@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
package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/LiqualityBoostNativeToERC20.js
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiqualityBoostNativeToERC20 = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cryptoassets_1 = require("@yaswap/cryptoassets");
|
|
6
|
+
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
|
7
|
+
const factory_1 = require("../../../factory");
|
|
8
|
+
const utils_1 = require("../../../store/actions/performNextAction/utils");
|
|
9
|
+
const types_1 = require("../../../store/types");
|
|
10
|
+
const asset_1 = require("../../../utils/asset");
|
|
11
|
+
const coinFormatter_1 = require("../../../utils/coinFormatter");
|
|
12
|
+
const SwapProvider_1 = require("../../SwapProvider");
|
|
13
|
+
const slippagePercentage = 3;
|
|
14
|
+
class LiqualityBoostNativeToERC20 extends SwapProvider_1.SwapProvider {
|
|
15
|
+
constructor(config) {
|
|
16
|
+
super(config);
|
|
17
|
+
this.liqualitySwapProvider = (0, factory_1.getSwapProvider)(this.config.network, types_1.SwapProviderType.Liquality);
|
|
18
|
+
this.sovrynSwapProvider = (0, factory_1.getSwapProvider)(this.config.network, types_1.SwapProviderType.Sovryn);
|
|
19
|
+
this.supportedBridgeAssets = this.config.supportedBridgeAssets;
|
|
20
|
+
if (this.config.network === 'mainnet') {
|
|
21
|
+
this.oneinchSwapProvider = (0, factory_1.getSwapProvider)(this.config.network, types_1.SwapProviderType.OneInch);
|
|
22
|
+
this.astroportSwapProvider = (0, factory_1.getSwapProvider)(this.config.network, types_1.SwapProviderType.Astroport);
|
|
23
|
+
this.bridgeAssetToAutomatedMarketMaker = {
|
|
24
|
+
MATIC: this.oneinchSwapProvider,
|
|
25
|
+
ETH: this.oneinchSwapProvider,
|
|
26
|
+
BNB: this.oneinchSwapProvider,
|
|
27
|
+
RBTC: this.sovrynSwapProvider,
|
|
28
|
+
AVAX: this.oneinchSwapProvider,
|
|
29
|
+
UST: this.astroportSwapProvider,
|
|
30
|
+
LUNA: this.astroportSwapProvider,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
else if (this.config.network === 'testnet') {
|
|
34
|
+
this.bridgeAssetToAutomatedMarketMaker = {
|
|
35
|
+
RBTC: this.sovrynSwapProvider,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
getSupportedPairs() {
|
|
40
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
return [];
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
getQuote({ network, from, to, amount }) {
|
|
45
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
if ((0, asset_1.isERC20)(from) || !(0, asset_1.isERC20)(to) || amount.lte(0)) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const bridgeAsset = (0, asset_1.getNativeAsset)(to);
|
|
50
|
+
if (!this.supportedBridgeAssets.includes(bridgeAsset)) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const quote = yield this.liqualitySwapProvider.getQuote({
|
|
54
|
+
network,
|
|
55
|
+
from,
|
|
56
|
+
to: bridgeAsset,
|
|
57
|
+
amount,
|
|
58
|
+
});
|
|
59
|
+
if (!quote) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const bridgeAssetQuantity = (0, cryptoassets_1.unitToCurrency)((0, cryptoassets_1.getAsset)(network, bridgeAsset), new bignumber_js_1.default(quote.toAmount));
|
|
63
|
+
const finalQuote = (yield this.bridgeAssetToAutomatedMarketMaker[bridgeAsset].getQuote({
|
|
64
|
+
network,
|
|
65
|
+
from: bridgeAsset,
|
|
66
|
+
to,
|
|
67
|
+
amount: bridgeAssetQuantity,
|
|
68
|
+
}));
|
|
69
|
+
if (!finalQuote) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
from,
|
|
74
|
+
to,
|
|
75
|
+
fromAmount: quote.fromAmount,
|
|
76
|
+
toAmount: finalQuote.toAmount,
|
|
77
|
+
min: quote.min,
|
|
78
|
+
max: quote.max,
|
|
79
|
+
bridgeAsset,
|
|
80
|
+
bridgeAssetAmount: quote.toAmount,
|
|
81
|
+
path: finalQuote.path,
|
|
82
|
+
fromTokenAddress: finalQuote.fromTokenAddress,
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
newSwap({ network, walletId, quote: _quote }) {
|
|
87
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const result = yield this.liqualitySwapProvider.newSwap({
|
|
89
|
+
network,
|
|
90
|
+
walletId,
|
|
91
|
+
quote: this.swapLiqualityFormat(_quote),
|
|
92
|
+
});
|
|
93
|
+
return Object.assign(Object.assign(Object.assign({}, result), _quote), { slippage: slippagePercentage * 100, bridgeAssetAmount: result.toAmount });
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
updateOrder(order) {
|
|
97
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
return yield this.liqualitySwapProvider.updateOrder(order);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
estimateFees({ network, walletId, asset, txType, quote, feePrices, max, }) {
|
|
102
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
const input = { network, walletId, asset, txType, quote, feePrices, max };
|
|
104
|
+
if (txType === this.fromTxType) {
|
|
105
|
+
const liqualityFees = yield this.liqualitySwapProvider.estimateFees(Object.assign(Object.assign({}, input), { txType: this.liqualitySwapProvider.fromTxType, quote: this.swapLiqualityFormat(quote) }));
|
|
106
|
+
return liqualityFees;
|
|
107
|
+
}
|
|
108
|
+
else if (txType === this.toTxType) {
|
|
109
|
+
const liqualityFees = yield this.liqualitySwapProvider.estimateFees(Object.assign(Object.assign({}, input), { asset: quote.bridgeAsset, txType: this.liqualitySwapProvider.toTxType, quote: this.swapLiqualityFormat(quote) }));
|
|
110
|
+
const automatedMarketMakerFees = yield this.bridgeAssetToAutomatedMarketMaker[quote.bridgeAsset].estimateFees(Object.assign(Object.assign({}, input), { asset: quote.bridgeAsset, txType: this.sovrynSwapProvider.fromTxType, quote: this.swapAutomatedMarketMakerFormat(quote) }));
|
|
111
|
+
const combinedFees = {};
|
|
112
|
+
for (const key in automatedMarketMakerFees) {
|
|
113
|
+
combinedFees[Number(key)] = new bignumber_js_1.default(automatedMarketMakerFees[Number(key)]).plus(liqualityFees[Number(key)]);
|
|
114
|
+
}
|
|
115
|
+
return combinedFees;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
getMin(quoteRequest) {
|
|
123
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
return yield this.liqualitySwapProvider.getMin(Object.assign(Object.assign({}, quoteRequest), { to: (0, asset_1.getNativeAsset)(quoteRequest.to) }));
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
finalizeLiqualitySwapAndStartAutomatedMarketMaker({ swapLSP, network, walletId }) {
|
|
128
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
const result = yield this.liqualitySwapProvider.waitForClaimConfirmations({
|
|
130
|
+
swap: swapLSP,
|
|
131
|
+
network: network,
|
|
132
|
+
walletId: walletId,
|
|
133
|
+
});
|
|
134
|
+
if ((result === null || result === void 0 ? void 0 : result.status) === 'SUCCESS') {
|
|
135
|
+
return { endTime: Date.now(), status: 'APPROVE_CONFIRMED' };
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
performNextSwapAction(store, { network, walletId, swap }) {
|
|
140
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
let updates;
|
|
142
|
+
if (swap.status === 'WAITING_FOR_CLAIM_CONFIRMATIONS') {
|
|
143
|
+
updates = yield (0, utils_1.withInterval)(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
return this.finalizeLiqualitySwapAndStartAutomatedMarketMaker({
|
|
145
|
+
swapLSP: this.swapLiqualityFormat(swap),
|
|
146
|
+
network,
|
|
147
|
+
walletId,
|
|
148
|
+
});
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
updates = yield this.liqualitySwapProvider.performNextSwapAction(store, {
|
|
153
|
+
network,
|
|
154
|
+
walletId,
|
|
155
|
+
swap: this.swapLiqualityFormat(swap),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (!updates) {
|
|
159
|
+
updates = yield this.bridgeAssetToAutomatedMarketMaker[swap.bridgeAsset].performNextSwapAction(store, {
|
|
160
|
+
network,
|
|
161
|
+
walletId,
|
|
162
|
+
swap: this.swapAutomatedMarketMakerFormat(swap),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return updates;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
_getStatuses() {
|
|
169
|
+
return Object.assign(Object.assign(Object.assign({}, this.liqualitySwapProvider.statuses), this.sovrynSwapProvider.statuses), { CONFIRM_COUNTER_PARTY_INITIATION: Object.assign(Object.assign({}, this.liqualitySwapProvider.statuses.CONFIRM_COUNTER_PARTY_INITIATION), { label: 'Locking {bridgeAsset}', notification(swap) {
|
|
170
|
+
return {
|
|
171
|
+
message: `Counterparty sent ${(0, coinFormatter_1.prettyBalance)(swap.bridgeAssetAmount, swap.bridgeAsset)} ${swap.bridgeAsset} to escrow`,
|
|
172
|
+
};
|
|
173
|
+
} }), READY_TO_CLAIM: Object.assign(Object.assign({}, this.liqualitySwapProvider.statuses.READY_TO_CLAIM), { label: 'Claiming {bridgeAsset}' }), WAITING_FOR_CLAIM_CONFIRMATIONS: Object.assign(Object.assign({}, this.liqualitySwapProvider.statuses.WAITING_FOR_CLAIM_CONFIRMATIONS), { label: 'Claiming {bridgeAsset}' }), APPROVE_CONFIRMED: Object.assign(Object.assign({}, this.sovrynSwapProvider.statuses.APPROVE_CONFIRMED), { step: 4, label: 'Swapping {bridgeAsset} for {to}' }), WAITING_FOR_SWAP_CONFIRMATIONS: Object.assign(Object.assign({}, this.sovrynSwapProvider.statuses.WAITING_FOR_SWAP_CONFIRMATIONS), { notification() {
|
|
174
|
+
return {
|
|
175
|
+
message: 'Engaging Automated Market Maker',
|
|
176
|
+
};
|
|
177
|
+
}, step: 4 }), SUCCESS: Object.assign(Object.assign({}, this.liqualitySwapProvider.statuses.SUCCESS), { step: 5 }), FAILED: Object.assign(Object.assign({}, this.sovrynSwapProvider.statuses.FAILED), { step: 5 }) });
|
|
178
|
+
}
|
|
179
|
+
_txTypes() {
|
|
180
|
+
return {
|
|
181
|
+
FROM_CHAIN: 'FROM_CHAIN',
|
|
182
|
+
TO_CHAIN: 'TO_CHAIN',
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
_fromTxType() {
|
|
186
|
+
return this._txTypes().FROM_CHAIN;
|
|
187
|
+
}
|
|
188
|
+
_toTxType() {
|
|
189
|
+
return this._txTypes().TO_CHAIN;
|
|
190
|
+
}
|
|
191
|
+
_timelineDiagramSteps() {
|
|
192
|
+
const ammTimeline = this.sovrynSwapProvider.timelineDiagramSteps;
|
|
193
|
+
if (ammTimeline[0] === 'APPROVE') {
|
|
194
|
+
ammTimeline.shift();
|
|
195
|
+
}
|
|
196
|
+
return this.liqualitySwapProvider.timelineDiagramSteps.concat(ammTimeline);
|
|
197
|
+
}
|
|
198
|
+
_totalSteps() {
|
|
199
|
+
let ammSteps = this.sovrynSwapProvider.totalSteps;
|
|
200
|
+
if (this.sovrynSwapProvider.timelineDiagramSteps[0] === 'APPROVE') {
|
|
201
|
+
ammSteps -= 1;
|
|
202
|
+
}
|
|
203
|
+
return this.liqualitySwapProvider.totalSteps + ammSteps;
|
|
204
|
+
}
|
|
205
|
+
swapLiqualityFormat(swap) {
|
|
206
|
+
return Object.assign(Object.assign({}, swap), { to: swap.bridgeAsset, toAmount: swap.bridgeAssetAmount, slippagePercentage });
|
|
207
|
+
}
|
|
208
|
+
swapAutomatedMarketMakerFormat(swap) {
|
|
209
|
+
return Object.assign(Object.assign({}, swap), { from: swap.bridgeAsset, fromAmount: swap.bridgeAssetAmount, fromAccountId: swap.toAccountId, slippagePercentage, fee: swap.claimFee });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
exports.LiqualityBoostNativeToERC20 = LiqualityBoostNativeToERC20;
|
|
213
|
+
//# sourceMappingURL=LiqualityBoostNativeToERC20.js.map
|
package/dist/src/swaps/liqualityboost/liqualityBoostNativeToERC20/LiqualityBoostNativeToERC20.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiqualityBoostNativeToERC20.js","sourceRoot":"","sources":["../../../../../src/swaps/liqualityboost/liqualityBoostNativeTo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ial way to swap across blockchains. Swap any native asset to hundreds of erc20 tokens ",
|
|
4
|
+
"pros": ["Cross-chain", "Secure", "Native assets to erc20 tokens"],
|
|
5
|
+
"cons": ["Low liquidity", "Few pairs"],
|
|
6
|
+
"fees": ["0.5 - 1.0%", "up to 3% slippage", "$50 - $100 minimum trade size"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EvmTypes } from '@yaswap/evm';
|
|
2
|
+
import { Transaction } from '@yaswap/types';
|
|
3
|
+
import { Asset, SwapHistoryItem } from '../../store/types';
|
|
4
|
+
import { LiqualitySwapHistoryItem } from '../liquality/LiqualitySwapProvider';
|
|
5
|
+
import { NextSwapActionRequest } from '../types';
|
|
6
|
+
export interface BoostHistoryItem extends LiqualitySwapHistoryItem {
|
|
7
|
+
approveTxHash: string;
|
|
8
|
+
swapTxHash: string;
|
|
9
|
+
approveTx: Transaction<EvmTypes.EthersTransactionResponse>;
|
|
10
|
+
swapTx: Transaction<EvmTypes.EthersTransactionResponse>;
|
|
11
|
+
bridgeAsset: Asset;
|
|
12
|
+
bridgeAssetAmount: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BoostNextSwapActionRequest extends Partial<NextSwapActionRequest> {
|
|
15
|
+
swapLSP: LiqualitySwapHistoryItem;
|
|
16
|
+
swapAMM?: SwapHistoryItem;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/swaps/liqualityboost/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Client } from '@yaswap/client';
|
|
2
|
+
import { EvmChainProvider, EvmTypes } from '@yaswap/evm';
|
|
3
|
+
import { Transaction } from '@yaswap/types';
|
|
4
|
+
import { ChainId } from '@yaswap/cryptoassets';
|
|
5
|
+
import BN from 'bignumber.js';
|
|
6
|
+
import { ActionContext } from '../../store';
|
|
7
|
+
import { Network, SwapHistoryItem } from '../../store/types';
|
|
8
|
+
import { SwapProvider } from '../SwapProvider';
|
|
9
|
+
import { BaseSwapProviderConfig, EstimateFeeRequest, EstimateFeeResponse, NextSwapActionRequest, QuoteRequest, SwapRequest, SwapStatus } from '../types';
|
|
10
|
+
export interface OneinchSwapHistoryItem extends SwapHistoryItem {
|
|
11
|
+
approveTxHash: string;
|
|
12
|
+
swapTxHash: string;
|
|
13
|
+
approveTx: Transaction<EvmTypes.EthersTransactionResponse>;
|
|
14
|
+
swapTx: Transaction<EvmTypes.EthersTransactionResponse>;
|
|
15
|
+
slippagePercentage: number;
|
|
16
|
+
}
|
|
17
|
+
export interface OneinchSwapProviderConfig extends BaseSwapProviderConfig {
|
|
18
|
+
agent: string;
|
|
19
|
+
routerAddress: string;
|
|
20
|
+
referrerAddress: {
|
|
21
|
+
[key in ChainId]?: string;
|
|
22
|
+
};
|
|
23
|
+
referrerFee: number;
|
|
24
|
+
}
|
|
25
|
+
declare class OneinchSwapProvider extends SwapProvider {
|
|
26
|
+
config: OneinchSwapProviderConfig;
|
|
27
|
+
private _httpClient;
|
|
28
|
+
constructor(config: OneinchSwapProviderConfig);
|
|
29
|
+
getSupportedPairs(): Promise<never[]>;
|
|
30
|
+
getClient(network: Network, walletId: string, asset: string, accountId: string): Client<EvmChainProvider, import("@yaswap/client").Wallet<any, any>, import("@yaswap/client").Swap<any, any, import("@yaswap/client").Wallet<any, any>>, import("@yaswap/client").Nft<any, any>>;
|
|
31
|
+
getQuote({ network, from, to, amount }: QuoteRequest): Promise<{
|
|
32
|
+
fromAmount: string;
|
|
33
|
+
toAmount: string;
|
|
34
|
+
} | null>;
|
|
35
|
+
approveTokens({ network, walletId, quote }: SwapRequest<OneinchSwapHistoryItem>): Promise<{
|
|
36
|
+
status: string;
|
|
37
|
+
approveTx: Transaction<any>;
|
|
38
|
+
approveTxHash: string;
|
|
39
|
+
}>;
|
|
40
|
+
sendSwap({ network, walletId, quote }: SwapRequest<OneinchSwapHistoryItem>): Promise<{
|
|
41
|
+
status: string;
|
|
42
|
+
swapTx: Transaction<any>;
|
|
43
|
+
swapTxHash: string;
|
|
44
|
+
}>;
|
|
45
|
+
newSwap({ network, walletId, quote }: SwapRequest<OneinchSwapHistoryItem>): Promise<{
|
|
46
|
+
status: string;
|
|
47
|
+
approveTx: Transaction<any>;
|
|
48
|
+
approveTxHash: string;
|
|
49
|
+
id: string;
|
|
50
|
+
fee: number;
|
|
51
|
+
slippage: number;
|
|
52
|
+
} | {
|
|
53
|
+
status: string;
|
|
54
|
+
swapTx: Transaction<any>;
|
|
55
|
+
swapTxHash: string;
|
|
56
|
+
id: string;
|
|
57
|
+
fee: number;
|
|
58
|
+
slippage: number;
|
|
59
|
+
}>;
|
|
60
|
+
estimateFees({ network, txType, quote, feePrices, feePricesL1, }: EstimateFeeRequest<string, OneinchSwapHistoryItem>): Promise<EstimateFeeResponse | null>;
|
|
61
|
+
getMin(_quoteRequest: QuoteRequest): Promise<BN>;
|
|
62
|
+
private _getQuote;
|
|
63
|
+
private _buildApproval;
|
|
64
|
+
private _buildSwap;
|
|
65
|
+
waitForApproveConfirmations({ swap, network, walletId }: NextSwapActionRequest<OneinchSwapHistoryItem>): Promise<{
|
|
66
|
+
endTime: number;
|
|
67
|
+
status: string;
|
|
68
|
+
} | undefined>;
|
|
69
|
+
waitForSwapConfirmations({ swap, network, walletId }: NextSwapActionRequest<OneinchSwapHistoryItem>): Promise<{
|
|
70
|
+
endTime: number;
|
|
71
|
+
status: string;
|
|
72
|
+
} | undefined>;
|
|
73
|
+
performNextSwapAction(store: ActionContext, { network, walletId, swap }: NextSwapActionRequest<OneinchSwapHistoryItem>): Promise<Partial<{
|
|
74
|
+
endTime: number;
|
|
75
|
+
status: string;
|
|
76
|
+
}> | undefined>;
|
|
77
|
+
protected _getStatuses(): Record<string, SwapStatus>;
|
|
78
|
+
protected _txTypes(): {
|
|
79
|
+
SWAP: string;
|
|
80
|
+
};
|
|
81
|
+
protected _fromTxType(): string | null;
|
|
82
|
+
protected _toTxType(): string | null;
|
|
83
|
+
protected _timelineDiagramSteps(): string[];
|
|
84
|
+
protected _totalSteps(): number;
|
|
85
|
+
}
|
|
86
|
+
export { OneinchSwapProvider };
|