@chainrails/react 0.2.23 → 0.2.25
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { jsxs as we, jsx as
|
|
1
|
+
import { useState as C, useRef as re, useEffect as x, useMemo as ye, useSyncExternalStore as Rt, useCallback as At, useLayoutEffect as vt, useDebugValue as Pt } from "react";
|
|
2
|
+
import { jsxs as we, jsx as M } from "react/jsx-runtime";
|
|
3
3
|
import './index.css';class G extends Error {
|
|
4
4
|
response;
|
|
5
5
|
request;
|
|
@@ -50,7 +50,7 @@ const be = (() => {
|
|
|
50
50
|
throw r;
|
|
51
51
|
}
|
|
52
52
|
return e && !t;
|
|
53
|
-
})(), It = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function",
|
|
53
|
+
})(), It = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function", Ut = typeof globalThis.FormData == "function", $e = ["get", "post", "put", "patch", "head", "delete"], xt = {
|
|
54
54
|
json: "application/json",
|
|
55
55
|
text: "text/*",
|
|
56
56
|
formData: "multipart/form-data",
|
|
@@ -59,7 +59,7 @@ const be = (() => {
|
|
|
59
59
|
// Supported in modern Fetch implementations (for example, browsers and recent Node.js/undici).
|
|
60
60
|
// We still feature-check at runtime before exposing the shortcut.
|
|
61
61
|
bytes: "*/*"
|
|
62
|
-
}, W = 2147483647,
|
|
62
|
+
}, W = 2147483647, kt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, ze = Symbol("stop");
|
|
63
63
|
class Le {
|
|
64
64
|
options;
|
|
65
65
|
constructor(t) {
|
|
@@ -104,7 +104,7 @@ const Dt = (e) => new Le(e), Ot = {
|
|
|
104
104
|
if (e instanceof FormData) {
|
|
105
105
|
let t = 0;
|
|
106
106
|
for (const [s, n] of e)
|
|
107
|
-
t +=
|
|
107
|
+
t += kt, t += new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length, t += typeof n == "string" ? new TextEncoder().encode(n).length : n.size;
|
|
108
108
|
return t;
|
|
109
109
|
}
|
|
110
110
|
if (e instanceof Blob)
|
|
@@ -164,25 +164,25 @@ const Dt = (e) => new Le(e), Ot = {
|
|
|
164
164
|
duplex: "half",
|
|
165
165
|
body: je(e.body, n, t)
|
|
166
166
|
});
|
|
167
|
-
}, I = (e) => e !== null && typeof e == "object",
|
|
167
|
+
}, I = (e) => e !== null && typeof e == "object", B = (...e) => {
|
|
168
168
|
for (const t of e)
|
|
169
169
|
if ((!I(t) || Array.isArray(t)) && t !== void 0)
|
|
170
170
|
throw new TypeError("The `options` argument must be an object");
|
|
171
171
|
return oe({}, ...e);
|
|
172
|
-
},
|
|
172
|
+
}, qe = (e = {}, t = {}) => {
|
|
173
173
|
const s = new globalThis.Headers(e), n = t instanceof globalThis.Headers, r = new globalThis.Headers(t);
|
|
174
174
|
for (const [i, o] of r.entries())
|
|
175
175
|
n && o === "undefined" || o === void 0 ? s.delete(i) : s.set(i, o);
|
|
176
176
|
return s;
|
|
177
177
|
};
|
|
178
|
-
function
|
|
178
|
+
function $(e, t, s) {
|
|
179
179
|
return Object.hasOwn(t, s) && t[s] === void 0 ? [] : oe(e[s] ?? [], t[s] ?? []);
|
|
180
180
|
}
|
|
181
|
-
const
|
|
182
|
-
beforeRequest:
|
|
183
|
-
beforeRetry:
|
|
184
|
-
afterResponse:
|
|
185
|
-
beforeError:
|
|
181
|
+
const _e = (e = {}, t = {}) => ({
|
|
182
|
+
beforeRequest: $(e, t, "beforeRequest"),
|
|
183
|
+
beforeRetry: $(e, t, "beforeRetry"),
|
|
184
|
+
afterResponse: $(e, t, "afterResponse"),
|
|
185
|
+
beforeError: $(e, t, "beforeError")
|
|
186
186
|
}), Lt = (e, t) => {
|
|
187
187
|
const s = new URLSearchParams();
|
|
188
188
|
for (const n of [e, t])
|
|
@@ -232,13 +232,13 @@ const qe = (e = {}, t = {}) => ({
|
|
|
232
232
|
}
|
|
233
233
|
I(c) && a in t && (c = oe(t[a], c)), t = { ...t, [a]: c };
|
|
234
234
|
}
|
|
235
|
-
I(o.hooks) && (n =
|
|
235
|
+
I(o.hooks) && (n = _e(n, o.hooks), t.hooks = n), I(o.headers) && (s = qe(s, o.headers), t.headers = s);
|
|
236
236
|
}
|
|
237
237
|
return r !== void 0 && (t.searchParams = r), i.length > 0 && (i.length === 1 ? t.signal = i[0] : Be ? t.signal = AbortSignal.any(i) : t.signal = i.at(-1)), t.context === void 0 && (t.context = {}), t;
|
|
238
|
-
}, jt = (e) => $e.includes(e) ? e.toUpperCase() : e,
|
|
238
|
+
}, jt = (e) => $e.includes(e) ? e.toUpperCase() : e, qt = ["get", "put", "head", "delete", "options", "trace"], _t = [408, 413, 429, 500, 502, 503, 504], Ft = [413, 429, 503], Ee = {
|
|
239
239
|
limit: 2,
|
|
240
|
-
methods:
|
|
241
|
-
statusCodes:
|
|
240
|
+
methods: qt,
|
|
241
|
+
statusCodes: _t,
|
|
242
242
|
afterStatusCodes: Ft,
|
|
243
243
|
maxRetryAfter: Number.POSITIVE_INFINITY,
|
|
244
244
|
backoffLimit: Number.POSITIVE_INFINITY,
|
|
@@ -323,7 +323,7 @@ class N {
|
|
|
323
323
|
if (n.#e.onDownloadProgress) {
|
|
324
324
|
if (typeof n.#e.onDownloadProgress != "function")
|
|
325
325
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
326
|
-
if (!
|
|
326
|
+
if (!Ct)
|
|
327
327
|
throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
328
328
|
return $t(o.clone(), n.#e.onDownloadProgress);
|
|
329
329
|
}
|
|
@@ -332,7 +332,7 @@ class N {
|
|
|
332
332
|
const o = n.#o, a = [];
|
|
333
333
|
o && !o.bodyUsed && a.push(o.body?.cancel()), n.request.bodyUsed || a.push(n.request.body?.cancel()), await Promise.all(a);
|
|
334
334
|
});
|
|
335
|
-
for (const [o, a] of Object.entries(
|
|
335
|
+
for (const [o, a] of Object.entries(xt))
|
|
336
336
|
o === "bytes" && typeof globalThis.Response?.prototype?.bytes != "function" || (i[o] = async () => {
|
|
337
337
|
n.request.headers.set("accept", n.request.headers.get("accept") || a);
|
|
338
338
|
const c = await i;
|
|
@@ -363,8 +363,8 @@ class N {
|
|
|
363
363
|
constructor(t, s = {}) {
|
|
364
364
|
if (this.#t = t, this.#e = {
|
|
365
365
|
...s,
|
|
366
|
-
headers:
|
|
367
|
-
hooks:
|
|
366
|
+
headers: qe(this.#t.headers, s.headers),
|
|
367
|
+
hooks: _e({
|
|
368
368
|
beforeRequest: [],
|
|
369
369
|
beforeRetry: [],
|
|
370
370
|
beforeError: [],
|
|
@@ -387,7 +387,7 @@ class N {
|
|
|
387
387
|
}
|
|
388
388
|
It && Be && (this.#r = this.#e.signal ?? this.#t.signal, this.#n = new globalThis.AbortController(), this.#e.signal = this.#r ? AbortSignal.any([this.#r, this.#n.signal]) : this.#n.signal), be && (this.#e.duplex = "half"), this.#e.json !== void 0 && (this.#e.body = this.#e.stringifyJson?.(this.#e.json) ?? JSON.stringify(this.#e.json), this.#e.headers.set("content-type", this.#e.headers.get("content-type") ?? "application/json"));
|
|
389
389
|
const n = s.headers && new globalThis.Headers(s.headers).has("content-type");
|
|
390
|
-
if (this.#t instanceof globalThis.Request && (
|
|
390
|
+
if (this.#t instanceof globalThis.Request && (Ut && this.#e.body instanceof globalThis.FormData || this.#e.body instanceof URLSearchParams) && !n && this.#e.headers.delete("content-type"), this.request = new globalThis.Request(this.#t, this.#e), Yt(this.#e.searchParams)) {
|
|
391
391
|
const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(N.#d(this.#e.searchParams)).toString()), o = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, i);
|
|
392
392
|
this.request = new globalThis.Request(o, this.#e);
|
|
393
393
|
}
|
|
@@ -499,10 +499,10 @@ class N {
|
|
|
499
499
|
}
|
|
500
500
|
/*! MIT License © Sindre Sorhus */
|
|
501
501
|
const Q = (e) => {
|
|
502
|
-
const t = (s, n) => N.create(s,
|
|
502
|
+
const t = (s, n) => N.create(s, B(e, n));
|
|
503
503
|
for (const s of $e)
|
|
504
|
-
t[s] = (n, r) => N.create(n,
|
|
505
|
-
return t.create = (s) => Q(
|
|
504
|
+
t[s] = (n, r) => N.create(n, B(e, r, { method: s }));
|
|
505
|
+
return t.create = (s) => Q(B(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Q(B(e, s))), t.stop = ze, t.retry = Dt, t;
|
|
506
506
|
}, Gt = Q();
|
|
507
507
|
var S = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(S || {});
|
|
508
508
|
const Fe = {
|
|
@@ -633,7 +633,7 @@ class tt extends v {
|
|
|
633
633
|
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function F(e, { dir: t, size: s = 32 } = {}) {
|
|
637
637
|
return typeof e == "string" ? Zt(e, { dir: t, size: s }) : Qt(e, { dir: t, size: s });
|
|
638
638
|
}
|
|
639
639
|
function Zt(e, { dir: t, size: s = 32 } = {}) {
|
|
@@ -697,7 +697,7 @@ function ss(e, t = {}) {
|
|
|
697
697
|
});
|
|
698
698
|
}
|
|
699
699
|
const a = `0x${(s && r < 0 ? (1n << BigInt(n * 8)) + BigInt(r) : r).toString(16)}`;
|
|
700
|
-
return n ?
|
|
700
|
+
return n ? F(a, { size: n }) : a;
|
|
701
701
|
}
|
|
702
702
|
const ns = /* @__PURE__ */ new TextEncoder();
|
|
703
703
|
function rs(e, t = {}) {
|
|
@@ -705,7 +705,7 @@ function rs(e, t = {}) {
|
|
|
705
705
|
}
|
|
706
706
|
function os(e, t = {}) {
|
|
707
707
|
const s = new Uint8Array(1);
|
|
708
|
-
return s[0] = Number(e), typeof t.size == "number" ? (ae(s, { size: t.size }),
|
|
708
|
+
return s[0] = Number(e), typeof t.size == "number" ? (ae(s, { size: t.size }), F(s, { size: t.size })) : s;
|
|
709
709
|
}
|
|
710
710
|
const T = {
|
|
711
711
|
zero: 48,
|
|
@@ -725,7 +725,7 @@ function Te(e) {
|
|
|
725
725
|
}
|
|
726
726
|
function st(e, t = {}) {
|
|
727
727
|
let s = e;
|
|
728
|
-
t.size && (ae(s, { size: t.size }), s =
|
|
728
|
+
t.size && (ae(s, { size: t.size }), s = F(s, { dir: "right", size: t.size }));
|
|
729
729
|
let n = s.slice(2);
|
|
730
730
|
n.length % 2 && (n = `0${n}`);
|
|
731
731
|
const r = n.length / 2, i = new Uint8Array(r);
|
|
@@ -743,11 +743,11 @@ function is(e, t) {
|
|
|
743
743
|
}
|
|
744
744
|
function nt(e, t = {}) {
|
|
745
745
|
const s = ns.encode(e);
|
|
746
|
-
return typeof t.size == "number" ? (ae(s, { size: t.size }),
|
|
746
|
+
return typeof t.size == "number" ? (ae(s, { size: t.size }), F(s, { dir: "right", size: t.size })) : s;
|
|
747
747
|
}
|
|
748
|
-
const
|
|
748
|
+
const z = /* @__PURE__ */ BigInt(2 ** 32 - 1), Re = /* @__PURE__ */ BigInt(32);
|
|
749
749
|
function as(e, t = !1) {
|
|
750
|
-
return t ? { h: Number(e &
|
|
750
|
+
return t ? { h: Number(e & z), l: Number(e >> Re & z) } : { h: Number(e >> Re & z) | 0, l: Number(e & z) | 0 };
|
|
751
751
|
}
|
|
752
752
|
function cs(e, t = !1) {
|
|
753
753
|
const s = e.length;
|
|
@@ -767,7 +767,7 @@ function Ae(e) {
|
|
|
767
767
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
768
768
|
throw new Error("positive integer expected, got " + e);
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function L(e, ...t) {
|
|
771
771
|
if (!ds(e))
|
|
772
772
|
throw new Error("Uint8Array expected");
|
|
773
773
|
if (t.length > 0 && !t.includes(e.length))
|
|
@@ -780,7 +780,7 @@ function ve(e, t = !0) {
|
|
|
780
780
|
throw new Error("Hash#digest() has already been called");
|
|
781
781
|
}
|
|
782
782
|
function ps(e, t) {
|
|
783
|
-
|
|
783
|
+
L(e);
|
|
784
784
|
const s = t.outputLen;
|
|
785
785
|
if (e.length < s)
|
|
786
786
|
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
@@ -808,7 +808,7 @@ function bs(e) {
|
|
|
808
808
|
return new Uint8Array(new TextEncoder().encode(e));
|
|
809
809
|
}
|
|
810
810
|
function ot(e) {
|
|
811
|
-
return typeof e == "string" && (e = bs(e)),
|
|
811
|
+
return typeof e == "string" && (e = bs(e)), L(e), e;
|
|
812
812
|
}
|
|
813
813
|
class Es {
|
|
814
814
|
}
|
|
@@ -816,28 +816,28 @@ function Ss(e) {
|
|
|
816
816
|
const t = (n) => e().update(ot(n)).digest(), s = e();
|
|
817
817
|
return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
|
|
818
818
|
}
|
|
819
|
-
const Ts = BigInt(0),
|
|
820
|
-
for (let e = 0, t =
|
|
819
|
+
const Ts = BigInt(0), k = BigInt(1), Rs = BigInt(2), As = BigInt(7), vs = BigInt(256), Ps = BigInt(113), it = [], at = [], ct = [];
|
|
820
|
+
for (let e = 0, t = k, s = 1, n = 0; e < 24; e++) {
|
|
821
821
|
[s, n] = [n, (2 * s + 3 * n) % 5], it.push(2 * (5 * n + s)), at.push((e + 1) * (e + 2) / 2 % 64);
|
|
822
822
|
let r = Ts;
|
|
823
823
|
for (let i = 0; i < 7; i++)
|
|
824
|
-
t = (t <<
|
|
824
|
+
t = (t << k ^ (t >> As) * Ps) % vs, t & Rs && (r ^= k << (k << /* @__PURE__ */ BigInt(i)) - k);
|
|
825
825
|
ct.push(r);
|
|
826
826
|
}
|
|
827
|
-
const ut = cs(ct, !0), Is = ut[0],
|
|
828
|
-
function
|
|
827
|
+
const ut = cs(ct, !0), Is = ut[0], Cs = ut[1], Ie = (e, t, s) => s > 32 ? fs(e, t, s) : us(e, t, s), Ce = (e, t, s) => s > 32 ? hs(e, t, s) : ls(e, t, s);
|
|
828
|
+
function Us(e, t = 24) {
|
|
829
829
|
const s = new Uint32Array(10);
|
|
830
830
|
for (let n = 24 - t; n < 24; n++) {
|
|
831
831
|
for (let o = 0; o < 10; o++)
|
|
832
832
|
s[o] = e[o] ^ e[o + 10] ^ e[o + 20] ^ e[o + 30] ^ e[o + 40];
|
|
833
833
|
for (let o = 0; o < 10; o += 2) {
|
|
834
|
-
const a = (o + 8) % 10, c = (o + 2) % 10, u = s[c], l = s[c + 1], w = Ie(u, l, 1) ^ s[a],
|
|
835
|
-
for (let
|
|
836
|
-
e[o +
|
|
834
|
+
const a = (o + 8) % 10, c = (o + 2) % 10, u = s[c], l = s[c + 1], w = Ie(u, l, 1) ^ s[a], p = Ce(u, l, 1) ^ s[a + 1];
|
|
835
|
+
for (let m = 0; m < 50; m += 10)
|
|
836
|
+
e[o + m] ^= w, e[o + m + 1] ^= p;
|
|
837
837
|
}
|
|
838
838
|
let r = e[2], i = e[3];
|
|
839
839
|
for (let o = 0; o < 24; o++) {
|
|
840
|
-
const a = at[o], c = Ie(r, i, a), u =
|
|
840
|
+
const a = at[o], c = Ie(r, i, a), u = Ce(r, i, a), l = it[o];
|
|
841
841
|
r = e[l], i = e[l + 1], e[l] = c, e[l + 1] = u;
|
|
842
842
|
}
|
|
843
843
|
for (let o = 0; o < 50; o += 10) {
|
|
@@ -846,7 +846,7 @@ function Cs(e, t = 24) {
|
|
|
846
846
|
for (let a = 0; a < 10; a++)
|
|
847
847
|
e[o + a] ^= ~s[(a + 2) % 10] & s[(a + 4) % 10];
|
|
848
848
|
}
|
|
849
|
-
e[0] ^= Is[n], e[1] ^=
|
|
849
|
+
e[0] ^= Is[n], e[1] ^= Cs[n];
|
|
850
850
|
}
|
|
851
851
|
rt(s);
|
|
852
852
|
}
|
|
@@ -861,10 +861,10 @@ class ce extends Es {
|
|
|
861
861
|
return this._cloneInto();
|
|
862
862
|
}
|
|
863
863
|
keccak() {
|
|
864
|
-
Pe(this.state32),
|
|
864
|
+
Pe(this.state32), Us(this.state32, this.rounds), Pe(this.state32), this.posOut = 0, this.pos = 0;
|
|
865
865
|
}
|
|
866
866
|
update(t) {
|
|
867
|
-
ve(this), t = ot(t),
|
|
867
|
+
ve(this), t = ot(t), L(t);
|
|
868
868
|
const { blockLen: s, state: n } = this, r = t.length;
|
|
869
869
|
for (let i = 0; i < r; ) {
|
|
870
870
|
const o = Math.min(s - this.pos, r - i);
|
|
@@ -882,7 +882,7 @@ class ce extends Es {
|
|
|
882
882
|
t[n] ^= s, (s & 128) !== 0 && n === r - 1 && this.keccak(), t[r - 1] ^= 128, this.keccak();
|
|
883
883
|
}
|
|
884
884
|
writeInto(t) {
|
|
885
|
-
ve(this, !1),
|
|
885
|
+
ve(this, !1), L(t), this.finish();
|
|
886
886
|
const s = this.state, { blockLen: n } = this;
|
|
887
887
|
for (let r = 0, i = t.length; r < i; ) {
|
|
888
888
|
this.posOut >= n && this.keccak();
|
|
@@ -915,9 +915,9 @@ class ce extends Es {
|
|
|
915
915
|
return t || (t = new ce(s, n, r, o, i)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = i, t.suffix = n, t.outputLen = r, t.enableXOF = o, t.destroyed = this.destroyed, t;
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
const
|
|
918
|
+
const xs = (e, t, s) => Ss(() => new ce(t, e, s)), ks = xs(1, 136, 256 / 8);
|
|
919
919
|
function Ds(e, t) {
|
|
920
|
-
return
|
|
920
|
+
return ks(ie(e, { strict: !1 }) ? rs(e) : e);
|
|
921
921
|
}
|
|
922
922
|
class Os extends v {
|
|
923
923
|
constructor({ address: t }) {
|
|
@@ -1014,7 +1014,7 @@ const Bs = {
|
|
|
1014
1014
|
decimals: 6,
|
|
1015
1015
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1016
1016
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1017
|
-
},
|
|
1017
|
+
}, qs = {
|
|
1018
1018
|
chainId: Ke.chainId,
|
|
1019
1019
|
address: R("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
|
|
1020
1020
|
symbol: "USDC",
|
|
@@ -1022,7 +1022,7 @@ const Bs = {
|
|
|
1022
1022
|
decimals: 6,
|
|
1023
1023
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1024
1024
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1025
|
-
},
|
|
1025
|
+
}, _s = {
|
|
1026
1026
|
chainId: Ve.chainId,
|
|
1027
1027
|
address: R("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
|
|
1028
1028
|
symbol: "USDC",
|
|
@@ -1050,7 +1050,7 @@ const Bs = {
|
|
|
1050
1050
|
decimals: 6,
|
|
1051
1051
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1052
1052
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1053
|
-
},
|
|
1053
|
+
}, Ue = {
|
|
1054
1054
|
ARBITRUM_MAINNET: {
|
|
1055
1055
|
...Fe,
|
|
1056
1056
|
tokens: {
|
|
@@ -1082,7 +1082,7 @@ const Bs = {
|
|
|
1082
1082
|
BASE_MAINNET: {
|
|
1083
1083
|
...Ke,
|
|
1084
1084
|
tokens: {
|
|
1085
|
-
[S.USDC]:
|
|
1085
|
+
[S.USDC]: qs
|
|
1086
1086
|
},
|
|
1087
1087
|
explorer: "https://basescan.org"
|
|
1088
1088
|
},
|
|
@@ -1096,7 +1096,7 @@ const Bs = {
|
|
|
1096
1096
|
BSC_MAINNET: {
|
|
1097
1097
|
...Ve,
|
|
1098
1098
|
tokens: {
|
|
1099
|
-
[S.USDC]:
|
|
1099
|
+
[S.USDC]: _s
|
|
1100
1100
|
},
|
|
1101
1101
|
explorer: "https://bscscan.com"
|
|
1102
1102
|
},
|
|
@@ -1125,44 +1125,49 @@ const Bs = {
|
|
|
1125
1125
|
var ee = /* @__PURE__ */ ((e) => (e.ARBITRUM = "ARBITRUM_MAINNET", e.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", e.AVALANCHE = "AVALANCHE_MAINNET", e.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", e.BASE = "BASE_MAINNET", e.BASE_TESTNET = "BASE_TESTNET", e.BSC = "BSC_MAINNET", e.ETHEREUM = "ETHEREUM_MAINNET", e.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", e.STARKNET = "STARKNET_MAINNET", e))(ee || {}), ht = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(ht || {});
|
|
1126
1126
|
const Ws = (e) => {
|
|
1127
1127
|
const t = e?.trim().toUpperCase();
|
|
1128
|
-
if (
|
|
1129
|
-
return
|
|
1128
|
+
if (Ue[t])
|
|
1129
|
+
return Ue[t];
|
|
1130
1130
|
};
|
|
1131
1131
|
function Vs(e, t) {
|
|
1132
1132
|
return Ws(e)?.tokens[t]?.address;
|
|
1133
1133
|
}
|
|
1134
1134
|
var ue = /* @__PURE__ */ ((e) => (e.PRODUCTION = "production", e.STAGING = "staging", e))(ue || {});
|
|
1135
|
-
class
|
|
1136
|
-
constructor({ api_key: t, env: s, seesion_token: n }) {
|
|
1137
|
-
this.api_key = t || "", this.sessionToken = n || "", this.env = s ?? ue.PRODUCTION;
|
|
1135
|
+
class d {
|
|
1136
|
+
constructor({ api_key: t, env: s, seesion_token: n, props: r }) {
|
|
1137
|
+
this.api_key = t || "", this.sessionToken = n || "", this.env = s ?? ue.PRODUCTION, this.props = r;
|
|
1138
1138
|
}
|
|
1139
1139
|
static async config(t) {
|
|
1140
|
-
if (!
|
|
1140
|
+
if (!d.app) {
|
|
1141
1141
|
if (!t)
|
|
1142
1142
|
throw new Error("Please provide an api_key");
|
|
1143
|
-
|
|
1143
|
+
d.app = new d(t);
|
|
1144
1144
|
}
|
|
1145
|
-
return t && (t.api_key !== void 0 && (
|
|
1145
|
+
return t && (t.api_key !== void 0 && (d.app.api_key = t.api_key), t.seesion_token !== void 0 && (d.app.sessionToken = t.seesion_token), t.env !== void 0 && (d.app.env = t.env), t.props !== void 0 && (d.app.props = t.props)), d.app;
|
|
1146
1146
|
}
|
|
1147
1147
|
static getApiKey() {
|
|
1148
|
-
if (!
|
|
1148
|
+
if (!d.app)
|
|
1149
1149
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1150
|
-
return
|
|
1150
|
+
return d.app.api_key;
|
|
1151
1151
|
}
|
|
1152
1152
|
static getSessionToken() {
|
|
1153
|
-
if (!
|
|
1153
|
+
if (!d.app)
|
|
1154
|
+
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1155
|
+
return d.app.sessionToken;
|
|
1156
|
+
}
|
|
1157
|
+
static getProps() {
|
|
1158
|
+
if (!d.app)
|
|
1154
1159
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1155
|
-
return
|
|
1160
|
+
return d.app.props;
|
|
1156
1161
|
}
|
|
1157
1162
|
static getEnv() {
|
|
1158
|
-
if (!
|
|
1163
|
+
if (!d.app)
|
|
1159
1164
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1160
|
-
return
|
|
1165
|
+
return d.app.env === "internal" ? "staging" : d.app.env;
|
|
1161
1166
|
}
|
|
1162
1167
|
static getBaseUrl() {
|
|
1163
|
-
if (!
|
|
1168
|
+
if (!d.app)
|
|
1164
1169
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1165
|
-
switch (
|
|
1170
|
+
switch (d.app.env) {
|
|
1166
1171
|
case "production":
|
|
1167
1172
|
return "https://api.chainrails.io/api/v1";
|
|
1168
1173
|
case "staging":
|
|
@@ -1174,23 +1179,23 @@ class h {
|
|
|
1174
1179
|
}
|
|
1175
1180
|
}
|
|
1176
1181
|
static getPayModalUrl(t) {
|
|
1177
|
-
if (!
|
|
1182
|
+
if (!d.app)
|
|
1178
1183
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1179
|
-
const s =
|
|
1184
|
+
const s = d.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(t), r = t && !isNaN(Number(t)) && n > 0 ? "/pay/" : "/deposit/", i = `${t && !isNaN(Number(t)) && n > 0 ? n * 100 : ""}`;
|
|
1180
1185
|
return s + r + i;
|
|
1181
1186
|
}
|
|
1182
1187
|
}
|
|
1183
1188
|
let te = null;
|
|
1184
1189
|
function Ys() {
|
|
1185
1190
|
te = Gt.create({
|
|
1186
|
-
prefixUrl:
|
|
1191
|
+
prefixUrl: d.getBaseUrl(),
|
|
1187
1192
|
headers: {
|
|
1188
1193
|
"Content-Type": "application/json"
|
|
1189
1194
|
},
|
|
1190
1195
|
hooks: {
|
|
1191
1196
|
beforeRequest: [
|
|
1192
1197
|
(e) => {
|
|
1193
|
-
const t =
|
|
1198
|
+
const t = d.getSessionToken() || d.getApiKey();
|
|
1194
1199
|
e.headers.set("Authorization", `Bearer ${t}`);
|
|
1195
1200
|
}
|
|
1196
1201
|
],
|
|
@@ -1201,83 +1206,83 @@ function Ys() {
|
|
|
1201
1206
|
}
|
|
1202
1207
|
});
|
|
1203
1208
|
}
|
|
1204
|
-
function
|
|
1209
|
+
function g() {
|
|
1205
1210
|
return te || Ys(), te;
|
|
1206
1211
|
}
|
|
1207
1212
|
class Xs {
|
|
1208
1213
|
async getById(t) {
|
|
1209
|
-
return await
|
|
1214
|
+
return await g().get("intents/" + t).json();
|
|
1210
1215
|
}
|
|
1211
1216
|
async getForSender(t) {
|
|
1212
|
-
return await
|
|
1217
|
+
return await g().get("intents/user/" + t).json();
|
|
1213
1218
|
}
|
|
1214
1219
|
async getForAddress(t) {
|
|
1215
|
-
return await
|
|
1220
|
+
return await g().get("intents/address/" + t).json();
|
|
1216
1221
|
}
|
|
1217
1222
|
async getForSession(t) {
|
|
1218
|
-
return await
|
|
1223
|
+
return await g().get("modal/sessions/intents/" + t).json();
|
|
1219
1224
|
}
|
|
1220
1225
|
async getAll(t) {
|
|
1221
|
-
return await
|
|
1226
|
+
return await g().get("intents", { searchParams: t }).json();
|
|
1222
1227
|
}
|
|
1223
1228
|
async create(t) {
|
|
1224
|
-
return await
|
|
1229
|
+
return await g().post("intents", { json: t }).json();
|
|
1225
1230
|
}
|
|
1226
1231
|
async createForSession(t) {
|
|
1227
|
-
return await
|
|
1232
|
+
return await g().post("modal/sessions/intents", { json: t }).json();
|
|
1228
1233
|
}
|
|
1229
1234
|
async update(t, s) {
|
|
1230
|
-
return await
|
|
1235
|
+
return await g().post("intents", { json: s }).json();
|
|
1231
1236
|
}
|
|
1232
1237
|
async triggerProcessing(t) {
|
|
1233
|
-
return await
|
|
1238
|
+
return await g().post(`intents/${t}/trigger-processing`).json();
|
|
1234
1239
|
}
|
|
1235
1240
|
async triggerProcessingForSession(t) {
|
|
1236
|
-
return await
|
|
1241
|
+
return await g().post(`modal/sessions/intents/${t}/process`).json();
|
|
1237
1242
|
}
|
|
1238
1243
|
}
|
|
1239
1244
|
class Js {
|
|
1240
1245
|
async getFromSpecificBridge(t) {
|
|
1241
|
-
return await
|
|
1246
|
+
return await g().get("quotes/single", { searchParams: t }).json();
|
|
1242
1247
|
}
|
|
1243
1248
|
async getFromAllBridges(t) {
|
|
1244
|
-
return await
|
|
1249
|
+
return await g().get("quotes/multiple", { searchParams: t }).json();
|
|
1245
1250
|
}
|
|
1246
1251
|
async getBestAcrossBridges(t) {
|
|
1247
|
-
return await
|
|
1252
|
+
return await g().get("quotes/best", { searchParams: t }).json();
|
|
1248
1253
|
}
|
|
1249
1254
|
async getAll(t) {
|
|
1250
|
-
return await
|
|
1255
|
+
return await g().get("quotes/multi-source", { searchParams: t }).json();
|
|
1251
1256
|
}
|
|
1252
1257
|
async getAllForSession(t) {
|
|
1253
|
-
return await
|
|
1258
|
+
return await g().get("modal/sessions/quotes", { searchParams: t }).json();
|
|
1254
1259
|
}
|
|
1255
1260
|
}
|
|
1256
1261
|
class Gs {
|
|
1257
1262
|
async getOptimalRoutes(t) {
|
|
1258
|
-
return await
|
|
1263
|
+
return await g().get("router/optimal-route", { searchParams: t }).json();
|
|
1259
1264
|
}
|
|
1260
1265
|
async getAllSupportedBridges() {
|
|
1261
|
-
return await
|
|
1266
|
+
return await g().get("router/supported-bridges/all").json();
|
|
1262
1267
|
}
|
|
1263
1268
|
async getSupportedBridges(t) {
|
|
1264
|
-
return await
|
|
1269
|
+
return await g().get("router/supported-bridges/route", { searchParams: t }).json();
|
|
1265
1270
|
}
|
|
1266
1271
|
async getSupportedRoutes(t, s) {
|
|
1267
|
-
return await
|
|
1272
|
+
return await g().get("router/supported-bridges/bridge/" + t, { searchParams: s }).json();
|
|
1268
1273
|
}
|
|
1269
1274
|
}
|
|
1270
1275
|
class Zs {
|
|
1271
1276
|
async getSupported(t) {
|
|
1272
|
-
return await
|
|
1277
|
+
return await g().get("chains", { searchParams: t }).json();
|
|
1273
1278
|
}
|
|
1274
1279
|
}
|
|
1275
1280
|
class Qs {
|
|
1276
1281
|
async getClientInfo() {
|
|
1277
|
-
return await
|
|
1282
|
+
return await g().get("client/auth/client-info").json();
|
|
1278
1283
|
}
|
|
1279
1284
|
async getClientInfoForSession() {
|
|
1280
|
-
return await
|
|
1285
|
+
return await g().get("modal/sessions/client").json();
|
|
1281
1286
|
}
|
|
1282
1287
|
}
|
|
1283
1288
|
class en {
|
|
@@ -1291,7 +1296,7 @@ class en {
|
|
|
1291
1296
|
destinationChain: ee[t.destinationChain?.replace("_MAINNET", "")],
|
|
1292
1297
|
amount: t.amount
|
|
1293
1298
|
};
|
|
1294
|
-
return
|
|
1299
|
+
return g().post("modal/sessions", { json: s }).json().then((n) => ({ ...n, amount: s.amount }));
|
|
1295
1300
|
}
|
|
1296
1301
|
}
|
|
1297
1302
|
const vn = {
|
|
@@ -1319,48 +1324,52 @@ function Pn(e) {
|
|
|
1319
1324
|
const {
|
|
1320
1325
|
amount: t,
|
|
1321
1326
|
styles: s,
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1327
|
+
excludedChains: n,
|
|
1328
|
+
isOpen: r,
|
|
1329
|
+
isPending: i,
|
|
1330
|
+
open: o,
|
|
1331
|
+
close: a,
|
|
1332
|
+
onCancel: c,
|
|
1333
|
+
onSuccess: u,
|
|
1334
|
+
session_url: l,
|
|
1335
|
+
sessionToken: w
|
|
1336
|
+
} = e, [p, m] = C(0), [b, H] = C(""), f = re(null);
|
|
1337
|
+
d.config({
|
|
1332
1338
|
api_key: "",
|
|
1333
1339
|
// @ts-expect-error
|
|
1334
1340
|
env: e.env === "internal" ? "internal" : "production"
|
|
1335
|
-
}),
|
|
1336
|
-
|
|
1337
|
-
}, [t]),
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1341
|
+
}), x(() => {
|
|
1342
|
+
H(d.getPayModalUrl(t));
|
|
1343
|
+
}, [t]), x(() => {
|
|
1344
|
+
const h = document.body.style.overflow;
|
|
1345
|
+
r ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = h || "";
|
|
1346
|
+
const E = (P) => {
|
|
1347
|
+
P.data === "closed" && (a(), c?.()), P.data === "completed" && (window.setTimeout(a, 2e3), u?.());
|
|
1342
1348
|
};
|
|
1343
|
-
return window.addEventListener("message",
|
|
1344
|
-
document.body.style.overflow =
|
|
1349
|
+
return window.addEventListener("message", E), () => {
|
|
1350
|
+
document.body.style.overflow = h || "", window.removeEventListener("message", E);
|
|
1345
1351
|
};
|
|
1346
|
-
}, [
|
|
1347
|
-
if (!
|
|
1348
|
-
const
|
|
1352
|
+
}, [r, c, u]), x(() => {
|
|
1353
|
+
if (!w) return;
|
|
1354
|
+
const h = {
|
|
1349
1355
|
type: "session",
|
|
1350
|
-
session_token:
|
|
1351
|
-
environment:
|
|
1352
|
-
styles: s
|
|
1356
|
+
session_token: w,
|
|
1357
|
+
environment: d.getEnv() || ue.PRODUCTION,
|
|
1358
|
+
styles: s,
|
|
1359
|
+
props: {
|
|
1360
|
+
excludedChains: n?.join(",")
|
|
1361
|
+
}
|
|
1353
1362
|
};
|
|
1354
|
-
|
|
1355
|
-
|
|
1363
|
+
f.current?.contentWindow?.postMessage(h, "https://app.chainrails.io"), f.current?.contentWindow?.postMessage(h, "https://chainrails-frontend-git-staging-horus-labs.vercel.app"), window.setTimeout(() => {
|
|
1364
|
+
f.current?.contentWindow?.postMessage(h, "https://app.chainrails.io"), f.current?.contentWindow?.postMessage(h, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
|
|
1356
1365
|
}, 1e3);
|
|
1357
|
-
}, [
|
|
1358
|
-
function
|
|
1359
|
-
|
|
1366
|
+
}, [w, p, r, s]);
|
|
1367
|
+
function y() {
|
|
1368
|
+
m(Math.random());
|
|
1360
1369
|
}
|
|
1361
1370
|
return /* @__PURE__ */ we("div", {
|
|
1362
|
-
className: tn("payment-modal-wrapper",
|
|
1363
|
-
children: [(
|
|
1371
|
+
className: tn("payment-modal-wrapper", p === 0 || i ? "loading" : "not-loading", r ? "open" : "closed"),
|
|
1372
|
+
children: [(p === 0 || i) && /* @__PURE__ */ M("div", {
|
|
1364
1373
|
role: "status",
|
|
1365
1374
|
className: "payment-modal-loader",
|
|
1366
1375
|
children: /* @__PURE__ */ we("svg", {
|
|
@@ -1369,27 +1378,27 @@ function Pn(e) {
|
|
|
1369
1378
|
viewBox: "0 0 100 101",
|
|
1370
1379
|
fill: "none",
|
|
1371
1380
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1372
|
-
children: [/* @__PURE__ */
|
|
1381
|
+
children: [/* @__PURE__ */ M("path", {
|
|
1373
1382
|
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
1374
1383
|
fill: "currentColor"
|
|
1375
|
-
}), /* @__PURE__ */
|
|
1384
|
+
}), /* @__PURE__ */ M("path", {
|
|
1376
1385
|
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
1377
1386
|
fill: "currentFill"
|
|
1378
1387
|
})]
|
|
1379
1388
|
})
|
|
1380
|
-
}), /* @__PURE__ */
|
|
1389
|
+
}), /* @__PURE__ */ M("iframe", {
|
|
1381
1390
|
allow: "clipboard-read *; clipboard-write *",
|
|
1382
|
-
src:
|
|
1383
|
-
onLoad:
|
|
1384
|
-
className: `payment-modal ${
|
|
1391
|
+
src: b || void 0,
|
|
1392
|
+
onLoad: y,
|
|
1393
|
+
className: `payment-modal ${p === 0 || i ? "invisible" : "visible"}`,
|
|
1385
1394
|
"data-id": t,
|
|
1386
|
-
ref:
|
|
1395
|
+
ref: f
|
|
1387
1396
|
}, t)]
|
|
1388
1397
|
});
|
|
1389
1398
|
}
|
|
1390
|
-
const sn = Symbol(), le = Symbol(), D = "a", pt = "f",
|
|
1399
|
+
const sn = Symbol(), le = Symbol(), D = "a", pt = "f", xe = "p", gt = "c", mt = "t", fe = "h", O = "w", he = "o", de = "k";
|
|
1391
1400
|
let nn = (e, t) => new Proxy(e, t);
|
|
1392
|
-
const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) => e && (ne.has(e) ? ne.get(e) : se(e) === Object.prototype || se(e) === Array.prototype),
|
|
1401
|
+
const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) => e && (ne.has(e) ? ne.get(e) : se(e) === Object.prototype || se(e) === Array.prototype), j = (e) => typeof e == "object" && e !== null, rn = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), on = (e) => {
|
|
1393
1402
|
if (Array.isArray(e))
|
|
1394
1403
|
return Array.from(e);
|
|
1395
1404
|
const t = Object.getOwnPropertyDescriptors(e);
|
|
@@ -1442,14 +1451,14 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1442
1451
|
}
|
|
1443
1452
|
const [i, o] = r;
|
|
1444
1453
|
let a = s && s.get(i);
|
|
1445
|
-
return (!a || a[1][pt] !== !!o) && (a = an(i, !!o), a[1][
|
|
1454
|
+
return (!a || a[1][pt] !== !!o) && (a = an(i, !!o), a[1][xe] = nn(o || i, a[0]), s && s.set(i, a)), a[1][D] = t, a[1][gt] = s, a[1][mt] = n, a[1][xe];
|
|
1446
1455
|
}, cn = (e, t) => {
|
|
1447
1456
|
const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
|
|
1448
1457
|
return s.length !== n.length || s.some((r, i) => r !== n[i]);
|
|
1449
1458
|
}, bt = (e, t, s, n, r = Object.is) => {
|
|
1450
1459
|
if (r(e, t))
|
|
1451
1460
|
return !1;
|
|
1452
|
-
if (!
|
|
1461
|
+
if (!j(e) || !j(t))
|
|
1453
1462
|
return !0;
|
|
1454
1463
|
const i = s.get(pe(e));
|
|
1455
1464
|
if (!i)
|
|
@@ -1478,29 +1487,29 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1478
1487
|
if (o === null)
|
|
1479
1488
|
throw new Error("invalid used");
|
|
1480
1489
|
return o;
|
|
1481
|
-
}, un = (e) => yt(e) && e[le] || null,
|
|
1490
|
+
}, un = (e) => yt(e) && e[le] || null, ke = (e, t = !0) => {
|
|
1482
1491
|
ne.set(e, t);
|
|
1483
1492
|
}, ln = (e, t, s) => {
|
|
1484
1493
|
const n = [], r = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
|
|
1485
1494
|
var c, u, l;
|
|
1486
1495
|
if (r.has(o))
|
|
1487
1496
|
return;
|
|
1488
|
-
|
|
1489
|
-
const w =
|
|
1497
|
+
j(o) && r.add(o);
|
|
1498
|
+
const w = j(o) && t.get(pe(o));
|
|
1490
1499
|
if (w) {
|
|
1491
|
-
if ((c = w[fe]) === null || c === void 0 || c.forEach((
|
|
1492
|
-
const
|
|
1493
|
-
n.push(a ? [...a,
|
|
1500
|
+
if ((c = w[fe]) === null || c === void 0 || c.forEach((p) => {
|
|
1501
|
+
const m = `:has(${String(p)})`;
|
|
1502
|
+
n.push(a ? [...a, m] : [m]);
|
|
1494
1503
|
}), w[O] === !0) {
|
|
1495
|
-
const
|
|
1496
|
-
n.push(a ? [...a,
|
|
1504
|
+
const p = ":ownKeys";
|
|
1505
|
+
n.push(a ? [...a, p] : [p]);
|
|
1497
1506
|
} else
|
|
1498
|
-
(u = w[he]) === null || u === void 0 || u.forEach((
|
|
1499
|
-
const
|
|
1500
|
-
n.push(a ? [...a,
|
|
1507
|
+
(u = w[he]) === null || u === void 0 || u.forEach((p) => {
|
|
1508
|
+
const m = `:hasOwn(${String(p)})`;
|
|
1509
|
+
n.push(a ? [...a, m] : [m]);
|
|
1501
1510
|
});
|
|
1502
|
-
(l = w[de]) === null || l === void 0 || l.forEach((
|
|
1503
|
-
"value" in (Object.getOwnPropertyDescriptor(o,
|
|
1511
|
+
(l = w[de]) === null || l === void 0 || l.forEach((p) => {
|
|
1512
|
+
"value" in (Object.getOwnPropertyDescriptor(o, p) || {}) && i(o[p], a ? [...a, p] : [p]);
|
|
1504
1513
|
});
|
|
1505
1514
|
} else a && n.push(a);
|
|
1506
1515
|
};
|
|
@@ -1510,7 +1519,7 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1510
1519
|
if (s?.[0] === t)
|
|
1511
1520
|
return s[1];
|
|
1512
1521
|
const n = Array.isArray(e) ? [] : Object.create(Object.getPrototypeOf(e));
|
|
1513
|
-
return
|
|
1522
|
+
return ke(n, !0), De.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
|
|
1514
1523
|
if (Object.getOwnPropertyDescriptor(n, r))
|
|
1515
1524
|
return;
|
|
1516
1525
|
const i = Reflect.get(e, r), { enumerable: o } = Reflect.getOwnPropertyDescriptor(
|
|
@@ -1524,9 +1533,9 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1524
1533
|
configurable: !0
|
|
1525
1534
|
};
|
|
1526
1535
|
if (me.has(i))
|
|
1527
|
-
|
|
1528
|
-
else if (
|
|
1529
|
-
const [c, u] =
|
|
1536
|
+
ke(i, !1);
|
|
1537
|
+
else if (U.has(i)) {
|
|
1538
|
+
const [c, u] = U.get(
|
|
1530
1539
|
i
|
|
1531
1540
|
);
|
|
1532
1541
|
a.value = Et(c, u());
|
|
@@ -1542,75 +1551,75 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1542
1551
|
},
|
|
1543
1552
|
set(r, i, o, a) {
|
|
1544
1553
|
const c = !e() && Reflect.has(r, i), u = Reflect.get(r, i, a);
|
|
1545
|
-
if (c && (Oe(u, o) ||
|
|
1554
|
+
if (c && (Oe(u, o) || _.has(o) && Oe(u, _.get(o))))
|
|
1546
1555
|
return !0;
|
|
1547
1556
|
s(i), ge(o) && (o = un(o) || o);
|
|
1548
|
-
const l = !
|
|
1557
|
+
const l = !U.has(o) && pn(o) ? St(o) : o;
|
|
1549
1558
|
return t(i, l), Reflect.set(r, i, l, a), n(["set", [i], o, u]), !0;
|
|
1550
1559
|
}
|
|
1551
|
-
}),
|
|
1560
|
+
}), U = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakMap(), J = [1], _ = /* @__PURE__ */ new WeakMap();
|
|
1552
1561
|
let Oe = Object.is, dn = (e, t) => new Proxy(e, t), pn = fn, gn = Et, mn = hn;
|
|
1553
1562
|
function St(e = {}) {
|
|
1554
1563
|
if (!ge(e))
|
|
1555
1564
|
throw new Error("object required");
|
|
1556
|
-
const t =
|
|
1565
|
+
const t = _.get(e);
|
|
1557
1566
|
if (t)
|
|
1558
1567
|
return t;
|
|
1559
1568
|
let s = J[0];
|
|
1560
|
-
const n = /* @__PURE__ */ new Set(), r = (
|
|
1561
|
-
s !==
|
|
1569
|
+
const n = /* @__PURE__ */ new Set(), r = (f, y = ++J[0]) => {
|
|
1570
|
+
s !== y && (i = s = y, n.forEach((h) => h(f, y)));
|
|
1562
1571
|
};
|
|
1563
1572
|
let i = s;
|
|
1564
|
-
const o = (
|
|
1565
|
-
const
|
|
1566
|
-
|
|
1567
|
-
})), s), a = (
|
|
1568
|
-
const E = [...
|
|
1569
|
-
E[1] = [
|
|
1570
|
-
}, c = /* @__PURE__ */ new Map(), u = (
|
|
1571
|
-
const
|
|
1572
|
-
if (
|
|
1573
|
-
if ((q ? "production" : void 0) !== "production" && c.has(
|
|
1573
|
+
const o = (f = J[0]) => (i !== f && (i = f, c.forEach(([y]) => {
|
|
1574
|
+
const h = y[1](f);
|
|
1575
|
+
h > s && (s = h);
|
|
1576
|
+
})), s), a = (f) => (y, h) => {
|
|
1577
|
+
const E = [...y];
|
|
1578
|
+
E[1] = [f, ...E[1]], r(E, h);
|
|
1579
|
+
}, c = /* @__PURE__ */ new Map(), u = (f, y) => {
|
|
1580
|
+
const h = !me.has(y) && U.get(y);
|
|
1581
|
+
if (h) {
|
|
1582
|
+
if ((q ? "production" : void 0) !== "production" && c.has(f))
|
|
1574
1583
|
throw new Error("prop listener already exists");
|
|
1575
1584
|
if (n.size) {
|
|
1576
|
-
const E =
|
|
1577
|
-
c.set(
|
|
1585
|
+
const E = h[2](a(f));
|
|
1586
|
+
c.set(f, [h, E]);
|
|
1578
1587
|
} else
|
|
1579
|
-
c.set(
|
|
1588
|
+
c.set(f, [h]);
|
|
1580
1589
|
}
|
|
1581
|
-
}, l = (
|
|
1582
|
-
var
|
|
1583
|
-
const
|
|
1584
|
-
|
|
1585
|
-
}, w = (
|
|
1590
|
+
}, l = (f) => {
|
|
1591
|
+
var y;
|
|
1592
|
+
const h = c.get(f);
|
|
1593
|
+
h && (c.delete(f), (y = h[1]) == null || y.call(h));
|
|
1594
|
+
}, w = (f) => (n.add(f), n.size === 1 && c.forEach(([h, E], P) => {
|
|
1586
1595
|
if ((q ? "production" : void 0) !== "production" && E)
|
|
1587
1596
|
throw new Error("remove already exists");
|
|
1588
|
-
const Tt =
|
|
1589
|
-
c.set(
|
|
1597
|
+
const Tt = h[2](a(P));
|
|
1598
|
+
c.set(P, [h, Tt]);
|
|
1590
1599
|
}), () => {
|
|
1591
|
-
n.delete(
|
|
1592
|
-
E && (E(), c.set(
|
|
1600
|
+
n.delete(f), n.size === 0 && c.forEach(([h, E], P) => {
|
|
1601
|
+
E && (E(), c.set(P, [h]));
|
|
1593
1602
|
});
|
|
1594
1603
|
});
|
|
1595
|
-
let
|
|
1596
|
-
const
|
|
1597
|
-
() =>
|
|
1604
|
+
let p = !0;
|
|
1605
|
+
const m = mn(
|
|
1606
|
+
() => p,
|
|
1598
1607
|
u,
|
|
1599
1608
|
l,
|
|
1600
1609
|
r
|
|
1601
|
-
), b = dn(e,
|
|
1602
|
-
|
|
1603
|
-
const
|
|
1604
|
-
return
|
|
1605
|
-
const
|
|
1610
|
+
), b = dn(e, m);
|
|
1611
|
+
_.set(e, b);
|
|
1612
|
+
const H = [e, o, w];
|
|
1613
|
+
return U.set(b, H), Reflect.ownKeys(e).forEach((f) => {
|
|
1614
|
+
const y = Object.getOwnPropertyDescriptor(
|
|
1606
1615
|
e,
|
|
1607
|
-
|
|
1616
|
+
f
|
|
1608
1617
|
);
|
|
1609
|
-
"value" in
|
|
1610
|
-
}),
|
|
1618
|
+
"value" in y && y.writable && (b[f] = e[f]);
|
|
1619
|
+
}), p = !1, b;
|
|
1611
1620
|
}
|
|
1612
1621
|
function yn(e, t, s) {
|
|
1613
|
-
const n =
|
|
1622
|
+
const n = U.get(e);
|
|
1614
1623
|
(q ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
|
|
1615
1624
|
let r;
|
|
1616
1625
|
const i = [], o = n[2];
|
|
@@ -1625,14 +1634,14 @@ function yn(e, t, s) {
|
|
|
1625
1634
|
};
|
|
1626
1635
|
}
|
|
1627
1636
|
function Ne(e) {
|
|
1628
|
-
const t =
|
|
1637
|
+
const t = U.get(e);
|
|
1629
1638
|
(q ? "production" : void 0) !== "production" && !t && console.warn("Please use proxy object");
|
|
1630
1639
|
const [s, n] = t;
|
|
1631
1640
|
return gn(s, n());
|
|
1632
1641
|
}
|
|
1633
1642
|
const wn = {}, bn = (e, t) => {
|
|
1634
1643
|
const s = re(void 0);
|
|
1635
|
-
|
|
1644
|
+
x(() => {
|
|
1636
1645
|
s.current = ln(e, t);
|
|
1637
1646
|
}), Pt(s.current);
|
|
1638
1647
|
}, En = bn, Sn = /* @__PURE__ */ new WeakMap();
|
|
@@ -1682,7 +1691,7 @@ function In({
|
|
|
1682
1691
|
onCancel: t,
|
|
1683
1692
|
onSuccess: s
|
|
1684
1693
|
}) {
|
|
1685
|
-
const n = Tn(A), [r, i] =
|
|
1694
|
+
const n = Tn(A), [r, i] = C(!1), [o, a] = C(Date.now()), c = n?.data?.sessionToken, u = n?.data?.amount;
|
|
1686
1695
|
function l() {
|
|
1687
1696
|
c || window.setTimeout(() => {
|
|
1688
1697
|
c && i(!0);
|
|
@@ -1691,20 +1700,20 @@ function In({
|
|
|
1691
1700
|
function w() {
|
|
1692
1701
|
i(!1);
|
|
1693
1702
|
}
|
|
1694
|
-
const
|
|
1695
|
-
const
|
|
1703
|
+
const p = () => {
|
|
1704
|
+
const m = Date.now();
|
|
1696
1705
|
A.isPending = !0, A.error = null, A.data = null, fetch(e, {
|
|
1697
1706
|
headers: {
|
|
1698
1707
|
"Content-Type": "application/json"
|
|
1699
1708
|
}
|
|
1700
1709
|
}).then((b) => b.json()).then((b) => {
|
|
1701
|
-
|
|
1710
|
+
m < o || (A.data = b, A.isPending = !1, a(m));
|
|
1702
1711
|
}).catch((b) => {
|
|
1703
|
-
|
|
1712
|
+
m < o || (A.error = b?.toString(), A.isPending = !1, a(m), setInterval(p, 5e3));
|
|
1704
1713
|
});
|
|
1705
1714
|
};
|
|
1706
|
-
return
|
|
1707
|
-
|
|
1715
|
+
return x(() => {
|
|
1716
|
+
p();
|
|
1708
1717
|
}, [e]), {
|
|
1709
1718
|
sessionToken: c,
|
|
1710
1719
|
amount: u,
|
|
@@ -1714,25 +1723,25 @@ function In({
|
|
|
1714
1723
|
close: w,
|
|
1715
1724
|
isPending: n.isPending,
|
|
1716
1725
|
error: n.error,
|
|
1717
|
-
refetch:
|
|
1726
|
+
refetch: p,
|
|
1718
1727
|
onSuccess: s,
|
|
1719
1728
|
onCancel: t
|
|
1720
1729
|
};
|
|
1721
1730
|
}
|
|
1722
|
-
function
|
|
1731
|
+
function Cn({
|
|
1723
1732
|
sessionToken: e,
|
|
1724
1733
|
amount: t,
|
|
1725
1734
|
onCancel: s,
|
|
1726
1735
|
onSuccess: n
|
|
1727
1736
|
}) {
|
|
1728
|
-
const [r, i] =
|
|
1737
|
+
const [r, i] = C(!1), [o, a] = C(e), [c, u] = C(t);
|
|
1729
1738
|
function l({
|
|
1730
|
-
sessionToken:
|
|
1739
|
+
sessionToken: m,
|
|
1731
1740
|
amount: b
|
|
1732
1741
|
}) {
|
|
1733
|
-
a(
|
|
1742
|
+
a(m), u(b);
|
|
1734
1743
|
}
|
|
1735
|
-
|
|
1744
|
+
x(() => {
|
|
1736
1745
|
a(e);
|
|
1737
1746
|
}, [e]);
|
|
1738
1747
|
function w() {
|
|
@@ -1740,7 +1749,7 @@ function Un({
|
|
|
1740
1749
|
o && i(!0);
|
|
1741
1750
|
}, 200), i(!0);
|
|
1742
1751
|
}
|
|
1743
|
-
function
|
|
1752
|
+
function p() {
|
|
1744
1753
|
i(!1);
|
|
1745
1754
|
}
|
|
1746
1755
|
return {
|
|
@@ -1749,17 +1758,17 @@ function Un({
|
|
|
1749
1758
|
amount: c,
|
|
1750
1759
|
isOpen: r,
|
|
1751
1760
|
open: w,
|
|
1752
|
-
close:
|
|
1761
|
+
close: p,
|
|
1753
1762
|
onSuccess: n,
|
|
1754
1763
|
onCancel: s
|
|
1755
1764
|
};
|
|
1756
1765
|
}
|
|
1757
1766
|
export {
|
|
1758
|
-
|
|
1767
|
+
d as Chainrails,
|
|
1759
1768
|
Pn as PaymentModal,
|
|
1760
1769
|
ee as chains,
|
|
1761
1770
|
vn as crapi,
|
|
1762
1771
|
ht as tokens,
|
|
1763
|
-
|
|
1772
|
+
Cn as usePaymentModal,
|
|
1764
1773
|
In as usePaymentSession
|
|
1765
1774
|
};
|