ethereumblockchainaxelar

Post 400 Error When Trying To Generate DepositAddress


I am trying to use the getDepositAddress from the AxelarJS Sdk. As referenced here

const fromChain = CHAINS.TESTNET.POLYGON,
   toChain = CHAINS.TESTNET.AVALANCHE,
   destinationAddress = "0xF16DfB26e1FEc993E085092563ECFAEaDa7eD7fD",
   thisAsset = "wavax-wei";

 const depositAddress = await axelarAssetTransfer.getDepositAddress({
   fromChain,
   toChain,
   destinationAddress,
   thisAsset,
   options: {
     shouldUnwrapIntoNative: false,
   },
 });
 console.log(depositAddress);

This is the code I use on the frontend but the error in the picture is what pops up in the console browser.

enter image description here


Solution

  • Thank you for this. I got it working. I think the issue was that I was using a newer version of Nextjs and Rainbowkit/Wagmi and I do receive an error but finally receive the deposit address