@chainrails/react 0.1.5 → 0.1.7
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/README.md +479 -22
- package/dist/chainrails-sdk.es.js +69 -68
- package/dist/chainrails-sdk.es.mjs +69 -68
- package/dist/chainrails-sdk.umd.js +1 -1
- package/dist/hooks/usePaymentSession.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState as X, useRef as ne, useEffect as re, useMemo as ye, useSyncExternalStore as
|
|
1
|
+
import { useState as X, useRef as ne, useEffect as re, useMemo as ye, useSyncExternalStore as Rt, useCallback as At, useLayoutEffect as vt, useDebugValue as Pt } from "react";
|
|
2
2
|
import { jsx as C, Fragment as It, jsxs as we } from "react/jsx-runtime";
|
|
3
3
|
import './index.css';class J extends Error {
|
|
4
4
|
response;
|
|
@@ -50,7 +50,7 @@ const be = (() => {
|
|
|
50
50
|
throw r;
|
|
51
51
|
}
|
|
52
52
|
return e && !t;
|
|
53
|
-
})(), Ut = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function",
|
|
53
|
+
})(), Ut = typeof globalThis.AbortController == "function", Be = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function", kt = 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
|
-
}, H = 2147483647, Dt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,
|
|
62
|
+
}, H = 2147483647, Dt = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, _e = Symbol("stop");
|
|
63
63
|
class Le {
|
|
64
64
|
options;
|
|
65
65
|
constructor(t) {
|
|
@@ -98,7 +98,7 @@ const Ot = (e) => new Le(e), Nt = {
|
|
|
98
98
|
signal: !0,
|
|
99
99
|
window: !0,
|
|
100
100
|
duplex: !0
|
|
101
|
-
},
|
|
101
|
+
}, $t = (e) => {
|
|
102
102
|
if (!e)
|
|
103
103
|
return 0;
|
|
104
104
|
if (e instanceof FormData) {
|
|
@@ -140,7 +140,7 @@ const Ot = (e) => new Le(e), Nt = {
|
|
|
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)
|
|
@@ -158,7 +158,7 @@ const Ot = (e) => new Le(e), Nt = {
|
|
|
158
158
|
}, Lt = (e, t, s) => {
|
|
159
159
|
if (!e.body)
|
|
160
160
|
return e;
|
|
161
|
-
const n =
|
|
161
|
+
const n = $t(s ?? e.body);
|
|
162
162
|
return new Request(e, {
|
|
163
163
|
// @ts-expect-error - Types are outdated.
|
|
164
164
|
duplex: "half",
|
|
@@ -235,7 +235,7 @@ const qe = (e = {}, t = {}) => ({
|
|
|
235
235
|
I(o.hooks) && (n = qe(n, o.hooks), t.hooks = n), I(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
|
-
}, jt = (e) =>
|
|
238
|
+
}, jt = (e) => $e.includes(e) ? e.toUpperCase() : e, qt = ["get", "put", "head", "delete", "options", "trace"], Ft = [408, 413, 429, 500, 502, 503, 504], Ht = [413, 429, 503], Ee = {
|
|
239
239
|
limit: 2,
|
|
240
240
|
methods: qt,
|
|
241
241
|
statusCodes: Ft,
|
|
@@ -325,14 +325,14 @@ class O {
|
|
|
325
325
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
326
326
|
if (!Ct)
|
|
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 () => {
|
|
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;
|
|
@@ -387,7 +387,7 @@ class O {
|
|
|
387
387
|
}
|
|
388
388
|
Ut && 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 && (kt && 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), Xt(this.#e.searchParams)) {
|
|
391
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
|
}
|
|
@@ -463,7 +463,7 @@ class O {
|
|
|
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);
|
|
@@ -500,9 +500,9 @@ class O {
|
|
|
500
500
|
/*! MIT License © Sindre Sorhus */
|
|
501
501
|
const Z = (e) => {
|
|
502
502
|
const t = (s, n) => O.create(s, M(e, n));
|
|
503
|
-
for (const s of
|
|
503
|
+
for (const s of $e)
|
|
504
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 =
|
|
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 = Ot, t;
|
|
506
506
|
}, Zt = Z();
|
|
507
507
|
var S = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(S || {});
|
|
508
508
|
const Fe = {
|
|
@@ -707,7 +707,7 @@ function is(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,
|
|
@@ -715,13 +715,13 @@ const R = {
|
|
|
715
715
|
a: 97,
|
|
716
716
|
f: 102
|
|
717
717
|
};
|
|
718
|
-
function
|
|
719
|
-
if (e >=
|
|
720
|
-
return e -
|
|
721
|
-
if (e >=
|
|
722
|
-
return e - (
|
|
723
|
-
if (e >=
|
|
724
|
-
return e - (
|
|
718
|
+
function Te(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;
|
|
@@ -730,7 +730,7 @@ function st(e, t = {}) {
|
|
|
730
730
|
n.length % 2 && (n = `0${n}`);
|
|
731
731
|
const r = n.length / 2, i = new Uint8Array(r);
|
|
732
732
|
for (let o = 0, a = 0; o < r; o++) {
|
|
733
|
-
const c =
|
|
733
|
+
const c = Te(n.charCodeAt(a++)), u = Te(n.charCodeAt(a++));
|
|
734
734
|
if (c === void 0 || u === void 0)
|
|
735
735
|
throw new v(`Invalid byte sequence ("${n[a - 2]}${n[a - 1]}" in "${n}").`);
|
|
736
736
|
i[o] = c * 16 + u;
|
|
@@ -745,9 +745,9 @@ function nt(e, t = {}) {
|
|
|
745
745
|
const s = rs.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), Re = /* @__PURE__ */ BigInt(32);
|
|
749
749
|
function cs(e, t = !1) {
|
|
750
|
-
return t ? { h: Number(e &
|
|
750
|
+
return t ? { h: Number(e & $), l: Number(e >> Re & $) } : { h: Number(e >> Re & $) | 0, l: Number(e & $) | 0 };
|
|
751
751
|
}
|
|
752
752
|
function us(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 (!ps(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 gs(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,24 +808,24 @@ function Es(e) {
|
|
|
808
808
|
return new Uint8Array(new TextEncoder().encode(e));
|
|
809
809
|
}
|
|
810
810
|
function ot(e) {
|
|
811
|
-
return typeof e == "string" && (e = Es(e)),
|
|
811
|
+
return typeof e == "string" && (e = Es(e)), _(e), e;
|
|
812
812
|
}
|
|
813
813
|
class Ss {
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function Ts(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
|
|
820
|
-
for (let e = 0, t =
|
|
819
|
+
const Rs = BigInt(0), k = BigInt(1), As = BigInt(2), vs = BigInt(7), Ps = BigInt(256), Is = 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
|
-
let r =
|
|
822
|
+
let r = Rs;
|
|
823
823
|
for (let i = 0; i < 7; i++)
|
|
824
|
-
t = (t <<
|
|
824
|
+
t = (t << k ^ (t >> vs) * Is) % Ps, t & As && (r ^= k << (k << /* @__PURE__ */ BigInt(i)) - k);
|
|
825
825
|
ct.push(r);
|
|
826
826
|
}
|
|
827
827
|
const ut = us(ct, !0), Us = ut[0], Cs = ut[1], Ie = (e, t, s) => s > 32 ? hs(e, t, s) : ls(e, t, s), Ue = (e, t, s) => s > 32 ? ds(e, t, s) : fs(e, t, s);
|
|
828
|
-
function
|
|
828
|
+
function ks(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++)
|
|
@@ -861,10 +861,10 @@ class ce extends Ss {
|
|
|
861
861
|
return this._cloneInto();
|
|
862
862
|
}
|
|
863
863
|
keccak() {
|
|
864
|
-
Pe(this.state32),
|
|
864
|
+
Pe(this.state32), ks(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 Ss {
|
|
|
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();
|
|
@@ -915,7 +915,7 @@ class ce extends Ss {
|
|
|
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) => Ts(() => new ce(t, e, s)), Ds = xs(1, 136, 256 / 8);
|
|
919
919
|
function Os(e, t) {
|
|
920
920
|
return Ds(ie(e, { strict: !1 }) ? os(e) : e);
|
|
921
921
|
}
|
|
@@ -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 R(e, t) {
|
|
965
965
|
if (!Bs(e, { strict: !1 }))
|
|
966
966
|
throw new Ns({ address: e });
|
|
967
967
|
return ft(e, t);
|
|
@@ -974,17 +974,17 @@ function Bs(e, t) {
|
|
|
974
974
|
const r = Ms.test(e) ? e.toLowerCase() === e ? !0 : s ? ft(e) === e : !0 : !1;
|
|
975
975
|
return V.set(n, r), r;
|
|
976
976
|
}
|
|
977
|
-
const
|
|
977
|
+
const $s = {
|
|
978
978
|
chainId: He.chainId,
|
|
979
|
-
address:
|
|
979
|
+
address: R("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: R("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
|
|
988
988
|
symbol: "USDC",
|
|
989
989
|
name: "USD Coin",
|
|
990
990
|
decimals: 6,
|
|
@@ -992,7 +992,7 @@ const _s = {
|
|
|
992
992
|
/* USDC */
|
|
993
993
|
}, Ls = {
|
|
994
994
|
chainId: Ge.chainId,
|
|
995
|
-
address:
|
|
995
|
+
address: R("0x5425890298aed601595a70ab815c96711a31bc65"),
|
|
996
996
|
symbol: "USDC",
|
|
997
997
|
fiatISO: "USD",
|
|
998
998
|
decimals: 6,
|
|
@@ -1000,7 +1000,7 @@ const _s = {
|
|
|
1000
1000
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1001
1001
|
}, zs = {
|
|
1002
1002
|
chainId: Je.chainId,
|
|
1003
|
-
address:
|
|
1003
|
+
address: R("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
|
|
1004
1004
|
symbol: "USDC",
|
|
1005
1005
|
fiatISO: "USD",
|
|
1006
1006
|
decimals: 6,
|
|
@@ -1008,7 +1008,7 @@ const _s = {
|
|
|
1008
1008
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1009
1009
|
}, js = {
|
|
1010
1010
|
chainId: We.chainId,
|
|
1011
|
-
address:
|
|
1011
|
+
address: R("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
|
|
1012
1012
|
symbol: "USDC",
|
|
1013
1013
|
fiatISO: "USD",
|
|
1014
1014
|
decimals: 6,
|
|
@@ -1016,7 +1016,7 @@ const _s = {
|
|
|
1016
1016
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1017
1017
|
}, qs = {
|
|
1018
1018
|
chainId: Ke.chainId,
|
|
1019
|
-
address:
|
|
1019
|
+
address: R("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
|
|
1020
1020
|
symbol: "USDC",
|
|
1021
1021
|
fiatISO: "USD",
|
|
1022
1022
|
decimals: 6,
|
|
@@ -1024,21 +1024,21 @@ const _s = {
|
|
|
1024
1024
|
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1025
1025
|
}, Fs = {
|
|
1026
1026
|
chainId: Ve.chainId,
|
|
1027
|
-
address:
|
|
1027
|
+
address: R("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
|
}, Hs = {
|
|
1033
1033
|
chainId: Xe.chainId,
|
|
1034
|
-
address:
|
|
1034
|
+
address: R("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
|
}, Ks = {
|
|
1040
1040
|
chainId: Ye.chainId,
|
|
1041
|
-
address:
|
|
1041
|
+
address: R("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 _s = {
|
|
|
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
|
},
|
|
@@ -1062,7 +1062,7 @@ const _s = {
|
|
|
1062
1062
|
...He,
|
|
1063
1063
|
explorer: "https://sepolia.arbiscan.io",
|
|
1064
1064
|
tokens: {
|
|
1065
|
-
[S.USDC]:
|
|
1065
|
+
[S.USDC]: $s
|
|
1066
1066
|
}
|
|
1067
1067
|
},
|
|
1068
1068
|
AVALANCHE_MAINNET: {
|
|
@@ -1336,7 +1336,7 @@ function Un(e) {
|
|
|
1336
1336
|
return window.addEventListener("message", p), () => {
|
|
1337
1337
|
document.body.style.overflow = d || "", window.removeEventListener("message", p);
|
|
1338
1338
|
};
|
|
1339
|
-
}, [i, u, f]);
|
|
1339
|
+
}, [i, u, f, y?.sessionToken]);
|
|
1340
1340
|
function A() {
|
|
1341
1341
|
w(!1), l();
|
|
1342
1342
|
}
|
|
@@ -1381,7 +1381,7 @@ function Un(e) {
|
|
|
1381
1381
|
function nn(e) {
|
|
1382
1382
|
return BigInt(e).toString();
|
|
1383
1383
|
}
|
|
1384
|
-
const rn = Symbol(), le = Symbol(),
|
|
1384
|
+
const rn = Symbol(), le = Symbol(), x = "a", pt = "f", ke = "p", gt = "c", mt = "t", fe = "h", D = "w", he = "o", de = "k";
|
|
1385
1385
|
let on = (e, t) => new Proxy(e, t);
|
|
1386
1386
|
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, an = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), cn = (e) => {
|
|
1387
1387
|
if (Array.isArray(e))
|
|
@@ -1397,8 +1397,8 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1397
1397
|
let n = !1;
|
|
1398
1398
|
const r = (a, c) => {
|
|
1399
1399
|
if (!n) {
|
|
1400
|
-
let u = s[
|
|
1401
|
-
if (u || (u = {}, s[
|
|
1400
|
+
let u = s[x].get(e);
|
|
1401
|
+
if (u || (u = {}, s[x].set(e, u)), a === D)
|
|
1402
1402
|
u[D] = !0;
|
|
1403
1403
|
else {
|
|
1404
1404
|
let f = u[a];
|
|
@@ -1406,10 +1406,10 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
1408
|
}, i = () => {
|
|
1409
|
-
n = !0, s[
|
|
1409
|
+
n = !0, s[x].delete(e);
|
|
1410
1410
|
}, o = {
|
|
1411
1411
|
get(a, c) {
|
|
1412
|
-
return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[
|
|
1412
|
+
return c === le ? e : (r(de, c), wt(Reflect.get(a, c), s[x], s[gt], s[mt]));
|
|
1413
1413
|
},
|
|
1414
1414
|
has(a, c) {
|
|
1415
1415
|
return c === rn ? (i(), !0) : (r(fe, c), Reflect.has(a, c));
|
|
@@ -1436,7 +1436,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1436
1436
|
}
|
|
1437
1437
|
const [i, o] = r;
|
|
1438
1438
|
let a = s && s.get(i);
|
|
1439
|
-
return (!a || a[1][pt] !== !!o) && (a = un(i, !!o), a[1][
|
|
1439
|
+
return (!a || a[1][pt] !== !!o) && (a = un(i, !!o), a[1][ke] = on(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
1440
|
}, ln = (e, t) => {
|
|
1441
1441
|
const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
|
|
1442
1442
|
return s.length !== n.length || s.some((r, i) => r !== n[i]);
|
|
@@ -1472,7 +1472,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1472
1472
|
if (o === null)
|
|
1473
1473
|
throw new Error("invalid used");
|
|
1474
1474
|
return o;
|
|
1475
|
-
}, fn = (e) => yt(e) && e[le] || null,
|
|
1475
|
+
}, fn = (e) => yt(e) && e[le] || null, xe = (e, t = !0) => {
|
|
1476
1476
|
se.set(e, t);
|
|
1477
1477
|
}, hn = (e, t, s) => {
|
|
1478
1478
|
const n = [], r = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
|
|
@@ -1504,7 +1504,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1504
1504
|
if (s?.[0] === t)
|
|
1505
1505
|
return s[1];
|
|
1506
1506
|
const n = Array.isArray(e) ? [] : Object.create(Object.getPrototypeOf(e));
|
|
1507
|
-
return
|
|
1507
|
+
return xe(n, !0), De.set(e, [t, n]), Reflect.ownKeys(e).forEach((r) => {
|
|
1508
1508
|
if (Object.getOwnPropertyDescriptor(n, r))
|
|
1509
1509
|
return;
|
|
1510
1510
|
const i = Reflect.get(e, r), { enumerable: o } = Reflect.getOwnPropertyDescriptor(
|
|
@@ -1518,7 +1518,7 @@ const te = Object.getPrototypeOf, se = /* @__PURE__ */ new WeakMap(), yt = (e) =
|
|
|
1518
1518
|
configurable: !0
|
|
1519
1519
|
};
|
|
1520
1520
|
if (me.has(i))
|
|
1521
|
-
|
|
1521
|
+
xe(i, !1);
|
|
1522
1522
|
else if (U.has(i)) {
|
|
1523
1523
|
const [c, u] = U.get(
|
|
1524
1524
|
i
|
|
@@ -1579,8 +1579,8 @@ function St(e = {}) {
|
|
|
1579
1579
|
}, y = (l) => (n.add(l), n.size === 1 && c.forEach(([p, b], N) => {
|
|
1580
1580
|
if ((z ? "production" : void 0) !== "production" && b)
|
|
1581
1581
|
throw new Error("remove already exists");
|
|
1582
|
-
const
|
|
1583
|
-
c.set(N, [p,
|
|
1582
|
+
const Tt = p[2](a(N));
|
|
1583
|
+
c.set(N, [p, Tt]);
|
|
1584
1584
|
}), () => {
|
|
1585
1585
|
n.delete(l), n.size === 0 && c.forEach(([p, b], N) => {
|
|
1586
1586
|
b && (b(), c.set(N, [p]));
|
|
@@ -1629,14 +1629,14 @@ const En = {}, Sn = (e, t) => {
|
|
|
1629
1629
|
re(() => {
|
|
1630
1630
|
s.current = hn(e, t);
|
|
1631
1631
|
}), Pt(s.current);
|
|
1632
|
-
},
|
|
1632
|
+
}, Tn = Sn, Rn = /* @__PURE__ */ new WeakMap();
|
|
1633
1633
|
function An(e, t) {
|
|
1634
1634
|
const n = ye(
|
|
1635
1635
|
() => e && /* @__PURE__ */ new WeakMap(),
|
|
1636
1636
|
[e]
|
|
1637
1637
|
), r = ne(void 0);
|
|
1638
1638
|
let i = !0;
|
|
1639
|
-
const o =
|
|
1639
|
+
const o = Rt(
|
|
1640
1640
|
At(
|
|
1641
1641
|
(c) => {
|
|
1642
1642
|
const u = bn(e, c);
|
|
@@ -1662,9 +1662,9 @@ function An(e, t) {
|
|
|
1662
1662
|
);
|
|
1663
1663
|
i = !1, vt(() => {
|
|
1664
1664
|
r.current = o;
|
|
1665
|
-
}), (En ? "production" : void 0) !== "production" &&
|
|
1665
|
+
}), (En ? "production" : void 0) !== "production" && Tn(o, n);
|
|
1666
1666
|
const a = ye(() => /* @__PURE__ */ new WeakMap(), []);
|
|
1667
|
-
return wt(o, n, a,
|
|
1667
|
+
return wt(o, n, a, Rn);
|
|
1668
1668
|
}
|
|
1669
1669
|
const P = St({
|
|
1670
1670
|
data: null,
|
|
@@ -1702,7 +1702,8 @@ function Cn({
|
|
|
1702
1702
|
})
|
|
1703
1703
|
}).then((l) => l.json()).then((l) => {
|
|
1704
1704
|
A < f || (P.data = l, h.config({
|
|
1705
|
-
api_key: l.sessionToken
|
|
1705
|
+
api_key: l.sessionToken,
|
|
1706
|
+
env: e === "https://chainrails-sdk-server.vercel.app/test/create-session" ? "internal" : "production"
|
|
1706
1707
|
}), P.isPending = !1, y(A));
|
|
1707
1708
|
}).catch((l) => {
|
|
1708
1709
|
A < f || (P.error = l?.toString(), P.isPending = !1, y(A));
|