π¦Transfer tokens to Moonbeam Parachain using Squid SDK from any EVM chain
How to leverage Squid router to teleport easily tokens to Moonbeam parachain, the EVM gateway of the Polkadot's ecosystem
As explained in the previous sections, the flow will start on the source chain. For instance, let's say we'll do a cross-chain transaction from MATIC to Moonbeam. The flow will be handled by Squid router, using their SDK v2 leveraging IBC across chains.
A signer, aka the user, will start the process by signing a transaction, in our example he'll call the CALL_BRIDGE_CALL
function of the Squid router adress on the Source chain.
The router can change its address so it's important to check the Squid documentation to get the latest address available.
As of December 23, you'll find these smart contracts at the following addresses:
Mainnet
SquidRouter
SquidMulticall
Testnet
SquidRouter
0xC3468a191Fe51815b26535ED1F82C1f79e6Ec37D
SquidMulticall
0x7a4F2BCdDf68C98202cbad13c4f3a04FF2405681
In order to execute the cross-chain transaction, Axelar General Message Passing protocol need a call properly forged containing all the required data. This is what we call a route in Squid API/SDK. To get a route that suits us, in our example a MATIC to GLMR swap, we can leverage both the Squid API and SDK. Let's see how both solutions are working.
Obtain an integrator-id to build with Squid
To get an integrator-id, you'll need to fill a quick form about yourself and your project. It literally takes 5mn and it's mandatory to make the calls work, so everything starts with this link.
Get a route using the Squid SDK
Initiate the SDK
Forge the route request parameters
fromAddress should be equal to msg.sender later in the transaction
fromChain and toChain should be chain IDs a String
fromAmount and toAmount should be formatted numbers with the appropriate decimals as String
Get a route using the Squid API
Initiate the API
Forge the route request
Example Route Request parameters (from 1 MATIC to GLMR)
Note: 0xEEeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
is used for native tokens
Currently available tokens on Moonbeam as destination chain
GLMR
xcDOT
Wormhole assets
USDC
BTC
ETH
Last updated