@chainrails/react 0.1.9 → 0.1.11
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.
|
@@ -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", Ut = typeof globalThis.ReadableStream == "function", Ct = typeof globalThis.FormData == "function",
|
|
53
|
+
})(), It = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ut = typeof globalThis.ReadableStream == "function", Ct = typeof globalThis.FormData == "function", _e = ["get", "post", "put", "patch", "head", "delete"], kt = {
|
|
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
|
-
}, H = 2147483647, xt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,
|
|
62
|
+
}, H = 2147483647, xt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, $e = Symbol("stop");
|
|
63
63
|
class Le {
|
|
64
64
|
options;
|
|
65
65
|
constructor(t) {
|
|
@@ -140,7 +140,7 @@ const Dt = (e) => new Le(e), Ot = {
|
|
|
140
140
|
n && (r += n.byteLength, s?.({ percent: 1, totalBytes: Math.max(t, r), transferredBytes: r }, n));
|
|
141
141
|
}
|
|
142
142
|
}));
|
|
143
|
-
},
|
|
143
|
+
}, _t = (e, t) => {
|
|
144
144
|
if (!e.body)
|
|
145
145
|
return e;
|
|
146
146
|
if (e.status === 204)
|
|
@@ -155,7 +155,7 @@ const Dt = (e) => new Le(e), Ot = {
|
|
|
155
155
|
statusText: e.statusText,
|
|
156
156
|
headers: e.headers
|
|
157
157
|
});
|
|
158
|
-
},
|
|
158
|
+
}, $t = (e, t, s) => {
|
|
159
159
|
if (!e.body)
|
|
160
160
|
return e;
|
|
161
161
|
const n = Bt(s ?? e.body);
|
|
@@ -164,9 +164,9 @@ const Dt = (e) => new Le(e), Ot = {
|
|
|
164
164
|
duplex: "half",
|
|
165
165
|
body: ze(e.body, n, t)
|
|
166
166
|
});
|
|
167
|
-
},
|
|
167
|
+
}, U = (e) => e !== null && typeof e == "object", M = (...e) => {
|
|
168
168
|
for (const t of e)
|
|
169
|
-
if ((!
|
|
169
|
+
if ((!U(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
|
}, je = (e = {}, t = {}) => {
|
|
@@ -196,7 +196,7 @@ const qe = (e = {}, t = {}) => ({
|
|
|
196
196
|
throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");
|
|
197
197
|
s.append(String(r[0]), String(r[1]));
|
|
198
198
|
}
|
|
199
|
-
else if (
|
|
199
|
+
else if (U(n))
|
|
200
200
|
for (const [r, i] of Object.entries(n))
|
|
201
201
|
i !== void 0 && s.append(r, String(i));
|
|
202
202
|
else {
|
|
@@ -211,14 +211,14 @@ const qe = (e = {}, t = {}) => ({
|
|
|
211
211
|
for (const o of e)
|
|
212
212
|
if (Array.isArray(o))
|
|
213
213
|
Array.isArray(t) || (t = []), t = [...t, ...o];
|
|
214
|
-
else if (
|
|
214
|
+
else if (U(o)) {
|
|
215
215
|
for (let [a, c] of Object.entries(o)) {
|
|
216
216
|
if (a === "signal" && c instanceof globalThis.AbortSignal) {
|
|
217
217
|
i.push(c);
|
|
218
218
|
continue;
|
|
219
219
|
}
|
|
220
220
|
if (a === "context") {
|
|
221
|
-
if (c != null && (!
|
|
221
|
+
if (c != null && (!U(c) || Array.isArray(c)))
|
|
222
222
|
throw new TypeError("The `context` option must be an object");
|
|
223
223
|
t = {
|
|
224
224
|
...t,
|
|
@@ -230,12 +230,12 @@ const qe = (e = {}, t = {}) => ({
|
|
|
230
230
|
c == null ? r = void 0 : r = r === void 0 ? c : Lt(r, c);
|
|
231
231
|
continue;
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
U(c) && a in t && (c = oe(t[a], c)), t = { ...t, [a]: c };
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
U(o.hooks) && (n = qe(n, o.hooks), t.hooks = n), U(o.headers) && (s = je(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
|
-
}, zt = (e) =>
|
|
238
|
+
}, zt = (e) => _e.includes(e) ? e.toUpperCase() : e, jt = ["get", "put", "head", "delete", "options", "trace"], qt = [408, 413, 429, 500, 502, 503, 504], Ft = [413, 429, 503], Ee = {
|
|
239
239
|
limit: 2,
|
|
240
240
|
methods: jt,
|
|
241
241
|
statusCodes: qt,
|
|
@@ -299,9 +299,9 @@ function Xt(e) {
|
|
|
299
299
|
function Jt(e) {
|
|
300
300
|
return e instanceof G || e?.name === G.name;
|
|
301
301
|
}
|
|
302
|
-
class
|
|
302
|
+
class O {
|
|
303
303
|
static create(t, s) {
|
|
304
|
-
const n = new
|
|
304
|
+
const n = new O(t, s), r = async () => {
|
|
305
305
|
if (typeof n.#e.timeout == "number" && n.#e.timeout > H)
|
|
306
306
|
throw new RangeError(`The \`timeout\` option cannot be greater than ${H}`);
|
|
307
307
|
await Promise.resolve();
|
|
@@ -325,7 +325,7 @@ class D {
|
|
|
325
325
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
326
326
|
if (!Ut)
|
|
327
327
|
throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
328
|
-
return
|
|
328
|
+
return _t(o.clone(), n.#e.onDownloadProgress);
|
|
329
329
|
}
|
|
330
330
|
return o;
|
|
331
331
|
}, i = n.#f(r).finally(async () => {
|
|
@@ -388,7 +388,7 @@ class D {
|
|
|
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
390
|
if (this.#t instanceof globalThis.Request && (Ct && 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
|
-
const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(
|
|
391
|
+
const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(O.#d(this.#e.searchParams)).toString()), o = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, i);
|
|
392
392
|
this.request = new globalThis.Request(o, this.#e);
|
|
393
393
|
}
|
|
394
394
|
if (this.#e.onUploadProgress) {
|
|
@@ -463,7 +463,7 @@ class D {
|
|
|
463
463
|
}
|
|
464
464
|
if (i instanceof globalThis.Response)
|
|
465
465
|
return i;
|
|
466
|
-
if (i ===
|
|
466
|
+
if (i === $e)
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
469
|
return this.#f(t);
|
|
@@ -494,15 +494,15 @@ class D {
|
|
|
494
494
|
this.#i = void 0, this.request = this.#h(t);
|
|
495
495
|
}
|
|
496
496
|
#h(t, s) {
|
|
497
|
-
return !this.#e.onUploadProgress || !t.body ? t :
|
|
497
|
+
return !this.#e.onUploadProgress || !t.body ? t : $t(t, this.#e.onUploadProgress, s ?? this.#e.body ?? void 0);
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
/*! MIT License © Sindre Sorhus */
|
|
501
501
|
const Z = (e) => {
|
|
502
|
-
const t = (s, n) =>
|
|
503
|
-
for (const s of
|
|
504
|
-
t[s] = (n, r) =>
|
|
505
|
-
return t.create = (s) => Z(M(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Z(M(e, s))), t.stop =
|
|
502
|
+
const t = (s, n) => O.create(s, M(e, n));
|
|
503
|
+
for (const s of _e)
|
|
504
|
+
t[s] = (n, r) => O.create(n, M(e, r, { method: s }));
|
|
505
|
+
return t.create = (s) => Z(M(s)), t.extend = (s) => (typeof s == "function" && (s = s(e ?? {})), Z(M(e, s))), t.stop = $e, t.retry = Dt, t;
|
|
506
506
|
}, Gt = Z();
|
|
507
507
|
var S = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(S || {});
|
|
508
508
|
const Fe = {
|
|
@@ -707,7 +707,7 @@ function os(e, t = {}) {
|
|
|
707
707
|
const s = new Uint8Array(1);
|
|
708
708
|
return s[0] = Number(e), typeof t.size == "number" ? (ae(s, { size: t.size }), q(s, { size: t.size })) : s;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
710
|
+
const T = {
|
|
711
711
|
zero: 48,
|
|
712
712
|
nine: 57,
|
|
713
713
|
A: 65,
|
|
@@ -716,12 +716,12 @@ const R = {
|
|
|
716
716
|
f: 102
|
|
717
717
|
};
|
|
718
718
|
function Re(e) {
|
|
719
|
-
if (e >=
|
|
720
|
-
return e -
|
|
721
|
-
if (e >=
|
|
722
|
-
return e - (
|
|
723
|
-
if (e >=
|
|
724
|
-
return e - (
|
|
719
|
+
if (e >= T.zero && e <= T.nine)
|
|
720
|
+
return e - T.zero;
|
|
721
|
+
if (e >= T.A && e <= T.F)
|
|
722
|
+
return e - (T.A - 10);
|
|
723
|
+
if (e >= T.a && e <= T.f)
|
|
724
|
+
return e - (T.a - 10);
|
|
725
725
|
}
|
|
726
726
|
function st(e, t = {}) {
|
|
727
727
|
let s = e;
|
|
@@ -745,9 +745,9 @@ function nt(e, t = {}) {
|
|
|
745
745
|
const s = ns.encode(e);
|
|
746
746
|
return typeof t.size == "number" ? (ae(s, { size: t.size }), q(s, { dir: "right", size: t.size })) : s;
|
|
747
747
|
}
|
|
748
|
-
const
|
|
748
|
+
const _ = /* @__PURE__ */ BigInt(2 ** 32 - 1), Te = /* @__PURE__ */ BigInt(32);
|
|
749
749
|
function as(e, t = !1) {
|
|
750
|
-
return t ? { h: Number(e &
|
|
750
|
+
return t ? { h: Number(e & _), l: Number(e >> Te & _) } : { h: Number(e >> Te & _) | 0, l: Number(e & _) | 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 $(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
|
+
$(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)), $(e), e;
|
|
812
812
|
}
|
|
813
813
|
class Es {
|
|
814
814
|
}
|
|
@@ -816,12 +816,12 @@ 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 Rs = BigInt(0),
|
|
820
|
-
for (let e = 0, t =
|
|
819
|
+
const Rs = BigInt(0), k = BigInt(1), Ts = 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 = Rs;
|
|
823
823
|
for (let i = 0; i < 7; i++)
|
|
824
|
-
t = (t <<
|
|
824
|
+
t = (t << k ^ (t >> As) * Ps) % vs, t & Ts && (r ^= k << (k << /* @__PURE__ */ BigInt(i)) - k);
|
|
825
825
|
ct.push(r);
|
|
826
826
|
}
|
|
827
827
|
const ut = cs(ct, !0), Is = ut[0], Us = ut[1], Ie = (e, t, s) => s > 32 ? fs(e, t, s) : us(e, t, s), Ue = (e, t, s) => s > 32 ? hs(e, t, s) : ls(e, t, s);
|
|
@@ -831,9 +831,9 @@ function Cs(e, t = 24) {
|
|
|
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], f = s[c + 1],
|
|
835
|
-
for (let
|
|
836
|
-
e[o +
|
|
834
|
+
const a = (o + 8) % 10, c = (o + 2) % 10, u = s[c], f = s[c + 1], w = Ie(u, f, 1) ^ s[a], p = Ue(u, f, 1) ^ s[a + 1];
|
|
835
|
+
for (let y = 0; y < 50; y += 10)
|
|
836
|
+
e[o + y] ^= w, e[o + y + 1] ^= p;
|
|
837
837
|
}
|
|
838
838
|
let r = e[2], i = e[3];
|
|
839
839
|
for (let o = 0; o < 24; o++) {
|
|
@@ -864,7 +864,7 @@ class ce extends Es {
|
|
|
864
864
|
Pe(this.state32), Cs(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), $(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), $(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();
|
|
@@ -961,7 +961,7 @@ function ft(e, t) {
|
|
|
961
961
|
const i = `0x${r.join("")}`;
|
|
962
962
|
return W.set(`${e}.${t}`, i), i;
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function A(e, t) {
|
|
965
965
|
if (!Ms(e, { strict: !1 }))
|
|
966
966
|
throw new Os({ address: e });
|
|
967
967
|
return ft(e, t);
|
|
@@ -976,23 +976,23 @@ function Ms(e, t) {
|
|
|
976
976
|
}
|
|
977
977
|
const Bs = {
|
|
978
978
|
chainId: He.chainId,
|
|
979
|
-
address:
|
|
979
|
+
address: A("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
|
|
980
980
|
symbol: "USDC",
|
|
981
981
|
fiatISO: "USD",
|
|
982
982
|
decimals: 6,
|
|
983
983
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
984
984
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
985
|
-
},
|
|
985
|
+
}, _s = {
|
|
986
986
|
chainId: Fe.chainId,
|
|
987
|
-
address:
|
|
987
|
+
address: A("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
|
|
988
988
|
symbol: "USDC",
|
|
989
989
|
name: "USD Coin",
|
|
990
990
|
decimals: 6,
|
|
991
991
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
992
992
|
/* USDC */
|
|
993
|
-
},
|
|
993
|
+
}, $s = {
|
|
994
994
|
chainId: Ge.chainId,
|
|
995
|
-
address:
|
|
995
|
+
address: A("0x5425890298aed601595a70ab815c96711a31bc65"),
|
|
996
996
|
symbol: "USDC",
|
|
997
997
|
fiatISO: "USD",
|
|
998
998
|
decimals: 6,
|
|
@@ -1000,7 +1000,7 @@ const Bs = {
|
|
|
1000
1000
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1001
1001
|
}, Ls = {
|
|
1002
1002
|
chainId: Je.chainId,
|
|
1003
|
-
address:
|
|
1003
|
+
address: A("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
|
|
1004
1004
|
symbol: "USDC",
|
|
1005
1005
|
fiatISO: "USD",
|
|
1006
1006
|
decimals: 6,
|
|
@@ -1008,7 +1008,7 @@ const Bs = {
|
|
|
1008
1008
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1009
1009
|
}, zs = {
|
|
1010
1010
|
chainId: We.chainId,
|
|
1011
|
-
address:
|
|
1011
|
+
address: A("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
|
|
1012
1012
|
symbol: "USDC",
|
|
1013
1013
|
fiatISO: "USD",
|
|
1014
1014
|
decimals: 6,
|
|
@@ -1016,7 +1016,7 @@ const Bs = {
|
|
|
1016
1016
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1017
1017
|
}, js = {
|
|
1018
1018
|
chainId: Ke.chainId,
|
|
1019
|
-
address:
|
|
1019
|
+
address: A("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
|
|
1020
1020
|
symbol: "USDC",
|
|
1021
1021
|
fiatISO: "USD",
|
|
1022
1022
|
decimals: 6,
|
|
@@ -1024,21 +1024,21 @@ const Bs = {
|
|
|
1024
1024
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1025
1025
|
}, qs = {
|
|
1026
1026
|
chainId: Ve.chainId,
|
|
1027
|
-
address:
|
|
1027
|
+
address: A("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
|
|
1028
1028
|
symbol: "USDC",
|
|
1029
1029
|
decimals: 18,
|
|
1030
1030
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1031
1031
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1032
1032
|
}, Fs = {
|
|
1033
1033
|
chainId: Xe.chainId,
|
|
1034
|
-
address:
|
|
1034
|
+
address: A("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
|
|
1035
1035
|
symbol: "USDC",
|
|
1036
1036
|
decimals: 6,
|
|
1037
1037
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1038
1038
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1039
1039
|
}, Hs = {
|
|
1040
1040
|
chainId: Ye.chainId,
|
|
1041
|
-
address:
|
|
1041
|
+
address: A("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
|
|
1042
1042
|
symbol: "USDC",
|
|
1043
1043
|
decimals: 6,
|
|
1044
1044
|
logoURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
@@ -1054,7 +1054,7 @@ const Bs = {
|
|
|
1054
1054
|
ARBITRUM_MAINNET: {
|
|
1055
1055
|
...Fe,
|
|
1056
1056
|
tokens: {
|
|
1057
|
-
[S.USDC]:
|
|
1057
|
+
[S.USDC]: _s
|
|
1058
1058
|
},
|
|
1059
1059
|
explorer: "https://arbiscan.io"
|
|
1060
1060
|
},
|
|
@@ -1075,7 +1075,7 @@ const Bs = {
|
|
|
1075
1075
|
AVALANCHE_TESTNET: {
|
|
1076
1076
|
...Ge,
|
|
1077
1077
|
tokens: {
|
|
1078
|
-
[S.USDC]:
|
|
1078
|
+
[S.USDC]: $s
|
|
1079
1079
|
},
|
|
1080
1080
|
explorer: "https://testnet.snowtrace.io"
|
|
1081
1081
|
},
|
|
@@ -1132,37 +1132,37 @@ 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
|
|
1135
|
+
class d {
|
|
1136
1136
|
constructor({ api_key: t, env: s, seesion_token: n }) {
|
|
1137
1137
|
this.api_key = t || "", this.sessionToken = n || "", this.env = s ?? ue.PRODUCTION;
|
|
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)), 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
1154
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1155
|
-
return
|
|
1155
|
+
return d.app.sessionToken;
|
|
1156
1156
|
}
|
|
1157
1157
|
static getEnv() {
|
|
1158
|
-
if (!
|
|
1158
|
+
if (!d.app)
|
|
1159
1159
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1160
|
-
return
|
|
1160
|
+
return d.app.env === "internal" ? "staging" : d.app.env;
|
|
1161
1161
|
}
|
|
1162
1162
|
static getBaseUrl() {
|
|
1163
|
-
if (!
|
|
1163
|
+
if (!d.app)
|
|
1164
1164
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1165
|
-
switch (
|
|
1165
|
+
switch (d.app.env) {
|
|
1166
1166
|
case "production":
|
|
1167
1167
|
return "https://api.chainrails.io/api/v1";
|
|
1168
1168
|
case "staging":
|
|
@@ -1174,23 +1174,23 @@ class h {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
1176
|
static getPayModalUrl(t, s, n, r) {
|
|
1177
|
-
if (!
|
|
1177
|
+
if (!d.app)
|
|
1178
1178
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1179
|
-
const i =
|
|
1179
|
+
const i = d.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", o = r && r > 0 ? "/pay/" : "/deposit/", a = `_chain_/${t}/_token_/${s}/_to_/${n}${r ? "/_amount_/" + r * 100 : ""}`;
|
|
1180
1180
|
return i + o + a;
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
1183
|
let ee = null;
|
|
1184
1184
|
function Ys() {
|
|
1185
1185
|
ee = Gt.create({
|
|
1186
|
-
prefixUrl:
|
|
1186
|
+
prefixUrl: d.getBaseUrl(),
|
|
1187
1187
|
headers: {
|
|
1188
1188
|
"Content-Type": "application/json"
|
|
1189
1189
|
},
|
|
1190
1190
|
hooks: {
|
|
1191
1191
|
beforeRequest: [
|
|
1192
1192
|
(e) => {
|
|
1193
|
-
const t =
|
|
1193
|
+
const t = d.getSessionToken() || d.getApiKey();
|
|
1194
1194
|
e.headers.set("Authorization", `Bearer ${t}`);
|
|
1195
1195
|
}
|
|
1196
1196
|
],
|
|
@@ -1201,80 +1201,80 @@ function Ys() {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function g() {
|
|
1205
1205
|
return ee || Ys(), ee;
|
|
1206
1206
|
}
|
|
1207
1207
|
class Xs {
|
|
1208
1208
|
async getById(t) {
|
|
1209
|
-
return await
|
|
1209
|
+
return await g().get("intents/" + t).json();
|
|
1210
1210
|
}
|
|
1211
1211
|
async getForSender(t) {
|
|
1212
|
-
return await
|
|
1212
|
+
return await g().get("intents/user/" + t).json();
|
|
1213
1213
|
}
|
|
1214
1214
|
async getForAddress(t) {
|
|
1215
|
-
return await
|
|
1215
|
+
return await g().get("intents/address/" + t).json();
|
|
1216
1216
|
}
|
|
1217
1217
|
async getForSession(t) {
|
|
1218
|
-
return await
|
|
1218
|
+
return await g().get("modal/sessions/intents/" + t).json();
|
|
1219
1219
|
}
|
|
1220
1220
|
async getAll(t) {
|
|
1221
|
-
return await
|
|
1221
|
+
return await g().get("intents", { searchParams: t }).json();
|
|
1222
1222
|
}
|
|
1223
1223
|
async create(t) {
|
|
1224
|
-
return await
|
|
1224
|
+
return await g().post("intents", { json: t }).json();
|
|
1225
1225
|
}
|
|
1226
1226
|
async createForSession(t) {
|
|
1227
|
-
return await
|
|
1227
|
+
return await g().post("modal/sessions/intents", { json: t }).json();
|
|
1228
1228
|
}
|
|
1229
1229
|
async update(t, s) {
|
|
1230
|
-
return await
|
|
1230
|
+
return await g().post("intents", { json: s }).json();
|
|
1231
1231
|
}
|
|
1232
1232
|
async triggerProcessing(t) {
|
|
1233
|
-
return await
|
|
1233
|
+
return await g().post(`intents/${t}/trigger-processing`).json();
|
|
1234
1234
|
}
|
|
1235
1235
|
async triggerProcessingForSession(t) {
|
|
1236
|
-
return await
|
|
1236
|
+
return await g().post(`modal/sessions/intents/${t}/process`).json();
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
class Js {
|
|
1240
1240
|
async getFromSpecificBridge(t) {
|
|
1241
|
-
return await
|
|
1241
|
+
return await g().get("quotes/single", { searchParams: t }).json();
|
|
1242
1242
|
}
|
|
1243
1243
|
async getFromAllBridges(t) {
|
|
1244
|
-
return await
|
|
1244
|
+
return await g().get("quotes/multiple", { searchParams: t }).json();
|
|
1245
1245
|
}
|
|
1246
1246
|
async getBestAcrossBridges(t) {
|
|
1247
|
-
return await
|
|
1247
|
+
return await g().get("quotes/best", { searchParams: t }).json();
|
|
1248
1248
|
}
|
|
1249
1249
|
async getAll(t) {
|
|
1250
|
-
return await
|
|
1250
|
+
return await g().get("quotes/multi-source", { searchParams: t }).json();
|
|
1251
1251
|
}
|
|
1252
1252
|
async getAllForSession(t) {
|
|
1253
|
-
return await
|
|
1253
|
+
return await g().get("modal/sessions/quotes", { searchParams: t }).json();
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
class Gs {
|
|
1257
1257
|
async getOptimalRoutes(t) {
|
|
1258
|
-
return await
|
|
1258
|
+
return await g().get("router/optimal-route", { searchParams: t }).json();
|
|
1259
1259
|
}
|
|
1260
1260
|
async getAllSupportedBridges() {
|
|
1261
|
-
return await
|
|
1261
|
+
return await g().get("router/supported-bridges/all").json();
|
|
1262
1262
|
}
|
|
1263
1263
|
async getSupportedBridges(t) {
|
|
1264
|
-
return await
|
|
1264
|
+
return await g().get("router/supported-bridges/route", { searchParams: t }).json();
|
|
1265
1265
|
}
|
|
1266
1266
|
async getSupportedRoutes(t, s) {
|
|
1267
|
-
return await
|
|
1267
|
+
return await g().get("router/supported-bridges/bridge/" + t, { searchParams: s }).json();
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
1270
|
class Zs {
|
|
1271
1271
|
async getSupported(t) {
|
|
1272
|
-
return await
|
|
1272
|
+
return await g().get("chains", { searchParams: t }).json();
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
1275
|
class Qs {
|
|
1276
1276
|
async getClientInfo() {
|
|
1277
|
-
return await
|
|
1277
|
+
return await g().get("client/auth/client-info").json();
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
1280
|
class en {
|
|
@@ -1288,7 +1288,7 @@ class en {
|
|
|
1288
1288
|
destinationChain: Q[t.destinationChain],
|
|
1289
1289
|
amount: t.amount
|
|
1290
1290
|
};
|
|
1291
|
-
return
|
|
1291
|
+
return g().post("modal/sessions", { json: s }).json();
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
1294
|
const Pn = {
|
|
@@ -1324,34 +1324,39 @@ function In(e) {
|
|
|
1324
1324
|
close: c,
|
|
1325
1325
|
onCancel: u,
|
|
1326
1326
|
onSuccess: f,
|
|
1327
|
-
|
|
1328
|
-
|
|
1327
|
+
session_url: w,
|
|
1328
|
+
data: p
|
|
1329
|
+
} = e, [y, R] = X(!0), b = ne(null);
|
|
1329
1330
|
re(() => {
|
|
1330
|
-
|
|
1331
|
-
const
|
|
1332
|
-
i ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow =
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1331
|
+
m();
|
|
1332
|
+
const h = document.body.style.overflow;
|
|
1333
|
+
i ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = h || "";
|
|
1334
|
+
const E = (P) => {
|
|
1335
|
+
P.data === "closed" && (c(), u?.()), P.data === "completed" && (window.setTimeout(c, 2e3), f?.());
|
|
1335
1336
|
};
|
|
1336
|
-
return window.addEventListener("message",
|
|
1337
|
-
document.body.style.overflow =
|
|
1337
|
+
return window.addEventListener("message", E), () => {
|
|
1338
|
+
document.body.style.overflow = h || "", window.removeEventListener("message", E);
|
|
1338
1339
|
};
|
|
1339
|
-
}, [i, u, f,
|
|
1340
|
-
function A() {
|
|
1341
|
-
w(!1), l();
|
|
1342
|
-
}
|
|
1340
|
+
}, [i, u, f, p?.sessionToken]);
|
|
1343
1341
|
function l() {
|
|
1344
|
-
|
|
1345
|
-
|
|
1342
|
+
R(!1), m();
|
|
1343
|
+
}
|
|
1344
|
+
function m() {
|
|
1345
|
+
if (!p?.sessionToken) return;
|
|
1346
|
+
d.config({
|
|
1347
|
+
api_key: p.sessionToken,
|
|
1348
|
+
env: w === "https://chainrails-sdk-server.vercel.app/test/create-session" ? "internal" : "production"
|
|
1349
|
+
});
|
|
1350
|
+
const h = {
|
|
1346
1351
|
type: "session",
|
|
1347
|
-
session_token:
|
|
1348
|
-
environment:
|
|
1352
|
+
session_token: p.sessionToken,
|
|
1353
|
+
environment: d.getEnv() || ue.PRODUCTION
|
|
1349
1354
|
};
|
|
1350
|
-
console.log(b.current, b.current?.contentWindow, b.current?.src), b.current?.contentWindow?.postMessage(
|
|
1355
|
+
console.log(b.current, b.current?.contentWindow, b.current?.src), b.current?.contentWindow?.postMessage(h, "https://app.chainrails.io"), b.current?.contentWindow?.postMessage(h, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
|
|
1351
1356
|
}
|
|
1352
1357
|
return /* @__PURE__ */ we("div", {
|
|
1353
|
-
className: tn("payment-modal-wrapper",
|
|
1354
|
-
children: [(
|
|
1358
|
+
className: tn("payment-modal-wrapper", y || o ? "loading" : "not-loading", i ? "open" : "closed"),
|
|
1359
|
+
children: [(y || o) && /* @__PURE__ */ N("div", {
|
|
1355
1360
|
role: "status",
|
|
1356
1361
|
className: "payment-modal-loader",
|
|
1357
1362
|
children: /* @__PURE__ */ we("svg", {
|
|
@@ -1370,9 +1375,9 @@ function In(e) {
|
|
|
1370
1375
|
})
|
|
1371
1376
|
}), /* @__PURE__ */ N("iframe", {
|
|
1372
1377
|
allow: "clipboard-read *; clipboard-write *",
|
|
1373
|
-
src:
|
|
1374
|
-
onLoad:
|
|
1375
|
-
className: `payment-modal ${
|
|
1378
|
+
src: d.getPayModalUrl(n, s, t, r),
|
|
1379
|
+
onLoad: l,
|
|
1380
|
+
className: `payment-modal ${y || o ? "invisible" : "visible"}`,
|
|
1376
1381
|
"data-id": r,
|
|
1377
1382
|
ref: b
|
|
1378
1383
|
})]
|
|
@@ -1381,7 +1386,7 @@ function In(e) {
|
|
|
1381
1386
|
function sn(e) {
|
|
1382
1387
|
return BigInt(e).toString();
|
|
1383
1388
|
}
|
|
1384
|
-
const nn = Symbol(), le = Symbol(),
|
|
1389
|
+
const nn = Symbol(), le = Symbol(), x = "a", pt = "f", ke = "p", gt = "c", mt = "t", fe = "h", D = "w", he = "o", de = "k";
|
|
1385
1390
|
let rn = (e, t) => new Proxy(e, t);
|
|
1386
1391
|
const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) => e && (se.has(e) ? se.get(e) : te(e) === Object.prototype || te(e) === Array.prototype), L = (e) => typeof e == "object" && e !== null, on = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), an = (e) => {
|
|
1387
1392
|
if (Array.isArray(e))
|
|
@@ -1397,19 +1402,19 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1397
1402
|
let n = !1;
|
|
1398
1403
|
const r = (a, c) => {
|
|
1399
1404
|
if (!n) {
|
|
1400
|
-
let u = s[
|
|
1401
|
-
if (u || (u = {}, s[
|
|
1402
|
-
u[
|
|
1405
|
+
let u = s[x].get(e);
|
|
1406
|
+
if (u || (u = {}, s[x].set(e, u)), a === D)
|
|
1407
|
+
u[D] = !0;
|
|
1403
1408
|
else {
|
|
1404
1409
|
let f = u[a];
|
|
1405
1410
|
f || (f = /* @__PURE__ */ new Set(), u[a] = f), f.add(c);
|
|
1406
1411
|
}
|
|
1407
1412
|
}
|
|
1408
1413
|
}, i = () => {
|
|
1409
|
-
n = !0, s[
|
|
1414
|
+
n = !0, s[x].delete(e);
|
|
1410
1415
|
}, o = {
|
|
1411
1416
|
get(a, c) {
|
|
1412
|
-
return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[
|
|
1417
|
+
return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[x], s[gt], s[mt]));
|
|
1413
1418
|
},
|
|
1414
1419
|
has(a, c) {
|
|
1415
1420
|
return c === nn ? (i(), !0) : (r(fe, c), Reflect.has(a, c));
|
|
@@ -1418,7 +1423,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1418
1423
|
return r(he, c), Reflect.getOwnPropertyDescriptor(a, c);
|
|
1419
1424
|
},
|
|
1420
1425
|
ownKeys(a) {
|
|
1421
|
-
return r(
|
|
1426
|
+
return r(D), Reflect.ownKeys(a);
|
|
1422
1427
|
}
|
|
1423
1428
|
};
|
|
1424
1429
|
return t && (o.set = o.deleteProperty = () => !1), [o, s];
|
|
@@ -1436,7 +1441,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1436
1441
|
}
|
|
1437
1442
|
const [i, o] = r;
|
|
1438
1443
|
let a = s && s.get(i);
|
|
1439
|
-
return (!a || a[1][pt] !== !!o) && (a = cn(i, !!o), a[1][ke] = rn(o || i, a[0]), s && s.set(i, a)), a[1][
|
|
1444
|
+
return (!a || a[1][pt] !== !!o) && (a = cn(i, !!o), a[1][ke] = rn(o || i, a[0]), s && s.set(i, a)), a[1][x] = t, a[1][gt] = s, a[1][mt] = n, a[1][ke];
|
|
1440
1445
|
}, un = (e, t) => {
|
|
1441
1446
|
const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
|
|
1442
1447
|
return s.length !== n.length || s.some((r, i) => r !== n[i]);
|
|
@@ -1457,7 +1462,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1457
1462
|
for (const a of i[fe] || [])
|
|
1458
1463
|
if (o = Reflect.has(e, a) !== Reflect.has(t, a), o)
|
|
1459
1464
|
return o;
|
|
1460
|
-
if (i[
|
|
1465
|
+
if (i[D] === !0) {
|
|
1461
1466
|
if (o = un(e, t), o)
|
|
1462
1467
|
return o;
|
|
1463
1468
|
} else
|
|
@@ -1480,21 +1485,21 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1480
1485
|
if (r.has(o))
|
|
1481
1486
|
return;
|
|
1482
1487
|
L(o) && r.add(o);
|
|
1483
|
-
const
|
|
1484
|
-
if (
|
|
1485
|
-
if ((c =
|
|
1486
|
-
const
|
|
1487
|
-
n.push(a ? [...a,
|
|
1488
|
-
}),
|
|
1489
|
-
const
|
|
1490
|
-
n.push(a ? [...a,
|
|
1488
|
+
const w = L(o) && t.get(pe(o));
|
|
1489
|
+
if (w) {
|
|
1490
|
+
if ((c = w[fe]) === null || c === void 0 || c.forEach((p) => {
|
|
1491
|
+
const y = `:has(${String(p)})`;
|
|
1492
|
+
n.push(a ? [...a, y] : [y]);
|
|
1493
|
+
}), w[D] === !0) {
|
|
1494
|
+
const p = ":ownKeys";
|
|
1495
|
+
n.push(a ? [...a, p] : [p]);
|
|
1491
1496
|
} else
|
|
1492
|
-
(u =
|
|
1493
|
-
const
|
|
1494
|
-
n.push(a ? [...a,
|
|
1497
|
+
(u = w[he]) === null || u === void 0 || u.forEach((p) => {
|
|
1498
|
+
const y = `:hasOwn(${String(p)})`;
|
|
1499
|
+
n.push(a ? [...a, y] : [y]);
|
|
1495
1500
|
});
|
|
1496
|
-
(f =
|
|
1497
|
-
"value" in (Object.getOwnPropertyDescriptor(o,
|
|
1501
|
+
(f = w[de]) === null || f === void 0 || f.forEach((p) => {
|
|
1502
|
+
"value" in (Object.getOwnPropertyDescriptor(o, p) || {}) && i(o[p], a ? [...a, p] : [p]);
|
|
1498
1503
|
});
|
|
1499
1504
|
} else a && n.push(a);
|
|
1500
1505
|
};
|
|
@@ -1519,8 +1524,8 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1519
1524
|
};
|
|
1520
1525
|
if (me.has(i))
|
|
1521
1526
|
xe(i, !1);
|
|
1522
|
-
else if (
|
|
1523
|
-
const [c, u] =
|
|
1527
|
+
else if (C.has(i)) {
|
|
1528
|
+
const [c, u] = C.get(
|
|
1524
1529
|
i
|
|
1525
1530
|
);
|
|
1526
1531
|
a.value = Et(c, u());
|
|
@@ -1539,10 +1544,10 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1539
1544
|
if (c && (Oe(u, o) || j.has(o) && Oe(u, j.get(o))))
|
|
1540
1545
|
return !0;
|
|
1541
1546
|
s(i), ge(o) && (o = ln(o) || o);
|
|
1542
|
-
const f = !
|
|
1547
|
+
const f = !C.has(o) && gn(o) ? St(o) : o;
|
|
1543
1548
|
return t(i, f), Reflect.set(r, i, f, a), n(["set", [i], o, u]), !0;
|
|
1544
1549
|
}
|
|
1545
|
-
}),
|
|
1550
|
+
}), C = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakSet(), De = /* @__PURE__ */ new WeakMap(), Y = [1], j = /* @__PURE__ */ new WeakMap();
|
|
1546
1551
|
let Oe = Object.is, pn = (e, t) => new Proxy(e, t), gn = hn, mn = Et, yn = dn;
|
|
1547
1552
|
function St(e = {}) {
|
|
1548
1553
|
if (!ge(e))
|
|
@@ -1551,60 +1556,60 @@ function St(e = {}) {
|
|
|
1551
1556
|
if (t)
|
|
1552
1557
|
return t;
|
|
1553
1558
|
let s = Y[0];
|
|
1554
|
-
const n = /* @__PURE__ */ new Set(), r = (l,
|
|
1555
|
-
s !==
|
|
1559
|
+
const n = /* @__PURE__ */ new Set(), r = (l, m = ++Y[0]) => {
|
|
1560
|
+
s !== m && (i = s = m, n.forEach((h) => h(l, m)));
|
|
1556
1561
|
};
|
|
1557
1562
|
let i = s;
|
|
1558
|
-
const o = (l = Y[0]) => (i !== l && (i = l, c.forEach(([
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1561
|
-
})), s), a = (l) => (
|
|
1562
|
-
const E = [...
|
|
1563
|
-
E[1] = [l, ...E[1]], r(E,
|
|
1564
|
-
}, c = /* @__PURE__ */ new Map(), u = (l,
|
|
1565
|
-
const
|
|
1566
|
-
if (
|
|
1563
|
+
const o = (l = Y[0]) => (i !== l && (i = l, c.forEach(([m]) => {
|
|
1564
|
+
const h = m[1](l);
|
|
1565
|
+
h > s && (s = h);
|
|
1566
|
+
})), s), a = (l) => (m, h) => {
|
|
1567
|
+
const E = [...m];
|
|
1568
|
+
E[1] = [l, ...E[1]], r(E, h);
|
|
1569
|
+
}, c = /* @__PURE__ */ new Map(), u = (l, m) => {
|
|
1570
|
+
const h = !me.has(m) && C.get(m);
|
|
1571
|
+
if (h) {
|
|
1567
1572
|
if ((z ? "production" : void 0) !== "production" && c.has(l))
|
|
1568
1573
|
throw new Error("prop listener already exists");
|
|
1569
1574
|
if (n.size) {
|
|
1570
|
-
const E =
|
|
1571
|
-
c.set(l, [
|
|
1575
|
+
const E = h[2](a(l));
|
|
1576
|
+
c.set(l, [h, E]);
|
|
1572
1577
|
} else
|
|
1573
|
-
c.set(l, [
|
|
1578
|
+
c.set(l, [h]);
|
|
1574
1579
|
}
|
|
1575
1580
|
}, f = (l) => {
|
|
1576
|
-
var
|
|
1577
|
-
const
|
|
1578
|
-
|
|
1579
|
-
},
|
|
1581
|
+
var m;
|
|
1582
|
+
const h = c.get(l);
|
|
1583
|
+
h && (c.delete(l), (m = h[1]) == null || m.call(h));
|
|
1584
|
+
}, w = (l) => (n.add(l), n.size === 1 && c.forEach(([h, E], P) => {
|
|
1580
1585
|
if ((z ? "production" : void 0) !== "production" && E)
|
|
1581
1586
|
throw new Error("remove already exists");
|
|
1582
|
-
const Rt =
|
|
1583
|
-
c.set(
|
|
1587
|
+
const Rt = h[2](a(P));
|
|
1588
|
+
c.set(P, [h, Rt]);
|
|
1584
1589
|
}), () => {
|
|
1585
|
-
n.delete(l), n.size === 0 && c.forEach(([
|
|
1586
|
-
E && (E(), c.set(
|
|
1590
|
+
n.delete(l), n.size === 0 && c.forEach(([h, E], P) => {
|
|
1591
|
+
E && (E(), c.set(P, [h]));
|
|
1587
1592
|
});
|
|
1588
1593
|
});
|
|
1589
|
-
let
|
|
1590
|
-
const
|
|
1591
|
-
() =>
|
|
1594
|
+
let p = !0;
|
|
1595
|
+
const y = yn(
|
|
1596
|
+
() => p,
|
|
1592
1597
|
u,
|
|
1593
1598
|
f,
|
|
1594
1599
|
r
|
|
1595
|
-
),
|
|
1596
|
-
j.set(e,
|
|
1597
|
-
const
|
|
1598
|
-
return
|
|
1599
|
-
const
|
|
1600
|
+
), R = pn(e, y);
|
|
1601
|
+
j.set(e, R);
|
|
1602
|
+
const b = [e, o, w];
|
|
1603
|
+
return C.set(R, b), Reflect.ownKeys(e).forEach((l) => {
|
|
1604
|
+
const m = Object.getOwnPropertyDescriptor(
|
|
1600
1605
|
e,
|
|
1601
1606
|
l
|
|
1602
1607
|
);
|
|
1603
|
-
"value" in
|
|
1604
|
-
}),
|
|
1608
|
+
"value" in m && m.writable && (R[l] = e[l]);
|
|
1609
|
+
}), p = !1, R;
|
|
1605
1610
|
}
|
|
1606
1611
|
function wn(e, t, s) {
|
|
1607
|
-
const n =
|
|
1612
|
+
const n = C.get(e);
|
|
1608
1613
|
(z ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
|
|
1609
1614
|
let r;
|
|
1610
1615
|
const i = [], o = n[2];
|
|
@@ -1619,7 +1624,7 @@ function wn(e, t, s) {
|
|
|
1619
1624
|
};
|
|
1620
1625
|
}
|
|
1621
1626
|
function Ne(e) {
|
|
1622
|
-
const t =
|
|
1627
|
+
const t = C.get(e);
|
|
1623
1628
|
(z ? "production" : void 0) !== "production" && !t && console.warn("Please use proxy object");
|
|
1624
1629
|
const [s, n] = t;
|
|
1625
1630
|
return mn(s, n());
|
|
@@ -1666,7 +1671,7 @@ function Tn(e, t) {
|
|
|
1666
1671
|
const a = ye(() => /* @__PURE__ */ new WeakMap(), []);
|
|
1667
1672
|
return wt(o, n, a, Rn);
|
|
1668
1673
|
}
|
|
1669
|
-
const
|
|
1674
|
+
const I = St({
|
|
1670
1675
|
data: null,
|
|
1671
1676
|
isPending: !1,
|
|
1672
1677
|
error: null
|
|
@@ -1680,16 +1685,16 @@ function Un({
|
|
|
1680
1685
|
onCancel: i,
|
|
1681
1686
|
onSuccess: o
|
|
1682
1687
|
}) {
|
|
1683
|
-
const a = Tn(
|
|
1684
|
-
function
|
|
1688
|
+
const a = Tn(I), [c, u] = X(!1), [f, w] = X(Date.now());
|
|
1689
|
+
function p() {
|
|
1685
1690
|
u(!0);
|
|
1686
1691
|
}
|
|
1687
|
-
function
|
|
1688
|
-
u(!1),
|
|
1692
|
+
function y() {
|
|
1693
|
+
u(!1), R();
|
|
1689
1694
|
}
|
|
1690
|
-
const
|
|
1691
|
-
const
|
|
1692
|
-
|
|
1695
|
+
const R = () => {
|
|
1696
|
+
const b = Date.now();
|
|
1697
|
+
I.isPending = !0, I.error = null, fetch(e, {
|
|
1693
1698
|
method: "POST",
|
|
1694
1699
|
headers: {
|
|
1695
1700
|
"Content-Type": "application/json"
|
|
@@ -1701,31 +1706,28 @@ function Un({
|
|
|
1701
1706
|
recipient: r
|
|
1702
1707
|
})
|
|
1703
1708
|
}).then((l) => l.json()).then((l) => {
|
|
1704
|
-
|
|
1705
|
-
api_key: l.sessionToken,
|
|
1706
|
-
env: e === "https://chainrails-sdk-server.vercel.app/test/create-session" ? "internal" : "production"
|
|
1707
|
-
}), P.isPending = !1, y(A));
|
|
1709
|
+
b < f || (I.data = l, I.isPending = !1, w(b));
|
|
1708
1710
|
}).catch((l) => {
|
|
1709
|
-
|
|
1711
|
+
b < f || (I.error = l?.toString(), I.isPending = !1, w(b));
|
|
1710
1712
|
});
|
|
1711
1713
|
};
|
|
1712
1714
|
return re(() => {
|
|
1713
|
-
|
|
1714
|
-
}, [t, s, n, r]), {
|
|
1715
|
+
R();
|
|
1716
|
+
}, [t, s, n, r, e]), {
|
|
1715
1717
|
...a,
|
|
1716
1718
|
destinationChain: t,
|
|
1717
1719
|
token: s,
|
|
1718
1720
|
recipient: r,
|
|
1719
1721
|
isOpen: c,
|
|
1720
|
-
open:
|
|
1721
|
-
close:
|
|
1722
|
-
refetch:
|
|
1722
|
+
open: p,
|
|
1723
|
+
close: y,
|
|
1724
|
+
refetch: R,
|
|
1723
1725
|
onSuccess: o,
|
|
1724
1726
|
onCancel: i
|
|
1725
1727
|
};
|
|
1726
1728
|
}
|
|
1727
1729
|
export {
|
|
1728
|
-
|
|
1730
|
+
d as Chainrails,
|
|
1729
1731
|
In as PaymentModal,
|
|
1730
1732
|
Q as chains,
|
|
1731
1733
|
Pn as crapi,
|