英文:
Post 400 Error When Trying To Generate DepositAddress
问题
我正在尝试使用AxelarJS SDK中的getDepositAddress
。如在此处引用的那样:
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);
这是我在前端使用的代码,但图片中的错误是在浏览器控制台中弹出的。
英文:
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.
答案1
得分: 1
看起来您收到了一个错误,因为未将预期的字段传递给获取存款地址函数,或者传递的字段不正确。
您所做的是:
const depositAddress = await axelarAssetTransfer.getDepositAddress({
fromChain,
toChain,
destinationAddress,
thisAsset,
options: {
shouldUnwrapIntoNative: false,
},
});
而不是
const depositAddress = await axelarAssetTransfer.getDepositAddress({
fromChain,
toChain,
destinationAddress,
asset: thisAsset,
options: {
shouldUnwrapIntoNative: false,
},
});
您提供给 asset
的键不正确。希望这可以帮助!
英文:
It seems you received an error because the expected field was not passed into the get deposit address function or was incorrect.
What you did was:
const depositAddress = await axelarAssetTransfer.getDepositAddress({
fromChain,
toChain,
destinationAddress,
thisAsset,
options: {
shouldUnwrapIntoNative: false,
},
});
Instead of
const depositAddress = await axelarAssetTransfer.getDepositAddress({
fromChain,
toChain,
destinationAddress,
asset: thisAsset,
options: {
shouldUnwrapIntoNative: false,
},
});
The key you provided for the asset
was incorrect. I hope this helps!
答案2
得分: 0
谢谢你。我已经解决了。我认为问题是因为我使用了较新版本的Nextjs和Rainbowkit/Wagmi,我确实收到了一个错误,但最终收到了存款地址。
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论