Closed Adw8 closed 5 months ago
Hey @Adw8, Apologies for the delay here. I saw your Discord messages and realized they differ from this question. I have flagged this internally with the team to confirm if the recent updates to Testnet is yet to be made for Devnet.
I'm curious why you wanted to use DEVNET, not Testnet or Axelar local development, with the Axelar Example repository we created for developers to test multichain development.
I would love to hear your thoughts.
Friendly bump here ^ @Adw8
Hello, I am trying to use the
sendToken
method from Axelarjs-sdk to sendaUSDC
tokens between chains. The code for doing this in a testnet environment is available on the docs. I have changed the environment fromEnvironment.TESTNET
toEnvironment.DEVNET
, and I am trying to do a token transfer from Avalanche Fuji to Ethereum-Sepolia. I am running into the following error.Steps to reproduce
USDC
andAVAX
tokens in your walletconst { ethers } = require("ethers");
const { getEvmSigner } = require("./utils");
const api = new AxelarAssetTransfer({ environment: Environment.DEVNET });
// add values const DESTINATION_ADDRESS = ""; const TOKEN = "aUSDC"; const AMOUNT = "100000"; const PRIVATE_KEY = "";
const test = async () => { const provider = new ethers.providers.JsonRpcProvider("https://avalanche-fuji-c-chain-rpc.publicnode.com/"); const evmSigner = getEvmSigner(PRIVATE_KEY).connect(provider); const requestOptions = { fromChain: CHAINS.TESTNET.AVALANCHE, toChain: CHAINS.TESTNET.SEPOLIA, destinationAddress: DESTINATION_ADDRESS, asset: { symbol: TOKEN }, amountInAtomicUnits: AMOUNT, options: { evmOptions: { signer: evmSigner, provider, approveSendForMe: true, }, }, }; console.log("Sending tokens..."); console.log("address is", await evmSigner.getAddress()); // console.log("balance is", await evmSigner.getBalance()); return api.sendToken(requestOptions); };
test().then((transaction) => { console.log(transaction); });
adwait@vivobook-m1603qa:~/projects/ds-repos/axelar-dev/src$ node devnet-transfer.js
Sending tokens...
/home/adwait/projects/ds-repos/axelar-dev/node_modules/@axelar-network/axelarjs-sdk/dist/src/utils/validateChain.js:46 throw new Error(
Invalid chain identifier for ${chains[i]}. Did you mean ${validations[i].bestMatch}?
); ^Error: Invalid chain identifier for ethereum-sepolia. Did you mean ethereum? at /home/adwait/projects/ds-repos/axelar-dev/node_modules/@axelar-network/axelarjs-sdk/dist/src/utils/validateChain.js:46:23 at Generator.next ()
at fulfilled (/home/adwait/projects/ds-repos/axelar-dev/node_modules/@axelar-network/axelarjs-sdk/dist/src/utils/validateChain.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v18.20.1
toChain: CHAINS.MAINNET.ETHEREUM,
/home/adwait/projects/ds-repos/axelar-dev/node_modules/@axelar-network/axelarjs-sdk/dist/src/libs/AxelarAssetTransfer.js:153 throw new Error("cannot find chain" + fromChain); ^
Error: cannot find chainAvalanche at AxelarAssetTransfer. (/home/adwait/projects/ds-repos/axelar-dev/node_modules/@axelar-network/axelarjs-sdk/dist/src/libs/AxelarAssetTransfer.js:153:23)
at Generator.next ()
at fulfilled (/home/adwait/projects/ds-repos/axelar-dev/node_modules/@axelar-network/axelarjs-sdk/dist/src/libs/AxelarAssetTransfer.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)