diff --git a/common/typescript/trezor-js.d.ts b/common/typescript/trezor-js.d.ts index 5906a1f8..3bf73f35 100644 --- a/common/typescript/trezor-js.d.ts +++ b/common/typescript/trezor-js.d.ts @@ -2,7 +2,7 @@ // Types are only based off of what's mentioned in the API // https://github.com/trezor/trezor.js/blob/master/API.md -declare module 'trezor.js' { +declare module 'mycrypto-trezor.js' { import { EventEmitter } from 'events'; import { Transport, TrezorDeviceInfoWithSession as DeviceDescriptor } from 'trezor-link'; diff --git a/package.json b/package.json index c19ebdfd..1df18303 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "bootstrap-sass": "3.3.7", "classnames": "2.2.5", "electron-updater": "2.21.10", - "mycrypto-eth-exists": "1.0.0", "ethereum-blockies-base64": "1.0.1", "ethereumjs-abi": "git://github.com/ethereumjs/ethereumjs-abi.git#09c3c48fd3bed143df7fa8f36f6f164205e23796", "ethereumjs-tx": "1.3.4", @@ -34,7 +33,9 @@ "lodash": "4.17.5", "moment": "2.22.1", "moment-timezone": "0.5.14", + "mycrypto-eth-exists": "1.0.0", "mycrypto-shepherd": "1.4.0", + "mycrypto-trezor.js": "6.17.5", "normalizr": "3.2.4", "qrcode": "1.2.0", "qrcode.react": "0.8.0", @@ -56,8 +57,6 @@ "redux-saga": "0.16.0", "scryptsy": "2.0.0", "semver": "5.5.0", - "trezor-connect": "5.0.13", - "trezor.js": "6.16.0", "uuid": "3.2.1", "wallet-address-validator": "0.1.6", "whatwg-fetch": "2.0.3", diff --git a/shared/enclave/server/wallets/trezor.ts b/shared/enclave/server/wallets/trezor.ts index 2eafab29..3821f1b3 100644 --- a/shared/enclave/server/wallets/trezor.ts +++ b/shared/enclave/server/wallets/trezor.ts @@ -1,4 +1,4 @@ -import { DeviceList, Session } from 'trezor.js'; +import { DeviceList, Session } from 'mycrypto-trezor.js'; import BN from 'bn.js'; import mapValues from 'lodash/mapValues'; import { addHexPrefix } from 'ethereumjs-util'; diff --git a/webpack_config/webpack.electron-dev.js b/webpack_config/webpack.electron-dev.js index 7104007c..de0df5ea 100644 --- a/webpack_config/webpack.electron-dev.js +++ b/webpack_config/webpack.electron-dev.js @@ -3,7 +3,6 @@ const webpack = require('webpack'); const path = require('path'); const ClearDistPlugin = require('./plugins/clearDist'); const config = require('./config'); -const makeConfig = require('./makeConfig'); const electronConfig = { target: 'electron-main', @@ -30,8 +29,7 @@ const electronConfig = { }), ], externals: { - 'node-hid': 'commonjs node-hid', - 'trezor.js-node': 'require("trezor.js-node")' + 'node-hid': 'commonjs node-hid' }, node: { __dirname: false, diff --git a/yarn.lock b/yarn.lock index 66ac7d86..d4d86e61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -568,6 +568,13 @@ asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" +ascli@~0.3: + version "0.3.0" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-0.3.0.tgz#5e66230e5219fe3e8952a4efb4f20fae596a813a" + dependencies: + colour latest + optjs latest + asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" @@ -1343,7 +1350,7 @@ base-x@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/base-x/-/base-x-1.1.0.tgz#42d3d717474f9ea02207f6d1aa1f426913eeb7ac" -base-x@^3.0.4: +base-x@^3.0.2, base-x@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.4.tgz#94c1788736da065edb1d68808869e357c977fa77" dependencies: @@ -1377,20 +1384,39 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" +bchaddrjs@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/bchaddrjs/-/bchaddrjs-0.2.1.tgz#8c2f1582e24e5ca11687ae19e2463543cfa0dd24" + dependencies: + bs58check "^2.1.1" + cashaddrjs "^0.2.7" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" dependencies: tweetnacl "^0.14.3" +bech32@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.3.tgz#bd47a8986bbb3eec34a56a097a84b8d3e9a2dfcd" + beeper@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" +big-integer@^1.6.26: + version "1.6.31" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.31.tgz#6d7852486e67c642502dcc03f7225a245c9fc7fa" + big.js@^3.1.3: version "3.2.0" resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" +bigi@^1.1.0, bigi@^1.4.0, bigi@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.2.tgz#9c665a95f88b8b08fc05cfd731f561859d725825" + bignumber.js@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-2.4.0.tgz#838a992da9f9d737e0f4b2db0be62bb09dd0c5e8" @@ -1471,12 +1497,36 @@ bip39@2.5.0: safe-buffer "^5.0.1" unorm "^1.3.3" -bip66@^1.1.3: +bip66@^1.1.0, bip66@^1.1.3: version "1.1.5" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" dependencies: safe-buffer "^5.0.1" +bitcoin-ops@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/bitcoin-ops/-/bitcoin-ops-1.4.1.tgz#e45de620398e22fd4ca6023de43974ff42240278" + +bitcoinjs-lib-zcash@^3.0.0, bitcoinjs-lib-zcash@^3.3.2: + version "3.4.1" + resolved "https://registry.yarnpkg.com/bitcoinjs-lib-zcash/-/bitcoinjs-lib-zcash-3.4.1.tgz#ea440857188ed3168f66ae8f6ecba603c53e3f22" + dependencies: + bech32 "^1.1.2" + bigi "^1.4.0" + bip66 "^1.1.0" + bitcoin-ops "^1.3.0" + bs58check "^2.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.3" + ecurve "^1.0.0" + merkle-lib "^2.0.10" + pushdata-bitcoin "^1.0.1" + randombytes "^2.0.1" + safe-buffer "^5.0.1" + typeforce "^1.11.3" + varuint-bitcoin "^1.0.4" + wif "^2.0.1" + bl@^1.0.0: version "1.2.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" @@ -1684,6 +1734,19 @@ bs58@^3.1.0: dependencies: base-x "^1.1.0" +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + dependencies: + base-x "^3.0.2" + +bs58check@<3.0.0, bs58check@^2.0.0, bs58check@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.1.tgz#8a5d0e587af97b784bf9cbf1b29f454d82bc0222" + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + bs58check@^1.0.8: version "1.3.4" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-1.3.4.tgz#c52540073749117714fa042c3047eb8f9151cbf8" @@ -1761,6 +1824,10 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" +bufferview@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bufferview/-/bufferview-1.0.1.tgz#7afd74a45f937fa422a1d338c08bbfdc76cd725d" + builder-util-runtime@4.2.1, builder-util-runtime@^4.2.1, builder-util-runtime@~4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-4.2.1.tgz#0caa358f1331d70680010141ca591952b69b35bc" @@ -1816,6 +1883,13 @@ builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" +bytebuffer-old-fixed-webpack@3.5.6: + version "3.5.6" + resolved "https://registry.yarnpkg.com/bytebuffer-old-fixed-webpack/-/bytebuffer-old-fixed-webpack-3.5.6.tgz#5adc419c6a9b4692f217206703ec7431c759aa3f" + dependencies: + bufferview "~1" + long "~2 >=2.2.3" + bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -1942,6 +2016,12 @@ caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" +cashaddrjs@^0.2.7: + version "0.2.8" + resolved "https://registry.yarnpkg.com/cashaddrjs/-/cashaddrjs-0.2.8.tgz#74003dd4beb55c6328c1a13117d4093f7becb580" + dependencies: + big-integer "^1.6.26" + caw@^1.0.1: version "1.2.0" resolved "https://registry.yarnpkg.com/caw/-/caw-1.2.0.tgz#ffb226fe7efc547288dc62ee3e97073c212d1034" @@ -2355,6 +2435,10 @@ colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" +colour@latest: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" @@ -2617,7 +2701,7 @@ create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2: ripemd160 "^2.0.1" sha.js "^2.4.0" -create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.3, create-hmac@^1.1.4: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" dependencies: @@ -3388,6 +3472,13 @@ ecc-jsbn@~0.1.1: dependencies: jsbn "~0.1.0" +ecurve@^1.0.0, ecurve@^1.0.2, ecurve@^1.0.3: + version "1.0.6" + resolved "https://registry.yarnpkg.com/ecurve/-/ecurve-1.0.6.tgz#dfdabbb7149f8d8b78816be5a7d5b83fcf6de797" + dependencies: + bigi "^1.1.0" + safe-buffer "^5.0.1" + editions@^1.3.3: version "1.3.4" resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.4.tgz#3662cb592347c3168eb8e498a0ff73271d67f50b" @@ -7077,6 +7168,10 @@ loglevelnext@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/loglevelnext/-/loglevelnext-1.0.4.tgz#0d991d9998180991dac8bd81e73a596a8720a645" +"long@~2 >=2.2.3": + version "2.4.0" + resolved "https://registry.yarnpkg.com/long/-/long-2.4.0.tgz#9fa180bb1d9500cdc29c4156766a1995e1f4524f" + longest@^1.0.0, longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -7258,6 +7353,10 @@ merge@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" +merkle-lib@^2.0.10: + version "2.0.10" + resolved "https://registry.yarnpkg.com/merkle-lib/-/merkle-lib-2.0.10.tgz#82b8dbae75e27a7785388b73f9d7725d0f6f3326" + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -7506,6 +7605,34 @@ mycrypto-shepherd@1.4.0: remote-redux-devtools "^0.5.12" url-search-params "^0.10.0" +mycrypto-trezor-link@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/mycrypto-trezor-link/-/mycrypto-trezor-link-1.5.1.tgz#1d0b13bd854022dcd9960062d04f8d9e7b4c67c0" + dependencies: + bigi "^1.4.1" + bitcoinjs-lib-zcash "^3.0.0" + ecurve "^1.0.3" + json-stable-stringify "^1.0.1" + node-fetch "^1.6.0" + object.values "^1.0.3" + protobufjs-old-fixed-webpack "3.8.5" + semver-compare "^1.0.0" + whatwg-fetch "0.11.0" + +mycrypto-trezor.js@6.17.5: + version "6.17.5" + resolved "https://registry.yarnpkg.com/mycrypto-trezor.js/-/mycrypto-trezor.js-6.17.5.tgz#f92cf11e614aa813814f8e444f459f02bf7ce906" + dependencies: + bchaddrjs "^0.2.1" + bitcoinjs-lib-zcash "^3.3.2" + ecurve "^1.0.2" + mycrypto-trezor-link "1.5.1" + node-fetch "^1.6.0" + randombytes "^2.0.1" + semver-compare "1.0.0" + unorm "^1.3.3" + whatwg-fetch "0.11.0" + nan@^2.0.5, nan@^2.0.8, nan@^2.10.0, nan@^2.2.1, nan@^2.3.0, nan@^2.6.2: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" @@ -7574,7 +7701,7 @@ node-dir@0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.8.tgz#55fb8deb699070707fb67f91a460f0448294c77d" -node-fetch@^1.0.1: +node-fetch@^1.0.1, node-fetch@^1.6.0: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" dependencies: @@ -7967,7 +8094,7 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.0.4: +object.values@^1.0.3, object.values@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.0.4.tgz#e524da09b4f66ff05df457546ec72ac99f13069a" dependencies: @@ -8024,6 +8151,10 @@ optipng-bin@^3.0.0: bin-wrapper "^3.0.0" logalot "^2.0.0" +optjs@latest: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + ora@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4" @@ -8841,6 +8972,13 @@ proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" +protobufjs-old-fixed-webpack@3.8.5: + version "3.8.5" + resolved "https://registry.yarnpkg.com/protobufjs-old-fixed-webpack/-/protobufjs-old-fixed-webpack-3.8.5.tgz#5813c1af9f1d136bbf39f4f9f2e6f3e43c389d06" + dependencies: + ascli "~0.3" + bytebuffer-old-fixed-webpack "3.5.6" + proxy-addr@~2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" @@ -8912,6 +9050,12 @@ punycode@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" +pushdata-bitcoin@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/pushdata-bitcoin/-/pushdata-bitcoin-1.0.1.tgz#15931d3cd967ade52206f523aa7331aef7d43af7" + dependencies: + bitcoin-ops "^1.3.0" + q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -10069,6 +10213,10 @@ seek-bzip@^1.0.3, seek-bzip@^1.0.5: dependencies: commander "~2.8.1" +semver-compare@1.0.0, semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + semver-diff@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" @@ -11268,6 +11416,10 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +typeforce@^1.11.3: + version "1.12.0" + resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.12.0.tgz#ca40899919f1466d7819e37be039406beb912a2e" + types-rlp@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/types-rlp/-/types-rlp-0.0.1.tgz#cb9a2fe70bbdabda3c2c491b21bc04c8bd917f9b" @@ -11631,6 +11783,12 @@ value-equal@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7" +varuint-bitcoin@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/varuint-bitcoin/-/varuint-bitcoin-1.1.0.tgz#7a343f50537607af6a3059312b9782a170894540" + dependencies: + safe-buffer "^5.1.1" + vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -11941,6 +12099,10 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: dependencies: iconv-lite "0.4.19" +whatwg-fetch@0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-0.11.0.tgz#46b1d18d0aa99955971ef1a2f5aac506add28815" + whatwg-fetch@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" @@ -11995,6 +12157,12 @@ widest-line@^2.0.0: dependencies: string-width "^2.1.1" +wif@^2.0.1: + version "2.0.6" + resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" + dependencies: + bs58check "<3.0.0" + window-or-global@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/window-or-global/-/window-or-global-1.0.1.tgz#dbe45ba2a291aabc56d62cf66c45b7fa322946de"