How to use the trezor-connect.default.ethereumSignTransaction 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 floating / frame / app / flex / trezor / index.js View on Github external
ethereumSignTransaction (path, transaction, cb) {
    TrezorConnect.ethereumSignTransaction({ device: this.device, path, transaction }).then(res => {
      if (!res.success) return cb(new Error(res.payload.error))
      cb(null, res.payload)
    }).catch(err => cb(err))
  }
github go-faast / faast-web / src / services / Trezor.ts View on Github external
signEthereumTx(
    derivationPath: string,
    tx: {
      to: string,
      value: string | number,
      gasPrice: string | number,
      gas: string | number,
      nonce: string | number,
      data?: string,
      chainId?: number,
    },
  ): Promise {
    const { to, value, gas, gasPrice, nonce, data, chainId } = tx
    return TrezorConnect.ethereumSignTransaction(log.debugInline('TrezorConnect.ethereumSignTransaction', {
      path: derivationPath,
      transaction: {
        to,
        value: toHex(value),
        gasLimit: toHex(gas),
        gasPrice: toHex(gasPrice),
        nonce: toHex(nonce),
        data,
        chainId,
      },
    })).then(handleResult)
  }
github rate-engineering / rate3-monorepo / packages / wallet / Trezor.js View on Github external
async signTransaction(path, networkPassphrase, transaction) {
    let result;
    const paramsStellar = { path, networkPassphrase, transaction };
    const paramsEthereum = { path, transaction };
    if (this.currency === 'ethereum') {
      result = await TrezorConnect.ethereumSignTransaction(paramsEthereum);
    } else {
      result = await TrezorConnect.stellarSignTransaction(paramsStellar);
    }
    return result;
  }