0xtrails 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ccip-DajerYAP.js → ccip-ru_Yzdas.js} +5 -5
- package/dist/{index-Bcr6y5Pc.js → index-Si7cO9V7.js} +589 -591
- package/dist/index.js +124 -125
- package/dist/intents.d.ts.map +1 -1
- package/dist/mutations.d.ts.map +1 -1
- package/dist/widget/index.js +3 -3
- package/package.json +2 -2
- package/src/intents.ts +1 -5
- package/src/mutations.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { l as o, u as gt, t as
|
|
2
|
-
import {
|
|
1
|
+
import { l as o, u as gt, t as Ht, a as Ot, b as Lt, g as M, I as bt, c as pt, d as Ct, e as yt, f as It, h as ut, i as St, T as K, p as wt, j as J, k as qt, m as ft, n as Nt, o as Tt, q as At } from "./index-Si7cO9V7.js";
|
|
2
|
+
import { r as te, al as ee, aq as ne, aA as oe, az as se, an as re, ay as ae, U as ie, K as ce, as as le, at as de, af as ue, L as ge, M as me, N as fe, a6 as Te, ax as ke, av as he, a7 as Ce, a9 as Ae, ah as Ee, aa as pe, a8 as ye, X as Ie, R as Se, G as we, J as Ue, am as Pe, Y as De, ar as xe, v as Re, s as ve, C as He, y as Oe, z as Le, B as be, A as qe, w as Ne, x as Be, D as Fe, ao as Me, H as Qe, E as We, a1 as $e, ab as _e, ap as Ge, ak as je, ae as Ke, aj as Je, ai as Xe, ag as ze, Q as Ve, O as Ze, P as Ye, au as tn, Z as en, S as nn, W as on, a3 as sn, _ as rn, $ as an, aw as cn, V as ln, F as dn, a4 as un, a0 as gn, a5 as mn, a2 as fn, ac as Tn, ad as kn } from "./index-Si7cO9V7.js";
|
|
3
3
|
import { useQuery as Ut, useMutation as kt } from "@tanstack/react-query";
|
|
4
4
|
import { useRef as Pt, useCallback as dt } from "react";
|
|
5
|
-
import { useWalletClient as
|
|
5
|
+
import { useWalletClient as Bt, useAccount as Ft, useChainId as Mt } from "wagmi";
|
|
6
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 Et = 150,
|
|
8
|
+
import { useIndexerGatewayClient as Cn } from "@0xsequence/hooks";
|
|
9
|
+
const Et = 150, Xt = (d, n) => {
|
|
10
10
|
const s = Ut({
|
|
11
11
|
queryKey: ["waitIntentReceipt", d],
|
|
12
12
|
queryFn: async () => {
|
|
@@ -53,27 +53,26 @@ function Rt() {
|
|
|
53
53
|
});
|
|
54
54
|
const s = n.quoteRequest.originChainId.toString(), a = n.quoteRequest.destinationChainId.toString();
|
|
55
55
|
try {
|
|
56
|
-
|
|
56
|
+
Ht({
|
|
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
62
|
const i = await d.commitIntent({
|
|
63
|
-
intent: n
|
|
64
|
-
trailsContracts: Ht
|
|
63
|
+
intent: n
|
|
65
64
|
});
|
|
66
65
|
return o.console.log("[trails-sdk] useCommitIntent: Commit successful", {
|
|
67
66
|
intentId: n.intentId,
|
|
68
67
|
response: i
|
|
69
|
-
}),
|
|
68
|
+
}), Ot({
|
|
70
69
|
intentAddress: n.originIntentAddress,
|
|
71
70
|
userAddress: n.ownerAddress,
|
|
72
71
|
originChainId: s ? Number(s) : void 0,
|
|
73
72
|
destinationChainId: a ? Number(a) : void 0
|
|
74
73
|
}), i;
|
|
75
74
|
} catch (i) {
|
|
76
|
-
throw
|
|
75
|
+
throw Lt({
|
|
77
76
|
error: M(i),
|
|
78
77
|
userAddress: n.ownerAddress,
|
|
79
78
|
intentAddress: n.originIntentAddress,
|
|
@@ -115,7 +114,7 @@ function vt() {
|
|
|
115
114
|
error: T,
|
|
116
115
|
errorJSON: JSON.stringify(T, null, 2)
|
|
117
116
|
}
|
|
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
|
|
117
|
+
), 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 bt && T?.cause?.toString().includes("status=SUCCEEDED") || JSON.stringify(T).includes("status=SUCCEEDED"))
|
|
119
118
|
return o.console.error(
|
|
120
119
|
"[trails-sdk] useExecuteIntent: Intent already succeeded, treating as success",
|
|
121
120
|
{ intentId: n }
|
|
@@ -142,7 +141,7 @@ function vt() {
|
|
|
142
141
|
}
|
|
143
142
|
});
|
|
144
143
|
}
|
|
145
|
-
function
|
|
144
|
+
function zt({
|
|
146
145
|
walletClient: d,
|
|
147
146
|
fromTokenAddress: n,
|
|
148
147
|
fromChainId: s,
|
|
@@ -150,13 +149,13 @@ function Vt({
|
|
|
150
149
|
toChainId: i,
|
|
151
150
|
swapAmount: T,
|
|
152
151
|
tradeType: nt,
|
|
153
|
-
toRecipient:
|
|
152
|
+
toRecipient: H,
|
|
154
153
|
toCalldata: ot,
|
|
155
154
|
slippageTolerance: X,
|
|
156
155
|
onStatusUpdate: z,
|
|
157
156
|
checkoutOnHandlers: V,
|
|
158
157
|
swapProvider: Q,
|
|
159
|
-
bridgeProvider:
|
|
158
|
+
bridgeProvider: O,
|
|
160
159
|
paymasterUrl: mt,
|
|
161
160
|
selectedFeeOption: st,
|
|
162
161
|
nodeGatewayEnv: rt,
|
|
@@ -172,10 +171,10 @@ function Vt({
|
|
|
172
171
|
}), R.current?.signal.addEventListener("abort", () => {
|
|
173
172
|
g.abort();
|
|
174
173
|
}), g.signal;
|
|
175
|
-
})() : R.current.signal, { trailsApiKey: C, trailsApiUrl:
|
|
174
|
+
})() : R.current.signal, { trailsApiKey: C, trailsApiUrl: Z, sequenceIndexerUrl: A } = pt(), Y = C, b = gt({
|
|
176
175
|
apiKey: C,
|
|
177
|
-
hostname:
|
|
178
|
-
}),
|
|
176
|
+
hostname: Z
|
|
177
|
+
}), $ = 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({
|
|
179
178
|
queryKey: [
|
|
180
179
|
"prepareSend",
|
|
181
180
|
n,
|
|
@@ -183,12 +182,12 @@ function Vt({
|
|
|
183
182
|
a,
|
|
184
183
|
i,
|
|
185
184
|
T?.toString(),
|
|
186
|
-
|
|
185
|
+
H,
|
|
187
186
|
ot,
|
|
188
187
|
nt,
|
|
189
188
|
X,
|
|
190
189
|
Q,
|
|
191
|
-
|
|
190
|
+
O,
|
|
192
191
|
L,
|
|
193
192
|
at
|
|
194
193
|
],
|
|
@@ -196,13 +195,13 @@ function Vt({
|
|
|
196
195
|
try {
|
|
197
196
|
if (R.current.signal.aborted && (o.console.log(
|
|
198
197
|
"[trails-sdk] Resetting aborted controller for new query"
|
|
199
|
-
), R.current = new AbortController()), !d || !b || !n || !a || !T || !
|
|
198
|
+
), R.current = new AbortController()), !d || !b || !n || !a || !T || !H || !s || !i || !$)
|
|
200
199
|
return null;
|
|
201
200
|
let g = [];
|
|
202
201
|
try {
|
|
203
202
|
g = (await It({
|
|
204
203
|
account: d.account.address,
|
|
205
|
-
indexerGatewayClient:
|
|
204
|
+
indexerGatewayClient: $,
|
|
206
205
|
trailsClient: b
|
|
207
206
|
})).balances;
|
|
208
207
|
} catch (l) {
|
|
@@ -326,7 +325,7 @@ function Vt({
|
|
|
326
325
|
originChainId: s,
|
|
327
326
|
originTokenBalance: y,
|
|
328
327
|
destinationChainId: i,
|
|
329
|
-
recipient:
|
|
328
|
+
recipient: H,
|
|
330
329
|
destinationTokenAddress: a,
|
|
331
330
|
swapAmount: T.toString(),
|
|
332
331
|
tradeType: nt ?? K.EXACT_OUTPUT,
|
|
@@ -343,7 +342,7 @@ function Vt({
|
|
|
343
342
|
}),
|
|
344
343
|
slippageTolerance: X?.toString(),
|
|
345
344
|
swapProvider: Q,
|
|
346
|
-
bridgeProvider:
|
|
345
|
+
bridgeProvider: O,
|
|
347
346
|
paymasterUrl: mt,
|
|
348
347
|
selectedFeeOption: st ?? null,
|
|
349
348
|
abortSignal: it,
|
|
@@ -352,12 +351,12 @@ function Vt({
|
|
|
352
351
|
executeIntentFn: m.mutateAsync,
|
|
353
352
|
checkoutOnHandlers: V,
|
|
354
353
|
sequenceIndexerUrl: A,
|
|
355
|
-
sequenceProjectAccessKey:
|
|
354
|
+
sequenceProjectAccessKey: Y,
|
|
356
355
|
originPublicClient: t ?? void 0,
|
|
357
356
|
destinationPublicClient: r ?? void 0,
|
|
358
357
|
isSmartWallet: at ?? void 0,
|
|
359
358
|
trailsApiKey: C,
|
|
360
|
-
trailsApiUrl:
|
|
359
|
+
trailsApiUrl: Z
|
|
361
360
|
};
|
|
362
361
|
o.console.log("[trails-sdk] options", et);
|
|
363
362
|
const { quote: c, send: lt } = await wt(et);
|
|
@@ -431,7 +430,7 @@ function Vt({
|
|
|
431
430
|
}
|
|
432
431
|
},
|
|
433
432
|
// Prevent unnecessary refetching
|
|
434
|
-
enabled: !!(d && b && n && a && T &&
|
|
433
|
+
enabled: !!(d && b && n && a && T && H && s && i && $ && // !isLoadingTokens &&
|
|
435
434
|
u && u.length > 0),
|
|
436
435
|
staleTime: 30 * 1e3,
|
|
437
436
|
// Consider data fresh for 30 seconds
|
|
@@ -451,7 +450,7 @@ function Vt({
|
|
|
451
450
|
swap: E?.swap || null,
|
|
452
451
|
isLoadingQuote: P,
|
|
453
452
|
quoteError: w,
|
|
454
|
-
quoteErrorPrettified:
|
|
453
|
+
quoteErrorPrettified: qt(w),
|
|
455
454
|
refetchQuote: () => I(),
|
|
456
455
|
abort: () => {
|
|
457
456
|
o.console.log("[trails-sdk] useQuote abort() called"), o.console.log(
|
|
@@ -464,19 +463,19 @@ function Vt({
|
|
|
464
463
|
}
|
|
465
464
|
};
|
|
466
465
|
}
|
|
467
|
-
function
|
|
468
|
-
const { data: n } =
|
|
469
|
-
openModal:
|
|
466
|
+
function Vt(d) {
|
|
467
|
+
const { data: n } = Bt(), { chainId: s } = Ft(), a = Mt(), i = gt(), { trailsApiKey: T, sequenceIndexerUrl: nt } = pt(), {
|
|
468
|
+
openModal: H,
|
|
470
469
|
setPendingSelection: ot,
|
|
471
470
|
setHostTransactionState: X,
|
|
472
471
|
setHostTransactionQuote: z,
|
|
473
472
|
setHostTransactionStates: V,
|
|
474
473
|
setHostTransactionTimestamp: Q,
|
|
475
|
-
hostTransactionState:
|
|
474
|
+
hostTransactionState: O,
|
|
476
475
|
setReceiptActionButtonText: mt,
|
|
477
476
|
setOnReceiptAction: st,
|
|
478
477
|
retryTransactionRef: rt
|
|
479
|
-
} =
|
|
478
|
+
} = Nt(), W = xt(), { supportedTokens: L } = yt(), at = Rt(), R = vt(), it = Pt(null), C = dt(
|
|
480
479
|
(t) => {
|
|
481
480
|
X((r) => ({
|
|
482
481
|
status: t.status ?? r.status,
|
|
@@ -487,7 +486,7 @@ function Yt(d) {
|
|
|
487
486
|
}));
|
|
488
487
|
},
|
|
489
488
|
[X]
|
|
490
|
-
),
|
|
489
|
+
), Z = async (t, r, u) => {
|
|
491
490
|
if (o.console.log(
|
|
492
491
|
"[trails-sdk] [useTrailsSendTransaction] Executing transaction",
|
|
493
492
|
{ variables: t, originSelection: r }
|
|
@@ -565,7 +564,7 @@ function Yt(d) {
|
|
|
565
564
|
(e) => e.contractAddress?.toLowerCase() === k?.toLowerCase() && e.chainId === m
|
|
566
565
|
), ct = L?.find(
|
|
567
566
|
(e) => e.contractAddress?.toLowerCase() === w?.toLowerCase() && e.chainId === I
|
|
568
|
-
), { getChainRpcClient: tt } = await import("./index-
|
|
567
|
+
), { getChainRpcClient: tt } = await import("./index-Si7cO9V7.js").then((e) => e.aZ), et = tt(m), c = tt(I), lt = async (e, h) => {
|
|
569
568
|
try {
|
|
570
569
|
const F = h === m ? et : h === I ? c : tt(h);
|
|
571
570
|
return F ? e.toLowerCase() === x.toLowerCase() ? ut(h)?.nativeCurrency.decimals ?? 18 : await F.readContract({
|
|
@@ -580,15 +579,15 @@ function Yt(d) {
|
|
|
580
579
|
), null;
|
|
581
580
|
}
|
|
582
581
|
};
|
|
583
|
-
let
|
|
584
|
-
if (
|
|
582
|
+
let _ = B?.decimals;
|
|
583
|
+
if (!_ && k) {
|
|
585
584
|
const e = await lt(
|
|
586
585
|
k,
|
|
587
586
|
m
|
|
588
587
|
);
|
|
589
|
-
e !== null && (
|
|
588
|
+
e !== null && (_ = e);
|
|
590
589
|
}
|
|
591
|
-
|
|
590
|
+
_ || (_ = 18);
|
|
592
591
|
let G = ct?.decimals;
|
|
593
592
|
if (!G && w) {
|
|
594
593
|
const e = await lt(
|
|
@@ -618,7 +617,7 @@ function Yt(d) {
|
|
|
618
617
|
trailsClient: i,
|
|
619
618
|
destinationCalldata: t.data ? t.data.toString() : void 0,
|
|
620
619
|
onTransactionStateChange: D,
|
|
621
|
-
sourceTokenDecimals:
|
|
620
|
+
sourceTokenDecimals: _,
|
|
622
621
|
destinationTokenDecimals: G,
|
|
623
622
|
paymasterUrl: d?.paymasterUrl,
|
|
624
623
|
slippageTolerance: d?.slippageTolerance?.toString(),
|
|
@@ -634,7 +633,7 @@ function Yt(d) {
|
|
|
634
633
|
destinationPublicClient: c ?? void 0,
|
|
635
634
|
isSmartWallet: d?.isSmartWallet ?? void 0
|
|
636
635
|
});
|
|
637
|
-
u?.trackInWidget && (z(ht ?? null),
|
|
636
|
+
u?.trackInWidget && (z(ht ?? null), O.details || C({
|
|
638
637
|
details: {
|
|
639
638
|
to: p,
|
|
640
639
|
tokenAddress: w,
|
|
@@ -642,7 +641,7 @@ function Yt(d) {
|
|
|
642
641
|
toChainId: I,
|
|
643
642
|
data: t.data
|
|
644
643
|
}
|
|
645
|
-
}), (!
|
|
644
|
+
}), (!O.status || O.status === "idle") && Q(Date.now()));
|
|
646
645
|
try {
|
|
647
646
|
u?.trackInWidget && C({ retryEnabled: !1 });
|
|
648
647
|
const {
|
|
@@ -792,7 +791,7 @@ function Yt(d) {
|
|
|
792
791
|
resolve: async (U) => {
|
|
793
792
|
try {
|
|
794
793
|
C({ status: "confirmation" });
|
|
795
|
-
const S = await
|
|
794
|
+
const S = await Z(t, U, {
|
|
796
795
|
trackInWidget: !0
|
|
797
796
|
});
|
|
798
797
|
y(S);
|
|
@@ -814,7 +813,7 @@ function Yt(d) {
|
|
|
814
813
|
}), setTimeout(() => {
|
|
815
814
|
o.console.log(
|
|
816
815
|
"[trails-sdk] [useTrailsSendTransaction] Calling openModal()"
|
|
817
|
-
),
|
|
816
|
+
), H();
|
|
818
817
|
}, 0);
|
|
819
818
|
});
|
|
820
819
|
}
|
|
@@ -830,7 +829,7 @@ function Yt(d) {
|
|
|
830
829
|
details: I,
|
|
831
830
|
error: null,
|
|
832
831
|
result: null
|
|
833
|
-
}), z(null), V([]), Q(Date.now()),
|
|
832
|
+
}), z(null), V([]), Q(Date.now()), H(), Z(t, void 0, { trackInWidget: !0 });
|
|
834
833
|
},
|
|
835
834
|
onSuccess: (t, r) => {
|
|
836
835
|
o.console.log(
|
|
@@ -844,7 +843,7 @@ function Yt(d) {
|
|
|
844
843
|
{ error: t, variables: r }
|
|
845
844
|
);
|
|
846
845
|
const u = M(t), k = Tt(t);
|
|
847
|
-
|
|
846
|
+
O.status !== "idle" && !k && C({
|
|
848
847
|
status: "error",
|
|
849
848
|
error: u
|
|
850
849
|
}), d?.onError?.(new Error(u), r);
|
|
@@ -855,7 +854,7 @@ function Yt(d) {
|
|
|
855
854
|
{ data: t, error: r, variables: u }
|
|
856
855
|
), d?.onSettled?.(t, r, u);
|
|
857
856
|
}
|
|
858
|
-
}),
|
|
857
|
+
}), Y = dt(
|
|
859
858
|
(t, r) => {
|
|
860
859
|
A.mutate(t, {
|
|
861
860
|
onSuccess: (u) => {
|
|
@@ -883,13 +882,13 @@ function Yt(d) {
|
|
|
883
882
|
}
|
|
884
883
|
}),
|
|
885
884
|
[A]
|
|
886
|
-
),
|
|
887
|
-
it.current &&
|
|
888
|
-
}, [
|
|
889
|
-
return rt.current =
|
|
890
|
-
sendTransaction:
|
|
885
|
+
), $ = dt(() => {
|
|
886
|
+
it.current && Y(it.current);
|
|
887
|
+
}, [Y]);
|
|
888
|
+
return rt.current = $, {
|
|
889
|
+
sendTransaction: Y,
|
|
891
890
|
sendTransactionAsync: b,
|
|
892
|
-
retry:
|
|
891
|
+
retry: $,
|
|
893
892
|
data: A.data,
|
|
894
893
|
error: A.error,
|
|
895
894
|
isPending: A.isPending,
|
|
@@ -902,93 +901,93 @@ function Yt(d) {
|
|
|
902
901
|
};
|
|
903
902
|
}
|
|
904
903
|
export {
|
|
905
|
-
|
|
906
|
-
|
|
904
|
+
te as InsufficientBalanceError,
|
|
905
|
+
ee as TRAILS_ROUTER_PLACEHOLDER_AMOUNT,
|
|
907
906
|
K as TradeType,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
907
|
+
ne as TrailsClient,
|
|
908
|
+
oe as TrailsHookModal,
|
|
909
|
+
se as TrailsModalProvider,
|
|
910
|
+
re as TrailsProvider,
|
|
911
|
+
ae as TrailsWidget,
|
|
912
|
+
ie as UserRejectionError,
|
|
913
|
+
ce as attemptSwitchChain,
|
|
914
|
+
le as buildRefundTransaction,
|
|
915
|
+
de as buildRefundTransactionWithSignature,
|
|
916
|
+
ue as calcAmountUsdPrice,
|
|
917
|
+
ge as calculateIntentAddress,
|
|
918
|
+
me as calculateOriginAndDestinationIntentAddresses,
|
|
919
|
+
fe as commitIntent,
|
|
920
|
+
Te as convertApiTokenInfoToToken,
|
|
921
|
+
ke as createModalController,
|
|
922
|
+
he as determineRefundCall,
|
|
923
|
+
Ce as formatBalanceFields,
|
|
924
|
+
Ae as formatPriceFields,
|
|
925
|
+
Ee as formatTvl,
|
|
926
|
+
pe as formatUsdAmountFormatted,
|
|
927
|
+
ye as formatUsdFields,
|
|
928
|
+
Ie as getAccountTotalBalanceUsd,
|
|
929
|
+
Se as getAccountTransactionHistory,
|
|
930
|
+
we as getAllChains,
|
|
932
931
|
ut as getChainInfo,
|
|
933
|
-
|
|
934
|
-
|
|
932
|
+
Ue as getChainRpcClient,
|
|
933
|
+
Pe as getERC20TransferData,
|
|
935
934
|
At as getHasSufficientBalanceToken,
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
935
|
+
De as getHasSufficientBalanceUsd,
|
|
936
|
+
xe as getIntent,
|
|
937
|
+
Re as getIsApiError,
|
|
938
|
+
ve as getIsBalanceTooLowError,
|
|
940
939
|
He as getIsInsufficientLiquidityError,
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
940
|
+
Oe as getIsNoAvailableQuoteError,
|
|
941
|
+
Le as getIsQuoteFailedError,
|
|
942
|
+
be as getIsQuoteInputError,
|
|
943
|
+
qe as getIsQuoteTokenError,
|
|
944
|
+
Ne as getIsRateLimitedError,
|
|
945
|
+
Be as getIsRequiredAmountNotMetError,
|
|
947
946
|
Tt as getIsUserRejectionError,
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
947
|
+
Fe as getIsWalletAlreadyConnectedError,
|
|
948
|
+
Me as getMinLogLevel,
|
|
949
|
+
qt as getPrettifiedErrorMessage,
|
|
950
|
+
Qe as getRpcUrl,
|
|
951
|
+
We as getSupportedChains,
|
|
953
952
|
$e as getSupportedTokens,
|
|
954
953
|
St as getTokenPrice,
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
954
|
+
_e as getTokenPrices,
|
|
955
|
+
Ge as getTrailsClient,
|
|
956
|
+
je as getTxTimeDiff,
|
|
957
|
+
Ke as invalidateTokenPricesCache,
|
|
958
|
+
Je as isValidInteger,
|
|
959
|
+
Xe as isValidNumeric,
|
|
961
960
|
o as logger,
|
|
962
|
-
|
|
963
|
-
|
|
961
|
+
ze as normalizeNumber,
|
|
962
|
+
Ve as pollIntentReceipt,
|
|
964
963
|
wt as prepareSend,
|
|
965
964
|
Ze as quoteIntent,
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
965
|
+
Ye as sendOriginTransaction,
|
|
966
|
+
tn as signPayload,
|
|
967
|
+
en as useAccountTotalBalanceUsd,
|
|
968
|
+
nn as useAccountTransactionHistory,
|
|
970
969
|
Ct as useChainRpcClient,
|
|
971
970
|
Rt as useCommitIntent,
|
|
972
971
|
vt as useExecuteIntent,
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
972
|
+
on as useGetIntent,
|
|
973
|
+
sn as useGetTokenImageUrl,
|
|
974
|
+
rn as useHasSufficientBalanceToken,
|
|
975
|
+
an as useHasSufficientBalanceUsd,
|
|
976
|
+
Cn as useIndexerGatewayClient,
|
|
977
|
+
Xt as useIntentReceiptMonitor,
|
|
978
|
+
cn as useIntentRecover,
|
|
979
|
+
ln as useIntentTransactionHistory,
|
|
980
|
+
zt as useQuote,
|
|
981
|
+
dn as useSupportedChains,
|
|
983
982
|
yt as useSupportedTokens,
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
983
|
+
un as useTokenAddress,
|
|
984
|
+
gn as useTokenBalances,
|
|
985
|
+
mn as useTokenInfo,
|
|
986
|
+
fn as useTokenList,
|
|
987
|
+
Tn as useTokenPrice,
|
|
988
|
+
kn as useTokenPrices,
|
|
990
989
|
pt as useTrails,
|
|
991
990
|
gt as useTrailsClient,
|
|
992
|
-
|
|
993
|
-
|
|
991
|
+
Nt as useTrailsModal,
|
|
992
|
+
Vt as useTrailsSendTransaction
|
|
994
993
|
};
|
package/dist/intents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../src/intents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,EACN,WAAW,EACX,SAAS,EAET,aAAa,EACb,gBAAgB,EAChB,eAAe,EAEf,iBAAiB,EAClB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,EAAW,MAAM,+BAA+B,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAgC,KAAK,GAAG,EAAE,MAAM,IAAI,CAAA;AACpE,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,YAAY,EAClB,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../src/intents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,EACN,WAAW,EACX,SAAS,EAET,aAAa,EACb,gBAAgB,EAChB,eAAe,EAEf,iBAAiB,EAClB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,EAAW,M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sBAAsB,EACtB,oBAAoB,GACrB,EAAE;IACD,iBAAiB,EAAE,OAAO,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,2BAA2B,EAAE,MAAM,CAAA;IACnC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,sBAAsB,EAAE,MAAM,CAAA;IAC9B,oBAAoB,EAAE,KAAK,CAAA;CAC5B;;;;;;EAqBA;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,GAAG,EACH,aAAa,EACb,KAAK,GACN,EAAE;IACD,kBAAkB,EAAE,MAAM,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,KAAK,CAAA;CACb;;;;;;EAiBA"}
|
package/dist/mutations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../src/mutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../src/mutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAS7D,OAAO,EACL,KAAK,qBAAqB,EAG3B,MAAM,eAAe,CAAA;AAEtB;;;GAGG;AACH,wBAAgB,eAAe,4HAmE9B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB;cAShB,MAAM;6BACS,MAAM;uBACZ,gBAAgB;YA2ExC"}
|
package/dist/widget/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aA as s, az as l, an as o, ay as e, ax as i, c as d, n as T } from "../index-Si7cO9V7.js";
|
|
2
2
|
export {
|
|
3
3
|
s as TrailsHookModal,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
l as TrailsModalProvider,
|
|
5
|
+
o as TrailsProvider,
|
|
6
6
|
e as TrailsWidget,
|
|
7
7
|
i as createModalController,
|
|
8
8
|
d as useTrails,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "0xtrails",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "SDK for Trails",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@0xsequence/hooks": "5.4.4",
|
|
27
27
|
"@0xsequence/indexer": "3.0.0-beta.4",
|
|
28
28
|
"@0xsequence/wallet-primitives": "^0.0.0-20250917144328",
|
|
29
|
-
"@0xtrails/api": "^0.8.
|
|
29
|
+
"@0xtrails/api": "^0.8.1",
|
|
30
30
|
"@databeat/tracker": "0.9.3",
|
|
31
31
|
"@radix-ui/react-tooltip": "1.2.8",
|
|
32
32
|
"@tanstack/react-query": "5.90.3",
|
package/src/intents.ts
CHANGED
|
@@ -24,10 +24,7 @@ import {
|
|
|
24
24
|
type WalletClient,
|
|
25
25
|
} from "viem"
|
|
26
26
|
import { getChainInfo, getChainRpcClient } from "./chains.js"
|
|
27
|
-
import {
|
|
28
|
-
SEQUENCE_V3_CONTRACT_ADDRESSES,
|
|
29
|
-
TRAILS_CONTRACTS,
|
|
30
|
-
} from "./constants.js"
|
|
27
|
+
import { SEQUENCE_V3_CONTRACT_ADDRESSES } from "./constants.js"
|
|
31
28
|
import {
|
|
32
29
|
trackTransactionStarted,
|
|
33
30
|
trackTransactionSubmitted,
|
|
@@ -403,7 +400,6 @@ export async function commitIntent(
|
|
|
403
400
|
// Commit the intent that was returned from quoteIntent
|
|
404
401
|
const response = await trailsClient.commitIntent({
|
|
405
402
|
intent,
|
|
406
|
-
trailsContracts: TRAILS_CONTRACTS,
|
|
407
403
|
})
|
|
408
404
|
|
|
409
405
|
// Track successful intent commit
|
package/src/mutations.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { Intent, DepositSignature } from "@0xtrails/api"
|
|
|
3
3
|
import { useTrailsClient } from "./trailsClient.js"
|
|
4
4
|
import { logger } from "./logger.js"
|
|
5
5
|
import { getFullErrorMessage } from "./error.js"
|
|
6
|
-
import { TRAILS_CONTRACTS } from "./constants.js"
|
|
7
6
|
import {
|
|
8
7
|
trackIntentCommitStarted,
|
|
9
8
|
trackIntentCommitCompleted,
|
|
@@ -49,7 +48,6 @@ export function useCommitIntent() {
|
|
|
49
48
|
// Commit the intent
|
|
50
49
|
const response = await trailsClient.commitIntent({
|
|
51
50
|
intent,
|
|
52
|
-
trailsContracts: TRAILS_CONTRACTS,
|
|
53
51
|
})
|
|
54
52
|
|
|
55
53
|
logger.console.log("[trails-sdk] useCommitIntent: Commit successful", {
|