Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

makerdao/dai-plugin-trezor-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •