Provider API

连接账户

NaboxWallet.tronLink.request({ method: 'tron_requestAccounts' });

tronWeb

具体api方法参考tronWeb官方文档arrow-up-right

签名交易和广播交易

const tronProvider = NaboxWallet.tronLink.tronWeb;
const transaction = await tronProvider.transactionBuilder.triggerSmartContract('toAddress', 'functionName', options, parameter, 'fromAddress');
// 签名交易
const signedTx = await tronProvider.trx.sign(transaction.transaction);
// 广播交易
const res = await tronProvider.trx.sendRawTransaction(signedTransaction);

signMessage(消息签名)

const tronProvider = NaboxWallet.tronLink.tronWeb;
const message = 'message'; // 签名的消息
const result = await tronProvider.trx.sign(message);

事件

TRON链的事件监听和其他链不同,通过监听message实现

Last updated