@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,249 @@
|
|
|
1
|
+
import { FeeDetails, NFTAsset, Nullable, Transaction } from '@yaswap/types';
|
|
2
|
+
import { ChainId } from '@yaswap/cryptoassets';
|
|
3
|
+
import { Step } from '@lifi/sdk';
|
|
4
|
+
import { SwapProviderError } from '../swaps/types';
|
|
5
|
+
import BN from 'bignumber.js';
|
|
6
|
+
import { LiqualityErrorJSON } from '@yaswap/error-parser';
|
|
7
|
+
import { ChainifyNetwork } from '../types';
|
|
8
|
+
export declare type NetworkWalletIdMap<T> = Partial<Record<Network, Record<WalletId, T>>>;
|
|
9
|
+
export declare type WalletIdNetworkMap<T> = Partial<Record<WalletId, Record<Network, T>>>;
|
|
10
|
+
export declare enum Network {
|
|
11
|
+
Mainnet = "mainnet",
|
|
12
|
+
Testnet = "testnet"
|
|
13
|
+
}
|
|
14
|
+
export interface ClientSettings<T> {
|
|
15
|
+
network: Network;
|
|
16
|
+
chainifyNetwork: T;
|
|
17
|
+
}
|
|
18
|
+
export declare type WalletId = string;
|
|
19
|
+
export declare type AccountId = string;
|
|
20
|
+
export declare type Asset = string;
|
|
21
|
+
export declare type FiatRates = Record<Asset, number>;
|
|
22
|
+
export declare type CurrenciesInfo = Record<Asset, BN>;
|
|
23
|
+
export declare type AnalyticsState = {
|
|
24
|
+
userId: string;
|
|
25
|
+
acceptedDate: number;
|
|
26
|
+
askedDate: number;
|
|
27
|
+
askedTimes: number;
|
|
28
|
+
notAskAgain: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare type AssetInfo = {
|
|
31
|
+
asset: string;
|
|
32
|
+
type: string;
|
|
33
|
+
amount: BN;
|
|
34
|
+
};
|
|
35
|
+
export interface Wallet {
|
|
36
|
+
id: WalletId;
|
|
37
|
+
name: string;
|
|
38
|
+
mnemonic: string;
|
|
39
|
+
at: number;
|
|
40
|
+
imported: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface CustomToken {
|
|
43
|
+
symbol: string;
|
|
44
|
+
name: string;
|
|
45
|
+
contractAddress: string;
|
|
46
|
+
decimals: number;
|
|
47
|
+
chain: ChainId;
|
|
48
|
+
}
|
|
49
|
+
export declare enum AccountType {
|
|
50
|
+
Default = "default",
|
|
51
|
+
BitcoinLedgerNativeSegwit = "bitcoin_ledger_nagive_segwit",
|
|
52
|
+
BitcoinLedgerLegacy = "bitcoin_ledger_legacy",
|
|
53
|
+
EthereumLedger = "ethereum_ledger",
|
|
54
|
+
RskLedger = "rsk_ledger"
|
|
55
|
+
}
|
|
56
|
+
export interface AccountDefinition {
|
|
57
|
+
type: AccountType;
|
|
58
|
+
name: string;
|
|
59
|
+
alias?: string;
|
|
60
|
+
chain: ChainId;
|
|
61
|
+
index: number;
|
|
62
|
+
derivationPath?: string;
|
|
63
|
+
addresses: string[];
|
|
64
|
+
assets: Asset[];
|
|
65
|
+
balances: Record<Asset, string>;
|
|
66
|
+
updatedAt?: number;
|
|
67
|
+
color: string;
|
|
68
|
+
enabled?: boolean;
|
|
69
|
+
chainCode?: string;
|
|
70
|
+
publicKey?: string;
|
|
71
|
+
nfts?: NFT[];
|
|
72
|
+
}
|
|
73
|
+
export interface AccountInfo {
|
|
74
|
+
derivationPath: string;
|
|
75
|
+
type: string;
|
|
76
|
+
chainCode?: string;
|
|
77
|
+
publicKey?: string;
|
|
78
|
+
address?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface Account extends AccountDefinition {
|
|
81
|
+
id: AccountId;
|
|
82
|
+
walletId: WalletId;
|
|
83
|
+
createdAt: number;
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
derivationPath: string;
|
|
86
|
+
chainCode?: string;
|
|
87
|
+
publicKey?: string;
|
|
88
|
+
nfts?: NFT[];
|
|
89
|
+
}
|
|
90
|
+
export interface PairData {
|
|
91
|
+
from: Asset;
|
|
92
|
+
to: Asset;
|
|
93
|
+
rate: string;
|
|
94
|
+
max: string;
|
|
95
|
+
min: string;
|
|
96
|
+
}
|
|
97
|
+
export interface MarketData extends PairData {
|
|
98
|
+
provider: string;
|
|
99
|
+
}
|
|
100
|
+
export declare enum FeeLabel {
|
|
101
|
+
Slow = "slow",
|
|
102
|
+
Average = "average",
|
|
103
|
+
Fast = "fast"
|
|
104
|
+
}
|
|
105
|
+
export declare enum TransactionType {
|
|
106
|
+
Send = "SEND",
|
|
107
|
+
Swap = "SWAP",
|
|
108
|
+
NFT = "NFT"
|
|
109
|
+
}
|
|
110
|
+
export declare enum SwapProviderType {
|
|
111
|
+
Liquality = "liquality",
|
|
112
|
+
LiqualityBoostNativeToERC20 = "liqualityBoostNativeToERC20",
|
|
113
|
+
LiqualityBoostERC20ToNative = "liqualityBoostERC20toNative",
|
|
114
|
+
UniswapV2 = "uniswapV2",
|
|
115
|
+
FastBTCDeposit = "fastBTC",
|
|
116
|
+
FastBTCWithdraw = "fastBTCWithdraw",
|
|
117
|
+
OneInch = "oneinchV4",
|
|
118
|
+
Sovryn = "sovryn",
|
|
119
|
+
Thorchain = "thorchain",
|
|
120
|
+
Astroport = "astroport",
|
|
121
|
+
Hop = "hop",
|
|
122
|
+
Jupiter = "jupiter",
|
|
123
|
+
DeBridge = "debridge",
|
|
124
|
+
LiFi = "lifi",
|
|
125
|
+
TeleSwap = "teleswap"
|
|
126
|
+
}
|
|
127
|
+
export interface BaseHistoryItem {
|
|
128
|
+
fee: number;
|
|
129
|
+
feeLabel: FeeLabel;
|
|
130
|
+
from: Asset;
|
|
131
|
+
id: string;
|
|
132
|
+
network: Network;
|
|
133
|
+
startTime: number;
|
|
134
|
+
endTime?: number;
|
|
135
|
+
status: string;
|
|
136
|
+
to: Asset;
|
|
137
|
+
type: TransactionType;
|
|
138
|
+
walletId: WalletId;
|
|
139
|
+
error?: Nullable<string>;
|
|
140
|
+
waitingForLock?: boolean;
|
|
141
|
+
}
|
|
142
|
+
export interface NFTSendTransactionParams {
|
|
143
|
+
network: Network;
|
|
144
|
+
accountId: AccountId;
|
|
145
|
+
walletId: WalletId;
|
|
146
|
+
receiver: string;
|
|
147
|
+
values: number[];
|
|
148
|
+
fee: number;
|
|
149
|
+
feeLabel: FeeLabel;
|
|
150
|
+
nft: NFT;
|
|
151
|
+
}
|
|
152
|
+
export declare enum SendStatus {
|
|
153
|
+
WAITING_FOR_CONFIRMATIONS = "WAITING_FOR_CONFIRMATIONS",
|
|
154
|
+
SUCCESS = "SUCCESS",
|
|
155
|
+
FAILED = "FAILED"
|
|
156
|
+
}
|
|
157
|
+
export interface SendHistoryItem extends BaseHistoryItem {
|
|
158
|
+
type: TransactionType.Send;
|
|
159
|
+
toAddress: string;
|
|
160
|
+
amount: string;
|
|
161
|
+
tx: Transaction;
|
|
162
|
+
txHash: string;
|
|
163
|
+
accountId: AccountId;
|
|
164
|
+
fiatRate: number;
|
|
165
|
+
status: SendStatus;
|
|
166
|
+
}
|
|
167
|
+
export interface NFTSendHistoryItem extends BaseHistoryItem {
|
|
168
|
+
type: TransactionType.NFT;
|
|
169
|
+
toAddress: string;
|
|
170
|
+
tx: Transaction;
|
|
171
|
+
nft: NFT;
|
|
172
|
+
txHash: string;
|
|
173
|
+
accountId: AccountId;
|
|
174
|
+
status: SendStatus;
|
|
175
|
+
}
|
|
176
|
+
export interface SwapHistoryItem extends BaseHistoryItem {
|
|
177
|
+
type: TransactionType.Swap;
|
|
178
|
+
claimFeeLabel: FeeLabel;
|
|
179
|
+
claimFee: number;
|
|
180
|
+
fromAmount: string;
|
|
181
|
+
fromAccountId: AccountId;
|
|
182
|
+
provider: SwapProviderType;
|
|
183
|
+
slippage: number;
|
|
184
|
+
toAccountId: AccountId;
|
|
185
|
+
toAmount: string;
|
|
186
|
+
bridgeAsset?: Asset;
|
|
187
|
+
path?: string[];
|
|
188
|
+
lifiRoute?: Step;
|
|
189
|
+
swapProviderError?: SwapProviderError;
|
|
190
|
+
}
|
|
191
|
+
export declare type HistoryItem = NFTSendHistoryItem | SendHistoryItem | SwapHistoryItem;
|
|
192
|
+
export declare enum ExperimentType {
|
|
193
|
+
ManageAccounts = "manageAccounts",
|
|
194
|
+
ReportErrors = "reportErrors"
|
|
195
|
+
}
|
|
196
|
+
export declare type ChainAccountIdMap = {
|
|
197
|
+
[key in ChainId]: string[];
|
|
198
|
+
};
|
|
199
|
+
export interface Connections extends ChainAccountIdMap {
|
|
200
|
+
defaultEthereum: string;
|
|
201
|
+
}
|
|
202
|
+
export declare type ExternalConnections = Record<WalletId, Record<string, Connections>>;
|
|
203
|
+
export interface RootState {
|
|
204
|
+
version: number;
|
|
205
|
+
key: string;
|
|
206
|
+
wallets: Wallet[];
|
|
207
|
+
unlockedAt: number;
|
|
208
|
+
brokerReady: boolean;
|
|
209
|
+
encryptedWallets: string;
|
|
210
|
+
enabledAssets: NetworkWalletIdMap<Asset[]>;
|
|
211
|
+
customTokens: NetworkWalletIdMap<CustomToken[]>;
|
|
212
|
+
accounts: WalletIdNetworkMap<Account[]>;
|
|
213
|
+
fiatRates: FiatRates;
|
|
214
|
+
currenciesInfo: CurrenciesInfo;
|
|
215
|
+
fees: NetworkWalletIdMap<Record<Asset, FeeDetails>>;
|
|
216
|
+
history: NetworkWalletIdMap<HistoryItem[]>;
|
|
217
|
+
marketData: Partial<Record<Network, MarketData[]>>;
|
|
218
|
+
activeNetwork: Network;
|
|
219
|
+
activeWalletId: WalletId;
|
|
220
|
+
keyUpdatedAt: number;
|
|
221
|
+
keySalt: string;
|
|
222
|
+
termsAcceptedAt: number;
|
|
223
|
+
setupAt: number;
|
|
224
|
+
injectEthereum: boolean;
|
|
225
|
+
injectEthereumChain: ChainId;
|
|
226
|
+
usbBridgeWindowsId: number;
|
|
227
|
+
externalConnections: ExternalConnections;
|
|
228
|
+
rskLegacyDerivation: boolean;
|
|
229
|
+
analytics: AnalyticsState;
|
|
230
|
+
experiments: Partial<Record<ExperimentType, boolean>>;
|
|
231
|
+
whatsNewModalVersion: string;
|
|
232
|
+
enabledChains: WalletIdNetworkMap<ChainId[]>;
|
|
233
|
+
errorLog: LiqualityErrorJSON[];
|
|
234
|
+
customChainSeetings: NetworkWalletIdMap<Record<ChainId, ChainifyNetwork>>;
|
|
235
|
+
}
|
|
236
|
+
export declare type NFTCollections<T> = {
|
|
237
|
+
[collectionName: string]: T[];
|
|
238
|
+
};
|
|
239
|
+
export interface NFTWithAccount extends NFT {
|
|
240
|
+
accountId: AccountId;
|
|
241
|
+
}
|
|
242
|
+
export interface NFT extends NFTAsset {
|
|
243
|
+
starred: boolean;
|
|
244
|
+
}
|
|
245
|
+
export declare enum NftProviderType {
|
|
246
|
+
OpenSea = "opensea",
|
|
247
|
+
Infura = "infura",
|
|
248
|
+
Covalent = "covalent"
|
|
249
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NftProviderType = exports.ExperimentType = exports.SendStatus = exports.SwapProviderType = exports.TransactionType = exports.FeeLabel = exports.AccountType = exports.Network = void 0;
|
|
4
|
+
var Network;
|
|
5
|
+
(function (Network) {
|
|
6
|
+
Network["Mainnet"] = "mainnet";
|
|
7
|
+
Network["Testnet"] = "testnet";
|
|
8
|
+
})(Network = exports.Network || (exports.Network = {}));
|
|
9
|
+
var AccountType;
|
|
10
|
+
(function (AccountType) {
|
|
11
|
+
AccountType["Default"] = "default";
|
|
12
|
+
AccountType["BitcoinLedgerNativeSegwit"] = "bitcoin_ledger_nagive_segwit";
|
|
13
|
+
AccountType["BitcoinLedgerLegacy"] = "bitcoin_ledger_legacy";
|
|
14
|
+
AccountType["EthereumLedger"] = "ethereum_ledger";
|
|
15
|
+
AccountType["RskLedger"] = "rsk_ledger";
|
|
16
|
+
})(AccountType = exports.AccountType || (exports.AccountType = {}));
|
|
17
|
+
var FeeLabel;
|
|
18
|
+
(function (FeeLabel) {
|
|
19
|
+
FeeLabel["Slow"] = "slow";
|
|
20
|
+
FeeLabel["Average"] = "average";
|
|
21
|
+
FeeLabel["Fast"] = "fast";
|
|
22
|
+
})(FeeLabel = exports.FeeLabel || (exports.FeeLabel = {}));
|
|
23
|
+
var TransactionType;
|
|
24
|
+
(function (TransactionType) {
|
|
25
|
+
TransactionType["Send"] = "SEND";
|
|
26
|
+
TransactionType["Swap"] = "SWAP";
|
|
27
|
+
TransactionType["NFT"] = "NFT";
|
|
28
|
+
})(TransactionType = exports.TransactionType || (exports.TransactionType = {}));
|
|
29
|
+
var SwapProviderType;
|
|
30
|
+
(function (SwapProviderType) {
|
|
31
|
+
SwapProviderType["Liquality"] = "liquality";
|
|
32
|
+
SwapProviderType["LiqualityBoostNativeToERC20"] = "liqualityBoostNativeToERC20";
|
|
33
|
+
SwapProviderType["LiqualityBoostERC20ToNative"] = "liqualityBoostERC20toNative";
|
|
34
|
+
SwapProviderType["UniswapV2"] = "uniswapV2";
|
|
35
|
+
SwapProviderType["FastBTCDeposit"] = "fastBTC";
|
|
36
|
+
SwapProviderType["FastBTCWithdraw"] = "fastBTCWithdraw";
|
|
37
|
+
SwapProviderType["OneInch"] = "oneinchV4";
|
|
38
|
+
SwapProviderType["Sovryn"] = "sovryn";
|
|
39
|
+
SwapProviderType["Thorchain"] = "thorchain";
|
|
40
|
+
SwapProviderType["Astroport"] = "astroport";
|
|
41
|
+
SwapProviderType["Hop"] = "hop";
|
|
42
|
+
SwapProviderType["Jupiter"] = "jupiter";
|
|
43
|
+
SwapProviderType["DeBridge"] = "debridge";
|
|
44
|
+
SwapProviderType["LiFi"] = "lifi";
|
|
45
|
+
SwapProviderType["TeleSwap"] = "teleswap";
|
|
46
|
+
})(SwapProviderType = exports.SwapProviderType || (exports.SwapProviderType = {}));
|
|
47
|
+
var SendStatus;
|
|
48
|
+
(function (SendStatus) {
|
|
49
|
+
SendStatus["WAITING_FOR_CONFIRMATIONS"] = "WAITING_FOR_CONFIRMATIONS";
|
|
50
|
+
SendStatus["SUCCESS"] = "SUCCESS";
|
|
51
|
+
SendStatus["FAILED"] = "FAILED";
|
|
52
|
+
})(SendStatus = exports.SendStatus || (exports.SendStatus = {}));
|
|
53
|
+
var ExperimentType;
|
|
54
|
+
(function (ExperimentType) {
|
|
55
|
+
ExperimentType["ManageAccounts"] = "manageAccounts";
|
|
56
|
+
ExperimentType["ReportErrors"] = "reportErrors";
|
|
57
|
+
})(ExperimentType = exports.ExperimentType || (exports.ExperimentType = {}));
|
|
58
|
+
var NftProviderType;
|
|
59
|
+
(function (NftProviderType) {
|
|
60
|
+
NftProviderType["OpenSea"] = "opensea";
|
|
61
|
+
NftProviderType["Infura"] = "infura";
|
|
62
|
+
NftProviderType["Covalent"] = "covalent";
|
|
63
|
+
})(NftProviderType = exports.NftProviderType || (exports.NftProviderType = {}));
|
|
64
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/store/types.ts"],"names":[],"mappings":";;;AAUA,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,8BAAmB,CAAA;IACnB,8BAAmB,CAAA;AACrB,CAAC,EAHW,OA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AAc,QAGzB;AAuED,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;AACvB,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Client } from '@yaswap/client';
|
|
3
|
+
import BN from 'bignumber.js';
|
|
4
|
+
import EventEmitter from 'events';
|
|
5
|
+
import { Asset, AssetInfo, CurrenciesInfo, Network, RootState, WalletId } from './types';
|
|
6
|
+
export declare const clientCache: {
|
|
7
|
+
[key: string]: Client;
|
|
8
|
+
};
|
|
9
|
+
export declare const CHAIN_LOCK: {
|
|
10
|
+
[key: string]: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const emitter: EventEmitter;
|
|
13
|
+
declare const wait: (millis: number) => Promise<void>;
|
|
14
|
+
export { wait };
|
|
15
|
+
export declare const waitForRandom: (min: number, max: number) => Promise<void>;
|
|
16
|
+
export declare const timestamp: () => number;
|
|
17
|
+
export declare const attemptToLockAsset: (network: Network, walletId: WalletId, asset: Asset) => {
|
|
18
|
+
key: string;
|
|
19
|
+
success: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const unlockAsset: (key: string) => void;
|
|
22
|
+
export declare const shouldApplyRskLegacyDerivation: (accounts: RootState['accounts'], mnemonic?: string, indexPath?: number) => Promise<boolean>;
|
|
23
|
+
export declare function getYacPrices(): Promise<any>;
|
|
24
|
+
export declare function getPrices(baseCurrencies: string[], toCurrency: string): Promise<{
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function getCurrenciesInfo(baseCurrencies: string[]): Promise<CurrenciesInfo>;
|
|
28
|
+
export declare function getPriority(chain: string): 0 | 1 | 2 | 3;
|
|
29
|
+
export declare const orderChains: (firstChain: {
|
|
30
|
+
totalFiatBalance: BN;
|
|
31
|
+
nativeAssetMarketCap: BN;
|
|
32
|
+
chain: string;
|
|
33
|
+
}, secondChain: {
|
|
34
|
+
totalFiatBalance: BN;
|
|
35
|
+
nativeAssetMarketCap: BN;
|
|
36
|
+
chain: string;
|
|
37
|
+
}) => number;
|
|
38
|
+
export declare const orderAssets: (hasFiat: boolean, hasTokenBalance: boolean, sortedAssetsByFiat: AssetInfo[], sortedAssetsByMarketCap: AssetInfo[], sortedAssetsByTokenBalance: AssetInfo[]) => string[];
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.orderAssets = exports.orderChains = exports.getPriority = exports.getCurrenciesInfo = exports.getPrices = exports.getYacPrices = exports.shouldApplyRskLegacyDerivation = exports.unlockAsset = exports.attemptToLockAsset = exports.timestamp = exports.waitForRandom = exports.wait = exports.emitter = exports.CHAIN_LOCK = exports.clientCache = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const client_1 = require("@yaswap/client");
|
|
6
|
+
const evm_1 = require("@yaswap/evm");
|
|
7
|
+
const cryptoassets_1 = require("@yaswap/cryptoassets");
|
|
8
|
+
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
|
9
|
+
const events_1 = tslib_1.__importDefault(require("events"));
|
|
10
|
+
const lodash_1 = require("lodash");
|
|
11
|
+
const cryptoassets_2 = tslib_1.__importDefault(require("../utils/cryptoassets"));
|
|
12
|
+
const types_1 = require("./types");
|
|
13
|
+
const build_config_1 = tslib_1.__importDefault(require("../build.config"));
|
|
14
|
+
exports.clientCache = {};
|
|
15
|
+
exports.CHAIN_LOCK = {};
|
|
16
|
+
exports.emitter = new events_1.default();
|
|
17
|
+
const wait = (millis) => new Promise((resolve) => setTimeout(() => resolve(), millis));
|
|
18
|
+
exports.wait = wait;
|
|
19
|
+
const waitForRandom = (min, max) => wait((0, lodash_1.random)(min, max));
|
|
20
|
+
exports.waitForRandom = waitForRandom;
|
|
21
|
+
const timestamp = () => Date.now();
|
|
22
|
+
exports.timestamp = timestamp;
|
|
23
|
+
const attemptToLockAsset = (network, walletId, asset) => {
|
|
24
|
+
const chain = cryptoassets_2.default[asset].chain;
|
|
25
|
+
const key = [network, walletId, chain].join('-');
|
|
26
|
+
if (exports.CHAIN_LOCK[key]) {
|
|
27
|
+
return {
|
|
28
|
+
key,
|
|
29
|
+
success: false,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.CHAIN_LOCK[key] = true;
|
|
33
|
+
return {
|
|
34
|
+
key,
|
|
35
|
+
success: true,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
exports.attemptToLockAsset = attemptToLockAsset;
|
|
39
|
+
const unlockAsset = (key) => {
|
|
40
|
+
exports.CHAIN_LOCK[key] = false;
|
|
41
|
+
exports.emitter.emit(`unlock:${key}`);
|
|
42
|
+
};
|
|
43
|
+
exports.unlockAsset = unlockAsset;
|
|
44
|
+
const COIN_GECKO_API = 'https://api.coingecko.com/api/v3';
|
|
45
|
+
const getRskERC20Assets = () => {
|
|
46
|
+
const erc20 = Object.keys(cryptoassets_2.default).filter((asset) => cryptoassets_2.default[asset].chain === cryptoassets_1.ChainId.Rootstock && cryptoassets_2.default[asset].type === cryptoassets_1.AssetTypes.erc20);
|
|
47
|
+
return erc20.map((erc) => cryptoassets_2.default[erc]);
|
|
48
|
+
};
|
|
49
|
+
const shouldApplyRskLegacyDerivation = (accounts, mnemonic, indexPath = 0) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
50
|
+
const rskERC20Assets = getRskERC20Assets().map((asset) => {
|
|
51
|
+
return Object.assign(Object.assign({}, asset), { isNative: asset.type === 'native' });
|
|
52
|
+
});
|
|
53
|
+
const walletIds = Object.keys(accounts);
|
|
54
|
+
const addresses = [];
|
|
55
|
+
walletIds.forEach((wallet) => {
|
|
56
|
+
const walletAccounts = accounts[wallet].mainnet;
|
|
57
|
+
walletAccounts.forEach((account) => {
|
|
58
|
+
if (account.chain === cryptoassets_1.ChainId.Rootstock) {
|
|
59
|
+
addresses.push(...account.addresses);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
if (mnemonic) {
|
|
64
|
+
const walletProvider = new evm_1.EvmWalletProvider({ mnemonic, derivationPath: `m/44'/137'/${indexPath}'/0/0` });
|
|
65
|
+
const _addresses = yield walletProvider.getAddresses();
|
|
66
|
+
addresses.push(..._addresses.map((e) => e.address));
|
|
67
|
+
}
|
|
68
|
+
const rskMainnetNetwork = (0, cryptoassets_1.getChain)(types_1.Network.Mainnet, cryptoassets_1.ChainId.Rootstock).network;
|
|
69
|
+
const chainProvider = new evm_1.EvmChainProvider(rskMainnetNetwork);
|
|
70
|
+
const balances = yield chainProvider.getBalance(addresses, rskERC20Assets);
|
|
71
|
+
return balances.some((amount) => amount.isGreaterThan(0));
|
|
72
|
+
});
|
|
73
|
+
exports.shouldApplyRskLegacyDerivation = shouldApplyRskLegacyDerivation;
|
|
74
|
+
function getYacPrices() {
|
|
75
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const yacoinExploraSwapApis = build_config_1.default.yacEsploraApis.esploraSwapUrl['mainnet'];
|
|
77
|
+
const { price } = yield client_1.HttpClient.get(`${yacoinExploraSwapApis}/getprice`);
|
|
78
|
+
return price;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
exports.getYacPrices = getYacPrices;
|
|
82
|
+
function getPrices(baseCurrencies, toCurrency) {
|
|
83
|
+
var _a;
|
|
84
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const coindIds = baseCurrencies
|
|
86
|
+
.filter((currency) => { var _a, _b; return (_b = (_a = cryptoassets_2.default[currency]) === null || _a === void 0 ? void 0 : _a.priceSource) === null || _b === void 0 ? void 0 : _b.coinGeckoId; })
|
|
87
|
+
.map((currency) => { var _a; return (_a = cryptoassets_2.default[currency].priceSource) === null || _a === void 0 ? void 0 : _a.coinGeckoId; });
|
|
88
|
+
const data = yield client_1.HttpClient.get(`${COIN_GECKO_API}/simple/price?ids=${coindIds.join(',')}&vs_currencies=${toCurrency}`);
|
|
89
|
+
let prices = (0, lodash_1.mapKeys)(data, (_, coinGeckoId) => (0, lodash_1.findKey)(cryptoassets_2.default, (asset) => { var _a; return ((_a = asset.priceSource) === null || _a === void 0 ? void 0 : _a.coinGeckoId) === coinGeckoId; }));
|
|
90
|
+
prices = (0, lodash_1.mapValues)(prices, (rates) => (0, lodash_1.mapKeys)(rates, (_, k) => k.toUpperCase()));
|
|
91
|
+
for (const baseCurrency of baseCurrencies) {
|
|
92
|
+
if (!prices[baseCurrency] && ((_a = cryptoassets_2.default[baseCurrency]) === null || _a === void 0 ? void 0 : _a.matchingAsset)) {
|
|
93
|
+
prices[baseCurrency] = prices[cryptoassets_2.default[baseCurrency].matchingAsset];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const symbolPrices = (0, lodash_1.mapValues)(prices, (rates, key) => {
|
|
97
|
+
const _toCurrency = toCurrency.toUpperCase();
|
|
98
|
+
if (rates && rates[_toCurrency]) {
|
|
99
|
+
return rates[_toCurrency];
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
console.error(`${_toCurrency} rate is missing for ${key}`);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return symbolPrices;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
exports.getPrices = getPrices;
|
|
109
|
+
function getCurrenciesInfo(baseCurrencies) {
|
|
110
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
const coindIds = baseCurrencies
|
|
112
|
+
.filter((currency) => { var _a, _b; return (_b = (_a = cryptoassets_2.default[currency]) === null || _a === void 0 ? void 0 : _a.priceSource) === null || _b === void 0 ? void 0 : _b.coinGeckoId; })
|
|
113
|
+
.map((currency) => {
|
|
114
|
+
var _a;
|
|
115
|
+
return ({
|
|
116
|
+
asset: currency,
|
|
117
|
+
coinGeckoId: (_a = cryptoassets_2.default[currency].priceSource) === null || _a === void 0 ? void 0 : _a.coinGeckoId,
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
const data = (yield Promise.all([
|
|
121
|
+
client_1.HttpClient.get(`${COIN_GECKO_API}/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=250&page=1&sparkline=false`),
|
|
122
|
+
client_1.HttpClient.get(`${COIN_GECKO_API}/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=250&page=2&sparkline=false`),
|
|
123
|
+
])).flat();
|
|
124
|
+
return coindIds.reduce((acc, currValue) => {
|
|
125
|
+
const { coinGeckoId, asset } = currValue;
|
|
126
|
+
const coinInfo = data.find((coin) => coin.id === coinGeckoId);
|
|
127
|
+
return (acc = Object.assign(Object.assign({}, acc), { [asset]: coinInfo ? new bignumber_js_1.default(coinInfo.market_cap) : new bignumber_js_1.default(0) }));
|
|
128
|
+
}, {});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
exports.getCurrenciesInfo = getCurrenciesInfo;
|
|
132
|
+
function getPriority(chain) {
|
|
133
|
+
switch (chain) {
|
|
134
|
+
case 'yacoin':
|
|
135
|
+
return 3;
|
|
136
|
+
case 'bitcoin':
|
|
137
|
+
return 2;
|
|
138
|
+
case 'ethereum':
|
|
139
|
+
return 1;
|
|
140
|
+
default:
|
|
141
|
+
return 0;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.getPriority = getPriority;
|
|
145
|
+
const orderChains = (firstChain, secondChain) => {
|
|
146
|
+
const firstPriority = getPriority(firstChain.chain);
|
|
147
|
+
const secondPriority = getPriority(secondChain.chain);
|
|
148
|
+
const difference = secondPriority - firstPriority;
|
|
149
|
+
if (difference != 0) {
|
|
150
|
+
return difference;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
if (firstChain.totalFiatBalance.gt(secondChain.totalFiatBalance)) {
|
|
154
|
+
return -1;
|
|
155
|
+
}
|
|
156
|
+
if (secondChain.totalFiatBalance.gt(firstChain.totalFiatBalance)) {
|
|
157
|
+
return 1;
|
|
158
|
+
}
|
|
159
|
+
if (firstChain.nativeAssetMarketCap.gt(secondChain.nativeAssetMarketCap)) {
|
|
160
|
+
return -1;
|
|
161
|
+
}
|
|
162
|
+
if (secondChain.nativeAssetMarketCap.gt(firstChain.nativeAssetMarketCap)) {
|
|
163
|
+
return 1;
|
|
164
|
+
}
|
|
165
|
+
return firstChain.chain < secondChain.chain ? -1 : 1;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
exports.orderChains = orderChains;
|
|
169
|
+
const orderAssets = (hasFiat, hasTokenBalance, sortedAssetsByFiat, sortedAssetsByMarketCap, sortedAssetsByTokenBalance) => {
|
|
170
|
+
let orderedAssets = [];
|
|
171
|
+
if (hasFiat) {
|
|
172
|
+
orderedAssets = [...sortedAssetsByFiat];
|
|
173
|
+
if (hasTokenBalance) {
|
|
174
|
+
orderedAssets = [...orderedAssets, ...sortedAssetsByTokenBalance, ...sortedAssetsByMarketCap];
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
orderedAssets = [...orderedAssets, ...sortedAssetsByMarketCap, ...sortedAssetsByTokenBalance];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else if (hasTokenBalance) {
|
|
181
|
+
orderedAssets = [...sortedAssetsByTokenBalance, ...sortedAssetsByMarketCap, ...sortedAssetsByFiat];
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
orderedAssets = [...sortedAssetsByMarketCap, ...sortedAssetsByFiat, ...sortedAssetsByTokenBalance];
|
|
185
|
+
}
|
|
186
|
+
const nativeAssetIdx = orderedAssets.findIndex((asset) => asset.type === 'native');
|
|
187
|
+
if (nativeAssetIdx !== -1) {
|
|
188
|
+
const nativeAsset = orderedAssets.splice(nativeAssetIdx, 1)[0];
|
|
189
|
+
return [nativeAsset, ...orderedAssets].map((asset) => asset.asset);
|
|
190
|
+
}
|
|
191
|
+
return orderedAssets.map((asset) => asset.asset);
|
|
192
|
+
};
|
|
193
|
+
exports.orderAssets = orderAssets;
|
|
194
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/store/utils.ts"],"names":[],"mappings":";;;;AAAA,2CAAoD;AACpD,qCAAkE;AAClE,uDAAqE;AACrE,wEAA8B;AAC9B,4DAAkC;AAClC,mCAA6D;AAC7D,iFAAiD;AACjD,mCAAyF;AACzF,2EAAyC;AAE5B,QAAA,WAAW,GAA8B,EAAE,CAAC;AAE5C,QAAA,UAAU,GAA+B,EAAE,CAAC;AAE5C,QAAA,OAAO,GAAG,IAAI,gBAAY,EAAE,CAAC;AAE1C,MAAM,IAAI,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5F,oBAAI;AAEN,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAA,eAAM,EAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAArE,QAAA,aAAa,iBAAwD;AAE3E,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AAA7B,QAAA,SAAS,aAAoB;AAEnC,MAAM,kBAAkB,GAAG,CAAC,OAAgB,EAAE,QAAkB,EAAE,KAAY,EAAE,EAAE;IACvF,MAAM,KAAK,GAAG,sBAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;IACxC,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEjD,IAAI,kBAAU,CAAC,GAAG,CAAC,EAAE;QACnB,OAAO;YACL,GAAG;YACH,OA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Aa,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE/D,OAAO,CAAC,WAAW,EAAE,GAAG,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACpE;IAED,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC;AA/BW,QAAA,WAAW,eA+BtB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EvmTypes } from '@yaswap/evm';
|
|
2
|
+
import { Transaction } from '@yaswap/types';
|
|
3
|
+
import { SwapHistoryItem } from '../store/types';
|
|
4
|
+
import { SwapProvider } from './SwapProvider';
|
|
5
|
+
import { BaseSwapProviderConfig, NextSwapActionRequest, SwapRequest, SwapStatus } from './types';
|
|
6
|
+
export interface EvmSwapHistoryItem extends SwapHistoryItem {
|
|
7
|
+
approveTxHash: string;
|
|
8
|
+
approveTx: Transaction<EvmTypes.EthersTransactionResponse>;
|
|
9
|
+
}
|
|
10
|
+
export interface EvmSwapProviderConfig extends BaseSwapProviderConfig {
|
|
11
|
+
routerAddress: string;
|
|
12
|
+
}
|
|
13
|
+
export declare abstract class EvmSwapProvider extends SwapProvider {
|
|
14
|
+
config: EvmSwapProviderConfig;
|
|
15
|
+
constructor(config: EvmSwapProviderConfig);
|
|
16
|
+
requiresApproval(swapRequest: SwapRequest, approvalAddress?: string): Promise<boolean>;
|
|
17
|
+
buildApprovalTx(swapRequest: SwapRequest, approveMax?: boolean, approvalAddress?: string): Promise<EvmTypes.EthersPopulatedTransaction | undefined>;
|
|
18
|
+
approve(swapRequest: SwapRequest, approveMax?: boolean, approvalAddress?: string): Promise<{
|
|
19
|
+
status: string;
|
|
20
|
+
approveTx: Transaction<any>;
|
|
21
|
+
approveTxHash: string;
|
|
22
|
+
} | {
|
|
23
|
+
status: string;
|
|
24
|
+
approveTx?: undefined;
|
|
25
|
+
approveTxHash?: undefined;
|
|
26
|
+
}>;
|
|
27
|
+
waitForApproveConfirmations(swapRequest: NextSwapActionRequest<EvmSwapHistoryItem>): Promise<{
|
|
28
|
+
endTime: number;
|
|
29
|
+
status: string;
|
|
30
|
+
} | undefined>;
|
|
31
|
+
protected _getStatuses(): Record<string, SwapStatus>;
|
|
32
|
+
}
|