@chainrails/react 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import './index.css';class
|
|
1
|
+
import { useState as k, useRef as le, useEffect as x, useMemo as Ce, useSyncExternalStore as bt, useCallback as Et, useLayoutEffect as St, useDebugValue as wt } from "react";
|
|
2
|
+
import { jsxs as Ae, jsx as _ } from "react/jsx-runtime";
|
|
3
|
+
import './index.css';class oe extends Error {
|
|
4
4
|
response;
|
|
5
5
|
request;
|
|
6
6
|
options;
|
|
7
7
|
constructor(e, s, n) {
|
|
8
|
-
const
|
|
8
|
+
const o = e.status || e.status === 0 ? e.status : "", i = e.statusText ?? "", r = `${o} ${i}`.trim(), a = r ? `status code ${r}` : "an unknown error";
|
|
9
9
|
super(`Request failed with ${a}: ${s.method} ${s.url}`), this.name = "HTTPError", this.response = e, this.request = s, this.options = n;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
class
|
|
12
|
+
class je extends Error {
|
|
13
13
|
name = "NonError";
|
|
14
14
|
value;
|
|
15
15
|
constructor(e) {
|
|
@@ -21,17 +21,17 @@ class Me extends Error {
|
|
|
21
21
|
super(s), this.value = e;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class J extends Error {
|
|
25
25
|
name = "ForceRetryError";
|
|
26
26
|
customDelay;
|
|
27
27
|
code;
|
|
28
28
|
customRequest;
|
|
29
29
|
constructor(e) {
|
|
30
|
-
const s = e?.cause ? e.cause instanceof Error ? e.cause : new
|
|
30
|
+
const s = e?.cause ? e.cause instanceof Error ? e.cause : new je(e.cause) : void 0;
|
|
31
31
|
super(e?.code ? `Forced retry: ${e.code}` : "Forced retry", s ? { cause: s } : void 0), this.customDelay = e?.delay, this.code = e?.code, this.customRequest = e?.request;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const De = (() => {
|
|
35
35
|
let t = !1, e = !1;
|
|
36
36
|
const s = typeof globalThis.ReadableStream == "function", n = typeof globalThis.Request == "function";
|
|
37
37
|
if (s && n)
|
|
@@ -44,13 +44,13 @@ const Se = (() => {
|
|
|
44
44
|
return t = !0, "half";
|
|
45
45
|
}
|
|
46
46
|
}).headers.has("Content-Type");
|
|
47
|
-
} catch (
|
|
48
|
-
if (
|
|
47
|
+
} catch (o) {
|
|
48
|
+
if (o instanceof Error && o.message === "unsupported BodyInit type")
|
|
49
49
|
return !1;
|
|
50
|
-
throw
|
|
50
|
+
throw o;
|
|
51
51
|
}
|
|
52
52
|
return t && !e;
|
|
53
|
-
})(),
|
|
53
|
+
})(), Rt = typeof globalThis.AbortController == "function", ze = typeof globalThis.AbortSignal == "function" && typeof globalThis.AbortSignal.any == "function", Ct = typeof globalThis.ReadableStream == "function", At = typeof globalThis.FormData == "function", qe = ["get", "post", "put", "patch", "head", "delete"], Dt = {
|
|
54
54
|
json: "application/json",
|
|
55
55
|
text: "text/*",
|
|
56
56
|
formData: "multipart/form-data",
|
|
@@ -59,14 +59,14 @@ const Se = (() => {
|
|
|
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
|
-
},
|
|
63
|
-
class
|
|
62
|
+
}, Z = 2147483647, Ut = new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length, Ke = Symbol("stop");
|
|
63
|
+
class We {
|
|
64
64
|
options;
|
|
65
65
|
constructor(e) {
|
|
66
66
|
this.options = e;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const vt = (t) => new We(t), kt = {
|
|
70
70
|
json: !0,
|
|
71
71
|
parseJson: !0,
|
|
72
72
|
stringifyJson: !0,
|
|
@@ -80,10 +80,10 @@ const Rt = (t) => new He(t), Ct = {
|
|
|
80
80
|
onUploadProgress: !0,
|
|
81
81
|
fetch: !0,
|
|
82
82
|
context: !0
|
|
83
|
-
},
|
|
83
|
+
}, It = {
|
|
84
84
|
next: !0
|
|
85
85
|
// Next.js cache revalidation (revalidate, tags)
|
|
86
|
-
},
|
|
86
|
+
}, Pt = {
|
|
87
87
|
method: !0,
|
|
88
88
|
headers: !0,
|
|
89
89
|
body: !0,
|
|
@@ -98,13 +98,13 @@ const Rt = (t) => new He(t), Ct = {
|
|
|
98
98
|
signal: !0,
|
|
99
99
|
window: !0,
|
|
100
100
|
duplex: !0
|
|
101
|
-
},
|
|
101
|
+
}, xt = (t) => {
|
|
102
102
|
if (!t)
|
|
103
103
|
return 0;
|
|
104
104
|
if (t instanceof FormData) {
|
|
105
105
|
let e = 0;
|
|
106
106
|
for (const [s, n] of t)
|
|
107
|
-
e +=
|
|
107
|
+
e += Ut, e += new TextEncoder().encode(`Content-Disposition: form-data; name="${s}"`).length, e += typeof n == "string" ? new TextEncoder().encode(n).length : n.size;
|
|
108
108
|
return e;
|
|
109
109
|
}
|
|
110
110
|
if (t instanceof Blob)
|
|
@@ -125,22 +125,22 @@ const Rt = (t) => new He(t), Ct = {
|
|
|
125
125
|
return 0;
|
|
126
126
|
}
|
|
127
127
|
return 0;
|
|
128
|
-
},
|
|
129
|
-
let n,
|
|
128
|
+
}, Ve = (t, e, s) => {
|
|
129
|
+
let n, o = 0;
|
|
130
130
|
return t.pipeThrough(new TransformStream({
|
|
131
|
-
transform(i,
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
let a = e === 0 ? 0 :
|
|
135
|
-
a >= 1 && (a = 1 - Number.EPSILON), s?.({ percent: a, totalBytes: Math.max(e,
|
|
131
|
+
transform(i, r) {
|
|
132
|
+
if (r.enqueue(i), n) {
|
|
133
|
+
o += n.byteLength;
|
|
134
|
+
let a = e === 0 ? 0 : o / e;
|
|
135
|
+
a >= 1 && (a = 1 - Number.EPSILON), s?.({ percent: a, totalBytes: Math.max(e, o), transferredBytes: o }, n);
|
|
136
136
|
}
|
|
137
137
|
n = i;
|
|
138
138
|
},
|
|
139
139
|
flush() {
|
|
140
|
-
n && (
|
|
140
|
+
n && (o += n.byteLength, s?.({ percent: 1, totalBytes: Math.max(e, o), transferredBytes: o }, n));
|
|
141
141
|
}
|
|
142
142
|
}));
|
|
143
|
-
},
|
|
143
|
+
}, Nt = (t, e) => {
|
|
144
144
|
if (!t.body)
|
|
145
145
|
return t;
|
|
146
146
|
if (t.status === 204)
|
|
@@ -150,69 +150,69 @@ const Rt = (t) => new He(t), Ct = {
|
|
|
150
150
|
headers: t.headers
|
|
151
151
|
});
|
|
152
152
|
const s = Math.max(0, Number(t.headers.get("content-length")) || 0);
|
|
153
|
-
return new Response(
|
|
153
|
+
return new Response(Ve(t.body, s, e), {
|
|
154
154
|
status: t.status,
|
|
155
155
|
statusText: t.statusText,
|
|
156
156
|
headers: t.headers
|
|
157
157
|
});
|
|
158
|
-
},
|
|
158
|
+
}, Ot = (t, e, s) => {
|
|
159
159
|
if (!t.body)
|
|
160
160
|
return t;
|
|
161
|
-
const n =
|
|
161
|
+
const n = xt(s ?? t.body);
|
|
162
162
|
return new Request(t, {
|
|
163
163
|
// @ts-expect-error - Types are outdated.
|
|
164
164
|
duplex: "half",
|
|
165
|
-
body:
|
|
165
|
+
body: Ve(t.body, n, e)
|
|
166
166
|
});
|
|
167
167
|
}, P = (t) => t !== null && typeof t == "object", F = (...t) => {
|
|
168
168
|
for (const e of t)
|
|
169
169
|
if ((!P(e) || Array.isArray(e)) && e !== void 0)
|
|
170
170
|
throw new TypeError("The `options` argument must be an object");
|
|
171
|
-
return
|
|
172
|
-
},
|
|
173
|
-
const s = new globalThis.Headers(t), n = e instanceof globalThis.Headers,
|
|
174
|
-
for (const [i,
|
|
175
|
-
n &&
|
|
171
|
+
return de({}, ...t);
|
|
172
|
+
}, Ye = (t = {}, e = {}) => {
|
|
173
|
+
const s = new globalThis.Headers(t), n = e instanceof globalThis.Headers, o = new globalThis.Headers(e);
|
|
174
|
+
for (const [i, r] of o.entries())
|
|
175
|
+
n && r === "undefined" || r === void 0 ? s.delete(i) : s.set(i, r);
|
|
176
176
|
return s;
|
|
177
177
|
};
|
|
178
|
-
function
|
|
179
|
-
return Object.hasOwn(e, s) && e[s] === void 0 ? [] :
|
|
180
|
-
}
|
|
181
|
-
const
|
|
182
|
-
beforeRequest:
|
|
183
|
-
beforeRetry:
|
|
184
|
-
afterResponse:
|
|
185
|
-
beforeError:
|
|
186
|
-
}),
|
|
178
|
+
function H(t, e, s) {
|
|
179
|
+
return Object.hasOwn(e, s) && e[s] === void 0 ? [] : de(t[s] ?? [], e[s] ?? []);
|
|
180
|
+
}
|
|
181
|
+
const Ge = (t = {}, e = {}) => ({
|
|
182
|
+
beforeRequest: H(t, e, "beforeRequest"),
|
|
183
|
+
beforeRetry: H(t, e, "beforeRetry"),
|
|
184
|
+
afterResponse: H(t, e, "afterResponse"),
|
|
185
|
+
beforeError: H(t, e, "beforeError")
|
|
186
|
+
}), Bt = (t, e) => {
|
|
187
187
|
const s = new URLSearchParams();
|
|
188
188
|
for (const n of [t, e])
|
|
189
189
|
if (n !== void 0)
|
|
190
190
|
if (n instanceof URLSearchParams)
|
|
191
|
-
for (const [
|
|
192
|
-
s.append(
|
|
191
|
+
for (const [o, i] of n.entries())
|
|
192
|
+
s.append(o, i);
|
|
193
193
|
else if (Array.isArray(n))
|
|
194
|
-
for (const
|
|
195
|
-
if (!Array.isArray(
|
|
194
|
+
for (const o of n) {
|
|
195
|
+
if (!Array.isArray(o) || o.length !== 2)
|
|
196
196
|
throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");
|
|
197
|
-
s.append(String(
|
|
197
|
+
s.append(String(o[0]), String(o[1]));
|
|
198
198
|
}
|
|
199
199
|
else if (P(n))
|
|
200
|
-
for (const [
|
|
201
|
-
i !== void 0 && s.append(
|
|
200
|
+
for (const [o, i] of Object.entries(n))
|
|
201
|
+
i !== void 0 && s.append(o, String(i));
|
|
202
202
|
else {
|
|
203
|
-
const
|
|
204
|
-
for (const [i,
|
|
205
|
-
s.append(i,
|
|
203
|
+
const o = new URLSearchParams(n);
|
|
204
|
+
for (const [i, r] of o.entries())
|
|
205
|
+
s.append(i, r);
|
|
206
206
|
}
|
|
207
207
|
return s;
|
|
208
|
-
},
|
|
209
|
-
let e = {}, s = {}, n = {},
|
|
208
|
+
}, de = (...t) => {
|
|
209
|
+
let e = {}, s = {}, n = {}, o;
|
|
210
210
|
const i = [];
|
|
211
|
-
for (const
|
|
212
|
-
if (Array.isArray(
|
|
213
|
-
Array.isArray(e) || (e = []), e = [...e, ...
|
|
214
|
-
else if (P(
|
|
215
|
-
for (let [a, u] of Object.entries(
|
|
211
|
+
for (const r of t)
|
|
212
|
+
if (Array.isArray(r))
|
|
213
|
+
Array.isArray(e) || (e = []), e = [...e, ...r];
|
|
214
|
+
else if (P(r)) {
|
|
215
|
+
for (let [a, u] of Object.entries(r)) {
|
|
216
216
|
if (a === "signal" && u instanceof globalThis.AbortSignal) {
|
|
217
217
|
i.push(u);
|
|
218
218
|
continue;
|
|
@@ -227,28 +227,28 @@ const je = (t = {}, e = {}) => ({
|
|
|
227
227
|
continue;
|
|
228
228
|
}
|
|
229
229
|
if (a === "searchParams") {
|
|
230
|
-
u == null ?
|
|
230
|
+
u == null ? o = void 0 : o = o === void 0 ? u : Bt(o, u);
|
|
231
231
|
continue;
|
|
232
232
|
}
|
|
233
|
-
P(u) && a in e && (u =
|
|
233
|
+
P(u) && a in e && (u = de(e[a], u)), e = { ...e, [a]: u };
|
|
234
234
|
}
|
|
235
|
-
P(
|
|
235
|
+
P(r.hooks) && (n = Ge(n, r.hooks), e.hooks = n), P(r.headers) && (s = Ye(s, r.headers), e.headers = s);
|
|
236
236
|
}
|
|
237
|
-
return
|
|
238
|
-
},
|
|
237
|
+
return o !== void 0 && (e.searchParams = o), i.length > 0 && (i.length === 1 ? e.signal = i[0] : ze ? e.signal = AbortSignal.any(i) : e.signal = i.at(-1)), e.context === void 0 && (e.context = {}), e;
|
|
238
|
+
}, Mt = (t) => qe.includes(t) ? t.toUpperCase() : t, Lt = ["get", "put", "head", "delete", "options", "trace"], _t = [408, 413, 429, 500, 502, 503, 504], Ft = [413, 429, 503], Ue = {
|
|
239
239
|
limit: 2,
|
|
240
|
-
methods:
|
|
241
|
-
statusCodes:
|
|
242
|
-
afterStatusCodes:
|
|
240
|
+
methods: Lt,
|
|
241
|
+
statusCodes: _t,
|
|
242
|
+
afterStatusCodes: Ft,
|
|
243
243
|
maxRetryAfter: Number.POSITIVE_INFINITY,
|
|
244
244
|
backoffLimit: Number.POSITIVE_INFINITY,
|
|
245
245
|
delay: (t) => 0.3 * 2 ** (t - 1) * 1e3,
|
|
246
246
|
jitter: void 0,
|
|
247
247
|
retryOnTimeout: !1
|
|
248
|
-
},
|
|
248
|
+
}, Ht = (t = {}) => {
|
|
249
249
|
if (typeof t == "number")
|
|
250
250
|
return {
|
|
251
|
-
...
|
|
251
|
+
...Ue,
|
|
252
252
|
limit: t
|
|
253
253
|
};
|
|
254
254
|
if (t.methods && !Array.isArray(t.methods))
|
|
@@ -256,66 +256,66 @@ const je = (t = {}, e = {}) => ({
|
|
|
256
256
|
if (t.statusCodes && !Array.isArray(t.statusCodes))
|
|
257
257
|
throw new Error("retry.statusCodes must be an array");
|
|
258
258
|
return {
|
|
259
|
-
...
|
|
259
|
+
...Ue,
|
|
260
260
|
...t
|
|
261
261
|
};
|
|
262
262
|
};
|
|
263
|
-
class
|
|
263
|
+
class re extends Error {
|
|
264
264
|
request;
|
|
265
265
|
constructor(e) {
|
|
266
266
|
super(`Request timed out: ${e.method} ${e.url}`), this.name = "TimeoutError", this.request = e;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
270
|
-
return new Promise((
|
|
271
|
-
const
|
|
272
|
-
s && s.abort(), i(new
|
|
269
|
+
async function $t(t, e, s, n) {
|
|
270
|
+
return new Promise((o, i) => {
|
|
271
|
+
const r = setTimeout(() => {
|
|
272
|
+
s && s.abort(), i(new re(t));
|
|
273
273
|
}, n.timeout);
|
|
274
|
-
n.fetch(t, e).then(
|
|
275
|
-
clearTimeout(
|
|
274
|
+
n.fetch(t, e).then(o).catch(i).then(() => {
|
|
275
|
+
clearTimeout(r);
|
|
276
276
|
});
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
async function
|
|
279
|
+
async function jt(t, { signal: e }) {
|
|
280
280
|
return new Promise((s, n) => {
|
|
281
|
-
e && (e.throwIfAborted(), e.addEventListener("abort",
|
|
282
|
-
function
|
|
281
|
+
e && (e.throwIfAborted(), e.addEventListener("abort", o, { once: !0 }));
|
|
282
|
+
function o() {
|
|
283
283
|
clearTimeout(i), n(e.reason);
|
|
284
284
|
}
|
|
285
285
|
const i = setTimeout(() => {
|
|
286
|
-
e?.removeEventListener("abort",
|
|
286
|
+
e?.removeEventListener("abort", o), s();
|
|
287
287
|
}, t);
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
|
-
const
|
|
290
|
+
const zt = (t, e) => {
|
|
291
291
|
const s = {};
|
|
292
292
|
for (const n in e)
|
|
293
|
-
Object.hasOwn(e, n) && !(n in
|
|
293
|
+
Object.hasOwn(e, n) && !(n in Pt) && !(n in kt) && (!(n in t) || n in It) && (s[n] = e[n]);
|
|
294
294
|
return s;
|
|
295
|
-
},
|
|
296
|
-
function
|
|
297
|
-
return t instanceof
|
|
295
|
+
}, qt = (t) => t === void 0 ? !1 : Array.isArray(t) ? t.length > 0 : t instanceof URLSearchParams ? t.size > 0 : typeof t == "object" ? Object.keys(t).length > 0 : typeof t == "string" ? t.trim().length > 0 : !!t;
|
|
296
|
+
function Kt(t) {
|
|
297
|
+
return t instanceof oe || t?.name === oe.name;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
return t instanceof
|
|
299
|
+
function Wt(t) {
|
|
300
|
+
return t instanceof re || t?.name === re.name;
|
|
301
301
|
}
|
|
302
|
-
class
|
|
302
|
+
class L {
|
|
303
303
|
static create(e, s) {
|
|
304
|
-
const n = new
|
|
305
|
-
if (typeof n.#e.timeout == "number" && n.#e.timeout >
|
|
306
|
-
throw new RangeError(`The \`timeout\` option cannot be greater than ${
|
|
304
|
+
const n = new L(e, s), o = async () => {
|
|
305
|
+
if (typeof n.#e.timeout == "number" && n.#e.timeout > Z)
|
|
306
|
+
throw new RangeError(`The \`timeout\` option cannot be greater than ${Z}`);
|
|
307
307
|
await Promise.resolve();
|
|
308
|
-
let
|
|
308
|
+
let r = await n.#g();
|
|
309
309
|
for (const a of n.#e.hooks.afterResponse) {
|
|
310
|
-
const u = n.#l(
|
|
311
|
-
if (l instanceof globalThis.Response && (
|
|
310
|
+
const u = n.#l(r.clone()), l = await a(n.request, n.#a(), u, { retryCount: n.#s });
|
|
311
|
+
if (l instanceof globalThis.Response && (r = l), l instanceof We)
|
|
312
312
|
throw await Promise.all([
|
|
313
313
|
u.body?.cancel(),
|
|
314
|
-
|
|
315
|
-
]), new
|
|
314
|
+
r.body?.cancel()
|
|
315
|
+
]), new J(l.options);
|
|
316
316
|
}
|
|
317
|
-
if (n.#l(
|
|
318
|
-
let a = new
|
|
317
|
+
if (n.#l(r), !r.ok && (typeof n.#e.throwHttpErrors == "function" ? n.#e.throwHttpErrors(r.status) : n.#e.throwHttpErrors)) {
|
|
318
|
+
let a = new oe(r, n.request, n.#a());
|
|
319
319
|
for (const u of n.#e.hooks.beforeError)
|
|
320
320
|
a = await u(a, { retryCount: n.#s });
|
|
321
321
|
throw a;
|
|
@@ -323,26 +323,26 @@ class M {
|
|
|
323
323
|
if (n.#e.onDownloadProgress) {
|
|
324
324
|
if (typeof n.#e.onDownloadProgress != "function")
|
|
325
325
|
throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
326
|
-
if (!
|
|
326
|
+
if (!Ct)
|
|
327
327
|
throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");
|
|
328
|
-
return
|
|
328
|
+
return Nt(r.clone(), n.#e.onDownloadProgress);
|
|
329
329
|
}
|
|
330
|
-
return
|
|
331
|
-
}, i = n.#d(
|
|
332
|
-
const
|
|
333
|
-
|
|
330
|
+
return r;
|
|
331
|
+
}, i = n.#d(o).finally(async () => {
|
|
332
|
+
const r = n.#r, a = [];
|
|
333
|
+
r && !r.bodyUsed && a.push(r.body?.cancel()), n.request.bodyUsed || a.push(n.request.body?.cancel()), await Promise.all(a);
|
|
334
334
|
});
|
|
335
|
-
for (const [
|
|
336
|
-
|
|
335
|
+
for (const [r, a] of Object.entries(Dt))
|
|
336
|
+
r === "bytes" && typeof globalThis.Response?.prototype?.bytes != "function" || (i[r] = async () => {
|
|
337
337
|
n.request.headers.set("accept", n.request.headers.get("accept") || a);
|
|
338
338
|
const u = await i;
|
|
339
|
-
if (
|
|
339
|
+
if (r === "json") {
|
|
340
340
|
if (u.status === 204)
|
|
341
341
|
return "";
|
|
342
342
|
const l = await u.text();
|
|
343
343
|
return l === "" ? "" : s.parseJson ? s.parseJson(l) : JSON.parse(l);
|
|
344
344
|
}
|
|
345
|
-
return u[
|
|
345
|
+
return u[r]();
|
|
346
346
|
});
|
|
347
347
|
return i;
|
|
348
348
|
}
|
|
@@ -356,24 +356,24 @@ class M {
|
|
|
356
356
|
// eslint-disable-next-line @typescript-eslint/prefer-readonly -- False positive: #input is reassigned on line 202
|
|
357
357
|
#t;
|
|
358
358
|
#e;
|
|
359
|
-
#o;
|
|
360
359
|
#r;
|
|
360
|
+
#o;
|
|
361
361
|
#i;
|
|
362
362
|
// eslint-disable-next-line complexity
|
|
363
363
|
constructor(e, s = {}) {
|
|
364
364
|
if (this.#t = e, this.#e = {
|
|
365
365
|
...s,
|
|
366
|
-
headers:
|
|
367
|
-
hooks:
|
|
366
|
+
headers: Ye(this.#t.headers, s.headers),
|
|
367
|
+
hooks: Ge({
|
|
368
368
|
beforeRequest: [],
|
|
369
369
|
beforeRetry: [],
|
|
370
370
|
beforeError: [],
|
|
371
371
|
afterResponse: []
|
|
372
372
|
}, s.hooks),
|
|
373
|
-
method:
|
|
373
|
+
method: Mt(s.method ?? this.#t.method ?? "GET"),
|
|
374
374
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
375
375
|
prefixUrl: String(s.prefixUrl || ""),
|
|
376
|
-
retry:
|
|
376
|
+
retry: Ht(s.retry),
|
|
377
377
|
throwHttpErrors: s.throwHttpErrors ?? !0,
|
|
378
378
|
timeout: s.timeout ?? 1e4,
|
|
379
379
|
fetch: s.fetch ?? globalThis.fetch.bind(globalThis),
|
|
@@ -385,16 +385,16 @@ class M {
|
|
|
385
385
|
throw new Error("`input` must not begin with a slash when using `prefixUrl`");
|
|
386
386
|
this.#e.prefixUrl.endsWith("/") || (this.#e.prefixUrl += "/"), this.#t = this.#e.prefixUrl + this.#t;
|
|
387
387
|
}
|
|
388
|
-
|
|
388
|
+
Rt && ze && (this.#o = this.#e.signal ?? this.#t.signal, this.#n = new globalThis.AbortController(), this.#e.signal = this.#o ? AbortSignal.any([this.#o, this.#n.signal]) : this.#n.signal), De && (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 && (
|
|
391
|
-
const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(
|
|
392
|
-
this.request = new globalThis.Request(
|
|
390
|
+
if (this.#t instanceof globalThis.Request && (At && 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), qt(this.#e.searchParams)) {
|
|
391
|
+
const i = "?" + (typeof this.#e.searchParams == "string" ? this.#e.searchParams.replace(/^\?/, "") : new URLSearchParams(L.#h(this.#e.searchParams)).toString()), r = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, i);
|
|
392
|
+
this.request = new globalThis.Request(r, this.#e);
|
|
393
393
|
}
|
|
394
394
|
if (this.#e.onUploadProgress) {
|
|
395
395
|
if (typeof this.#e.onUploadProgress != "function")
|
|
396
396
|
throw new TypeError("The `onUploadProgress` option must be a function");
|
|
397
|
-
if (!
|
|
397
|
+
if (!De)
|
|
398
398
|
throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");
|
|
399
399
|
this.request = this.#f(this.request, this.#e.body ?? void 0);
|
|
400
400
|
}
|
|
@@ -404,11 +404,11 @@ class M {
|
|
|
404
404
|
let s = e;
|
|
405
405
|
return this.#e.retry.jitter === !0 ? s = Math.random() * e : typeof this.#e.retry.jitter == "function" && (s = this.#e.retry.jitter(e), (!Number.isFinite(s) || s < 0) && (s = e)), Math.min(this.#e.retry.backoffLimit, s);
|
|
406
406
|
}
|
|
407
|
-
async #
|
|
407
|
+
async #m(e) {
|
|
408
408
|
if (this.#s++, this.#s > this.#e.retry.limit)
|
|
409
409
|
throw e;
|
|
410
|
-
const s = e instanceof Error ? e : new
|
|
411
|
-
if (s instanceof
|
|
410
|
+
const s = e instanceof Error ? e : new je(e);
|
|
411
|
+
if (s instanceof J)
|
|
412
412
|
return s.customDelay ?? this.#c();
|
|
413
413
|
if (!this.#e.retry.methods.includes(this.request.method.toLowerCase()))
|
|
414
414
|
throw e;
|
|
@@ -419,17 +419,17 @@ class M {
|
|
|
419
419
|
if (n === !0)
|
|
420
420
|
return this.#c();
|
|
421
421
|
}
|
|
422
|
-
if (
|
|
422
|
+
if (Wt(e) && !this.#e.retry.retryOnTimeout)
|
|
423
423
|
throw e;
|
|
424
|
-
if (
|
|
424
|
+
if (Kt(e)) {
|
|
425
425
|
if (!this.#e.retry.statusCodes.includes(e.response.status))
|
|
426
426
|
throw e;
|
|
427
427
|
const n = e.response.headers.get("Retry-After") ?? e.response.headers.get("RateLimit-Reset") ?? e.response.headers.get("X-RateLimit-Retry-After") ?? e.response.headers.get("X-RateLimit-Reset") ?? e.response.headers.get("X-Rate-Limit-Reset");
|
|
428
428
|
if (n && this.#e.retry.afterStatusCodes.includes(e.response.status)) {
|
|
429
|
-
let
|
|
430
|
-
Number.isNaN(
|
|
431
|
-
const i = this.#e.retry.maxRetryAfter ??
|
|
432
|
-
return
|
|
429
|
+
let o = Number(n) * 1e3;
|
|
430
|
+
Number.isNaN(o) ? o = Date.parse(n) - Date.now() : o >= Date.parse("2024-01-01") && (o -= Date.now());
|
|
431
|
+
const i = this.#e.retry.maxRetryAfter ?? o;
|
|
432
|
+
return o < i ? o : i;
|
|
433
433
|
}
|
|
434
434
|
if (e.response.status === 413)
|
|
435
435
|
throw e;
|
|
@@ -443,15 +443,15 @@ class M {
|
|
|
443
443
|
try {
|
|
444
444
|
return await e();
|
|
445
445
|
} catch (s) {
|
|
446
|
-
const n = Math.min(await this.#
|
|
446
|
+
const n = Math.min(await this.#m(s), Z);
|
|
447
447
|
if (this.#s < 1)
|
|
448
448
|
throw s;
|
|
449
|
-
if (await
|
|
450
|
-
const
|
|
451
|
-
this.#u(
|
|
449
|
+
if (await jt(n, this.#o ? { signal: this.#o } : {}), s instanceof J && s.customRequest) {
|
|
450
|
+
const o = this.#e.signal ? new globalThis.Request(s.customRequest, { signal: this.#e.signal }) : new globalThis.Request(s.customRequest);
|
|
451
|
+
this.#u(o);
|
|
452
452
|
}
|
|
453
|
-
for (const
|
|
454
|
-
const i = await
|
|
453
|
+
for (const o of this.#e.hooks.beforeRetry) {
|
|
454
|
+
const i = await o({
|
|
455
455
|
request: this.request,
|
|
456
456
|
options: this.#a(),
|
|
457
457
|
error: s,
|
|
@@ -463,14 +463,14 @@ class M {
|
|
|
463
463
|
}
|
|
464
464
|
if (i instanceof globalThis.Response)
|
|
465
465
|
return i;
|
|
466
|
-
if (i ===
|
|
466
|
+
if (i === Ke)
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
469
|
return this.#d(e);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
async #
|
|
473
|
-
this.#n?.signal.aborted && (this.#n = new globalThis.AbortController(), this.#e.signal = this.#
|
|
472
|
+
async #g() {
|
|
473
|
+
this.#n?.signal.aborted && (this.#n = new globalThis.AbortController(), this.#e.signal = this.#o ? AbortSignal.any([this.#o, this.#n.signal]) : this.#n.signal, this.request = new globalThis.Request(this.request, { signal: this.#e.signal }));
|
|
474
474
|
for (const s of this.#e.hooks.beforeRequest) {
|
|
475
475
|
const n = await s(this.request, this.#a(), { retryCount: this.#s });
|
|
476
476
|
if (n instanceof Response)
|
|
@@ -480,8 +480,8 @@ class M {
|
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
const e =
|
|
484
|
-
return this.#
|
|
483
|
+
const e = zt(this.request, this.#e);
|
|
484
|
+
return this.#r = this.request, this.request = this.#r.clone(), this.#e.timeout === !1 ? this.#e.fetch(this.#r, e) : $t(this.#r, e, this.#n, this.#e);
|
|
485
485
|
}
|
|
486
486
|
#a() {
|
|
487
487
|
if (!this.#i) {
|
|
@@ -494,16 +494,16 @@ class M {
|
|
|
494
494
|
this.#i = void 0, this.request = this.#f(e);
|
|
495
495
|
}
|
|
496
496
|
#f(e, s) {
|
|
497
|
-
return !this.#e.onUploadProgress || !e.body ? e :
|
|
497
|
+
return !this.#e.onUploadProgress || !e.body ? e : Ot(e, this.#e.onUploadProgress, s ?? this.#e.body ?? void 0);
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
/*! MIT License © Sindre Sorhus */
|
|
501
|
-
const
|
|
502
|
-
const e = (s, n) =>
|
|
503
|
-
for (const s of
|
|
504
|
-
e[s] = (n,
|
|
505
|
-
return e.create = (s) =>
|
|
506
|
-
},
|
|
501
|
+
const ie = (t) => {
|
|
502
|
+
const e = (s, n) => L.create(s, F(t, n));
|
|
503
|
+
for (const s of qe)
|
|
504
|
+
e[s] = (n, o) => L.create(n, F(t, o, { method: s }));
|
|
505
|
+
return e.create = (s) => ie(F(s)), e.extend = (s) => (typeof s == "function" && (s = s(t ?? {})), ie(F(t, s))), e.stop = Ke, e.retry = vt, e;
|
|
506
|
+
}, Vt = ie(), b = {
|
|
507
507
|
ARBITRUM: "ARBITRUM_MAINNET",
|
|
508
508
|
ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
|
|
509
509
|
AVALANCHE: "AVALANCHE_MAINNET",
|
|
@@ -522,7 +522,7 @@ const se = (t) => {
|
|
|
522
522
|
POLYGON: "POLYGON_MAINNET",
|
|
523
523
|
STARKNET: "STARKNET_MAINNET",
|
|
524
524
|
STARKNET_TESTNET: "STARKNET_TESTNET"
|
|
525
|
-
},
|
|
525
|
+
}, mn = {
|
|
526
526
|
ARBITRUM: "ARBITRUM",
|
|
527
527
|
ARBITRUM_TESTNET: "ARBITRUM_TESTNET",
|
|
528
528
|
AVALANCHE: "AVALANCHE",
|
|
@@ -542,29 +542,29 @@ const se = (t) => {
|
|
|
542
542
|
STARKNET: "STARKNET",
|
|
543
543
|
STARKNET_TESTNET: "STARKNET_TESTNET"
|
|
544
544
|
};
|
|
545
|
-
function
|
|
545
|
+
function fe(t, { strict: e = !0 } = {}) {
|
|
546
546
|
return !t || typeof t != "string" ? !1 : e ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x");
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
return
|
|
548
|
+
function ve(t) {
|
|
549
|
+
return fe(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
|
|
550
550
|
}
|
|
551
|
-
const
|
|
552
|
-
let
|
|
551
|
+
const Xe = "2.43.4";
|
|
552
|
+
let Q = {
|
|
553
553
|
getDocsUrl: ({ docsBaseUrl: t, docsPath: e = "", docsSlug: s }) => e ? `${t ?? "https://viem.sh"}${e}${s ? `#${s}` : ""}` : void 0,
|
|
554
|
-
version: `viem@${
|
|
554
|
+
version: `viem@${Xe}`
|
|
555
555
|
};
|
|
556
|
-
class
|
|
556
|
+
class I extends Error {
|
|
557
557
|
constructor(e, s = {}) {
|
|
558
|
-
const n = s.cause instanceof
|
|
558
|
+
const n = s.cause instanceof I ? s.cause.details : s.cause?.message ? s.cause.message : s.details, o = s.cause instanceof I && s.cause.docsPath || s.docsPath, i = Q.getDocsUrl?.({ ...s, docsPath: o }), r = [
|
|
559
559
|
e || "An error occurred.",
|
|
560
560
|
"",
|
|
561
561
|
...s.metaMessages ? [...s.metaMessages, ""] : [],
|
|
562
562
|
...i ? [`Docs: ${i}`] : [],
|
|
563
563
|
...n ? [`Details: ${n}`] : [],
|
|
564
|
-
...
|
|
564
|
+
...Q.version ? [`Version: ${Q.version}`] : []
|
|
565
565
|
].join(`
|
|
566
566
|
`);
|
|
567
|
-
super(
|
|
567
|
+
super(r, s.cause ? { cause: s.cause } : void 0), Object.defineProperty(this, "details", {
|
|
568
568
|
enumerable: !0,
|
|
569
569
|
configurable: !0,
|
|
570
570
|
writable: !0,
|
|
@@ -594,95 +594,95 @@ class U extends Error {
|
|
|
594
594
|
configurable: !0,
|
|
595
595
|
writable: !0,
|
|
596
596
|
value: "BaseError"
|
|
597
|
-
}), this.details = n, this.docsPath =
|
|
597
|
+
}), this.details = n, this.docsPath = o, this.metaMessages = s.metaMessages, this.name = s.name ?? this.name, this.shortMessage = e, this.version = Xe;
|
|
598
598
|
}
|
|
599
599
|
walk(e) {
|
|
600
|
-
return
|
|
600
|
+
return Je(this, e);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
return e?.(t) ? t : t && typeof t == "object" && "cause" in t && t.cause !== void 0 ?
|
|
603
|
+
function Je(t, e) {
|
|
604
|
+
return e?.(t) ? t : t && typeof t == "object" && "cause" in t && t.cause !== void 0 ? Je(t.cause, e) : e ? null : t;
|
|
605
605
|
}
|
|
606
|
-
class
|
|
606
|
+
class Ze extends I {
|
|
607
607
|
constructor({ size: e, targetSize: s, type: n }) {
|
|
608
608
|
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${s}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
function
|
|
612
|
-
return typeof t == "string" ?
|
|
611
|
+
function W(t, { dir: e, size: s = 32 } = {}) {
|
|
612
|
+
return typeof t == "string" ? Yt(t, { dir: e, size: s }) : Gt(t, { dir: e, size: s });
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Yt(t, { dir: e, size: s = 32 } = {}) {
|
|
615
615
|
if (s === null)
|
|
616
616
|
return t;
|
|
617
617
|
const n = t.replace("0x", "");
|
|
618
618
|
if (n.length > s * 2)
|
|
619
|
-
throw new
|
|
619
|
+
throw new Ze({
|
|
620
620
|
size: Math.ceil(n.length / 2),
|
|
621
621
|
targetSize: s,
|
|
622
622
|
type: "hex"
|
|
623
623
|
});
|
|
624
624
|
return `0x${n[e === "right" ? "padEnd" : "padStart"](s * 2, "0")}`;
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function Gt(t, { dir: e, size: s = 32 } = {}) {
|
|
627
627
|
if (s === null)
|
|
628
628
|
return t;
|
|
629
629
|
if (t.length > s)
|
|
630
|
-
throw new
|
|
630
|
+
throw new Ze({
|
|
631
631
|
size: t.length,
|
|
632
632
|
targetSize: s,
|
|
633
633
|
type: "bytes"
|
|
634
634
|
});
|
|
635
635
|
const n = new Uint8Array(s);
|
|
636
|
-
for (let
|
|
636
|
+
for (let o = 0; o < s; o++) {
|
|
637
637
|
const i = e === "right";
|
|
638
|
-
n[i ?
|
|
638
|
+
n[i ? o : s - o - 1] = t[i ? o : t.length - o - 1];
|
|
639
639
|
}
|
|
640
640
|
return n;
|
|
641
641
|
}
|
|
642
|
-
class
|
|
643
|
-
constructor({ max: e, min: s, signed: n, size:
|
|
644
|
-
super(`Number "${i}" is not in safe ${
|
|
642
|
+
class Xt extends I {
|
|
643
|
+
constructor({ max: e, min: s, signed: n, size: o, value: i }) {
|
|
644
|
+
super(`Number "${i}" is not in safe ${o ? `${o * 8}-bit ${n ? "signed" : "unsigned"} ` : ""}integer range ${e ? `(${s} to ${e})` : `(above ${s})`}`, { name: "IntegerOutOfRangeError" });
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
class
|
|
647
|
+
class Jt extends I {
|
|
648
648
|
constructor({ givenSize: e, maxSize: s }) {
|
|
649
649
|
super(`Size cannot exceed ${s} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
|
-
function
|
|
653
|
-
if (
|
|
654
|
-
throw new
|
|
655
|
-
givenSize:
|
|
652
|
+
function he(t, { size: e }) {
|
|
653
|
+
if (ve(t) > e)
|
|
654
|
+
throw new Jt({
|
|
655
|
+
givenSize: ve(t),
|
|
656
656
|
maxSize: e
|
|
657
657
|
});
|
|
658
658
|
}
|
|
659
|
-
function
|
|
660
|
-
const { signed: s, size: n } = e,
|
|
659
|
+
function Zt(t, e = {}) {
|
|
660
|
+
const { signed: s, size: n } = e, o = BigInt(t);
|
|
661
661
|
let i;
|
|
662
662
|
n ? s ? i = (1n << BigInt(n) * 8n - 1n) - 1n : i = 2n ** (BigInt(n) * 8n) - 1n : typeof t == "number" && (i = BigInt(Number.MAX_SAFE_INTEGER));
|
|
663
|
-
const
|
|
664
|
-
if (i &&
|
|
663
|
+
const r = typeof i == "bigint" && s ? -i - 1n : 0;
|
|
664
|
+
if (i && o > i || o < r) {
|
|
665
665
|
const u = typeof t == "bigint" ? "n" : "";
|
|
666
|
-
throw new
|
|
666
|
+
throw new Xt({
|
|
667
667
|
max: i ? `${i}${u}` : void 0,
|
|
668
|
-
min: `${
|
|
668
|
+
min: `${r}${u}`,
|
|
669
669
|
signed: s,
|
|
670
670
|
size: n,
|
|
671
671
|
value: `${t}${u}`
|
|
672
672
|
});
|
|
673
673
|
}
|
|
674
|
-
const a = `0x${(s &&
|
|
675
|
-
return n ?
|
|
674
|
+
const a = `0x${(s && o < 0 ? (1n << BigInt(n * 8)) + BigInt(o) : o).toString(16)}`;
|
|
675
|
+
return n ? W(a, { size: n }) : a;
|
|
676
676
|
}
|
|
677
|
-
const
|
|
678
|
-
function
|
|
679
|
-
return typeof t == "number" || typeof t == "bigint" ?
|
|
677
|
+
const Qt = /* @__PURE__ */ new TextEncoder();
|
|
678
|
+
function es(t, e = {}) {
|
|
679
|
+
return typeof t == "number" || typeof t == "bigint" ? ss(t, e) : typeof t == "boolean" ? ts(t, e) : fe(t) ? Qe(t, e) : et(t, e);
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function ts(t, e = {}) {
|
|
682
682
|
const s = new Uint8Array(1);
|
|
683
|
-
return s[0] = Number(t), typeof e.size == "number" ? (
|
|
683
|
+
return s[0] = Number(t), typeof e.size == "number" ? (he(s, { size: e.size }), W(s, { size: e.size })) : s;
|
|
684
684
|
}
|
|
685
|
-
const
|
|
685
|
+
const U = {
|
|
686
686
|
zero: 48,
|
|
687
687
|
nine: 57,
|
|
688
688
|
A: 65,
|
|
@@ -690,160 +690,160 @@ const A = {
|
|
|
690
690
|
a: 97,
|
|
691
691
|
f: 102
|
|
692
692
|
};
|
|
693
|
-
function
|
|
694
|
-
if (t >=
|
|
695
|
-
return t -
|
|
696
|
-
if (t >=
|
|
697
|
-
return t - (
|
|
698
|
-
if (t >=
|
|
699
|
-
return t - (
|
|
700
|
-
}
|
|
701
|
-
function
|
|
693
|
+
function ke(t) {
|
|
694
|
+
if (t >= U.zero && t <= U.nine)
|
|
695
|
+
return t - U.zero;
|
|
696
|
+
if (t >= U.A && t <= U.F)
|
|
697
|
+
return t - (U.A - 10);
|
|
698
|
+
if (t >= U.a && t <= U.f)
|
|
699
|
+
return t - (U.a - 10);
|
|
700
|
+
}
|
|
701
|
+
function Qe(t, e = {}) {
|
|
702
702
|
let s = t;
|
|
703
|
-
e.size && (
|
|
703
|
+
e.size && (he(s, { size: e.size }), s = W(s, { dir: "right", size: e.size }));
|
|
704
704
|
let n = s.slice(2);
|
|
705
705
|
n.length % 2 && (n = `0${n}`);
|
|
706
|
-
const
|
|
707
|
-
for (let
|
|
708
|
-
const u =
|
|
706
|
+
const o = n.length / 2, i = new Uint8Array(o);
|
|
707
|
+
for (let r = 0, a = 0; r < o; r++) {
|
|
708
|
+
const u = ke(n.charCodeAt(a++)), l = ke(n.charCodeAt(a++));
|
|
709
709
|
if (u === void 0 || l === void 0)
|
|
710
|
-
throw new
|
|
711
|
-
i[
|
|
710
|
+
throw new I(`Invalid byte sequence ("${n[a - 2]}${n[a - 1]}" in "${n}").`);
|
|
711
|
+
i[r] = u * 16 + l;
|
|
712
712
|
}
|
|
713
713
|
return i;
|
|
714
714
|
}
|
|
715
|
-
function
|
|
716
|
-
const s =
|
|
717
|
-
return
|
|
715
|
+
function ss(t, e) {
|
|
716
|
+
const s = Zt(t, e);
|
|
717
|
+
return Qe(s);
|
|
718
718
|
}
|
|
719
|
-
function
|
|
720
|
-
const s =
|
|
721
|
-
return typeof e.size == "number" ? (
|
|
719
|
+
function et(t, e = {}) {
|
|
720
|
+
const s = Qt.encode(t);
|
|
721
|
+
return typeof e.size == "number" ? (he(s, { size: e.size }), W(s, { dir: "right", size: e.size })) : s;
|
|
722
722
|
}
|
|
723
|
-
const
|
|
724
|
-
function
|
|
725
|
-
return e ? { h: Number(t &
|
|
723
|
+
const $ = /* @__PURE__ */ BigInt(2 ** 32 - 1), Ie = /* @__PURE__ */ BigInt(32);
|
|
724
|
+
function ns(t, e = !1) {
|
|
725
|
+
return e ? { h: Number(t & $), l: Number(t >> Ie & $) } : { h: Number(t >> Ie & $) | 0, l: Number(t & $) | 0 };
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function os(t, e = !1) {
|
|
728
728
|
const s = t.length;
|
|
729
|
-
let n = new Uint32Array(s),
|
|
729
|
+
let n = new Uint32Array(s), o = new Uint32Array(s);
|
|
730
730
|
for (let i = 0; i < s; i++) {
|
|
731
|
-
const { h:
|
|
732
|
-
[n[i],
|
|
731
|
+
const { h: r, l: a } = ns(t[i], e);
|
|
732
|
+
[n[i], o[i]] = [r, a];
|
|
733
733
|
}
|
|
734
|
-
return [n,
|
|
734
|
+
return [n, o];
|
|
735
735
|
}
|
|
736
|
-
const
|
|
736
|
+
const rs = (t, e, s) => t << s | e >>> 32 - s, is = (t, e, s) => e << s | t >>> 32 - s, as = (t, e, s) => e << s - 32 | t >>> 64 - s, cs = (t, e, s) => t << s - 32 | e >>> 64 - s;
|
|
737
737
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
738
|
-
function
|
|
738
|
+
function us(t) {
|
|
739
739
|
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function Pe(t) {
|
|
742
742
|
if (!Number.isSafeInteger(t) || t < 0)
|
|
743
743
|
throw new Error("positive integer expected, got " + t);
|
|
744
744
|
}
|
|
745
|
-
function
|
|
746
|
-
if (!
|
|
745
|
+
function j(t, ...e) {
|
|
746
|
+
if (!us(t))
|
|
747
747
|
throw new Error("Uint8Array expected");
|
|
748
748
|
if (e.length > 0 && !e.includes(t.length))
|
|
749
749
|
throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function xe(t, e = !0) {
|
|
752
752
|
if (t.destroyed)
|
|
753
753
|
throw new Error("Hash instance has been destroyed");
|
|
754
754
|
if (e && t.finished)
|
|
755
755
|
throw new Error("Hash#digest() has already been called");
|
|
756
756
|
}
|
|
757
|
-
function
|
|
758
|
-
|
|
757
|
+
function ls(t, e) {
|
|
758
|
+
j(t);
|
|
759
759
|
const s = e.outputLen;
|
|
760
760
|
if (t.length < s)
|
|
761
761
|
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function ds(t) {
|
|
764
764
|
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function tt(...t) {
|
|
767
767
|
for (let e = 0; e < t.length; e++)
|
|
768
768
|
t[e].fill(0);
|
|
769
769
|
}
|
|
770
|
-
const
|
|
771
|
-
function
|
|
770
|
+
const fs = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
771
|
+
function hs(t) {
|
|
772
772
|
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function ms(t) {
|
|
775
775
|
for (let e = 0; e < t.length; e++)
|
|
776
|
-
t[e] =
|
|
776
|
+
t[e] = hs(t[e]);
|
|
777
777
|
return t;
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
function
|
|
779
|
+
const Ne = fs ? (t) => t : ms;
|
|
780
|
+
function gs(t) {
|
|
781
781
|
if (typeof t != "string")
|
|
782
782
|
throw new Error("string expected");
|
|
783
783
|
return new Uint8Array(new TextEncoder().encode(t));
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
return typeof t == "string" && (t =
|
|
785
|
+
function st(t) {
|
|
786
|
+
return typeof t == "string" && (t = gs(t)), j(t), t;
|
|
787
787
|
}
|
|
788
|
-
class
|
|
788
|
+
class ps {
|
|
789
789
|
}
|
|
790
|
-
function
|
|
791
|
-
const e = (n) => t().update(
|
|
790
|
+
function ys(t) {
|
|
791
|
+
const e = (n) => t().update(st(n)).digest(), s = t();
|
|
792
792
|
return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
|
|
793
793
|
}
|
|
794
|
-
const
|
|
795
|
-
for (let t = 0, e =
|
|
796
|
-
[s, n] = [n, (2 * s + 3 * n) % 5],
|
|
797
|
-
let
|
|
794
|
+
const Ts = BigInt(0), O = BigInt(1), bs = BigInt(2), Es = BigInt(7), Ss = BigInt(256), ws = BigInt(113), nt = [], ot = [], rt = [];
|
|
795
|
+
for (let t = 0, e = O, s = 1, n = 0; t < 24; t++) {
|
|
796
|
+
[s, n] = [n, (2 * s + 3 * n) % 5], nt.push(2 * (5 * n + s)), ot.push((t + 1) * (t + 2) / 2 % 64);
|
|
797
|
+
let o = Ts;
|
|
798
798
|
for (let i = 0; i < 7; i++)
|
|
799
|
-
e = (e <<
|
|
800
|
-
|
|
799
|
+
e = (e << O ^ (e >> Es) * ws) % Ss, e & bs && (o ^= O << (O << /* @__PURE__ */ BigInt(i)) - O);
|
|
800
|
+
rt.push(o);
|
|
801
801
|
}
|
|
802
|
-
const
|
|
803
|
-
function
|
|
802
|
+
const it = os(rt, !0), Rs = it[0], Cs = it[1], Oe = (t, e, s) => s > 32 ? as(t, e, s) : rs(t, e, s), Be = (t, e, s) => s > 32 ? cs(t, e, s) : is(t, e, s);
|
|
803
|
+
function As(t, e = 24) {
|
|
804
804
|
const s = new Uint32Array(10);
|
|
805
805
|
for (let n = 24 - e; n < 24; n++) {
|
|
806
|
-
for (let
|
|
807
|
-
s[
|
|
808
|
-
for (let
|
|
809
|
-
const a = (
|
|
806
|
+
for (let r = 0; r < 10; r++)
|
|
807
|
+
s[r] = t[r] ^ t[r + 10] ^ t[r + 20] ^ t[r + 30] ^ t[r + 40];
|
|
808
|
+
for (let r = 0; r < 10; r += 2) {
|
|
809
|
+
const a = (r + 8) % 10, u = (r + 2) % 10, l = s[u], f = s[u + 1], E = Oe(l, f, 1) ^ s[a], h = Be(l, f, 1) ^ s[a + 1];
|
|
810
810
|
for (let y = 0; y < 50; y += 10)
|
|
811
|
-
t[
|
|
811
|
+
t[r + y] ^= E, t[r + y + 1] ^= h;
|
|
812
812
|
}
|
|
813
|
-
let
|
|
814
|
-
for (let
|
|
815
|
-
const a =
|
|
816
|
-
|
|
813
|
+
let o = t[2], i = t[3];
|
|
814
|
+
for (let r = 0; r < 24; r++) {
|
|
815
|
+
const a = ot[r], u = Oe(o, i, a), l = Be(o, i, a), f = nt[r];
|
|
816
|
+
o = t[f], i = t[f + 1], t[f] = u, t[f + 1] = l;
|
|
817
817
|
}
|
|
818
|
-
for (let
|
|
818
|
+
for (let r = 0; r < 50; r += 10) {
|
|
819
819
|
for (let a = 0; a < 10; a++)
|
|
820
|
-
s[a] = t[
|
|
820
|
+
s[a] = t[r + a];
|
|
821
821
|
for (let a = 0; a < 10; a++)
|
|
822
|
-
t[
|
|
822
|
+
t[r + a] ^= ~s[(a + 2) % 10] & s[(a + 4) % 10];
|
|
823
823
|
}
|
|
824
|
-
t[0] ^=
|
|
824
|
+
t[0] ^= Rs[n], t[1] ^= Cs[n];
|
|
825
825
|
}
|
|
826
|
-
|
|
826
|
+
tt(s);
|
|
827
827
|
}
|
|
828
|
-
class
|
|
828
|
+
class me extends ps {
|
|
829
829
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
830
|
-
constructor(e, s, n,
|
|
831
|
-
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = s, this.outputLen = n, this.enableXOF =
|
|
830
|
+
constructor(e, s, n, o = !1, i = 24) {
|
|
831
|
+
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = s, this.outputLen = n, this.enableXOF = o, this.rounds = i, Pe(n), !(0 < e && e < 200))
|
|
832
832
|
throw new Error("only keccak-f1600 function is supported");
|
|
833
|
-
this.state = new Uint8Array(200), this.state32 =
|
|
833
|
+
this.state = new Uint8Array(200), this.state32 = ds(this.state);
|
|
834
834
|
}
|
|
835
835
|
clone() {
|
|
836
836
|
return this._cloneInto();
|
|
837
837
|
}
|
|
838
838
|
keccak() {
|
|
839
|
-
|
|
839
|
+
Ne(this.state32), As(this.state32, this.rounds), Ne(this.state32), this.posOut = 0, this.pos = 0;
|
|
840
840
|
}
|
|
841
841
|
update(e) {
|
|
842
|
-
|
|
843
|
-
const { blockLen: s, state: n } = this,
|
|
844
|
-
for (let i = 0; i <
|
|
845
|
-
const
|
|
846
|
-
for (let a = 0; a <
|
|
842
|
+
xe(this), e = st(e), j(e);
|
|
843
|
+
const { blockLen: s, state: n } = this, o = e.length;
|
|
844
|
+
for (let i = 0; i < o; ) {
|
|
845
|
+
const r = Math.min(s - this.pos, o - i);
|
|
846
|
+
for (let a = 0; a < r; a++)
|
|
847
847
|
n[this.pos++] ^= e[i++];
|
|
848
848
|
this.pos === s && this.keccak();
|
|
849
849
|
}
|
|
@@ -853,16 +853,16 @@ class le extends ds {
|
|
|
853
853
|
if (this.finished)
|
|
854
854
|
return;
|
|
855
855
|
this.finished = !0;
|
|
856
|
-
const { state: e, suffix: s, pos: n, blockLen:
|
|
857
|
-
e[n] ^= s, (s & 128) !== 0 && n ===
|
|
856
|
+
const { state: e, suffix: s, pos: n, blockLen: o } = this;
|
|
857
|
+
e[n] ^= s, (s & 128) !== 0 && n === o - 1 && this.keccak(), e[o - 1] ^= 128, this.keccak();
|
|
858
858
|
}
|
|
859
859
|
writeInto(e) {
|
|
860
|
-
|
|
860
|
+
xe(this, !1), j(e), this.finish();
|
|
861
861
|
const s = this.state, { blockLen: n } = this;
|
|
862
|
-
for (let
|
|
862
|
+
for (let o = 0, i = e.length; o < i; ) {
|
|
863
863
|
this.posOut >= n && this.keccak();
|
|
864
|
-
const
|
|
865
|
-
e.set(s.subarray(this.posOut, this.posOut +
|
|
864
|
+
const r = Math.min(n - this.posOut, i - o);
|
|
865
|
+
e.set(s.subarray(this.posOut, this.posOut + r), o), this.posOut += r, o += r;
|
|
866
866
|
}
|
|
867
867
|
return e;
|
|
868
868
|
}
|
|
@@ -872,10 +872,10 @@ class le extends ds {
|
|
|
872
872
|
return this.writeInto(e);
|
|
873
873
|
}
|
|
874
874
|
xof(e) {
|
|
875
|
-
return
|
|
875
|
+
return Pe(e), this.xofInto(new Uint8Array(e));
|
|
876
876
|
}
|
|
877
877
|
digestInto(e) {
|
|
878
|
-
if (
|
|
878
|
+
if (ls(e, this), this.finished)
|
|
879
879
|
throw new Error("digest() was already called");
|
|
880
880
|
return this.writeInto(e), this.destroy(), e;
|
|
881
881
|
}
|
|
@@ -883,18 +883,18 @@ class le extends ds {
|
|
|
883
883
|
return this.digestInto(new Uint8Array(this.outputLen));
|
|
884
884
|
}
|
|
885
885
|
destroy() {
|
|
886
|
-
this.destroyed = !0,
|
|
886
|
+
this.destroyed = !0, tt(this.state);
|
|
887
887
|
}
|
|
888
888
|
_cloneInto(e) {
|
|
889
|
-
const { blockLen: s, suffix: n, outputLen:
|
|
890
|
-
return e || (e = new
|
|
889
|
+
const { blockLen: s, suffix: n, outputLen: o, rounds: i, enableXOF: r } = this;
|
|
890
|
+
return e || (e = new me(s, n, o, r, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = n, e.outputLen = o, e.enableXOF = r, e.destroyed = this.destroyed, e;
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
|
-
const
|
|
894
|
-
function
|
|
895
|
-
return
|
|
893
|
+
const Ds = (t, e, s) => ys(() => new me(e, t, s)), Us = Ds(1, 136, 256 / 8);
|
|
894
|
+
function vs(t, e) {
|
|
895
|
+
return Us(fe(t, { strict: !1 }) ? es(t) : t);
|
|
896
896
|
}
|
|
897
|
-
class
|
|
897
|
+
class ks extends I {
|
|
898
898
|
constructor({ address: e }) {
|
|
899
899
|
super(`Address "${e}" is invalid.`, {
|
|
900
900
|
metaMessages: [
|
|
@@ -905,7 +905,7 @@ class Cs extends U {
|
|
|
905
905
|
});
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
|
-
class
|
|
908
|
+
class at extends Map {
|
|
909
909
|
constructor(e) {
|
|
910
910
|
super(), Object.defineProperty(this, "maxSize", {
|
|
911
911
|
enumerable: !0,
|
|
@@ -926,28 +926,28 @@ class tt extends Map {
|
|
|
926
926
|
return this;
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
|
-
const
|
|
930
|
-
function
|
|
931
|
-
if (
|
|
932
|
-
return
|
|
933
|
-
const s = t.substring(2).toLowerCase(), n =
|
|
934
|
-
for (let
|
|
935
|
-
n[
|
|
936
|
-
const i = `0x${
|
|
937
|
-
return
|
|
929
|
+
const ee = /* @__PURE__ */ new at(8192);
|
|
930
|
+
function ct(t, e) {
|
|
931
|
+
if (ee.has(`${t}.${e}`))
|
|
932
|
+
return ee.get(`${t}.${e}`);
|
|
933
|
+
const s = t.substring(2).toLowerCase(), n = vs(et(s)), o = s.split("");
|
|
934
|
+
for (let r = 0; r < 40; r += 2)
|
|
935
|
+
n[r >> 1] >> 4 >= 8 && o[r] && (o[r] = o[r].toUpperCase()), (n[r >> 1] & 15) >= 8 && o[r + 1] && (o[r + 1] = o[r + 1].toUpperCase());
|
|
936
|
+
const i = `0x${o.join("")}`;
|
|
937
|
+
return ee.set(`${t}.${e}`, i), i;
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
if (!
|
|
941
|
-
throw new
|
|
942
|
-
return
|
|
939
|
+
function S(t, e) {
|
|
940
|
+
if (!Ps(t, { strict: !1 }))
|
|
941
|
+
throw new ks({ address: t });
|
|
942
|
+
return ct(t, e);
|
|
943
943
|
}
|
|
944
|
-
const
|
|
945
|
-
function
|
|
944
|
+
const Is = /^0x[a-fA-F0-9]{40}$/, te = /* @__PURE__ */ new at(8192);
|
|
945
|
+
function Ps(t, e) {
|
|
946
946
|
const { strict: s = !0 } = e ?? {}, n = `${t}.${s}`;
|
|
947
|
-
if (
|
|
948
|
-
return
|
|
949
|
-
const
|
|
950
|
-
return
|
|
947
|
+
if (te.has(n))
|
|
948
|
+
return te.get(n);
|
|
949
|
+
const o = Is.test(t) ? t.toLowerCase() === t ? !0 : s ? ct(t) === t : !0 : !1;
|
|
950
|
+
return te.set(n, o), o;
|
|
951
951
|
}
|
|
952
952
|
const c = {
|
|
953
953
|
USDC: "USDC",
|
|
@@ -962,58 +962,59 @@ const c = {
|
|
|
962
962
|
LORDS: "LORDS"
|
|
963
963
|
};
|
|
964
964
|
c.USDC;
|
|
965
|
-
const
|
|
965
|
+
const ut = {
|
|
966
966
|
[b.ARBITRUM]: {
|
|
967
967
|
[c.DAI]: {
|
|
968
|
-
address:
|
|
968
|
+
address: S("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
|
|
969
969
|
symbol: c.DAI,
|
|
970
970
|
name: "Dai Stablecoin",
|
|
971
971
|
decimals: 18,
|
|
972
|
-
logoURI: "/images/tokens/dai.png"
|
|
973
|
-
|
|
972
|
+
logoURI: "/images/tokens/dai.png",
|
|
973
|
+
nativeToken: !1
|
|
974
974
|
},
|
|
975
975
|
[c.ETH]: {
|
|
976
976
|
address: "0x0000000000000000000000000000000000000000",
|
|
977
977
|
symbol: c.ETH,
|
|
978
978
|
name: "Ethereum",
|
|
979
979
|
decimals: 18,
|
|
980
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
981
|
-
|
|
980
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
981
|
+
nativeToken: !0
|
|
982
982
|
},
|
|
983
983
|
[c.USDC]: {
|
|
984
|
-
address:
|
|
984
|
+
address: S("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
|
|
985
985
|
symbol: c.USDC,
|
|
986
986
|
name: "USD Coin",
|
|
987
987
|
decimals: 6,
|
|
988
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
989
|
-
|
|
988
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
989
|
+
nativeToken: !1
|
|
990
990
|
},
|
|
991
991
|
[c.USDT]: {
|
|
992
|
-
address:
|
|
992
|
+
address: S("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),
|
|
993
993
|
symbol: c.USDT,
|
|
994
994
|
name: "Tether USD",
|
|
995
995
|
decimals: 6,
|
|
996
|
-
logoURI: "/images/tokens/usdt.png"
|
|
997
|
-
|
|
996
|
+
logoURI: "/images/tokens/usdt.png",
|
|
997
|
+
nativeToken: !1
|
|
998
998
|
},
|
|
999
999
|
[c.WETH]: {
|
|
1000
|
-
address:
|
|
1000
|
+
address: S("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
|
|
1001
1001
|
symbol: c.WETH,
|
|
1002
1002
|
name: "Wrapped Ether",
|
|
1003
1003
|
decimals: 18,
|
|
1004
|
-
logoURI: "/images/tokens/weth.png"
|
|
1005
|
-
|
|
1004
|
+
logoURI: "/images/tokens/weth.png",
|
|
1005
|
+
nativeToken: !1
|
|
1006
1006
|
}
|
|
1007
1007
|
},
|
|
1008
1008
|
[b.ARBITRUM_TESTNET]: {
|
|
1009
1009
|
[c.USDC]: {
|
|
1010
|
-
address:
|
|
1010
|
+
address: S("0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"),
|
|
1011
1011
|
symbol: c.USDC,
|
|
1012
1012
|
name: "USD Coin",
|
|
1013
1013
|
fiatISO: "USD",
|
|
1014
1014
|
decimals: 6,
|
|
1015
1015
|
logoURI: "/images/tokens/usdc.svg",
|
|
1016
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1016
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1017
|
+
nativeToken: !1
|
|
1017
1018
|
}
|
|
1018
1019
|
},
|
|
1019
1020
|
[b.AVALANCHE]: {
|
|
@@ -1022,44 +1023,46 @@ const nt = {
|
|
|
1022
1023
|
symbol: c.DAI,
|
|
1023
1024
|
name: "Dai Stablecoin",
|
|
1024
1025
|
decimals: 18,
|
|
1025
|
-
logoURI: "/images/tokens/dai.png"
|
|
1026
|
-
|
|
1026
|
+
logoURI: "/images/tokens/dai.png",
|
|
1027
|
+
nativeToken: !1
|
|
1027
1028
|
},
|
|
1028
1029
|
[c.USDC]: {
|
|
1029
|
-
address:
|
|
1030
|
+
address: S("0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E"),
|
|
1030
1031
|
symbol: c.USDC,
|
|
1031
1032
|
name: "USD Coin",
|
|
1032
1033
|
fiatISO: "USD",
|
|
1033
1034
|
decimals: 6,
|
|
1034
1035
|
logoURI: "/images/tokens/usdc.svg",
|
|
1035
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1036
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1037
|
+
nativeToken: !1
|
|
1036
1038
|
},
|
|
1037
1039
|
[c.USDT]: {
|
|
1038
1040
|
address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",
|
|
1039
1041
|
symbol: c.USDT,
|
|
1040
1042
|
name: "Tether USD",
|
|
1041
1043
|
decimals: 6,
|
|
1042
|
-
logoURI: "/images/tokens/usdt.png"
|
|
1043
|
-
|
|
1044
|
+
logoURI: "/images/tokens/usdt.png",
|
|
1045
|
+
nativeToken: !1
|
|
1044
1046
|
},
|
|
1045
1047
|
[c.WETH]: {
|
|
1046
1048
|
address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
|
|
1047
1049
|
symbol: c.WETH,
|
|
1048
1050
|
name: "Wrapped Ether",
|
|
1049
1051
|
decimals: 18,
|
|
1050
|
-
logoURI: "/images/tokens/weth.png"
|
|
1051
|
-
|
|
1052
|
+
logoURI: "/images/tokens/weth.png",
|
|
1053
|
+
nativeToken: !1
|
|
1052
1054
|
}
|
|
1053
1055
|
},
|
|
1054
1056
|
[b.AVALANCHE_TESTNET]: {
|
|
1055
1057
|
[c.USDC]: {
|
|
1056
|
-
address:
|
|
1058
|
+
address: S("0x5425890298aed601595a70AB815c96711a31Bc65"),
|
|
1057
1059
|
symbol: c.USDC,
|
|
1058
1060
|
name: "USD Coin",
|
|
1059
1061
|
fiatISO: "USD",
|
|
1060
1062
|
decimals: 6,
|
|
1061
1063
|
logoURI: "/images/tokens/usdc.svg",
|
|
1062
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1064
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1065
|
+
nativeToken: !1
|
|
1063
1066
|
}
|
|
1064
1067
|
},
|
|
1065
1068
|
[b.BASE]: {
|
|
@@ -1068,52 +1071,54 @@ const nt = {
|
|
|
1068
1071
|
symbol: c.DAI,
|
|
1069
1072
|
name: "Dai Stablecoin",
|
|
1070
1073
|
decimals: 18,
|
|
1071
|
-
logoURI: "/images/tokens/dai.png"
|
|
1072
|
-
|
|
1074
|
+
logoURI: "/images/tokens/dai.png",
|
|
1075
|
+
nativeToken: !1
|
|
1073
1076
|
},
|
|
1074
1077
|
[c.ETH]: {
|
|
1075
1078
|
address: "0x0000000000000000000000000000000000000000",
|
|
1076
1079
|
symbol: c.ETH,
|
|
1077
1080
|
name: "Ethereum",
|
|
1078
1081
|
decimals: 18,
|
|
1079
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
1080
|
-
|
|
1082
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
1083
|
+
nativeToken: !0
|
|
1081
1084
|
},
|
|
1082
1085
|
[c.EURC]: {
|
|
1083
1086
|
address: "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",
|
|
1084
1087
|
symbol: c.EURC,
|
|
1085
1088
|
name: "Euro Coin",
|
|
1086
1089
|
decimals: 6,
|
|
1087
|
-
logoURI: "/images/tokens/eurc.png"
|
|
1088
|
-
|
|
1090
|
+
logoURI: "/images/tokens/eurc.png",
|
|
1091
|
+
nativeToken: !1
|
|
1089
1092
|
},
|
|
1090
1093
|
[c.USDC]: {
|
|
1091
|
-
address:
|
|
1094
|
+
address: S("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
|
|
1092
1095
|
symbol: c.USDC,
|
|
1093
1096
|
name: "USD Coin",
|
|
1094
1097
|
fiatISO: "USD",
|
|
1095
1098
|
decimals: 6,
|
|
1096
1099
|
logoURI: "/images/tokens/usdc.svg",
|
|
1097
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1100
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1101
|
+
nativeToken: !1
|
|
1098
1102
|
},
|
|
1099
1103
|
[c.WETH]: {
|
|
1100
|
-
address:
|
|
1104
|
+
address: S("0x4200000000000000000000000000000000000006"),
|
|
1101
1105
|
symbol: c.WETH,
|
|
1102
1106
|
name: "Wrapped Ether",
|
|
1103
1107
|
decimals: 18,
|
|
1104
|
-
logoURI: "/images/tokens/weth.png"
|
|
1105
|
-
|
|
1108
|
+
logoURI: "/images/tokens/weth.png",
|
|
1109
|
+
nativeToken: !1
|
|
1106
1110
|
}
|
|
1107
1111
|
},
|
|
1108
1112
|
[b.BASE_TESTNET]: {
|
|
1109
1113
|
[c.USDC]: {
|
|
1110
|
-
address:
|
|
1114
|
+
address: S("0x036CbD53842c5426634e7929541eC2318f3dCF7e"),
|
|
1111
1115
|
symbol: c.USDC,
|
|
1112
1116
|
name: "USD Coin",
|
|
1113
1117
|
fiatISO: "USD",
|
|
1114
1118
|
decimals: 6,
|
|
1115
1119
|
logoURI: "/images/tokens/usdc.svg",
|
|
1116
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1120
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1121
|
+
nativeToken: !1
|
|
1117
1122
|
}
|
|
1118
1123
|
},
|
|
1119
1124
|
[b.BSC]: {
|
|
@@ -1122,48 +1127,49 @@ const nt = {
|
|
|
1122
1127
|
symbol: c.BNB,
|
|
1123
1128
|
name: "BNB",
|
|
1124
1129
|
decimals: 18,
|
|
1125
|
-
logoURI: "/images/chains/bsc.webp"
|
|
1126
|
-
|
|
1130
|
+
logoURI: "/images/chains/bsc.webp",
|
|
1131
|
+
nativeToken: !0
|
|
1127
1132
|
},
|
|
1128
1133
|
[c.BUSD]: {
|
|
1129
1134
|
address: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
|
|
1130
1135
|
symbol: c.BUSD,
|
|
1131
1136
|
name: "Binance USD",
|
|
1132
1137
|
decimals: 18,
|
|
1133
|
-
logoURI: "/images/tokens/busd.png"
|
|
1134
|
-
|
|
1138
|
+
logoURI: "/images/tokens/busd.png",
|
|
1139
|
+
nativeToken: !1
|
|
1135
1140
|
},
|
|
1136
1141
|
[c.DAI]: {
|
|
1137
1142
|
address: "0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",
|
|
1138
1143
|
symbol: c.DAI,
|
|
1139
1144
|
name: "Dai Stablecoin",
|
|
1140
1145
|
decimals: 18,
|
|
1141
|
-
logoURI: "/images/tokens/dai.png"
|
|
1142
|
-
|
|
1146
|
+
logoURI: "/images/tokens/dai.png",
|
|
1147
|
+
nativeToken: !1
|
|
1143
1148
|
},
|
|
1144
1149
|
[c.ETH]: {
|
|
1145
1150
|
address: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
|
|
1146
1151
|
symbol: c.ETH,
|
|
1147
1152
|
name: "Ethereum",
|
|
1148
1153
|
decimals: 18,
|
|
1149
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
1150
|
-
|
|
1154
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
1155
|
+
nativeToken: !1
|
|
1151
1156
|
},
|
|
1152
1157
|
[c.USDC]: {
|
|
1153
|
-
address:
|
|
1158
|
+
address: S("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
|
|
1154
1159
|
symbol: c.USDC,
|
|
1155
1160
|
decimals: 18,
|
|
1156
1161
|
name: "USD Coin",
|
|
1157
1162
|
logoURI: "/images/tokens/usdc.svg",
|
|
1158
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1163
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1164
|
+
nativeToken: !1
|
|
1159
1165
|
},
|
|
1160
1166
|
[c.USDT]: {
|
|
1161
1167
|
address: "0x55d398326f99059fF775485246999027B3197955",
|
|
1162
1168
|
symbol: c.USDT,
|
|
1163
1169
|
name: "Tether USD",
|
|
1164
1170
|
decimals: 18,
|
|
1165
|
-
logoURI: "/images/tokens/usdt.png"
|
|
1166
|
-
|
|
1171
|
+
logoURI: "/images/tokens/usdt.png",
|
|
1172
|
+
nativeToken: !1
|
|
1167
1173
|
}
|
|
1168
1174
|
},
|
|
1169
1175
|
[b.ETHEREUM]: {
|
|
@@ -1172,74 +1178,76 @@ const nt = {
|
|
|
1172
1178
|
symbol: c.BUSD,
|
|
1173
1179
|
name: "Binance USD",
|
|
1174
1180
|
decimals: 18,
|
|
1175
|
-
logoURI: "/images/tokens/busd.png"
|
|
1176
|
-
|
|
1181
|
+
logoURI: "/images/tokens/busd.png",
|
|
1182
|
+
nativeToken: !1
|
|
1177
1183
|
},
|
|
1178
1184
|
[c.DAI]: {
|
|
1179
|
-
address:
|
|
1185
|
+
address: S("0x6B175474E89094C44Da98b954EedeAC495271d0F"),
|
|
1180
1186
|
symbol: c.DAI,
|
|
1181
1187
|
name: "Dai Stablecoin",
|
|
1182
1188
|
decimals: 18,
|
|
1183
|
-
logoURI: "/images/tokens/dai.png"
|
|
1184
|
-
|
|
1189
|
+
logoURI: "/images/tokens/dai.png",
|
|
1190
|
+
nativeToken: !1
|
|
1185
1191
|
},
|
|
1186
1192
|
[c.ETH]: {
|
|
1187
1193
|
address: "0x0000000000000000000000000000000000000000",
|
|
1188
1194
|
symbol: c.ETH,
|
|
1189
1195
|
name: "Ethereum",
|
|
1190
1196
|
decimals: 18,
|
|
1191
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
1192
|
-
|
|
1197
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
1198
|
+
nativeToken: !0
|
|
1193
1199
|
},
|
|
1194
1200
|
[c.EURC]: {
|
|
1195
1201
|
address: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
|
|
1196
1202
|
symbol: c.EURC,
|
|
1197
1203
|
name: "Euro Coin",
|
|
1198
1204
|
decimals: 6,
|
|
1199
|
-
logoURI: "/images/tokens/eurc.png"
|
|
1200
|
-
|
|
1205
|
+
logoURI: "/images/tokens/eurc.png",
|
|
1206
|
+
nativeToken: !1
|
|
1201
1207
|
},
|
|
1202
1208
|
[c.STRK]: {
|
|
1203
1209
|
address: "0xCa14007Eff0dB1f8135f4C25B34De49AB0d42766",
|
|
1204
1210
|
symbol: c.STRK,
|
|
1205
1211
|
name: "Starknet Token",
|
|
1206
1212
|
decimals: 18,
|
|
1207
|
-
logoURI: "/images/chains/starknet.svg"
|
|
1208
|
-
|
|
1213
|
+
logoURI: "/images/chains/starknet.svg",
|
|
1214
|
+
nativeToken: !1
|
|
1209
1215
|
},
|
|
1210
1216
|
[c.USDC]: {
|
|
1211
|
-
address:
|
|
1217
|
+
address: S("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
|
|
1212
1218
|
symbol: c.USDC,
|
|
1213
1219
|
name: "USD Coin",
|
|
1214
1220
|
decimals: 6,
|
|
1215
1221
|
logoURI: "/images/tokens/usdc.svg",
|
|
1216
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1222
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1223
|
+
nativeToken: !1
|
|
1217
1224
|
},
|
|
1218
1225
|
[c.USDT]: {
|
|
1219
|
-
address:
|
|
1226
|
+
address: S("0xdAC17F958D2ee523a2206206994597C13D831ec7"),
|
|
1220
1227
|
symbol: c.USDT,
|
|
1221
1228
|
name: "Tether USD",
|
|
1222
1229
|
decimals: 6,
|
|
1223
|
-
logoURI: "/images/tokens/usdt.png"
|
|
1224
|
-
|
|
1230
|
+
logoURI: "/images/tokens/usdt.png",
|
|
1231
|
+
nativeToken: !1
|
|
1225
1232
|
},
|
|
1226
1233
|
[c.WETH]: {
|
|
1227
|
-
address:
|
|
1234
|
+
address: S("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
|
|
1228
1235
|
symbol: c.WETH,
|
|
1229
1236
|
name: "Wrapped Ether",
|
|
1230
1237
|
decimals: 18,
|
|
1231
|
-
logoURI: "/images/tokens/weth.png"
|
|
1232
|
-
|
|
1238
|
+
logoURI: "/images/tokens/weth.png",
|
|
1239
|
+
nativeToken: !1
|
|
1233
1240
|
}
|
|
1234
1241
|
},
|
|
1235
1242
|
[b.ETHEREUM_TESTNET]: {
|
|
1236
1243
|
[c.USDC]: {
|
|
1237
|
-
address:
|
|
1244
|
+
address: S("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),
|
|
1238
1245
|
symbol: c.USDC,
|
|
1239
1246
|
decimals: 6,
|
|
1240
1247
|
name: "USD Coin",
|
|
1241
1248
|
logoURI: "/images/tokens/usdc.svg",
|
|
1242
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1249
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1250
|
+
nativeToken: !1
|
|
1243
1251
|
}
|
|
1244
1252
|
},
|
|
1245
1253
|
[b.HYPEREVM]: {
|
|
@@ -1248,8 +1256,8 @@ const nt = {
|
|
|
1248
1256
|
symbol: c.USDC,
|
|
1249
1257
|
name: "USD Coin",
|
|
1250
1258
|
decimals: 6,
|
|
1251
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
1252
|
-
|
|
1259
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
1260
|
+
nativeToken: !1
|
|
1253
1261
|
}
|
|
1254
1262
|
},
|
|
1255
1263
|
[b.LISK]: {
|
|
@@ -1258,8 +1266,8 @@ const nt = {
|
|
|
1258
1266
|
symbol: c.USDC,
|
|
1259
1267
|
name: "USD Coin",
|
|
1260
1268
|
decimals: 6,
|
|
1261
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
1262
|
-
|
|
1269
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
1270
|
+
nativeToken: !1
|
|
1263
1271
|
}
|
|
1264
1272
|
},
|
|
1265
1273
|
[b.MONAD]: {
|
|
@@ -1268,8 +1276,8 @@ const nt = {
|
|
|
1268
1276
|
symbol: c.USDC,
|
|
1269
1277
|
name: "USD Coin",
|
|
1270
1278
|
decimals: 6,
|
|
1271
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
1272
|
-
|
|
1279
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
1280
|
+
nativeToken: !1
|
|
1273
1281
|
}
|
|
1274
1282
|
},
|
|
1275
1283
|
[b.MONAD_TESTNET]: {
|
|
@@ -1278,8 +1286,8 @@ const nt = {
|
|
|
1278
1286
|
symbol: c.USDC,
|
|
1279
1287
|
name: "USD Coin",
|
|
1280
1288
|
decimals: 6,
|
|
1281
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
1282
|
-
|
|
1289
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
1290
|
+
nativeToken: !1
|
|
1283
1291
|
}
|
|
1284
1292
|
},
|
|
1285
1293
|
[b.OPTIMISM]: {
|
|
@@ -1288,40 +1296,40 @@ const nt = {
|
|
|
1288
1296
|
symbol: c.DAI,
|
|
1289
1297
|
name: "Dai Stablecoin",
|
|
1290
1298
|
decimals: 18,
|
|
1291
|
-
logoURI: "/images/tokens/dai.png"
|
|
1292
|
-
|
|
1299
|
+
logoURI: "/images/tokens/dai.png",
|
|
1300
|
+
nativeToken: !1
|
|
1293
1301
|
},
|
|
1294
1302
|
[c.ETH]: {
|
|
1295
1303
|
address: "0x0000000000000000000000000000000000000000",
|
|
1296
1304
|
symbol: c.ETH,
|
|
1297
1305
|
name: "Ethereum",
|
|
1298
1306
|
decimals: 18,
|
|
1299
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
1300
|
-
|
|
1307
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
1308
|
+
nativeToken: !0
|
|
1301
1309
|
},
|
|
1302
1310
|
[c.USDC]: {
|
|
1303
1311
|
address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
1304
1312
|
symbol: c.USDC,
|
|
1305
1313
|
name: "USD Coin",
|
|
1306
1314
|
decimals: 6,
|
|
1307
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
1308
|
-
|
|
1315
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
1316
|
+
nativeToken: !1
|
|
1309
1317
|
},
|
|
1310
1318
|
[c.USDT]: {
|
|
1311
1319
|
address: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
|
|
1312
1320
|
symbol: c.USDT,
|
|
1313
1321
|
name: "Tether USD",
|
|
1314
1322
|
decimals: 6,
|
|
1315
|
-
logoURI: "/images/tokens/usdt.png"
|
|
1316
|
-
|
|
1323
|
+
logoURI: "/images/tokens/usdt.png",
|
|
1324
|
+
nativeToken: !1
|
|
1317
1325
|
},
|
|
1318
1326
|
[c.WETH]: {
|
|
1319
1327
|
address: "0x4200000000000000000000000000000000000006",
|
|
1320
1328
|
symbol: c.WETH,
|
|
1321
1329
|
name: "Wrapped Ether",
|
|
1322
1330
|
decimals: 18,
|
|
1323
|
-
logoURI: "/images/tokens/weth.png"
|
|
1324
|
-
|
|
1331
|
+
logoURI: "/images/tokens/weth.png",
|
|
1332
|
+
nativeToken: !1
|
|
1325
1333
|
}
|
|
1326
1334
|
},
|
|
1327
1335
|
[b.OPTIMISM_TESTNET]: {
|
|
@@ -1330,8 +1338,8 @@ const nt = {
|
|
|
1330
1338
|
symbol: c.USDC,
|
|
1331
1339
|
name: "USD Coin",
|
|
1332
1340
|
decimals: 6,
|
|
1333
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
1334
|
-
|
|
1341
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
1342
|
+
nativeToken: !1
|
|
1335
1343
|
}
|
|
1336
1344
|
},
|
|
1337
1345
|
[b.POLYGON]: {
|
|
@@ -1340,32 +1348,32 @@ const nt = {
|
|
|
1340
1348
|
symbol: c.DAI,
|
|
1341
1349
|
name: "Dai Stablecoin",
|
|
1342
1350
|
decimals: 18,
|
|
1343
|
-
logoURI: "/images/tokens/dai.png"
|
|
1344
|
-
|
|
1351
|
+
logoURI: "/images/tokens/dai.png",
|
|
1352
|
+
nativeToken: !1
|
|
1345
1353
|
},
|
|
1346
1354
|
[c.USDC]: {
|
|
1347
1355
|
address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
|
|
1348
1356
|
symbol: c.USDC,
|
|
1349
1357
|
name: "USD Coin",
|
|
1350
1358
|
decimals: 6,
|
|
1351
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
1352
|
-
|
|
1359
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
1360
|
+
nativeToken: !1
|
|
1353
1361
|
},
|
|
1354
1362
|
[c.USDT]: {
|
|
1355
1363
|
address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
|
|
1356
1364
|
symbol: c.USDT,
|
|
1357
1365
|
name: "Tether USD",
|
|
1358
1366
|
decimals: 6,
|
|
1359
|
-
logoURI: "/images/tokens/usdt.png"
|
|
1360
|
-
|
|
1367
|
+
logoURI: "/images/tokens/usdt.png",
|
|
1368
|
+
nativeToken: !1
|
|
1361
1369
|
},
|
|
1362
1370
|
[c.WETH]: {
|
|
1363
1371
|
address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
|
|
1364
1372
|
symbol: c.WETH,
|
|
1365
1373
|
name: "Wrapped Ether",
|
|
1366
1374
|
decimals: 18,
|
|
1367
|
-
logoURI: "/images/tokens/weth.png"
|
|
1368
|
-
|
|
1375
|
+
logoURI: "/images/tokens/weth.png",
|
|
1376
|
+
nativeToken: !1
|
|
1369
1377
|
}
|
|
1370
1378
|
},
|
|
1371
1379
|
[b.STARKNET]: {
|
|
@@ -1374,32 +1382,32 @@ const nt = {
|
|
|
1374
1382
|
symbol: c.DAI,
|
|
1375
1383
|
name: "Dai Stablecoin",
|
|
1376
1384
|
decimals: 18,
|
|
1377
|
-
logoURI: "/images/tokens/dai.png"
|
|
1378
|
-
|
|
1385
|
+
logoURI: "/images/tokens/dai.png",
|
|
1386
|
+
nativeToken: !1
|
|
1379
1387
|
},
|
|
1380
1388
|
[c.ETH]: {
|
|
1381
1389
|
address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
1382
1390
|
symbol: c.ETH,
|
|
1383
1391
|
name: "Ethereum",
|
|
1384
1392
|
decimals: 18,
|
|
1385
|
-
logoURI: "/images/chains/ethereum.svg"
|
|
1386
|
-
|
|
1393
|
+
logoURI: "/images/chains/ethereum.svg",
|
|
1394
|
+
nativeToken: !1
|
|
1387
1395
|
},
|
|
1388
1396
|
[c.LORDS]: {
|
|
1389
1397
|
address: "0x0124aeb495b947201f5faC96fD1138E326AD86195B98df6DEc9009158A533B49",
|
|
1390
1398
|
symbol: c.LORDS,
|
|
1391
1399
|
name: "LORDS Token",
|
|
1392
1400
|
decimals: 18,
|
|
1393
|
-
logoURI: "/images/tokens/lords.png"
|
|
1394
|
-
|
|
1401
|
+
logoURI: "/images/tokens/lords.png",
|
|
1402
|
+
nativeToken: !1
|
|
1395
1403
|
},
|
|
1396
1404
|
[c.STRK]: {
|
|
1397
1405
|
address: "0x04718f5a0Fc34cC1AF16A1cdee98fFB20C31f5cD61D6Ab07201858f4287c938D",
|
|
1398
1406
|
symbol: c.STRK,
|
|
1399
1407
|
name: "Starknet Token",
|
|
1400
1408
|
decimals: 18,
|
|
1401
|
-
logoURI: "/images/chains/starknet.svg"
|
|
1402
|
-
|
|
1409
|
+
logoURI: "/images/chains/starknet.svg",
|
|
1410
|
+
nativeToken: !1
|
|
1403
1411
|
},
|
|
1404
1412
|
[c.USDC]: {
|
|
1405
1413
|
address: "0x033068F6539f8e6e6b131e6B2B814e6c34A5224bC66947c47DaB9dFeE93b35fb",
|
|
@@ -1407,15 +1415,16 @@ const nt = {
|
|
|
1407
1415
|
name: "USD Coin",
|
|
1408
1416
|
decimals: 6,
|
|
1409
1417
|
logoURI: "/images/tokens/usdc.svg",
|
|
1410
|
-
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png"
|
|
1418
|
+
logoSourceURI: "https://pay.daimo.com/coin-logos/usdc.png",
|
|
1419
|
+
nativeToken: !1
|
|
1411
1420
|
},
|
|
1412
1421
|
[c.USDT]: {
|
|
1413
1422
|
address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
|
|
1414
1423
|
symbol: c.USDT,
|
|
1415
1424
|
name: "Tether USD",
|
|
1416
1425
|
decimals: 6,
|
|
1417
|
-
logoURI: "/images/tokens/usdt.png"
|
|
1418
|
-
|
|
1426
|
+
logoURI: "/images/tokens/usdt.png",
|
|
1427
|
+
nativeToken: !1
|
|
1419
1428
|
}
|
|
1420
1429
|
},
|
|
1421
1430
|
[b.STARKNET_TESTNET]: {
|
|
@@ -1424,93 +1433,93 @@ const nt = {
|
|
|
1424
1433
|
symbol: c.USDC,
|
|
1425
1434
|
name: "USD Coin",
|
|
1426
1435
|
decimals: 6,
|
|
1427
|
-
logoURI: "/images/tokens/usdc.svg"
|
|
1428
|
-
|
|
1436
|
+
logoURI: "/images/tokens/usdc.svg",
|
|
1437
|
+
nativeToken: !1
|
|
1429
1438
|
}
|
|
1430
1439
|
}
|
|
1431
|
-
},
|
|
1432
|
-
function
|
|
1433
|
-
if (
|
|
1440
|
+
}, xs = new Set(Object.values(b));
|
|
1441
|
+
function w(t) {
|
|
1442
|
+
if (Ns(t))
|
|
1434
1443
|
return t;
|
|
1435
1444
|
const e = b[t];
|
|
1436
1445
|
if (!e)
|
|
1437
1446
|
throw new Error(`Invalid chain: ${t}. Chain must be a valid chain alias or internal chain value from Chains.`);
|
|
1438
1447
|
return e;
|
|
1439
1448
|
}
|
|
1440
|
-
function
|
|
1441
|
-
return
|
|
1449
|
+
function Ns(t) {
|
|
1450
|
+
return xs.has(t);
|
|
1442
1451
|
}
|
|
1443
|
-
function
|
|
1444
|
-
const s = e.toLowerCase().trim(), n =
|
|
1452
|
+
function Os(t, e) {
|
|
1453
|
+
const s = e.toLowerCase().trim(), n = ut[t];
|
|
1445
1454
|
if (!n)
|
|
1446
1455
|
throw new Error(
|
|
1447
1456
|
`Chain not found: ${t}. The chain key must be a valid chain identifier.`
|
|
1448
1457
|
);
|
|
1449
|
-
let
|
|
1458
|
+
let o;
|
|
1450
1459
|
for (const i in n) {
|
|
1451
|
-
const
|
|
1452
|
-
if (
|
|
1453
|
-
|
|
1460
|
+
const r = n[i];
|
|
1461
|
+
if (r && r.address.toLowerCase() === s.toLowerCase()) {
|
|
1462
|
+
o = r;
|
|
1454
1463
|
break;
|
|
1455
1464
|
}
|
|
1456
1465
|
}
|
|
1457
|
-
if (!
|
|
1466
|
+
if (!o)
|
|
1458
1467
|
throw new Error(
|
|
1459
1468
|
`Token address mismatch: address ${e} does not exist on chain ${t}. The token address must be a valid token address on the specified chain.`
|
|
1460
1469
|
);
|
|
1461
|
-
return
|
|
1470
|
+
return o;
|
|
1462
1471
|
}
|
|
1463
|
-
function
|
|
1464
|
-
const n =
|
|
1472
|
+
function se(t, e, s) {
|
|
1473
|
+
const n = Os(t, e);
|
|
1465
1474
|
if (n.symbol !== s)
|
|
1466
1475
|
throw new Error(
|
|
1467
1476
|
`Token address and symbol mismatch: address ${e} on chain ${t} corresponds to token "${n.symbol}", but expected "${s}". The token address must correspond to a token with the expected symbol on the specified chain.`
|
|
1468
1477
|
);
|
|
1469
1478
|
return n;
|
|
1470
1479
|
}
|
|
1471
|
-
function
|
|
1472
|
-
return
|
|
1480
|
+
function Bs(t, e) {
|
|
1481
|
+
return ut[t]?.[e];
|
|
1473
1482
|
}
|
|
1474
|
-
function
|
|
1475
|
-
return
|
|
1483
|
+
function Me(t, e) {
|
|
1484
|
+
return Bs(t, e)?.address;
|
|
1476
1485
|
}
|
|
1477
|
-
var
|
|
1478
|
-
class
|
|
1479
|
-
constructor({ api_key: e, env: s, seesion_token: n, props:
|
|
1480
|
-
this.api_key = e || "", this.sessionToken = n || "", this.env = s ??
|
|
1486
|
+
var ge = /* @__PURE__ */ ((t) => (t.PRODUCTION = "production", t.STAGING = "staging", t))(ge || {});
|
|
1487
|
+
class d {
|
|
1488
|
+
constructor({ api_key: e, env: s, seesion_token: n, props: o }) {
|
|
1489
|
+
this.api_key = e || "", this.sessionToken = n || "", this.env = s ?? ge.PRODUCTION, this.props = o;
|
|
1481
1490
|
}
|
|
1482
1491
|
static async config(e) {
|
|
1483
|
-
if (!
|
|
1492
|
+
if (!d.app) {
|
|
1484
1493
|
if (!e)
|
|
1485
1494
|
throw new Error("Please provide an api_key");
|
|
1486
|
-
|
|
1495
|
+
d.app = new d(e);
|
|
1487
1496
|
}
|
|
1488
|
-
return e && (e.api_key !== void 0 && (
|
|
1497
|
+
return e && (e.api_key !== void 0 && (d.app.api_key = e.api_key), e.seesion_token !== void 0 && (d.app.sessionToken = e.seesion_token), e.env !== void 0 && (d.app.env = e.env), e.props !== void 0 && (d.app.props = e.props)), d.app;
|
|
1489
1498
|
}
|
|
1490
1499
|
static getApiKey() {
|
|
1491
|
-
if (!
|
|
1500
|
+
if (!d.app)
|
|
1492
1501
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1493
|
-
return
|
|
1502
|
+
return d.app.api_key;
|
|
1494
1503
|
}
|
|
1495
1504
|
static getSessionToken() {
|
|
1496
|
-
if (!
|
|
1505
|
+
if (!d.app)
|
|
1497
1506
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1498
|
-
return
|
|
1507
|
+
return d.app.sessionToken;
|
|
1499
1508
|
}
|
|
1500
1509
|
static getProps() {
|
|
1501
|
-
if (!
|
|
1510
|
+
if (!d.app)
|
|
1502
1511
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1503
|
-
return
|
|
1512
|
+
return d.app.props;
|
|
1504
1513
|
}
|
|
1505
1514
|
static getEnv() {
|
|
1506
|
-
if (!
|
|
1515
|
+
if (!d.app)
|
|
1507
1516
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1508
|
-
return
|
|
1517
|
+
return d.app.env === "internal" ? "staging" : d.app.env;
|
|
1509
1518
|
}
|
|
1510
1519
|
static getBaseUrl() {
|
|
1511
|
-
if (!
|
|
1520
|
+
if (!d.app)
|
|
1512
1521
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1513
|
-
switch (
|
|
1522
|
+
switch (d.app.env) {
|
|
1514
1523
|
case "production":
|
|
1515
1524
|
return "https://api.chainrails.io/api/v1";
|
|
1516
1525
|
case "staging":
|
|
@@ -1522,23 +1531,23 @@ class g {
|
|
|
1522
1531
|
}
|
|
1523
1532
|
}
|
|
1524
1533
|
static getPayModalUrl(e) {
|
|
1525
|
-
if (!
|
|
1534
|
+
if (!d.app)
|
|
1526
1535
|
throw new Error("Chainrails SDK not configured. Please call Chainrails.config() first.");
|
|
1527
|
-
const s =
|
|
1528
|
-
return s +
|
|
1536
|
+
const s = d.app.env === "internal" ? "https://chainrails-frontend-git-staging-horus-labs.vercel.app" : "https://app.chainrails.io", n = Number(e), o = e && !isNaN(Number(e)) && n > 0 ? "/pay/" : "/deposit/", i = `${e && !isNaN(Number(e)) && n > 0 ? n * 100 : ""}`;
|
|
1537
|
+
return s + o + i;
|
|
1529
1538
|
}
|
|
1530
1539
|
}
|
|
1531
|
-
let
|
|
1532
|
-
function
|
|
1533
|
-
|
|
1534
|
-
prefixUrl:
|
|
1540
|
+
let ae = null;
|
|
1541
|
+
function Ms() {
|
|
1542
|
+
ae = Vt.create({
|
|
1543
|
+
prefixUrl: d.getBaseUrl(),
|
|
1535
1544
|
headers: {
|
|
1536
1545
|
"Content-Type": "application/json"
|
|
1537
1546
|
},
|
|
1538
1547
|
hooks: {
|
|
1539
1548
|
beforeRequest: [
|
|
1540
1549
|
(t) => {
|
|
1541
|
-
const e =
|
|
1550
|
+
const e = d.getSessionToken() || d.getApiKey();
|
|
1542
1551
|
t.headers.set("Authorization", `Bearer ${e}`);
|
|
1543
1552
|
}
|
|
1544
1553
|
],
|
|
@@ -1550,9 +1559,9 @@ function xs() {
|
|
|
1550
1559
|
});
|
|
1551
1560
|
}
|
|
1552
1561
|
function p() {
|
|
1553
|
-
return
|
|
1562
|
+
return ae || Ms(), ae;
|
|
1554
1563
|
}
|
|
1555
|
-
class
|
|
1564
|
+
class Ls {
|
|
1556
1565
|
async getById(e) {
|
|
1557
1566
|
return await p().get("intents/" + e).json();
|
|
1558
1567
|
}
|
|
@@ -1569,7 +1578,7 @@ class Ns {
|
|
|
1569
1578
|
return await p().get("intents", { searchParams: e }).json();
|
|
1570
1579
|
}
|
|
1571
1580
|
async create(e) {
|
|
1572
|
-
const s =
|
|
1581
|
+
const s = w(e.source_chain), n = w(e.destination_chain);
|
|
1573
1582
|
return await p().post("intents", {
|
|
1574
1583
|
json: {
|
|
1575
1584
|
...e,
|
|
@@ -1579,7 +1588,7 @@ class Ns {
|
|
|
1579
1588
|
}).json();
|
|
1580
1589
|
}
|
|
1581
1590
|
async createForSession(e) {
|
|
1582
|
-
const s =
|
|
1591
|
+
const s = w(e.sourceChain);
|
|
1583
1592
|
return await p().post("modal/sessions/intents", {
|
|
1584
1593
|
json: { ...e, sourceChain: s }
|
|
1585
1594
|
}).json();
|
|
@@ -1594,11 +1603,11 @@ class Ns {
|
|
|
1594
1603
|
return await p().post(`modal/sessions/intents/${e}/process`).json();
|
|
1595
1604
|
}
|
|
1596
1605
|
}
|
|
1597
|
-
class
|
|
1606
|
+
class _s {
|
|
1598
1607
|
async getFromSpecificBridge(e) {
|
|
1599
|
-
const s =
|
|
1600
|
-
|
|
1601
|
-
const n =
|
|
1608
|
+
const s = w(e.sourceChain);
|
|
1609
|
+
se(s, e.tokenIn, e.amountSymbol);
|
|
1610
|
+
const n = w(e.destinationChain);
|
|
1602
1611
|
return await p().get("quotes/single", {
|
|
1603
1612
|
searchParams: {
|
|
1604
1613
|
...e,
|
|
@@ -1608,9 +1617,9 @@ class Os {
|
|
|
1608
1617
|
}).json();
|
|
1609
1618
|
}
|
|
1610
1619
|
async getFromAllBridges(e) {
|
|
1611
|
-
const s =
|
|
1612
|
-
|
|
1613
|
-
const n =
|
|
1620
|
+
const s = w(e.sourceChain);
|
|
1621
|
+
se(s, e.tokenIn, e.amountSymbol);
|
|
1622
|
+
const n = w(e.destinationChain);
|
|
1614
1623
|
return await p().get("quotes/multiple", {
|
|
1615
1624
|
searchParams: {
|
|
1616
1625
|
...e,
|
|
@@ -1620,9 +1629,9 @@ class Os {
|
|
|
1620
1629
|
}).json();
|
|
1621
1630
|
}
|
|
1622
1631
|
async getBestAcrossBridges(e) {
|
|
1623
|
-
const s =
|
|
1624
|
-
|
|
1625
|
-
const n =
|
|
1632
|
+
const s = w(e.sourceChain);
|
|
1633
|
+
se(s, e.tokenIn, e.amountSymbol);
|
|
1634
|
+
const n = w(e.destinationChain);
|
|
1626
1635
|
return await p().get("quotes/best", { searchParams: {
|
|
1627
1636
|
...e,
|
|
1628
1637
|
sourceChain: s,
|
|
@@ -1630,7 +1639,7 @@ class Os {
|
|
|
1630
1639
|
} }).json();
|
|
1631
1640
|
}
|
|
1632
1641
|
async getAll(e) {
|
|
1633
|
-
const s =
|
|
1642
|
+
const s = w(e.destinationChain);
|
|
1634
1643
|
return await p().get("quotes/multi-source", { searchParams: {
|
|
1635
1644
|
...e,
|
|
1636
1645
|
destinationChain: s
|
|
@@ -1640,9 +1649,9 @@ class Os {
|
|
|
1640
1649
|
return await p().get("modal/sessions/quotes", { searchParams: e }).json();
|
|
1641
1650
|
}
|
|
1642
1651
|
}
|
|
1643
|
-
class
|
|
1652
|
+
class Fs {
|
|
1644
1653
|
async getOptimalRoutes(e) {
|
|
1645
|
-
const s =
|
|
1654
|
+
const s = w(e.sourceChain), n = w(e.destinationChain);
|
|
1646
1655
|
return await p().get("router/optimal-route", {
|
|
1647
1656
|
searchParams: {
|
|
1648
1657
|
...e,
|
|
@@ -1655,23 +1664,18 @@ class Bs {
|
|
|
1655
1664
|
return await p().get("router/supported-bridges/all").json();
|
|
1656
1665
|
}
|
|
1657
1666
|
async getSupportedBridges(e) {
|
|
1658
|
-
const s =
|
|
1667
|
+
const s = w(e.sourceChain), n = w(e.destinationChain);
|
|
1659
1668
|
return await p().get("router/supported-bridges/route", { searchParams: {
|
|
1660
1669
|
...e,
|
|
1661
1670
|
sourceChain: s,
|
|
1662
1671
|
destinationChain: n
|
|
1663
1672
|
} }).json();
|
|
1664
1673
|
}
|
|
1665
|
-
async getSupportedRoutes(e
|
|
1666
|
-
|
|
1667
|
-
return await p().get("router/supported-routes/bridge/" + e, { searchParams: {
|
|
1668
|
-
...s,
|
|
1669
|
-
sourceChain: n,
|
|
1670
|
-
destinationChain: r
|
|
1671
|
-
} }).json();
|
|
1674
|
+
async getSupportedRoutes(e) {
|
|
1675
|
+
return await p().get("router/supported-routes/bridge/" + e).json();
|
|
1672
1676
|
}
|
|
1673
1677
|
}
|
|
1674
|
-
class
|
|
1678
|
+
class Hs {
|
|
1675
1679
|
async getSupported(e) {
|
|
1676
1680
|
return await p().get("chains", { searchParams: e }).json();
|
|
1677
1681
|
}
|
|
@@ -1679,7 +1683,7 @@ class Ms {
|
|
|
1679
1683
|
return await p().get(`chains/balances/${e.address}`, { searchParams: e }).json();
|
|
1680
1684
|
}
|
|
1681
1685
|
}
|
|
1682
|
-
class
|
|
1686
|
+
class $s {
|
|
1683
1687
|
async getClientInfo() {
|
|
1684
1688
|
return await p().get("client/auth/client-info").json();
|
|
1685
1689
|
}
|
|
@@ -1687,182 +1691,205 @@ class Ls {
|
|
|
1687
1691
|
return await p().get("modal/sessions/client").json();
|
|
1688
1692
|
}
|
|
1689
1693
|
}
|
|
1690
|
-
class
|
|
1694
|
+
class js {
|
|
1691
1695
|
async getSessionToken(e) {
|
|
1692
|
-
const s =
|
|
1696
|
+
const s = w(e.destinationChain);
|
|
1697
|
+
let n = Me(s, e.token);
|
|
1698
|
+
n || (console.error(`${e.token} on ${e.destinationChain} is currently unsupported, defaulting to usdc`), n = Me(s, "USDC"));
|
|
1699
|
+
const o = {
|
|
1693
1700
|
recipient: e.recipient,
|
|
1694
|
-
tokenOut:
|
|
1695
|
-
s,
|
|
1696
|
-
e.token
|
|
1697
|
-
),
|
|
1701
|
+
tokenOut: n,
|
|
1698
1702
|
destinationChain: s,
|
|
1699
1703
|
amount: e.amount
|
|
1700
1704
|
};
|
|
1701
|
-
return p().post("modal/sessions", { json:
|
|
1705
|
+
return p().post("modal/sessions", { json: o }).json().then((i) => ({ ...i, amount: o.amount }));
|
|
1702
1706
|
}
|
|
1703
1707
|
}
|
|
1704
|
-
const
|
|
1705
|
-
router: new
|
|
1706
|
-
quotes: new
|
|
1707
|
-
intents: new
|
|
1708
|
-
chains: new
|
|
1709
|
-
client: new
|
|
1710
|
-
auth: new
|
|
1708
|
+
const gn = {
|
|
1709
|
+
router: new Fs(),
|
|
1710
|
+
quotes: new _s(),
|
|
1711
|
+
intents: new Ls(),
|
|
1712
|
+
chains: new Hs(),
|
|
1713
|
+
client: new $s(),
|
|
1714
|
+
auth: new js()
|
|
1711
1715
|
};
|
|
1712
|
-
function
|
|
1716
|
+
function lt(t) {
|
|
1713
1717
|
var e, s, n = "";
|
|
1714
1718
|
if (typeof t == "string" || typeof t == "number") n += t;
|
|
1715
1719
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
1716
|
-
var
|
|
1717
|
-
for (e = 0; e <
|
|
1720
|
+
var o = t.length;
|
|
1721
|
+
for (e = 0; e < o; e++) t[e] && (s = lt(t[e])) && (n && (n += " "), n += s);
|
|
1718
1722
|
} else for (s in t) t[s] && (n && (n += " "), n += s);
|
|
1719
1723
|
return n;
|
|
1720
1724
|
}
|
|
1721
|
-
function
|
|
1722
|
-
for (var t, e, s = 0, n = "",
|
|
1725
|
+
function zs() {
|
|
1726
|
+
for (var t, e, s = 0, n = "", o = arguments.length; s < o; s++) (t = arguments[s]) && (e = lt(t)) && (n && (n += " "), n += e);
|
|
1723
1727
|
return n;
|
|
1724
1728
|
}
|
|
1725
|
-
|
|
1729
|
+
const qs = ["light", "dark", "system"];
|
|
1730
|
+
function pn(t) {
|
|
1726
1731
|
const {
|
|
1727
1732
|
amount: e,
|
|
1728
1733
|
styles: s,
|
|
1729
1734
|
excludeChains: n,
|
|
1730
|
-
isOpen:
|
|
1735
|
+
isOpen: o,
|
|
1731
1736
|
isPending: i,
|
|
1732
|
-
open:
|
|
1737
|
+
open: r,
|
|
1733
1738
|
close: a,
|
|
1734
1739
|
onCancel: u,
|
|
1735
1740
|
onSuccess: l,
|
|
1736
|
-
session_url:
|
|
1737
|
-
sessionToken:
|
|
1738
|
-
} = t, [
|
|
1739
|
-
|
|
1741
|
+
session_url: f,
|
|
1742
|
+
sessionToken: E
|
|
1743
|
+
} = t, [h, y] = k(0), [R, V] = k(""), [g, T] = k(null), m = le(null);
|
|
1744
|
+
d.config({
|
|
1740
1745
|
api_key: "",
|
|
1741
1746
|
// @ts-expect-error
|
|
1742
1747
|
env: t.env === "internal" ? "internal" : "production"
|
|
1743
1748
|
}), x(() => {
|
|
1744
|
-
|
|
1749
|
+
V(d.getPayModalUrl(e));
|
|
1745
1750
|
}, [e]), x(() => {
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1751
|
+
const C = s?.theme;
|
|
1752
|
+
if (!C || qs.includes(C)) {
|
|
1753
|
+
T(null);
|
|
1754
|
+
return;
|
|
1755
|
+
}
|
|
1756
|
+
let D = !1;
|
|
1757
|
+
return (async () => {
|
|
1758
|
+
try {
|
|
1759
|
+
const G = d.getBaseUrl(), Re = await fetch(`${G}/themes/${C}`);
|
|
1760
|
+
if (!Re.ok) return;
|
|
1761
|
+
const X = await Re.json();
|
|
1762
|
+
!D && X.status === "approved" && X.css_content && T(X.css_content);
|
|
1763
|
+
} catch (G) {
|
|
1764
|
+
console.error("Failed to fetch theme:", G);
|
|
1765
|
+
}
|
|
1766
|
+
})(), () => {
|
|
1767
|
+
D = !0;
|
|
1768
|
+
};
|
|
1769
|
+
}, [s?.theme]), x(() => {
|
|
1770
|
+
const C = document.body.style.overflow;
|
|
1771
|
+
o ? (document.body.style.overflow = "hidden", document.body.style.overflow = "hidden") : document.body.style.overflow = C || "";
|
|
1772
|
+
const D = (Y) => {
|
|
1773
|
+
Y.data === "closed" && (a(), u?.()), Y.data === "completed" && (window.setTimeout(a, 2e3), l?.());
|
|
1750
1774
|
};
|
|
1751
|
-
return window.addEventListener("message",
|
|
1752
|
-
document.body.style.overflow =
|
|
1775
|
+
return window.addEventListener("message", D), () => {
|
|
1776
|
+
document.body.style.overflow = C || "", window.removeEventListener("message", D);
|
|
1753
1777
|
};
|
|
1754
|
-
}, [
|
|
1755
|
-
if (!
|
|
1756
|
-
const
|
|
1778
|
+
}, [o, u, l]), x(() => {
|
|
1779
|
+
if (!E) return;
|
|
1780
|
+
const C = t.css || g || void 0, D = {
|
|
1757
1781
|
type: "session",
|
|
1758
|
-
session_token:
|
|
1759
|
-
environment:
|
|
1782
|
+
session_token: E,
|
|
1783
|
+
environment: d.getEnv() || ge.PRODUCTION,
|
|
1760
1784
|
styles: s,
|
|
1761
1785
|
props: {
|
|
1762
1786
|
excludeChains: n?.join(",")
|
|
1763
|
-
}
|
|
1787
|
+
},
|
|
1788
|
+
...C ? {
|
|
1789
|
+
css: C
|
|
1790
|
+
} : {}
|
|
1764
1791
|
};
|
|
1765
|
-
|
|
1766
|
-
|
|
1792
|
+
m.current?.contentWindow?.postMessage(D, "https://app.chainrails.io"), m.current?.contentWindow?.postMessage(D, "https://chainrails-frontend-git-staging-horus-labs.vercel.app"), window.setTimeout(() => {
|
|
1793
|
+
m.current?.contentWindow?.postMessage(D, "https://app.chainrails.io"), m.current?.contentWindow?.postMessage(D, "https://chainrails-frontend-git-staging-horus-labs.vercel.app");
|
|
1767
1794
|
}, 1e3);
|
|
1768
|
-
}, [
|
|
1769
|
-
function
|
|
1795
|
+
}, [E, h, o, s, g]);
|
|
1796
|
+
function A() {
|
|
1770
1797
|
y(Math.random());
|
|
1771
1798
|
}
|
|
1772
|
-
return /* @__PURE__ */
|
|
1773
|
-
className:
|
|
1774
|
-
children: [(
|
|
1799
|
+
return /* @__PURE__ */ Ae("div", {
|
|
1800
|
+
className: zs("payment-modal-wrapper", h === 0 || i ? "loading" : "not-loading", o ? "open" : "closed"),
|
|
1801
|
+
children: [(h === 0 || i) && /* @__PURE__ */ _("div", {
|
|
1775
1802
|
role: "status",
|
|
1776
1803
|
className: "payment-modal-loader",
|
|
1777
|
-
children: /* @__PURE__ */
|
|
1804
|
+
children: /* @__PURE__ */ Ae("svg", {
|
|
1778
1805
|
"aria-hidden": "true",
|
|
1779
1806
|
className: "icon",
|
|
1780
1807
|
viewBox: "0 0 100 101",
|
|
1781
1808
|
fill: "none",
|
|
1782
1809
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1783
|
-
children: [/* @__PURE__ */
|
|
1810
|
+
children: [/* @__PURE__ */ _("path", {
|
|
1784
1811
|
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",
|
|
1785
1812
|
fill: "currentColor"
|
|
1786
|
-
}), /* @__PURE__ */
|
|
1813
|
+
}), /* @__PURE__ */ _("path", {
|
|
1787
1814
|
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",
|
|
1788
1815
|
fill: "currentFill"
|
|
1789
1816
|
})]
|
|
1790
1817
|
})
|
|
1791
|
-
}), /* @__PURE__ */
|
|
1818
|
+
}), /* @__PURE__ */ _("iframe", {
|
|
1792
1819
|
allow: "clipboard-read *; clipboard-write *",
|
|
1793
1820
|
src: R || void 0,
|
|
1794
|
-
onLoad:
|
|
1795
|
-
className: `payment-modal ${
|
|
1821
|
+
onLoad: A,
|
|
1822
|
+
className: `payment-modal ${h === 0 || i ? "invisible" : "visible"}`,
|
|
1796
1823
|
"data-id": e,
|
|
1797
|
-
ref:
|
|
1824
|
+
ref: m
|
|
1798
1825
|
}, e)]
|
|
1799
1826
|
});
|
|
1800
1827
|
}
|
|
1801
|
-
const
|
|
1802
|
-
let
|
|
1803
|
-
const
|
|
1828
|
+
const Ks = Symbol(), pe = Symbol(), B = "a", dt = "f", Le = "p", ft = "c", ht = "t", ye = "h", M = "w", Te = "o", be = "k";
|
|
1829
|
+
let Ws = (t, e) => new Proxy(t, e);
|
|
1830
|
+
const ce = Object.getPrototypeOf, ue = /* @__PURE__ */ new WeakMap(), mt = (t) => t && (ue.has(t) ? ue.get(t) : ce(t) === Object.prototype || ce(t) === Array.prototype), z = (t) => typeof t == "object" && t !== null, Vs = (t) => Object.values(Object.getOwnPropertyDescriptors(t)).some((e) => !e.configurable && !e.writable), Ys = (t) => {
|
|
1804
1831
|
if (Array.isArray(t))
|
|
1805
1832
|
return Array.from(t);
|
|
1806
1833
|
const e = Object.getOwnPropertyDescriptors(t);
|
|
1807
1834
|
return Object.values(e).forEach((s) => {
|
|
1808
1835
|
s.configurable = !0;
|
|
1809
|
-
}), Object.create(
|
|
1810
|
-
},
|
|
1836
|
+
}), Object.create(ce(t), e);
|
|
1837
|
+
}, Gs = (t, e) => {
|
|
1811
1838
|
const s = {
|
|
1812
|
-
[
|
|
1839
|
+
[dt]: e
|
|
1813
1840
|
};
|
|
1814
1841
|
let n = !1;
|
|
1815
|
-
const
|
|
1842
|
+
const o = (a, u) => {
|
|
1816
1843
|
if (!n) {
|
|
1817
|
-
let l = s[
|
|
1818
|
-
if (l || (l = {}, s[
|
|
1819
|
-
l[
|
|
1844
|
+
let l = s[B].get(t);
|
|
1845
|
+
if (l || (l = {}, s[B].set(t, l)), a === M)
|
|
1846
|
+
l[M] = !0;
|
|
1820
1847
|
else {
|
|
1821
|
-
let
|
|
1822
|
-
|
|
1848
|
+
let f = l[a];
|
|
1849
|
+
f || (f = /* @__PURE__ */ new Set(), l[a] = f), f.add(u);
|
|
1823
1850
|
}
|
|
1824
1851
|
}
|
|
1825
1852
|
}, i = () => {
|
|
1826
|
-
n = !0, s[
|
|
1827
|
-
},
|
|
1853
|
+
n = !0, s[B].delete(t);
|
|
1854
|
+
}, r = {
|
|
1828
1855
|
get(a, u) {
|
|
1829
|
-
return u ===
|
|
1856
|
+
return u === pe ? t : (o(be, u), gt(Reflect.get(a, u), s[B], s[ft], s[ht]));
|
|
1830
1857
|
},
|
|
1831
1858
|
has(a, u) {
|
|
1832
|
-
return u ===
|
|
1859
|
+
return u === Ks ? (i(), !0) : (o(ye, u), Reflect.has(a, u));
|
|
1833
1860
|
},
|
|
1834
1861
|
getOwnPropertyDescriptor(a, u) {
|
|
1835
|
-
return
|
|
1862
|
+
return o(Te, u), Reflect.getOwnPropertyDescriptor(a, u);
|
|
1836
1863
|
},
|
|
1837
1864
|
ownKeys(a) {
|
|
1838
|
-
return
|
|
1865
|
+
return o(M), Reflect.ownKeys(a);
|
|
1839
1866
|
}
|
|
1840
1867
|
};
|
|
1841
|
-
return e && (
|
|
1842
|
-
},
|
|
1868
|
+
return e && (r.set = r.deleteProperty = () => !1), [r, s];
|
|
1869
|
+
}, Ee = (t) => (
|
|
1843
1870
|
// unwrap proxy
|
|
1844
|
-
t[
|
|
1871
|
+
t[pe] || // otherwise
|
|
1845
1872
|
t
|
|
1846
|
-
),
|
|
1847
|
-
if (!
|
|
1873
|
+
), gt = (t, e, s, n) => {
|
|
1874
|
+
if (!mt(t))
|
|
1848
1875
|
return t;
|
|
1849
|
-
let
|
|
1850
|
-
if (!
|
|
1851
|
-
const u =
|
|
1852
|
-
|
|
1876
|
+
let o = n && n.get(t);
|
|
1877
|
+
if (!o) {
|
|
1878
|
+
const u = Ee(t);
|
|
1879
|
+
Vs(u) ? o = [u, Ys(u)] : o = [u], n?.set(t, o);
|
|
1853
1880
|
}
|
|
1854
|
-
const [i,
|
|
1881
|
+
const [i, r] = o;
|
|
1855
1882
|
let a = s && s.get(i);
|
|
1856
|
-
return (!a || a[1][
|
|
1857
|
-
},
|
|
1883
|
+
return (!a || a[1][dt] !== !!r) && (a = Gs(i, !!r), a[1][Le] = Ws(r || i, a[0]), s && s.set(i, a)), a[1][B] = e, a[1][ft] = s, a[1][ht] = n, a[1][Le];
|
|
1884
|
+
}, Xs = (t, e) => {
|
|
1858
1885
|
const s = Reflect.ownKeys(t), n = Reflect.ownKeys(e);
|
|
1859
|
-
return s.length !== n.length || s.some((
|
|
1860
|
-
},
|
|
1861
|
-
if (
|
|
1886
|
+
return s.length !== n.length || s.some((o, i) => o !== n[i]);
|
|
1887
|
+
}, pt = (t, e, s, n, o = Object.is) => {
|
|
1888
|
+
if (o(t, e))
|
|
1862
1889
|
return !1;
|
|
1863
1890
|
if (!z(t) || !z(e))
|
|
1864
1891
|
return !0;
|
|
1865
|
-
const i = s.get(
|
|
1892
|
+
const i = s.get(Ee(t));
|
|
1866
1893
|
if (!i)
|
|
1867
1894
|
return !0;
|
|
1868
1895
|
if (n) {
|
|
@@ -1870,274 +1897,274 @@ const re = Object.getPrototypeOf, oe = /* @__PURE__ */ new WeakMap(), ct = (t) =
|
|
|
1870
1897
|
return !1;
|
|
1871
1898
|
n.set(t, e);
|
|
1872
1899
|
}
|
|
1873
|
-
let
|
|
1874
|
-
for (const a of i[
|
|
1875
|
-
if (
|
|
1876
|
-
return
|
|
1877
|
-
if (i[
|
|
1878
|
-
if (
|
|
1879
|
-
return
|
|
1900
|
+
let r = null;
|
|
1901
|
+
for (const a of i[ye] || [])
|
|
1902
|
+
if (r = Reflect.has(t, a) !== Reflect.has(e, a), r)
|
|
1903
|
+
return r;
|
|
1904
|
+
if (i[M] === !0) {
|
|
1905
|
+
if (r = Xs(t, e), r)
|
|
1906
|
+
return r;
|
|
1880
1907
|
} else
|
|
1881
|
-
for (const a of i[
|
|
1908
|
+
for (const a of i[Te] || []) {
|
|
1882
1909
|
const u = !!Reflect.getOwnPropertyDescriptor(t, a), l = !!Reflect.getOwnPropertyDescriptor(e, a);
|
|
1883
|
-
if (
|
|
1884
|
-
return
|
|
1910
|
+
if (r = u !== l, r)
|
|
1911
|
+
return r;
|
|
1885
1912
|
}
|
|
1886
|
-
for (const a of i[
|
|
1887
|
-
if (
|
|
1888
|
-
return
|
|
1889
|
-
if (
|
|
1913
|
+
for (const a of i[be] || [])
|
|
1914
|
+
if (r = pt(t[a], e[a], s, n, o), r)
|
|
1915
|
+
return r;
|
|
1916
|
+
if (r === null)
|
|
1890
1917
|
throw new Error("invalid used");
|
|
1891
|
-
return
|
|
1892
|
-
},
|
|
1893
|
-
|
|
1894
|
-
},
|
|
1895
|
-
const n = [],
|
|
1896
|
-
var u, l,
|
|
1897
|
-
if (
|
|
1918
|
+
return r;
|
|
1919
|
+
}, Js = (t) => mt(t) && t[pe] || null, _e = (t, e = !0) => {
|
|
1920
|
+
ue.set(t, e);
|
|
1921
|
+
}, Zs = (t, e, s) => {
|
|
1922
|
+
const n = [], o = /* @__PURE__ */ new WeakSet(), i = (r, a) => {
|
|
1923
|
+
var u, l, f;
|
|
1924
|
+
if (o.has(r))
|
|
1898
1925
|
return;
|
|
1899
|
-
z(
|
|
1900
|
-
const
|
|
1901
|
-
if (
|
|
1902
|
-
if ((u =
|
|
1903
|
-
const y = `:has(${String(
|
|
1926
|
+
z(r) && o.add(r);
|
|
1927
|
+
const E = z(r) && e.get(Ee(r));
|
|
1928
|
+
if (E) {
|
|
1929
|
+
if ((u = E[ye]) === null || u === void 0 || u.forEach((h) => {
|
|
1930
|
+
const y = `:has(${String(h)})`;
|
|
1904
1931
|
n.push(a ? [...a, y] : [y]);
|
|
1905
|
-
}),
|
|
1906
|
-
const
|
|
1907
|
-
n.push(a ? [...a,
|
|
1932
|
+
}), E[M] === !0) {
|
|
1933
|
+
const h = ":ownKeys";
|
|
1934
|
+
n.push(a ? [...a, h] : [h]);
|
|
1908
1935
|
} else
|
|
1909
|
-
(l =
|
|
1910
|
-
const y = `:hasOwn(${String(
|
|
1936
|
+
(l = E[Te]) === null || l === void 0 || l.forEach((h) => {
|
|
1937
|
+
const y = `:hasOwn(${String(h)})`;
|
|
1911
1938
|
n.push(a ? [...a, y] : [y]);
|
|
1912
1939
|
});
|
|
1913
|
-
(
|
|
1914
|
-
"value" in (Object.getOwnPropertyDescriptor(
|
|
1940
|
+
(f = E[be]) === null || f === void 0 || f.forEach((h) => {
|
|
1941
|
+
"value" in (Object.getOwnPropertyDescriptor(r, h) || {}) && i(r[h], a ? [...a, h] : [h]);
|
|
1915
1942
|
});
|
|
1916
1943
|
} else a && n.push(a);
|
|
1917
1944
|
};
|
|
1918
1945
|
return i(t), n;
|
|
1919
|
-
},
|
|
1920
|
-
const s =
|
|
1946
|
+
}, q = {}, Se = (t) => typeof t == "object" && t !== null, Qs = (t) => Se(t) && !we.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), yt = (t, e) => {
|
|
1947
|
+
const s = Fe.get(t);
|
|
1921
1948
|
if (s?.[0] === e)
|
|
1922
1949
|
return s[1];
|
|
1923
1950
|
const n = Array.isArray(t) ? [] : Object.create(Object.getPrototypeOf(t));
|
|
1924
|
-
return
|
|
1925
|
-
if (Object.getOwnPropertyDescriptor(n,
|
|
1951
|
+
return _e(n, !0), Fe.set(t, [e, n]), Reflect.ownKeys(t).forEach((o) => {
|
|
1952
|
+
if (Object.getOwnPropertyDescriptor(n, o))
|
|
1926
1953
|
return;
|
|
1927
|
-
const i = Reflect.get(t,
|
|
1954
|
+
const i = Reflect.get(t, o), { enumerable: r } = Reflect.getOwnPropertyDescriptor(
|
|
1928
1955
|
t,
|
|
1929
|
-
|
|
1956
|
+
o
|
|
1930
1957
|
), a = {
|
|
1931
1958
|
value: i,
|
|
1932
|
-
enumerable:
|
|
1959
|
+
enumerable: r,
|
|
1933
1960
|
// This is intentional to avoid copying with proxy-compare.
|
|
1934
1961
|
// It's still non-writable, so it avoids assigning a value.
|
|
1935
1962
|
configurable: !0
|
|
1936
1963
|
};
|
|
1937
|
-
if (
|
|
1938
|
-
|
|
1939
|
-
else if (
|
|
1940
|
-
const [u, l] =
|
|
1964
|
+
if (we.has(i))
|
|
1965
|
+
_e(i, !1);
|
|
1966
|
+
else if (N.has(i)) {
|
|
1967
|
+
const [u, l] = N.get(
|
|
1941
1968
|
i
|
|
1942
1969
|
);
|
|
1943
|
-
a.value =
|
|
1970
|
+
a.value = yt(u, l());
|
|
1944
1971
|
}
|
|
1945
|
-
Object.defineProperty(n,
|
|
1972
|
+
Object.defineProperty(n, o, a);
|
|
1946
1973
|
}), Object.preventExtensions(n);
|
|
1947
|
-
},
|
|
1948
|
-
deleteProperty(
|
|
1949
|
-
const
|
|
1974
|
+
}, en = (t, e, s, n) => ({
|
|
1975
|
+
deleteProperty(o, i) {
|
|
1976
|
+
const r = Reflect.get(o, i);
|
|
1950
1977
|
s(i);
|
|
1951
|
-
const a = Reflect.deleteProperty(
|
|
1952
|
-
return a && n(["delete", [i],
|
|
1978
|
+
const a = Reflect.deleteProperty(o, i);
|
|
1979
|
+
return a && n(["delete", [i], r]), a;
|
|
1953
1980
|
},
|
|
1954
|
-
set(
|
|
1955
|
-
const u = !t() && Reflect.has(
|
|
1956
|
-
if (u && (
|
|
1981
|
+
set(o, i, r, a) {
|
|
1982
|
+
const u = !t() && Reflect.has(o, i), l = Reflect.get(o, i, a);
|
|
1983
|
+
if (u && (He(l, r) || K.has(r) && He(l, K.get(r))))
|
|
1957
1984
|
return !0;
|
|
1958
|
-
s(i),
|
|
1959
|
-
const
|
|
1960
|
-
return e(i,
|
|
1961
|
-
}
|
|
1962
|
-
}),
|
|
1963
|
-
let
|
|
1964
|
-
function
|
|
1965
|
-
if (!
|
|
1985
|
+
s(i), Se(r) && (r = Js(r) || r);
|
|
1986
|
+
const f = !N.has(r) && sn(r) ? Tt(r) : r;
|
|
1987
|
+
return e(i, f), Reflect.set(o, i, f, a), n(["set", [i], r, l]), !0;
|
|
1988
|
+
}
|
|
1989
|
+
}), N = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakSet(), Fe = /* @__PURE__ */ new WeakMap(), ne = [1], K = /* @__PURE__ */ new WeakMap();
|
|
1990
|
+
let He = Object.is, tn = (t, e) => new Proxy(t, e), sn = Qs, nn = yt, on = en;
|
|
1991
|
+
function Tt(t = {}) {
|
|
1992
|
+
if (!Se(t))
|
|
1966
1993
|
throw new Error("object required");
|
|
1967
|
-
const e =
|
|
1994
|
+
const e = K.get(t);
|
|
1968
1995
|
if (e)
|
|
1969
1996
|
return e;
|
|
1970
|
-
let s =
|
|
1971
|
-
const n = /* @__PURE__ */ new Set(),
|
|
1972
|
-
s !==
|
|
1997
|
+
let s = ne[0];
|
|
1998
|
+
const n = /* @__PURE__ */ new Set(), o = (g, T = ++ne[0]) => {
|
|
1999
|
+
s !== T && (i = s = T, n.forEach((m) => m(g, T)));
|
|
1973
2000
|
};
|
|
1974
2001
|
let i = s;
|
|
1975
|
-
const
|
|
1976
|
-
const
|
|
1977
|
-
|
|
1978
|
-
})), s), a = (
|
|
1979
|
-
const
|
|
1980
|
-
|
|
1981
|
-
}, u = /* @__PURE__ */ new Map(), l = (
|
|
1982
|
-
const
|
|
1983
|
-
if (
|
|
1984
|
-
if ((
|
|
2002
|
+
const r = (g = ne[0]) => (i !== g && (i = g, u.forEach(([T]) => {
|
|
2003
|
+
const m = T[1](g);
|
|
2004
|
+
m > s && (s = m);
|
|
2005
|
+
})), s), a = (g) => (T, m) => {
|
|
2006
|
+
const A = [...T];
|
|
2007
|
+
A[1] = [g, ...A[1]], o(A, m);
|
|
2008
|
+
}, u = /* @__PURE__ */ new Map(), l = (g, T) => {
|
|
2009
|
+
const m = !we.has(T) && N.get(T);
|
|
2010
|
+
if (m) {
|
|
2011
|
+
if ((q ? "production" : void 0) !== "production" && u.has(g))
|
|
1985
2012
|
throw new Error("prop listener already exists");
|
|
1986
2013
|
if (n.size) {
|
|
1987
|
-
const
|
|
1988
|
-
u.set(
|
|
2014
|
+
const A = m[2](a(g));
|
|
2015
|
+
u.set(g, [m, A]);
|
|
1989
2016
|
} else
|
|
1990
|
-
u.set(
|
|
2017
|
+
u.set(g, [m]);
|
|
1991
2018
|
}
|
|
1992
|
-
},
|
|
1993
|
-
var
|
|
1994
|
-
const
|
|
1995
|
-
|
|
1996
|
-
},
|
|
1997
|
-
if ((
|
|
2019
|
+
}, f = (g) => {
|
|
2020
|
+
var T;
|
|
2021
|
+
const m = u.get(g);
|
|
2022
|
+
m && (u.delete(g), (T = m[1]) == null || T.call(m));
|
|
2023
|
+
}, E = (g) => (n.add(g), n.size === 1 && u.forEach(([m, A], C) => {
|
|
2024
|
+
if ((q ? "production" : void 0) !== "production" && A)
|
|
1998
2025
|
throw new Error("remove already exists");
|
|
1999
|
-
const
|
|
2000
|
-
u.set(
|
|
2026
|
+
const D = m[2](a(C));
|
|
2027
|
+
u.set(C, [m, D]);
|
|
2001
2028
|
}), () => {
|
|
2002
|
-
n.delete(
|
|
2003
|
-
|
|
2029
|
+
n.delete(g), n.size === 0 && u.forEach(([m, A], C) => {
|
|
2030
|
+
A && (A(), u.set(C, [m]));
|
|
2004
2031
|
});
|
|
2005
2032
|
});
|
|
2006
|
-
let
|
|
2007
|
-
const y =
|
|
2008
|
-
() =>
|
|
2033
|
+
let h = !0;
|
|
2034
|
+
const y = on(
|
|
2035
|
+
() => h,
|
|
2009
2036
|
l,
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
), R =
|
|
2013
|
-
|
|
2014
|
-
const
|
|
2015
|
-
return
|
|
2016
|
-
const
|
|
2037
|
+
f,
|
|
2038
|
+
o
|
|
2039
|
+
), R = tn(t, y);
|
|
2040
|
+
K.set(t, R);
|
|
2041
|
+
const V = [t, r, E];
|
|
2042
|
+
return N.set(R, V), Reflect.ownKeys(t).forEach((g) => {
|
|
2043
|
+
const T = Object.getOwnPropertyDescriptor(
|
|
2017
2044
|
t,
|
|
2018
|
-
|
|
2045
|
+
g
|
|
2019
2046
|
);
|
|
2020
|
-
"value" in
|
|
2021
|
-
}),
|
|
2022
|
-
}
|
|
2023
|
-
function
|
|
2024
|
-
const n =
|
|
2025
|
-
(
|
|
2026
|
-
let
|
|
2027
|
-
const i = [],
|
|
2047
|
+
"value" in T && T.writable && (R[g] = t[g]);
|
|
2048
|
+
}), h = !1, R;
|
|
2049
|
+
}
|
|
2050
|
+
function rn(t, e, s) {
|
|
2051
|
+
const n = N.get(t);
|
|
2052
|
+
(q ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
|
|
2053
|
+
let o;
|
|
2054
|
+
const i = [], r = n[2];
|
|
2028
2055
|
let a = !1;
|
|
2029
|
-
const l =
|
|
2030
|
-
i.push(
|
|
2031
|
-
|
|
2056
|
+
const l = r((f) => {
|
|
2057
|
+
i.push(f), o || (o = Promise.resolve().then(() => {
|
|
2058
|
+
o = void 0, a && e(i.splice(0));
|
|
2032
2059
|
}));
|
|
2033
2060
|
});
|
|
2034
2061
|
return a = !0, () => {
|
|
2035
2062
|
a = !1, l();
|
|
2036
2063
|
};
|
|
2037
2064
|
}
|
|
2038
|
-
function
|
|
2039
|
-
const e =
|
|
2040
|
-
(
|
|
2065
|
+
function $e(t) {
|
|
2066
|
+
const e = N.get(t);
|
|
2067
|
+
(q ? "production" : void 0) !== "production" && !e && console.warn("Please use proxy object");
|
|
2041
2068
|
const [s, n] = e;
|
|
2042
|
-
return
|
|
2069
|
+
return nn(s, n());
|
|
2043
2070
|
}
|
|
2044
|
-
const
|
|
2045
|
-
const s =
|
|
2071
|
+
const an = {}, cn = (t, e) => {
|
|
2072
|
+
const s = le(void 0);
|
|
2046
2073
|
x(() => {
|
|
2047
|
-
s.current =
|
|
2048
|
-
}),
|
|
2049
|
-
},
|
|
2050
|
-
function
|
|
2051
|
-
const n =
|
|
2074
|
+
s.current = Zs(t, e);
|
|
2075
|
+
}), wt(s.current);
|
|
2076
|
+
}, un = cn, ln = /* @__PURE__ */ new WeakMap();
|
|
2077
|
+
function dn(t, e) {
|
|
2078
|
+
const n = Ce(
|
|
2052
2079
|
() => t && /* @__PURE__ */ new WeakMap(),
|
|
2053
2080
|
[t]
|
|
2054
|
-
),
|
|
2081
|
+
), o = le(void 0);
|
|
2055
2082
|
let i = !0;
|
|
2056
|
-
const
|
|
2057
|
-
|
|
2083
|
+
const r = bt(
|
|
2084
|
+
Et(
|
|
2058
2085
|
(u) => {
|
|
2059
|
-
const l =
|
|
2086
|
+
const l = rn(t, u);
|
|
2060
2087
|
return u(), l;
|
|
2061
2088
|
},
|
|
2062
2089
|
[t, void 0]
|
|
2063
2090
|
),
|
|
2064
2091
|
() => {
|
|
2065
|
-
const u =
|
|
2092
|
+
const u = $e(t);
|
|
2066
2093
|
try {
|
|
2067
|
-
if (!i &&
|
|
2068
|
-
|
|
2094
|
+
if (!i && o.current && !pt(
|
|
2095
|
+
o.current,
|
|
2069
2096
|
u,
|
|
2070
2097
|
n,
|
|
2071
2098
|
/* @__PURE__ */ new WeakMap()
|
|
2072
2099
|
))
|
|
2073
|
-
return
|
|
2100
|
+
return o.current;
|
|
2074
2101
|
} catch {
|
|
2075
2102
|
}
|
|
2076
2103
|
return u;
|
|
2077
2104
|
},
|
|
2078
|
-
() =>
|
|
2105
|
+
() => $e(t)
|
|
2079
2106
|
);
|
|
2080
|
-
i = !1,
|
|
2081
|
-
|
|
2082
|
-
}), (
|
|
2083
|
-
const a =
|
|
2084
|
-
return
|
|
2107
|
+
i = !1, St(() => {
|
|
2108
|
+
o.current = r;
|
|
2109
|
+
}), (an ? "production" : void 0) !== "production" && un(r, n);
|
|
2110
|
+
const a = Ce(() => /* @__PURE__ */ new WeakMap(), []);
|
|
2111
|
+
return gt(r, n, a, ln);
|
|
2085
2112
|
}
|
|
2086
|
-
const
|
|
2113
|
+
const v = Tt({
|
|
2087
2114
|
data: null,
|
|
2088
2115
|
isPending: !1,
|
|
2089
2116
|
error: null
|
|
2090
2117
|
});
|
|
2091
|
-
function
|
|
2118
|
+
function yn({
|
|
2092
2119
|
session_url: t,
|
|
2093
2120
|
onCancel: e,
|
|
2094
2121
|
onSuccess: s
|
|
2095
2122
|
}) {
|
|
2096
|
-
const n =
|
|
2097
|
-
function
|
|
2123
|
+
const n = dn(v), [o, i] = k(!1), [r, a] = k(Date.now()), u = n?.data?.sessionToken, l = n?.data?.amount;
|
|
2124
|
+
function f() {
|
|
2098
2125
|
u || window.setTimeout(() => {
|
|
2099
2126
|
u && i(!0);
|
|
2100
2127
|
}, 200), i(!0);
|
|
2101
2128
|
}
|
|
2102
|
-
function
|
|
2129
|
+
function E() {
|
|
2103
2130
|
i(!1);
|
|
2104
2131
|
}
|
|
2105
|
-
const
|
|
2132
|
+
const h = () => {
|
|
2106
2133
|
const y = Date.now();
|
|
2107
|
-
|
|
2134
|
+
v.isPending = !0, v.error = null, v.data = null, fetch(t, {
|
|
2108
2135
|
headers: {
|
|
2109
2136
|
"Content-Type": "application/json"
|
|
2110
2137
|
}
|
|
2111
2138
|
}).then((R) => R.json()).then((R) => {
|
|
2112
|
-
y <
|
|
2139
|
+
y < r || (v.data = R, v.isPending = !1, a(y));
|
|
2113
2140
|
}).catch((R) => {
|
|
2114
|
-
y <
|
|
2141
|
+
y < r || (v.error = R?.toString(), v.isPending = !1, a(y), setInterval(h, 5e3));
|
|
2115
2142
|
});
|
|
2116
2143
|
};
|
|
2117
2144
|
return x(() => {
|
|
2118
|
-
|
|
2145
|
+
h();
|
|
2119
2146
|
}, [t]), {
|
|
2120
2147
|
sessionToken: u,
|
|
2121
2148
|
amount: l,
|
|
2122
|
-
isOpen:
|
|
2149
|
+
isOpen: o,
|
|
2123
2150
|
session_url: t,
|
|
2124
|
-
open:
|
|
2125
|
-
close:
|
|
2151
|
+
open: f,
|
|
2152
|
+
close: E,
|
|
2126
2153
|
isPending: n.isPending,
|
|
2127
2154
|
error: n.error,
|
|
2128
|
-
refetch:
|
|
2155
|
+
refetch: h,
|
|
2129
2156
|
onSuccess: s,
|
|
2130
2157
|
onCancel: e
|
|
2131
2158
|
};
|
|
2132
2159
|
}
|
|
2133
|
-
function
|
|
2160
|
+
function Tn({
|
|
2134
2161
|
sessionToken: t,
|
|
2135
2162
|
amount: e,
|
|
2136
2163
|
onCancel: s,
|
|
2137
2164
|
onSuccess: n
|
|
2138
2165
|
}) {
|
|
2139
|
-
const [
|
|
2140
|
-
function
|
|
2166
|
+
const [o, i] = k(!1), [r, a] = k(t), [u, l] = k(e);
|
|
2167
|
+
function f({
|
|
2141
2168
|
sessionToken: y,
|
|
2142
2169
|
amount: R
|
|
2143
2170
|
}) {
|
|
@@ -2146,31 +2173,31 @@ function hn({
|
|
|
2146
2173
|
x(() => {
|
|
2147
2174
|
a(t);
|
|
2148
2175
|
}, [t]);
|
|
2149
|
-
function
|
|
2150
|
-
|
|
2151
|
-
|
|
2176
|
+
function E() {
|
|
2177
|
+
r || window.setTimeout(() => {
|
|
2178
|
+
r && i(!0);
|
|
2152
2179
|
}, 200), i(!0);
|
|
2153
2180
|
}
|
|
2154
|
-
function
|
|
2181
|
+
function h() {
|
|
2155
2182
|
i(!1);
|
|
2156
2183
|
}
|
|
2157
2184
|
return {
|
|
2158
|
-
sessionToken:
|
|
2159
|
-
updateSession:
|
|
2185
|
+
sessionToken: r,
|
|
2186
|
+
updateSession: f,
|
|
2160
2187
|
amount: u,
|
|
2161
|
-
isOpen:
|
|
2162
|
-
open:
|
|
2163
|
-
close:
|
|
2188
|
+
isOpen: o,
|
|
2189
|
+
open: E,
|
|
2190
|
+
close: h,
|
|
2164
2191
|
onSuccess: n,
|
|
2165
2192
|
onCancel: s
|
|
2166
2193
|
};
|
|
2167
2194
|
}
|
|
2168
2195
|
export {
|
|
2169
2196
|
c as AmountSymbols,
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2197
|
+
d as Chainrails,
|
|
2198
|
+
mn as Chains,
|
|
2199
|
+
pn as PaymentModal,
|
|
2200
|
+
gn as crapi,
|
|
2201
|
+
Tn as usePaymentModal,
|
|
2202
|
+
yn as usePaymentSession
|
|
2176
2203
|
};
|