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
|
@@ -16,15 +16,17 @@ import { getChainInfo } from "../../chains.js"
|
|
|
16
16
|
import { useMode } from "../hooks/useMode.js"
|
|
17
17
|
import { ScreenHeader } from "./ScreenHeader.js"
|
|
18
18
|
import { getExplorerUrl } from "../../explorer.js"
|
|
19
|
+
import { logger } from "../../logger.js"
|
|
19
20
|
|
|
20
21
|
interface ReceiptProps {
|
|
21
|
-
onSendAnother
|
|
22
|
+
onSendAnother?: () => void
|
|
22
23
|
onClose: () => void
|
|
23
24
|
renderInline?: boolean
|
|
24
25
|
transactionStates?: TransactionState[]
|
|
25
26
|
totalCompletionSeconds?: number
|
|
26
27
|
quote?: PrepareSendQuote | null
|
|
27
28
|
showCloseButton?: boolean
|
|
29
|
+
actionButtonText?: string
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
// Hook to fetch the time difference in seconds between two transactions on possibly different chains
|
|
@@ -103,6 +105,7 @@ export const Receipt: React.FC<ReceiptProps> = ({
|
|
|
103
105
|
totalCompletionSeconds,
|
|
104
106
|
quote,
|
|
105
107
|
showCloseButton,
|
|
108
|
+
actionButtonText,
|
|
106
109
|
}) => {
|
|
107
110
|
const { mode } = useMode()
|
|
108
111
|
const [showContent, setShowContent] = useState(false)
|
|
@@ -130,7 +133,16 @@ export const Receipt: React.FC<ReceiptProps> = ({
|
|
|
130
133
|
return transactionStates.some((tx) => hasMetaTxError(tx))
|
|
131
134
|
}, [transactionStates, hasMetaTxError])
|
|
132
135
|
|
|
136
|
+
// Check if any transaction is aborted
|
|
137
|
+
const hasAborted = useMemo(() => {
|
|
138
|
+
return transactionStates.some((tx) => tx.state === "aborted")
|
|
139
|
+
}, [transactionStates])
|
|
140
|
+
|
|
133
141
|
const buttonText = useMemo(() => {
|
|
142
|
+
// Use custom actionButtonText if provided, otherwise use mode-based text
|
|
143
|
+
if (actionButtonText) {
|
|
144
|
+
return actionButtonText
|
|
145
|
+
}
|
|
134
146
|
if (mode === "pay") {
|
|
135
147
|
return "Pay Again"
|
|
136
148
|
} else if (mode === "fund") {
|
|
@@ -140,7 +152,7 @@ export const Receipt: React.FC<ReceiptProps> = ({
|
|
|
140
152
|
} else {
|
|
141
153
|
return "Send Again"
|
|
142
154
|
}
|
|
143
|
-
}, [mode])
|
|
155
|
+
}, [mode, actionButtonText])
|
|
144
156
|
|
|
145
157
|
const {
|
|
146
158
|
finalExplorerUrl,
|
|
@@ -208,7 +220,9 @@ export const Receipt: React.FC<ReceiptProps> = ({
|
|
|
208
220
|
className={`px-2 py-0.5 rounded-full text-xs ${
|
|
209
221
|
state.state === "confirmed"
|
|
210
222
|
? "bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-400"
|
|
211
|
-
:
|
|
223
|
+
: state.state === "aborted"
|
|
224
|
+
? "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"
|
|
225
|
+
: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-400"
|
|
212
226
|
}`}
|
|
213
227
|
>
|
|
214
228
|
{state.state.charAt(0).toUpperCase() +
|
|
@@ -270,12 +284,25 @@ export const Receipt: React.FC<ReceiptProps> = ({
|
|
|
270
284
|
</div>
|
|
271
285
|
)
|
|
272
286
|
|
|
273
|
-
// Only show error state if we truly have no transaction hash at all
|
|
287
|
+
// Only show error state if we truly have no transaction hash at all OR if any transaction is aborted
|
|
274
288
|
const hasAnyTransactionHash = transactionStates.some(
|
|
275
289
|
(tx) => tx.transactionHash,
|
|
276
290
|
)
|
|
277
291
|
|
|
278
|
-
if
|
|
292
|
+
// Log intent ID if available when aborted (for debugging)
|
|
293
|
+
useEffect(() => {
|
|
294
|
+
if (hasAborted && quote?.intentId) {
|
|
295
|
+
logger.console.error(
|
|
296
|
+
"[trails-sdk] Transaction aborted with intent ID:",
|
|
297
|
+
quote.intentId,
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
}, [hasAborted, quote?.intentId])
|
|
301
|
+
|
|
302
|
+
if (
|
|
303
|
+
(!finalExplorerUrl && !showRefundInfo && !hasAnyTransactionHash) ||
|
|
304
|
+
hasAborted
|
|
305
|
+
) {
|
|
279
306
|
return (
|
|
280
307
|
<div className="flex flex-col justify-center min-h-full space-y-6">
|
|
281
308
|
<ScreenHeader />
|
|
@@ -303,11 +330,51 @@ export const Receipt: React.FC<ReceiptProps> = ({
|
|
|
303
330
|
Transaction Failed
|
|
304
331
|
</h2>
|
|
305
332
|
<p className="mt-2 text-sm text-gray-600 dark:text-gray-400">
|
|
306
|
-
|
|
307
|
-
|
|
333
|
+
{hasAborted ? (
|
|
334
|
+
<>
|
|
335
|
+
The transaction likely timed out and was aborted. Please{" "}
|
|
336
|
+
<a
|
|
337
|
+
href="https://support.trails.build/en/"
|
|
338
|
+
target="_blank"
|
|
339
|
+
rel="noopener noreferrer"
|
|
340
|
+
className="text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300 underline"
|
|
341
|
+
>
|
|
342
|
+
contact support
|
|
343
|
+
</a>{" "}
|
|
344
|
+
with the intent ID below to request a refund.
|
|
345
|
+
</>
|
|
346
|
+
) : (
|
|
347
|
+
<>
|
|
348
|
+
No final transaction hash found. This is likely due to a failed
|
|
349
|
+
transaction or failed relay. Please{" "}
|
|
350
|
+
<a
|
|
351
|
+
href="https://support.trails.build/en/"
|
|
352
|
+
target="_blank"
|
|
353
|
+
rel="noopener noreferrer"
|
|
354
|
+
className="text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300 underline"
|
|
355
|
+
>
|
|
356
|
+
reach out to support
|
|
357
|
+
</a>
|
|
358
|
+
.
|
|
359
|
+
</>
|
|
360
|
+
)}
|
|
308
361
|
</p>
|
|
309
362
|
</div>
|
|
310
363
|
|
|
364
|
+
{/* Show Intent ID if available */}
|
|
365
|
+
{quote?.intentId && (
|
|
366
|
+
<div className="text-center">
|
|
367
|
+
<div className="inline-flex flex-col items-center gap-2 p-3 rounded-lg bg-gray-100 dark:bg-gray-800">
|
|
368
|
+
<span className="text-xs text-gray-600 dark:text-gray-400">
|
|
369
|
+
Intent ID
|
|
370
|
+
</span>
|
|
371
|
+
<code className="text-sm font-mono text-gray-900 dark:text-white break-all">
|
|
372
|
+
{quote.intentId}
|
|
373
|
+
</code>
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
)}
|
|
377
|
+
|
|
311
378
|
{onSendAnother && (
|
|
312
379
|
<div className="flex justify-center">
|
|
313
380
|
<button
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type React from "react"
|
|
2
|
-
import type {
|
|
2
|
+
import type { Token } from "../../tokens.js"
|
|
3
3
|
import { TokenImage } from "./TokenImage.js"
|
|
4
4
|
|
|
5
5
|
interface RecentTokensProps {
|
|
6
|
-
recentTokens:
|
|
7
|
-
onTokenSelect: (token:
|
|
8
|
-
selectedToken?:
|
|
6
|
+
recentTokens: Token[]
|
|
7
|
+
onTokenSelect: (token: Token) => void
|
|
8
|
+
selectedToken?: Token | null
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const RecentTokens: React.FC<RecentTokensProps> = ({
|
|
@@ -17,12 +17,12 @@ export const RecentTokens: React.FC<RecentTokensProps> = ({
|
|
|
17
17
|
return null
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const isTokenSelected = (token:
|
|
20
|
+
const isTokenSelected = (token: Token) => {
|
|
21
21
|
if (!selectedToken) return false
|
|
22
22
|
return (
|
|
23
23
|
token.contractAddress.toLowerCase() ===
|
|
24
24
|
selectedToken.contractAddress.toLowerCase() &&
|
|
25
|
-
token.chainId === selectedToken.chainId
|
|
25
|
+
(token.chainId || 0) === (selectedToken.chainId || 0)
|
|
26
26
|
)
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -37,7 +37,7 @@ export const RecentTokens: React.FC<RecentTokensProps> = ({
|
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<button
|
|
40
|
-
key={`${token.chainId}-${token.contractAddress}`}
|
|
40
|
+
key={`${token.chainId || 0}-${token.contractAddress}`}
|
|
41
41
|
type="button"
|
|
42
42
|
onClick={() => onTokenSelect(token)}
|
|
43
43
|
title={`${token.symbol} - ${token.name}`}
|
|
@@ -51,7 +51,7 @@ export const RecentTokens: React.FC<RecentTokensProps> = ({
|
|
|
51
51
|
<TokenImage
|
|
52
52
|
symbol={token.symbol}
|
|
53
53
|
imageUrl={token.imageUrl}
|
|
54
|
-
chainId={token.chainId}
|
|
54
|
+
chainId={token.chainId || 0}
|
|
55
55
|
size={28}
|
|
56
56
|
/>
|
|
57
57
|
</div>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChevronRight } from "lucide-react"
|
|
2
2
|
import type React from "react"
|
|
3
3
|
import { truncateAddress } from "../../utils.js"
|
|
4
|
-
import { Identicon } from "./Identicon.js"
|
|
5
4
|
import { useBack } from "../hooks/useBack.js"
|
|
6
5
|
import { useSelectedRecipient } from "../hooks/useSelectedRecipient.js"
|
|
6
|
+
import { AddressWalletIcon } from "./AddressWalletIcon.js"
|
|
7
7
|
|
|
8
8
|
export const RecipientSelectorButton: React.FC = () => {
|
|
9
9
|
const { setCurrentScreenWithBack } = useBack()
|
|
@@ -27,7 +27,9 @@ export const RecipientSelectorButton: React.FC = () => {
|
|
|
27
27
|
{selectedRecipient ? (
|
|
28
28
|
<>
|
|
29
29
|
<div className="flex items-center mr-1">
|
|
30
|
-
<
|
|
30
|
+
<AddressWalletIcon
|
|
31
|
+
walletAddress={selectedRecipient as `0x${string}`}
|
|
32
|
+
/>
|
|
31
33
|
</div>
|
|
32
34
|
<span className="text-sm font-medium m-0">
|
|
33
35
|
{truncateAddress(selectedRecipient, 4, 4)}
|
|
@@ -4,7 +4,7 @@ import { useConnections } from "wagmi"
|
|
|
4
4
|
import AccountActionsDropdown from "./AccountActionsDropdown.js"
|
|
5
5
|
import AccountIntentTransactionHistoryButton from "./AccountIntentTransactionHistoryButton.js"
|
|
6
6
|
import { useWidgetProps } from "../hooks/useWidgetProps.js"
|
|
7
|
-
import {
|
|
7
|
+
import { useTrailsModal } from "../providers/TrailsModalProvider.js"
|
|
8
8
|
|
|
9
9
|
interface ScreenHeaderProps {
|
|
10
10
|
onBack?: () => void
|
|
@@ -24,7 +24,7 @@ export const ScreenHeader: React.FC<ScreenHeaderProps> = ({
|
|
|
24
24
|
}) => {
|
|
25
25
|
const connections = useConnections()
|
|
26
26
|
const { renderInline } = useWidgetProps()
|
|
27
|
-
const { closeModal, isModalOpen } =
|
|
27
|
+
const { closeModal, isModalOpen } = useTrailsModal()
|
|
28
28
|
|
|
29
29
|
// Check if there are any connected accounts across all connectors
|
|
30
30
|
const isConnected = connections.length > 0
|
|
@@ -38,7 +38,7 @@ export const SearchInputField: React.FC<SearchInputFieldProps> = ({
|
|
|
38
38
|
value={value}
|
|
39
39
|
onChange={(e) => onChange(e.target.value)}
|
|
40
40
|
placeholder={placeholder}
|
|
41
|
-
className={`block w-full pl-10 ${rightAlignedComponent ? "pr-
|
|
41
|
+
className={`block w-full pl-10 ${rightAlignedComponent ? "pr-16" : "pr-4"} py-2 border border-solid border-gray-200 dark:border-gray-700 trails-border-radius-input focus:ring-2 focus:ring-blue-500 focus:border-blue-500 trails-input`}
|
|
42
42
|
/>
|
|
43
43
|
|
|
44
44
|
{rightAlignedComponent && (
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useRef, useState, useEffect } from "react"
|
|
2
|
+
import { createPortal } from "react-dom"
|
|
3
|
+
import css from "../compiled.css?inline"
|
|
4
|
+
|
|
5
|
+
export interface ShadowPortalProps {
|
|
6
|
+
children: React.ReactNode
|
|
7
|
+
customCss?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function ShadowPortal({
|
|
11
|
+
children,
|
|
12
|
+
customCss,
|
|
13
|
+
}: ShadowPortalProps): React.JSX.Element {
|
|
14
|
+
const hostRef = useRef<HTMLDivElement>(null)
|
|
15
|
+
const [shadowRoot, setShadowRoot] = useState<ShadowRoot | null>(null)
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (hostRef.current) {
|
|
19
|
+
let shadow = hostRef.current.shadowRoot
|
|
20
|
+
if (!shadow) {
|
|
21
|
+
shadow = hostRef.current.attachShadow({ mode: "open" })
|
|
22
|
+
|
|
23
|
+
// Inject <style> tag with your widget's CSS
|
|
24
|
+
const styleTag = document.createElement("style")
|
|
25
|
+
styleTag.textContent = css
|
|
26
|
+
shadow.appendChild(styleTag)
|
|
27
|
+
}
|
|
28
|
+
setShadowRoot(shadow)
|
|
29
|
+
}
|
|
30
|
+
}, [])
|
|
31
|
+
|
|
32
|
+
// Update custom CSS when it changes
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (shadowRoot) {
|
|
35
|
+
// Remove any existing custom CSS
|
|
36
|
+
const existingCustomStyles = shadowRoot.querySelectorAll(
|
|
37
|
+
'style[id="custom-css"]',
|
|
38
|
+
)
|
|
39
|
+
existingCustomStyles.forEach((style) => {
|
|
40
|
+
style.remove()
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// Inject new custom CSS if provided
|
|
44
|
+
if (customCss) {
|
|
45
|
+
const customStyleTag = document.createElement("style")
|
|
46
|
+
customStyleTag.id = "custom-css"
|
|
47
|
+
customStyleTag.textContent = `:root, [data-theme="light"], [data-theme="dark"] { ${customCss} }`
|
|
48
|
+
shadowRoot.appendChild(customStyleTag)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, [customCss, shadowRoot])
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div ref={hostRef} className="w-full">
|
|
55
|
+
{shadowRoot ? createPortal(children, shadowRoot) : null}
|
|
56
|
+
</div>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from "react"
|
|
2
2
|
import type { Account, WalletClient } from "viem"
|
|
3
3
|
import type { TransactionState } from "../../transactions.js"
|
|
4
|
-
import type { OnCompleteProps
|
|
5
|
-
import type {
|
|
4
|
+
import type { OnCompleteProps } from "../hooks/useSendForm.js"
|
|
5
|
+
import type { Token } from "../../tokens.js"
|
|
6
6
|
import type { CheckoutOnHandlers } from "../hooks/useCheckout.js"
|
|
7
7
|
import type { PrepareSendQuote } from "../../prepareSend.js"
|
|
8
8
|
import { ClassicSwap } from "./ClassicSwap.js"
|
|
@@ -27,7 +27,7 @@ interface SwapProps {
|
|
|
27
27
|
setWalletConfirmRetryHandler: (handler: () => Promise<void>) => void
|
|
28
28
|
quoteProvider?: string
|
|
29
29
|
fundMethod?: string
|
|
30
|
-
|
|
30
|
+
onNavigateToOnramp?: (
|
|
31
31
|
props: {
|
|
32
32
|
toTokenSymbol: string
|
|
33
33
|
toTokenAmount: string
|
|
@@ -35,11 +35,12 @@ interface SwapProps {
|
|
|
35
35
|
toRecipientAddress: string
|
|
36
36
|
},
|
|
37
37
|
quote?: PrepareSendQuote | null,
|
|
38
|
+
continueSend?: () => Promise<void>,
|
|
38
39
|
) => void
|
|
39
40
|
onAmountUpdate?: (amount: string) => void
|
|
40
41
|
checkoutOnHandlers?: CheckoutOnHandlers
|
|
41
|
-
recentTokens?:
|
|
42
|
-
onRecentTokenSelect?: (token:
|
|
42
|
+
recentTokens?: Token[]
|
|
43
|
+
onRecentTokenSelect?: (token: Token) => void
|
|
43
44
|
onTrackToken?: (token: any) => void
|
|
44
45
|
isSequenceWallet?: boolean
|
|
45
46
|
}
|
|
@@ -108,7 +108,7 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
|
|
|
108
108
|
)
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
export
|
|
111
|
+
export function useTheme(): ThemeContextType {
|
|
112
112
|
const context = useContext(ThemeContext)
|
|
113
113
|
if (context === undefined) {
|
|
114
114
|
throw new Error("useTheme must be used within a ThemeProvider")
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useState } from "react"
|
|
2
2
|
import type React from "react"
|
|
3
|
-
import type { Token } from "
|
|
4
|
-
import type { SupportedToken } from "../../tokens.js"
|
|
3
|
+
import type { Token } from "../../tokens.js"
|
|
5
4
|
import { ScreenHeader } from "./ScreenHeader.js"
|
|
6
5
|
import { TokenSelector } from "./TokenSelector.js"
|
|
7
6
|
import { ChainList } from "./ChainList.js"
|
|
@@ -15,8 +14,8 @@ interface TokenListProps {
|
|
|
15
14
|
targetAmountUsd?: number | null
|
|
16
15
|
targetAmountUsdFormatted?: string | null
|
|
17
16
|
onError: (error: Error | string | null) => void
|
|
18
|
-
recentTokens?:
|
|
19
|
-
onRecentTokenSelect?: (token:
|
|
17
|
+
recentTokens?: Token[]
|
|
18
|
+
onRecentTokenSelect?: (token: Token) => void
|
|
20
19
|
fundMethod?: string | null
|
|
21
20
|
renderInline?: boolean
|
|
22
21
|
onNavigateToFundMethods?: () => void
|