Swap Overview
Last updated
Last updated
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:
'get_swap_raw'
Fetches raw swap data from the SpiderSwap API. This function is essential for retrieving detailed swap information required for executing token swaps.
'get_swap'
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.
'create_transaction'
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.
'send_transaction'
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.
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.