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

tech debt: update ledger dependencies #346

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 0 additions & 3 deletions docs/architecture.dot
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ digraph D {

hdwalletledgerwebusb [label="hdwallet-ledger-webusb", shape=box, fillcolor="darkseagreen1", style=filled]
hdwalletledgerwebusb -> hdwalletledger

hdwalletledgeru2f [label="hdwallet-ledger-u2f", shape=box, fillcolor="darkseagreen1", style=filled]
hdwalletledgeru2f -> hdwalletledger
}
}

5 changes: 0 additions & 5 deletions examples/sandbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,18 @@ const nativeAdapter = native.NativeAdapter.useKeyring(keyring, {
mnemonic,
deviceId: "native-wallet-test",
});

const log = debug.default("hdwallet");

const trezorAdapter = trezorConnect.TrezorAdapter.useKeyring(keyring, {
debug: false,
manifest: {
email: "[email protected]",
appUrl: "https://shapeshift.com",
},
});

const ledgerAdapter = ledgerWebUSB.WebUSBLedgerAdapter.useKeyring(keyring);

window["keyring"] = keyring;

window.localStorage.debug = "*";
const loggers: { [deviceID: string]: debug.Debugger } = {};

let wallet;
window["wallet"] = wallet;
Expand Down
23 changes: 13 additions & 10 deletions examples/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hdwallet-sandbox",
"version": "1.16.10",
"version": "1.17.0",
"main": "index.js",
"license": "MIT",
"private": true,
Expand All @@ -9,16 +9,19 @@
"dev": "yarn parcel index.html",
"clean": "rm -rf dist .cache"
},
"engines": {
"node": "14.x"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is accurate. You're 100% certain this doesn't run on older versions of node? I'm running node 12.x and it compiles fine for me.

},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.16.10",
"@shapeshiftoss/hdwallet-ledger": "1.16.10",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.16.10",
"@shapeshiftoss/hdwallet-native": "1.16.10",
"@shapeshiftoss/hdwallet-portis": "1.16.10",
"@shapeshiftoss/hdwallet-trezor": "1.16.10",
"@shapeshiftoss/hdwallet-trezor-connect": "1.16.10",
"@shapeshiftoss/hdwallet-core": "1.17.0",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.17.0",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.17.0",
"@shapeshiftoss/hdwallet-ledger": "1.17.0",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.17.0",
"@shapeshiftoss/hdwallet-native": "1.17.0",
"@shapeshiftoss/hdwallet-portis": "1.17.0",
"@shapeshiftoss/hdwallet-trezor": "1.17.0",
"@shapeshiftoss/hdwallet-trezor-connect": "1.17.0",
"bip32": "^2.0.4",
"debug": "^4.1.1",
"jquery": "^3.4.1",
Expand Down
15 changes: 9 additions & 6 deletions integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/integration",
"version": "1.16.10",
"version": "1.17.0",
"main": "index.js",
"license": "MIT",
"private": true,
Expand All @@ -9,12 +9,15 @@
"test": "yarn jest --verbose",
"dev": "lerna run test --scope integration --parallel --include-filtered-dependencies"
},
"engines": {
"node": "14.x"
},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey-nodewebusb": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.16.10",
"@shapeshiftoss/hdwallet-trezor": "1.16.10",
"@shapeshiftoss/hdwallet-core": "1.17.0",
"@shapeshiftoss/hdwallet-keepkey": "1.17.0",
"@shapeshiftoss/hdwallet-keepkey-nodewebusb": "1.17.0",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.17.0",
"@shapeshiftoss/hdwallet-trezor": "1.17.0",
"@types/debug": "^4.1.5",
"@types/jest": "^26.0.23",
"debug": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.22.1",
"version": "1.16.10",
"version": "1.17.0",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"lerna:publish": "lerna publish --pre-dist-tag alpha from-package",
"postinstall": "patch-package"
},
"engines": {
"node": "14.x"
},
Comment on lines +37 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We removed engine restrictions on purpose several versions ago. If a dependency requires at least node 14, then it's own engines block should be set; if it isn't, we should set it on the affected hdwallet-* package, but it shouldn't be all-pervasive, and should at least specify >=14 instead of 14.x.

