diff --git a/__tests__/init.ts b/__tests__/init.ts index 54559c74b..c21b2f8c5 100644 --- a/__tests__/init.ts +++ b/__tests__/init.ts @@ -89,20 +89,19 @@ jest.mock('react-native-fs', jest.fn); jest.mock('@react-navigation/native', () => ({ createNavigationContainerRef: jest.fn, })); -jest.mock('@haqq/provider-ledger-react-native', () => ({ - getBleManager: jest.fn, -})); jest.mock('react-native-ble-plx', () => ({ State: jest.fn, })); -jest.mock('@haqq/provider-mnemonic-react-native', () => ({ - ProviderMnemonicReactNative: jest.fn, -})); -jest.mock('@haqq/provider-sss-react-native', () => ({ - ProviderSSSReactNative: jest.fn, -})); -jest.mock('@haqq/provider-hot-react-native', () => ({ - ProviderHotReactNative: jest.fn, +jest.mock('@haqq/rn-wallet-providers', () => ({ + utils: { + getBleManager: jest.fn, + }, + ProviderMnemonicBase: jest.fn, + ProviderMnemonicEvm: jest.fn, + ProviderSSSBase: jest.fn, + ProviderSSSEvm: jest.fn, + ProviderHotBase: jest.fn, + ProviderHotEvm: jest.fn, })); jest.mock('@react-native-async-storage/async-storage', jest.fn); jest.mock('@haqq/shared-react-native', () => ({ diff --git a/package.json b/package.json index ce2b2d336..a5c93ae77 100644 --- a/package.json +++ b/package.json @@ -42,13 +42,8 @@ "@expo/react-native-action-sheet": "4.0.1", "@haqq/encryption-react-native": "0.0.4", "@haqq/format-number-with-subscript-zeros": "1.0.1", - "@haqq/provider-base": "0.0.23", - "@haqq/provider-hot-react-native": "0.0.10", - "@haqq/provider-keystone-react-native": "0.0.7", - "@haqq/provider-ledger-react-native": "0.0.28", - "@haqq/provider-mnemonic-react-native": "0.0.14", - "@haqq/provider-sss-react-native": "0.0.14", "@haqq/provider-web3-utils": "0.0.14", + "@haqq/rn-wallet-providers": "0.0.2", "@haqq/shared-react-native": "0.0.12", "@invertase/react-native-apple-authentication": "2.2.2", "@keystonehq/bc-ur-registry-eth": "0.7.7", diff --git a/src/components/ledger-scan/ledger-scan-row.tsx b/src/components/ledger-scan/ledger-scan-row.tsx index 0fd07e0e8..c374eff78 100644 --- a/src/components/ledger-scan/ledger-scan-row.tsx +++ b/src/components/ledger-scan/ledger-scan-row.tsx @@ -1,6 +1,6 @@ import React, {useCallback} from 'react'; -import {Device} from '@haqq/provider-ledger-react-native'; +import {Device} from '@haqq/rn-wallet-providers'; import {ActivityIndicator, TouchableOpacity} from 'react-native'; import {Color} from '@app/colors'; diff --git a/src/components/ledger-scan/ledger-scan.tsx b/src/components/ledger-scan/ledger-scan.tsx index a3ac15c06..d7a353cd2 100644 --- a/src/components/ledger-scan/ledger-scan.tsx +++ b/src/components/ledger-scan/ledger-scan.tsx @@ -1,6 +1,6 @@ import React, {useCallback} from 'react'; -import {Device} from '@haqq/provider-ledger-react-native'; +import {Device} from '@haqq/rn-wallet-providers'; import {FlatList, ListRenderItem} from 'react-native'; import {PopupContainer} from '@app/components/ui'; diff --git a/src/components/modals/cloud-share-not-found.tsx b/src/components/modals/cloud-share-not-found.tsx index 20379190b..8dfd61860 100644 --- a/src/components/modals/cloud-share-not-found.tsx +++ b/src/components/modals/cloud-share-not-found.tsx @@ -1,6 +1,6 @@ import React, {useCallback, useEffect} from 'react'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {observer} from 'mobx-react'; import {Image, Platform, View} from 'react-native'; @@ -63,7 +63,7 @@ export const CloudShareNotFound = observer( ); const storage = await getProviderStorage('', 'cloud'); - await ProviderSSSReactNative.initialize( + await ProviderSSSBase.initialize( creds.privateKey, null, localShare, diff --git a/src/event-actions/on-app-backup.ts b/src/event-actions/on-app-backup.ts index 68fe82ba4..79a9f44d6 100644 --- a/src/event-actions/on-app-backup.ts +++ b/src/event-actions/on-app-backup.ts @@ -1,5 +1,4 @@ -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderMnemonicBase, ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {isAfter} from 'date-fns'; import {app} from '@app/contexts'; @@ -19,10 +18,10 @@ export async function onAppBackup() { return; } - const mnemonics = await ProviderMnemonicReactNative.getAccounts(); + const mnemonics = await ProviderMnemonicBase.getAccounts(); if (isFeatureEnabled(Feature.sss)) { - const sss = await ProviderSSSReactNative.getAccounts(); + const sss = await ProviderSSSBase.getAccounts(); if (mnemonics.length && !sss.length) { navigator.navigate(SettingsStackRoutes.BackupSssSuggestion, { accountId: mnemonics[0], diff --git a/src/event-actions/on-push-subscription-transactions-subscribe.ts b/src/event-actions/on-push-subscription-transactions-subscribe.ts index 18b0da82d..95c1e28e3 100644 --- a/src/event-actions/on-push-subscription-transactions-subscribe.ts +++ b/src/event-actions/on-push-subscription-transactions-subscribe.ts @@ -1,11 +1,9 @@ -import {cosmosAddress} from '@haqq/provider-base'; - +import {AddressUtils} from '@app/helpers/address-utils'; import {VariablesBool} from '@app/models/variables-bool'; import {VariablesString} from '@app/models/variables-string'; import {Wallet} from '@app/models/wallet'; import {Backend} from '@app/services/backend'; import {PushNotificationTopicsEnum} from '@app/services/push-notifications'; -import {COSMOS_PREFIX} from '@app/variables/common'; export async function onPushSubscriptionTransactionsSubscribe() { VariablesBool.set( @@ -22,7 +20,7 @@ export async function onPushSubscriptionTransactionsSubscribe() { wallets.map(async w => Backend.instance.createNotificationSubscription( subscription, - cosmosAddress(w.address, COSMOS_PREFIX), + AddressUtils.toHaqq(w.address), ), ), ); diff --git a/src/event-actions/on-wallet-create.ts b/src/event-actions/on-wallet-create.ts index f9cb2cf08..7fad35eb1 100644 --- a/src/event-actions/on-wallet-create.ts +++ b/src/event-actions/on-wallet-create.ts @@ -1,4 +1,4 @@ -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; +import {ProviderMnemonicBase} from '@haqq/rn-wallet-providers'; import {app} from '@app/contexts'; import {onStakingSync} from '@app/event-actions/on-staking-sync'; @@ -43,7 +43,7 @@ export async function onWalletCreate(wallet: Wallet) { case WalletType.mnemonic: const providerMnemonic = (await getProviderInstanceForWallet( wallet, - )) as ProviderMnemonicReactNative; + )) as ProviderMnemonicBase; if (typeof providerMnemonic.isMnemonicSaved === 'function') { mnemonicSaved = await providerMnemonic.isMnemonicSaved(); } else { diff --git a/src/event-actions/on-wallet-mnemonic-check.ts b/src/event-actions/on-wallet-mnemonic-check.ts index 54b05bc55..5b421335d 100644 --- a/src/event-actions/on-wallet-mnemonic-check.ts +++ b/src/event-actions/on-wallet-mnemonic-check.ts @@ -1,4 +1,4 @@ -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; +import {ProviderMnemonicBase} from '@haqq/rn-wallet-providers'; import {isAfter} from 'date-fns'; import {app} from '@app/contexts'; @@ -20,7 +20,7 @@ export async function onWalletMnemonicCheck(snoozeBackup: Date) { ); for (const accountId of accounts) { - const provider = new ProviderMnemonicReactNative({ + const provider = new ProviderMnemonicBase({ account: accountId, getPassword: app.getPassword.bind(app), }); diff --git a/src/event-actions/on-wallet-mnemonic-saved.ts b/src/event-actions/on-wallet-mnemonic-saved.ts index b6a9baaee..ade30ff05 100644 --- a/src/event-actions/on-wallet-mnemonic-saved.ts +++ b/src/event-actions/on-wallet-mnemonic-saved.ts @@ -1,4 +1,4 @@ -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; +import {ProviderMnemonicBase} from '@haqq/rn-wallet-providers'; import {app} from '@app/contexts'; import {Wallet} from '@app/models/wallet'; @@ -7,7 +7,7 @@ import {WalletType} from '@app/types'; export async function onWalletMnemonicSaved(accountId: string) { const wallets = Wallet.getAll(); - const provider = new ProviderMnemonicReactNative({ + const provider = new ProviderMnemonicBase({ account: accountId, getPassword: app.getPassword.bind(app), }); diff --git a/src/event-actions/on-wallet-sss-check.ts b/src/event-actions/on-wallet-sss-check.ts index b9e75a297..a0816ad37 100644 --- a/src/event-actions/on-wallet-sss-check.ts +++ b/src/event-actions/on-wallet-sss-check.ts @@ -1,4 +1,4 @@ -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {isAfter} from 'date-fns'; import {app} from '@app/contexts'; @@ -23,7 +23,7 @@ export async function onWalletSssCheck(snoozeBackup: Date) { for (const accountId of accounts) { const storage = await getProviderStorage(accountId); - const provider = new ProviderSSSReactNative({ + const provider = new ProviderSSSBase({ storage, account: accountId, getPassword: app.getPassword.bind(app), diff --git a/src/event-actions/on-wallet-sss-saved.ts b/src/event-actions/on-wallet-sss-saved.ts index cee0ec67f..aae348022 100644 --- a/src/event-actions/on-wallet-sss-saved.ts +++ b/src/event-actions/on-wallet-sss-saved.ts @@ -1,4 +1,4 @@ -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {app} from '@app/contexts'; import {getProviderStorage} from '@app/helpers/get-provider-storage'; @@ -9,15 +9,13 @@ export async function onWalletSssSaved(accountId: string) { const wallets = Wallet.getAll(); const storage = await getProviderStorage(accountId); - const provider = new ProviderSSSReactNative({ + const provider = new ProviderSSSBase({ account: accountId, storage, getPassword: app.getPassword.bind(app), }); - const storages = await ProviderSSSReactNative.getStoragesForAccount( - accountId, - ); + const storages = await ProviderSSSBase.getStoragesForAccount(accountId); const isShareSaved = await Promise.all( storages.map(async s => { diff --git a/src/helpers/address.ts b/src/helpers/address.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/helpers/await-for-bluetooth.ts b/src/helpers/await-for-bluetooth.ts index 0be8d596c..c8ecb7eca 100644 --- a/src/helpers/await-for-bluetooth.ts +++ b/src/helpers/await-for-bluetooth.ts @@ -1,4 +1,4 @@ -import {getBleManager} from '@haqq/provider-ledger-react-native'; +import {utils} from '@haqq/rn-wallet-providers'; import {State} from 'react-native-ble-plx'; import {hideModal, showModal} from '@app/helpers/modal'; @@ -10,7 +10,7 @@ export const awaitForBluetooth = () => { return new Promise((resolve, reject) => { let currentState = State.Unknown; let currentModal: ModalName | null = null; - const manager = getBleManager(); + const manager = utils.getBleManager(); const onClose = () => { reject(new Error('bluetooth_popup_closed')); diff --git a/src/helpers/await-for-ledger.ts b/src/helpers/await-for-ledger.ts index f944e18b7..e6bac461d 100644 --- a/src/helpers/await-for-ledger.ts +++ b/src/helpers/await-for-ledger.ts @@ -1,5 +1,8 @@ -import {ProviderInterface} from '@haqq/provider-base'; -import {ProviderLedgerReactNative} from '@haqq/provider-ledger-react-native'; +import { + ProviderInterface, + ProviderLedgerBase, + ProviderLedgerEvm, +} from '@haqq/rn-wallet-providers'; import {Keyboard} from 'react-native'; import {app} from '@app/contexts'; @@ -19,7 +22,10 @@ const LEDGER_PROVIDER_EVENTS = [ ]; export const awaitForLedger = async (transport: ProviderInterface) => { - if (transport instanceof ProviderLedgerReactNative) { + if ( + transport instanceof ProviderLedgerBase || + transport instanceof ProviderLedgerEvm + ) { Keyboard.dismiss(); await awaitForBluetooth(); return new Promise((resolve, reject) => { diff --git a/src/helpers/create-wallets-for-provider.ts b/src/helpers/create-wallets-for-provider.ts index 08eb84939..db777ec68 100644 --- a/src/helpers/create-wallets-for-provider.ts +++ b/src/helpers/create-wallets-for-provider.ts @@ -1,4 +1,4 @@ -import {ProviderInterface} from '@haqq/provider-base'; +import {ProviderInterface} from '@haqq/rn-wallet-providers'; import {app} from '@app/contexts'; import {I18N, getText} from '@app/i18n'; diff --git a/src/helpers/decrypt-local-share.ts b/src/helpers/decrypt-local-share.ts index ebb506b14..601f3c940 100644 --- a/src/helpers/decrypt-local-share.ts +++ b/src/helpers/decrypt-local-share.ts @@ -1,5 +1,5 @@ -import {ITEM_KEY} from '@haqq/provider-sss-react-native/dist/constants'; import {accountInfo} from '@haqq/provider-web3-utils'; +import {constants} from '@haqq/rn-wallet-providers'; import {decryptShare} from '@haqq/shared-react-native'; import EncryptedStorage from 'react-native-encrypted-storage'; @@ -9,7 +9,9 @@ export const decryptLocalShare = async ( ) => { const account = await accountInfo(sssPrivateKey); const _value = await EncryptedStorage.getItem( - `${ITEM_KEY}_${account.address.toLowerCase()}`, + `${ + constants.ITEM_KEYS[constants.WalletType.sss] + }_${account.address.toLowerCase()}`, ); const shareStore = await decryptShare(JSON.parse(_value || ''), password); diff --git a/src/helpers/get-provider-for-new-wallet.ts b/src/helpers/get-provider-for-new-wallet.ts index 2830400d0..9eb33ae1b 100644 --- a/src/helpers/get-provider-for-new-wallet.ts +++ b/src/helpers/get-provider-for-new-wallet.ts @@ -1,5 +1,4 @@ -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderMnemonicBase, ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {app} from '@app/contexts'; import {getProviderStorage} from '@app/helpers/get-provider-storage'; @@ -12,7 +11,7 @@ export async function getProviderForNewWallet(params?: WalletInitialData) { if (params && params.type === 'sss') { const storage = await getProviderStorage('', params.provider); - return await ProviderSSSReactNative.initialize( + return await ProviderSSSBase.initialize( params.action === 'restore' ? params.sssPrivateKey || null : null, params.sssCloudShare || null, params.sssLocalShare || null, @@ -28,26 +27,26 @@ export async function getProviderForNewWallet(params?: WalletInitialData) { ).catch(err => ErrorHandler.handle('sssLimitReached', err)); } - const keysSss = await ProviderSSSReactNative.getAccounts(); + const keysSss = await ProviderSSSBase.getAccounts(); if (keysSss.length) { const storage = await getProviderStorage(keysSss[0]); - return new ProviderSSSReactNative({ + return new ProviderSSSBase({ storage, account: keysSss[0], getPassword, }); } - const keysMnemonic = await ProviderMnemonicReactNative.getAccounts(); + const keysMnemonic = await ProviderMnemonicBase.getAccounts(); if (keysMnemonic.length) { - return new ProviderMnemonicReactNative({ + return new ProviderMnemonicBase({ account: keysMnemonic[0], getPassword, }); } - return await ProviderMnemonicReactNative.initialize(null, getPassword, {}); + return await ProviderMnemonicBase.initialize(null, getPassword, {}); } diff --git a/src/helpers/get-provider-storage.ts b/src/helpers/get-provider-storage.ts index edd79d29d..3fd150b94 100644 --- a/src/helpers/get-provider-storage.ts +++ b/src/helpers/get-provider-storage.ts @@ -1,7 +1,4 @@ -import { - ProviderSSSReactNative, - StorageInterface, -} from '@haqq/provider-sss-react-native'; +import {ProviderSSSBase, StorageInterface} from '@haqq/rn-wallet-providers'; import {AsyncLocalStorage} from '@app/services/async-local-storage'; import {Cloud} from '@app/services/cloud'; @@ -13,7 +10,7 @@ export async function getProviderStorage( ): Promise { const storages = storage ? [storage] - : await ProviderSSSReactNative.getStoragesForAccount(accountId); + : await ProviderSSSBase.getStoragesForAccount(accountId); const cloudEnabled = await Cloud.isEnabled(); if ( diff --git a/src/helpers/get-wallets-from-provider.tsx b/src/helpers/get-wallets-from-provider.tsx index aa8704230..f1c5f0de2 100644 --- a/src/helpers/get-wallets-from-provider.tsx +++ b/src/helpers/get-wallets-from-provider.tsx @@ -1,5 +1,8 @@ -import {ProviderInterface} from '@haqq/provider-base'; -import {ProviderKeystoneReactNative} from '@haqq/provider-keystone-react-native'; +import { + ProviderInterface, + ProviderKeystoneBase, + ProviderKeystoneEvm, +} from '@haqq/rn-wallet-providers'; import {ChooseAccountTabNames} from '@app/components/choose-account/choose-account'; import {Wallet} from '@app/models/wallet'; @@ -28,7 +31,10 @@ export async function* getWalletsFromProvider( })[] = []; const genHdPath = (_index: number) => { - if (provider instanceof ProviderKeystoneReactNative) { + if ( + provider instanceof ProviderKeystoneBase || + provider instanceof ProviderKeystoneEvm + ) { return provider.buildPath(_index); } if (mnemonicType === ChooseAccountTabNames.Basic) { diff --git a/src/helpers/ledger-transport-wrapper.ts b/src/helpers/ledger-transport-wrapper.ts index bd5af0b85..3f8dab255 100644 --- a/src/helpers/ledger-transport-wrapper.ts +++ b/src/helpers/ledger-transport-wrapper.ts @@ -1,5 +1,8 @@ -import {ProviderInterface} from '@haqq/provider-base'; -import {ProviderLedgerReactNative} from '@haqq/provider-ledger-react-native'; +import { + ProviderInterface, + ProviderLedgerBase, + ProviderLedgerEvm, +} from '@haqq/rn-wallet-providers'; import {ModalName, awaitForBluetooth, awaitForLedger, hideModal} from './'; import {ExtractPromiseType} from '../types'; @@ -18,7 +21,10 @@ export const ledgerTransportCbWrapper = async ( ): Promise> => { let result; try { - if (transport instanceof ProviderLedgerReactNative) { + if ( + transport instanceof ProviderLedgerBase || + transport instanceof ProviderLedgerEvm + ) { await awaitForBluetooth(); // no need await here awaitForLedger(transport); diff --git a/src/helpers/provider-instance.ts b/src/helpers/provider-instance.ts index 734b72563..1db2a23b8 100644 --- a/src/helpers/provider-instance.ts +++ b/src/helpers/provider-instance.ts @@ -1,15 +1,15 @@ import { BytesLike, ProviderBaseError, + ProviderHotEvm, ProviderInterface, + ProviderKeystoneEvm, + ProviderLedgerEvm, + ProviderMnemonicEvm, + ProviderSSSEvm, TransactionRequest, TypedData, -} from '@haqq/provider-base'; -import {ProviderHotReactNative} from '@haqq/provider-hot-react-native'; -import {ProviderKeystoneReactNative} from '@haqq/provider-keystone-react-native'; -import {ProviderLedgerReactNative} from '@haqq/provider-ledger-react-native'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +} from '@haqq/rn-wallet-providers'; import {app} from '@app/contexts'; import {awaitForLedger} from '@app/helpers/await-for-ledger'; @@ -112,19 +112,19 @@ export async function getProviderInstanceForWallet( let provider: ProviderInterface; switch (wallet.type) { case WalletType.mnemonic: - provider = new ProviderMnemonicReactNative({ + provider = new ProviderMnemonicEvm({ account: wallet.accountId!, getPassword: app.getPassword.bind(app), }); break; case WalletType.hot: - provider = new ProviderHotReactNative({ + provider = new ProviderHotEvm({ getPassword: app.getPassword.bind(app), account: wallet.accountId!, }); break; case WalletType.ledgerBt: { - provider = new ProviderLedgerReactNative({ + provider = new ProviderLedgerEvm({ getPassword: app.getPassword.bind(app), deviceId: wallet.accountId!, appName: LEDGER_APP, @@ -136,14 +136,14 @@ export async function getProviderInstanceForWallet( } case WalletType.sss: const storage = await getProviderStorage(wallet.accountId as string); - provider = new ProviderSSSReactNative({ + provider = new ProviderSSSEvm({ storage, getPassword: app.getPassword.bind(app), account: wallet.accountId!, }); break; case WalletType.keystone: - provider = new ProviderKeystoneReactNative({ + provider = new ProviderKeystoneEvm({ qrCBORHex: wallet.accountId!, awaitForSign: async params => { const signatureHex = await awaitForQRSign(params); diff --git a/src/helpers/remove-local-share.ts b/src/helpers/remove-local-share.ts index 7ea053c48..e6c426f64 100644 --- a/src/helpers/remove-local-share.ts +++ b/src/helpers/remove-local-share.ts @@ -1,10 +1,12 @@ -import {ITEM_KEY} from '@haqq/provider-sss-react-native/dist/constants'; import {accountInfo} from '@haqq/provider-web3-utils'; +import {constants} from '@haqq/rn-wallet-providers'; import EncryptedStorage from 'react-native-encrypted-storage'; export const removeLocalShare = async (sssPrivateKey: string) => { const account = await accountInfo(sssPrivateKey); await EncryptedStorage.removeItem( - `${ITEM_KEY}_${account.address.toLowerCase()}`, + `${ + constants.ITEM_KEYS[constants.WalletType.sss] + }_${account.address.toLowerCase()}`, ); }; diff --git a/src/helpers/secure-pin-utils.ts b/src/helpers/secure-pin-utils.ts index bb4362941..161225ce6 100644 --- a/src/helpers/secure-pin-utils.ts +++ b/src/helpers/secure-pin-utils.ts @@ -1,6 +1,8 @@ -import {ProviderHotReactNative} from '@haqq/provider-hot-react-native'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import { + ProviderHotBase, + ProviderMnemonicBase, + ProviderSSSBase, +} from '@haqq/rn-wallet-providers'; import {decryptPassworder, encryptPassworder} from '@haqq/shared-react-native'; import EncryptedStorage from 'react-native-encrypted-storage'; @@ -68,18 +70,18 @@ const getProviderForUpdatePin = async ( ) => { switch (wallet.type) { case WalletType.mnemonic: - return new ProviderMnemonicReactNative({ + return new ProviderMnemonicBase({ account: wallet.accountId!, getPassword, }); case WalletType.hot: - return new ProviderHotReactNative({ + return new ProviderHotBase({ getPassword, account: wallet.accountId!, }); case WalletType.sss: const storage = await getProviderStorage(wallet.accountId as string); - return new ProviderSSSReactNative({ + return new ProviderSSSBase({ storage, getPassword, account: wallet.accountId!, diff --git a/src/models/migration-wallets.ts b/src/models/migration-wallets.ts index 715ac19a7..e9b40cec8 100644 --- a/src/models/migration-wallets.ts +++ b/src/models/migration-wallets.ts @@ -1,6 +1,5 @@ import {decrypt} from '@haqq/encryption-react-native'; -import {ProviderHotReactNative} from '@haqq/provider-hot-react-native'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; +import {ProviderHotBase, ProviderMnemonicBase} from '@haqq/rn-wallet-providers'; import {Wallet} from './wallet'; @@ -28,7 +27,7 @@ export async function migrationWallets() { wallet.data, ); - const provider = await ProviderHotReactNative.initialize( + const provider = await ProviderHotBase.initialize( privateKey, getPassword, {}, @@ -48,7 +47,7 @@ export async function migrationWallets() { const m = typeof mnemonic === 'string' ? mnemonic : mnemonic.phrase; - const provider = await ProviderMnemonicReactNative.initialize( + const provider = await ProviderMnemonicBase.initialize( m, getPassword, {}, diff --git a/src/route-types.ts b/src/route-types.ts index de2b97554..e9e7c747b 100644 --- a/src/route-types.ts +++ b/src/route-types.ts @@ -1,7 +1,6 @@ import {Proposal as ProposalProvider} from '@evmos/provider'; import {Proposal as ProposalGovProvider} from '@evmos/provider/dist/rest/gov'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderMnemonicBase, ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {SessionTypes} from '@walletconnect/types'; import {TotalValueTabNames} from '@app/components/total-value-info'; @@ -675,13 +674,13 @@ export enum OnboardingStackRoutes { export type OnboardingStackParamList = WelcomeStackParamList & { [OnboardingStackRoutes.OnboardingSetupPin]: WalletInitialData & { - provider?: ProviderMnemonicReactNative; + provider?: ProviderMnemonicBase; currentPin: string; nextScreen: AnyRouteFromParent; errorText?: string; }; [OnboardingStackRoutes.OnboardingRepeatPin]: WalletInitialData & { - provider?: ProviderMnemonicReactNative; + provider?: ProviderMnemonicBase; currentPin: string; nextScreen: AnyRouteFromParent; }; @@ -749,17 +748,14 @@ export type SignInStackParamList = WelcomeStackParamList & { [SignInStackRoutes.SigninPin]: WalletInitialData; [SignInStackRoutes.SigninSharesNotFound]: undefined; [SignInStackRoutes.OnboardingSetupPin]: WalletInitialData & { - provider?: - | ProviderMnemonicReactNative - | ProviderSSSReactNative - | SssProviders; + provider?: ProviderMnemonicBase | ProviderSSSBase | SssProviders; biometryType?: BiometryType; }; [SignInStackRoutes.SigninStoreWallet]: WalletInitialData & { nextScreen?: SignInStackRoutes; }; [SignInStackRoutes.SigninNotExists]: WalletInitialData & { - provider: ProviderMnemonicReactNative | ProviderSSSReactNative; + provider: ProviderMnemonicBase | ProviderSSSBase; email?: string; }; [SignInStackRoutes.SigninNotRecovery]: WalletInitialData; @@ -769,11 +765,11 @@ export type SignInStackParamList = WelcomeStackParamList & { }; [SignInStackRoutes.SigninChooseAccount]: | (WalletInitialData & { - provider: ProviderMnemonicReactNative; + provider: ProviderMnemonicBase; nextScreen?: SignInStackRoutes; }) | { - provider: ProviderSSSReactNative; + provider: ProviderSSSBase; nextScreen?: SignInStackRoutes; sssProvider: string; }; diff --git a/src/screens/DeviceStack/KeystoneStack/keystone-accounts.tsx b/src/screens/DeviceStack/KeystoneStack/keystone-accounts.tsx index 27113fdf6..141920504 100644 --- a/src/screens/DeviceStack/KeystoneStack/keystone-accounts.tsx +++ b/src/screens/DeviceStack/KeystoneStack/keystone-accounts.tsx @@ -1,9 +1,6 @@ import React, {memo, useCallback, useMemo, useRef, useState} from 'react'; -import { - KeyringAccountEnum, - ProviderKeystoneReactNative, -} from '@haqq/provider-keystone-react-native'; +import {ProviderKeystoneBase, constants} from '@haqq/rn-wallet-providers'; import {makeID} from '@haqq/shared-react-native'; import {KeystoneAccounts} from '@app/components/keystone/keystone-accounts'; @@ -38,7 +35,7 @@ export const KeystoneAccountsScreen = memo(() => { KeystoneStackRoutes.KeystoneAccounts >().params; const provider = useRef( - new ProviderKeystoneReactNative({ + new ProviderKeystoneBase({ qrCBORHex, awaitForSign: Promise.resolve, }), @@ -102,7 +99,7 @@ export const KeystoneAccountsScreen = memo(() => { if ( provider.current.getKeyringAccount() === - KeyringAccountEnum.ledger_live + constants.KeyringAccountEnum.ledger_live ) { showError(errorId, getText(I18N.keystoneWalletSyncPathError)); } else { diff --git a/src/screens/DeviceStack/LedgerStack/ledger-accounts.tsx b/src/screens/DeviceStack/LedgerStack/ledger-accounts.tsx index 96b5348ed..a4ecb83d0 100644 --- a/src/screens/DeviceStack/LedgerStack/ledger-accounts.tsx +++ b/src/screens/DeviceStack/LedgerStack/ledger-accounts.tsx @@ -1,6 +1,6 @@ import React, {memo, useCallback, useEffect, useRef, useState} from 'react'; -import {ProviderLedgerReactNative} from '@haqq/provider-ledger-react-native'; +import {ProviderLedgerEvm} from '@haqq/rn-wallet-providers'; import {ChooseAccountTabNames} from '@app/components/choose-account/choose-account'; import {LedgerAccounts} from '@app/components/ledger-accounts'; @@ -26,7 +26,7 @@ export const LedgerAccountsScreen = memo(() => { LedgerStackRoutes.LedgerAccounts >().params; const provider = useRef( - new ProviderLedgerReactNative({ + new ProviderLedgerEvm({ getPassword: app.getPassword.bind(app), deviceId, appName: LEDGER_APP, diff --git a/src/screens/DeviceStack/LedgerStack/ledger-bluetooth.tsx b/src/screens/DeviceStack/LedgerStack/ledger-bluetooth.tsx index 18a8c158a..7b3218764 100644 --- a/src/screens/DeviceStack/LedgerStack/ledger-bluetooth.tsx +++ b/src/screens/DeviceStack/LedgerStack/ledger-bluetooth.tsx @@ -1,7 +1,8 @@ import React, {memo, useCallback, useEffect, useRef, useState} from 'react'; -import {State, tryToInitBt} from '@haqq/provider-ledger-react-native'; +import {utils} from '@haqq/rn-wallet-providers'; import {Linking} from 'react-native'; +import {State} from 'react-native-ble-plx'; import {Subscription} from 'rxjs'; import {LedgerBluetooth} from '@app/components/ledger-bluetooth'; @@ -46,7 +47,7 @@ export const LedgerBluetoothScreen = memo(() => { subscription.current?.unsubscribe(); } setLoading(true); - const sub = await tryToInitBt(); + const sub = await utils.tryToInitBt(); // @ts-ignore subscription.current = sub.subscribe({ next: (state: State) => { diff --git a/src/screens/DeviceStack/LedgerStack/ledger-scan.tsx b/src/screens/DeviceStack/LedgerStack/ledger-scan.tsx index 4c8dc5f69..44b26c753 100644 --- a/src/screens/DeviceStack/LedgerStack/ledger-scan.tsx +++ b/src/screens/DeviceStack/LedgerStack/ledger-scan.tsx @@ -2,9 +2,10 @@ import React, {memo, useCallback, useEffect, useRef, useState} from 'react'; import { Device, - ProviderLedgerReactNative, - scanDevices, -} from '@haqq/provider-ledger-react-native'; + ProviderLedgerBase, + ProviderLedgerEvm, + utils, +} from '@haqq/rn-wallet-providers'; import {Observable, firstValueFrom} from 'rxjs'; import {LedgerScan} from '@app/components/ledger-scan'; @@ -20,9 +21,9 @@ import {LEDGER_APP} from '@app/variables/common'; export const LedgerScanScreen = memo(() => { const [refreshing, setRefreshing] = useState(false); const [devices, setDevices] = useState([]); - const scan = useRef(scanDevices()).current; + const scan = useRef(utils.scanDevices()).current; const ledgerProvidersMap = useRef< - Record + Record >({}).current; const [devicesLoadingMap, setDevicesLoadingMap] = useState< Record @@ -88,7 +89,7 @@ export const LedgerScanScreen = memo(() => { async (item: Device) => { setDeviceError(item, null); setDeviceLoading(item, true); - const provider = new ProviderLedgerReactNative({ + const provider = new ProviderLedgerEvm({ getPassword: app.getPassword.bind(app), deviceId: item.id, appName: LEDGER_APP, diff --git a/src/screens/DeviceStack/LedgerStack/ledger-verify.tsx b/src/screens/DeviceStack/LedgerStack/ledger-verify.tsx index c790c9c8a..164014d97 100644 --- a/src/screens/DeviceStack/LedgerStack/ledger-verify.tsx +++ b/src/screens/DeviceStack/LedgerStack/ledger-verify.tsx @@ -1,6 +1,6 @@ import React, {memo, useCallback} from 'react'; -import {ProviderLedgerReactNative} from '@haqq/provider-ledger-react-native'; +import {ProviderLedgerEvm} from '@haqq/rn-wallet-providers'; import {useFocusEffect} from '@react-navigation/native'; import {LedgerVerify} from '@app/components/ledger-verify'; @@ -33,7 +33,7 @@ export const LedgerVerifyScreen = memo(() => { useFocusEffect( useCallback(() => { - const provider = new ProviderLedgerReactNative({ + const provider = new ProviderLedgerEvm({ getPassword: app.getPassword.bind(app), deviceId: route.params.deviceId, appName: LEDGER_APP, diff --git a/src/screens/HomeStack/BackupStack/backup-create.tsx b/src/screens/HomeStack/BackupStack/backup-create.tsx index 96baab10e..215069ad8 100644 --- a/src/screens/HomeStack/BackupStack/backup-create.tsx +++ b/src/screens/HomeStack/BackupStack/backup-create.tsx @@ -1,7 +1,11 @@ import React, {memo, useEffect, useState} from 'react'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import { + ProviderMnemonicBase, + ProviderMnemonicEvm, + ProviderSSSBase, + ProviderSSSEvm, +} from '@haqq/rn-wallet-providers'; import {Alert} from 'react-native'; import {addScreenshotListener} from 'react-native-detector'; @@ -26,8 +30,10 @@ export const BackupCreateScreen = memo(() => { const provider = await getProviderInstanceForWallet(wallet, true); if ( - provider instanceof ProviderMnemonicReactNative || - provider instanceof ProviderSSSReactNative + provider instanceof ProviderMnemonicBase || + provider instanceof ProviderMnemonicEvm || + provider instanceof ProviderSSSBase || + provider instanceof ProviderSSSEvm ) { provider.getMnemonicPhrase().then(phrase => setMnemonic(phrase)); } diff --git a/src/screens/HomeStack/BackupStack/backup-verify.tsx b/src/screens/HomeStack/BackupStack/backup-verify.tsx index 92e86cb5b..071dfd21c 100644 --- a/src/screens/HomeStack/BackupStack/backup-verify.tsx +++ b/src/screens/HomeStack/BackupStack/backup-verify.tsx @@ -1,7 +1,11 @@ import React, {memo, useCallback, useRef, useState} from 'react'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import { + ProviderMnemonicBase, + ProviderMnemonicEvm, + ProviderSSSBase, + ProviderSSSEvm, +} from '@haqq/rn-wallet-providers'; import {BackupVerify} from '@app/components/backup-verify'; import {Loading} from '@app/components/ui'; @@ -20,20 +24,20 @@ export const BackupVerifyScreen = memo(() => { BackupStackParamList, BackupStackRoutes.BackupVerify >().params; - const provider = useRef< - ProviderMnemonicReactNative | ProviderSSSReactNative | null - >(null); + const provider = useRef(null); const [mnemonic, setMnemonic] = useState(null); useEffectAsync(async () => { provider.current = (await getProviderInstanceForWallet(wallet, true)) as - | ProviderMnemonicReactNative - | ProviderSSSReactNative; + | ProviderMnemonicBase + | ProviderSSSBase; if ( - provider.current instanceof ProviderMnemonicReactNative || - provider.current instanceof ProviderSSSReactNative + provider.current instanceof ProviderMnemonicBase || + provider.current instanceof ProviderMnemonicEvm || + provider.current instanceof ProviderSSSEvm || + provider.current instanceof ProviderSSSBase ) { provider.current.getMnemonicPhrase().then(phrase => setMnemonic(phrase)); } @@ -44,7 +48,10 @@ export const BackupVerifyScreen = memo(() => { const onDone = useCallback( async (selected: string) => { if (selected === mnemonic && provider.current !== null) { - if (provider.current instanceof ProviderMnemonicReactNative) { + if ( + provider.current instanceof ProviderMnemonicBase || + provider.current instanceof ProviderMnemonicEvm + ) { await provider.current.setMnemonicSaved(); } diff --git a/src/screens/HomeStack/HomeFeedStack/wallets.tsx b/src/screens/HomeStack/HomeFeedStack/wallets.tsx index df81c6302..d7e8941d1 100644 --- a/src/screens/HomeStack/HomeFeedStack/wallets.tsx +++ b/src/screens/HomeStack/HomeFeedStack/wallets.tsx @@ -1,7 +1,10 @@ import React, {useCallback} from 'react'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import { + ProviderMnemonicBase, + ProviderSSSBase, + ProviderSSSEvm, +} from '@haqq/rn-wallet-providers'; import {observer} from 'mobx-react'; import {Wallets} from '@app/components/wallets'; @@ -117,10 +120,11 @@ export const WalletsWrapper = observer(() => { ); const onPressCreate = useCallback(async () => { - const getType = ( - provider: ProviderMnemonicReactNative | ProviderSSSReactNative, - ) => { - if (provider instanceof ProviderSSSReactNative) { + const getType = (provider: ProviderMnemonicBase | ProviderSSSBase) => { + if ( + provider instanceof ProviderSSSBase || + provider instanceof ProviderSSSEvm + ) { return WalletType.sss; } return WalletType.mnemonic; diff --git a/src/screens/HomeStack/ManageAccountsStack/settings-account-detail.tsx b/src/screens/HomeStack/ManageAccountsStack/settings-account-detail.tsx index be9371c9f..965dd4aa1 100644 --- a/src/screens/HomeStack/ManageAccountsStack/settings-account-detail.tsx +++ b/src/screens/HomeStack/ManageAccountsStack/settings-account-detail.tsx @@ -1,6 +1,6 @@ import React, {useCallback, useEffect} from 'react'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {observer} from 'mobx-react'; import {Alert, Platform} from 'react-native'; @@ -86,8 +86,9 @@ export const SettingsAccountDetailScreen = observer(() => { requestAnimationFrame(async () => { const sssWalletsCountBefore = Wallet.count(WalletType.sss); const accountID = wallet?.accountId; - const providerArray = - await ProviderSSSReactNative.getStoragesForAccount(accountID!); + const providerArray = await ProviderSSSBase.getStoragesForAccount( + accountID!, + ); await Wallet.remove(address); hideModal(ModalType.loading); navigation.goBack(); diff --git a/src/screens/HomeStack/ManageAccountsStack/settings-view-recovery-phrase.tsx b/src/screens/HomeStack/ManageAccountsStack/settings-view-recovery-phrase.tsx index a71487cf3..b830eff5c 100644 --- a/src/screens/HomeStack/ManageAccountsStack/settings-view-recovery-phrase.tsx +++ b/src/screens/HomeStack/ManageAccountsStack/settings-view-recovery-phrase.tsx @@ -1,7 +1,6 @@ import React, {memo, useCallback, useState} from 'react'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderMnemonicBase, ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {SettingsViewRecoveryPhrase} from '@app/components/settings/settings-view-recovery-phrase'; import {CustomHeader, Loading} from '@app/components/ui'; @@ -30,7 +29,7 @@ export const SettingsViewRecoveryPhraseScreen = memo(() => { const onEnter = useCallback(async () => { switch (type) { case WalletType.mnemonic: - const providerMnemonic = new ProviderMnemonicReactNative({ + const providerMnemonic = new ProviderMnemonicBase({ account: accountId, getPassword: app.getPassword.bind(app), }); @@ -39,7 +38,7 @@ export const SettingsViewRecoveryPhraseScreen = memo(() => { break; case WalletType.sss: const storage = await getProviderStorage(accountId); - const providerSss = new ProviderSSSReactNative({ + const providerSss = new ProviderSSSBase({ storage, getPassword: app.getPassword.bind(app), account: accountId, diff --git a/src/screens/HomeStack/SssMigrate/sss-migrate-store.tsx b/src/screens/HomeStack/SssMigrate/sss-migrate-store.tsx index 4f36db60b..590d40999 100644 --- a/src/screens/HomeStack/SssMigrate/sss-migrate-store.tsx +++ b/src/screens/HomeStack/SssMigrate/sss-migrate-store.tsx @@ -1,7 +1,6 @@ import {useEffect} from 'react'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderMnemonicBase, ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {useFocusEffect} from '@react-navigation/native'; import {mnemonicToEntropy} from 'ethers/lib/utils'; import {observer} from 'mobx-react'; @@ -37,7 +36,7 @@ export const SssMigrateStoreScreen = observer(() => { const storage = await getProviderStorage('', route.params.provider); const getPassword = app.getPassword.bind(app); - const mnemonicProvider = new ProviderMnemonicReactNative({ + const mnemonicProvider = new ProviderMnemonicBase({ account: route.params.accountId, getPassword, }); @@ -52,7 +51,7 @@ export const SssMigrateStoreScreen = observer(() => { entropy = entropy.padStart(64, '0'); - const provider = await ProviderSSSReactNative.initialize( + const provider = await ProviderSSSBase.initialize( route.params.privateKey, null, null, @@ -85,10 +84,7 @@ export const SssMigrateStoreScreen = observer(() => { accountId, socialLinkEnabled: true, }); - await ProviderSSSReactNative.setStorageForAccount( - accountId, - storage, - ); + await ProviderSSSBase.setStorageForAccount(accountId, storage); } } diff --git a/src/screens/HomeStack/StakingDelegateStack/staking-delegate-form.tsx b/src/screens/HomeStack/StakingDelegateStack/staking-delegate-form.tsx index aee224a43..4af7dde9e 100644 --- a/src/screens/HomeStack/StakingDelegateStack/staking-delegate-form.tsx +++ b/src/screens/HomeStack/StakingDelegateStack/staking-delegate-form.tsx @@ -1,6 +1,6 @@ import React, {useCallback, useMemo, useState} from 'react'; -import {ProviderLedgerReactNative} from '@haqq/provider-ledger-react-native'; +import {ProviderLedgerEvm} from '@haqq/rn-wallet-providers'; import _ from 'lodash'; import {observer} from 'mobx-react'; @@ -55,7 +55,7 @@ export const StakingDelegateFormScreen = observer(() => { Logger.log('f.amount', f.amount); _setFee(new Balance(f.amount)); } catch (err) { - if (instance instanceof ProviderLedgerReactNative) { + if (instance instanceof ProviderLedgerEvm) { instance.abort(); setDefaultFee(); } diff --git a/src/screens/HomeStack/StakingUndelegateStack/staking-undelegate-form.tsx b/src/screens/HomeStack/StakingUndelegateStack/staking-undelegate-form.tsx index 28b50d78b..678ffceef 100644 --- a/src/screens/HomeStack/StakingUndelegateStack/staking-undelegate-form.tsx +++ b/src/screens/HomeStack/StakingUndelegateStack/staking-undelegate-form.tsx @@ -1,6 +1,6 @@ import React, {useCallback, useEffect, useMemo, useState} from 'react'; -import {ProviderLedgerReactNative} from '@haqq/provider-ledger-react-native'; +import {ProviderLedgerEvm} from '@haqq/rn-wallet-providers'; import _ from 'lodash'; import {observer} from 'mobx-react'; @@ -66,7 +66,7 @@ export const StakingUnDelegateFormScreen = observer(() => { Logger.log('f.amount', f.amount); _setFee(new Balance(f.amount)); } catch (err) { - if (instance instanceof ProviderLedgerReactNative) { + if (instance instanceof ProviderLedgerEvm) { instance.abort(); setDefaultFee(); } diff --git a/src/screens/HomeStack/TransactionStack/transaction-ledger.tsx b/src/screens/HomeStack/TransactionStack/transaction-ledger.tsx index 35f51a58f..2aa0d0182 100644 --- a/src/screens/HomeStack/TransactionStack/transaction-ledger.tsx +++ b/src/screens/HomeStack/TransactionStack/transaction-ledger.tsx @@ -1,6 +1,6 @@ import React, {memo, useCallback, useEffect, useRef} from 'react'; -import {ProviderInterface} from '@haqq/provider-base'; +import {ProviderInterface} from '@haqq/rn-wallet-providers'; import {TransactionLedger} from '@app/components/transaction-ledger'; import {app} from '@app/contexts'; diff --git a/src/screens/WelcomeStack/SignInStack/signin-networks.tsx b/src/screens/WelcomeStack/SignInStack/signin-networks.tsx index e409649e6..e8d3e8142 100644 --- a/src/screens/WelcomeStack/SignInStack/signin-networks.tsx +++ b/src/screens/WelcomeStack/SignInStack/signin-networks.tsx @@ -1,7 +1,7 @@ import React, {memo, useCallback} from 'react'; -import {ITEM_KEY} from '@haqq/provider-sss-react-native/dist/constants'; import {accountInfo} from '@haqq/provider-web3-utils'; +import {constants} from '@haqq/rn-wallet-providers'; import EncryptedStorage from 'react-native-encrypted-storage'; import {SigninNetworks} from '@app/components/signin-networks'; @@ -94,7 +94,9 @@ export const SignInNetworksScreen = memo(() => { ); const localShare = await EncryptedStorage.getItem( - `${ITEM_KEY}_${account.address.toLowerCase()}`, + `${ + constants.ITEM_KEYS[constants.WalletType.sss] + }_${account.address.toLowerCase()}`, ); if (!cloudShare) { diff --git a/src/screens/WelcomeStack/SignInStack/signin-restore-wallet.tsx b/src/screens/WelcomeStack/SignInStack/signin-restore-wallet.tsx index 2d6db5f4a..b5ac9be69 100644 --- a/src/screens/WelcomeStack/SignInStack/signin-restore-wallet.tsx +++ b/src/screens/WelcomeStack/SignInStack/signin-restore-wallet.tsx @@ -1,6 +1,6 @@ import React, {memo, useCallback} from 'react'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; +import {ProviderMnemonicBase} from '@haqq/rn-wallet-providers'; import {utils} from 'ethers'; import {SignInRestore} from '@app/components/singin-restore-wallet'; @@ -36,7 +36,7 @@ export const SignInRestoreScreen = memo(() => { const generatedPassword = String(makeID(10)); const passwordPromise = () => Promise.resolve(generatedPassword); - const provider = await ProviderMnemonicReactNative.initialize( + const provider = await ProviderMnemonicBase.initialize( seed.trim().toLowerCase(), app.onboarded ? app.getPassword.bind(app) : passwordPromise, {}, diff --git a/src/screens/WelcomeStack/SignInStack/signin-store-wallet.tsx b/src/screens/WelcomeStack/SignInStack/signin-store-wallet.tsx index 9f860b512..d7b8dbb66 100644 --- a/src/screens/WelcomeStack/SignInStack/signin-store-wallet.tsx +++ b/src/screens/WelcomeStack/SignInStack/signin-store-wallet.tsx @@ -1,8 +1,10 @@ import {useEffect} from 'react'; -import {ProviderHotReactNative} from '@haqq/provider-hot-react-native'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import { + ProviderHotBase, + ProviderMnemonicBase, + ProviderSSSBase, +} from '@haqq/rn-wallet-providers'; import {observer} from 'mobx-react'; import {app} from '@app/contexts'; @@ -58,7 +60,7 @@ export const SignInStoreWalletScreen = observer(() => { ? params.privateKey.slice(2) : params.privateKey; - const provider = await ProviderHotReactNative.initialize( + const provider = await ProviderHotBase.initialize( privateKey, app.getPassword.bind(app), {}, @@ -74,12 +76,11 @@ export const SignInStoreWalletScreen = observer(() => { }); break; case 'mnemonic': - const mnemonicProvider = - await ProviderMnemonicReactNative.initialize( - params.mnemonic, - getPassword, - {}, - ); + const mnemonicProvider = await ProviderMnemonicBase.initialize( + params.mnemonic, + getPassword, + {}, + ); await mnemonicProvider.setMnemonicSaved(); @@ -90,7 +91,7 @@ export const SignInStoreWalletScreen = observer(() => { const storage = await getProviderStorage('', params.provider); const password = await getPassword(); - const sssProvider = await ProviderSSSReactNative.initialize( + const sssProvider = await ProviderSSSBase.initialize( params.sssPrivateKey, params.sssCloudShare, params.sssLocalShare, diff --git a/src/screens/WelcomeStack/SignUpStack/signup-network-exists.tsx b/src/screens/WelcomeStack/SignUpStack/signup-network-exists.tsx index 9e9dc3513..fce2645bf 100644 --- a/src/screens/WelcomeStack/SignUpStack/signup-network-exists.tsx +++ b/src/screens/WelcomeStack/SignUpStack/signup-network-exists.tsx @@ -1,7 +1,7 @@ import React, {memo, useCallback} from 'react'; -import {ITEM_KEY} from '@haqq/provider-sss-react-native/dist/constants'; import {accountInfo} from '@haqq/provider-web3-utils'; +import {constants} from '@haqq/rn-wallet-providers'; import {Alert} from 'react-native'; import EncryptedStorage from 'react-native-encrypted-storage'; @@ -51,7 +51,9 @@ export const SignupNetworkExistsScreen = memo(() => { ); const localShare = await EncryptedStorage.getItem( - `${ITEM_KEY}_${account.address.toLowerCase()}`, + `${ + constants.ITEM_KEYS[constants.WalletType.sss] + }_${account.address.toLowerCase()}`, ); if (!cloudShare && !localShare) { diff --git a/src/screens/WelcomeStack/SignUpStack/signup-store-wallet.tsx b/src/screens/WelcomeStack/SignUpStack/signup-store-wallet.tsx index 4d7b40827..9c3c26cf0 100644 --- a/src/screens/WelcomeStack/SignUpStack/signup-store-wallet.tsx +++ b/src/screens/WelcomeStack/SignUpStack/signup-store-wallet.tsx @@ -1,6 +1,6 @@ import {useCallback, useEffect} from 'react'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderSSSBase, ProviderSSSEvm} from '@haqq/rn-wallet-providers'; import {observer} from 'mobx-react'; import {app} from '@app/contexts'; @@ -52,7 +52,9 @@ export const SignUpStoreWalletScreen = observer(() => { //@ts-ignore route.params.sssPrivateKey || //@ts-ignore - route.params.provider instanceof ProviderSSSReactNative || + route.params.provider instanceof ProviderSSSBase || + //@ts-ignore + route.params.provider instanceof ProviderSSSEvm || //@ts-ignore Object.values(SssProviders).includes(route.params.provider) ) { diff --git a/src/screens/choose-account-screen.tsx b/src/screens/choose-account-screen.tsx index 14f94adc1..107d66f87 100644 --- a/src/screens/choose-account-screen.tsx +++ b/src/screens/choose-account-screen.tsx @@ -1,7 +1,6 @@ import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderMnemonicBase, ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {useFocusEffect} from '@react-navigation/native'; import {observer} from 'mobx-react'; @@ -47,17 +46,16 @@ export const ChooseAccountScreen = observer(() => { const generator = useRef | null>( null, ); - const walletProvider = useRef< - ProviderMnemonicReactNative | ProviderSSSReactNative | null - >(null); + const walletProvider = useRef( + null, + ); const isMnemonicProvider = - walletProvider.current instanceof ProviderMnemonicReactNative; - const isSSSProvider = - walletProvider.current instanceof ProviderSSSReactNative; + walletProvider.current instanceof ProviderMnemonicBase; + const isSSSProvider = walletProvider.current instanceof ProviderSSSBase; useEffect(() => { - if (params.provider instanceof ProviderSSSReactNative) { + if (params.provider instanceof ProviderSSSBase) { navigation.setOptions({ //@ts-ignore customBackFunction: () => navigation.popToTop(), @@ -125,7 +123,7 @@ export const ChooseAccountScreen = observer(() => { setLoading(true); try { walletProvider.current = params.provider; - if (walletProvider.current instanceof ProviderMnemonicReactNative) { + if (walletProvider.current instanceof ProviderMnemonicBase) { await walletProvider.current.setMnemonicSaved(); } @@ -212,7 +210,7 @@ export const ChooseAccountScreen = observer(() => { const accountID = walletsToCreate[0].accountId; //@ts-ignore const storage = await getProviderStorage(accountID, params.sssProvider); - await ProviderSSSReactNative.setStorageForAccount(accountID, storage); + await ProviderSSSBase.setStorageForAccount(accountID, storage); } if (isMnemonicProvider && !app.onboarded) { diff --git a/src/screens/popup-backup-sss-notification.tsx b/src/screens/popup-backup-sss-notification.tsx index 22059165c..4f361b5f2 100644 --- a/src/screens/popup-backup-sss-notification.tsx +++ b/src/screens/popup-backup-sss-notification.tsx @@ -1,6 +1,6 @@ import React, {memo, useCallback} from 'react'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {addMinutes} from 'date-fns'; import { @@ -31,7 +31,7 @@ export const BackupSssNotificationScreen = memo(() => { if (wallet.accountId) { const storage = new Cloud(); - const provider = new ProviderSSSReactNative({ + const provider = new ProviderSSSBase({ storage, account: wallet.accountId, getPassword: app.getPassword.bind(app), diff --git a/src/screens/sss-store-wallet.tsx b/src/screens/sss-store-wallet.tsx index 317c99f78..96b6ed02d 100644 --- a/src/screens/sss-store-wallet.tsx +++ b/src/screens/sss-store-wallet.tsx @@ -1,7 +1,7 @@ //@ts-nocheck import React, {useEffect} from 'react'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +import {ProviderSSSBase} from '@haqq/rn-wallet-providers'; import {app} from '@app/contexts'; import {hideModal, showModal} from '@app/helpers'; @@ -28,7 +28,7 @@ export const SssStoreWalletScreen = () => { try { const storage = await getProviderStorage(); - const provider = await ProviderSSSReactNative.initialize( + const provider = await ProviderSSSBase.initialize( route.params.privateKey, route.params.cloudShare, route.params.localShare, diff --git a/src/services/async-local-storage.ts b/src/services/async-local-storage.ts index e4a410c5d..8a52706b3 100644 --- a/src/services/async-local-storage.ts +++ b/src/services/async-local-storage.ts @@ -1,4 +1,4 @@ -import {StorageInterface} from '@haqq/provider-sss-react-native'; +import {StorageInterface} from '@haqq/rn-wallet-providers'; import RNAsyncStorage from '@react-native-async-storage/async-storage'; export class AsyncLocalStorage implements StorageInterface { diff --git a/src/services/cloud.ts b/src/services/cloud.ts index 96d80af3a..ffe87b1e5 100644 --- a/src/services/cloud.ts +++ b/src/services/cloud.ts @@ -1,4 +1,4 @@ -import {StorageInterface} from '@haqq/provider-sss-react-native'; +import {StorageInterface} from '@haqq/rn-wallet-providers'; import {NativeModules} from 'react-native'; const {RNCloud} = NativeModules; diff --git a/src/services/cosmos.ts b/src/services/cosmos.ts index 17bbb3e2e..c4e30718d 100644 --- a/src/services/cosmos.ts +++ b/src/services/cosmos.ts @@ -38,8 +38,7 @@ import { signatureToWeb3Extension, } from '@evmos/transactions'; import {Sender} from '@evmos/transactions/dist/messages/common'; -import {ProviderInterface, base64PublicKey} from '@haqq/provider-base'; -import {normalize0x} from '@haqq/provider-keystone-react-native'; +import {ProviderInterface, utils} from '@haqq/rn-wallet-providers'; import Decimal from 'decimal.js'; import {AddressUtils} from '@app/helpers/address-utils'; @@ -317,7 +316,7 @@ export class Cosmos { accountAddress: account.base_account.address, sequence: parseInt(account.base_account.sequence as string, 10), accountNumber: parseInt(account.base_account.account_number, 10), - pubkey: base64PublicKey(publicKey), + pubkey: utils.base64PublicKey(publicKey), }; } @@ -335,7 +334,7 @@ export class Cosmos { types, }); - return normalize0x(signature); + return utils.normalize0x(signature); } async sendMsg( diff --git a/src/services/eth-network/eth-network.ts b/src/services/eth-network/eth-network.ts index ef0c3d409..eb5f1f822 100644 --- a/src/services/eth-network/eth-network.ts +++ b/src/services/eth-network/eth-network.ts @@ -1,6 +1,6 @@ import {TransactionRequest} from '@ethersproject/abstract-provider'; import {Deferrable} from '@ethersproject/properties'; -import {ProviderInterface} from '@haqq/provider-base'; +import {ProviderInterface} from '@haqq/rn-wallet-providers'; import Decimal from 'decimal.js'; import {BigNumber, utils} from 'ethers'; diff --git a/src/services/eth-sign.ts b/src/services/eth-sign.ts index 151f1fa77..e1669540e 100644 --- a/src/services/eth-sign.ts +++ b/src/services/eth-sign.ts @@ -1,4 +1,4 @@ -import {TransactionRequest} from '@haqq/provider-base'; +import {TransactionRequest} from '@haqq/rn-wallet-providers'; import {app} from '@app/contexts'; import {AddressUtils} from '@app/helpers/address-utils'; diff --git a/src/services/google-drive-2.ts b/src/services/google-drive-2.ts index bba891f8a..59135d010 100644 --- a/src/services/google-drive-2.ts +++ b/src/services/google-drive-2.ts @@ -1,4 +1,4 @@ -import {StorageInterface} from '@haqq/provider-sss-react-native'; +import {StorageInterface} from '@haqq/rn-wallet-providers'; import {Cloud} from '@app/services/cloud'; diff --git a/src/services/google-drive.ts b/src/services/google-drive.ts index 418f9a3c3..7fdc592c2 100644 --- a/src/services/google-drive.ts +++ b/src/services/google-drive.ts @@ -1,4 +1,4 @@ -import {StorageInterface} from '@haqq/provider-sss-react-native'; +import {StorageInterface} from '@haqq/rn-wallet-providers'; import {getGoogleTokens, hasGoogleToken} from '@app/helpers/get-google-tokens'; import {getHttpResponse, makeID} from '@app/utils'; diff --git a/src/services/json-rpc-middleware/index.ts b/src/services/json-rpc-middleware/index.ts index 5e48159f0..328d8b782 100644 --- a/src/services/json-rpc-middleware/index.ts +++ b/src/services/json-rpc-middleware/index.ts @@ -1,4 +1,4 @@ -import {normalize0x} from '@haqq/provider-keystone-react-native'; +import {utils} from '@haqq/rn-wallet-providers'; import {getSdkError} from '@walletconnect/utils'; import {JsonRpcError, createAsyncMiddleware} from 'json-rpc-engine'; @@ -44,7 +44,7 @@ export const createJsonRpcMiddleware = ({ res.result = await handler({req, helper}); if (typeof res.result === 'string') { - res.result = normalize0x(res.result); + res.result = utils.normalize0x(res.result); } if (req.method === 'eth_requestAccounts' && Array.isArray(res.result)) { diff --git a/src/services/provider-sss-initialize.ts b/src/services/provider-sss-initialize.ts index 8ec98155d..e8c07a99c 100644 --- a/src/services/provider-sss-initialize.ts +++ b/src/services/provider-sss-initialize.ts @@ -1,12 +1,11 @@ -import {ProviderBaseOptions} from '@haqq/provider-base'; +import {accountInfo, generateEntropy} from '@haqq/provider-web3-utils'; import { - Polynomial, - ProviderSSSReactNative, + ProviderBaseOptions, + ProviderSSSBase, StorageInterface, - lagrangeInterpolation, -} from '@haqq/provider-sss-react-native'; -import {ITEM_KEY} from '@haqq/provider-sss-react-native/dist/constants'; -import {accountInfo, generateEntropy} from '@haqq/provider-web3-utils'; + constants, + utils, +} from '@haqq/rn-wallet-providers'; import { encryptShare, jsonrpcRequest, @@ -38,7 +37,7 @@ export async function providerSssInitialize( metadataUrl: string; generateSharesUrl: string; }, -): Promise { +): Promise { let keyPK = socialPrivateKey; let shares = []; @@ -66,7 +65,7 @@ export async function providerSssInitialize( ? Buffer.from(privateKey, 'hex') : await generateEntropy(32); - const p = await Polynomial.initialize(pk, 2); + const p = await utils.Polynomial.initialize(pk, 2); for (let i = 0; i < 2; i++) { const index = await generateEntropy(16); @@ -74,13 +73,13 @@ export async function providerSssInitialize( } } - const poly = await Polynomial.fromShares(shares); + const poly = await utils.Polynomial.fromShares(shares); if (!socialPrivateKey || privateKey) { const index = await generateEntropy(16); const tmpSocialShare = poly.getShare(index.toString('hex')); - const p = await Polynomial.initialize( + const p = await utils.Polynomial.initialize( new BN(tmpSocialShare.share, 'hex'), 3, ); @@ -115,7 +114,7 @@ export async function providerSssInitialize( throw new Error('not enough shares'); } - const newPk = lagrangeInterpolation( + const newPk = utils.lagrangeInterpolation( sharesTmp2.map(s => new BN(s[0], 'hex')), sharesTmp2.map(s => new BN(s[1], 'hex')), ); @@ -152,7 +151,7 @@ export async function providerSssInitialize( ); if (stored) { - await ProviderSSSReactNative.setStorageForAccount( + await ProviderSSSBase.setStorageForAccount( address.toLowerCase(), storage, ); @@ -167,18 +166,18 @@ export async function providerSssInitialize( const sqStore = await encryptShare(deviceShare, pass); await EncryptedStorage.setItem( - `${ITEM_KEY}_${address.toLowerCase()}`, + `${constants.ITEM_KEYS[constants.WalletType.sss]}_${address.toLowerCase()}`, JSON.stringify(sqStore), ); - const accounts = await ProviderSSSReactNative.getAccounts(); + const accounts = await ProviderSSSBase.getAccounts(); await EncryptedStorage.setItem( - `${ITEM_KEY}_accounts`, + `${constants.ITEM_KEYS[constants.WalletType.sss]}_accounts`, JSON.stringify(accounts.concat(address.toLowerCase())), ); - return new ProviderSSSReactNative({ + return new ProviderSSSBase({ ...options, getPassword, storage, diff --git a/src/services/provider-sss.ts b/src/services/provider-sss.ts index 87bc32082..c33b3971b 100644 --- a/src/services/provider-sss.ts +++ b/src/services/provider-sss.ts @@ -1,5 +1,5 @@ -import {lagrangeInterpolation} from '@haqq/provider-sss-react-native'; import {generateEntropy} from '@haqq/provider-web3-utils'; +import {lagrangeInterpolation} from '@haqq/rn-wallet-providers/dist/utils'; import {jsonrpcRequest} from '@haqq/shared-react-native'; import {appleAuth} from '@invertase/react-native-apple-authentication'; import BN from 'bn.js'; diff --git a/src/services/sign-json-rpc-request.ts b/src/services/sign-json-rpc-request.ts index 3937d2dd8..6f538f30b 100644 --- a/src/services/sign-json-rpc-request.ts +++ b/src/services/sign-json-rpc-request.ts @@ -1,5 +1,4 @@ -import {TransactionRequest} from '@haqq/provider-base'; -import {normalize0x} from '@haqq/provider-keystone-react-native'; +import {TransactionRequest, utils} from '@haqq/rn-wallet-providers'; import {getSdkError} from '@walletconnect/utils'; import {DEBUG_VARS} from '@app/debug-vars'; @@ -228,6 +227,6 @@ export class SignJsonRpcRequest { logger.log('✅ signEIP155Request result:', result, result.length); - return normalize0x(result); + return utils.normalize0x(result); } } diff --git a/src/types.ts b/src/types.ts index 4d15f62a9..0934aef89 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,11 +7,11 @@ import {Coin} from '@evmos/transactions'; import { AccessListish, BigNumberish, + KeystoneAwaitForSignParams, + ProviderMnemonicBase, + ProviderSSSBase, TypedDataTypesNames, -} from '@haqq/provider-base'; -import {KeystoneAwaitForSignParams} from '@haqq/provider-keystone-react-native'; -import {ProviderMnemonicReactNative} from '@haqq/provider-mnemonic-react-native'; -import {ProviderSSSReactNative} from '@haqq/provider-sss-react-native'; +} from '@haqq/rn-wallet-providers'; import {FirebaseMessagingTypes} from '@react-native-firebase/messaging'; import {NativeStackNavigationOptions} from '@react-navigation/native-stack'; import {SessionTypes} from '@walletconnect/types'; @@ -153,9 +153,9 @@ export type KeystoneWalletInitialData = { export type RootStackParamList = { chooseAccount: - | (WalletInitialData & {provider: ProviderMnemonicReactNative}) + | (WalletInitialData & {provider: ProviderMnemonicBase}) | { - provider: ProviderSSSReactNative; + provider: ProviderSSSBase; }; cloudProblems: {sssProvider: SssProviders; onNext: () => void}; home: undefined; diff --git a/yarn.lock b/yarn.lock index 8bb5894cc..31c1d0678 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2364,113 +2364,42 @@ __metadata: languageName: node linkType: hard -"@haqq/provider-base@npm:0.0.23": - version: 0.0.23 - resolution: "@haqq/provider-base@npm:0.0.23" - dependencies: - bech32-converting: ^1.0.9 - ethers: ^5.7.2 - events: ^3.3.0 - checksum: 2b34d31e39567ba7e2996b8bece47037aae6ae760225dc0423c561d832934bcd65787f5d0688ead955a97254d80ba8353f3d4627775ca02d94460fe5fe06abd9 - languageName: node - linkType: hard - -"@haqq/provider-hot-react-native@npm:0.0.10": - version: 0.0.10 - resolution: "@haqq/provider-hot-react-native@npm:0.0.10" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - peerDependencies: - "@haqq/encryption-react-native": "*" - "@haqq/provider-base": "*" - "@haqq/provider-web3-utils": "*" - "@haqq/shared-react-native": "*" - react-native-encrypted-storage: "*" - checksum: c8eb370eea2a4ae06b77352308ddd3e9bbca77061e9704b0521f0500f6b956134d5f0e932d39f28ed90365fb49f7eda6163f5a1e46e19c65b75fcb76ba3dea4e - languageName: node - linkType: hard - -"@haqq/provider-keystone-react-native@npm:0.0.7": - version: 0.0.7 - resolution: "@haqq/provider-keystone-react-native@npm:0.0.7" - dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@keystonehq/bc-ur-registry-eth": ^0.7.7 - "@keystonehq/ur-decoder": ^0.12.2 - ethers: ^5.7.2 - events: ^3.3.0 +"@haqq/provider-web3-utils@npm:0.0.14": + version: 0.0.14 + resolution: "@haqq/provider-web3-utils@npm:0.0.14" peerDependencies: - "@haqq/provider-base": "*" react: "*" react-native: "*" - checksum: cbec5f892b86d88770430e5c1e509a96e29090db315529bfd4887902fabd6b5ef0337cc11c86495f1d4bef087d50516a23523da54183d436a34ba476bac2abd8 + checksum: a28940220969e4a4f4936901b836ffc4e89512639a860e7fc5f1242ee8a9ea3ba25a159092b8731d5fcee10e80d6db5481968e68fc0af8d7330e959e49065664 languageName: node linkType: hard -"@haqq/provider-ledger-react-native@npm:0.0.28": - version: 0.0.28 - resolution: "@haqq/provider-ledger-react-native@npm:0.0.28" +"@haqq/rn-wallet-providers@npm:0.0.2": + version: 0.0.2 + resolution: "@haqq/rn-wallet-providers@npm:0.0.2" dependencies: "@ethersproject/abstract-provider": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/transactions": ^5.7.0 + "@keystonehq/bc-ur-registry-eth": ^0.7.7 + "@keystonehq/ur-decoder": ^0.12.2 "@ledgerhq/hw-app-eth": 6.35.4 "@ledgerhq/hw-transport": 6.30.3 "@ledgerhq/react-native-hw-transport-ble": 6.30.0 + bech32-converting: ^1.0.9 + bip39: ^3.1.0 ethers: ^5.7.2 events: ^3.3.0 rxjs: ^7.8.0 - peerDependencies: - "@haqq/provider-base": "*" - react: "*" - react-native: "*" - react-native-ble-plx: "*" - checksum: 318d2eea26e856dfff2ac1cddf4cd97234ac5df793a825323e0f425cf42ed617686a751fb4cc4c850e9436994162d9a17c51d963f537b0cbbae3b1a44a1caca5 - languageName: node - linkType: hard - -"@haqq/provider-mnemonic-react-native@npm:0.0.14": - version: 0.0.14 - resolution: "@haqq/provider-mnemonic-react-native@npm:0.0.14" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - bip39: ^3.1.0 peerDependencies: "@haqq/encryption-react-native": "*" - "@haqq/provider-base": "*" - "@haqq/provider-web3-utils": "*" - "@haqq/shared-react-native": "*" - react-native-encrypted-storage: "*" - checksum: 35506b1ea1d079af309f71f6e6015a19ee1ca6c3950a07587a308d17711d2523e051bd4b52984287d5f06ff02da23e8ab89a4e22d266a29a7ebf31146a23750d - languageName: node - linkType: hard - -"@haqq/provider-sss-react-native@npm:0.0.14": - version: 0.0.14 - resolution: "@haqq/provider-sss-react-native@npm:0.0.14" - dependencies: - "@ethersproject/bytes": 5.7.0 - "@ethersproject/transactions": 5.7.0 - bn.js: 5.2.1 - events: 3.3.0 - peerDependencies: - "@haqq/provider-base": "*" "@haqq/provider-web3-utils": "*" "@haqq/shared-react-native": "*" react: "*" react-native: "*" + react-native-ble-plx: "*" react-native-encrypted-storage: "*" - checksum: 59430174e5f4fcb5a0b01c58496287dd8b5e5f08725e160f4f60380ce495749ef504f3a6deed04f0776d6afffe55e9f259cdd56eb7bcc8f6a5d46636a6b7ce89 - languageName: node - linkType: hard - -"@haqq/provider-web3-utils@npm:0.0.14": - version: 0.0.14 - resolution: "@haqq/provider-web3-utils@npm:0.0.14" - peerDependencies: - react: "*" - react-native: "*" - checksum: a28940220969e4a4f4936901b836ffc4e89512639a860e7fc5f1242ee8a9ea3ba25a159092b8731d5fcee10e80d6db5481968e68fc0af8d7330e959e49065664 + checksum: d85f7ed5f28ca7854ca13e07045da833862cc2352dcce761a09921519d72958982dc6c09754fec481b218b2687e8889fd5134ba159b7c533e4a4bf4cf2d6db99 languageName: node linkType: hard @@ -9828,12 +9757,11 @@ __metadata: linkType: hard "find-babel-config@npm:^2.0.0": - version: 2.1.1 - resolution: "find-babel-config@npm:2.1.1" + version: 2.1.2 + resolution: "find-babel-config@npm:2.1.2" dependencies: json5: ^2.2.3 - path-exists: ^4.0.0 - checksum: 4be54397339520e0cd49870acb10366684ffc001fd0b7bffedd0fe9d3e1d82234692d3cb4e5ba95280a35887238ba6f82dc79569a13a3749ae3931c23e0b3a99 + checksum: 268f29cb38ee086b0f953c89f762dcea30b5b0e14abee2b39516410c00b49baa6821f598bd50346c93584e5625c5740f5c8b7e34993f568787a068f84dacc8c2 languageName: node linkType: hard @@ -10498,13 +10426,8 @@ __metadata: "@expo/react-native-action-sheet": 4.0.1 "@haqq/encryption-react-native": 0.0.4 "@haqq/format-number-with-subscript-zeros": 1.0.1 - "@haqq/provider-base": 0.0.23 - "@haqq/provider-hot-react-native": 0.0.10 - "@haqq/provider-keystone-react-native": 0.0.7 - "@haqq/provider-ledger-react-native": 0.0.28 - "@haqq/provider-mnemonic-react-native": 0.0.14 - "@haqq/provider-sss-react-native": 0.0.14 "@haqq/provider-web3-utils": 0.0.14 + "@haqq/rn-wallet-providers": 0.0.2 "@haqq/shared-react-native": 0.0.12 "@invertase/react-native-apple-authentication": 2.2.2 "@keystonehq/bc-ur-registry-eth": 0.7.7 @@ -18331,7 +18254,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:1 || 2, tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.4.1 || ^1.9.3, tslib@npm:^2.5.3, tslib@npm:^2.6.2": +"tslib@npm:1 || 2, tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.4.1 || ^1.9.3, tslib@npm:^2.6.2": version: 2.6.3 resolution: "tslib@npm:2.6.3" checksum: 74fce0e100f1ebd95b8995fbbd0e6c91bdd8f4c35c00d4da62e285a3363aaa534de40a80db30ecfd388ed7c313c42d930ee0eaf108e8114214b180eec3dbe6f5 @@ -18345,6 +18268,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:^2.5.3": + version: 2.7.0 + resolution: "tslib@npm:2.7.0" + checksum: 1606d5c89f88d466889def78653f3aab0f88692e80bb2066d090ca6112ae250ec1cfa9dbfaab0d17b60da15a4186e8ec4d893801c67896b277c17374e36e1d28 + languageName: node + linkType: hard + "tsutils@npm:3, tsutils@npm:^3.21.0": version: 3.21.0 resolution: "tsutils@npm:3.21.0"