0xtrails 0.6.6 → 0.7.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/dist/aave.d.ts +10 -2
- package/dist/aave.d.ts.map +1 -1
- package/dist/analytics.d.ts +26 -0
- package/dist/analytics.d.ts.map +1 -1
- package/dist/{ccip-CbJrlK-L.js → ccip-fConRNoG.js} +21 -21
- package/dist/chains.d.ts +23 -8
- package/dist/chains.d.ts.map +1 -1
- package/dist/constants.d.ts +5 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/customTokens.d.ts +12 -0
- package/dist/customTokens.d.ts.map +1 -0
- package/dist/decoders.d.ts +2 -2
- package/dist/decoders.d.ts.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/fees.d.ts +37 -2
- package/dist/fees.d.ts.map +1 -1
- package/dist/gasless.d.ts +15 -36
- package/dist/gasless.d.ts.map +1 -1
- package/dist/{index-w7_dK4c5.js → index-BbajxCG_.js} +59269 -77146
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +828 -359
- package/dist/indexerClient.d.ts.map +1 -1
- package/dist/intentReceiptMonitor.d.ts +1 -1
- package/dist/intentReceiptMonitor.d.ts.map +1 -1
- package/dist/intentReceiptPoller.d.ts +1 -1
- package/dist/intentReceiptPoller.d.ts.map +1 -1
- package/dist/intents.d.ts +3 -2
- package/dist/intents.d.ts.map +1 -1
- package/dist/mode.d.ts +1 -1
- package/dist/mode.d.ts.map +1 -1
- package/dist/mutations.d.ts +2 -2
- package/dist/mutations.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +2 -2
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/prices.d.ts +1 -1
- package/dist/prices.d.ts.map +1 -1
- package/dist/sequenceWallet.d.ts +2 -2
- package/dist/sequenceWallet.d.ts.map +1 -1
- package/dist/time.d.ts +6 -0
- package/dist/time.d.ts.map +1 -1
- package/dist/tokenBalances.d.ts +40 -25
- package/dist/tokenBalances.d.ts.map +1 -1
- package/dist/tokens.d.ts +54 -14
- package/dist/tokens.d.ts.map +1 -1
- package/dist/trailsClient.d.ts +1 -1
- package/dist/trailsClient.d.ts.map +1 -1
- package/dist/trailsRouter.d.ts +2 -1
- package/dist/trailsRouter.d.ts.map +1 -1
- 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 +2 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/execution/transactionState.d.ts +1 -1
- package/dist/transactionIntent/execution/transactionState.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/crossChain.d.ts +5 -3
- package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +5 -3
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -1
- package/dist/transactionIntent/quote/feeExtractors.d.ts +1 -6
- package/dist/transactionIntent/quote/feeExtractors.d.ts.map +1 -1
- package/dist/transactionIntent/quote/normalizeQuote.d.ts +4 -2
- package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.d.ts +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/types.d.ts +28 -5
- package/dist/transactionIntent/types.d.ts.map +1 -1
- package/dist/transactionIntent/utils/testnetHelpers.d.ts +0 -1
- package/dist/transactionIntent/utils/testnetHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/validators.d.ts +0 -2
- package/dist/transactionIntent/validators.d.ts.map +1 -1
- package/dist/transactions.d.ts +2 -2
- package/dist/transactions.d.ts.map +1 -1
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/wallets.d.ts +1 -0
- package/dist/wallets.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/AddressWalletIcon.d.ts +6 -0
- package/dist/widget/components/AddressWalletIcon.d.ts.map +1 -0
- package/dist/widget/components/ChainFilterDropdown.d.ts +2 -6
- package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
- package/dist/widget/components/ChainImage.d.ts.map +1 -1
- package/dist/widget/components/ChainList.d.ts +0 -5
- package/dist/widget/components/ChainList.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts +6 -6
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
- package/dist/widget/components/DebugMenu.d.ts +1 -1
- package/dist/widget/components/DebugMenu.d.ts.map +1 -1
- package/dist/widget/components/DebugScreensList.d.ts.map +1 -1
- package/dist/widget/components/DepositTracker.d.ts.map +1 -1
- package/dist/widget/components/Earn.d.ts +5 -5
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/FeeOption.d.ts +1 -1
- package/dist/widget/components/FeeOption.d.ts.map +1 -1
- package/dist/widget/components/FeeOptions.d.ts +2 -2
- package/dist/widget/components/FeeOptions.d.ts.map +1 -1
- package/dist/widget/components/Footer.d.ts +1 -1
- package/dist/widget/components/Footer.d.ts.map +1 -1
- package/dist/widget/components/Fund.d.ts +5 -5
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundMethods.d.ts +0 -1
- package/dist/widget/components/FundMethods.d.ts.map +1 -1
- package/dist/widget/components/FundSwap.d.ts +6 -6
- package/dist/widget/components/FundSwap.d.ts.map +1 -1
- package/dist/widget/components/HookModalContent.d.ts +8 -0
- package/dist/widget/components/HookModalContent.d.ts.map +1 -0
- package/dist/widget/components/OriginSelectionAmount.d.ts +11 -0
- package/dist/widget/components/OriginSelectionAmount.d.ts.map +1 -0
- package/dist/widget/components/Pay.d.ts +5 -5
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts +5 -5
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/components/PoolWithdraw.d.ts +3 -3
- package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Receipt.d.ts +2 -1
- package/dist/widget/components/Receipt.d.ts.map +1 -1
- package/dist/widget/components/RecentTokens.d.ts +4 -4
- package/dist/widget/components/RecentTokens.d.ts.map +1 -1
- package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/ShadowPortal.d.ts +6 -0
- package/dist/widget/components/ShadowPortal.d.ts.map +1 -0
- package/dist/widget/components/Swap.d.ts +6 -6
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/ThemeProvider.d.ts +1 -1
- package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
- package/dist/widget/components/TokenList.d.ts +3 -4
- package/dist/widget/components/TokenList.d.ts.map +1 -1
- package/dist/widget/components/TokenSelector.d.ts +3 -4
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/Tooltip.d.ts +6 -1
- package/dist/widget/components/Tooltip.d.ts.map +1 -1
- package/dist/widget/components/TrailsHookModal.d.ts +10 -0
- package/dist/widget/components/TrailsHookModal.d.ts.map +1 -0
- package/dist/widget/components/WaasFeeOptions.d.ts +3 -0
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/components/WidgetProviders.d.ts +14 -0
- package/dist/widget/components/WidgetProviders.d.ts.map +1 -0
- package/dist/widget/css/compiled.css +1 -1
- package/dist/widget/hooks/useAddressWalletIcon.d.ts +10 -0
- package/dist/widget/hooks/useAddressWalletIcon.d.ts.map +1 -0
- package/dist/widget/hooks/useBalanceVisible.d.ts +1 -1
- package/dist/widget/hooks/useBalanceVisible.d.ts.map +1 -1
- package/dist/widget/hooks/useChainFilter.d.ts +1 -1
- package/dist/widget/hooks/useChainFilter.d.ts.map +1 -1
- package/dist/widget/hooks/useCheckout.d.ts +13 -1
- package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
- package/dist/widget/hooks/useConnector.d.ts +4 -0
- package/dist/widget/hooks/useConnector.d.ts.map +1 -0
- package/dist/widget/hooks/useCurrentScreen.d.ts +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts.map +1 -1
- package/dist/widget/hooks/useCustomTokenFetch.d.ts +19 -0
- package/dist/widget/hooks/useCustomTokenFetch.d.ts.map +1 -0
- package/dist/widget/hooks/useCustomTokenSearch.d.ts +20 -0
- package/dist/widget/hooks/useCustomTokenSearch.d.ts.map +1 -0
- package/dist/widget/hooks/useDebounce.d.ts +10 -0
- package/dist/widget/hooks/useDebounce.d.ts.map +1 -0
- package/dist/widget/hooks/useDebugScreens.d.ts +7 -2
- package/dist/widget/hooks/useDebugScreens.d.ts.map +1 -1
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts +3 -19
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -1
- package/dist/widget/hooks/useDestinationSelectedToken.d.ts +1 -14
- package/dist/widget/hooks/useDestinationSelectedToken.d.ts.map +1 -1
- package/dist/widget/hooks/useEarnPool.d.ts +1 -1
- package/dist/widget/hooks/useEarnPool.d.ts.map +1 -1
- package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/hooks/useIsMobile.d.ts +5 -0
- package/dist/widget/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/widget/hooks/useMode.d.ts +2 -2
- package/dist/widget/hooks/useMode.d.ts.map +1 -1
- package/dist/widget/hooks/useOriginSelectedToken.d.ts +2 -15
- package/dist/widget/hooks/useOriginSelectedToken.d.ts.map +1 -1
- package/dist/widget/hooks/usePayMessage.d.ts.map +1 -1
- package/dist/widget/hooks/usePriceImpactWarning.d.ts +1 -1
- package/dist/widget/hooks/usePriceImpactWarning.d.ts.map +1 -1
- package/dist/widget/hooks/useQuote.d.ts +173 -4
- package/dist/widget/hooks/useQuote.d.ts.map +1 -1
- package/dist/widget/hooks/useRecentTokens.d.ts +3 -3
- package/dist/widget/hooks/useRecentTokens.d.ts.map +1 -1
- package/dist/widget/hooks/useRecipients.d.ts +1 -1
- package/dist/widget/hooks/useRecipients.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedFeeOption.d.ts +2 -2
- package/dist/widget/hooks/useSelectedFeeOption.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedFundMethod.d.ts +1 -1
- package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedRecipient.d.ts +1 -1
- package/dist/widget/hooks/useSelectedRecipient.d.ts.map +1 -1
- package/dist/widget/hooks/useSendForm.d.ts +9 -31
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/hooks/useSwapAmount.d.ts +1 -1
- package/dist/widget/hooks/useSwapAmount.d.ts.map +1 -1
- package/dist/widget/hooks/useTheme.d.ts +1 -1
- package/dist/widget/hooks/useTheme.d.ts.map +1 -1
- package/dist/widget/hooks/useTokenList.d.ts +7 -31
- package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
- package/dist/widget/hooks/useTrailsSendTransaction.d.ts +83 -0
- package/dist/widget/hooks/useTrailsSendTransaction.d.ts.map +1 -0
- package/dist/widget/hooks/useWalletConnectUri.d.ts +11 -0
- package/dist/widget/hooks/useWalletConnectUri.d.ts.map +1 -0
- package/dist/widget/hooks/useWidgetProps.d.ts +5 -0
- package/dist/widget/hooks/useWidgetProps.d.ts.map +1 -1
- package/dist/widget/index.d.ts +2 -0
- package/dist/widget/index.d.ts.map +1 -1
- package/dist/widget/index.js +8 -5
- package/dist/widget/providers/TrailsModalProvider.d.ts +65 -0
- package/dist/widget/providers/TrailsModalProvider.d.ts.map +1 -0
- package/dist/widget/providers/TrailsProvider.d.ts +1 -1
- package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
- package/dist/widget/types.d.ts +11 -18
- package/dist/widget/types.d.ts.map +1 -1
- package/dist/widget/widget.d.ts +20 -11
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +45 -49
- package/src/aave.ts +387 -138
- package/src/analytics.ts +208 -2
- package/src/chains.ts +65 -64
- package/src/constants.ts +18 -14
- package/src/customTokens.ts +151 -0
- package/src/decoders.ts +4 -7
- package/src/error.ts +7 -3
- package/src/fees.ts +239 -125
- package/src/gasless.ts +54 -108
- package/src/index.ts +29 -9
- package/src/indexerClient.ts +2 -0
- package/src/intentReceiptMonitor.ts +1 -4
- package/src/intentReceiptPoller.ts +2 -2
- package/src/intents.ts +16 -5
- package/src/mode.ts +1 -1
- package/src/mutations.ts +7 -3
- package/src/prepareSend.ts +19 -14
- package/src/prices.ts +1 -1
- package/src/sequenceWallet.ts +2 -2
- package/src/time.ts +28 -0
- package/src/tokenBalances.ts +348 -153
- package/src/tokens.ts +393 -142
- package/src/trailsClient.ts +1 -1
- package/src/trailsRouter.ts +4 -5
- package/src/transactionIntent/deposits/depositOrchestrator.ts +6 -2
- package/src/transactionIntent/deposits/gaslessDeposit.ts +13 -7
- package/src/transactionIntent/deposits/standardDeposit.ts +1 -1
- package/src/transactionIntent/execution/transactionState.ts +1 -1
- package/src/transactionIntent/handlers/crossChain.ts +75 -37
- package/src/transactionIntent/handlers/sameChainSameToken.ts +66 -20
- package/src/transactionIntent/quote/feeExtractors.ts +1 -29
- package/src/transactionIntent/quote/normalizeQuote.ts +99 -7
- package/src/transactionIntent/quote/quoteHelpers.ts +1 -1
- package/src/transactionIntent/types.ts +31 -6
- package/src/transactionIntent/utils/testnetHelpers.ts +0 -5
- package/src/transactionIntent/validators.ts +0 -30
- package/src/transactions.ts +3 -3
- package/src/utils.ts +18 -0
- package/src/wallets.ts +32 -10
- package/src/widget/compiled.css +1 -1
- package/src/widget/components/AccountIntentTransactionHistory.tsx +2 -1
- package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +2 -2
- package/src/widget/components/AddressWalletIcon.tsx +29 -0
- package/src/widget/components/ChainFilterDropdown.tsx +2 -8
- package/src/widget/components/ChainImage.tsx +8 -5
- package/src/widget/components/ChainList.tsx +6 -8
- package/src/widget/components/ClassicSwap.tsx +93 -85
- package/src/widget/components/ConnectWallet.tsx +1 -2
- package/src/widget/components/ConnectedWallets.tsx +17 -4
- package/src/widget/components/DebugMenu.tsx +2 -2
- package/src/widget/components/DebugScreensList.tsx +0 -1
- package/src/widget/components/DepositTracker.tsx +20 -34
- package/src/widget/components/Earn.tsx +7 -6
- package/src/widget/components/FeeOption.tsx +4 -4
- package/src/widget/components/FeeOptions.tsx +19 -39
- package/src/widget/components/Footer.tsx +1 -1
- package/src/widget/components/Fund.tsx +23 -119
- package/src/widget/components/FundMethods.tsx +9 -6
- package/src/widget/components/FundSwap.tsx +6 -5
- package/src/widget/components/FundingMethodSelectorButton.tsx +2 -2
- package/src/widget/components/HookModalContent.tsx +306 -0
- package/src/widget/components/Modal.tsx +1 -1
- package/src/widget/components/OriginSelectionAmount.tsx +135 -0
- package/src/widget/components/Pay.tsx +66 -124
- package/src/widget/components/PoolDeposit.tsx +11 -55
- package/src/widget/components/PoolWithdraw.tsx +3 -3
- package/src/widget/components/QuoteDetails.tsx +473 -728
- package/src/widget/components/Receipt.tsx +74 -7
- package/src/widget/components/RecentTokens.tsx +8 -8
- package/src/widget/components/RecipientSelectorButton.tsx +4 -2
- package/src/widget/components/ScreenHeader.tsx +2 -2
- package/src/widget/components/SearchInputField.tsx +1 -1
- package/src/widget/components/ShadowPortal.tsx +58 -0
- package/src/widget/components/Swap.tsx +6 -5
- package/src/widget/components/ThemeProvider.tsx +1 -1
- package/src/widget/components/TokenList.tsx +3 -4
- package/src/widget/components/TokenSelector.tsx +211 -80
- package/src/widget/components/Tooltip.tsx +18 -7
- package/src/widget/components/TrailsHookModal.tsx +118 -0
- package/src/widget/components/WaasFeeOptions.tsx +333 -138
- package/src/widget/components/WalletConfirmation.tsx +7 -2
- package/src/widget/components/WalletConnect.tsx +197 -235
- package/src/widget/components/WidgetProviders.tsx +75 -0
- package/src/widget/hooks/useAddressWalletIcon.ts +53 -0
- package/src/widget/hooks/useBalanceVisible.tsx +1 -1
- package/src/widget/hooks/useChainFilter.tsx +1 -1
- package/src/widget/hooks/useCheckout.ts +13 -1
- package/src/widget/hooks/useConnector.tsx +18 -0
- package/src/widget/hooks/useCurrentScreen.tsx +3 -3
- package/src/widget/hooks/useCustomTokenFetch.tsx +72 -0
- package/src/widget/hooks/useCustomTokenSearch.tsx +402 -0
- package/src/widget/hooks/useDebounce.ts +25 -0
- package/src/widget/hooks/useDebugScreens.ts +26 -10
- package/src/widget/hooks/useDefaultTokenSelection.tsx +99 -143
- package/src/widget/hooks/useDestinationSelectedToken.tsx +1 -14
- package/src/widget/hooks/useEarnPool.tsx +1 -1
- package/src/widget/hooks/useIntentTransactionHistory.ts +20 -11
- package/src/widget/hooks/useIsMobile.tsx +50 -0
- package/src/widget/hooks/useMode.ts +2 -3
- package/src/widget/hooks/useOriginSelectedToken.tsx +2 -15
- package/src/widget/hooks/usePayMessage.tsx +31 -11
- package/src/widget/hooks/usePriceImpactWarning.ts +1 -1
- package/src/widget/hooks/useQuote.ts +189 -6
- package/src/widget/hooks/useRecentTokens.ts +6 -6
- package/src/widget/hooks/useRecipients.ts +1 -1
- package/src/widget/hooks/useSelectedFeeOption.tsx +2 -2
- package/src/widget/hooks/useSelectedFundMethod.tsx +1 -1
- package/src/widget/hooks/useSelectedRecipient.tsx +1 -1
- package/src/widget/hooks/useSendForm.ts +328 -152
- package/src/widget/hooks/useSwapAmount.tsx +1 -1
- package/src/widget/hooks/useTheme.tsx +1 -1
- package/src/widget/hooks/useTokenList.ts +672 -400
- package/src/widget/hooks/useTrailsSendTransaction.ts +949 -0
- package/src/widget/hooks/useWalletConnectUri.tsx +228 -0
- package/src/widget/hooks/useWidgetProps.tsx +3 -1
- package/src/widget/index.tsx +12 -0
- package/src/widget/providers/TrailsModalProvider.tsx +195 -0
- package/src/widget/providers/TrailsProvider.tsx +9 -3
- package/src/widget/types.ts +12 -20
- package/src/widget/widget.tsx +598 -385
- package/dist/cctp.d.ts +0 -3
- package/dist/cctp.d.ts.map +0 -1
- package/dist/lifi.d.ts +0 -4
- package/dist/lifi.d.ts.map +0 -1
- package/dist/meshconnect.d.ts +0 -171
- package/dist/meshconnect.d.ts.map +0 -1
- package/dist/relaySdk.d.ts +0 -87
- package/dist/relaySdk.d.ts.map +0 -1
- package/dist/widget/components/MeshConnectExchanges.d.ts +0 -7
- package/dist/widget/components/MeshConnectExchanges.d.ts.map +0 -1
- package/dist/widget/components/MeshConnectFlow.d.ts +0 -13
- package/dist/widget/components/MeshConnectFlow.d.ts.map +0 -1
- package/dist/widget/components/MeshConnectIframe.d.ts +0 -15
- package/dist/widget/components/MeshConnectIframe.d.ts.map +0 -1
- package/dist/widget/components/Receive.d.ts +0 -12
- package/dist/widget/components/Receive.d.ts.map +0 -1
- package/dist/widget/hooks/useSelectedMeshExchange.d.ts +0 -14
- package/dist/widget/hooks/useSelectedMeshExchange.d.ts.map +0 -1
- package/src/cctp.ts +0 -54
- package/src/lifi.ts +0 -108
- package/src/meshconnect.ts +0 -531
- package/src/relaySdk.ts +0 -703
- package/src/widget/components/MeshConnectExchanges.tsx +0 -290
- package/src/widget/components/MeshConnectFlow.tsx +0 -90
- package/src/widget/components/MeshConnectIframe.tsx +0 -500
- package/src/widget/components/Receive.tsx +0 -175
- package/src/widget/hooks/useSelectedMeshExchange.tsx +0 -46
|
@@ -2,7 +2,6 @@ import { Search, Loader2, ChevronRight } from "lucide-react"
|
|
|
2
2
|
import { useEffect, useState, useMemo, useRef, useCallback } from "react"
|
|
3
3
|
import type React from "react"
|
|
4
4
|
import type { Account, WalletClient } from "viem"
|
|
5
|
-
import { zeroAddress } from "viem"
|
|
6
5
|
import type { TransactionState } from "../../transactions.js"
|
|
7
6
|
import type { OnCompleteProps } from "../hooks/useSendForm.js"
|
|
8
7
|
import type { CheckoutOnHandlers } from "../hooks/useCheckout.js"
|
|
@@ -29,7 +28,7 @@ import { getChainInfo } from "../../chains.js"
|
|
|
29
28
|
import { FeeOptions } from "./FeeOptions.js"
|
|
30
29
|
import { truncateAddress } from "../../utils.js"
|
|
31
30
|
import type { PrepareSendQuote } from "../../prepareSend.js"
|
|
32
|
-
import type {
|
|
31
|
+
import type { Token } from "../../tokens.js"
|
|
33
32
|
import { logger } from "../../logger.js"
|
|
34
33
|
import { RefundWarning } from "./RefundWarning.js"
|
|
35
34
|
import { TokenSelectorButton } from "./TokenSelectorButton.js"
|
|
@@ -57,7 +56,7 @@ interface PayProps {
|
|
|
57
56
|
setWalletConfirmRetryHandler: (handler: () => Promise<void>) => void
|
|
58
57
|
quoteProvider?: string
|
|
59
58
|
fundMethod?: string
|
|
60
|
-
|
|
59
|
+
onNavigateToOnramp?: (
|
|
61
60
|
props: {
|
|
62
61
|
toTokenSymbol: string
|
|
63
62
|
toTokenAmount: string
|
|
@@ -65,10 +64,11 @@ interface PayProps {
|
|
|
65
64
|
toRecipientAddress: string
|
|
66
65
|
},
|
|
67
66
|
quote?: PrepareSendQuote | null,
|
|
67
|
+
continueSend?: () => Promise<void>,
|
|
68
68
|
) => void
|
|
69
69
|
checkoutOnHandlers?: CheckoutOnHandlers
|
|
70
|
-
recentTokens?:
|
|
71
|
-
onRecentTokenSelect?: (token:
|
|
70
|
+
recentTokens?: Token[]
|
|
71
|
+
onRecentTokenSelect?: (token: Token) => void
|
|
72
72
|
onTrackToken?: (token: any) => void
|
|
73
73
|
toRecipient?: string
|
|
74
74
|
toAmount?: string
|
|
@@ -94,7 +94,7 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
94
94
|
setWalletConfirmRetryHandler,
|
|
95
95
|
quoteProvider,
|
|
96
96
|
fundMethod,
|
|
97
|
-
|
|
97
|
+
onNavigateToOnramp,
|
|
98
98
|
checkoutOnHandlers,
|
|
99
99
|
recentTokens,
|
|
100
100
|
onRecentTokenSelect,
|
|
@@ -220,7 +220,7 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
220
220
|
quoteProvider,
|
|
221
221
|
fundMethod,
|
|
222
222
|
mode,
|
|
223
|
-
|
|
223
|
+
onNavigateToOnramp,
|
|
224
224
|
checkoutOnHandlers,
|
|
225
225
|
})
|
|
226
226
|
|
|
@@ -254,32 +254,13 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
254
254
|
)
|
|
255
255
|
|
|
256
256
|
if (destinationToken) {
|
|
257
|
-
const decimals =
|
|
258
|
-
destinationToken.contractInfo?.decimals ??
|
|
259
|
-
(destinationToken as any)?.decimals
|
|
260
|
-
|
|
261
|
-
const formattedToken = {
|
|
262
|
-
...destinationToken,
|
|
263
|
-
contractInfo: {
|
|
264
|
-
decimals,
|
|
265
|
-
contractAddress: destinationToken.contractAddress,
|
|
266
|
-
symbol: destinationToken.symbol,
|
|
267
|
-
name: destinationToken.name,
|
|
268
|
-
},
|
|
269
|
-
}
|
|
270
|
-
|
|
271
257
|
logger.console.log(
|
|
272
258
|
"[trails-sdk] Auto-selecting destination token from props:",
|
|
273
|
-
|
|
259
|
+
destinationToken,
|
|
274
260
|
)
|
|
275
261
|
|
|
276
|
-
setDestinationToken(
|
|
277
|
-
setSelectedDestToken(
|
|
278
|
-
symbol: destinationToken.symbol,
|
|
279
|
-
name: destinationToken.name,
|
|
280
|
-
imageUrl: destinationToken.imageUrl,
|
|
281
|
-
decimals,
|
|
282
|
-
})
|
|
262
|
+
setDestinationToken(destinationToken)
|
|
263
|
+
setSelectedDestToken(destinationToken)
|
|
283
264
|
|
|
284
265
|
// Set the destination chain
|
|
285
266
|
if (setSelectedDestinationChain) {
|
|
@@ -375,16 +356,7 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
375
356
|
setDestinationToken(defaultDestinationToken as any)
|
|
376
357
|
}
|
|
377
358
|
|
|
378
|
-
|
|
379
|
-
destTokenToUse.contractInfo?.decimals ??
|
|
380
|
-
(destTokenToUse as any)?.decimals
|
|
381
|
-
|
|
382
|
-
setSelectedDestToken({
|
|
383
|
-
symbol: destTokenToUse.symbol,
|
|
384
|
-
name: destTokenToUse.name,
|
|
385
|
-
imageUrl: destTokenToUse.imageUrl,
|
|
386
|
-
decimals,
|
|
387
|
-
})
|
|
359
|
+
setSelectedDestToken(destTokenToUse)
|
|
388
360
|
|
|
389
361
|
// Also set the destination chain if available
|
|
390
362
|
if (setSelectedDestinationChain && destTokenToUse.chainId) {
|
|
@@ -458,20 +430,9 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
458
430
|
const inputStyles = useDynamicInputStyles({ inputValue: displayAmount })
|
|
459
431
|
|
|
460
432
|
const handleOriginTokenSelect = useCallback(
|
|
461
|
-
(token:
|
|
462
|
-
const formattedToken = {
|
|
463
|
-
...token,
|
|
464
|
-
decimals: token.contractInfo?.decimals || token.decimals,
|
|
465
|
-
contractInfo: {
|
|
466
|
-
decimals: token.contractInfo?.decimals || token.decimals,
|
|
467
|
-
contractAddress: token.contractAddress,
|
|
468
|
-
symbol: token.symbol,
|
|
469
|
-
name: token.name,
|
|
470
|
-
},
|
|
471
|
-
}
|
|
472
|
-
|
|
433
|
+
(token: Token) => {
|
|
473
434
|
// Update global origin token state
|
|
474
|
-
setOriginToken(
|
|
435
|
+
setOriginToken(token)
|
|
475
436
|
setShowOriginTokenSelector(false)
|
|
476
437
|
logger.console.log("[trails-sdk] selected origin token", token)
|
|
477
438
|
// Track the token selection
|
|
@@ -481,21 +442,10 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
481
442
|
)
|
|
482
443
|
|
|
483
444
|
const handleDestinationTokenSelect = useCallback(
|
|
484
|
-
(token:
|
|
485
|
-
const formattedToken = {
|
|
486
|
-
...token,
|
|
487
|
-
decimals: token.contractInfo?.decimals || token.decimals,
|
|
488
|
-
contractInfo: {
|
|
489
|
-
decimals: token.contractInfo?.decimals || token.decimals,
|
|
490
|
-
contractAddress: token.contractAddress,
|
|
491
|
-
symbol: token.symbol,
|
|
492
|
-
name: token.name,
|
|
493
|
-
},
|
|
494
|
-
}
|
|
495
|
-
|
|
445
|
+
(token: Token) => {
|
|
496
446
|
// Update both global destination token state and useSendForm state
|
|
497
|
-
setDestinationToken(
|
|
498
|
-
setSelectedDestToken(
|
|
447
|
+
setDestinationToken(token)
|
|
448
|
+
setSelectedDestToken(token)
|
|
499
449
|
|
|
500
450
|
// Update destination chain to match the selected token's chain
|
|
501
451
|
if (setSelectedDestinationChain && token.chainId) {
|
|
@@ -560,17 +510,7 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
560
510
|
compactMode={false}
|
|
561
511
|
recentTokens={recentTokens}
|
|
562
512
|
onRecentTokenSelect={(token) => {
|
|
563
|
-
|
|
564
|
-
...token,
|
|
565
|
-
decimals: token.decimals,
|
|
566
|
-
contractInfo: {
|
|
567
|
-
decimals: token.decimals,
|
|
568
|
-
contractAddress: token.contractAddress,
|
|
569
|
-
symbol: token.symbol,
|
|
570
|
-
name: token.name,
|
|
571
|
-
},
|
|
572
|
-
} as any
|
|
573
|
-
setOriginToken(formattedToken)
|
|
513
|
+
setOriginToken(token)
|
|
574
514
|
setShowOriginTokenSelector(false)
|
|
575
515
|
onRecentTokenSelect?.(token)
|
|
576
516
|
}}
|
|
@@ -606,18 +546,8 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
606
546
|
compactMode={false}
|
|
607
547
|
recentTokens={recentTokens}
|
|
608
548
|
onRecentTokenSelect={(token) => {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
decimals: token.decimals,
|
|
612
|
-
contractInfo: {
|
|
613
|
-
decimals: token.decimals,
|
|
614
|
-
contractAddress: token.contractAddress,
|
|
615
|
-
symbol: token.symbol,
|
|
616
|
-
name: token.name,
|
|
617
|
-
},
|
|
618
|
-
} as any
|
|
619
|
-
setDestinationToken(formattedToken)
|
|
620
|
-
setSelectedDestToken(formattedToken)
|
|
549
|
+
setDestinationToken(token)
|
|
550
|
+
setSelectedDestToken(token)
|
|
621
551
|
setShowDestinationTokenSelector(false)
|
|
622
552
|
onRecentTokenSelect?.(token)
|
|
623
553
|
}}
|
|
@@ -672,7 +602,15 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
672
602
|
/* Payment Request UI */
|
|
673
603
|
<>
|
|
674
604
|
{/* Payment Request Header */}
|
|
675
|
-
<div
|
|
605
|
+
<div
|
|
606
|
+
className="space-y-1 trails-bg-secondary p-3 border bg-white dark:bg-gray-800"
|
|
607
|
+
style={{
|
|
608
|
+
borderColor: "var(--trails-bg-secondary-hover)",
|
|
609
|
+
borderWidth: "1px",
|
|
610
|
+
borderStyle: "solid",
|
|
611
|
+
borderRadius: "var(--trails-border-radius-large-button)",
|
|
612
|
+
}}
|
|
613
|
+
>
|
|
676
614
|
<div className="flex justify-start">
|
|
677
615
|
<div className="flex items-center font-medium trails-text-primary text-sm flex-wrap whitespace-break-spaces break-all min-w-full">
|
|
678
616
|
{payMessage}
|
|
@@ -682,7 +620,14 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
682
620
|
|
|
683
621
|
{/* Origin Token Selection for Payment Request */}
|
|
684
622
|
<div className="mb-4">
|
|
685
|
-
<div
|
|
623
|
+
<div
|
|
624
|
+
className="pt-4 pb-4 trails-border-radius-container p-3 group transition-all duration-200 border bg-white dark:bg-gray-800 min-h-[120px] flex flex-col"
|
|
625
|
+
style={{
|
|
626
|
+
borderColor: "var(--trails-bg-secondary-hover)",
|
|
627
|
+
borderWidth: "1px",
|
|
628
|
+
borderStyle: "solid",
|
|
629
|
+
}}
|
|
630
|
+
>
|
|
686
631
|
{/* Amount to Pay Label */}
|
|
687
632
|
<div className="mb-4 flex justify-between items-center">
|
|
688
633
|
<div className="text-sm font-medium trails-text-secondary text-left m-0">
|
|
@@ -729,7 +674,27 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
729
674
|
<div className="text-xs text-gray-500 dark:text-gray-400">
|
|
730
675
|
{originToken?.symbol &&
|
|
731
676
|
prepareSendQuote?.originAmountFormatted ? (
|
|
732
|
-
|
|
677
|
+
prepareSendQuote?.originAmountUsdDisplay === "$0.00" ||
|
|
678
|
+
prepareSendQuote?.originAmountUsdDisplay === "$0" ? (
|
|
679
|
+
<>
|
|
680
|
+
{prepareSendQuote.originAmountFormatted}{" "}
|
|
681
|
+
{originToken.symbol}
|
|
682
|
+
</>
|
|
683
|
+
) : (
|
|
684
|
+
<>
|
|
685
|
+
≈ {prepareSendQuote?.originAmountUsdDisplay || "$0.00"}
|
|
686
|
+
{prepareSendQuote?.fees?.totalFeeAmountUsd &&
|
|
687
|
+
parseFloat(prepareSendQuote.fees.totalFeeAmountUsd) >
|
|
688
|
+
0 ? (
|
|
689
|
+
<span className="text-green-600 dark:text-green-400">
|
|
690
|
+
{" "}
|
|
691
|
+
(incl.{" "}
|
|
692
|
+
{prepareSendQuote.fees.totalFeeAmountUsdDisplay}{" "}
|
|
693
|
+
fees)
|
|
694
|
+
</span>
|
|
695
|
+
) : null}
|
|
696
|
+
</>
|
|
697
|
+
)
|
|
733
698
|
) : (
|
|
734
699
|
<span> </span>
|
|
735
700
|
)}
|
|
@@ -776,10 +741,7 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
776
741
|
{!toAmount && (
|
|
777
742
|
<PercentageMaxButtons
|
|
778
743
|
userBalance={originTokenBalance.balanceFormatted}
|
|
779
|
-
isNativeToken={
|
|
780
|
-
originToken.contractAddress === zeroAddress ||
|
|
781
|
-
originToken.contractAddress === undefined
|
|
782
|
-
}
|
|
744
|
+
isNativeToken={originToken.isNativeToken ?? false}
|
|
783
745
|
gasCostFormatted={prepareSendQuote?.gasCostFormatted}
|
|
784
746
|
chainId={originToken.chainId}
|
|
785
747
|
onAmountSelect={(amount) => {
|
|
@@ -920,11 +882,15 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
920
882
|
<div className="space-y-1">
|
|
921
883
|
{/* Destination Amount Input Section - Like Fund.tsx but for destination token */}
|
|
922
884
|
<div
|
|
923
|
-
className={`pt-4 pb-4
|
|
924
|
-
!toAmount
|
|
925
|
-
? "trails-bg-secondary-hover focus-within:!bg-white dark:focus-within:!bg-gray-800 trails-focus-border-secondary"
|
|
926
|
-
: ""
|
|
885
|
+
className={`pt-4 pb-4 p-3 group transition-all duration-200 border min-h-[120px] flex flex-col ${
|
|
886
|
+
!toAmount ? "" : ""
|
|
927
887
|
}`}
|
|
888
|
+
style={{
|
|
889
|
+
borderColor: "var(--trails-bg-secondary-hover)",
|
|
890
|
+
borderWidth: "1px",
|
|
891
|
+
borderStyle: "solid",
|
|
892
|
+
borderRadius: "var(--trails-border-radius-large-button)",
|
|
893
|
+
}}
|
|
928
894
|
>
|
|
929
895
|
{/* Amount to Pay Label */}
|
|
930
896
|
<div className="mb-4 flex justify-between items-center">
|
|
@@ -999,30 +965,6 @@ export const Pay: React.FC<PayProps> = ({
|
|
|
999
965
|
severity="warning"
|
|
1000
966
|
/>
|
|
1001
967
|
|
|
1002
|
-
{prepareSendQuote?.noSufficientBalance ? (
|
|
1003
|
-
<div className="px-2 py-3 rounded-lg bg-amber-500/10 border border-solid border-amber-500/30">
|
|
1004
|
-
<div className="flex items-center space-x-2">
|
|
1005
|
-
<svg
|
|
1006
|
-
className="w-4 h-4 text-amber-500 flex-shrink-0"
|
|
1007
|
-
fill="none"
|
|
1008
|
-
stroke="currentColor"
|
|
1009
|
-
viewBox="0 0 24 24"
|
|
1010
|
-
aria-hidden="true"
|
|
1011
|
-
>
|
|
1012
|
-
<path
|
|
1013
|
-
strokeLinecap="round"
|
|
1014
|
-
strokeLinejoin="round"
|
|
1015
|
-
strokeWidth={2}
|
|
1016
|
-
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"
|
|
1017
|
-
/>
|
|
1018
|
-
</svg>
|
|
1019
|
-
<p className="text-sm text-amber-600 dark:text-amber-400">
|
|
1020
|
-
Insufficient balance to complete this transaction
|
|
1021
|
-
</p>
|
|
1022
|
-
</div>
|
|
1023
|
-
</div>
|
|
1024
|
-
) : null}
|
|
1025
|
-
|
|
1026
968
|
{/* Fee Options */}
|
|
1027
969
|
{fundMethod !== "qr-code" && fundMethod !== "exchange" && originToken && (
|
|
1028
970
|
<FeeOptions
|
|
@@ -32,7 +32,7 @@ import { getExplorerUrlForAddress } from "../../explorer.js"
|
|
|
32
32
|
import aaveLogo from "../assets/aave.svg"
|
|
33
33
|
import morphoLogo from "../assets/morpho.svg"
|
|
34
34
|
import { TradeType, type PrepareSendQuote } from "../../prepareSend.js"
|
|
35
|
-
import type {
|
|
35
|
+
import type { Token } from "../../tokens.js"
|
|
36
36
|
import { logger } from "../../logger.js"
|
|
37
37
|
import { DynamicSizeInputField } from "./DynamicSizeInputField.js"
|
|
38
38
|
import { FeeOptions } from "./FeeOptions.js"
|
|
@@ -56,7 +56,7 @@ interface PoolDepositProps {
|
|
|
56
56
|
setWalletConfirmRetryHandler: (handler: () => Promise<void>) => void
|
|
57
57
|
quoteProvider?: string
|
|
58
58
|
fundMethod?: string
|
|
59
|
-
|
|
59
|
+
onNavigateToOnramp?: (
|
|
60
60
|
props: {
|
|
61
61
|
toTokenSymbol: string
|
|
62
62
|
toTokenAmount: string
|
|
@@ -64,10 +64,11 @@ interface PoolDepositProps {
|
|
|
64
64
|
toRecipientAddress: string
|
|
65
65
|
},
|
|
66
66
|
quote?: PrepareSendQuote | null,
|
|
67
|
+
continueSend?: () => Promise<void>,
|
|
67
68
|
) => void
|
|
68
69
|
checkoutOnHandlers?: CheckoutOnHandlers
|
|
69
|
-
recentTokens?:
|
|
70
|
-
onRecentTokenSelect?: (token:
|
|
70
|
+
recentTokens?: Token[]
|
|
71
|
+
onRecentTokenSelect?: (token: Token) => void
|
|
71
72
|
onTrackToken?: (token: any) => void
|
|
72
73
|
onPoolSelectorStateChange?: (isShowing: boolean) => void
|
|
73
74
|
}
|
|
@@ -85,7 +86,7 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
85
86
|
setWalletConfirmRetryHandler,
|
|
86
87
|
quoteProvider,
|
|
87
88
|
fundMethod,
|
|
88
|
-
|
|
89
|
+
onNavigateToOnramp,
|
|
89
90
|
checkoutOnHandlers,
|
|
90
91
|
recentTokens,
|
|
91
92
|
onRecentTokenSelect,
|
|
@@ -207,7 +208,7 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
207
208
|
quoteProvider,
|
|
208
209
|
fundMethod,
|
|
209
210
|
mode,
|
|
210
|
-
|
|
211
|
+
onNavigateToOnramp,
|
|
211
212
|
checkoutOnHandlers,
|
|
212
213
|
})
|
|
213
214
|
|
|
@@ -227,18 +228,7 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
227
228
|
) {
|
|
228
229
|
const highestValueToken = filteredTokensFormatted[0] // First token is highest USD value
|
|
229
230
|
if (highestValueToken && Number(highestValueToken.balanceUsd) > 0) {
|
|
230
|
-
|
|
231
|
-
highestValueToken.contractInfo?.decimals ??
|
|
232
|
-
(highestValueToken as any)?.decimals
|
|
233
|
-
setOriginToken({
|
|
234
|
-
...highestValueToken,
|
|
235
|
-
contractInfo: {
|
|
236
|
-
decimals,
|
|
237
|
-
contractAddress: highestValueToken.contractAddress,
|
|
238
|
-
symbol: highestValueToken.symbol,
|
|
239
|
-
name: highestValueToken.name,
|
|
240
|
-
},
|
|
241
|
-
} as any)
|
|
231
|
+
setOriginToken(highestValueToken)
|
|
242
232
|
}
|
|
243
233
|
}
|
|
244
234
|
}, [originToken, isLoadingTokens, filteredTokensFormatted, setOriginToken])
|
|
@@ -276,18 +266,8 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
276
266
|
setShowEarnPools(false)
|
|
277
267
|
}
|
|
278
268
|
|
|
279
|
-
const handleOriginTokenSelect = (token:
|
|
280
|
-
|
|
281
|
-
...token,
|
|
282
|
-
decimals: token.contractInfo?.decimals || token.decimals,
|
|
283
|
-
contractInfo: {
|
|
284
|
-
decimals: token.contractInfo?.decimals || token.decimals,
|
|
285
|
-
contractAddress: token.contractAddress,
|
|
286
|
-
symbol: token.symbol,
|
|
287
|
-
name: token.name,
|
|
288
|
-
},
|
|
289
|
-
} as any
|
|
290
|
-
setOriginToken(formattedToken)
|
|
269
|
+
const handleOriginTokenSelect = (token: Token) => {
|
|
270
|
+
setOriginToken(token)
|
|
291
271
|
logger.console.log("[trails-sdk] selected origin token", token)
|
|
292
272
|
setShowOriginTokenSelector(false)
|
|
293
273
|
// Track the token selection
|
|
@@ -420,7 +400,7 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
420
400
|
{/* Percentage Buttons */}
|
|
421
401
|
<PercentageMaxButtons
|
|
422
402
|
userBalance={balanceFormatted}
|
|
423
|
-
isNativeToken={originToken.
|
|
403
|
+
isNativeToken={originToken.isNativeToken ?? false}
|
|
424
404
|
gasCostFormatted={prepareSendQuote?.gasCostFormatted}
|
|
425
405
|
chainId={originToken.chainId}
|
|
426
406
|
onAmountSelect={handleAmountSelect}
|
|
@@ -569,30 +549,6 @@ export const PoolDeposit: React.FC<PoolDepositProps> = ({
|
|
|
569
549
|
)}
|
|
570
550
|
</div>
|
|
571
551
|
|
|
572
|
-
{prepareSendQuote?.noSufficientBalance ? (
|
|
573
|
-
<div className="px-2 py-3 rounded-lg bg-amber-500/10 border border-solid border-amber-500/30">
|
|
574
|
-
<div className="flex items-center space-x-2">
|
|
575
|
-
<svg
|
|
576
|
-
className="w-4 h-4 text-amber-500 flex-shrink-0"
|
|
577
|
-
fill="none"
|
|
578
|
-
stroke="currentColor"
|
|
579
|
-
viewBox="0 0 24 24"
|
|
580
|
-
aria-hidden="true"
|
|
581
|
-
>
|
|
582
|
-
<path
|
|
583
|
-
strokeLinecap="round"
|
|
584
|
-
strokeLinejoin="round"
|
|
585
|
-
strokeWidth={2}
|
|
586
|
-
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"
|
|
587
|
-
/>
|
|
588
|
-
</svg>
|
|
589
|
-
<p className="text-sm text-amber-600 dark:text-amber-400">
|
|
590
|
-
Insufficient balance to complete this transaction
|
|
591
|
-
</p>
|
|
592
|
-
</div>
|
|
593
|
-
</div>
|
|
594
|
-
) : null}
|
|
595
|
-
|
|
596
552
|
{/* Fee Options */}
|
|
597
553
|
{fundMethod !== "qr-code" && fundMethod !== "exchange" && (
|
|
598
554
|
<FeeOptions
|
|
@@ -17,7 +17,7 @@ import { getChainInfo } from "../../chains.js"
|
|
|
17
17
|
import { useAmountUsd } from "../hooks/useAmountUsd.js"
|
|
18
18
|
import aaveLogo from "../assets/aave.svg"
|
|
19
19
|
import morphoLogo from "../assets/morpho.svg"
|
|
20
|
-
import type {
|
|
20
|
+
import type { Token } from "../../tokens.js"
|
|
21
21
|
import { logger } from "../../logger.js"
|
|
22
22
|
import { generateAaveWithdrawCalldata } from "../../aave.js"
|
|
23
23
|
import { generateMorphoWithdrawCalldata } from "../../morpho.js"
|
|
@@ -36,8 +36,8 @@ interface PoolWithdrawProps {
|
|
|
36
36
|
onError: (error: Error | string | null) => void
|
|
37
37
|
onComplete: (result: OnCompleteProps) => void
|
|
38
38
|
checkoutOnHandlers?: CheckoutOnHandlers
|
|
39
|
-
recentTokens?:
|
|
40
|
-
onRecentTokenSelect?: (token:
|
|
39
|
+
recentTokens?: Token[]
|
|
40
|
+
onRecentTokenSelect?: (token: Token) => void
|
|
41
41
|
onTrackToken?: (token: any) => void
|
|
42
42
|
onPoolSelectorStateChange?: (isShowing: boolean) => void
|
|
43
43
|
}
|