How to use the trezor-connect.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 MyCryptoHQ / MyCrypto / common / v2 / services / WalletService / deterministic / trezor.ts View on Github external
import { Transaction as EthTx, TxData } from 'ethereumjs-tx';
import mapValues from 'lodash/mapValues';

import { translateRaw } from 'v2/translations';
import TrezorConnect from 'trezor-connect';
import { getTransactionFields } from 'v2/services/EthService';
import { stripHexPrefixAndLower, padLeftEven } from 'v2/services/EthService/utils';
import { HardwareWallet, ChainCodeResponse } from './hardware';

// read more: https://github.com/trezor/connect/blob/develop/docs/index.md#trezor-connect-manifest
TrezorConnect.manifest({
  email: 'support@mycrypto.com',
  appUrl: 'https://mycrypto.com/'
});

export class TrezorWallet extends HardwareWallet {
  public static getChainCode(dpath: string): Promise {
    return new Promise(resolve => {
      TrezorConnect.getPublicKey({
        path: dpath
      }).then((res: any) => {
        if (res.success) {
          resolve({
            publicKey: res.payload.publicKey,
            chainCode: res.payload.chainCode
          });
        } else {
github Mrtenz / FindETH / packages / web / src / wallets / Trezor.ts View on Github external
public async initialize(): Promise {
    TrezorConnect.manifest({
      email: 'maarten@zuidhoorn.com',
      appUrl: 'https://findeth.io'
    });

    this.cache = {};

    // Fetch a random address to ensure the connection works
    await this.getAddress(DEFAULT_ETH, 50);
  }
github MyEtherWallet / MyEtherWallet / src / wallets / hardware / trezor / index.js View on Github external
constructor() {
    Trezor.manifest({
      email: 'dev@myetherwallet.com',
      appUrl: 'https://www.myetherwallet.com'
    });

    this.identifier = trezorType;
    this.isHardware = true;
    this.needPassword = NEED_PASSWORD;
    this.supportedPaths = bip44Paths[trezorType];
  }
  async init(basePath) {
github MyEtherWallet / MyEtherWallet / src / wallets / hardware / trezor / index.js View on Github external
constructor() {
    Trezor.manifest({
      email: 'dev@myetherwallet.com',
      appUrl: 'https://www.myetherwallet.com'
    });

    this.identifier = trezorType;
    this.isHardware = true;
    this.needPassword = NEED_PASSWORD;
    this.supportedPaths = bip44Paths[trezorType];
  }
  async init(basePath) {
github tronscan / tronscan-frontend / src / hw / trezor / trezorAccess.jsx View on Github external
getAddress = async () => {

    TrezorConnect.manifest({
      email: 'dev@tronscan.org',
      appUrl: 'https://tronscan.org'
    });

    console.log("getting address!");
    try {
      let {payload, success} = await TrezorConnect.tronGetAddress({
        "path": "m/44'/195'/0'/0/0",
        "showOnTrezor": true
      });

      console.log("result",  {
        payload,
        success,
      });
github urbit / bridge / src / views / Login / Trezor.js View on Github external
async values => {
      TrezorConnect.manifest({
        email: 'bridge-trezor@urbit.org',
        appUrl: 'https://github.com/urbit/bridge',
      });

      const { success, payload } = await TrezorConnect.getPublicKey({
        path: values.hdPath,
      });

      if (!success) {
        return { [FORM_ERROR]: 'Failed to authenticate with your Trezor.' };
      }

      const publicKey = Buffer.from(payload.publicKey, 'hex');
      const chainCode = Buffer.from(payload.chainCode, 'hex');
      const pub = secp256k1.publicKeyConvert(publicKey, true);
      const hd = bip32.fromPublicKey(pub, chainCode);
github AugurProject / augur / packages / augur-ui / src / modules / auth / components / trezor-connect / trezor-connect.tsx View on Github external
import React, { Component } from "react";
import DerivationPath, { NUM_DERIVATION_PATHS_TO_DISPLAY } from "modules/auth/helpers/derivation-path";
import TrezorConnect, { DEVICE_EVENT, DEVICE } from "trezor-connect";
import HardwareWallet from "modules/auth/components/common/hardware-wallet";
import { TREZOR_MANIFEST_EMAIL, TREZOR_MANIFEST_APPURL } from "modules/common/constants";

TrezorConnect.manifest({
  email: TREZOR_MANIFEST_EMAIL,
  appUrl: TREZOR_MANIFEST_APPURL,
});

interface TrezorConnectWrapperProps {
  loginWithTrezor: Function;
  showAdvanced: boolean;
  showError: Function;
  hideError: Function;
  error: boolean;
  onSuccess: Function;
  setIsLoading: Function;
  setShowAdvancedButton: Function;
  isClicked: boolean;
  isLoading: boolean;
  logout: Function;
github AugurProject / augur-ui / src / modules / auth / components / trezor-connect / trezor-connect.jsx View on Github external
constructor(props) {
    super(props);

    this.connectWallet = this.connectWallet.bind(this);

    TrezorConnect.manifest({
      email: TREZOR_MANIFEST_EMAIL,
      appUrl: TREZOR_MANIFEST_APP
    });
  }
github urbit / bridge / src / views / Trezor.js View on Github external
async pollDevice() {
    const { setWallet, setWalletHdPath } = this.props;
    const { hdpath } = this.state;

    TrezorConnect.manifest({
      email: 'bridge-trezor@urbit.org',
      appUrl: 'https://github.com/urbit/bridge',
    });
    TrezorConnect.getPublicKey({ path: hdpath }).then(info => {
      if (info.success === true) {
        const payload = info.payload;
        const publicKey = Buffer.from(payload.publicKey, 'hex');
        const chainCode = Buffer.from(payload.chainCode, 'hex');
        const pub = secp256k1.publicKeyConvert(publicKey, true);
        const hd = bip32.fromPublicKey(pub, chainCode);
        setWallet(Maybe.Just(hd));
        setWalletHdPath(hdpath);
      } else {
        setWallet(Maybe.Nothing());
      }
    });
github AdExNetwork / adex-platform / src / services / smart-contracts / signers / trezor.js View on Github external
import { Signer, utils } from 'ethers'
import TrezorConnect from 'trezor-connect'
import { constants } from 'adex-models'

const DEFAULT_HD_PATH = "m/44'/60'/0'/0"

TrezorConnect.manifest({
	email: 'contactus@adex.network',
	appUrl: 'http://adex.network',
})

export default class TrezorSigner extends Signer {
	constructor(provider, opts = {}) {
		super()
		this._provider = provider
		this._path = opts.path || DEFAULT_HD_PATH
	}

	get path() {
		return this._path
	}
	get provider() {
		return this._provider