Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async run() {
const trezorInputs = this.inputs.map((input, inputIndex) => trezorInput(input, this.bip32Paths[inputIndex]));
const trezorOutputs = this.outputs.map((output) => trezorOutput(output));
const transaction = {
inputs: trezorInputs,
outputs: trezorOutputs,
coin: coin(this.network),
};
const result = await TrezorConnect.signTransaction(transaction);
if (!result.success) {
throw new Error(result.payload.error);
}
return result.payload.signatures;
}
signTx(assetSymbol: string, inputs: Input[], outputs: Output[]): Promise {
return TrezorConnect.signTransaction(log.debugInline('TrezorConnect.signTransaction', {
coin: assetSymbol.toLowerCase(),
inputs,
outputs,
})).then(handleResult)
}