0xtrails 0.4.3 → 0.6.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/analytics.d.ts +8 -3
- package/dist/analytics.d.ts.map +1 -1
- package/dist/{ccip-C9CA3tIi.js → ccip-Dw5AN7oU.js} +27 -27
- package/dist/cctp.d.ts +0 -149
- package/dist/cctp.d.ts.map +1 -1
- package/dist/chains.d.ts +31 -4
- package/dist/chains.d.ts.map +1 -1
- package/dist/config.d.ts +28 -52
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -7
- package/dist/constants.d.ts.map +1 -1
- package/dist/contractUtils.d.ts.map +1 -1
- package/dist/estimate.d.ts.map +1 -1
- package/dist/fees.d.ts.map +1 -1
- package/dist/gasless.d.ts +12 -0
- package/dist/gasless.d.ts.map +1 -1
- package/dist/{index-CNB57v0n.js → index-BtVUTbEZ.js} +32255 -40547
- package/dist/index.d.ts +13 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +320 -944
- package/dist/indexerClient.d.ts +9 -6
- package/dist/indexerClient.d.ts.map +1 -1
- package/dist/intents.d.ts +0 -18
- package/dist/intents.d.ts.map +1 -1
- package/dist/mutations.d.ts.map +1 -1
- package/dist/paymasterSend.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +1 -1
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/sendUserOp.d.ts +0 -18
- package/dist/sendUserOp.d.ts.map +1 -1
- package/dist/sequenceWallet.d.ts +1 -1
- package/dist/sequenceWallet.d.ts.map +1 -1
- package/dist/tokenBalances.d.ts.map +1 -1
- package/dist/tokens.d.ts +10 -8
- package/dist/tokens.d.ts.map +1 -1
- package/dist/trailsClient.d.ts +3 -3
- package/dist/trailsClient.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +4 -5
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +4 -5
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/standardDeposit.d.ts +2 -2
- package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/execution/transactionState.d.ts +2 -2
- package/dist/transactionIntent/execution/transactionState.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/crossChain.d.ts +6 -4
- package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/index.d.ts +0 -1
- package/dist/transactionIntent/handlers/index.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +4 -34
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -1
- package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.d.ts +2 -1
- package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/types.d.ts +7 -19
- package/dist/transactionIntent/types.d.ts.map +1 -1
- package/dist/transactionIntent/utils/index.d.ts +0 -1
- package/dist/transactionIntent/utils/index.d.ts.map +1 -1
- package/dist/transactions.d.ts +6 -18
- package/dist/transactions.d.ts.map +1 -1
- package/dist/utils.d.ts +8 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/walletUtils.d.ts +21 -0
- package/dist/walletUtils.d.ts.map +1 -0
- package/dist/wallets.d.ts +33 -240
- package/dist/wallets.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConfigDisplay.d.ts.map +1 -1
- package/dist/widget/components/FeeOption.d.ts +8 -13
- package/dist/widget/components/FeeOption.d.ts.map +1 -1
- package/dist/widget/components/FeeOptions.d.ts +11 -5
- package/dist/widget/components/FeeOptions.d.ts.map +1 -1
- package/dist/widget/components/NativeGasOption.d.ts.map +1 -1
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/components/QRCodeDeposit.d.ts +5 -0
- package/dist/widget/components/QRCodeDeposit.d.ts.map +1 -1
- package/dist/widget/components/QRCodeWalletSelect.d.ts +13 -0
- package/dist/widget/components/QRCodeWalletSelect.d.ts.map +1 -0
- package/dist/widget/components/QrCode.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Receipt.d.ts.map +1 -1
- package/dist/widget/components/ScreenHeader.d.ts +1 -1
- package/dist/widget/components/ScreenHeader.d.ts.map +1 -1
- package/dist/widget/components/SlippageToleranceSettings.d.ts +1 -0
- package/dist/widget/components/SlippageToleranceSettings.d.ts.map +1 -1
- package/dist/widget/components/Toast.d.ts.map +1 -1
- package/dist/widget/components/TokenImage.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/css/compiled.css +1 -1
- package/dist/widget/hooks/useCheckout.d.ts +15 -1
- package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts.map +1 -1
- package/dist/widget/hooks/useDebugScreens.d.ts +1 -1
- package/dist/widget/hooks/useDebugScreens.d.ts.map +1 -1
- package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/hooks/useIsConnectedWalletSmartContract.d.ts +7 -0
- package/dist/widget/hooks/useIsConnectedWalletSmartContract.d.ts.map +1 -0
- package/dist/widget/hooks/useIsSequenceWallet.d.ts +6 -0
- package/dist/widget/hooks/useIsSequenceWallet.d.ts.map +1 -0
- package/dist/widget/hooks/useQuote.d.ts +6 -11
- package/dist/widget/hooks/useQuote.d.ts.map +1 -1
- package/dist/widget/hooks/useRecentTokens.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedFeeOption.d.ts +30 -0
- package/dist/widget/hooks/useSelectedFeeOption.d.ts.map +1 -0
- package/dist/widget/hooks/useSendForm.d.ts +6 -15
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
- package/dist/widget/index.d.ts +1 -0
- package/dist/widget/index.d.ts.map +1 -1
- package/dist/widget/index.js +4 -2
- package/dist/widget/providers/TrailsProvider.d.ts +29 -0
- package/dist/widget/providers/TrailsProvider.d.ts.map +1 -0
- package/dist/widget/widget.d.ts +14 -3
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/analytics.ts +53 -21
- package/src/cctp.ts +0 -1016
- package/src/chains.ts +155 -68
- package/src/config.ts +51 -207
- package/src/constants.ts +1 -13
- package/src/contractUtils.ts +6 -6
- package/src/estimate.ts +3 -6
- package/src/fees.ts +5 -10
- package/src/gasless.ts +45 -0
- package/src/index.ts +18 -40
- package/src/indexerClient.ts +39 -48
- package/src/intents.ts +51 -226
- package/src/mutations.ts +3 -2
- package/src/paymasterSend.ts +2 -5
- package/src/prepareSend.ts +21 -14
- package/src/sendUserOp.ts +3 -64
- package/src/sequenceWallet.ts +1 -2
- package/src/tokenBalances.ts +2 -1
- package/src/tokens.ts +62 -133
- package/src/trailsClient.ts +17 -12
- package/src/transactionIntent/deposits/depositOrchestrator.ts +14 -15
- package/src/transactionIntent/deposits/gaslessDeposit.ts +70 -100
- package/src/transactionIntent/deposits/standardDeposit.ts +22 -28
- package/src/transactionIntent/execution/transactionState.ts +2 -2
- package/src/transactionIntent/handlers/crossChain.ts +179 -381
- package/src/transactionIntent/handlers/index.ts +0 -1
- package/src/transactionIntent/handlers/sameChainSameToken.ts +228 -94
- package/src/transactionIntent/quote/normalizeQuote.ts +4 -6
- package/src/transactionIntent/quote/quoteHelpers.ts +35 -3
- package/src/transactionIntent/types.ts +7 -27
- package/src/transactionIntent/utils/index.ts +0 -1
- package/src/transactions.ts +19 -118
- package/src/umd.tsx +1 -3
- package/src/utils.ts +28 -8
- package/src/walletUtils.ts +42 -0
- package/src/wallets.ts +365 -208
- package/src/widget/compiled.css +1 -1
- package/src/widget/components/AccountIntentTransactionHistory.tsx +78 -4
- package/src/widget/components/AccountSettings.tsx +17 -17
- package/src/widget/components/ChainList.tsx +3 -3
- package/src/widget/components/ClassicSwap.tsx +19 -10
- package/src/widget/components/ConfigDisplay.tsx +19 -59
- package/src/widget/components/FeeOption.tsx +63 -20
- package/src/widget/components/FeeOptions.tsx +54 -123
- package/src/widget/components/NativeGasOption.tsx +3 -1
- package/src/widget/components/Pay.tsx +18 -11
- package/src/widget/components/PoolDeposit.tsx +23 -10
- package/src/widget/components/QRCodeDeposit.tsx +50 -30
- package/src/widget/components/QRCodeWalletSelect.tsx +77 -0
- package/src/widget/components/QrCode.tsx +188 -233
- package/src/widget/components/QuoteDetails.tsx +48 -2
- package/src/widget/components/Receipt.tsx +5 -2
- package/src/widget/components/ScreenHeader.tsx +10 -8
- package/src/widget/components/SlippageToleranceSettings.tsx +63 -14
- package/src/widget/components/Toast.tsx +10 -0
- package/src/widget/components/TokenImage.tsx +56 -13
- package/src/widget/components/WalletConnect.tsx +37 -99
- package/src/widget/hooks/useCheckout.ts +71 -0
- package/src/widget/hooks/useCurrentScreen.tsx +1 -0
- package/src/widget/hooks/useDebugScreens.ts +5 -0
- package/src/widget/hooks/useIntentTransactionHistory.ts +790 -412
- package/src/widget/hooks/useIsConnectedWalletSmartContract.ts +43 -0
- package/src/widget/hooks/useIsSequenceWallet.ts +17 -0
- package/src/widget/hooks/useQuote.ts +27 -34
- package/src/widget/hooks/useRecentTokens.ts +2 -1
- package/src/widget/hooks/useSelectedFeeOption.tsx +257 -0
- package/src/widget/hooks/useSendForm.ts +175 -46
- package/src/widget/hooks/useTokenList.ts +15 -2
- package/src/widget/index.tsx +8 -0
- package/src/widget/providers/TrailsProvider.tsx +123 -0
- package/src/widget/widget.tsx +165 -143
- package/dist/cctpqueue.d.ts +0 -18
- package/dist/cctpqueue.d.ts.map +0 -1
- package/dist/preconditions.d.ts +0 -12
- package/dist/preconditions.d.ts.map +0 -1
- package/dist/trails.d.ts +0 -110
- package/dist/trails.d.ts.map +0 -1
- package/dist/transactionIntent/handlers/sameChainDifferentToken.d.ts +0 -62
- package/dist/transactionIntent/handlers/sameChainDifferentToken.d.ts.map +0 -1
- package/dist/transactionIntent/utils/lifiHelpers.d.ts +0 -10
- package/dist/transactionIntent/utils/lifiHelpers.d.ts.map +0 -1
- package/dist/widget/hooks/useSelectedFeeToken.d.ts +0 -33
- package/dist/widget/hooks/useSelectedFeeToken.d.ts.map +0 -1
- package/src/cctpqueue.ts +0 -66
- package/src/preconditions.ts +0 -47
- package/src/trails.ts +0 -1303
- package/src/transactionIntent/handlers/sameChainDifferentToken.ts +0 -323
- package/src/transactionIntent/utils/lifiHelpers.ts +0 -68
- package/src/widget/hooks/useSelectedFeeToken.tsx +0 -288
package/src/widget/widget.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "@0xsequence/design-system/preset"
|
|
2
|
-
import { SequenceHooksContext, SequenceHooksProvider } from "@0xsequence/hooks"
|
|
3
2
|
import { AaveClient, AaveProvider } from "@aave/react"
|
|
4
3
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
|
|
5
4
|
import { AnimatePresence, motion } from "motion/react"
|
|
@@ -36,22 +35,11 @@ import {
|
|
|
36
35
|
trackWalletConnected,
|
|
37
36
|
trackWalletDisconnected,
|
|
38
37
|
trackWidgetScreen,
|
|
38
|
+
updateProjectAccessKey,
|
|
39
39
|
} from "../analytics.js"
|
|
40
40
|
import { getAllChains, getChainInfo, getRpcUrl } from "../chains.js"
|
|
41
|
-
import {
|
|
42
|
-
|
|
43
|
-
getDebug,
|
|
44
|
-
getSequenceIndexerUrl,
|
|
45
|
-
getSequenceNodeGatewayUrl,
|
|
46
|
-
getTrailsApiUrl,
|
|
47
|
-
setDebug,
|
|
48
|
-
setSequenceIndexerUrl,
|
|
49
|
-
setSequenceNodeGatewayUrl,
|
|
50
|
-
setSequenceProjectAccessKey,
|
|
51
|
-
setSlippageTolerance,
|
|
52
|
-
setTrailsApiUrl,
|
|
53
|
-
setWalletConnectProjectId,
|
|
54
|
-
} from "../config.js"
|
|
41
|
+
import { PROD_SEQUENCE_NODE_GATEWAY_URL } from "../constants.js"
|
|
42
|
+
// Config is now managed exclusively by TrailsProvider
|
|
55
43
|
import { cssObjectToString } from "../cssUtils.js"
|
|
56
44
|
import {
|
|
57
45
|
getFullErrorMessage,
|
|
@@ -67,13 +55,21 @@ import type { Pool } from "../pools.js"
|
|
|
67
55
|
import { usePools } from "../pools.js"
|
|
68
56
|
import type { PrepareSendQuote } from "../prepareSend.js"
|
|
69
57
|
import { isValidInteger, isValidNumeric } from "../prices.js"
|
|
70
|
-
import type { MetaTxnReceipt } from "../transactionIntent/types.js"
|
|
71
58
|
import type { Theme } from "../theme.js"
|
|
72
59
|
import type { SupportedToken } from "../tokens.js"
|
|
73
60
|
import { getWethAddress } from "../tokens.js"
|
|
61
|
+
import type { IntentTransaction } from "@0xsequence/trails-api"
|
|
74
62
|
import type { TransactionState } from "../transactions.js"
|
|
75
|
-
import {
|
|
63
|
+
import {
|
|
64
|
+
useQRCodeWallets,
|
|
65
|
+
useWallets,
|
|
66
|
+
walletConnectConnector,
|
|
67
|
+
getConnectorsInternal,
|
|
68
|
+
} from "../wallets.js"
|
|
76
69
|
// import { useOpenConnectModal } from "@0xsequence/connect"
|
|
70
|
+
import { generateAaveDepositCalldata } from "../aave.js"
|
|
71
|
+
import { DEFAULT_MODE } from "../constants.js"
|
|
72
|
+
import { generateMorphoDepositCalldata } from "../morpho.js"
|
|
77
73
|
import css from "./compiled.css?inline"
|
|
78
74
|
import { AccountIntentTransactionHistory } from "./components/AccountIntentTransactionHistory.js"
|
|
79
75
|
import { AccountSettings } from "./components/AccountSettings.js"
|
|
@@ -84,14 +80,15 @@ import { Earn } from "./components/Earn.js"
|
|
|
84
80
|
import EarnPools from "./components/EarnPools.js"
|
|
85
81
|
import { ErrorDisplay } from "./components/ErrorDisplay.js"
|
|
86
82
|
import Footer from "./components/Footer.js"
|
|
87
|
-
import { Fund } from "./components/FundSwap.js"
|
|
88
83
|
import FundMethods from "./components/FundMethods.js"
|
|
84
|
+
import { Fund } from "./components/FundSwap.js"
|
|
89
85
|
import { MeshConnectExchanges } from "./components/MeshConnectExchanges.js"
|
|
90
86
|
import { MeshConnectFlow } from "./components/MeshConnectFlow.js"
|
|
91
87
|
import type { MeshConnectProps } from "./components/MeshConnectIframe.js"
|
|
92
88
|
import Modal from "./components/Modal.js"
|
|
93
89
|
import { Pay } from "./components/Pay.js"
|
|
94
90
|
import QRCodeDeposit from "./components/QRCodeDeposit.js"
|
|
91
|
+
import QRCodeWalletSelect from "./components/QRCodeWalletSelect.js"
|
|
95
92
|
import Receipt from "./components/Receipt.js"
|
|
96
93
|
import { Receive } from "./components/Receive.js"
|
|
97
94
|
import { Recipients } from "./components/Recipients.js"
|
|
@@ -115,15 +112,12 @@ import {
|
|
|
115
112
|
useCurrentScreen,
|
|
116
113
|
type Screen,
|
|
117
114
|
} from "./hooks/useCurrentScreen.js"
|
|
118
|
-
import {
|
|
119
|
-
WalletConnectionProvider,
|
|
120
|
-
useWalletConnectionContext,
|
|
121
|
-
} from "./hooks/useWalletConnectionContext.js"
|
|
122
115
|
import { useDebugScreens } from "./hooks/useDebugScreens.js"
|
|
123
116
|
import { DefaultTokenSelectionProvider } from "./hooks/useDefaultTokenSelection.js"
|
|
124
117
|
import { DestinationSelectedTokenProvider } from "./hooks/useDestinationSelectedToken.js"
|
|
125
118
|
import { EarnPoolProvider, useEarnPool } from "./hooks/useEarnPool.js"
|
|
126
119
|
import { useInitialRedirect } from "./hooks/useInitialRedirect.js"
|
|
120
|
+
import { useIsSequenceWallet } from "./hooks/useIsSequenceWallet.js"
|
|
127
121
|
import { ModeProvider } from "./hooks/useMode.js"
|
|
128
122
|
import {
|
|
129
123
|
OriginSelectedTokenProvider as SelectedTokenProvider,
|
|
@@ -132,7 +126,14 @@ import {
|
|
|
132
126
|
} from "./hooks/useOriginSelectedToken.js"
|
|
133
127
|
import { PriceImpactWarningProvider } from "./hooks/usePriceImpactWarning.js"
|
|
134
128
|
import { useRecentTokens } from "./hooks/useRecentTokens.js"
|
|
135
|
-
import {
|
|
129
|
+
import {
|
|
130
|
+
SelectedFeeOptionProvider,
|
|
131
|
+
useSelectedFeeOption,
|
|
132
|
+
} from "./hooks/useSelectedFeeOption.js"
|
|
133
|
+
import {
|
|
134
|
+
SelectedFundMethodProvider,
|
|
135
|
+
useSelectedFundMethod,
|
|
136
|
+
} from "./hooks/useSelectedFundMethod.js"
|
|
136
137
|
import {
|
|
137
138
|
SelectedMeshExchangeProvider,
|
|
138
139
|
useSelectedMeshExchange,
|
|
@@ -145,14 +146,16 @@ import type { OnCompleteProps } from "./hooks/useSendForm.js"
|
|
|
145
146
|
import { SwapAmountProvider } from "./hooks/useSwapAmount.js"
|
|
146
147
|
import { useTargetAmount } from "./hooks/useTargetAmount.js"
|
|
147
148
|
import { ThemeProvider as ThemePreferenceProvider } from "./hooks/useTheme.js"
|
|
149
|
+
import {
|
|
150
|
+
useWalletConnectionContext,
|
|
151
|
+
WalletConnectionProvider,
|
|
152
|
+
} from "./hooks/useWalletConnectionContext.js"
|
|
148
153
|
import { useWidgetProps, WidgetPropsProvider } from "./hooks/useWidgetProps.js"
|
|
149
154
|
import {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
import { generateMorphoDepositCalldata } from "../morpho.js"
|
|
155
|
-
import { generateAaveDepositCalldata } from "../aave.js"
|
|
155
|
+
TrailsProvider,
|
|
156
|
+
useTrails,
|
|
157
|
+
type TrailsProviderProps,
|
|
158
|
+
} from "./providers/TrailsProvider.js"
|
|
156
159
|
|
|
157
160
|
export const aaveClient = AaveClient.create()
|
|
158
161
|
|
|
@@ -203,9 +206,9 @@ const isValidToToToken = (toToken: string | null | undefined) => {
|
|
|
203
206
|
|
|
204
207
|
export type TrailsWidgetProps = {
|
|
205
208
|
apiKey: string
|
|
206
|
-
sequenceIndexerUrl?: string
|
|
207
|
-
trailsApiUrl?: string
|
|
208
|
-
sequenceNodeGatewayUrl?: string
|
|
209
|
+
sequenceIndexerUrl?: string
|
|
210
|
+
trailsApiUrl?: string
|
|
211
|
+
sequenceNodeGatewayUrl?: string
|
|
209
212
|
toAddress?: string | null
|
|
210
213
|
toAmount?: string | null
|
|
211
214
|
toChainId?: number | string | null
|
|
@@ -240,6 +243,15 @@ export type TrailsWidgetProps = {
|
|
|
240
243
|
sessionId: string
|
|
241
244
|
transactionStates: TransactionState[]
|
|
242
245
|
}) => void
|
|
246
|
+
onCheckoutApprovalRequest?: (data: { sessionId: string }) => void
|
|
247
|
+
onCheckoutApprovalConfirmed?: (data: {
|
|
248
|
+
sessionId: string
|
|
249
|
+
transactionHash: `0x${string}`
|
|
250
|
+
}) => void
|
|
251
|
+
onCheckoutApprovalRejected?: (data: {
|
|
252
|
+
sessionId: string
|
|
253
|
+
error: unknown
|
|
254
|
+
}) => void
|
|
243
255
|
onOpen?: () => void
|
|
244
256
|
onClose?: () => void
|
|
245
257
|
|
|
@@ -475,6 +487,9 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
475
487
|
onCheckoutSignatureRequest,
|
|
476
488
|
onCheckoutSignatureConfirmed,
|
|
477
489
|
onCheckoutSignatureRejected,
|
|
490
|
+
onCheckoutApprovalRequest,
|
|
491
|
+
onCheckoutApprovalConfirmed,
|
|
492
|
+
onCheckoutApprovalRejected,
|
|
478
493
|
onCheckoutComplete,
|
|
479
494
|
onCheckoutError,
|
|
480
495
|
onCheckoutStatusUpdate,
|
|
@@ -490,25 +505,12 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
490
505
|
hideDisconnect,
|
|
491
506
|
} = useWidgetProps()
|
|
492
507
|
const { address, chainId, connector } = useAccount()
|
|
508
|
+
const { trailsApiKey } = useTrails()
|
|
509
|
+
const qrCodeWallets = useQRCodeWallets()
|
|
493
510
|
// const { setOpenConnectModal } = useOpenConnectModal()
|
|
494
511
|
|
|
495
|
-
//
|
|
496
|
-
const isSequenceWallet =
|
|
497
|
-
if (!connector) return false
|
|
498
|
-
const connectorName = connector.name?.toLowerCase() || ""
|
|
499
|
-
const connectorId = connector.id?.toLowerCase() || ""
|
|
500
|
-
const isSequence =
|
|
501
|
-
connectorName.includes("sequence") || connectorId.includes("sequence")
|
|
502
|
-
|
|
503
|
-
console.log("[trails-sdk] Sequence wallet detection:", {
|
|
504
|
-
connectorName,
|
|
505
|
-
connectorId,
|
|
506
|
-
isSequence,
|
|
507
|
-
connector: connector.name,
|
|
508
|
-
})
|
|
509
|
-
|
|
510
|
-
return isSequence
|
|
511
|
-
}, [connector])
|
|
512
|
+
// Check if the current connector is a Sequence wallet
|
|
513
|
+
const isSequenceWallet = useIsSequenceWallet()
|
|
512
514
|
const connections = useConnections()
|
|
513
515
|
const { disconnectAsync } = useDisconnect()
|
|
514
516
|
const { switchAccount } = useSwitchAccount()
|
|
@@ -564,6 +566,7 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
564
566
|
const [error, setError] = useState<string | null>(null)
|
|
565
567
|
const [prepareSendQuote, setPrepareSendQuote] =
|
|
566
568
|
useState<PrepareSendQuote | null>(null)
|
|
569
|
+
const [qrCodeWalletId, setQrCodeWalletId] = useState<string | null>(null)
|
|
567
570
|
const [previousConnector, setPreviousConnector] = useState<Connector | null>(
|
|
568
571
|
null,
|
|
569
572
|
)
|
|
@@ -880,11 +883,16 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
880
883
|
onCheckoutSignatureRequest,
|
|
881
884
|
onCheckoutSignatureConfirmed,
|
|
882
885
|
onCheckoutSignatureRejected,
|
|
886
|
+
onCheckoutApprovalRequest,
|
|
887
|
+
onCheckoutApprovalConfirmed,
|
|
888
|
+
onCheckoutApprovalRejected,
|
|
883
889
|
onCheckoutComplete,
|
|
884
890
|
onCheckoutError,
|
|
885
891
|
onCheckoutStatusUpdate,
|
|
886
892
|
})
|
|
887
893
|
|
|
894
|
+
const { clearSelectedFeeOption } = useSelectedFeeOption()
|
|
895
|
+
|
|
888
896
|
// Use the debug screens hook
|
|
889
897
|
const { handleDebugScreenSelect } = useDebugScreens({
|
|
890
898
|
setCurrentScreen,
|
|
@@ -921,6 +929,13 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
921
929
|
})
|
|
922
930
|
}, [currentScreen, address])
|
|
923
931
|
|
|
932
|
+
// Update analytics project access key when it changes
|
|
933
|
+
useEffect(() => {
|
|
934
|
+
if (trailsApiKey) {
|
|
935
|
+
updateProjectAccessKey(trailsApiKey)
|
|
936
|
+
}
|
|
937
|
+
}, [trailsApiKey])
|
|
938
|
+
|
|
924
939
|
// Identify user with Databeat whenever address changes
|
|
925
940
|
useEffect(() => {
|
|
926
941
|
const analytics = getAnalytics()
|
|
@@ -1319,6 +1334,8 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
1319
1334
|
setPrepareSendQuote(null)
|
|
1320
1335
|
setTotalCompletionSeconds(null)
|
|
1321
1336
|
clearHistory()
|
|
1337
|
+
// Reset selected fee token for new checkout
|
|
1338
|
+
clearSelectedFeeOption()
|
|
1322
1339
|
}, [
|
|
1323
1340
|
setSelectedFundMethod,
|
|
1324
1341
|
setDestinationTxHash,
|
|
@@ -1330,8 +1347,16 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
1330
1347
|
setSelectedPool,
|
|
1331
1348
|
setCurrentScreen,
|
|
1332
1349
|
clearHistory,
|
|
1350
|
+
clearSelectedFeeOption,
|
|
1333
1351
|
])
|
|
1334
1352
|
|
|
1353
|
+
// Update the currentScreen state when when the widget receives an updated 'mode' prop passed in by the consuming app.
|
|
1354
|
+
// This allows the widget to change modes without remounting the component.
|
|
1355
|
+
useEffect(() => {
|
|
1356
|
+
const initialScreen = getInitialScreenForMode(currentMode)
|
|
1357
|
+
setCurrentScreen(initialScreen)
|
|
1358
|
+
}, [currentMode, getInitialScreenForMode, setCurrentScreen])
|
|
1359
|
+
|
|
1335
1360
|
const handleOpenModal = useCallback(() => {
|
|
1336
1361
|
setIsModalOpen(true)
|
|
1337
1362
|
onOpen?.()
|
|
@@ -1363,6 +1388,11 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
1363
1388
|
}
|
|
1364
1389
|
|
|
1365
1390
|
function handleTransferComplete({ transactionStates }: OnCompleteProps) {
|
|
1391
|
+
logger.console.log(
|
|
1392
|
+
"[trails-sdk] handleTransferComplete called",
|
|
1393
|
+
transactionStates,
|
|
1394
|
+
)
|
|
1395
|
+
|
|
1366
1396
|
const firstTransactionState = transactionStates[0]
|
|
1367
1397
|
const lastTransactionState = transactionStates[transactionStates.length - 1]
|
|
1368
1398
|
|
|
@@ -1376,12 +1406,12 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
1376
1406
|
|
|
1377
1407
|
if (
|
|
1378
1408
|
lastTransactionState?.transactionHash ||
|
|
1379
|
-
((lastTransactionState as unknown as
|
|
1409
|
+
((lastTransactionState as unknown as IntentTransaction)?.txnHash &&
|
|
1380
1410
|
lastTransactionState?.chainId)
|
|
1381
1411
|
) {
|
|
1382
1412
|
setDestinationTxHash(
|
|
1383
1413
|
lastTransactionState?.transactionHash ||
|
|
1384
|
-
(lastTransactionState as unknown as
|
|
1414
|
+
(lastTransactionState as unknown as IntentTransaction)?.txnHash ||
|
|
1385
1415
|
"",
|
|
1386
1416
|
)
|
|
1387
1417
|
setDestinationChainId(lastTransactionState?.chainId)
|
|
@@ -1538,13 +1568,13 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
1538
1568
|
|
|
1539
1569
|
const handleWaitingForWalletConfirm = (quote: PrepareSendQuote) => {
|
|
1540
1570
|
setShowWalletConfirmRetry(false)
|
|
1541
|
-
|
|
1571
|
+
setPrepareSendQuote(quote ?? null)
|
|
1572
|
+
// Navigate to QR wallet selection when using QR code funding method
|
|
1542
1573
|
if (selectedFundMethod === "qr-code") {
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
setCurrentScreen("wallet-confirmation")
|
|
1574
|
+
setCurrentScreenWithBack("qr-code-wallet-select", currentScreen)
|
|
1575
|
+
return
|
|
1546
1576
|
}
|
|
1547
|
-
|
|
1577
|
+
setCurrentScreen("wallet-confirmation")
|
|
1548
1578
|
}
|
|
1549
1579
|
|
|
1550
1580
|
async function handleWalletConfirmRetry() {
|
|
@@ -1635,6 +1665,11 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
1635
1665
|
case "send-form":
|
|
1636
1666
|
return (
|
|
1637
1667
|
<Pay
|
|
1668
|
+
onBack={
|
|
1669
|
+
currentMode === "receive"
|
|
1670
|
+
? () => setCurrentScreen("receive")
|
|
1671
|
+
: undefined
|
|
1672
|
+
}
|
|
1638
1673
|
selectedToken={selectedToken}
|
|
1639
1674
|
onSend={handleOnSend}
|
|
1640
1675
|
onWaitingForWalletConfirm={handleWaitingForWalletConfirm}
|
|
@@ -1740,15 +1775,37 @@ const WidgetContent = forwardRef<TrailsWidgetRef>((_, ref) => {
|
|
|
1740
1775
|
quote={prepareSendQuote}
|
|
1741
1776
|
/>
|
|
1742
1777
|
)
|
|
1778
|
+
case "qr-code-wallet-select":
|
|
1779
|
+
return (
|
|
1780
|
+
<QRCodeWalletSelect
|
|
1781
|
+
onBack={handleBack}
|
|
1782
|
+
onSelect={(walletId) => {
|
|
1783
|
+
setQrCodeWalletId(walletId)
|
|
1784
|
+
setCurrentScreen("qr-code-deposit")
|
|
1785
|
+
}}
|
|
1786
|
+
selectedWalletId={qrCodeWalletId}
|
|
1787
|
+
/>
|
|
1788
|
+
)
|
|
1743
1789
|
case "qr-code-deposit":
|
|
1744
|
-
return
|
|
1790
|
+
return (
|
|
1791
|
+
<QRCodeDeposit
|
|
1792
|
+
onBack={() => setCurrentScreen("qr-code-wallet-select")}
|
|
1793
|
+
onChangeWallet={() => setCurrentScreen("qr-code-wallet-select")}
|
|
1794
|
+
quote={prepareSendQuote}
|
|
1795
|
+
selectedWalletId={qrCodeWalletId}
|
|
1796
|
+
walletOptions={qrCodeWallets}
|
|
1797
|
+
/>
|
|
1798
|
+
)
|
|
1745
1799
|
case "pending":
|
|
1746
1800
|
return (
|
|
1747
1801
|
<TransferPending
|
|
1748
1802
|
onElapsedTime={handleElapsedTime}
|
|
1749
1803
|
transactionStates={transactionStates}
|
|
1750
1804
|
quote={prepareSendQuote}
|
|
1751
|
-
onContinue={() =>
|
|
1805
|
+
onContinue={() => {
|
|
1806
|
+
logger.console.log("[trails-sdk] onContinue called")
|
|
1807
|
+
setCurrentScreen("receipt")
|
|
1808
|
+
}}
|
|
1752
1809
|
/>
|
|
1753
1810
|
)
|
|
1754
1811
|
case "receipt":
|
|
@@ -2078,7 +2135,7 @@ const WidgetInner = forwardRef<TrailsWidgetRef, TrailsWidgetProps>(
|
|
|
2078
2135
|
<WalletConnectionProvider>
|
|
2079
2136
|
<SelectedTokenProvider>
|
|
2080
2137
|
<DestinationSelectedTokenProvider>
|
|
2081
|
-
<
|
|
2138
|
+
<SelectedFeeOptionProvider>
|
|
2082
2139
|
<SelectedRecipientProvider>
|
|
2083
2140
|
<SwapAmountProvider>
|
|
2084
2141
|
<ChainFilterProvider>
|
|
@@ -2099,7 +2156,7 @@ const WidgetInner = forwardRef<TrailsWidgetRef, TrailsWidgetProps>(
|
|
|
2099
2156
|
</ChainFilterProvider>
|
|
2100
2157
|
</SwapAmountProvider>
|
|
2101
2158
|
</SelectedRecipientProvider>
|
|
2102
|
-
</
|
|
2159
|
+
</SelectedFeeOptionProvider>
|
|
2103
2160
|
</DestinationSelectedTokenProvider>
|
|
2104
2161
|
</SelectedTokenProvider>
|
|
2105
2162
|
</WalletConnectionProvider>
|
|
@@ -2113,52 +2170,23 @@ const WidgetInner = forwardRef<TrailsWidgetRef, TrailsWidgetProps>(
|
|
|
2113
2170
|
|
|
2114
2171
|
export const TrailsWidget = forwardRef<TrailsWidgetRef, TrailsWidgetProps>(
|
|
2115
2172
|
(props, ref) => {
|
|
2116
|
-
const sequenceHooksContext = useContext(SequenceHooksContext)
|
|
2117
2173
|
const wagmiContext = useContext(WagmiContext)
|
|
2118
2174
|
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
setSequenceProjectAccessKey(props.apiKey)
|
|
2122
|
-
} else {
|
|
2175
|
+
// Validate required props
|
|
2176
|
+
if (!props.apiKey) {
|
|
2123
2177
|
throw new Error("apiKey is required")
|
|
2124
2178
|
}
|
|
2125
|
-
if (props.sequenceIndexerUrl) {
|
|
2126
|
-
logger.console.log("props.sequenceIndexerUrl", props.sequenceIndexerUrl)
|
|
2127
|
-
setSequenceIndexerUrl(props.sequenceIndexerUrl)
|
|
2128
|
-
}
|
|
2129
|
-
if (props.trailsApiUrl) {
|
|
2130
|
-
logger.console.log("props.trailsApiUrl", props.trailsApiUrl)
|
|
2131
|
-
setTrailsApiUrl(props.trailsApiUrl)
|
|
2132
|
-
}
|
|
2133
|
-
if (props.sequenceNodeGatewayUrl) {
|
|
2134
|
-
logger.console.log(
|
|
2135
|
-
"props.sequenceNodeGatewayUrl",
|
|
2136
|
-
props.sequenceNodeGatewayUrl,
|
|
2137
|
-
)
|
|
2138
|
-
setSequenceNodeGatewayUrl(props.sequenceNodeGatewayUrl)
|
|
2139
|
-
}
|
|
2140
|
-
if (props.walletConnectProjectId) {
|
|
2141
|
-
logger.console.log(
|
|
2142
|
-
"props.walletConnectProjectId",
|
|
2143
|
-
props.walletConnectProjectId,
|
|
2144
|
-
)
|
|
2145
|
-
setWalletConnectProjectId(props.walletConnectProjectId)
|
|
2146
|
-
}
|
|
2147
|
-
if (props.slippageTolerance !== undefined) {
|
|
2148
|
-
logger.console.log("props.slippageTolerance", props.slippageTolerance)
|
|
2149
|
-
setSlippageTolerance(String(props.slippageTolerance))
|
|
2150
|
-
}
|
|
2151
|
-
if (typeof props.debug === "boolean" && props.debug !== getDebug()) {
|
|
2152
|
-
logger.console.log("props.debug", props.debug)
|
|
2153
|
-
setDebug(props.debug)
|
|
2154
|
-
}
|
|
2155
2179
|
|
|
2156
2180
|
const wagmiConfig = React.useMemo(() => {
|
|
2157
2181
|
const chains = getAllChains() as any
|
|
2158
2182
|
const baseConfig = {
|
|
2159
2183
|
chains,
|
|
2160
2184
|
transports: (chains as Array<Chain>).reduce((acc, chain) => {
|
|
2161
|
-
const sequenceRpcUrl = getRpcUrl(
|
|
2185
|
+
const sequenceRpcUrl = getRpcUrl(
|
|
2186
|
+
chain.id,
|
|
2187
|
+
props.apiKey,
|
|
2188
|
+
props.sequenceNodeGatewayUrl ?? PROD_SEQUENCE_NODE_GATEWAY_URL,
|
|
2189
|
+
)
|
|
2162
2190
|
return {
|
|
2163
2191
|
...acc,
|
|
2164
2192
|
[chain.id]: sequenceRpcUrl ? http(sequenceRpcUrl) : http(),
|
|
@@ -2174,14 +2202,35 @@ export const TrailsWidget = forwardRef<TrailsWidgetRef, TrailsWidgetProps>(
|
|
|
2174
2202
|
})
|
|
2175
2203
|
: undefined
|
|
2176
2204
|
|
|
2205
|
+
// Note: We can't use useConnectors hook here since this is in useMemo
|
|
2206
|
+
// So we'll create connectors directly with the apiKey
|
|
2207
|
+
const connectors = Array.isArray(props.wagmiConnectors)
|
|
2208
|
+
? props.wagmiConnectors
|
|
2209
|
+
: getConnectorsInternal(props.apiKey)
|
|
2210
|
+
|
|
2177
2211
|
return createConfig({
|
|
2178
2212
|
...baseConfig,
|
|
2179
|
-
connectors
|
|
2180
|
-
? props.wagmiConnectors
|
|
2181
|
-
: connectors,
|
|
2213
|
+
connectors,
|
|
2182
2214
|
storage,
|
|
2183
2215
|
})
|
|
2184
|
-
}, [
|
|
2216
|
+
}, [
|
|
2217
|
+
props.apiKey,
|
|
2218
|
+
props.decoupleWagmi,
|
|
2219
|
+
props.wagmiConnectors,
|
|
2220
|
+
props.sequenceNodeGatewayUrl,
|
|
2221
|
+
])
|
|
2222
|
+
|
|
2223
|
+
const trailsConfig: TrailsProviderProps["config"] = {
|
|
2224
|
+
trailsApiKey: props.apiKey,
|
|
2225
|
+
trailsApiUrl: props.trailsApiUrl,
|
|
2226
|
+
sequenceIndexerUrl: props.sequenceIndexerUrl,
|
|
2227
|
+
sequenceNodeGatewayUrl: props.sequenceNodeGatewayUrl,
|
|
2228
|
+
walletConnectProjectId: props.walletConnectProjectId,
|
|
2229
|
+
slippageTolerance: props.slippageTolerance
|
|
2230
|
+
? String(props.slippageTolerance)
|
|
2231
|
+
: undefined,
|
|
2232
|
+
debug: props.debug,
|
|
2233
|
+
}
|
|
2185
2234
|
|
|
2186
2235
|
// Create content with only the providers that don't exist in parent
|
|
2187
2236
|
const content = (() => {
|
|
@@ -2191,63 +2240,36 @@ export const TrailsWidget = forwardRef<TrailsWidgetRef, TrailsWidgetProps>(
|
|
|
2191
2240
|
</ThemeProvider>
|
|
2192
2241
|
)
|
|
2193
2242
|
|
|
2194
|
-
const sequenceConfig = {
|
|
2195
|
-
commitHash: getCommitHash(),
|
|
2196
|
-
projectAccessKey: props.apiKey,
|
|
2197
|
-
env: {
|
|
2198
|
-
indexerUrl: props.sequenceIndexerUrl || getSequenceIndexerUrl(),
|
|
2199
|
-
indexerGatewayUrl:
|
|
2200
|
-
props.sequenceIndexerUrl || getSequenceIndexerUrl(),
|
|
2201
|
-
nodeGatewayUrl:
|
|
2202
|
-
props.sequenceNodeGatewayUrl || getSequenceNodeGatewayUrl(),
|
|
2203
|
-
trailsApiUrl: props.trailsApiUrl || getTrailsApiUrl(),
|
|
2204
|
-
},
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
2243
|
if (props.decoupleWagmi) {
|
|
2208
2244
|
return (
|
|
2209
|
-
<
|
|
2210
|
-
<
|
|
2211
|
-
<
|
|
2245
|
+
<TrailsProvider config={trailsConfig}>
|
|
2246
|
+
<AaveProvider client={aaveClient}>
|
|
2247
|
+
<QueryClientProvider client={queryClient}>
|
|
2212
2248
|
<WagmiProvider config={wagmiConfig}>
|
|
2213
2249
|
{widgetContent}
|
|
2214
2250
|
</WagmiProvider>
|
|
2215
|
-
</
|
|
2216
|
-
</
|
|
2217
|
-
</
|
|
2251
|
+
</QueryClientProvider>
|
|
2252
|
+
</AaveProvider>
|
|
2253
|
+
</TrailsProvider>
|
|
2218
2254
|
)
|
|
2219
2255
|
}
|
|
2220
2256
|
|
|
2221
2257
|
const baseContent = (
|
|
2222
|
-
<
|
|
2223
|
-
<
|
|
2224
|
-
{
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
// Both providers exist in parent, just render widget
|
|
2258
|
+
<TrailsProvider config={trailsConfig}>
|
|
2259
|
+
<AaveProvider client={aaveClient}>
|
|
2260
|
+
<QueryClientProvider client={queryClient}>
|
|
2261
|
+
{wagmiContext ? (
|
|
2262
|
+
// WagmiProvider exists in parent, don't wrap
|
|
2228
2263
|
widgetContent
|
|
2229
2264
|
) : (
|
|
2230
|
-
//
|
|
2265
|
+
// WagmiProvider missing, wrap with it
|
|
2231
2266
|
<WagmiProvider config={wagmiConfig}>
|
|
2232
2267
|
{widgetContent}
|
|
2233
2268
|
</WagmiProvider>
|
|
2234
|
-
)
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
{wagmiContext ? (
|
|
2239
|
-
// WagmiProvider exists in parent, don't wrap
|
|
2240
|
-
widgetContent
|
|
2241
|
-
) : (
|
|
2242
|
-
// WagmiProvider missing, wrap with it
|
|
2243
|
-
<WagmiProvider config={wagmiConfig}>
|
|
2244
|
-
{widgetContent}
|
|
2245
|
-
</WagmiProvider>
|
|
2246
|
-
)}
|
|
2247
|
-
</SequenceHooksProvider>
|
|
2248
|
-
)}
|
|
2249
|
-
</QueryClientProvider>
|
|
2250
|
-
</AaveProvider>
|
|
2269
|
+
)}
|
|
2270
|
+
</QueryClientProvider>
|
|
2271
|
+
</AaveProvider>
|
|
2272
|
+
</TrailsProvider>
|
|
2251
2273
|
)
|
|
2252
2274
|
|
|
2253
2275
|
return baseContent
|
package/dist/cctpqueue.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { TrailsClient } from './trailsClient.js';
|
|
2
|
-
type CctpQueueCapable = {
|
|
3
|
-
queueCCTPTransfer: (args: {
|
|
4
|
-
sourceTxHash?: string;
|
|
5
|
-
metaTxHash?: string;
|
|
6
|
-
sourceChainId: number;
|
|
7
|
-
destinationChainId: number;
|
|
8
|
-
}, headers?: object, signal?: AbortSignal) => Promise<unknown>;
|
|
9
|
-
};
|
|
10
|
-
export declare function hasCctpQueue(client: unknown): client is CctpQueueCapable;
|
|
11
|
-
export declare function queueCCTPTransfer({ trailsClient, sourceTxHash, sourceChainId, destinationChainId, }: {
|
|
12
|
-
trailsClient: TrailsClient;
|
|
13
|
-
sourceTxHash: string;
|
|
14
|
-
sourceChainId: number;
|
|
15
|
-
destinationChainId: number;
|
|
16
|
-
}): Promise<void>;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=cctpqueue.d.ts.map
|
package/dist/cctpqueue.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cctpqueue.d.ts","sourceRoot":"","sources":["../src/cctpqueue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,KAAK,gBAAgB,GAAG;IACtB,iBAAiB,EAAE,CACjB,IAAI,EAAE;QACJ,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,aAAa,EAAE,MAAM,CAAA;QACrB,kBAAkB,EAAE,MAAM,CAAA;KAC3B,EACD,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,OAAO,CAAC,CAAA;CACtB,CAAA;AAqBD,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,gBAAgB,CAGxE;AAED,wBAAsB,iBAAiB,CAAC,EACtC,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,kBAAkB,GACnB,EAAE;IACD,YAAY,EAAE,YAAY,CAAA;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;CAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAchB"}
|
package/dist/preconditions.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TransactionPrecondition } from '@0xsequence/trails-api';
|
|
2
|
-
export type IntentPrecondition = TransactionPrecondition;
|
|
3
|
-
export declare function findPreconditionAddresses(preconditions: TransactionPrecondition[], originChainId: number, destinationChainId: number): {
|
|
4
|
-
originAddress?: string;
|
|
5
|
-
destinationAddress?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function findChainAndAddressesFromPreconditions(preconditions: TransactionPrecondition[]): {
|
|
8
|
-
chainId: number;
|
|
9
|
-
address: string;
|
|
10
|
-
}[];
|
|
11
|
-
export declare function findFirstPreconditionForChainId(preconditions: TransactionPrecondition[], chainId: number): TransactionPrecondition | null;
|
|
12
|
-
//# sourceMappingURL=preconditions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preconditions.d.ts","sourceRoot":"","sources":["../src/preconditions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAGrE,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,CAAA;AAExD,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,uBAAuB,EAAE,EACxC,aAAa,EAAE,MAAM,EACrB,kBAAkB,EAAE,MAAM,GACzB;IAAE,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAE,CAYzD;AAED,wBAAgB,sCAAsC,CACpD,aAAa,EAAE,uBAAuB,EAAE,GACvC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAWxC;AAED,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,uBAAuB,EAAE,EACxC,OAAO,EAAE,MAAM,GACd,uBAAuB,GAAG,IAAI,CAKhC"}
|