trezor-link
Trezor Link
Last updated 3 years ago by karelbilek .
LGPL-3.0+ · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install trezor-link 
SYNC missed versions from official npm registry.

trezor-link

Build Status gitter

Library for low-level communication with TREZOR.

Intended as a "building block" for other packages - it is used in trezor.js and chrome extension.

You probably don't want to use this package directly. For communication with Trezor with a more high-level API, use trezor.js.

How to use

Use like this:

var Link = require('trezor-link');
var LowlevelTransport = Link.Lowlevel;
var NodeHidPlugin = Link.NodeHid;

var link = new LowlevelTransport(new NodeHidPlugin());

var config = fetch('https://wallet.mytrezor.com/data/config_signed.bin').then(function (response) {
  if (response.ok) {
    return response.text();
  } else {
    throw new Error(`Fetch error ${response.status}`);
  }
});

return link.init().then(function () { 
  return config.then(function (configData) {
    return link.configure(configData);
  });
}).then(function () {
  return link.enumerate();
}).then(function (devices) {
  return link.acquire(devices[0].path);
}).then(function (session) {
  return link.call(session, 'GetFeatures', {}).then(function (features) {
    console.log(features);
    return link.release(session);
  });
}).catch(function (error) {
  console.error(error);
});

Notes

Source is annotated with Flow types, so it's more obvious what is going on from source code.

Flow

