Swap Overview

The '@karrotcapital/spiderswap' package offers a suite of functions to facilitate token swaps and transaction management on the Solana blockchain. Here is an overview of the four main functions provided by the package:

Functions

1. 'getSwapRaw'

Fetches raw swap data from the SpiderSwap API. This function is essential for retrieving detailed swap information required for executing token swaps.

Learn more about 'getSwapRaw'

2. 'getSwap'

Simplifies the process of fetching swap data by converting the amount to lamports and slippage to basis points before making the API call. This function provides an easy-to-use interface for obtaining swap data.

Learn more about 'getSwap'

3. 'createTransaction'

Creates a Solana transaction from a base64-encoded string containing the swap transaction data. This function is used to prepare transactions for submission to the blockchain.

Learn more about 'createTransaction'

4. 'sendTransaction'

Sends a Solana transaction to the blockchain, handling retries and confirmation. This function is crucial for ensuring that transactions are successfully broadcasted and confirmed on the network.

Learn more about 'sendTransaction'

These functions provide a comprehensive toolkit for developers to interact with the SpiderSwap API and manage token swaps efficiently. For detailed documentation and examples, refer to the respective function pages linked above.

Last updated