@yaswap/wallet-core 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +804 -0
- package/README.md +163 -0
- package/dist/package.json +76 -0
- package/dist/src/build.config.d.ts +46 -0
- package/dist/src/build.config.js +237 -0
- package/dist/src/build.config.js.map +1 -0
- package/dist/src/factory/client/clients.d.ts +11 -0
- package/dist/src/factory/client/clients.js +119 -0
- package/dist/src/factory/client/clients.js.map +1 -0
- package/dist/src/factory/client/evm.d.ts +6 -0
- package/dist/src/factory/client/evm.js +71 -0
- package/dist/src/factory/client/evm.js.map +1 -0
- package/dist/src/factory/client/index.d.ts +11 -0
- package/dist/src/factory/client/index.js +38 -0
- package/dist/src/factory/client/index.js.map +1 -0
- package/dist/src/factory/client/nft.d.ts +4 -0
- package/dist/src/factory/client/nft.js +26 -0
- package/dist/src/factory/client/nft.js.map +1 -0
- package/dist/src/factory/index.d.ts +3 -0
- package/dist/src/factory/index.js +7 -0
- package/dist/src/factory/index.js.map +1 -0
- package/dist/src/factory/settings.d.ts +4 -0
- package/dist/src/factory/settings.js +27 -0
- package/dist/src/factory/settings.js.map +1 -0
- package/dist/src/factory/swap/index.d.ts +4 -0
- package/dist/src/factory/swap/index.js +66 -0
- package/dist/src/factory/swap/index.js.map +1 -0
- package/dist/src/index.d.ts +1619 -0
- package/dist/src/index.js +38 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.test.d.ts +1 -0
- package/dist/src/index.test.js +187 -0
- package/dist/src/index.test.js.map +1 -0
- package/dist/src/nameResolvers/nameResolver.d.ts +7 -0
- package/dist/src/nameResolvers/nameResolver.js +3 -0
- package/dist/src/nameResolvers/nameResolver.js.map +1 -0
- package/dist/src/nameResolvers/uns.d.ts +12 -0
- package/dist/src/nameResolvers/uns.js +83 -0
- package/dist/src/nameResolvers/uns.js.map +1 -0
- package/dist/src/nameResolvers/uns.test.d.ts +1 -0
- package/dist/src/nameResolvers/uns.test.js +29 -0
- package/dist/src/nameResolvers/uns.test.js.map +1 -0
- package/dist/src/store/actions/acceptTermsAndConditions.d.ts +4 -0
- package/dist/src/store/actions/acceptTermsAndConditions.js +17 -0
- package/dist/src/store/actions/acceptTermsAndConditions.js.map +1 -0
- package/dist/src/store/actions/acceptTermsAndConditions.test.d.ts +1 -0
- package/dist/src/store/actions/acceptTermsAndConditions.test.js +22 -0
- package/dist/src/store/actions/acceptTermsAndConditions.test.js.map +1 -0
- package/dist/src/store/actions/accounts/createAccount.d.ts +7 -0
- package/dist/src/store/actions/accounts/createAccount.js +27 -0
- package/dist/src/store/actions/accounts/createAccount.js.map +1 -0
- package/dist/src/store/actions/accounts/createAccount.test.d.ts +1 -0
- package/dist/src/store/actions/accounts/createAccount.test.js +29 -0
- package/dist/src/store/actions/accounts/createAccount.test.js.map +1 -0
- package/dist/src/store/actions/accounts/index.d.ts +5 -0
- package/dist/src/store/actions/accounts/index.js +9 -0
- package/dist/src/store/actions/accounts/index.js.map +1 -0
- package/dist/src/store/actions/accounts/removeAccount.d.ts +7 -0
- package/dist/src/store/actions/accounts/removeAccount.js +12 -0
- package/dist/src/store/actions/accounts/removeAccount.js.map +1 -0
- package/dist/src/store/actions/accounts/removeAccount.test.d.ts +1 -0
- package/dist/src/store/actions/accounts/removeAccount.test.js +53 -0
- package/dist/src/store/actions/accounts/removeAccount.test.js.map +1 -0
- package/dist/src/store/actions/accounts/toggleAccount.d.ts +8 -0
- package/dist/src/store/actions/accounts/toggleAccount.js +19 -0
- package/dist/src/store/actions/accounts/toggleAccount.js.map +1 -0
- package/dist/src/store/actions/accounts/toggleAccount.test.d.ts +1 -0
- package/dist/src/store/actions/accounts/toggleAccount.test.js +44 -0
- package/dist/src/store/actions/accounts/toggleAccount.test.js.map +1 -0
- package/dist/src/store/actions/accounts/toggleBlockchain.d.ts +9 -0
- package/dist/src/store/actions/accounts/toggleBlockchain.js +14 -0
- package/dist/src/store/actions/accounts/toggleBlockchain.js.map +1 -0
- package/dist/src/store/actions/accounts/updateAccount.d.ts +26 -0
- package/dist/src/store/actions/accounts/updateAccount.js +14 -0
- package/dist/src/store/actions/accounts/updateAccount.js.map +1 -0
- package/dist/src/store/actions/addCustomToken.d.ts +12 -0
- package/dist/src/store/actions/addCustomToken.js +12 -0
- package/dist/src/store/actions/addCustomToken.js.map +1 -0
- package/dist/src/store/actions/addCustomToken.test.d.ts +1 -0
- package/dist/src/store/actions/addCustomToken.test.js +59 -0
- package/dist/src/store/actions/addCustomToken.test.js.map +1 -0
- package/dist/src/store/actions/addExternalConnection.d.ts +9 -0
- package/dist/src/store/actions/addExternalConnection.js +13 -0
- package/dist/src/store/actions/addExternalConnection.js.map +1 -0
- package/dist/src/store/actions/addExternalConnection.test.d.ts +1 -0
- package/dist/src/store/actions/addExternalConnection.test.js +100 -0
- package/dist/src/store/actions/addExternalConnection.test.js.map +1 -0
- package/dist/src/store/actions/analytics.d.ts +21 -0
- package/dist/src/store/actions/analytics.js +58 -0
- package/dist/src/store/actions/analytics.js.map +1 -0
- package/dist/src/store/actions/analytics.test.d.ts +1 -0
- package/dist/src/store/actions/analytics.test.js +33 -0
- package/dist/src/store/actions/analytics.test.js.map +1 -0
- package/dist/src/store/actions/changeActiveNetwork.d.ts +5 -0
- package/dist/src/store/actions/changeActiveNetwork.js +13 -0
- package/dist/src/store/actions/changeActiveNetwork.js.map +1 -0
- package/dist/src/store/actions/changeActiveWalletId.d.ts +5 -0
- package/dist/src/store/actions/changeActiveWalletId.js +11 -0
- package/dist/src/store/actions/changeActiveWalletId.js.map +1 -0
- package/dist/src/store/actions/changeActiveWalletId.test.d.ts +1 -0
- package/dist/src/store/actions/changeActiveWalletId.test.js +40 -0
- package/dist/src/store/actions/changeActiveWalletId.test.js.map +1 -0
- package/dist/src/store/actions/changePassword.d.ts +4 -0
- package/dist/src/store/actions/changePassword.js +13 -0
- package/dist/src/store/actions/changePassword.js.map +1 -0
- package/dist/src/store/actions/changePassword.test.d.ts +1 -0
- package/dist/src/store/actions/changePassword.test.js +22 -0
- package/dist/src/store/actions/changePassword.test.js.map +1 -0
- package/dist/src/store/actions/checkPendingActions.d.ts +5 -0
- package/dist/src/store/actions/checkPendingActions.js +25 -0
- package/dist/src/store/actions/checkPendingActions.js.map +1 -0
- package/dist/src/store/actions/clearErrorLog.d.ts +2 -0
- package/dist/src/store/actions/clearErrorLog.js +10 -0
- package/dist/src/store/actions/clearErrorLog.js.map +1 -0
- package/dist/src/store/actions/createWallet.d.ts +7 -0
- package/dist/src/store/actions/createWallet.js +90 -0
- package/dist/src/store/actions/createWallet.js.map +1 -0
- package/dist/src/store/actions/createWallet.test.d.ts +1 -0
- package/dist/src/store/actions/createWallet.test.js +41 -0
- package/dist/src/store/actions/createWallet.test.js.map +1 -0
- package/dist/src/store/actions/customChainSettings.d.ts +15 -0
- package/dist/src/store/actions/customChainSettings.js +37 -0
- package/dist/src/store/actions/customChainSettings.js.map +1 -0
- package/dist/src/store/actions/disableAssets.d.ts +7 -0
- package/dist/src/store/actions/disableAssets.js +28 -0
- package/dist/src/store/actions/disableAssets.js.map +1 -0
- package/dist/src/store/actions/disableEthereumInjection.d.ts +2 -0
- package/dist/src/store/actions/disableEthereumInjection.js +11 -0
- package/dist/src/store/actions/disableEthereumInjection.js.map +1 -0
- package/dist/src/store/actions/disableEthereumInjection.test.d.ts +1 -0
- package/dist/src/store/actions/disableEthereumInjection.test.js +24 -0
- package/dist/src/store/actions/disableEthereumInjection.test.js.map +1 -0
- package/dist/src/store/actions/enableAssets.d.ts +7 -0
- package/dist/src/store/actions/enableAssets.js +65 -0
- package/dist/src/store/actions/enableAssets.js.map +1 -0
- package/dist/src/store/actions/enableAssets.test.d.ts +1 -0
- package/dist/src/store/actions/enableAssets.test.js +37 -0
- package/dist/src/store/actions/enableAssets.test.js.map +1 -0
- package/dist/src/store/actions/enableDisableAssets.test.d.ts +1 -0
- package/dist/src/store/actions/enableDisableAssets.test.js +79 -0
- package/dist/src/store/actions/enableDisableAssets.test.js.map +1 -0
- package/dist/src/store/actions/enableEthereumInjection.d.ts +2 -0
- package/dist/src/store/actions/enableEthereumInjection.js +11 -0
- package/dist/src/store/actions/enableEthereumInjection.js.map +1 -0
- package/dist/src/store/actions/exportPrivateKey.d.ts +9 -0
- package/dist/src/store/actions/exportPrivateKey.js +12 -0
- package/dist/src/store/actions/exportPrivateKey.js.map +1 -0
- package/dist/src/store/actions/exportPrivateKey.test.d.ts +1 -0
- package/dist/src/store/actions/exportPrivateKey.test.js +36 -0
- package/dist/src/store/actions/exportPrivateKey.test.js.map +1 -0
- package/dist/src/store/actions/fetchTokenDetails.d.ts +11 -0
- package/dist/src/store/actions/fetchTokenDetails.js +22 -0
- package/dist/src/store/actions/fetchTokenDetails.js.map +1 -0
- package/dist/src/store/actions/forgetDappConnections.d.ts +2 -0
- package/dist/src/store/actions/forgetDappConnections.js +11 -0
- package/dist/src/store/actions/forgetDappConnections.js.map +1 -0
- package/dist/src/store/actions/getLockForAsset.d.ts +8 -0
- package/dist/src/store/actions/getLockForAsset.js +34 -0
- package/dist/src/store/actions/getLockForAsset.js.map +1 -0
- package/dist/src/store/actions/getQuotes.d.ts +13 -0
- package/dist/src/store/actions/getQuotes.js +70 -0
- package/dist/src/store/actions/getQuotes.js.map +1 -0
- package/dist/src/store/actions/getQuotes.test.d.ts +1 -0
- package/dist/src/store/actions/getQuotes.test.js +30 -0
- package/dist/src/store/actions/getQuotes.test.js.map +1 -0
- package/dist/src/store/actions/getUnusedAddresses.d.ts +8 -0
- package/dist/src/store/actions/getUnusedAddresses.js +51 -0
- package/dist/src/store/actions/getUnusedAddresses.js.map +1 -0
- package/dist/src/store/actions/hardware-wallet/getLedgerAccounts.d.ts +16 -0
- package/dist/src/store/actions/hardware-wallet/getLedgerAccounts.js +57 -0
- package/dist/src/store/actions/hardware-wallet/getLedgerAccounts.js.map +1 -0
- package/dist/src/store/actions/hardware-wallet/index.d.ts +1 -0
- package/dist/src/store/actions/hardware-wallet/index.js +5 -0
- package/dist/src/store/actions/hardware-wallet/index.js.map +1 -0
- package/dist/src/store/actions/index.d.ts +47 -0
- package/dist/src/store/actions/index.js +51 -0
- package/dist/src/store/actions/index.js.map +1 -0
- package/dist/src/store/actions/initializeAddresses.d.ts +6 -0
- package/dist/src/store/actions/initializeAddresses.js +26 -0
- package/dist/src/store/actions/initializeAddresses.js.map +1 -0
- package/dist/src/store/actions/initializeAddresses.test.d.ts +1 -0
- package/dist/src/store/actions/initializeAddresses.test.js +58 -0
- package/dist/src/store/actions/initializeAddresses.test.js.map +1 -0
- package/dist/src/store/actions/lockWallet.d.ts +2 -0
- package/dist/src/store/actions/lockWallet.js +11 -0
- package/dist/src/store/actions/lockWallet.js.map +1 -0
- package/dist/src/store/actions/lockWallet.test.d.ts +1 -0
- package/dist/src/store/actions/lockWallet.test.js +24 -0
- package/dist/src/store/actions/lockWallet.test.js.map +1 -0
- package/dist/src/store/actions/logError.d.ts +3 -0
- package/dist/src/store/actions/logError.js +10 -0
- package/dist/src/store/actions/logError.js.map +1 -0
- package/dist/src/store/actions/logError.test.d.ts +1 -0
- package/dist/src/store/actions/logError.test.js +27 -0
- package/dist/src/store/actions/logError.test.js.map +1 -0
- package/dist/src/store/actions/newSwap.d.ts +12 -0
- package/dist/src/store/actions/newSwap.js +34 -0
- package/dist/src/store/actions/newSwap.js.map +1 -0
- package/dist/src/store/actions/performNextAction/index.d.ts +7 -0
- package/dist/src/store/actions/performNextAction/index.js +65 -0
- package/dist/src/store/actions/performNextAction/index.js.map +1 -0
- package/dist/src/store/actions/performNextAction/send.d.ts +7 -0
- package/dist/src/store/actions/performNextAction/send.js +54 -0
- package/dist/src/store/actions/performNextAction/send.js.map +1 -0
- package/dist/src/store/actions/performNextAction/sendNFT.d.ts +7 -0
- package/dist/src/store/actions/performNextAction/sendNFT.js +50 -0
- package/dist/src/store/actions/performNextAction/sendNFT.js.map +1 -0
- package/dist/src/store/actions/performNextAction/utils.d.ts +11 -0
- package/dist/src/store/actions/performNextAction/utils.js +42 -0
- package/dist/src/store/actions/performNextAction/utils.js.map +1 -0
- package/dist/src/store/actions/proxyMutation.d.ts +5 -0
- package/dist/src/store/actions/proxyMutation.js +9 -0
- package/dist/src/store/actions/proxyMutation.js.map +1 -0
- package/dist/src/store/actions/removeCustomToken.d.ts +7 -0
- package/dist/src/store/actions/removeCustomToken.js +11 -0
- package/dist/src/store/actions/removeCustomToken.js.map +1 -0
- package/dist/src/store/actions/retrySwap.d.ts +5 -0
- package/dist/src/store/actions/retrySwap.js +23 -0
- package/dist/src/store/actions/retrySwap.js.map +1 -0
- package/dist/src/store/actions/sendNFTTransaction.d.ts +4 -0
- package/dist/src/store/actions/sendNFTTransaction.js +47 -0
- package/dist/src/store/actions/sendNFTTransaction.js.map +1 -0
- package/dist/src/store/actions/sendTransaction.d.ts +17 -0
- package/dist/src/store/actions/sendTransaction.js +51 -0
- package/dist/src/store/actions/sendTransaction.js.map +1 -0
- package/dist/src/store/actions/sendTransaction.test.d.ts +1 -0
- package/dist/src/store/actions/sendTransaction.test.js +80 -0
- package/dist/src/store/actions/sendTransaction.test.js.map +1 -0
- package/dist/src/store/actions/setEthereumInjectionChain.d.ts +5 -0
- package/dist/src/store/actions/setEthereumInjectionChain.js +11 -0
- package/dist/src/store/actions/setEthereumInjectionChain.js.map +1 -0
- package/dist/src/store/actions/setEthereumInjectionChain.test.d.ts +1 -0
- package/dist/src/store/actions/setEthereumInjectionChain.test.js +20 -0
- package/dist/src/store/actions/setEthereumInjectionChain.test.js.map +1 -0
- package/dist/src/store/actions/setWhatsNewModalVersion.d.ts +4 -0
- package/dist/src/store/actions/setWhatsNewModalVersion.js +10 -0
- package/dist/src/store/actions/setWhatsNewModalVersion.js.map +1 -0
- package/dist/src/store/actions/setWhatsNewModalVersion.test.d.ts +1 -0
- package/dist/src/store/actions/setWhatsNewModalVersion.test.js +24 -0
- package/dist/src/store/actions/setWhatsNewModalVersion.test.js.map +1 -0
- package/dist/src/store/actions/showNotification.d.ts +2 -0
- package/dist/src/store/actions/showNotification.js +10 -0
- package/dist/src/store/actions/showNotification.js.map +1 -0
- package/dist/src/store/actions/toggleExperiment.d.ts +5 -0
- package/dist/src/store/actions/toggleExperiment.js +10 -0
- package/dist/src/store/actions/toggleExperiment.js.map +1 -0
- package/dist/src/store/actions/toggleExperiment.test.d.ts +1 -0
- package/dist/src/store/actions/toggleExperiment.test.js +34 -0
- package/dist/src/store/actions/toggleExperiment.test.js.map +1 -0
- package/dist/src/store/actions/toggleNFTStarred.d.ts +8 -0
- package/dist/src/store/actions/toggleNFTStarred.js +10 -0
- package/dist/src/store/actions/toggleNFTStarred.js.map +1 -0
- package/dist/src/store/actions/unlockWallet.d.ts +4 -0
- package/dist/src/store/actions/unlockWallet.js +22 -0
- package/dist/src/store/actions/unlockWallet.js.map +1 -0
- package/dist/src/store/actions/updateAccountBalance.d.ts +7 -0
- package/dist/src/store/actions/updateAccountBalance.js +29 -0
- package/dist/src/store/actions/updateAccountBalance.js.map +1 -0
- package/dist/src/store/actions/updateBalances.d.ts +9 -0
- package/dist/src/store/actions/updateBalances.js +169 -0
- package/dist/src/store/actions/updateBalances.js.map +1 -0
- package/dist/src/store/actions/updateBalances.test.d.ts +1 -0
- package/dist/src/store/actions/updateBalances.test.js +43 -0
- package/dist/src/store/actions/updateBalances.test.js.map +1 -0
- package/dist/src/store/actions/updateCurrenciesInfo.d.ts +5 -0
- package/dist/src/store/actions/updateCurrenciesInfo.js +14 -0
- package/dist/src/store/actions/updateCurrenciesInfo.js.map +1 -0
- package/dist/src/store/actions/updateFees.d.ts +6 -0
- package/dist/src/store/actions/updateFees.js +16 -0
- package/dist/src/store/actions/updateFees.js.map +1 -0
- package/dist/src/store/actions/updateFees.test.d.ts +1 -0
- package/dist/src/store/actions/updateFees.test.js +86 -0
- package/dist/src/store/actions/updateFees.test.js.map +1 -0
- package/dist/src/store/actions/updateFiatRates.d.ts +5 -0
- package/dist/src/store/actions/updateFiatRates.js +15 -0
- package/dist/src/store/actions/updateFiatRates.js.map +1 -0
- package/dist/src/store/actions/updateFiatRates.test.d.ts +1 -0
- package/dist/src/store/actions/updateFiatRates.test.js +43 -0
- package/dist/src/store/actions/updateFiatRates.test.js.map +1 -0
- package/dist/src/store/actions/updateMarketData.d.ts +8 -0
- package/dist/src/store/actions/updateMarketData.js +28 -0
- package/dist/src/store/actions/updateMarketData.js.map +1 -0
- package/dist/src/store/actions/updateMarketData.test.d.ts +1 -0
- package/dist/src/store/actions/updateMarketData.test.js +49 -0
- package/dist/src/store/actions/updateMarketData.test.js.map +1 -0
- package/dist/src/store/actions/updateNFTs.d.ts +7 -0
- package/dist/src/store/actions/updateNFTs.js +39 -0
- package/dist/src/store/actions/updateNFTs.js.map +1 -0
- package/dist/src/store/actions/updateNFTs.test.d.ts +1 -0
- package/dist/src/store/actions/updateNFTs.test.js +32 -0
- package/dist/src/store/actions/updateNFTs.test.js.map +1 -0
- package/dist/src/store/actions/updateTransactionFee.d.ts +11 -0
- package/dist/src/store/actions/updateTransactionFee.js +81 -0
- package/dist/src/store/actions/updateTransactionFee.js.map +1 -0
- package/dist/src/store/broker/notification.d.ts +4 -0
- package/dist/src/store/broker/notification.js +84 -0
- package/dist/src/store/broker/notification.js.map +1 -0
- package/dist/src/store/getters.d.ts +59 -0
- package/dist/src/store/getters.js +350 -0
- package/dist/src/store/getters.js.map +1 -0
- package/dist/src/store/index.d.ts +3524 -0
- package/dist/src/store/index.js +24 -0
- package/dist/src/store/index.js.map +1 -0
- package/dist/src/store/migrations/10_analytics_settings.d.ts +4 -0
- package/dist/src/store/migrations/10_analytics_settings.js +19 -0
- package/dist/src/store/migrations/10_analytics_settings.js.map +1 -0
- package/dist/src/store/migrations/11_12_rsk_legacy_derivation_path.d.ts +8 -0
- package/dist/src/store/migrations/11_12_rsk_legacy_derivation_path.js +22 -0
- package/dist/src/store/migrations/11_12_rsk_legacy_derivation_path.js.map +1 -0
- package/dist/src/store/migrations/13_rsk_fish_token.d.ts +4 -0
- package/dist/src/store/migrations/13_rsk_fish_token.js +19 -0
- package/dist/src/store/migrations/13_rsk_fish_token.js.map +1 -0
- package/dist/src/store/migrations/14_account_set_derivation_path.d.ts +4 -0
- package/dist/src/store/migrations/14_account_set_derivation_path.js +56 -0
- package/dist/src/store/migrations/14_account_set_derivation_path.js.map +1 -0
- package/dist/src/store/migrations/15_accounts_chains_set_enabled.d.ts +4 -0
- package/dist/src/store/migrations/15_accounts_chains_set_enabled.js +25 -0
- package/dist/src/store/migrations/15_accounts_chains_set_enabled.js.map +1 -0
- package/dist/src/store/migrations/16_enable_terra_chain.d.ts +4 -0
- package/dist/src/store/migrations/16_enable_terra_chain.js +10 -0
- package/dist/src/store/migrations/16_enable_terra_chain.js.map +1 -0
- package/dist/src/store/migrations/17_remove_injection_enabled.d.ts +4 -0
- package/dist/src/store/migrations/17_remove_injection_enabled.js +12 -0
- package/dist/src/store/migrations/17_remove_injection_enabled.js.map +1 -0
- package/dist/src/store/migrations/18_enable_avalanche_chain.d.ts +4 -0
- package/dist/src/store/migrations/18_enable_avalanche_chain.js +10 -0
- package/dist/src/store/migrations/18_enable_avalanche_chain.js.map +1 -0
- package/dist/src/store/migrations/19_remove_existing_ledger_accounts.d.ts +4 -0
- package/dist/src/store/migrations/19_remove_existing_ledger_accounts.js +25 -0
- package/dist/src/store/migrations/19_remove_existing_ledger_accounts.js.map +1 -0
- package/dist/src/store/migrations/19_remove_existing_ledger_accounts.state.pre.json +1944 -0
- package/dist/src/store/migrations/19_remove_existing_ledger_accounts_test.d.ts +1 -0
- package/dist/src/store/migrations/19_remove_existing_ledger_accounts_test.js +7 -0
- package/dist/src/store/migrations/19_remove_existing_ledger_accounts_test.js.map +1 -0
- package/dist/src/store/migrations/1_first_migration.d.ts +4 -0
- package/dist/src/store/migrations/1_first_migration.js +11 -0
- package/dist/src/store/migrations/1_first_migration.js.map +1 -0
- package/dist/src/store/migrations/20_fix_accounts.d.ts +4 -0
- package/dist/src/store/migrations/20_fix_accounts.js +68 -0
- package/dist/src/store/migrations/20_fix_accounts.js.map +1 -0
- package/dist/src/store/migrations/21_enable_solana_chain.d.ts +4 -0
- package/dist/src/store/migrations/21_enable_solana_chain.js +10 -0
- package/dist/src/store/migrations/21_enable_solana_chain.js.map +1 -0
- package/dist/src/store/migrations/22_enable_optimism_chain.d.ts +4 -0
- package/dist/src/store/migrations/22_enable_optimism_chain.js +10 -0
- package/dist/src/store/migrations/22_enable_optimism_chain.js.map +1 -0
- package/dist/src/store/migrations/2_set_default_assets.d.ts +4 -0
- package/dist/src/store/migrations/2_set_default_assets.js +20 -0
- package/dist/src/store/migrations/2_set_default_assets.js.map +1 -0
- package/dist/src/store/migrations/3_add_network_custom_tokens.d.ts +4 -0
- package/dist/src/store/migrations/3_add_network_custom_tokens.js +21 -0
- package/dist/src/store/migrations/3_add_network_custom_tokens.js.map +1 -0
- package/dist/src/store/migrations/4_fix_rsk_token_injected_asset.d.ts +4 -0
- package/dist/src/store/migrations/4_fix_rsk_token_injected_asset.js +15 -0
- package/dist/src/store/migrations/4_fix_rsk_token_injected_asset.js.map +1 -0
- package/dist/src/store/migrations/5_multiple_account_support.d.ts +4 -0
- package/dist/src/store/migrations/5_multiple_account_support.js +96 -0
- package/dist/src/store/migrations/5_multiple_account_support.js.map +1 -0
- package/dist/src/store/migrations/6_use_ledger_live_default.d.ts +4 -0
- package/dist/src/store/migrations/6_use_ledger_live_default.js +11 -0
- package/dist/src/store/migrations/6_use_ledger_live_default.js.map +1 -0
- package/dist/src/store/migrations/7_multi_provider_swaps.d.ts +4 -0
- package/dist/src/store/migrations/7_multi_provider_swaps.js +27 -0
- package/dist/src/store/migrations/7_multi_provider_swaps.js.map +1 -0
- package/dist/src/store/migrations/8_remove_use_ledger_live.d.ts +4 -0
- package/dist/src/store/migrations/8_remove_use_ledger_live.js +12 -0
- package/dist/src/store/migrations/8_remove_use_ledger_live.js.map +1 -0
- package/dist/src/store/migrations/9_inject_ethereum_asset_chain.d.ts +4 -0
- package/dist/src/store/migrations/9_inject_ethereum_asset_chain.js +14 -0
- package/dist/src/store/migrations/9_inject_ethereum_asset_chain.js.map +1 -0
- package/dist/src/store/migrations/before_after_migration_script.test.d.ts +1 -0
- package/dist/src/store/migrations/before_after_migration_script.test.js +92 -0
- package/dist/src/store/migrations/before_after_migration_script.test.js.map +1 -0
- package/dist/src/store/migrations/enable_chain.d.ts +3 -0
- package/dist/src/store/migrations/enable_chain.js +71 -0
- package/dist/src/store/migrations/enable_chain.js.map +1 -0
- package/dist/src/store/migrations/index.d.ts +5 -0
- package/dist/src/store/migrations/index.js +78 -0
- package/dist/src/store/migrations/index.js.map +1 -0
- package/dist/src/store/migrations/migration_script.test.d.ts +1 -0
- package/dist/src/store/migrations/migration_script.test.js +59 -0
- package/dist/src/store/migrations/migration_script.test.js.map +1 -0
- package/dist/src/store/mutations.d.ts +209 -0
- package/dist/src/store/mutations.js +348 -0
- package/dist/src/store/mutations.js.map +1 -0
- package/dist/src/store/state.d.ts +3 -0
- package/dist/src/store/state.js +46 -0
- package/dist/src/store/state.js.map +1 -0
- package/dist/src/store/types.d.ts +249 -0
- package/dist/src/store/types.js +64 -0
- package/dist/src/store/types.js.map +1 -0
- package/dist/src/store/utils.d.ts +38 -0
- package/dist/src/store/utils.js +194 -0
- package/dist/src/store/utils.js.map +1 -0
- package/dist/src/swaps/EvmSwapProvider.d.ts +32 -0
- package/dist/src/swaps/EvmSwapProvider.js +118 -0
- package/dist/src/swaps/EvmSwapProvider.js.map +1 -0
- package/dist/src/swaps/SwapProvider.d.ts +35 -0
- package/dist/src/swaps/SwapProvider.js +89 -0
- package/dist/src/swaps/SwapProvider.js.map +1 -0
- package/dist/src/swaps/astroport/AstroportSwapProvider.d.ts +67 -0
- package/dist/src/swaps/astroport/AstroportSwapProvider.js +251 -0
- package/dist/src/swaps/astroport/AstroportSwapProvider.js.map +1 -0
- package/dist/src/swaps/astroport/info.json +7 -0
- package/dist/src/swaps/astroport/queries.d.ts +108 -0
- package/dist/src/swaps/astroport/queries.js +227 -0
- package/dist/src/swaps/astroport/queries.js.map +1 -0
- package/dist/src/swaps/debridge/DeBridgeSwapProvider.d.ts +98 -0
- package/dist/src/swaps/debridge/DeBridgeSwapProvider.js +553 -0
- package/dist/src/swaps/debridge/DeBridgeSwapProvider.js.map +1 -0
- package/dist/src/swaps/debridge/abi/DeBridgeGate.json +1958 -0
- package/dist/src/swaps/debridge/abi/SignatureVerifier.json +925 -0
- package/dist/src/swaps/debridge/info.json +13 -0
- package/dist/src/swaps/fastbtc/FastBTCDepositSwapProvider.d.ts +103 -0
- package/dist/src/swaps/fastbtc/FastBTCDepositSwapProvider.js +292 -0
- package/dist/src/swaps/fastbtc/FastBTCDepositSwapProvider.js.map +1 -0
- package/dist/src/swaps/fastbtc/FastBTCWithdrawSwapProvider.d.ts +108 -0
- package/dist/src/swaps/fastbtc/FastBTCWithdrawSwapProvider.js +306 -0
- package/dist/src/swaps/fastbtc/FastBTCWithdrawSwapProvider.js.map +1 -0
- package/dist/src/swaps/fastbtc/fastBtcBridgeContract.d.ts +19 -0
- package/dist/src/swaps/fastbtc/fastBtcBridgeContract.js +24 -0
- package/dist/src/swaps/fastbtc/fastBtcBridgeContract.js.map +1 -0
- package/dist/src/swaps/fastbtc/info.json +7 -0
- package/dist/src/swaps/hop/HopSwapProvider.d.ts +124 -0
- package/dist/src/swaps/hop/HopSwapProvider.js +479 -0
- package/dist/src/swaps/hop/HopSwapProvider.js.map +1 -0
- package/dist/src/swaps/hop/info.json +12 -0
- package/dist/src/swaps/hop/queries.d.ts +2 -0
- package/dist/src/swaps/hop/queries.js +61 -0
- package/dist/src/swaps/hop/queries.js.map +1 -0
- package/dist/src/swaps/jupiter/JupiterSwapProvider.d.ts +46 -0
- package/dist/src/swaps/jupiter/JupiterSwapProvider.js +189 -0
- package/dist/src/swaps/jupiter/JupiterSwapProvider.js.map +1 -0
- package/dist/src/swaps/jupiter/info.json +7 -0
- package/dist/src/swaps/lifi/LifiSwapProvider.d.ts +76 -0
- package/dist/src/swaps/lifi/LifiSwapProvider.js +313 -0
- package/dist/src/swaps/lifi/LifiSwapProvider.js.map +1 -0
- package/dist/src/swaps/lifi/info.json +7 -0
- package/dist/src/swaps/liquality/LiqualitySwapProvider.d.ts +104 -0
- package/dist/src/swaps/liquality/LiqualitySwapProvider.js +704 -0
- package/dist/src/swaps/liquality/LiqualitySwapProvider.js.map +1 -0
- package/dist/src/swaps/liquality/info.json +7 -0
- package/dist/src/swaps/liqualityboost/liqualityBoostERC20toNative/LiqualityBoostERC20toNative.d.ts +124 -0
- package/dist/src/swaps/liqualityboost/liqualityBoostERC20toNative/LiqualityBoostERC20toNative.js +239 -0
- package/dist/src/swaps/liqualityboost/liqualityBoostERC20toNative/LiqualityBoostERC20toNative.js.map +1 -0
- package/dist/src/swaps/liqualityboost/liqualityBoostERC20toNative/info.json +7 -0
- package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/LiqualityBoostNativeToERC20.d.ts +52 -0
- package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/LiqualityBoostNativeToERC20.js +213 -0
- package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/LiqualityBoostNativeToERC20.js.map +1 -0
- package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/info.json +7 -0
- package/dist/src/swaps/liqualityboost/types.d.ts +17 -0
- package/dist/src/swaps/liqualityboost/types.js +3 -0
- package/dist/src/swaps/liqualityboost/types.js.map +1 -0
- package/dist/src/swaps/oneinch/OneinchSwapProvider.d.ts +86 -0
- package/dist/src/swaps/oneinch/OneinchSwapProvider.js +369 -0
- package/dist/src/swaps/oneinch/OneinchSwapProvider.js.map +1 -0
- package/dist/src/swaps/oneinch/info.json +13 -0
- package/dist/src/swaps/sovryn/SovrynSwapProvider.d.ts +110 -0
- package/dist/src/swaps/sovryn/SovrynSwapProvider.js +369 -0
- package/dist/src/swaps/sovryn/SovrynSwapProvider.js.map +1 -0
- package/dist/src/swaps/sovryn/info.json +7 -0
- package/dist/src/swaps/teleswap/TeleSwapSwapProvider.d.ts +167 -0
- package/dist/src/swaps/teleswap/TeleSwapSwapProvider.js +874 -0
- package/dist/src/swaps/teleswap/TeleSwapSwapProvider.js.map +1 -0
- package/dist/src/swaps/teleswap/info.json +7 -0
- package/dist/src/swaps/thorchain/ThorchainSwapProvider.d.ts +194 -0
- package/dist/src/swaps/thorchain/ThorchainSwapProvider.js +534 -0
- package/dist/src/swaps/thorchain/ThorchainSwapProvider.js.map +1 -0
- package/dist/src/swaps/thorchain/info.json +7 -0
- package/dist/src/swaps/types.d.ts +87 -0
- package/dist/src/swaps/types.js +9 -0
- package/dist/src/swaps/types.js.map +1 -0
- package/dist/src/swaps/uniswap/UniswapSwapProvider.d.ts +117 -0
- package/dist/src/swaps/uniswap/UniswapSwapProvider.js +438 -0
- package/dist/src/swaps/uniswap/UniswapSwapProvider.js.map +1 -0
- package/dist/src/swaps/uniswap/info.json +7 -0
- package/dist/src/swaps/utils.d.ts +92 -0
- package/dist/src/swaps/utils.js +57 -0
- package/dist/src/swaps/utils.js.map +1 -0
- package/dist/src/tsconfig.json +30 -0
- package/dist/src/types.d.ts +29 -0
- package/dist/src/types.js +3 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/accounts.d.ts +16 -0
- package/dist/src/utils/accounts.js +89 -0
- package/dist/src/utils/accounts.js.map +1 -0
- package/dist/src/utils/address.d.ts +8 -0
- package/dist/src/utils/address.js +17 -0
- package/dist/src/utils/address.js.map +1 -0
- package/dist/src/utils/address.test.d.ts +1 -0
- package/dist/src/utils/address.test.js +12 -0
- package/dist/src/utils/address.test.js.map +1 -0
- package/dist/src/utils/asset.d.ts +22 -0
- package/dist/src/utils/asset.js +198 -0
- package/dist/src/utils/asset.js.map +1 -0
- package/dist/src/utils/asset.test.d.ts +1 -0
- package/dist/src/utils/asset.test.js +42 -0
- package/dist/src/utils/asset.test.js.map +1 -0
- package/dist/src/utils/chainify.d.ts +3 -0
- package/dist/src/utils/chainify.js +41 -0
- package/dist/src/utils/chainify.js.map +1 -0
- package/dist/src/utils/coinFormatter.d.ts +13 -0
- package/dist/src/utils/coinFormatter.js +58 -0
- package/dist/src/utils/coinFormatter.js.map +1 -0
- package/dist/src/utils/crypto.d.ts +6 -0
- package/dist/src/utils/crypto.js +70 -0
- package/dist/src/utils/crypto.js.map +1 -0
- package/dist/src/utils/cryptoassets.d.ts +5 -0
- package/dist/src/utils/cryptoassets.js +26 -0
- package/dist/src/utils/cryptoassets.js.map +1 -0
- package/dist/src/utils/derivationPath.d.ts +6 -0
- package/dist/src/utils/derivationPath.js +75 -0
- package/dist/src/utils/derivationPath.js.map +1 -0
- package/dist/src/utils/derivationPath.spec.d.ts +1 -0
- package/dist/src/utils/derivationPath.spec.js +37 -0
- package/dist/src/utils/derivationPath.spec.js.map +1 -0
- package/dist/src/utils/export.d.ts +5 -0
- package/dist/src/utils/export.js +24 -0
- package/dist/src/utils/export.js.map +1 -0
- package/dist/src/utils/fees.d.ts +43 -0
- package/dist/src/utils/fees.js +222 -0
- package/dist/src/utils/fees.js.map +1 -0
- package/dist/src/utils/fees.test.d.ts +1 -0
- package/dist/src/utils/fees.test.js +40 -0
- package/dist/src/utils/fees.test.js.map +1 -0
- package/dist/src/utils/fetchTokenDetails.d.ts +1 -0
- package/dist/src/utils/fetchTokenDetails.js +19 -0
- package/dist/src/utils/fetchTokenDetails.js.map +1 -0
- package/dist/src/utils/history.d.ts +66 -0
- package/dist/src/utils/history.js +135 -0
- package/dist/src/utils/history.js.map +1 -0
- package/dist/src/utils/isTransactionNotFoundError.d.ts +1 -0
- package/dist/src/utils/isTransactionNotFoundError.js +16 -0
- package/dist/src/utils/isTransactionNotFoundError.js.map +1 -0
- package/dist/src/utils/ledger.d.ts +12 -0
- package/dist/src/utils/ledger.js +38 -0
- package/dist/src/utils/ledger.js.map +1 -0
- package/dist/src/utils/moment.d.ts +2 -0
- package/dist/src/utils/moment.js +8 -0
- package/dist/src/utils/moment.js.map +1 -0
- package/dist/src/utils/networks.d.ts +10 -0
- package/dist/src/utils/networks.js +43 -0
- package/dist/src/utils/networks.js.map +1 -0
- package/dist/src/utils/parseTokenTx.d.ts +2 -0
- package/dist/src/utils/parseTokenTx.js +10 -0
- package/dist/src/utils/parseTokenTx.js.map +1 -0
- package/dist/src/utils/quotes.d.ts +5 -0
- package/dist/src/utils/quotes.js +20 -0
- package/dist/src/utils/quotes.js.map +1 -0
- package/dist/src/utils/quotes.test.d.ts +1 -0
- package/dist/src/utils/quotes.test.js +85 -0
- package/dist/src/utils/quotes.test.js.map +1 -0
- package/dist/src/utils/timeline.d.ts +71 -0
- package/dist/src/utils/timeline.js +176 -0
- package/dist/src/utils/timeline.js.map +1 -0
- package/dist/src/walletOptions/defaultOptions.d.ts +3 -0
- package/dist/src/walletOptions/defaultOptions.js +36 -0
- package/dist/src/walletOptions/defaultOptions.js.map +1 -0
- package/dist/src/walletOptions/index.d.ts +7 -0
- package/dist/src/walletOptions/index.js +11 -0
- package/dist/src/walletOptions/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enableChain = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cryptoassets_1 = require("@yaswap/cryptoassets");
|
|
6
|
+
const accounts_1 = require("../../utils/accounts");
|
|
7
|
+
const derivationPath_1 = require("../../utils/derivationPath");
|
|
8
|
+
const networks_1 = require("../../utils/networks");
|
|
9
|
+
const types_1 = require("../types");
|
|
10
|
+
function enableChain(state, chainId) {
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const accounts = {};
|
|
13
|
+
const enabledChains = {};
|
|
14
|
+
for (const walletId in state.accounts) {
|
|
15
|
+
accounts[walletId] = {};
|
|
16
|
+
enabledChains[walletId] = {};
|
|
17
|
+
for (const network of networks_1.Networks) {
|
|
18
|
+
const accountExists = state.accounts[walletId][network].find((account) => account.chain === chainId);
|
|
19
|
+
if (accountExists) {
|
|
20
|
+
accounts[walletId][network] = [...state.accounts[walletId][network]];
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const chain = (0, cryptoassets_1.getChain)(network, chainId);
|
|
24
|
+
const derivationPath = (0, derivationPath_1.getDerivationPath)(chainId, network, 0, types_1.AccountType.Default);
|
|
25
|
+
const account = (0, accounts_1.accountCreator)({
|
|
26
|
+
walletId,
|
|
27
|
+
network,
|
|
28
|
+
account: {
|
|
29
|
+
name: `${chain.name} 1`,
|
|
30
|
+
alias: '',
|
|
31
|
+
chain: chainId,
|
|
32
|
+
addresses: [],
|
|
33
|
+
assets: chain.nativeAsset.map((nativeAsset) => nativeAsset.code),
|
|
34
|
+
balances: {},
|
|
35
|
+
type: types_1.AccountType.Default,
|
|
36
|
+
index: 0,
|
|
37
|
+
derivationPath,
|
|
38
|
+
color: (0, accounts_1.getNextAccountColor)(chainId, 0),
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
accounts[walletId][network] = [...state.accounts[walletId][network], account];
|
|
42
|
+
}
|
|
43
|
+
const chainEnabled = state.enabledChains[walletId][network].includes(chainId);
|
|
44
|
+
if (chainEnabled) {
|
|
45
|
+
enabledChains[walletId][network] = [...state.enabledChains[walletId][network]];
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
enabledChains[walletId][network] = [...state.enabledChains[walletId][network], chainId];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const enabledAssets = {};
|
|
53
|
+
for (const network of networks_1.Networks) {
|
|
54
|
+
enabledAssets[network] = {};
|
|
55
|
+
for (const walletId in state.enabledAssets[network]) {
|
|
56
|
+
enabledAssets[network][walletId] = [...state.enabledAssets[network][walletId]];
|
|
57
|
+
const chain = (0, cryptoassets_1.getChain)(network, chainId);
|
|
58
|
+
const nativeAssetsCodes = chain.nativeAsset.map((nativeAsset) => nativeAsset.code);
|
|
59
|
+
for (const nativeAssetCode of nativeAssetsCodes) {
|
|
60
|
+
if (!enabledAssets[network][walletId].includes(nativeAssetCode))
|
|
61
|
+
enabledAssets[network][walletId].push(nativeAssetCode);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return Object.assign(Object.assign({}, state), { enabledChains,
|
|
66
|
+
enabledAssets,
|
|
67
|
+
accounts });
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
exports.enableChain = enableChain;
|
|
71
|
+
//# sourceMappingURL=enable_chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable_chain.js","sourceRoot":"","sources":["../../../../src/store/migrations/enable_chain.ts"],"names":[],"mappings":";;;;AAAA,uDAAyD;AACzD,mDAA2E;AAC3E,+DAA+D;AAC/D,mDAAgD;AAChD,oCAAuC;AAEvC,SAAe,WAAW,CAAC,KAAU,EAAE,OAAgB;;QACrD,MAAM,QAAQ,GAAQ,EAAE,CAAC;QACzB,MAAM,aAAa,GAAQ,EAAE,CAAC;QAE9B,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,QAAQ,EAAE;YACrC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YACxB,aAAa,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YAE7B,KAAK,MAAM,OAAO,IAAI,mBAAQ,EAAE;gBAC9B,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC;gBAE1G,IAAI,aAAa,EAAE;oBACjB,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;iBACtE;qBAAM;oBACL,MAAM,KAAK,GAAG,IAAA,uBAAQ,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;oBACzC,MAAM,cAAc,GAAG,IAAA,kCAAiB,EAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,mBAAW,CAAC,OAAO,CAAC,CAAC;oBACnF,MAAM,OAAO,GAAG,IAAA,yBAAc,EAAC;wBAC7B,QAAQ;wBACR,OAAO;wBACP,OAAO,EAAE;4BACP,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI;4BACvB,KAAK,EAAE,EAAE;4BACT,KAAK,EAAE,OAAO;4BACd,SAAS,EAAE,EAAE;4BACb,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;4BAChE,QAAQ,EAAE,EAAE;4BACZ,IAAI,EAAE,mBAAW,CAAC,OAAO;4BACzB,KAAK,EAAE,CAAC;4BACR,cAAc;4BACd,KAAK,EAAE,IAAA,8BAAmB,EAAC,OAAO,EAAE,CAAC,CAAC;yBACvC;qBACF,CAAC,CAAC;oBACH,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;iBAC/E;gBAED,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBAC9E,IAAI,YAAY,EAAE;oBAChB,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;iBAChF;qBAAM;oBACL,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;iBACzF;aACF;SACF;QAED,MAAM,aAAa,GAAQ,EAAE,CAAC;QAC9B,KAAK,MAAM,OAAO,IAAI,mBAAQ,EAAE;YAC9B,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YAC5B,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;gBACnD,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAE/E,MAAM,KAAK,GAAG,IAAA,uBAAQ,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACzC,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBACnF,KAAK,MAAM,eAAe,IAAI,iBAAiB,EAAE;oBAC/C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;wBAC7D,aAAa,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;iBAC1D;aACF;SACF;QAED,uCACK,KAAK,KACR,aAAa;YACb,aAAa;YACb,QAAQ,IACR;IACJ,CAAC;CAAA;AAEQ,kCAAW"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RootState } from '../types';
|
|
2
|
+
declare const LATEST_VERSION: number;
|
|
3
|
+
declare function isMigrationNeeded(state: RootState): boolean;
|
|
4
|
+
declare function processMigrations(state: RootState): Promise<RootState>;
|
|
5
|
+
export { LATEST_VERSION, isMigrationNeeded, processMigrations };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processMigrations = exports.isMigrationNeeded = exports.LATEST_VERSION = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const _10_analytics_settings_1 = require("./10_analytics_settings");
|
|
7
|
+
const _11_12_rsk_legacy_derivation_path_1 = require("./11_12_rsk_legacy_derivation_path");
|
|
8
|
+
const _13_rsk_fish_token_1 = require("./13_rsk_fish_token");
|
|
9
|
+
const _14_account_set_derivation_path_1 = require("./14_account_set_derivation_path");
|
|
10
|
+
const _15_accounts_chains_set_enabled_1 = require("./15_accounts_chains_set_enabled");
|
|
11
|
+
const _16_enable_terra_chain_1 = require("./16_enable_terra_chain");
|
|
12
|
+
const _17_remove_injection_enabled_1 = require("./17_remove_injection_enabled");
|
|
13
|
+
const _18_enable_avalanche_chain_1 = require("./18_enable_avalanche_chain");
|
|
14
|
+
const _19_remove_existing_ledger_accounts_1 = require("./19_remove_existing_ledger_accounts");
|
|
15
|
+
const _20_fix_accounts_1 = require("./20_fix_accounts");
|
|
16
|
+
const _21_enable_solana_chain_1 = require("./21_enable_solana_chain");
|
|
17
|
+
const _22_enable_optimism_chain_1 = require("./22_enable_optimism_chain");
|
|
18
|
+
const _1_first_migration_1 = require("./1_first_migration");
|
|
19
|
+
const _2_set_default_assets_1 = require("./2_set_default_assets");
|
|
20
|
+
const _3_add_network_custom_tokens_1 = require("./3_add_network_custom_tokens");
|
|
21
|
+
const _4_fix_rsk_token_injected_asset_1 = require("./4_fix_rsk_token_injected_asset");
|
|
22
|
+
const _5_multiple_account_support_1 = require("./5_multiple_account_support");
|
|
23
|
+
const _6_use_ledger_live_default_1 = require("./6_use_ledger_live_default");
|
|
24
|
+
const _7_multi_provider_swaps_1 = require("./7_multi_provider_swaps");
|
|
25
|
+
const _8_remove_use_ledger_live_1 = require("./8_remove_use_ledger_live");
|
|
26
|
+
const _9_inject_ethereum_asset_chain_1 = require("./9_inject_ethereum_asset_chain");
|
|
27
|
+
const migrations = [
|
|
28
|
+
_1_first_migration_1.firstMigration,
|
|
29
|
+
_2_set_default_assets_1.setDefaultAssets,
|
|
30
|
+
_3_add_network_custom_tokens_1.addNetworkCustomTokens,
|
|
31
|
+
_4_fix_rsk_token_injected_asset_1.fixRSKTokenInjectedAsset,
|
|
32
|
+
_5_multiple_account_support_1.multipleAccountSupport,
|
|
33
|
+
_6_use_ledger_live_default_1.useLedgerLiveDefault,
|
|
34
|
+
_7_multi_provider_swaps_1.multiProviderSwaps,
|
|
35
|
+
_8_remove_use_ledger_live_1.removeUseLedgerLive,
|
|
36
|
+
_9_inject_ethereum_asset_chain_1.injectEthereumAssetChain,
|
|
37
|
+
_10_analytics_settings_1.analitycsSettings,
|
|
38
|
+
_11_12_rsk_legacy_derivation_path_1.rskLegacyDerivationPath,
|
|
39
|
+
_11_12_rsk_legacy_derivation_path_1.rskLegacyDerivationPathFix,
|
|
40
|
+
_13_rsk_fish_token_1.rskFishToken,
|
|
41
|
+
_14_account_set_derivation_path_1.accountSetDerivationPath,
|
|
42
|
+
_15_accounts_chains_set_enabled_1.accountsChainsSetEnabled,
|
|
43
|
+
_16_enable_terra_chain_1.enableTerraChain,
|
|
44
|
+
_17_remove_injection_enabled_1.removeInjectionEnabled,
|
|
45
|
+
_18_enable_avalanche_chain_1.enableAvalancheChain,
|
|
46
|
+
_19_remove_existing_ledger_accounts_1.removeExistingLedgerAccounts,
|
|
47
|
+
_20_fix_accounts_1.addMissingAccounts,
|
|
48
|
+
_21_enable_solana_chain_1.enableSolanaChain,
|
|
49
|
+
_22_enable_optimism_chain_1.enableOptimismChain,
|
|
50
|
+
];
|
|
51
|
+
const LATEST_VERSION = migrations[migrations.length - 1].version;
|
|
52
|
+
exports.LATEST_VERSION = LATEST_VERSION;
|
|
53
|
+
function isMigrationNeeded(state) {
|
|
54
|
+
const currentVersion = state.version || 0;
|
|
55
|
+
return currentVersion < LATEST_VERSION;
|
|
56
|
+
}
|
|
57
|
+
exports.isMigrationNeeded = isMigrationNeeded;
|
|
58
|
+
function processMigrations(state) {
|
|
59
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const currentVersion = state.version || 0;
|
|
61
|
+
let newState = (0, lodash_1.cloneDeep)(state);
|
|
62
|
+
for (const migration of migrations) {
|
|
63
|
+
if (currentVersion < migration.version) {
|
|
64
|
+
try {
|
|
65
|
+
newState = yield migration.migrate((0, lodash_1.cloneDeep)(newState));
|
|
66
|
+
newState.version = migration.version;
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
console.error(`Failed to migrate to v${migration.version}`, e);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return newState;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
exports.processMigrations = processMigrations;
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/store/migrations/index.ts"],"names":[],"mappings":";;;;AAAA,mCAAmC;AAEnC,oEAA4D;AAC5D,0FAAyG;AACzG,4DAAmD;AACnD,sFAA4E;AAC5E,sFAA4E;AAC5E,oEAA2D;AAC3D,gFAAuE;AACvE,4EAAmE;AACnE,8FAAoF;AACpF,wDAAuD;AACvD,sEAA6D;AAC7D,0EAAiE;AAGjE,4DAAqD;AACrD,kEAA0D;AAC1D,gFAAuE;AACvE,sFAA4E;AAC5E,8EAAsE;AACtE,4EAAmE;AACnE,sEAA8D;AAC9D,0EAAiE;AACjE,oFAA2E;AAE3E,MAAM,UAAU,GAAG;IACjB,mCAAc;IACd,wCAAgB;IAChB,qDAAsB;IACtB,0DAAwB;IACxB,oDAAsB;IACtB,iDAAoB;IACpB,4CAAkB;IAClB,+CAAmB;IACnB,yDAAwB;IACxB,0CAAiB;IACjB,2DAAuB;IACvB,8DAA0B;IAC1B,iCAAY;IACZ,0DAAwB;IACxB,0DAAwB;IACxB,yCAAgB;IAChB,qDAAsB;IACtB,iDAAoB;IACpB,kEAA4B;IAC5B,qCAAkB;IAClB,2CAAiB;IACjB,+CAAmB;CACpB,CAAC;AAEF,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;AAyBxD,wCAAc;AAvBvB,SAAS,iBAAiB,CAAC,KAAgB;IACzC,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC1C,OAAO,cAAc,GAAG,cAAc,CAAC;AACzC,CAAC;AAoBwB,8CAAiB;AAlB1C,SAAe,iBAAiB,CAAC,KAAgB;;QAC/C,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QAE1C,IAAI,QAAQ,GAAG,IAAA,kBAAS,EAAC,KAAK,CAAC,CAAC;QAChC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;YAClC,IAAI,cAAc,GAAG,SAAS,CAAC,OAAO,EAAE;gBACtC,IAAI;oBACF,QAAQ,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,IAAA,kBAAS,EAAC,QAAQ,CAAC,CAAC,CAAC;oBACxD,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;iBACtC;gBAAC,OAAO,CAAC,EAAE;oBACV,OAAO,CAAC,KAAK,CAAC,yBAAyB,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;oBAC/D,MAAM;iBACP;aACF;SACF;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAE2C,8CAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const Process = tslib_1.__importStar(require("process"));
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const defaultOptions_1 = tslib_1.__importDefault(require("../../walletOptions/defaultOptions"));
|
|
7
|
+
const types_1 = require("../types");
|
|
8
|
+
const index_2 = require("./index");
|
|
9
|
+
describe('migrations scripts tests', () => {
|
|
10
|
+
const wallet = (0, index_1.setupWallet)(Object.assign({}, defaultOptions_1.default));
|
|
11
|
+
let TEST_MNEMONIC = Process.env.TEST_MNEMONIC;
|
|
12
|
+
if (!TEST_MNEMONIC) {
|
|
13
|
+
throw new Error('Please set the TEST_MNEMONIC environment variable');
|
|
14
|
+
}
|
|
15
|
+
TEST_MNEMONIC = TEST_MNEMONIC.replace(/,/g, ' ');
|
|
16
|
+
beforeEach(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
yield wallet.dispatch.createWallet({
|
|
18
|
+
key: '0x1234567890123456789012345678901234567890',
|
|
19
|
+
mnemonic: TEST_MNEMONIC,
|
|
20
|
+
imported: true,
|
|
21
|
+
});
|
|
22
|
+
yield wallet.dispatch.unlockWallet({
|
|
23
|
+
key: '0x1234567890123456789012345678901234567890',
|
|
24
|
+
});
|
|
25
|
+
}));
|
|
26
|
+
it('should be able validate accounts-mainnet', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
var _a, _b, _c, _d, _e, _f;
|
|
28
|
+
expect(wallet.state.activeNetwork).toBe('mainnet');
|
|
29
|
+
const walletId = wallet.state.activeWalletId;
|
|
30
|
+
expect(wallet.state.version).toBe(index_2.LATEST_VERSION);
|
|
31
|
+
const accounts = wallet.state.accounts;
|
|
32
|
+
expect(accounts).not.toBeNull();
|
|
33
|
+
expect((0, index_2.isMigrationNeeded)(wallet.state)).toBeFalsy();
|
|
34
|
+
const maninNetAccountsLength = (_b = (_a = wallet.state.accounts) === null || _a === void 0 ? void 0 : _a[walletId]) === null || _b === void 0 ? void 0 : _b.mainnet.length;
|
|
35
|
+
expect(maninNetAccountsLength).toBeGreaterThan(0);
|
|
36
|
+
for (let i = 0; i < maninNetAccountsLength; i++) {
|
|
37
|
+
expect((_d = (_c = wallet.state.accounts) === null || _c === void 0 ? void 0 : _c[walletId]) === null || _d === void 0 ? void 0 : _d.mainnet[i].enabled).toBeTruthy();
|
|
38
|
+
expect((_f = (_e = wallet.state.accounts) === null || _e === void 0 ? void 0 : _e[walletId]) === null || _f === void 0 ? void 0 : _f.mainnet[i].type).toBe('default');
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
it('should be able validate accounts-testnet', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
+
var _g, _h, _j, _k, _l, _m;
|
|
43
|
+
yield wallet.dispatch.changeActiveNetwork({
|
|
44
|
+
network: types_1.Network.Testnet,
|
|
45
|
+
});
|
|
46
|
+
expect(wallet.state.activeNetwork).toBe('testnet');
|
|
47
|
+
const walletId = wallet.state.activeWalletId;
|
|
48
|
+
expect(wallet.state.version).toBe(index_2.LATEST_VERSION);
|
|
49
|
+
const testnetAccountsLength = (_h = (_g = wallet.state.accounts) === null || _g === void 0 ? void 0 : _g[walletId]) === null || _h === void 0 ? void 0 : _h.testnet.length;
|
|
50
|
+
expect(testnetAccountsLength).not.toBeNull();
|
|
51
|
+
expect((0, index_2.isMigrationNeeded)(wallet.state)).toBeFalsy();
|
|
52
|
+
expect(testnetAccountsLength).toBeGreaterThan(0);
|
|
53
|
+
for (let i = 0; i < testnetAccountsLength; i++) {
|
|
54
|
+
expect((_k = (_j = wallet.state.accounts) === null || _j === void 0 ? void 0 : _j[walletId]) === null || _k === void 0 ? void 0 : _k.testnet[i].enabled).toBeTruthy();
|
|
55
|
+
expect((_m = (_l = wallet.state.accounts) === null || _l === void 0 ? void 0 : _l[walletId]) === null || _m === void 0 ? void 0 : _m.testnet[i].type).toBe('default');
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=migration_script.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration_script.test.js","sourceRoot":"","sources":["../../../../src/store/migrations/migration_script.test.ts"],"names":[],"mappings":";;;AAAA,yDAAmC;AACnC,uCAA0C;AAC1C,gGAAsE;AACtE,oCAAmC;AACnC,mCAA4D;AAE5D,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,MAAM,MAAM,GAAG,IAAA,mBAAW,oBAAM,wBAAoB,EAAG,CAAC;IACxD,IAAI,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IAC9C,IAAI,CAAC,aAAa,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;IACD,aAAa,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAEjD,UAAU,CAAC,GAAS,EAAE;QACpB,MAAM,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;YACjC,GAAG,EAAE,4CAA4C;YACjD,QAAQ,EAAE,aAAc;YACxB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;YACjC,GAAG,EAAE,4CAA4C;SAClD,CAAC,CAAC;IACL,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAS,EAAE;;QACxD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC;QAC7C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,sBAAc,CAAC,CAAC;QAElD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;QACvC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAChC,MAAM,CAAC,IAAA,yBAAiB,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;QAEpD,MAAM,sBAAsB,GAAG,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,QAAQ,0CAAG,QAAQ,CAAC,0CAAE,OAAO,CAAC,MAAM,CAAC;QACjF,MAAM,CAAC,sBAAsB,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,sBAAuB,EAAE,CAAC,EAAE,EAAE;YAChD,MAAM,CAAC,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,QAAQ,0CAAG,QAAQ,CAAC,0CAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;YAC3E,MAAM,CAAC,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,QAAQ,0CAAG,QAAQ,CAAC,0CAAE,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC5E;IACH,CAAC,CAAA,CAAC,CAAC;IACH,EAAE,CAAC,0CAA0C,EAAE,GAAS,EAAE;;QAExD,MAAM,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YACxC,OAAO,EAAE,eAAO,CAAC,OAAO;SACzB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC;QAC7C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,sBAAc,CAAC,CAAC;QAClD,MAAM,qBAAqB,GAAG,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,QAAQ,0CAAG,QAAQ,CAAC,0CAAE,OAAO,CAAC,MAAM,CAAC;QAChF,MAAM,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC7C,MAAM,CAAC,IAAA,yBAAiB,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;QACpD,MAAM,CAAC,qBAAqB,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,qBAAsB,EAAE,CAAC,EAAE,EAAE;YAC/C,MAAM,CAAC,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,QAAQ,0CAAG,QAAQ,CAAC,0CAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;YAC3E,MAAM,CAAC,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,QAAQ,0CAAG,QAAQ,CAAC,0CAAE,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC5E;IACH,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { FeeDetails, Nullable, Network as ChainifyNetwork } from '@yaswap/types';
|
|
2
|
+
import { ChainId } from '@yaswap/cryptoassets';
|
|
3
|
+
import { LiqualityErrorJSON } from '@yaswap/error-parser';
|
|
4
|
+
import { Account, AccountId, AnalyticsState, Asset, CurrenciesInfo, CustomToken, ExperimentType, FiatRates, HistoryItem, MarketData, Network, NFT, NFTSendHistoryItem, RootState, SendHistoryItem, SwapHistoryItem, Wallet, WalletId } from './types';
|
|
5
|
+
declare const _default: {
|
|
6
|
+
SET_STATE(state: RootState, { newState }: {
|
|
7
|
+
newState: RootState;
|
|
8
|
+
}): void;
|
|
9
|
+
CREATE_WALLET(state: RootState, { key, keySalt, encryptedWallets, wallet, }: {
|
|
10
|
+
key: string;
|
|
11
|
+
keySalt: string;
|
|
12
|
+
encryptedWallets: string;
|
|
13
|
+
wallet: Wallet;
|
|
14
|
+
}): void;
|
|
15
|
+
ACCEPT_TNC(state: RootState): void;
|
|
16
|
+
CHANGE_ACTIVE_WALLETID(state: RootState, { walletId }: {
|
|
17
|
+
walletId: WalletId;
|
|
18
|
+
}): void;
|
|
19
|
+
CHANGE_ACTIVE_NETWORK(state: RootState, { network }: {
|
|
20
|
+
network: Network;
|
|
21
|
+
}): void;
|
|
22
|
+
CHANGE_PASSWORD(state: RootState, { key, keySalt, encryptedWallets }: {
|
|
23
|
+
key: string;
|
|
24
|
+
keySalt: string;
|
|
25
|
+
encryptedWallets: string;
|
|
26
|
+
}): void;
|
|
27
|
+
LOCK_WALLET(state: RootState): void;
|
|
28
|
+
UNLOCK_WALLET(state: RootState, { key, wallets, unlockedAt }: {
|
|
29
|
+
key: string;
|
|
30
|
+
wallets: Wallet[];
|
|
31
|
+
unlockedAt: number;
|
|
32
|
+
}): void;
|
|
33
|
+
NEW_SWAP(state: RootState, { network, walletId, swap }: {
|
|
34
|
+
network: Network;
|
|
35
|
+
walletId: WalletId;
|
|
36
|
+
swap: SwapHistoryItem;
|
|
37
|
+
}): void;
|
|
38
|
+
NEW_TRASACTION(state: RootState, { network, walletId, transaction }: {
|
|
39
|
+
network: Network;
|
|
40
|
+
walletId: WalletId;
|
|
41
|
+
transaction: SendHistoryItem;
|
|
42
|
+
}): void;
|
|
43
|
+
NEW_NFT_TRASACTION(state: RootState, { network, walletId, transaction }: {
|
|
44
|
+
network: Network;
|
|
45
|
+
walletId: WalletId;
|
|
46
|
+
transaction: NFTSendHistoryItem;
|
|
47
|
+
}): void;
|
|
48
|
+
UPDATE_HISTORY(state: RootState, { network, walletId, id, updates, }: {
|
|
49
|
+
network: Network;
|
|
50
|
+
walletId: WalletId;
|
|
51
|
+
id: string;
|
|
52
|
+
updates: Partial<HistoryItem>;
|
|
53
|
+
}): void;
|
|
54
|
+
REMOVE_ORDER(state: RootState, { network, walletId, id }: {
|
|
55
|
+
network: Network;
|
|
56
|
+
walletId: WalletId;
|
|
57
|
+
id: string;
|
|
58
|
+
}): void;
|
|
59
|
+
UPDATE_BALANCE(state: RootState, { network, accountId, walletId, asset, balance, }: {
|
|
60
|
+
network: Network;
|
|
61
|
+
accountId: AccountId;
|
|
62
|
+
walletId: WalletId;
|
|
63
|
+
asset: Asset;
|
|
64
|
+
balance: string;
|
|
65
|
+
}): void;
|
|
66
|
+
UPDATE_MULTIPLE_BALANCES(state: RootState, { network, accountId, walletId, assets, balances, }: {
|
|
67
|
+
network: Network;
|
|
68
|
+
accountId: AccountId;
|
|
69
|
+
walletId: WalletId;
|
|
70
|
+
assets: Asset[];
|
|
71
|
+
balances: Nullable<string>[];
|
|
72
|
+
}): void;
|
|
73
|
+
UPDATE_FEES(state: RootState, { network, walletId, asset, fees }: {
|
|
74
|
+
network: Network;
|
|
75
|
+
walletId: WalletId;
|
|
76
|
+
asset: Asset;
|
|
77
|
+
fees: FeeDetails;
|
|
78
|
+
}): void;
|
|
79
|
+
UPDATE_FIAT_RATES(state: RootState, { fiatRates }: {
|
|
80
|
+
fiatRates: FiatRates;
|
|
81
|
+
}): void;
|
|
82
|
+
UPDATE_CURRENCIES_INFO(state: RootState, { currenciesInfo }: {
|
|
83
|
+
currenciesInfo: CurrenciesInfo;
|
|
84
|
+
}): void;
|
|
85
|
+
UPDATE_MARKET_DATA(state: RootState, { network, marketData }: {
|
|
86
|
+
network: Network;
|
|
87
|
+
marketData: MarketData[];
|
|
88
|
+
}): void;
|
|
89
|
+
SET_ETHEREUM_INJECTION_CHAIN(state: RootState, { chain }: {
|
|
90
|
+
chain: ChainId;
|
|
91
|
+
}): void;
|
|
92
|
+
ENABLE_ETHEREUM_INJECTION(state: RootState): void;
|
|
93
|
+
DISABLE_ETHEREUM_INJECTION(state: RootState): void;
|
|
94
|
+
ENABLE_ASSETS(state: RootState, { network, walletId, assets }: {
|
|
95
|
+
network: Network;
|
|
96
|
+
walletId: WalletId;
|
|
97
|
+
assets: Asset[];
|
|
98
|
+
}): void;
|
|
99
|
+
DISABLE_ASSETS(state: RootState, { network, walletId, assets }: {
|
|
100
|
+
network: Network;
|
|
101
|
+
walletId: WalletId;
|
|
102
|
+
assets: Asset[];
|
|
103
|
+
}): void;
|
|
104
|
+
DISABLE_ACCOUNT_ASSETS(state: RootState, { network, walletId, accountId, assets, }: {
|
|
105
|
+
network: Network;
|
|
106
|
+
walletId: WalletId;
|
|
107
|
+
accountId: AccountId;
|
|
108
|
+
assets: Asset[];
|
|
109
|
+
}): void;
|
|
110
|
+
ENABLE_ACCOUNT_ASSETS(state: RootState, { network, walletId, accountId, assets, }: {
|
|
111
|
+
network: Network;
|
|
112
|
+
walletId: WalletId;
|
|
113
|
+
accountId: AccountId;
|
|
114
|
+
assets: Asset[];
|
|
115
|
+
}): void;
|
|
116
|
+
ADD_CUSTOM_TOKEN(state: RootState, { network, walletId, customToken }: {
|
|
117
|
+
network: Network;
|
|
118
|
+
walletId: WalletId;
|
|
119
|
+
customToken: CustomToken;
|
|
120
|
+
}): void;
|
|
121
|
+
REMOVE_CUSTOM_TOKEN(state: RootState, { network, walletId, symbol }: {
|
|
122
|
+
network: Network;
|
|
123
|
+
walletId: WalletId;
|
|
124
|
+
symbol: string;
|
|
125
|
+
}): void;
|
|
126
|
+
CREATE_ACCOUNT(state: RootState, { network, walletId, account }: {
|
|
127
|
+
network: Network;
|
|
128
|
+
walletId: WalletId;
|
|
129
|
+
account: Account;
|
|
130
|
+
}): void;
|
|
131
|
+
UPDATE_ACCOUNT(state: RootState, { network, walletId, account }: {
|
|
132
|
+
network: Network;
|
|
133
|
+
walletId: WalletId;
|
|
134
|
+
account: Account;
|
|
135
|
+
}): void;
|
|
136
|
+
REMOVE_ACCOUNT(state: RootState, { walletId, id, network }: {
|
|
137
|
+
walletId: WalletId;
|
|
138
|
+
id: AccountId;
|
|
139
|
+
network: Network;
|
|
140
|
+
}): void;
|
|
141
|
+
UPDATE_ACCOUNT_ADDRESSES(state: RootState, { network, accountId, walletId, addresses, }: {
|
|
142
|
+
network: Network;
|
|
143
|
+
accountId: AccountId;
|
|
144
|
+
walletId: WalletId;
|
|
145
|
+
addresses: string[];
|
|
146
|
+
}): void;
|
|
147
|
+
SET_USB_BRIDGE_WINDOWS_ID(state: RootState, { id }: {
|
|
148
|
+
id: number;
|
|
149
|
+
}): void;
|
|
150
|
+
SET_EXTERNAL_CONNECTION_DEFAULT(state: RootState, { origin, activeWalletId, accountId }: {
|
|
151
|
+
origin: string;
|
|
152
|
+
activeWalletId: WalletId;
|
|
153
|
+
accountId: AccountId;
|
|
154
|
+
}): void;
|
|
155
|
+
ADD_EXTERNAL_CONNECTION(state: RootState, { origin, activeWalletId, accountId, chain, }: {
|
|
156
|
+
origin: string;
|
|
157
|
+
activeWalletId: WalletId;
|
|
158
|
+
accountId: AccountId;
|
|
159
|
+
chain: ChainId;
|
|
160
|
+
}): void;
|
|
161
|
+
REMOVE_EXTERNAL_CONNECTIONS(state: RootState, { activeWalletId }: {
|
|
162
|
+
activeWalletId: WalletId;
|
|
163
|
+
}): void;
|
|
164
|
+
SET_ANALYTICS_PREFERENCES(state: RootState, payload: Partial<AnalyticsState>): void;
|
|
165
|
+
UPDATE_NFTS(state: RootState, { network, walletId, accountId, nfts }: {
|
|
166
|
+
network: Network;
|
|
167
|
+
walletId: WalletId;
|
|
168
|
+
accountId: AccountId;
|
|
169
|
+
nfts: NFT[];
|
|
170
|
+
}): void;
|
|
171
|
+
NFT_TOGGLE_STARRED(state: RootState, { network, walletId, accountId, nft }: {
|
|
172
|
+
network: Network;
|
|
173
|
+
walletId: WalletId;
|
|
174
|
+
accountId: AccountId;
|
|
175
|
+
nft: NFT;
|
|
176
|
+
}): void;
|
|
177
|
+
TOGGLE_EXPERIMENT(state: RootState, { name }: {
|
|
178
|
+
name: ExperimentType;
|
|
179
|
+
}): void;
|
|
180
|
+
SET_WHATS_NEW_MODAL_VERSION(state: RootState, { version }: {
|
|
181
|
+
version: string;
|
|
182
|
+
}): void;
|
|
183
|
+
TOGGLE_BLOCKCHAIN(state: RootState, { network, walletId, chainId, enable, }: {
|
|
184
|
+
network: Network;
|
|
185
|
+
walletId: WalletId;
|
|
186
|
+
chainId: ChainId;
|
|
187
|
+
enable: boolean;
|
|
188
|
+
}): void;
|
|
189
|
+
TOGGLE_ACCOUNT(state: RootState, { network, walletId, accountId, enable, }: {
|
|
190
|
+
network: Network;
|
|
191
|
+
walletId: WalletId;
|
|
192
|
+
accountId: AccountId;
|
|
193
|
+
enable: boolean;
|
|
194
|
+
}): void;
|
|
195
|
+
LOG_ERROR(state: RootState, error: LiqualityErrorJSON): void;
|
|
196
|
+
CLEAR_ERROR_LOG(state: RootState): void;
|
|
197
|
+
SET_CUSTOM_CHAIN_SETTINGS(state: RootState, { network, walletId, chainId, chanifyNetwork, }: {
|
|
198
|
+
network: Network;
|
|
199
|
+
walletId: WalletId;
|
|
200
|
+
chainId: ChainId;
|
|
201
|
+
chanifyNetwork: ChainifyNetwork;
|
|
202
|
+
}): void;
|
|
203
|
+
REMOVE_CUSTOM_CHAIN_SETTINGS(state: RootState, { network, walletId, chainId }: {
|
|
204
|
+
network: Network;
|
|
205
|
+
walletId: WalletId;
|
|
206
|
+
chainId: ChainId;
|
|
207
|
+
}): void;
|
|
208
|
+
};
|
|
209
|
+
export default _default;
|