Set your transfer parameters
Before you can send tokens or messages, you'll need to set your parameters.
Now you're ready to set the parameters of your trade request.
Example: Swap 1 WETH from Ethereum network and receive axlUSDC on the Moonbeam network
const params = {
sourceChainId: 3, // Ropsten
sourceTokenAddress: '0xc778417E063141139Fce010982780140Aa0cD5Ab', // WETH on Ropsten
sourceAmount: '100000000000000000', // 0.1 WETH
destinationChainId: 1287, // Moonbase Alpha
destinationTokenAddress: '0xd1633f7fb3d716643125d6415d4177bc36b7186b', // axlUSDC on Moonmbeam
recipientAddress: '0x...',
slippage: 3 // 3 --> 3.00% slippage. SDK supports 2 decimals
Params are structured as aGetRoute object. A GetRoute object describes a desired any-to-any transfer. It is defined by the following interface:
Source Chain ID
Destination Chain ID
Address of the sending tokens
Address of the receiving tokens
Amount of tokens to be sent in WEI
The expected output address that will received the destination tokens
Route total slippage limit (0-1) (unsupported, default to 1)
Note that the same token type (i.e. USDC) often has a different address on each chain. Make sure you've checked the address is right for the chain you are sending from/to.

Sending/receiving native tokens

If you want to send or receive native tokens (i.e ETH), the sourceTokenAddress or destinationTokenAddress arguments must be set to 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
Once you have configured the params object, the next step is to get a route
Copy link