How to use the trezor-connect.default.manifest 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 go-faast / faast-web / src / services / Trezor.ts View on Github external
} from 'Utilities/bitcoin'
import { toHex } from 'Utilities/convert'
import { PaymentTx } from 'Services/Bitcore'
import { HdAccount } from 'Types'
import { AddressFormat } from 'Utilities/addressFormat'
import { bchCashAddrFormat } from 'Utilities/addressFormat/assets/BCH'

export {
  Input as TrezorInput,
  Output as TrezorOutput,
  PublicKey as TrezorPublicKey,
  SignedTransaction as TrezorSignedTransaction,
  EthereumSignedTransaction as TrezorEthereumSignedTransaction,
}

TrezorConnect.manifest({
  email: 'dev@faa.st',
  appUrl: 'https://faa.st/app',
})

const requiredAddressFormats: { [symbol: string]: AddressFormat } = {
  BCH: bchCashAddrFormat,
}

export function convertAddressFormat(assetSymbol: string, address: string): string {
  const format = requiredAddressFormats[assetSymbol]
  if (format) {
    return format.convert(address)
  }
  return address
}
github unchained-capital / unchained-wallets / src / trezor.js View on Github external
multisigAddressType,
  MULTISIG_ADDRESS_TYPES,
} from "unchained-bitcoin";

import {
  WalletInteraction,
  PENDING,
  ACTIVE,
  INFO,
  ERROR,
  WARNING,
} from "./interaction";

const TrezorConnect = require("trezor-connect").default;

TrezorConnect.manifest({email: "foo@bar.com", appUrl: "https://localhost:3000"});

/**
 * Interaction with Trezor hardware wallets
 * @extends {module:interaction.WalletInteraction}
 */
export class TrezorInteraction extends WalletInteraction {

  /**
   * @param {object} options
   * @param {string} options.network - bitcoin network
   */
  constructor({network}) {
    super({network});
    this.trezorCoin = coin(network);
  }