Asks device to sign given transaction. User is asked to confirm all transaction details on Trezor.
ES6
const result = await TrezorConnect.stellarSignTransaction(params);CommonJS
TrezorConnect.stellarSignTransaction(params).then(function(result) {
});path— obligatorystring | Array<number>minimum length is3. read morenetworkPassphrase- obligatorystringnetwork passphrasetransaction- obligatoryObjecttype of StellarTransaction
stellar-sdk is not a part of trezor-connect repository.
To transform StellarSDK.Transaction object into TrezorConnect.StellarTransaction object copy this plugin into your project.
import StellarSDK from 'stellar-sdk';
import transformTrezorTransaction from '<path-to-plugin>/index.js';
const tx = new StellarSdk.TransactionBuilder(...);
...
tx.build();
const params = transformTrezorTransaction(tx);
const result = TrezorConnect.stellarSignTransaction(params);
if (result.success) {
tx.addSignature('account-public-key', result.payload.signature);
}TrezorConnect.stellarSignTransaction(
path: "m/44'/148'/0'",
networkPassphrase: "Test SDF Network ; September 2015",
transaction: {
source: "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
fee: 100,
sequence: 4294967296,
memo: {
type: 0,
},
operations: [
{
type: "payment",
source: "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
destination: "GAXSFOOGF4ELO5HT5PTN23T5XE6D5QWL3YBHSVQ2HWOFEJNYYMRJENBV",
amount: "10000"
}
]
}
});{
success: true,
payload: {
publicKey: string,
signature: string,
}
}Error
{
success: false,
payload: {
error: string // error message
}
}