具体代码如下 myAddress在发帖的时候修改成假的了
const myAddress = "0x007d23AcAddddff68a9eB7771a1B431dc2128C0684AEf0037xxxxBa97e43xxxx";
const amountIn = 1*1000000;
let now = new Date();
let day = now.getDate() + 2;
now.setDate(day);
const timestamp = Math.floor(now / 1000);
const myCall2 = {
contractAddress: this.starkJson.tenK.address,
entrypoint: "swapExactTokensForTokens",
calldata: CallData.compile({
amountIn: cairo.uint256(amountIn),
amountOutMin: cairo.uint256(price),
path: tokenArr,
to: cairo.felt(myAddress),
deadline: cairo.felt(timestamp),
}),
}
// const calls = [myCall1, myCall2]
const maxFee = await account.getSuggestedMaxFee({ type: TransactionType.INVOKE, payload: myCall2 });
console.log("fee:" + maxFee)
callData.compile 之后的参数
报错信息:
求大佬指点迷津