@use-glyph/sdk-react 2.0.0-rc.4 → 2.0.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/glyph-widget.es.js +20 -19
- package/dist/glyph-widget.umd.js +27 -27
- package/dist/glyph-widget.umd.js.map +1 -1
- package/dist/index.js +87 -85
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/lib/relay.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23098,10 +23098,14 @@ async function Rk(e) {
|
|
|
23098
23098
|
throw console.error(d), d;
|
|
23099
23099
|
}
|
|
23100
23100
|
}
|
|
23101
|
-
const xl = 792703809,
|
|
23101
|
+
const xl = 792703809, ht = xk({
|
|
23102
23102
|
baseApiUrl: qo,
|
|
23103
23103
|
source: "useglyph.io"
|
|
23104
|
-
}),
|
|
23104
|
+
}), UM = (e) => {
|
|
23105
|
+
ht.configure({
|
|
23106
|
+
chains: e
|
|
23107
|
+
});
|
|
23108
|
+
}, Fk = /^0x[a-fA-F0-9]{40}$/, Mk = /https?:\/\/(?:[a-zA-Z0-9-]+\.)*twimg\.com/, Vk = hE({
|
|
23105
23109
|
prefix: "gw-"
|
|
23106
23110
|
});
|
|
23107
23111
|
function ae(...e) {
|
|
@@ -23111,7 +23115,7 @@ function Wk(e) {
|
|
|
23111
23115
|
return !window.isSecureContext || !e ? !1 : (navigator.clipboard.writeText(e), !0);
|
|
23112
23116
|
}
|
|
23113
23117
|
const Ga = (e) => `https://effigy.im/a/${e || "0x0000000000000000000000000000000000000000"}.svg`;
|
|
23114
|
-
function
|
|
23118
|
+
function IM(e) {
|
|
23115
23119
|
return e ? Fk.test(e) : !1;
|
|
23116
23120
|
}
|
|
23117
23121
|
const Lk = "GlyphWidget", rs = (e) => {
|
|
@@ -23181,14 +23185,14 @@ function eu(e, t) {
|
|
|
23181
23185
|
return r.blockExplorers.default.name;
|
|
23182
23186
|
}
|
|
23183
23187
|
function zk() {
|
|
23184
|
-
const e =
|
|
23188
|
+
const e = ht?.chains, t = /* @__PURE__ */ new Map();
|
|
23185
23189
|
return e.forEach((r) => {
|
|
23186
23190
|
r.id && r.iconUrl && t.set(r.id, r.iconUrl);
|
|
23187
23191
|
}), { chains: e, iconMap: t };
|
|
23188
23192
|
}
|
|
23189
|
-
const Dk = (e) =>
|
|
23193
|
+
const Dk = (e) => ht?.chains?.find((t) => t.id === e) || null, tu = (e, t) => {
|
|
23190
23194
|
if (!e || !t || e?.chainId !== t?.chainId || ![e?.address?.toLowerCase?.(), t?.address?.toLowerCase?.()].includes(Bt)) return !1;
|
|
23191
|
-
const n = (
|
|
23195
|
+
const n = (ht?.chains || []).find((a) => a.id === e.chainId)?.wrappedTokenAddress;
|
|
23192
23196
|
return !![e?.address?.toLowerCase?.(), t?.address?.toLowerCase?.()].includes(
|
|
23193
23197
|
n?.toLowerCase?.()
|
|
23194
23198
|
);
|
|
@@ -24857,7 +24861,7 @@ Gm.displayName = Dm;
|
|
|
24857
24861
|
function xc(e) {
|
|
24858
24862
|
return e ? "open" : "closed";
|
|
24859
24863
|
}
|
|
24860
|
-
var Zm = "DialogTitleWarning", [
|
|
24864
|
+
var Zm = "DialogTitleWarning", [NM, Qm] = bA(Zm, {
|
|
24861
24865
|
contentName: yn,
|
|
24862
24866
|
titleName: Cc,
|
|
24863
24867
|
docsSlug: "dialog"
|
|
@@ -25449,7 +25453,7 @@ function dT({ open: e, onOpenChange: t, children: r, onDrag: n, onRelease: a, sn
|
|
|
25449
25453
|
document.body.style.pointerEvents = "auto";
|
|
25450
25454
|
}), ue || (document.body.style.pointerEvents = "auto");
|
|
25451
25455
|
}
|
|
25452
|
-
}), [K, G] = O.useState(!1), [Y, j] = O.useState(!1), [H, te] = O.useState(!1), _ = O.useRef(null), $ = O.useRef(null), Q = O.useRef(null), se = O.useRef(null), ce = O.useRef(null), ne = O.useRef(!1), he = O.useRef(null), Ce = O.useRef(0), Fe = O.useRef(!1), Te = O.useRef(!U), Be = O.useRef(0), ie = O.useRef(null), Qt = O.useRef(((T = ie.current) == null ? void 0 : T.getBoundingClientRect().height) || 0),
|
|
25456
|
+
}), [K, G] = O.useState(!1), [Y, j] = O.useState(!1), [H, te] = O.useState(!1), _ = O.useRef(null), $ = O.useRef(null), Q = O.useRef(null), se = O.useRef(null), ce = O.useRef(null), ne = O.useRef(!1), he = O.useRef(null), Ce = O.useRef(0), Fe = O.useRef(!1), Te = O.useRef(!U), Be = O.useRef(0), ie = O.useRef(null), Qt = O.useRef(((T = ie.current) == null ? void 0 : T.getBoundingClientRect().height) || 0), ft = O.useRef(((M = ie.current) == null ? void 0 : M.getBoundingClientRect().width) || 0), lt = O.useRef(0), le = O.useCallback((ue) => {
|
|
25453
25457
|
s && ue === ze.length - 1 && ($.current = /* @__PURE__ */ new Date());
|
|
25454
25458
|
}, []), { activeSnapPoint: ve, activeSnapPointIndex: pt, setActiveSnapPoint: de, onRelease: me, snapPointsOffset: ze, onDrag: Vt, shouldFade: _e, getPercentageDragged: kt } = oT({
|
|
25455
25459
|
snapPoints: s,
|
|
@@ -25479,7 +25483,7 @@ function dT({ open: e, onOpenChange: t, children: r, onDrag: n, onRelease: a, sn
|
|
|
25479
25483
|
}
|
|
25480
25484
|
function w(ue) {
|
|
25481
25485
|
var Re, Ve;
|
|
25482
|
-
!p && !s || ie.current && !ie.current.contains(ue.target) || (Qt.current = ((Re = ie.current) == null ? void 0 : Re.getBoundingClientRect().height) || 0,
|
|
25486
|
+
!p && !s || ie.current && !ie.current.contains(ue.target) || (Qt.current = ((Re = ie.current) == null ? void 0 : Re.getBoundingClientRect().height) || 0, ft.current = ((Ve = ie.current) == null ? void 0 : Ve.getBoundingClientRect().width) || 0, j(!0), Q.current = /* @__PURE__ */ new Date(), Hm() && window.addEventListener("touchend", () => ne.current = !1, {
|
|
25483
25487
|
once: !0
|
|
25484
25488
|
}), ue.target.setPointerCapture(ue.pointerId), Ce.current = ct(S) ? ue.pageY : ue.pageX);
|
|
25485
25489
|
}
|
|
@@ -25514,7 +25518,7 @@ function dT({ open: e, onOpenChange: t, children: r, onDrag: n, onRelease: a, sn
|
|
|
25514
25518
|
if (ie.current && Y) {
|
|
25515
25519
|
const Re = S === "bottom" || S === "right" ? 1 : -1, Ve = (Ce.current - (ct(S) ? ue.pageY : ue.pageX)) * Re, Se = Ve > 0, $e = s && !p && !Se;
|
|
25516
25520
|
if ($e && pt === 0) return;
|
|
25517
|
-
const pe = Math.abs(Ve), Ue = document.querySelector("[data-vaul-drawer-wrapper]"), Pe = S === "bottom" || S === "top" ? Qt.current :
|
|
25521
|
+
const pe = Math.abs(Ve), Ue = document.querySelector("[data-vaul-drawer-wrapper]"), Pe = S === "bottom" || S === "top" ? Qt.current : ft.current;
|
|
25518
25522
|
let Ye = pe / Pe;
|
|
25519
25523
|
const Jt = kt(pe, Se);
|
|
25520
25524
|
if (Jt !== null && (Ye = Jt), $e && Ye >= 1 || !ne.current && !I(ue.target, Se)) return;
|
|
@@ -28017,7 +28021,7 @@ function TI(e) {
|
|
|
28017
28021
|
}
|
|
28018
28022
|
const UI = (e) => {
|
|
28019
28023
|
var t, r, n, a, s, o, i, l, u;
|
|
28020
|
-
const { invert: p, toast: d, unstyled: m, interacting: f, setHeights: y, visibleToasts: C, heights: b, index: E, toasts: k, expanded: x, removeToast: S, defaultRichColors: U, closeButton: B, style: N, cancelButtonStyle: V, actionButtonStyle: W, className: P = "", descriptionClassName: J = "", duration: D, position: T, gap: M, expandByDefault: F, classNames: q, icons: K, closeButtonAriaLabel: G = "Close toast" } = e, [Y, j] = O.useState(null), [H, te] = O.useState(null), [_, $] = O.useState(!1), [Q, se] = O.useState(!1), [ce, ne] = O.useState(!1), [he, Ce] = O.useState(!1), [Fe, Te] = O.useState(!1), [Be, ie] = O.useState(0), [Qt,
|
|
28024
|
+
const { invert: p, toast: d, unstyled: m, interacting: f, setHeights: y, visibleToasts: C, heights: b, index: E, toasts: k, expanded: x, removeToast: S, defaultRichColors: U, closeButton: B, style: N, cancelButtonStyle: V, actionButtonStyle: W, className: P = "", descriptionClassName: J = "", duration: D, position: T, gap: M, expandByDefault: F, classNames: q, icons: K, closeButtonAriaLabel: G = "Close toast" } = e, [Y, j] = O.useState(null), [H, te] = O.useState(null), [_, $] = O.useState(!1), [Q, se] = O.useState(!1), [ce, ne] = O.useState(!1), [he, Ce] = O.useState(!1), [Fe, Te] = O.useState(!1), [Be, ie] = O.useState(0), [Qt, ft] = O.useState(0), lt = O.useRef(d.duration || D || Vu), le = O.useRef(null), ve = O.useRef(null), pt = E === 0, de = E + 1 <= C, me = d.type, ze = d.dismissible !== !1, Vt = d.className || "", _e = d.descriptionClassName || "", kt = O.useMemo(() => b.findIndex((pe) => pe.toastId === d.id) || 0, [
|
|
28021
28025
|
b,
|
|
28022
28026
|
d.id
|
|
28023
28027
|
]), v = O.useMemo(() => {
|
|
@@ -28046,7 +28050,7 @@ const UI = (e) => {
|
|
|
28046
28050
|
const pe = ve.current;
|
|
28047
28051
|
if (pe) {
|
|
28048
28052
|
const Ue = pe.getBoundingClientRect().height;
|
|
28049
|
-
return
|
|
28053
|
+
return ft(Ue), y((Pe) => [
|
|
28050
28054
|
{
|
|
28051
28055
|
toastId: d.id,
|
|
28052
28056
|
height: Ue,
|
|
@@ -28063,7 +28067,7 @@ const UI = (e) => {
|
|
|
28063
28067
|
const pe = ve.current, Ue = pe.style.height;
|
|
28064
28068
|
pe.style.height = "auto";
|
|
28065
28069
|
const Pe = pe.getBoundingClientRect().height;
|
|
28066
|
-
pe.style.height = Ue,
|
|
28070
|
+
pe.style.height = Ue, ft(Pe), y((Ye) => Ye.find((Ge) => Ge.toastId === d.id) ? Ye.map((Ge) => Ge.toastId === d.id ? {
|
|
28067
28071
|
...Ge,
|
|
28068
28072
|
height: Pe
|
|
28069
28073
|
} : Ge) : [
|
|
@@ -29181,7 +29185,7 @@ var Bl = "TooltipTrigger", Qh = R.forwardRef(
|
|
|
29181
29185
|
}
|
|
29182
29186
|
);
|
|
29183
29187
|
Qh.displayName = Bl;
|
|
29184
|
-
var tN = "TooltipPortal", [
|
|
29188
|
+
var tN = "TooltipPortal", [BM, rN] = ei(tN, {
|
|
29185
29189
|
forceMount: void 0
|
|
29186
29190
|
}), ea = "TooltipContent", Jh = R.forwardRef(
|
|
29187
29191
|
(e, t) => {
|
|
@@ -30115,7 +30119,7 @@ const FN = (e) => /* @__PURE__ */ c("svg", { width: "23", height: "19", viewBox:
|
|
|
30115
30119
|
}, WN = wt(VN);
|
|
30116
30120
|
var LN = /* @__PURE__ */ ((e) => (e.FUND = "FUND", e.SWAP = "SWAP", e.WITHDRAW = "WITHDRAW", e))(LN || {}), ON = /* @__PURE__ */ ((e) => (e.SEND = "SEND", e.RECEIVE = "RECEIVE", e.TRANSFER = "TRANSFER", e.PAY = "PAY", e))(ON || {});
|
|
30117
30121
|
function qN(e = 10, t) {
|
|
30118
|
-
const r =
|
|
30122
|
+
const r = ht?.chains || [], { fetchForAllNetworks: n } = qe(), { glyphApiFetch: a } = sn(), s = Gt(), [o, i] = re(0), [l, u] = re(!0), [p, d] = re(!1), [m, f] = re([]), y = nt(
|
|
30119
30123
|
async (k = !1) => {
|
|
30120
30124
|
try {
|
|
30121
30125
|
d(!0);
|
|
@@ -30196,7 +30200,7 @@ function KN(e) {
|
|
|
30196
30200
|
] });
|
|
30197
30201
|
}
|
|
30198
30202
|
function zN({ data: e }) {
|
|
30199
|
-
const t = e?.chain_id ?
|
|
30203
|
+
const t = e?.chain_id ? ht.chains.find((r) => r.id === e.chain_id) : void 0;
|
|
30200
30204
|
return /* @__PURE__ */ A("div", { className: "gw-flex gw-items-center gw-typography-body1 gw-flex-1 gw-space-x-3", children: [
|
|
30201
30205
|
/* @__PURE__ */ A("span", { className: "gw-relative gw-flex-shrink-0", children: [
|
|
30202
30206
|
/* @__PURE__ */ c(
|
|
@@ -31181,7 +31185,7 @@ const br = ({
|
|
|
31181
31185
|
)
|
|
31182
31186
|
] });
|
|
31183
31187
|
function kB() {
|
|
31184
|
-
const e =
|
|
31188
|
+
const e = ht.chains, { balances: t, hasBalances: r, fetchForAllNetworks: n } = oi(), a = t?.tokens || [], s = t?.wallet_value?.tokens;
|
|
31185
31189
|
return /* @__PURE__ */ A("div", { className: "gw-pl-4 gw-pt-4 gw-flex gw-flex-col gw-h-full gw-min-h-0", children: [
|
|
31186
31190
|
/* @__PURE__ */ A("div", { className: "gw-flex gw-justify-between gw-items-center gw-w-full gw-pr-4", children: [
|
|
31187
31191
|
/* @__PURE__ */ c("h6", { children: "Tokens" }),
|
|
@@ -32385,7 +32389,7 @@ const GB = ({
|
|
|
32385
32389
|
onTokenSelect: e,
|
|
32386
32390
|
selectedToken: t
|
|
32387
32391
|
}) => {
|
|
32388
|
-
const r =
|
|
32392
|
+
const r = ht.chains || [], [n, a] = re(!1), s = Gt(), { switchChainAsync: o } = Ql(), { balances: i, hasBalances: l, fetchForAllNetworks: u, setFetchForAllNetworks: p } = oi(), d = u ? "all" : s, m = Oe(() => t?.chainId ? r.find((b) => b.id === t.chainId) : null, [t?.chainId]), [f] = Oe(() => d === "all" ? [null] : [r.find((E) => E.id === d)], [d]), y = vo(null);
|
|
32389
32393
|
xe(() => {
|
|
32390
32394
|
y.current = document.querySelector(".gw-wallet-container");
|
|
32391
32395
|
}, []);
|
|
@@ -33062,7 +33066,7 @@ function rR({ onBack: e, onEnd: t, onShowActivity: r, setGradientType: n }) {
|
|
|
33062
33066
|
const de = setInterval(() => Qt(), j ? eR : 0);
|
|
33063
33067
|
return () => clearInterval(de);
|
|
33064
33068
|
}, [G, j, Qt]);
|
|
33065
|
-
const
|
|
33069
|
+
const ft = Oe(
|
|
33066
33070
|
() => _o(500, (de) => {
|
|
33067
33071
|
T(null), W(Number(de));
|
|
33068
33072
|
}),
|
|
@@ -33183,7 +33187,7 @@ function rR({ onBack: e, onEnd: t, onShowActivity: r, setGradientType: n }) {
|
|
|
33183
33187
|
Q(!0);
|
|
33184
33188
|
} else
|
|
33185
33189
|
_(null), Q(!1);
|
|
33186
|
-
|
|
33190
|
+
ft(me), N(me), J(!1);
|
|
33187
33191
|
},
|
|
33188
33192
|
placeholder: "0",
|
|
33189
33193
|
className: ae(
|
|
@@ -33210,7 +33214,7 @@ function rR({ onBack: e, onEnd: t, onShowActivity: r, setGradientType: n }) {
|
|
|
33210
33214
|
className: "gw-rounded-lg gw-py-1 gw-px-2 gw-h-auto gw-w-16",
|
|
33211
33215
|
onClick: () => {
|
|
33212
33216
|
const de = P ? "" : `${+(x?.value || 0) || ""}`;
|
|
33213
|
-
N(de),
|
|
33217
|
+
N(de), ft(de), J((me) => !me);
|
|
33214
33218
|
},
|
|
33215
33219
|
children: /* @__PURE__ */ c("span", { className: "gw-typography-overline", children: P ? "Clear" : "Max" })
|
|
33216
33220
|
}
|
|
@@ -33442,11 +33446,11 @@ const oR = () => {
|
|
|
33442
33446
|
handleSignMessageStep: async (o) => {
|
|
33443
33447
|
const i = o.data?.sign;
|
|
33444
33448
|
let l;
|
|
33445
|
-
return i && (i.signatureKind === "eip191" ? (
|
|
33449
|
+
return i && (i.signatureKind === "eip191" ? (ht.log(["Execute Steps: Signing with eip191"], oe.Verbose), i.message.match(/0x[0-9a-fA-F]{64}/) ? l = await t({
|
|
33446
33450
|
message: i.message
|
|
33447
33451
|
}) : l = await t({
|
|
33448
33452
|
message: i.message
|
|
33449
|
-
})) : i.signatureKind === "eip712" && (
|
|
33453
|
+
})) : i.signatureKind === "eip712" && (ht.log(["Execute Steps: Signing with eip712"], oe.Verbose), l = await r({
|
|
33450
33454
|
data: {
|
|
33451
33455
|
domain: i.domain,
|
|
33452
33456
|
types: i.types,
|
|
@@ -33498,7 +33502,7 @@ const oR = () => {
|
|
|
33498
33502
|
if (!o.ok) throw new Error("Failed to fetch transactions");
|
|
33499
33503
|
const i = await a.getChainId();
|
|
33500
33504
|
s && s !== i && (console.log("Switching chain from", i, "to", s), await a.switchChain(s));
|
|
33501
|
-
const { id: l, quote: u } = await o.json(), p = await
|
|
33505
|
+
const { id: l, quote: u } = await o.json(), p = await ht.actions.execute({
|
|
33502
33506
|
quote: u,
|
|
33503
33507
|
wallet: a
|
|
33504
33508
|
}).catch(async (m) => {
|
|
@@ -33578,7 +33582,7 @@ const oR = () => {
|
|
|
33578
33582
|
queryFn: async () => {
|
|
33579
33583
|
cn(u), cn(p), cn(r), cn(n), cn(s);
|
|
33580
33584
|
const b = r.chainId === xl ? p : u, E = n.chainId === xl ? p : u;
|
|
33581
|
-
return
|
|
33585
|
+
return ht.actions.getQuote({
|
|
33582
33586
|
tradeType: a,
|
|
33583
33587
|
chainId: r.chainId,
|
|
33584
33588
|
currency: r.address,
|
|
@@ -33665,7 +33669,7 @@ const mR = ({
|
|
|
33665
33669
|
selectedToken: t,
|
|
33666
33670
|
defaultChainId: r
|
|
33667
33671
|
}) => {
|
|
33668
|
-
const n =
|
|
33672
|
+
const n = ht.chains || [], a = Oe(() => n.map((N) => N.id), []), [s, o] = re(!1), [i, l] = re(r), u = Oe(() => t?.chainId ? n.find((N) => N.id === t.chainId) : null, [t?.chainId]), [p, d] = re(""), [m, f] = re(""), y = Oe(
|
|
33669
33673
|
() => _o(500, (N) => {
|
|
33670
33674
|
f(N);
|
|
33671
33675
|
}),
|
|
@@ -34028,7 +34032,7 @@ Please try again.` }),
|
|
|
34028
34032
|
sellAmount: r,
|
|
34029
34033
|
buyAmount: n
|
|
34030
34034
|
}) => {
|
|
34031
|
-
const a =
|
|
34035
|
+
const a = ht.chains || [], { fromCurrency: s, toCurrency: o } = is(), i = Oe(
|
|
34032
34036
|
() => a.find((u) => u.id === s?.chainId),
|
|
34033
34037
|
[s?.chainId]
|
|
34034
34038
|
), l = Oe(() => a.find((u) => u.id === o?.chainId), [o?.chainId]);
|
|
@@ -34125,7 +34129,7 @@ Please try again.` }),
|
|
|
34125
34129
|
buyAmount: n,
|
|
34126
34130
|
txDetails: a
|
|
34127
34131
|
}) => {
|
|
34128
|
-
const s =
|
|
34132
|
+
const s = ht.chains || [], { fromCurrency: o, toCurrency: i } = is(), l = Oe(
|
|
34129
34133
|
() => s.find((p) => p.id === o?.chainId),
|
|
34130
34134
|
[o?.chainId]
|
|
34131
34135
|
), u = Oe(() => s.find((p) => p.id === i?.chainId), [i?.chainId]);
|
|
@@ -34272,7 +34276,7 @@ function xR({ onBack: e, onEnd: t, onShowActivity: r, setGradientType: n }) {
|
|
|
34272
34276
|
error: Ce
|
|
34273
34277
|
} = Wl(f?.evmWallet, E?.address, E?.chainId), Fe = b?.decimals && H && Q !== void 0 && Number(Hr(Q, b?.decimals)) < Number(H) ? "Insufficient balance" : null, Te = M || // Error from swap intent status
|
|
34274
34278
|
K || // Error during execution
|
|
34275
|
-
(a === Wt.START ? V?.message || ce || Ce || Fe : void 0), Be = Number(B?.fees?.app?.amountUsd || "0"), ie = Math.abs(Number(B?.details?.totalImpact?.usd || "0")), Qt = Math.abs(ie - Be),
|
|
34279
|
+
(a === Wt.START ? V?.message || ce || Ce || Fe : void 0), Be = Number(B?.fees?.app?.amountUsd || "0"), ie = Math.abs(Number(B?.details?.totalImpact?.usd || "0")), Qt = Math.abs(ie - Be), ft = B?.details?.currencyIn?.amountUsd ? Number(B?.details?.currencyIn?.amountUsd) : void 0, lt = B?.details?.currencyOut?.amountUsd ? Number(B?.details?.currencyOut?.amountUsd) : void 0;
|
|
34276
34280
|
return /* @__PURE__ */ A(ke, { children: [
|
|
34277
34281
|
a === Wt.START && /* @__PURE__ */ c(
|
|
34278
34282
|
xt,
|
|
@@ -34350,7 +34354,7 @@ function xR({ onBack: e, onEnd: t, onShowActivity: r, setGradientType: n }) {
|
|
|
34350
34354
|
}
|
|
34351
34355
|
) }),
|
|
34352
34356
|
/* @__PURE__ */ A("div", { className: "gw-flex gw-justify-between gw-items-center gw-w-full gw-text-brand-gray-500", children: [
|
|
34353
|
-
|
|
34357
|
+
ft === void 0 ? /* @__PURE__ */ c("div", { className: "gw-h-4 gw-w-1" }) : /* @__PURE__ */ c("div", { className: "gw-typography-caption", children: ft < 0.01 ? "<$0.01" : `${Qe(ft || "0", "USD")}` }),
|
|
34354
34358
|
/* @__PURE__ */ c(ke, { children: se ? /* @__PURE__ */ c("div", { className: "gw-typography-caption gw-flex gw-items-center gw-mr-4", children: /* @__PURE__ */ c(Je, { className: "gw-h-4 gw-w-10 gw-inline-block gw-ml-0.5" }) }) : Q !== void 0 && b?.decimals ? /* @__PURE__ */ A("div", { className: "gw-typography-caption gw-flex gw-items-center gw-mr-4", children: [
|
|
34355
34359
|
Za(
|
|
34356
34360
|
parseFloat(Hr(Q, b?.decimals)),
|
|
@@ -34496,7 +34500,7 @@ function xR({ onBack: e, onEnd: t, onShowActivity: r, setGradientType: n }) {
|
|
|
34496
34500
|
] }),
|
|
34497
34501
|
/* @__PURE__ */ A("div", { className: "gw-flex gw-justify-between gw-items-center gw-mt-1", children: [
|
|
34498
34502
|
/* @__PURE__ */ c("span", { children: "Total" }),
|
|
34499
|
-
/* @__PURE__ */ c("div", { className: "gw-text-foreground gw-font-medium", children: B &&
|
|
34503
|
+
/* @__PURE__ */ c("div", { className: "gw-text-foreground gw-font-medium", children: B && ft ? ft < 0.01 ? "<$0.01" : `${Qe(ft || "0", "USD")}` : N ? /* @__PURE__ */ c(Je, { className: "gw-w-6 gw-h-3.5" }) : "-" })
|
|
34500
34504
|
] })
|
|
34501
34505
|
] })
|
|
34502
34506
|
] }),
|
|
@@ -34642,7 +34646,7 @@ const Zu = wt(
|
|
|
34642
34646
|
alt: "failed-gradient",
|
|
34643
34647
|
className: "gw-absolute gw-top-0 gw-left-0 gw-w-full gw-h-full gw-object-cover gw-object-left-bottom gw-z-0 gw-pointer-events-none gw-rounded-t-3xl md:gw-rounded-3xl"
|
|
34644
34648
|
}
|
|
34645
|
-
) : null,
|
|
34649
|
+
) : null, MM = ({ buttonProps: e }) => {
|
|
34646
34650
|
const t = "light", r = Mx("(min-width: 768px)"), n = Cr(Ao);
|
|
34647
34651
|
if (!n) throw new Error("GlyphWidget must be used within a GlyphViewProvider");
|
|
34648
34652
|
const { glyphView: a, setGlyphView: s } = n, { ready: o, authenticated: i, user: l, hideWidget: u } = qe();
|
|
@@ -34685,10 +34689,10 @@ const Zu = wt(
|
|
|
34685
34689
|
}
|
|
34686
34690
|
)
|
|
34687
34691
|
) }) : /* @__PURE__ */ c(gm, {}) });
|
|
34688
|
-
},
|
|
34692
|
+
}, VM = () => {
|
|
34689
34693
|
const { logout: e } = qe();
|
|
34690
34694
|
return /* @__PURE__ */ c(Ae, { className: "gw-w-full", variant: "outline", onClick: e, children: "Logout" });
|
|
34691
|
-
},
|
|
34695
|
+
}, WM = () => {
|
|
34692
34696
|
const { glyphUrl: e } = qe(), t = new URL("/", e).toString();
|
|
34693
34697
|
return e ? /* @__PURE__ */ c(
|
|
34694
34698
|
Ae,
|
|
@@ -34913,13 +34917,13 @@ const kR = ({ children: e }) => {
|
|
|
34913
34917
|
const s = ko();
|
|
34914
34918
|
xe(() => {
|
|
34915
34919
|
if (s.chains) {
|
|
34916
|
-
const p = new Set(
|
|
34920
|
+
const p = new Set(ht.chains.map((f) => f.id)), d = new Set(s.chains.map((f) => f.id));
|
|
34917
34921
|
if (!((f, y) => f.size === y.size && [...f].every((C) => y.has(C)))(p, d))
|
|
34918
34922
|
throw new Error(
|
|
34919
34923
|
"Chain mismatch detected. Please use `useGlyphConfigureDynamicChains` from `@use-glyph/sdk-react` to configure chains dynamically."
|
|
34920
34924
|
);
|
|
34921
34925
|
}
|
|
34922
|
-
}, [s.chains,
|
|
34926
|
+
}, [s.chains, ht.chains]);
|
|
34923
34927
|
const o = Oe(
|
|
34924
34928
|
() => ({
|
|
34925
34929
|
[On.EIP1193]: TR,
|
|
@@ -34946,7 +34950,7 @@ const kR = ({ children: e }) => {
|
|
|
34946
34950
|
if (Array.isArray(l.supportedChains) && Array.isArray(l.chains) && l.supportedChains.length > 0 && l.chains.length > 0)
|
|
34947
34951
|
r(l.supportedChains), a(
|
|
34948
34952
|
l.chains.map((u) => uc(u).viemChain)
|
|
34949
|
-
),
|
|
34953
|
+
), ht.configure({
|
|
34950
34954
|
chains: l.chains
|
|
34951
34955
|
});
|
|
34952
34956
|
else
|
|
@@ -34954,7 +34958,7 @@ const kR = ({ children: e }) => {
|
|
|
34954
34958
|
})();
|
|
34955
34959
|
}, [e, t]), { chainIds: t, chains: n };
|
|
34956
34960
|
};
|
|
34957
|
-
function
|
|
34961
|
+
function LM() {
|
|
34958
34962
|
const { user: e } = qe(), t = Gt(), { glyphApiFetch: r } = sn(), [n, a] = re(!1);
|
|
34959
34963
|
return { checkTokenGate: nt(async (o) => {
|
|
34960
34964
|
try {
|
|
@@ -34971,7 +34975,7 @@ function WM() {
|
|
|
34971
34975
|
}
|
|
34972
34976
|
}, [t, e, r, a]), isTokenGateLoading: n };
|
|
34973
34977
|
}
|
|
34974
|
-
function
|
|
34978
|
+
function OM() {
|
|
34975
34979
|
const { user: e } = qe(), t = Gt(), { glyphApiFetch: r } = sn(), [n, a] = re(!1);
|
|
34976
34980
|
return { checkOwnership: nt(async (o) => {
|
|
34977
34981
|
try {
|
|
@@ -34988,7 +34992,7 @@ function LM() {
|
|
|
34988
34992
|
}
|
|
34989
34993
|
}, [r, t]), isOwnershipCheckLoading: n };
|
|
34990
34994
|
}
|
|
34991
|
-
const
|
|
34995
|
+
const qM = () => {
|
|
34992
34996
|
const e = Cr(Ao);
|
|
34993
34997
|
if (e === void 0) throw new Error("useGlyphView must be used within a GlyphViewProvider");
|
|
34994
34998
|
const { setGlyphView: t } = e;
|
|
@@ -35006,7 +35010,7 @@ const OM = () => {
|
|
|
35006
35010
|
}, [e, t]),
|
|
35007
35011
|
disconnect: r
|
|
35008
35012
|
};
|
|
35009
|
-
},
|
|
35013
|
+
}, KM = () => {
|
|
35010
35014
|
const { connect: e } = UR(), { isConnected: t, isConnecting: r } = wp();
|
|
35011
35015
|
return t ? /* @__PURE__ */ c(gm, {}) : r ? /* @__PURE__ */ c(Ae, { variant: "default", size: "login", disabled: !0, children: /* @__PURE__ */ A("span", { className: "gw-inline-flex gw-items-center gw-w-full gw-gap-1", children: [
|
|
35012
35016
|
/* @__PURE__ */ c("span", { className: "gw-p-2 gw-rounded-full", children: /* @__PURE__ */ c(wn, { className: "!gw-size-5" }) }),
|
|
@@ -37499,7 +37503,7 @@ function bF() {
|
|
|
37499
37503
|
);
|
|
37500
37504
|
}
|
|
37501
37505
|
const Qt = /[^+/0-9A-Za-z-_]/g;
|
|
37502
|
-
function
|
|
37506
|
+
function ft(v) {
|
|
37503
37507
|
if (v = v.split("=")[0], v = v.trim().replace(Qt, ""), v.length < 2) return "";
|
|
37504
37508
|
for (; v.length % 4 !== 0; )
|
|
37505
37509
|
v = v + "=";
|
|
@@ -37573,7 +37577,7 @@ function bF() {
|
|
|
37573
37577
|
return z;
|
|
37574
37578
|
}
|
|
37575
37579
|
function pt(v) {
|
|
37576
|
-
return t.toByteArray(
|
|
37580
|
+
return t.toByteArray(ft(v));
|
|
37577
37581
|
}
|
|
37578
37582
|
function de(v, g, w, I) {
|
|
37579
37583
|
let L;
|
|
@@ -38351,25 +38355,22 @@ function HF(e = {}) {
|
|
|
38351
38355
|
};
|
|
38352
38356
|
};
|
|
38353
38357
|
}
|
|
38354
|
-
const jF = new vp(),
|
|
38358
|
+
const jF = new vp(), ZM = ({
|
|
38355
38359
|
queryClient: e = jF,
|
|
38356
38360
|
children: t,
|
|
38357
38361
|
ssr: r,
|
|
38358
38362
|
...n
|
|
38359
38363
|
}) => {
|
|
38360
|
-
const { chains: a } = If(), s = Oe(
|
|
38361
|
-
|
|
38362
|
-
|
|
38363
|
-
|
|
38364
|
-
|
|
38365
|
-
|
|
38366
|
-
|
|
38367
|
-
|
|
38368
|
-
|
|
38369
|
-
|
|
38370
|
-
}) : null,
|
|
38371
|
-
[a, n.useStagingTenant, r]
|
|
38372
|
-
);
|
|
38364
|
+
const { chains: a } = If(n.glyphUrl), s = Oe(() => a && a.length > 0 ? b0({
|
|
38365
|
+
chains: a,
|
|
38366
|
+
ssr: r,
|
|
38367
|
+
connectors: [HF({ useStagingTenant: n.useStagingTenant })],
|
|
38368
|
+
transports: a.reduce(
|
|
38369
|
+
(o, i) => (o[i.id] = It(), o),
|
|
38370
|
+
{}
|
|
38371
|
+
),
|
|
38372
|
+
multiInjectedProviderDiscovery: !1
|
|
38373
|
+
}) : null, [a, n.useStagingTenant, r]);
|
|
38373
38374
|
return s ? /* @__PURE__ */ c(y0, { config: s, children: /* @__PURE__ */ c(Ep, { client: e, children: /* @__PURE__ */ c(
|
|
38374
38375
|
Uf,
|
|
38375
38376
|
{
|
|
@@ -38379,11 +38380,11 @@ const jF = new vp(), GM = ({
|
|
|
38379
38380
|
children: t
|
|
38380
38381
|
}
|
|
38381
38382
|
) }) }) : null;
|
|
38382
|
-
},
|
|
38383
|
+
}, QM = d0({
|
|
38383
38384
|
id: Rr,
|
|
38384
38385
|
name: Ot.name,
|
|
38385
38386
|
iconUrl: Ot.iconUrl
|
|
38386
|
-
}),
|
|
38387
|
+
}), JM = d0({
|
|
38387
38388
|
id: Fr,
|
|
38388
38389
|
name: Ot.name,
|
|
38389
38390
|
iconUrl: Ot.iconUrl
|
|
@@ -38586,7 +38587,7 @@ const jF = new vp(), GM = ({
|
|
|
38586
38587
|
}, [a, s, o, d, n, r, p]), xe(() => {
|
|
38587
38588
|
l && p.error("Connector error:", l);
|
|
38588
38589
|
}, [l, p]), /* @__PURE__ */ c(ke, { children: e });
|
|
38589
|
-
}, mp = `privy:${Rr}`, hp = `privy:${Fr}`,
|
|
38590
|
+
}, mp = `privy:${Rr}`, hp = `privy:${Fr}`, PM = ({
|
|
38590
38591
|
queryClient: e = new vp(),
|
|
38591
38592
|
glyphUrl: t,
|
|
38592
38593
|
useStagingTenant: r,
|
|
@@ -38595,7 +38596,7 @@ const jF = new vp(), GM = ({
|
|
|
38595
38596
|
onLogout: s,
|
|
38596
38597
|
...o
|
|
38597
38598
|
}) => {
|
|
38598
|
-
const { chains: i } = If(), l = Oe(() => {
|
|
38599
|
+
const { chains: i } = If(t), l = Oe(() => {
|
|
38599
38600
|
if (!(!i || i.length === 0))
|
|
38600
38601
|
return M0({
|
|
38601
38602
|
chains: i,
|
|
@@ -38637,42 +38638,43 @@ const jF = new vp(), GM = ({
|
|
|
38637
38638
|
) }) }) }) });
|
|
38638
38639
|
};
|
|
38639
38640
|
export {
|
|
38640
|
-
|
|
38641
|
-
|
|
38642
|
-
|
|
38641
|
+
JM as A,
|
|
38642
|
+
Nx as B,
|
|
38643
|
+
mp as C,
|
|
38643
38644
|
LN as D,
|
|
38644
|
-
|
|
38645
|
-
|
|
38645
|
+
PM as E,
|
|
38646
|
+
hp as F,
|
|
38646
38647
|
Rr as G,
|
|
38648
|
+
_F as H,
|
|
38647
38649
|
$F as I,
|
|
38648
38650
|
gm as L,
|
|
38649
|
-
|
|
38651
|
+
KM as N,
|
|
38650
38652
|
Fr as S,
|
|
38651
38653
|
Ix as W,
|
|
38652
38654
|
Jl as a,
|
|
38653
38655
|
cM as b,
|
|
38654
38656
|
rs as c,
|
|
38655
38657
|
Uf as d,
|
|
38656
|
-
|
|
38657
|
-
|
|
38658
|
-
|
|
38659
|
-
|
|
38660
|
-
|
|
38661
|
-
|
|
38662
|
-
|
|
38663
|
-
|
|
38664
|
-
|
|
38665
|
-
|
|
38658
|
+
MM as e,
|
|
38659
|
+
VM as f,
|
|
38660
|
+
WM as g,
|
|
38661
|
+
UM as h,
|
|
38662
|
+
IM as i,
|
|
38663
|
+
oi as j,
|
|
38664
|
+
qe as k,
|
|
38665
|
+
KI as l,
|
|
38666
|
+
qN as m,
|
|
38667
|
+
ON as n,
|
|
38666
38668
|
LM as o,
|
|
38667
38669
|
OM as p,
|
|
38668
|
-
|
|
38669
|
-
|
|
38670
|
-
|
|
38671
|
-
|
|
38672
|
-
|
|
38673
|
-
|
|
38674
|
-
|
|
38675
|
-
|
|
38670
|
+
qM as q,
|
|
38671
|
+
Ot as r,
|
|
38672
|
+
He as s,
|
|
38673
|
+
On as t,
|
|
38674
|
+
If as u,
|
|
38675
|
+
x1 as v,
|
|
38676
|
+
UR as w,
|
|
38677
|
+
HF as x,
|
|
38676
38678
|
ZM as y,
|
|
38677
38679
|
QM as z
|
|
38678
38680
|
};
|