From 9e9f92387652ed3805c50f0c19190237dac907b5 Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Wed, 30 Jun 2021 10:30:48 +0200 Subject: [PATCH 01/16] ci: forks should create test builds --- app/hooks/use-prepare-ledger.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/hooks/use-prepare-ledger.ts b/app/hooks/use-prepare-ledger.ts index 674549413..d57511931 100644 --- a/app/hooks/use-prepare-ledger.ts +++ b/app/hooks/use-prepare-ledger.ts @@ -41,7 +41,9 @@ export function usePrepareLedger() { const appVersionErrorText = useMemo(() => { return ` Make sure to upgrade your Stacks app to the latest version in Ledger Live. - This version of the Stacks Wallet only works with ${SUPPORTED_LEDGER_VERSION_MAJOR}.${SUPPORTED_LEDGER_VERSION_MINOR}. + This version of the Stacks Wallet only works with ${String( + SUPPORTED_LEDGER_VERSION_MAJOR + )}.${String(SUPPORTED_LEDGER_VERSION_MINOR)}. Detected version ${String(appVersion?.major)}.${String(appVersion?.minor)} `; }, [appVersion]); From 6876e842ce6ba1e199233079d56df6ce479c3ea7 Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Mon, 5 Jul 2021 17:30:07 +0200 Subject: [PATCH 02/16] fix(ledger): support 0.13 --- app/constants/index.ts | 8 +- app/hooks/use-prepare-ledger.ts | 29 ++++-- app/main/ledger-actions.ts | 16 +++- package.json | 3 +- yarn.lock | 152 ++++++++++++++++++++++++++------ 5 files changed, 167 insertions(+), 41 deletions(-) diff --git a/app/constants/index.ts b/app/constants/index.ts index bb092308a..80f3734bc 100644 --- a/app/constants/index.ts +++ b/app/constants/index.ts @@ -62,13 +62,15 @@ export const REVOKE_DELEGATION_TX_SIZE_BYTES = 165; export const STACKING_CONTRACT_CALL_FEE = 260; -export const POOLED_STACKING_TX_SIZE_BYTES = 199; +export const POOLED_STACKING_TX_SIZE_BYTES = 216; export const SUPPORTED_BTC_ADDRESS_FORMATS = ['p2pkh', 'p2sh'] as const; -export const SUPPORTED_LEDGER_VERSION_MAJOR = 0; +export const LATEST_LEDGER_VERSION_MAJOR = 0; -export const SUPPORTED_LEDGER_VERSION_MINOR = 11; +export const LATEST_LEDGER_VERSION_MINOR = 13; + +export const SUPPORTED_LEDGER_VERSIONS_MINOR = [11, LATEST_LEDGER_VERSION_MINOR]; export const DEFAULT_POLLING_INTERVAL = 10_000; diff --git a/app/hooks/use-prepare-ledger.ts b/app/hooks/use-prepare-ledger.ts index d57511931..59b73b34c 100644 --- a/app/hooks/use-prepare-ledger.ts +++ b/app/hooks/use-prepare-ledger.ts @@ -2,11 +2,16 @@ import { useEffect, useMemo, useState } from 'react'; import { LedgerError } from '@zondax/ledger-blockstack'; import { Observable } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { SUPPORTED_LEDGER_VERSION_MAJOR, SUPPORTED_LEDGER_VERSION_MINOR } from '@constants/index'; +import { + LATEST_LEDGER_VERSION_MAJOR, + LATEST_LEDGER_VERSION_MINOR, + SUPPORTED_LEDGER_VERSIONS_MINOR, +} from '@constants/index'; import type { LedgerMessageEvents } from '../main/register-ledger-listeners'; import { useListenLedgerEffect } from './use-listen-ledger-effect'; import { messages$ } from './use-message-events'; +import { isTestnet } from '@utils/network-utils'; export enum LedgerConnectStep { Disconnected, @@ -30,23 +35,29 @@ export function usePrepareLedger() { const [isLocked, setIsLocked] = useState(false); const [appVersion, setAppVersion] = useState(null); + const versionSupportsTestnetLedger = useMemo(() => { + if (appVersion === null) return false; + return appVersion.major >= 0 && appVersion.minor > 11; + }, [appVersion]); + const isSupportedAppVersion = useMemo(() => { if (appVersion === null) return true; - return ( - appVersion.major === SUPPORTED_LEDGER_VERSION_MAJOR && - appVersion.minor === SUPPORTED_LEDGER_VERSION_MINOR - ); - }, [appVersion]); + if (!versionSupportsTestnetLedger && isTestnet()) return false; + return SUPPORTED_LEDGER_VERSIONS_MINOR.includes(appVersion.minor); + }, [appVersion, versionSupportsTestnetLedger]); const appVersionErrorText = useMemo(() => { + if (!versionSupportsTestnetLedger && isTestnet()) { + return `Cannot use Ledger on testnet with app version 0.11.0 or lower. Upgrade on Ledger Live.`; + } return ` Make sure to upgrade your Stacks app to the latest version in Ledger Live. This version of the Stacks Wallet only works with ${String( - SUPPORTED_LEDGER_VERSION_MAJOR - )}.${String(SUPPORTED_LEDGER_VERSION_MINOR)}. + LATEST_LEDGER_VERSION_MAJOR + )}.${String(LATEST_LEDGER_VERSION_MINOR)}. Detected version ${String(appVersion?.major)}.${String(appVersion?.minor)} `; - }, [appVersion]); + }, [appVersion, versionSupportsTestnetLedger]); useListenLedgerEffect(); diff --git a/app/main/ledger-actions.ts b/app/main/ledger-actions.ts index aa7766014..e2b2bea98 100644 --- a/app/main/ledger-actions.ts +++ b/app/main/ledger-actions.ts @@ -1,12 +1,21 @@ import Transport from '@ledgerhq/hw-transport'; +import { AddressVersion } from '@stacks/transactions'; import StacksApp, { LedgerError, ResponseAddress, ResponseSign } from '@zondax/ledger-blockstack'; +const chainIdMap = { + mainnet: AddressVersion.MainnetSingleSig, + testnet: AddressVersion.TestnetSingleSig, +}; + const STX_DERIVATION_PATH = `m/44'/5757'/0'/0/0`; export async function ledgerRequestStxAddress(transport: Transport | null) { if (!transport) throw new Error('No device transport'); const stacksApp = new StacksApp(transport); - const resp = await stacksApp.showAddressAndPubKey(STX_DERIVATION_PATH); + const resp = await stacksApp.showAddressAndPubKey( + STX_DERIVATION_PATH, + chainIdMap[process.env.STX_NETWORK as keyof typeof chainIdMap] + ); if (resp.publicKey) { return { ...resp, publicKey: resp.publicKey.toString('hex') }; } @@ -16,7 +25,10 @@ export async function ledgerRequestStxAddress(transport: Transport | null) { export async function ledgerShowStxAddress(transport: Transport | null) { if (!transport) throw new Error('No device transport'); const stacksApp = new StacksApp(transport); - const resp = await stacksApp.getAddressAndPubKey(STX_DERIVATION_PATH); + const resp = await stacksApp.getAddressAndPubKey( + STX_DERIVATION_PATH, + chainIdMap[process.env.STX_NETWORK as keyof typeof chainIdMap] + ); return resp; } diff --git a/package.json b/package.json index 14e61d4cc..3ad8bb946 100644 --- a/package.json +++ b/package.json @@ -219,7 +219,8 @@ "@styled-system/theme-get": "5.1.2", "@tabler/icons": "1.40.2", "@tippyjs/react": "4.2.5", - "@zondax/ledger-blockstack": "0.1.0", + "@zondax/ledger-blockstack-legacy": "npm:@zondax/ledger-blockstack@0.1.0", + "@zondax/ledger-blockstack": "0.2.0", "argon2-browser": "1.15.3", "axios": "0.21.1", "bignumber.js": "9.0.1", diff --git a/yarn.lock b/yarn.lock index ed92addfb..82763c381 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1092,13 +1092,20 @@ pirates "^4.0.0" source-map-support "^0.5.16" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.10.5", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.5", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": version "7.13.17" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.17.tgz#8966d1fc9593bf848602f0662d6b4d0069e3a7ec" integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.10.3": + version "7.14.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" + integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.12.13", "@babel/template@^7.3.3": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" @@ -1691,20 +1698,20 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@ledgerhq/devices@^5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-5.49.0.tgz#86733944ea724acb974b136e46487a90ee0bfa6e" - integrity sha512-14VSO+NeR/O8VSXXnlBsA0DAluzanJVEjHLDJubU5NZjEttXVF9gdQh1j10+MKW0f8H23IkdqwswVQIB9ZPomQ== +"@ledgerhq/devices@^5.51.1": + version "5.51.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-5.51.1.tgz#d741a4a5d8f17c2f9d282fd27147e6fe1999edb7" + integrity sha512-4w+P0VkbjzEXC7kv8T1GJ/9AVaP9I6uasMZ/JcdwZBS3qwvKo5A5z9uGhP5c7TvItzcmPb44b5Mw2kT+WjUuAA== dependencies: - "@ledgerhq/errors" "^5.49.0" - "@ledgerhq/logs" "^5.49.0" - rxjs "^6.6.7" + "@ledgerhq/errors" "^5.50.0" + "@ledgerhq/logs" "^5.50.0" + rxjs "6" semver "^7.3.5" -"@ledgerhq/errors@^5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.49.0.tgz#8ecb43bb702504d9fc94ee12022d81d6e36cb5ce" - integrity sha512-+uhoSsAnzZiZ2CUk/dv4Uo8lrl0jn2izYJATSbC5aZFd0Yl7PWZ1SMHMkvPVEgQvWZcu4iQZ67rlKOtj5tUFWA== +"@ledgerhq/errors@^5.50.0": + version "5.50.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.50.0.tgz#e3a6834cb8c19346efca214c1af84ed28e69dad9" + integrity sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow== "@ledgerhq/hw-transport@^5.17.0": version "5.49.0" @@ -1715,10 +1722,19 @@ "@ledgerhq/errors" "^5.49.0" events "^3.3.0" -"@ledgerhq/logs@^5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.49.0.tgz#e14e34df1605c17d6b90eb32c591c7b3de3fbae8" - integrity sha512-Ynl2JzRwh8l9PoXrDNihXEicpVo6Ra2lYZoqSYfVH/v/2/TSa/JB9Qll8P85XFYkS3ouDTTbp1S5KViaTkqD5g== +"@ledgerhq/hw-transport@^5.39.1": + version "5.51.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz#8dd14a8e58cbee4df0c29eaeef983a79f5f22578" + integrity sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw== + dependencies: + "@ledgerhq/devices" "^5.51.1" + "@ledgerhq/errors" "^5.50.0" + events "^3.3.0" + +"@ledgerhq/logs@^5.50.0": + version "5.50.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.50.0.tgz#29c6419e8379d496ab6d0426eadf3c4d100cd186" + integrity sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA== "@malept/cross-spawn-promise@^1.1.0": version "1.1.1" @@ -2504,6 +2520,13 @@ jsonrpc-lite "^2.2.0" ws "^7.4.0" +"@stacks/common@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@stacks/common/-/common-1.2.2.tgz#1365ffb0f8bd9e4cd194c63c65a1bb2c83876ba1" + integrity sha512-knCqq88EBRCN8AhS7+Sx2PJuRv0EFNChEpqLqCAchCHCQfp5bWad/47Zw+fLP9ccBwFXh4pl1wDtbQLBfDo0+A== + dependencies: + cross-fetch "^3.0.6" + "@stacks/eslint-config@1.0.9": version "1.0.9" resolved "https://registry.yarnpkg.com/@stacks/eslint-config/-/eslint-config-1.0.9.tgz#824b3996773dadfe231302522f8d66fe30f677b5" @@ -2518,6 +2541,13 @@ eslint-plugin-import ">=2.23.3" eslint-plugin-prettier "^3.4.0" +"@stacks/network@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@stacks/network/-/network-1.2.2.tgz#30ca87ad6339f32eb04ed3a9dbcc2e39ed933604" + integrity sha512-xcWwuRrLJn9qqi3PEBcP2UPZHQztTZd31C0aVlzYHttNMir/sY9SrUqSnw45z2Jo4O9pIYYPIiPRtdV91Ho3fw== + dependencies: + "@stacks/common" "^1.2.2" + "@stacks/prettier-config@0.0.8", "@stacks/prettier-config@^0.0.8": version "0.0.8" resolved "https://registry.yarnpkg.com/@stacks/prettier-config/-/prettier-config-0.0.8.tgz#4db04dbca3982f74f4554ca522f37570125516e3" @@ -2530,6 +2560,28 @@ resolved "https://registry.yarnpkg.com/@stacks/stacks-blockchain-api-types/-/stacks-blockchain-api-types-0.61.0.tgz#f8bc61ad7781fdc0d9e9db711580db984f164e93" integrity sha512-yPOfTUboo5eA9BZL/hqMcM71GstrFs9YWzOrJFPeP4cOO1wgYvAcckgBRbgiE3NqeX0A7SLZLDAXLZbATuRq9w== +"@stacks/transactions@^1.0.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@stacks/transactions/-/transactions-1.4.1.tgz#7b1d046051065a28707bac58c39d021fa49575f4" + integrity sha512-7LFA9yQqlmN+oVJeYaj+NfZyuInJxF8ozJ8kypCmJ9rUrbbGC/es1KyseB96YBiiOh4eLUfRlD1j6boSdNR8aA== + dependencies: + "@stacks/common" "^1.2.2" + "@stacks/network" "^1.2.2" + "@types/bn.js" "^4.11.6" + "@types/elliptic" "^6.4.12" + "@types/randombytes" "^2.0.0" + "@types/sha.js" "^2.4.0" + bn.js "^4.11.9" + c32check "^1.1.1" + cross-fetch "^3.0.5" + elliptic "^6.5.3" + lodash "^4.17.20" + lodash-es "4.17.20" + randombytes "^2.1.0" + ripemd160-min "^0.0.6" + sha.js "^2.4.11" + smart-buffer "^4.1.0" + "@stacks/ui-core@7.3.0", "@stacks/ui-core@^7.3.0": version "7.3.0" resolved "https://registry.yarnpkg.com/@stacks/ui-core/-/ui-core-7.3.0.tgz#7d4dd4d60206e795ca6b7109dfbaea74f878fda2" @@ -2764,13 +2816,20 @@ resolved "https://registry.yarnpkg.com/@types/big.js/-/big.js-6.0.2.tgz#a86938c1bb4511e69d91f69823cacc3f48ff1fa3" integrity sha512-7NdmOT3zjtghMofDwP1nAJCJWVjc/96V5msXRAZ4lPrvpGlajA95VQec7OXwA2wQaVmhjt+F5ko8pjvQU1tTFA== -"@types/bn.js@5.1.0": +"@types/bn.js@*", "@types/bn.js@5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== dependencies: "@types/node" "*" +"@types/bn.js@^4.11.6": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + "@types/cheerio@*": version "0.22.28" resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.28.tgz#90808aabb44fec40fa2950f4c72351e3e4eb065b" @@ -2807,6 +2866,13 @@ dependencies: electron "*" +"@types/elliptic@^6.4.12": + version "6.4.12" + resolved "https://registry.yarnpkg.com/@types/elliptic/-/elliptic-6.4.12.tgz#e8add831f9cc9a88d9d84b3733ff669b68eaa124" + integrity sha512-gP1KsqoouLJGH6IJa28x7PXb3cRqh83X8HCLezd2dF+XcAIMKYv53KV+9Zn6QA561E120uOqZBQ+Jy/cl+fviw== + dependencies: + "@types/bn.js" "*" + "@types/enzyme-adapter-react-16@1.0.6": version "1.0.6" resolved "https://registry.yarnpkg.com/@types/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.0.6.tgz#8aca7ae2fd6c7137d869b6616e696d21bb8b0cec" @@ -2937,7 +3003,7 @@ "@types/ledgerhq__hw-transport" "*" "@types/node" "*" -"@types/ledgerhq__hw-transport@*", "@types/ledgerhq__hw-transport@^4.21.2": +"@types/ledgerhq__hw-transport@*", "@types/ledgerhq__hw-transport@^4.21.2", "@types/ledgerhq__hw-transport@^4.21.3": version "4.21.3" resolved "https://registry.yarnpkg.com/@types/ledgerhq__hw-transport/-/ledgerhq__hw-transport-4.21.3.tgz#1e658da6b5d01ffab92f9660cf57121aecfa7e2c" integrity sha512-6QveiZLsFLq9WZDk8HWAZhivoGzyz5S8WV36hpUe7KrVDaTR1fDdB+syorrNRhYbyjraAuUJrIdJR5p/7doq8g== @@ -3025,6 +3091,13 @@ version "0.25.0" resolved "https://codeload.github.com/types/npm-ramda/tar.gz/9529aa3c8ff70ff84afcbc0be83443c00f30ea90" +"@types/randombytes@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/randombytes/-/randombytes-2.0.0.tgz#0087ff5e60ae68023b9bc4398b406fea7ad18304" + integrity sha512-bz8PhAVlwN72vqefzxa14DKNT8jK/mV66CSjwdVQM/k3Th3EPKfUtdMniwZgMedQTFuywAsfjnZsg+pEnltaMA== + dependencies: + "@types/node" "*" + "@types/react-dom@17.0.3": version "17.0.3" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.3.tgz#7fdf37b8af9d6d40127137865bb3fff8871d7ee1" @@ -3093,6 +3166,13 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== +"@types/sha.js@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/sha.js/-/sha.js-2.4.0.tgz#bce682ef860b40f419d024fa08600c3b8d24bb01" + integrity sha512-amxKgPy6WJTKuw8mpUwjX2BSxuBtBmZfRwIUDIuPJKNwGN8CWDli8JTg5ONTWOtcTkHIstvT7oAhhYXqEjStHQ== + dependencies: + "@types/node" "*" + "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -3453,7 +3533,7 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -"@zondax/ledger-blockstack@0.1.0": +"@zondax/ledger-blockstack-legacy@npm:@zondax/ledger-blockstack@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@zondax/ledger-blockstack/-/ledger-blockstack-0.1.0.tgz#3e26bc39294a6921f1f169130d1f8874f6d43cdc" integrity sha512-FLRYFQISGeIIFXhYNSMFbbDbT9bgSDhIMvz/8buhn6p/WtbWmWbBaPUBCg8JrKW5NujdydibaESys1xOTg5CPw== @@ -3463,6 +3543,16 @@ "@types/ledgerhq__hw-transport" "^4.21.2" ts-jest "^26.1.4" +"@zondax/ledger-blockstack@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@zondax/ledger-blockstack/-/ledger-blockstack-0.2.0.tgz#901cffd445f14391d1d0e028c6c18a6b5c2e758d" + integrity sha512-e1Wdc+RCzGWY6n9T31Yukv9MVMHNmiZFW6MJxklWw/O49zG9wSPhOS2/LYpbZHywy0FeC1yJm+WX9RbMfAwYdA== + dependencies: + "@babel/runtime" "^7.12.5" + "@ledgerhq/hw-transport" "^5.39.1" + "@stacks/transactions" "^1.0.1" + "@types/ledgerhq__hw-transport" "^4.21.3" + JSONStream@^1.0.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -4521,7 +4611,7 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== -c32check@1.1.2, c32check@^1.1.2: +c32check@1.1.2, c32check@^1.1.1, c32check@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/c32check/-/c32check-1.1.2.tgz#e84a66366bf9964ddf8d7b1f86d0e79281b8c8bd" integrity sha512-YgmbvOQ9HfoH7ptW80JP6WJdgoHJFGqFjxaFYvwD+bU5i3dJ44a1LI0yxdiA2n/tVKq9W92tYcFjTP5hGlvhcg== @@ -5237,7 +5327,7 @@ cross-env@7.0.3: dependencies: cross-spawn "^7.0.1" -cross-fetch@^3.0.6: +cross-fetch@^3.0.5, cross-fetch@^3.0.6: version "3.1.4" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== @@ -8966,6 +9056,11 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash-es@4.17.20: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.20.tgz#29f6332eefc60e849f869c264bc71126ad61e8f7" + integrity sha512-JD1COMZsq8maT6mnuz1UMV0jvYD0E0aUsSOdrr1/nAG3dhqQXwRRgeW0cSqH1U43INKcqxaiVIQNOUDld7gRDA== + lodash-es@^4.17.14, lodash-es@^4.17.15: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" @@ -11071,6 +11166,11 @@ rimraf@^2.6.3: dependencies: glob "^7.1.3" +ripemd160-min@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/ripemd160-min/-/ripemd160-min-0.0.6.tgz#a904b77658114474d02503e819dcc55853b67e62" + integrity sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A== + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -11120,7 +11220,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@6.6.7, rxjs@^6.6.3, rxjs@^6.6.7: +rxjs@6, rxjs@6.6.7, rxjs@^6.6.3, rxjs@^6.6.7: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== @@ -11474,7 +11574,7 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -smart-buffer@^4.0.2: +smart-buffer@^4.0.2, smart-buffer@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.1.0.tgz#91605c25d91652f4661ea69ccf45f1b331ca21ba" integrity sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw== @@ -12257,9 +12357,9 @@ ts-jest@26.5.4: yargs-parser "20.x" ts-jest@^26.1.4: - version "26.5.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.5.tgz#e40481b6ee4dd162626ba481a2be05fa57160ea5" - integrity sha512-7tP4m+silwt1NHqzNRAPjW1BswnAhopTdc2K3HEkRZjF0ZG2F/e/ypVH0xiZIMfItFtD3CX0XFbwPzp9fIEUVg== + version "26.5.6" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.6.tgz#c32e0746425274e1dfe333f43cd3c800e014ec35" + integrity sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA== dependencies: bs-logger "0.x" buffer-from "1.x" From 74299e7135e87cc1a928227c9bf6dbf6b167583f Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Wed, 7 Jul 2021 13:49:02 +0200 Subject: [PATCH 03/16] chore: improve copy/user guidance --- .../delegated-stacking-info-card.tsx | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/app/pages/stacking/delegated-stacking/components/delegated-stacking-info-card.tsx b/app/pages/stacking/delegated-stacking/components/delegated-stacking-info-card.tsx index 9ac2be783..aff7878ea 100644 --- a/app/pages/stacking/delegated-stacking/components/delegated-stacking-info-card.tsx +++ b/app/pages/stacking/delegated-stacking/components/delegated-stacking-info-card.tsx @@ -13,6 +13,8 @@ import { parseNumericalFormInput } from '@utils/form/parse-numerical-form-input' import { stxToMicroStx, toHumanReadableStx } from '@utils/unit-convert'; import { truncateMiddle } from '@utils/tx-utils'; import { formatCycles } from '@utils/stacking'; +import { useCalculateFee } from '@hooks/use-calculate-fee'; +import { useWalletType } from '@hooks/use-wallet-type'; import { InfoCard, InfoCardLabel as Label, @@ -21,7 +23,8 @@ import { InfoCardValue as Value, InfoCardSection as Section, } from '../../../../components/info-card'; -import { useCalculateFee } from '@hooks/use-calculate-fee'; +import { useSelector } from 'react-redux'; +import { selectPoxInfo } from '@store/stacking'; interface PoolingInfoCardProps extends FlexProps { amount: string | number | null; @@ -35,6 +38,8 @@ export const PoolingInfoCard: FC = props => { const { amount, delegationType, poolStxAddress, durationInCycles, burnHeight, ...rest } = props; const calcFee = useCalculateFee(); + const { whenWallet } = useWalletType(); + const poxInfo = useSelector(selectPoxInfo); const amountToBeStacked = useMemo( () => stxToMicroStx(parseNumericalFormInput(amount)).integerValue(), @@ -92,11 +97,31 @@ export const PoolingInfoCard: FC = props => { {poolStxAddress ? truncateMiddle(poolStxAddress) : '—'} + + + {truncateMiddle(poxInfo?.contract_id ?? '')} +
- + {toHumanReadableStx(calcFee(POOLED_STACKING_TX_SIZE_BYTES))}
From 1bf257167283399a429ef720575896ede464e817 Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Wed, 7 Jul 2021 14:44:14 +0200 Subject: [PATCH 04/16] chore: revert packages --- package.json | 3 +- yarn.lock | 152 +++++++++------------------------------------------ 2 files changed, 27 insertions(+), 128 deletions(-) diff --git a/package.json b/package.json index 3ad8bb946..14e61d4cc 100644 --- a/package.json +++ b/package.json @@ -219,8 +219,7 @@ "@styled-system/theme-get": "5.1.2", "@tabler/icons": "1.40.2", "@tippyjs/react": "4.2.5", - "@zondax/ledger-blockstack-legacy": "npm:@zondax/ledger-blockstack@0.1.0", - "@zondax/ledger-blockstack": "0.2.0", + "@zondax/ledger-blockstack": "0.1.0", "argon2-browser": "1.15.3", "axios": "0.21.1", "bignumber.js": "9.0.1", diff --git a/yarn.lock b/yarn.lock index 82763c381..ed92addfb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1092,20 +1092,13 @@ pirates "^4.0.0" source-map-support "^0.5.16" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.5", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.10.5", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": version "7.13.17" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.17.tgz#8966d1fc9593bf848602f0662d6b4d0069e3a7ec" integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.3": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" - integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/template@^7.12.13", "@babel/template@^7.3.3": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" @@ -1698,20 +1691,20 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@ledgerhq/devices@^5.51.1": - version "5.51.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-5.51.1.tgz#d741a4a5d8f17c2f9d282fd27147e6fe1999edb7" - integrity sha512-4w+P0VkbjzEXC7kv8T1GJ/9AVaP9I6uasMZ/JcdwZBS3qwvKo5A5z9uGhP5c7TvItzcmPb44b5Mw2kT+WjUuAA== +"@ledgerhq/devices@^5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-5.49.0.tgz#86733944ea724acb974b136e46487a90ee0bfa6e" + integrity sha512-14VSO+NeR/O8VSXXnlBsA0DAluzanJVEjHLDJubU5NZjEttXVF9gdQh1j10+MKW0f8H23IkdqwswVQIB9ZPomQ== dependencies: - "@ledgerhq/errors" "^5.50.0" - "@ledgerhq/logs" "^5.50.0" - rxjs "6" + "@ledgerhq/errors" "^5.49.0" + "@ledgerhq/logs" "^5.49.0" + rxjs "^6.6.7" semver "^7.3.5" -"@ledgerhq/errors@^5.50.0": - version "5.50.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.50.0.tgz#e3a6834cb8c19346efca214c1af84ed28e69dad9" - integrity sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow== +"@ledgerhq/errors@^5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.49.0.tgz#8ecb43bb702504d9fc94ee12022d81d6e36cb5ce" + integrity sha512-+uhoSsAnzZiZ2CUk/dv4Uo8lrl0jn2izYJATSbC5aZFd0Yl7PWZ1SMHMkvPVEgQvWZcu4iQZ67rlKOtj5tUFWA== "@ledgerhq/hw-transport@^5.17.0": version "5.49.0" @@ -1722,19 +1715,10 @@ "@ledgerhq/errors" "^5.49.0" events "^3.3.0" -"@ledgerhq/hw-transport@^5.39.1": - version "5.51.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz#8dd14a8e58cbee4df0c29eaeef983a79f5f22578" - integrity sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw== - dependencies: - "@ledgerhq/devices" "^5.51.1" - "@ledgerhq/errors" "^5.50.0" - events "^3.3.0" - -"@ledgerhq/logs@^5.50.0": - version "5.50.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.50.0.tgz#29c6419e8379d496ab6d0426eadf3c4d100cd186" - integrity sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA== +"@ledgerhq/logs@^5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.49.0.tgz#e14e34df1605c17d6b90eb32c591c7b3de3fbae8" + integrity sha512-Ynl2JzRwh8l9PoXrDNihXEicpVo6Ra2lYZoqSYfVH/v/2/TSa/JB9Qll8P85XFYkS3ouDTTbp1S5KViaTkqD5g== "@malept/cross-spawn-promise@^1.1.0": version "1.1.1" @@ -2520,13 +2504,6 @@ jsonrpc-lite "^2.2.0" ws "^7.4.0" -"@stacks/common@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@stacks/common/-/common-1.2.2.tgz#1365ffb0f8bd9e4cd194c63c65a1bb2c83876ba1" - integrity sha512-knCqq88EBRCN8AhS7+Sx2PJuRv0EFNChEpqLqCAchCHCQfp5bWad/47Zw+fLP9ccBwFXh4pl1wDtbQLBfDo0+A== - dependencies: - cross-fetch "^3.0.6" - "@stacks/eslint-config@1.0.9": version "1.0.9" resolved "https://registry.yarnpkg.com/@stacks/eslint-config/-/eslint-config-1.0.9.tgz#824b3996773dadfe231302522f8d66fe30f677b5" @@ -2541,13 +2518,6 @@ eslint-plugin-import ">=2.23.3" eslint-plugin-prettier "^3.4.0" -"@stacks/network@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@stacks/network/-/network-1.2.2.tgz#30ca87ad6339f32eb04ed3a9dbcc2e39ed933604" - integrity sha512-xcWwuRrLJn9qqi3PEBcP2UPZHQztTZd31C0aVlzYHttNMir/sY9SrUqSnw45z2Jo4O9pIYYPIiPRtdV91Ho3fw== - dependencies: - "@stacks/common" "^1.2.2" - "@stacks/prettier-config@0.0.8", "@stacks/prettier-config@^0.0.8": version "0.0.8" resolved "https://registry.yarnpkg.com/@stacks/prettier-config/-/prettier-config-0.0.8.tgz#4db04dbca3982f74f4554ca522f37570125516e3" @@ -2560,28 +2530,6 @@ resolved "https://registry.yarnpkg.com/@stacks/stacks-blockchain-api-types/-/stacks-blockchain-api-types-0.61.0.tgz#f8bc61ad7781fdc0d9e9db711580db984f164e93" integrity sha512-yPOfTUboo5eA9BZL/hqMcM71GstrFs9YWzOrJFPeP4cOO1wgYvAcckgBRbgiE3NqeX0A7SLZLDAXLZbATuRq9w== -"@stacks/transactions@^1.0.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@stacks/transactions/-/transactions-1.4.1.tgz#7b1d046051065a28707bac58c39d021fa49575f4" - integrity sha512-7LFA9yQqlmN+oVJeYaj+NfZyuInJxF8ozJ8kypCmJ9rUrbbGC/es1KyseB96YBiiOh4eLUfRlD1j6boSdNR8aA== - dependencies: - "@stacks/common" "^1.2.2" - "@stacks/network" "^1.2.2" - "@types/bn.js" "^4.11.6" - "@types/elliptic" "^6.4.12" - "@types/randombytes" "^2.0.0" - "@types/sha.js" "^2.4.0" - bn.js "^4.11.9" - c32check "^1.1.1" - cross-fetch "^3.0.5" - elliptic "^6.5.3" - lodash "^4.17.20" - lodash-es "4.17.20" - randombytes "^2.1.0" - ripemd160-min "^0.0.6" - sha.js "^2.4.11" - smart-buffer "^4.1.0" - "@stacks/ui-core@7.3.0", "@stacks/ui-core@^7.3.0": version "7.3.0" resolved "https://registry.yarnpkg.com/@stacks/ui-core/-/ui-core-7.3.0.tgz#7d4dd4d60206e795ca6b7109dfbaea74f878fda2" @@ -2816,20 +2764,13 @@ resolved "https://registry.yarnpkg.com/@types/big.js/-/big.js-6.0.2.tgz#a86938c1bb4511e69d91f69823cacc3f48ff1fa3" integrity sha512-7NdmOT3zjtghMofDwP1nAJCJWVjc/96V5msXRAZ4lPrvpGlajA95VQec7OXwA2wQaVmhjt+F5ko8pjvQU1tTFA== -"@types/bn.js@*", "@types/bn.js@5.1.0": +"@types/bn.js@5.1.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== dependencies: "@types/node" "*" -"@types/bn.js@^4.11.6": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" - "@types/cheerio@*": version "0.22.28" resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.28.tgz#90808aabb44fec40fa2950f4c72351e3e4eb065b" @@ -2866,13 +2807,6 @@ dependencies: electron "*" -"@types/elliptic@^6.4.12": - version "6.4.12" - resolved "https://registry.yarnpkg.com/@types/elliptic/-/elliptic-6.4.12.tgz#e8add831f9cc9a88d9d84b3733ff669b68eaa124" - integrity sha512-gP1KsqoouLJGH6IJa28x7PXb3cRqh83X8HCLezd2dF+XcAIMKYv53KV+9Zn6QA561E120uOqZBQ+Jy/cl+fviw== - dependencies: - "@types/bn.js" "*" - "@types/enzyme-adapter-react-16@1.0.6": version "1.0.6" resolved "https://registry.yarnpkg.com/@types/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.0.6.tgz#8aca7ae2fd6c7137d869b6616e696d21bb8b0cec" @@ -3003,7 +2937,7 @@ "@types/ledgerhq__hw-transport" "*" "@types/node" "*" -"@types/ledgerhq__hw-transport@*", "@types/ledgerhq__hw-transport@^4.21.2", "@types/ledgerhq__hw-transport@^4.21.3": +"@types/ledgerhq__hw-transport@*", "@types/ledgerhq__hw-transport@^4.21.2": version "4.21.3" resolved "https://registry.yarnpkg.com/@types/ledgerhq__hw-transport/-/ledgerhq__hw-transport-4.21.3.tgz#1e658da6b5d01ffab92f9660cf57121aecfa7e2c" integrity sha512-6QveiZLsFLq9WZDk8HWAZhivoGzyz5S8WV36hpUe7KrVDaTR1fDdB+syorrNRhYbyjraAuUJrIdJR5p/7doq8g== @@ -3091,13 +3025,6 @@ version "0.25.0" resolved "https://codeload.github.com/types/npm-ramda/tar.gz/9529aa3c8ff70ff84afcbc0be83443c00f30ea90" -"@types/randombytes@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/randombytes/-/randombytes-2.0.0.tgz#0087ff5e60ae68023b9bc4398b406fea7ad18304" - integrity sha512-bz8PhAVlwN72vqefzxa14DKNT8jK/mV66CSjwdVQM/k3Th3EPKfUtdMniwZgMedQTFuywAsfjnZsg+pEnltaMA== - dependencies: - "@types/node" "*" - "@types/react-dom@17.0.3": version "17.0.3" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.3.tgz#7fdf37b8af9d6d40127137865bb3fff8871d7ee1" @@ -3166,13 +3093,6 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== -"@types/sha.js@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@types/sha.js/-/sha.js-2.4.0.tgz#bce682ef860b40f419d024fa08600c3b8d24bb01" - integrity sha512-amxKgPy6WJTKuw8mpUwjX2BSxuBtBmZfRwIUDIuPJKNwGN8CWDli8JTg5ONTWOtcTkHIstvT7oAhhYXqEjStHQ== - dependencies: - "@types/node" "*" - "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -3533,7 +3453,7 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -"@zondax/ledger-blockstack-legacy@npm:@zondax/ledger-blockstack@0.1.0": +"@zondax/ledger-blockstack@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@zondax/ledger-blockstack/-/ledger-blockstack-0.1.0.tgz#3e26bc39294a6921f1f169130d1f8874f6d43cdc" integrity sha512-FLRYFQISGeIIFXhYNSMFbbDbT9bgSDhIMvz/8buhn6p/WtbWmWbBaPUBCg8JrKW5NujdydibaESys1xOTg5CPw== @@ -3543,16 +3463,6 @@ "@types/ledgerhq__hw-transport" "^4.21.2" ts-jest "^26.1.4" -"@zondax/ledger-blockstack@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@zondax/ledger-blockstack/-/ledger-blockstack-0.2.0.tgz#901cffd445f14391d1d0e028c6c18a6b5c2e758d" - integrity sha512-e1Wdc+RCzGWY6n9T31Yukv9MVMHNmiZFW6MJxklWw/O49zG9wSPhOS2/LYpbZHywy0FeC1yJm+WX9RbMfAwYdA== - dependencies: - "@babel/runtime" "^7.12.5" - "@ledgerhq/hw-transport" "^5.39.1" - "@stacks/transactions" "^1.0.1" - "@types/ledgerhq__hw-transport" "^4.21.3" - JSONStream@^1.0.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -4611,7 +4521,7 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== -c32check@1.1.2, c32check@^1.1.1, c32check@^1.1.2: +c32check@1.1.2, c32check@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/c32check/-/c32check-1.1.2.tgz#e84a66366bf9964ddf8d7b1f86d0e79281b8c8bd" integrity sha512-YgmbvOQ9HfoH7ptW80JP6WJdgoHJFGqFjxaFYvwD+bU5i3dJ44a1LI0yxdiA2n/tVKq9W92tYcFjTP5hGlvhcg== @@ -5327,7 +5237,7 @@ cross-env@7.0.3: dependencies: cross-spawn "^7.0.1" -cross-fetch@^3.0.5, cross-fetch@^3.0.6: +cross-fetch@^3.0.6: version "3.1.4" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== @@ -9056,11 +8966,6 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash-es@4.17.20: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.20.tgz#29f6332eefc60e849f869c264bc71126ad61e8f7" - integrity sha512-JD1COMZsq8maT6mnuz1UMV0jvYD0E0aUsSOdrr1/nAG3dhqQXwRRgeW0cSqH1U43INKcqxaiVIQNOUDld7gRDA== - lodash-es@^4.17.14, lodash-es@^4.17.15: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" @@ -11166,11 +11071,6 @@ rimraf@^2.6.3: dependencies: glob "^7.1.3" -ripemd160-min@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/ripemd160-min/-/ripemd160-min-0.0.6.tgz#a904b77658114474d02503e819dcc55853b67e62" - integrity sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A== - ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -11220,7 +11120,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@6, rxjs@6.6.7, rxjs@^6.6.3, rxjs@^6.6.7: +rxjs@6.6.7, rxjs@^6.6.3, rxjs@^6.6.7: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== @@ -11574,7 +11474,7 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -smart-buffer@^4.0.2, smart-buffer@^4.1.0: +smart-buffer@^4.0.2: version "4.1.0" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.1.0.tgz#91605c25d91652f4661ea69ccf45f1b331ca21ba" integrity sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw== @@ -12357,9 +12257,9 @@ ts-jest@26.5.4: yargs-parser "20.x" ts-jest@^26.1.4: - version "26.5.6" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.6.tgz#c32e0746425274e1dfe333f43cd3c800e014ec35" - integrity sha512-rua+rCP8DxpA8b4DQD/6X2HQS8Zy/xzViVYfEs2OQu68tkCuKLV0Md8pmX55+W24uRIyAsf/BajRfxOs+R2MKA== + version "26.5.5" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.5.tgz#e40481b6ee4dd162626ba481a2be05fa57160ea5" + integrity sha512-7tP4m+silwt1NHqzNRAPjW1BswnAhopTdc2K3HEkRZjF0ZG2F/e/ypVH0xiZIMfItFtD3CX0XFbwPzp9fIEUVg== dependencies: bs-logger "0.x" buffer-from "1.x" From a1fde6362647ed502518901077d1dcc088a38a67 Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Wed, 7 Jul 2021 15:06:47 +0200 Subject: [PATCH 05/16] chore: upgrade ledger package --- app/constants/index.ts | 2 +- app/modals/receive-stx/receive-stx-modal.tsx | 9 +- package.json | 2 +- yarn.lock | 162 +++++++++++++------ 4 files changed, 117 insertions(+), 58 deletions(-) diff --git a/app/constants/index.ts b/app/constants/index.ts index 80f3734bc..d8568f56a 100644 --- a/app/constants/index.ts +++ b/app/constants/index.ts @@ -68,7 +68,7 @@ export const SUPPORTED_BTC_ADDRESS_FORMATS = ['p2pkh', 'p2sh'] as const; export const LATEST_LEDGER_VERSION_MAJOR = 0; -export const LATEST_LEDGER_VERSION_MINOR = 13; +export const LATEST_LEDGER_VERSION_MINOR = 14; export const SUPPORTED_LEDGER_VERSIONS_MINOR = [11, LATEST_LEDGER_VERSION_MINOR]; diff --git a/app/modals/receive-stx/receive-stx-modal.tsx b/app/modals/receive-stx/receive-stx-modal.tsx index 5303a94a8..b6916c2ec 100644 --- a/app/modals/receive-stx/receive-stx-modal.tsx +++ b/app/modals/receive-stx/receive-stx-modal.tsx @@ -22,10 +22,11 @@ export const ReceiveStxModal: FC<{ isOpen: boolean }> = memo(({ isOpen }) => { return ( Receive STX - {whenWallet({ - ledger: , - software: , - })} + {isOpen && + whenWallet({ + ledger: , + software: , + })}