0xtrails 0.15.1 → 0.16.1
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/README.md +63 -434
- package/dist/actions/actionBuilder.d.ts +10 -0
- package/dist/actions/actionBuilder.d.ts.map +1 -1
- package/dist/actions/actionBuilder.js +92 -80
- package/dist/actions/constants.d.ts +9 -53
- package/dist/actions/constants.d.ts.map +1 -1
- package/dist/actions/constants.js +10 -11
- package/dist/actions/custom-integrations/sushiswapV3/sushiswapV3.js +11 -11
- package/dist/actions/custom-integrations/uniswapV3/uniswapV3.js +11 -11
- package/dist/actions/destinationCalls.d.ts.map +1 -1
- package/dist/actions/destinationCalls.js +34 -27
- package/dist/actions/hooks/useEarnBalances.js +7 -7
- package/dist/actions/hooks/useEarnMarkets.js +4 -4
- package/dist/actions/hooks/useEarnProviders.js +4 -4
- package/dist/actions/hooks/useResolveActions.d.ts +2 -11
- package/dist/actions/hooks/useResolveActions.d.ts.map +1 -1
- package/dist/actions/hooks/useResolveActions.js +40 -222
- package/dist/actions/index.d.ts +6 -0
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +35 -28
- package/dist/actions/resolveActions.d.ts +13 -0
- package/dist/actions/resolveActions.d.ts.map +1 -0
- package/dist/actions/resolveActions.js +267 -0
- package/dist/actions/resolvers.d.ts +2 -3
- package/dist/actions/resolvers.d.ts.map +1 -1
- package/dist/actions/resolvers.js +1 -1
- package/dist/actions/types.d.ts +16 -0
- package/dist/actions/types.d.ts.map +1 -1
- package/dist/actions/utils.d.ts +5 -5
- package/dist/actions/utils.d.ts.map +1 -1
- package/dist/actions/utils.js +124 -114
- package/dist/adapters/evmAdapter.d.ts +10 -0
- package/dist/adapters/evmAdapter.d.ts.map +1 -0
- package/dist/adapters/evmAdapter.js +28 -0
- package/dist/analytics.js +8 -8
- package/dist/chainRegistry.d.ts +6 -0
- package/dist/chainRegistry.d.ts.map +1 -0
- package/dist/chainRegistry.js +47 -0
- package/dist/chainResolution.d.ts +6 -0
- package/dist/chainResolution.d.ts.map +1 -0
- package/dist/chainResolution.js +53 -0
- package/dist/chainRpcClient.d.ts +8 -0
- package/dist/chainRpcClient.d.ts.map +1 -0
- package/dist/chainRpcClient.js +67 -0
- package/dist/chains.d.ts +5 -11
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +108 -208
- package/dist/config.d.ts +1 -30
- package/dist/config.d.ts.map +1 -1
- package/dist/configDefaults.d.ts +7 -0
- package/dist/configDefaults.d.ts.map +1 -0
- package/dist/configDefaults.js +9 -0
- package/dist/configStore.d.ts +31 -0
- package/dist/configStore.d.ts.map +1 -0
- package/dist/{config.js → configStore.js} +1 -1
- package/dist/constants.d.ts +2 -14
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +21 -31
- package/dist/contractConstants.d.ts +8 -0
- package/dist/contractConstants.d.ts.map +1 -0
- package/dist/contractConstants.js +9 -0
- package/dist/contractUtils.js +5 -5
- package/dist/ens.d.ts.map +1 -1
- package/dist/ens.js +78 -55
- package/dist/estimate.js +11 -11
- package/dist/fees.d.ts.map +1 -1
- package/dist/fees.js +40 -35
- package/dist/gasless.d.ts +5 -0
- package/dist/gasless.d.ts.map +1 -1
- package/dist/gasless.js +12 -12
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +63 -62
- package/dist/hooks/prepareTrailsSendTransactionDestination.js +1 -1
- package/dist/hooks/useAmountUsd.js +5 -5
- package/dist/hooks/useBluvoTokenList.d.ts +13 -0
- package/dist/hooks/useBluvoTokenList.d.ts.map +1 -0
- package/dist/hooks/useBluvoTokenList.js +57 -0
- package/dist/hooks/useCheckout.js +6 -6
- package/dist/hooks/useCombinedHistory.d.ts.map +1 -1
- package/dist/hooks/useCombinedHistory.js +89 -81
- package/dist/hooks/useCustomTokenSearch.d.ts +4 -1
- package/dist/hooks/useCustomTokenSearch.d.ts.map +1 -1
- package/dist/hooks/useCustomTokenSearch.js +106 -108
- package/dist/hooks/useDefaultDestinationToken.js +5 -5
- package/dist/hooks/useDefaultOriginToken.d.ts.map +1 -1
- package/dist/hooks/useDefaultOriginToken.js +73 -80
- package/dist/hooks/useDepositMonitor.js +15 -15
- package/dist/hooks/useDestinationSelectedToken.d.ts +8 -2
- package/dist/hooks/useDestinationSelectedToken.d.ts.map +1 -1
- package/dist/hooks/useDestinationSelectedToken.js +150 -116
- package/dist/hooks/useExchangeFundingSelection.d.ts +17 -0
- package/dist/hooks/useExchangeFundingSelection.d.ts.map +1 -0
- package/dist/hooks/useExchangeFundingSelection.js +25 -0
- package/dist/hooks/useExternalFundingReceiptSync.js +5 -5
- package/dist/hooks/useFiatSelectedCurrency.js +1 -1
- package/dist/hooks/useGetIntent.js +3 -3
- package/dist/hooks/useIntentReceiptBalances.js +6 -6
- package/dist/hooks/useIntentTransactionHistory.d.ts.map +1 -1
- package/dist/hooks/useIntentTransactionHistory.js +207 -182
- package/dist/hooks/useMeldTransactionHistory.js +5 -5
- package/dist/hooks/useMeldTransactionStatus.js +8 -8
- package/dist/hooks/useOnRampCountryDefaults.js +4 -4
- package/dist/hooks/useOnRampQuote.js +1 -1
- package/dist/hooks/useOriginSelectedToken.d.ts +5 -0
- package/dist/hooks/useOriginSelectedToken.d.ts.map +1 -1
- package/dist/hooks/useOriginSelectedToken.js +112 -46
- package/dist/hooks/usePayMessage.js +2 -2
- package/dist/hooks/useQuote.d.ts +37 -45
- package/dist/hooks/useQuote.d.ts.map +1 -1
- package/dist/hooks/useQuote.js +249 -254
- package/dist/hooks/useRecentChains.d.ts +7 -0
- package/dist/hooks/useRecentChains.d.ts.map +1 -0
- package/dist/hooks/useRecentChains.js +52 -0
- package/dist/hooks/useSelectedFundMethod.d.ts +31 -0
- package/dist/hooks/useSelectedFundMethod.d.ts.map +1 -1
- package/dist/hooks/useSelectedFundMethod.js +35 -26
- package/dist/hooks/useSelectedRecipient.d.ts.map +1 -1
- package/dist/hooks/useSelectedRecipient.js +21 -21
- package/dist/hooks/useSendForm.d.ts +8 -1
- package/dist/hooks/useSendForm.d.ts.map +1 -1
- package/dist/hooks/useSendForm.js +266 -256
- package/dist/hooks/useSwapState.d.ts +1 -1
- package/dist/hooks/useSwapState.d.ts.map +1 -1
- package/dist/hooks/useTokenList.d.ts +4 -1
- package/dist/hooks/useTokenList.d.ts.map +1 -1
- package/dist/hooks/useTokenList.js +350 -355
- package/dist/hooks/useTrailsSendTransaction.d.ts +9 -43
- package/dist/hooks/useTrailsSendTransaction.d.ts.map +1 -1
- package/dist/hooks/useTrailsSendTransaction.js +289 -306
- package/dist/hooks/useViewManager.d.ts +1 -1
- package/dist/hooks/useViewManager.d.ts.map +1 -1
- package/dist/hooks/useWalletConnectionContext.d.ts +6 -5
- package/dist/hooks/useWalletConnectionContext.d.ts.map +1 -1
- package/dist/hooks/useWalletConnectionContext.js +3 -3
- package/dist/hydrate/multicall.d.ts.map +1 -1
- package/dist/hydrate/multicall.js +127 -91
- package/dist/index.d.ts +77 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +307 -257
- package/dist/indexerClient.d.ts.map +1 -1
- package/dist/indexerClient.js +23 -25
- package/dist/intentProtocolResolver.js +2 -2
- package/dist/intents.d.ts +3 -2
- package/dist/intents.d.ts.map +1 -1
- package/dist/intents.js +58 -63
- package/dist/logger/index.js +1 -1
- package/dist/meld/components/MeldCountriesList.js +1 -1
- package/dist/meld/components/MeldFundMethods.js +7 -7
- package/dist/meld/components/MeldProvidersList.js +1 -1
- package/dist/meld/components/MeldTokensList.js +9 -9
- package/dist/meld/components/SimpleHeader.js +4 -4
- package/dist/meld/utils/meld.js +2 -2
- package/dist/offlineRecovery.d.ts.map +1 -1
- package/dist/offlineRecovery.js +107 -112
- package/dist/onramp/MeshConnectIframe.js +1 -1
- package/dist/onramp/SendFromExchangeButton.js +1 -1
- package/dist/onramp/TrailsOnRampProvider.d.ts +7 -0
- package/dist/onramp/TrailsOnRampProvider.d.ts.map +1 -1
- package/dist/onramp/bluvo/hooks/useBluvoFundingSelection.d.ts +12 -0
- package/dist/onramp/bluvo/hooks/useBluvoFundingSelection.d.ts.map +1 -0
- package/dist/onramp/bluvo/hooks/useBluvoFundingSelection.js +18 -0
- package/dist/onramp/mesh/components/MeshExchangeSelection.js +5 -5
- package/dist/onramp/mesh/hooks/useMeshSelectedTokenBalance.js +4 -4
- package/dist/onramp/mesh/hooks/useMeshSessionAccountBalance.js +1 -1
- package/dist/onramp/trailsOnramp.d.ts.map +1 -1
- package/dist/onramp/trailsOnramp.js +22 -18
- package/dist/onrampClient.d.ts.map +1 -1
- package/dist/onrampClient.js +21 -17
- package/dist/package.js +30 -28
- package/dist/prepareSend.d.ts +4 -2
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/prepareSend.js +32 -31
- package/dist/query/QueryProvider.d.ts +9 -0
- package/dist/query/QueryProvider.d.ts.map +1 -0
- package/dist/query/QueryProvider.js +13 -0
- package/dist/query/balance.fetchers.d.ts.map +1 -1
- package/dist/query/balance.fetchers.js +16 -16
- package/dist/query/balance.hooks.js +9 -9
- package/dist/query/balance.queries.js +1 -1
- package/dist/query/chains.hooks.d.ts +3 -2
- package/dist/query/chains.hooks.d.ts.map +1 -1
- package/dist/query/chains.hooks.js +25 -24
- package/dist/query/fiat.hooks.js +5 -5
- package/dist/query/geo.hooks.js +1 -1
- package/dist/query/geo.queries.js +1 -1
- package/dist/query/intentProtocol.queries.js +1 -1
- package/dist/query/persister.d.ts +0 -1
- package/dist/query/persister.d.ts.map +1 -1
- package/dist/query/persister.js +5 -5
- package/dist/query/price.hooks.js +4 -4
- package/dist/query/price.queries.js +1 -1
- package/dist/query/serialization.d.ts +3 -0
- package/dist/query/serialization.d.ts.map +1 -0
- package/dist/query/serialization.js +17 -0
- package/dist/query/token.fetchers.d.ts +13 -0
- package/dist/query/token.fetchers.d.ts.map +1 -0
- package/dist/query/token.fetchers.js +6 -0
- package/dist/{hooks/useTokens.d.ts → query/token.hooks.d.ts} +14 -25
- package/dist/query/token.hooks.d.ts.map +1 -0
- package/dist/query/token.hooks.js +68 -0
- package/dist/query/token.queries.d.ts +67 -0
- package/dist/query/token.queries.d.ts.map +1 -0
- package/dist/query/token.queries.js +144 -0
- package/dist/quoteError.d.ts +22 -0
- package/dist/quoteError.d.ts.map +1 -0
- package/dist/quoteError.js +9 -0
- package/dist/recover.d.ts +10 -3
- package/dist/recover.d.ts.map +1 -1
- package/dist/recover.js +401 -339
- package/dist/smartContractWallet.d.ts +8 -0
- package/dist/smartContractWallet.d.ts.map +1 -0
- package/dist/smartContractWallet.js +11 -0
- package/dist/tokenRegistry.d.ts +50 -0
- package/dist/tokenRegistry.d.ts.map +1 -0
- package/dist/tokenRegistry.js +589 -0
- package/dist/tokenTypes.d.ts +29 -0
- package/dist/tokenTypes.d.ts.map +1 -0
- package/dist/tokens.d.ts +10 -44
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +269 -798
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +3 -2
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +3 -2
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.js +52 -49
- package/dist/transactionIntent/deposits/standardDeposit.d.ts +3 -2
- package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/standardDeposit.js +2 -2
- package/dist/transactionIntent/handlers/intentHandler.d.ts +3 -2
- package/dist/transactionIntent/handlers/intentHandler.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/intentHandler.js +193 -193
- package/dist/transactionIntent/quote/feeExtractors.d.ts +2 -1
- package/dist/transactionIntent/quote/feeExtractors.d.ts.map +1 -1
- package/dist/transactionIntent/quote/feeExtractors.js +31 -20
- package/dist/transactionIntent/quote/normalizeQuote.js +43 -43
- package/dist/transactionIntent/quote/quoteHelpers.d.ts +3 -3
- package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.js +35 -32
- package/dist/transactionIntent/types.d.ts +9 -6
- package/dist/transactionIntent/types.d.ts.map +1 -1
- package/dist/transactionIntent/types.js +24 -7
- package/dist/transactions.d.ts +5 -0
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +8 -8
- package/dist/umd/trails.min.js +767 -1112
- package/dist/utils/tokenResolution.d.ts +19 -0
- package/dist/utils/tokenResolution.d.ts.map +1 -0
- package/dist/utils/tokenResolution.js +53 -0
- package/dist/widget/assets/components/Aave.d.ts +8 -0
- package/dist/widget/assets/components/Aave.d.ts.map +1 -0
- package/dist/widget/assets/components/Aave.js +29 -0
- package/dist/widget/assets/components/ExchangeIconBlack.d.ts +8 -0
- package/dist/widget/assets/components/ExchangeIconBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/FundMethodCardBrands.d.ts +8 -0
- package/dist/widget/assets/components/FundMethodCardBrands.d.ts.map +1 -0
- package/dist/widget/assets/components/FundMethodCardBrands.js +49 -0
- package/dist/widget/assets/components/FundMethodExchangeBrands.d.ts +8 -0
- package/dist/widget/assets/components/FundMethodExchangeBrands.d.ts.map +1 -0
- package/dist/widget/assets/components/FundMethodExchangeBrands.js +37 -0
- package/dist/widget/assets/components/MetaMaskIconFox.d.ts +8 -0
- package/dist/widget/assets/components/MetaMaskIconFox.d.ts.map +1 -0
- package/dist/widget/assets/components/MetaMaskIconFoxWithMargins.d.ts +8 -0
- package/dist/widget/assets/components/MetaMaskIconFoxWithMargins.d.ts.map +1 -0
- package/dist/widget/assets/components/MetaMaskLogoBlack.d.ts +8 -0
- package/dist/widget/assets/components/MetaMaskLogoBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/MetaMaskLogoWhite.d.ts +8 -0
- package/dist/widget/assets/components/MetaMaskLogoWhite.d.ts.map +1 -0
- package/dist/widget/assets/components/Morpho.d.ts +8 -0
- package/dist/widget/assets/components/Morpho.d.ts.map +1 -0
- package/dist/widget/assets/components/Morpho.js +51 -0
- package/dist/widget/assets/components/TrailsBlack.d.ts +8 -0
- package/dist/widget/assets/components/TrailsBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/TrailsBlack.js +25 -0
- package/dist/widget/assets/components/TrailsWhite.d.ts +8 -0
- package/dist/widget/assets/components/TrailsWhite.d.ts.map +1 -0
- package/dist/widget/assets/components/TrailsWhite.js +25 -0
- package/dist/widget/assets/components/WalletChangeBlack.d.ts +8 -0
- package/dist/widget/assets/components/WalletChangeBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/WalletConnectLogo.d.ts +8 -0
- package/dist/widget/assets/components/WalletConnectLogo.d.ts.map +1 -0
- package/dist/widget/assets/components/WalletConnectLogoBlack.d.ts +8 -0
- package/dist/widget/assets/components/WalletConnectLogoBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/WalletConnectLogoBlue.d.ts +8 -0
- package/dist/widget/assets/components/WalletConnectLogoBlue.d.ts.map +1 -0
- package/dist/widget/assets/components/WalletConnectLogoWhite.d.ts +8 -0
- package/dist/widget/assets/components/WalletConnectLogoWhite.d.ts.map +1 -0
- package/dist/widget/assets/components/index.d.ts +17 -0
- package/dist/widget/assets/components/index.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoCache.d.ts +54 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoCache.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoCache.js +68 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoFlowClient.d.ts +386 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoFlowClient.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoFlowClient.js +872 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoWebClient.d.ts +192 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoWebClient.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoWebClient.js +294 -0
- package/dist/widget/bluvo/bluvo-lib/WebSocketClient.d.ts +51 -0
- package/dist/widget/bluvo/bluvo-lib/WebSocketClient.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/WebSocketClient.js +72 -0
- package/dist/widget/bluvo/bluvo-lib/WebsocketListener.d.ts +19 -0
- package/dist/widget/bluvo/bluvo-lib/WebsocketListener.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/WebsocketListener.js +62 -0
- package/dist/widget/bluvo/bluvo-lib/WorkflowTypes.d.ts +44 -0
- package/dist/widget/bluvo/bluvo-lib/WorkflowTypes.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/WorkflowTypes.js +6 -0
- package/dist/widget/bluvo/bluvo-lib/api.types.d.ts +49 -0
- package/dist/widget/bluvo/bluvo-lib/api.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/balanceTransform.d.ts +84 -0
- package/dist/widget/bluvo/bluvo-lib/balanceTransform.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/balanceTransform.js +26 -0
- package/dist/widget/bluvo/bluvo-lib/createMachine.d.ts +3 -0
- package/dist/widget/bluvo/bluvo-lib/createMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/createMachine.js +38 -0
- package/dist/widget/bluvo/bluvo-lib/error-codes.d.ts +156 -0
- package/dist/widget/bluvo/bluvo-lib/error-codes.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/error-codes.js +115 -0
- package/dist/widget/bluvo/bluvo-lib/flow.types.d.ts +356 -0
- package/dist/widget/bluvo/bluvo-lib/flow.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.d.ts +4 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.js +45 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.types.d.ts +20 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/flowStateHandlers.d.ts +39 -0
- package/dist/widget/bluvo/bluvo-lib/flowStateHandlers.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/flowStateHandlers.js +395 -0
- package/dist/widget/bluvo/bluvo-lib/index.d.ts +5 -0
- package/dist/widget/bluvo/bluvo-lib/index.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/machine.types.d.ts +15 -0
- package/dist/widget/bluvo/bluvo-lib/machine.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/stateHelpers.d.ts +23 -0
- package/dist/widget/bluvo/bluvo-lib/stateHelpers.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/stateHelpers.js +24 -0
- package/dist/widget/bluvo/bluvo-lib/useBluvoFlow.d.ts +325 -0
- package/dist/widget/bluvo/bluvo-lib/useBluvoFlow.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/useBluvoFlow.js +152 -0
- package/dist/widget/bluvo/bluvo-lib/useFlowMachine.d.ts +11 -0
- package/dist/widget/bluvo/bluvo-lib/useFlowMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/useFlowMachine.js +25 -0
- package/dist/widget/bluvo/bluvo-lib/useWithdrawMachine.d.ts +17 -0
- package/dist/widget/bluvo/bluvo-lib/useWithdrawMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawal.types.d.ts +46 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawal.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalErrorHandler.d.ts +29 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalErrorHandler.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalErrorHandler.js +95 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalMachine.d.ts +3 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalMachine.js +137 -0
- package/dist/widget/bluvo/index.d.ts +2 -0
- package/dist/widget/bluvo/index.d.ts.map +1 -0
- package/dist/widget/components/AccountActionsDropdown.js +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.js +143 -190
- package/dist/widget/components/AccountIntentTransactionHistoryButton.js +1 -1
- package/dist/widget/components/AccountSettings.d.ts.map +1 -1
- package/dist/widget/components/AccountSettings.js +19 -18
- package/dist/widget/components/AddressWalletIcon.d.ts +1 -1
- package/dist/widget/components/AddressWalletIcon.d.ts.map +1 -1
- package/dist/widget/components/AddressWalletIcon.js +13 -13
- package/dist/widget/components/AllChainsIcon.d.ts.map +1 -1
- package/dist/widget/components/AllChainsIcon.js +80 -13
- package/dist/widget/components/BluvoExchangeSelection.d.ts +12 -0
- package/dist/widget/components/BluvoExchangeSelection.d.ts.map +1 -0
- package/dist/widget/components/BluvoExchangeSelection.js +131 -0
- package/dist/widget/components/BluvoExchangeSelection.lazy.d.ts +2 -0
- package/dist/widget/components/BluvoExchangeSelection.lazy.d.ts.map +1 -0
- package/dist/widget/components/BluvoExchangeSelection.lazy.js +4 -0
- package/dist/widget/components/BluvoOnrampFlow.d.ts +20 -0
- package/dist/widget/components/BluvoOnrampFlow.d.ts.map +1 -0
- package/dist/widget/components/BluvoOnrampFlow.js +1472 -0
- package/dist/widget/components/BluvoOnrampFlow.lazy.d.ts +2 -0
- package/dist/widget/components/BluvoOnrampFlow.lazy.d.ts.map +1 -0
- package/dist/widget/components/BluvoOnrampFlow.lazy.js +4 -0
- package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
- package/dist/widget/components/ChainFilterDropdown.js +37 -37
- package/dist/widget/components/ChainList.d.ts.map +1 -1
- package/dist/widget/components/ChainList.js +157 -119
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.js +309 -300
- package/dist/widget/components/ConfigDisplay.js +3 -3
- package/dist/widget/components/ConnectWallet.d.ts +1 -6
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.js +110 -165
- package/dist/widget/components/ConnectedWallets.d.ts +3 -1
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.js +75 -100
- package/dist/widget/components/CopyButton.js +1 -1
- package/dist/widget/components/CountryFilterDropdown.js +1 -1
- package/dist/widget/components/DebugMenu.js +1 -1
- package/dist/widget/components/DepositTracker.js +1 -1
- package/dist/widget/components/DirectTransfer.d.ts +1 -1
- package/dist/widget/components/DirectTransfer.js +3 -3
- package/dist/widget/components/Earn.js +1 -1
- package/dist/widget/components/EarnMarkets.d.ts.map +1 -1
- package/dist/widget/components/EarnMarkets.js +162 -148
- package/dist/widget/components/EarnPools.d.ts.map +1 -1
- package/dist/widget/components/EarnPools.js +123 -103
- package/dist/widget/components/EarnPoolsFilters.d.ts.map +1 -1
- package/dist/widget/components/EarnPoolsFilters.js +19 -16
- package/dist/widget/components/EarnWithdraw.d.ts.map +1 -1
- package/dist/widget/components/EarnWithdraw.js +130 -129
- package/dist/widget/components/FeeOptions.js +1 -1
- package/dist/widget/components/FiatSelector.js +5 -5
- package/dist/widget/components/FiatSelectorButton.js +6 -6
- package/dist/widget/components/Footer.d.ts.map +1 -1
- package/dist/widget/components/Footer.js +47 -40
- package/dist/widget/components/Fund.d.ts +15 -11
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/Fund.js +13 -1088
- package/dist/widget/components/Fund.types.d.ts +22 -0
- package/dist/widget/components/Fund.types.d.ts.map +1 -0
- package/dist/widget/components/FundExactInput.d.ts +5 -0
- package/dist/widget/components/FundExactInput.d.ts.map +1 -0
- package/dist/widget/components/FundExactInput.js +1116 -0
- package/dist/widget/components/FundExactOutput.d.ts +5 -0
- package/dist/widget/components/FundExactOutput.d.ts.map +1 -0
- package/dist/widget/components/FundExactOutput.js +498 -0
- package/dist/widget/components/FundMethods.d.ts +2 -1
- package/dist/widget/components/FundMethods.d.ts.map +1 -1
- package/dist/widget/components/FundMethods.js +144 -143
- package/dist/widget/components/FundWalletSelection.d.ts +1 -0
- package/dist/widget/components/FundWalletSelection.d.ts.map +1 -1
- package/dist/widget/components/FundWalletSelection.js +18 -19
- package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/FundingMethodSelectorButton.js +32 -30
- package/dist/widget/components/HookModalContent.js +11 -11
- package/dist/widget/components/MeldForm.js +15 -15
- package/dist/widget/components/MeldHistory.js +5 -5
- package/dist/widget/components/MeldStepsFlow.js +8 -8
- package/dist/widget/components/MeldTransactionStatus.js +7 -7
- package/dist/widget/components/Modal.js +3 -3
- package/dist/widget/components/OnRampProviderSelector.js +1 -1
- package/dist/widget/components/OnrampErrorScreen.js +1 -1
- package/dist/widget/components/OnrampHistoryRow.js +1 -1
- package/dist/widget/components/OnrampPaymentMethods.js +1 -1
- package/dist/widget/components/OnrampProviderConfirmation.js +7 -7
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/Pay.js +223 -216
- package/dist/widget/components/PaymentMethods.d.ts.map +1 -1
- package/dist/widget/components/PaymentMethods.js +51 -52
- package/dist/widget/components/PoolDeposit.js +35 -35
- package/dist/widget/components/QRCodeOptions.js +1 -1
- package/dist/widget/components/QRCodeWalletSelect.d.ts +1 -1
- package/dist/widget/components/QRCodeWalletSelect.js +1 -1
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.js +195 -187
- package/dist/widget/components/QuoteInputErrorBlock.d.ts +7 -0
- package/dist/widget/components/QuoteInputErrorBlock.d.ts.map +1 -0
- package/dist/widget/components/QuoteInputErrorBlock.js +22 -0
- package/dist/widget/components/Receipt.js +15 -15
- package/dist/widget/components/RecentChains.d.ts +9 -0
- package/dist/widget/components/RecentChains.d.ts.map +1 -0
- package/dist/widget/components/RecentChains.js +28 -0
- package/dist/widget/components/RecipientSelectorButton.js +5 -5
- package/dist/widget/components/Recipients.d.ts.map +1 -1
- package/dist/widget/components/Recipients.js +84 -102
- package/dist/widget/components/ScreenHeader.d.ts.map +1 -1
- package/dist/widget/components/ScreenHeader.js +20 -20
- package/dist/widget/components/SearchInputField.js +4 -4
- package/dist/widget/components/SessionTimeoutScreen.js +1 -1
- package/dist/widget/components/ShadowPortal.js +1 -1
- package/dist/widget/components/SlippageToleranceSettings.js +4 -4
- package/dist/widget/components/ThemeProvider.js +1 -1
- package/dist/widget/components/Toast.js +19 -19
- package/dist/widget/components/TokenImage.js +4 -4
- package/dist/widget/components/TokenSelector.d.ts +3 -0
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/TokenSelector.js +201 -190
- package/dist/widget/components/TokenSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/TokenSelectorButton.js +22 -22
- package/dist/widget/components/TrailsHookModal.d.ts +2 -2
- package/dist/widget/components/TrailsHookModal.d.ts.map +1 -1
- package/dist/widget/components/TrailsHookModal.js +47 -49
- package/dist/widget/components/TransactionDetails.d.ts.map +1 -1
- package/dist/widget/components/TransactionDetails.js +33 -23
- package/dist/widget/components/TransactionHistoryItem.d.ts.map +1 -1
- package/dist/widget/components/TransactionHistoryItem.js +278 -188
- package/dist/widget/components/TransferPendingVertical.js +2 -2
- package/dist/widget/components/UserPreferences.js +11 -11
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
- package/dist/widget/components/WaasFeeOptions.js +208 -159
- package/dist/widget/components/WalletAccountHeader.js +1 -1
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/components/WalletConfirmation.js +46 -47
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.js +83 -135
- package/dist/widget/components/WalletConnectionPending.d.ts.map +1 -1
- package/dist/widget/components/WalletConnectionPending.js +25 -25
- package/dist/widget/components/WalletList.d.ts +8 -2
- package/dist/widget/components/WalletList.d.ts.map +1 -1
- package/dist/widget/components/WalletList.js +61 -33
- package/dist/widget/components/WidgetProviders.d.ts +3 -1
- package/dist/widget/components/WidgetProviders.d.ts.map +1 -1
- package/dist/widget/components/WidgetProviders.js +32 -28
- package/dist/widget/components/Withdraw.d.ts.map +1 -1
- package/dist/widget/components/Withdraw.js +192 -185
- package/dist/widget/index.d.ts +3 -1
- package/dist/widget/index.d.ts.map +1 -1
- package/dist/widget/index.js +30 -26
- package/dist/widget/modes/EarnWidget.d.ts +4 -4
- package/dist/widget/modes/EarnWidget.d.ts.map +1 -1
- package/dist/widget/modes/EarnWidget.js +17 -15
- package/dist/widget/modes/FundWidget.d.ts +13 -0
- package/dist/widget/modes/FundWidget.d.ts.map +1 -1
- package/dist/widget/modes/FundWidget.js +30 -28
- package/dist/widget/modes/PayWidget.d.ts.map +1 -1
- package/dist/widget/modes/PayWidget.js +23 -21
- package/dist/widget/modes/SwapWidget.d.ts.map +1 -1
- package/dist/widget/modes/SwapWidget.js +19 -18
- package/dist/widget/modes/WithdrawWidget.d.ts +3 -3
- package/dist/widget/modes/WithdrawWidget.d.ts.map +1 -1
- package/dist/widget/modes/WithdrawWidget.js +15 -13
- package/dist/widget/props.d.ts +255 -0
- package/dist/widget/props.d.ts.map +1 -0
- package/dist/widget/props.js +14 -0
- package/dist/widget/providers/TrailsModalProvider.js +4 -4
- package/dist/widget/providers/TrailsProvider.d.ts +78 -16
- package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
- package/dist/widget/providers/TrailsProvider.js +64 -46
- package/dist/widget/providers/WalletContext.d.ts +10 -0
- package/dist/widget/providers/WalletContext.d.ts.map +1 -0
- package/dist/widget/providers/WalletContext.js +23 -0
- package/dist/widget/providers/WidgetProviderTree.d.ts +9 -7
- package/dist/widget/providers/WidgetProviderTree.d.ts.map +1 -1
- package/dist/widget/providers/WidgetProviderTree.js +31 -47
- package/dist/widget/providers/adapterConfig.d.ts +13 -0
- package/dist/widget/providers/adapterConfig.d.ts.map +1 -0
- package/dist/widget/providers/adapterConfig.js +97 -0
- package/dist/widget/providers/sequenceSupport.d.ts +42 -0
- package/dist/widget/providers/sequenceSupport.d.ts.map +1 -0
- package/dist/widget/providers/walletRuntimeResolution.d.ts +10 -0
- package/dist/widget/providers/walletRuntimeResolution.d.ts.map +1 -0
- package/dist/widget/providers/walletRuntimeResolution.js +14 -0
- package/dist/widget/shared/destinationDefaultToken.d.ts.map +1 -1
- package/dist/widget/shared/destinationDefaultToken.js +12 -13
- package/dist/widget/shared/destinationSupport.d.ts +40 -0
- package/dist/widget/shared/destinationSupport.d.ts.map +1 -0
- package/dist/widget/shared/destinationSupport.js +215 -0
- package/dist/widget/shared/resolution.d.ts +2 -17
- package/dist/widget/shared/resolution.d.ts.map +1 -1
- package/dist/widget/shared/resolution.js +32 -52
- package/dist/widget/shared/resolvePaymentSource.d.ts +2 -1
- package/dist/widget/shared/resolvePaymentSource.d.ts.map +1 -1
- package/dist/widget/shared/resolvePaymentSource.js +9 -9
- package/dist/widget/shared/types.d.ts +23 -31
- package/dist/widget/shared/types.d.ts.map +1 -1
- package/dist/widget/styles.gen.d.ts.map +1 -1
- package/dist/widget/styles.gen.js +4 -4
- package/dist/widget/utils/fundMethodSwitchState.d.ts +2 -0
- package/dist/widget/utils/fundMethodSwitchState.d.ts.map +1 -1
- package/dist/widget/utils/fundMethodSwitchState.js +3 -3
- package/dist/widget/utils/tokens.d.ts.map +1 -1
- package/dist/widget/utils/tokens.js +11 -25
- package/dist/widget/utils/trailsOnrampConfig.d.ts +5 -0
- package/dist/widget/utils/trailsOnrampConfig.d.ts.map +1 -1
- package/dist/widget/utils/viewManagerGuards.d.ts.map +1 -1
- package/dist/widget/utils/viewManagerGuards.js +5 -4
- package/dist/widget/utils/walletConnectRedirect.d.ts +19 -0
- package/dist/widget/utils/walletConnectRedirect.d.ts.map +1 -0
- package/dist/widget/utils/walletConnectRedirect.js +21 -0
- package/dist/widget/widget.d.ts +2 -224
- package/dist/widget/widget.d.ts.map +1 -1
- package/dist/widget/widget.js +995 -993
- package/dist/widgetFlowHooks.d.ts +12 -0
- package/dist/widgetFlowHooks.d.ts.map +1 -0
- package/dist/widgetFlowHooks.js +18 -0
- package/package.json +24 -22
- package/dist/hooks/useAddressWalletIcon.d.ts +0 -10
- package/dist/hooks/useAddressWalletIcon.d.ts.map +0 -1
- package/dist/hooks/useAddressWalletIcon.js +0 -33
- package/dist/hooks/useConnector.d.ts +0 -9
- package/dist/hooks/useConnector.d.ts.map +0 -1
- package/dist/hooks/useConnector.js +0 -11
- package/dist/hooks/useIsSequenceWallet.d.ts +0 -6
- package/dist/hooks/useIsSequenceWallet.d.ts.map +0 -1
- package/dist/hooks/useIsSequenceWallet.js +0 -10
- package/dist/hooks/useTokens.d.ts.map +0 -1
- package/dist/hooks/useTokens.js +0 -166
- package/dist/hooks/useWalletConnectUri.d.ts +0 -19
- package/dist/hooks/useWalletConnectUri.d.ts.map +0 -1
- package/dist/hooks/useWalletConnectUri.js +0 -122
- package/dist/query/tokenList.queries.d.ts +0 -54
- package/dist/query/tokenList.queries.d.ts.map +0 -1
- package/dist/query/tokenList.queries.js +0 -77
- package/dist/tokensApi.d.ts +0 -8
- package/dist/tokensApi.d.ts.map +0 -1
- package/dist/tokensApi.js +0 -56
- package/dist/walletUtils.d.ts +0 -42
- package/dist/walletUtils.d.ts.map +0 -1
- package/dist/walletUtils.js +0 -110
- package/dist/wallets.d.ts +0 -23
- package/dist/wallets.d.ts.map +0 -1
- package/dist/wallets.js +0 -236
- package/dist/widget/assets/FundMethod-card-brands.js +0 -4
- package/dist/widget/assets/FundMethod-exchange-brands.js +0 -4
- package/dist/widget/assets/Trails-logo-black.js +0 -4
- package/dist/widget/assets/Trails-logo-white.js +0 -4
- package/dist/widget/assets/aave.js +0 -4
- package/dist/widget/assets/morpho.js +0 -4
- package/dist/widget/components/FundMethodIcons.d.ts +0 -4
- package/dist/widget/components/FundMethodIcons.d.ts.map +0 -1
- package/dist/widget/components/FundMethodIcons.js +0 -60
- package/dist/widget/shared/tokenAllowlist.d.ts +0 -36
- package/dist/widget/shared/tokenAllowlist.d.ts.map +0 -1
- package/dist/widget/shared/tokenAllowlist.js +0 -60
- package/dist/widget/utils/createWagmiConfig.d.ts +0 -10
- package/dist/widget/utils/createWagmiConfig.d.ts.map +0 -1
- package/dist/widget/utils/createWagmiConfig.js +0 -18
|
@@ -1,86 +1,87 @@
|
|
|
1
|
-
import { FIAT_CURRENCY_SYMBOLS as xt } from "../../constants.js";
|
|
2
1
|
import { logger as l } from "../../logger/index.js";
|
|
3
|
-
import { isWithinCooldown as
|
|
4
|
-
import { getChainInfo as
|
|
5
|
-
import { addressEqual as
|
|
6
|
-
import {
|
|
2
|
+
import { isWithinCooldown as Fe } from "../../utils/time.js";
|
|
3
|
+
import { getChainInfo as he } from "../../chains.js";
|
|
4
|
+
import { addressEqual as Ue } from "../../utils/address.js";
|
|
5
|
+
import { FIAT_CURRENCY_SYMBOLS as Dt } from "../../constants.js";
|
|
6
|
+
import { useSupportedTokens as At } from "../../query/token.hooks.js";
|
|
7
|
+
import { getSupportedChains as Lt } from "../shared/destinationSupport.js";
|
|
8
|
+
import { useOriginSelectedToken as Mt } from "../../hooks/useOriginSelectedToken.js";
|
|
9
|
+
import { useDestinationSelectedToken as It } from "../../hooks/useDestinationSelectedToken.js";
|
|
10
|
+
import { isPositiveNumber as Ot, toSafeNumber as We } from "../../utils/validation.js";
|
|
7
11
|
import { forexRateStore as ie } from "../utils/forexRateStore.js";
|
|
8
|
-
import { formatUsdAmountDisplay as
|
|
12
|
+
import { formatUsdAmountDisplay as Rt, formatUsdAmountLocaleDisplay as Bt } from "../../utils/format.js";
|
|
13
|
+
import { useSelectedRecipient as Ft } from "../../hooks/useSelectedRecipient.js";
|
|
14
|
+
import { useBalanceVisible as Ut } from "../../hooks/useBalanceVisible.js";
|
|
9
15
|
import { TradeType as f } from "../../transactionIntent/types.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import { useCallback as $, useEffect as c, useRef as I, useState as T } from "react";
|
|
34
|
-
import { ArrowLeftRight as Ht } from "lucide-react";
|
|
35
|
-
import { Fragment as qt, jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
36
|
-
var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, account: se, toRecipient: o, toAmount: Xe, toChainId: x, toToken: d, toCalldata: He, walletClient: qe, onTransactionStateChange: Ge, onError: ae, onWaitingForWalletConfirm: Qe, setWalletConfirmRetryHandler: ze, swapProvider: Ke, bridgeProvider: Ye, swapProviderFallback: Ze, bridgeProviderFallback: Je, onAmountUpdate: oe, checkoutOnHandlers: et, recentTokens: Se, onTrackToken: P, isSequenceWallet: Gt = !1, fromToken: y, fromChainId: X, defaultInputMode: tt }) => {
|
|
37
|
-
const { mode: nt, navigate: it } = It(), O = !y, { isBalanceVisible: be } = Bt(), { selectedToken: i, setSelectedToken: N, hasManualSelection: D, setHasManualSelection: v } = At(), { selectedToken: C, setSelectedToken: A, hasManualSelection: H, setHasManualSelection: q, availableDestinationTokens: st } = Lt(), { token: G, isLoadingBalance: Te } = Ot(i, se?.address), { selectedRecipient: L, setSelectedRecipient: Q } = Mt(), ye = I(o), w = I({
|
|
16
|
+
import { useSwapState as Wt } from "../../hooks/useSwapState.js";
|
|
17
|
+
import { useScreenGuard as Et, useViewManager as jt } from "../../hooks/useViewManager.js";
|
|
18
|
+
import { ScreenHeader as pe } from "./ScreenHeader.js";
|
|
19
|
+
import { useAccountTokenBalanceOnchain as _t } from "../../query/balance.hooks.js";
|
|
20
|
+
import { TokenSelector as Ee } from "./TokenSelector.js";
|
|
21
|
+
import { ChainList as je } from "./ChainList.js";
|
|
22
|
+
import Vt from "./DynamicSizeInputField.js";
|
|
23
|
+
import $t from "./QuoteDetails.js";
|
|
24
|
+
import ge from "./LoadingSpinner.js";
|
|
25
|
+
import { PercentageMaxButtons as Pt } from "./PercentageMaxButtons.js";
|
|
26
|
+
import { useDefaultOriginToken as Xt } from "../../hooks/useDefaultOriginToken.js";
|
|
27
|
+
import { useSendForm as Ht } from "../../hooks/useSendForm.js";
|
|
28
|
+
import { isFeeOptionDisabled as qt } from "./FeeOption.js";
|
|
29
|
+
import Kt from "./FeeOptions.js";
|
|
30
|
+
import Gt from "./FundingMethodSelectorButton.js";
|
|
31
|
+
import { TokenSelectorButton as _e } from "./TokenSelectorButton.js";
|
|
32
|
+
import { useDefaultDestinationToken as Qt } from "../../hooks/useDefaultDestinationToken.js";
|
|
33
|
+
import Ve from "./RecipientSelectorButton.js";
|
|
34
|
+
import { useCallback as $, useEffect as c, useMemo as zt, useRef as B, useState as T } from "react";
|
|
35
|
+
import { Fragment as Yt, jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
36
|
+
import { ArrowLeftRight as Zt } from "lucide-react";
|
|
37
|
+
var jn = ({ selectedToken: $e, onSend: Pe, onConfirm: Xe, onComplete: Se, account: se, toRecipient: o, toAmount: He, toChainId: x, toToken: d, toCalldata: qe, walletClient: Ke, onTransactionStateChange: Ge, onError: ae, onWaitingForWalletConfirm: Qe, setWalletConfirmRetryHandler: ze, swapProvider: Ye, bridgeProvider: Ze, swapProviderFallback: Je, bridgeProviderFallback: et, onAmountUpdate: oe, checkoutOnHandlers: tt, recentTokens: be, onTrackToken: P, isSequenceWallet: Jt = !1, fromToken: w, fromChainId: X, defaultInputMode: nt }) => {
|
|
38
|
+
const { mode: it, navigate: st } = jt(), F = !w, { isBalanceVisible: Te } = Ut(), { selectedToken: i, setSelectedToken: N, hasManualSelection: v, setHasManualSelection: C, availableOriginTokens: at, availableOriginTokenKeys: ot, availableOriginTokenRestrictedChainIds: rt, availableOriginChainIds: re } = Mt(), { selectedToken: D, setSelectedToken: A, hasManualSelection: H, setHasManualSelection: q } = It(), lt = zt(() => Lt(re), [re]), { token: K, isLoadingBalance: we } = _t(i, se?.address), { selectedRecipient: L, setSelectedRecipient: G } = Ft(), ye = B(o), y = B({
|
|
38
39
|
hasManualDestinationSelection: !1,
|
|
39
40
|
lastOriginSelectionTime: 0,
|
|
40
41
|
lastDestinationSelectionTime: 0
|
|
41
|
-
}), { defaultOriginToken: U, isLoading:
|
|
42
|
+
}), { defaultOriginToken: U, isLoading: Q } = Xt(), { defaultDestinationToken: M, isLoading: ke } = Qt(i), [xe, le] = T($e?.chainId || i?.chainId), { tradeType: ct, setTradeType: W, sellAmount: z, setSellAmount: h, buyAmount: dt, setBuyAmount: E, resetSwapState: Ne, enterFormMode: ut } = Wt();
|
|
42
43
|
c(() => {
|
|
43
|
-
|
|
44
|
-
}, []),
|
|
44
|
+
ut("withdraw");
|
|
45
|
+
}, []), Et((o == null || o === "") && !L, "recipients", { backTarget: "withdraw" }), c(() => {
|
|
45
46
|
const e = o !== ye.current;
|
|
46
|
-
ye.current = o, e ? o ? (l.console.log("[trails-sdk] Withdraw Setting selectedRecipient to toRecipient:", o),
|
|
47
|
+
ye.current = o, e ? o ? (l.console.log("[trails-sdk] Withdraw Setting selectedRecipient to toRecipient:", o), G(o)) : (l.console.log("[trails-sdk] Withdraw Clearing selectedRecipient (toRecipient is now empty)"), G(null)) : o && !L && (l.console.log("[trails-sdk] Withdraw Setting selectedRecipient to toRecipient:", o), G(o));
|
|
47
48
|
}, [
|
|
48
49
|
o,
|
|
49
50
|
L,
|
|
50
|
-
|
|
51
|
+
G
|
|
51
52
|
]);
|
|
52
|
-
const
|
|
53
|
+
const mt = L || o || se?.address, p = ct || f.EXACT_INPUT, [k, ft] = T(nt === "fiat"), [Y, g] = T(""), [en, ve] = T(!1), j = B(null);
|
|
53
54
|
c(() => () => {
|
|
54
55
|
j.current && clearTimeout(j.current);
|
|
55
56
|
}, []);
|
|
56
|
-
const
|
|
57
|
-
g(""),
|
|
58
|
-
}, [
|
|
57
|
+
const ht = $((e) => {
|
|
58
|
+
g(""), Ne(), Se(e);
|
|
59
|
+
}, [Se, Ne]), { amount: pt, amountRaw: Ce, balanceFormatted: Z, balanceRaw: J, tokenDecimals: gt, balanceLocaleDisplay: St, balanceUsdDisplay: De, balanceUsdLocaleDisplay: bt, handleSubmit: Tt, isSubmitting: Ae, isLoadingQuote: I, selectedDestToken: Le, setSelectedDestinationChain: O, setSelectedDestToken: S, buttonText: ee, destinationTokenAddress: wt, isValidCustomToken: yt, prepareSendQuote: r, processedFeeOptions: kt, selectedFeeOption: ce, setSelectedFeeOption: xt, sourceTokenPrices: Nt } = Ht({
|
|
59
60
|
account: se,
|
|
60
|
-
toAmount: p === f.EXACT_OUTPUT ?
|
|
61
|
-
fromAmount: p === f.EXACT_INPUT ?
|
|
62
|
-
toRecipient:
|
|
61
|
+
toAmount: p === f.EXACT_OUTPUT ? dt : He,
|
|
62
|
+
fromAmount: p === f.EXACT_INPUT ? z : void 0,
|
|
63
|
+
toRecipient: mt,
|
|
63
64
|
toChainId: x,
|
|
64
65
|
toToken: d,
|
|
65
|
-
toCalldata:
|
|
66
|
-
walletClient:
|
|
66
|
+
toCalldata: qe,
|
|
67
|
+
walletClient: Ke,
|
|
67
68
|
onTransactionStateChange: Ge,
|
|
68
69
|
onError: ae,
|
|
69
70
|
onWaitingForWalletConfirm: Qe,
|
|
70
|
-
onSend:
|
|
71
|
-
onConfirm:
|
|
72
|
-
onComplete:
|
|
71
|
+
onSend: Pe,
|
|
72
|
+
onConfirm: Xe,
|
|
73
|
+
onComplete: ht,
|
|
73
74
|
selectedToken: i ?? void 0,
|
|
74
75
|
setWalletConfirmRetryHandler: ze,
|
|
75
76
|
tradeType: p,
|
|
76
|
-
swapProvider:
|
|
77
|
-
bridgeProvider:
|
|
78
|
-
swapProviderFallback:
|
|
79
|
-
bridgeProviderFallback:
|
|
77
|
+
swapProvider: Ye,
|
|
78
|
+
bridgeProvider: Ze,
|
|
79
|
+
swapProviderFallback: Je,
|
|
80
|
+
bridgeProviderFallback: et,
|
|
80
81
|
fundMethod: "wallet",
|
|
81
|
-
mode:
|
|
82
|
-
checkoutOnHandlers:
|
|
83
|
-
}), u =
|
|
82
|
+
mode: it,
|
|
83
|
+
checkoutOnHandlers: tt
|
|
84
|
+
}), u = Nt?.[0]?.priceUsd || 0, Me = $((e) => {
|
|
84
85
|
let n = e;
|
|
85
86
|
e !== "0" && e.length > 1 && e.startsWith("0") && e[1] !== "." && (n = e.replace(/^0+/, "") || "0"), W(f.EXACT_INPUT), h(n);
|
|
86
87
|
}, [W, h]);
|
|
@@ -92,172 +93,178 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
92
93
|
h,
|
|
93
94
|
E
|
|
94
95
|
]), c(() => {
|
|
95
|
-
oe && oe(
|
|
96
|
-
}, [
|
|
97
|
-
|
|
96
|
+
oe && oe(Ce);
|
|
97
|
+
}, [Ce, oe]), c(() => {
|
|
98
|
+
v && !i && !Q && (l.console.log("[trails-sdk] Resetting hasManualOriginSelection - token was cleared"), C(!1));
|
|
98
99
|
}, [
|
|
99
|
-
|
|
100
|
+
v,
|
|
100
101
|
i,
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
Q,
|
|
103
|
+
C
|
|
103
104
|
]), c(() => {
|
|
104
|
-
!i && !
|
|
105
|
+
!i && !Q && U && !v && (l.console.log("[trails-sdk] Auto-selecting origin token:", U), N(U), le(U.chainId));
|
|
105
106
|
}, [
|
|
106
107
|
i,
|
|
107
|
-
|
|
108
|
+
Q,
|
|
108
109
|
U,
|
|
109
110
|
N,
|
|
110
|
-
|
|
111
|
+
v
|
|
111
112
|
]), c(() => {
|
|
112
113
|
if (d) return;
|
|
113
|
-
const e =
|
|
114
|
-
if (!
|
|
114
|
+
const e = v || Fe(y.current.lastOriginSelectionTime, 1e3), n = y.current.hasManualDestinationSelection || H || Fe(y.current.lastDestinationSelectionTime, 1e3);
|
|
115
|
+
if (!D && !ke && M && !n && !e) {
|
|
115
116
|
l.console.log("[trails-sdk] Auto-selecting destination token:", M), A(M), S(M);
|
|
116
|
-
const s =
|
|
117
|
-
s &&
|
|
117
|
+
const s = he(M.chainId);
|
|
118
|
+
s && O(s);
|
|
118
119
|
}
|
|
119
120
|
}, [
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
D,
|
|
122
|
+
ke,
|
|
122
123
|
M,
|
|
123
124
|
H,
|
|
124
|
-
|
|
125
|
+
v,
|
|
125
126
|
A,
|
|
126
127
|
S,
|
|
127
|
-
|
|
128
|
+
O,
|
|
128
129
|
d
|
|
129
130
|
]), c(() => {
|
|
130
|
-
|
|
131
|
+
de.current && de.current.focus();
|
|
131
132
|
}, []);
|
|
132
|
-
const
|
|
133
|
+
const de = B(null), [te, _] = T(!1), [ne, V] = T(!1), [vt, Ie] = T(!1), [Ct, Oe] = T(!1), { supportedTokens: R } = At({ disabled: !!d || te || ne }), ue = B(null);
|
|
133
134
|
c(() => {
|
|
134
135
|
const e = `${d}-${x}`;
|
|
135
|
-
if (d && x &&
|
|
136
|
-
const n =
|
|
136
|
+
if (d && x && R?.length > 0 && ue.current !== e) {
|
|
137
|
+
const n = R?.find((s) => s.chainId === Number(x) && (Ue(s.contractAddress, d) || s.symbol.toLowerCase() === d.toLowerCase()));
|
|
137
138
|
if (n) {
|
|
138
139
|
l.console.log("[trails-sdk] Withdraw: Setting destination token from toToken prop:", n), A(n), S(n);
|
|
139
|
-
const s =
|
|
140
|
-
s &&
|
|
140
|
+
const s = he(Number(x));
|
|
141
|
+
s && O(s), ue.current = e;
|
|
141
142
|
}
|
|
142
|
-
} else !d && H && (q(!1),
|
|
143
|
+
} else !d && H && (q(!1), y.current.hasManualDestinationSelection = !1, ue.current = null);
|
|
143
144
|
}, [
|
|
144
145
|
d,
|
|
145
146
|
x,
|
|
146
|
-
|
|
147
|
+
R,
|
|
147
148
|
A,
|
|
148
149
|
S,
|
|
149
|
-
|
|
150
|
+
O,
|
|
150
151
|
H,
|
|
151
152
|
q
|
|
152
153
|
]), c(() => {
|
|
153
|
-
|
|
154
|
-
}, [
|
|
155
|
-
const Re =
|
|
154
|
+
D && (l.console.log("[trails-sdk] Syncing destination token to useSendForm:", D), S(D));
|
|
155
|
+
}, [D, S]);
|
|
156
|
+
const Re = B(null);
|
|
156
157
|
c(() => {
|
|
157
|
-
const e = `${
|
|
158
|
-
if (
|
|
159
|
-
const n =
|
|
160
|
-
n && (l.console.log("[trails-sdk] Withdraw: Setting origin token from fromToken prop:", n), N(n),
|
|
158
|
+
const e = `${w}-${X}`;
|
|
159
|
+
if (w && X && R?.length > 0 && Re.current !== e) {
|
|
160
|
+
const n = R?.find((s) => s.chainId === Number(X) && (Ue(s.contractAddress, w) || s.symbol.toLowerCase() === w.toLowerCase()));
|
|
161
|
+
n && (l.console.log("[trails-sdk] Withdraw: Setting origin token from fromToken prop:", n), N(n), le(n.chainId), C(!0), Re.current = e);
|
|
161
162
|
}
|
|
162
163
|
}, [
|
|
163
|
-
|
|
164
|
+
w,
|
|
164
165
|
X,
|
|
165
|
-
|
|
166
|
+
R,
|
|
166
167
|
N,
|
|
167
|
-
|
|
168
|
+
C
|
|
168
169
|
]);
|
|
169
|
-
const
|
|
170
|
-
(!i || i.symbol !== e.symbol) && (h(""), E(""), W(f.EXACT_INPUT), g("")), N(e),
|
|
170
|
+
const me = $((e) => {
|
|
171
|
+
(!i || i.symbol !== e.symbol) && (h(""), E(""), W(f.EXACT_INPUT), g("")), N(e), le(e.chainId), _(!1), C(!0), y.current.lastOriginSelectionTime = Date.now(), P?.(e), l.console.log("[trails-sdk] selected origin token", e);
|
|
171
172
|
}, [
|
|
172
173
|
N,
|
|
173
|
-
|
|
174
|
+
C,
|
|
174
175
|
P,
|
|
175
176
|
i,
|
|
176
177
|
h,
|
|
177
178
|
E,
|
|
178
179
|
W
|
|
179
|
-
]),
|
|
180
|
+
]), fe = $((e) => {
|
|
180
181
|
A(e), S(e);
|
|
181
|
-
const n =
|
|
182
|
-
n &&
|
|
182
|
+
const n = he(e.chainId);
|
|
183
|
+
n && O(n), V(!1), q(!0), y.current.hasManualDestinationSelection = !0, y.current.lastDestinationSelectionTime = Date.now(), P?.(e), l.console.log("[trails-sdk] selected destination token", e);
|
|
183
184
|
}, [
|
|
184
185
|
A,
|
|
185
186
|
S,
|
|
186
|
-
|
|
187
|
+
O,
|
|
187
188
|
q,
|
|
188
189
|
P
|
|
189
|
-
]),
|
|
190
|
-
te ?
|
|
190
|
+
]), Be = $((e) => {
|
|
191
|
+
te ? me(e) : ne && fe(e);
|
|
191
192
|
}, [
|
|
192
193
|
te,
|
|
193
194
|
ne,
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
me,
|
|
196
|
+
fe
|
|
196
197
|
]);
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
return vt ? /* @__PURE__ */ t(je, {
|
|
199
|
+
chains: lt,
|
|
200
|
+
onBack: () => {
|
|
201
|
+
Ie(!1), _(!0);
|
|
202
|
+
}
|
|
203
|
+
}) : te ? /* @__PURE__ */ a("div", {
|
|
200
204
|
className: "space-y-2",
|
|
201
|
-
children: [/* @__PURE__ */ t(
|
|
205
|
+
children: [/* @__PURE__ */ t(pe, {
|
|
202
206
|
onBack: () => _(!1),
|
|
203
207
|
headerContent: "Select Token to Withdraw",
|
|
204
208
|
headerContentAlign: "left"
|
|
205
|
-
}), /* @__PURE__ */ t(
|
|
206
|
-
onTokenSelect:
|
|
209
|
+
}), /* @__PURE__ */ t(Ee, {
|
|
210
|
+
onTokenSelect: me,
|
|
207
211
|
onError: ae,
|
|
212
|
+
allowedTokens: at,
|
|
213
|
+
allowedTokenKeys: ot,
|
|
214
|
+
allowedTokenRestrictedChainIds: rt,
|
|
215
|
+
allowedChainIds: re,
|
|
208
216
|
showContinueButton: !1,
|
|
209
217
|
compactMode: !1,
|
|
210
218
|
allSupportedTokens: !1,
|
|
211
219
|
fundMethod: "wallet",
|
|
212
220
|
chainListScreen: !0,
|
|
213
221
|
onNavigateToChainList: () => {
|
|
214
|
-
_(!1),
|
|
222
|
+
_(!1), Ie(!0);
|
|
215
223
|
},
|
|
216
|
-
recentTokens:
|
|
217
|
-
onRecentTokenSelect:
|
|
224
|
+
recentTokens: be,
|
|
225
|
+
onRecentTokenSelect: Be
|
|
218
226
|
})]
|
|
219
|
-
}) :
|
|
220
|
-
|
|
227
|
+
}) : Ct ? /* @__PURE__ */ t(je, { onBack: () => {
|
|
228
|
+
Oe(!1), V(!0);
|
|
221
229
|
} }) : ne ? /* @__PURE__ */ a("div", {
|
|
222
230
|
className: "space-y-2",
|
|
223
|
-
children: [/* @__PURE__ */ t(
|
|
231
|
+
children: [/* @__PURE__ */ t(pe, {
|
|
224
232
|
onBack: () => V(!1),
|
|
225
233
|
headerContent: "Select Token to Receive",
|
|
226
234
|
headerContentAlign: "left"
|
|
227
|
-
}), /* @__PURE__ */ t(
|
|
228
|
-
onTokenSelect:
|
|
235
|
+
}), /* @__PURE__ */ t(Ee, {
|
|
236
|
+
onTokenSelect: fe,
|
|
229
237
|
onError: ae,
|
|
230
|
-
allowedTokens: st,
|
|
231
238
|
showContinueButton: !1,
|
|
232
239
|
compactMode: !1,
|
|
233
240
|
allSupportedTokens: !0,
|
|
234
241
|
fundMethod: "wallet",
|
|
235
242
|
chainListScreen: !0,
|
|
236
243
|
onNavigateToChainList: () => {
|
|
237
|
-
V(!1),
|
|
244
|
+
V(!1), Oe(!0);
|
|
238
245
|
},
|
|
239
|
-
recentTokens:
|
|
240
|
-
onRecentTokenSelect:
|
|
246
|
+
recentTokens: be,
|
|
247
|
+
onRecentTokenSelect: Be
|
|
241
248
|
})]
|
|
242
249
|
}) : /* @__PURE__ */ a("div", {
|
|
243
250
|
className: "space-y-2",
|
|
244
|
-
children: [/* @__PURE__ */ t(
|
|
251
|
+
children: [/* @__PURE__ */ t(pe, {
|
|
245
252
|
headerContent: "Withdraw",
|
|
246
253
|
headerContentAlign: "left",
|
|
247
254
|
showAccountActions: !0,
|
|
248
255
|
customActions: /* @__PURE__ */ a("button", {
|
|
249
256
|
type: "button",
|
|
250
|
-
onClick: () =>
|
|
257
|
+
onClick: () => st("swap", { backTarget: "withdraw" }),
|
|
251
258
|
className: "flex h-8 px-3 justify-center items-center gap-1.5 rounded-full bg-gray-50 dark:bg-gray-700 cursor-pointer transition-colors text-gray-900 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",
|
|
252
259
|
title: "Swap",
|
|
253
|
-
children: [/* @__PURE__ */ t(
|
|
260
|
+
children: [/* @__PURE__ */ t(Zt, { className: "h-4 w-4" }), /* @__PURE__ */ t("span", {
|
|
254
261
|
className: "text-sm font-medium",
|
|
255
262
|
children: "Swap"
|
|
256
263
|
})]
|
|
257
264
|
})
|
|
258
265
|
}), /* @__PURE__ */ a("form", {
|
|
259
266
|
onSubmit: (e) => {
|
|
260
|
-
e.preventDefault(), l.console.log("[trails-sdk] Calling handleSubmit from Withdraw"),
|
|
267
|
+
e.preventDefault(), l.console.log("[trails-sdk] Calling handleSubmit from Withdraw"), Tt(e);
|
|
261
268
|
},
|
|
262
269
|
className: "space-y-1",
|
|
263
270
|
children: [
|
|
@@ -268,13 +275,13 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
268
275
|
className: "flex items-center justify-center",
|
|
269
276
|
children: /* @__PURE__ */ a("div", {
|
|
270
277
|
className: "flex items-center justify-center space-x-2",
|
|
271
|
-
children: [/* @__PURE__ */ t(
|
|
272
|
-
ref:
|
|
278
|
+
children: [/* @__PURE__ */ t(Vt, {
|
|
279
|
+
ref: de,
|
|
273
280
|
value: Y,
|
|
274
281
|
onChange: (e) => {
|
|
275
282
|
const n = e.target.value;
|
|
276
|
-
if (
|
|
277
|
-
|
|
283
|
+
if (ve(!0), j.current && clearTimeout(j.current), j.current = setTimeout(() => {
|
|
284
|
+
ve(!1);
|
|
278
285
|
}, 300), n === "") {
|
|
279
286
|
g(""), h("");
|
|
280
287
|
return;
|
|
@@ -282,27 +289,27 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
282
289
|
const s = new RegExp(`^\\d*\\.?\\d{0,${k ? 2 : 8}}$`);
|
|
283
290
|
if (n.match(s))
|
|
284
291
|
if (g(n), k && u > 0) {
|
|
285
|
-
const m =
|
|
286
|
-
|
|
287
|
-
} else
|
|
292
|
+
const m = We(n), b = ie.getRate();
|
|
293
|
+
Me(((b && b.currency !== "USD" ? m / b.rate : m) / u).toString());
|
|
294
|
+
} else Me(n);
|
|
288
295
|
},
|
|
289
|
-
isLoading:
|
|
296
|
+
isLoading: I && p === f.EXACT_OUTPUT,
|
|
290
297
|
variant: "default",
|
|
291
298
|
inputSize: "large",
|
|
292
299
|
textAlign: "center",
|
|
293
300
|
isFiatInput: k,
|
|
294
|
-
currencySymbol: k ?
|
|
295
|
-
}),
|
|
301
|
+
currencySymbol: k ? Dt[ie.getRate()?.currency || "USD"] || "$" : i?.symbol
|
|
302
|
+
}), I && p === f.EXACT_OUTPUT && /* @__PURE__ */ t(ge, {})]
|
|
296
303
|
})
|
|
297
304
|
}),
|
|
298
|
-
!
|
|
305
|
+
!F && /* @__PURE__ */ t("div", {
|
|
299
306
|
className: "mt-3 flex justify-center",
|
|
300
307
|
children: /* @__PURE__ */ a("div", {
|
|
301
308
|
className: "flex items-center space-x-1 text-sm",
|
|
302
309
|
children: [/* @__PURE__ */ t("span", {
|
|
303
310
|
className: "text-gray-500 dark:text-gray-400",
|
|
304
311
|
children: "To:"
|
|
305
|
-
}), /* @__PURE__ */ t(
|
|
312
|
+
}), /* @__PURE__ */ t(Ve, { selectedRecipient: L })]
|
|
306
313
|
})
|
|
307
314
|
}),
|
|
308
315
|
/* @__PURE__ */ t("div", {
|
|
@@ -313,9 +320,9 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
313
320
|
type: "button",
|
|
314
321
|
onClick: () => {
|
|
315
322
|
const e = !k;
|
|
316
|
-
if (
|
|
323
|
+
if (ft(e), Y && u > 0) {
|
|
317
324
|
const n = parseFloat(Y);
|
|
318
|
-
if (
|
|
325
|
+
if (Ot(n)) {
|
|
319
326
|
const s = ie.getRate();
|
|
320
327
|
if (e) {
|
|
321
328
|
const m = n * u, b = s && s.currency !== "USD" ? m * s.rate : m;
|
|
@@ -350,7 +357,7 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
350
357
|
strokeLinejoin: "round"
|
|
351
358
|
})]
|
|
352
359
|
}), (() => {
|
|
353
|
-
const e =
|
|
360
|
+
const e = We(Y);
|
|
354
361
|
if (k) {
|
|
355
362
|
const n = ie.getRate(), s = n && n.currency !== "USD" ? e / n.rate : e, m = u > 0 ? s / u : 0, b = m > 0 ? `${m.toFixed(8)} ${i?.symbol || ""}` : `0 ${i?.symbol || ""}`;
|
|
356
363
|
return /* @__PURE__ */ a("span", {
|
|
@@ -360,8 +367,8 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
360
367
|
} else {
|
|
361
368
|
const n = e * u;
|
|
362
369
|
return /* @__PURE__ */ a("span", {
|
|
363
|
-
title:
|
|
364
|
-
children: ["≈ ",
|
|
370
|
+
title: Rt(n),
|
|
371
|
+
children: ["≈ ", Bt(n)]
|
|
365
372
|
});
|
|
366
373
|
}
|
|
367
374
|
})()]
|
|
@@ -370,13 +377,13 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
370
377
|
}),
|
|
371
378
|
i && Z && /* @__PURE__ */ t("div", {
|
|
372
379
|
className: "mt-3 flex justify-center items-center space-x-2",
|
|
373
|
-
children: /* @__PURE__ */ t(
|
|
380
|
+
children: /* @__PURE__ */ t(Pt, {
|
|
374
381
|
userBalance: Z,
|
|
375
382
|
userBalanceRaw: J,
|
|
376
|
-
decimals:
|
|
383
|
+
decimals: gt,
|
|
377
384
|
isNativeToken: i.isNativeToken ?? !1,
|
|
378
385
|
gasCostFormatted: r?.gasCostFormatted,
|
|
379
|
-
chainId:
|
|
386
|
+
chainId: xe || void 0,
|
|
380
387
|
onAmountSelect: (e) => {
|
|
381
388
|
if (W(f.EXACT_INPUT), h(e), E(""), k && u > 0) {
|
|
382
389
|
const n = parseFloat(e) * u;
|
|
@@ -399,10 +406,10 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
399
406
|
style: { minWidth: "138px" },
|
|
400
407
|
children: [/* @__PURE__ */ t("span", {
|
|
401
408
|
className: "text-sm font-medium text-black dark:text-white",
|
|
402
|
-
children:
|
|
403
|
-
}),
|
|
409
|
+
children: F ? "From" : "Withdraw"
|
|
410
|
+
}), F && /* @__PURE__ */ t("div", {
|
|
404
411
|
className: "mt-1",
|
|
405
|
-
children: /* @__PURE__ */ t(
|
|
412
|
+
children: /* @__PURE__ */ t(Gt, { sendToScreen: {
|
|
406
413
|
screen: "select-funding-wallet",
|
|
407
414
|
backScreen: "withdraw"
|
|
408
415
|
} })
|
|
@@ -414,10 +421,10 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
414
421
|
style: { minWidth: "138px" },
|
|
415
422
|
children: [/* @__PURE__ */ t("span", {
|
|
416
423
|
className: "text-sm font-medium text-black dark:text-white",
|
|
417
|
-
children:
|
|
418
|
-
}),
|
|
424
|
+
children: F ? "To" : "Receive"
|
|
425
|
+
}), F && /* @__PURE__ */ t("div", {
|
|
419
426
|
className: "mt-1",
|
|
420
|
-
children: /* @__PURE__ */ t(
|
|
427
|
+
children: /* @__PURE__ */ t(Ve, { selectedRecipient: L })
|
|
421
428
|
})]
|
|
422
429
|
})
|
|
423
430
|
]
|
|
@@ -427,11 +434,11 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
427
434
|
children: [
|
|
428
435
|
/* @__PURE__ */ t("div", {
|
|
429
436
|
className: "min-w-[138px] flex flex-col mr-0 py-3.5",
|
|
430
|
-
children: /* @__PURE__ */ t(
|
|
437
|
+
children: /* @__PURE__ */ t(_e, {
|
|
431
438
|
token: i,
|
|
432
|
-
chainId:
|
|
439
|
+
chainId: xe,
|
|
433
440
|
onSelect: () => _(!0),
|
|
434
|
-
unselectable: !!
|
|
441
|
+
unselectable: !!w,
|
|
435
442
|
fullWidth: !0
|
|
436
443
|
})
|
|
437
444
|
}),
|
|
@@ -456,9 +463,9 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
456
463
|
}),
|
|
457
464
|
/* @__PURE__ */ t("div", {
|
|
458
465
|
className: "min-w-[138px] flex",
|
|
459
|
-
children: /* @__PURE__ */ t(
|
|
460
|
-
token:
|
|
461
|
-
chainId:
|
|
466
|
+
children: /* @__PURE__ */ t(_e, {
|
|
467
|
+
token: Le,
|
|
468
|
+
chainId: Le?.chainId,
|
|
462
469
|
onSelect: () => V(!0),
|
|
463
470
|
unselectable: !!d,
|
|
464
471
|
fullWidth: !0
|
|
@@ -468,10 +475,10 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
468
475
|
}),
|
|
469
476
|
i && /* @__PURE__ */ t("div", {
|
|
470
477
|
className: "mt-3 pl-1 text-xs text-left",
|
|
471
|
-
children: r?.noSufficientBalance || !
|
|
478
|
+
children: r?.noSufficientBalance || !we && J !== void 0 && J !== "" && BigInt(J) === 0n ? /* @__PURE__ */ t("span", {
|
|
472
479
|
style: { color: "#F97316" },
|
|
473
480
|
children: "Insufficient funds"
|
|
474
|
-
}) : Z ? /* @__PURE__ */ a(
|
|
481
|
+
}) : Z ? /* @__PURE__ */ a(Yt, { children: [/* @__PURE__ */ t("span", {
|
|
475
482
|
className: "text-black dark:text-white notranslate",
|
|
476
483
|
translate: "no",
|
|
477
484
|
children: "Balance:"
|
|
@@ -480,14 +487,14 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
480
487
|
translate: "no",
|
|
481
488
|
children: [
|
|
482
489
|
" ",
|
|
483
|
-
|
|
484
|
-
|
|
490
|
+
Te ? `${St || Z} ${i.symbol}` : "••••••",
|
|
491
|
+
De && Te ? /* @__PURE__ */ a("span", {
|
|
485
492
|
className: "notranslate",
|
|
486
493
|
translate: "no",
|
|
487
494
|
children: [
|
|
488
495
|
" ",
|
|
489
496
|
"(",
|
|
490
|
-
|
|
497
|
+
bt || De,
|
|
491
498
|
")"
|
|
492
499
|
]
|
|
493
500
|
}) : null
|
|
@@ -496,43 +503,43 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
496
503
|
})
|
|
497
504
|
]
|
|
498
505
|
}),
|
|
499
|
-
/* @__PURE__ */ t(
|
|
500
|
-
processedFeeOptions:
|
|
501
|
-
selectedFeeOption:
|
|
502
|
-
setSelectedFeeOption: (e) =>
|
|
506
|
+
/* @__PURE__ */ t(Kt, {
|
|
507
|
+
processedFeeOptions: kt || [],
|
|
508
|
+
selectedFeeOption: ce,
|
|
509
|
+
setSelectedFeeOption: (e) => xt(e),
|
|
503
510
|
chainId: i?.chainId,
|
|
504
|
-
isRefetching:
|
|
511
|
+
isRefetching: I,
|
|
505
512
|
originTokenInfo: {
|
|
506
|
-
originToken:
|
|
507
|
-
originTokenBalance:
|
|
508
|
-
originTokenAmount:
|
|
509
|
-
isLoadingBalance:
|
|
513
|
+
originToken: K ?? i,
|
|
514
|
+
originTokenBalance: K?.balance ?? i?.balance ?? "0",
|
|
515
|
+
originTokenAmount: z,
|
|
516
|
+
isLoadingBalance: we
|
|
510
517
|
}
|
|
511
518
|
}),
|
|
512
|
-
r && !
|
|
519
|
+
r && !I && /* @__PURE__ */ t("div", {
|
|
513
520
|
className: "mb-4",
|
|
514
|
-
children: /* @__PURE__ */ t(
|
|
521
|
+
children: /* @__PURE__ */ t($t, {
|
|
515
522
|
quote: r,
|
|
516
523
|
showContent: !0,
|
|
517
524
|
swapMode: !1,
|
|
518
|
-
isRefetching:
|
|
525
|
+
isRefetching: I,
|
|
519
526
|
showInsufficientFunds: !1
|
|
520
527
|
})
|
|
521
528
|
}),
|
|
522
529
|
/* @__PURE__ */ t("button", {
|
|
523
530
|
type: "submit",
|
|
524
|
-
disabled: !
|
|
525
|
-
originToken:
|
|
526
|
-
originTokenBalance:
|
|
527
|
-
originTokenAmount:
|
|
531
|
+
disabled: !pt || Ae || !wt || !yt || I || !r || r?.noSufficientBalance || (ce ? qt(ce, {
|
|
532
|
+
originToken: K ?? i,
|
|
533
|
+
originTokenBalance: K?.balance ?? i?.balance ?? "0",
|
|
534
|
+
originTokenAmount: z
|
|
528
535
|
}) : !1),
|
|
529
536
|
className: "w-full font-semibold py-4 px-4 trails-border-radius-button transition-colors bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white disabled:text-gray-500 disabled:cursor-not-allowed cursor-pointer relative",
|
|
530
|
-
children:
|
|
537
|
+
children: Ae ? /* @__PURE__ */ a("div", {
|
|
531
538
|
className: "flex items-center justify-center",
|
|
532
|
-
children: [/* @__PURE__ */ t(
|
|
533
|
-
}) : r?.noSufficientBalance ? "Insufficient Balance" :
|
|
539
|
+
children: [/* @__PURE__ */ t(ge, { className: "mr-2" }), /* @__PURE__ */ t("span", { children: ee })]
|
|
540
|
+
}) : r?.noSufficientBalance ? "Insufficient Balance" : z ? ee === "Getting quote..." ? /* @__PURE__ */ a("div", {
|
|
534
541
|
className: "flex items-center justify-center",
|
|
535
|
-
children: [/* @__PURE__ */ t(
|
|
542
|
+
children: [/* @__PURE__ */ t(ge, { className: "mr-2" }), /* @__PURE__ */ t("span", { children: ee })]
|
|
536
543
|
}) : ee || "Make withdrawal" : "Enter amount"
|
|
537
544
|
})
|
|
538
545
|
]
|
|
@@ -540,5 +547,5 @@ var Rn = ({ selectedToken: Ve, onSend: $e, onConfirm: Pe, onComplete: ge, accoun
|
|
|
540
547
|
});
|
|
541
548
|
};
|
|
542
549
|
export {
|
|
543
|
-
|
|
550
|
+
jn as Withdraw
|
|
544
551
|
};
|