If you want to use flow for typechecking, just include the file as normally, it will automatically use the included flow file. However, you need to add flowtype/*.js to your [libs] (or copy it yourself from flow-typed repository), and probably libs from flowconfig.

License

LGPLv3

Current Tags

  • 1.6.0-bridge-fallback.2                                ...           bridge-fallback (19 hours ago)
  • 1.6.5                                ...           latest (a month ago)

205 Versions

  • 1.6.0-bridge-fallback.2                                ...           19 hours ago
  • 1.6.0-bridge-fallback.1                                ...           5 days ago
  • 1.6.5                                ...           a month ago
  • 1.6.4                                ...           2 months ago
  • 1.6.3                                ...           2 months ago
  • 1.6.2                                ...           2 months ago
  • 1.6.1                                ...           8 months ago
  • 1.6.0                                ...           a year ago
  • 1.5.3-experiment4                                ...           a year ago
  • 1.5.3-experiment2                                ...           a year ago
  • 1.5.3-experiment                                ...           a year ago
  • 1.5.5                                ...           a year ago
  • 1.5.2                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.8                                ...           2 years ago
  • 1.3.7                                ...           2 years ago
  • 1.3.6                                ...           2 years ago
  • 1.3.5                                ...           2 years ago
  • 1.3.4                                ...           2 years ago
  • 1.3.3                                ...           2 years ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0-webenumerate.3                                ...           2 years ago
  • 1.3.0-webenumerate.2                                ...           2 years ago
  • 1.3.0-webenumerate.1                                ...           2 years ago
  • 1.3.3-0                                ...           2 years ago
  • 1.3.2-0                                ...           2 years ago
  • 1.3.1-0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.5                                ...           2 years ago
  • 1.1.4                                ...           2 years ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.9-7                                ...           2 years ago
  • 1.0.9-6                                ...           2 years ago
  • 1.0.9-5                                ...           2 years ago
  • 1.0.9-4                                ...           2 years ago
  • 1.0.9-3                                ...           2 years ago
  • 1.0.9-2                                ...           2 years ago
  • 1.0.9-1                                ...           2 years ago
  • 1.0.9-0                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.2.114                                ...           2 years ago
  • 1.0.0-alpha.10                                ...           2 years ago
  • 1.0.0-alpha.9                                ...           2 years ago
  • 1.0.0-alpha.8                                ...           2 years ago
  • 1.0.0-alpha.7                                ...           2 years ago
  • 1.0.0-alpha.6                                ...           2 years ago
  • 1.0.0-alpha.5                                ...           2 years ago
  • 1.0.0-alpha.4                                ...           2 years ago
  • 1.0.0-alpha.3                                ...           2 years ago
  • 1.0.0-alpha.2                                ...           2 years ago
  • 1.0.0-alpha.1                                ...           2 years ago
  • 1.0.0-alpha.0                                ...           2 years ago
  • 0.2.113                                ...           2 years ago
  • 0.2.112                                ...           2 years ago
  • 0.2.111                                ...           2 years ago
  • 0.2.110                                ...           2 years ago
  • 0.2.109                                ...           2 years ago
  • 0.2.108                                ...           2 years ago
  • 0.2.107                                ...           2 years ago
  • 0.2.106                                ...           2 years ago
  • 0.2.105                                ...           2 years ago
  • 0.2.103                                ...           3 years ago
  • 0.2.102                                ...           3 years ago
  • 0.2.101                                ...           3 years ago
  • 0.2.100                                ...           3 years ago
  • 0.2.99                                ...           3 years ago
  • 0.2.98                                ...           3 years ago
  • 0.2.97                                ...           3 years ago
  • 0.2.96                                ...           3 years ago
  • 0.2.95                                ...           3 years ago
  • 0.2.94                                ...           3 years ago
  • 0.2.93                                ...           3 years ago
  • 0.2.92                                ...           3 years ago
  • 0.2.91                                ...           3 years ago
  • 0.2.90                                ...           3 years ago
  • 0.2.89                                ...           3 years ago
  • 0.2.88                                ...           3 years ago
  • 0.2.87                                ...           3 years ago
  • 0.2.86                                ...           3 years ago
  • 0.2.85                                ...           3 years ago
  • 0.2.84                                ...           3 years ago
  • 0.2.83                                ...           3 years ago
  • 0.2.82                                ...           3 years ago
  • 0.2.81                                ...           3 years ago
  • 0.2.80                                ...           3 years ago
  • 0.2.79                                ...           3 years ago
  • 0.2.78                                ...           3 years ago
  • 0.2.77                                ...           3 years ago
  • 0.2.76                                ...           3 years ago
  • 0.2.75                                ...           3 years ago
  • 0.2.74                                ...           3 years ago
  • 0.2.73                                ...           3 years ago
  • 0.2.71                                ...           3 years ago
  • 0.2.70                                ...           3 years ago
  • 0.2.69                                ...           3 years ago
  • 0.2.68                                ...           3 years ago
  • 0.2.67                                ...           3 years ago
  • 0.2.66                                ...           3 years ago
  • 0.2.65                                ...           3 years ago
  • 0.2.64                                ...           3 years ago
  • 0.2.63                                ...           3 years ago
  • 0.2.62                                ...           3 years ago
  • 0.2.61                                ...           3 years ago
  • 0.2.60                                ...           3 years ago
  • 0.2.59                                ...           3 years ago
  • 0.2.58                                ...           3 years ago
  • 0.2.57                                ...           3 years ago
  • 0.2.56                                ...           3 years ago
  • 0.2.55                                ...           3 years ago
  • 0.2.54                                ...           3 years ago
  • 0.2.53                                ...           3 years ago
  • 0.2.52                                ...           3 years ago
  • 0.2.51                                ...           3 years ago
  • 0.2.50                                ...           3 years ago
  • 0.2.49                                ...           3 years ago
  • 0.2.48                                ...           3 years ago
  • 0.2.47                                ...           3 years ago
  • 0.2.46                                ...           3 years ago
  • 0.2.45                                ...           3 years ago
  • 0.2.44                                ...           3 years ago
  • 0.2.43                                ...           3 years ago
  • 0.2.42                                ...           3 years ago
  • 0.2.41                                ...           3 years ago
  • 0.2.40                                ...           3 years ago
  • 0.2.39                                ...           3 years ago
  • 0.2.38                                ...           3 years ago
  • 0.2.37                                ...           3 years ago
  • 0.2.36                                ...           3 years ago
  • 0.2.35                                ...           3 years ago
  • 0.2.34                                ...           3 years ago
  • 0.2.33                                ...           3 years ago
  • 0.2.32                                ...           3 years ago
  • 0.2.31                                ...           3 years ago
  • 0.2.30                                ...           3 years ago
  • 0.2.29                                ...           3 years ago
  • 0.2.28                                ...           3 years ago
  • 0.2.27                                ...           3 years ago
  • 0.2.26                                ...           3 years ago
  • 0.2.25                                ...           3 years ago
  • 0.2.24                                ...           3 years ago
  • 0.2.23                                ...           3 years ago
  • 0.2.22                                ...           3 years ago
  • 0.2.21                                ...           3 years ago
  • 0.2.20                                ...           3 years ago
  • 0.2.19                                ...           3 years ago
  • 0.2.18                                ...           3 years ago
  • 0.2.17                                ...           3 years ago
  • 0.2.16                                ...           3 years ago
  • 0.2.15                                ...           3 years ago
  • 0.2.14                                ...           3 years ago
  • 0.2.13                                ...           3 years ago
  • 0.2.12                                ...           3 years ago
  • 0.2.11                                ...           3 years ago
  • 0.2.10                                ...           3 years ago
  • 0.2.9                                ...           3 years ago
  • 0.2.8                                ...           3 years ago
  • 0.2.7                                ...           3 years ago
  • 0.2.6                                ...           3 years ago
  • 0.2.5                                ...           3 years ago
  • 0.2.4                                ...           3 years ago
  • 0.2.3                                ...           3 years ago
  • 0.2.2                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.23                                ...           3 years ago
  • 0.1.22                                ...           3 years ago
  • 0.1.21                                ...           3 years ago
  • 0.1.20                                ...           3 years ago
  • 0.1.19                                ...           3 years ago
  • 0.1.18                                ...           3 years ago
  • 0.1.17                                ...           3 years ago
  • 0.1.16                                ...           3 years ago
  • 0.1.15                                ...           3 years ago
  • 0.1.14                                ...           3 years ago
  • 0.1.13                                ...           3 years ago
  • 0.1.12                                ...           3 years ago
  • 0.1.11                                ...           3 years ago
  • 0.1.10                                ...           3 years ago
  • 0.1.9                                ...           3 years ago
  • 0.1.8                                ...           3 years ago
  • 0.1.7                                ...           3 years ago
  • 0.1.6                                ...           3 years ago
  • 0.1.5                                ...           3 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago

Copyright 2014 - 2016 © taobao.org |