How to use the trezor-connect.default.signTransaction function in trezor-connect

To help you get started, we’ve selected a few trezor-connect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unchained-capital / unchained-wallets / src / trezor.js View on Github external
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;
  }
github go-faast / faast-web / src / services / Trezor.ts View on Github external
signTx(assetSymbol: string, inputs: Input[], outputs: Output[]): Promise {
    return TrezorConnect.signTransaction(log.debugInline('TrezorConnect.signTransaction', {
      coin: assetSymbol.toLowerCase(),
      inputs,
      outputs,
    })).then(handleResult)
  }