Tron: sign transaction
Sign a given Tron transaction on device. User will be asked to confirm transaction details on Trezor. The API is compatible with TronWeb transaction object.
Currently supported contract types:
TransferContractTriggerSmartContractFreezeBalanceV2ContractUnfreezeBalanceV2ContractWithdrawExpireUnfreezeContract
const result = await TrezorConnect.tronSignTransaction(params);Params
TronSignTransaction
path
String | Array<Number>
minimum length is 5. read more
ref_block_bytes
String
last 4 bytes of the reference block height, in hex format
ref_block_hash
String
8th to 16th(exclusive) bytes of the reference block hash(ID), in hex format
expiration
Number
expiration time of the transaction which should be no more than 1 day. The unit is milliseconds
timestamp
Number
timestamp of the transaction. The unit is milliseconds
fee_limit
Number
maximum fee to consume in a contract related transaction. The unit is sun (1 TRX = 1000000 sun)
data
String
optional transaction memo
or
or
or
Example
Use TransferContract to send a TRX transfer
const { signature } = await TrezorConnect.tronSignTransaction({
path: "m/44'/195'/0'/0/0",
ref_block_bytes: 'e942',
ref_block_hash: '6394747da9fee421',
expiration: 1752562632000,
timestamp: 1752562572000,
fee_limit: 10000000,
contract: [
{
type: 'TransferContract',
parameter: {
value: {
owner_address: '41f2cd810c48c401d392ead3c6e1e1cb9f57750a58',
to_address: '4141f82674a30ae1328745d08afe2d1a0a24195283',
amount: 18123456,
},
},
},
],
});Use TronWeb to create the transaction object
const transaction = await tronWeb.transactionBuilder.sendTrx(
'TVDGpn4hCSzJ5nkHPLetk8KQBtwaTppnkr',
100,
'TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL',
);
const result = await TrezorConnect.tronSignTransaction({
path: "m/44'/195'/0'/0/0",
...transaction.raw_data,
});
const sent = await tronWeb.trx.sendRawTransaction({
...transaction.raw_data,
signature: [result.payload.signature],
});Result
{
success: true,
payload: {
signature: string, // signed transaction in hex format
}
}Error
{
success: false,
payload: {
error: string // error message
}
}