@chainrails/react 0.1.15 → 0.1.17
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 +6 -0
- package/dist/PaymentModal/index.d.ts.map +1 -1
- package/dist/chainrails-sdk.es.js +109 -107
- package/dist/chainrails-sdk.es.mjs +109 -107
- package/dist/chainrails-sdk.umd.js +2 -2
- package/dist/hooks/usePaymentSession.d.ts +1 -0
- package/dist/hooks/usePaymentSession.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Chainrails } from "@chainrails/sdk";
|
|
1
2
|
import React from "react";
|
|
2
3
|
type PaymentModalProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
4
|
recipient: string;
|
|
@@ -18,5 +19,10 @@ type PaymentModalProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
18
19
|
onSuccess?: () => void;
|
|
19
20
|
};
|
|
20
21
|
export declare function PaymentModal(props: PaymentModalProps): JSX.Element;
|
|
22
|
+
declare global {
|
|
23
|
+
interface Window {
|
|
24
|
+
chainrails: Chainrails;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
21
27
|
export {};
|
|
22
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PaymentModal/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PaymentModal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAC;AAE1D,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,KAAK,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,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,eAuGpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,UAAU,CAAC;KACxB;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as L, useRef as re, useEffect as oe, useMemo as be, useSyncExternalStore as At, useCallback as vt, useLayoutEffect as Pt, useDebugValue as It } from "react";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as x, Fragment as Ut, jsxs as Ee } from "react/jsx-runtime";
|
|
3
3
|
import './index.css';class G extends Error {
|
|
4
4
|
response;
|
|
5
5
|
request;
|
|
@@ -164,9 +164,9 @@ const Nt = (e) => new je(e), Mt = {
|
|
|
164
164
|
duplex: "half",
|
|
165
165
|
body: qe(e.body, n, t)
|
|
166
166
|
});
|
|
167
|
-
},
|
|
167
|
+
}, C = (e) => e !== null && typeof e == "object", B = (...e) => {
|
|
168
168
|
for (const t of e)
|
|
169
|
-
if ((!
|
|
169
|
+
if ((!C(t) || Array.isArray(t)) && t !== void 0)
|
|
170
170
|
throw new TypeError("The `options` argument must be an object");
|
|
171
171
|
return ie({}, ...e);
|
|
172
172
|
}, Fe = (e = {}, t = {}) => {
|
|
@@ -196,7 +196,7 @@ const He = (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 (C(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 He = (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 (C(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 && (!C(c) || Array.isArray(c)))
|
|
222
222
|
throw new TypeError("The `context` option must be an object");
|
|
223
223
|
t = {
|
|
224
224
|
...t,
|
|
@@ -230,9 +230,9 @@ const He = (e = {}, t = {}) => ({
|
|
|
230
230
|
c == null ? r = void 0 : r = r === void 0 ? c : jt(r, c);
|
|
231
231
|
continue;
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
C(c) && a in t && (c = ie(t[a], c)), t = { ...t, [a]: c };
|
|
234
234
|
}
|
|
235
|
-
|
|
235
|
+
C(o.hooks) && (n = He(n, o.hooks), t.hooks = n), C(o.headers) && (s = Fe(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] : _e ? t.signal = AbortSignal.any(i) : t.signal = i.at(-1)), t.context === void 0 && (t.context = {}), t;
|
|
238
238
|
}, qt = (e) => Le.includes(e) ? e.toUpperCase() : e, Ft = ["get", "put", "head", "delete", "options", "trace"], Ht = [408, 413, 429, 500, 502, 503, 504], Kt = [413, 429, 503], Te = {
|
|
@@ -299,9 +299,9 @@ function Gt(e) {
|
|
|
299
299
|
function Zt(e) {
|
|
300
300
|
return e instanceof Z || e?.name === Z.name;
|
|
301
301
|
}
|
|
302
|
-
class
|
|
302
|
+
class M {
|
|
303
303
|
static create(t, s) {
|
|
304
|
-
const n = new
|
|
304
|
+
const n = new M(t, s), r = async () => {
|
|
305
305
|
if (typeof n.#e.timeout == "number" && n.#e.timeout > W)
|
|
306
306
|
throw new RangeError(`The \`timeout\` option cannot be greater than ${W}`);
|
|
307
307
|
await Promise.resolve();
|
|
@@ -388,7 +388,7 @@ class N {
|
|
|
388
388
|
Ct && _e && (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), Se && (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 && (xt && 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), Jt(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(M.#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) {
|
|
@@ -499,9 +499,9 @@ class N {
|
|
|
499
499
|
}
|
|
500
500
|
/*! MIT License © Sindre Sorhus */
|
|
501
501
|
const Q = (e) => {
|
|
502
|
-
const t = (s, n) =>
|
|
502
|
+
const t = (s, n) => M.create(s, B(e, n));
|
|
503
503
|
for (const s of Le)
|
|
504
|
-
t[s] = (n, r) =>
|
|
504
|
+
t[s] = (n, r) => M.create(n, B(e, r, { method: s }));
|
|
505
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 = Nt, t;
|
|
506
506
|
}, Qt = Q();
|
|
507
507
|
var E = /* @__PURE__ */ ((e) => (e.USDC = "USDC", e))(E || {});
|
|
@@ -816,12 +816,12 @@ function Rs(e) {
|
|
|
816
816
|
const t = (n) => e().update(at(n)).digest(), s = e();
|
|
817
817
|
return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = () => e(), t;
|
|
818
818
|
}
|
|
819
|
-
const As = BigInt(0),
|
|
820
|
-
for (let e = 0, t =
|
|
819
|
+
const As = BigInt(0), D = BigInt(1), vs = BigInt(2), Ps = BigInt(7), Is = BigInt(256), Us = BigInt(113), ct = [], ut = [], lt = [];
|
|
820
|
+
for (let e = 0, t = D, s = 1, n = 0; e < 24; e++) {
|
|
821
821
|
[s, n] = [n, (2 * s + 3 * n) % 5], ct.push(2 * (5 * n + s)), ut.push((e + 1) * (e + 2) / 2 % 64);
|
|
822
822
|
let r = As;
|
|
823
823
|
for (let i = 0; i < 7; i++)
|
|
824
|
-
t = (t <<
|
|
824
|
+
t = (t << D ^ (t >> Ps) * Us) % Is, t & vs && (r ^= D << (D << /* @__PURE__ */ BigInt(i)) - D);
|
|
825
825
|
lt.push(r);
|
|
826
826
|
}
|
|
827
827
|
const ft = ls(lt, !0), Cs = ft[0], ks = ft[1], Ce = (e, t, s) => s > 32 ? ds(e, t, s) : fs(e, t, s), ke = (e, t, s) => s > 32 ? ps(e, t, s) : hs(e, t, s);
|
|
@@ -1201,80 +1201,80 @@ function Js() {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function g() {
|
|
1205
1205
|
return te || Js(), te;
|
|
1206
1206
|
}
|
|
1207
1207
|
class Gs {
|
|
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 Zs {
|
|
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 Qs {
|
|
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 en {
|
|
1271
1271
|
async getSupported(t) {
|
|
1272
|
-
return await
|
|
1272
|
+
return await g().get("chains", { searchParams: t }).json();
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
1275
|
class tn {
|
|
1276
1276
|
async getClientInfo() {
|
|
1277
|
-
return await
|
|
1277
|
+
return await g().get("client/auth/client-info").json();
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
1280
|
class sn {
|
|
@@ -1288,7 +1288,7 @@ class sn {
|
|
|
1288
1288
|
destinationChain: ee[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 Un = {
|
|
@@ -1326,37 +1326,38 @@ function Cn(e) {
|
|
|
1326
1326
|
onSuccess: f,
|
|
1327
1327
|
session_url: w,
|
|
1328
1328
|
data: d
|
|
1329
|
-
} = e, [y, S] = L(!0), [
|
|
1329
|
+
} = e, [y, S] = L(!0), [T, l] = L(null), m = re(null);
|
|
1330
1330
|
oe(() => {
|
|
1331
1331
|
b();
|
|
1332
|
-
const
|
|
1333
|
-
i ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow =
|
|
1334
|
-
const
|
|
1332
|
+
const R = document.body.style.overflow;
|
|
1333
|
+
i ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = R || "";
|
|
1334
|
+
const I = (we) => {
|
|
1335
1335
|
we.data === "closed" && (c(), u?.()), we.data === "completed" && (window.setTimeout(c, 2e3), f?.());
|
|
1336
1336
|
};
|
|
1337
|
-
return window.addEventListener("message",
|
|
1338
|
-
document.body.style.overflow =
|
|
1337
|
+
return window.addEventListener("message", I), () => {
|
|
1338
|
+
document.body.style.overflow = R || "", window.removeEventListener("message", I);
|
|
1339
1339
|
};
|
|
1340
1340
|
}, [i, u, f, d?.sessionToken]);
|
|
1341
|
-
function
|
|
1341
|
+
function p() {
|
|
1342
1342
|
S(!1), b();
|
|
1343
1343
|
}
|
|
1344
|
-
function b() {
|
|
1344
|
+
async function b() {
|
|
1345
1345
|
if (!d?.sessionToken) return;
|
|
1346
|
-
h.config({
|
|
1346
|
+
const R = await h.config({
|
|
1347
1347
|
api_key: d?.sessionToken || "",
|
|
1348
1348
|
env: w === "https://chainrails-sdk-server.vercel.app/test/create-session" ? "internal" : "production"
|
|
1349
|
-
})
|
|
1350
|
-
|
|
1349
|
+
});
|
|
1350
|
+
l(h.getPayModalUrl(n, s, t, r));
|
|
1351
|
+
const I = {
|
|
1351
1352
|
type: "session",
|
|
1352
1353
|
session_token: d.sessionToken,
|
|
1353
1354
|
environment: h.getEnv() || le.PRODUCTION
|
|
1354
1355
|
};
|
|
1355
|
-
|
|
1356
|
+
window.chainrails = R, m.current?.contentWindow?.postMessage(I, "https://app.chainrails.io"), m.current?.contentWindow?.postMessage(I, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
|
|
1356
1357
|
}
|
|
1357
1358
|
return d?.sessionToken ? /* @__PURE__ */ Ee("div", {
|
|
1358
1359
|
className: nn("payment-modal-wrapper", y || o ? "loading" : "not-loading", i ? "open" : "closed"),
|
|
1359
|
-
children: [(y || o) && /* @__PURE__ */
|
|
1360
|
+
children: [(y || o) && /* @__PURE__ */ x("div", {
|
|
1360
1361
|
role: "status",
|
|
1361
1362
|
className: "payment-modal-loader",
|
|
1362
1363
|
children: /* @__PURE__ */ Ee("svg", {
|
|
@@ -1365,28 +1366,28 @@ function Cn(e) {
|
|
|
1365
1366
|
viewBox: "0 0 100 101",
|
|
1366
1367
|
fill: "none",
|
|
1367
1368
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1368
|
-
children: [/* @__PURE__ */
|
|
1369
|
+
children: [/* @__PURE__ */ x("path", {
|
|
1369
1370
|
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",
|
|
1370
1371
|
fill: "currentColor"
|
|
1371
|
-
}), /* @__PURE__ */
|
|
1372
|
+
}), /* @__PURE__ */ x("path", {
|
|
1372
1373
|
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",
|
|
1373
1374
|
fill: "currentFill"
|
|
1374
1375
|
})]
|
|
1375
1376
|
})
|
|
1376
|
-
}),
|
|
1377
|
+
}), T ? /* @__PURE__ */ x("iframe", {
|
|
1377
1378
|
allow: "clipboard-read *; clipboard-write *",
|
|
1378
|
-
src:
|
|
1379
|
-
onLoad:
|
|
1379
|
+
src: T,
|
|
1380
|
+
onLoad: p,
|
|
1380
1381
|
className: `payment-modal ${y || o ? "invisible" : "visible"}`,
|
|
1381
1382
|
"data-id": r,
|
|
1382
|
-
ref:
|
|
1383
|
+
ref: m
|
|
1383
1384
|
}) : null]
|
|
1384
|
-
}) : /* @__PURE__ */
|
|
1385
|
+
}) : /* @__PURE__ */ x(Ut, {});
|
|
1385
1386
|
}
|
|
1386
1387
|
function rn(e) {
|
|
1387
1388
|
return BigInt(e).toString();
|
|
1388
1389
|
}
|
|
1389
|
-
const on = Symbol(), fe = Symbol(),
|
|
1390
|
+
const on = Symbol(), fe = Symbol(), O = "a", mt = "f", De = "p", yt = "c", wt = "t", he = "h", N = "w", de = "o", pe = "k";
|
|
1390
1391
|
let an = (e, t) => new Proxy(e, t);
|
|
1391
1392
|
const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), bt = (e) => e && (ne.has(e) ? ne.get(e) : se(e) === Object.prototype || se(e) === Array.prototype), j = (e) => typeof e == "object" && e !== null, cn = (e) => Object.values(Object.getOwnPropertyDescriptors(e)).some((t) => !t.configurable && !t.writable), un = (e) => {
|
|
1392
1393
|
if (Array.isArray(e))
|
|
@@ -1402,19 +1403,19 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), bt = (e) =
|
|
|
1402
1403
|
let n = !1;
|
|
1403
1404
|
const r = (a, c) => {
|
|
1404
1405
|
if (!n) {
|
|
1405
|
-
let u = s[
|
|
1406
|
-
if (u || (u = {}, s[
|
|
1407
|
-
u[
|
|
1406
|
+
let u = s[O].get(e);
|
|
1407
|
+
if (u || (u = {}, s[O].set(e, u)), a === N)
|
|
1408
|
+
u[N] = !0;
|
|
1408
1409
|
else {
|
|
1409
1410
|
let f = u[a];
|
|
1410
1411
|
f || (f = /* @__PURE__ */ new Set(), u[a] = f), f.add(c);
|
|
1411
1412
|
}
|
|
1412
1413
|
}
|
|
1413
1414
|
}, i = () => {
|
|
1414
|
-
n = !0, s[
|
|
1415
|
+
n = !0, s[O].delete(e);
|
|
1415
1416
|
}, o = {
|
|
1416
1417
|
get(a, c) {
|
|
1417
|
-
return c === fe ? e : (r(pe, c), Et(Reflect.get(a, c), s[
|
|
1418
|
+
return c === fe ? e : (r(pe, c), Et(Reflect.get(a, c), s[O], s[yt], s[wt]));
|
|
1418
1419
|
},
|
|
1419
1420
|
has(a, c) {
|
|
1420
1421
|
return c === on ? (i(), !0) : (r(he, c), Reflect.has(a, c));
|
|
@@ -1423,7 +1424,7 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), bt = (e) =
|
|
|
1423
1424
|
return r(de, c), Reflect.getOwnPropertyDescriptor(a, c);
|
|
1424
1425
|
},
|
|
1425
1426
|
ownKeys(a) {
|
|
1426
|
-
return r(
|
|
1427
|
+
return r(N), Reflect.ownKeys(a);
|
|
1427
1428
|
}
|
|
1428
1429
|
};
|
|
1429
1430
|
return t && (o.set = o.deleteProperty = () => !1), [o, s];
|
|
@@ -1441,7 +1442,7 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), bt = (e) =
|
|
|
1441
1442
|
}
|
|
1442
1443
|
const [i, o] = r;
|
|
1443
1444
|
let a = s && s.get(i);
|
|
1444
|
-
return (!a || a[1][mt] !== !!o) && (a = ln(i, !!o), a[1][De] = an(o || i, a[0]), s && s.set(i, a)), a[1][
|
|
1445
|
+
return (!a || a[1][mt] !== !!o) && (a = ln(i, !!o), a[1][De] = an(o || i, a[0]), s && s.set(i, a)), a[1][O] = t, a[1][yt] = s, a[1][wt] = n, a[1][De];
|
|
1445
1446
|
}, fn = (e, t) => {
|
|
1446
1447
|
const s = Reflect.ownKeys(e), n = Reflect.ownKeys(t);
|
|
1447
1448
|
return s.length !== n.length || s.some((r, i) => r !== n[i]);
|
|
@@ -1462,7 +1463,7 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), bt = (e) =
|
|
|
1462
1463
|
for (const a of i[he] || [])
|
|
1463
1464
|
if (o = Reflect.has(e, a) !== Reflect.has(t, a), o)
|
|
1464
1465
|
return o;
|
|
1465
|
-
if (i[
|
|
1466
|
+
if (i[N] === !0) {
|
|
1466
1467
|
if (o = fn(e, t), o)
|
|
1467
1468
|
return o;
|
|
1468
1469
|
} else
|
|
@@ -1490,7 +1491,7 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), bt = (e) =
|
|
|
1490
1491
|
if ((c = w[he]) === null || c === void 0 || c.forEach((d) => {
|
|
1491
1492
|
const y = `:has(${String(d)})`;
|
|
1492
1493
|
n.push(a ? [...a, y] : [y]);
|
|
1493
|
-
}), w[
|
|
1494
|
+
}), w[N] === !0) {
|
|
1494
1495
|
const d = ":ownKeys";
|
|
1495
1496
|
n.push(a ? [...a, d] : [d]);
|
|
1496
1497
|
} else
|
|
@@ -1524,8 +1525,8 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), bt = (e) =
|
|
|
1524
1525
|
};
|
|
1525
1526
|
if (ye.has(i))
|
|
1526
1527
|
Oe(i, !1);
|
|
1527
|
-
else if (
|
|
1528
|
-
const [c, u] =
|
|
1528
|
+
else if (k.has(i)) {
|
|
1529
|
+
const [c, u] = k.get(
|
|
1529
1530
|
i
|
|
1530
1531
|
);
|
|
1531
1532
|
a.value = Tt(c, u());
|
|
@@ -1544,10 +1545,10 @@ const se = Object.getPrototypeOf, ne = /* @__PURE__ */ new WeakMap(), bt = (e) =
|
|
|
1544
1545
|
if (c && (Me(u, o) || F.has(o) && Me(u, F.get(o))))
|
|
1545
1546
|
return !0;
|
|
1546
1547
|
s(i), me(o) && (o = hn(o) || o);
|
|
1547
|
-
const f = !
|
|
1548
|
+
const f = !k.has(o) && yn(o) ? Rt(o) : o;
|
|
1548
1549
|
return t(i, f), Reflect.set(r, i, f, a), n(["set", [i], o, u]), !0;
|
|
1549
1550
|
}
|
|
1550
|
-
}),
|
|
1551
|
+
}), k = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakSet(), Ne = /* @__PURE__ */ new WeakMap(), J = [1], F = /* @__PURE__ */ new WeakMap();
|
|
1551
1552
|
let Me = Object.is, mn = (e, t) => new Proxy(e, t), yn = pn, wn = Tt, bn = gn;
|
|
1552
1553
|
function Rt(e = {}) {
|
|
1553
1554
|
if (!me(e))
|
|
@@ -1556,39 +1557,39 @@ function Rt(e = {}) {
|
|
|
1556
1557
|
if (t)
|
|
1557
1558
|
return t;
|
|
1558
1559
|
let s = J[0];
|
|
1559
|
-
const n = /* @__PURE__ */ new Set(), r = (l,
|
|
1560
|
-
s !==
|
|
1560
|
+
const n = /* @__PURE__ */ new Set(), r = (l, m = ++J[0]) => {
|
|
1561
|
+
s !== m && (i = s = m, n.forEach((p) => p(l, m)));
|
|
1561
1562
|
};
|
|
1562
1563
|
let i = s;
|
|
1563
|
-
const o = (l = J[0]) => (i !== l && (i = l, c.forEach(([
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1566
|
-
})), s), a = (l) => (
|
|
1567
|
-
const b = [...
|
|
1568
|
-
b[1] = [l, ...b[1]], r(b,
|
|
1569
|
-
}, c = /* @__PURE__ */ new Map(), u = (l,
|
|
1570
|
-
const
|
|
1571
|
-
if (
|
|
1564
|
+
const o = (l = J[0]) => (i !== l && (i = l, c.forEach(([m]) => {
|
|
1565
|
+
const p = m[1](l);
|
|
1566
|
+
p > s && (s = p);
|
|
1567
|
+
})), s), a = (l) => (m, p) => {
|
|
1568
|
+
const b = [...m];
|
|
1569
|
+
b[1] = [l, ...b[1]], r(b, p);
|
|
1570
|
+
}, c = /* @__PURE__ */ new Map(), u = (l, m) => {
|
|
1571
|
+
const p = !ye.has(m) && k.get(m);
|
|
1572
|
+
if (p) {
|
|
1572
1573
|
if ((q ? "production" : void 0) !== "production" && c.has(l))
|
|
1573
1574
|
throw new Error("prop listener already exists");
|
|
1574
1575
|
if (n.size) {
|
|
1575
|
-
const b =
|
|
1576
|
-
c.set(l, [
|
|
1576
|
+
const b = p[2](a(l));
|
|
1577
|
+
c.set(l, [p, b]);
|
|
1577
1578
|
} else
|
|
1578
|
-
c.set(l, [
|
|
1579
|
+
c.set(l, [p]);
|
|
1579
1580
|
}
|
|
1580
1581
|
}, f = (l) => {
|
|
1581
|
-
var
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
}, w = (l) => (n.add(l), n.size === 1 && c.forEach(([
|
|
1582
|
+
var m;
|
|
1583
|
+
const p = c.get(l);
|
|
1584
|
+
p && (c.delete(l), (m = p[1]) == null || m.call(p));
|
|
1585
|
+
}, w = (l) => (n.add(l), n.size === 1 && c.forEach(([p, b], R) => {
|
|
1585
1586
|
if ((q ? "production" : void 0) !== "production" && b)
|
|
1586
1587
|
throw new Error("remove already exists");
|
|
1587
|
-
const
|
|
1588
|
-
c.set(
|
|
1588
|
+
const I = p[2](a(R));
|
|
1589
|
+
c.set(R, [p, I]);
|
|
1589
1590
|
}), () => {
|
|
1590
|
-
n.delete(l), n.size === 0 && c.forEach(([
|
|
1591
|
-
b && (b(), c.set(
|
|
1591
|
+
n.delete(l), n.size === 0 && c.forEach(([p, b], R) => {
|
|
1592
|
+
b && (b(), c.set(R, [p]));
|
|
1592
1593
|
});
|
|
1593
1594
|
});
|
|
1594
1595
|
let d = !0;
|
|
@@ -1599,17 +1600,17 @@ function Rt(e = {}) {
|
|
|
1599
1600
|
r
|
|
1600
1601
|
), S = mn(e, y);
|
|
1601
1602
|
F.set(e, S);
|
|
1602
|
-
const
|
|
1603
|
-
return
|
|
1604
|
-
const
|
|
1603
|
+
const T = [e, o, w];
|
|
1604
|
+
return k.set(S, T), Reflect.ownKeys(e).forEach((l) => {
|
|
1605
|
+
const m = Object.getOwnPropertyDescriptor(
|
|
1605
1606
|
e,
|
|
1606
1607
|
l
|
|
1607
1608
|
);
|
|
1608
|
-
"value" in
|
|
1609
|
+
"value" in m && m.writable && (S[l] = e[l]);
|
|
1609
1610
|
}), d = !1, S;
|
|
1610
1611
|
}
|
|
1611
1612
|
function En(e, t, s) {
|
|
1612
|
-
const n =
|
|
1613
|
+
const n = k.get(e);
|
|
1613
1614
|
(q ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
|
|
1614
1615
|
let r;
|
|
1615
1616
|
const i = [], o = n[2];
|
|
@@ -1624,7 +1625,7 @@ function En(e, t, s) {
|
|
|
1624
1625
|
};
|
|
1625
1626
|
}
|
|
1626
1627
|
function Be(e) {
|
|
1627
|
-
const t =
|
|
1628
|
+
const t = k.get(e);
|
|
1628
1629
|
(q ? "production" : void 0) !== "production" && !t && console.warn("Please use proxy object");
|
|
1629
1630
|
const [s, n] = t;
|
|
1630
1631
|
return wn(s, n());
|
|
@@ -1671,7 +1672,7 @@ function vn(e, t) {
|
|
|
1671
1672
|
const a = be(() => /* @__PURE__ */ new WeakMap(), []);
|
|
1672
1673
|
return Et(o, n, a, An);
|
|
1673
1674
|
}
|
|
1674
|
-
const
|
|
1675
|
+
const U = Rt({
|
|
1675
1676
|
data: null,
|
|
1676
1677
|
isPending: !1,
|
|
1677
1678
|
error: null
|
|
@@ -1685,7 +1686,7 @@ function kn({
|
|
|
1685
1686
|
onCancel: i,
|
|
1686
1687
|
onSuccess: o
|
|
1687
1688
|
}) {
|
|
1688
|
-
const a = vn(
|
|
1689
|
+
const a = vn(U), [c, u] = L(!1), [f, w] = L(Date.now());
|
|
1689
1690
|
function d() {
|
|
1690
1691
|
u(!0);
|
|
1691
1692
|
}
|
|
@@ -1693,8 +1694,8 @@ function kn({
|
|
|
1693
1694
|
u(!1), S();
|
|
1694
1695
|
}
|
|
1695
1696
|
const S = () => {
|
|
1696
|
-
const
|
|
1697
|
-
|
|
1697
|
+
const T = Date.now();
|
|
1698
|
+
U.isPending = !0, U.error = null, fetch(e, {
|
|
1698
1699
|
method: "POST",
|
|
1699
1700
|
headers: {
|
|
1700
1701
|
"Content-Type": "application/json"
|
|
@@ -1706,15 +1707,16 @@ function kn({
|
|
|
1706
1707
|
recipient: r
|
|
1707
1708
|
})
|
|
1708
1709
|
}).then((l) => l.json()).then((l) => {
|
|
1709
|
-
|
|
1710
|
+
T < f || (U.data = l, U.isPending = !1, w(T));
|
|
1710
1711
|
}).catch((l) => {
|
|
1711
|
-
|
|
1712
|
+
T < f || (U.error = l?.toString(), U.isPending = !1, w(T));
|
|
1712
1713
|
});
|
|
1713
1714
|
};
|
|
1714
1715
|
return oe(() => {
|
|
1715
1716
|
S();
|
|
1716
1717
|
}, [t, s, n, r, e]), {
|
|
1717
1718
|
...a,
|
|
1719
|
+
amount: n,
|
|
1718
1720
|
destinationChain: t,
|
|
1719
1721
|
token: s,
|
|
1720
1722
|
recipient: r,
|