0xtrails 0.16.0 → 0.16.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/offlineRecovery.d.ts.map +1 -1
- package/dist/offlineRecovery.js +66 -71
- package/dist/package.js +1 -1
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/prepareSend.js +77 -77
- 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,238 +1,242 @@
|
|
|
1
1
|
import { logger as N } from "../../logger/index.js";
|
|
2
|
-
import { normalizeAddress as
|
|
3
|
-
import { formatAmountDisplay as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useTrails as
|
|
8
|
-
import { formatUnits as
|
|
9
|
-
import { useCallback as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { ChevronDown as
|
|
12
|
-
var
|
|
13
|
-
const
|
|
14
|
-
|
|
2
|
+
import { normalizeAddress as X, truncateAddress as Y } from "../../utils/address.js";
|
|
3
|
+
import { formatAmountDisplay as Z } from "../../utils/format.js";
|
|
4
|
+
import _ from "./CopyButton.js";
|
|
5
|
+
import V from "./TokenImage.js";
|
|
6
|
+
import ee from "./Tooltip.js";
|
|
7
|
+
import { useTrails as re } from "../providers/TrailsProvider.js";
|
|
8
|
+
import { formatUnits as se } from "viem";
|
|
9
|
+
import { useCallback as j, useEffect as I, useMemo as P, useRef as te, useState as w } from "react";
|
|
10
|
+
import { Fragment as R, jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
11
|
+
import { ChevronDown as ae, ChevronUp as le } from "lucide-react";
|
|
12
|
+
var F = (a) => "hasEnoughBalanceForFee" in a && "balance" in a, ne = (a) => a?.contractAddress ? Y(a.contractAddress) : "Native Token", W = ({ option: a, chainId: i, feeDisplay: n, isSelected: u = !1, isDisabled: o = !1, showRadio: d = !1, radioName: l = "feeOption", onSelect: A }) => {
|
|
13
|
+
const h = (c) => {
|
|
14
|
+
c?.stopPropagation(), !o && A?.();
|
|
15
15
|
};
|
|
16
16
|
return /* @__PURE__ */ r("div", {
|
|
17
|
-
className: `px-4 py-3 flex flex-col space-y-3 border border-gray-200 dark:border-gray-800 rounded-lg transition-all duration-200 ${
|
|
18
|
-
role:
|
|
19
|
-
tabIndex:
|
|
20
|
-
"aria-disabled":
|
|
21
|
-
onClick:
|
|
22
|
-
onKeyDown:
|
|
23
|
-
(
|
|
17
|
+
className: `px-4 py-3 flex flex-col space-y-3 border border-gray-200 dark:border-gray-800 rounded-lg transition-all duration-200 ${o ? "opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-900/30" : "bg-white dark:bg-gray-900 hover:shadow-sm"}`,
|
|
18
|
+
role: d ? "radio" : void 0,
|
|
19
|
+
tabIndex: d && !o ? 0 : void 0,
|
|
20
|
+
"aria-disabled": o,
|
|
21
|
+
onClick: d ? h : void 0,
|
|
22
|
+
onKeyDown: d ? (c) => {
|
|
23
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), h());
|
|
24
24
|
} : void 0,
|
|
25
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ t("div", {
|
|
26
26
|
className: "flex items-start justify-between gap-3",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ t("div", {
|
|
28
28
|
className: "flex items-center space-x-3",
|
|
29
|
-
children: [/* @__PURE__ */ r(
|
|
30
|
-
symbol:
|
|
31
|
-
imageUrl:
|
|
29
|
+
children: [/* @__PURE__ */ r(V, {
|
|
30
|
+
symbol: a.token.symbol,
|
|
31
|
+
imageUrl: a.token.logoURL,
|
|
32
32
|
chainId: i,
|
|
33
33
|
size: 32
|
|
34
|
-
}), /* @__PURE__ */
|
|
34
|
+
}), /* @__PURE__ */ t("div", {
|
|
35
35
|
className: "ml-2 text-left",
|
|
36
36
|
children: [/* @__PURE__ */ r("div", {
|
|
37
37
|
className: "text-sm font-semibold",
|
|
38
|
-
children:
|
|
38
|
+
children: a.token.symbol
|
|
39
39
|
}), /* @__PURE__ */ r("div", {
|
|
40
40
|
className: "text-xs trails-text-muted",
|
|
41
|
-
children:
|
|
41
|
+
children: ne(a.token)
|
|
42
42
|
})]
|
|
43
43
|
})]
|
|
44
|
-
}), /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ t("div", {
|
|
45
45
|
className: "flex items-center space-x-3",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ t("div", {
|
|
47
47
|
className: "text-right",
|
|
48
48
|
children: [/* @__PURE__ */ r("div", {
|
|
49
49
|
className: "text-[10px] uppercase tracking-wide trails-text-muted",
|
|
50
50
|
children: "Fee to pay"
|
|
51
|
-
}), /* @__PURE__ */
|
|
51
|
+
}), /* @__PURE__ */ t("div", {
|
|
52
52
|
className: "text-base font-semibold",
|
|
53
53
|
children: [
|
|
54
|
-
|
|
54
|
+
n.feeAmountFormatted,
|
|
55
55
|
" ",
|
|
56
|
-
|
|
56
|
+
a.token.symbol
|
|
57
57
|
]
|
|
58
58
|
})]
|
|
59
|
-
}),
|
|
59
|
+
}), d && /* @__PURE__ */ r("input", {
|
|
60
60
|
type: "radio",
|
|
61
|
-
name:
|
|
61
|
+
name: l,
|
|
62
62
|
checked: u,
|
|
63
|
-
disabled:
|
|
64
|
-
onChange:
|
|
63
|
+
disabled: o,
|
|
64
|
+
onChange: h,
|
|
65
65
|
className: "w-4 h-4 text-trails-primary focus:ring-trails-primary"
|
|
66
66
|
})]
|
|
67
67
|
})]
|
|
68
68
|
})
|
|
69
69
|
});
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
}, O = () => /* @__PURE__ */ r("div", {
|
|
71
|
+
className: "flex items-center justify-center py-8",
|
|
72
|
+
children: /* @__PURE__ */ r("p", {
|
|
73
|
+
className: "text-sm trails-text-muted",
|
|
74
|
+
children: "Loading fee options..."
|
|
75
|
+
})
|
|
76
|
+
}), oe = ({ chainId: a, originToken: i, originTokenAmount: n, setIsFeeOptionConfirmed: u, onFeeOptionsLoaded: o, setIsError: d, pendingFeeOptionConfirmation: l, confirmPendingFeeOption: A, rejectPendingFeeOption: h }) => {
|
|
77
|
+
const [c, x] = w(), S = te(void 0), [y, H] = w(!1), [f, g] = w(!1), [$, T] = w(!1), K = !!l && (!l.options || l.options.length === 0), B = P(() => i?.contractAddress?.toLowerCase() || null, [i?.contractAddress]), p = P(() => {
|
|
78
|
+
if (!n) return null;
|
|
73
79
|
try {
|
|
74
|
-
return BigInt(
|
|
80
|
+
return BigInt(n);
|
|
75
81
|
} catch (e) {
|
|
76
82
|
return N.console.error("[trails-sdk] Failed to parse origin token amount for fee comparison", {
|
|
77
|
-
originTokenAmount:
|
|
83
|
+
originTokenAmount: n,
|
|
78
84
|
error: e
|
|
79
85
|
}), null;
|
|
80
86
|
}
|
|
81
|
-
}, [
|
|
87
|
+
}, [n]), z = j((e) => {
|
|
82
88
|
if (!i || !e?.token) return !1;
|
|
83
|
-
const
|
|
84
|
-
return
|
|
85
|
-
}, [i,
|
|
86
|
-
if (!p || p <= 0n || !
|
|
89
|
+
const s = e.token.contractAddress ? X(e.token.contractAddress) : null;
|
|
90
|
+
return B && s ? B === s : !1;
|
|
91
|
+
}, [i, B]), v = j((e) => {
|
|
92
|
+
if (!p || p <= 0n || !z(e) || !e?.balance || !e?.value) return !1;
|
|
87
93
|
try {
|
|
88
94
|
return BigInt(e.balance) < BigInt(e.value) + p;
|
|
89
|
-
} catch (
|
|
95
|
+
} catch (s) {
|
|
90
96
|
return N.console.error("[trails-sdk] Failed to compare origin amount plus fee with balance", {
|
|
91
97
|
balance: e?.balance,
|
|
92
98
|
value: e?.value,
|
|
93
|
-
originAmount:
|
|
94
|
-
error:
|
|
99
|
+
originAmount: n,
|
|
100
|
+
error: s
|
|
95
101
|
}), !1;
|
|
96
102
|
}
|
|
97
103
|
}, [
|
|
98
|
-
|
|
104
|
+
z,
|
|
99
105
|
p,
|
|
100
|
-
|
|
101
|
-
]),
|
|
102
|
-
const
|
|
103
|
-
let
|
|
106
|
+
n
|
|
107
|
+
]), M = j((e) => {
|
|
108
|
+
const s = e.token.decimals ?? 18, b = e.value || "0";
|
|
109
|
+
let C = "0";
|
|
104
110
|
try {
|
|
105
|
-
|
|
106
|
-
maxFractionDigits: Math.min(
|
|
111
|
+
C = Z(se(BigInt(b), s), {
|
|
112
|
+
maxFractionDigits: Math.min(s, 6),
|
|
107
113
|
minFractionDigits: 0
|
|
108
114
|
});
|
|
109
|
-
} catch (
|
|
115
|
+
} catch (Q) {
|
|
110
116
|
N.console.warn("[trails-sdk] Failed to format fee option amount", {
|
|
111
|
-
error:
|
|
117
|
+
error: Q,
|
|
112
118
|
value: b,
|
|
113
|
-
decimals:
|
|
119
|
+
decimals: s,
|
|
114
120
|
token: e?.token?.symbol
|
|
115
121
|
});
|
|
116
122
|
}
|
|
117
|
-
return { feeAmountFormatted:
|
|
118
|
-
}, [])
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
return { feeAmountFormatted: C };
|
|
124
|
+
}, []), L = P(() => {
|
|
125
|
+
const e = (l?.options ?? []).filter(F).filter((s) => s.hasEnoughBalanceForFee);
|
|
126
|
+
return e.find((s) => !v(s)) ?? e[0];
|
|
127
|
+
}, [l?.options, v]), E = L?.token?.symbol;
|
|
128
|
+
I(() => {
|
|
129
|
+
const e = l?.id;
|
|
130
|
+
if (!e) {
|
|
131
|
+
S.current = void 0;
|
|
132
|
+
return;
|
|
123
133
|
}
|
|
134
|
+
S.current !== e && (S.current = e, T(!1), u(!1), x(void 0));
|
|
135
|
+
}, [l?.id, u]), I(() => {
|
|
136
|
+
l && (N.console.log("[trails-sdk] Pending fee options: ", l.options), L && o && o(), !c && E && x(E));
|
|
124
137
|
}, [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
133
|
-
|
|
138
|
+
L,
|
|
139
|
+
E,
|
|
140
|
+
o,
|
|
141
|
+
l,
|
|
142
|
+
c
|
|
143
|
+
]);
|
|
144
|
+
const G = async (e) => {
|
|
145
|
+
if (l && !f) {
|
|
146
|
+
g(!0);
|
|
134
147
|
try {
|
|
135
|
-
|
|
148
|
+
T(!0), u(!0), A(l.id, e);
|
|
136
149
|
} finally {
|
|
137
|
-
|
|
150
|
+
g(!1);
|
|
138
151
|
}
|
|
139
152
|
}
|
|
140
|
-
},
|
|
141
|
-
if (
|
|
142
|
-
|
|
153
|
+
}, J = async () => {
|
|
154
|
+
if (l && !f) {
|
|
155
|
+
g(!0);
|
|
143
156
|
try {
|
|
144
|
-
|
|
157
|
+
h(l.id);
|
|
145
158
|
} finally {
|
|
146
|
-
|
|
159
|
+
g(!1);
|
|
147
160
|
}
|
|
148
161
|
}
|
|
149
162
|
};
|
|
150
|
-
if (!
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
className: "flex flex-col items-center space-y-3",
|
|
155
|
-
children: [/* @__PURE__ */ r("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-trails-primary" }), /* @__PURE__ */ r("p", {
|
|
156
|
-
className: "text-sm trails-text-muted",
|
|
157
|
-
children: "Loading fee options..."
|
|
158
|
-
})]
|
|
159
|
-
})
|
|
160
|
-
});
|
|
161
|
-
const v = a.options, m = v.filter(x).filter((e) => e.hasEnoughBalanceForFee).find((e) => e.token.symbol === n), W = m ? P(m) : null, A = m ? j(m) : !1, z = v.find((e) => x(e) && e.hasEnoughBalanceForFee);
|
|
162
|
-
return z || o?.(!0), z ? /* @__PURE__ */ s("div", {
|
|
163
|
+
if (!l) return $ ? null : /* @__PURE__ */ r(O, {});
|
|
164
|
+
if (K) return /* @__PURE__ */ r(O, {});
|
|
165
|
+
const k = l.options, m = k.filter(F).filter((e) => e.hasEnoughBalanceForFee).find((e) => e.token.symbol === c), U = m ? M(m) : null, D = m ? v(m) : !1, q = k.find((e) => F(e) && e.hasEnoughBalanceForFee);
|
|
166
|
+
return q || d?.(!0), q ? /* @__PURE__ */ t("div", {
|
|
163
167
|
className: "space-y-2",
|
|
164
168
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ t("div", {
|
|
166
170
|
className: "flex items-center justify-between",
|
|
167
171
|
children: [/* @__PURE__ */ r("div", {
|
|
168
172
|
className: "text-sm font-medium trails-text-primary",
|
|
169
173
|
children: "Select Fee Payment Token"
|
|
170
|
-
}), /* @__PURE__ */
|
|
174
|
+
}), /* @__PURE__ */ t("button", {
|
|
171
175
|
type: "button",
|
|
172
|
-
onClick: () =>
|
|
176
|
+
onClick: () => H(!y),
|
|
173
177
|
className: "flex items-center space-x-1 text-xs trails-text-muted hover:trails-text-primary transition-colors cursor-pointer",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ t("span", { children: [y ? "Hide" : "Show", " options"] }), y ? /* @__PURE__ */ r(le, { className: "w-3 h-3" }) : /* @__PURE__ */ r(ae, { className: "w-3 h-3" })]
|
|
175
179
|
})]
|
|
176
180
|
}),
|
|
177
|
-
m?.hasEnoughBalanceForFee &&
|
|
181
|
+
m?.hasEnoughBalanceForFee && U && /* @__PURE__ */ r(W, {
|
|
178
182
|
option: m,
|
|
179
|
-
chainId:
|
|
180
|
-
feeDisplay:
|
|
183
|
+
chainId: a,
|
|
184
|
+
feeDisplay: U,
|
|
181
185
|
isSelected: !0,
|
|
182
|
-
isDisabled:
|
|
186
|
+
isDisabled: D,
|
|
183
187
|
showRadio: !1
|
|
184
188
|
}),
|
|
185
|
-
|
|
189
|
+
y && /* @__PURE__ */ r("div", {
|
|
186
190
|
className: "space-y-2",
|
|
187
|
-
children:
|
|
188
|
-
const
|
|
189
|
-
return
|
|
191
|
+
children: k.filter(F).filter((e) => e.hasEnoughBalanceForFee).map((e) => {
|
|
192
|
+
const s = v(e), b = M(e);
|
|
193
|
+
return s ? /* @__PURE__ */ r(ee, {
|
|
190
194
|
message: "Not enough balance to cover sell amount and fee",
|
|
191
|
-
children: /* @__PURE__ */ r(
|
|
195
|
+
children: /* @__PURE__ */ r(W, {
|
|
192
196
|
option: e,
|
|
193
|
-
chainId:
|
|
197
|
+
chainId: a,
|
|
194
198
|
feeDisplay: b,
|
|
195
|
-
isSelected:
|
|
196
|
-
isDisabled:
|
|
199
|
+
isSelected: c === e.token.symbol,
|
|
200
|
+
isDisabled: s,
|
|
197
201
|
showRadio: !0,
|
|
198
|
-
onSelect: () =>
|
|
202
|
+
onSelect: () => x(e.token.symbol)
|
|
199
203
|
}, e.token.symbol || e.token.contractAddress)
|
|
200
|
-
}, e.token.symbol) : /* @__PURE__ */ r(
|
|
204
|
+
}, e.token.symbol) : /* @__PURE__ */ r(W, {
|
|
201
205
|
option: e,
|
|
202
|
-
chainId:
|
|
206
|
+
chainId: a,
|
|
203
207
|
feeDisplay: b,
|
|
204
|
-
isSelected:
|
|
205
|
-
isDisabled:
|
|
208
|
+
isSelected: c === e.token.symbol,
|
|
209
|
+
isDisabled: s,
|
|
206
210
|
showRadio: !0,
|
|
207
|
-
onSelect: () =>
|
|
211
|
+
onSelect: () => x(e.token.symbol)
|
|
208
212
|
}, e.token.symbol || e.token.contractAddress);
|
|
209
213
|
})
|
|
210
214
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ t("div", {
|
|
212
216
|
className: "flex flex-col space-y-3 sm:flex-row sm:space-y-0 sm:space-x-3",
|
|
213
|
-
children: [!
|
|
217
|
+
children: [!D && /* @__PURE__ */ r("div", {
|
|
214
218
|
className: "flex-1",
|
|
215
219
|
children: /* @__PURE__ */ r("button", {
|
|
216
220
|
type: "button",
|
|
217
|
-
onClick: () =>
|
|
218
|
-
disabled: !m ||
|
|
221
|
+
onClick: () => G(m?.token.contractAddress || null),
|
|
222
|
+
disabled: !m || f,
|
|
219
223
|
className: "w-full py-3 px-6 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-300 disabled:text-gray-500 text-white font-semibold rounded-lg transition-all duration-200 cursor-pointer disabled:cursor-not-allowed shadow-sm hover:shadow-md disabled:shadow-none flex items-center justify-center",
|
|
220
|
-
children:
|
|
224
|
+
children: f ? /* @__PURE__ */ t(R, { children: [/* @__PURE__ */ r("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2" }), "Processing..."] }) : "Confirm Fee"
|
|
221
225
|
})
|
|
222
226
|
}), /* @__PURE__ */ r("button", {
|
|
223
227
|
type: "button",
|
|
224
|
-
onClick:
|
|
225
|
-
disabled:
|
|
226
|
-
className: `px-6 py-3 bg-gray-100 hover:bg-gray-200 disabled:bg-gray-50 text-gray-700 font-semibold rounded-lg transition-all duration-200 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 flex items-center justify-center border border-gray-300 ${
|
|
227
|
-
children:
|
|
228
|
+
onClick: J,
|
|
229
|
+
disabled: f,
|
|
230
|
+
className: `px-6 py-3 bg-gray-100 hover:bg-gray-200 disabled:bg-gray-50 text-gray-700 font-semibold rounded-lg transition-all duration-200 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 flex items-center justify-center border border-gray-300 ${D ? "w-full sm:flex-1" : ""}`,
|
|
231
|
+
children: f ? /* @__PURE__ */ t(R, { children: [/* @__PURE__ */ r("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-gray-500 mr-2" }), "Processing..."] }) : "Cancel"
|
|
228
232
|
})]
|
|
229
233
|
})
|
|
230
234
|
]
|
|
231
|
-
}) : /* @__PURE__ */
|
|
235
|
+
}) : /* @__PURE__ */ t("div", {
|
|
232
236
|
className: "space-y-4 py-6",
|
|
233
237
|
children: [/* @__PURE__ */ r("div", {
|
|
234
238
|
className: "p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",
|
|
235
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ t("div", {
|
|
236
240
|
className: "flex items-start space-x-2",
|
|
237
241
|
children: [/* @__PURE__ */ r("svg", {
|
|
238
242
|
"aria-hidden": "true",
|
|
@@ -253,34 +257,34 @@ var x = (l) => "hasEnoughBalanceForFee" in l && "balance" in l, O = (l) => l?.co
|
|
|
253
257
|
})
|
|
254
258
|
}), /* @__PURE__ */ r("div", {
|
|
255
259
|
className: "flex flex-col space-y-2",
|
|
256
|
-
children:
|
|
257
|
-
const
|
|
258
|
-
return /* @__PURE__ */
|
|
260
|
+
children: k.map((e) => {
|
|
261
|
+
const s = e.token.contractAddress;
|
|
262
|
+
return /* @__PURE__ */ t("div", {
|
|
259
263
|
className: "flex items-center space-x-3 p-3 trails-bg-secondary trails-border-radius-container border border-transparent",
|
|
260
264
|
children: [/* @__PURE__ */ r("div", {
|
|
261
265
|
className: "flex items-center shrink-0",
|
|
262
|
-
children: /* @__PURE__ */ r(
|
|
266
|
+
children: /* @__PURE__ */ r(V, {
|
|
263
267
|
symbol: e.token.symbol,
|
|
264
268
|
imageUrl: e.token.logoURL,
|
|
265
|
-
chainId:
|
|
269
|
+
chainId: a,
|
|
266
270
|
size: 32
|
|
267
271
|
})
|
|
268
|
-
}), /* @__PURE__ */
|
|
272
|
+
}), /* @__PURE__ */ t("div", {
|
|
269
273
|
className: "flex-1 min-w-0 flex flex-col items-start",
|
|
270
274
|
children: [/* @__PURE__ */ r("span", {
|
|
271
275
|
className: "text-sm font-bold trails-text-primary leading-tight",
|
|
272
276
|
children: e.token.symbol
|
|
273
|
-
}),
|
|
277
|
+
}), s ? /* @__PURE__ */ t("div", {
|
|
274
278
|
className: "flex items-center space-x-1.5 mt-0.5",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
279
|
+
children: [/* @__PURE__ */ t("span", {
|
|
276
280
|
className: "text-xs trails-text-muted leading-tight",
|
|
277
281
|
children: [
|
|
278
|
-
|
|
282
|
+
s.slice(0, 4),
|
|
279
283
|
"...",
|
|
280
|
-
|
|
284
|
+
s.slice(-4)
|
|
281
285
|
]
|
|
282
|
-
}), /* @__PURE__ */ r(
|
|
283
|
-
text:
|
|
286
|
+
}), /* @__PURE__ */ r(_, {
|
|
287
|
+
text: s,
|
|
284
288
|
stopPropagation: !0,
|
|
285
289
|
className: "shrink-0 p-0.5",
|
|
286
290
|
size: "sm"
|
|
@@ -290,15 +294,15 @@ var x = (l) => "hasEnoughBalanceForFee" in l && "balance" in l, O = (l) => l?.co
|
|
|
290
294
|
children: "Native Token"
|
|
291
295
|
})]
|
|
292
296
|
})]
|
|
293
|
-
}, e.token.symbol ||
|
|
297
|
+
}, e.token.symbol || s);
|
|
294
298
|
})
|
|
295
299
|
})]
|
|
296
300
|
});
|
|
297
|
-
},
|
|
301
|
+
}, ce = () => /* @__PURE__ */ r("div", {
|
|
298
302
|
className: "space-y-4 py-6",
|
|
299
303
|
children: /* @__PURE__ */ r("div", {
|
|
300
304
|
className: "p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",
|
|
301
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ t("div", {
|
|
302
306
|
className: "flex items-start space-x-2",
|
|
303
307
|
children: [/* @__PURE__ */ r("svg", {
|
|
304
308
|
"aria-hidden": "true",
|
|
@@ -312,7 +316,7 @@ var x = (l) => "hasEnoughBalanceForFee" in l && "balance" in l, O = (l) => l?.co
|
|
|
312
316
|
strokeWidth: 2,
|
|
313
317
|
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
314
318
|
})
|
|
315
|
-
}), /* @__PURE__ */
|
|
319
|
+
}), /* @__PURE__ */ t("p", {
|
|
316
320
|
className: "text-sm text-red-800 dark:text-red-200 font-medium",
|
|
317
321
|
children: [
|
|
318
322
|
"Sequence fee options require adapter-owned Sequence support. Pass the matching wagmi adapter through ",
|
|
@@ -328,18 +332,18 @@ var x = (l) => "hasEnoughBalanceForFee" in l && "balance" in l, O = (l) => l?.co
|
|
|
328
332
|
})]
|
|
329
333
|
})
|
|
330
334
|
})
|
|
331
|
-
}),
|
|
332
|
-
const { sequenceSupport: i } =
|
|
333
|
-
return
|
|
334
|
-
|
|
335
|
-
}, [
|
|
335
|
+
}), ve = (a) => {
|
|
336
|
+
const { sequenceSupport: i } = re(), n = i?.WaasFeeOptionsController, { chainId: u, setIsError: o } = a;
|
|
337
|
+
return I(() => {
|
|
338
|
+
n || o?.(!0);
|
|
339
|
+
}, [n, o]), n ? /* @__PURE__ */ r(n, {
|
|
336
340
|
chainId: u,
|
|
337
|
-
children: (
|
|
338
|
-
...
|
|
339
|
-
...
|
|
341
|
+
children: (d) => /* @__PURE__ */ r(oe, {
|
|
342
|
+
...a,
|
|
343
|
+
...d
|
|
340
344
|
})
|
|
341
|
-
}) : /* @__PURE__ */ r(
|
|
345
|
+
}) : /* @__PURE__ */ r(ce, {});
|
|
342
346
|
};
|
|
343
347
|
export {
|
|
344
|
-
|
|
348
|
+
ve as default
|
|
345
349
|
};
|