Javascript SDK
These docs are under active development as we iterate based on our partners' feedback
The Chainflip SDK provides a simple and efficient way for developers to interact with the Chainflip protocol, making it easy to build powerful and user-friendly applications.
In this guide we'll explain how to:
- Get chains & assets: Use the
getChains
andgetAssets
methods to retrieve information about the available chains and their respective assets. - Get quotes: The
getQuote
method provides a quote for a proposed swap. This includes details like the source and destination chains, the tokens involved, and the expected exchange rate and fees. - Swap assets: There are two main ways to swap assets, depending on the source chain and/or the specific use case:
- Request a regular or boostable deposit address: The
requestDepositAddress
method provides a deposit address where the user can send the source tokens to be swapped. Funds need to be sent to initiate the swap. The swapped tokens will be sent to the destination address provided. - Execute swap call: Alternatively, the
executeSwap
method triggers the swap by calling theswap()
function in the Chainflip Vault directly (EVM only for now). The swapped tokens will be sent to the destination address provided.
- Request a regular or boostable deposit address: The
- Get status: The
getStatus
method provides real-time updates about the status of a swap operation.
If you want to learn more, check the Native Swap Flow documentation
Support
If you are experiencing issues with the SDK, please go to the #integration-docs channel in Discord for assistance. Not in Discord yet? Join us (opens in a new tab).