0xtrails 0.16.0 → 0.16.1
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/offlineRecovery.d.ts.map +1 -1
- package/dist/offlineRecovery.js +66 -71
- package/dist/package.js +1 -1
- package/dist/recover.d.ts +9 -2
- package/dist/recover.d.ts.map +1 -1
- package/dist/recover.js +443 -377
- package/dist/umd/trails.min.js +200 -200
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.js +151 -143
- package/dist/widget/components/TransactionHistoryItem.d.ts.map +1 -1
- package/dist/widget/components/TransactionHistoryItem.js +209 -154
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
- package/dist/widget/components/WaasFeeOptions.js +158 -154
- package/dist/widget/styles.gen.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionHistoryItem.d.ts","sourceRoot":"","sources":["../../../src/widget/components/TransactionHistoryItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAQ/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"TransactionHistoryItem.d.ts","sourceRoot":"","sources":["../../../src/widget/components/TransactionHistoryItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAQ/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAyC5E,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC;IACrC,WAAW,EAAE,iBAAiB,CAAA;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,oBAAoB,CAAC,EAAE,GAAG,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,oBAAoB,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC1C,uBAAuB,EAAE;QACvB,CAAC,aAAa,EAAE,MAAM,GAAG;YACvB,iBAAiB,EAAE,qBAAqB,GAAG,SAAS,CAAA;YACpD,SAAS,EAAE,OAAO,CAAA;YAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;SACpB,CAAA;KACF,CAAA;IACD,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC/B,CA24BA,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { getQueryParam as
|
|
1
|
+
import { getQueryParam as Pe } from "../../queryParamsCore.js";
|
|
2
2
|
import { logger as o } from "../../logger/index.js";
|
|
3
|
-
import { formatRelativeDate as
|
|
4
|
-
import { getExplorerUrl as
|
|
5
|
-
import { truncateAddress as
|
|
6
|
-
import { formatRawAmount as
|
|
7
|
-
import { getCommittedIntents as
|
|
8
|
-
import { useExecuteIntent as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
3
|
+
import { formatRelativeDate as Oe } from "../../utils/time.js";
|
|
4
|
+
import { getExplorerUrl as de } from "../../explorer.js";
|
|
5
|
+
import { truncateAddress as ce } from "../../utils/address.js";
|
|
6
|
+
import { formatRawAmount as ue } from "../../utils/format.js";
|
|
7
|
+
import { getCommittedIntents as Me } from "../../committedIntentStore.js";
|
|
8
|
+
import { useExecuteIntent as We } from "../../mutations.js";
|
|
9
|
+
import me from "./Identicon.js";
|
|
10
|
+
import xe from "./TokenImage.js";
|
|
11
|
+
import je from "./WaasFeeOptions.js";
|
|
12
|
+
import { useTrails as Be } from "../providers/TrailsProvider.js";
|
|
13
|
+
import { useGetIntent as ze } from "../../hooks/useGetIntent.js";
|
|
14
|
+
import { useKeymachineIntentRecovery as Qe } from "../../recover.js";
|
|
15
|
+
import { useOfflineIntentRecovery as Ve } from "../../offlineRecovery.js";
|
|
16
|
+
import { ErrorDisplay as O } from "./ErrorDisplay.js";
|
|
17
|
+
import _e from "./ExecutionStatusBadge.js";
|
|
18
|
+
import { TransactionDetails as qe } from "./TransactionDetails.js";
|
|
19
|
+
import { IntentStatus as s, TransactionStatus as Ge } from "@0xtrails/api";
|
|
20
|
+
import { useCallback as M, useEffect as Ke, useMemo as m, useRef as W, useState as a } from "react";
|
|
21
|
+
import { useWalletClient as $e } from "@0xtrails/wallet";
|
|
22
|
+
import { Fragment as Xe, jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
23
|
+
import { Info as Ye } from "lucide-react";
|
|
24
|
+
function Ze(e) {
|
|
23
25
|
return !e || e === "UNKNOWN" ? null : e.charAt(0) + e.slice(1).toLowerCase();
|
|
24
26
|
}
|
|
25
|
-
function
|
|
27
|
+
function Je(e) {
|
|
26
28
|
switch (e) {
|
|
27
29
|
case "PAY":
|
|
28
30
|
return "bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";
|
|
@@ -38,83 +40,86 @@ function De(e) {
|
|
|
38
40
|
return "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200";
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function he(e) {
|
|
42
44
|
return e ? e.replaceAll("_", " ") : null;
|
|
43
45
|
}
|
|
44
|
-
var
|
|
45
|
-
const [
|
|
46
|
+
var Ct = ({ transaction: e, index: et, onRefetch: H, fetchedIntent: d, isOffline: ge = !1, commitIntentMutation: b, onCommitSuccess: v, selectedWalletClient: fe, balancesByIntentAddress: pe, onRefetchBalances: g }) => {
|
|
47
|
+
const [j, B] = a(!1), ye = W(null), E = Oe(e.createdAt), z = Ze(e.mode), { data: be } = $e(), R = he(e.swapProviderUsed), A = he(e.bridgeProviderUsed), x = fe || be, { sequenceSupport: ve } = Be(), [l, Ie] = a(null), S = m(() => !e.intentId || l ? !1 : e.hasBalance ?? !1, [
|
|
46
48
|
e.intentId,
|
|
47
49
|
e.hasBalance,
|
|
48
|
-
|
|
49
|
-
]),
|
|
50
|
-
intentId:
|
|
51
|
-
enabled:
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
l
|
|
51
|
+
]), Q = e.executionStatus === s.QUOTED && !d, V = !!e.intentId && S, f = m(() => !e.intentId || !e.mainSigner ? null : Me(e.mainSigner).find((n) => n.intentId === e.intentId) ?? null, [e.intentId, e.mainSigner]), { intent: p, isLoading: ke, error: tt, refetch: _ } = ze({
|
|
52
|
+
intentId: Q || V ? e.intentId : void 0,
|
|
53
|
+
enabled: Q || V
|
|
54
|
+
}), we = d || p || f, [Te, q] = a(!1), [F, L] = a(!1), [G, I] = a(!1), [, K] = a(!1), [u, k] = a(!1), w = W(!1), T = W(!1), [$, C] = a(null), [X, Y] = a(!1), [Z, J] = a(null), [ee, te] = a(!1), [re, ne] = a(null), D = M(() => {
|
|
55
|
+
w.current = !0, k(!0), L(!1), I(!1);
|
|
56
|
+
}, []), { recover: ie, recoverToken: i, selectedRecoveryTarget: Ce } = Qe({
|
|
57
|
+
intent: l ? null : we,
|
|
58
|
+
balancesByIntentAddress: pe,
|
|
59
|
+
walletClient: x || void 0,
|
|
60
|
+
onTransactionSubmitted: D
|
|
61
|
+
}), { recover: oe, isLoading: Ne } = Ve({
|
|
62
|
+
intent: f,
|
|
63
|
+
walletClient: x || void 0,
|
|
59
64
|
ownerAddress: e.mainSigner
|
|
60
|
-
}),
|
|
61
|
-
if (
|
|
65
|
+
}), h = Te || Ne, U = m(() => {
|
|
66
|
+
if (H)
|
|
62
67
|
return () => {
|
|
63
|
-
|
|
68
|
+
H(), e.intentId && !l && _();
|
|
64
69
|
};
|
|
65
70
|
}, [
|
|
66
|
-
|
|
71
|
+
H,
|
|
67
72
|
e.intentId,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
]),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
])).has(e.executionStatus ?? "") &&
|
|
79
|
-
if (!e.intentId || !
|
|
73
|
+
l,
|
|
74
|
+
_
|
|
75
|
+
]), He = e.intentId && x && !l && !u && (S || ge && !!f), ae = i?.chainId ?? Ce?.chainId, N = !!ve?.WaasFeeOptionsController && !!ae, Ee = We(), Re = (e.executionStatus === s.QUOTED || d?.status === s.QUOTED) && b && e.intentId, Ae = (e.executionStatus === s.COMMITTED || d?.status === s.COMMITTED) && e.intentId && !(/* @__PURE__ */ new Set([
|
|
76
|
+
s.EXECUTING,
|
|
77
|
+
s.SUCCEEDED,
|
|
78
|
+
s.FAILED,
|
|
79
|
+
s.ABORTED,
|
|
80
|
+
s.REFUNDED,
|
|
81
|
+
s.INVALID,
|
|
82
|
+
Ge.MINING
|
|
83
|
+
])).has(e.executionStatus ?? "") && S, Se = async () => {
|
|
84
|
+
if (!e.intentId || !b) {
|
|
80
85
|
o.console.error("[AccountIntentTransactionHistory] Cannot commit: missing intentId or mutation");
|
|
81
86
|
return;
|
|
82
87
|
}
|
|
83
88
|
try {
|
|
84
|
-
if (
|
|
85
|
-
await
|
|
89
|
+
if (Y(!0), J(null), d)
|
|
90
|
+
await b.mutateAsync(d), o.console.log("[AccountIntentTransactionHistory] Fetched intent committed successfully", { intentId: d.intentId });
|
|
86
91
|
else {
|
|
87
|
-
if (!
|
|
88
|
-
await
|
|
92
|
+
if (!p) throw new Error("Intent data not available for committing");
|
|
93
|
+
await b.mutateAsync(p), o.console.log("[AccountIntentTransactionHistory] Regular transaction intent committed successfully", { intentId: e.intentId });
|
|
89
94
|
}
|
|
90
|
-
|
|
95
|
+
v && v();
|
|
91
96
|
} catch (n) {
|
|
92
97
|
o.console.error("[AccountIntentTransactionHistory] Failed to commit intent", {
|
|
93
98
|
intentId: e.intentId,
|
|
94
99
|
error: n
|
|
95
|
-
}),
|
|
100
|
+
}), J(n instanceof Error ? n.message : typeof n == "string" ? n : "Failed to commit intent. Please try again.");
|
|
96
101
|
} finally {
|
|
97
|
-
|
|
102
|
+
Y(!1);
|
|
98
103
|
}
|
|
99
|
-
},
|
|
104
|
+
}, Fe = async (n) => {
|
|
100
105
|
if (!e.intentId) {
|
|
101
106
|
o.console.error("[AccountIntentTransactionHistory] Cannot execute: missing intentId");
|
|
102
107
|
return;
|
|
103
108
|
}
|
|
104
109
|
try {
|
|
105
|
-
|
|
106
|
-
const c = n || e.originTransactionHash || e.originIntentTxHash || e.originIntentDepositTxHash || e.txnHash ||
|
|
107
|
-
await
|
|
110
|
+
te(!0), ne(null);
|
|
111
|
+
const c = n || e.originTransactionHash || e.originIntentTxHash || e.originIntentDepositTxHash || e.txnHash || Pe("depositTransactionHash");
|
|
112
|
+
await Ee.mutateAsync({ intentId: e.intentId }), o.console.log("[AccountIntentTransactionHistory] Intent executed successfully", {
|
|
108
113
|
intentId: e.intentId,
|
|
109
114
|
depositTransactionHash: c
|
|
110
|
-
}),
|
|
115
|
+
}), v && v();
|
|
111
116
|
} catch (c) {
|
|
112
117
|
o.console.error("[AccountIntentTransactionHistory] Failed to execute intent", {
|
|
113
118
|
intentId: e.intentId,
|
|
114
119
|
error: c
|
|
115
|
-
}),
|
|
120
|
+
}), ne(c instanceof Error ? c.message : typeof c == "string" ? c : "Failed to execute intent. Please try again.");
|
|
116
121
|
} finally {
|
|
117
|
-
|
|
122
|
+
te(!1);
|
|
118
123
|
}
|
|
119
124
|
};
|
|
120
125
|
o.console.log("[AccountIntentTransactionHistory] Tooltip debug:", {
|
|
@@ -123,34 +128,70 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
123
128
|
recoverTokenSymbol: i?.symbol,
|
|
124
129
|
recoverTokenBalanceFormatted: i?.balanceFormatted,
|
|
125
130
|
recoverTokenBalanceUsdDisplay: i?.balanceUsdDisplay,
|
|
126
|
-
isRecovering:
|
|
127
|
-
shouldShowTooltip: i && !
|
|
131
|
+
isRecovering: h,
|
|
132
|
+
shouldShowTooltip: i && !h
|
|
128
133
|
});
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
134
|
+
const P = M(async () => {
|
|
135
|
+
if (!T.current) {
|
|
136
|
+
if (!e.intentId || !x) {
|
|
137
|
+
o.console.error("[AccountIntentTransactionHistory] Cannot recover: missing intentId or walletClient");
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
T.current = !0;
|
|
141
|
+
try {
|
|
142
|
+
q(!0), C(null), N || (w.current = !1, k(!1));
|
|
143
|
+
let n;
|
|
144
|
+
f ? n = await oe() : n = (await ie()).txHash, o.console.log("[AccountIntentTransactionHistory] Recover transaction sent", {
|
|
145
|
+
intentId: e.intentId,
|
|
146
|
+
txHash: n
|
|
147
|
+
}), Ie(n), C(null), U ? setTimeout(() => {
|
|
148
|
+
U(), g && g();
|
|
149
|
+
}, 2e3) : g && setTimeout(() => {
|
|
150
|
+
g();
|
|
151
|
+
}, 2e3);
|
|
152
|
+
} catch (n) {
|
|
153
|
+
o.console.error("[AccountIntentTransactionHistory] Failed to recover intent", {
|
|
154
|
+
intentId: e.intentId,
|
|
155
|
+
error: n
|
|
156
|
+
});
|
|
157
|
+
const c = n instanceof Error ? n.message : typeof n == "string" ? n : "Failed to recover intent. Please try again.";
|
|
158
|
+
w.current || k(!1), C(c);
|
|
159
|
+
} finally {
|
|
160
|
+
T.current = !1, q(!1), L(!1), I(!1);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}, [
|
|
164
|
+
x,
|
|
165
|
+
U,
|
|
166
|
+
N,
|
|
167
|
+
g,
|
|
168
|
+
ie,
|
|
169
|
+
oe,
|
|
170
|
+
f,
|
|
171
|
+
e.intentId
|
|
172
|
+
]);
|
|
173
|
+
Ke(() => {
|
|
174
|
+
!F || !G || (I(!1), P());
|
|
175
|
+
}, [
|
|
176
|
+
P,
|
|
177
|
+
G,
|
|
178
|
+
F
|
|
179
|
+
]);
|
|
180
|
+
const Le = () => {
|
|
181
|
+
if (!e.intentId || !x) {
|
|
131
182
|
o.console.error("[AccountIntentTransactionHistory] Cannot recover: missing intentId or walletClient");
|
|
132
183
|
return;
|
|
133
184
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}), ne(n), C(null), S ? setTimeout(() => {
|
|
141
|
-
S(), f && f();
|
|
142
|
-
}, 2e3) : f && setTimeout(() => {
|
|
143
|
-
f();
|
|
144
|
-
}, 2e3);
|
|
145
|
-
} catch (n) {
|
|
146
|
-
o.console.error("[AccountIntentTransactionHistory] Failed to recover intent", {
|
|
147
|
-
intentId: e.intentId,
|
|
148
|
-
error: n
|
|
149
|
-
}), C(n instanceof Error ? n.message : typeof n == "string" ? n : "Failed to recover intent. Please try again.");
|
|
150
|
-
} finally {
|
|
151
|
-
U(!1);
|
|
185
|
+
if (!(T.current || u)) {
|
|
186
|
+
if (C(null), K(!1), w.current = !1, k(!1), N) {
|
|
187
|
+
L(!0), I(!0);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
P();
|
|
152
191
|
}
|
|
153
|
-
},
|
|
192
|
+
}, De = M((n) => {
|
|
193
|
+
K(n), n && D();
|
|
194
|
+
}, [D]), y = m(() => e.destinationTransactionHash && e.destinationChainId ? {
|
|
154
195
|
hash: e.destinationTransactionHash,
|
|
155
196
|
chainId: e.destinationChainId
|
|
156
197
|
} : e.destinationIntentTxHash && e.destinationChainId ? {
|
|
@@ -173,21 +214,21 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
173
214
|
e.txnHash,
|
|
174
215
|
e.destinationChainId,
|
|
175
216
|
e.originChainId
|
|
176
|
-
]),
|
|
177
|
-
txHash:
|
|
178
|
-
chainId:
|
|
179
|
-
}), [
|
|
217
|
+
]), le = m(() => !y?.hash || !y.chainId ? null : de({
|
|
218
|
+
txHash: y.hash,
|
|
219
|
+
chainId: y.chainId
|
|
220
|
+
}), [y]), Ue = m(() => {
|
|
180
221
|
if (e.intentProtocol) return e.intentProtocol;
|
|
181
|
-
const n =
|
|
222
|
+
const n = d || p;
|
|
182
223
|
return n?.intentProtocol ? n.intentProtocol : n?.quoteRequest?.options?.intentProtocol;
|
|
183
224
|
}, [
|
|
184
225
|
e.intentProtocol,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
]),
|
|
188
|
-
txHash:
|
|
226
|
+
d,
|
|
227
|
+
p
|
|
228
|
+
]), se = m(() => !l || !e.originChainId ? null : de({
|
|
229
|
+
txHash: l,
|
|
189
230
|
chainId: e.originChainId
|
|
190
|
-
}), [
|
|
231
|
+
}), [l, e.originChainId]);
|
|
191
232
|
return /* @__PURE__ */ r("div", {
|
|
192
233
|
className: "border border-gray-200 dark:border-gray-700 rounded-lg p-2 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",
|
|
193
234
|
children: [
|
|
@@ -195,15 +236,15 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
195
236
|
className: "flex items-center justify-between mb-2",
|
|
196
237
|
children: [/* @__PURE__ */ t("div", {
|
|
197
238
|
className: "flex items-center gap-2 flex-wrap",
|
|
198
|
-
children:
|
|
239
|
+
children: E.relative && /* @__PURE__ */ t("span", {
|
|
199
240
|
className: "text-xs text-gray-900 dark:text-gray-100 cursor-help",
|
|
200
|
-
title:
|
|
201
|
-
children:
|
|
241
|
+
title: E.full || void 0,
|
|
242
|
+
children: E.relative
|
|
202
243
|
})
|
|
203
244
|
}), /* @__PURE__ */ r("div", {
|
|
204
245
|
className: "flex items-center gap-2",
|
|
205
|
-
children: [
|
|
206
|
-
href:
|
|
246
|
+
children: [le && /* @__PURE__ */ r("a", {
|
|
247
|
+
href: le,
|
|
207
248
|
target: "_blank",
|
|
208
249
|
rel: "noopener noreferrer",
|
|
209
250
|
className: "inline-flex items-center gap-1 text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-xs whitespace-nowrap",
|
|
@@ -220,20 +261,20 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
220
261
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
221
262
|
})]
|
|
222
263
|
})]
|
|
223
|
-
}),
|
|
224
|
-
className: `inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${
|
|
225
|
-
children:
|
|
264
|
+
}), z && /* @__PURE__ */ t("span", {
|
|
265
|
+
className: `inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${Je(e.mode)}`,
|
|
266
|
+
children: z
|
|
226
267
|
})]
|
|
227
268
|
})]
|
|
228
269
|
}),
|
|
229
|
-
(
|
|
270
|
+
(R || A) && /* @__PURE__ */ r("div", {
|
|
230
271
|
className: "mb-2 flex flex-wrap gap-2",
|
|
231
|
-
children: [
|
|
272
|
+
children: [R && /* @__PURE__ */ r("span", {
|
|
232
273
|
className: "inline-flex items-center rounded bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-200",
|
|
233
|
-
children: ["Swap: ",
|
|
234
|
-
}),
|
|
274
|
+
children: ["Swap: ", R]
|
|
275
|
+
}), A && /* @__PURE__ */ r("span", {
|
|
235
276
|
className: "inline-flex items-center rounded bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-700 dark:bg-gray-800 dark:text-gray-200",
|
|
236
|
-
children: ["Bridge: ",
|
|
277
|
+
children: ["Bridge: ", A]
|
|
237
278
|
})]
|
|
238
279
|
}),
|
|
239
280
|
/* @__PURE__ */ t("div", {
|
|
@@ -243,7 +284,7 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
243
284
|
children: [
|
|
244
285
|
/* @__PURE__ */ r("div", {
|
|
245
286
|
className: "flex items-start gap-2 flex-1 max-w-[130px]",
|
|
246
|
-
children: [/* @__PURE__ */ t(
|
|
287
|
+
children: [/* @__PURE__ */ t(xe, {
|
|
247
288
|
symbol: e.originToken.symbol,
|
|
248
289
|
imageUrl: e.originToken.imageUrl,
|
|
249
290
|
chainId: e.originToken.chainId,
|
|
@@ -254,20 +295,20 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
254
295
|
className: "text-xs font-medium text-gray-900 dark:text-gray-100 whitespace-nowrap overflow-hidden text-ellipsis",
|
|
255
296
|
style: { maxWidth: "85px" },
|
|
256
297
|
children: [
|
|
257
|
-
|
|
298
|
+
ue(e.originTokenAmount || "0", e.originToken.decimals),
|
|
258
299
|
" ",
|
|
259
300
|
e.originToken.symbol
|
|
260
301
|
]
|
|
261
302
|
}), e.mainSigner && /* @__PURE__ */ r("div", {
|
|
262
303
|
className: "flex items-center gap-1 whitespace-nowrap",
|
|
263
|
-
children: [/* @__PURE__ */ t(
|
|
304
|
+
children: [/* @__PURE__ */ t(me, {
|
|
264
305
|
value: e.mainSigner,
|
|
265
306
|
size: 12
|
|
266
307
|
}), /* @__PURE__ */ t("span", {
|
|
267
308
|
className: "text-xs",
|
|
268
309
|
style: { color: "#71717A" },
|
|
269
310
|
title: e.mainSigner,
|
|
270
|
-
children:
|
|
311
|
+
children: ce(e.mainSigner)
|
|
271
312
|
})]
|
|
272
313
|
})]
|
|
273
314
|
})]
|
|
@@ -281,7 +322,7 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
281
322
|
}),
|
|
282
323
|
/* @__PURE__ */ r("div", {
|
|
283
324
|
className: "flex items-start gap-2 flex-1 max-w-[130px]",
|
|
284
|
-
children: [/* @__PURE__ */ t(
|
|
325
|
+
children: [/* @__PURE__ */ t(xe, {
|
|
285
326
|
symbol: e.destinationToken.symbol,
|
|
286
327
|
imageUrl: e.destinationToken.imageUrl,
|
|
287
328
|
chainId: e.destinationToken.chainId,
|
|
@@ -292,20 +333,20 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
292
333
|
className: "text-xs font-medium text-gray-900 dark:text-gray-100 whitespace-nowrap overflow-hidden text-ellipsis",
|
|
293
334
|
style: { maxWidth: "85px" },
|
|
294
335
|
children: [
|
|
295
|
-
|
|
336
|
+
ue(e.destinationTokenAmount || "0", e.destinationToken.decimals),
|
|
296
337
|
" ",
|
|
297
338
|
e.destinationToken.symbol
|
|
298
339
|
]
|
|
299
340
|
}), e.destinationToAddress && /* @__PURE__ */ r("div", {
|
|
300
341
|
className: "flex items-center gap-1 whitespace-nowrap",
|
|
301
|
-
children: [/* @__PURE__ */ t(
|
|
342
|
+
children: [/* @__PURE__ */ t(me, {
|
|
302
343
|
value: e.destinationToAddress,
|
|
303
344
|
size: 12
|
|
304
345
|
}), /* @__PURE__ */ t("span", {
|
|
305
346
|
className: "text-xs",
|
|
306
347
|
style: { color: "#71717A" },
|
|
307
348
|
title: e.destinationToAddress,
|
|
308
|
-
children:
|
|
349
|
+
children: ce(e.destinationToAddress)
|
|
309
350
|
})]
|
|
310
351
|
})]
|
|
311
352
|
})]
|
|
@@ -316,33 +357,43 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
316
357
|
children: "Transaction details available below"
|
|
317
358
|
})
|
|
318
359
|
}),
|
|
319
|
-
|
|
360
|
+
Z && /* @__PURE__ */ t("div", {
|
|
320
361
|
className: "w-full",
|
|
321
|
-
children: /* @__PURE__ */ t(
|
|
322
|
-
error:
|
|
362
|
+
children: /* @__PURE__ */ t(O, {
|
|
363
|
+
error: Z,
|
|
323
364
|
severity: "error"
|
|
324
365
|
})
|
|
325
366
|
}),
|
|
326
|
-
|
|
367
|
+
re && /* @__PURE__ */ t("div", {
|
|
327
368
|
className: "w-full",
|
|
328
|
-
children: /* @__PURE__ */ t(
|
|
329
|
-
error:
|
|
369
|
+
children: /* @__PURE__ */ t(O, {
|
|
370
|
+
error: re,
|
|
330
371
|
severity: "error"
|
|
331
372
|
})
|
|
332
373
|
}),
|
|
333
|
-
|
|
374
|
+
$ && /* @__PURE__ */ t("div", {
|
|
334
375
|
className: "w-full",
|
|
335
|
-
children: /* @__PURE__ */ t(
|
|
336
|
-
error:
|
|
376
|
+
children: /* @__PURE__ */ t(O, {
|
|
377
|
+
error: $,
|
|
337
378
|
severity: "error"
|
|
338
379
|
})
|
|
339
380
|
}),
|
|
381
|
+
F && N && !u && /* @__PURE__ */ r("div", {
|
|
382
|
+
className: "w-full rounded-lg border border-gray-200 bg-gray-50 p-3 dark:border-gray-700 dark:bg-gray-800/60",
|
|
383
|
+
children: [/* @__PURE__ */ t("div", {
|
|
384
|
+
className: "mb-3 text-sm font-medium text-gray-900 dark:text-gray-100",
|
|
385
|
+
children: "Select a fee token to restore funds with your embedded wallet"
|
|
386
|
+
}), /* @__PURE__ */ t(je, {
|
|
387
|
+
chainId: ae,
|
|
388
|
+
setIsFeeOptionConfirmed: De
|
|
389
|
+
})]
|
|
390
|
+
}),
|
|
340
391
|
/* @__PURE__ */ r("div", {
|
|
341
392
|
className: "flex items-center justify-between mt-2",
|
|
342
393
|
children: [/* @__PURE__ */ r("div", {
|
|
343
394
|
className: "flex items-center gap-2",
|
|
344
|
-
children: [/* @__PURE__ */ t(
|
|
345
|
-
href:
|
|
395
|
+
children: [/* @__PURE__ */ t(_e, { status: e.intentStatus || e.executionStatus }), l && se ? /* @__PURE__ */ r("a", {
|
|
396
|
+
href: se,
|
|
346
397
|
target: "_blank",
|
|
347
398
|
rel: "noopener noreferrer",
|
|
348
399
|
className: "inline-flex items-center gap-1 text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-xs transition-colors",
|
|
@@ -359,29 +410,33 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
359
410
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
360
411
|
})]
|
|
361
412
|
})]
|
|
362
|
-
}) : /* @__PURE__ */ r(
|
|
363
|
-
|
|
413
|
+
}) : /* @__PURE__ */ r(Xe, { children: [
|
|
414
|
+
Re && /* @__PURE__ */ t("button", {
|
|
364
415
|
type: "button",
|
|
365
|
-
onClick:
|
|
366
|
-
disabled:
|
|
416
|
+
onClick: Se,
|
|
417
|
+
disabled: X,
|
|
367
418
|
className: "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-xs transition-colors disabled:text-gray-400 focus:outline-none cursor-pointer disabled:cursor-not-allowed",
|
|
368
419
|
"aria-label": "Commit intent",
|
|
369
|
-
children:
|
|
420
|
+
children: X || ke ? "Committing..." : "Commit"
|
|
370
421
|
}),
|
|
371
|
-
|
|
422
|
+
Ae && /* @__PURE__ */ t("button", {
|
|
372
423
|
type: "button",
|
|
373
|
-
onClick: () =>
|
|
374
|
-
disabled:
|
|
424
|
+
onClick: () => Fe(),
|
|
425
|
+
disabled: ee,
|
|
375
426
|
className: "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-xs transition-colors disabled:text-gray-400 focus:outline-none cursor-pointer disabled:cursor-not-allowed",
|
|
376
427
|
"aria-label": "Execute intent",
|
|
377
|
-
children:
|
|
428
|
+
children: ee ? "Executing..." : "Execute"
|
|
429
|
+
}),
|
|
430
|
+
u && !l && /* @__PURE__ */ t("span", {
|
|
431
|
+
className: "text-blue-600 dark:text-blue-400 text-xs whitespace-nowrap",
|
|
432
|
+
children: "Tx Sent"
|
|
378
433
|
}),
|
|
379
|
-
|
|
434
|
+
He && /* @__PURE__ */ r("div", {
|
|
380
435
|
className: "flex items-center gap-1",
|
|
381
436
|
children: [/* @__PURE__ */ r("button", {
|
|
382
437
|
type: "button",
|
|
383
|
-
onClick:
|
|
384
|
-
disabled:
|
|
438
|
+
onClick: Le,
|
|
439
|
+
disabled: h || u,
|
|
385
440
|
className: "flex items-center gap-1 text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 text-xs transition-colors disabled:text-gray-400 focus:outline-none whitespace-nowrap cursor-pointer disabled:cursor-not-allowed",
|
|
386
441
|
"aria-label": "Restore funds from intent",
|
|
387
442
|
children: [/* @__PURE__ */ r("svg", {
|
|
@@ -395,10 +450,10 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
395
450
|
d: "M1.5 7.24996C1.5 6.38801 1.84217 5.56112 2.45166 4.95162C3.06115 4.34213 3.88805 3.99996 4.75 3.99996H8.79297L7.14648 2.35348C6.95122 2.15822 6.95122 1.84171 7.14648 1.64645C7.34175 1.45118 7.65825 1.45118 7.85352 1.64645L10.3535 4.14645C10.5488 4.34171 10.5488 4.65822 10.3535 4.85348L7.85352 7.35348C7.65825 7.54874 7.34175 7.54874 7.14648 7.35348C6.95122 7.15822 6.95122 6.84171 7.14648 6.64645L8.79297 4.99996H4.75C4.15326 4.99996 3.58114 5.23719 3.15918 5.65914C2.73722 6.0811 2.5 6.65323 2.5 7.24996C2.5 7.54539 2.55835 7.83786 2.67139 8.1108C2.78446 8.38378 2.95025 8.63185 3.15918 8.84078C3.58114 9.26274 4.15326 9.49996 4.75 9.49996H6.5C6.77614 9.49996 7 9.72382 7 9.99996C7 10.2761 6.77614 10.5 6.5 10.5H4.75C3.88805 10.5 3.06115 10.1578 2.45166 9.5483C2.14987 9.24651 1.91089 8.88792 1.74756 8.49361C1.58423 8.09931 1.5 7.67676 1.5 7.24996Z",
|
|
396
451
|
fill: "currentColor"
|
|
397
452
|
})]
|
|
398
|
-
}),
|
|
399
|
-
}), i && !
|
|
453
|
+
}), u && h ? "Tx Sent" : h ? "Restoring..." : "Restore funds"]
|
|
454
|
+
}), i && !h && !u && /* @__PURE__ */ r("div", {
|
|
400
455
|
className: "relative group",
|
|
401
|
-
children: [/* @__PURE__ */ t(
|
|
456
|
+
children: [/* @__PURE__ */ t(Ye, {
|
|
402
457
|
className: "w-3 h-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 cursor-help",
|
|
403
458
|
"aria-label": "Token balance info"
|
|
404
459
|
}), /* @__PURE__ */ r("div", {
|
|
@@ -432,9 +487,9 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
432
487
|
})]
|
|
433
488
|
})
|
|
434
489
|
] })]
|
|
435
|
-
}), !
|
|
490
|
+
}), !j && /* @__PURE__ */ r("button", {
|
|
436
491
|
type: "button",
|
|
437
|
-
onClick: () =>
|
|
492
|
+
onClick: () => B(!0),
|
|
438
493
|
className: "flex items-center justify-center gap-1 py-1 px-3 rounded-md transition-colors cursor-pointer text-xs text-gray-900 dark:text-gray-100 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 whitespace-nowrap",
|
|
439
494
|
"aria-label": "Show more details",
|
|
440
495
|
children: [/* @__PURE__ */ t("span", { children: "More Details" }), /* @__PURE__ */ r("svg", {
|
|
@@ -453,15 +508,15 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
453
508
|
})]
|
|
454
509
|
}),
|
|
455
510
|
/* @__PURE__ */ t("div", {
|
|
456
|
-
ref:
|
|
457
|
-
className: `overflow-hidden transition-all duration-300 ease-out ${
|
|
511
|
+
ref: ye,
|
|
512
|
+
className: `overflow-hidden transition-all duration-300 ease-out ${j ? "max-h-[400px] opacity-100" : "max-h-0 opacity-0"}`,
|
|
458
513
|
children: /* @__PURE__ */ r("div", {
|
|
459
514
|
className: "p-3 rounded-lg bg-gray-50 dark:bg-gray-800",
|
|
460
515
|
children: [/* @__PURE__ */ t("div", {
|
|
461
516
|
className: "flex justify-center mb-3 -mt-1",
|
|
462
517
|
children: /* @__PURE__ */ r("button", {
|
|
463
518
|
type: "button",
|
|
464
|
-
onClick: () =>
|
|
519
|
+
onClick: () => B(!1),
|
|
465
520
|
className: "flex items-center gap-1 px-3 py-1 text-xs bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600 rounded-md transition-colors duration-200 text-gray-600 dark:text-gray-300 hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",
|
|
466
521
|
"aria-label": "Close details",
|
|
467
522
|
children: [/* @__PURE__ */ t("span", { children: "Close" }), /* @__PURE__ */ r("svg", {
|
|
@@ -478,9 +533,9 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
478
533
|
})]
|
|
479
534
|
})]
|
|
480
535
|
})
|
|
481
|
-
}), /* @__PURE__ */ t(
|
|
536
|
+
}), /* @__PURE__ */ t(qe, {
|
|
482
537
|
transaction: e,
|
|
483
|
-
intentProtocol:
|
|
538
|
+
intentProtocol: Ue
|
|
484
539
|
})]
|
|
485
540
|
})
|
|
486
541
|
})
|
|
@@ -488,5 +543,5 @@ var rt = ({ transaction: e, index: Se, onRefetch: v, fetchedIntent: s, isOffline
|
|
|
488
543
|
});
|
|
489
544
|
};
|
|
490
545
|
export {
|
|
491
|
-
|
|
546
|
+
Ct as default
|
|
492
547
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WaasFeeOptions.d.ts","sourceRoot":"","sources":["../../../src/widget/components/WaasFeeOptions.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAgInD,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,uBAAuB,EAAE,CAAC,oBAAoB,EAAE,OAAO,KAAK,IAAI,CAAA;IAChE,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CACxC;
|
|
1
|
+
{"version":3,"file":"WaasFeeOptions.d.ts","sourceRoot":"","sources":["../../../src/widget/components/WaasFeeOptions.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAgInD,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,uBAAuB,EAAE,CAAC,oBAAoB,EAAE,OAAO,KAAK,IAAI,CAAA;IAChE,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CACxC;AAmfD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAsBxD,CAAA;AAED,eAAe,cAAc,CAAA"}
|