"devDependencies": {
"jest": "^26.6.3",
"jest-environment-jsdom": "^25.5.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/hdwallet-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-core",
"version": "1.16.10",
"version": "1.17.0",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -13,6 +13,9 @@
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"prepublishOnly": "yarn clean && yarn build"
},
"engines": {
"node": "14.x"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is wrong because we use hdwallet in axiom which runs node 12. "engines" will prevent use of any other version of node. If you absolutely want to add "engines" then use ">= 12" or whatever the minimum version of node is that is compatible.

},
"dependencies": {
"eventemitter2": "^5.0.1",
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/hdwallet-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function arrayify(value: string): Uint8Array {
return new Uint8Array(result);
}

const HARDENED = 0x80000000;
export const HARDENED = 0x80000000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this would need a better name for export at this level; also it doesn't need to be exported if if you use core.addressNListToBIP32 as shown below.

Suggested change
export const HARDENED = 0x80000000;
const HARDENED = 0x80000000;

export function bip32ToAddressNList(path: string): number[] {
if (!bip32Like(path)) {
throw new Error(`Not a bip32 path: '${path}'`);
Expand Down
9 changes: 6 additions & 3 deletions packages/hdwallet-keepkey-chromeusb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-chromeusb",
"version": "1.16.10",
"version": "1.17.0",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -13,9 +13,12 @@
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"prepublishOnly": "yarn clean && yarn build"
},
"engines": {
"node": "14.x"
},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey": "1.16.10"
"@shapeshiftoss/hdwallet-core": "1.17.0",
"@shapeshiftoss/hdwallet-keepkey": "1.17.0"
},
"devDependencies": {
"typescript": "^4.3.2"
Expand Down
7 changes: 5 additions & 2 deletions packages/hdwallet-keepkey-electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-electron",
"version": "1.16.10",
"version": "1.17.0",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -13,8 +13,11 @@
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"prepublishOnly": "yarn clean && yarn build"
},
"engines": {
"node": "14.x"
},
"dependencies": {
"@shapeshiftoss/hdwallet-keepkey": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey": "1.17.0",
"uuid": "^8.3.2"
},
"peerDependencies": {
Expand Down
7 changes: 5 additions & 2 deletions packages/hdwallet-keepkey-nodehid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-nodehid",
"version": "1.16.10",
"version": "1.17.0",
"license": "MIT",
"private": true,
"main": "dist/index.js",
Expand All @@ -11,8 +11,11 @@
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"prepublishOnly": "yarn clean && yarn build"
},
"engines": {
"node": "14.x"
},
"dependencies": {
"@shapeshiftoss/hdwallet-keepkey": "1.16.10"
"@shapeshiftoss/hdwallet-keepkey": "1.17.0"
},
"peerDependencies": {
"node-hid": "^0.7.7"
Expand Down
9 changes: 6 additions & 3 deletions packages/hdwallet-keepkey-nodewebusb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-nodewebusb",
"version": "1.16.10",
"version": "1.17.0",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -13,9 +13,12 @@
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"prepublishOnly": "yarn clean && yarn build"
},
"engines": {
"node": "14.x"
},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey": "1.16.10"
"@shapeshiftoss/hdwallet-core": "1.17.0",
"@shapeshiftoss/hdwallet-keepkey": "1.17.0"
},
"peerDependencies": {
"webusb": "^2.2.0"
Expand Down
9 changes: 6 additions & 3 deletions packages/hdwallet-keepkey-tcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-tcp",
"version": "1.16.10",
"version": "1.17.0",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -13,9 +13,12 @@
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"prepublishOnly": "yarn clean && yarn build"
},
"engines": {
"node": "14.x"
},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey": "1.16.10",
"@shapeshiftoss/hdwallet-core": "1.17.0",
"@shapeshiftoss/hdwallet-keepkey": "1.17.0",
"axios": "^0.21.1"
},
"devDependencies": {
Expand Down
9 changes: 6 additions & 3 deletions packages/hdwallet-keepkey-webusb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-webusb",
"version": "1.16.10",
"version": "1.17.0",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -13,9 +13,12 @@
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"prepublishOnly": "yarn clean && yarn build"
},
"engines": {
"node": "14.x"
},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.16.10",
"@shapeshiftoss/hdwallet-keepkey": "1.16.10"
"@shapeshiftoss/hdwallet-core": "1.17.0",
"@shapeshiftoss/hdwallet-keepkey": "1.17.0"
},
"devDependencies": {
"@types/w3c-web-usb": "^1.0.4",
Expand Down
7 changes: 5 additions & 2 deletions packages/hdwallet-keepkey/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey",
"version": "1.16.10",
"version": "1.17.0",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -14,11 +14,14 @@
"clean": "rm -rf dist tsconfig.tsbuildinfo",
"prepublishOnly": "yarn clean && yarn build"
},
"engines": {
"node": "14.x"
},
"dependencies": {
"@ethereumjs/common": "^2.4.0",
"@ethereumjs/tx": "^3.3.0",
"@keepkey/device-protocol": "^7.2.4",
"@shapeshiftoss/hdwallet-core": "1.16.10",
"@shapeshiftoss/hdwallet-core": "1.17.0",
"bignumber.js": "^9.0.1",
"bnb-javascript-sdk-nobroadcast": "^2.16.14",
"crypto-js": "^4.0.0",
Expand Down
4 changes: 0 additions & 4 deletions packages/hdwallet-ledger-u2f/.npmignore

This file was deleted.

29 changes: 0 additions & 29 deletions packages/hdwallet-ledger-u2f/package.json

This file was deleted.

Loading