@chainrails/react 0.0.32 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PaymentModal/index.d.ts +1 -0
- package/dist/PaymentModal/index.d.ts.map +1 -1
- package/dist/chainrails-sdk.es.js +159 -158
- package/dist/chainrails-sdk.es.mjs +159 -158
- package/dist/chainrails-sdk.umd.js +1 -1
- package/dist/hooks/usePaymentSession.d.ts +3 -3
- package/dist/hooks/usePaymentSession.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PaymentModal/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,KAAK,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PaymentModal/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,KAAK,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAgFpD"}
|
|
@@ -164,9 +164,9 @@ const Ie = (t) => new ye(t), Be = {
|
|
|
164
164
|
duplex: "half",
|
|
165
165
|
body: ge(t.body, r, e)
|
|
166
166
|
});
|
|
167
|
-
},
|
|
167
|
+
}, E = (t) => t !== null && typeof t == "object", k = (...t) => {
|
|
168
168
|
for (const e of t)
|
|
169
|
-
if ((!
|
|
169
|
+
if ((!E(e) || Array.isArray(e)) && e !== void 0)
|
|
170
170
|
throw new TypeError("The `options` argument must be an object");
|
|
171
171
|
return Y({}, ...t);
|
|
172
172
|
}, me = (t = {}, e = {}) => {
|
|
@@ -175,14 +175,14 @@ const Ie = (t) => new ye(t), Be = {
|
|
|
175
175
|
r && o === "undefined" || o === void 0 ? s.delete(i) : s.set(i, o);
|
|
176
176
|
return s;
|
|
177
177
|
};
|
|
178
|
-
function
|
|
178
|
+
function N(t, e, s) {
|
|
179
179
|
return Object.hasOwn(e, s) && e[s] === void 0 ? [] : Y(t[s] ?? [], e[s] ?? []);
|
|
180
180
|
}
|
|
181
181
|
const we = (t = {}, e = {}) => ({
|
|
182
|
-
beforeRequest:
|
|
183
|
-
beforeRetry:
|
|
184
|
-
afterResponse:
|
|
185
|
-
beforeError:
|
|
182
|
+
beforeRequest: N(t, e, "beforeRequest"),
|
|
183
|
+
beforeRetry: N(t, e, "beforeRetry"),
|
|
184
|
+
afterResponse: N(t, e, "afterResponse"),
|
|
185
|
+
beforeError: N(t, e, "beforeError")
|
|
186
186
|
}), Ye = (t, e) => {
|
|
187
187
|
const s = new URLSearchParams();
|
|
188
188
|
for (const r of [t, e])
|
|
@@ -196,7 +196,7 @@ const we = (t = {}, e = {}) => ({
|
|
|
196
196
|
throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");
|
|
197
197
|
s.append(String(n[0]), String(n[1]));
|
|
198
198
|
}
|
|
199
|
-
else if (
|
|
199
|
+
else if (E(r))
|
|
200
200
|
for (const [n, i] of Object.entries(r))
|
|
201
201
|
i !== void 0 && s.append(n, String(i));
|
|
202
202
|
else {
|
|
@@ -211,14 +211,14 @@ const we = (t = {}, e = {}) => ({
|
|
|
211
211
|
for (const o of t)
|
|
212
212
|
if (Array.isArray(o))
|
|
213
213
|
Array.isArray(e) || (e = []), e = [...e, ...o];
|
|
214
|
-
else if (
|
|
214
|
+
else if (E(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 && (!E(c) || Array.isArray(c)))
|
|
222
222
|
throw new TypeError("The `context` option must be an object");
|
|
223
223
|
e = {
|
|
224
224
|
...e,
|
|
@@ -230,9 +230,9 @@ const we = (t = {}, e = {}) => ({
|
|
|
230
230
|
c == null ? n = void 0 : n = n === void 0 ? c : Ye(n, c);
|
|
231
231
|
continue;
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
E(c) && a in e && (c = Y(e[a], c)), e = { ...e, [a]: c };
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
E(o.hooks) && (r = we(r, o.hooks), e.hooks = r), E(o.headers) && (s = me(s, o.headers), e.headers = s);
|
|
236
236
|
}
|
|
237
237
|
return n !== void 0 && (e.searchParams = n), i.length > 0 && (i.length === 1 ? e.signal = i[0] : he ? e.signal = AbortSignal.any(i) : e.signal = i.at(-1)), e.context === void 0 && (e.context = {}), e;
|
|
238
238
|
}, ze = (t) => de.includes(t) ? t.toUpperCase() : t, Ve = ["get", "put", "head", "delete", "options", "trace"], Je = [408, 413, 429, 500, 502, 503, 504], Ge = [413, 429, 503], ne = {
|
|
@@ -499,23 +499,23 @@ class O {
|
|
|
499
499
|
}
|
|
500
500
|
/*! MIT License © Sindre Sorhus */
|
|
501
501
|
const B = (t) => {
|
|
502
|
-
const e = (s, r) => O.create(s,
|
|
502
|
+
const e = (s, r) => O.create(s, k(t, r));
|
|
503
503
|
for (const s of de)
|
|
504
|
-
e[s] = (r, n) => O.create(r,
|
|
505
|
-
return e.create = (s) => B(
|
|
504
|
+
e[s] = (r, n) => O.create(r, k(t, n, { method: s }));
|
|
505
|
+
return e.create = (s) => B(k(s)), e.extend = (s) => (typeof s == "function" && (s = s(t ?? {})), B(k(t, s))), e.stop = pe, e.retry = Ie, e;
|
|
506
506
|
}, nt = B();
|
|
507
507
|
var ot = /* @__PURE__ */ ((t) => (t.ARBITRUM = "ARBITRUM_MAINNET", t.ARBITRUM_TESTNET = "ARBITRUM_TESTNET", t.AVALANCHE = "AVALANCHE_MAINNET", t.AVALANCHE_TESTNET = "AVALANCHE_TESTNET", t.BASE = "BASE_MAINNET", t.BASE_TESTNET = "BASE_TESTNET", t.BSC = "BSC_MAINNET", t.ETHEREUM = "ETHEREUM_MAINNET", t.ETHEREUM_TESTNET = "ETHEREUM_TESTNET", t.STARKNET = "STARKNET_MAINNET", t))(ot || {}), it = /* @__PURE__ */ ((t) => (t.USDC = "USDC", t))(it || {}), z = /* @__PURE__ */ ((t) => (t.PRODUCTION = "production", t.STAGING = "staging", t))(z || {});
|
|
508
|
-
class
|
|
508
|
+
class d {
|
|
509
509
|
constructor({ api_key: e, env: s }) {
|
|
510
510
|
this.api_key = e, this.jwt = "", this.env = s ?? z.PRODUCTION;
|
|
511
511
|
}
|
|
512
512
|
static async config(e) {
|
|
513
|
-
if (!
|
|
513
|
+
if (!d.app) {
|
|
514
514
|
if (!e)
|
|
515
515
|
throw new Error("Please provide an api_key");
|
|
516
|
-
|
|
516
|
+
d.app = new d(e);
|
|
517
517
|
}
|
|
518
|
-
return e && (
|
|
518
|
+
return e && (d.app.api_key = e.api_key, e.env !== void 0 && (d.app.env = e.env), await this.updateJWT(), setInterval(this.updateJWT.bind(this), 1500 * 1e3)), d.app;
|
|
519
519
|
}
|
|
520
520
|
static async updateJWT() {
|
|
521
521
|
try {
|
|
@@ -525,7 +525,7 @@ class h {
|
|
|
525
525
|
"content-type": "application/json"
|
|
526
526
|
},
|
|
527
527
|
body: JSON.stringify({
|
|
528
|
-
apiKey:
|
|
528
|
+
apiKey: d.app.api_key
|
|
529
529
|
})
|
|
530
530
|
})).json();
|
|
531
531
|
this.app.jwt = e.token;
|
|
@@ -533,22 +533,22 @@ class h {
|
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
static getApiKey() {
|
|
536
|
-
if (!
|
|
536
|
+
if (!d.app)
|
|
537
537
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
538
|
-
return
|
|
538
|
+
return d.app.api_key;
|
|
539
539
|
}
|
|
540
540
|
static getSessionKey() {
|
|
541
|
-
return
|
|
541
|
+
return d.app.jwt;
|
|
542
542
|
}
|
|
543
543
|
static getEnv() {
|
|
544
|
-
if (!
|
|
544
|
+
if (!d.app)
|
|
545
545
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
546
|
-
return
|
|
546
|
+
return d.app.env === "internal" ? "staging" : d.app.env;
|
|
547
547
|
}
|
|
548
548
|
static getBaseUrl() {
|
|
549
|
-
if (!
|
|
549
|
+
if (!d.app)
|
|
550
550
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
551
|
-
switch (
|
|
551
|
+
switch (d.app.env) {
|
|
552
552
|
case "production":
|
|
553
553
|
return "https://api.chainrails.io/api/v1";
|
|
554
554
|
case "staging":
|
|
@@ -560,23 +560,23 @@ class h {
|
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
static getPayModalUrl(e, s, r, n) {
|
|
563
|
-
if (!
|
|
563
|
+
if (!d.app)
|
|
564
564
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
565
|
-
const i =
|
|
565
|
+
const i = d.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", o = n && n > 0 ? "/pay/" : "/deposit/", a = `_chain_/${e}/_token_/${s}/_to_/${r}${n ? "/_amount_/" + n * 100 : ""}`;
|
|
566
566
|
return i + o + a;
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
let H = null;
|
|
570
570
|
function at() {
|
|
571
571
|
H = nt.create({
|
|
572
|
-
prefixUrl:
|
|
572
|
+
prefixUrl: d.getBaseUrl(),
|
|
573
573
|
headers: {
|
|
574
574
|
"Content-Type": "application/json"
|
|
575
575
|
},
|
|
576
576
|
hooks: {
|
|
577
577
|
beforeRequest: [
|
|
578
578
|
(t) => {
|
|
579
|
-
const e =
|
|
579
|
+
const e = d.getSessionKey();
|
|
580
580
|
t.headers.set("Authorization", `Bearer ${e}`);
|
|
581
581
|
}
|
|
582
582
|
],
|
|
@@ -587,68 +587,68 @@ function at() {
|
|
|
587
587
|
}
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function g() {
|
|
591
591
|
return H || at(), H;
|
|
592
592
|
}
|
|
593
593
|
class ct {
|
|
594
594
|
async getById(e) {
|
|
595
|
-
return await
|
|
595
|
+
return await g().get("intents/" + e).json();
|
|
596
596
|
}
|
|
597
597
|
async getForSender(e) {
|
|
598
|
-
return await
|
|
598
|
+
return await g().get("intents/user/" + e).json();
|
|
599
599
|
}
|
|
600
600
|
async getForAddress(e) {
|
|
601
|
-
return await
|
|
601
|
+
return await g().get("intents/address/" + e).json();
|
|
602
602
|
}
|
|
603
603
|
async getAll(e) {
|
|
604
|
-
return await
|
|
604
|
+
return await g().get("intents", { searchParams: e }).json();
|
|
605
605
|
}
|
|
606
606
|
async create(e) {
|
|
607
|
-
return await
|
|
607
|
+
return await g().post("intents", { json: e }).json();
|
|
608
608
|
}
|
|
609
609
|
async update(e, s) {
|
|
610
|
-
return await
|
|
610
|
+
return await g().post("intents", { json: s }).json();
|
|
611
611
|
}
|
|
612
612
|
async triggerProcessing(e) {
|
|
613
|
-
return await
|
|
613
|
+
return await g().post(`intents/${e}/trigger-processing`).json();
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
class ut {
|
|
617
617
|
async getFromSpecificBridge(e) {
|
|
618
|
-
return await
|
|
618
|
+
return await g().get("quotes/single", { searchParams: e }).json();
|
|
619
619
|
}
|
|
620
620
|
async getFromAllBridges(e) {
|
|
621
|
-
return await
|
|
621
|
+
return await g().get("quotes/multiple", { searchParams: e }).json();
|
|
622
622
|
}
|
|
623
623
|
async getBestAcrossBridges(e) {
|
|
624
|
-
return await
|
|
624
|
+
return await g().get("quotes/best", { searchParams: e }).json();
|
|
625
625
|
}
|
|
626
626
|
async getAll(e) {
|
|
627
|
-
return await
|
|
627
|
+
return await g().get("quotes/multi-source", { searchParams: e }).json();
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
630
|
class lt {
|
|
631
631
|
async getOptimalRoutes(e) {
|
|
632
|
-
return await
|
|
632
|
+
return await g().get("router/optimal-route", { searchParams: e }).json();
|
|
633
633
|
}
|
|
634
634
|
async getAllSupportedBridges() {
|
|
635
|
-
return await
|
|
635
|
+
return await g().get("router/supported-bridges/all").json();
|
|
636
636
|
}
|
|
637
637
|
async getSupportedBridges(e) {
|
|
638
|
-
return await
|
|
638
|
+
return await g().get("router/supported-bridges/route", { searchParams: e }).json();
|
|
639
639
|
}
|
|
640
640
|
async getSupportedRoutes(e, s) {
|
|
641
|
-
return await
|
|
641
|
+
return await g().get("router/supported-bridges/bridge/" + e, { searchParams: s }).json();
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
class ft {
|
|
645
645
|
async getSupported(e) {
|
|
646
|
-
return await
|
|
646
|
+
return await g().get("chains", { searchParams: e }).json();
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
class ht {
|
|
650
650
|
async getClientInfo() {
|
|
651
|
-
return await
|
|
651
|
+
return await g().get("client/auth/client-info").json();
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
654
|
const xt = {
|
|
@@ -678,38 +678,39 @@ function Lt(t) {
|
|
|
678
678
|
chain: r,
|
|
679
679
|
amount: n,
|
|
680
680
|
isOpen: i,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
681
|
+
isPending: o,
|
|
682
|
+
open: a,
|
|
683
|
+
close: c,
|
|
684
|
+
onCancel: u,
|
|
685
|
+
onSuccess: y,
|
|
686
|
+
session_token: w
|
|
687
|
+
} = t, [p, m] = le(!0), R = W(null);
|
|
687
688
|
F(() => {
|
|
688
|
-
|
|
689
|
-
const
|
|
690
|
-
i ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow =
|
|
691
|
-
const
|
|
692
|
-
|
|
689
|
+
l();
|
|
690
|
+
const f = document.body.style.overflow;
|
|
691
|
+
i ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = f || "";
|
|
692
|
+
const h = (T) => {
|
|
693
|
+
T.data === "closed" && (c(), u?.()), T.data === "completed" && (window.setTimeout(c, 2e3), y?.());
|
|
693
694
|
};
|
|
694
|
-
return window.addEventListener("message",
|
|
695
|
-
document.body.style.overflow =
|
|
695
|
+
return window.addEventListener("message", h), () => {
|
|
696
|
+
document.body.style.overflow = f || "", window.removeEventListener("message", h);
|
|
696
697
|
};
|
|
697
|
-
}, [i,
|
|
698
|
-
function
|
|
699
|
-
|
|
698
|
+
}, [i, u, y]);
|
|
699
|
+
function j() {
|
|
700
|
+
m(!1), l();
|
|
700
701
|
}
|
|
701
|
-
function
|
|
702
|
-
if (!
|
|
703
|
-
const
|
|
702
|
+
function l() {
|
|
703
|
+
if (!w) return;
|
|
704
|
+
const f = {
|
|
704
705
|
type: "session",
|
|
705
|
-
session_token:
|
|
706
|
-
environment:
|
|
706
|
+
session_token: w,
|
|
707
|
+
environment: d.getEnv() || z.PRODUCTION
|
|
707
708
|
};
|
|
708
|
-
|
|
709
|
+
R.current?.contentWindow?.postMessage(f, "https://app.chainrails.io"), R.current?.contentWindow?.postMessage(f, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
|
|
709
710
|
}
|
|
710
|
-
return
|
|
711
|
-
className: dt("payment-modal-wrapper",
|
|
712
|
-
children: [
|
|
711
|
+
return w ? /* @__PURE__ */ se("div", {
|
|
712
|
+
className: dt("payment-modal-wrapper", p || o ? "loading" : "not-loading", i ? "open" : "closed"),
|
|
713
|
+
children: [(p || o) && /* @__PURE__ */ S("div", {
|
|
713
714
|
role: "status",
|
|
714
715
|
className: "payment-modal-loader",
|
|
715
716
|
children: /* @__PURE__ */ se("svg", {
|
|
@@ -728,17 +729,17 @@ function Lt(t) {
|
|
|
728
729
|
})
|
|
729
730
|
}), /* @__PURE__ */ S("iframe", {
|
|
730
731
|
allow: "clipboard-read *; clipboard-write *",
|
|
731
|
-
src:
|
|
732
|
-
onLoad:
|
|
733
|
-
className: `payment-modal ${
|
|
732
|
+
src: d.getPayModalUrl(r, s, e, n),
|
|
733
|
+
onLoad: j,
|
|
734
|
+
className: `payment-modal ${p || o ? "invisible" : "visible"}`,
|
|
734
735
|
"data-id": n,
|
|
735
|
-
ref:
|
|
736
|
+
ref: R
|
|
736
737
|
})]
|
|
737
738
|
}) : /* @__PURE__ */ S(Ue, {});
|
|
738
739
|
}
|
|
739
740
|
const pt = Symbol(), V = Symbol(), A = "a", Re = "f", oe = "p", be = "c", Ee = "t", J = "h", v = "w", G = "o", X = "k";
|
|
740
741
|
let yt = (t, e) => new Proxy(t, e);
|
|
741
|
-
const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) => t && ($.has(t) ? $.get(t) : K(t) === Object.prototype || K(t) === Array.prototype),
|
|
742
|
+
const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) => t && ($.has(t) ? $.get(t) : K(t) === Object.prototype || K(t) === Array.prototype), q = (t) => typeof t == "object" && t !== null, gt = (t) => Object.values(Object.getOwnPropertyDescriptors(t)).some((e) => !e.configurable && !e.writable), mt = (t) => {
|
|
742
743
|
if (Array.isArray(t))
|
|
743
744
|
return Array.from(t);
|
|
744
745
|
const e = Object.getOwnPropertyDescriptors(t);
|
|
@@ -756,8 +757,8 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
756
757
|
if (u || (u = {}, s[A].set(t, u)), a === v)
|
|
757
758
|
u[v] = !0;
|
|
758
759
|
else {
|
|
759
|
-
let
|
|
760
|
-
|
|
760
|
+
let y = u[a];
|
|
761
|
+
y || (y = /* @__PURE__ */ new Set(), u[a] = y), y.add(c);
|
|
761
762
|
}
|
|
762
763
|
}
|
|
763
764
|
}, i = () => {
|
|
@@ -798,7 +799,7 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
798
799
|
}, Ae = (t, e, s, r, n = Object.is) => {
|
|
799
800
|
if (n(t, e))
|
|
800
801
|
return !1;
|
|
801
|
-
if (!
|
|
802
|
+
if (!q(t) || !q(e))
|
|
802
803
|
return !0;
|
|
803
804
|
const i = s.get(Z(t));
|
|
804
805
|
if (!i)
|
|
@@ -831,30 +832,30 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
831
832
|
$.set(t, e);
|
|
832
833
|
}, bt = (t, e, s) => {
|
|
833
834
|
const r = [], n = /* @__PURE__ */ new WeakSet(), i = (o, a) => {
|
|
834
|
-
var c, u,
|
|
835
|
+
var c, u, y;
|
|
835
836
|
if (n.has(o))
|
|
836
837
|
return;
|
|
837
|
-
|
|
838
|
-
const w =
|
|
838
|
+
q(o) && n.add(o);
|
|
839
|
+
const w = q(o) && e.get(Z(o));
|
|
839
840
|
if (w) {
|
|
840
|
-
if ((c = w[J]) === null || c === void 0 || c.forEach((
|
|
841
|
-
const
|
|
842
|
-
r.push(a ? [...a,
|
|
841
|
+
if ((c = w[J]) === null || c === void 0 || c.forEach((p) => {
|
|
842
|
+
const m = `:has(${String(p)})`;
|
|
843
|
+
r.push(a ? [...a, m] : [m]);
|
|
843
844
|
}), w[v] === !0) {
|
|
844
|
-
const
|
|
845
|
-
r.push(a ? [...a,
|
|
845
|
+
const p = ":ownKeys";
|
|
846
|
+
r.push(a ? [...a, p] : [p]);
|
|
846
847
|
} else
|
|
847
|
-
(u = w[G]) === null || u === void 0 || u.forEach((
|
|
848
|
-
const
|
|
849
|
-
r.push(a ? [...a,
|
|
848
|
+
(u = w[G]) === null || u === void 0 || u.forEach((p) => {
|
|
849
|
+
const m = `:hasOwn(${String(p)})`;
|
|
850
|
+
r.push(a ? [...a, m] : [m]);
|
|
850
851
|
});
|
|
851
|
-
(
|
|
852
|
-
"value" in (Object.getOwnPropertyDescriptor(o,
|
|
852
|
+
(y = w[X]) === null || y === void 0 || y.forEach((p) => {
|
|
853
|
+
"value" in (Object.getOwnPropertyDescriptor(o, p) || {}) && i(o[p], a ? [...a, p] : [p]);
|
|
853
854
|
});
|
|
854
855
|
} else a && r.push(a);
|
|
855
856
|
};
|
|
856
857
|
return i(t), r;
|
|
857
|
-
},
|
|
858
|
+
}, _ = {}, Q = (t) => typeof t == "object" && t !== null, Et = (t) => Q(t) && !ee.has(t) && (Array.isArray(t) || !(Symbol.iterator in t)) && !(t instanceof WeakMap) && !(t instanceof WeakSet) && !(t instanceof Error) && !(t instanceof Number) && !(t instanceof Date) && !(t instanceof String) && !(t instanceof RegExp) && !(t instanceof ArrayBuffer) && !(t instanceof Promise), ve = (t, e) => {
|
|
858
859
|
const s = ae.get(t);
|
|
859
860
|
if (s?.[0] === e)
|
|
860
861
|
return s[1];
|
|
@@ -874,8 +875,8 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
874
875
|
};
|
|
875
876
|
if (ee.has(i))
|
|
876
877
|
ie(i, !1);
|
|
877
|
-
else if (
|
|
878
|
-
const [c, u] =
|
|
878
|
+
else if (P.has(i)) {
|
|
879
|
+
const [c, u] = P.get(
|
|
879
880
|
i
|
|
880
881
|
);
|
|
881
882
|
a.value = ve(c, u());
|
|
@@ -891,81 +892,81 @@ const K = Object.getPrototypeOf, $ = /* @__PURE__ */ new WeakMap(), Pe = (t) =>
|
|
|
891
892
|
},
|
|
892
893
|
set(n, i, o, a) {
|
|
893
894
|
const c = !t() && Reflect.has(n, i), u = Reflect.get(n, i, a);
|
|
894
|
-
if (c && (ce(u, o) ||
|
|
895
|
+
if (c && (ce(u, o) || U.has(o) && ce(u, U.get(o))))
|
|
895
896
|
return !0;
|
|
896
897
|
s(i), Q(o) && (o = Rt(o) || o);
|
|
897
|
-
const
|
|
898
|
-
return e(i,
|
|
898
|
+
const y = !P.has(o) && At(o) ? Oe(o) : o;
|
|
899
|
+
return e(i, y), Reflect.set(n, i, y, a), r(["set", [i], o, u]), !0;
|
|
899
900
|
}
|
|
900
|
-
}),
|
|
901
|
+
}), P = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakSet(), ae = /* @__PURE__ */ new WeakMap(), L = [1], U = /* @__PURE__ */ new WeakMap();
|
|
901
902
|
let ce = Object.is, St = (t, e) => new Proxy(t, e), At = Et, vt = ve, Ot = Pt;
|
|
902
903
|
function Oe(t = {}) {
|
|
903
904
|
if (!Q(t))
|
|
904
905
|
throw new Error("object required");
|
|
905
|
-
const e =
|
|
906
|
+
const e = U.get(t);
|
|
906
907
|
if (e)
|
|
907
908
|
return e;
|
|
908
909
|
let s = L[0];
|
|
909
|
-
const r = /* @__PURE__ */ new Set(), n = (l,
|
|
910
|
-
s !==
|
|
910
|
+
const r = /* @__PURE__ */ new Set(), n = (l, f = ++L[0]) => {
|
|
911
|
+
s !== f && (i = s = f, r.forEach((h) => h(l, f)));
|
|
911
912
|
};
|
|
912
913
|
let i = s;
|
|
913
|
-
const o = (l = L[0]) => (i !== l && (i = l, c.forEach(([
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
})), s), a = (l) => (
|
|
917
|
-
const T = [...
|
|
918
|
-
T[1] = [l, ...T[1]], n(T,
|
|
919
|
-
}, c = /* @__PURE__ */ new Map(), u = (l,
|
|
920
|
-
const
|
|
921
|
-
if (
|
|
922
|
-
if ((
|
|
914
|
+
const o = (l = L[0]) => (i !== l && (i = l, c.forEach(([f]) => {
|
|
915
|
+
const h = f[1](l);
|
|
916
|
+
h > s && (s = h);
|
|
917
|
+
})), s), a = (l) => (f, h) => {
|
|
918
|
+
const T = [...f];
|
|
919
|
+
T[1] = [l, ...T[1]], n(T, h);
|
|
920
|
+
}, c = /* @__PURE__ */ new Map(), u = (l, f) => {
|
|
921
|
+
const h = !ee.has(f) && P.get(f);
|
|
922
|
+
if (h) {
|
|
923
|
+
if ((_ ? "production" : void 0) !== "production" && c.has(l))
|
|
923
924
|
throw new Error("prop listener already exists");
|
|
924
925
|
if (r.size) {
|
|
925
|
-
const T =
|
|
926
|
-
c.set(l, [
|
|
926
|
+
const T = h[2](a(l));
|
|
927
|
+
c.set(l, [h, T]);
|
|
927
928
|
} else
|
|
928
|
-
c.set(l, [
|
|
929
|
+
c.set(l, [h]);
|
|
929
930
|
}
|
|
930
|
-
},
|
|
931
|
-
var
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
}, w = (l) => (r.add(l), r.size === 1 && c.forEach(([
|
|
935
|
-
if ((
|
|
931
|
+
}, y = (l) => {
|
|
932
|
+
var f;
|
|
933
|
+
const h = c.get(l);
|
|
934
|
+
h && (c.delete(l), (f = h[1]) == null || f.call(h));
|
|
935
|
+
}, w = (l) => (r.add(l), r.size === 1 && c.forEach(([h, T], C) => {
|
|
936
|
+
if ((_ ? "production" : void 0) !== "production" && T)
|
|
936
937
|
throw new Error("remove already exists");
|
|
937
|
-
const Ce =
|
|
938
|
-
c.set(
|
|
938
|
+
const Ce = h[2](a(C));
|
|
939
|
+
c.set(C, [h, Ce]);
|
|
939
940
|
}), () => {
|
|
940
|
-
r.delete(l), r.size === 0 && c.forEach(([
|
|
941
|
-
T && (T(), c.set(
|
|
941
|
+
r.delete(l), r.size === 0 && c.forEach(([h, T], C) => {
|
|
942
|
+
T && (T(), c.set(C, [h]));
|
|
942
943
|
});
|
|
943
944
|
});
|
|
944
|
-
let
|
|
945
|
-
const
|
|
946
|
-
() =>
|
|
945
|
+
let p = !0;
|
|
946
|
+
const m = Ot(
|
|
947
|
+
() => p,
|
|
947
948
|
u,
|
|
948
|
-
|
|
949
|
+
y,
|
|
949
950
|
n
|
|
950
|
-
),
|
|
951
|
-
|
|
952
|
-
const
|
|
953
|
-
return
|
|
954
|
-
const
|
|
951
|
+
), R = St(t, m);
|
|
952
|
+
U.set(t, R);
|
|
953
|
+
const j = [t, o, w];
|
|
954
|
+
return P.set(R, j), Reflect.ownKeys(t).forEach((l) => {
|
|
955
|
+
const f = Object.getOwnPropertyDescriptor(
|
|
955
956
|
t,
|
|
956
957
|
l
|
|
957
958
|
);
|
|
958
|
-
"value" in
|
|
959
|
-
}),
|
|
959
|
+
"value" in f && f.writable && (R[l] = t[l]);
|
|
960
|
+
}), p = !1, R;
|
|
960
961
|
}
|
|
961
962
|
function Ct(t, e, s) {
|
|
962
|
-
const r =
|
|
963
|
-
(
|
|
963
|
+
const r = P.get(t);
|
|
964
|
+
(_ ? "production" : void 0) !== "production" && !r && console.warn("Please use proxy object");
|
|
964
965
|
let n;
|
|
965
966
|
const i = [], o = r[2];
|
|
966
967
|
let a = !1;
|
|
967
|
-
const u = o((
|
|
968
|
-
i.push(
|
|
968
|
+
const u = o((y) => {
|
|
969
|
+
i.push(y), n || (n = Promise.resolve().then(() => {
|
|
969
970
|
n = void 0, a && e(i.splice(0));
|
|
970
971
|
}));
|
|
971
972
|
});
|
|
@@ -974,8 +975,8 @@ function Ct(t, e, s) {
|
|
|
974
975
|
};
|
|
975
976
|
}
|
|
976
977
|
function ue(t) {
|
|
977
|
-
const e =
|
|
978
|
-
(
|
|
978
|
+
const e = P.get(t);
|
|
979
|
+
(_ ? "production" : void 0) !== "production" && !e && console.warn("Please use proxy object");
|
|
979
980
|
const [s, r] = e;
|
|
980
981
|
return vt(s, r());
|
|
981
982
|
}
|
|
@@ -1021,7 +1022,7 @@ function Ut(t, e) {
|
|
|
1021
1022
|
const a = te(() => /* @__PURE__ */ new WeakMap(), []);
|
|
1022
1023
|
return Se(o, r, a, _t);
|
|
1023
1024
|
}
|
|
1024
|
-
const
|
|
1025
|
+
const b = Oe({
|
|
1025
1026
|
data: null,
|
|
1026
1027
|
isPending: !1,
|
|
1027
1028
|
error: null
|
|
@@ -1035,15 +1036,15 @@ function Dt({
|
|
|
1035
1036
|
onCancel: i,
|
|
1036
1037
|
onSuccess: o
|
|
1037
1038
|
}) {
|
|
1038
|
-
const a = Ut(
|
|
1039
|
-
function
|
|
1039
|
+
const a = Ut(b), [c, u] = le(!1);
|
|
1040
|
+
function y() {
|
|
1040
1041
|
u(!0);
|
|
1041
1042
|
}
|
|
1042
1043
|
function w() {
|
|
1043
1044
|
u(!1);
|
|
1044
1045
|
}
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1046
|
+
const p = () => {
|
|
1047
|
+
b.isPending = !0, b.error = null, fetch(t, {
|
|
1047
1048
|
method: "POST",
|
|
1048
1049
|
headers: {
|
|
1049
1050
|
"Content-Type": "application/json"
|
|
@@ -1054,27 +1055,27 @@ function Dt({
|
|
|
1054
1055
|
amount: r,
|
|
1055
1056
|
to: n
|
|
1056
1057
|
})
|
|
1057
|
-
}).then((
|
|
1058
|
-
|
|
1059
|
-
}).catch((
|
|
1060
|
-
|
|
1058
|
+
}).then((m) => m.json()).then((m) => {
|
|
1059
|
+
b.data = m, b.isPending = !1;
|
|
1060
|
+
}).catch((m) => {
|
|
1061
|
+
b.error = m?.toString(), b.isPending = !1;
|
|
1061
1062
|
});
|
|
1062
1063
|
};
|
|
1063
|
-
return F(
|
|
1064
|
+
return F(p, [e, s, r, n]), {
|
|
1064
1065
|
...a,
|
|
1065
1066
|
chain: e,
|
|
1066
1067
|
token: s,
|
|
1067
1068
|
to: n,
|
|
1068
1069
|
isOpen: c,
|
|
1069
|
-
open:
|
|
1070
|
+
open: y,
|
|
1070
1071
|
close: w,
|
|
1071
|
-
refetch:
|
|
1072
|
+
refetch: p,
|
|
1072
1073
|
onSuccess: o,
|
|
1073
1074
|
onCancel: i
|
|
1074
1075
|
};
|
|
1075
1076
|
}
|
|
1076
1077
|
export {
|
|
1077
|
-
|
|
1078
|
+
d as Chainrails,
|
|
1078
1079
|
Lt as PaymentModal,
|
|
1079
1080
|
ot as chains,
|
|
1080
1081
|
xt as crapi,
|