0xtrails 0.1.13 → 0.2.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.map +1 -1
- package/dist/analytics.d.ts +11 -2
- package/dist/analytics.d.ts.map +1 -1
- package/dist/apiClient.d.ts +1 -1
- package/dist/apiClient.d.ts.map +1 -1
- package/dist/{proxyCaller.d.ts → balanceInjector.d.ts} +5 -4
- package/dist/balanceInjector.d.ts.map +1 -0
- package/dist/{ccip-D3gTQONK.js → ccip-D6ToCrWc.js} +12 -12
- package/dist/cctp.d.ts.map +1 -1
- package/dist/cctpqueue.d.ts +3 -3
- package/dist/cctpqueue.d.ts.map +1 -1
- package/dist/chains.d.ts.map +1 -1
- package/dist/config.d.ts +17 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.d.ts +5 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/contractUtils.d.ts +2 -0
- package/dist/contractUtils.d.ts.map +1 -1
- package/dist/customChains.d.ts +24 -0
- package/dist/customChains.d.ts.map +1 -0
- package/dist/{index-CnUM7lKf.js → index-BqgeTLL8.js} +34072 -30146
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +411 -400
- package/dist/intentEntrypoint.d.ts +96 -0
- package/dist/intentEntrypoint.d.ts.map +1 -0
- package/dist/intents.d.ts +5 -3
- package/dist/intents.d.ts.map +1 -1
- package/dist/metaTxnMonitor.d.ts.map +1 -1
- package/dist/morpho.d.ts.map +1 -1
- package/dist/pools.d.ts +3 -1
- package/dist/pools.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +8 -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/relaySdk.d.ts.map +1 -1
- package/dist/relayer.d.ts.map +1 -1
- package/dist/toast.d.ts +9 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/tokenBalances.d.ts +6 -2
- package/dist/tokenBalances.d.ts.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/trails.d.ts +6 -5
- package/dist/trails.d.ts.map +1 -1
- package/dist/trailsClient.d.ts +12 -0
- package/dist/trailsClient.d.ts.map +1 -0
- package/dist/transactions.d.ts +8 -0
- package/dist/transactions.d.ts.map +1 -1
- package/dist/wallets.d.ts.map +1 -1
- package/dist/widget/components/AccountActionsDropdown.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/AccountSettings.d.ts +7 -0
- package/dist/widget/components/AccountSettings.d.ts.map +1 -0
- package/dist/widget/components/ChainList.d.ts +0 -1
- package/dist/widget/components/ChainList.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts +46 -0
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -0
- package/dist/widget/components/ConfigDisplay.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts +9 -0
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -0
- package/dist/widget/components/DebugMenu.d.ts.map +1 -1
- package/dist/widget/components/DebugScreensList.d.ts.map +1 -1
- package/dist/widget/components/DebugToast.d.ts +3 -0
- package/dist/widget/components/DebugToast.d.ts.map +1 -0
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/EarnPools.d.ts.map +1 -1
- package/dist/widget/components/Fund.d.ts +44 -0
- package/dist/widget/components/Fund.d.ts.map +1 -0
- package/dist/widget/components/Identicon.d.ts +9 -0
- package/dist/widget/components/Identicon.d.ts.map +1 -0
- package/dist/widget/components/Pay.d.ts +46 -0
- package/dist/widget/components/Pay.d.ts.map +1 -0
- package/dist/widget/components/Receive.d.ts.map +1 -1
- package/dist/widget/components/RecentTokens.d.ts.map +1 -1
- package/dist/widget/components/Recipients.d.ts +9 -0
- package/dist/widget/components/Recipients.d.ts.map +1 -0
- package/dist/widget/components/RefundWarning.d.ts +9 -0
- package/dist/widget/components/RefundWarning.d.ts.map +1 -0
- package/dist/widget/components/SimpleSwap.d.ts.map +1 -1
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/SwapSettings.d.ts +1 -5
- package/dist/widget/components/SwapSettings.d.ts.map +1 -1
- package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
- package/dist/widget/components/ThemeSyncer.d.ts +6 -0
- package/dist/widget/components/ThemeSyncer.d.ts.map +1 -0
- package/dist/widget/components/Toast.d.ts +24 -0
- package/dist/widget/components/Toast.d.ts.map +1 -0
- package/dist/widget/components/TokenList.d.ts.map +1 -1
- package/dist/widget/components/TransactionDetails.d.ts.map +1 -1
- package/dist/widget/components/TruncatedAddress.d.ts +2 -0
- package/dist/widget/components/TruncatedAddress.d.ts.map +1 -1
- package/dist/widget/components/UserPreferences.d.ts +7 -0
- package/dist/widget/components/UserPreferences.d.ts.map +1 -0
- package/dist/widget/hooks/useBalanceVisible.d.ts +1 -0
- package/dist/widget/hooks/useBalanceVisible.d.ts.map +1 -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/useDefaultTokenSelection.d.ts +54 -0
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -0
- package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/hooks/usePayMessage.d.ts +34 -0
- package/dist/widget/hooks/usePayMessage.d.ts.map +1 -0
- package/dist/widget/hooks/useRecipients.d.ts +17 -0
- package/dist/widget/hooks/useRecipients.d.ts.map +1 -0
- package/dist/widget/hooks/useSelectedRecipient.d.ts +12 -0
- package/dist/widget/hooks/useSelectedRecipient.d.ts.map +1 -0
- package/dist/widget/hooks/useSendForm.d.ts +2 -0
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/hooks/useSwapAmount.d.ts +13 -0
- package/dist/widget/hooks/useSwapAmount.d.ts.map +1 -0
- package/dist/widget/hooks/useSwapSettings.d.ts +16 -0
- package/dist/widget/hooks/useSwapSettings.d.ts.map +1 -0
- package/dist/widget/hooks/useTargetAmount.d.ts +5 -0
- package/dist/widget/hooks/useTargetAmount.d.ts.map +1 -0
- package/dist/widget/hooks/useTheme.d.ts +14 -0
- package/dist/widget/hooks/useTheme.d.ts.map +1 -0
- package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
- package/dist/widget/index.js +2 -2
- package/dist/widget/widget.d.ts +9 -0
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +29 -28
- package/src/aave.ts +6 -1
- package/src/analytics.ts +103 -53
- package/src/apiClient.ts +1 -1
- package/src/{proxyCaller.ts → balanceInjector.ts} +22 -17
- package/src/cctp.ts +6 -2
- package/src/cctpqueue.ts +7 -7
- package/src/chains.ts +8 -0
- package/src/config.ts +40 -9
- package/src/constants.ts +11 -8
- package/src/contractUtils.ts +33 -2
- package/src/customChains.ts +24 -0
- package/src/index.ts +11 -1
- package/src/intentEntrypoint.ts +253 -0
- package/src/intents.ts +87 -54
- package/src/metaTxnMonitor.ts +1 -0
- package/src/morpho.ts +13 -2
- package/src/pools.ts +68 -86
- package/src/prepareSend.ts +437 -207
- package/src/prices.ts +51 -7
- package/src/relaySdk.ts +6 -4
- package/src/relayer.ts +2 -0
- package/src/toast.ts +110 -0
- package/src/tokenBalances.ts +112 -20
- package/src/tokens.ts +70 -7
- package/src/trails.ts +80 -77
- package/src/trailsClient.ts +45 -0
- package/src/transactions.ts +27 -35
- package/src/umd.tsx +1 -1
- package/src/wallets.ts +2 -1
- package/src/widget/assets/sequence-logo.svg +15 -0
- package/src/widget/compiled.css +2 -2
- package/src/widget/components/AccountActionsDropdown.tsx +18 -159
- package/src/widget/components/AccountIntentTransactionHistory.tsx +346 -63
- package/src/widget/components/AccountSettings.tsx +96 -0
- package/src/widget/components/ChainFilterDropdown.tsx +1 -1
- package/src/widget/components/ChainList.tsx +10 -20
- package/src/widget/components/ClassicSwap.tsx +923 -0
- package/src/widget/components/ConfigDisplay.tsx +8 -5
- package/src/widget/components/ConnectedWallets.tsx +260 -0
- package/src/widget/components/DebugMenu.tsx +2 -0
- package/src/widget/components/DebugScreensList.tsx +3 -0
- package/src/widget/components/DebugToast.tsx +63 -0
- package/src/widget/components/Earn.tsx +108 -116
- package/src/widget/components/EarnPools.tsx +2 -4
- package/src/widget/components/EarnPoolsFilters.tsx +6 -6
- package/src/widget/components/Fund.tsx +1245 -0
- package/src/widget/components/FundMethods.tsx +1 -1
- package/src/widget/components/FundSendForm.tsx +1 -1
- package/src/widget/components/Identicon.tsx +158 -0
- package/src/widget/components/Pay.tsx +1088 -0
- package/src/widget/components/PaySendForm.tsx +1 -1
- package/src/widget/components/QuoteDetails.tsx +1 -1
- package/src/widget/components/Receipt.tsx +1 -1
- package/src/widget/components/Receive.tsx +4 -2
- package/src/widget/components/RecentTokens.tsx +2 -1
- package/src/widget/components/Recipients.tsx +448 -0
- package/src/widget/components/RefundWarning.tsx +61 -0
- package/src/widget/components/ScreenHeader.tsx +1 -1
- package/src/widget/components/SimpleSwap.tsx +74 -58
- package/src/widget/components/Swap.tsx +35 -853
- package/src/widget/components/SwapSettings.tsx +5 -11
- package/src/widget/components/ThemeProvider.tsx +32 -0
- package/src/widget/components/ThemeSyncer.tsx +47 -0
- package/src/widget/components/Toast.tsx +315 -0
- package/src/widget/components/TokenList.tsx +2 -34
- package/src/widget/components/TokenSelector.tsx +3 -3
- package/src/widget/components/TransactionDetails.tsx +153 -13
- package/src/widget/components/TruncatedAddress.tsx +5 -1
- package/src/widget/components/UserPreferences.tsx +156 -0
- package/src/widget/components/WalletList.tsx +1 -1
- package/src/widget/hooks/useBalanceVisible.tsx +40 -2
- package/src/widget/hooks/useCheckout.ts +13 -0
- package/src/widget/hooks/useCurrentScreen.tsx +3 -0
- package/src/widget/hooks/useDebugScreens.ts +12 -2
- package/src/widget/hooks/useDefaultTokenSelection.tsx +475 -0
- package/src/widget/hooks/useIntentTransactionHistory.ts +212 -0
- package/src/widget/hooks/usePayMessage.tsx +370 -0
- package/src/widget/hooks/useRecipients.ts +168 -0
- package/src/widget/hooks/useSelectedRecipient.tsx +48 -0
- package/src/widget/hooks/useSendForm.ts +179 -26
- package/src/widget/hooks/useSwapAmount.tsx +50 -0
- package/src/widget/hooks/useSwapSettings.tsx +100 -0
- package/src/widget/hooks/useTargetAmount.ts +23 -0
- package/src/widget/hooks/useTheme.tsx +80 -0
- package/src/widget/hooks/useTokenList.ts +20 -11
- package/src/widget/index.css +45 -21
- package/src/widget/widget.tsx +164 -68
- package/dist/address.d.ts +0 -2
- package/dist/address.d.ts.map +0 -1
- package/dist/proxyCaller.d.ts.map +0 -1
- package/src/address.ts +0 -6
package/dist/index.js
CHANGED
|
@@ -1,53 +1,55 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import {
|
|
3
|
-
import { useMutation as
|
|
4
|
-
import { useState as c, useCallback as qe, useEffect as b, useMemo as
|
|
5
|
-
import { isAddressEqual as ee, zeroAddress as
|
|
6
|
-
import { useSwitchChain as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
1
|
+
import { u as bn, a as En, l as t, c as Pe, f as Pn, b as B, S as xe, d as Me, e as xn, h as Mn, i as ce, q as On, j as qn, k as Oe } from "./index-BqgeTLL8.js";
|
|
2
|
+
import { O as zn, T as Yn, ad as Jn, af as Xn, v as Zn, ae as et, U as nt, m as tt, D as st, A as it, r as at, aa as ot, E as rt, F as ct, s as lt, z as dt, R as ut, ab as gt, P as mt, W as ft, Z as ht, Y as It, a3 as pt, V as vt, a8 as Tt, o as Ct, K as St, X as At, ac as yt, N as wt, a6 as kt, x as bt, Q as Et, w as Pt, a9 as xt, $ as Mt, a4 as Ot, a1 as qt, a2 as Rt, _ as $t, a7 as Nt, a0 as Ft, a5 as Ht, n as Ut, G as Dt, B as Bt, H as jt, I as Gt, t as Lt, C as _t, y as Wt, p as Qt, L as Vt, J as Kt, M as zt } from "./index-BqgeTLL8.js";
|
|
3
|
+
import { useMutation as Se, useQuery as Rn } from "@tanstack/react-query";
|
|
4
|
+
import { useState as c, useCallback as qe, useEffect as b, useMemo as $n, useRef as Re } from "react";
|
|
5
|
+
import { isAddressEqual as ee, zeroAddress as $e, isAddress as Nn, createPublicClient as Ne, http as Fe, createWalletClient as He, custom as Ue } from "viem";
|
|
6
|
+
import { useSwitchChain as Fn, useSendTransaction as Hn, useEstimateGas as Un, useWaitForTransactionReceipt as Dn } from "wagmi";
|
|
7
|
+
const De = 1e4;
|
|
8
|
+
function Qn(Be) {
|
|
9
9
|
const {
|
|
10
10
|
account: d,
|
|
11
11
|
disableAutoExecute: je = !1,
|
|
12
|
-
env:
|
|
13
|
-
sequenceProjectAccessKey:
|
|
14
|
-
} =
|
|
12
|
+
env: Ge,
|
|
13
|
+
sequenceProjectAccessKey: Le
|
|
14
|
+
} = Be, S = bn({
|
|
15
|
+
projectAccessKey: Le
|
|
16
|
+
}), [x, ne] = c(!je), [le, de] = c(!1), [j, Ae] = c(
|
|
15
17
|
{}
|
|
16
|
-
), [u,
|
|
17
|
-
|
|
18
|
+
), [u, O] = c(null), [y, q] = c(null), [v, R] = c(null), [A, G] = c(null), [T, ue] = c(), [$, L] = c(null), [
|
|
19
|
+
_e,
|
|
18
20
|
_
|
|
19
|
-
] = c(null), [
|
|
21
|
+
] = c(null), [N, W] = c(
|
|
20
22
|
null
|
|
21
|
-
), [
|
|
22
|
-
switchChain:
|
|
23
|
-
isPending:
|
|
24
|
-
error:
|
|
25
|
-
} =
|
|
26
|
-
env:
|
|
23
|
+
), [We, Q] = c(null), [i, V] = c(null), [Qe, ye] = c({}), [te, se] = c(!1), [we, K] = c(!1), {
|
|
24
|
+
switchChain: Ve,
|
|
25
|
+
isPending: Ke,
|
|
26
|
+
error: z
|
|
27
|
+
} = Fn(), E = Hn(), [ze, ke] = c(!1), [w, M] = c(null), [Ye, F] = c(null), [ge, Y] = c({}), [Je, ie] = c(null), { getRelayer: me, relayers: Xe } = En({
|
|
28
|
+
env: Ge
|
|
27
29
|
}), {
|
|
28
|
-
data:
|
|
29
|
-
isError:
|
|
30
|
-
error:
|
|
31
|
-
} =
|
|
30
|
+
data: ae,
|
|
31
|
+
isError: fe,
|
|
32
|
+
error: he
|
|
33
|
+
} = Un(
|
|
32
34
|
i?.to && i?.chainId && !i.error ? {
|
|
33
35
|
to: i.to || void 0,
|
|
34
36
|
data: i.data || void 0,
|
|
35
37
|
value: i.value || void 0,
|
|
36
38
|
chainId: i.chainId || void 0
|
|
37
39
|
} : void 0
|
|
38
|
-
), I =
|
|
40
|
+
), I = Se({
|
|
39
41
|
mutationFn: async (e) => {
|
|
40
42
|
if (t.console.log(
|
|
41
43
|
"[useTrails] commitIntentConfigMutation started with args:",
|
|
42
44
|
e
|
|
43
|
-
), !
|
|
45
|
+
), !S)
|
|
44
46
|
throw t.console.error("[useTrails] API client not available"), new Error("API client not available");
|
|
45
47
|
if (!e.quoteProvider)
|
|
46
48
|
throw t.console.error("[useTrails] quoteProvider is required"), new Error("quoteProvider is required");
|
|
47
49
|
try {
|
|
48
50
|
t.console.log("[useTrails] Calculating intent address..."), t.console.log("[useTrails] Main signer:", e.mainSignerAddress), t.console.log("[useTrails] Calls:", e.calls);
|
|
49
|
-
const n = g.variables?.originChainId,
|
|
50
|
-
if (!n || !
|
|
51
|
+
const n = g.variables?.params.originChainId, a = g.variables?.params.destinationChainId;
|
|
52
|
+
if (!n || !a)
|
|
51
53
|
throw t.console.error(
|
|
52
54
|
"[useTrails] Could not determine origin/destination chain IDs for verification."
|
|
53
55
|
), new Error(
|
|
@@ -57,64 +59,64 @@ function Kn(Ge) {
|
|
|
57
59
|
e.mainSignerAddress,
|
|
58
60
|
e.calls
|
|
59
61
|
), {
|
|
60
|
-
originAddress:
|
|
61
|
-
destinationAddress:
|
|
62
|
-
} =
|
|
62
|
+
originAddress: r,
|
|
63
|
+
destinationAddress: m
|
|
64
|
+
} = Pn(
|
|
63
65
|
e.preconditions,
|
|
64
66
|
n,
|
|
65
|
-
|
|
67
|
+
a
|
|
66
68
|
);
|
|
67
69
|
t.console.log("[useTrails] Verification addresses:", {
|
|
68
70
|
calculatedOrigin: l.toString(),
|
|
69
71
|
calculatedDestination: s.toString(),
|
|
70
|
-
preconditionOrigin:
|
|
71
|
-
preconditionDestination:
|
|
72
|
+
preconditionOrigin: r,
|
|
73
|
+
preconditionDestination: m
|
|
72
74
|
});
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
+
const f = !!r && ee(
|
|
76
|
+
B(r),
|
|
75
77
|
l
|
|
76
78
|
);
|
|
77
|
-
t.console.log("[useTrails] Origin verified:",
|
|
78
|
-
const
|
|
79
|
-
|
|
79
|
+
t.console.log("[useTrails] Origin verified:", f);
|
|
80
|
+
const o = m && ee(
|
|
81
|
+
B(m),
|
|
80
82
|
s
|
|
81
|
-
) || !
|
|
83
|
+
) || !m && n === a && ee(s, $e);
|
|
82
84
|
t.console.log(
|
|
83
85
|
"[useTrails] Destination verified:",
|
|
84
|
-
|
|
86
|
+
o
|
|
85
87
|
);
|
|
86
|
-
const
|
|
88
|
+
const h = f && o;
|
|
87
89
|
if (ie({
|
|
88
|
-
success:
|
|
89
|
-
receivedOriginAddress:
|
|
90
|
-
receivedDestinationAddress:
|
|
90
|
+
success: h,
|
|
91
|
+
receivedOriginAddress: r,
|
|
92
|
+
receivedDestinationAddress: m,
|
|
91
93
|
calculatedOriginAddress: l.toString(),
|
|
92
94
|
calculatedDestinationAddress: s.toString()
|
|
93
|
-
}), !
|
|
95
|
+
}), !h)
|
|
94
96
|
throw t.console.error("[useTrails] Address verification failed.", {
|
|
95
|
-
isOriginVerified:
|
|
96
|
-
isDestinationVerified:
|
|
97
|
+
isOriginVerified: f,
|
|
98
|
+
isDestinationVerified: o
|
|
97
99
|
}), new Error(
|
|
98
|
-
`Address verification failed. Origin verified: ${
|
|
100
|
+
`Address verification failed. Origin verified: ${f}, Destination verified: ${o}`
|
|
99
101
|
);
|
|
100
102
|
t.console.log("[useTrails] Committing intent config to API...");
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
103
|
+
const p = await S.commitIntentConfig({
|
|
104
|
+
params: {
|
|
105
|
+
originIntentAddress: l.toString(),
|
|
106
|
+
destinationIntentAddress: s.toString(),
|
|
107
|
+
mainSigner: e.mainSignerAddress,
|
|
108
|
+
calls: e.calls,
|
|
109
|
+
preconditions: e.preconditions,
|
|
110
|
+
addressOverrides: {
|
|
111
|
+
...xe,
|
|
112
|
+
...e.addressOverrides
|
|
113
|
+
}
|
|
112
114
|
}
|
|
113
115
|
});
|
|
114
|
-
return t.console.log("[useTrails] API Commit Response:",
|
|
116
|
+
return t.console.log("[useTrails] API Commit Response:", p), {
|
|
115
117
|
originIntentAddress: l.toString(),
|
|
116
118
|
destinationIntentAddress: s.toString(),
|
|
117
|
-
response:
|
|
119
|
+
response: p
|
|
118
120
|
};
|
|
119
121
|
} catch (n) {
|
|
120
122
|
throw console.error("[useTrails] Error during commit intent mutation:", n), n;
|
|
@@ -127,77 +129,77 @@ function Kn(Ge) {
|
|
|
127
129
|
), t.console.log(
|
|
128
130
|
"[useTrails] Setting committedOriginIntentAddress:",
|
|
129
131
|
e.originIntentAddress
|
|
130
|
-
),
|
|
132
|
+
), L(e.originIntentAddress), _(e.destinationIntentAddress);
|
|
131
133
|
},
|
|
132
134
|
onError: (e) => {
|
|
133
|
-
t.console.error("[useTrails] Failed to commit intent config:", e),
|
|
135
|
+
t.console.error("[useTrails] Failed to commit intent config:", e), L(null), _(null);
|
|
134
136
|
}
|
|
135
137
|
}), {
|
|
136
|
-
data:
|
|
137
|
-
isLoading:
|
|
138
|
-
error:
|
|
139
|
-
} =
|
|
140
|
-
queryKey: ["getIntentConfig",
|
|
138
|
+
data: Ze,
|
|
139
|
+
isLoading: en,
|
|
140
|
+
error: nn
|
|
141
|
+
} = Rn({
|
|
142
|
+
queryKey: ["getIntentConfig", $],
|
|
141
143
|
queryFn: async () => {
|
|
142
|
-
if (!
|
|
144
|
+
if (!S || !$)
|
|
143
145
|
throw new Error("API client or committed intent address not available");
|
|
144
146
|
return t.console.log(
|
|
145
147
|
"Fetching intent config for address:",
|
|
146
|
-
|
|
147
|
-
), await
|
|
148
|
-
intentAddress:
|
|
148
|
+
$
|
|
149
|
+
), await S.getIntentConfig({
|
|
150
|
+
intentAddress: $
|
|
149
151
|
});
|
|
150
152
|
},
|
|
151
|
-
enabled:
|
|
153
|
+
enabled: !!$ && !!S && I.isSuccess,
|
|
152
154
|
staleTime: 1e3 * 60 * 5,
|
|
153
155
|
// 5 minutes
|
|
154
156
|
retry: 1
|
|
155
157
|
});
|
|
156
158
|
async function be(e) {
|
|
157
|
-
return qn(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
return qn(S, {
|
|
160
|
+
params: {
|
|
161
|
+
...e.params,
|
|
162
|
+
addressOverrides: {
|
|
163
|
+
...xe,
|
|
164
|
+
...e.params.addressOverrides
|
|
165
|
+
}
|
|
164
166
|
}
|
|
165
167
|
});
|
|
166
168
|
}
|
|
167
|
-
const g =
|
|
169
|
+
const g = Se({
|
|
168
170
|
mutationFn: async (e) => {
|
|
169
|
-
if (e.originChainId === e.destinationChainId && ee(
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
if (e.params.originChainId === e.params.destinationChainId && ee(
|
|
172
|
+
B(e.params.originTokenAddress),
|
|
173
|
+
B(e.params.destinationTokenAddress)
|
|
172
174
|
))
|
|
173
175
|
throw new Error(
|
|
174
176
|
"The same token cannot be used as both the source and destination token."
|
|
175
177
|
);
|
|
176
178
|
if (!d.address)
|
|
177
179
|
throw new Error("Missing selected token or account address");
|
|
178
|
-
|
|
180
|
+
L(null), _(null), ie(null), G(null), O(null), q(null), R(null), W(null), Q(null);
|
|
179
181
|
const n = await be(e);
|
|
180
|
-
return
|
|
182
|
+
return O(n.payloads.metaTxns), q(n.payloads.calls), R(n.payloads.preconditions), G(n.payloads.trailsFee), W(n.payloads.originIntentAddress), Q(n.payloads.destinationIntentAddress), L(null), _(null), ie(null), n;
|
|
181
183
|
},
|
|
182
184
|
onSuccess: (e) => {
|
|
183
|
-
t.console.log("Intent Config Success:", e), G(e.trailsFee || null), W(e.originIntentAddress),
|
|
185
|
+
t.console.log("Intent Config Success:", e), G(e.payloads.trailsFee || null), W(e.payloads.originIntentAddress), Q(e.payloads.destinationIntentAddress), e.payloads?.calls && e.payloads.calls.length > 0 && e.payloads.preconditions && e.payloads.preconditions.length > 0 && e.payloads.metaTxns && e.payloads.metaTxns.length > 0 ? (q(e.payloads.calls), R(e.payloads.preconditions), O(e.payloads.metaTxns)) : (t.console.warn("API returned success but no operations found."), q(null), R(null), O(null));
|
|
184
186
|
},
|
|
185
187
|
onError: (e) => {
|
|
186
|
-
console.error("Intent Config Error:", e),
|
|
188
|
+
console.error("Intent Config Error:", e), q(null), R(null), O(null), G(null), W(null), Q(null);
|
|
187
189
|
}
|
|
188
190
|
});
|
|
189
|
-
function
|
|
191
|
+
function tn(e) {
|
|
190
192
|
g.mutate(e);
|
|
191
193
|
}
|
|
192
|
-
const
|
|
193
|
-
t.console.log("[Trails] Clearing intent state"),
|
|
194
|
+
const sn = qe(() => {
|
|
195
|
+
t.console.log("[Trails] Clearing intent state"), q(null), R(null), O(null), G(null), L(null), _(null), ie(null), W(null), Q(null), ye({}), de(!1), Y({});
|
|
194
196
|
}, []), k = qe(
|
|
195
|
-
(e, n,
|
|
197
|
+
(e, n, a, l, s) => {
|
|
196
198
|
M({
|
|
197
199
|
txnHash: e,
|
|
198
200
|
status: n === "success" ? "Success" : n === "reverted" ? "Failed" : n === "sending" ? "Sending..." : "Pending",
|
|
199
201
|
revertReason: n === "reverted" ? s || "Transaction reverted" : void 0,
|
|
200
|
-
gasUsed:
|
|
202
|
+
gasUsed: a ? Number(a) : void 0,
|
|
201
203
|
effectiveGasPrice: l?.toString()
|
|
202
204
|
});
|
|
203
205
|
},
|
|
@@ -233,13 +235,13 @@ function Kn(Ge) {
|
|
|
233
235
|
void 0,
|
|
234
236
|
`Switching to chain ${i.chainId}...`
|
|
235
237
|
);
|
|
236
|
-
const e =
|
|
238
|
+
const e = He({
|
|
237
239
|
chain: ce(i.chainId),
|
|
238
|
-
transport:
|
|
240
|
+
transport: Ue(await d.connector.getProvider())
|
|
239
241
|
// TODO: Add proper type
|
|
240
242
|
});
|
|
241
243
|
try {
|
|
242
|
-
await
|
|
244
|
+
await Oe({
|
|
243
245
|
walletClient: e,
|
|
244
246
|
desiredChainId: i.chainId
|
|
245
247
|
}), K(!1);
|
|
@@ -259,21 +261,21 @@ function Kn(Ge) {
|
|
|
259
261
|
"Transaction already in progress. Skipping duplicate request."
|
|
260
262
|
);
|
|
261
263
|
else {
|
|
262
|
-
if (se(!0), ue(void 0), k(void 0, "sending"), !
|
|
264
|
+
if (se(!0), ue(void 0), k(void 0, "sending"), !ae && !fe) {
|
|
263
265
|
ke(!0);
|
|
264
266
|
return;
|
|
265
267
|
}
|
|
266
|
-
if (
|
|
267
|
-
t.console.error("Gas estimation failed:",
|
|
268
|
+
if (fe) {
|
|
269
|
+
t.console.error("Gas estimation failed:", he), k(
|
|
268
270
|
void 0,
|
|
269
271
|
"reverted",
|
|
270
272
|
void 0,
|
|
271
273
|
void 0,
|
|
272
|
-
`Gas estimation failed: ${
|
|
274
|
+
`Gas estimation failed: ${he?.message}`
|
|
273
275
|
), se(!1);
|
|
274
276
|
return;
|
|
275
277
|
}
|
|
276
|
-
const e =
|
|
278
|
+
const e = ae ? BigInt(Math.floor(Number(ae) * 1.2)) : void 0;
|
|
277
279
|
E.sendTransaction(
|
|
278
280
|
{
|
|
279
281
|
to: i.to,
|
|
@@ -300,14 +302,14 @@ function Kn(Ge) {
|
|
|
300
302
|
}
|
|
301
303
|
};
|
|
302
304
|
b(() => {
|
|
303
|
-
|
|
305
|
+
z && (t.console.error("Chain switch error:", z), k(
|
|
304
306
|
void 0,
|
|
305
307
|
"reverted",
|
|
306
308
|
void 0,
|
|
307
309
|
void 0,
|
|
308
|
-
`Chain switch failed: ${
|
|
310
|
+
`Chain switch failed: ${z.message || "Unknown error"}`
|
|
309
311
|
), K(!1));
|
|
310
|
-
}, [
|
|
312
|
+
}, [z, k]), b(() => {
|
|
311
313
|
ke(!1);
|
|
312
314
|
}, []), b(() => {
|
|
313
315
|
i?.chainId && d.chainId === i.chainId && (t.console.log("No chain switch required"), K(!1));
|
|
@@ -315,13 +317,13 @@ function Kn(Ge) {
|
|
|
315
317
|
if (i?.chainId && d.chainId !== i.chainId) {
|
|
316
318
|
async function e() {
|
|
317
319
|
try {
|
|
318
|
-
const n = i.chainId,
|
|
320
|
+
const n = i.chainId, a = He({
|
|
319
321
|
chain: ce(n),
|
|
320
|
-
transport:
|
|
322
|
+
transport: Ue(await d.connector.getProvider())
|
|
321
323
|
// TODO: Add proper type
|
|
322
324
|
});
|
|
323
|
-
await
|
|
324
|
-
walletClient:
|
|
325
|
+
await Oe({
|
|
326
|
+
walletClient: a,
|
|
325
327
|
desiredChainId: n
|
|
326
328
|
});
|
|
327
329
|
} catch (n) {
|
|
@@ -332,12 +334,12 @@ function Kn(Ge) {
|
|
|
332
334
|
}
|
|
333
335
|
}, [d, i]);
|
|
334
336
|
const {
|
|
335
|
-
data:
|
|
336
|
-
isLoading:
|
|
337
|
+
data: C,
|
|
338
|
+
isLoading: H,
|
|
337
339
|
isSuccess: Ie,
|
|
338
|
-
isError:
|
|
339
|
-
error:
|
|
340
|
-
} =
|
|
340
|
+
isError: pe,
|
|
341
|
+
error: oe
|
|
342
|
+
} = Dn({
|
|
341
343
|
hash: T,
|
|
342
344
|
confirmations: 1,
|
|
343
345
|
query: {
|
|
@@ -346,11 +348,11 @@ function Kn(Ge) {
|
|
|
346
348
|
});
|
|
347
349
|
b(() => {
|
|
348
350
|
if (!T) {
|
|
349
|
-
|
|
351
|
+
w?.txnHash && M(null), F(null), Object.keys(j).length > 0 && Ae({});
|
|
350
352
|
return;
|
|
351
353
|
}
|
|
352
|
-
if (!(
|
|
353
|
-
if (
|
|
354
|
+
if (!(w?.txnHash === T && (w?.status === "Success" || w?.status === "Failed") && !H)) {
|
|
355
|
+
if (H) {
|
|
354
356
|
M((e) => ({
|
|
355
357
|
...e?.txnHash === T ? e : {
|
|
356
358
|
gasUsed: void 0,
|
|
@@ -362,15 +364,15 @@ function Kn(Ge) {
|
|
|
362
364
|
}));
|
|
363
365
|
return;
|
|
364
366
|
}
|
|
365
|
-
if (Ie &&
|
|
366
|
-
const e =
|
|
367
|
+
if (Ie && C) {
|
|
368
|
+
const e = C.status === "success" ? "Success" : "Failed";
|
|
367
369
|
M({
|
|
368
|
-
txnHash:
|
|
370
|
+
txnHash: C.transactionHash,
|
|
369
371
|
status: e,
|
|
370
|
-
gasUsed:
|
|
371
|
-
effectiveGasPrice:
|
|
372
|
-
revertReason:
|
|
373
|
-
}), e === "Success" &&
|
|
372
|
+
gasUsed: C.gasUsed ? Number(C.gasUsed) : void 0,
|
|
373
|
+
effectiveGasPrice: C.effectiveGasPrice?.toString(),
|
|
374
|
+
revertReason: C.status === "reverted" ? oe?.message || "Transaction reverted by receipt" : void 0
|
|
375
|
+
}), e === "Success" && C.blockNumber ? (async () => {
|
|
374
376
|
try {
|
|
375
377
|
if (!i?.chainId) {
|
|
376
378
|
t.console.error(
|
|
@@ -378,45 +380,45 @@ function Kn(Ge) {
|
|
|
378
380
|
), F(null);
|
|
379
381
|
return;
|
|
380
382
|
}
|
|
381
|
-
const
|
|
382
|
-
chain:
|
|
383
|
-
transport:
|
|
383
|
+
const a = ce(i.chainId), s = await Ne({
|
|
384
|
+
chain: a,
|
|
385
|
+
transport: Fe()
|
|
384
386
|
}).getBlock({
|
|
385
|
-
blockNumber: BigInt(
|
|
387
|
+
blockNumber: BigInt(C.blockNumber)
|
|
386
388
|
});
|
|
387
389
|
F(Number(s.timestamp));
|
|
388
|
-
} catch (
|
|
390
|
+
} catch (a) {
|
|
389
391
|
t.console.error(
|
|
390
392
|
"[Trails] Error fetching origin block timestamp:",
|
|
391
|
-
|
|
393
|
+
a
|
|
392
394
|
), F(null);
|
|
393
395
|
}
|
|
394
|
-
})() : e !== "Success" && F(null), e === "Success" && u && u.length > 0 && x && !u.some((n) =>
|
|
396
|
+
})() : e !== "Success" && F(null), e === "Success" && u && u.length > 0 && x && !u.some((n) => j[`${n.chainId}-${n.id}`]) && (t.console.log(
|
|
395
397
|
"Origin transaction successful, auto-sending all meta transactions..."
|
|
396
|
-
),
|
|
397
|
-
} else
|
|
398
|
+
), U.mutate({ selectedId: null }));
|
|
399
|
+
} else pe && (M({
|
|
398
400
|
txnHash: T,
|
|
399
401
|
status: "Failed",
|
|
400
|
-
revertReason:
|
|
402
|
+
revertReason: oe?.message || "Failed to get receipt",
|
|
401
403
|
gasUsed: void 0,
|
|
402
404
|
effectiveGasPrice: void 0
|
|
403
405
|
}), F(null));
|
|
404
406
|
}
|
|
405
407
|
}, [
|
|
406
408
|
T,
|
|
407
|
-
|
|
409
|
+
H,
|
|
408
410
|
Ie,
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
411
|
+
pe,
|
|
412
|
+
C,
|
|
413
|
+
oe,
|
|
412
414
|
u,
|
|
413
|
-
|
|
415
|
+
j,
|
|
414
416
|
x,
|
|
415
417
|
i?.chainId,
|
|
416
|
-
|
|
417
|
-
|
|
418
|
+
w?.status,
|
|
419
|
+
w?.txnHash
|
|
418
420
|
]), b(() => {
|
|
419
|
-
x && I.isSuccess && i?.chainId && d.chainId === i.chainId && !i.error && i.to && i.data !== null && i.value !== null && !E.isPending && !
|
|
421
|
+
x && I.isSuccess && i?.chainId && d.chainId === i.chainId && !i.error && i.to && i.data !== null && i.value !== null && !E.isPending && !H && !T && !we && !w && !le && (t.console.log("Auto-executing transaction: All conditions met."), de(!0), M({
|
|
420
422
|
status: "Sending..."
|
|
421
423
|
}), E.sendTransaction(
|
|
422
424
|
{
|
|
@@ -443,65 +445,65 @@ function Kn(Ge) {
|
|
|
443
445
|
i,
|
|
444
446
|
d.chainId,
|
|
445
447
|
E.isPending,
|
|
446
|
-
|
|
448
|
+
H,
|
|
447
449
|
T,
|
|
448
|
-
|
|
449
|
-
|
|
450
|
+
we,
|
|
451
|
+
w,
|
|
450
452
|
le,
|
|
451
453
|
E
|
|
452
454
|
]), b(() => {
|
|
453
|
-
x &&
|
|
455
|
+
x && y && v && A && d.address && N && !I.isPending && !I.isSuccess && (t.console.log("Auto-committing intent configuration..."), I.mutate({
|
|
454
456
|
mainSignerAddress: d.address,
|
|
455
|
-
calls:
|
|
456
|
-
preconditions:
|
|
457
|
-
quoteProvider:
|
|
458
|
-
addressOverrides: g.variables?.addressOverrides
|
|
457
|
+
calls: y,
|
|
458
|
+
preconditions: v,
|
|
459
|
+
quoteProvider: A.quoteProvider,
|
|
460
|
+
addressOverrides: g.variables?.params.addressOverrides
|
|
459
461
|
}));
|
|
460
462
|
}, [
|
|
461
463
|
x,
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
464
|
+
y,
|
|
465
|
+
v,
|
|
466
|
+
A,
|
|
465
467
|
d.address,
|
|
466
|
-
|
|
468
|
+
N,
|
|
467
469
|
I,
|
|
468
470
|
g.variables
|
|
469
471
|
]);
|
|
470
|
-
const
|
|
472
|
+
const U = Se({
|
|
471
473
|
mutationFn: async ({ selectedId: e }) => {
|
|
472
474
|
if (t.console.log("[trails-sdk] Starting sendMetaTxn mutation", {
|
|
473
475
|
selectedId: e,
|
|
474
|
-
hasIntentCallsPayloads: !!
|
|
475
|
-
hasIntentPreconditions: !!
|
|
476
|
+
hasIntentCallsPayloads: !!y,
|
|
477
|
+
hasIntentPreconditions: !!v,
|
|
476
478
|
hasMetaTxns: !!u,
|
|
477
479
|
hasAccountAddress: !!d.address,
|
|
478
|
-
quoteProvider:
|
|
479
|
-
}), !
|
|
480
|
+
quoteProvider: A?.quoteProvider
|
|
481
|
+
}), !y || !v || !u || !d.address)
|
|
480
482
|
throw new Error("Missing required data for meta-transaction");
|
|
481
|
-
if (!
|
|
483
|
+
if (!A?.quoteProvider)
|
|
482
484
|
throw new Error("quoteProvider is required");
|
|
483
|
-
const n =
|
|
485
|
+
const n = Me(
|
|
484
486
|
d.address,
|
|
485
|
-
|
|
486
|
-
),
|
|
487
|
+
y
|
|
488
|
+
), a = e ? [u.find((s) => s.id === e)] : u;
|
|
487
489
|
if (t.console.log("[trails-sdk] Selected transactions to send", {
|
|
488
490
|
selectedId: e,
|
|
489
491
|
totalMetaTxns: u.length,
|
|
490
|
-
txnsToSendCount:
|
|
491
|
-
txnsToSend:
|
|
492
|
+
txnsToSendCount: a.filter((s) => s).length,
|
|
493
|
+
txnsToSend: a.filter((s) => s).map((s) => ({
|
|
492
494
|
id: s?.id,
|
|
493
495
|
chainId: s?.chainId,
|
|
494
496
|
walletAddress: s?.walletAddress,
|
|
495
497
|
contract: s?.contract
|
|
496
498
|
}))
|
|
497
|
-
}), !
|
|
499
|
+
}), !a || e && !a[0])
|
|
498
500
|
throw new Error("Meta transaction not found");
|
|
499
501
|
const l = [];
|
|
500
|
-
for (const s of
|
|
502
|
+
for (const s of a) {
|
|
501
503
|
if (!s) continue;
|
|
502
|
-
const
|
|
504
|
+
const r = `${s.chainId}-${s.id}`, m = j[r], f = Date.now();
|
|
503
505
|
if (t.console.log(
|
|
504
|
-
`[trails-sdk] Processing meta transaction ${
|
|
506
|
+
`[trails-sdk] Processing meta transaction ${r}`,
|
|
505
507
|
{
|
|
506
508
|
metaTxnId: s.id,
|
|
507
509
|
chainId: s.chainId,
|
|
@@ -509,88 +511,88 @@ function Kn(Ge) {
|
|
|
509
511
|
contract: s.contract,
|
|
510
512
|
intentAddress: n
|
|
511
513
|
}
|
|
512
|
-
),
|
|
513
|
-
const
|
|
514
|
-
(
|
|
514
|
+
), m && f - m < De) {
|
|
515
|
+
const o = Math.ceil(
|
|
516
|
+
(De - (f - m)) / 1e3
|
|
515
517
|
);
|
|
516
518
|
t.console.log(
|
|
517
|
-
`[trails-sdk] Meta transaction for ${
|
|
519
|
+
`[trails-sdk] Meta transaction for ${r} was sent recently. Wait ${o}s before retry`,
|
|
518
520
|
{
|
|
519
|
-
lastSentTime:
|
|
520
|
-
now:
|
|
521
|
-
timeLeft:
|
|
521
|
+
lastSentTime: m,
|
|
522
|
+
now: f,
|
|
523
|
+
timeLeft: o
|
|
522
524
|
}
|
|
523
525
|
);
|
|
524
526
|
continue;
|
|
525
527
|
}
|
|
526
528
|
try {
|
|
527
|
-
const
|
|
528
|
-
if (Number.isNaN(
|
|
529
|
+
const o = parseInt(s.chainId, 10);
|
|
530
|
+
if (Number.isNaN(o) || o <= 0)
|
|
529
531
|
throw t.console.error(
|
|
530
532
|
"[trails-sdk] Invalid chainId for meta transaction",
|
|
531
533
|
{
|
|
532
|
-
chainId:
|
|
533
|
-
operationKey:
|
|
534
|
+
chainId: o,
|
|
535
|
+
operationKey: r,
|
|
534
536
|
metaTxn: s
|
|
535
537
|
}
|
|
536
|
-
), new Error(`Invalid chainId for meta transaction: ${
|
|
537
|
-
const
|
|
538
|
-
if (!
|
|
538
|
+
), new Error(`Invalid chainId for meta transaction: ${o}`);
|
|
539
|
+
const h = me(o);
|
|
540
|
+
if (!h)
|
|
539
541
|
throw t.console.error("[trails-sdk] No relayer found for chainId", {
|
|
540
|
-
chainId:
|
|
541
|
-
operationKey:
|
|
542
|
-
availableRelayers: Array.from(
|
|
543
|
-
}), new Error(`No relayer found for chainId: ${
|
|
544
|
-
const
|
|
545
|
-
(
|
|
542
|
+
chainId: o,
|
|
543
|
+
operationKey: r,
|
|
544
|
+
availableRelayers: Array.from(Xe.keys())
|
|
545
|
+
}), new Error(`No relayer found for chainId: ${o}`);
|
|
546
|
+
const p = v.filter(
|
|
547
|
+
(D) => D.chainId && parseInt(D.chainId, 10) === o
|
|
546
548
|
);
|
|
547
549
|
t.console.log(
|
|
548
|
-
`[trails-sdk] Relaying meta transaction ${
|
|
550
|
+
`[trails-sdk] Relaying meta transaction ${r} to intent ${n} via relayer`,
|
|
549
551
|
{
|
|
550
|
-
chainId:
|
|
551
|
-
operationKey:
|
|
552
|
+
chainId: o,
|
|
553
|
+
operationKey: r,
|
|
552
554
|
intentAddress: n,
|
|
553
|
-
relayer: !!
|
|
554
|
-
preconditionsCount:
|
|
555
|
+
relayer: !!h,
|
|
556
|
+
preconditionsCount: p.length
|
|
555
557
|
}
|
|
556
558
|
);
|
|
557
|
-
const { opHash: Z } = await
|
|
559
|
+
const { opHash: Z } = await h.sendMetaTxn(
|
|
558
560
|
s.walletAddress,
|
|
559
561
|
s.contract,
|
|
560
562
|
s.input,
|
|
561
563
|
Number(s.chainId),
|
|
562
564
|
void 0,
|
|
563
|
-
|
|
565
|
+
p
|
|
564
566
|
);
|
|
565
567
|
t.console.log(
|
|
566
|
-
`[trails-sdk] Successfully sent meta transaction ${
|
|
568
|
+
`[trails-sdk] Successfully sent meta transaction ${r}`,
|
|
567
569
|
{
|
|
568
|
-
operationKey:
|
|
570
|
+
operationKey: r,
|
|
569
571
|
opHash: Z,
|
|
570
|
-
chainId:
|
|
572
|
+
chainId: o
|
|
571
573
|
}
|
|
572
574
|
);
|
|
573
|
-
const
|
|
575
|
+
const re = !1;
|
|
574
576
|
l.push({
|
|
575
|
-
operationKey:
|
|
577
|
+
operationKey: r,
|
|
576
578
|
opHash: Z,
|
|
577
579
|
success: !0
|
|
578
580
|
});
|
|
579
|
-
} catch (
|
|
580
|
-
const
|
|
581
|
+
} catch (o) {
|
|
582
|
+
const h = o instanceof Error ? o.message : "Unknown error";
|
|
581
583
|
t.console.error(
|
|
582
|
-
`[trails-sdk] Failed to send meta transaction ${
|
|
584
|
+
`[trails-sdk] Failed to send meta transaction ${r}`,
|
|
583
585
|
{
|
|
584
|
-
operationKey:
|
|
585
|
-
error:
|
|
586
|
+
operationKey: r,
|
|
587
|
+
error: h,
|
|
586
588
|
chainId: s.chainId,
|
|
587
589
|
metaTxnId: s.id,
|
|
588
590
|
walletAddress: s.walletAddress,
|
|
589
591
|
contract: s.contract
|
|
590
592
|
}
|
|
591
593
|
), l.push({
|
|
592
|
-
operationKey:
|
|
593
|
-
error:
|
|
594
|
+
operationKey: r,
|
|
595
|
+
error: h,
|
|
594
596
|
success: !1
|
|
595
597
|
});
|
|
596
598
|
}
|
|
@@ -611,13 +613,13 @@ function Kn(Ge) {
|
|
|
611
613
|
error: n.error || null
|
|
612
614
|
}))
|
|
613
615
|
}
|
|
614
|
-
), e.forEach(({ operationKey: n, opHash:
|
|
615
|
-
l &&
|
|
616
|
+
), e.forEach(({ operationKey: n, opHash: a, success: l }) => {
|
|
617
|
+
l && a ? (Ae((s) => ({
|
|
616
618
|
...s,
|
|
617
619
|
[n]: Date.now()
|
|
618
|
-
})),
|
|
620
|
+
})), ye((s) => ({
|
|
619
621
|
...s,
|
|
620
|
-
[n]:
|
|
622
|
+
[n]: a
|
|
621
623
|
}))) : t.console.warn(
|
|
622
624
|
`[trails-sdk] Not updating state for failed meta transaction ${n}`,
|
|
623
625
|
{
|
|
@@ -638,48 +640,48 @@ function Kn(Ge) {
|
|
|
638
640
|
// Allow up to 2 retries
|
|
639
641
|
retryDelay: (e) => Math.min(1e3 * 2 ** e, 3e4)
|
|
640
642
|
// Exponential backoff
|
|
641
|
-
}), [J,
|
|
643
|
+
}), [J, on] = c(null), [X, rn] = c(null);
|
|
642
644
|
b(() => {
|
|
643
|
-
if (
|
|
644
|
-
|
|
645
|
+
if (!N || !y?.[0]?.chainId || !J || !X || !v || !d.address) {
|
|
646
|
+
V(null);
|
|
645
647
|
return;
|
|
646
648
|
}
|
|
647
649
|
try {
|
|
648
|
-
const e =
|
|
649
|
-
if (!e || !
|
|
650
|
-
|
|
650
|
+
const e = N;
|
|
651
|
+
if (!e || !Nn(e)) {
|
|
652
|
+
V(null);
|
|
651
653
|
return;
|
|
652
654
|
}
|
|
653
|
-
let n,
|
|
655
|
+
let n, a = "0x", l = 0n;
|
|
654
656
|
const s = e;
|
|
655
|
-
if (J ===
|
|
656
|
-
const
|
|
657
|
-
(
|
|
658
|
-
),
|
|
659
|
-
if (
|
|
657
|
+
if (J === $e) {
|
|
658
|
+
const m = v.find(
|
|
659
|
+
(o) => (o.type === "transfer-native" || o.type === "native-balance") && o.chainId === X.toString()
|
|
660
|
+
), f = m?.data?.minAmount?.toString() ?? m?.data?.min?.toString();
|
|
661
|
+
if (f === void 0)
|
|
660
662
|
throw new Error(
|
|
661
663
|
"Could not find native precondition (transfer-native or native-balance) or min amount"
|
|
662
664
|
);
|
|
663
|
-
l = BigInt(
|
|
665
|
+
l = BigInt(f), n = s;
|
|
664
666
|
} else {
|
|
665
|
-
const
|
|
666
|
-
(
|
|
667
|
-
|
|
668
|
-
|
|
667
|
+
const f = v.find(
|
|
668
|
+
(o) => o.type === "erc20-balance" && o.chainId === X.toString() && o.data?.token && ee(
|
|
669
|
+
B(o.data.token),
|
|
670
|
+
B(J)
|
|
669
671
|
)
|
|
670
672
|
)?.data?.min?.toString();
|
|
671
|
-
if (
|
|
673
|
+
if (f === void 0)
|
|
672
674
|
throw new Error(
|
|
673
675
|
"Could not find ERC20 balance precondition or min amount"
|
|
674
676
|
);
|
|
675
|
-
|
|
677
|
+
a = xn({
|
|
676
678
|
recipient: s,
|
|
677
|
-
amount: BigInt(
|
|
679
|
+
amount: BigInt(f)
|
|
678
680
|
}), n = J;
|
|
679
681
|
}
|
|
680
|
-
|
|
682
|
+
V({
|
|
681
683
|
to: n,
|
|
682
|
-
data:
|
|
684
|
+
data: a,
|
|
683
685
|
value: l,
|
|
684
686
|
chainId: X,
|
|
685
687
|
error: void 0
|
|
@@ -688,7 +690,7 @@ function Kn(Ge) {
|
|
|
688
690
|
t.console.error(
|
|
689
691
|
"[trails-sdk] Failed to calculate origin call params for UI:",
|
|
690
692
|
e
|
|
691
|
-
),
|
|
693
|
+
), V({
|
|
692
694
|
to: null,
|
|
693
695
|
data: null,
|
|
694
696
|
value: null,
|
|
@@ -697,22 +699,22 @@ function Kn(Ge) {
|
|
|
697
699
|
});
|
|
698
700
|
}
|
|
699
701
|
}, [
|
|
700
|
-
|
|
702
|
+
y,
|
|
701
703
|
J,
|
|
702
704
|
X,
|
|
703
|
-
|
|
705
|
+
v,
|
|
704
706
|
d.address,
|
|
705
|
-
|
|
707
|
+
N
|
|
706
708
|
]);
|
|
707
|
-
const P =
|
|
709
|
+
const P = Mn(
|
|
708
710
|
u,
|
|
709
|
-
|
|
711
|
+
me
|
|
710
712
|
);
|
|
711
|
-
|
|
712
|
-
const
|
|
713
|
-
return `${n}:${
|
|
713
|
+
$n(() => !u || Object.keys(P).length === 0 ? "no_statuses" : u.map((n) => `${n.chainId}-${n.id}`).sort().map((n) => {
|
|
714
|
+
const a = P[n];
|
|
715
|
+
return `${n}:${a ? a.status : "loading"}`;
|
|
714
716
|
}).join(","), [u, P]);
|
|
715
|
-
const
|
|
717
|
+
const ve = Re(/* @__PURE__ */ new Set()), Te = Re(null);
|
|
716
718
|
b(() => {
|
|
717
719
|
if (t.console.log(
|
|
718
720
|
"[trails-sdk] Running meta-transaction block timestamp effect:",
|
|
@@ -723,7 +725,7 @@ function Kn(Ge) {
|
|
|
723
725
|
), !u || u.length === 0) {
|
|
724
726
|
t.console.log(
|
|
725
727
|
"[trails-sdk] No meta transactions, clearing timestamps"
|
|
726
|
-
),
|
|
728
|
+
), ve.current.clear(), Object.keys(ge).length > 0 && Y({});
|
|
727
729
|
return;
|
|
728
730
|
}
|
|
729
731
|
if (!Object.keys(P).length) {
|
|
@@ -731,109 +733,111 @@ function Kn(Ge) {
|
|
|
731
733
|
return;
|
|
732
734
|
}
|
|
733
735
|
u.forEach(async (e, n) => {
|
|
734
|
-
const
|
|
735
|
-
if (
|
|
736
|
+
const a = `${e.chainId}-${e.id}`;
|
|
737
|
+
if (ve.current.has(a)) {
|
|
736
738
|
t.console.log(
|
|
737
|
-
`[trails-sdk] MetaTxn ${
|
|
739
|
+
`[trails-sdk] MetaTxn ${a}: Already processed, skipping`
|
|
738
740
|
);
|
|
739
741
|
return;
|
|
740
742
|
}
|
|
741
|
-
const l = P[
|
|
743
|
+
const l = P[a];
|
|
742
744
|
if (!l || l.status !== "confirmed") {
|
|
743
745
|
t.console.log(
|
|
744
|
-
`[trails-sdk] MetaTxn ${
|
|
746
|
+
`[trails-sdk] MetaTxn ${a}: Status not confirmed, skipping`
|
|
745
747
|
);
|
|
746
748
|
return;
|
|
747
749
|
}
|
|
748
750
|
const s = l.transactionHash;
|
|
749
751
|
if (!s) {
|
|
750
752
|
t.console.log(
|
|
751
|
-
`[trails-sdk] MetaTxn ${
|
|
753
|
+
`[trails-sdk] MetaTxn ${a}: No transaction hash, skipping`
|
|
752
754
|
);
|
|
753
755
|
return;
|
|
754
756
|
}
|
|
755
757
|
t.console.log(
|
|
756
|
-
`[trails-sdk] MetaTxn ${
|
|
757
|
-
),
|
|
758
|
+
`[trails-sdk] MetaTxn ${a}: Processing transaction ${s}`
|
|
759
|
+
), ve.current.add(a);
|
|
758
760
|
try {
|
|
759
|
-
const
|
|
760
|
-
if (Number.isNaN(
|
|
761
|
+
const r = parseInt(e.chainId, 10);
|
|
762
|
+
if (Number.isNaN(r) || r <= 0)
|
|
761
763
|
throw new Error(
|
|
762
764
|
`Invalid chainId for meta transaction: ${e.chainId}`
|
|
763
765
|
);
|
|
764
|
-
const
|
|
765
|
-
chain:
|
|
766
|
-
transport:
|
|
767
|
-
}),
|
|
766
|
+
const m = ce(r), f = Ne({
|
|
767
|
+
chain: m,
|
|
768
|
+
transport: Fe()
|
|
769
|
+
}), o = await f.getTransactionReceipt({
|
|
768
770
|
hash: s
|
|
769
771
|
});
|
|
770
|
-
if (
|
|
771
|
-
const
|
|
772
|
-
blockNumber:
|
|
772
|
+
if (o && typeof o.blockNumber == "bigint") {
|
|
773
|
+
const h = await f.getBlock({
|
|
774
|
+
blockNumber: o.blockNumber
|
|
773
775
|
});
|
|
774
776
|
t.console.log(
|
|
775
|
-
`[trails-sdk] MetaTxn ${
|
|
776
|
-
),
|
|
777
|
-
...
|
|
778
|
-
[
|
|
779
|
-
timestamp: Number(
|
|
777
|
+
`[trails-sdk] MetaTxn ${a}: Got block timestamp ${h.timestamp}`
|
|
778
|
+
), Y((p) => ({
|
|
779
|
+
...p,
|
|
780
|
+
[a]: {
|
|
781
|
+
timestamp: Number(h.timestamp),
|
|
780
782
|
error: void 0
|
|
781
783
|
}
|
|
782
784
|
}));
|
|
783
785
|
try {
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
+
const p = A?.quoteProvider ? String(A.quoteProvider).toLowerCase() : void 0, Z = g.variables?.params.provider ? String(
|
|
787
|
+
g.variables.params.provider
|
|
788
|
+
).toLowerCase() : void 0, re = p === "cctp" || Z === "cctp", D = g.variables?.params.originChainId, Ce = g.variables?.params.destinationChainId;
|
|
789
|
+
t.console.log("[Trails] isCctp", re), t.console.log("[Trails] providerFromQuote", p), t.console.log("[Trails] providerFromArgs", Z), t.console.log("[Trails] trailsFee", A), t.console.log(
|
|
786
790
|
"[Trails] createIntentMutation.variables",
|
|
787
791
|
g.variables
|
|
788
792
|
), t.console.log(
|
|
789
|
-
"[Trails] createIntentMutation.variables.provider",
|
|
790
|
-
g.variables?.provider
|
|
793
|
+
"[Trails] createIntentMutation.variables.params.provider",
|
|
794
|
+
g.variables?.params.provider
|
|
791
795
|
), t.console.log(
|
|
792
|
-
"[Trails] createIntentMutation.variables.originChainId",
|
|
793
|
-
g.variables?.originChainId
|
|
796
|
+
"[Trails] createIntentMutation.variables.params.originChainId",
|
|
797
|
+
g.variables?.params.originChainId
|
|
794
798
|
), t.console.log(
|
|
795
|
-
"[Trails] createIntentMutation.variables.destinationChainId",
|
|
796
|
-
g.variables?.destinationChainId
|
|
799
|
+
"[Trails] createIntentMutation.variables.params.destinationChainId",
|
|
800
|
+
g.variables?.params.destinationChainId
|
|
797
801
|
), t.console.log(
|
|
798
802
|
"[Trails] lastQueuedCctpSourceTxHash",
|
|
799
803
|
Te.current
|
|
800
804
|
), t.console.log("[Trails] transactionHash", s), t.console.log(
|
|
801
805
|
"[Trails] originChainIdForCctp",
|
|
802
|
-
|
|
806
|
+
D
|
|
803
807
|
), t.console.log(
|
|
804
808
|
"[Trails] destinationChainIdForCctp",
|
|
805
|
-
|
|
806
|
-
),
|
|
807
|
-
|
|
809
|
+
Ce
|
|
810
|
+
), re && S && s && typeof D == "number" && typeof Ce == "number" && Te.current !== s && n === 0 && (Te.current = s, await On({
|
|
811
|
+
trailsClient: S,
|
|
808
812
|
sourceTxHash: s,
|
|
809
|
-
sourceChainId:
|
|
810
|
-
destinationChainId:
|
|
813
|
+
sourceChainId: D,
|
|
814
|
+
destinationChainId: Ce
|
|
811
815
|
}));
|
|
812
|
-
} catch (
|
|
816
|
+
} catch (p) {
|
|
813
817
|
t.console.error(
|
|
814
|
-
`[trails-sdk] Queue CCTP on meta-tx error (${
|
|
815
|
-
|
|
818
|
+
`[trails-sdk] Queue CCTP on meta-tx error (${a}):`,
|
|
819
|
+
p
|
|
816
820
|
);
|
|
817
821
|
}
|
|
818
822
|
} else
|
|
819
823
|
t.console.warn(
|
|
820
|
-
`[trails-sdk] MetaTxn ${
|
|
821
|
-
),
|
|
822
|
-
...
|
|
823
|
-
[
|
|
824
|
+
`[trails-sdk] MetaTxn ${a}: No block number in receipt`
|
|
825
|
+
), Y((h) => ({
|
|
826
|
+
...h,
|
|
827
|
+
[a]: {
|
|
824
828
|
timestamp: null,
|
|
825
829
|
error: "Block number not found in receipt"
|
|
826
830
|
}
|
|
827
831
|
}));
|
|
828
|
-
} catch (
|
|
832
|
+
} catch (r) {
|
|
829
833
|
t.console.error(
|
|
830
|
-
`[trails-sdk] MetaTxn ${
|
|
831
|
-
|
|
832
|
-
),
|
|
833
|
-
...
|
|
834
|
-
[
|
|
834
|
+
`[trails-sdk] MetaTxn ${a}: Error:`,
|
|
835
|
+
r
|
|
836
|
+
), Y((m) => ({
|
|
837
|
+
...m,
|
|
838
|
+
[a]: {
|
|
835
839
|
timestamp: null,
|
|
836
|
-
error:
|
|
840
|
+
error: r.message || "Failed to fetch receipt/timestamp"
|
|
837
841
|
}
|
|
838
842
|
}));
|
|
839
843
|
}
|
|
@@ -842,159 +846,166 @@ function Kn(Ge) {
|
|
|
842
846
|
u,
|
|
843
847
|
P,
|
|
844
848
|
ge,
|
|
845
|
-
|
|
849
|
+
A,
|
|
846
850
|
g.variables,
|
|
847
|
-
|
|
851
|
+
S
|
|
848
852
|
]);
|
|
849
|
-
const
|
|
853
|
+
const cn = (e) => {
|
|
850
854
|
ne(e);
|
|
851
855
|
};
|
|
852
|
-
function
|
|
856
|
+
function ln(e) {
|
|
853
857
|
g.mutate({
|
|
854
858
|
...e,
|
|
855
859
|
destinationSalt: Date.now().toString()
|
|
856
860
|
});
|
|
857
861
|
}
|
|
858
|
-
function
|
|
862
|
+
function dn(e) {
|
|
859
863
|
t.console.log("[trails-sdk] commitIntentConfig", e), I.mutate(e);
|
|
860
864
|
}
|
|
861
|
-
function
|
|
865
|
+
function un(e) {
|
|
862
866
|
if (!e) {
|
|
863
|
-
|
|
867
|
+
V(null);
|
|
864
868
|
return;
|
|
865
869
|
}
|
|
866
|
-
const { originChainId: n, tokenAddress:
|
|
867
|
-
|
|
870
|
+
const { originChainId: n, tokenAddress: a } = e;
|
|
871
|
+
rn(n), on(a);
|
|
868
872
|
}
|
|
869
|
-
function
|
|
870
|
-
|
|
873
|
+
function gn(e) {
|
|
874
|
+
U.mutate({ selectedId: e });
|
|
871
875
|
}
|
|
872
|
-
const { chainId: mn } = d, Ee = i?.chainId,
|
|
876
|
+
const { chainId: mn } = d, Ee = i?.chainId, fn = g.isPending, hn = g.isSuccess, In = g.error, pn = g.variables, vn = I.isPending, Tn = I.isSuccess, Cn = I.error, Sn = I.variables, An = U.isPending, yn = U.isSuccess, wn = U.error, kn = U.variables;
|
|
873
877
|
return {
|
|
874
|
-
|
|
878
|
+
trailsClient: S,
|
|
875
879
|
metaTxns: u,
|
|
876
|
-
intentCallsPayloads:
|
|
877
|
-
intentPreconditions:
|
|
878
|
-
trailsFee:
|
|
880
|
+
intentCallsPayloads: y,
|
|
881
|
+
intentPreconditions: v,
|
|
882
|
+
trailsFee: A,
|
|
879
883
|
txnHash: T,
|
|
880
|
-
committedOriginIntentAddress:
|
|
881
|
-
committedDestinationIntentAddress:
|
|
882
|
-
verificationStatus:
|
|
883
|
-
getRelayer:
|
|
884
|
-
estimatedGas:
|
|
885
|
-
isEstimateError:
|
|
886
|
-
estimateError:
|
|
887
|
-
calculateIntentAddress:
|
|
884
|
+
committedOriginIntentAddress: $,
|
|
885
|
+
committedDestinationIntentAddress: _e,
|
|
886
|
+
verificationStatus: Je,
|
|
887
|
+
getRelayer: me,
|
|
888
|
+
estimatedGas: ae,
|
|
889
|
+
isEstimateError: fe,
|
|
890
|
+
estimateError: he,
|
|
891
|
+
calculateIntentAddress: Me,
|
|
888
892
|
calculateOriginAndDestinationIntentAddresses: Pe,
|
|
889
|
-
committedIntentConfig:
|
|
890
|
-
isLoadingCommittedConfig:
|
|
891
|
-
committedConfigError:
|
|
892
|
-
commitIntentConfig:
|
|
893
|
-
commitIntentConfigPending:
|
|
894
|
-
commitIntentConfigSuccess:
|
|
893
|
+
committedIntentConfig: Ze,
|
|
894
|
+
isLoadingCommittedConfig: en,
|
|
895
|
+
committedConfigError: nn,
|
|
896
|
+
commitIntentConfig: dn,
|
|
897
|
+
commitIntentConfigPending: vn,
|
|
898
|
+
commitIntentConfigSuccess: Tn,
|
|
895
899
|
commitIntentConfigError: Cn,
|
|
896
|
-
commitIntentConfigArgs:
|
|
900
|
+
commitIntentConfigArgs: Sn,
|
|
897
901
|
getIntentCallsPayloads: be,
|
|
898
|
-
operationHashes:
|
|
899
|
-
callIntentCallsPayload:
|
|
902
|
+
operationHashes: Qe,
|
|
903
|
+
callIntentCallsPayload: tn,
|
|
900
904
|
sendOriginTransaction: an,
|
|
901
|
-
switchChain:
|
|
902
|
-
isSwitchingChain:
|
|
903
|
-
switchChainError:
|
|
905
|
+
switchChain: Ve,
|
|
906
|
+
isSwitchingChain: Ke,
|
|
907
|
+
switchChainError: z,
|
|
904
908
|
isTransactionInProgress: te,
|
|
905
909
|
isChainSwitchRequired: mn !== Ee && !!Ee,
|
|
906
910
|
sendTransaction: E.sendTransaction,
|
|
907
911
|
isSendingTransaction: E.isPending,
|
|
908
|
-
originCallStatus:
|
|
912
|
+
originCallStatus: w,
|
|
909
913
|
updateOriginCallStatus: k,
|
|
910
|
-
isEstimatingGas:
|
|
914
|
+
isEstimatingGas: ze,
|
|
911
915
|
isAutoExecute: x,
|
|
912
|
-
updateAutoExecute:
|
|
913
|
-
receipt:
|
|
914
|
-
isWaitingForReceipt:
|
|
916
|
+
updateAutoExecute: cn,
|
|
917
|
+
receipt: C,
|
|
918
|
+
isWaitingForReceipt: H,
|
|
915
919
|
receiptIsSuccess: Ie,
|
|
916
|
-
receiptIsError:
|
|
917
|
-
receiptError:
|
|
920
|
+
receiptIsError: pe,
|
|
921
|
+
receiptError: oe,
|
|
918
922
|
hasAutoExecuted: le,
|
|
919
923
|
originCallSuccess: E.isSuccess,
|
|
920
|
-
sentMetaTxns:
|
|
921
|
-
sendMetaTxn:
|
|
922
|
-
sendMetaTxnPending:
|
|
923
|
-
sendMetaTxnSuccess:
|
|
924
|
-
sendMetaTxnError:
|
|
925
|
-
sendMetaTxnArgs:
|
|
926
|
-
clearIntent:
|
|
924
|
+
sentMetaTxns: j,
|
|
925
|
+
sendMetaTxn: gn,
|
|
926
|
+
sendMetaTxnPending: An,
|
|
927
|
+
sendMetaTxnSuccess: yn,
|
|
928
|
+
sendMetaTxnError: wn,
|
|
929
|
+
sendMetaTxnArgs: kn,
|
|
930
|
+
clearIntent: sn,
|
|
927
931
|
metaTxnMonitorStatuses: P,
|
|
928
|
-
createIntent:
|
|
929
|
-
createIntentPending:
|
|
930
|
-
createIntentSuccess:
|
|
931
|
-
createIntentError:
|
|
932
|
-
createIntentArgs:
|
|
932
|
+
createIntent: ln,
|
|
933
|
+
createIntentPending: fn,
|
|
934
|
+
createIntentSuccess: hn,
|
|
935
|
+
createIntentError: In,
|
|
936
|
+
createIntentArgs: pn,
|
|
933
937
|
originCallParams: i,
|
|
934
|
-
updateOriginCallParams:
|
|
935
|
-
originBlockTimestamp:
|
|
938
|
+
updateOriginCallParams: un,
|
|
939
|
+
originBlockTimestamp: Ye,
|
|
936
940
|
metaTxnBlockTimestamps: ge,
|
|
937
|
-
originIntentAddress:
|
|
938
|
-
destinationIntentAddress:
|
|
941
|
+
originIntentAddress: N,
|
|
942
|
+
destinationIntentAddress: We
|
|
939
943
|
};
|
|
940
944
|
}
|
|
941
945
|
export {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
+
zn as TRAILS_CONTRACT_PLACEHOLDER_AMOUNT,
|
|
947
|
+
Yn as TradeType,
|
|
948
|
+
Jn as TrailsClient,
|
|
949
|
+
Xn as TrailsWidget,
|
|
950
|
+
Me as calculateIntentAddress,
|
|
946
951
|
Pe as calculateOriginAndDestinationIntentAddresses,
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
952
|
+
Zn as commitIntentConfig,
|
|
953
|
+
et as createModalController,
|
|
954
|
+
nt as declareSequenceEnv,
|
|
955
|
+
tt as getAPIClient,
|
|
956
|
+
st as getAccountTotalBalanceUsd,
|
|
957
|
+
it as getAccountTransactionHistory,
|
|
958
|
+
at as getAllChains,
|
|
959
|
+
ce as getChainInfo,
|
|
960
|
+
ot as getDebug,
|
|
961
|
+
xn as getERC20TransferData,
|
|
962
|
+
rt as getHasSufficientBalanceToken,
|
|
956
963
|
ct as getHasSufficientBalanceUsd,
|
|
957
964
|
lt as getIndexerGatewayClient,
|
|
958
965
|
qn as getIntentCallsPayloads,
|
|
959
966
|
dt as getIntentTransactionHistory,
|
|
960
967
|
ut as getMetaTxnReceipt,
|
|
961
968
|
gt as getMinLogLevel,
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
969
|
+
mt as getRelayer,
|
|
970
|
+
ft as getSequenceApiUrl,
|
|
971
|
+
ht as getSequenceEnv,
|
|
965
972
|
It as getSequenceIndexerUrl,
|
|
966
|
-
|
|
967
|
-
|
|
973
|
+
pt as getSequenceNodeGatewayUrl,
|
|
974
|
+
vt as getSequenceProjectAccessKey,
|
|
968
975
|
Tt as getSlippageTolerance,
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
976
|
+
Ct as getSupportedChains,
|
|
977
|
+
St as getSupportedTokens,
|
|
978
|
+
At as getTrailsApiUrl,
|
|
979
|
+
yt as getTrailsClient,
|
|
980
|
+
wt as getTxTimeDiff,
|
|
981
|
+
kt as getWalletConnectProjectId,
|
|
973
982
|
t as logger,
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
983
|
+
bt as prepareSend,
|
|
984
|
+
Et as relayerSendMetaTx,
|
|
985
|
+
Pt as sendOriginTransaction,
|
|
986
|
+
xt as setDebug,
|
|
987
|
+
Mt as setSequenceApiUrl,
|
|
988
|
+
Ot as setSequenceEnv,
|
|
989
|
+
qt as setSequenceIndexerUrl,
|
|
981
990
|
Rt as setSequenceNodeGatewayUrl,
|
|
982
|
-
|
|
991
|
+
$t as setSequenceProjectAccessKey,
|
|
983
992
|
Nt as setSlippageTolerance,
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
Lt as
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
993
|
+
Ft as setTrailsApiUrl,
|
|
994
|
+
Ht as setWalletConnectProjectId,
|
|
995
|
+
Ut as useAPIClient,
|
|
996
|
+
Dt as useAccountTotalBalanceUsd,
|
|
997
|
+
Bt as useAccountTransactionHistory,
|
|
998
|
+
jt as useHasSufficientBalanceToken,
|
|
999
|
+
Gt as useHasSufficientBalanceUsd,
|
|
1000
|
+
Lt as useIndexerGatewayClient,
|
|
1001
|
+
_t as useIntentTransactionHistory,
|
|
1002
|
+
Mn as useMetaTxnsMonitor,
|
|
1003
|
+
Wt as useQuote,
|
|
1004
|
+
En as useRelayers,
|
|
1005
|
+
Qt as useSupportedChains,
|
|
1006
|
+
Vt as useSupportedTokens,
|
|
1007
|
+
Kt as useTokenBalances,
|
|
1008
|
+
zt as useTokenList,
|
|
1009
|
+
Qn as useTrails,
|
|
1010
|
+
bn as useTrailsClient
|
|
1000
1011
|
};
|