You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

EverWallet sendMessage参数数量不匹配错误原因咨询

错误原因分析:everwallet sendMessage: Parameter count mismatch

这个错误的核心是你调用sendMessage时的参数传递方式不符合EverWallet接口要求:

  • EverWallet的rawApi.sendMessage接口不接收单个配置对象作为参数,而是需要逐个传入独立参数。
  • 你当前把所有参数打包成一个对象传递,相当于只传了1个参数,但接口期望多个独立参数,因此触发了「参数数量不匹配」的错误。

修正后的代码示例

public async getEverWalletTransaction(
    recipient: string,
    price: any,
    payload: any,
  ): Promise<string> {
    console.log(this.wallet.address);
    console.log(recipient);
    console.log(price.toString());
    console.log(payload);
    // 改为逐个传入参数,最后一个是包含bounce、payload的配置对象
    const { transaction } = await this.ton.rawApi.sendMessage(
      this.wallet.address,
      recipient,
      price.toString(),
      { bounce: true, payload }
    );

    return transaction.id.hash;
  }

关键说明

  • sendMessage的标准参数顺序为:sender(字符串)、recipient(字符串)、amount(字符串),最后是可选的配置对象(包含bounce、payload等属性)。
  • 严格按照这个参数结构传递,就能解决参数数量不匹配的问题。

内容的提问来源于stack exchange,提问作者Стас Рябцев

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.12 02:50:39