GithubHelp home page GithubHelp logo

isabella232 / dai-plugin-trezor-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from makerdao/dai-plugin-trezor-web

0.0 0.0 0.0 280 KB

Plugin for using Trezor with dai.js in a browser environment.

License: MIT License

Shell 4.13% JavaScript 95.87%

dai-plugin-trezor-web's Introduction

dai-plugin-trezor-web

A Dai.js plugin for using Trezor in a browser environment.

Example usage

import TrezorPlugin from '@makerdao/dai-plugin-trezor-web';
import Maker from '@makerdao/dai';

// this will trigger the Trezor popup immediately
const maker = await Maker.create('http', {
  plugins: [TrezorPlugin],
  accounts: {
    // derivation path can be omitted; the default value is shown
    myTrezor1: { type: 'trezor', path: "44'/60'/0'/0/0" }
  }
});

// this will not resolve until the Trezor user interaction is complete
await maker.authenticate();

// or you can defer showing the Trezor popup until later
await maker.addAccount('myTrezor2', { type: 'trezor' };

Options

  • accountsLength: Set this to the number of accounts to fetch. Must also set choose if greater than 1; see below. (Default: 1)
  • accountsOffset: Set this to the index offset number to fetch accounts from (Default: 0)
  • path: Set this to the derivation path to use. (Default: "44'/60'/0'/0/0")
  • networkId

Try the demo app

You can find an example of this plugin being used in an app at this repo.

Publishing to NPM

yarn
// version bump on package.json
yarn build
cd /dist
npm publish

dai-plugin-trezor-web's People

Contributors

adrianleb avatar dependabot[bot] avatar levity avatar tyler17 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.