20 WalletConnect-TRON 怎么签署转账交易

看了下波场官方文档,有提示 WalletConnect 怎么连接TRON,但是想发起转账,发现没效果,一直提示错误。

https://cn.developers.tron.network/docs/walletconnect-tron

试了以下两种方式没无法调用TRX转账,报错: {"code":5201,"message":"Unknown method(s) requested"}

var tronTransaction = await this.tronWeb.transactionBuilder.sendTrx(toAddress, toNum, fromAddress);

const signedTransaction = await this.wallet.signTransaction(tronTransaction);

const broadcastResult = await this.tronWeb.trx.sendRawTransaction(signedTransaction);

const tronTransaction = {
  to: toAddress,
  amount: toNum, // The amount in SUN (smallest unit of TRX)
  tokenID: '', // Token ID (if you are transferring TRC-20 tokens)
  data: '', // Additional data (if needed)
};

const signedTransaction = await this.wallet.signTransaction(tronTransaction);

const broadcastResult = await this.tronWeb.trx.sendRawTransaction(signedTransaction);

360截图17040515244257.png

请先 登录 后评论

最佳答案 2023-07-27 22:42

已解决

请先 登录 后评论

其它 1 个回答

鬼才链(v+transbsc)
请先 登录 后评论
  • 1 关注
  • 0 收藏,1985 浏览
  • 提出于 2023-07-26 21:32