5 starkjs调用getSuggestedMaxFee报错

具体代码如下 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 之后的参数

image.png

报错信息:

image.png

求大佬指点迷津

请先 登录 后评论

1 个回答

Tiny熊
  擅长:智能合约,以太坊
请先 登录 后评论
  • 1 关注
  • 0 收藏,2596 浏览
  • Ss 提出于 2023-08-16 01:19