https://github.com/throughnothing/chrome-trezor
Chrome Javascript library to interface with Trezor Bitcoin hardware wallet
https://github.com/throughnothing/chrome-trezor
Last synced: about 1 year ago
JSON representation
Chrome Javascript library to interface with Trezor Bitcoin hardware wallet
- Host: GitHub
- URL: https://github.com/throughnothing/chrome-trezor
- Owner: throughnothing
- Created: 2015-02-15T05:04:39.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-01T18:30:00.000Z (about 11 years ago)
- Last Synced: 2023-04-14T01:26:29.958Z (about 3 years ago)
- Language: JavaScript
- Homepage:
- Size: 708 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chrome-trezor
[](https://travis-ci.org/throughnothing/chrome-trezor)
[](https://coveralls.io/r/throughnothing/chrome-trezor?branch=master)
*DEPRECATED:* This repo is depracated as it has been replaced by [trezor/trezor-chrome-extension](https://github.com/trezor/trezor-chrome-extension)
This is a javascript library to interface with a Trezor Bitcoin hardware
wallet directly from the Chrome browser. It will work in Chrome on all
platforms and also on Chromebooks.
# Synopsis
```javascript
var Trezor = require('chrome-trezor'),
TrezorDevice = Trezor.Device,
TrezorMessage = Trezor.Message,
TrezorMessages = Trezor.Messages;
var trezor = new TrezorDevice();
trezor.on('connect', function() { console.log('connected') });
trezor.connect();
```
## Running in Chrome
This is just a library to be used in other projects, but it does come with
some examples that can be run in Chrome.
To run the examples, you *do not* need to install the developer requirements
listed below if you don't want to modify the code.
Simply enable "Developer mode" checkbox in the upper-right-hand corner of
`chrome://extensions` and then click "Load unpacked extension..." and pick
the `examples-build` directory of this repo.
The `examples-build/manifest.json`, along with the
`examples-build/js/background.js` file that it points to will tell chrome
how to run everything.
If you want to modify the code and run your modifications, you will need to
proceed with the development requirements below.
## Using in Chrome Apps/Extensions
To use this in Chrome Apps/Extensions, you will need your app to have
the following permissions in your `manifest.json` in order to access
the trezor device:
```
"permissions": [
"hid",
{
"usbDevices": [
{ "vendorId": 21324, "productId": 1 }
]
},
...
],
```
The example program has a sample in `example-builds/manifest.json` that can be used as an example.
## Development requirements
* Chrome 38 or later. If you're on dev channel you should be fine.
* Node.js's [npm](https://www.npmjs.org/). On my OSX machine I
satisfied this requirement with `brew install node`.
* Webpack + App dependencies:
* `sudo npm -g install webpack mocha && npm install`
## Running tests
```
npm run test
```
## Build
To build run: `npm run build`
Whenever you make changes to the javascript in `index.js` or `lib/` you will
need to run this again before re-launching the app from Chrome.