看了下波场官方文档,有提示 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);