JavaScript SDK
These docs are under active development as we iterate based on our partners' feedback
The Chainflip SDK provides a simple way for JavaScript/TypeScript developers to interact with the Chainflip protocol. 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 the expected exchange rate, expected fees and expected duration. - Swap assets: There are two ways to initiate a swap on Chainflip:
- Request a deposit address: The
requestDepositAddress
method generates a deposit address on the source chain. The user sends funds to this address to initiate a swap. - Trigger a vault swap: The
encodeVaultSwapData
method returns an unsigned transaction that encodes the details of the swap. The user signs and submits this transaction to initiate the swap.
- Request a 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 about how Chainflip swaps work, check the Swapping Basics section
Support
If you are experiencing issues with the SDK, visit the #technical-discussion channel in Discord for assistance. Not in Discord yet? Join us (opens in a new tab).