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