This simple frontend demo app uses axelarjs-sdk to enable a user to transfer AXL tokens from Axelar to Avalanche.
This demo performs one task: call axelarJsSDK.getDepositAddress
to request a one-time deposit address A
from the Axelar network and present A
to the user. (From here, the user may send AXL tokens to A
on the Axelar blockchain. Any user who does this will soon see wrapped Axelar tokens appear in her Avalanche wallet.)
Refer to axelarjs-sdk for code snippets on SDK setup, instantiation, and invokation. Those code snippets are incorporated into this demo as follows:
AxelarApi.js
App.js
Configure your Metamask as per Set up Metamask for EVM chains | Axelar Docs:
Clone this repo, install axelarjs-sdk, and run the server
git clone git@github.com:axelarnetwork/deposit-address-demo.git
cd deposit-address-demo
npm i --save @axelar-network/axelarjs-sdk
npm start
Your browser should open automatically to URL http://localhost:3000/
and display the following
Metamask should automatically appear. You'll be asked to connect Metamask to http://localhost:3000/
. (If Metamask is locked then you first need to unlock it using your Metamask password.)
Select the account you wish to connect with Metamask.
This Metamask account is the Avalanche testnet account to which you will send AXL tokens.
Click "next" then "connect" in Metamask.
Click the text "Click here to generate a link address..." in the demo. Metamask will appear again, asking you to sign a one-time code.
Click "sign" in Metamask.
After a few seconds you should see the following
The demo is now complete.
Send AXL testnet tokens to the one-time deposit address axelar1...
. One way to do this is visit Axelar Testnet Faucet. (The minimum transfer amount is 10 AXL. You may need to use the faucet multiple times to accumulate enough AXL in your one-time deposit address.)
Check the balance of your one-time deposit address at Axelarscan testnet explorer
The Axelar network microservices will automatically transfer AXL tokens from your one-time address to your Metamask Avalanche testnet account.
Wait a few minutes. Then check the "Axelar (AXL)" ERC20 token balance of your Metamask Avalanche testnet account at SnowTrace: Avalanche Testnet C-Chain Blockchain Explorer