0xtrails 0.7.0 → 0.8.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-fConRNoG.js → ccip-uMWNlvmJ.js} +34 -34
- package/dist/fees.d.ts.map +1 -1
- package/dist/{index-BbajxCG_.js → index-BiPwqVkZ.js} +31527 -28874
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +478 -456
- package/dist/intents.d.ts +10 -4
- package/dist/intents.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +1 -1
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/prices.d.ts +2 -2
- package/dist/prices.d.ts.map +1 -1
- package/dist/refund.d.ts +116 -0
- package/dist/refund.d.ts.map +1 -0
- package/dist/tokenBalances.d.ts +1 -1
- package/dist/tokenBalances.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/crossChain.d.ts +4 -3
- package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +3 -3
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -1
- package/dist/transactionIntent/quote/normalizeQuote.d.ts +1 -2
- package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.d.ts +3 -3
- package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/types.d.ts +5 -4
- package/dist/transactionIntent/types.d.ts.map +1 -1
- package/dist/transactions.d.ts +4 -0
- package/dist/transactions.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts +2 -1
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/Earn.d.ts +2 -1
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/ErrorDisplay.d.ts.map +1 -1
- package/dist/widget/components/Fund.d.ts +2 -1
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundSwap.d.ts +2 -1
- package/dist/widget/components/FundSwap.d.ts.map +1 -1
- package/dist/widget/components/Pay.d.ts +2 -1
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts +2 -1
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.d.ts +1 -0
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Swap.d.ts +2 -1
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/TokenImage.d.ts.map +1 -1
- package/dist/widget/components/TransactionDetails.d.ts.map +1 -1
- package/dist/widget/css/compiled.css +1 -1
- package/dist/widget/hooks/useAmountUsd.d.ts.map +1 -1
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -1
- package/dist/widget/hooks/useGetIntent.d.ts +18 -0
- package/dist/widget/hooks/useGetIntent.d.ts.map +1 -0
- package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/hooks/useQuote.d.ts +10 -7
- package/dist/widget/hooks/useQuote.d.ts.map +1 -1
- package/dist/widget/hooks/useSendForm.d.ts +3 -2
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
- package/dist/widget/hooks/useTrailsSendTransaction.d.ts.map +1 -1
- package/dist/widget/index.js +3 -3
- package/dist/widget/widget.d.ts +2 -1
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +5 -12
- package/src/fees.ts +8 -2
- package/src/index.ts +33 -1
- package/src/intents.ts +34 -7
- package/src/prepareSend.ts +6 -4
- package/src/prices.ts +6 -6
- package/src/refund.ts +914 -0
- package/src/tokenBalances.ts +4 -14
- package/src/transactionIntent/handlers/crossChain.ts +21 -10
- package/src/transactionIntent/handlers/sameChainSameToken.ts +12 -8
- package/src/transactionIntent/quote/normalizeQuote.ts +29 -27
- package/src/transactionIntent/quote/quoteHelpers.ts +5 -9
- package/src/transactionIntent/types.ts +5 -3
- package/src/transactions.ts +5 -0
- package/src/widget/compiled.css +1 -1
- package/src/widget/components/AccountIntentTransactionHistory.tsx +197 -5
- package/src/widget/components/ClassicSwap.tsx +6 -3
- package/src/widget/components/Earn.tsx +6 -3
- package/src/widget/components/ErrorDisplay.tsx +6 -4
- package/src/widget/components/Fund.tsx +6 -3
- package/src/widget/components/FundSwap.tsx +2 -1
- package/src/widget/components/Pay.tsx +15 -7
- package/src/widget/components/PoolDeposit.tsx +6 -3
- package/src/widget/components/QuoteDetails.tsx +34 -38
- package/src/widget/components/Swap.tsx +2 -1
- package/src/widget/components/TokenImage.tsx +3 -1
- package/src/widget/components/TransactionDetails.tsx +108 -0
- package/src/widget/hooks/useAmountUsd.ts +0 -3
- package/src/widget/hooks/useDefaultTokenSelection.tsx +0 -3
- package/src/widget/hooks/useGetIntent.ts +53 -0
- package/src/widget/hooks/useIntentTransactionHistory.ts +85 -3
- package/src/widget/hooks/useQuote.ts +16 -10
- package/src/widget/hooks/useSendForm.ts +30 -15
- package/src/widget/hooks/useTokenList.ts +2 -4
- package/src/widget/hooks/useTrailsSendTransaction.ts +2 -1
- package/src/widget/widget.tsx +12 -6
- package/dist/sequenceWallet.d.ts +0 -67
- package/dist/sequenceWallet.d.ts.map +0 -1
- package/src/sequenceWallet.ts +0 -532
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { l as o, u as
|
|
2
|
-
import { s as ee,
|
|
3
|
-
import { useQuery as
|
|
4
|
-
import { useRef as
|
|
1
|
+
import { l as o, u as gt, t as Ot, T as Ht, a as Lt, b as bt, g as M, I as qt, c as pt, d as Ct, e as yt, f as It, h as ut, i as St, j as K, p as wt, k as J, m as Nt, n as ft, o as Bt, q as Tt, r as At } from "./index-BiPwqVkZ.js";
|
|
2
|
+
import { s as ee, am as ne, ar as oe, aB as se, aA as re, ao as ae, az as ie, U as ce, L as le, at as de, au as ue, ag as ge, M as me, N as fe, O as Te, a7 as ke, ay as he, aw as Ce, a8 as Ae, aa as Ee, ai as pe, ab as ye, a9 as Ie, Y as Se, S as we, H as Ue, K as Pe, an as De, Z as xe, as as Re, w as ve, v as Oe, D as He, z as Le, A as be, C as qe, B as Ne, x as Be, y as Fe, E as Me, ap as Qe, J as We, F as _e, a2 as $e, ac as Ge, aq as je, al as Ke, af as Je, ak as Xe, aj as ze, ah as Ve, R as Ye, P as Ze, Q as tn, av as en, _ as nn, V as on, X as sn, a4 as rn, $ as an, a0 as cn, W as ln, G as dn, a5 as un, a1 as gn, a6 as mn, a3 as fn, ad as Tn, ae as kn, ax as hn } from "./index-BiPwqVkZ.js";
|
|
3
|
+
import { useQuery as Ut, useMutation as kt } from "@tanstack/react-query";
|
|
4
|
+
import { useRef as Pt, useCallback as dt } from "react";
|
|
5
5
|
import { useWalletClient as Ft, useAccount as Mt, useChainId as Qt } from "wagmi";
|
|
6
|
-
import { zeroAddress as
|
|
6
|
+
import { zeroAddress as x, erc20Abi as Dt } from "viem";
|
|
7
7
|
import { useIndexerGatewayClient as xt } from "@0xsequence/hooks";
|
|
8
|
-
import { useIndexerGatewayClient as
|
|
9
|
-
const
|
|
10
|
-
const s =
|
|
8
|
+
import { useIndexerGatewayClient as An } from "@0xsequence/hooks";
|
|
9
|
+
const Et = 150, zt = (d, n) => {
|
|
10
|
+
const s = Ut({
|
|
11
11
|
queryKey: ["waitIntentReceipt", d],
|
|
12
12
|
queryFn: async () => {
|
|
13
13
|
if (!d)
|
|
@@ -25,14 +25,14 @@ const At = 150, zt = (d, n) => {
|
|
|
25
25
|
enabled: !!d,
|
|
26
26
|
refetchIntervalInBackground: !0,
|
|
27
27
|
refetchInterval: (a) => {
|
|
28
|
-
const
|
|
29
|
-
return
|
|
28
|
+
const i = a.state.data;
|
|
29
|
+
return i && i.done ? (o.console.log(
|
|
30
30
|
`[trails-sdk] ✅ Intent monitoring complete for ${d}`
|
|
31
|
-
), !1) :
|
|
31
|
+
), !1) : Et;
|
|
32
32
|
},
|
|
33
|
-
retry: (a,
|
|
33
|
+
retry: (a, i) => a >= 30 ? (o.console.error(
|
|
34
34
|
`[trails-sdk] ❌ Giving up on intent ${d} after 30 failed API attempts:`,
|
|
35
|
-
|
|
35
|
+
i
|
|
36
36
|
), !1) : !0
|
|
37
37
|
});
|
|
38
38
|
return {
|
|
@@ -43,9 +43,9 @@ const At = 150, zt = (d, n) => {
|
|
|
43
43
|
error: s.error
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
-
function
|
|
47
|
-
const d =
|
|
48
|
-
return
|
|
46
|
+
function Rt() {
|
|
47
|
+
const d = gt();
|
|
48
|
+
return kt({
|
|
49
49
|
mutationFn: async (n) => {
|
|
50
50
|
o.console.log("[trails-sdk] useCommitIntent: Starting commit", {
|
|
51
51
|
intentId: n.intentId,
|
|
@@ -53,40 +53,40 @@ function Pt() {
|
|
|
53
53
|
});
|
|
54
54
|
const s = n.quoteRequest.originChainId.toString(), a = n.quoteRequest.destinationChainId.toString();
|
|
55
55
|
try {
|
|
56
|
-
|
|
56
|
+
Ot({
|
|
57
57
|
intentAddress: n.originIntentAddress,
|
|
58
58
|
userAddress: n.ownerAddress,
|
|
59
59
|
originChainId: s ? Number(s) : void 0,
|
|
60
60
|
destinationChainId: a ? Number(a) : void 0
|
|
61
61
|
});
|
|
62
|
-
const
|
|
62
|
+
const i = await d.commitIntent({
|
|
63
63
|
intent: n,
|
|
64
|
-
trailsContracts:
|
|
64
|
+
trailsContracts: Ht
|
|
65
65
|
});
|
|
66
66
|
return o.console.log("[trails-sdk] useCommitIntent: Commit successful", {
|
|
67
67
|
intentId: n.intentId,
|
|
68
|
-
response:
|
|
68
|
+
response: i
|
|
69
69
|
}), Lt({
|
|
70
70
|
intentAddress: n.originIntentAddress,
|
|
71
71
|
userAddress: n.ownerAddress,
|
|
72
72
|
originChainId: s ? Number(s) : void 0,
|
|
73
73
|
destinationChainId: a ? Number(a) : void 0
|
|
74
|
-
}),
|
|
75
|
-
} catch (
|
|
76
|
-
throw
|
|
77
|
-
error:
|
|
74
|
+
}), i;
|
|
75
|
+
} catch (i) {
|
|
76
|
+
throw bt({
|
|
77
|
+
error: M(i),
|
|
78
78
|
userAddress: n.ownerAddress,
|
|
79
79
|
intentAddress: n.originIntentAddress,
|
|
80
80
|
originChainId: s ? Number(s) : void 0,
|
|
81
81
|
destinationChainId: a ? Number(a) : void 0
|
|
82
|
-
}),
|
|
82
|
+
}), i;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const d =
|
|
89
|
-
return
|
|
87
|
+
function vt() {
|
|
88
|
+
const d = gt();
|
|
89
|
+
return kt({
|
|
90
90
|
mutationFn: async ({
|
|
91
91
|
intentId: n,
|
|
92
92
|
depositTransactionHash: s,
|
|
@@ -100,9 +100,9 @@ function Rt() {
|
|
|
100
100
|
throw new Error(
|
|
101
101
|
"[trails-sdk] Either depositTransactionHash or depositSignature must be provided"
|
|
102
102
|
);
|
|
103
|
-
let
|
|
103
|
+
let i;
|
|
104
104
|
try {
|
|
105
|
-
|
|
105
|
+
i = await d.executeIntent({
|
|
106
106
|
intentId: n,
|
|
107
107
|
depositTransactionHash: s,
|
|
108
108
|
depositSignature: a
|
|
@@ -115,7 +115,7 @@ function Rt() {
|
|
|
115
115
|
error: T,
|
|
116
116
|
errorJSON: JSON.stringify(T, null, 2)
|
|
117
117
|
}
|
|
118
|
-
), T instanceof Error && T?.message?.includes("status=SUCCEEDED") || T instanceof Error && T?.cause?.message?.includes("status=SUCCEEDED") || T instanceof Error && JSON.stringify(T).includes("status=SUCCEEDED") || T instanceof
|
|
118
|
+
), T instanceof Error && T?.message?.includes("status=SUCCEEDED") || T instanceof Error && T?.cause?.message?.includes("status=SUCCEEDED") || T instanceof Error && JSON.stringify(T).includes("status=SUCCEEDED") || T instanceof qt && T?.cause?.toString().includes("status=SUCCEEDED") || JSON.stringify(T).includes("status=SUCCEEDED"))
|
|
119
119
|
return o.console.error(
|
|
120
120
|
"[trails-sdk] useExecuteIntent: Intent already succeeded, treating as success",
|
|
121
121
|
{ intentId: n }
|
|
@@ -136,9 +136,9 @@ function Rt() {
|
|
|
136
136
|
"[trails-sdk] useExecuteIntent: Execution successful",
|
|
137
137
|
{
|
|
138
138
|
intentId: n,
|
|
139
|
-
response:
|
|
139
|
+
response: i
|
|
140
140
|
}
|
|
141
|
-
),
|
|
141
|
+
), i;
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
}
|
|
@@ -147,129 +147,131 @@ function Vt({
|
|
|
147
147
|
fromTokenAddress: n,
|
|
148
148
|
fromChainId: s,
|
|
149
149
|
toTokenAddress: a,
|
|
150
|
-
toChainId:
|
|
150
|
+
toChainId: i,
|
|
151
151
|
swapAmount: T,
|
|
152
|
-
tradeType:
|
|
153
|
-
toRecipient:
|
|
154
|
-
toCalldata:
|
|
155
|
-
slippageTolerance:
|
|
156
|
-
onStatusUpdate:
|
|
157
|
-
checkoutOnHandlers:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
152
|
+
tradeType: nt,
|
|
153
|
+
toRecipient: O,
|
|
154
|
+
toCalldata: ot,
|
|
155
|
+
slippageTolerance: X,
|
|
156
|
+
onStatusUpdate: z,
|
|
157
|
+
checkoutOnHandlers: V,
|
|
158
|
+
swapProvider: Q,
|
|
159
|
+
bridgeProvider: H,
|
|
160
|
+
paymasterUrl: mt,
|
|
161
|
+
selectedFeeOption: st,
|
|
162
|
+
nodeGatewayEnv: rt,
|
|
163
|
+
abortSignal: W,
|
|
164
|
+
apiKey: L,
|
|
165
|
+
isSmartWallet: at
|
|
165
166
|
} = {}) {
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
const
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
}),
|
|
172
|
-
|
|
173
|
-
}),
|
|
174
|
-
})() :
|
|
175
|
-
apiKey:
|
|
176
|
-
hostname:
|
|
177
|
-
}),
|
|
167
|
+
rt && (globalThis.__testNodeGatewayEnv = rt);
|
|
168
|
+
const R = Pt(new AbortController()), it = W ? (() => {
|
|
169
|
+
const g = new AbortController();
|
|
170
|
+
return W.addEventListener("abort", () => {
|
|
171
|
+
g.abort(), R.current?.abort();
|
|
172
|
+
}), R.current?.signal.addEventListener("abort", () => {
|
|
173
|
+
g.abort();
|
|
174
|
+
}), g.signal;
|
|
175
|
+
})() : R.current.signal, { trailsApiKey: C, trailsApiUrl: Y, sequenceIndexerUrl: A } = pt(), Z = C, b = gt({
|
|
176
|
+
apiKey: C,
|
|
177
|
+
hostname: Y
|
|
178
|
+
}), _ = xt(), t = Ct(s ?? void 0), r = Ct(i ?? void 0), { supportedTokens: u } = yt(), k = Rt(), m = vt(), { data: E, isLoading: P, error: w, refetch: I } = Ut({
|
|
178
179
|
queryKey: [
|
|
179
180
|
"prepareSend",
|
|
180
181
|
n,
|
|
181
182
|
s,
|
|
182
183
|
a,
|
|
183
|
-
|
|
184
|
+
i,
|
|
184
185
|
T?.toString(),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
186
|
+
O,
|
|
187
|
+
ot,
|
|
188
|
+
nt,
|
|
189
|
+
X,
|
|
190
|
+
Q,
|
|
191
|
+
H,
|
|
192
|
+
L,
|
|
193
|
+
at
|
|
192
194
|
],
|
|
193
195
|
queryFn: async () => {
|
|
194
196
|
try {
|
|
195
|
-
if (
|
|
197
|
+
if (R.current.signal.aborted && (o.console.log(
|
|
196
198
|
"[trails-sdk] Resetting aborted controller for new query"
|
|
197
|
-
),
|
|
199
|
+
), R.current = new AbortController()), !d || !b || !n || !a || !T || !O || !s || !i || !_)
|
|
198
200
|
return null;
|
|
199
|
-
let
|
|
201
|
+
let g = [];
|
|
200
202
|
try {
|
|
201
|
-
|
|
203
|
+
g = (await It({
|
|
202
204
|
account: d.account.address,
|
|
203
|
-
indexerGatewayClient:
|
|
204
|
-
trailsClient:
|
|
205
|
+
indexerGatewayClient: _,
|
|
206
|
+
trailsClient: b
|
|
205
207
|
})).balances;
|
|
206
|
-
} catch (
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
208
|
+
} catch (l) {
|
|
209
|
+
const f = M(l), D = f.includes("Cross-Origin") || f.includes("CORS") || f.includes("Same Origin Policy"), j = f.includes("fetch failed") || f.includes("network");
|
|
210
|
+
if (D || j)
|
|
209
211
|
o.console.warn(
|
|
210
212
|
"[trails-sdk] [useQuote] Network or CORS error fetching balances, proceeding with quote using zero balance:",
|
|
211
213
|
{
|
|
212
|
-
error:
|
|
214
|
+
error: f,
|
|
213
215
|
account: d.account.address
|
|
214
216
|
}
|
|
215
|
-
),
|
|
217
|
+
), g = [];
|
|
216
218
|
else
|
|
217
|
-
throw
|
|
219
|
+
throw l;
|
|
218
220
|
}
|
|
219
|
-
const
|
|
220
|
-
(
|
|
221
|
+
const y = g.find(
|
|
222
|
+
(l) => l.chainId === s && (l.contractAddress?.toLowerCase() === n.toLowerCase() || !l.contractAddress && n === x)
|
|
221
223
|
)?.balance ?? "0";
|
|
222
|
-
let
|
|
224
|
+
let v = 0;
|
|
223
225
|
try {
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
tokenSymbol:
|
|
227
|
-
tokenAddress:
|
|
226
|
+
const f = ut(s)?.nativeCurrency?.symbol ?? "";
|
|
227
|
+
f && (v = (await St(b, {
|
|
228
|
+
tokenSymbol: f,
|
|
229
|
+
tokenAddress: x,
|
|
228
230
|
chainId: s
|
|
229
231
|
}))?.priceUsd ?? 0, o.console.log(
|
|
230
232
|
"[trails-sdk] [useQuote] Origin native token price:",
|
|
231
233
|
{
|
|
232
234
|
chainId: s,
|
|
233
|
-
symbol:
|
|
234
|
-
priceUsd:
|
|
235
|
+
symbol: f,
|
|
236
|
+
priceUsd: v
|
|
235
237
|
}
|
|
236
238
|
));
|
|
237
|
-
} catch (
|
|
239
|
+
} catch (l) {
|
|
238
240
|
o.console.error(
|
|
239
241
|
"[trails-sdk] [useQuote] Error getting origin native token price:",
|
|
240
|
-
|
|
242
|
+
l
|
|
241
243
|
);
|
|
242
244
|
}
|
|
243
|
-
const
|
|
245
|
+
const U = async (l, f) => {
|
|
244
246
|
try {
|
|
245
|
-
const
|
|
246
|
-
if (!
|
|
247
|
+
const D = f === s ? t : f === i ? r : null;
|
|
248
|
+
if (!D)
|
|
247
249
|
return o.console.warn(
|
|
248
|
-
`[trails-sdk] No RPC client available for chain ${
|
|
250
|
+
`[trails-sdk] No RPC client available for chain ${f}`
|
|
249
251
|
), null;
|
|
250
|
-
if (
|
|
251
|
-
return
|
|
252
|
-
const
|
|
253
|
-
address:
|
|
252
|
+
if (l.toLowerCase() === x.toLowerCase())
|
|
253
|
+
return ut(f)?.nativeCurrency.decimals ?? 18;
|
|
254
|
+
const j = await D.readContract({
|
|
255
|
+
address: l,
|
|
254
256
|
abi: Dt,
|
|
255
257
|
functionName: "decimals"
|
|
256
258
|
});
|
|
257
259
|
return o.console.log(
|
|
258
|
-
`[trails-sdk] Fetched decimals on-chain for token ${
|
|
259
|
-
),
|
|
260
|
-
} catch (
|
|
260
|
+
`[trails-sdk] Fetched decimals on-chain for token ${l} on chain ${f}: ${j}`
|
|
261
|
+
), j;
|
|
262
|
+
} catch (D) {
|
|
261
263
|
return o.console.error(
|
|
262
|
-
`[trails-sdk] Error fetching decimals on-chain for token ${
|
|
263
|
-
|
|
264
|
+
`[trails-sdk] Error fetching decimals on-chain for token ${l} on chain ${f}:`,
|
|
265
|
+
D
|
|
264
266
|
), null;
|
|
265
267
|
}
|
|
266
|
-
}, S =
|
|
267
|
-
(
|
|
268
|
-
),
|
|
269
|
-
(
|
|
268
|
+
}, S = u?.find(
|
|
269
|
+
(l) => l.contractAddress?.toLowerCase() === n?.toLowerCase() && l.chainId === s
|
|
270
|
+
), q = u?.find(
|
|
271
|
+
(l) => l.contractAddress?.toLowerCase() === a?.toLowerCase() && l.chainId === i
|
|
270
272
|
);
|
|
271
|
-
let
|
|
272
|
-
if (!
|
|
273
|
+
let N = S?.decimals;
|
|
274
|
+
if (!N && n && s) {
|
|
273
275
|
o.console.warn(
|
|
274
276
|
"[trails-sdk] [useQuote] Source token decimals not found in token list, fetching on-chain:",
|
|
275
277
|
{
|
|
@@ -278,13 +280,13 @@ function Vt({
|
|
|
278
280
|
fromChainId: s
|
|
279
281
|
}
|
|
280
282
|
);
|
|
281
|
-
const
|
|
283
|
+
const l = await U(
|
|
282
284
|
n,
|
|
283
285
|
s
|
|
284
286
|
);
|
|
285
|
-
|
|
287
|
+
l !== null && (N = l);
|
|
286
288
|
}
|
|
287
|
-
if (!
|
|
289
|
+
if (!N)
|
|
288
290
|
throw o.console.error(
|
|
289
291
|
"[trails-sdk] [useQuote] Source token decimals not found:",
|
|
290
292
|
{
|
|
@@ -293,143 +295,144 @@ function Vt({
|
|
|
293
295
|
fromChainId: s
|
|
294
296
|
}
|
|
295
297
|
), new Error("Source token decimals not found");
|
|
296
|
-
let
|
|
297
|
-
if (!
|
|
298
|
+
let B = q?.decimals;
|
|
299
|
+
if (!B && a && i) {
|
|
298
300
|
o.console.warn(
|
|
299
301
|
"[trails-sdk] Destination token decimals not found in token list, fetching on-chain:",
|
|
300
302
|
{
|
|
301
|
-
destinationToken:
|
|
303
|
+
destinationToken: q,
|
|
302
304
|
toTokenAddress: a,
|
|
303
|
-
toChainId:
|
|
305
|
+
toChainId: i
|
|
304
306
|
}
|
|
305
307
|
);
|
|
306
|
-
const
|
|
308
|
+
const l = await U(
|
|
307
309
|
a,
|
|
308
|
-
|
|
310
|
+
i
|
|
309
311
|
);
|
|
310
|
-
|
|
312
|
+
l !== null && (B = l);
|
|
311
313
|
}
|
|
312
|
-
if (!
|
|
314
|
+
if (!B)
|
|
313
315
|
throw o.console.error(
|
|
314
316
|
"[trails-sdk] Destination token decimals not found:",
|
|
315
317
|
{
|
|
316
|
-
destinationToken:
|
|
318
|
+
destinationToken: q,
|
|
317
319
|
toTokenAddress: a,
|
|
318
|
-
toChainId:
|
|
320
|
+
toChainId: i
|
|
319
321
|
}
|
|
320
322
|
), new Error("Destination token decimals not found");
|
|
321
|
-
const
|
|
323
|
+
const ct = q?.symbol ?? "", tt = S?.symbol ?? "", et = {
|
|
322
324
|
account: d.account,
|
|
323
325
|
originTokenAddress: n,
|
|
324
326
|
originChainId: s,
|
|
325
|
-
originTokenBalance:
|
|
326
|
-
destinationChainId:
|
|
327
|
-
recipient:
|
|
327
|
+
originTokenBalance: y,
|
|
328
|
+
destinationChainId: i,
|
|
329
|
+
recipient: O,
|
|
328
330
|
destinationTokenAddress: a,
|
|
329
331
|
swapAmount: T.toString(),
|
|
330
|
-
tradeType:
|
|
331
|
-
originTokenSymbol:
|
|
332
|
-
destinationTokenSymbol:
|
|
333
|
-
destinationCalldata:
|
|
332
|
+
tradeType: nt ?? K.EXACT_OUTPUT,
|
|
333
|
+
originTokenSymbol: tt,
|
|
334
|
+
destinationTokenSymbol: ct,
|
|
335
|
+
destinationCalldata: ot,
|
|
334
336
|
client: d,
|
|
335
|
-
trailsClient:
|
|
336
|
-
sourceTokenDecimals:
|
|
337
|
-
destinationTokenDecimals:
|
|
337
|
+
trailsClient: b,
|
|
338
|
+
sourceTokenDecimals: N,
|
|
339
|
+
destinationTokenDecimals: B,
|
|
338
340
|
fee: "0",
|
|
339
341
|
dryMode: !1,
|
|
340
|
-
onTransactionStateChange:
|
|
342
|
+
onTransactionStateChange: z ?? (() => {
|
|
341
343
|
}),
|
|
342
|
-
slippageTolerance:
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
344
|
+
slippageTolerance: X?.toString(),
|
|
345
|
+
swapProvider: Q,
|
|
346
|
+
bridgeProvider: H,
|
|
347
|
+
paymasterUrl: mt,
|
|
348
|
+
selectedFeeOption: st ?? null,
|
|
349
|
+
abortSignal: it,
|
|
350
|
+
originNativeTokenPriceUsd: v,
|
|
351
|
+
commitIntentFn: k.mutateAsync,
|
|
352
|
+
executeIntentFn: m.mutateAsync,
|
|
353
|
+
checkoutOnHandlers: V,
|
|
354
|
+
sequenceIndexerUrl: A,
|
|
355
|
+
sequenceProjectAccessKey: Z,
|
|
356
|
+
originPublicClient: t ?? void 0,
|
|
357
|
+
destinationPublicClient: r ?? void 0,
|
|
358
|
+
isSmartWallet: at ?? void 0,
|
|
359
|
+
trailsApiKey: C,
|
|
360
|
+
trailsApiUrl: Y
|
|
358
361
|
};
|
|
359
|
-
o.console.log("[trails-sdk] options",
|
|
360
|
-
const { quote:
|
|
362
|
+
o.console.log("[trails-sdk] options", et);
|
|
363
|
+
const { quote: c, send: lt } = await wt(et);
|
|
361
364
|
return {
|
|
362
365
|
quote: {
|
|
363
|
-
fromAmount:
|
|
364
|
-
toAmount:
|
|
365
|
-
fromAmountMin:
|
|
366
|
-
toAmountMin:
|
|
367
|
-
originToken:
|
|
368
|
-
destinationToken:
|
|
369
|
-
originChain:
|
|
370
|
-
destinationChain:
|
|
371
|
-
fees:
|
|
372
|
-
priceImpact:
|
|
373
|
-
priceImpactUsd:
|
|
374
|
-
priceImpactUsdDisplay:
|
|
375
|
-
completionEstimateSeconds:
|
|
376
|
-
slippageTolerance:
|
|
377
|
-
transactionStates:
|
|
378
|
-
originTokenRate:
|
|
379
|
-
destinationTokenRate:
|
|
380
|
-
|
|
381
|
-
fromAmountUsdDisplay:
|
|
382
|
-
toAmountUsdDisplay:
|
|
383
|
-
gasCostUsd:
|
|
384
|
-
gasCostUsdDisplay:
|
|
385
|
-
gasCost:
|
|
386
|
-
gasCostFormatted:
|
|
387
|
-
totalFeesUsd:
|
|
388
|
-
totalFeesUsdDisplay:
|
|
389
|
-
totalGasUsd:
|
|
390
|
-
totalGasUsdDisplay:
|
|
391
|
-
allProviderFeesUsd:
|
|
392
|
-
allProviderFeesUsdDisplay:
|
|
366
|
+
fromAmount: c.originAmount,
|
|
367
|
+
toAmount: c.destinationAmount,
|
|
368
|
+
fromAmountMin: c.originAmountMin,
|
|
369
|
+
toAmountMin: c.destinationAmountMin,
|
|
370
|
+
originToken: c.originToken,
|
|
371
|
+
destinationToken: c.destinationToken,
|
|
372
|
+
originChain: c.originChain,
|
|
373
|
+
destinationChain: c.destinationChain,
|
|
374
|
+
fees: c.fees,
|
|
375
|
+
priceImpact: c.priceImpact,
|
|
376
|
+
priceImpactUsd: c.priceImpactUsd ?? void 0,
|
|
377
|
+
priceImpactUsdDisplay: c.priceImpactUsdDisplay ?? void 0,
|
|
378
|
+
completionEstimateSeconds: c.completionEstimateSeconds,
|
|
379
|
+
slippageTolerance: c.slippageTolerance,
|
|
380
|
+
transactionStates: c.transactionStates,
|
|
381
|
+
originTokenRate: c.originTokenRate,
|
|
382
|
+
destinationTokenRate: c.destinationTokenRate,
|
|
383
|
+
routeProviders: c.routeProviders,
|
|
384
|
+
fromAmountUsdDisplay: c.originAmountUsdDisplay ?? void 0,
|
|
385
|
+
toAmountUsdDisplay: c.destinationAmountUsdDisplay ?? void 0,
|
|
386
|
+
gasCostUsd: c.gasCostUsd ?? void 0,
|
|
387
|
+
gasCostUsdDisplay: c.gasCostUsdDisplay ?? void 0,
|
|
388
|
+
gasCost: c.gasCost ?? void 0,
|
|
389
|
+
gasCostFormatted: c.gasCostFormatted ?? void 0,
|
|
390
|
+
totalFeesUsd: c.grandTotalUsd ?? void 0,
|
|
391
|
+
totalFeesUsdDisplay: c.grandTotalUsdDisplay ?? void 0,
|
|
392
|
+
totalGasUsd: c.totalGasUsd ?? void 0,
|
|
393
|
+
totalGasUsdDisplay: c.totalGasUsdDisplay ?? void 0,
|
|
394
|
+
allProviderFeesUsd: c.allProviderFeesUsd ?? void 0,
|
|
395
|
+
allProviderFeesUsdDisplay: c.allProviderFeesUsdDisplay ?? void 0
|
|
393
396
|
},
|
|
394
397
|
swap: async () => {
|
|
395
398
|
const {
|
|
396
|
-
depositUserTxnReceipt:
|
|
397
|
-
destinationIntentTransaction:
|
|
398
|
-
totalCompletionSeconds:
|
|
399
|
-
} = await
|
|
400
|
-
selectedFeeOption:
|
|
399
|
+
depositUserTxnReceipt: l,
|
|
400
|
+
destinationIntentTransaction: f,
|
|
401
|
+
totalCompletionSeconds: D
|
|
402
|
+
} = await lt({
|
|
403
|
+
selectedFeeOption: st ?? null
|
|
401
404
|
});
|
|
402
405
|
return {
|
|
403
406
|
originTransaction: {
|
|
404
|
-
transactionHash:
|
|
405
|
-
explorerUrl:
|
|
406
|
-
txHash:
|
|
407
|
+
transactionHash: l?.transactionHash,
|
|
408
|
+
explorerUrl: J({
|
|
409
|
+
txHash: l?.transactionHash,
|
|
407
410
|
chainId: s
|
|
408
411
|
}),
|
|
409
|
-
receipt:
|
|
412
|
+
receipt: l
|
|
410
413
|
},
|
|
411
414
|
destinationTransaction: {
|
|
412
|
-
transactionHash:
|
|
413
|
-
explorerUrl:
|
|
414
|
-
txHash:
|
|
415
|
-
chainId:
|
|
415
|
+
transactionHash: f?.txnHash,
|
|
416
|
+
explorerUrl: J({
|
|
417
|
+
txHash: f?.txnHash,
|
|
418
|
+
chainId: i
|
|
416
419
|
}),
|
|
417
|
-
receipt:
|
|
420
|
+
receipt: f
|
|
418
421
|
},
|
|
419
|
-
totalCompletionSeconds:
|
|
422
|
+
totalCompletionSeconds: D
|
|
420
423
|
};
|
|
421
424
|
}
|
|
422
425
|
};
|
|
423
|
-
} catch (
|
|
426
|
+
} catch (g) {
|
|
424
427
|
throw o.console.error(
|
|
425
428
|
"[trails-sdk] [useQuote] Error getting quote:",
|
|
426
|
-
|
|
427
|
-
),
|
|
429
|
+
g
|
|
430
|
+
), M(g);
|
|
428
431
|
}
|
|
429
432
|
},
|
|
430
433
|
// Prevent unnecessary refetching
|
|
431
|
-
enabled: !!(d &&
|
|
432
|
-
|
|
434
|
+
enabled: !!(d && b && n && a && T && O && s && i && _ && // !isLoadingTokens &&
|
|
435
|
+
u && u.length > 0),
|
|
433
436
|
staleTime: 30 * 1e3,
|
|
434
437
|
// Consider data fresh for 30 seconds
|
|
435
438
|
refetchOnWindowFocus: !1,
|
|
@@ -444,17 +447,17 @@ function Vt({
|
|
|
444
447
|
// Refetch when network reconnects
|
|
445
448
|
});
|
|
446
449
|
return {
|
|
447
|
-
quote:
|
|
448
|
-
swap:
|
|
449
|
-
isLoadingQuote:
|
|
450
|
-
quoteError:
|
|
451
|
-
quoteErrorPrettified: Nt(
|
|
452
|
-
refetchQuote: () =>
|
|
450
|
+
quote: E?.quote || null,
|
|
451
|
+
swap: E?.swap || null,
|
|
452
|
+
isLoadingQuote: P,
|
|
453
|
+
quoteError: w,
|
|
454
|
+
quoteErrorPrettified: Nt(w),
|
|
455
|
+
refetchQuote: () => I(),
|
|
453
456
|
abort: () => {
|
|
454
457
|
o.console.log("[trails-sdk] useQuote abort() called"), o.console.log(
|
|
455
458
|
"[trails-sdk] Active operations before abort:",
|
|
456
459
|
ft.getAll()
|
|
457
|
-
),
|
|
460
|
+
), R.current.abort(), ft.abortAll(), o.console.log(
|
|
458
461
|
"[trails-sdk] Abort completed, active operations:",
|
|
459
462
|
ft.getAll()
|
|
460
463
|
);
|
|
@@ -462,20 +465,20 @@ function Vt({
|
|
|
462
465
|
};
|
|
463
466
|
}
|
|
464
467
|
function Yt(d) {
|
|
465
|
-
const { data: n } = Ft(), { chainId: s } = Mt(), a = Qt(),
|
|
466
|
-
openModal:
|
|
467
|
-
setPendingSelection:
|
|
468
|
-
setHostTransactionState:
|
|
469
|
-
setHostTransactionQuote:
|
|
470
|
-
setHostTransactionStates:
|
|
471
|
-
setHostTransactionTimestamp:
|
|
472
|
-
hostTransactionState:
|
|
473
|
-
setReceiptActionButtonText:
|
|
474
|
-
setOnReceiptAction:
|
|
475
|
-
retryTransactionRef:
|
|
476
|
-
} = Bt(),
|
|
468
|
+
const { data: n } = Ft(), { chainId: s } = Mt(), a = Qt(), i = gt(), { trailsApiKey: T, sequenceIndexerUrl: nt } = pt(), {
|
|
469
|
+
openModal: O,
|
|
470
|
+
setPendingSelection: ot,
|
|
471
|
+
setHostTransactionState: X,
|
|
472
|
+
setHostTransactionQuote: z,
|
|
473
|
+
setHostTransactionStates: V,
|
|
474
|
+
setHostTransactionTimestamp: Q,
|
|
475
|
+
hostTransactionState: H,
|
|
476
|
+
setReceiptActionButtonText: mt,
|
|
477
|
+
setOnReceiptAction: st,
|
|
478
|
+
retryTransactionRef: rt
|
|
479
|
+
} = Bt(), W = xt(), { supportedTokens: L } = yt(), at = Rt(), R = vt(), it = Pt(null), C = dt(
|
|
477
480
|
(t) => {
|
|
478
|
-
|
|
481
|
+
X((r) => ({
|
|
479
482
|
status: t.status ?? r.status,
|
|
480
483
|
details: t.details === null ? void 0 : t.details ? { ...r.details, ...t.details } : r.details,
|
|
481
484
|
error: t.error === null ? void 0 : t.error !== void 0 ? t.error : r.error,
|
|
@@ -483,8 +486,8 @@ function Yt(d) {
|
|
|
483
486
|
retryEnabled: t.retryEnabled !== void 0 ? t.retryEnabled : r.retryEnabled
|
|
484
487
|
}));
|
|
485
488
|
},
|
|
486
|
-
[
|
|
487
|
-
),
|
|
489
|
+
[X]
|
|
490
|
+
), Y = async (t, r, u) => {
|
|
488
491
|
if (o.console.log(
|
|
489
492
|
"[trails-sdk] [useTrailsSendTransaction] Executing transaction",
|
|
490
493
|
{ variables: t, originSelection: r }
|
|
@@ -494,63 +497,63 @@ function Yt(d) {
|
|
|
494
497
|
);
|
|
495
498
|
if (!t.to)
|
|
496
499
|
throw new Error("Transaction 'to' address is required.");
|
|
497
|
-
let k,
|
|
500
|
+
let k, m, E;
|
|
498
501
|
if (r)
|
|
499
|
-
k = r.fromTokenAddress,
|
|
502
|
+
k = r.fromTokenAddress, m = r.fromChainId, E = r.fromAmount;
|
|
500
503
|
else if (t.fromTokenAddress && t.fromChainId && t.fromAmount)
|
|
501
|
-
k = t.fromTokenAddress,
|
|
504
|
+
k = t.fromTokenAddress, m = t.fromChainId, E = t.fromAmount;
|
|
502
505
|
else if (t.to && t.value !== void 0) {
|
|
503
506
|
const e = s || a;
|
|
504
507
|
if (!e)
|
|
505
508
|
throw new Error("Chain ID not available. Please connect your wallet.");
|
|
506
|
-
|
|
509
|
+
m = e, k = x, E = t.value.toString();
|
|
507
510
|
} else
|
|
508
511
|
throw new Error(
|
|
509
512
|
"Origin token parameters are required. Please provide 'value' (native token), or 'fromTokenAddress'/'fromChainId'/'fromAmount' (ERC20 token), or select via modal."
|
|
510
513
|
);
|
|
511
|
-
const
|
|
512
|
-
if (!
|
|
514
|
+
const P = s || a;
|
|
515
|
+
if (!P)
|
|
513
516
|
throw new Error("Chain ID not available. Please connect your wallet.");
|
|
514
|
-
let
|
|
517
|
+
let w, I, g, p;
|
|
515
518
|
if (t.tokenAddress && t.tokenAmount)
|
|
516
|
-
|
|
519
|
+
w = t.tokenAddress, I = L?.find(
|
|
517
520
|
(h) => h.contractAddress?.toLowerCase() === t.tokenAddress?.toLowerCase()
|
|
518
|
-
)?.chainId ??
|
|
521
|
+
)?.chainId ?? P, g = t.tokenAmount, p = t.to;
|
|
519
522
|
else if (t.to && t.value !== void 0)
|
|
520
|
-
|
|
523
|
+
w = x, I = P, g = t.value.toString(), p = t.to;
|
|
521
524
|
else
|
|
522
525
|
throw new Error(
|
|
523
526
|
"Either 'value' or 'tokenAddress'/'tokenAmount' must be provided."
|
|
524
527
|
);
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
528
|
+
const y = t.tokenAddress && t.tokenAmount ? K.EXACT_OUTPUT : K.EXACT_INPUT;
|
|
529
|
+
if (y === K.EXACT_INPUT && !E)
|
|
527
530
|
throw new Error(
|
|
528
531
|
"Origin amount is required for this transaction. Please provide 'value' or 'fromAmount'."
|
|
529
532
|
);
|
|
530
|
-
const
|
|
531
|
-
let
|
|
533
|
+
const v = y === K.EXACT_OUTPUT ? g : E;
|
|
534
|
+
let U = [];
|
|
532
535
|
try {
|
|
533
|
-
|
|
536
|
+
U = (await It({
|
|
534
537
|
account: n.account.address,
|
|
535
|
-
indexerGatewayClient:
|
|
536
|
-
trailsClient:
|
|
538
|
+
indexerGatewayClient: W,
|
|
539
|
+
trailsClient: i
|
|
537
540
|
})).balances;
|
|
538
541
|
} catch (e) {
|
|
539
542
|
o.console.warn(
|
|
540
543
|
"[trails-sdk] [useTrailsSendTransaction] Error fetching balances, proceeding with zero balance",
|
|
541
544
|
e
|
|
542
|
-
),
|
|
545
|
+
), U = [];
|
|
543
546
|
}
|
|
544
|
-
const q =
|
|
545
|
-
(e) => e.chainId ===
|
|
547
|
+
const q = U.find(
|
|
548
|
+
(e) => e.chainId === m && (e.contractAddress?.toLowerCase() === k?.toLowerCase() || !e.contractAddress && k === x)
|
|
546
549
|
)?.balance ?? "0";
|
|
547
|
-
let
|
|
550
|
+
let N = 0;
|
|
548
551
|
try {
|
|
549
|
-
const h =
|
|
550
|
-
h && (
|
|
552
|
+
const h = ut(m)?.nativeCurrency?.symbol ?? "";
|
|
553
|
+
h && (N = (await St(i, {
|
|
551
554
|
tokenSymbol: h,
|
|
552
|
-
tokenAddress:
|
|
553
|
-
chainId:
|
|
555
|
+
tokenAddress: x,
|
|
556
|
+
chainId: m
|
|
554
557
|
}))?.priceUsd ?? 0);
|
|
555
558
|
} catch (e) {
|
|
556
559
|
o.console.warn(
|
|
@@ -558,275 +561,276 @@ function Yt(d) {
|
|
|
558
561
|
e
|
|
559
562
|
);
|
|
560
563
|
}
|
|
561
|
-
const
|
|
562
|
-
(e) => e.contractAddress?.toLowerCase() === k?.toLowerCase() && e.chainId ===
|
|
563
|
-
),
|
|
564
|
-
(e) => e.contractAddress?.toLowerCase() ===
|
|
565
|
-
), { getChainRpcClient:
|
|
564
|
+
const B = L?.find(
|
|
565
|
+
(e) => e.contractAddress?.toLowerCase() === k?.toLowerCase() && e.chainId === m
|
|
566
|
+
), ct = L?.find(
|
|
567
|
+
(e) => e.contractAddress?.toLowerCase() === w?.toLowerCase() && e.chainId === I
|
|
568
|
+
), { getChainRpcClient: tt } = await import("./index-BiPwqVkZ.js").then((e) => e.a_), et = tt(m), c = tt(I), lt = async (e, h) => {
|
|
566
569
|
try {
|
|
567
|
-
const
|
|
568
|
-
return
|
|
570
|
+
const F = h === m ? et : h === I ? c : tt(h);
|
|
571
|
+
return F ? e.toLowerCase() === x.toLowerCase() ? ut(h)?.nativeCurrency.decimals ?? 18 : await F.readContract({
|
|
569
572
|
address: e,
|
|
570
573
|
abi: Dt,
|
|
571
574
|
functionName: "decimals"
|
|
572
575
|
}) : null;
|
|
573
|
-
} catch (
|
|
576
|
+
} catch (F) {
|
|
574
577
|
return o.console.error(
|
|
575
578
|
`[trails-sdk] Error fetching decimals on-chain for token ${e} on chain ${h}:`,
|
|
576
|
-
|
|
579
|
+
F
|
|
577
580
|
), null;
|
|
578
581
|
}
|
|
579
582
|
};
|
|
580
|
-
let $ =
|
|
583
|
+
let $ = B?.decimals;
|
|
581
584
|
if (!$ && k) {
|
|
582
|
-
const e = await
|
|
585
|
+
const e = await lt(
|
|
583
586
|
k,
|
|
584
|
-
|
|
587
|
+
m
|
|
585
588
|
);
|
|
586
589
|
e !== null && ($ = e);
|
|
587
590
|
}
|
|
588
591
|
$ || ($ = 18);
|
|
589
|
-
let
|
|
590
|
-
if (!
|
|
591
|
-
const e = await
|
|
592
|
-
|
|
593
|
-
|
|
592
|
+
let G = ct?.decimals;
|
|
593
|
+
if (!G && w) {
|
|
594
|
+
const e = await lt(
|
|
595
|
+
w,
|
|
596
|
+
I
|
|
594
597
|
);
|
|
595
|
-
e !== null && (
|
|
598
|
+
e !== null && (G = e);
|
|
596
599
|
}
|
|
597
|
-
|
|
598
|
-
const
|
|
599
|
-
u?.trackInWidget &&
|
|
600
|
-
}, { send:
|
|
600
|
+
G || (G = 18);
|
|
601
|
+
const l = ct?.symbol ?? "", f = B?.symbol ?? "", D = (e) => {
|
|
602
|
+
u?.trackInWidget && V(e), d?.onStatusUpdate?.(e);
|
|
603
|
+
}, { send: j, quote: ht } = await wt({
|
|
601
604
|
account: n.account,
|
|
602
605
|
originTokenAddress: k,
|
|
603
|
-
originChainId:
|
|
606
|
+
originChainId: m,
|
|
604
607
|
originTokenBalance: q,
|
|
605
|
-
destinationChainId:
|
|
606
|
-
recipient:
|
|
607
|
-
destinationTokenAddress:
|
|
608
|
-
swapAmount:
|
|
609
|
-
tradeType:
|
|
610
|
-
originTokenSymbol:
|
|
611
|
-
destinationTokenSymbol:
|
|
608
|
+
destinationChainId: I,
|
|
609
|
+
recipient: p,
|
|
610
|
+
destinationTokenAddress: w,
|
|
611
|
+
swapAmount: v,
|
|
612
|
+
tradeType: y,
|
|
613
|
+
originTokenSymbol: f,
|
|
614
|
+
destinationTokenSymbol: l,
|
|
612
615
|
fee: "0",
|
|
613
616
|
client: n,
|
|
614
617
|
dryMode: !1,
|
|
615
|
-
trailsClient:
|
|
618
|
+
trailsClient: i,
|
|
616
619
|
destinationCalldata: t.data ? t.data.toString() : void 0,
|
|
617
|
-
onTransactionStateChange:
|
|
620
|
+
onTransactionStateChange: D,
|
|
618
621
|
sourceTokenDecimals: $,
|
|
619
|
-
destinationTokenDecimals:
|
|
622
|
+
destinationTokenDecimals: G,
|
|
620
623
|
paymasterUrl: d?.paymasterUrl,
|
|
621
624
|
slippageTolerance: d?.slippageTolerance?.toString(),
|
|
622
|
-
originNativeTokenPriceUsd:
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
625
|
+
originNativeTokenPriceUsd: N,
|
|
626
|
+
swapProvider: d?.swapProvider,
|
|
627
|
+
bridgeProvider: d?.bridgeProvider,
|
|
628
|
+
commitIntentFn: at.mutateAsync,
|
|
629
|
+
executeIntentFn: R.mutateAsync,
|
|
626
630
|
checkoutOnHandlers: d?.checkoutOnHandlers,
|
|
627
|
-
sequenceIndexerUrl:
|
|
631
|
+
sequenceIndexerUrl: nt,
|
|
628
632
|
sequenceProjectAccessKey: T,
|
|
629
|
-
originPublicClient:
|
|
630
|
-
destinationPublicClient:
|
|
633
|
+
originPublicClient: et ?? void 0,
|
|
634
|
+
destinationPublicClient: c ?? void 0,
|
|
631
635
|
isSmartWallet: d?.isSmartWallet ?? void 0
|
|
632
636
|
});
|
|
633
|
-
u?.trackInWidget && (
|
|
637
|
+
u?.trackInWidget && (z(ht ?? null), H.details || C({
|
|
634
638
|
details: {
|
|
635
|
-
to:
|
|
636
|
-
tokenAddress:
|
|
637
|
-
tokenAmount:
|
|
638
|
-
toChainId:
|
|
639
|
+
to: p,
|
|
640
|
+
tokenAddress: w,
|
|
641
|
+
tokenAmount: y === K.EXACT_OUTPUT ? g : void 0,
|
|
642
|
+
toChainId: I,
|
|
639
643
|
data: t.data
|
|
640
644
|
}
|
|
641
|
-
}), (!
|
|
645
|
+
}), (!H.status || H.status === "idle") && Q(Date.now()));
|
|
642
646
|
try {
|
|
643
|
-
u?.trackInWidget &&
|
|
647
|
+
u?.trackInWidget && C({ retryEnabled: !1 });
|
|
644
648
|
const {
|
|
645
649
|
depositUserTxnReceipt: e,
|
|
646
650
|
destinationIntentTransaction: h,
|
|
647
|
-
totalCompletionSeconds:
|
|
648
|
-
} = await
|
|
651
|
+
totalCompletionSeconds: F
|
|
652
|
+
} = await j({
|
|
649
653
|
selectedFeeOption: null,
|
|
650
654
|
// Transition to "pending" when wallet signature is complete
|
|
651
655
|
onOriginSend: () => {
|
|
652
|
-
u?.trackInWidget &&
|
|
656
|
+
u?.trackInWidget && C({ status: "pending", error: null });
|
|
653
657
|
}
|
|
654
658
|
});
|
|
655
|
-
return u?.trackInWidget &&
|
|
659
|
+
return u?.trackInWidget && C({
|
|
656
660
|
status: "success",
|
|
657
661
|
result: {
|
|
658
662
|
originTxHash: e?.transactionHash,
|
|
659
|
-
originExplorerUrl: e?.transactionHash ?
|
|
663
|
+
originExplorerUrl: e?.transactionHash ? J({
|
|
660
664
|
txHash: e.transactionHash,
|
|
661
|
-
chainId:
|
|
665
|
+
chainId: m
|
|
662
666
|
}) : void 0,
|
|
663
667
|
destinationTxHash: h?.txnHash,
|
|
664
|
-
destinationExplorerUrl: h?.txnHash ?
|
|
668
|
+
destinationExplorerUrl: h?.txnHash ? J({
|
|
665
669
|
txHash: h.txnHash,
|
|
666
|
-
chainId:
|
|
670
|
+
chainId: I
|
|
667
671
|
}) : void 0
|
|
668
672
|
}
|
|
669
673
|
}), {
|
|
670
674
|
originTransaction: {
|
|
671
675
|
transactionHash: e?.transactionHash,
|
|
672
|
-
explorerUrl:
|
|
676
|
+
explorerUrl: J({
|
|
673
677
|
txHash: e?.transactionHash,
|
|
674
|
-
chainId:
|
|
678
|
+
chainId: m
|
|
675
679
|
}),
|
|
676
680
|
receipt: e
|
|
677
681
|
},
|
|
678
682
|
destinationTransaction: {
|
|
679
683
|
transactionHash: h?.txnHash,
|
|
680
|
-
explorerUrl:
|
|
684
|
+
explorerUrl: J({
|
|
681
685
|
txHash: h?.txnHash,
|
|
682
|
-
chainId:
|
|
686
|
+
chainId: I
|
|
683
687
|
}),
|
|
684
688
|
receipt: h
|
|
685
689
|
},
|
|
686
|
-
totalCompletionSeconds:
|
|
690
|
+
totalCompletionSeconds: F
|
|
687
691
|
};
|
|
688
692
|
} catch (e) {
|
|
689
693
|
if (u?.trackInWidget) {
|
|
690
|
-
const h =
|
|
691
|
-
|
|
694
|
+
const h = Tt(e);
|
|
695
|
+
C(h ? {
|
|
692
696
|
status: "confirmation",
|
|
693
697
|
error: null,
|
|
694
698
|
retryEnabled: !0
|
|
695
699
|
} : {
|
|
696
700
|
status: "error",
|
|
697
|
-
error:
|
|
701
|
+
error: M(e),
|
|
698
702
|
retryEnabled: !1
|
|
699
703
|
});
|
|
700
704
|
}
|
|
701
705
|
throw e;
|
|
702
706
|
}
|
|
703
|
-
},
|
|
707
|
+
}, A = kt({
|
|
704
708
|
mutationFn: async (t) => {
|
|
705
709
|
o.console.log(
|
|
706
710
|
"[trails-sdk] [useTrailsSendTransaction] Starting transaction",
|
|
707
711
|
t
|
|
708
|
-
),
|
|
712
|
+
), mt(
|
|
709
713
|
d?.receiptActionButtonText ?? "Transact Again"
|
|
710
|
-
),
|
|
714
|
+
), st(d?.onReceiptAction ?? null);
|
|
711
715
|
const r = t.value !== void 0, u = t.fromTokenAddress !== void 0 && t.fromChainId !== void 0, k = r || u;
|
|
712
|
-
let
|
|
713
|
-
if (t.tokenAddress &&
|
|
714
|
-
const
|
|
715
|
-
(
|
|
716
|
+
let m;
|
|
717
|
+
if (t.tokenAddress && L) {
|
|
718
|
+
const g = L.find(
|
|
719
|
+
(p) => p.contractAddress?.toLowerCase() === t.tokenAddress?.toLowerCase()
|
|
716
720
|
);
|
|
717
|
-
|
|
721
|
+
g && (m = g.chainId);
|
|
718
722
|
}
|
|
719
|
-
|
|
720
|
-
let
|
|
723
|
+
m || (m = s || a);
|
|
724
|
+
let E = !0, P = !0;
|
|
721
725
|
if (n?.account)
|
|
722
726
|
try {
|
|
723
727
|
if (k) {
|
|
724
|
-
let
|
|
725
|
-
t.value !== void 0 ? (
|
|
728
|
+
let g, p, y;
|
|
729
|
+
t.value !== void 0 ? (g = x, p = s || a || 1, y = t.value.toString()) : t.fromTokenAddress && t.fromChainId && (g = t.fromTokenAddress, p = t.fromChainId, y = t.fromAmount), g && p && y && y !== "0" && (E = await At({
|
|
726
730
|
account: n.account.address,
|
|
727
|
-
token:
|
|
728
|
-
amount:
|
|
729
|
-
chainId:
|
|
730
|
-
indexerGatewayClient:
|
|
731
|
-
trailsClient:
|
|
731
|
+
token: g,
|
|
732
|
+
amount: y,
|
|
733
|
+
chainId: p,
|
|
734
|
+
indexerGatewayClient: W,
|
|
735
|
+
trailsClient: i
|
|
732
736
|
}), o.console.log(
|
|
733
737
|
"[trails-sdk] [useTrailsSendTransaction] Origin token balance check:",
|
|
734
738
|
{
|
|
735
|
-
tokenAddress:
|
|
736
|
-
amount:
|
|
737
|
-
chainId:
|
|
738
|
-
hasSufficientBalance:
|
|
739
|
+
tokenAddress: g,
|
|
740
|
+
amount: y,
|
|
741
|
+
chainId: p,
|
|
742
|
+
hasSufficientBalance: E
|
|
739
743
|
}
|
|
740
744
|
));
|
|
741
745
|
}
|
|
742
|
-
|
|
746
|
+
E && t.tokenAddress && t.tokenAmount && (P = await At({
|
|
743
747
|
account: n.account.address,
|
|
744
748
|
token: t.tokenAddress,
|
|
745
749
|
amount: t.tokenAmount,
|
|
746
|
-
chainId:
|
|
747
|
-
indexerGatewayClient:
|
|
748
|
-
trailsClient:
|
|
750
|
+
chainId: m,
|
|
751
|
+
indexerGatewayClient: W,
|
|
752
|
+
trailsClient: i
|
|
749
753
|
}), o.console.log(
|
|
750
754
|
"[trails-sdk] [useTrailsSendTransaction] Destination token balance check:",
|
|
751
755
|
{
|
|
752
756
|
tokenAddress: t.tokenAddress,
|
|
753
757
|
tokenAmount: t.tokenAmount,
|
|
754
|
-
chainId:
|
|
755
|
-
hasSufficientBalance:
|
|
758
|
+
chainId: m,
|
|
759
|
+
hasSufficientBalance: P
|
|
756
760
|
}
|
|
757
761
|
));
|
|
758
|
-
} catch (
|
|
762
|
+
} catch (g) {
|
|
759
763
|
o.console.warn(
|
|
760
764
|
"[trails-sdk] [useTrailsSendTransaction] Error checking balances, defaulting to origin selection:",
|
|
761
|
-
|
|
762
|
-
),
|
|
765
|
+
g
|
|
766
|
+
), E = !1, P = !1;
|
|
763
767
|
}
|
|
764
|
-
const
|
|
768
|
+
const w = !k || !E || !P;
|
|
765
769
|
if (o.console.log(
|
|
766
770
|
"[trails-sdk] [useTrailsSendTransaction] Origin selection decision:",
|
|
767
771
|
{
|
|
768
772
|
hasOriginParams: k,
|
|
769
|
-
hasSufficientOriginBalance:
|
|
770
|
-
hasSufficientDestinationTokenBalance:
|
|
771
|
-
needsOriginSelection:
|
|
773
|
+
hasSufficientOriginBalance: E,
|
|
774
|
+
hasSufficientDestinationTokenBalance: P,
|
|
775
|
+
needsOriginSelection: w
|
|
772
776
|
}
|
|
773
|
-
),
|
|
774
|
-
const
|
|
777
|
+
), w) {
|
|
778
|
+
const g = !(t.tokenAddress && t.tokenAmount), p = {
|
|
775
779
|
to: t.to,
|
|
776
780
|
tokenAddress: t.tokenAddress,
|
|
777
781
|
tokenAmount: t.tokenAmount,
|
|
778
|
-
toChainId:
|
|
782
|
+
toChainId: m,
|
|
779
783
|
data: t.data
|
|
780
784
|
};
|
|
781
|
-
return
|
|
785
|
+
return C({
|
|
782
786
|
status: "awaiting-origin",
|
|
783
|
-
details:
|
|
787
|
+
details: p,
|
|
784
788
|
error: null,
|
|
785
789
|
result: null
|
|
786
|
-
}),
|
|
787
|
-
|
|
788
|
-
resolve: async (
|
|
790
|
+
}), z(null), V([]), Q(Date.now()), new Promise((y, v) => {
|
|
791
|
+
ot({
|
|
792
|
+
resolve: async (U) => {
|
|
789
793
|
try {
|
|
790
|
-
|
|
791
|
-
const
|
|
794
|
+
C({ status: "confirmation" });
|
|
795
|
+
const S = await Y(t, U, {
|
|
792
796
|
trackInWidget: !0
|
|
793
797
|
});
|
|
794
|
-
|
|
795
|
-
} catch (
|
|
796
|
-
|
|
798
|
+
y(S);
|
|
799
|
+
} catch (S) {
|
|
800
|
+
Tt(S) || C({
|
|
797
801
|
status: "error",
|
|
798
|
-
error:
|
|
799
|
-
}),
|
|
802
|
+
error: M(S)
|
|
803
|
+
}), v(S);
|
|
800
804
|
}
|
|
801
805
|
},
|
|
802
|
-
reject: (
|
|
803
|
-
const
|
|
804
|
-
|
|
806
|
+
reject: (U) => {
|
|
807
|
+
const S = U instanceof Error ? U : new Error(String(U));
|
|
808
|
+
C({
|
|
805
809
|
status: "error",
|
|
806
|
-
error:
|
|
807
|
-
}),
|
|
810
|
+
error: M(S)
|
|
811
|
+
}), v(S);
|
|
808
812
|
},
|
|
809
|
-
requireAmountInput:
|
|
813
|
+
requireAmountInput: g
|
|
810
814
|
}), setTimeout(() => {
|
|
811
815
|
o.console.log(
|
|
812
816
|
"[trails-sdk] [useTrailsSendTransaction] Calling openModal()"
|
|
813
|
-
),
|
|
817
|
+
), O();
|
|
814
818
|
}, 0);
|
|
815
819
|
});
|
|
816
820
|
}
|
|
817
|
-
const
|
|
821
|
+
const I = {
|
|
818
822
|
to: t.to,
|
|
819
823
|
tokenAddress: t.tokenAddress,
|
|
820
824
|
tokenAmount: t.tokenAmount,
|
|
821
|
-
toChainId:
|
|
825
|
+
toChainId: m,
|
|
822
826
|
data: t.data
|
|
823
827
|
};
|
|
824
|
-
return
|
|
828
|
+
return C({
|
|
825
829
|
status: "confirmation",
|
|
826
|
-
details:
|
|
830
|
+
details: I,
|
|
827
831
|
error: null,
|
|
828
832
|
result: null
|
|
829
|
-
}),
|
|
833
|
+
}), z(null), V([]), Q(Date.now()), O(), Y(t, void 0, { trackInWidget: !0 });
|
|
830
834
|
},
|
|
831
835
|
onSuccess: (t, r) => {
|
|
832
836
|
o.console.log(
|
|
@@ -839,8 +843,8 @@ function Yt(d) {
|
|
|
839
843
|
"[trails-sdk] [useTrailsSendTransaction] Transaction error",
|
|
840
844
|
{ error: t, variables: r }
|
|
841
845
|
);
|
|
842
|
-
const u =
|
|
843
|
-
|
|
846
|
+
const u = M(t), k = Tt(t);
|
|
847
|
+
H.status !== "idle" && !k && C({
|
|
844
848
|
status: "error",
|
|
845
849
|
error: u
|
|
846
850
|
}), d?.onError?.(new Error(u), r);
|
|
@@ -851,9 +855,9 @@ function Yt(d) {
|
|
|
851
855
|
{ data: t, error: r, variables: u }
|
|
852
856
|
), d?.onSettled?.(t, r, u);
|
|
853
857
|
}
|
|
854
|
-
}),
|
|
858
|
+
}), Z = dt(
|
|
855
859
|
(t, r) => {
|
|
856
|
-
|
|
860
|
+
A.mutate(t, {
|
|
857
861
|
onSuccess: (u) => {
|
|
858
862
|
r?.onSuccess?.(u);
|
|
859
863
|
},
|
|
@@ -865,9 +869,9 @@ function Yt(d) {
|
|
|
865
869
|
}
|
|
866
870
|
});
|
|
867
871
|
},
|
|
868
|
-
[
|
|
869
|
-
),
|
|
870
|
-
async (t, r) =>
|
|
872
|
+
[A]
|
|
873
|
+
), b = dt(
|
|
874
|
+
async (t, r) => A.mutateAsync(t, {
|
|
871
875
|
onSuccess: (u) => {
|
|
872
876
|
r?.onSuccess?.(u);
|
|
873
877
|
},
|
|
@@ -878,95 +882,113 @@ function Yt(d) {
|
|
|
878
882
|
r?.onSettled?.(u, k);
|
|
879
883
|
}
|
|
880
884
|
}),
|
|
881
|
-
[
|
|
882
|
-
),
|
|
883
|
-
|
|
884
|
-
}, [
|
|
885
|
-
return
|
|
886
|
-
sendTransaction:
|
|
887
|
-
sendTransactionAsync:
|
|
888
|
-
retry:
|
|
889
|
-
data:
|
|
890
|
-
error:
|
|
891
|
-
isPending:
|
|
892
|
-
isSuccess:
|
|
893
|
-
isError:
|
|
894
|
-
isIdle:
|
|
895
|
-
status:
|
|
896
|
-
reset:
|
|
897
|
-
variables:
|
|
885
|
+
[A]
|
|
886
|
+
), _ = dt(() => {
|
|
887
|
+
it.current && Z(it.current);
|
|
888
|
+
}, [Z]);
|
|
889
|
+
return rt.current = _, {
|
|
890
|
+
sendTransaction: Z,
|
|
891
|
+
sendTransactionAsync: b,
|
|
892
|
+
retry: _,
|
|
893
|
+
data: A.data,
|
|
894
|
+
error: A.error,
|
|
895
|
+
isPending: A.isPending,
|
|
896
|
+
isSuccess: A.isSuccess,
|
|
897
|
+
isError: A.isError,
|
|
898
|
+
isIdle: A.isIdle,
|
|
899
|
+
status: A.status,
|
|
900
|
+
reset: A.reset,
|
|
901
|
+
variables: A.variables
|
|
898
902
|
};
|
|
899
903
|
}
|
|
900
904
|
export {
|
|
901
905
|
ee as InsufficientBalanceError,
|
|
902
906
|
ne as TRAILS_ROUTER_PLACEHOLDER_AMOUNT,
|
|
903
|
-
|
|
907
|
+
K as TradeType,
|
|
904
908
|
oe as TrailsClient,
|
|
905
909
|
se as TrailsHookModal,
|
|
906
910
|
re as TrailsModalProvider,
|
|
907
|
-
|
|
908
|
-
|
|
911
|
+
ae as TrailsProvider,
|
|
912
|
+
ie as TrailsWidget,
|
|
909
913
|
ce as UserRejectionError,
|
|
910
|
-
le as
|
|
911
|
-
de as
|
|
912
|
-
ue as
|
|
913
|
-
ge as
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
Te as
|
|
917
|
-
ke as
|
|
918
|
-
he as
|
|
919
|
-
Ce as
|
|
920
|
-
Ae as
|
|
921
|
-
Ee as
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
De as
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
Re as
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
914
|
+
le as attemptSwitchChain,
|
|
915
|
+
de as buildRefundTransaction,
|
|
916
|
+
ue as buildRefundTransactionWithSignature,
|
|
917
|
+
ge as calcAmountUsdPrice,
|
|
918
|
+
me as calculateIntentAddress,
|
|
919
|
+
fe as calculateOriginAndDestinationIntentAddresses,
|
|
920
|
+
Te as commitIntent,
|
|
921
|
+
ke as convertApiTokenInfoToToken,
|
|
922
|
+
he as createModalController,
|
|
923
|
+
Ce as determineRefundCall,
|
|
924
|
+
Ae as formatBalanceFields,
|
|
925
|
+
Ee as formatPriceFields,
|
|
926
|
+
pe as formatTvl,
|
|
927
|
+
ye as formatUsdAmountFormatted,
|
|
928
|
+
Ie as formatUsdFields,
|
|
929
|
+
Se as getAccountTotalBalanceUsd,
|
|
930
|
+
we as getAccountTransactionHistory,
|
|
931
|
+
Ue as getAllChains,
|
|
932
|
+
ut as getChainInfo,
|
|
933
|
+
Pe as getChainRpcClient,
|
|
934
|
+
De as getERC20TransferData,
|
|
935
|
+
At as getHasSufficientBalanceToken,
|
|
936
|
+
xe as getHasSufficientBalanceUsd,
|
|
937
|
+
Re as getIntent,
|
|
938
|
+
ve as getIsApiError,
|
|
939
|
+
Oe as getIsBalanceTooLowError,
|
|
940
|
+
He as getIsInsufficientLiquidityError,
|
|
941
|
+
Le as getIsNoAvailableQuoteError,
|
|
942
|
+
be as getIsQuoteFailedError,
|
|
943
|
+
qe as getIsQuoteInputError,
|
|
944
|
+
Ne as getIsQuoteTokenError,
|
|
945
|
+
Be as getIsRateLimitedError,
|
|
946
|
+
Fe as getIsRequiredAmountNotMetError,
|
|
947
|
+
Tt as getIsUserRejectionError,
|
|
948
|
+
Me as getIsWalletAlreadyConnectedError,
|
|
949
|
+
Qe as getMinLogLevel,
|
|
939
950
|
Nt as getPrettifiedErrorMessage,
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
951
|
+
We as getRpcUrl,
|
|
952
|
+
_e as getSupportedChains,
|
|
953
|
+
$e as getSupportedTokens,
|
|
954
|
+
St as getTokenPrice,
|
|
955
|
+
Ge as getTokenPrices,
|
|
956
|
+
je as getTrailsClient,
|
|
957
|
+
Ke as getTxTimeDiff,
|
|
958
|
+
Je as invalidateTokenPricesCache,
|
|
959
|
+
Xe as isValidInteger,
|
|
960
|
+
ze as isValidNumeric,
|
|
945
961
|
o as logger,
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
962
|
+
Ve as normalizeNumber,
|
|
963
|
+
Ye as pollIntentReceipt,
|
|
964
|
+
wt as prepareSend,
|
|
965
|
+
Ze as quoteIntent,
|
|
966
|
+
tn as sendOriginTransaction,
|
|
967
|
+
en as signPayload,
|
|
968
|
+
nn as useAccountTotalBalanceUsd,
|
|
969
|
+
on as useAccountTransactionHistory,
|
|
970
|
+
Ct as useChainRpcClient,
|
|
971
|
+
Rt as useCommitIntent,
|
|
972
|
+
vt as useExecuteIntent,
|
|
973
|
+
sn as useGetIntent,
|
|
974
|
+
rn as useGetTokenImageUrl,
|
|
975
|
+
an as useHasSufficientBalanceToken,
|
|
976
|
+
cn as useHasSufficientBalanceUsd,
|
|
977
|
+
An as useIndexerGatewayClient,
|
|
959
978
|
zt as useIntentReceiptMonitor,
|
|
960
|
-
|
|
979
|
+
ln as useIntentTransactionHistory,
|
|
961
980
|
Vt as useQuote,
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
981
|
+
dn as useSupportedChains,
|
|
982
|
+
yt as useSupportedTokens,
|
|
983
|
+
un as useTokenAddress,
|
|
984
|
+
gn as useTokenBalances,
|
|
985
|
+
mn as useTokenInfo,
|
|
986
|
+
fn as useTokenList,
|
|
987
|
+
Tn as useTokenPrice,
|
|
988
|
+
kn as useTokenPrices,
|
|
989
|
+
pt as useTrails,
|
|
990
|
+
gt as useTrailsClient,
|
|
970
991
|
Bt as useTrailsModal,
|
|
992
|
+
hn as useTrailsRefund,
|
|
971
993
|
Yt as useTrailsSendTransaction
|
|
972
994
|
};
|