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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebugScreens.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useDebugScreens.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,gBAAgB,E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AE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,cAAc,EAAE,CACd,KAAK,EAAE;QACL,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAC5B,GAAG,IAAI,KACL,IAAI,CAAA;IACT,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,eAAO,MAAM,eAAe,GAAI,yMAW7B,oBAAoB;sCAGJ,MAAM;CAkjBxB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { Token } from '../../tokens.js';
|
|
2
3
|
/**
|
|
3
4
|
* Hook for intelligent default token selection in 0xtrails widget.
|
|
4
5
|
*
|
|
@@ -25,26 +26,9 @@ import { ReactNode } from 'react';
|
|
|
25
26
|
* @returns defaultDestinationToken - Matching token on different chain (null if toToken/toChainId set)
|
|
26
27
|
* @returns isLoading - Whether token data is still loading
|
|
27
28
|
*/
|
|
28
|
-
export interface DefaultToken {
|
|
29
|
-
id: number;
|
|
30
|
-
name: string;
|
|
31
|
-
symbol: string;
|
|
32
|
-
balance: string;
|
|
33
|
-
imageUrl: string;
|
|
34
|
-
chainId: number;
|
|
35
|
-
contractAddress: string;
|
|
36
|
-
balanceUsdFormatted: string;
|
|
37
|
-
tokenPriceUsd: number;
|
|
38
|
-
decimals: number;
|
|
39
|
-
contractInfo?: {
|
|
40
|
-
decimals: number;
|
|
41
|
-
symbol: string;
|
|
42
|
-
name: string;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
29
|
export interface UseDefaultTokenSelectionReturn {
|
|
46
|
-
defaultOriginToken:
|
|
47
|
-
defaultDestinationToken:
|
|
30
|
+
defaultOriginToken: Token | null;
|
|
31
|
+
defaultDestinationToken: Token | null;
|
|
48
32
|
isLoading: boolean;
|
|
49
33
|
}
|
|
50
34
|
export declare function DefaultTokenSelectionProvider({ children, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDefaultTokenSelection.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useDefaultTokenSelection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useDefaultTokenSelection.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useDefaultTokenSelection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAU5C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,8BAA8B;IAC7C,kBAAkB,EAAE,KAAK,GAAG,IAAI,CAAA;IAChC,uBAAuB,EAAE,KAAK,GAAG,IAAI,CAAA;IACrC,SAAS,EAAE,OAAO,CAAA;CACnB;AAybD,wBAAgB,6BAA6B,CAAC,EAC5C,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;CACpB,2CAQA;AAED,wBAAgB,wBAAwB,IAAI,8BAA8B,CAQzE"}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
id: number;
|
|
4
|
-
name: string;
|
|
5
|
-
symbol: string;
|
|
6
|
-
balance: string;
|
|
7
|
-
imageUrl: string;
|
|
8
|
-
chainId: number;
|
|
9
|
-
contractAddress: string;
|
|
10
|
-
contractInfo?: {
|
|
11
|
-
decimals: number;
|
|
12
|
-
symbol: string;
|
|
13
|
-
name: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
2
|
+
import { Token } from '../../tokens.js';
|
|
16
3
|
interface DestinationSelectedTokenContextType {
|
|
17
4
|
selectedToken: Token | null;
|
|
18
5
|
setSelectedToken: (token: Token | null) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDestinationSelectedToken.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useDestinationSelectedToken.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,
|
|
1
|
+
{"version":3,"file":"useDestinationSelectedToken.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useDestinationSelectedToken.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAE5C,UAAU,mCAAmC;IAC3C,aAAa,EAAE,KAAK,GAAG,IAAI,CAAA;IAC3B,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/C,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B;AAMD,UAAU,qCAAqC;IAC7C,QAAQ,EAAE,SAAS,CAAA;IACnB,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAA;CAC5B;AAED,eAAO,MAAM,gCAAgC,EAAE,KAAK,CAAC,EAAE,CACrD,qCAAqC,CAmBtC,CAAA;AAED,eAAO,MAAM,2BAA2B,QAClC,mCAUH,CAAA"}
|
|
@@ -7,6 +7,6 @@ interface EarnPoolContextType {
|
|
|
7
7
|
export declare const EarnPoolProvider: React.FC<{
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
}>;
|
|
10
|
-
export declare
|
|
10
|
+
export declare function useEarnPool(): EarnPoolContextType;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=useEarnPool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEarnPool.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useEarnPool.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,UAAU,mBAAmB;IAC3B,YAAY,EAAE,IAAI,GAAG,IAAI,CAAA;IACzB,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAA;CAC7C;AAMD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAU9D,CAAA;AAED,
|
|
1
|
+
{"version":3,"file":"useEarnPool.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useEarnPool.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,UAAU,mBAAmB;IAC3B,YAAY,EAAE,IAAI,GAAG,IAAI,CAAA;IACzB,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAA;CAC7C;AAMD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAU9D,CAAA;AAED,wBAAgB,WAAW,IAAI,mBAAmB,CAMjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntentTransactionHistory.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useIntentTransactionHistory.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"useIntentTransactionHistory.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useIntentTransactionHistory.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAA;AAosB9B,MAAM,MAAM,iCAAiC,GAAG;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG;IAC9C,YAAY,EAAE,iBAAiB,EAAE,CAAA;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAMD,wBAAgB,2BAA2B,CAAC,EAC1C,cAAc,EACd,QAAa,EACb,OAAc,GACf,EAAE,iCAAiC,GAAG,iCAAiC,CA2JvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsMobile.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useIsMobile.tsx"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,WAAW,IAAI,OAAO,CA4CrC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { Mode } from '../../mode.js';
|
|
2
2
|
export interface ModeConfig {
|
|
3
3
|
mode?: Mode;
|
|
4
4
|
}
|
|
5
5
|
export declare const ModeProvider: import('react').Provider<ModeConfig | null>;
|
|
6
|
-
export declare
|
|
6
|
+
export declare function useMode(): ModeConfig;
|
|
7
7
|
//# sourceMappingURL=useMode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMode.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useMode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMode.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useMode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEzC,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ;AAID,eAAO,MAAM,YAAY,6CAAuB,CAAA;AAEhD,wBAAgB,OAAO,IAAI,UAAU,CAGpC"}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
id: number;
|
|
4
|
-
name: string;
|
|
5
|
-
symbol: string;
|
|
6
|
-
balance: string;
|
|
7
|
-
imageUrl: string;
|
|
8
|
-
chainId: number;
|
|
9
|
-
contractAddress: string;
|
|
10
|
-
contractInfo?: {
|
|
11
|
-
decimals: number;
|
|
12
|
-
symbol: string;
|
|
13
|
-
name: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
2
|
+
import { Token } from '../../tokens.js';
|
|
16
3
|
interface OriginSelectedTokenContextType {
|
|
17
4
|
selectedToken: Token | null;
|
|
18
5
|
setSelectedToken: (token: Token | null) => void;
|
|
@@ -23,6 +10,6 @@ interface OriginSelectedTokenProviderProps {
|
|
|
23
10
|
initialToken?: Token | null;
|
|
24
11
|
}
|
|
25
12
|
export declare const OriginSelectedTokenProvider: React.FC<OriginSelectedTokenProviderProps>;
|
|
26
|
-
export declare
|
|
13
|
+
export declare function useOriginSelectedToken(): OriginSelectedTokenContextType;
|
|
27
14
|
export {};
|
|
28
15
|
//# sourceMappingURL=useOriginSelectedToken.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOriginSelectedToken.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useOriginSelectedToken.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,
|
|
1
|
+
{"version":3,"file":"useOriginSelectedToken.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useOriginSelectedToken.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAE5C,UAAU,8BAA8B;IACtC,aAAa,EAAE,KAAK,GAAG,IAAI,CAAA;IAC3B,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/C,kBAAkB,EAAE,MAAM,IAAI,CAAA;CAC/B;AAMD,UAAU,gCAAgC;IACxC,QAAQ,EAAE,SAAS,CAAA;IACnB,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAA;CAC5B;AAED,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAChD,gCAAgC,CAmBjC,CAAA;AAED,wBAAgB,sBAAsB,IAAI,8BAA8B,CAUvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePayMessage.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/usePayMessage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYtC,MAAM,WAAW,cAAc;IAC7B,IAAI,EACA,MAAM,GACN,UAAU,GACV,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,oBAAoB,GACpB,WAAW,GACX,UAAU,GACV,eAAe,GACf,aAAa,GACb,aAAa,GACb,cAAc,GACd,cAAc,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,SAAS,CAAA;IAClB,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,IAAI,mBAAmB,
|
|
1
|
+
{"version":3,"file":"usePayMessage.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/usePayMessage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYtC,MAAM,WAAW,cAAc;IAC7B,IAAI,EACA,MAAM,GACN,UAAU,GACV,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,oBAAoB,GACpB,WAAW,GACX,UAAU,GACV,eAAe,GACf,aAAa,GACb,aAAa,GACb,cAAc,GACd,cAAc,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,SAAS,CAAA;IAClB,KAAK,EAAE,cAAc,EAAE,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,IAAI,mBAAmB,CAoZnD"}
|
|
@@ -4,5 +4,5 @@ export interface PriceImpactWarningConfig {
|
|
|
4
4
|
fallbackBridgeUrl?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const PriceImpactWarningProvider: import('react').Provider<PriceImpactWarningConfig | null>;
|
|
7
|
-
export declare
|
|
7
|
+
export declare function usePriceImpactWarning(): PriceImpactWarningConfig;
|
|
8
8
|
//# sourceMappingURL=usePriceImpactWarning.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePriceImpactWarning.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/usePriceImpactWarning.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,wBAAwB;IACvC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAKD,eAAO,MAAM,0BAA0B,2DAAqC,CAAA;AAE5E,
|
|
1
|
+
{"version":3,"file":"usePriceImpactWarning.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/usePriceImpactWarning.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,wBAAwB;IACvC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAKD,eAAO,MAAM,0BAA0B,2DAAqC,CAAA;AAE5E,wBAAgB,qBAAqB,IAAI,wBAAwB,CAGhE"}
|
|
@@ -1,22 +1,41 @@
|
|
|
1
1
|
import { TransactionReceipt } from 'viem';
|
|
2
2
|
import { TradeType, PrepareSendFees } from '../../prepareSend.js';
|
|
3
|
-
import { IntentTransaction, FeeOption } from '@
|
|
3
|
+
import { IntentTransaction, FeeOption } from '@0xtrails/api';
|
|
4
4
|
import { Chain } from '../../chains.js';
|
|
5
|
-
import {
|
|
5
|
+
import { Token } from '../../tokens.js';
|
|
6
6
|
import { TransactionState } from '../../transactions.js';
|
|
7
7
|
import { CheckoutOnHandlers } from './useCheckout.js';
|
|
8
|
+
/**
|
|
9
|
+
* Configuration options for the `useQuote` hook.
|
|
10
|
+
*
|
|
11
|
+
* All parameters are optional, but the hook will not fetch a quote until all required
|
|
12
|
+
* parameters are provided (walletClient, fromTokenAddress, fromChainId, toTokenAddress,
|
|
13
|
+
* toChainId, swapAmount, toRecipient).
|
|
14
|
+
*/
|
|
8
15
|
export type UseQuoteProps = {
|
|
16
|
+
/** The wallet client from wagmi (e.g., from `useWalletClient()`). Required for quote fetching. */
|
|
9
17
|
walletClient?: any;
|
|
18
|
+
/** The contract address of the origin token. */
|
|
10
19
|
fromTokenAddress?: string | null;
|
|
20
|
+
/** The chain ID of the origin chain */
|
|
11
21
|
fromChainId?: number | null;
|
|
22
|
+
/** The contract address of the destination token. */
|
|
12
23
|
toTokenAddress?: string | null;
|
|
24
|
+
/** The chain ID of the destination chain. */
|
|
13
25
|
toChainId?: number | null;
|
|
26
|
+
/** Optional custom calldata for the destination chain. Used for executing arbitrary contract calls. */
|
|
14
27
|
toCalldata?: string | null;
|
|
28
|
+
/** The amount to swap, as a string or bigint in the token's smallest unit (wei/smallest unit). For example, 1 USDC (6 decimals) = '1000000'. */
|
|
15
29
|
swapAmount?: string | bigint;
|
|
30
|
+
/** The recipient address for the destination token. */
|
|
16
31
|
toRecipient?: string | null;
|
|
32
|
+
/** The trade type: `TradeType.EXACT_INPUT` (you specify input amount) or `TradeType.EXACT_OUTPUT` (you specify output amount). Defaults to `EXACT_OUTPUT`. */
|
|
17
33
|
tradeType?: TradeType | null;
|
|
34
|
+
/** Slippage tolerance as a decimal string or number (e.g., '0.005' for 0.5%, '0.01' for 1%). Defaults to a reasonable value if not provided. */
|
|
18
35
|
slippageTolerance?: string | number | null;
|
|
36
|
+
/** Optional callback function that receives transaction state updates during swap execution. */
|
|
19
37
|
onStatusUpdate?: ((transactionStates: TransactionState[]) => void) | null;
|
|
38
|
+
/** Optional quote provider ID to use. If not specified, the best available provider will be selected. */
|
|
20
39
|
quoteProvider?: string | null;
|
|
21
40
|
/**
|
|
22
41
|
* Optional checkout event handlers for tracking the states of a Trails transaction.
|
|
@@ -47,13 +66,25 @@ export type UseQuoteProps = {
|
|
|
47
66
|
* - `triggerCheckoutStatusUpdate`
|
|
48
67
|
*/
|
|
49
68
|
checkoutOnHandlers?: Partial<CheckoutOnHandlers>;
|
|
69
|
+
/** Optional paymaster URL for gasless ERC-4337 transactions. */
|
|
50
70
|
paymasterUrl?: string;
|
|
71
|
+
/** Optional fee option selection (e.g., user selects USDC as the fee token instead of ETH) */
|
|
51
72
|
selectedFeeOption?: FeeOption | null;
|
|
73
|
+
/** Optional AbortSignal to cancel the quote request. */
|
|
52
74
|
abortSignal?: AbortSignal;
|
|
75
|
+
/** Optional API key override for Trails API access. */
|
|
53
76
|
apiKey?: string | null;
|
|
77
|
+
/** Optional environment override for node gateway ('prod' | 'dev' | 'local' | 'cors-anywhere'). */
|
|
54
78
|
nodeGatewayEnv?: "prod" | "dev" | "local" | "cors-anywhere";
|
|
79
|
+
/** Optional flag to indicate if the wallet is a smart wallet. */
|
|
55
80
|
isSmartWallet?: boolean | null;
|
|
56
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Return type for the `swap` function returned by {@link useQuote}.
|
|
84
|
+
*
|
|
85
|
+
* Contains information about both the origin and destination transactions,
|
|
86
|
+
* including transaction hashes, explorer URLs, and receipts.
|
|
87
|
+
*/
|
|
57
88
|
export type SwapReturn = {
|
|
58
89
|
originTransaction: {
|
|
59
90
|
transactionHash?: string | null;
|
|
@@ -67,23 +98,34 @@ export type SwapReturn = {
|
|
|
67
98
|
};
|
|
68
99
|
totalCompletionSeconds?: number;
|
|
69
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Information about a quote provider (LiFi, CCTP, Relay, etc.) used for routing the swap.
|
|
103
|
+
*/
|
|
70
104
|
export type QuoteProviderInfo = {
|
|
71
105
|
id: string;
|
|
72
106
|
name: string;
|
|
73
107
|
url: string;
|
|
74
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* A quote object containing all the details about a Trails intent transaction.
|
|
111
|
+
*
|
|
112
|
+
* Includes token amounts, fees, price impact, estimated completion time,
|
|
113
|
+
* and other relevant information for displaying to the user.
|
|
114
|
+
*/
|
|
75
115
|
export type Quote = {
|
|
76
116
|
fromAmount: string;
|
|
77
117
|
fromAmountMin: string;
|
|
78
118
|
toAmount: string;
|
|
79
119
|
toAmountMin: string;
|
|
80
|
-
originToken:
|
|
81
|
-
destinationToken:
|
|
120
|
+
originToken: Token;
|
|
121
|
+
destinationToken: Token;
|
|
82
122
|
originChain: Chain;
|
|
83
123
|
destinationChain: Chain;
|
|
84
124
|
fees: PrepareSendFees;
|
|
85
125
|
slippageTolerance: string;
|
|
86
126
|
priceImpact: string;
|
|
127
|
+
priceImpactUsd?: string;
|
|
128
|
+
priceImpactUsdDisplay?: string;
|
|
87
129
|
completionEstimateSeconds: number;
|
|
88
130
|
transactionStates?: TransactionState[];
|
|
89
131
|
originTokenRate?: string;
|
|
@@ -95,15 +137,142 @@ export type Quote = {
|
|
|
95
137
|
gasCostUsdDisplay?: string;
|
|
96
138
|
gasCost?: string;
|
|
97
139
|
gasCostFormatted?: string;
|
|
140
|
+
totalFeesUsd?: number;
|
|
141
|
+
totalFeesUsdDisplay?: string;
|
|
142
|
+
totalGasUsd?: number;
|
|
143
|
+
totalGasUsdDisplay?: string;
|
|
144
|
+
allProviderFeesUsd?: number;
|
|
145
|
+
allProviderFeesUsdDisplay?: string;
|
|
98
146
|
};
|
|
147
|
+
/**
|
|
148
|
+
* Return type for the {@link useQuote} hook.
|
|
149
|
+
*
|
|
150
|
+
* Provides the quote data, swap function, loading state, error information,
|
|
151
|
+
* and utility functions for managing the quote lifecycle.
|
|
152
|
+
*/
|
|
99
153
|
export type UseQuoteReturn = {
|
|
154
|
+
/** The quote object with swap details, or `null` if not available. */
|
|
100
155
|
quote: Quote | null;
|
|
156
|
+
/** A function to execute the swap, or `null` if not available. Returns a Promise that resolves to swap result with transaction receipts. */
|
|
101
157
|
swap: (() => Promise<SwapReturn | null>) | null;
|
|
158
|
+
/** Boolean indicating if a quote is currently being fetched. */
|
|
102
159
|
isLoadingQuote: boolean;
|
|
160
|
+
/** Any error that occurred while fetching the quote, or `null`. */
|
|
103
161
|
quoteError: unknown;
|
|
162
|
+
/** A user-friendly error message string. */
|
|
104
163
|
quoteErrorPrettified: string;
|
|
164
|
+
/** Function to manually refetch the quote (useful for refreshing stale quotes). */
|
|
105
165
|
refetchQuote: () => void;
|
|
166
|
+
/** Function to abort any in-flight quote requests. */
|
|
106
167
|
abort: () => void;
|
|
107
168
|
};
|
|
169
|
+
/**
|
|
170
|
+
* React hook for fetching quotes and executing cross-chain or same-chain intent transactions.
|
|
171
|
+
*
|
|
172
|
+
* This hook provides a simple interface to get quotes for intent transactions and execute them.
|
|
173
|
+
* It handles both cross-chain and same-chain intent transactions, automatically fetching token balances,
|
|
174
|
+
* calculating fees, and providing transaction state updates.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* Cross-chain swap example:
|
|
178
|
+
* ```tsx
|
|
179
|
+
* import { useQuote, TradeType } from '0xtrails'
|
|
180
|
+
* import { useEffect } from 'react'
|
|
181
|
+
* import { useWalletClient, useAccount } from 'wagmi'
|
|
182
|
+
*
|
|
183
|
+
* export const Swap = () => {
|
|
184
|
+
* const { data: walletClient } = useWalletClient()
|
|
185
|
+
* const { address } = useAccount()
|
|
186
|
+
*
|
|
187
|
+
* const { quote, swap, isLoadingQuote, quoteError, refetchQuote } = useQuote({
|
|
188
|
+
* walletClient,
|
|
189
|
+
* fromTokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // USDC
|
|
190
|
+
* fromChainId: 1, // Ethereum
|
|
191
|
+
* toTokenAddress: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC
|
|
192
|
+
* toChainId: 8453, // Base
|
|
193
|
+
* swapAmount: '1000000', // 1 USDC (6 decimals)
|
|
194
|
+
* tradeType: TradeType.EXACT_INPUT,
|
|
195
|
+
* toRecipient: address,
|
|
196
|
+
* slippageTolerance: '0.005', // 0.5%
|
|
197
|
+
* onStatusUpdate: (states) => {
|
|
198
|
+
* console.log('Transaction states:', states)
|
|
199
|
+
* }
|
|
200
|
+
* })
|
|
201
|
+
*
|
|
202
|
+
* // Quotes can become stale; refetch every ~30 seconds
|
|
203
|
+
* useEffect(() => {
|
|
204
|
+
* const id = setInterval(() => {
|
|
205
|
+
* refetchQuote?.()
|
|
206
|
+
* }, 30000)
|
|
207
|
+
* return () => clearInterval(id)
|
|
208
|
+
* }, [refetchQuote])
|
|
209
|
+
*
|
|
210
|
+
* const handleSwap = async () => {
|
|
211
|
+
* if (!swap) return
|
|
212
|
+
*
|
|
213
|
+
* try {
|
|
214
|
+
* const result = await swap()
|
|
215
|
+
* console.log('Swap completed:', result)
|
|
216
|
+
* } catch (error) {
|
|
217
|
+
* console.error('Swap failed:', error)
|
|
218
|
+
* }
|
|
219
|
+
* }
|
|
220
|
+
*
|
|
221
|
+
* if (isLoadingQuote) return <div>Getting quote...</div>
|
|
222
|
+
* if (quoteError) return <div>Error: {String(quoteError)}</div>
|
|
223
|
+
* if (!quote) return <div>No quote available</div>
|
|
224
|
+
*
|
|
225
|
+
* return (
|
|
226
|
+
* <div>
|
|
227
|
+
* <div>From: {quote.fromAmount} {quote.originToken.symbol}</div>
|
|
228
|
+
* <div>To: {quote.toAmount} {quote.destinationToken.symbol}</div>
|
|
229
|
+
* <button onClick={handleSwap}>Execute Swap</button>
|
|
230
|
+
* </div>
|
|
231
|
+
* )
|
|
232
|
+
* }
|
|
233
|
+
* ```
|
|
234
|
+
*
|
|
235
|
+
* @param props - Configuration options for the quote
|
|
236
|
+
* @param props.walletClient - The wallet client from wagmi (e.g., from `useWalletClient()`)
|
|
237
|
+
* @param props.fromTokenAddress - The contract address of the token to swap from.
|
|
238
|
+
* @param props.fromChainId - The chain ID of the origin chain
|
|
239
|
+
* @param props.toTokenAddress - The contract address of the token to swap to. Use `zeroAddress` for native tokens
|
|
240
|
+
* @param props.toChainId - The chain ID of the destination chain
|
|
241
|
+
* @param props.swapAmount - The amount to swap, as a string or bigint in the token's smallest unit (wei/smallest unit). For example, 1 USDC (6 decimals) = '1000000'
|
|
242
|
+
* @param props.tradeType - The trade type: `TradeType.EXACT_INPUT` (you specify input amount) or `TradeType.EXACT_OUTPUT` (you specify output amount). Defaults to `EXACT_OUTPUT`
|
|
243
|
+
* @param props.toRecipient - The recipient address for the destination token.
|
|
244
|
+
* @param props.slippageTolerance - Slippage tolerance as a decimal string or number (e.g., '0.005' for 0.5%, '0.01' for 1%). Defaults to a reasonable value if not provided
|
|
245
|
+
* @param props.toCalldata - Optional custom calldata for the destination chain. Used for executing arbitrary contract calls (e.g., swap and mint an NFT on destination chain)
|
|
246
|
+
* @param props.onStatusUpdate - Optional callback function that receives transaction state updates during swap execution
|
|
247
|
+
* @param props.quoteProvider - Optional quote provider ID to use (auto, lifi, relay, cctp, direct). If not specified, the best available provider will be selected
|
|
248
|
+
* @param props.checkoutOnHandlers - Optional event handlers for tracking checkout/transaction lifecycle events
|
|
249
|
+
* @param props.paymasterUrl - Optional paymaster URL for gasless ERC-4337 transactions
|
|
250
|
+
* @param props.selectedFeeOption - Optional fee option selection (e.g., user selects USDC as the fee token instead of ETH)
|
|
251
|
+
* @param props.abortSignal - Optional AbortSignal to cancel the quote request
|
|
252
|
+
* @param props.apiKey - Optional API key override for Trails API access
|
|
253
|
+
* @param props.nodeGatewayEnv - Optional environment override ('prod' | 'dev' | 'local' | 'cors-anywhere')
|
|
254
|
+
* @param props.isSmartWallet - Optional flag to indicate if the wallet is a smart wallet
|
|
255
|
+
*
|
|
256
|
+
* @returns An object containing:
|
|
257
|
+
* - `quote` - The quote object with swap details, or `null` if not available
|
|
258
|
+
* - `swap` - A function to execute the swap, or `null` if not available. Returns a Promise that resolves to swap result with transaction receipts
|
|
259
|
+
* - `isLoadingQuote` - Boolean indicating if a quote is currently being fetched
|
|
260
|
+
* - `quoteError` - Any error that occurred while fetching the quote, or `null`
|
|
261
|
+
* - `quoteErrorPrettified` - A user-friendly error message string
|
|
262
|
+
* - `refetchQuote` - Function to manually refetch the quote (useful for refreshing stale quotes)
|
|
263
|
+
* - `abort` - Function to abort any in-flight quote requests
|
|
264
|
+
*
|
|
265
|
+
* @remarks
|
|
266
|
+
* - The hook uses React Query internally, so quotes are cached and automatically refetched based on query key changes
|
|
267
|
+
* - Quotes are considered stale after 30 seconds. You may want to periodically call `refetchQuote()` to keep quotes fresh
|
|
268
|
+
* - The hook will not fetch a quote until all required parameters are provided (walletClient, token addresses, chain IDs, swap amount, recipient)
|
|
269
|
+
* - For native tokens (ETH, MATIC, etc.), use the zero address (`0x0000000000000000000000000000000000000000`)
|
|
270
|
+
*
|
|
271
|
+
* @see {@link TradeType} for available trade types
|
|
272
|
+
* @see {@link Quote} for the quote object structure
|
|
273
|
+
* @see {@link SwapReturn} for the swap result structure
|
|
274
|
+
*
|
|
275
|
+
* For more information go to {@link https://docs.trails.build/sdk/hooks#usequote-hook}
|
|
276
|
+
*/
|
|
108
277
|
export declare function useQuote({ walletClient, fromTokenAddress, fromChainId, toTokenAddress, toChainId, swapAmount, tradeType, toRecipient, toCalldata, slippageTolerance, onStatusUpdate, checkoutOnHandlers, quoteProvider, paymasterUrl, selectedFeeOption, nodeGatewayEnv, abortSignal: externalAbortSignal, apiKey, isSmartWallet, }?: Partial<UseQuoteProps>): UseQuoteReturn;
|
|
109
278
|
//# sourceMappingURL=useQuote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQuote.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useQuote.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAA;AAY9C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useQuote.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useQuote.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAA;AAY9C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAG3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,kGAAkG;IA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B,EAChB,WAAW,EACX,cAAc,EACd,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,WAAW,EAAE,mBAAmB,EAChC,MAAM,EACN,aAAa,GACd,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,cAAc,CAyc9C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Token } from '../../tokens.js';
|
|
2
2
|
export declare function useRecentTokens(accountAddress?: string): {
|
|
3
|
-
recentTokens:
|
|
4
|
-
addRecentToken: (token:
|
|
3
|
+
recentTokens: Token[];
|
|
4
|
+
addRecentToken: (token: Token) => void;
|
|
5
5
|
clearRecentTokens: () => void;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=useRecentTokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRecentTokens.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useRecentTokens.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useRecentTokens.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useRecentTokens.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAU5C,wBAAgB,eAAe,CAAC,cAAc,CAAC,EAAE,MAAM;;4BA4B3C,KAAK;;EAkEhB"}
|
|
@@ -4,7 +4,7 @@ export interface RecentRecipient {
|
|
|
4
4
|
resolvedAddress?: string;
|
|
5
5
|
timestamp: number;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare function useRecipients(): {
|
|
8
8
|
recentRecipients: RecentRecipient[];
|
|
9
9
|
addRecentRecipient: (input: string, resolvedAddress?: string, ensName?: string) => Promise<void>;
|
|
10
10
|
removeRecentRecipient: (address: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRecipients.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useRecipients.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;CAClB;AAKD,
|
|
1
|
+
{"version":3,"file":"useRecipients.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useRecipients.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;CAClB;AAKD,wBAAgB,aAAa;;gCAgEX,MAAM,oBAAoB,MAAM,YAAY,MAAM;qCAyDtD,MAAM;;wBApFF,MAAM,KAAG,OAAO,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;EAoHzE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { FeeOption } from '@
|
|
2
|
+
import { FeeOption } from '@0xtrails/api';
|
|
3
3
|
export type ProcessedFeeOption = FeeOption & {
|
|
4
4
|
notEnoughBalance?: boolean;
|
|
5
5
|
tokenImageUrl?: string;
|
|
@@ -25,6 +25,6 @@ interface SelectedFeeOptionProviderProps {
|
|
|
25
25
|
initialToken?: FeeOption | null;
|
|
26
26
|
}
|
|
27
27
|
export declare const SelectedFeeOptionProvider: React.FC<SelectedFeeOptionProviderProps>;
|
|
28
|
-
export declare
|
|
28
|
+
export declare function useSelectedFeeOption(): SelectedFeeOptionContextType;
|
|
29
29
|
export {};
|
|
30
30
|
//# sourceMappingURL=useSelectedFeeOption.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectedFeeOption.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useSelectedFeeOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useSelectedFeeOption.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useSelectedFeeOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAsD9C,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAGD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,UAAU,4BAA4B;IACpC,iBAAiB,EAAE,SAAS,GAAG,IAAI,CAAA;IACnC,oBAAoB,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAA;IACvD,sBAAsB,EAAE,MAAM,IAAI,CAAA;IAClC,mBAAmB,EAAE,kBAAkB,EAAE,CAAA;IACzC,aAAa,EAAE,CACb,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS,EACvD,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,eAAe,EAAE,gBAAgB,EAAE,KAChC,IAAI,CAAA;CACV;AAMD,UAAU,8BAA8B;IACtC,QAAQ,EAAE,SAAS,CAAA;IACnB,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;CAChC;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAC9C,8BAA8B,CAwM/B,CAAA;AAED,wBAAgB,oBAAoB,IAAI,4BAA4B,CAUnE"}
|
|
@@ -7,6 +7,6 @@ interface SelectedFundMethodProviderProps {
|
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
export declare const SelectedFundMethodProvider: ({ children, }: SelectedFundMethodProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare
|
|
10
|
+
export declare function useSelectedFundMethod(): SelectedFundMethodContextType;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=useSelectedFundMethod.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectedFundMethod.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useSelectedFundMethod.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3E,UAAU,6BAA6B;IACrC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAChD;AAMD,UAAU,+BAA+B;IACvC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,0BAA0B,GAAI,eAExC,+BAA+B,4CAajC,CAAA;AAED,
|
|
1
|
+
{"version":3,"file":"useSelectedFundMethod.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useSelectedFundMethod.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3E,UAAU,6BAA6B;IACrC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAChD;AAMD,UAAU,+BAA+B;IACvC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,0BAA0B,GAAI,eAExC,+BAA+B,4CAajC,CAAA;AAED,wBAAgB,qBAAqB,IAAI,6BAA6B,CAQrE"}
|
|
@@ -7,6 +7,6 @@ interface SelectedRecipientProviderProps {
|
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
export declare const SelectedRecipientProvider: React.FC<SelectedRecipientProviderProps>;
|
|
10
|
-
export declare
|
|
10
|
+
export declare function useSelectedRecipient(): SelectedRecipientContextType;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=useSelectedRecipient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelectedRecipient.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useSelectedRecipient.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,UAAU,4BAA4B;IACpC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,oBAAoB,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CACzD;AAMD,UAAU,8BAA8B;IACtC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAC9C,8BAA8B,CAwB/B,CAAA;AAED,
|
|
1
|
+
{"version":3,"file":"useSelectedRecipient.d.ts","sourceRoot":"","sources":["../../../src/widget/hooks/useSelectedRecipient.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,UAAU,4BAA4B;IACpC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,oBAAoB,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CACzD;AAMD,UAAU,8BAA8B;IACtC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAC9C,8BAA8B,CAwB/B,CAAA;AAED,wBAAgB,oBAAoB,iCAQnC"}
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import { TokenPrice, FeeOption } from '@
|
|
1
|
+
import { TokenPrice, FeeOption } from '@0xtrails/api';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
import { Account, WalletClient } from 'viem';
|
|
4
4
|
import { TradeType, PrepareSendQuote } from '../../prepareSend.js';
|
|
5
5
|
import { TransactionState } from '../../transactions.js';
|
|
6
|
-
import {
|
|
6
|
+
import { Token } from '../../tokens.js';
|
|
7
7
|
import { CheckoutOnHandlers } from './useCheckout.js';
|
|
8
8
|
import { ProcessedFeeOption } from './useSelectedFeeOption.js';
|
|
9
|
-
export interface Token {
|
|
10
|
-
id: number;
|
|
11
|
-
name: string;
|
|
12
|
-
symbol: string;
|
|
13
|
-
balance: string;
|
|
14
|
-
imageUrl: string;
|
|
15
|
-
chainId: number;
|
|
16
|
-
contractAddress: string;
|
|
17
|
-
tokenPriceUsd?: number;
|
|
18
|
-
balanceUsdFormatted?: string;
|
|
19
|
-
contractInfo?: {
|
|
20
|
-
decimals: number;
|
|
21
|
-
symbol: string;
|
|
22
|
-
name: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export type TokenInfo = {
|
|
26
|
-
symbol: string;
|
|
27
|
-
name: string;
|
|
28
|
-
imageUrl: string;
|
|
29
|
-
decimals: number;
|
|
30
|
-
};
|
|
31
9
|
type ChainInfo = {
|
|
32
10
|
id: number;
|
|
33
11
|
name: string;
|
|
@@ -61,13 +39,13 @@ export type UseSendProps = {
|
|
|
61
39
|
tradeType?: TradeType;
|
|
62
40
|
quoteProvider?: string;
|
|
63
41
|
fundMethod?: string;
|
|
64
|
-
mode?: "pay" | "fund" | "earn" | "swap"
|
|
65
|
-
|
|
42
|
+
mode?: "pay" | "fund" | "earn" | "swap";
|
|
43
|
+
onNavigateToOnramp?: (props: {
|
|
66
44
|
toTokenSymbol: string;
|
|
67
45
|
toTokenAmount: string;
|
|
68
46
|
toChainId: number;
|
|
69
47
|
toRecipientAddress: string;
|
|
70
|
-
}, quote?: PrepareSendQuote | null) => void;
|
|
48
|
+
}, quote?: PrepareSendQuote | null, continueSend?: () => Promise<void>) => void;
|
|
71
49
|
checkoutOnHandlers?: CheckoutOnHandlers;
|
|
72
50
|
refetchTrigger?: number;
|
|
73
51
|
};
|
|
@@ -89,15 +67,15 @@ export type UseSendReturn = {
|
|
|
89
67
|
recipient: string;
|
|
90
68
|
recipientInput: string;
|
|
91
69
|
selectedDestinationChain: ChainInfo | null;
|
|
92
|
-
selectedDestToken:
|
|
70
|
+
selectedDestToken: Token | null;
|
|
93
71
|
setAmount: (amount: string) => void;
|
|
94
72
|
setRecipient: (recipient: string) => void;
|
|
95
73
|
setRecipientInput: (recipientInput: string) => void;
|
|
96
74
|
setSelectedDestinationChain: (chain: ChainInfo) => void;
|
|
97
|
-
setSelectedDestToken: (token:
|
|
75
|
+
setSelectedDestToken: (token: Token | null) => void;
|
|
98
76
|
setSelectedFeeOption: (token: FeeOption | null) => void;
|
|
99
77
|
processedFeeOptions: ProcessedFeeOption[];
|
|
100
|
-
supportedTokens:
|
|
78
|
+
supportedTokens: Token[];
|
|
101
79
|
supportedChains: ChainInfo[];
|
|
102
80
|
ensAddress: string | null;
|
|
103
81
|
isWaitingForWalletConfirm: boolean;
|
|
@@ -126,6 +104,6 @@ toChainId, // Custom specified destination chain id
|
|
|
126
104
|
toToken, // Custom specified destination token address or symbol
|
|
127
105
|
toCalldata, // Custom specified destination calldata
|
|
128
106
|
refundAddress, // Custom specified refund address
|
|
129
|
-
walletClient, onTransactionStateChange, onError, onWaitingForWalletConfirm, paymasterUrls, selectedToken, onSend, onConfirm, onComplete, setWalletConfirmRetryHandler, tradeType, quoteProvider, fundMethod, mode,
|
|
107
|
+
walletClient, onTransactionStateChange, onError, onWaitingForWalletConfirm, paymasterUrls, selectedToken, onSend, onConfirm, onComplete, setWalletConfirmRetryHandler, tradeType, quoteProvider, fundMethod, mode, onNavigateToOnramp, checkoutOnHandlers, refetchTrigger, }: UseSendProps): UseSendReturn;
|
|
130
108
|
export {};
|
|
131
109
|
//# sourceMappingURL=useSendForm.d.ts.map
|