Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome extension compatibility #10

Open
wants to merge 4 commits into
base: s-x-compat
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/device/speculos.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const net = require('net');
const net = require('chrome-net');

class USB {
constructor() {}
Expand Down
2 changes: 1 addition & 1 deletion lib/device/usb.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let busb;
if (process.env.SPECULOS === 'true')
busb = require('./speculos');
else
busb = require('busb');
busb = require('busb/lib/busb-browser');

const assert = require('bsert');
const Logger = require('blgr');
Expand Down
4 changes: 3 additions & 1 deletion lib/ledger/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
const assert = require('bsert');
const bufio = require('bufio');
const {encoding} = bufio;
const {MTX, Network, Rules} = require('hsd');
const MTX = require('hsd/lib/primitives/mtx')
const Network = require('hsd/lib/protocol/network')
const Rules = require('hsd/lib/covenants/rules')
const {types} = Rules;

const util = require('../utils/util');
Expand Down
2 changes: 1 addition & 1 deletion lib/ledger/covenant.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'use strict';

const assert = require('bsert');
const {Rules} = require('hsd');
const Rules = require('hsd/lib/covenants/rules')

/**
* Ledger-aware output covenants used to verify
Expand Down
4 changes: 3 additions & 1 deletion lib/ledger/hsd.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
const assert = require('bsert');
const Logger = require('blgr');
const {Lock} = require('bmutex');
const {HDPublicKey, Network, Script} = require('hsd');
const HDPublicKey = require('hsd/lib/hd/public')
const Network = require('hsd/lib/protocol/network')
const Script = require('hsd/lib/script').Script;
const util = require('../utils/util');
const {Device} = require('../device/device');
const {LedgerClient, LedgerInput} = require('./');
Expand Down
4 changes: 3 additions & 1 deletion lib/utils/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

const assert = require('bsert');
const bufio = require('bufio');
const {Address, hd, Rules} = require('hsd');
const Address = require('hsd/lib/primitives/address')
const hd = require('hsd/lib/hd')
const Rules = require('hsd/lib/covenants/rules')

/**
* Index at which hardening begins.
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"bmutex": "git+https://github.com/bcoin-org/bmutex#semver:~0.1.6",
"bsert": "git+https://github.com/chjj/bsert#semver:~0.0.10",
"bufio": "git+https://github.com/bcoin-org/bufio#semver:^1.0.6",
"busb": "git+https://github.com/nodar-chkuaselidze/busb#semver:~1.0.0-beta.0"
"busb": "git+https://github.com/nodar-chkuaselidze/busb#semver:~1.0.0-beta.0",
"chrome-net": "^3.3.4"
},
"peerDependencies": {
"hsd": "git+https://github.com/handshake-org/hsd#semver:^2.1.5"
Expand Down