tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
388 stars 259 forks source link

tronweb has no permission to sign error when sign transaction with multisig #525

Closed arlong87 closed 3 weeks ago

arlong87 commented 3 weeks ago

One user add my address and add all permissions. https://nile.tronscan.org/#/address/TRuyvihAEe3YVPwjG1p8uVLAZroLmV3Lyt/permissions

I use this code to send energy from that account to another account:


var tradeobj = await tronWeb.transactionBuilder.sendTrx('TWhZ7SDk11Tzb2tw5aBbH68VQBBYnABc58',10000000,'TRuyvihAEe3YVPwjG1p8uVLAZroLmV3Lyt');
const signedtxn = await tronWeb.trx.multiSign(tradeobj,'e0bfd7d228db4a6329c6829783e87dc44b73e359d693dfcb368809023bec5c7c',2);  //TFLBdVmRNSGGH4Tb6JdbSaLjNws7a5MFtk private key
const tx = await tronWeb.trx.sendRawTransaction(signedtxn);
console.log(tx);

But I get error: Error: e0bfd7d228db4a6329c6829783e87dc44b73e359d693dfcb368809023bec5c7c has no permission to sign

I did not see any problem in sharing the private key, I do on nile testnet.

ferdinand026 commented 3 weeks ago

@arlong87 Maybe you should set a permissionID for the transaction, please refer to this guide: https://developers.tron.network/docs/multi-signature-example-process-flow#3-select-permission-and-create-transaction

arlong87 commented 3 weeks ago

thank you, its worked.