From 35cafb1453737f5ac15e56de18047875b0535126 Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Thu, 9 Jan 2025 01:23:54 +0400 Subject: [PATCH 1/2] feat: keystore import (#8442) --- package.json | 24 +- src/assets/translations/en/main.json | 16 +- .../components/NativeImportKeystore.tsx | 216 ++++++++++++++++++ ...{NativeImport.tsx => NativeImportSeed.tsx} | 4 +- .../components/NativeImportSelect.tsx | 81 +++++++ .../NativeWallet/components/NativeStart.tsx | 7 +- .../WalletProvider/NativeWallet/types.ts | 1 + .../WalletProvider/WalletProvider.test.tsx | 2 +- src/context/WalletProvider/config.ts | 22 +- src/context/WalletProvider/types.ts | 4 +- src/lib/mixpanel/types.ts | 3 +- yarn.lock | 192 +++++++--------- 12 files changed, 435 insertions(+), 137 deletions(-) create mode 100644 src/context/WalletProvider/NativeWallet/components/NativeImportKeystore.tsx rename src/context/WalletProvider/NativeWallet/components/{NativeImport.tsx => NativeImportSeed.tsx} (96%) create mode 100644 src/context/WalletProvider/NativeWallet/components/NativeImportSelect.tsx diff --git a/package.json b/package.json index 90b07e54199..0a3ac123036 100644 --- a/package.json +++ b/package.json @@ -94,18 +94,18 @@ "@shapeshiftoss/caip": "workspace:^", "@shapeshiftoss/chain-adapters": "workspace:^", "@shapeshiftoss/errors": "workspace:^", - "@shapeshiftoss/hdwallet-coinbase": "1.57.1", - "@shapeshiftoss/hdwallet-core": "1.57.1", - "@shapeshiftoss/hdwallet-keepkey": "1.57.1", - "@shapeshiftoss/hdwallet-keepkey-webusb": "1.57.1", - "@shapeshiftoss/hdwallet-keplr": "1.57.1", - "@shapeshiftoss/hdwallet-ledger": "1.57.1", - "@shapeshiftoss/hdwallet-ledger-webusb": "1.57.1", - "@shapeshiftoss/hdwallet-metamask-multichain": "1.57.1", - "@shapeshiftoss/hdwallet-native": "1.57.1", - "@shapeshiftoss/hdwallet-native-vault": "1.57.1", - "@shapeshiftoss/hdwallet-phantom": "1.57.1", - "@shapeshiftoss/hdwallet-walletconnectv2": "1.57.1", + "@shapeshiftoss/hdwallet-coinbase": "1.58.0", + "@shapeshiftoss/hdwallet-core": "1.58.0", + "@shapeshiftoss/hdwallet-keepkey": "1.58.0", + "@shapeshiftoss/hdwallet-keepkey-webusb": "1.58.0", + "@shapeshiftoss/hdwallet-keplr": "1.58.0", + "@shapeshiftoss/hdwallet-ledger": "1.58.0", + "@shapeshiftoss/hdwallet-ledger-webusb": "1.58.0", + "@shapeshiftoss/hdwallet-metamask-multichain": "1.58.0", + "@shapeshiftoss/hdwallet-native": "1.58.0", + "@shapeshiftoss/hdwallet-native-vault": "1.58.0", + "@shapeshiftoss/hdwallet-phantom": "1.58.0", + "@shapeshiftoss/hdwallet-walletconnectv2": "1.58.0", "@shapeshiftoss/swapper": "workspace:^", "@shapeshiftoss/types": "workspace:^", "@shapeshiftoss/unchained-client": "workspace:^", diff --git a/src/assets/translations/en/main.json b/src/assets/translations/en/main.json index fc93b7fa16c..055fe7d2d3b 100644 --- a/src/assets/translations/en/main.json +++ b/src/assets/translations/en/main.json @@ -1744,11 +1744,16 @@ }, "import": { "header": "Import your wallet", + "keystoreHeader": "Import your keystore wallet", "body": "Type or paste your Secret Recovery Phrase in all lower case with no commas or numbers and a single space between each word.", "button": "Next", "secretRecoveryPhraseError": "Enter your Secret Recovery Phrase with a single space in between words. Omit any commas, returns, or any additional characters.", "secretRecoveryPhraseRequired": "Secret Recovery Phrase is required", - "secretRecoveryPhraseTooShort": "Secret Recovery Phrase is too short" + "secretRecoveryPhraseTooShort": "Secret Recovery Phrase is too short", + "dragAndDrop": "Drag & Drop or Choose File", + "keystoreImportBody": "Upload file by clicking browse or by dragging and dropping below.", + "importKeystore": "Import Keystore", + "invalidKeystorePassword": "Invalid keystore password" }, "password": { "header": "Create a New Password", @@ -1766,10 +1771,17 @@ }, "start": { "header": "ShapeShift Wallet", + "selectHeader": "Import Wallet", + "keystoreHeader": "Keystore Wallet", "body": "You can have multiple ShapeShift wallets. You may load a wallet, import a wallet from a Secret Recovery Phrase, or create a new wallet.", + "selectBody": "Import wallet using your Secret Recovery Phrase or by uploading your keystore file.", "import": "Import a wallet", + "secretRecoveryPhrase": "Secret Recovery Phrase", + "twelveWordSeedPhrase": "12 word seed phrase", + "keystore": "Keystore", "create": "Create a new wallet", - "load": "Saved wallets" + "load": "Saved wallets", + "uploadKeystore": "Upload Keystore File" }, "success": { "encryptingWallet": "Encrypting your wallet... if your browser asks to store data in persistent storage, please click 'Allow'.", diff --git a/src/context/WalletProvider/NativeWallet/components/NativeImportKeystore.tsx b/src/context/WalletProvider/NativeWallet/components/NativeImportKeystore.tsx new file mode 100644 index 00000000000..ed4e2671c01 --- /dev/null +++ b/src/context/WalletProvider/NativeWallet/components/NativeImportKeystore.tsx @@ -0,0 +1,216 @@ +import { + Box, + Button, + FormControl, + FormErrorMessage, + Icon, + Input, + ModalBody, + ModalHeader, + Text as CText, + useColorModeValue, + VStack, +} from '@chakra-ui/react' +import { useCallback, useState } from 'react' +import type { FieldValues } from 'react-hook-form' +import { useForm } from 'react-hook-form' +import { FaFile } from 'react-icons/fa' +import { useTranslate } from 'react-polyglot' +import type { RouteComponentProps } from 'react-router-dom' +import { Text } from 'components/Text' +import { NativeWalletRoutes } from 'context/WalletProvider/types' +import { getMixPanel } from 'lib/mixpanel/mixPanelSingleton' +import { MixPanelEvent } from 'lib/mixpanel/types' + +import type { NativeWalletValues } from '../types' + +const hoverSx = { borderColor: 'blue.500' } + +// TODO(gomes): use https://www.chakra-ui.com/docs/components/file-upload if/when we migrate to chakra@3 +const FileUpload = ({ onFileSelect }: { onFileSelect: (file: File) => void }) => { + const bgColor = useColorModeValue('gray.50', 'gray.800') + const borderColor = useColorModeValue('gray.200', 'gray.600') + const [isDragging, setIsDragging] = useState(false) + const [filename, setFilename] = useState(null) + + const handleDragEnter = useCallback((e: React.DragEvent) => { + e.preventDefault() + e.stopPropagation() + setIsDragging(true) + }, []) + + const handleDragLeave = useCallback((e: React.DragEvent) => { + e.preventDefault() + e.stopPropagation() + setIsDragging(false) + }, []) + + const handleDragOver = useCallback((e: React.DragEvent) => { + e.preventDefault() + e.stopPropagation() + }, []) + + const processFile = useCallback( + (file: File) => { + setFilename(file.name) + onFileSelect(file) + }, + [onFileSelect], + ) + + const handleDrop = useCallback( + (e: React.DragEvent) => { + e.preventDefault() + e.stopPropagation() + setIsDragging(false) + + const files = e.dataTransfer.files + if (files?.[0]) { + processFile(files[0]) + } + }, + [processFile], + ) + + const handleFileInput = useCallback( + (e: React.ChangeEvent) => { + const files = e.target.files + if (files?.[0]) { + processFile(files[0]) + } + }, + [processFile], + ) + + return ( + + + + + {filename ? ( + {filename} + ) : ( + + )} + + + ) +} + +export const NativeImportKeystore = ({ history }: RouteComponentProps) => { + const [keystoreFile, setKeystoreFile] = useState(null) + const mixpanel = getMixPanel() + + const translate = useTranslate() + + const { + setError, + handleSubmit, + formState: { errors, isSubmitting }, + register, + } = useForm({ shouldUnregister: true }) + + const onSubmit = useCallback( + async (values: FieldValues) => { + const { Vault } = await import('@shapeshiftoss/hdwallet-native-vault') + const vault = await Vault.create() + vault.meta.set('createdAt', Date.now()) + + if (!keystoreFile) { + throw new Error('No keystore uploaded') + } + + try { + await vault.loadFromKeystore(keystoreFile, values.keystorePassword) + } catch (e) { + setError('keystorePassword', { + type: 'manual', + message: translate('walletProvider.shapeShift.import.invalidKeystorePassword'), + }) + return + } + + history.push(NativeWalletRoutes.Password, { vault }) + mixpanel?.track(MixPanelEvent.NativeImportKeystore) + }, + [history, keystoreFile, mixpanel, setError, translate], + ) + + const handleFileSelect = useCallback((file: File) => { + const reader = new FileReader() + reader.onload = e => { + if (!e?.target) return + if (typeof e.target.result !== 'string') return + setKeystoreFile(e.target.result) + } + reader.readAsText(file) + }, []) + + return ( + <> + + + + + + +
+ + + + {keystoreFile && ( + <> + + + {errors.keystorePassword?.message} + + + + + )} + +
+
+ + ) +} diff --git a/src/context/WalletProvider/NativeWallet/components/NativeImport.tsx b/src/context/WalletProvider/NativeWallet/components/NativeImportSeed.tsx similarity index 96% rename from src/context/WalletProvider/NativeWallet/components/NativeImport.tsx rename to src/context/WalletProvider/NativeWallet/components/NativeImportSeed.tsx index c37b534e3a9..695d2a6c2b8 100644 --- a/src/context/WalletProvider/NativeWallet/components/NativeImport.tsx +++ b/src/context/WalletProvider/NativeWallet/components/NativeImportSeed.tsx @@ -19,7 +19,7 @@ import { MixPanelEvent } from 'lib/mixpanel/types' import type { NativeWalletValues } from '../types' -export const NativeImport = ({ history }: RouteComponentProps) => { +export const NativeImportSeed = ({ history }: RouteComponentProps) => { const mixpanel = getMixPanel() const { @@ -37,7 +37,7 @@ export const NativeImport = ({ history }: RouteComponentProps) => { vault.meta.set('createdAt', Date.now()) vault.set('#mnemonic', values.mnemonic.toLowerCase().trim()) history.push(NativeWalletRoutes.Password, { vault }) - mixpanel?.track(MixPanelEvent.NativeImport) + mixpanel?.track(MixPanelEvent.NativeImportSeed) } catch (e) { setError('mnemonic', { type: 'manual', message: 'walletProvider.shapeShift.import.header' }) } diff --git a/src/context/WalletProvider/NativeWallet/components/NativeImportSelect.tsx b/src/context/WalletProvider/NativeWallet/components/NativeImportSelect.tsx new file mode 100644 index 00000000000..82bff9ca84a --- /dev/null +++ b/src/context/WalletProvider/NativeWallet/components/NativeImportSelect.tsx @@ -0,0 +1,81 @@ +import { ArrowForwardIcon } from '@chakra-ui/icons' +import { Button, HStack, ModalBody, ModalHeader, Stack, VStack } from '@chakra-ui/react' +import { useCallback } from 'react' +import { FaFile, FaKey } from 'react-icons/fa' +import type { RouteComponentProps } from 'react-router' +import { Text } from 'components/Text' +import { NativeWalletRoutes } from 'context/WalletProvider/types' + +const arrowForwardIcon = + +export const NativeImportSelect = ({ history }: RouteComponentProps) => { + const handleImportKeystoreClick = useCallback( + () => history.push(NativeWalletRoutes.ImportKeystore), + [history], + ) + const handleImportSeedClick = useCallback( + () => history.push(NativeWalletRoutes.ImportSeed), + [history], + ) + + return ( + <> + + + + + + + + + + + + ) +} diff --git a/src/context/WalletProvider/NativeWallet/components/NativeStart.tsx b/src/context/WalletProvider/NativeWallet/components/NativeStart.tsx index 9a57c498f95..af3fbf2e700 100644 --- a/src/context/WalletProvider/NativeWallet/components/NativeStart.tsx +++ b/src/context/WalletProvider/NativeWallet/components/NativeStart.tsx @@ -34,7 +34,10 @@ export const NativeStart = ({ history }: RouteComponentProps) => { const handleLoad = useCallback(() => history.push(NativeWalletRoutes.Load), [history]) const handleCreate = useCallback(() => history.push(NativeWalletRoutes.Create), [history]) - const handleImport = useCallback(() => history.push(NativeWalletRoutes.Import), [history]) + const handleImportClick = useCallback( + () => history.push(NativeWalletRoutes.ImportSelect), + [history], + ) const handleLogin = useCallback(() => history.push(NativeWalletRoutes.LegacyLogin), [history]) return ( @@ -78,7 +81,7 @@ export const NativeStart = ({ history }: RouteComponentProps) => { py={4} justifyContent='space-between' rightIcon={arrowForwardIcon} - onClick={handleImport} + onClick={handleImportClick} data-test='wallet-native-import-button' > diff --git a/src/context/WalletProvider/NativeWallet/types.ts b/src/context/WalletProvider/NativeWallet/types.ts index 95cd8a18f95..f8adc9d889a 100644 --- a/src/context/WalletProvider/NativeWallet/types.ts +++ b/src/context/WalletProvider/NativeWallet/types.ts @@ -8,6 +8,7 @@ export type NativeWalletValues = { password: string email: string twoFactorCode: string + keystorePassword: string mnemonic: string message: string confirmPassword: string diff --git a/src/context/WalletProvider/WalletProvider.test.tsx b/src/context/WalletProvider/WalletProvider.test.tsx index dba7a170744..6fe622ca385 100644 --- a/src/context/WalletProvider/WalletProvider.test.tsx +++ b/src/context/WalletProvider/WalletProvider.test.tsx @@ -151,7 +151,7 @@ describe('WalletProvider', () => { }) expect(result.current.state.modalType).toBe(type) - expect(result.current.state.initialRoute).toBe(SUPPORTED_WALLETS[type].routes[5].path) + expect(result.current.state.initialRoute).toBe('/native/create') }) }) diff --git a/src/context/WalletProvider/config.ts b/src/context/WalletProvider/config.ts index a6aad14ba47..dae5ba48cb7 100644 --- a/src/context/WalletProvider/config.ts +++ b/src/context/WalletProvider/config.ts @@ -52,6 +52,12 @@ const NativeStart = lazy(() => default: NativeStart, })), ) +const NativeImportSelect = lazy(() => + import('./NativeWallet/components/NativeImportSelect').then(({ NativeImportSelect }) => ({ + default: NativeImportSelect, + })), +) + const NativeRename = lazy(() => import('./NativeWallet/components/NativeRename').then(({ NativeRename }) => ({ default: NativeRename, @@ -77,11 +83,17 @@ const NativeCreate = lazy(() => default: NativeCreate, })), ) -const NativeImport = lazy(() => - import('./NativeWallet/components/NativeImport').then(({ NativeImport }) => ({ - default: NativeImport, +const NativeImportSeed = lazy(() => + import('./NativeWallet/components/NativeImportSeed').then(({ NativeImportSeed }) => ({ + default: NativeImportSeed, })), ) +const NativeImportKeystore = lazy(() => + import('./NativeWallet/components/NativeImportKeystore').then(({ NativeImportKeystore }) => ({ + default: NativeImportKeystore, + })), +) + const NativeLegacyLogin = lazy(() => import('./NativeWallet/components/NativeLegacyLogin').then(({ NativeLegacyLogin }) => ({ default: NativeLegacyLogin, @@ -360,7 +372,9 @@ export const SUPPORTED_WALLETS: SupportedWalletInfoByKeyManager = { { path: NativeWalletRoutes.Load, component: NativeLoad }, { path: NativeWalletRoutes.Password, component: NativePassword }, { path: NativeWalletRoutes.Rename, component: NativeRename }, - { path: NativeWalletRoutes.Import, component: NativeImport }, + { path: NativeWalletRoutes.ImportSelect, component: NativeImportSelect }, + { path: NativeWalletRoutes.ImportSeed, component: NativeImportSeed }, + { path: NativeWalletRoutes.ImportKeystore, component: NativeImportKeystore }, { path: NativeWalletRoutes.Create, component: NativeCreate }, { path: NativeWalletRoutes.CreateTest, component: NativeTestPhrase }, { path: NativeWalletRoutes.Success, component: NativeSuccess }, diff --git a/src/context/WalletProvider/types.ts b/src/context/WalletProvider/types.ts index 4656f390fee..f8bf03560ba 100644 --- a/src/context/WalletProvider/types.ts +++ b/src/context/WalletProvider/types.ts @@ -28,7 +28,9 @@ export enum NativeWalletRoutes { Load = '/native/load', Password = '/native/password', Rename = '/native/rename', - Import = '/native/import', + ImportSelect = '/native/import-select', + ImportSeed = '/native/import-seed', + ImportKeystore = '/native/import-keystore', Create = '/native/create', CreateTest = '/native/create-test', Success = '/native/success', diff --git a/src/lib/mixpanel/types.ts b/src/lib/mixpanel/types.ts index fe05fd28170..adc1864cb27 100644 --- a/src/lib/mixpanel/types.ts +++ b/src/lib/mixpanel/types.ts @@ -42,7 +42,8 @@ export enum MixPanelEvent { SwitchWallet = 'Switch Wallet', DisconnectWallet = 'Disconnect Wallet', FiatRamp = 'Fiat Ramp', - NativeImport = 'Native Import', + NativeImportSeed = 'Native Import Seed', + NativeImportKeystore = 'Native Import Keystore', NativeCreate = 'Native Create', Click = 'Click', ClickdApp = 'Click dApp', diff --git a/yarn.lock b/yarn.lock index a59adb24f5c..b0e3cd6089e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11376,15 +11376,15 @@ __metadata: languageName: node linkType: hard -"@shapeshiftoss/hdwallet-coinbase@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-coinbase@npm:1.57.1" +"@shapeshiftoss/hdwallet-coinbase@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-coinbase@npm:1.58.0" dependencies: "@coinbase/wallet-sdk": ^3.6.6 - "@shapeshiftoss/hdwallet-core": 1.57.1 + "@shapeshiftoss/hdwallet-core": 1.58.0 eth-rpc-errors: ^4.0.3 lodash: ^4.17.21 - checksum: ebfd1e44c38ddb4c25fd43a5f9993d26939107a6590f7f627ff8622e0ccbc236cee1f218868538ca5aefb8131fe7a04584c70aacc540c0276200ea0bef5984e9 + checksum: 18d38de7cf9044e520152bb7f1ad239d6fb5266c1b1358505ef91572b3c98396fc9e4b52839fa9fd4565b41f8320f0982d6566cbd4d401411eb21769e0084e42 languageName: node linkType: hard @@ -11400,50 +11400,50 @@ __metadata: languageName: node linkType: hard -"@shapeshiftoss/hdwallet-core@npm:1.55.1, @shapeshiftoss/hdwallet-core@npm:^1.55.1": - version: 1.55.1 - resolution: "@shapeshiftoss/hdwallet-core@npm:1.55.1" +"@shapeshiftoss/hdwallet-core@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-core@npm:1.58.0" dependencies: + "@shapeshiftoss/bitcoinjs-lib": 7.0.0-shapeshift.0 "@shapeshiftoss/proto-tx-builder": ^0.8.0 + "@solana/web3.js": 1.95.8 eip-712: ^1.0.0 + ethers: 5.7.2 eventemitter2: ^5.0.1 lodash: ^4.17.21 rxjs: ^6.4.0 type-assertions: ^1.1.0 - checksum: 8b100097dfc6a5661f1ee7e2bceb91e196813f9aee174cdc7313507017d0ecc4d80476b415d1e6791313b946a3fc8e8329eb939b91cdb57070b7d9e3e8847568 + checksum: 3068b30958cb404a3625e91a5388a5d2403ddb20fa0776c561c38db3899f68bc9632106fac97e76faad6f4730fffa15df2ea11c87b319b3c1ebc6740d0a08688 languageName: node linkType: hard -"@shapeshiftoss/hdwallet-core@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-core@npm:1.57.1" +"@shapeshiftoss/hdwallet-core@npm:^1.55.1": + version: 1.55.1 + resolution: "@shapeshiftoss/hdwallet-core@npm:1.55.1" dependencies: - "@shapeshiftoss/bitcoinjs-lib": 7.0.0-shapeshift.0 "@shapeshiftoss/proto-tx-builder": ^0.8.0 - "@solana/web3.js": 1.95.8 eip-712: ^1.0.0 - ethers: 5.7.2 eventemitter2: ^5.0.1 lodash: ^4.17.21 rxjs: ^6.4.0 type-assertions: ^1.1.0 - checksum: dcff52cb673cef9a9de8bc810154e3aab39324191740305605aa266af6f09999028eb2790d6d126a940261f3be32c077a0f3c7985bb340e645d48e05c8745630 + checksum: 8b100097dfc6a5661f1ee7e2bceb91e196813f9aee174cdc7313507017d0ecc4d80476b415d1e6791313b946a3fc8e8329eb939b91cdb57070b7d9e3e8847568 languageName: node linkType: hard -"@shapeshiftoss/hdwallet-keepkey-webusb@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-keepkey-webusb@npm:1.57.1" +"@shapeshiftoss/hdwallet-keepkey-webusb@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-keepkey-webusb@npm:1.58.0" dependencies: - "@shapeshiftoss/hdwallet-core": 1.57.1 - "@shapeshiftoss/hdwallet-keepkey": 1.57.1 - checksum: 17e5b69407bbad192031fcac57795531513fa060011b3dd3a8c149e3707fc79e95b2eda7922199094e6e8c401125a29fa42b1a9e1d3174ffb512ff23d81a099e + "@shapeshiftoss/hdwallet-core": 1.58.0 + "@shapeshiftoss/hdwallet-keepkey": 1.58.0 + checksum: 74ed5ac00531e252760c3b5051a6c36c4cfac209082a252bf1f680acc77e74d63845b9ccbfa4631ae02bb7b2ae0d5d2707fecb8c71680fbc0d272fd64c3d83f8 languageName: node linkType: hard -"@shapeshiftoss/hdwallet-keepkey@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-keepkey@npm:1.57.1" +"@shapeshiftoss/hdwallet-keepkey@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-keepkey@npm:1.58.0" dependencies: "@bitcoinerlab/secp256k1": ^1.1.1 "@ethereumjs/common": ^2.4.0 @@ -11451,7 +11451,7 @@ __metadata: "@keepkey/device-protocol": ^7.12.2 "@metamask/eth-sig-util": ^7.0.0 "@shapeshiftoss/bitcoinjs-lib": 7.0.0-shapeshift.0 - "@shapeshiftoss/hdwallet-core": 1.57.1 + "@shapeshiftoss/hdwallet-core": 1.58.0 "@shapeshiftoss/proto-tx-builder": ^0.8.0 bignumber.js: ^9.0.1 bnb-javascript-sdk-nobroadcast: ^2.16.14 @@ -11462,27 +11462,27 @@ __metadata: lodash: ^4.17.21 p-lazy: ^3.1.0 semver: ^7.3.8 - checksum: 0cae8e69c31d4597490f4eca8b21d7ff08e70ad218d00e5976052e7cc752850cae1dc53451ec539e879154885bee789334c8af7ee5915eab9313dcbb9f99543a + checksum: 2e6cc591f37fa16fb86b8975371a97e24adf2cf99ec26146dda76ed38992aa30b7639d81d385679e0d6a878793fa2ca610eb6d266c2210e8d4f7646ab06f1580 languageName: node linkType: hard -"@shapeshiftoss/hdwallet-keplr@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-keplr@npm:1.57.1" +"@shapeshiftoss/hdwallet-keplr@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-keplr@npm:1.58.0" dependencies: "@shapeshiftoss/caip": 8.15.0 - "@shapeshiftoss/hdwallet-core": 1.57.1 + "@shapeshiftoss/hdwallet-core": 1.58.0 "@shapeshiftoss/proto-tx-builder": ^0.8.0 "@shapeshiftoss/types": 3.1.3 base64-js: ^1.5.1 lodash: ^4.17.21 - checksum: 789a27ccb621852c3a6f879889282ff8d627ec6b1ab5a8e431d7268007e62c19b210fef3534e695f3c4259ea58fd3646abbc227bcfd72e1f261350ef95b01df2 + checksum: a34e88dc5c0cca654973e2f619ae336c0468870a2dd40b4aed99d72f55d1fe775165959267f76fe50f022929528fe8cfe9df7c08a66047be71fae4f2460089bb languageName: node linkType: hard -"@shapeshiftoss/hdwallet-ledger-webusb@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-ledger-webusb@npm:1.57.1" +"@shapeshiftoss/hdwallet-ledger-webusb@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-ledger-webusb@npm:1.58.0" dependencies: "@ledgerhq/hw-app-btc": ^10.4.1 "@ledgerhq/hw-app-eth": ^6.38.0 @@ -11491,23 +11491,23 @@ __metadata: "@ledgerhq/hw-transport-webusb": ^6.29.2 "@ledgerhq/live-common": ^21.8.2 "@ledgerhq/logs": ^6.10.1 - "@shapeshiftoss/hdwallet-core": 1.57.1 - "@shapeshiftoss/hdwallet-ledger": 1.57.1 + "@shapeshiftoss/hdwallet-core": 1.58.0 + "@shapeshiftoss/hdwallet-ledger": 1.58.0 "@types/w3c-web-usb": ^1.0.4 p-queue: ^7.4.1 - checksum: 3e764abe2dc1ec298e3f8e4d0ce1f5e2a2228075c6a6f2f1d548f98d6e92bffaaadddd98fa3654f99157b082ab8941f97b90839db32480aa7811e771bbd397f5 + checksum: 677b07d8bbd6a614c477faa31ec2d91bae3c5311d7d1eae59f665c19462dfb52b7df940669a741590baeeba5b7d787061427a63aa2fc5c4e48de6d812a65f97b languageName: node linkType: hard -"@shapeshiftoss/hdwallet-ledger@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-ledger@npm:1.57.1" +"@shapeshiftoss/hdwallet-ledger@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-ledger@npm:1.58.0" dependencies: "@ethereumjs/common": ^2.4.0 "@ethereumjs/tx": ^3.3.0 "@ledgerhq/hw-app-cosmos": ^6.29.1 "@shapeshiftoss/bitcoinjs-lib": 7.0.0-shapeshift.0 - "@shapeshiftoss/hdwallet-core": 1.57.1 + "@shapeshiftoss/hdwallet-core": 1.58.0 "@solana/web3.js": 1.95.8 base64-js: ^1.5.1 bchaddrjs: ^0.4.4 @@ -11516,33 +11516,33 @@ __metadata: ethereumjs-tx: 1.3.7 ethereumjs-util: ^6.1.0 lodash: ^4.17.21 - checksum: 4456a97a4a0af3e76e60628478a9d9b25850c48b4bbcaf252896ae9637adafb5eb444cd07259ea0bf935318d25b0139d5c90655e225fb90187a802153d36eebc + checksum: cdcb0e53f013e71d24976181f032cc38fac32f04f2a458a673bbfb1dac720ceff838bbf9df217d2ce5586f5ff1288b08692f41fe26802346ad95555bdb69e802 languageName: node linkType: hard -"@shapeshiftoss/hdwallet-metamask-multichain@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-metamask-multichain@npm:1.57.1" +"@shapeshiftoss/hdwallet-metamask-multichain@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-metamask-multichain@npm:1.58.0" dependencies: "@metamask/detect-provider": ^1.2.0 "@metamask/onboarding": ^1.0.1 "@shapeshiftoss/common-api": ^9.3.0 - "@shapeshiftoss/hdwallet-core": 1.57.1 + "@shapeshiftoss/hdwallet-core": 1.58.0 "@shapeshiftoss/metamask-snaps-adapter": ^1.0.12 "@shapeshiftoss/metamask-snaps-types": ^1.0.12 eth-rpc-errors: ^4.0.3 lodash: ^4.17.21 mipd: ^0.0.7 - checksum: f01e27f0bca3ea6981325f670064fdef8316cf1affe4c80d516b546cac23a9e52b9cab2fe2c711fa6160960d37c010a1ec8218b162acc44d35d227ab7968771a + checksum: 37129a17440b7d3a8c1785f21d6d3ad9434917c3d2f56542ae89ed6cf35fb6cf42d030feb823e041e58a498103786f177b41d0493a18363503fccdbdd9d249f9 languageName: node linkType: hard -"@shapeshiftoss/hdwallet-native-vault@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-native-vault@npm:1.57.1" +"@shapeshiftoss/hdwallet-native-vault@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-native-vault@npm:1.58.0" dependencies: "@bitcoinerlab/secp256k1": ^1.1.1 - "@shapeshiftoss/hdwallet-native": 1.57.1 + "@shapeshiftoss/hdwallet-native": 1.58.0 bip39: ^3.0.4 hash-wasm: ^4.11.0 idb-keyval: ^6.0.3 @@ -11551,18 +11551,18 @@ __metadata: type-assertions: ^1.1.0 uuid: ^8.3.2 web-encoding: ^1.1.0 - checksum: 5c7d8d357c437a69f31e25e449faf1bd6c7f2f14dee72499fe30eb2a784683edebcec73a46ba9f860571dee9bde217021c3e0d69e8379009aa170eb2570b23c4 + checksum: 1e78a33205adad2594d6db5a302fb9aa26d0442b47505c66c56fefcc0b4c1ae6926e559fdede28bb3dad4ecf44f15a3c9959f15c6baa178d6242d956cc8d93b2 languageName: node linkType: hard -"@shapeshiftoss/hdwallet-native@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-native@npm:1.57.1" +"@shapeshiftoss/hdwallet-native@npm:1.58.0, @shapeshiftoss/hdwallet-native@npm:^1.55.1": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-native@npm:1.58.0" dependencies: "@bitcoinerlab/secp256k1": ^1.1.1 "@shapeshiftoss/bitcoinjs-lib": 7.0.0-shapeshift.0 "@shapeshiftoss/fiosdk": 1.2.1-shapeshift.6 - "@shapeshiftoss/hdwallet-core": 1.57.1 + "@shapeshiftoss/hdwallet-core": 1.58.0 "@shapeshiftoss/proto-tx-builder": ^0.8.0 "@zxing/text-encoding": ^0.9.0 bchaddrjs: ^0.4.9 @@ -11584,66 +11584,34 @@ __metadata: scrypt-js: ^3.0.1 tendermint-tx-builder: ^1.0.9 web-encoding: ^1.1.0 - checksum: e2070a2a08e63fb9bbf2695d4114162d9ff0a66b02db857fa495d0d930fd1423ccf185adaab44ebcffad8d67beff13237a8a674b2fef84e05faee7740e206adb - languageName: node - linkType: hard - -"@shapeshiftoss/hdwallet-native@npm:^1.55.1": - version: 1.55.1 - resolution: "@shapeshiftoss/hdwallet-native@npm:1.55.1" - dependencies: - "@shapeshiftoss/bitcoinjs-lib": 5.2.0-shapeshift.2 - "@shapeshiftoss/fiosdk": 1.2.1-shapeshift.6 - "@shapeshiftoss/hdwallet-core": 1.55.1 - "@shapeshiftoss/proto-tx-builder": ^0.8.0 - "@zxing/text-encoding": ^0.9.0 - bchaddrjs: ^0.4.9 - bech32: ^1.1.4 - bignumber.js: ^9.0.1 - bip32: ^2.0.5 - bip39: ^3.0.2 - bnb-javascript-sdk-nobroadcast: ^2.16.14 - crypto-js: ^4.0.0 - eip-712: ^1.0.0 - ethers: 5.7.2 - eventemitter2: ^5.0.1 - funtypes: ^3.0.1 - hash-wasm: ^4.11.0 - lodash: ^4.17.21 - node-fetch: ^2.6.1 - p-lazy: ^3.1.0 - scrypt-js: ^3.0.1 - tendermint-tx-builder: ^1.0.9 - tiny-secp256k1: ^1.1.6 - web-encoding: ^1.1.0 - checksum: 278c54daee3082bb66fcb8ab6af5f51ea0a2b2c3b5a4a530f8a74ac70a1503ae6aefa6aa114aec808855a77e4e10618b39d176e9f8367c90f44f03ec5953e4de + checksum: 293b61168aad91f064db9c5b61a585f6111391ccdc866defb85c0db9309a15050f97ebfa2532dd628749da229e197b6f818618829d3e195fc63ea9470cb35f6b languageName: node linkType: hard -"@shapeshiftoss/hdwallet-phantom@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-phantom@npm:1.57.1" +"@shapeshiftoss/hdwallet-phantom@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-phantom@npm:1.58.0" dependencies: "@shapeshiftoss/bitcoinjs-lib": 7.0.0-shapeshift.0 - "@shapeshiftoss/hdwallet-core": 1.57.1 + "@shapeshiftoss/hdwallet-core": 1.58.0 "@solana/web3.js": 1.95.8 base64-js: ^1.5.1 bitcoinjs-message: ^2.0.0 ethers: 5.7.2 lodash: ^4.17.21 - checksum: 748b7d14137b5cc535cd0b2d1dd3c7b6761178fe5f1cb9f6f13765497c047b7bf62ed6eb892334aef1e58d03b7c8fa6be62425ddd42c1fe75997d755e71a4b6e + checksum: a4b791041c87448315f5a524661e0940d1fd20c94b0028118fc6e24d4a996c36cecd57b7ebedd6730eebbf85bc34838a791d3b1d121e790fa56a0fa48b855211 languageName: node linkType: hard -"@shapeshiftoss/hdwallet-walletconnectv2@npm:1.57.1": - version: 1.57.1 - resolution: "@shapeshiftoss/hdwallet-walletconnectv2@npm:1.57.1" +"@shapeshiftoss/hdwallet-walletconnectv2@npm:1.58.0": + version: 1.58.0 + resolution: "@shapeshiftoss/hdwallet-walletconnectv2@npm:1.58.0" dependencies: - "@shapeshiftoss/hdwallet-core": 1.57.1 + "@shapeshiftoss/hdwallet-core": 1.58.0 "@walletconnect/ethereum-provider": ^2.10.1 "@walletconnect/modal": ^2.6.2 ethers: ^5.6.5 - checksum: 15529912ad4db48fa8cad354295470457fac6ddc10ce4f83ee1f603d611a531d135c632825dc782bbf1794ed8846989ab7a70049efbc62e4318757ad7f6b91c3 + checksum: 7b41c6a544a02f5b5786713c7ce2a3a8979fef7ad8ba20d157fae55c93d38aa3edfccf31e06083a395482ab481ebc20db687be9487c305e569c4f61ac1d50091 languageName: node linkType: hard @@ -11843,18 +11811,18 @@ __metadata: "@shapeshiftoss/caip": "workspace:^" "@shapeshiftoss/chain-adapters": "workspace:^" "@shapeshiftoss/errors": "workspace:^" - "@shapeshiftoss/hdwallet-coinbase": 1.57.1 - "@shapeshiftoss/hdwallet-core": 1.57.1 - "@shapeshiftoss/hdwallet-keepkey": 1.57.1 - "@shapeshiftoss/hdwallet-keepkey-webusb": 1.57.1 - "@shapeshiftoss/hdwallet-keplr": 1.57.1 - "@shapeshiftoss/hdwallet-ledger": 1.57.1 - "@shapeshiftoss/hdwallet-ledger-webusb": 1.57.1 - "@shapeshiftoss/hdwallet-metamask-multichain": 1.57.1 - "@shapeshiftoss/hdwallet-native": 1.57.1 - "@shapeshiftoss/hdwallet-native-vault": 1.57.1 - "@shapeshiftoss/hdwallet-phantom": 1.57.1 - "@shapeshiftoss/hdwallet-walletconnectv2": 1.57.1 + "@shapeshiftoss/hdwallet-coinbase": 1.58.0 + "@shapeshiftoss/hdwallet-core": 1.58.0 + "@shapeshiftoss/hdwallet-keepkey": 1.58.0 + "@shapeshiftoss/hdwallet-keepkey-webusb": 1.58.0 + "@shapeshiftoss/hdwallet-keplr": 1.58.0 + "@shapeshiftoss/hdwallet-ledger": 1.58.0 + "@shapeshiftoss/hdwallet-ledger-webusb": 1.58.0 + "@shapeshiftoss/hdwallet-metamask-multichain": 1.58.0 + "@shapeshiftoss/hdwallet-native": 1.58.0 + "@shapeshiftoss/hdwallet-native-vault": 1.58.0 + "@shapeshiftoss/hdwallet-phantom": 1.58.0 + "@shapeshiftoss/hdwallet-walletconnectv2": 1.58.0 "@shapeshiftoss/swapper": "workspace:^" "@shapeshiftoss/types": "workspace:^" "@shapeshiftoss/unchained-client": "workspace:^" From 2f3b30e852d28b0f642419e004b23c62829699af Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Thu, 9 Jan 2025 03:41:03 +0400 Subject: [PATCH 2/2] feat: toggle chainflip dca flag (#8507) --- .env.base | 2 +- .env.dev | 1 - .env.develop | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.env.base b/.env.base index a97d255a48a..4ea88ae570a 100644 --- a/.env.base +++ b/.env.base @@ -66,7 +66,7 @@ REACT_APP_FEATURE_SWAPPER_SOLANA=true # Swapper feature flags - other .env files will override these REACT_APP_FEATURE_CHAINFLIP_SWAP=true -REACT_APP_FEATURE_CHAINFLIP_SWAP_DCA=false +REACT_APP_FEATURE_CHAINFLIP_SWAP_DCA=true REACT_APP_FEATURE_COWSWAP=true REACT_APP_FEATURE_LIFI_SWAP=true REACT_APP_FEATURE_THOR_SWAP=true diff --git a/.env.dev b/.env.dev index a56939e995b..4d85185a527 100644 --- a/.env.dev +++ b/.env.dev @@ -4,7 +4,6 @@ REACT_APP_FEATURE_SWAPPER_SOLANA=true # Swapper feature flags -REACT_APP_FEATURE_CHAINFLIP_SWAP_DCA=true REACT_APP_FEATURE_LIMIT_ORDERS=true REACT_APP_FEATURE_NEW_TRADE_FLOW=true diff --git a/.env.develop b/.env.develop index 009ed0d1311..f0a2711da7b 100644 --- a/.env.develop +++ b/.env.develop @@ -5,7 +5,6 @@ REACT_APP_FEATURE_SWAPPER_SOLANA=true # Swapper feature flags -REACT_APP_FEATURE_CHAINFLIP_SWAP_DCA=true REACT_APP_FEATURE_LIMIT_ORDERS=true REACT_APP_FEATURE_NEW_TRADE_FLOW=true