0xtrails 0.4.1 → 0.4.2
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/{ccip-Bc-mZIIK.js → ccip-Dl3umoGg.js} +5 -5
- package/dist/{index-BWGjgMLm.js → index-sMS_ge1R.js} +13956 -13858
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +501 -474
- package/dist/intents.d.ts +1 -1
- package/dist/intents.d.ts.map +1 -1
- package/dist/morpho.d.ts.map +1 -1
- package/dist/mutations.d.ts +2 -2
- package/dist/mutations.d.ts.map +1 -1
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/trails.d.ts +9 -10
- package/dist/trails.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +3 -2
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/standardDeposit.d.ts +3 -2
- package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/crossChain.d.ts +1 -1
- package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +3 -2
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/types.d.ts +1 -1
- package/dist/transactionIntent/types.d.ts.map +1 -1
- package/dist/widget/components/FeeOptions.d.ts +2 -1
- package/dist/widget/components/FeeOptions.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/hooks/useQuote.d.ts +31 -1
- package/dist/widget/hooks/useQuote.d.ts.map +1 -1
- package/dist/widget/hooks/useSendForm.d.ts +1 -1
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/index.js +1 -1
- package/package.json +7 -7
- package/src/aave.ts +1 -0
- package/src/index.ts +1 -1
- package/src/intents.ts +2 -2
- package/src/morpho.ts +3 -2
- package/src/mutations.ts +53 -5
- package/src/prepareSend.ts +12 -1
- package/src/trails.ts +57 -65
- package/src/transactionIntent/deposits/depositOrchestrator.ts +4 -1
- package/src/transactionIntent/deposits/gaslessDeposit.ts +1 -1
- package/src/transactionIntent/deposits/standardDeposit.ts +124 -3
- package/src/transactionIntent/handlers/crossChain.ts +14 -9
- package/src/transactionIntent/handlers/sameChainSameToken.ts +32 -12
- package/src/transactionIntent/quote/quoteHelpers.ts +4 -11
- package/src/transactionIntent/types.ts +1 -1
- package/src/widget/components/FeeOptions.tsx +2 -1
- package/src/widget/components/PoolDeposit.tsx +68 -4
- package/src/widget/hooks/useDebugScreens.ts +11 -11
- package/src/widget/hooks/useQuote.ts +37 -2
- package/src/widget/hooks/useSendForm.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { l as t, u as Ie, t as
|
|
2
|
-
import {
|
|
3
|
-
import { useQuery as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { zeroAddress as fe, isAddressEqual as
|
|
6
|
-
import { useSwitchChain as Bn, useSendTransaction as
|
|
7
|
-
const
|
|
8
|
-
const a =
|
|
9
|
-
queryKey: ["waitIntentReceipt",
|
|
1
|
+
import { l as t, u as Ie, t as An, a as En, b as wn, I as kn, g as Ue, c as yn, d as bn, e as xn, f as Re, h as Pn, T as Un, p as Rn, i as Fe, j as qn, k as Pe, m as Le, n as Dn, o as te, q as Ne, r as On, s as Mn, v as Hn, w as Be } from "./index-sMS_ge1R.js";
|
|
2
|
+
import { x as et, X as nt, af as tt, ah as st, U as it, D as ot, ag as rt, Y as at, L as ct, H as lt, B as dt, ac as ut, M as gt, N as mt, C as ft, G as It, y as ht, ad as pt, a0 as vt, $ as Ct, a5 as Tt, Z as St, aa as At, z as Et, S as wt, _ as kt, ae as yt, W as bt, a8 as xt, F as Pt, E as Ut, ab as Rt, a6 as qt, a3 as Dt, a4 as Ot, a1 as Mt, a9 as Ht, a2 as Ft, a7 as Lt, O as Nt, J as Bt, P as Gt, Q as $t, K as jt, A as Qt, R as Wt, V as Vt } from "./index-sMS_ge1R.js";
|
|
3
|
+
import { useQuery as qe, useMutation as me } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as Fn, useMemo as Ge, useState as u, useCallback as $e, useEffect as P } from "react";
|
|
5
|
+
import { zeroAddress as fe, isAddressEqual as ce, isAddress as Ln, ethAddress as Nn, createWalletClient as je, custom as Qe } from "viem";
|
|
6
|
+
import { useSwitchChain as Bn, useSendTransaction as Gn, useEstimateGas as $n, useWaitForTransactionReceipt as jn } from "wagmi";
|
|
7
|
+
const We = 150, Qn = (g, i) => {
|
|
8
|
+
const a = qe({
|
|
9
|
+
queryKey: ["waitIntentReceipt", g],
|
|
10
10
|
queryFn: async () => {
|
|
11
|
-
if (!
|
|
11
|
+
if (!g)
|
|
12
12
|
throw new Error("Intent ID is required for monitoring");
|
|
13
13
|
t.console.log(
|
|
14
|
-
`[trails-sdk] 🔍 Monitoring intent receipt for ${
|
|
14
|
+
`[trails-sdk] 🔍 Monitoring intent receipt for ${g}`
|
|
15
15
|
);
|
|
16
|
-
const
|
|
17
|
-
intentId:
|
|
16
|
+
const l = await i.waitIntentReceipt({
|
|
17
|
+
intentId: g
|
|
18
18
|
});
|
|
19
19
|
return t.console.log(
|
|
20
|
-
`[trails-sdk] 📊 Intent ${
|
|
21
|
-
),
|
|
20
|
+
`[trails-sdk] 📊 Intent ${g} status: ${l.intentReceipt.status}, done: ${l.done}`
|
|
21
|
+
), l;
|
|
22
22
|
},
|
|
23
|
-
enabled: !!
|
|
23
|
+
enabled: !!g,
|
|
24
24
|
refetchIntervalInBackground: !0,
|
|
25
|
-
refetchInterval: (
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
`[trails-sdk] ✅ Intent monitoring complete for ${
|
|
29
|
-
), !1) :
|
|
25
|
+
refetchInterval: (l) => {
|
|
26
|
+
const o = l.state.data;
|
|
27
|
+
return o && o.done ? (t.console.log(
|
|
28
|
+
`[trails-sdk] ✅ Intent monitoring complete for ${g}`
|
|
29
|
+
), !1) : We;
|
|
30
30
|
},
|
|
31
|
-
retry: (
|
|
32
|
-
`[trails-sdk] ❌ Giving up on intent ${
|
|
33
|
-
|
|
31
|
+
retry: (l, o) => l >= 30 ? (t.console.error(
|
|
32
|
+
`[trails-sdk] ❌ Giving up on intent ${g} after 30 failed API attempts:`,
|
|
33
|
+
o
|
|
34
34
|
), !1) : !0
|
|
35
35
|
});
|
|
36
36
|
return {
|
|
@@ -41,175 +41,203 @@ const Qe = 150, jn = (u, i) => {
|
|
|
41
41
|
error: a.error
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
const
|
|
44
|
+
function Ve() {
|
|
45
|
+
const g = Ie();
|
|
46
46
|
return me({
|
|
47
47
|
mutationFn: async (i) => {
|
|
48
48
|
t.console.log("[trails-sdk] useCommitIntent: Starting commit", {
|
|
49
49
|
intentId: i.intentId,
|
|
50
50
|
originIntentAddress: i.originIntentAddress
|
|
51
51
|
});
|
|
52
|
-
const a = i.calls[0]?.chainId,
|
|
52
|
+
const a = i.calls[0]?.chainId, l = i.calls[1]?.chainId;
|
|
53
53
|
try {
|
|
54
|
-
|
|
54
|
+
An({
|
|
55
55
|
intentAddress: i.originIntentAddress,
|
|
56
56
|
userAddress: i.ownerAddress,
|
|
57
57
|
originChainId: a ? Number(a) : void 0,
|
|
58
|
-
destinationChainId:
|
|
58
|
+
destinationChainId: l ? Number(l) : void 0
|
|
59
59
|
});
|
|
60
|
-
const
|
|
60
|
+
const o = await g.commitIntent({ intent: i });
|
|
61
61
|
return t.console.log("[trails-sdk] useCommitIntent: Commit successful", {
|
|
62
62
|
intentId: i.intentId,
|
|
63
|
-
response:
|
|
64
|
-
}),
|
|
63
|
+
response: o
|
|
64
|
+
}), En({
|
|
65
65
|
intentAddress: i.originIntentAddress,
|
|
66
66
|
userAddress: i.ownerAddress,
|
|
67
67
|
originChainId: a ? Number(a) : void 0,
|
|
68
|
-
destinationChainId:
|
|
69
|
-
}),
|
|
70
|
-
} catch (
|
|
71
|
-
throw
|
|
72
|
-
error:
|
|
68
|
+
destinationChainId: l ? Number(l) : void 0
|
|
69
|
+
}), o;
|
|
70
|
+
} catch (o) {
|
|
71
|
+
throw wn({
|
|
72
|
+
error: Ue(o),
|
|
73
73
|
userAddress: i.ownerAddress,
|
|
74
74
|
intentAddress: i.originIntentAddress,
|
|
75
75
|
originChainId: a ? Number(a) : void 0,
|
|
76
|
-
destinationChainId:
|
|
77
|
-
}),
|
|
76
|
+
destinationChainId: l ? Number(l) : void 0
|
|
77
|
+
}), o;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
const
|
|
82
|
+
function _e() {
|
|
83
|
+
const g = Ie();
|
|
84
84
|
return me({
|
|
85
85
|
mutationFn: async ({
|
|
86
86
|
intentId: i,
|
|
87
87
|
depositTransactionHash: a,
|
|
88
|
-
depositSignature:
|
|
88
|
+
depositSignature: l
|
|
89
89
|
}) => {
|
|
90
90
|
if (t.console.log("[trails-sdk] useExecuteIntent: Starting execution", {
|
|
91
91
|
intentId: i,
|
|
92
92
|
depositTransactionHash: a,
|
|
93
|
-
hasDepositSignature: !!
|
|
94
|
-
}), !a && !
|
|
93
|
+
hasDepositSignature: !!l
|
|
94
|
+
}), !a && !l)
|
|
95
95
|
throw new Error(
|
|
96
96
|
"[trails-sdk] Either depositTransactionHash or depositSignature must be provided"
|
|
97
97
|
);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
let o;
|
|
99
|
+
try {
|
|
100
|
+
o = await g.executeIntent({
|
|
101
|
+
intentId: i,
|
|
102
|
+
depositTransactionHash: a,
|
|
103
|
+
depositSignature: l
|
|
104
|
+
});
|
|
105
|
+
} catch (d) {
|
|
106
|
+
if (t.console.error(
|
|
107
|
+
"[trails-sdk] useExecuteIntent: Error executing intent",
|
|
108
|
+
{
|
|
109
|
+
intentId: i,
|
|
110
|
+
error: d,
|
|
111
|
+
errorJSON: JSON.stringify(d, null, 2)
|
|
112
|
+
}
|
|
113
|
+
), d instanceof Error && d?.message?.includes("status=SUCCEEDED") || d instanceof Error && d?.cause?.message?.includes("status=SUCCEEDED") || d instanceof Error && JSON.stringify(d).includes("status=SUCCEEDED") || d instanceof kn && d?.cause?.toString().includes("status=SUCCEEDED") || JSON.stringify(d).includes("status=SUCCEEDED"))
|
|
114
|
+
return t.console.error(
|
|
115
|
+
"[trails-sdk] useExecuteIntent: Intent already succeeded, treating as success",
|
|
116
|
+
{ intentId: i }
|
|
117
|
+
), {
|
|
118
|
+
intentId: i,
|
|
119
|
+
intentStatus: "SUCCEEDED"
|
|
120
|
+
};
|
|
121
|
+
throw t.console.error(
|
|
122
|
+
"[trails-sdk] useExecuteIntent did not throw IntentStatusError and is not a SUCCEEDED intent",
|
|
123
|
+
{
|
|
124
|
+
intentId: i,
|
|
125
|
+
error: d,
|
|
126
|
+
errorJSON: JSON.stringify(d, null, 2)
|
|
127
|
+
}
|
|
128
|
+
), d;
|
|
129
|
+
}
|
|
103
130
|
return t.console.log(
|
|
104
131
|
"[trails-sdk] useExecuteIntent: Execution successful",
|
|
105
132
|
{
|
|
106
133
|
intentId: i,
|
|
107
|
-
response:
|
|
134
|
+
response: o
|
|
108
135
|
}
|
|
109
|
-
),
|
|
136
|
+
), o;
|
|
110
137
|
}
|
|
111
138
|
});
|
|
112
139
|
}
|
|
113
|
-
function
|
|
114
|
-
walletClient:
|
|
140
|
+
function Kn({
|
|
141
|
+
walletClient: g,
|
|
115
142
|
fromTokenAddress: i,
|
|
116
143
|
fromChainId: a,
|
|
117
|
-
toTokenAddress:
|
|
118
|
-
toChainId:
|
|
119
|
-
swapAmount:
|
|
120
|
-
tradeType:
|
|
144
|
+
toTokenAddress: l,
|
|
145
|
+
toChainId: o,
|
|
146
|
+
swapAmount: d,
|
|
147
|
+
tradeType: j,
|
|
121
148
|
toRecipient: F,
|
|
122
|
-
toCalldata:
|
|
123
|
-
slippageTolerance:
|
|
124
|
-
onStatusUpdate:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
149
|
+
toCalldata: X,
|
|
150
|
+
slippageTolerance: Q,
|
|
151
|
+
onStatusUpdate: he,
|
|
152
|
+
checkoutOnHandlers: W,
|
|
153
|
+
quoteProvider: U,
|
|
154
|
+
paymasterUrl: V,
|
|
155
|
+
selectedFeeToken: R,
|
|
128
156
|
nodeGatewayEnv: w,
|
|
129
157
|
abortSignal: q,
|
|
130
|
-
apiKey:
|
|
158
|
+
apiKey: v
|
|
131
159
|
} = {}) {
|
|
132
160
|
w && (globalThis.__testNodeGatewayEnv = w);
|
|
133
|
-
const
|
|
161
|
+
const S = Fn(new AbortController()), se = q ? (() => {
|
|
134
162
|
const s = new AbortController();
|
|
135
163
|
return q.addEventListener("abort", () => {
|
|
136
|
-
s.abort(),
|
|
137
|
-
}),
|
|
164
|
+
s.abort(), S.current?.abort();
|
|
165
|
+
}), S.current?.signal.addEventListener("abort", () => {
|
|
138
166
|
s.abort();
|
|
139
167
|
}), s.signal;
|
|
140
|
-
})() :
|
|
141
|
-
|
|
142
|
-
), { supportedTokens: k } =
|
|
168
|
+
})() : S.current.signal, pe = Ge(() => v ? { apiKey: v } : {}, [v]), p = Ge(() => v ? { projectAccessKey: v } : {}, [v]), D = Ie(pe), m = yn(
|
|
169
|
+
p
|
|
170
|
+
), { supportedTokens: k } = bn(), ve = Ve(), _ = _e(), { data: O, isLoading: J, error: le, refetch: z } = qe({
|
|
143
171
|
queryKey: [
|
|
144
172
|
"prepareSend",
|
|
145
173
|
i,
|
|
146
174
|
a,
|
|
175
|
+
l,
|
|
147
176
|
o,
|
|
148
|
-
|
|
149
|
-
P?.toString(),
|
|
177
|
+
d?.toString(),
|
|
150
178
|
F,
|
|
179
|
+
X,
|
|
151
180
|
j,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
p
|
|
181
|
+
Q,
|
|
182
|
+
U,
|
|
183
|
+
v
|
|
156
184
|
],
|
|
157
185
|
queryFn: async () => {
|
|
158
186
|
try {
|
|
159
|
-
if (
|
|
187
|
+
if (S.current.signal.aborted && (t.console.log(
|
|
160
188
|
"[trails-sdk] Resetting aborted controller for new query"
|
|
161
|
-
),
|
|
189
|
+
), S.current = new AbortController()), !g || !D || !i || !l || !d || !F || !a || !o || !m)
|
|
162
190
|
return null;
|
|
163
191
|
let s = [];
|
|
164
192
|
try {
|
|
165
|
-
s = (await
|
|
166
|
-
account:
|
|
167
|
-
indexerGatewayClient:
|
|
168
|
-
trailsClient:
|
|
193
|
+
s = (await xn({
|
|
194
|
+
account: g.account.address,
|
|
195
|
+
indexerGatewayClient: m,
|
|
196
|
+
trailsClient: D
|
|
169
197
|
})).balances;
|
|
170
|
-
} catch (
|
|
171
|
-
const
|
|
198
|
+
} catch (c) {
|
|
199
|
+
const h = Ue(c), $ = h.includes("Cross-Origin") || h.includes("CORS") || h.includes("Same Origin Policy"), we = h.includes("fetch failed") || h.includes("network");
|
|
172
200
|
if ($ || we)
|
|
173
201
|
t.console.warn(
|
|
174
202
|
"[trails-sdk] [useQuote] Network or CORS error fetching balances, proceeding with quote using zero balance:",
|
|
175
203
|
{
|
|
176
|
-
error:
|
|
177
|
-
account:
|
|
204
|
+
error: h,
|
|
205
|
+
account: g.account.address
|
|
178
206
|
}
|
|
179
207
|
), s = [];
|
|
180
208
|
else
|
|
181
|
-
throw
|
|
209
|
+
throw c;
|
|
182
210
|
}
|
|
183
|
-
const
|
|
184
|
-
(
|
|
211
|
+
const Ce = s.find(
|
|
212
|
+
(c) => c.chainId === a && (c.contractAddress?.toLowerCase() === i.toLowerCase() || !c.contractAddress && i === fe)
|
|
185
213
|
)?.balance ?? "0";
|
|
186
|
-
let
|
|
214
|
+
let ie = 0;
|
|
187
215
|
try {
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
tokenSymbol:
|
|
216
|
+
const h = Re(a)?.nativeCurrency?.symbol ?? "";
|
|
217
|
+
h && (ie = (await Pn(D, {
|
|
218
|
+
tokenSymbol: h,
|
|
191
219
|
tokenAddress: fe,
|
|
192
220
|
chainId: a
|
|
193
221
|
}))?.priceUsd ?? 0, t.console.log(
|
|
194
222
|
"[trails-sdk] [useQuote] Origin native token price:",
|
|
195
223
|
{
|
|
196
224
|
chainId: a,
|
|
197
|
-
symbol:
|
|
198
|
-
priceUsd:
|
|
225
|
+
symbol: h,
|
|
226
|
+
priceUsd: ie
|
|
199
227
|
}
|
|
200
228
|
));
|
|
201
|
-
} catch (
|
|
229
|
+
} catch (c) {
|
|
202
230
|
t.console.error(
|
|
203
231
|
"[trails-sdk] [useQuote] Error getting origin native token price:",
|
|
204
|
-
|
|
232
|
+
c
|
|
205
233
|
);
|
|
206
234
|
}
|
|
207
235
|
const L = k?.find(
|
|
208
|
-
(
|
|
209
|
-
),
|
|
210
|
-
(
|
|
211
|
-
),
|
|
212
|
-
if (!
|
|
236
|
+
(c) => c.contractAddress?.toLowerCase() === i?.toLowerCase() && c.chainId === a
|
|
237
|
+
), N = k?.find(
|
|
238
|
+
(c) => c.contractAddress?.toLowerCase() === l?.toLowerCase() && c.chainId === o
|
|
239
|
+
), oe = L?.decimals;
|
|
240
|
+
if (!oe)
|
|
213
241
|
throw t.console.error(
|
|
214
242
|
"[trails-sdk] [useQuote] Missing source token decimals:",
|
|
215
243
|
{
|
|
@@ -218,48 +246,49 @@ function Xn({
|
|
|
218
246
|
fromChainId: a
|
|
219
247
|
}
|
|
220
248
|
), new Error("Source token decimals not found");
|
|
221
|
-
const
|
|
222
|
-
if (!
|
|
249
|
+
const B = N?.decimals;
|
|
250
|
+
if (!B)
|
|
223
251
|
throw t.console.error(
|
|
224
252
|
"[trails-sdk] Missing destination token decimals:",
|
|
225
253
|
{
|
|
226
|
-
destinationToken:
|
|
227
|
-
toTokenAddress:
|
|
228
|
-
toChainId:
|
|
254
|
+
destinationToken: N,
|
|
255
|
+
toTokenAddress: l,
|
|
256
|
+
toChainId: o
|
|
229
257
|
}
|
|
230
258
|
), new Error("Destination token decimals not found");
|
|
231
|
-
const Te =
|
|
232
|
-
account:
|
|
259
|
+
const Te = N?.symbol ?? "", Se = L?.symbol ?? "", G = {
|
|
260
|
+
account: g.account,
|
|
233
261
|
originTokenAddress: i,
|
|
234
262
|
originChainId: a,
|
|
235
|
-
originTokenBalance:
|
|
236
|
-
destinationChainId:
|
|
263
|
+
originTokenBalance: Ce,
|
|
264
|
+
destinationChainId: o,
|
|
237
265
|
recipient: F,
|
|
238
|
-
destinationTokenAddress:
|
|
239
|
-
swapAmount:
|
|
240
|
-
tradeType:
|
|
241
|
-
originTokenSymbol:
|
|
266
|
+
destinationTokenAddress: l,
|
|
267
|
+
swapAmount: d.toString(),
|
|
268
|
+
tradeType: j ?? Un.EXACT_OUTPUT,
|
|
269
|
+
originTokenSymbol: Se,
|
|
242
270
|
destinationTokenSymbol: Te,
|
|
243
|
-
destinationCalldata:
|
|
244
|
-
client:
|
|
245
|
-
trailsClient:
|
|
246
|
-
sourceTokenDecimals:
|
|
247
|
-
destinationTokenDecimals:
|
|
271
|
+
destinationCalldata: X,
|
|
272
|
+
client: g,
|
|
273
|
+
trailsClient: D,
|
|
274
|
+
sourceTokenDecimals: oe,
|
|
275
|
+
destinationTokenDecimals: B,
|
|
248
276
|
fee: "0",
|
|
249
277
|
dryMode: !1,
|
|
250
|
-
onTransactionStateChange:
|
|
278
|
+
onTransactionStateChange: he ?? (() => {
|
|
251
279
|
}),
|
|
252
|
-
slippageTolerance:
|
|
253
|
-
quoteProvider:
|
|
254
|
-
paymasterUrl:
|
|
255
|
-
selectedFeeToken:
|
|
256
|
-
abortSignal:
|
|
257
|
-
originNativeTokenPriceUsd:
|
|
258
|
-
commitIntentFn:
|
|
259
|
-
executeIntentFn:
|
|
280
|
+
slippageTolerance: Q?.toString(),
|
|
281
|
+
quoteProvider: U,
|
|
282
|
+
paymasterUrl: V,
|
|
283
|
+
selectedFeeToken: R ?? void 0,
|
|
284
|
+
abortSignal: se,
|
|
285
|
+
originNativeTokenPriceUsd: ie,
|
|
286
|
+
commitIntentFn: ve.mutateAsync,
|
|
287
|
+
executeIntentFn: _.mutateAsync,
|
|
288
|
+
checkoutOnHandlers: W
|
|
260
289
|
};
|
|
261
290
|
t.console.log("[trails-sdk] options", G);
|
|
262
|
-
const { quote: r, send:
|
|
291
|
+
const { quote: r, send: Ae } = await Rn(G);
|
|
263
292
|
return {
|
|
264
293
|
quote: {
|
|
265
294
|
fromAmount: r.originAmount,
|
|
@@ -287,28 +316,28 @@ function Xn({
|
|
|
287
316
|
},
|
|
288
317
|
swap: async () => {
|
|
289
318
|
const {
|
|
290
|
-
depositUserTxnReceipt:
|
|
291
|
-
destinationMetaTxnReceipt:
|
|
319
|
+
depositUserTxnReceipt: c,
|
|
320
|
+
destinationMetaTxnReceipt: h,
|
|
292
321
|
totalCompletionSeconds: $
|
|
293
|
-
} = await
|
|
294
|
-
selectedFeeToken:
|
|
322
|
+
} = await Ae({
|
|
323
|
+
selectedFeeToken: R ?? void 0
|
|
295
324
|
});
|
|
296
325
|
return {
|
|
297
326
|
originTransaction: {
|
|
298
|
-
transactionHash:
|
|
299
|
-
explorerUrl:
|
|
300
|
-
txHash:
|
|
327
|
+
transactionHash: c?.transactionHash,
|
|
328
|
+
explorerUrl: Fe({
|
|
329
|
+
txHash: c?.transactionHash,
|
|
301
330
|
chainId: a
|
|
302
331
|
}),
|
|
303
|
-
receipt:
|
|
332
|
+
receipt: c
|
|
304
333
|
},
|
|
305
334
|
destinationTransaction: {
|
|
306
|
-
transactionHash:
|
|
307
|
-
explorerUrl:
|
|
308
|
-
txHash:
|
|
309
|
-
chainId:
|
|
335
|
+
transactionHash: h?.txnHash,
|
|
336
|
+
explorerUrl: Fe({
|
|
337
|
+
txHash: h?.txnHash,
|
|
338
|
+
chainId: o
|
|
310
339
|
}),
|
|
311
|
-
receipt:
|
|
340
|
+
receipt: h
|
|
312
341
|
},
|
|
313
342
|
totalCompletionSeconds: $
|
|
314
343
|
};
|
|
@@ -318,11 +347,11 @@ function Xn({
|
|
|
318
347
|
throw t.console.error(
|
|
319
348
|
"[trails-sdk] [useQuote] Error getting quote:",
|
|
320
349
|
s
|
|
321
|
-
),
|
|
350
|
+
), Ue(s);
|
|
322
351
|
}
|
|
323
352
|
},
|
|
324
353
|
// Prevent unnecessary refetching
|
|
325
|
-
enabled: !!(
|
|
354
|
+
enabled: !!(g && D && i && l && d && F && a && o && m && // !isLoadingTokens &&
|
|
326
355
|
k && k.length > 0),
|
|
327
356
|
staleTime: 30 * 1e3,
|
|
328
357
|
// Consider data fresh for 30 seconds
|
|
@@ -338,113 +367,116 @@ function Xn({
|
|
|
338
367
|
// Refetch when network reconnects
|
|
339
368
|
});
|
|
340
369
|
return {
|
|
341
|
-
quote:
|
|
342
|
-
swap:
|
|
343
|
-
isLoadingQuote:
|
|
370
|
+
quote: O?.quote || null,
|
|
371
|
+
swap: O?.swap || null,
|
|
372
|
+
isLoadingQuote: J,
|
|
344
373
|
quoteError: le,
|
|
345
|
-
quoteErrorPrettified:
|
|
374
|
+
quoteErrorPrettified: qn(le),
|
|
346
375
|
refetchQuote: () => z(),
|
|
347
376
|
abort: () => {
|
|
348
377
|
t.console.log("[trails-sdk] useQuote abort() called"), t.console.log(
|
|
349
378
|
"[trails-sdk] Active operations before abort:",
|
|
350
|
-
|
|
351
|
-
),
|
|
379
|
+
Pe.getAll()
|
|
380
|
+
), S.current.abort(), Pe.abortAll(), t.console.log(
|
|
352
381
|
"[trails-sdk] Abort completed, active operations:",
|
|
353
|
-
|
|
382
|
+
Pe.getAll()
|
|
354
383
|
);
|
|
355
384
|
}
|
|
356
385
|
};
|
|
357
386
|
}
|
|
358
|
-
function
|
|
387
|
+
function Xn(g) {
|
|
359
388
|
const {
|
|
360
389
|
account: i,
|
|
361
|
-
disableAutoExecute: a = !1
|
|
362
|
-
|
|
390
|
+
disableAutoExecute: a = !1,
|
|
391
|
+
sequenceProjectAccessKey: l
|
|
392
|
+
} = g, o = Ie({
|
|
393
|
+
apiKey: l
|
|
394
|
+
}), [d, j] = u(!a), [F, X] = u(!1), [Q, he] = u(
|
|
363
395
|
{}
|
|
364
|
-
), [
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
] =
|
|
396
|
+
), [W, U] = u(null), [V, R] = u(null), [w, q] = u(null), [v, S] = u(null), [se, pe] = u(null), [p, D] = u(), [m, k] = u(null), [
|
|
397
|
+
ve,
|
|
398
|
+
_
|
|
399
|
+
] = u(null), [O, J] = u(
|
|
368
400
|
null
|
|
369
|
-
), [le, z] =
|
|
401
|
+
), [le, z] = u(null), [s, Y] = u(null), [Ce, ie] = u({}), [L, N] = u(!1), [oe, B] = u(!1), {
|
|
370
402
|
switchChain: Te,
|
|
371
|
-
isPending:
|
|
403
|
+
isPending: Se,
|
|
372
404
|
error: G
|
|
373
|
-
} = Bn(), r =
|
|
405
|
+
} = Bn(), r = Gn(), [Ae, Ee] = u(!1), [y, c] = u(null), [h, $] = u(null), [we, De] = u({}), [Je, de] = u(null), {
|
|
374
406
|
data: ue,
|
|
375
407
|
isError: ke,
|
|
376
|
-
error:
|
|
377
|
-
} =
|
|
408
|
+
error: ye
|
|
409
|
+
} = $n(
|
|
378
410
|
s?.to && s?.chainId && !s.error ? {
|
|
379
411
|
to: s.to || void 0,
|
|
380
412
|
data: s.data || void 0,
|
|
381
413
|
value: s.value || void 0,
|
|
382
414
|
chainId: s.chainId || void 0
|
|
383
415
|
} : void 0
|
|
384
|
-
), ze =
|
|
416
|
+
), ze = Ve(), A = me({
|
|
385
417
|
mutationFn: async (e) => {
|
|
386
418
|
t.console.log(
|
|
387
419
|
"[useTrails] commitIntentMutation started with intent:",
|
|
388
420
|
e
|
|
389
421
|
);
|
|
390
422
|
try {
|
|
391
|
-
const n =
|
|
392
|
-
if (!n || !
|
|
423
|
+
const n = C.variables?.originChainId, f = C.variables?.destinationChainId;
|
|
424
|
+
if (!n || !f)
|
|
393
425
|
throw t.console.error(
|
|
394
426
|
"[useTrails] Could not determine origin/destination chain IDs for verification."
|
|
395
427
|
), new Error(
|
|
396
428
|
"Could not determine origin/destination chain IDs for verification."
|
|
397
429
|
);
|
|
398
430
|
t.console.log("[useTrails] Calculating intent address..."), t.console.log("[useTrails] Main signer:", e.ownerAddress), t.console.log("[useTrails] Calls:", e.calls);
|
|
399
|
-
const { originIntentAddress:
|
|
431
|
+
const { originIntentAddress: E, destinationIntentAddress: b } = Le(
|
|
400
432
|
e.ownerAddress,
|
|
401
433
|
e.calls
|
|
402
434
|
), {
|
|
403
|
-
originAddress:
|
|
404
|
-
destinationAddress:
|
|
405
|
-
} =
|
|
435
|
+
originAddress: ae,
|
|
436
|
+
destinationAddress: K
|
|
437
|
+
} = Dn(
|
|
406
438
|
e.preconditions,
|
|
407
439
|
n,
|
|
408
|
-
|
|
440
|
+
f
|
|
409
441
|
);
|
|
410
442
|
t.console.log("[useTrails] Verification addresses:", {
|
|
411
|
-
calculatedOrigin:
|
|
412
|
-
calculatedDestination:
|
|
413
|
-
preconditionOrigin:
|
|
414
|
-
preconditionDestination:
|
|
443
|
+
calculatedOrigin: E.toString(),
|
|
444
|
+
calculatedDestination: b.toString(),
|
|
445
|
+
preconditionOrigin: ae,
|
|
446
|
+
preconditionDestination: K
|
|
415
447
|
});
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
448
|
+
const x = !!ae && ce(
|
|
449
|
+
te(ae),
|
|
450
|
+
E
|
|
419
451
|
);
|
|
420
|
-
t.console.log("[useTrails] Origin verified:",
|
|
421
|
-
const T =
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
) || !
|
|
452
|
+
t.console.log("[useTrails] Origin verified:", x);
|
|
453
|
+
const T = K && ce(
|
|
454
|
+
te(K),
|
|
455
|
+
b
|
|
456
|
+
) || !K && n === f && ce(b, fe);
|
|
425
457
|
t.console.log(
|
|
426
458
|
"[useTrails] Destination verified:",
|
|
427
459
|
T
|
|
428
460
|
);
|
|
429
|
-
const Me =
|
|
461
|
+
const Me = x && T;
|
|
430
462
|
if (de({
|
|
431
463
|
success: Me,
|
|
432
|
-
receivedOriginAddress:
|
|
433
|
-
receivedDestinationAddress:
|
|
434
|
-
calculatedOriginAddress:
|
|
435
|
-
calculatedDestinationAddress:
|
|
464
|
+
receivedOriginAddress: ae,
|
|
465
|
+
receivedDestinationAddress: K,
|
|
466
|
+
calculatedOriginAddress: E.toString(),
|
|
467
|
+
calculatedDestinationAddress: b.toString()
|
|
436
468
|
}), !Me)
|
|
437
469
|
throw t.console.error("[useTrails] Address verification failed.", {
|
|
438
|
-
isOriginVerified:
|
|
470
|
+
isOriginVerified: x,
|
|
439
471
|
isDestinationVerified: T
|
|
440
472
|
}), new Error(
|
|
441
|
-
`Address verification failed. Origin verified: ${
|
|
473
|
+
`Address verification failed. Origin verified: ${x}, Destination verified: ${T}`
|
|
442
474
|
);
|
|
443
475
|
t.console.log("[useTrails] Committing intent to API...");
|
|
444
476
|
const He = await ze.mutateAsync(e);
|
|
445
477
|
return t.console.log("[useTrails] API Commit Response:", He), {
|
|
446
|
-
originIntentAddress:
|
|
447
|
-
destinationIntentAddress:
|
|
478
|
+
originIntentAddress: E.toString(),
|
|
479
|
+
destinationIntentAddress: b.toString(),
|
|
448
480
|
response: He
|
|
449
481
|
};
|
|
450
482
|
} catch (n) {
|
|
@@ -458,71 +490,67 @@ function Jn(u) {
|
|
|
458
490
|
), t.console.log(
|
|
459
491
|
"[useTrails] Setting committedOriginIntentAddress:",
|
|
460
492
|
e.originIntentAddress
|
|
461
|
-
), k(e.originIntentAddress),
|
|
493
|
+
), k(e.originIntentAddress), _(e.destinationIntentAddress);
|
|
462
494
|
},
|
|
463
495
|
onError: (e) => {
|
|
464
|
-
t.console.error("[useTrails] Failed to commit intent config:", e), k(null),
|
|
496
|
+
t.console.error("[useTrails] Failed to commit intent config:", e), k(null), _(null);
|
|
465
497
|
}
|
|
466
|
-
}),
|
|
467
|
-
data:
|
|
468
|
-
isLoading:
|
|
469
|
-
error:
|
|
470
|
-
} =
|
|
471
|
-
queryKey: ["getIntent",
|
|
498
|
+
}), Z = _e(), {
|
|
499
|
+
data: Ke,
|
|
500
|
+
isLoading: Xe,
|
|
501
|
+
error: Ye
|
|
502
|
+
} = qe({
|
|
503
|
+
queryKey: ["getIntent", m],
|
|
472
504
|
queryFn: async () => {
|
|
473
|
-
if (!o || !
|
|
505
|
+
if (!o || !m)
|
|
474
506
|
throw new Error("API client or committed intent address not available");
|
|
475
507
|
return t.console.log(
|
|
476
508
|
"Fetching intent config for address:",
|
|
477
|
-
|
|
509
|
+
m
|
|
478
510
|
), (await o.getIntent({
|
|
479
|
-
intentId:
|
|
511
|
+
intentId: m
|
|
480
512
|
})).intent;
|
|
481
513
|
},
|
|
482
|
-
enabled: !!
|
|
514
|
+
enabled: !!m && !!o && A.isSuccess,
|
|
483
515
|
staleTime: 1e3 * 60 * 5,
|
|
484
516
|
// 5 minutes
|
|
485
517
|
retry: 1
|
|
486
518
|
});
|
|
487
|
-
async function
|
|
488
|
-
const { intent: n } = await
|
|
519
|
+
async function Ze(e) {
|
|
520
|
+
const { intent: n } = await Ne(o, e);
|
|
489
521
|
return n;
|
|
490
522
|
}
|
|
491
|
-
const
|
|
523
|
+
const C = me({
|
|
492
524
|
mutationFn: async (e) => {
|
|
493
|
-
if (e.originChainId === e.destinationChainId &&
|
|
494
|
-
|
|
495
|
-
|
|
525
|
+
if (e.originChainId === e.destinationChainId && ce(
|
|
526
|
+
te(e.originTokenAddress),
|
|
527
|
+
te(e.destinationTokenAddress)
|
|
496
528
|
))
|
|
497
529
|
throw new Error(
|
|
498
530
|
"The same token cannot be used as both the source and destination token."
|
|
499
531
|
);
|
|
500
532
|
if (!i.address)
|
|
501
533
|
throw new Error("Missing selected token or account address");
|
|
502
|
-
k(null),
|
|
503
|
-
const { intent: n } = await
|
|
504
|
-
return
|
|
534
|
+
k(null), _(null), de(null), S(null), U(null), R(null), q(null), J(null), z(null);
|
|
535
|
+
const { intent: n } = await Ne(o, e);
|
|
536
|
+
return U(n.metaTxns), R(n.calls), q(n.preconditions), S(n.fees), J(n.originIntentAddress), z(n.destinationIntentAddress), pe(n), k(null), _(null), de(null), n;
|
|
505
537
|
},
|
|
506
538
|
onSuccess: (e) => {
|
|
507
|
-
t.console.log("Intent Config Success:", e),
|
|
539
|
+
t.console.log("Intent Config Success:", e), S(e.fees || null), J(e.originIntentAddress), z(e.destinationIntentAddress), e?.calls && e.calls.length > 0 && e.preconditions && e.preconditions.length > 0 && e.metaTxns && e.metaTxns.length > 0 ? (R(e.calls), q(e.preconditions), U(e.metaTxns)) : (t.console.warn("API returned success but no operations found."), R(null), q(null), U(null));
|
|
508
540
|
},
|
|
509
541
|
onError: (e) => {
|
|
510
|
-
console.error("Intent Config Error:", e),
|
|
542
|
+
console.error("Intent Config Error:", e), R(null), q(null), U(null), S(null), J(null), z(null);
|
|
511
543
|
}
|
|
512
|
-
})
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
t.console.log("[Trails] Clearing intent state"), U(null), q(null), R(null), A(null), k(null), V(null), de(null), _(null), z(null), se({}), F(!1), qe({});
|
|
518
|
-
}, []), H = Ge(
|
|
519
|
-
(e, n, m, S, y) => {
|
|
520
|
-
l({
|
|
544
|
+
}), en = $e(() => {
|
|
545
|
+
t.console.log("[Trails] Clearing intent state"), R(null), q(null), U(null), S(null), k(null), _(null), de(null), J(null), z(null), ie({}), X(!1), De({});
|
|
546
|
+
}, []), M = $e(
|
|
547
|
+
(e, n, f, E, b) => {
|
|
548
|
+
c({
|
|
521
549
|
txnHash: e,
|
|
522
550
|
status: n === "success" ? "Success" : n === "reverted" ? "Failed" : n === "sending" ? "Sending..." : "Pending",
|
|
523
|
-
revertReason: n === "reverted" ?
|
|
524
|
-
gasUsed:
|
|
525
|
-
effectiveGasPrice:
|
|
551
|
+
revertReason: n === "reverted" ? b || "Transaction reverted" : void 0,
|
|
552
|
+
gasUsed: f ? Number(f) : void 0,
|
|
553
|
+
effectiveGasPrice: E?.toString()
|
|
526
554
|
});
|
|
527
555
|
},
|
|
528
556
|
[]
|
|
@@ -540,7 +568,7 @@ function Jn(u) {
|
|
|
540
568
|
t.console.error(
|
|
541
569
|
"Origin call parameters not available or invalid:",
|
|
542
570
|
s
|
|
543
|
-
),
|
|
571
|
+
), M(
|
|
544
572
|
void 0,
|
|
545
573
|
"reverted",
|
|
546
574
|
void 0,
|
|
@@ -550,31 +578,31 @@ function Jn(u) {
|
|
|
550
578
|
return;
|
|
551
579
|
}
|
|
552
580
|
if (i.chainId !== s.chainId) {
|
|
553
|
-
|
|
581
|
+
B(!0), M(
|
|
554
582
|
void 0,
|
|
555
583
|
"pending",
|
|
556
584
|
void 0,
|
|
557
585
|
void 0,
|
|
558
586
|
`Switching to chain ${s.chainId}...`
|
|
559
587
|
);
|
|
560
|
-
const e =
|
|
588
|
+
const e = je({
|
|
561
589
|
chain: Re(s.chainId),
|
|
562
|
-
transport:
|
|
590
|
+
transport: Qe(await i.connector.getProvider())
|
|
563
591
|
// TODO: Add proper type
|
|
564
592
|
});
|
|
565
593
|
try {
|
|
566
594
|
await Be({
|
|
567
595
|
walletClient: e,
|
|
568
596
|
desiredChainId: s.chainId
|
|
569
|
-
}),
|
|
597
|
+
}), B(!1);
|
|
570
598
|
} catch (n) {
|
|
571
|
-
t.console.error("Chain switch failed:", n), n instanceof Error && n.message.includes("User rejected") &&
|
|
599
|
+
t.console.error("Chain switch failed:", n), n instanceof Error && n.message.includes("User rejected") && j(!1), M(
|
|
572
600
|
void 0,
|
|
573
601
|
"reverted",
|
|
574
602
|
void 0,
|
|
575
603
|
void 0,
|
|
576
604
|
n instanceof Error ? n.message : "Unknown error switching chain"
|
|
577
|
-
),
|
|
605
|
+
), B(!1);
|
|
578
606
|
return;
|
|
579
607
|
}
|
|
580
608
|
}
|
|
@@ -583,18 +611,18 @@ function Jn(u) {
|
|
|
583
611
|
"Transaction already in progress. Skipping duplicate request."
|
|
584
612
|
);
|
|
585
613
|
else {
|
|
586
|
-
if (
|
|
587
|
-
|
|
614
|
+
if (N(!0), D(void 0), M(void 0, "sending"), !ue && !ke) {
|
|
615
|
+
Ee(!0);
|
|
588
616
|
return;
|
|
589
617
|
}
|
|
590
618
|
if (ke) {
|
|
591
|
-
t.console.error("Gas estimation failed:",
|
|
619
|
+
t.console.error("Gas estimation failed:", ye), M(
|
|
592
620
|
void 0,
|
|
593
621
|
"reverted",
|
|
594
622
|
void 0,
|
|
595
623
|
void 0,
|
|
596
|
-
`Gas estimation failed: ${
|
|
597
|
-
),
|
|
624
|
+
`Gas estimation failed: ${ye?.message}`
|
|
625
|
+
), N(!1);
|
|
598
626
|
return;
|
|
599
627
|
}
|
|
600
628
|
const e = ue ? BigInt(Math.floor(Number(ue) * 1.2)) : void 0;
|
|
@@ -608,44 +636,44 @@ function Jn(u) {
|
|
|
608
636
|
},
|
|
609
637
|
{
|
|
610
638
|
onSuccess: (n) => {
|
|
611
|
-
t.console.log("Transaction sent, hash:", n),
|
|
639
|
+
t.console.log("Transaction sent, hash:", n), D(n), N(!1);
|
|
612
640
|
},
|
|
613
641
|
onError: (n) => {
|
|
614
|
-
t.console.error("Transaction failed:", n), n instanceof Error && (n.message.includes("User rejected") || n.message.includes("user rejected")) &&
|
|
642
|
+
t.console.error("Transaction failed:", n), n instanceof Error && (n.message.includes("User rejected") || n.message.includes("user rejected")) && j(!1), M(
|
|
615
643
|
void 0,
|
|
616
644
|
"reverted",
|
|
617
645
|
void 0,
|
|
618
646
|
void 0,
|
|
619
647
|
n instanceof Error ? n.message : "Unknown error"
|
|
620
|
-
),
|
|
648
|
+
), N(!1);
|
|
621
649
|
}
|
|
622
650
|
}
|
|
623
651
|
);
|
|
624
652
|
}
|
|
625
653
|
};
|
|
626
|
-
|
|
627
|
-
G && (t.console.error("Chain switch error:", G),
|
|
654
|
+
P(() => {
|
|
655
|
+
G && (t.console.error("Chain switch error:", G), M(
|
|
628
656
|
void 0,
|
|
629
657
|
"reverted",
|
|
630
658
|
void 0,
|
|
631
659
|
void 0,
|
|
632
660
|
`Chain switch failed: ${G.message || "Unknown error"}`
|
|
633
|
-
),
|
|
634
|
-
}, [G,
|
|
635
|
-
|
|
636
|
-
}, []),
|
|
637
|
-
s?.chainId && i.chainId === s.chainId && (t.console.log("No chain switch required"),
|
|
638
|
-
}, [i.chainId, s?.chainId]),
|
|
661
|
+
), B(!1));
|
|
662
|
+
}, [G, M]), P(() => {
|
|
663
|
+
Ee(!1);
|
|
664
|
+
}, []), P(() => {
|
|
665
|
+
s?.chainId && i.chainId === s.chainId && (t.console.log("No chain switch required"), B(!1));
|
|
666
|
+
}, [i.chainId, s?.chainId]), P(() => {
|
|
639
667
|
if (s?.chainId && i.chainId !== s.chainId) {
|
|
640
668
|
async function e() {
|
|
641
669
|
try {
|
|
642
|
-
const n = s.chainId,
|
|
670
|
+
const n = s.chainId, f = je({
|
|
643
671
|
chain: Re(n),
|
|
644
|
-
transport:
|
|
672
|
+
transport: Qe(await i.connector.getProvider())
|
|
645
673
|
// TODO: Add proper type
|
|
646
674
|
});
|
|
647
675
|
await Be({
|
|
648
|
-
walletClient:
|
|
676
|
+
walletClient: f,
|
|
649
677
|
desiredChainId: n
|
|
650
678
|
});
|
|
651
679
|
} catch (n) {
|
|
@@ -656,52 +684,52 @@ function Jn(u) {
|
|
|
656
684
|
}
|
|
657
685
|
}, [i, s]);
|
|
658
686
|
const {
|
|
659
|
-
data:
|
|
660
|
-
isLoading:
|
|
661
|
-
isSuccess:
|
|
662
|
-
isError:
|
|
687
|
+
data: H,
|
|
688
|
+
isLoading: ee,
|
|
689
|
+
isSuccess: be,
|
|
690
|
+
isError: xe,
|
|
663
691
|
error: ge
|
|
664
|
-
} =
|
|
665
|
-
hash:
|
|
692
|
+
} = jn({
|
|
693
|
+
hash: p,
|
|
666
694
|
confirmations: 1,
|
|
667
695
|
query: {
|
|
668
|
-
enabled: !!
|
|
696
|
+
enabled: !!p
|
|
669
697
|
}
|
|
670
698
|
});
|
|
671
|
-
|
|
672
|
-
if (!
|
|
673
|
-
|
|
699
|
+
P(() => {
|
|
700
|
+
if (!p) {
|
|
701
|
+
y?.txnHash && c(null), $(null), Object.keys(Q).length > 0 && he({});
|
|
674
702
|
return;
|
|
675
703
|
}
|
|
676
|
-
if (!(
|
|
677
|
-
if (
|
|
678
|
-
|
|
679
|
-
...e?.txnHash ===
|
|
704
|
+
if (!(y?.txnHash === p && (y?.status === "Success" || y?.status === "Failed") && !ee)) {
|
|
705
|
+
if (ee) {
|
|
706
|
+
c((e) => ({
|
|
707
|
+
...e?.txnHash === p ? e : {
|
|
680
708
|
gasUsed: void 0,
|
|
681
709
|
effectiveGasPrice: void 0,
|
|
682
710
|
revertReason: void 0
|
|
683
711
|
},
|
|
684
|
-
txnHash:
|
|
712
|
+
txnHash: p,
|
|
685
713
|
status: "Pending"
|
|
686
714
|
}));
|
|
687
715
|
return;
|
|
688
716
|
}
|
|
689
|
-
if (
|
|
690
|
-
const e =
|
|
691
|
-
|
|
692
|
-
txnHash:
|
|
717
|
+
if (be && H) {
|
|
718
|
+
const e = H.status === "success" ? "Success" : "Failed";
|
|
719
|
+
c({
|
|
720
|
+
txnHash: H.transactionHash,
|
|
693
721
|
status: e,
|
|
694
|
-
gasUsed:
|
|
695
|
-
effectiveGasPrice:
|
|
696
|
-
revertReason:
|
|
697
|
-
}), e !== "Success" && $(null), e === "Success" &&
|
|
722
|
+
gasUsed: H.gasUsed ? Number(H.gasUsed) : void 0,
|
|
723
|
+
effectiveGasPrice: H.effectiveGasPrice?.toString(),
|
|
724
|
+
revertReason: H.status === "reverted" ? ge?.message || "Transaction reverted by receipt" : void 0
|
|
725
|
+
}), e !== "Success" && $(null), e === "Success" && W && W.length > 0 && d && !W.some((n) => Q[`${n.chainId}-${n.id}`]) && (t.console.log(
|
|
698
726
|
"Origin transaction successful, calling executeIntent and auto-sending all meta transactions..."
|
|
699
|
-
),
|
|
700
|
-
intentId:
|
|
701
|
-
depositTransactionHash:
|
|
727
|
+
), m && p && Z.mutate({
|
|
728
|
+
intentId: m,
|
|
729
|
+
depositTransactionHash: p
|
|
702
730
|
}));
|
|
703
|
-
} else
|
|
704
|
-
txnHash:
|
|
731
|
+
} else xe && (c({
|
|
732
|
+
txnHash: p,
|
|
705
733
|
status: "Failed",
|
|
706
734
|
revertReason: ge?.message || "Failed to get receipt",
|
|
707
735
|
gasUsed: void 0,
|
|
@@ -709,21 +737,21 @@ function Jn(u) {
|
|
|
709
737
|
}), $(null));
|
|
710
738
|
}
|
|
711
739
|
}, [
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
ye,
|
|
740
|
+
p,
|
|
741
|
+
ee,
|
|
715
742
|
be,
|
|
716
|
-
|
|
743
|
+
xe,
|
|
744
|
+
H,
|
|
717
745
|
ge,
|
|
746
|
+
W,
|
|
718
747
|
Q,
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
c && C.isSuccess && s?.chainId && i.chainId === s.chainId && !s.error && s.to && s.data !== null && s.value !== null && !r.isPending && !Z && !h && !ie && !E && !J && (t.console.log("Auto-executing transaction: All conditions met."), F(!0), l({
|
|
748
|
+
d,
|
|
749
|
+
y?.status,
|
|
750
|
+
y?.txnHash,
|
|
751
|
+
m,
|
|
752
|
+
Z
|
|
753
|
+
]), P(() => {
|
|
754
|
+
d && A.isSuccess && s?.chainId && i.chainId === s.chainId && !s.error && s.to && s.data !== null && s.value !== null && !r.isPending && !ee && !p && !oe && !y && !F && (t.console.log("Auto-executing transaction: All conditions met."), X(!0), c({
|
|
727
755
|
status: "Sending..."
|
|
728
756
|
}), r.sendTransaction(
|
|
729
757
|
{
|
|
@@ -734,87 +762,87 @@ function Jn(u) {
|
|
|
734
762
|
},
|
|
735
763
|
{
|
|
736
764
|
onSuccess: (n) => {
|
|
737
|
-
t.console.log("Auto-executed transaction sent, hash:", n),
|
|
765
|
+
t.console.log("Auto-executed transaction sent, hash:", n), D(n);
|
|
738
766
|
},
|
|
739
767
|
onError: (n) => {
|
|
740
|
-
t.console.error("Auto-executed transaction failed:", n), n instanceof Error && (n.message.includes("User rejected") || n.message.includes("user rejected")) &&
|
|
768
|
+
t.console.error("Auto-executed transaction failed:", n), n instanceof Error && (n.message.includes("User rejected") || n.message.includes("user rejected")) && j(!1), c({
|
|
741
769
|
status: "Failed",
|
|
742
770
|
revertReason: n instanceof Error ? n.message : "Unknown error"
|
|
743
|
-
}),
|
|
771
|
+
}), X(!1);
|
|
744
772
|
}
|
|
745
773
|
}
|
|
746
774
|
));
|
|
747
775
|
}, [
|
|
748
|
-
|
|
749
|
-
|
|
776
|
+
d,
|
|
777
|
+
A.isSuccess,
|
|
750
778
|
s,
|
|
751
779
|
i.chainId,
|
|
752
780
|
r.isPending,
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
781
|
+
ee,
|
|
782
|
+
p,
|
|
783
|
+
oe,
|
|
784
|
+
y,
|
|
785
|
+
F,
|
|
758
786
|
r
|
|
759
|
-
]),
|
|
760
|
-
|
|
787
|
+
]), P(() => {
|
|
788
|
+
d && V && w && v && i.address && O && !A.isPending && !A.isSuccess && (t.console.log("Auto-committing intent configuration..."), se && A.mutate(se));
|
|
761
789
|
}, [
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
790
|
+
d,
|
|
791
|
+
se,
|
|
792
|
+
V,
|
|
765
793
|
w,
|
|
766
|
-
|
|
794
|
+
v,
|
|
767
795
|
i.address,
|
|
768
|
-
|
|
769
|
-
|
|
796
|
+
O,
|
|
797
|
+
A
|
|
770
798
|
]);
|
|
771
|
-
const [
|
|
772
|
-
|
|
773
|
-
if (!
|
|
774
|
-
|
|
799
|
+
const [ne, tn] = u(null), [re, sn] = u(null);
|
|
800
|
+
P(() => {
|
|
801
|
+
if (!O || !V?.[0]?.chainId || !ne || !re || !w || !i.address) {
|
|
802
|
+
Y(null);
|
|
775
803
|
return;
|
|
776
804
|
}
|
|
777
805
|
try {
|
|
778
|
-
const e =
|
|
779
|
-
if (!e || !
|
|
780
|
-
|
|
806
|
+
const e = O;
|
|
807
|
+
if (!e || !Ln(e)) {
|
|
808
|
+
Y(null);
|
|
781
809
|
return;
|
|
782
810
|
}
|
|
783
|
-
let n,
|
|
784
|
-
const
|
|
785
|
-
if (
|
|
786
|
-
const
|
|
787
|
-
(T) => (T.type === "transfer-native" || T.type === "native-balance") && T.chainId ===
|
|
811
|
+
let n, f = "0x", E = 0n;
|
|
812
|
+
const b = e;
|
|
813
|
+
if (ne === fe || ne === Nn) {
|
|
814
|
+
const x = w.find(
|
|
815
|
+
(T) => (T.type === "transfer-native" || T.type === "native-balance") && T.chainId === re
|
|
788
816
|
)?.minAmount?.toString();
|
|
789
|
-
if (
|
|
817
|
+
if (x === void 0)
|
|
790
818
|
throw new Error("Could not find precondition or min amount");
|
|
791
|
-
|
|
819
|
+
E = BigInt(x), n = b;
|
|
792
820
|
} else {
|
|
793
|
-
const
|
|
794
|
-
(T) => T.type === "erc20-balance" && T.chainId ===
|
|
795
|
-
|
|
796
|
-
ne
|
|
821
|
+
const x = w.find(
|
|
822
|
+
(T) => T.type === "erc20-balance" && T.chainId === re && T.tokenAddress && ce(
|
|
823
|
+
te(T.tokenAddress),
|
|
824
|
+
te(ne)
|
|
797
825
|
)
|
|
798
826
|
)?.minAmount?.toString();
|
|
799
|
-
if (
|
|
827
|
+
if (x === void 0)
|
|
800
828
|
throw new Error("Could not find precondition or min amount");
|
|
801
|
-
|
|
802
|
-
recipient:
|
|
803
|
-
amount: BigInt(
|
|
804
|
-
}), n =
|
|
829
|
+
f = On({
|
|
830
|
+
recipient: b,
|
|
831
|
+
amount: BigInt(x)
|
|
832
|
+
}), n = ne;
|
|
805
833
|
}
|
|
806
|
-
|
|
834
|
+
Y({
|
|
807
835
|
to: n,
|
|
808
|
-
data:
|
|
809
|
-
value:
|
|
810
|
-
chainId:
|
|
836
|
+
data: f,
|
|
837
|
+
value: E,
|
|
838
|
+
chainId: re,
|
|
811
839
|
error: void 0
|
|
812
840
|
});
|
|
813
841
|
} catch (e) {
|
|
814
842
|
t.console.error(
|
|
815
843
|
"[trails-sdk] Failed to calculate origin call params for UI:",
|
|
816
844
|
e
|
|
817
|
-
),
|
|
845
|
+
), Y({
|
|
818
846
|
to: null,
|
|
819
847
|
data: null,
|
|
820
848
|
value: null,
|
|
@@ -823,217 +851,216 @@ function Jn(u) {
|
|
|
823
851
|
});
|
|
824
852
|
}
|
|
825
853
|
}, [
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
854
|
+
V,
|
|
855
|
+
ne,
|
|
856
|
+
re,
|
|
829
857
|
w,
|
|
830
858
|
i.address,
|
|
831
|
-
|
|
859
|
+
O
|
|
832
860
|
]);
|
|
833
|
-
const
|
|
834
|
-
|
|
861
|
+
const I = Qn(
|
|
862
|
+
m ?? void 0,
|
|
835
863
|
o
|
|
836
864
|
);
|
|
837
|
-
|
|
865
|
+
P(() => {
|
|
838
866
|
if (t.console.log("[trails-sdk] Intent receipt status update:", {
|
|
839
|
-
intentId:
|
|
840
|
-
done:
|
|
841
|
-
hasReceipt: !!
|
|
842
|
-
}), !
|
|
867
|
+
intentId: m,
|
|
868
|
+
done: I.done,
|
|
869
|
+
hasReceipt: !!I.intentReceipt
|
|
870
|
+
}), !I.intentReceipt) {
|
|
843
871
|
t.console.log("[trails-sdk] No intent receipt yet, waiting...");
|
|
844
872
|
return;
|
|
845
873
|
}
|
|
846
874
|
const e = {};
|
|
847
|
-
if (
|
|
848
|
-
const n =
|
|
849
|
-
e[
|
|
875
|
+
if (I.intentReceipt.originTransaction) {
|
|
876
|
+
const n = I.intentReceipt.originTransaction, f = `${n.chainId}-${n.metaTxnId}`;
|
|
877
|
+
e[f] = { timestamp: null };
|
|
850
878
|
}
|
|
851
|
-
if (
|
|
852
|
-
const n =
|
|
853
|
-
e[
|
|
879
|
+
if (I.intentReceipt.destinationTransaction) {
|
|
880
|
+
const n = I.intentReceipt.destinationTransaction, f = `${n.chainId}-${n.metaTxnId}`;
|
|
881
|
+
e[f] = { timestamp: null };
|
|
854
882
|
}
|
|
855
|
-
|
|
883
|
+
De(e);
|
|
856
884
|
}, [
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
]),
|
|
861
|
-
if (
|
|
862
|
-
intentId:
|
|
863
|
-
status:
|
|
864
|
-
}),
|
|
865
|
-
const e =
|
|
866
|
-
|
|
885
|
+
I.intentReceipt,
|
|
886
|
+
I.done,
|
|
887
|
+
m
|
|
888
|
+
]), P(() => {
|
|
889
|
+
if (I.done && I.intentReceipt && (t.console.log("[trails-sdk] Intent execution completed", {
|
|
890
|
+
intentId: m,
|
|
891
|
+
status: I.intentReceipt.status
|
|
892
|
+
}), I.intentReceipt.originTransaction?.txnHash)) {
|
|
893
|
+
const e = v?.quoteProvider ? String(v.quoteProvider).toLowerCase() : void 0, n = C.variables?.options?.quoteProvider ? String(
|
|
894
|
+
C.variables.options.quoteProvider
|
|
867
895
|
).toLowerCase() : void 0;
|
|
868
|
-
if ((e === "cctp" || n === "cctp") &&
|
|
896
|
+
if ((e === "cctp" || n === "cctp") && C.variables)
|
|
869
897
|
try {
|
|
870
898
|
Mn({
|
|
871
|
-
sourceTxHash:
|
|
872
|
-
sourceChainId:
|
|
873
|
-
destinationChainId:
|
|
899
|
+
sourceTxHash: I.intentReceipt.originTransaction.txnHash,
|
|
900
|
+
sourceChainId: C.variables.originChainId,
|
|
901
|
+
destinationChainId: C.variables.destinationChainId,
|
|
874
902
|
trailsClient: o
|
|
875
903
|
});
|
|
876
|
-
} catch (
|
|
877
|
-
t.console.error("[Trails] queueCCTPTransfer error",
|
|
904
|
+
} catch (E) {
|
|
905
|
+
t.console.error("[Trails] queueCCTPTransfer error", E);
|
|
878
906
|
}
|
|
879
907
|
}
|
|
880
908
|
}, [
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
909
|
+
I.done,
|
|
910
|
+
I.intentReceipt,
|
|
911
|
+
m,
|
|
912
|
+
v,
|
|
913
|
+
C.variables,
|
|
886
914
|
o
|
|
887
915
|
]);
|
|
888
916
|
const on = (e) => {
|
|
889
|
-
|
|
917
|
+
j(e);
|
|
890
918
|
};
|
|
891
919
|
function rn(e) {
|
|
892
|
-
|
|
920
|
+
C.mutate(e);
|
|
893
921
|
}
|
|
894
922
|
function an(e) {
|
|
895
|
-
t.console.log("[trails-sdk] commitIntent", e),
|
|
923
|
+
t.console.log("[trails-sdk] commitIntent", e), A.mutate(e);
|
|
896
924
|
}
|
|
897
925
|
function cn(e) {
|
|
898
926
|
if (!e) {
|
|
899
|
-
|
|
927
|
+
Y(null);
|
|
900
928
|
return;
|
|
901
929
|
}
|
|
902
|
-
const { originChainId: n, tokenAddress:
|
|
903
|
-
sn(n), tn(
|
|
930
|
+
const { originChainId: n, tokenAddress: f } = e;
|
|
931
|
+
sn(n), tn(f);
|
|
904
932
|
}
|
|
905
|
-
const { chainId: ln } = i, Oe = s?.chainId, dn =
|
|
906
|
-
function
|
|
907
|
-
|
|
933
|
+
const { chainId: ln } = i, Oe = s?.chainId, dn = C.isPending, un = C.isSuccess, gn = C.error, mn = C.variables, fn = A.isPending, In = A.isSuccess, hn = A.error, pn = A.variables, vn = Z.isPending, Cn = Z.isSuccess, Tn = Z.error;
|
|
934
|
+
function Sn(e) {
|
|
935
|
+
Z.mutate(e);
|
|
908
936
|
}
|
|
909
937
|
return {
|
|
910
938
|
trailsClient: o,
|
|
911
|
-
metaTxns:
|
|
912
|
-
|
|
939
|
+
metaTxns: W,
|
|
940
|
+
intentCalls: V,
|
|
913
941
|
intentPreconditions: w,
|
|
914
|
-
trailsFee:
|
|
915
|
-
txnHash:
|
|
916
|
-
committedOriginIntentAddress:
|
|
917
|
-
committedDestinationIntentAddress:
|
|
918
|
-
verificationStatus:
|
|
942
|
+
trailsFee: v,
|
|
943
|
+
txnHash: p,
|
|
944
|
+
committedOriginIntentAddress: m,
|
|
945
|
+
committedDestinationIntentAddress: ve,
|
|
946
|
+
verificationStatus: Je,
|
|
919
947
|
estimatedGas: ue,
|
|
920
948
|
isEstimateError: ke,
|
|
921
|
-
estimateError:
|
|
949
|
+
estimateError: ye,
|
|
922
950
|
calculateIntentAddress: Hn,
|
|
923
|
-
calculateOriginAndDestinationIntentAddresses:
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
committedConfigError:
|
|
951
|
+
calculateOriginAndDestinationIntentAddresses: Le,
|
|
952
|
+
committedIntent: Ke,
|
|
953
|
+
isLoadingCommittedIntent: Xe,
|
|
954
|
+
committedConfigError: Ye,
|
|
927
955
|
commitIntent: an,
|
|
928
956
|
commitIntentPending: fn,
|
|
929
957
|
commitIntentSuccess: In,
|
|
930
958
|
commitIntentError: hn,
|
|
931
959
|
commitIntentArgs: pn,
|
|
932
|
-
executeIntent:
|
|
960
|
+
executeIntent: Sn,
|
|
933
961
|
executeIntentPending: vn,
|
|
934
|
-
executeIntentSuccess:
|
|
935
|
-
executeIntentError:
|
|
936
|
-
|
|
937
|
-
operationHashes:
|
|
938
|
-
callIntentCallsPayload: Ze,
|
|
962
|
+
executeIntentSuccess: Cn,
|
|
963
|
+
executeIntentError: Tn,
|
|
964
|
+
getIntentFromQuoteIntent: Ze,
|
|
965
|
+
operationHashes: Ce,
|
|
939
966
|
sendOriginTransaction: nn,
|
|
940
967
|
switchChain: Te,
|
|
941
|
-
isSwitchingChain:
|
|
968
|
+
isSwitchingChain: Se,
|
|
942
969
|
switchChainError: G,
|
|
943
970
|
isTransactionInProgress: L,
|
|
944
971
|
isChainSwitchRequired: ln !== Oe && !!Oe,
|
|
945
972
|
sendTransaction: r.sendTransaction,
|
|
946
973
|
isSendingTransaction: r.isPending,
|
|
947
|
-
originCallStatus:
|
|
948
|
-
updateOriginCallStatus:
|
|
949
|
-
isEstimatingGas:
|
|
950
|
-
isAutoExecute:
|
|
974
|
+
originCallStatus: y,
|
|
975
|
+
updateOriginCallStatus: M,
|
|
976
|
+
isEstimatingGas: Ae,
|
|
977
|
+
isAutoExecute: d,
|
|
951
978
|
updateAutoExecute: on,
|
|
952
|
-
receipt:
|
|
953
|
-
isWaitingForReceipt:
|
|
954
|
-
receiptIsSuccess:
|
|
955
|
-
receiptIsError:
|
|
979
|
+
receipt: H,
|
|
980
|
+
isWaitingForReceipt: ee,
|
|
981
|
+
receiptIsSuccess: be,
|
|
982
|
+
receiptIsError: xe,
|
|
956
983
|
receiptError: ge,
|
|
957
|
-
hasAutoExecuted:
|
|
984
|
+
hasAutoExecuted: F,
|
|
958
985
|
originCallSuccess: r.isSuccess,
|
|
959
|
-
sentMetaTxns:
|
|
986
|
+
sentMetaTxns: Q,
|
|
960
987
|
clearIntent: en,
|
|
961
|
-
intentReceiptStatus:
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
988
|
+
intentReceiptStatus: I,
|
|
989
|
+
quoteIntent: rn,
|
|
990
|
+
quoteIntentPending: dn,
|
|
991
|
+
quoteIntentSuccess: un,
|
|
992
|
+
quoteIntentError: gn,
|
|
993
|
+
quoteIntentArgs: mn,
|
|
967
994
|
originCallParams: s,
|
|
968
995
|
updateOriginCallParams: cn,
|
|
969
|
-
originBlockTimestamp:
|
|
996
|
+
originBlockTimestamp: h,
|
|
970
997
|
metaTxnBlockTimestamps: we,
|
|
971
|
-
originIntentAddress:
|
|
998
|
+
originIntentAddress: O,
|
|
972
999
|
destinationIntentAddress: le
|
|
973
1000
|
};
|
|
974
1001
|
}
|
|
975
1002
|
export {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
1003
|
+
et as InsufficientBalanceError,
|
|
1004
|
+
nt as TRAILS_ROUTER_PLACEHOLDER_AMOUNT,
|
|
1005
|
+
Un as TradeType,
|
|
1006
|
+
tt as TrailsClient,
|
|
1007
|
+
st as TrailsWidget,
|
|
1008
|
+
it as UserRejectionError,
|
|
982
1009
|
Hn as calculateIntentAddress,
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1010
|
+
Le as calculateOriginAndDestinationIntentAddresses,
|
|
1011
|
+
ot as commitIntent,
|
|
1012
|
+
rt as createModalController,
|
|
1013
|
+
at as declareSequenceEnv,
|
|
1014
|
+
ct as getAccountTotalBalanceUsd,
|
|
1015
|
+
lt as getAccountTransactionHistory,
|
|
1016
|
+
dt as getAllChains,
|
|
990
1017
|
Re as getChainInfo,
|
|
991
|
-
|
|
1018
|
+
ut as getDebug,
|
|
992
1019
|
On as getERC20TransferData,
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
vt as getSequenceIndexerUrl,
|
|
1020
|
+
gt as getHasSufficientBalanceToken,
|
|
1021
|
+
mt as getHasSufficientBalanceUsd,
|
|
1022
|
+
ft as getIndexerGatewayClient,
|
|
1023
|
+
It as getIntentTransactionHistory,
|
|
1024
|
+
ht as getIsUserRejectionError,
|
|
1025
|
+
pt as getMinLogLevel,
|
|
1026
|
+
vt as getSequenceEnv,
|
|
1027
|
+
Ct as getSequenceIndexerUrl,
|
|
1002
1028
|
Tt as getSequenceNodeGatewayUrl,
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1029
|
+
St as getSequenceProjectAccessKey,
|
|
1030
|
+
At as getSlippageTolerance,
|
|
1031
|
+
Et as getSupportedChains,
|
|
1006
1032
|
wt as getSupportedTokens,
|
|
1007
1033
|
kt as getTrailsApiUrl,
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1034
|
+
yt as getTrailsClient,
|
|
1035
|
+
bt as getTxTimeDiff,
|
|
1036
|
+
xt as getWalletConnectProjectId,
|
|
1011
1037
|
t as logger,
|
|
1012
|
-
|
|
1038
|
+
Pt as pollIntentReceipt,
|
|
1013
1039
|
Rn as prepareSend,
|
|
1014
|
-
|
|
1040
|
+
Ne as quoteIntent,
|
|
1041
|
+
Ut as sendOriginTransaction,
|
|
1015
1042
|
Rt as setDebug,
|
|
1016
|
-
|
|
1017
|
-
|
|
1043
|
+
qt as setSequenceEnv,
|
|
1044
|
+
Dt as setSequenceIndexerUrl,
|
|
1018
1045
|
Ot as setSequenceNodeGatewayUrl,
|
|
1019
1046
|
Mt as setSequenceProjectAccessKey,
|
|
1020
1047
|
Ht as setSlippageTolerance,
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1048
|
+
Ft as setTrailsApiUrl,
|
|
1049
|
+
Lt as setWalletConnectProjectId,
|
|
1050
|
+
Nt as useAccountTotalBalanceUsd,
|
|
1024
1051
|
Bt as useAccountTransactionHistory,
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1052
|
+
Ve as useCommitIntent,
|
|
1053
|
+
_e as useExecuteIntent,
|
|
1054
|
+
Gt as useHasSufficientBalanceToken,
|
|
1055
|
+
$t as useHasSufficientBalanceUsd,
|
|
1056
|
+
yn as useIndexerGatewayClient,
|
|
1057
|
+
Qn as useIntentReceiptMonitor,
|
|
1058
|
+
jt as useIntentTransactionHistory,
|
|
1059
|
+
Kn as useQuote,
|
|
1060
|
+
Qt as useSupportedChains,
|
|
1061
|
+
bn as useSupportedTokens,
|
|
1062
|
+
Wt as useTokenBalances,
|
|
1063
|
+
Vt as useTokenList,
|
|
1064
|
+
Xn as useTrails,
|
|
1038
1065
|
Ie as useTrailsClient
|
|
1039
1066
|
};
|