@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,553 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeBridgeSwapProvider = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
6
|
+
const bignumber_js_1 = tslib_1.__importStar(require("bignumber.js"));
|
|
7
|
+
const SwapProvider_1 = require("../SwapProvider");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
const cryptoassets_1 = require("@yaswap/cryptoassets");
|
|
10
|
+
const utils_1 = require("../../store/actions/performNextAction/utils");
|
|
11
|
+
const coinFormatter_1 = require("../../utils/coinFormatter");
|
|
12
|
+
const ethers = tslib_1.__importStar(require("ethers"));
|
|
13
|
+
const ERC20_json_1 = tslib_1.__importDefault(require("@uniswap/v2-core/build/ERC20.json"));
|
|
14
|
+
const SignatureVerifier_json_1 = tslib_1.__importDefault(require("./abi/SignatureVerifier.json"));
|
|
15
|
+
const DeBridgeGate_json_1 = tslib_1.__importDefault(require("./abi/DeBridgeGate.json"));
|
|
16
|
+
const cryptoassets_2 = tslib_1.__importDefault(require("../../utils/cryptoassets"));
|
|
17
|
+
const asset_1 = require("../../utils/asset");
|
|
18
|
+
const error_parser_1 = require("@yaswap/error-parser");
|
|
19
|
+
const error_parser_2 = require("@yaswap/error-parser");
|
|
20
|
+
const isTransactionNotFoundError_1 = require("../../utils/isTransactionNotFoundError");
|
|
21
|
+
const zeroAddress = '0x0000000000000000000000000000000000000000';
|
|
22
|
+
const slippagePercentage = 3;
|
|
23
|
+
const slippageBps = slippagePercentage * 100;
|
|
24
|
+
const chainIds = [1, 56, 137, 42161, 43114];
|
|
25
|
+
class DeBridgeSwapProvider extends SwapProvider_1.SwapProvider {
|
|
26
|
+
constructor(config) {
|
|
27
|
+
super(config);
|
|
28
|
+
this.debridgeApiErrorParser = (0, error_parser_1.getErrorParser)(error_parser_2.DebridgeAPIErrorParser);
|
|
29
|
+
}
|
|
30
|
+
getQuote({ network, from, to, amount }) {
|
|
31
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
if (!(0, asset_1.isChainEvmCompatible)(from, network) || !(0, asset_1.isChainEvmCompatible)(to, network) || new bignumber_js_1.BigNumber(amount).lte(0)) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const chainIdFrom = (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[from].chain).network.chainId;
|
|
36
|
+
const chainIdTo = (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[to].chain).network.chainId;
|
|
37
|
+
if (chainIdTo === chainIdFrom) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
if (!chainIds.includes(chainIdFrom) || !chainIds.includes(chainIdTo)) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const fromAmountInUnit = new bignumber_js_1.default((0, cryptoassets_1.currencyToUnit)(cryptoassets_2.default[from], new bignumber_js_1.default(amount)));
|
|
44
|
+
try {
|
|
45
|
+
const fromToken = cryptoassets_2.default[from].contractAddress || zeroAddress;
|
|
46
|
+
const toToken = cryptoassets_2.default[to].contractAddress || zeroAddress;
|
|
47
|
+
const trade = (yield this.debridgeApiErrorParser.wrapAsync(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return yield (0, axios_1.default)({
|
|
49
|
+
url: this.config.url + 'estimation',
|
|
50
|
+
method: 'get',
|
|
51
|
+
params: {
|
|
52
|
+
srcChainId: chainIdFrom,
|
|
53
|
+
srcChainTokenIn: fromToken,
|
|
54
|
+
srcChainTokenInAmount: fromAmountInUnit.toFixed(),
|
|
55
|
+
slippage: slippagePercentage,
|
|
56
|
+
dstChainId: chainIdTo,
|
|
57
|
+
dstChainTokenOut: toToken,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}), null));
|
|
61
|
+
return {
|
|
62
|
+
from,
|
|
63
|
+
to,
|
|
64
|
+
fromAmount: fromAmountInUnit.toFixed(),
|
|
65
|
+
toAmount: (0, bignumber_js_1.default)(trade.data.estimation.dstChainTokenOut.amount).toFixed(),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
estimateFees({ network, walletId, asset, quote, feePrices }) {
|
|
74
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
try {
|
|
76
|
+
const nativeAsset = (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[asset].chain).nativeAsset;
|
|
77
|
+
const client = this.getClient(network, walletId, quote.from, quote.fromAccountId);
|
|
78
|
+
let gasLimit = 0;
|
|
79
|
+
if (yield this.requiresApproval({ network, walletId, quote })) {
|
|
80
|
+
const approvalTx = yield this.buildApprovalTx({
|
|
81
|
+
network,
|
|
82
|
+
walletId,
|
|
83
|
+
quote,
|
|
84
|
+
});
|
|
85
|
+
const rawApprovalTx = {
|
|
86
|
+
from: approvalTx.from,
|
|
87
|
+
to: approvalTx.to,
|
|
88
|
+
data: approvalTx.data,
|
|
89
|
+
value: '0x' + approvalTx.value.toString(16),
|
|
90
|
+
};
|
|
91
|
+
gasLimit += (yield client.chain.getProvider().estimateGas(rawApprovalTx)).toNumber();
|
|
92
|
+
}
|
|
93
|
+
const swapTx = yield this.loadSwapTx({ network, walletId, quote });
|
|
94
|
+
const toChain = cryptoassets_2.default[quote.to].chain;
|
|
95
|
+
const fromChain = cryptoassets_2.default[quote.from].chain;
|
|
96
|
+
if (toChain === fromChain)
|
|
97
|
+
return null;
|
|
98
|
+
const fromAddressRaw = yield this.getSwapAddress(network, walletId, quote.from, quote.fromAccountId);
|
|
99
|
+
const fromAddress = (0, cryptoassets_1.getChain)(network, toChain).formatAddress(fromAddressRaw);
|
|
100
|
+
const rawSwapTx = {
|
|
101
|
+
from: fromAddress,
|
|
102
|
+
to: swapTx.to,
|
|
103
|
+
value: '0x' + Number(swapTx.value).toString(16),
|
|
104
|
+
data: swapTx.data,
|
|
105
|
+
};
|
|
106
|
+
try {
|
|
107
|
+
gasLimit += (yield client.chain.getProvider().estimateGas(rawSwapTx)).toNumber();
|
|
108
|
+
}
|
|
109
|
+
catch (e) {
|
|
110
|
+
const estimateGas = yield this.getGasLimit(network, quote.from, cryptoassets_2.default[quote.from].contractAddress || zeroAddress);
|
|
111
|
+
gasLimit += estimateGas;
|
|
112
|
+
}
|
|
113
|
+
let globalFee = (0, bignumber_js_1.default)(0);
|
|
114
|
+
const fromToken = cryptoassets_2.default[quote.from].contractAddress || zeroAddress;
|
|
115
|
+
if (fromToken === zeroAddress) {
|
|
116
|
+
const provider = client.chain.getProvider();
|
|
117
|
+
const chainIdFrom = (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[quote.from].chain).network.chainId;
|
|
118
|
+
const debridgeGate = new ethers.Contract(this.config.chains[chainIdFrom].deBridgeGateAddress, DeBridgeGate_json_1.default.abi, provider);
|
|
119
|
+
globalFee = (yield debridgeGate.globalFixedNativeFee()) || 0;
|
|
120
|
+
}
|
|
121
|
+
const fees = {};
|
|
122
|
+
for (const feePrice of feePrices) {
|
|
123
|
+
const gasPrice = (0, bignumber_js_1.default)(feePrice).times(1e9);
|
|
124
|
+
const fee = (0, bignumber_js_1.default)(gasLimit).times(1.3).times(gasPrice).plus(globalFee.toString());
|
|
125
|
+
fees[feePrice] = (0, cryptoassets_1.unitToCurrency)(cryptoassets_2.default[nativeAsset[0].code], fee);
|
|
126
|
+
}
|
|
127
|
+
return fees;
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
console.warn(e);
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
newSwap({ network, walletId, quote }) {
|
|
136
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
const approvalRequired = (0, asset_1.isERC20)(quote.from);
|
|
138
|
+
const updates = approvalRequired
|
|
139
|
+
? yield this.approveTokens({ network, walletId, quote })
|
|
140
|
+
: yield this.sendSwap({ network, walletId, quote });
|
|
141
|
+
return Object.assign({ id: (0, uuid_1.v4)(), fee: quote.fee, slippage: slippageBps }, updates);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
performNextSwapAction(store, { network, walletId, swap }) {
|
|
145
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
let updates;
|
|
147
|
+
switch (swap.status) {
|
|
148
|
+
case 'WAITING_FOR_APPROVE_CONFIRMATIONS':
|
|
149
|
+
updates = yield (0, utils_1.withInterval)(() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.waitForApproveConfirmations({ swap, network, walletId }); }));
|
|
150
|
+
break;
|
|
151
|
+
case 'APPROVE_CONFIRMED':
|
|
152
|
+
updates = yield (0, utils_1.withLock)(store, { item: swap, network, walletId, asset: swap.from }, () => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.sendSwap({ quote: swap, network, walletId }); }));
|
|
153
|
+
break;
|
|
154
|
+
case 'WAITING_FOR_SEND_SWAP_CONFIRMATIONS':
|
|
155
|
+
updates = yield (0, utils_1.withInterval)(() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.waitForSwapConfirmations({ swap, network, walletId }); }));
|
|
156
|
+
break;
|
|
157
|
+
case 'WAITING_FOR_RECEIVE_SWAP_CONFIRMATIONS':
|
|
158
|
+
updates = yield (0, utils_1.withInterval)(() => tslib_1.__awaiter(this, void 0, void 0, function* () { return this.waitForSwapExecution({ swap, network, walletId }); }));
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
return updates;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
waitForSwapConfirmations({ swap, network, walletId }) {
|
|
165
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
const client = this.getClient(network, walletId, swap.from, swap.fromAccountId);
|
|
167
|
+
try {
|
|
168
|
+
const tx = yield client.chain.getTransactionByHash(swap.fromFundHash);
|
|
169
|
+
const chainIdFrom = (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[swap.from].chain).network.chainId;
|
|
170
|
+
if (chainIdFrom &&
|
|
171
|
+
tx &&
|
|
172
|
+
tx.confirmations &&
|
|
173
|
+
tx.confirmations > this.config.chains[chainIdFrom].minBlockConfirmation) {
|
|
174
|
+
const { status } = yield client.chain.getProvider().getTransactionReceipt(swap.fromFundHash);
|
|
175
|
+
this.updateBalances(network, walletId, [swap.fromAccountId]);
|
|
176
|
+
if (Number(status) === 1) {
|
|
177
|
+
const provider = client.chain.getProvider();
|
|
178
|
+
const signatureVerifier = new ethers.Contract(this.config.chains[chainIdFrom].signatureVerifier, SignatureVerifier_json_1.default.abi, provider);
|
|
179
|
+
const minConfirmations = yield signatureVerifier.minConfirmations();
|
|
180
|
+
const count = yield this.getConfirmationsCount(swap.fromFundHash);
|
|
181
|
+
if (count >= minConfirmations) {
|
|
182
|
+
return {
|
|
183
|
+
endTime: Date.now(),
|
|
184
|
+
status: 'WAITING_FOR_RECEIVE_SWAP_CONFIRMATIONS',
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
return {
|
|
190
|
+
endTime: Date.now(),
|
|
191
|
+
status: 'FAILED',
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
catch (e) {
|
|
197
|
+
if ((0, isTransactionNotFoundError_1.isTransactionNotFoundError)(e))
|
|
198
|
+
console.warn(e);
|
|
199
|
+
else
|
|
200
|
+
throw e;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
getConfirmationsCount(swapTxHash) {
|
|
205
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
try {
|
|
207
|
+
const submissionId = yield this.getSubmissionId(swapTxHash);
|
|
208
|
+
if (submissionId) {
|
|
209
|
+
const result = yield (0, axios_1.default)({
|
|
210
|
+
url: this.config.api + 'SubmissionConfirmations/getForSubmission',
|
|
211
|
+
method: 'get',
|
|
212
|
+
params: {
|
|
213
|
+
submissionId: submissionId,
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
if (Array.isArray(result === null || result === void 0 ? void 0 : result.data)) {
|
|
217
|
+
return result.data.length;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
catch (e) {
|
|
222
|
+
console.warn(e);
|
|
223
|
+
}
|
|
224
|
+
return 0;
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
getSupportedPairs() {
|
|
228
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
229
|
+
return [];
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
getMin(_quoteRequest) {
|
|
233
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
return new bignumber_js_1.default(0);
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
getClient(network, walletId, asset, accountId) {
|
|
238
|
+
return super.getClient(network, walletId, asset, accountId);
|
|
239
|
+
}
|
|
240
|
+
buildApprovalTx({ network, walletId, quote }) {
|
|
241
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
242
|
+
const client = this.getClient(network, walletId, quote.from, quote.fromAccountId);
|
|
243
|
+
const provider = client.chain.getProvider();
|
|
244
|
+
cryptoassets_2.default[quote.from].contractAddress;
|
|
245
|
+
const erc20 = new ethers.Contract(cryptoassets_2.default[quote.from].contractAddress, ERC20_json_1.default.abi, provider);
|
|
246
|
+
const inputAmount = ethers.BigNumber.from((0, bignumber_js_1.default)(quote.fromAmount).toFixed());
|
|
247
|
+
const inputAmountHex = inputAmount.toHexString();
|
|
248
|
+
const encodedData = erc20.interface.encodeFunctionData('approve', [this.config.routerAddress, inputAmountHex]);
|
|
249
|
+
const fromChain = cryptoassets_2.default[quote.from].chain;
|
|
250
|
+
const fromAddressRaw = yield this.getSwapAddress(network, walletId, quote.from, quote.fromAccountId);
|
|
251
|
+
const fromAddress = (0, cryptoassets_1.getChain)(network, fromChain).formatAddress(fromAddressRaw);
|
|
252
|
+
return {
|
|
253
|
+
from: fromAddress,
|
|
254
|
+
to: cryptoassets_2.default[quote.from].contractAddress,
|
|
255
|
+
value: new bignumber_js_1.BigNumber(0).toFixed(),
|
|
256
|
+
data: encodedData,
|
|
257
|
+
fee: quote.fee,
|
|
258
|
+
};
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
requiresApproval({ network, walletId, quote }) {
|
|
262
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
if (!(0, asset_1.isERC20)(quote.from))
|
|
264
|
+
return false;
|
|
265
|
+
const fromChain = cryptoassets_2.default[quote.from].chain;
|
|
266
|
+
const client = this.getClient(network, walletId, quote.from, quote.fromAccountId);
|
|
267
|
+
const provider = client.chain.getProvider();
|
|
268
|
+
const erc20 = new ethers.Contract(cryptoassets_2.default[quote.from].contractAddress, ERC20_json_1.default.abi, provider);
|
|
269
|
+
const fromAddressRaw = yield this.getSwapAddress(network, walletId, quote.from, quote.fromAccountId);
|
|
270
|
+
const fromAddress = (0, cryptoassets_1.getChain)(network, fromChain).formatAddress(fromAddressRaw);
|
|
271
|
+
const allowance = yield erc20.allowance(fromAddress, this.config.routerAddress);
|
|
272
|
+
const inputAmount = ethers.BigNumber.from((0, bignumber_js_1.default)(quote.fromAmount).toFixed());
|
|
273
|
+
return !allowance.gte(inputAmount);
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
approveTokens({ network, walletId, quote }) {
|
|
277
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
if (!(yield this.requiresApproval({ network, walletId, quote }))) {
|
|
279
|
+
return {
|
|
280
|
+
status: 'APPROVE_CONFIRMED',
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
const txData = yield this.buildApprovalTx({ network, walletId, quote });
|
|
284
|
+
const client = this.getClient(network, walletId, quote.from, quote.fromAccountId);
|
|
285
|
+
const approveTx = yield client.wallet.sendTransaction(txData);
|
|
286
|
+
return {
|
|
287
|
+
status: 'WAITING_FOR_APPROVE_CONFIRMATIONS',
|
|
288
|
+
approveTx,
|
|
289
|
+
approveTxHash: approveTx.hash,
|
|
290
|
+
};
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
loadSwapTx({ network, walletId, quote }) {
|
|
294
|
+
var _a, _b;
|
|
295
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
296
|
+
const toChain = cryptoassets_2.default[quote.to].chain;
|
|
297
|
+
const fromChain = cryptoassets_2.default[quote.from].chain;
|
|
298
|
+
if (toChain === fromChain)
|
|
299
|
+
return null;
|
|
300
|
+
const toAddress = yield this.getSwapAddress(network, walletId, quote.to, quote.toAccountId);
|
|
301
|
+
const chainIdFrom = (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[quote.from].chain).network.chainId;
|
|
302
|
+
const chainIdTo = (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[quote.to].chain).network.chainId;
|
|
303
|
+
const fromToken = cryptoassets_2.default[quote.from].contractAddress || zeroAddress;
|
|
304
|
+
const toToken = cryptoassets_2.default[quote.to].contractAddress || zeroAddress;
|
|
305
|
+
const result = (yield this.debridgeApiErrorParser.wrapAsync(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
306
|
+
return yield (0, axios_1.default)({
|
|
307
|
+
url: this.config.url + 'transaction',
|
|
308
|
+
method: 'get',
|
|
309
|
+
params: {
|
|
310
|
+
srcChainId: chainIdFrom,
|
|
311
|
+
srcChainTokenIn: fromToken,
|
|
312
|
+
srcChainTokenInAmount: quote.fromAmount,
|
|
313
|
+
slippage: slippagePercentage,
|
|
314
|
+
dstChainId: chainIdTo,
|
|
315
|
+
dstChainTokenOut: toToken,
|
|
316
|
+
dstChainTokenOutRecipient: toAddress,
|
|
317
|
+
dstChainFallbackAddress: toAddress,
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
}), null));
|
|
321
|
+
if ((_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.tx) {
|
|
322
|
+
const estimation = (_b = result === null || result === void 0 ? void 0 : result.data) === null || _b === void 0 ? void 0 : _b.estimation;
|
|
323
|
+
const txInfo = Object.assign(Object.assign({}, result.data.tx), { amount: estimation === null || estimation === void 0 ? void 0 : estimation.dstChainTokenOut.amount });
|
|
324
|
+
if ((estimation === null || estimation === void 0 ? void 0 : estimation.srcChainTokenIn) && (estimation === null || estimation === void 0 ? void 0 : estimation.srcChainTokenOut)) {
|
|
325
|
+
txInfo.preSwap = {
|
|
326
|
+
toAddress: estimation === null || estimation === void 0 ? void 0 : estimation.srcChainTokenOut.address,
|
|
327
|
+
fromAddress: estimation === null || estimation === void 0 ? void 0 : estimation.srcChainTokenIn.address,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
return txInfo;
|
|
331
|
+
}
|
|
332
|
+
return null;
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
sendSwap({ network, walletId, quote }) {
|
|
336
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
337
|
+
const client = this.getClient(network, walletId, quote.from, quote.fromAccountId);
|
|
338
|
+
const trade = yield this.loadSwapTx({ network, walletId, quote });
|
|
339
|
+
if ((0, bignumber_js_1.default)(quote.toAmount)
|
|
340
|
+
.times(1 - slippagePercentage / 100)
|
|
341
|
+
.gt(trade.amount)) {
|
|
342
|
+
throw new error_parser_1.SlippageTooHighError({
|
|
343
|
+
expectedAmount: quote.toAmount,
|
|
344
|
+
actualAmount: trade.amount,
|
|
345
|
+
currency: quote.to,
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
yield this.sendLedgerNotification(quote.fromAccountId, 'Signing required to complete the swap.');
|
|
349
|
+
try {
|
|
350
|
+
const fromFundTx = yield client.wallet.sendTransaction({
|
|
351
|
+
to: trade.to,
|
|
352
|
+
value: trade.value,
|
|
353
|
+
data: trade.data,
|
|
354
|
+
fee: quote.fee,
|
|
355
|
+
});
|
|
356
|
+
return {
|
|
357
|
+
status: 'WAITING_FOR_SEND_SWAP_CONFIRMATIONS',
|
|
358
|
+
fromFundTx,
|
|
359
|
+
fromFundHash: fromFundTx.hash,
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
catch (e) {
|
|
363
|
+
console.warn(e);
|
|
364
|
+
if (e.reason) {
|
|
365
|
+
throw new Error(e.reason);
|
|
366
|
+
}
|
|
367
|
+
throw e;
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
waitForApproveConfirmations({ swap, network, walletId, }) {
|
|
372
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
373
|
+
const client = this.getClient(network, walletId, swap.from, swap.fromAccountId);
|
|
374
|
+
try {
|
|
375
|
+
const tx = yield client.chain.getTransactionByHash(swap.approveTxHash);
|
|
376
|
+
if (tx && tx.confirmations && tx.confirmations > 0) {
|
|
377
|
+
return {
|
|
378
|
+
endTime: Date.now(),
|
|
379
|
+
status: 'APPROVE_CONFIRMED',
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
catch (e) {
|
|
384
|
+
if ((0, isTransactionNotFoundError_1.isTransactionNotFoundError)(e))
|
|
385
|
+
console.warn(e);
|
|
386
|
+
else
|
|
387
|
+
throw e;
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
waitForSwapExecution({ swap, network, walletId }) {
|
|
392
|
+
var _a;
|
|
393
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
394
|
+
try {
|
|
395
|
+
const submissionInfo = yield this.getFullSubmissionInfo(swap.fromFundHash);
|
|
396
|
+
if (((_a = submissionInfo === null || submissionInfo === void 0 ? void 0 : submissionInfo.send) === null || _a === void 0 ? void 0 : _a.isExecuted) && (submissionInfo === null || submissionInfo === void 0 ? void 0 : submissionInfo.claim)) {
|
|
397
|
+
const client = this.getClient(network, walletId, swap.to, swap.toAccountId);
|
|
398
|
+
const tx = yield client.chain.getTransactionByHash(submissionInfo === null || submissionInfo === void 0 ? void 0 : submissionInfo.claim.transactionHash);
|
|
399
|
+
this.updateBalances(network, walletId, [swap.fromAccountId]);
|
|
400
|
+
return {
|
|
401
|
+
receiveTxHash: tx.hash,
|
|
402
|
+
receiveTx: tx,
|
|
403
|
+
endTime: Date.now(),
|
|
404
|
+
status: tx.status,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
catch (e) {
|
|
409
|
+
if ((0, isTransactionNotFoundError_1.isTransactionNotFoundError)(e))
|
|
410
|
+
console.warn(e);
|
|
411
|
+
else
|
|
412
|
+
throw e;
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
getFullSubmissionInfo(swapTxHash) {
|
|
417
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
418
|
+
try {
|
|
419
|
+
const result = yield (0, axios_1.default)({
|
|
420
|
+
url: this.config.api + 'Transactions/GetFullSubmissionInfo',
|
|
421
|
+
method: 'get',
|
|
422
|
+
params: {
|
|
423
|
+
filter: swapTxHash,
|
|
424
|
+
filterType: 1,
|
|
425
|
+
},
|
|
426
|
+
});
|
|
427
|
+
return (result === null || result === void 0 ? void 0 : result.data) || null;
|
|
428
|
+
}
|
|
429
|
+
catch (e) {
|
|
430
|
+
console.warn(e);
|
|
431
|
+
return null;
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
getSubmissionId(swapTxHash) {
|
|
436
|
+
var _a, _b;
|
|
437
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
438
|
+
try {
|
|
439
|
+
const result = yield (0, axios_1.default)({
|
|
440
|
+
url: this.config.api + 'Transactions/GetFullSubmissionInfo',
|
|
441
|
+
method: 'get',
|
|
442
|
+
params: {
|
|
443
|
+
filter: swapTxHash,
|
|
444
|
+
filterType: 1,
|
|
445
|
+
},
|
|
446
|
+
});
|
|
447
|
+
return ((_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.send) === null || _b === void 0 ? void 0 : _b.submissionId) || null;
|
|
448
|
+
}
|
|
449
|
+
catch (e) {
|
|
450
|
+
console.warn(e);
|
|
451
|
+
return null;
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
_txTypes() {
|
|
456
|
+
return {
|
|
457
|
+
SWAP: 'SWAP',
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
_fromTxType() {
|
|
461
|
+
return this._txTypes().SWAP;
|
|
462
|
+
}
|
|
463
|
+
_toTxType() {
|
|
464
|
+
return null;
|
|
465
|
+
}
|
|
466
|
+
_totalSteps() {
|
|
467
|
+
return 4;
|
|
468
|
+
}
|
|
469
|
+
_timelineDiagramSteps() {
|
|
470
|
+
return ['APPROVE', 'INITIATION', 'RECEIVE'];
|
|
471
|
+
}
|
|
472
|
+
_getStatuses() {
|
|
473
|
+
return {
|
|
474
|
+
WAITING_FOR_APPROVE_CONFIRMATIONS: {
|
|
475
|
+
step: 0,
|
|
476
|
+
label: 'Approving {from} http',
|
|
477
|
+
filterStatus: 'PENDING',
|
|
478
|
+
notification(swap) {
|
|
479
|
+
return {
|
|
480
|
+
message: `Approving ${swap.from}`,
|
|
481
|
+
};
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
APPROVE_CONFIRMED: {
|
|
485
|
+
step: 1,
|
|
486
|
+
label: 'Swapping {from}',
|
|
487
|
+
filterStatus: 'PENDING',
|
|
488
|
+
},
|
|
489
|
+
WAITING_FOR_SEND_SWAP_CONFIRMATIONS: {
|
|
490
|
+
step: 1,
|
|
491
|
+
label: 'Swapping {from}',
|
|
492
|
+
filterStatus: 'PENDING',
|
|
493
|
+
notification() {
|
|
494
|
+
return {
|
|
495
|
+
message: 'Engaging deBridge',
|
|
496
|
+
};
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
WAITING_FOR_RECEIVE_SWAP_CONFIRMATIONS: {
|
|
500
|
+
step: 2,
|
|
501
|
+
label: 'Swapping {to}',
|
|
502
|
+
filterStatus: 'PENDING',
|
|
503
|
+
notification() {
|
|
504
|
+
return {
|
|
505
|
+
message: 'Awaiting Execution',
|
|
506
|
+
};
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
SUCCESS: {
|
|
510
|
+
step: 3,
|
|
511
|
+
label: 'Completed',
|
|
512
|
+
filterStatus: 'COMPLETED',
|
|
513
|
+
notification(swap) {
|
|
514
|
+
return {
|
|
515
|
+
message: `Swap completed, ${(0, coinFormatter_1.prettyBalance)(swap.toAmount, swap.to)} ${swap.to} ready to use`,
|
|
516
|
+
};
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
FAILED: {
|
|
520
|
+
step: 3,
|
|
521
|
+
label: 'Swap Failed',
|
|
522
|
+
filterStatus: 'REFUNDED',
|
|
523
|
+
notification() {
|
|
524
|
+
return {
|
|
525
|
+
message: 'Swap failed',
|
|
526
|
+
};
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
getGasLimit(network, from, toAddress) {
|
|
532
|
+
var _a;
|
|
533
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
534
|
+
const chainIdFrom = (0, cryptoassets_1.getChain)(network, cryptoassets_2.default[from].chain).network.chainId;
|
|
535
|
+
try {
|
|
536
|
+
const result = yield (0, axios_1.default)({
|
|
537
|
+
url: this.config.url + 'srcTxOptimisticGasConsumption',
|
|
538
|
+
method: 'get',
|
|
539
|
+
params: {
|
|
540
|
+
srcChainId: chainIdFrom,
|
|
541
|
+
srcChainTokenIn: toAddress,
|
|
542
|
+
},
|
|
543
|
+
});
|
|
544
|
+
return ((_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.srcTxOptimisticGasConsumption) || 0;
|
|
545
|
+
}
|
|
546
|
+
catch (e) {
|
|
547
|
+
return 0;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
exports.DeBridgeSwapProvider = DeBridgeSwapProvider;
|
|
553
|
+
//# sourceMappingURL=DeBridgeSwapProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeBridgeSwapProvider.js","sourceRoot":"","sources":["../../../../src/swaps/debridge/DeBridgeSwapProvider.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAC1B,qEAA6C;AAC7C,kDAA+C;AAC/C,+BAAoC;AACpC,uDAAgF;AAChF,uEAAqF;AACrF,6DAA0D;AAC1D,uDAAiC;AACjC,2FAAsD;AACtD,kGAA6D;AAC7D,wFAAmD;AAUnD,oFAAoD;AAEpD,6CAAkE;AAKlE,uDAA4E;AAC5E,uDA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