Asks device to sign given transaction. User is asked to confirm all transaction details on OneKey.
const response = await HardwareSDK.tronSignTransaction(connectId, deviceId, params)
type TronTransaction = {
refBlockBytes: string;
refBlockHash: string;
expiration: number;
data?: string;
contract: TronTransactionContract;
timestamp: number;
feeLimit?: number;
};
type TronTransactionContract = {
transferContract?: TronTransferContract;
triggerSmartContract?: TronTriggerSmartContract;
};
type TronTransferContract = {
toAddress?: string;
amount?: UintType;
};
type TronTriggerSmartContract = {
contractAddress?: string;
callValue?: number;
data?: string;
callTokenValue?: number;
assetId?: number;
};
HardwareSDK.tronSignTransaction(connectId, deviceId, {
path: "m/44'/195'/0'/0'/0",
transaction: {
refBlockBytes: 'ddf1',
refBlockHash: 'd04764f22469a0b8',
timestamp: 1655692083406,
expiration: 1655692140000,
contract: {
transferContract: {
toAddress: 'TXrs7yxQLNzig7J9EbKhoEiUp6kWpdWKnD',
amount: 100,
},
}
}
});
{
success: true,
payload: {
signature: string;
serialized_tx: string;
}
}
{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}