@argent/x-shared 1.32.5 → 1.32.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/index.mjs +1047 -1044
- package/dist/onchainRecovery/schema.d.ts +9 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import F, { z as h } from "zod";
|
|
2
|
-
import { p as xt, H as K, a as
|
|
3
|
-
import { am as
|
|
4
|
-
import { constants as Z, starknetId as
|
|
5
|
-
import { useEffect as Yt, useRef as
|
|
6
|
-
import { isFunction as zt, isString as
|
|
7
|
-
import ae, { useSWRConfig as
|
|
8
|
-
import { hex as
|
|
9
|
-
import { UAParser as
|
|
10
|
-
import { validateMnemonic as
|
|
11
|
-
import { wordlist as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
2
|
+
import { p as xt, H as K, a as tn, u as k, N as Un, c as jr, C as jn, A as St, i as Lr, b as Dr, n as Ln, d as Hr, e as Vr, f as Mr, g as Gr, s as Q, h as nt, j as en, k as zr, S as qr, l as nn, M as rn, m as Wr, o as Kr, q as Dn, r as Zr, t as se, B as sn, v as oe, w as Pt, x as Yr, y as Xr, z as Jr, D as Qr, E as ts, F as es, T as ns, G as Re, I as Hn, J as rs, K as ye, L as ss, O as os, P as as, Q as is, R as _t } from "./transactionVersion-DLjpblNo.mjs";
|
|
3
|
+
import { am as Ad, aV as xd, bN as vd, aX as Id, aT as Td, an as Bd, af as _d, ah as Nd, ag as Cd, ai as Od, bs as kd, bA as Pd, bg as Rd, bk as $d, a9 as Fd, aa as Ud, a5 as jd, a4 as Ld, Z as Dd, W as Hd, X as Vd, Y as Md, aM as Gd, az as zd, au as qd, av as Wd, as as Kd, at as Zd, ax as Yd, aw as Xd, ay as Jd, ar as Qd, aq as tf, ap as ef, ao as nf, aA as rf, aj as sf, ab as of, b1 as af, b5 as cf, b3 as lf, bn as uf, bC as df, bx as ff, bI as hf, ae as pf, bc as mf, b7 as gf, be as wf, bj as yf, aD as bf, aE as Sf, aF as Ef, bK as Af, bJ as xf, bG as vf, bq as If, aB as Tf, aC as Bf, bo as _f, aK as Nf, aG as Cf, aL as Of, aI as kf, aJ as Pf, b0 as Rf, bp as $f, bf as Ff, bz as Uf, bv as jf, bm as Lf, bd as Df, aY as Hf, $ as Vf, _ as Mf, a1 as Gf, a2 as zf, bu as qf, bt as Wf, aS as Kf, aZ as Zf, b2 as Yf, a0 as Xf, aP as Jf, ac as Qf, a7 as th, ak as eh, a6 as nh, aQ as rh, bB as sh, bw as oh, aU as ah, b9 as ih, a8 as ch, ad as lh, al as uh, aO as dh, aH as fh, br as hh, bH as ph, b8 as mh, ba as gh, bb as wh, bh as yh, bl as bh, bi as Sh, bE as Eh, bF as Ah, bD as xh, a3 as vh, b4 as Ih, by as Th, aW as Bh, a_ as _h, aR as Nh, a$ as Ch, b6 as Oh, aN as kh, bP as Ph, bO as Rh, bL as $h, bQ as Fh, bM as Uh, U as jh, V as Lh } from "./transactionVersion-DLjpblNo.mjs";
|
|
4
|
+
import { constants as Z, starknetId as Vn, CallData as mt, CairoOption as on, CairoOptionVariant as an, hash as Mn, num as O, encode as $t, uint256 as Dt, ec as cs, isSierra as ls, TransactionType as cn } from "starknet";
|
|
5
|
+
import { useEffect as Yt, useRef as ln, useState as us, useMemo as vt, useCallback as Gn } from "react";
|
|
6
|
+
import { isFunction as zt, isString as zn, upperCase as $e, isNil as ds, upperFirst as fs, lowerCase as qn, isUndefined as hs, isEmpty as un, isArray as ps } from "lodash-es";
|
|
7
|
+
import ae, { useSWRConfig as ms } from "swr";
|
|
8
|
+
import { hex as Wn, base58 as Kn, stringToBytes as gs } from "@scure/base";
|
|
9
|
+
import { UAParser as ws } from "ua-parser-js";
|
|
10
|
+
import { validateMnemonic as ys } from "@scure/bip39";
|
|
11
|
+
import { wordlist as bs } from "@scure/bip39/wordlists/english";
|
|
12
|
+
import Ss from "object-hash";
|
|
13
|
+
const Es = h.object({
|
|
14
14
|
name: h.string().optional(),
|
|
15
15
|
address: h.string(),
|
|
16
16
|
ownerAddress: h.string(),
|
|
@@ -35,11 +35,11 @@ const Ss = h.object({
|
|
|
35
35
|
guid: h.string().optional(),
|
|
36
36
|
signerType: h.enum(["StarknetKey", "EthereumKey"]).optional()
|
|
37
37
|
}).optional()
|
|
38
|
-
}),
|
|
38
|
+
}), Il = h.object({
|
|
39
39
|
address: h.string(),
|
|
40
40
|
guardianAddress: h.string().optional(),
|
|
41
|
-
account:
|
|
42
|
-
}),
|
|
41
|
+
account: Es
|
|
42
|
+
}), Tl = h.object({
|
|
43
43
|
ownerAddress: h.string(),
|
|
44
44
|
signature: h.object({
|
|
45
45
|
r: h.string(),
|
|
@@ -49,27 +49,27 @@ const Ss = h.object({
|
|
|
49
49
|
name: h.string().optional(),
|
|
50
50
|
icon: h.string().optional()
|
|
51
51
|
});
|
|
52
|
-
function
|
|
52
|
+
function Bl(t) {
|
|
53
53
|
return "transactionVersion" in t;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function _l(t) {
|
|
56
56
|
return "simulateTransaction" in t;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Nl(t) {
|
|
59
59
|
return !("simulateTransaction" in t);
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const As = h.object({
|
|
62
62
|
value: h.string(),
|
|
63
63
|
platform: h.enum(["ios", "argentx", "android", "webwallet"]).nullable()
|
|
64
|
-
}),
|
|
65
|
-
preferences: h.record(
|
|
66
|
-
}),
|
|
67
|
-
function Cl(t) {
|
|
68
|
-
return As.safeParse(t).success;
|
|
69
|
-
}
|
|
64
|
+
}), Cl = h.object({
|
|
65
|
+
preferences: h.record(As)
|
|
66
|
+
}), xs = h.enum(["mainnet-alpha", "sepolia-alpha"]), vs = h.enum(["mainnet", "sepolia"]);
|
|
70
67
|
function Ol(t) {
|
|
71
68
|
return xs.safeParse(t).success;
|
|
72
69
|
}
|
|
70
|
+
function kl(t) {
|
|
71
|
+
return vs.safeParse(t).success;
|
|
72
|
+
}
|
|
73
73
|
const Ht = 18;
|
|
74
74
|
function Vt({ value: t, decimals: e }) {
|
|
75
75
|
if (e === 0)
|
|
@@ -79,100 +79,100 @@ function Vt({ value: t, decimals: e }) {
|
|
|
79
79
|
const r = t.toString().padStart(e, "0"), s = r.slice(0, -e) || "0", o = r.slice(-e).replace(/0+$/, "");
|
|
80
80
|
return `${n ? "-" : ""}${s}${o ? `.${o}` : ""}`;
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const Fe = (t, e) => ({
|
|
83
83
|
decimals: e,
|
|
84
84
|
value: e >= t.decimals ? t.value * BigInt(10) ** BigInt(e - t.decimals) : t.value / BigInt(10) ** BigInt(t.decimals - e)
|
|
85
|
-
}),
|
|
85
|
+
}), Zn = (t) => {
|
|
86
86
|
const e = t.value.toString().split("").reverse();
|
|
87
87
|
let n = 0;
|
|
88
88
|
for (let s = 0; s < e.length && e[s] === "0"; s++)
|
|
89
89
|
n++;
|
|
90
90
|
const r = t.decimals - n;
|
|
91
|
-
return
|
|
92
|
-
},
|
|
93
|
-
const n = Math.max(t.decimals, e.decimals), [r, s] = [t, e].map((o) =>
|
|
91
|
+
return Fe(t, r);
|
|
92
|
+
}, Yn = (t, e) => {
|
|
93
|
+
const n = Math.max(t.decimals, e.decimals), [r, s] = [t, e].map((o) => Fe(o, n));
|
|
94
94
|
return [r.value, s.value, n];
|
|
95
95
|
}, ie = (t) => (e, n) => {
|
|
96
|
-
const [r, s, o] =
|
|
96
|
+
const [r, s, o] = Yn(e, n);
|
|
97
97
|
return {
|
|
98
98
|
decimals: o,
|
|
99
99
|
value: t(r, s, o)
|
|
100
100
|
};
|
|
101
101
|
}, Mt = (t) => (e, n) => {
|
|
102
|
-
const [r, s] =
|
|
102
|
+
const [r, s] = Yn(e, n);
|
|
103
103
|
return t(r, s);
|
|
104
|
-
},
|
|
104
|
+
}, Is = ie((t, e) => t + e), Ts = ie((t, e) => t - e), Bs = ie((t, e, n) => {
|
|
105
105
|
if (e === BigInt(0))
|
|
106
106
|
throw new Error("Division by zero is not allowed");
|
|
107
107
|
return t * BigInt(10) ** BigInt(n) / e;
|
|
108
|
-
}),
|
|
108
|
+
}), _s = (t, e) => Zn({
|
|
109
109
|
decimals: t.decimals + e.decimals,
|
|
110
110
|
value: t.value * e.value
|
|
111
|
-
}),
|
|
111
|
+
}), Ns = ie((t, e) => {
|
|
112
112
|
if (e === BigInt(0))
|
|
113
113
|
throw new Error("Modulus by zero is not allowed");
|
|
114
114
|
return t % e;
|
|
115
|
-
}),
|
|
115
|
+
}), Ue = (t) => ({
|
|
116
116
|
decimals: t.decimals,
|
|
117
117
|
value: t.value >= BigInt(0) ? t.value : -t.value
|
|
118
|
-
}),
|
|
119
|
-
function
|
|
118
|
+
}), Xn = Mt((t, e) => t === e), Cs = Mt((t, e) => t < e), Os = Mt((t, e) => t > e), ks = Mt((t, e) => t <= e), Ps = Mt((t, e) => t >= e), Rs = (t, e) => !Xn(t, e);
|
|
119
|
+
function $s(t) {
|
|
120
120
|
return Vt({ value: t, decimals: Ht });
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Fs(t) {
|
|
123
123
|
return xt(t, Ht);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Us(t) {
|
|
126
126
|
return Vt({ value: t, decimals: Ht });
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function je(t) {
|
|
129
129
|
return xt(t, Ht);
|
|
130
130
|
}
|
|
131
|
-
function Us(t) {
|
|
132
|
-
return Fe({ value: t, decimals: 0 }).value;
|
|
133
|
-
}
|
|
134
131
|
function js(t) {
|
|
135
|
-
return
|
|
132
|
+
return Ue({ value: t, decimals: 0 }).value;
|
|
133
|
+
}
|
|
134
|
+
function Ls(t) {
|
|
135
|
+
return Ue(je(t));
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function Ds(t, e) {
|
|
138
138
|
return {
|
|
139
139
|
value: BigInt(t),
|
|
140
140
|
decimals: e
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
function
|
|
143
|
+
const Hs = { value: 1n, decimals: 0 };
|
|
144
|
+
function Vs(t) {
|
|
145
145
|
return h.string().refine((e) => /^-?\d+(\.\d+)?$/.test(e), { message: "Invalid number format" }).transform((e) => xt(e, t));
|
|
146
146
|
}
|
|
147
|
-
const
|
|
147
|
+
const Pl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
148
148
|
__proto__: null,
|
|
149
|
-
ONE:
|
|
150
|
-
abs:
|
|
151
|
-
absBigInt:
|
|
152
|
-
add:
|
|
153
|
-
createUnitsSchema:
|
|
154
|
-
div:
|
|
155
|
-
eq:
|
|
156
|
-
formatCurrency:
|
|
157
|
-
formatEther:
|
|
149
|
+
ONE: Hs,
|
|
150
|
+
abs: Ue,
|
|
151
|
+
absBigInt: js,
|
|
152
|
+
add: Is,
|
|
153
|
+
createUnitsSchema: Vs,
|
|
154
|
+
div: Bs,
|
|
155
|
+
eq: Xn,
|
|
156
|
+
formatCurrency: Us,
|
|
157
|
+
formatEther: $s,
|
|
158
158
|
formatUnits: Vt,
|
|
159
|
-
gt:
|
|
160
|
-
gte:
|
|
161
|
-
lt:
|
|
162
|
-
lte:
|
|
163
|
-
mod:
|
|
164
|
-
mul:
|
|
165
|
-
not:
|
|
166
|
-
parseCurrency:
|
|
167
|
-
parseCurrencyAbs:
|
|
168
|
-
parseEther:
|
|
159
|
+
gt: Os,
|
|
160
|
+
gte: Ps,
|
|
161
|
+
lt: Cs,
|
|
162
|
+
lte: ks,
|
|
163
|
+
mod: Ns,
|
|
164
|
+
mul: _s,
|
|
165
|
+
not: Rs,
|
|
166
|
+
parseCurrency: je,
|
|
167
|
+
parseCurrencyAbs: Ls,
|
|
168
|
+
parseEther: Fs,
|
|
169
169
|
parseUnits: xt,
|
|
170
|
-
sub:
|
|
171
|
-
toBigDecimal:
|
|
172
|
-
toFixedDecimals:
|
|
173
|
-
toTiniestPossibleDecimal:
|
|
170
|
+
sub: Ts,
|
|
171
|
+
toBigDecimal: Ds,
|
|
172
|
+
toFixedDecimals: Fe,
|
|
173
|
+
toTiniestPossibleDecimal: Zn
|
|
174
174
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
175
|
-
class
|
|
175
|
+
class Rl {
|
|
176
176
|
constructor(e, n) {
|
|
177
177
|
this.cachePromise = n.open(e).catch((r) => (console.error(new Error("Failed to open cache", { cause: r })), null));
|
|
178
178
|
}
|
|
@@ -206,7 +206,7 @@ class Pl {
|
|
|
206
206
|
await Promise.allSettled(n.map((r) => e.delete(r)));
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
class
|
|
209
|
+
class $l {
|
|
210
210
|
constructor(e, n) {
|
|
211
211
|
this.httpService = e, this.baseUrl = n, this.offsetInS = 0, this.syncIntervalInMs = 60 * 1e3, this.initialSync = this.syncWithServer(), setInterval(() => void this.syncWithServer(), this.syncIntervalInMs);
|
|
212
212
|
}
|
|
@@ -220,7 +220,7 @@ class Rl {
|
|
|
220
220
|
this.offsetInS = r;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
class
|
|
223
|
+
class Le {
|
|
224
224
|
constructor(e, n = "json") {
|
|
225
225
|
this.requestInit = e, this.responseType = n;
|
|
226
226
|
}
|
|
@@ -235,7 +235,7 @@ class je {
|
|
|
235
235
|
...n == null ? void 0 : n.headers
|
|
236
236
|
}
|
|
237
237
|
}, o = await fetch(e, s).catch(() => {
|
|
238
|
-
throw new K(
|
|
238
|
+
throw new K(tn.FAILED_TO_FETCH_URL, 0);
|
|
239
239
|
});
|
|
240
240
|
if (this.responseType === "json") {
|
|
241
241
|
if (!o.ok)
|
|
@@ -255,7 +255,7 @@ class je {
|
|
|
255
255
|
...n == null ? void 0 : n.headers
|
|
256
256
|
}
|
|
257
257
|
}, a = await fetch(e, o).catch(() => {
|
|
258
|
-
throw new K(
|
|
258
|
+
throw new K(tn.FAILED_TO_POST_URL, 0);
|
|
259
259
|
});
|
|
260
260
|
if (!a.ok)
|
|
261
261
|
throw new K(a.statusText, a.status, await a.json());
|
|
@@ -307,7 +307,7 @@ class je {
|
|
|
307
307
|
const qt = (t) => {
|
|
308
308
|
process.env.NODE_ENV;
|
|
309
309
|
};
|
|
310
|
-
function
|
|
310
|
+
function Ms(t, e) {
|
|
311
311
|
const n = t.clone(), r = new Headers(n.headers);
|
|
312
312
|
for (const [s, o] of Object.entries(e))
|
|
313
313
|
r.set(s, o);
|
|
@@ -317,7 +317,7 @@ function Vs(t, e) {
|
|
|
317
317
|
headers: r
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
|
-
class
|
|
320
|
+
class Fl {
|
|
321
321
|
constructor(e, n, r, s) {
|
|
322
322
|
this.dateService = e, this.cacheService = n, this.httpService = r, this.options = s, this.inFlightRequests = /* @__PURE__ */ new Map();
|
|
323
323
|
}
|
|
@@ -344,7 +344,7 @@ class $l {
|
|
|
344
344
|
if (!r) {
|
|
345
345
|
const s = this.httpService.get(e, n).then(async (o) => {
|
|
346
346
|
const a = await this.dateService.now();
|
|
347
|
-
return await this.cacheService.set(e,
|
|
347
|
+
return await this.cacheService.set(e, Ms(o, {
|
|
348
348
|
date: a.toUTCString()
|
|
349
349
|
})), o;
|
|
350
350
|
}).finally(() => {
|
|
@@ -369,7 +369,7 @@ const Xt = (t, e, n) => {
|
|
|
369
369
|
} catch {
|
|
370
370
|
}
|
|
371
371
|
return r;
|
|
372
|
-
},
|
|
372
|
+
}, Jn = async (t, e) => {
|
|
373
373
|
const n = await fetch(t, e), r = await n.text();
|
|
374
374
|
if (!n.ok)
|
|
375
375
|
throw Xt("An error occurred while fetching", n, r);
|
|
@@ -378,7 +378,7 @@ const Xt = (t, e, n) => {
|
|
|
378
378
|
} catch {
|
|
379
379
|
throw Xt("An error occurred while parsing", n, r);
|
|
380
380
|
}
|
|
381
|
-
},
|
|
381
|
+
}, Ul = async (t, e) => {
|
|
382
382
|
const n = await fetch(t, {
|
|
383
383
|
method: "POST",
|
|
384
384
|
...e
|
|
@@ -390,38 +390,38 @@ const Xt = (t, e, n) => {
|
|
|
390
390
|
} catch {
|
|
391
391
|
throw Xt("An error occurred while parsing", n, r);
|
|
392
392
|
}
|
|
393
|
-
},
|
|
393
|
+
}, jl = (t) => ({
|
|
394
394
|
refreshInterval: t,
|
|
395
395
|
dedupingInterval: t
|
|
396
|
-
}),
|
|
396
|
+
}), Ll = (t) => `${t.networkId}::${t.address}`, Gs = () => {
|
|
397
397
|
};
|
|
398
|
-
function
|
|
399
|
-
const { cache: s } =
|
|
398
|
+
function zs(t, e, n, r) {
|
|
399
|
+
const { cache: s } = ms(), o = ae(t && e, t ? n : Gs, r);
|
|
400
400
|
return Yt(() => {
|
|
401
401
|
t || (o.mutate(), s.delete(e));
|
|
402
402
|
}, [t]), o;
|
|
403
403
|
}
|
|
404
|
-
const
|
|
404
|
+
const Dl = {
|
|
405
405
|
revalidateOnFocus: !1,
|
|
406
406
|
revalidateOnMount: !0,
|
|
407
407
|
revalidateOnReconnect: !1,
|
|
408
408
|
refreshWhenOffline: !1,
|
|
409
409
|
refreshWhenHidden: !1,
|
|
410
410
|
refreshInterval: 0
|
|
411
|
-
},
|
|
411
|
+
}, qs = async (t, e) => {
|
|
412
412
|
try {
|
|
413
|
-
const { time: n } = await
|
|
413
|
+
const { time: n } = await Jn(k(t, "time"), {
|
|
414
414
|
headers: e
|
|
415
415
|
});
|
|
416
416
|
return n;
|
|
417
417
|
} catch {
|
|
418
418
|
throw new Error("failed to request time");
|
|
419
419
|
}
|
|
420
|
-
},
|
|
421
|
-
const n = await
|
|
420
|
+
}, Hl = async (t, e) => {
|
|
421
|
+
const n = await qs(t, e);
|
|
422
422
|
return Math.floor(n);
|
|
423
423
|
};
|
|
424
|
-
function
|
|
424
|
+
function Ws(t) {
|
|
425
425
|
switch (t) {
|
|
426
426
|
case "mainnet-alpha":
|
|
427
427
|
case Z.NetworkName.SN_MAIN:
|
|
@@ -430,45 +430,45 @@ function qs(t) {
|
|
|
430
430
|
case Z.NetworkName.SN_SEPOLIA:
|
|
431
431
|
return Z.StarknetChainId.SN_SEPOLIA;
|
|
432
432
|
default:
|
|
433
|
-
throw new
|
|
433
|
+
throw new Un({
|
|
434
434
|
code: "NOT_FOUND",
|
|
435
435
|
message: `Unknown networkId: ${t}`
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
function Ws(t) {
|
|
440
|
-
return t.replace(".stark", "").split(".").map((r) => Hn.useEncoded(r).toString(10));
|
|
441
|
-
}
|
|
442
439
|
function Ks(t) {
|
|
443
|
-
|
|
444
|
-
|
|
440
|
+
return t.replace(".stark", "").split(".").map((r) => Vn.useEncoded(r).toString(10));
|
|
441
|
+
}
|
|
442
|
+
function Zs(t) {
|
|
443
|
+
const e = Ws(t);
|
|
444
|
+
return Vn.getStarknetIdContract(e);
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
const n =
|
|
446
|
+
function Ys(t, e) {
|
|
447
|
+
const n = Zs(e), r = Ks(t);
|
|
448
448
|
try {
|
|
449
449
|
const o = { domain: r, hint: [] };
|
|
450
|
-
return
|
|
450
|
+
return jr.parse({
|
|
451
451
|
contractAddress: n,
|
|
452
452
|
entrypoint: "domain_to_address",
|
|
453
453
|
calldata: o
|
|
454
454
|
});
|
|
455
455
|
} catch (s) {
|
|
456
|
-
throw new
|
|
456
|
+
throw new jn({
|
|
457
457
|
code: "NOT_VALID",
|
|
458
458
|
options: { error: s }
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
async function
|
|
462
|
+
async function Xs(t, e, n) {
|
|
463
463
|
if (!e || !n)
|
|
464
|
-
throw new
|
|
464
|
+
throw new Un({
|
|
465
465
|
code: "NO_NETWORK_OR_MULTICALL"
|
|
466
466
|
});
|
|
467
467
|
let r = null;
|
|
468
468
|
try {
|
|
469
|
-
r =
|
|
469
|
+
r = Ys(t, e);
|
|
470
470
|
} catch (i) {
|
|
471
|
-
throw new
|
|
471
|
+
throw new jn({
|
|
472
472
|
code: "NOT_VALID",
|
|
473
473
|
options: { error: i }
|
|
474
474
|
});
|
|
@@ -481,25 +481,25 @@ async function Ys(t, e, n) {
|
|
|
481
481
|
code: "STARKNAME_ERROR"
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
|
-
if (
|
|
484
|
+
if (Lr(o))
|
|
485
485
|
throw new St({
|
|
486
486
|
code: "STARKNAME_NOT_FOUND",
|
|
487
487
|
message: `${t} not found`
|
|
488
488
|
});
|
|
489
|
-
if (!
|
|
489
|
+
if (!Dr(o))
|
|
490
490
|
throw new St({
|
|
491
491
|
code: "STARKNAME_INVALID_ADDRESS",
|
|
492
492
|
message: `${t} resolved to an invalid address (${o})`
|
|
493
493
|
});
|
|
494
|
-
return
|
|
494
|
+
return Ln(o);
|
|
495
495
|
}
|
|
496
|
-
class
|
|
496
|
+
class Vl {
|
|
497
497
|
constructor(e, n, r) {
|
|
498
498
|
this.httpService = e, this.baseUrl = n, this.allowedArgentNameNetworkId = r;
|
|
499
499
|
}
|
|
500
500
|
async parseAddressOrDomain(e, n, r) {
|
|
501
|
-
if (
|
|
502
|
-
return
|
|
501
|
+
if (Hr(e))
|
|
502
|
+
return Ln(e);
|
|
503
503
|
try {
|
|
504
504
|
return await this.getAddressFromDomainName(e, n, r);
|
|
505
505
|
} catch {
|
|
@@ -507,22 +507,22 @@ class Hl {
|
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
509
|
async getAddressFromDomainName(e, n, r) {
|
|
510
|
-
if (
|
|
511
|
-
return
|
|
512
|
-
if (
|
|
510
|
+
if (Vr(e))
|
|
511
|
+
return Xs(e, n, r);
|
|
512
|
+
if (Mr(e)) {
|
|
513
513
|
if (n !== this.allowedArgentNameNetworkId)
|
|
514
514
|
throw new St({
|
|
515
515
|
code: "ARGENT_NAME_INVALID_NETWORK",
|
|
516
516
|
message: `Argent name is only enabled on "${this.allowedArgentNameNetworkId}"`
|
|
517
517
|
});
|
|
518
|
-
return
|
|
518
|
+
return Gr(e, this.httpService, this.baseUrl);
|
|
519
519
|
}
|
|
520
520
|
throw new St({
|
|
521
521
|
code: "NO_ADDRESS_FROM_DOMAIN"
|
|
522
522
|
});
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
const
|
|
525
|
+
const Js = [
|
|
526
526
|
"0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918"
|
|
527
527
|
], tt = {
|
|
528
528
|
// CAIRO_0
|
|
@@ -539,48 +539,48 @@ const Xs = [
|
|
|
539
539
|
"0.1.1": "0x6e150953b26271a740bf2b6e9bca17cc52c68d765f761295de51ceb8526ee72",
|
|
540
540
|
"0.1.0": "0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48"
|
|
541
541
|
};
|
|
542
|
-
var
|
|
543
|
-
function
|
|
544
|
-
var e =
|
|
542
|
+
var Qs = typeof global == "object" && global && global.Object === Object && global, to = typeof self == "object" && self && self.Object === Object && self, ce = Qs || to || Function("return this")(), Qt = ce.Symbol, Qn = Object.prototype, eo = Qn.hasOwnProperty, no = Qn.toString, Nt = Qt ? Qt.toStringTag : void 0;
|
|
543
|
+
function ro(t) {
|
|
544
|
+
var e = eo.call(t, Nt), n = t[Nt];
|
|
545
545
|
try {
|
|
546
546
|
t[Nt] = void 0;
|
|
547
547
|
var r = !0;
|
|
548
548
|
} catch {
|
|
549
549
|
}
|
|
550
|
-
var s =
|
|
550
|
+
var s = no.call(t);
|
|
551
551
|
return r && (e ? t[Nt] = n : delete t[Nt]), s;
|
|
552
552
|
}
|
|
553
|
-
var
|
|
554
|
-
function
|
|
555
|
-
return
|
|
553
|
+
var so = Object.prototype, oo = so.toString;
|
|
554
|
+
function ao(t) {
|
|
555
|
+
return oo.call(t);
|
|
556
556
|
}
|
|
557
|
-
var
|
|
558
|
-
function
|
|
559
|
-
return t == null ? t === void 0 ?
|
|
557
|
+
var io = "[object Null]", co = "[object Undefined]", dn = Qt ? Qt.toStringTag : void 0;
|
|
558
|
+
function lo(t) {
|
|
559
|
+
return t == null ? t === void 0 ? co : io : dn && dn in Object(t) ? ro(t) : ao(t);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function tr(t) {
|
|
562
562
|
var e = typeof t;
|
|
563
563
|
return t != null && (e == "object" || e == "function");
|
|
564
564
|
}
|
|
565
|
-
var
|
|
566
|
-
function
|
|
567
|
-
if (!
|
|
565
|
+
var uo = "[object AsyncFunction]", fo = "[object Function]", ho = "[object GeneratorFunction]", po = "[object Proxy]";
|
|
566
|
+
function mo(t) {
|
|
567
|
+
if (!tr(t))
|
|
568
568
|
return !1;
|
|
569
|
-
var e =
|
|
570
|
-
return e ==
|
|
569
|
+
var e = lo(t);
|
|
570
|
+
return e == fo || e == ho || e == uo || e == po;
|
|
571
571
|
}
|
|
572
|
-
var be = ce["__core-js_shared__"],
|
|
572
|
+
var be = ce["__core-js_shared__"], fn = function() {
|
|
573
573
|
var t = /[^.]+$/.exec(be && be.keys && be.keys.IE_PROTO || "");
|
|
574
574
|
return t ? "Symbol(src)_1." + t : "";
|
|
575
575
|
}();
|
|
576
|
-
function
|
|
577
|
-
return !!
|
|
576
|
+
function go(t) {
|
|
577
|
+
return !!fn && fn in t;
|
|
578
578
|
}
|
|
579
|
-
var
|
|
580
|
-
function
|
|
579
|
+
var wo = Function.prototype, yo = wo.toString;
|
|
580
|
+
function bo(t) {
|
|
581
581
|
if (t != null) {
|
|
582
582
|
try {
|
|
583
|
-
return
|
|
583
|
+
return yo.call(t);
|
|
584
584
|
} catch {
|
|
585
585
|
}
|
|
586
586
|
try {
|
|
@@ -590,48 +590,48 @@ function yo(t) {
|
|
|
590
590
|
}
|
|
591
591
|
return "";
|
|
592
592
|
}
|
|
593
|
-
var
|
|
594
|
-
"^" +
|
|
593
|
+
var So = /[\\^$.*+?()[\]{}|]/g, Eo = /^\[object .+?Constructor\]$/, Ao = Function.prototype, xo = Object.prototype, vo = Ao.toString, Io = xo.hasOwnProperty, To = RegExp(
|
|
594
|
+
"^" + vo.call(Io).replace(So, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
595
595
|
);
|
|
596
|
-
function
|
|
597
|
-
if (!
|
|
596
|
+
function Bo(t) {
|
|
597
|
+
if (!tr(t) || go(t))
|
|
598
598
|
return !1;
|
|
599
|
-
var e =
|
|
600
|
-
return e.test(
|
|
599
|
+
var e = mo(t) ? To : Eo;
|
|
600
|
+
return e.test(bo(t));
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function _o(t, e) {
|
|
603
603
|
return t == null ? void 0 : t[e];
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
var n =
|
|
607
|
-
return
|
|
605
|
+
function De(t, e) {
|
|
606
|
+
var n = _o(t, e);
|
|
607
|
+
return Bo(n) ? n : void 0;
|
|
608
608
|
}
|
|
609
|
-
var Ft =
|
|
610
|
-
function
|
|
609
|
+
var Ft = De(Object, "create");
|
|
610
|
+
function No() {
|
|
611
611
|
this.__data__ = Ft ? Ft(null) : {}, this.size = 0;
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Co(t) {
|
|
614
614
|
var e = this.has(t) && delete this.__data__[t];
|
|
615
615
|
return this.size -= e ? 1 : 0, e;
|
|
616
616
|
}
|
|
617
|
-
var
|
|
618
|
-
function
|
|
617
|
+
var Oo = "__lodash_hash_undefined__", ko = Object.prototype, Po = ko.hasOwnProperty;
|
|
618
|
+
function Ro(t) {
|
|
619
619
|
var e = this.__data__;
|
|
620
620
|
if (Ft) {
|
|
621
621
|
var n = e[t];
|
|
622
|
-
return n ===
|
|
622
|
+
return n === Oo ? void 0 : n;
|
|
623
623
|
}
|
|
624
|
-
return
|
|
624
|
+
return Po.call(e, t) ? e[t] : void 0;
|
|
625
625
|
}
|
|
626
|
-
var
|
|
627
|
-
function
|
|
626
|
+
var $o = Object.prototype, Fo = $o.hasOwnProperty;
|
|
627
|
+
function Uo(t) {
|
|
628
628
|
var e = this.__data__;
|
|
629
|
-
return Ft ? e[t] !== void 0 :
|
|
629
|
+
return Ft ? e[t] !== void 0 : Fo.call(e, t);
|
|
630
630
|
}
|
|
631
|
-
var
|
|
632
|
-
function
|
|
631
|
+
var jo = "__lodash_hash_undefined__";
|
|
632
|
+
function Lo(t, e) {
|
|
633
633
|
var n = this.__data__;
|
|
634
|
-
return this.size += this.has(t) ? 0 : 1, n[t] = Ft && e === void 0 ?
|
|
634
|
+
return this.size += this.has(t) ? 0 : 1, n[t] = Ft && e === void 0 ? jo : e, this;
|
|
635
635
|
}
|
|
636
636
|
function ft(t) {
|
|
637
637
|
var e = -1, n = t == null ? 0 : t.length;
|
|
@@ -640,39 +640,39 @@ function ft(t) {
|
|
|
640
640
|
this.set(r[0], r[1]);
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
|
-
ft.prototype.clear =
|
|
644
|
-
ft.prototype.delete =
|
|
645
|
-
ft.prototype.get =
|
|
646
|
-
ft.prototype.has =
|
|
647
|
-
ft.prototype.set =
|
|
648
|
-
function
|
|
643
|
+
ft.prototype.clear = No;
|
|
644
|
+
ft.prototype.delete = Co;
|
|
645
|
+
ft.prototype.get = Ro;
|
|
646
|
+
ft.prototype.has = Uo;
|
|
647
|
+
ft.prototype.set = Lo;
|
|
648
|
+
function Do() {
|
|
649
649
|
this.__data__ = [], this.size = 0;
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function Ho(t, e) {
|
|
652
652
|
return t === e || t !== t && e !== e;
|
|
653
653
|
}
|
|
654
654
|
function le(t, e) {
|
|
655
655
|
for (var n = t.length; n--; )
|
|
656
|
-
if (
|
|
656
|
+
if (Ho(t[n][0], e))
|
|
657
657
|
return n;
|
|
658
658
|
return -1;
|
|
659
659
|
}
|
|
660
|
-
var
|
|
661
|
-
function
|
|
660
|
+
var Vo = Array.prototype, Mo = Vo.splice;
|
|
661
|
+
function Go(t) {
|
|
662
662
|
var e = this.__data__, n = le(e, t);
|
|
663
663
|
if (n < 0)
|
|
664
664
|
return !1;
|
|
665
665
|
var r = e.length - 1;
|
|
666
|
-
return n == r ? e.pop() :
|
|
666
|
+
return n == r ? e.pop() : Mo.call(e, n, 1), --this.size, !0;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
668
|
+
function zo(t) {
|
|
669
669
|
var e = this.__data__, n = le(e, t);
|
|
670
670
|
return n < 0 ? void 0 : e[n][1];
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function qo(t) {
|
|
673
673
|
return le(this.__data__, t) > -1;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Wo(t, e) {
|
|
676
676
|
var n = this.__data__, r = le(n, t);
|
|
677
677
|
return r < 0 ? (++this.size, n.push([t, e])) : n[r][1] = e, this;
|
|
678
678
|
}
|
|
@@ -683,38 +683,38 @@ function It(t) {
|
|
|
683
683
|
this.set(r[0], r[1]);
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
|
-
It.prototype.clear =
|
|
687
|
-
It.prototype.delete =
|
|
688
|
-
It.prototype.get =
|
|
689
|
-
It.prototype.has =
|
|
690
|
-
It.prototype.set =
|
|
691
|
-
var
|
|
692
|
-
function
|
|
686
|
+
It.prototype.clear = Do;
|
|
687
|
+
It.prototype.delete = Go;
|
|
688
|
+
It.prototype.get = zo;
|
|
689
|
+
It.prototype.has = qo;
|
|
690
|
+
It.prototype.set = Wo;
|
|
691
|
+
var Ko = De(ce, "Map");
|
|
692
|
+
function Zo() {
|
|
693
693
|
this.size = 0, this.__data__ = {
|
|
694
694
|
hash: new ft(),
|
|
695
|
-
map: new (
|
|
695
|
+
map: new (Ko || It)(),
|
|
696
696
|
string: new ft()
|
|
697
697
|
};
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function Yo(t) {
|
|
700
700
|
var e = typeof t;
|
|
701
701
|
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
702
702
|
}
|
|
703
703
|
function ue(t, e) {
|
|
704
704
|
var n = t.__data__;
|
|
705
|
-
return
|
|
705
|
+
return Yo(e) ? n[typeof e == "string" ? "string" : "hash"] : n.map;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function Xo(t) {
|
|
708
708
|
var e = ue(this, t).delete(t);
|
|
709
709
|
return this.size -= e ? 1 : 0, e;
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function Jo(t) {
|
|
712
712
|
return ue(this, t).get(t);
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function Qo(t) {
|
|
715
715
|
return ue(this, t).has(t);
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function ta(t, e) {
|
|
718
718
|
var n = ue(this, t), r = n.size;
|
|
719
719
|
return n.set(t, e), this.size += n.size == r ? 0 : 1, this;
|
|
720
720
|
}
|
|
@@ -725,16 +725,16 @@ function Tt(t) {
|
|
|
725
725
|
this.set(r[0], r[1]);
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
-
Tt.prototype.clear =
|
|
729
|
-
Tt.prototype.delete =
|
|
730
|
-
Tt.prototype.get =
|
|
731
|
-
Tt.prototype.has =
|
|
732
|
-
Tt.prototype.set =
|
|
733
|
-
var
|
|
734
|
-
function ea(t) {
|
|
735
|
-
return this.__data__.set(t, ta), this;
|
|
736
|
-
}
|
|
728
|
+
Tt.prototype.clear = Zo;
|
|
729
|
+
Tt.prototype.delete = Xo;
|
|
730
|
+
Tt.prototype.get = Jo;
|
|
731
|
+
Tt.prototype.has = Qo;
|
|
732
|
+
Tt.prototype.set = ta;
|
|
733
|
+
var ea = "__lodash_hash_undefined__";
|
|
737
734
|
function na(t) {
|
|
735
|
+
return this.__data__.set(t, ea), this;
|
|
736
|
+
}
|
|
737
|
+
function ra(t) {
|
|
738
738
|
return this.__data__.has(t);
|
|
739
739
|
}
|
|
740
740
|
function te(t) {
|
|
@@ -742,60 +742,60 @@ function te(t) {
|
|
|
742
742
|
for (this.__data__ = new Tt(); ++e < n; )
|
|
743
743
|
this.add(t[e]);
|
|
744
744
|
}
|
|
745
|
-
te.prototype.add = te.prototype.push =
|
|
746
|
-
te.prototype.has =
|
|
747
|
-
function
|
|
745
|
+
te.prototype.add = te.prototype.push = na;
|
|
746
|
+
te.prototype.has = ra;
|
|
747
|
+
function sa(t, e, n, r) {
|
|
748
748
|
for (var s = t.length, o = n + -1; ++o < s; )
|
|
749
749
|
if (e(t[o], o, t))
|
|
750
750
|
return o;
|
|
751
751
|
return -1;
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function oa(t) {
|
|
754
754
|
return t !== t;
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function aa(t, e, n) {
|
|
757
757
|
for (var r = n - 1, s = t.length; ++r < s; )
|
|
758
758
|
if (t[r] === e)
|
|
759
759
|
return r;
|
|
760
760
|
return -1;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
return e === e ?
|
|
762
|
+
function ia(t, e, n) {
|
|
763
|
+
return e === e ? aa(t, e, n) : sa(t, oa, n);
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function ca(t, e) {
|
|
766
766
|
var n = t == null ? 0 : t.length;
|
|
767
|
-
return !!n &&
|
|
767
|
+
return !!n && ia(t, e, 0) > -1;
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function la(t, e, n) {
|
|
770
770
|
for (var r = -1, s = t == null ? 0 : t.length; ++r < s; )
|
|
771
771
|
if (n(e, t[r]))
|
|
772
772
|
return !0;
|
|
773
773
|
return !1;
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function ua(t, e) {
|
|
776
776
|
return t.has(e);
|
|
777
777
|
}
|
|
778
|
-
var Se =
|
|
779
|
-
function
|
|
778
|
+
var Se = De(ce, "Set");
|
|
779
|
+
function da() {
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function er(t) {
|
|
782
782
|
var e = -1, n = Array(t.size);
|
|
783
783
|
return t.forEach(function(r) {
|
|
784
784
|
n[++e] = r;
|
|
785
785
|
}), n;
|
|
786
786
|
}
|
|
787
|
-
var
|
|
787
|
+
var fa = 1 / 0, ha = Se && 1 / er(new Se([, -0]))[1] == fa ? function(t) {
|
|
788
788
|
return new Se(t);
|
|
789
|
-
} :
|
|
790
|
-
function
|
|
791
|
-
var r = -1, s =
|
|
789
|
+
} : da, pa = 200;
|
|
790
|
+
function ma(t, e, n) {
|
|
791
|
+
var r = -1, s = ca, o = t.length, a = !0, i = [], c = i;
|
|
792
792
|
if (n)
|
|
793
|
-
a = !1, s =
|
|
794
|
-
else if (o >=
|
|
795
|
-
var l =
|
|
793
|
+
a = !1, s = la;
|
|
794
|
+
else if (o >= pa) {
|
|
795
|
+
var l = ha(t);
|
|
796
796
|
if (l)
|
|
797
|
-
return
|
|
798
|
-
a = !1, s =
|
|
797
|
+
return er(l);
|
|
798
|
+
a = !1, s = ua, c = new te();
|
|
799
799
|
} else
|
|
800
800
|
c = i;
|
|
801
801
|
t:
|
|
@@ -810,10 +810,10 @@ function pa(t, e, n) {
|
|
|
810
810
|
}
|
|
811
811
|
return i;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
814
|
-
return e = typeof e == "function" ? e : void 0, t && t.length ?
|
|
813
|
+
function ga(t, e) {
|
|
814
|
+
return e = typeof e == "function" ? e : void 0, t && t.length ? ma(t, void 0, e) : [];
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function hn(t) {
|
|
817
817
|
const e = Object.entries(tt), n = Object.entries(Jt);
|
|
818
818
|
switch (t) {
|
|
819
819
|
case "cairo0":
|
|
@@ -826,92 +826,92 @@ function fn(t) {
|
|
|
826
826
|
return e.map(([, r]) => r);
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function wa() {
|
|
830
830
|
const t = Q.maxSatisfying(Object.keys(tt), "*");
|
|
831
831
|
if (!t)
|
|
832
832
|
throw new Error(`No argent account contract found: v${t} `);
|
|
833
833
|
return tt[t];
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function Ml() {
|
|
836
836
|
const t = Q.maxSatisfying(Object.keys(Jt), "*");
|
|
837
837
|
if (!t)
|
|
838
838
|
throw new Error(`No argent multisig contract found: v${t} `);
|
|
839
839
|
return Jt[t];
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function ya() {
|
|
842
842
|
return Object.entries(tt).filter(([t]) => Q.gte(t, "0.4.0")).map(([, t]) => t);
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function Gl() {
|
|
845
845
|
const t = Q.maxSatisfying(Object.keys(tt), "<0.3.0");
|
|
846
846
|
if (!t)
|
|
847
847
|
throw new Error(`No argent account contract found: v${t} `);
|
|
848
848
|
return tt[t];
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function ba() {
|
|
851
851
|
const t = Object.entries(tt).filter(([n]) => Q.gte(n, "0.3.1")).map(([, n]) => n), e = Object.entries(Jt).filter(([n]) => Q.gte(n, "0.1.1")).map(([, n]) => n);
|
|
852
852
|
return [...t, ...e];
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function zl() {
|
|
855
855
|
return Object.entries(tt).filter(([t]) => Q.gte(t, "0.4.0")).map(([, t]) => t);
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function ql() {
|
|
858
858
|
const t = Q.maxSatisfying(Object.keys(tt), ">=0.4.0");
|
|
859
859
|
if (!t)
|
|
860
860
|
throw new Error(`No ledger account contract found: v${t}`);
|
|
861
861
|
return tt[t];
|
|
862
862
|
}
|
|
863
|
-
const
|
|
864
|
-
function
|
|
865
|
-
const r =
|
|
863
|
+
const Sa = (t, e) => t.cairoVersion === e.cairoVersion && nt(t.accountClassHash, e.accountClassHash);
|
|
864
|
+
function Wl(t, e, n = []) {
|
|
865
|
+
const r = en.parse({
|
|
866
866
|
cairoVersion: e.cairoVersion ?? "1",
|
|
867
|
-
accountClassHash: e.classHash ??
|
|
868
|
-
}), s = h.array(
|
|
869
|
-
...
|
|
870
|
-
...
|
|
871
|
-
], c =
|
|
867
|
+
accountClassHash: e.classHash ?? wa()
|
|
868
|
+
}), s = h.array(en).parse(n), o = [
|
|
869
|
+
...hn("cairo0").map((l) => ({ cairoVersion: "0", accountClassHash: l })),
|
|
870
|
+
...hn("cairo1").map((l) => ({ cairoVersion: "1", accountClassHash: l }))
|
|
871
|
+
], c = ga([
|
|
872
872
|
r,
|
|
873
873
|
...s,
|
|
874
874
|
...o
|
|
875
|
-
],
|
|
875
|
+
], Sa).map((l) => ({
|
|
876
876
|
implementation: l,
|
|
877
|
-
address:
|
|
877
|
+
address: xa(l.cairoVersion, l.accountClassHash, t, e.guardian, e.salt)
|
|
878
878
|
})).find((l) => nt(l.address, e.address));
|
|
879
879
|
if (!c)
|
|
880
|
-
throw new
|
|
880
|
+
throw new zr({ code: "CALCULATED_ADDRESS_NO_MATCH" });
|
|
881
881
|
return c.implementation;
|
|
882
882
|
}
|
|
883
|
-
function
|
|
884
|
-
const a =
|
|
883
|
+
function Ea(t, e, n, r, s, o = Js[0]) {
|
|
884
|
+
const a = Aa(t, e, n, r);
|
|
885
885
|
return {
|
|
886
886
|
classHash: t === "0" ? o : e,
|
|
887
887
|
constructorCalldata: mt.compile(a),
|
|
888
888
|
addressSalt: s || n
|
|
889
889
|
};
|
|
890
890
|
}
|
|
891
|
-
function
|
|
892
|
-
const s = t !== "0" && nt(
|
|
891
|
+
function Aa(t, e, n, r) {
|
|
892
|
+
const s = t !== "0" && nt(qr, e), o = {
|
|
893
893
|
pubkey: n,
|
|
894
894
|
...s ? {} : { guardian: r || "0" }
|
|
895
895
|
};
|
|
896
|
-
if (
|
|
897
|
-
const i =
|
|
896
|
+
if (ya().some((i) => nt(i, e))) {
|
|
897
|
+
const i = nn(n, rn.Starknet), c = r ? new on(an.Some, nn(r, rn.Starknet)) : new on(an.None, null);
|
|
898
898
|
return { ownerSigner: i, guardianAsOption: c };
|
|
899
899
|
}
|
|
900
|
-
return t === "0" ?
|
|
900
|
+
return t === "0" ? Wr.parse({
|
|
901
901
|
implementation: e,
|
|
902
|
-
selector:
|
|
902
|
+
selector: Mn.getSelectorFromName("initialize"),
|
|
903
903
|
calldata: mt.compile(o)
|
|
904
|
-
}) :
|
|
904
|
+
}) : Kr.parse({
|
|
905
905
|
owner: n,
|
|
906
906
|
guardian: r
|
|
907
907
|
});
|
|
908
908
|
}
|
|
909
|
-
function
|
|
910
|
-
const o =
|
|
911
|
-
return
|
|
909
|
+
function xa(t, e, n, r, s) {
|
|
910
|
+
const o = Ea(t, e, n, r, s);
|
|
911
|
+
return Mn.calculateContractAddressFromHash(o.addressSalt, o.classHash, o.constructorCalldata, 0);
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
const n =
|
|
913
|
+
function Kl(t, e) {
|
|
914
|
+
const n = ln(t), r = ln();
|
|
915
915
|
return Yt(() => {
|
|
916
916
|
n.current = t;
|
|
917
917
|
}, [t]), Yt(() => () => {
|
|
@@ -920,8 +920,8 @@ function Wl(t, e) {
|
|
|
920
920
|
r.current && clearTimeout(r.current), r.current = setTimeout(() => n.current(...s), e);
|
|
921
921
|
};
|
|
922
922
|
}
|
|
923
|
-
function
|
|
924
|
-
const [n, r] =
|
|
923
|
+
function Zl(t, e) {
|
|
924
|
+
const [n, r] = us(t);
|
|
925
925
|
return Yt(() => {
|
|
926
926
|
const s = setTimeout(() => {
|
|
927
927
|
r(t);
|
|
@@ -931,7 +931,7 @@ function Kl(t, e) {
|
|
|
931
931
|
};
|
|
932
932
|
}, [t, e]), n;
|
|
933
933
|
}
|
|
934
|
-
const
|
|
934
|
+
const va = h.object({
|
|
935
935
|
name: h.enum([
|
|
936
936
|
"dappland",
|
|
937
937
|
"discord",
|
|
@@ -942,10 +942,10 @@ const xa = h.object({
|
|
|
942
942
|
]),
|
|
943
943
|
url: h.string(),
|
|
944
944
|
position: h.number()
|
|
945
|
-
}), va = h.object({
|
|
946
|
-
address: Ln,
|
|
947
|
-
chain: h.enum(["ethereum", "starknet"])
|
|
948
945
|
}), Ia = h.object({
|
|
946
|
+
address: Dn,
|
|
947
|
+
chain: h.enum(["ethereum", "starknet"])
|
|
948
|
+
}), Ta = h.object({
|
|
949
949
|
dappId: h.string(),
|
|
950
950
|
name: h.string(),
|
|
951
951
|
description: h.string().optional(),
|
|
@@ -953,60 +953,60 @@ const xa = h.object({
|
|
|
953
953
|
dappUrl: h.string().optional(),
|
|
954
954
|
inAppBrowserCompatible: h.boolean(),
|
|
955
955
|
argentVerified: h.boolean(),
|
|
956
|
-
links: h.array(
|
|
957
|
-
contracts: h.array(
|
|
956
|
+
links: h.array(va).optional(),
|
|
957
|
+
contracts: h.array(Ia).optional(),
|
|
958
958
|
categories: h.array(h.string()).optional(),
|
|
959
959
|
supportedApps: h.array(h.string()).optional(),
|
|
960
960
|
brandColor: h.string().optional(),
|
|
961
961
|
executeFromOutsideAllowed: h.boolean().default(!1).optional()
|
|
962
|
-
}),
|
|
963
|
-
class
|
|
962
|
+
}), Ba = h.array(Ta);
|
|
963
|
+
class Yl {
|
|
964
964
|
constructor(e, n) {
|
|
965
|
-
this.apiBase = e, this.httpService = new
|
|
965
|
+
this.apiBase = e, this.httpService = new Le(n, "json");
|
|
966
966
|
}
|
|
967
967
|
async getAll() {
|
|
968
|
-
const e = await this.httpService.get(`${this.apiBase}/tokens/dapps`), n =
|
|
968
|
+
const e = await this.httpService.get(`${this.apiBase}/tokens/dapps`), n = Ba.safeParse(e);
|
|
969
969
|
if (!n.success)
|
|
970
970
|
throw new Error("Failed to parse known dapps");
|
|
971
971
|
return n.data;
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function _a(t) {
|
|
975
975
|
var e;
|
|
976
976
|
return (e = t == null ? void 0 : t.links) == null ? void 0 : e.find((n) => n.name === "dappland");
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function Xl(t) {
|
|
979
979
|
var e;
|
|
980
|
-
return (e =
|
|
980
|
+
return (e = _a(t)) == null ? void 0 : e.url;
|
|
981
981
|
}
|
|
982
|
-
const
|
|
983
|
-
domain:
|
|
982
|
+
const nr = F.object({
|
|
983
|
+
domain: Zr,
|
|
984
984
|
address: se.optional(),
|
|
985
985
|
avatar: F.string().optional(),
|
|
986
986
|
status: F.union([F.literal("KNOWN"), F.literal("UNKNOWN")])
|
|
987
|
-
}),
|
|
987
|
+
}), Na = F.array(nr), Ca = F.object({
|
|
988
988
|
provider: F.string(),
|
|
989
989
|
name: F.string(),
|
|
990
990
|
avatar: F.string().optional()
|
|
991
|
-
}),
|
|
991
|
+
}), Oa = F.object({
|
|
992
992
|
address: se,
|
|
993
993
|
status: F.union([F.literal("KNOWN"), F.literal("UNKNOWN")]),
|
|
994
|
-
resolutions: F.array(
|
|
995
|
-
}),
|
|
996
|
-
class
|
|
994
|
+
resolutions: F.array(Ca).optional()
|
|
995
|
+
}), ka = F.array(F.string()), Pa = Oa.array();
|
|
996
|
+
class Jl {
|
|
997
997
|
constructor(e, n) {
|
|
998
|
-
this.apiBase = e, this.headers = n, this.httpService = new
|
|
998
|
+
this.apiBase = e, this.headers = n, this.httpService = new Le(this.headers, "json");
|
|
999
999
|
}
|
|
1000
1000
|
async getAddressFromMultipleStarknetId(e, n, r) {
|
|
1001
1001
|
const s = new URLSearchParams(n.map((c) => ["domain", c]));
|
|
1002
1002
|
r && s.set("includeAvatar", "true");
|
|
1003
|
-
const o = k(this.apiBase, e, "starknet.id", `?${s}`), a = await this.httpService.get(o), i =
|
|
1003
|
+
const o = k(this.apiBase, e, "starknet.id", `?${s}`), a = await this.httpService.get(o), i = Na.safeParse(a);
|
|
1004
1004
|
if (!i.success)
|
|
1005
1005
|
throw new Error("Failed to parse name resolution");
|
|
1006
1006
|
return i.data;
|
|
1007
1007
|
}
|
|
1008
1008
|
async getAddressFromStarknetId(e, n, r) {
|
|
1009
|
-
const s = k(this.apiBase, e, "starknet.id", n, r ? "?includeAvatar=true" : ""), o = await this.httpService.get(s), a =
|
|
1009
|
+
const s = k(this.apiBase, e, "starknet.id", n, r ? "?includeAvatar=true" : ""), o = await this.httpService.get(s), a = nr.safeParse(o);
|
|
1010
1010
|
if (!a.success)
|
|
1011
1011
|
throw new Error("Failed to parse name resolution");
|
|
1012
1012
|
return a.data;
|
|
@@ -1017,111 +1017,111 @@ class Xl {
|
|
|
1017
1017
|
async getStarknetIdFromAddress(e, n, r) {
|
|
1018
1018
|
const s = new URLSearchParams(n.map((c) => ["address", c]));
|
|
1019
1019
|
r && s.set("includeAvatar", "true");
|
|
1020
|
-
const o = k(this.apiBase, e, "addresses", `?${s}`), a = await this.httpService.get(o), i =
|
|
1020
|
+
const o = k(this.apiBase, e, "addresses", `?${s}`), a = await this.httpService.get(o), i = Pa.safeParse(a);
|
|
1021
1021
|
if (!i.success)
|
|
1022
1022
|
throw new Error("Failed to parse name resolution");
|
|
1023
1023
|
return i.data;
|
|
1024
1024
|
}
|
|
1025
1025
|
async getProvidersNames(e) {
|
|
1026
|
-
const n = k(this.apiBase, e, "providers", "name"), r = await this.httpService.get(n), s =
|
|
1026
|
+
const n = k(this.apiBase, e, "providers", "name"), r = await this.httpService.get(n), s = ka.safeParse(r);
|
|
1027
1027
|
if (!s.success)
|
|
1028
1028
|
throw new Error("Failed to parse name resolution");
|
|
1029
1029
|
return s.data;
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
|
-
const
|
|
1033
|
-
function
|
|
1032
|
+
const rr = (t) => t.slice(0, 6) + "..." + t.slice(-4);
|
|
1033
|
+
function pn(t) {
|
|
1034
1034
|
if (!Number.isSafeInteger(t) || t < 0)
|
|
1035
1035
|
throw new Error(`positive integer expected, not ${t}`);
|
|
1036
1036
|
}
|
|
1037
|
-
function
|
|
1037
|
+
function Ra(t) {
|
|
1038
1038
|
return t instanceof Uint8Array || t != null && typeof t == "object" && t.constructor.name === "Uint8Array";
|
|
1039
1039
|
}
|
|
1040
1040
|
function de(t, ...e) {
|
|
1041
|
-
if (!
|
|
1041
|
+
if (!Ra(t))
|
|
1042
1042
|
throw new Error("Uint8Array expected");
|
|
1043
1043
|
if (e.length > 0 && !e.includes(t.length))
|
|
1044
1044
|
throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`);
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1046
|
+
function mn(t, e = !0) {
|
|
1047
1047
|
if (t.destroyed)
|
|
1048
1048
|
throw new Error("Hash instance has been destroyed");
|
|
1049
1049
|
if (e && t.finished)
|
|
1050
1050
|
throw new Error("Hash#digest() has already been called");
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function $a(t, e) {
|
|
1053
1053
|
de(t);
|
|
1054
1054
|
const n = e.outputLen;
|
|
1055
1055
|
if (t.length < n)
|
|
1056
1056
|
throw new Error(`digestInto() expects output buffer of length at least ${n}`);
|
|
1057
1057
|
}
|
|
1058
|
-
const Wt = /* @__PURE__ */ BigInt(2 ** 32 - 1),
|
|
1059
|
-
function $a(t, e = !1) {
|
|
1060
|
-
return e ? { h: Number(t & Wt), l: Number(t >> mn & Wt) } : { h: Number(t >> mn & Wt) | 0, l: Number(t & Wt) | 0 };
|
|
1061
|
-
}
|
|
1058
|
+
const Wt = /* @__PURE__ */ BigInt(2 ** 32 - 1), gn = /* @__PURE__ */ BigInt(32);
|
|
1062
1059
|
function Fa(t, e = !1) {
|
|
1060
|
+
return e ? { h: Number(t & Wt), l: Number(t >> gn & Wt) } : { h: Number(t >> gn & Wt) | 0, l: Number(t & Wt) | 0 };
|
|
1061
|
+
}
|
|
1062
|
+
function Ua(t, e = !1) {
|
|
1063
1063
|
let n = new Uint32Array(t.length), r = new Uint32Array(t.length);
|
|
1064
1064
|
for (let s = 0; s < t.length; s++) {
|
|
1065
|
-
const { h: o, l: a } =
|
|
1065
|
+
const { h: o, l: a } = Fa(t[s], e);
|
|
1066
1066
|
[n[s], r[s]] = [o, a];
|
|
1067
1067
|
}
|
|
1068
1068
|
return [n, r];
|
|
1069
1069
|
}
|
|
1070
|
-
const
|
|
1070
|
+
const ja = (t, e, n) => t << n | e >>> 32 - n, La = (t, e, n) => e << n | t >>> 32 - n, Da = (t, e, n) => e << n - 32 | t >>> 64 - n, Ha = (t, e, n) => t << n - 32 | e >>> 64 - n;
|
|
1071
1071
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1072
|
-
const
|
|
1073
|
-
function
|
|
1072
|
+
const Va = (t) => new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4)), wn = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68, Ma = (t) => t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
1073
|
+
function yn(t) {
|
|
1074
1074
|
for (let e = 0; e < t.length; e++)
|
|
1075
|
-
t[e] =
|
|
1075
|
+
t[e] = Ma(t[e]);
|
|
1076
1076
|
}
|
|
1077
|
-
const
|
|
1078
|
-
function
|
|
1077
|
+
const Ga = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
1078
|
+
function za(t) {
|
|
1079
1079
|
de(t);
|
|
1080
1080
|
let e = "";
|
|
1081
1081
|
for (let n = 0; n < t.length; n++)
|
|
1082
|
-
e +=
|
|
1082
|
+
e += Ga[t[n]];
|
|
1083
1083
|
return e;
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function sr(t) {
|
|
1086
1086
|
if (typeof t != "string")
|
|
1087
1087
|
throw new Error(`utf8ToBytes expected string, got ${typeof t}`);
|
|
1088
1088
|
return new Uint8Array(new TextEncoder().encode(t));
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
return typeof t == "string" && (t =
|
|
1090
|
+
function or(t) {
|
|
1091
|
+
return typeof t == "string" && (t = sr(t)), de(t), t;
|
|
1092
1092
|
}
|
|
1093
|
-
let
|
|
1093
|
+
let qa = class {
|
|
1094
1094
|
// Safe version that clones internal state
|
|
1095
1095
|
clone() {
|
|
1096
1096
|
return this._cloneInto();
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
|
-
function
|
|
1100
|
-
const e = (r) => t().update(
|
|
1099
|
+
function Wa(t) {
|
|
1100
|
+
const e = (r) => t().update(or(r)).digest(), n = t();
|
|
1101
1101
|
return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = () => t(), e;
|
|
1102
1102
|
}
|
|
1103
|
-
const
|
|
1103
|
+
const ar = [], ir = [], cr = [], Ka = /* @__PURE__ */ BigInt(0), Ct = /* @__PURE__ */ BigInt(1), Za = /* @__PURE__ */ BigInt(2), Ya = /* @__PURE__ */ BigInt(7), Xa = /* @__PURE__ */ BigInt(256), Ja = /* @__PURE__ */ BigInt(113);
|
|
1104
1104
|
for (let t = 0, e = Ct, n = 1, r = 0; t < 24; t++) {
|
|
1105
|
-
[n, r] = [r, (2 * n + 3 * r) % 5],
|
|
1106
|
-
let s =
|
|
1105
|
+
[n, r] = [r, (2 * n + 3 * r) % 5], ar.push(2 * (5 * r + n)), ir.push((t + 1) * (t + 2) / 2 % 64);
|
|
1106
|
+
let s = Ka;
|
|
1107
1107
|
for (let o = 0; o < 7; o++)
|
|
1108
|
-
e = (e << Ct ^ (e >>
|
|
1109
|
-
|
|
1108
|
+
e = (e << Ct ^ (e >> Ya) * Ja) % Xa, e & Za && (s ^= Ct << (Ct << /* @__PURE__ */ BigInt(o)) - Ct);
|
|
1109
|
+
cr.push(s);
|
|
1110
1110
|
}
|
|
1111
|
-
const [
|
|
1112
|
-
function
|
|
1111
|
+
const [Qa, ti] = /* @__PURE__ */ Ua(cr, !0), bn = (t, e, n) => n > 32 ? Da(t, e, n) : ja(t, e, n), Sn = (t, e, n) => n > 32 ? Ha(t, e, n) : La(t, e, n);
|
|
1112
|
+
function ei(t, e = 24) {
|
|
1113
1113
|
const n = new Uint32Array(10);
|
|
1114
1114
|
for (let r = 24 - e; r < 24; r++) {
|
|
1115
1115
|
for (let a = 0; a < 10; a++)
|
|
1116
1116
|
n[a] = t[a] ^ t[a + 10] ^ t[a + 20] ^ t[a + 30] ^ t[a + 40];
|
|
1117
1117
|
for (let a = 0; a < 10; a += 2) {
|
|
1118
|
-
const i = (a + 8) % 10, c = (a + 2) % 10, l = n[c], d = n[c + 1], u =
|
|
1118
|
+
const i = (a + 8) % 10, c = (a + 2) % 10, l = n[c], d = n[c + 1], u = bn(l, d, 1) ^ n[i], w = Sn(l, d, 1) ^ n[i + 1];
|
|
1119
1119
|
for (let m = 0; m < 50; m += 10)
|
|
1120
1120
|
t[a + m] ^= u, t[a + m + 1] ^= w;
|
|
1121
1121
|
}
|
|
1122
1122
|
let s = t[2], o = t[3];
|
|
1123
1123
|
for (let a = 0; a < 24; a++) {
|
|
1124
|
-
const i =
|
|
1124
|
+
const i = ir[a], c = bn(s, o, i), l = Sn(s, o, i), d = ar[a];
|
|
1125
1125
|
s = t[d], o = t[d + 1], t[d] = c, t[d + 1] = l;
|
|
1126
1126
|
}
|
|
1127
1127
|
for (let a = 0; a < 50; a += 10) {
|
|
@@ -1130,24 +1130,24 @@ function ti(t, e = 24) {
|
|
|
1130
1130
|
for (let i = 0; i < 10; i++)
|
|
1131
1131
|
t[a + i] ^= ~n[(i + 2) % 10] & n[(i + 4) % 10];
|
|
1132
1132
|
}
|
|
1133
|
-
t[0] ^=
|
|
1133
|
+
t[0] ^= Qa[r], t[1] ^= ti[r];
|
|
1134
1134
|
}
|
|
1135
1135
|
n.fill(0);
|
|
1136
1136
|
}
|
|
1137
|
-
let
|
|
1137
|
+
let ni = class lr extends qa {
|
|
1138
1138
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1139
1139
|
constructor(e, n, r, s = !1, o = 24) {
|
|
1140
|
-
if (super(), this.blockLen = e, this.suffix = n, this.outputLen = r, this.enableXOF = s, this.rounds = o, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1,
|
|
1140
|
+
if (super(), this.blockLen = e, this.suffix = n, this.outputLen = r, this.enableXOF = s, this.rounds = o, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, pn(r), 0 >= this.blockLen || this.blockLen >= 200)
|
|
1141
1141
|
throw new Error("Sha3 supports only keccak-f1600 function");
|
|
1142
|
-
this.state = new Uint8Array(200), this.state32 =
|
|
1142
|
+
this.state = new Uint8Array(200), this.state32 = Va(this.state);
|
|
1143
1143
|
}
|
|
1144
1144
|
keccak() {
|
|
1145
|
-
|
|
1145
|
+
wn || yn(this.state32), ei(this.state32, this.rounds), wn || yn(this.state32), this.posOut = 0, this.pos = 0;
|
|
1146
1146
|
}
|
|
1147
1147
|
update(e) {
|
|
1148
|
-
|
|
1148
|
+
mn(this);
|
|
1149
1149
|
const { blockLen: n, state: r } = this;
|
|
1150
|
-
e =
|
|
1150
|
+
e = or(e);
|
|
1151
1151
|
const s = e.length;
|
|
1152
1152
|
for (let o = 0; o < s; ) {
|
|
1153
1153
|
const a = Math.min(n - this.pos, s - o);
|
|
@@ -1165,7 +1165,7 @@ let ei = class cr extends za {
|
|
|
1165
1165
|
e[r] ^= n, n & 128 && r === s - 1 && this.keccak(), e[s - 1] ^= 128, this.keccak();
|
|
1166
1166
|
}
|
|
1167
1167
|
writeInto(e) {
|
|
1168
|
-
|
|
1168
|
+
mn(this, !1), de(e), this.finish();
|
|
1169
1169
|
const n = this.state, { blockLen: r } = this;
|
|
1170
1170
|
for (let s = 0, o = e.length; s < o; ) {
|
|
1171
1171
|
this.posOut >= r && this.keccak();
|
|
@@ -1180,10 +1180,10 @@ let ei = class cr extends za {
|
|
|
1180
1180
|
return this.writeInto(e);
|
|
1181
1181
|
}
|
|
1182
1182
|
xof(e) {
|
|
1183
|
-
return
|
|
1183
|
+
return pn(e), this.xofInto(new Uint8Array(e));
|
|
1184
1184
|
}
|
|
1185
1185
|
digestInto(e) {
|
|
1186
|
-
if (
|
|
1186
|
+
if ($a(e, this), this.finished)
|
|
1187
1187
|
throw new Error("digest() was already called");
|
|
1188
1188
|
return this.writeInto(e), this.destroy(), e;
|
|
1189
1189
|
}
|
|
@@ -1195,36 +1195,36 @@ let ei = class cr extends za {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
_cloneInto(e) {
|
|
1197
1197
|
const { blockLen: n, suffix: r, outputLen: s, rounds: o, enableXOF: a } = this;
|
|
1198
|
-
return e || (e = new
|
|
1198
|
+
return e || (e = new lr(n, r, s, a, o)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = o, e.suffix = r, e.outputLen = s, e.enableXOF = a, e.destroyed = this.destroyed, e;
|
|
1199
1199
|
}
|
|
1200
1200
|
};
|
|
1201
|
-
const
|
|
1202
|
-
function
|
|
1203
|
-
return `0x${
|
|
1201
|
+
const ri = (t, e, n) => Wa(() => new ni(e, t, n)), si = /* @__PURE__ */ ri(1, 136, 256 / 8);
|
|
1202
|
+
function oi(t) {
|
|
1203
|
+
return `0x${za(si(sr(t)))}`;
|
|
1204
1204
|
}
|
|
1205
|
-
const
|
|
1206
|
-
if (!
|
|
1205
|
+
const ai = (t) => {
|
|
1206
|
+
if (!zn(t))
|
|
1207
1207
|
return;
|
|
1208
1208
|
const e = /(\d+)$/, n = t.match(e);
|
|
1209
1209
|
if (n)
|
|
1210
1210
|
return n[1];
|
|
1211
|
-
},
|
|
1212
|
-
if (!
|
|
1211
|
+
}, ii = (t, e = !1) => {
|
|
1212
|
+
if (!zn(t))
|
|
1213
1213
|
return "";
|
|
1214
|
-
const n = e ? t.replace(/[^0-9a-z ]/gi, "") : t, s =
|
|
1214
|
+
const n = e ? t.replace(/[^0-9a-z ]/gi, "") : t, s = $e(n).split(" "), o = ai(n), a = s.map((i) => i[0]);
|
|
1215
1215
|
return o && o.length > 1 && o.length < n.length ? [a[0], o.substring(0, 2)].join("") : s.length === 1 ? s[0].substring(0, 2) : [a[0], a[a.length - 1]].join("");
|
|
1216
|
-
}, { toBigInt:
|
|
1216
|
+
}, { toBigInt: ci } = O, En = (t) => {
|
|
1217
1217
|
const e = t.replace("#", "");
|
|
1218
1218
|
if (!/^[0-9A-F]{6}$/i.test(e))
|
|
1219
1219
|
throw new Error(`Invalid color ${t}`);
|
|
1220
1220
|
return `#${e}`;
|
|
1221
1221
|
}, ee = (t, e) => {
|
|
1222
|
-
const n =
|
|
1222
|
+
const n = En(e.background), r = En(e.color ?? "#ffffff"), s = ii(t, !0), o = `<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
|
|
1223
1223
|
<rect width="48" height="48" fill="${n}" />
|
|
1224
1224
|
<text x="50%" y="54%" dominant-baseline="middle" text-anchor="middle" font-size="16" font-family="Barlow, Helvetica, Arial, sans-serif" fill="${r}">${s}</text>
|
|
1225
1225
|
</svg>`;
|
|
1226
1226
|
return `data:image/svg+xml;base64,${btoa(o)}`;
|
|
1227
|
-
},
|
|
1227
|
+
}, An = [
|
|
1228
1228
|
"02BBA8",
|
|
1229
1229
|
"29C5FF",
|
|
1230
1230
|
"0078A4",
|
|
@@ -1233,46 +1233,46 @@ const oi = (t) => {
|
|
|
1233
1233
|
"FF875B",
|
|
1234
1234
|
"FF675C",
|
|
1235
1235
|
"FF5C72"
|
|
1236
|
-
],
|
|
1237
|
-
const e =
|
|
1238
|
-
return
|
|
1239
|
-
},
|
|
1236
|
+
], li = (t) => {
|
|
1237
|
+
const e = oi(t).slice(-2), n = parseInt(e, 16) % An.length;
|
|
1238
|
+
return An[n];
|
|
1239
|
+
}, ui = (t) => {
|
|
1240
1240
|
try {
|
|
1241
|
-
return O.toHex(
|
|
1241
|
+
return O.toHex(ci(O.hexToDecimalString(t)));
|
|
1242
1242
|
} catch {
|
|
1243
1243
|
}
|
|
1244
1244
|
return "";
|
|
1245
|
-
},
|
|
1246
|
-
const s =
|
|
1245
|
+
}, tu = ({ accountName: t, networkId: e, accountAddress: n, backgroundColor: r }) => {
|
|
1246
|
+
const s = ui(n), o = `${e}::${s}`, a = r || li(o);
|
|
1247
1247
|
return ee(t, { background: a });
|
|
1248
|
-
},
|
|
1249
|
-
const e = $t.removeHexPrefix($t.sanitizeHex(O.toHex(t))), n =
|
|
1250
|
-
return
|
|
1251
|
-
},
|
|
1252
|
-
const e =
|
|
1253
|
-
return $t.sanitizeHex(
|
|
1254
|
-
},
|
|
1255
|
-
function
|
|
1248
|
+
}, di = (t) => {
|
|
1249
|
+
const e = $t.removeHexPrefix($t.sanitizeHex(O.toHex(t))), n = Wn.decode(e);
|
|
1250
|
+
return Kn.encode(n);
|
|
1251
|
+
}, eu = (t) => t.map(di), fi = (t) => {
|
|
1252
|
+
const e = Kn.decode(t);
|
|
1253
|
+
return $t.sanitizeHex(Wn.encode(e));
|
|
1254
|
+
}, nu = (t) => t.map(fi);
|
|
1255
|
+
function ru(t, e) {
|
|
1256
1256
|
const n = t.getTime(), r = e.getTime(), s = Math.abs(n - r);
|
|
1257
1257
|
return Math.floor(s / (1e3 * 60 * 60 * 24));
|
|
1258
1258
|
}
|
|
1259
|
-
const
|
|
1259
|
+
const su = (t) => (t || "false") === "true", ou = async (t, e) => {
|
|
1260
1260
|
try {
|
|
1261
1261
|
return await t.getClassHashAt(e), !0;
|
|
1262
1262
|
} catch {
|
|
1263
1263
|
return !1;
|
|
1264
1264
|
}
|
|
1265
1265
|
};
|
|
1266
|
-
function
|
|
1267
|
-
return !
|
|
1266
|
+
function au(t) {
|
|
1267
|
+
return !ds(t);
|
|
1268
1268
|
}
|
|
1269
|
-
const
|
|
1269
|
+
const iu = (t) => {
|
|
1270
1270
|
const e = /^(0|0x([a-f0-9A-F]+)?)$/;
|
|
1271
1271
|
return !!(t === "" || e.test(t));
|
|
1272
|
-
}, Y = (t) => !isNaN(parseFloat(t)) && isFinite(Number(t)),
|
|
1272
|
+
}, Y = (t) => !isNaN(parseFloat(t)) && isFinite(Number(t)), cu = (t, e = 16) => {
|
|
1273
1273
|
const n = new RegExp(`^[0-9]*.?[0-9]{0,${e}}$`);
|
|
1274
1274
|
return t === "" ? !0 : Y(t) ? !!n.test(t) : !1;
|
|
1275
|
-
},
|
|
1275
|
+
}, He = {
|
|
1276
1276
|
CURRENCY: {
|
|
1277
1277
|
minDecimalPlaces: 2,
|
|
1278
1278
|
maxDecimalPlaces: 10,
|
|
@@ -1287,19 +1287,19 @@ const au = (t) => {
|
|
|
1287
1287
|
decimalPlacesWhenZero: 1,
|
|
1288
1288
|
allowLeadingZerosInDecimalPart: !0
|
|
1289
1289
|
}
|
|
1290
|
-
},
|
|
1291
|
-
...
|
|
1290
|
+
}, hi = (t, e) => ur(t, {
|
|
1291
|
+
...He.CURRENCY,
|
|
1292
1292
|
...e || {}
|
|
1293
|
-
}),
|
|
1294
|
-
...
|
|
1293
|
+
}), pi = (t, e) => ur(t, {
|
|
1294
|
+
...He.TOKEN,
|
|
1295
1295
|
...e || {}
|
|
1296
|
-
}),
|
|
1296
|
+
}), ur = (t, { minDecimalPlaces: e, maxDecimalPlaces: n, minDecimalSignificantDigits: r, decimalPlacesWhenZero: s, allowLeadingZerosInDecimalPart: o } = He.CURRENCY) => {
|
|
1297
1297
|
if (!Y(t))
|
|
1298
1298
|
return null;
|
|
1299
|
-
const a = new
|
|
1299
|
+
const a = new sn(typeof t == "bigint" ? t.toString() : t);
|
|
1300
1300
|
let i;
|
|
1301
1301
|
const c = `0.${"".padStart(s - 1, "0")}1`;
|
|
1302
|
-
if (a.lt(new
|
|
1302
|
+
if (a.lt(new sn(c)) && !o)
|
|
1303
1303
|
i = `0.${"".padStart(s, "0")}`;
|
|
1304
1304
|
else if (a.gte(1))
|
|
1305
1305
|
i = a.toFormat(e);
|
|
@@ -1310,53 +1310,53 @@ const au = (t) => {
|
|
|
1310
1310
|
let l = i.replace(/0+$/, "");
|
|
1311
1311
|
const d = 1 + i.indexOf(".") + s;
|
|
1312
1312
|
return l.length < d && (l = i.substring(0, d)), l;
|
|
1313
|
-
},
|
|
1313
|
+
}, mi = (t, e = 18) => {
|
|
1314
1314
|
const n = t.replace(",", ".");
|
|
1315
1315
|
return !t || !Y(n) ? 0n : xt(n, Number(e)).value;
|
|
1316
1316
|
};
|
|
1317
1317
|
function Ut(t) {
|
|
1318
1318
|
return Dt.bnToUint256(t);
|
|
1319
1319
|
}
|
|
1320
|
-
const
|
|
1320
|
+
const lu = (t, e) => `${t} ${e}${t === 1 ? "" : "s"}`, uu = (t) => new Promise((e, n) => {
|
|
1321
1321
|
const r = new FileReader();
|
|
1322
1322
|
r.onload = () => {
|
|
1323
1323
|
var s;
|
|
1324
1324
|
return r.result ? e((s = r.result) == null ? void 0 : s.toString()) : n(new Error("Could not read file"));
|
|
1325
1325
|
}, r.onerror = n, r.onabort = n.bind(null, new Error("User aborted")), r.readAsText(t);
|
|
1326
1326
|
});
|
|
1327
|
-
function
|
|
1327
|
+
function du(t) {
|
|
1328
1328
|
try {
|
|
1329
|
-
return
|
|
1329
|
+
return fs(qn(t));
|
|
1330
1330
|
} catch {
|
|
1331
1331
|
return t;
|
|
1332
1332
|
}
|
|
1333
1333
|
}
|
|
1334
|
-
const
|
|
1334
|
+
const fu = (t, e) => {
|
|
1335
1335
|
const n = new URLSearchParams(e), r = n.size ? `?${n}` : "";
|
|
1336
1336
|
return k(...oe(t), r);
|
|
1337
1337
|
};
|
|
1338
|
-
function
|
|
1338
|
+
function hu(t) {
|
|
1339
1339
|
return (...e) => {
|
|
1340
1340
|
t(...e);
|
|
1341
1341
|
};
|
|
1342
1342
|
}
|
|
1343
|
-
class
|
|
1343
|
+
class gi extends Error {
|
|
1344
1344
|
constructor(e, n) {
|
|
1345
1345
|
super(`${e}::${n}`), this.name = e, this.code = n, this.name = e;
|
|
1346
1346
|
}
|
|
1347
1347
|
}
|
|
1348
|
-
class
|
|
1348
|
+
class xn extends gi {
|
|
1349
1349
|
constructor(e) {
|
|
1350
1350
|
super("BackendPaginationError", e);
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
|
-
const
|
|
1354
|
-
class
|
|
1353
|
+
const vn = 32;
|
|
1354
|
+
class pu {
|
|
1355
1355
|
constructor(e, n, r) {
|
|
1356
|
-
this.apiBase = e, this.headers = n, this.imageOptimizationUrl = r, this.httpService = new
|
|
1356
|
+
this.apiBase = e, this.headers = n, this.imageOptimizationUrl = r, this.httpService = new Le(this.headers, "json");
|
|
1357
1357
|
}
|
|
1358
1358
|
async getNfts(e, n, r, s = 1) {
|
|
1359
|
-
const o = this.normalizeAddress(r), a = k(this.apiBase, "pandora", e, n), i = this.pageToPageIndex(s), l = `${k(a, "profile", o, "nfts")}?page=${i}&size=${
|
|
1359
|
+
const o = this.normalizeAddress(r), a = k(this.apiBase, "pandora", e, n), i = this.pageToPageIndex(s), l = `${k(a, "profile", o, "nfts")}?page=${i}&size=${vn}`, d = await this.httpService.get(l), u = d.content.map((w) => this.mapItem(w, r));
|
|
1360
1360
|
return {
|
|
1361
1361
|
totalPages: d.totalPages,
|
|
1362
1362
|
page: d.number + 1,
|
|
@@ -1384,7 +1384,7 @@ class hu {
|
|
|
1384
1384
|
return this.mapItem(c);
|
|
1385
1385
|
}
|
|
1386
1386
|
async getProfileCollections(e, n, r, s = 1, o = !1) {
|
|
1387
|
-
const a = this.pageToPageIndex(s), i = this.normalizeAddress(r), c = k(this.apiBase, "pandora", e, n), l = k(c, "profile", i, "collections", `?page=${a}&size=${
|
|
1387
|
+
const a = this.pageToPageIndex(s), i = this.normalizeAddress(r), c = k(this.apiBase, "pandora", e, n), l = k(c, "profile", i, "collections", `?page=${a}&size=${vn}`), d = await this.httpService.get(l), u = [];
|
|
1388
1388
|
for (const w of d.content)
|
|
1389
1389
|
if (o) {
|
|
1390
1390
|
const m = await this.getCollectionMetrics(e, n, w.contractAddress);
|
|
@@ -1403,14 +1403,14 @@ class hu {
|
|
|
1403
1403
|
return this.httpService.get(a);
|
|
1404
1404
|
}
|
|
1405
1405
|
normalizeAddress(e) {
|
|
1406
|
-
return
|
|
1406
|
+
return Dn.parse(e);
|
|
1407
1407
|
}
|
|
1408
1408
|
pageToPageIndex(e) {
|
|
1409
1409
|
if (!Number.isInteger(e))
|
|
1410
|
-
throw new
|
|
1410
|
+
throw new xn("notANumber");
|
|
1411
1411
|
const n = e - 1;
|
|
1412
1412
|
if (n < 0)
|
|
1413
|
-
throw new
|
|
1413
|
+
throw new xn("tooLow");
|
|
1414
1414
|
return n;
|
|
1415
1415
|
}
|
|
1416
1416
|
optimizeImage(e, n, r) {
|
|
@@ -1430,7 +1430,7 @@ class hu {
|
|
|
1430
1430
|
token_id: e.tokenId,
|
|
1431
1431
|
contract_address: e.contractAddress,
|
|
1432
1432
|
name: r,
|
|
1433
|
-
spec: "spec" in e ?
|
|
1433
|
+
spec: "spec" in e ? wi(e.spec) : void 0,
|
|
1434
1434
|
description: "",
|
|
1435
1435
|
best_bid_order: {
|
|
1436
1436
|
payment_amount: "bestListPrice" in e ? BigInt(e.bestListPrice) : void 0
|
|
@@ -1447,11 +1447,11 @@ class hu {
|
|
|
1447
1447
|
owner: {
|
|
1448
1448
|
account_address: ((s = e.owner) == null ? void 0 : s.address) || n
|
|
1449
1449
|
},
|
|
1450
|
-
contract_name:
|
|
1450
|
+
contract_name: rr(e.contractAddress)
|
|
1451
1451
|
};
|
|
1452
1452
|
}
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1454
|
+
function wi(t) {
|
|
1455
1455
|
switch (t) {
|
|
1456
1456
|
case "erc721":
|
|
1457
1457
|
case "starknetErc721":
|
|
@@ -1464,7 +1464,7 @@ function gi(t) {
|
|
|
1464
1464
|
function Ee(t, e) {
|
|
1465
1465
|
return {
|
|
1466
1466
|
contractAddress: se.parse(t.contractAddress),
|
|
1467
|
-
name: t.name ||
|
|
1467
|
+
name: t.name || rr(t.contractAddress),
|
|
1468
1468
|
description: t.description ?? "",
|
|
1469
1469
|
imageUri: t.imageUrls.preview ?? ee(t.name || t.contractAddress.replace("0x", ""), {
|
|
1470
1470
|
background: "#15192A",
|
|
@@ -1482,29 +1482,29 @@ function Ee(t, e) {
|
|
|
1482
1482
|
}
|
|
1483
1483
|
};
|
|
1484
1484
|
}
|
|
1485
|
-
const
|
|
1485
|
+
const dr = async (t, e, n, r, s = 1) => {
|
|
1486
1486
|
const o = await t.getNfts(e, n, r, s);
|
|
1487
1487
|
if (s < o.totalPages) {
|
|
1488
|
-
const a = await
|
|
1488
|
+
const a = await dr(t, e, n, r, o.page + 1);
|
|
1489
1489
|
return {
|
|
1490
1490
|
...o,
|
|
1491
1491
|
nfts: o.nfts.concat(a.nfts)
|
|
1492
1492
|
};
|
|
1493
1493
|
}
|
|
1494
1494
|
return o;
|
|
1495
|
-
},
|
|
1496
|
-
const { data: o, ...a } = ae(r && [r, "nfts"], () => r &&
|
|
1495
|
+
}, mu = (t, e, n, r, s) => {
|
|
1496
|
+
const { data: o, ...a } = ae(r && [r, "nfts"], () => r && dr(t, e, n, r), {
|
|
1497
1497
|
refreshInterval: 3e5,
|
|
1498
1498
|
...s
|
|
1499
1499
|
});
|
|
1500
1500
|
return { nfts: o == null ? void 0 : o.nfts, ...a };
|
|
1501
|
-
},
|
|
1501
|
+
}, gu = (t, e, n, r, s) => {
|
|
1502
1502
|
const { data: o, ...a } = ae(r && [`${r}`, "nfts-collection"], () => r && t.getCollection(e, n, r), {
|
|
1503
1503
|
refreshInterval: 6e4,
|
|
1504
1504
|
...s
|
|
1505
1505
|
});
|
|
1506
1506
|
return { collection: o, ...a };
|
|
1507
|
-
},
|
|
1507
|
+
}, wu = (t, e, n, r, s, o) => {
|
|
1508
1508
|
const { data: a, ...i } = ae(s && r && [`${r}:${s}`, "nft"], () => s && r ? t.getNft(e, n, r, s) : void 0, {
|
|
1509
1509
|
refreshInterval: 6e4,
|
|
1510
1510
|
revalidateOnFocus: !1,
|
|
@@ -1512,7 +1512,7 @@ const ur = async (t, e, n, r, s = 1) => {
|
|
|
1512
1512
|
...o
|
|
1513
1513
|
});
|
|
1514
1514
|
return { nft: a, ...i };
|
|
1515
|
-
},
|
|
1515
|
+
}, yu = ({ image_uri: t, image_url_copy: e }) => {
|
|
1516
1516
|
if (t && e) {
|
|
1517
1517
|
if (!e.startsWith("ipfs://"))
|
|
1518
1518
|
return e;
|
|
@@ -1520,16 +1520,16 @@ const ur = async (t, e, n, r, s = 1) => {
|
|
|
1520
1520
|
return t;
|
|
1521
1521
|
}
|
|
1522
1522
|
return e || t;
|
|
1523
|
-
},
|
|
1524
|
-
function
|
|
1523
|
+
}, bu = (t, e) => t.token_id === e.token_id && nt(t.contract_address, e.contract_address);
|
|
1524
|
+
function In(t) {
|
|
1525
1525
|
if (!Number.isSafeInteger(t) || t < 0)
|
|
1526
1526
|
throw new Error(`Wrong positive integer: ${t}`);
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1528
|
+
function yi(t) {
|
|
1529
1529
|
return t instanceof Uint8Array || t != null && typeof t == "object" && t.constructor.name === "Uint8Array";
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1532
|
-
if (!
|
|
1531
|
+
function fr(t, ...e) {
|
|
1532
|
+
if (!yi(t))
|
|
1533
1533
|
throw new Error("Expected Uint8Array");
|
|
1534
1534
|
if (e.length > 0 && !e.includes(t.length))
|
|
1535
1535
|
throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`);
|
|
@@ -1540,75 +1540,75 @@ function ne(t, e = !0) {
|
|
|
1540
1540
|
if (e && t.finished)
|
|
1541
1541
|
throw new Error("Hash#digest() has already been called");
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1544
|
-
|
|
1543
|
+
function hr(t, e) {
|
|
1544
|
+
fr(t);
|
|
1545
1545
|
const n = e.outputLen;
|
|
1546
1546
|
if (t.length < n)
|
|
1547
1547
|
throw new Error(`digestInto() expects output buffer of length at least ${n}`);
|
|
1548
1548
|
}
|
|
1549
|
-
const Kt = /* @__PURE__ */ BigInt(2 ** 32 - 1),
|
|
1550
|
-
function yi(t, e = !1) {
|
|
1551
|
-
return e ? { h: Number(t & Kt), l: Number(t >> In & Kt) } : { h: Number(t >> In & Kt) | 0, l: Number(t & Kt) | 0 };
|
|
1552
|
-
}
|
|
1549
|
+
const Kt = /* @__PURE__ */ BigInt(2 ** 32 - 1), Tn = /* @__PURE__ */ BigInt(32);
|
|
1553
1550
|
function bi(t, e = !1) {
|
|
1551
|
+
return e ? { h: Number(t & Kt), l: Number(t >> Tn & Kt) } : { h: Number(t >> Tn & Kt) | 0, l: Number(t & Kt) | 0 };
|
|
1552
|
+
}
|
|
1553
|
+
function Si(t, e = !1) {
|
|
1554
1554
|
let n = new Uint32Array(t.length), r = new Uint32Array(t.length);
|
|
1555
1555
|
for (let s = 0; s < t.length; s++) {
|
|
1556
|
-
const { h: o, l: a } =
|
|
1556
|
+
const { h: o, l: a } = bi(t[s], e);
|
|
1557
1557
|
[n[s], r[s]] = [o, a];
|
|
1558
1558
|
}
|
|
1559
1559
|
return [n, r];
|
|
1560
1560
|
}
|
|
1561
|
-
const
|
|
1561
|
+
const Ei = (t, e, n) => t << n | e >>> 32 - n, Ai = (t, e, n) => e << n | t >>> 32 - n, xi = (t, e, n) => e << n - 32 | t >>> 64 - n, vi = (t, e, n) => t << n - 32 | e >>> 64 - n;
|
|
1562
1562
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1563
|
-
const
|
|
1564
|
-
function
|
|
1563
|
+
const Ii = (t) => new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
1564
|
+
function Ti(t) {
|
|
1565
1565
|
return t instanceof Uint8Array || t != null && typeof t == "object" && t.constructor.name === "Uint8Array";
|
|
1566
1566
|
}
|
|
1567
|
-
const Ae = (t) => new DataView(t.buffer, t.byteOffset, t.byteLength), J = (t, e) => t << 32 - e | t >>> e,
|
|
1568
|
-
if (!
|
|
1567
|
+
const Ae = (t) => new DataView(t.buffer, t.byteOffset, t.byteLength), J = (t, e) => t << 32 - e | t >>> e, Bi = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
1568
|
+
if (!Bi)
|
|
1569
1569
|
throw new Error("Non little-endian hardware is not supported");
|
|
1570
|
-
function
|
|
1570
|
+
function pr(t) {
|
|
1571
1571
|
if (typeof t != "string")
|
|
1572
1572
|
throw new Error(`utf8ToBytes expected string, got ${typeof t}`);
|
|
1573
1573
|
return new Uint8Array(new TextEncoder().encode(t));
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
if (typeof t == "string" && (t =
|
|
1575
|
+
function Ve(t) {
|
|
1576
|
+
if (typeof t == "string" && (t = pr(t)), !Ti(t))
|
|
1577
1577
|
throw new Error(`expected Uint8Array, got ${typeof t}`);
|
|
1578
1578
|
return t;
|
|
1579
1579
|
}
|
|
1580
|
-
let
|
|
1580
|
+
let mr = class {
|
|
1581
1581
|
// Safe version that clones internal state
|
|
1582
1582
|
clone() {
|
|
1583
1583
|
return this._cloneInto();
|
|
1584
1584
|
}
|
|
1585
1585
|
};
|
|
1586
|
-
function
|
|
1587
|
-
const e = (r) => t().update(
|
|
1586
|
+
function gr(t) {
|
|
1587
|
+
const e = (r) => t().update(Ve(r)).digest(), n = t();
|
|
1588
1588
|
return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = () => t(), e;
|
|
1589
1589
|
}
|
|
1590
|
-
const [
|
|
1590
|
+
const [wr, yr, br] = [[], [], []], _i = /* @__PURE__ */ BigInt(0), Ot = /* @__PURE__ */ BigInt(1), Ni = /* @__PURE__ */ BigInt(2), Ci = /* @__PURE__ */ BigInt(7), Oi = /* @__PURE__ */ BigInt(256), ki = /* @__PURE__ */ BigInt(113);
|
|
1591
1591
|
for (let t = 0, e = Ot, n = 1, r = 0; t < 24; t++) {
|
|
1592
|
-
[n, r] = [r, (2 * n + 3 * r) % 5],
|
|
1593
|
-
let s =
|
|
1592
|
+
[n, r] = [r, (2 * n + 3 * r) % 5], wr.push(2 * (5 * r + n)), yr.push((t + 1) * (t + 2) / 2 % 64);
|
|
1593
|
+
let s = _i;
|
|
1594
1594
|
for (let o = 0; o < 7; o++)
|
|
1595
|
-
e = (e << Ot ^ (e >>
|
|
1596
|
-
|
|
1595
|
+
e = (e << Ot ^ (e >> Ci) * ki) % Oi, e & Ni && (s ^= Ot << (Ot << /* @__PURE__ */ BigInt(o)) - Ot);
|
|
1596
|
+
br.push(s);
|
|
1597
1597
|
}
|
|
1598
|
-
const [
|
|
1599
|
-
function
|
|
1598
|
+
const [Pi, Ri] = /* @__PURE__ */ Si(br, !0), Bn = (t, e, n) => n > 32 ? xi(t, e, n) : Ei(t, e, n), _n = (t, e, n) => n > 32 ? vi(t, e, n) : Ai(t, e, n);
|
|
1599
|
+
function $i(t, e = 24) {
|
|
1600
1600
|
const n = new Uint32Array(10);
|
|
1601
1601
|
for (let r = 24 - e; r < 24; r++) {
|
|
1602
1602
|
for (let a = 0; a < 10; a++)
|
|
1603
1603
|
n[a] = t[a] ^ t[a + 10] ^ t[a + 20] ^ t[a + 30] ^ t[a + 40];
|
|
1604
1604
|
for (let a = 0; a < 10; a += 2) {
|
|
1605
|
-
const i = (a + 8) % 10, c = (a + 2) % 10, l = n[c], d = n[c + 1], u =
|
|
1605
|
+
const i = (a + 8) % 10, c = (a + 2) % 10, l = n[c], d = n[c + 1], u = Bn(l, d, 1) ^ n[i], w = _n(l, d, 1) ^ n[i + 1];
|
|
1606
1606
|
for (let m = 0; m < 50; m += 10)
|
|
1607
1607
|
t[a + m] ^= u, t[a + m + 1] ^= w;
|
|
1608
1608
|
}
|
|
1609
1609
|
let s = t[2], o = t[3];
|
|
1610
1610
|
for (let a = 0; a < 24; a++) {
|
|
1611
|
-
const i =
|
|
1611
|
+
const i = yr[a], c = Bn(s, o, i), l = _n(s, o, i), d = wr[a];
|
|
1612
1612
|
s = t[d], o = t[d + 1], t[d] = c, t[d + 1] = l;
|
|
1613
1613
|
}
|
|
1614
1614
|
for (let a = 0; a < 50; a += 10) {
|
|
@@ -1617,24 +1617,24 @@ function Ri(t, e = 24) {
|
|
|
1617
1617
|
for (let i = 0; i < 10; i++)
|
|
1618
1618
|
t[a + i] ^= ~n[(i + 2) % 10] & n[(i + 4) % 10];
|
|
1619
1619
|
}
|
|
1620
|
-
t[0] ^=
|
|
1620
|
+
t[0] ^= Pi[r], t[1] ^= Ri[r];
|
|
1621
1621
|
}
|
|
1622
1622
|
n.fill(0);
|
|
1623
1623
|
}
|
|
1624
|
-
class
|
|
1624
|
+
class Me extends mr {
|
|
1625
1625
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1626
1626
|
constructor(e, n, r, s = !1, o = 24) {
|
|
1627
|
-
if (super(), this.blockLen = e, this.suffix = n, this.outputLen = r, this.enableXOF = s, this.rounds = o, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1,
|
|
1627
|
+
if (super(), this.blockLen = e, this.suffix = n, this.outputLen = r, this.enableXOF = s, this.rounds = o, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, In(r), 0 >= this.blockLen || this.blockLen >= 200)
|
|
1628
1628
|
throw new Error("Sha3 supports only keccak-f1600 function");
|
|
1629
|
-
this.state = new Uint8Array(200), this.state32 =
|
|
1629
|
+
this.state = new Uint8Array(200), this.state32 = Ii(this.state);
|
|
1630
1630
|
}
|
|
1631
1631
|
keccak() {
|
|
1632
|
-
|
|
1632
|
+
$i(this.state32, this.rounds), this.posOut = 0, this.pos = 0;
|
|
1633
1633
|
}
|
|
1634
1634
|
update(e) {
|
|
1635
1635
|
ne(this);
|
|
1636
1636
|
const { blockLen: n, state: r } = this;
|
|
1637
|
-
e =
|
|
1637
|
+
e = Ve(e);
|
|
1638
1638
|
const s = e.length;
|
|
1639
1639
|
for (let o = 0; o < s; ) {
|
|
1640
1640
|
const a = Math.min(n - this.pos, s - o);
|
|
@@ -1652,7 +1652,7 @@ class Ve extends pr {
|
|
|
1652
1652
|
e[r] ^= n, n & 128 && r === s - 1 && this.keccak(), e[s - 1] ^= 128, this.keccak();
|
|
1653
1653
|
}
|
|
1654
1654
|
writeInto(e) {
|
|
1655
|
-
ne(this, !1),
|
|
1655
|
+
ne(this, !1), fr(e), this.finish();
|
|
1656
1656
|
const n = this.state, { blockLen: r } = this;
|
|
1657
1657
|
for (let s = 0, o = e.length; s < o; ) {
|
|
1658
1658
|
this.posOut >= r && this.keccak();
|
|
@@ -1667,10 +1667,10 @@ class Ve extends pr {
|
|
|
1667
1667
|
return this.writeInto(e);
|
|
1668
1668
|
}
|
|
1669
1669
|
xof(e) {
|
|
1670
|
-
return
|
|
1670
|
+
return In(e), this.xofInto(new Uint8Array(e));
|
|
1671
1671
|
}
|
|
1672
1672
|
digestInto(e) {
|
|
1673
|
-
if (
|
|
1673
|
+
if (hr(e, this), this.finished)
|
|
1674
1674
|
throw new Error("digest() was already called");
|
|
1675
1675
|
return this.writeInto(e), this.destroy(), e;
|
|
1676
1676
|
}
|
|
@@ -1682,24 +1682,24 @@ class Ve extends pr {
|
|
|
1682
1682
|
}
|
|
1683
1683
|
_cloneInto(e) {
|
|
1684
1684
|
const { blockLen: n, suffix: r, outputLen: s, rounds: o, enableXOF: a } = this;
|
|
1685
|
-
return e || (e = new
|
|
1685
|
+
return e || (e = new Me(n, r, s, a, o)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = o, e.suffix = r, e.outputLen = s, e.enableXOF = a, e.destroyed = this.destroyed, e;
|
|
1686
1686
|
}
|
|
1687
1687
|
}
|
|
1688
|
-
const
|
|
1689
|
-
function
|
|
1688
|
+
const Fi = (t, e, n) => gr(() => new Me(e, t, n)), Ui = /* @__PURE__ */ Fi(1, 136, 256 / 8);
|
|
1689
|
+
function ji(t, e, n, r) {
|
|
1690
1690
|
if (typeof t.setBigUint64 == "function")
|
|
1691
1691
|
return t.setBigUint64(e, n, r);
|
|
1692
1692
|
const s = BigInt(32), o = BigInt(4294967295), a = Number(n >> s & o), i = Number(n & o), c = r ? 4 : 0, l = r ? 0 : 4;
|
|
1693
1693
|
t.setUint32(e + c, a, r), t.setUint32(e + l, i, r);
|
|
1694
1694
|
}
|
|
1695
|
-
class
|
|
1695
|
+
class Li extends mr {
|
|
1696
1696
|
constructor(e, n, r, s) {
|
|
1697
1697
|
super(), this.blockLen = e, this.outputLen = n, this.padOffset = r, this.isLE = s, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(e), this.view = Ae(this.buffer);
|
|
1698
1698
|
}
|
|
1699
1699
|
update(e) {
|
|
1700
1700
|
ne(this);
|
|
1701
1701
|
const { view: n, buffer: r, blockLen: s } = this;
|
|
1702
|
-
e =
|
|
1702
|
+
e = Ve(e);
|
|
1703
1703
|
const o = e.length;
|
|
1704
1704
|
for (let a = 0; a < o; ) {
|
|
1705
1705
|
const i = Math.min(s - this.pos, o - a);
|
|
@@ -1714,13 +1714,13 @@ class ji extends pr {
|
|
|
1714
1714
|
return this.length += e.length, this.roundClean(), this;
|
|
1715
1715
|
}
|
|
1716
1716
|
digestInto(e) {
|
|
1717
|
-
ne(this),
|
|
1717
|
+
ne(this), hr(e, this), this.finished = !0;
|
|
1718
1718
|
const { buffer: n, view: r, blockLen: s, isLE: o } = this;
|
|
1719
1719
|
let { pos: a } = this;
|
|
1720
1720
|
n[a++] = 128, this.buffer.subarray(a).fill(0), this.padOffset > s - a && (this.process(r, 0), a = 0);
|
|
1721
1721
|
for (let u = a; u < s; u++)
|
|
1722
1722
|
n[u] = 0;
|
|
1723
|
-
|
|
1723
|
+
ji(r, s - 8, BigInt(this.length * 8), o), this.process(r, 0);
|
|
1724
1724
|
const i = Ae(e), c = this.outputLen;
|
|
1725
1725
|
if (c % 4)
|
|
1726
1726
|
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
@@ -1742,7 +1742,7 @@ class ji extends pr {
|
|
|
1742
1742
|
return e.length = s, e.pos = i, e.finished = o, e.destroyed = a, s % n && e.buffer.set(r), e;
|
|
1743
1743
|
}
|
|
1744
1744
|
}
|
|
1745
|
-
const
|
|
1745
|
+
const Di = (t, e, n) => t & e ^ ~t & n, Hi = (t, e, n) => t & e ^ t & n ^ e & n, Vi = /* @__PURE__ */ new Uint32Array([
|
|
1746
1746
|
1116352408,
|
|
1747
1747
|
1899447441,
|
|
1748
1748
|
3049323471,
|
|
@@ -1817,7 +1817,7 @@ const Li = (t, e, n) => t & e ^ ~t & n, Di = (t, e, n) => t & e ^ t & n ^ e & n,
|
|
|
1817
1817
|
528734635,
|
|
1818
1818
|
1541459225
|
|
1819
1819
|
]), ct = /* @__PURE__ */ new Uint32Array(64);
|
|
1820
|
-
class
|
|
1820
|
+
class Mi extends Li {
|
|
1821
1821
|
constructor() {
|
|
1822
1822
|
super(64, 32, 8, !1), this.A = it[0] | 0, this.B = it[1] | 0, this.C = it[2] | 0, this.D = it[3] | 0, this.E = it[4] | 0, this.F = it[5] | 0, this.G = it[6] | 0, this.H = it[7] | 0;
|
|
1823
1823
|
}
|
|
@@ -1838,7 +1838,7 @@ class Vi extends ji {
|
|
|
1838
1838
|
}
|
|
1839
1839
|
let { A: r, B: s, C: o, D: a, E: i, F: c, G: l, H: d } = this;
|
|
1840
1840
|
for (let u = 0; u < 64; u++) {
|
|
1841
|
-
const w = J(i, 6) ^ J(i, 11) ^ J(i, 25), m = d + w +
|
|
1841
|
+
const w = J(i, 6) ^ J(i, 11) ^ J(i, 25), m = d + w + Di(i, c, l) + Vi[u] + ct[u] | 0, f = (J(r, 2) ^ J(r, 13) ^ J(r, 22)) + Hi(r, s, o) | 0;
|
|
1842
1842
|
d = l, l = c, c = i, i = a + m | 0, a = o, o = s, s = r, r = m + f | 0;
|
|
1843
1843
|
}
|
|
1844
1844
|
r = r + this.A | 0, s = s + this.B | 0, o = o + this.C | 0, a = a + this.D | 0, i = i + this.E | 0, c = c + this.F | 0, l = l + this.G | 0, d = d + this.H | 0, this.set(r, s, o, a, i, c, l, d);
|
|
@@ -1850,22 +1850,22 @@ class Vi extends ji {
|
|
|
1850
1850
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
|
|
1851
1851
|
}
|
|
1852
1852
|
}
|
|
1853
|
-
const
|
|
1853
|
+
const Sr = /* @__PURE__ */ gr(() => new Mi());
|
|
1854
1854
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
1855
|
-
const
|
|
1855
|
+
const Er = BigInt(0), fe = BigInt(1), Gi = BigInt(2), he = (t) => t instanceof Uint8Array, zi = Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
1856
1856
|
function ht(t) {
|
|
1857
1857
|
if (!he(t))
|
|
1858
1858
|
throw new Error("Uint8Array expected");
|
|
1859
1859
|
let e = "";
|
|
1860
1860
|
for (let n = 0; n < t.length; n++)
|
|
1861
|
-
e +=
|
|
1861
|
+
e += zi[t[n]];
|
|
1862
1862
|
return e;
|
|
1863
1863
|
}
|
|
1864
|
-
function
|
|
1864
|
+
function Ar(t) {
|
|
1865
1865
|
const e = t.toString(16);
|
|
1866
1866
|
return e.length & 1 ? `0${e}` : e;
|
|
1867
1867
|
}
|
|
1868
|
-
function
|
|
1868
|
+
function Ge(t) {
|
|
1869
1869
|
if (typeof t != "string")
|
|
1870
1870
|
throw new Error("hex string expected, got " + typeof t);
|
|
1871
1871
|
return BigInt(t === "" ? "0" : `0x${t}`);
|
|
@@ -1885,14 +1885,14 @@ function pt(t) {
|
|
|
1885
1885
|
return e;
|
|
1886
1886
|
}
|
|
1887
1887
|
function X(t) {
|
|
1888
|
-
return
|
|
1888
|
+
return Ge(ht(t));
|
|
1889
1889
|
}
|
|
1890
|
-
function
|
|
1890
|
+
function ze(t) {
|
|
1891
1891
|
if (!he(t))
|
|
1892
1892
|
throw new Error("Uint8Array expected");
|
|
1893
|
-
return
|
|
1893
|
+
return Ge(ht(Uint8Array.from(t).reverse()));
|
|
1894
1894
|
}
|
|
1895
|
-
const Et = (t, e) => pt(t.toString(16).padStart(e * 2, "0")),
|
|
1895
|
+
const Et = (t, e) => pt(t.toString(16).padStart(e * 2, "0")), xr = (t, e) => Et(t, e).reverse(), qi = (t) => pt(Ar(t));
|
|
1896
1896
|
function V(t, e, n) {
|
|
1897
1897
|
let r;
|
|
1898
1898
|
if (typeof e == "string")
|
|
@@ -1919,7 +1919,7 @@ function jt(...t) {
|
|
|
1919
1919
|
e.set(r, n), n += r.length;
|
|
1920
1920
|
}), e;
|
|
1921
1921
|
}
|
|
1922
|
-
function
|
|
1922
|
+
function Wi(t, e) {
|
|
1923
1923
|
if (t.length !== e.length)
|
|
1924
1924
|
return !1;
|
|
1925
1925
|
for (let n = 0; n < t.length; n++)
|
|
@@ -1927,19 +1927,19 @@ function qi(t, e) {
|
|
|
1927
1927
|
return !1;
|
|
1928
1928
|
return !0;
|
|
1929
1929
|
}
|
|
1930
|
-
function
|
|
1930
|
+
function Ki(t) {
|
|
1931
1931
|
if (typeof t != "string")
|
|
1932
1932
|
throw new Error(`utf8ToBytes expected string, got ${typeof t}`);
|
|
1933
1933
|
return new TextEncoder().encode(t);
|
|
1934
1934
|
}
|
|
1935
|
-
function
|
|
1935
|
+
function Zi(t) {
|
|
1936
1936
|
let e;
|
|
1937
|
-
for (e = 0; t >
|
|
1937
|
+
for (e = 0; t > Er; t >>= fe, e += 1)
|
|
1938
1938
|
;
|
|
1939
1939
|
return e;
|
|
1940
1940
|
}
|
|
1941
|
-
const
|
|
1942
|
-
function
|
|
1941
|
+
const Yi = (t, e) => t >> BigInt(e) & fe, Xi = (t, e, n) => t | (n ? fe : Er) << BigInt(e), pe = (t) => (Gi << BigInt(t - 1)) - fe, xe = (t) => new Uint8Array(t), Nn = (t) => Uint8Array.from(t);
|
|
1942
|
+
function vr(t, e, n) {
|
|
1943
1943
|
if (typeof t != "number" || t < 2)
|
|
1944
1944
|
throw new Error("hashLen must be a number");
|
|
1945
1945
|
if (typeof e != "number" || e < 2)
|
|
@@ -1950,7 +1950,7 @@ function xr(t, e, n) {
|
|
|
1950
1950
|
const a = () => {
|
|
1951
1951
|
r.fill(1), s.fill(0), o = 0;
|
|
1952
1952
|
}, i = (...u) => n(s, r, ...u), c = (u = xe()) => {
|
|
1953
|
-
s = i(
|
|
1953
|
+
s = i(Nn([0]), u), r = i(), u.length !== 0 && (s = i(Nn([1]), u), r = i());
|
|
1954
1954
|
}, l = () => {
|
|
1955
1955
|
if (o++ >= 1e3)
|
|
1956
1956
|
throw new Error("drbg: tried 1000 values");
|
|
@@ -1971,7 +1971,7 @@ function xr(t, e, n) {
|
|
|
1971
1971
|
return a(), m;
|
|
1972
1972
|
};
|
|
1973
1973
|
}
|
|
1974
|
-
const
|
|
1974
|
+
const Ji = {
|
|
1975
1975
|
bigint: (t) => typeof t == "bigint",
|
|
1976
1976
|
function: (t) => typeof t == "function",
|
|
1977
1977
|
boolean: (t) => typeof t == "boolean",
|
|
@@ -1983,7 +1983,7 @@ const Xi = {
|
|
|
1983
1983
|
};
|
|
1984
1984
|
function Gt(t, e, n = {}) {
|
|
1985
1985
|
const r = (s, o, a) => {
|
|
1986
|
-
const i =
|
|
1986
|
+
const i = Ji[o];
|
|
1987
1987
|
if (typeof i != "function")
|
|
1988
1988
|
throw new Error(`Invalid validator "${o}", expected function`);
|
|
1989
1989
|
const c = t[s];
|
|
@@ -1996,37 +1996,37 @@ function Gt(t, e, n = {}) {
|
|
|
1996
1996
|
r(s, o, !0);
|
|
1997
1997
|
return t;
|
|
1998
1998
|
}
|
|
1999
|
-
const
|
|
1999
|
+
const Qi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2000
2000
|
__proto__: null,
|
|
2001
|
-
bitGet:
|
|
2002
|
-
bitLen:
|
|
2001
|
+
bitGet: Yi,
|
|
2002
|
+
bitLen: Zi,
|
|
2003
2003
|
bitMask: pe,
|
|
2004
|
-
bitSet:
|
|
2004
|
+
bitSet: Xi,
|
|
2005
2005
|
bytesToHex: ht,
|
|
2006
2006
|
bytesToNumberBE: X,
|
|
2007
|
-
bytesToNumberLE:
|
|
2007
|
+
bytesToNumberLE: ze,
|
|
2008
2008
|
concatBytes: jt,
|
|
2009
|
-
createHmacDrbg:
|
|
2009
|
+
createHmacDrbg: vr,
|
|
2010
2010
|
ensureBytes: V,
|
|
2011
|
-
equalBytes:
|
|
2011
|
+
equalBytes: Wi,
|
|
2012
2012
|
hexToBytes: pt,
|
|
2013
|
-
hexToNumber:
|
|
2013
|
+
hexToNumber: Ge,
|
|
2014
2014
|
numberToBytesBE: Et,
|
|
2015
|
-
numberToBytesLE:
|
|
2016
|
-
numberToHexUnpadded:
|
|
2017
|
-
numberToVarBytesBE:
|
|
2018
|
-
utf8ToBytes:
|
|
2015
|
+
numberToBytesLE: xr,
|
|
2016
|
+
numberToHexUnpadded: Ar,
|
|
2017
|
+
numberToVarBytesBE: qi,
|
|
2018
|
+
utf8ToBytes: Ki,
|
|
2019
2019
|
validateObject: Gt
|
|
2020
2020
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2021
2021
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2022
|
-
const U = BigInt(0), $ = BigInt(1), ut = BigInt(2),
|
|
2022
|
+
const U = BigInt(0), $ = BigInt(1), ut = BigInt(2), tc = BigInt(3), _e = BigInt(4), Cn = BigInt(5), On = BigInt(8);
|
|
2023
2023
|
BigInt(9);
|
|
2024
2024
|
BigInt(16);
|
|
2025
2025
|
function M(t, e) {
|
|
2026
2026
|
const n = t % e;
|
|
2027
2027
|
return n >= U ? n : e + n;
|
|
2028
2028
|
}
|
|
2029
|
-
function
|
|
2029
|
+
function ec(t, e, n) {
|
|
2030
2030
|
if (n <= U || e < U)
|
|
2031
2031
|
throw new Error("Expected power/modulo > 0");
|
|
2032
2032
|
if (n === $)
|
|
@@ -2048,12 +2048,12 @@ function Ne(t, e) {
|
|
|
2048
2048
|
throw new Error("invert: does not exist");
|
|
2049
2049
|
return M(s, e);
|
|
2050
2050
|
}
|
|
2051
|
-
function
|
|
2051
|
+
function nc(t) {
|
|
2052
2052
|
const e = (t - $) / ut;
|
|
2053
2053
|
let n, r, s;
|
|
2054
2054
|
for (n = t - $, r = 0; n % ut === U; n /= ut, r++)
|
|
2055
2055
|
;
|
|
2056
|
-
for (s = ut; s < t &&
|
|
2056
|
+
for (s = ut; s < t && ec(s, e, t) !== t - $; s++)
|
|
2057
2057
|
;
|
|
2058
2058
|
if (r === 1) {
|
|
2059
2059
|
const a = (t + $) / _e;
|
|
@@ -2081,8 +2081,8 @@ function ec(t) {
|
|
|
2081
2081
|
return u;
|
|
2082
2082
|
};
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2085
|
-
if (t % _e ===
|
|
2084
|
+
function rc(t) {
|
|
2085
|
+
if (t % _e === tc) {
|
|
2086
2086
|
const e = (t + $) / _e;
|
|
2087
2087
|
return function(r, s) {
|
|
2088
2088
|
const o = r.pow(s, e);
|
|
@@ -2091,8 +2091,8 @@ function nc(t) {
|
|
|
2091
2091
|
return o;
|
|
2092
2092
|
};
|
|
2093
2093
|
}
|
|
2094
|
-
if (t %
|
|
2095
|
-
const e = (t -
|
|
2094
|
+
if (t % On === Cn) {
|
|
2095
|
+
const e = (t - Cn) / On;
|
|
2096
2096
|
return function(r, s) {
|
|
2097
2097
|
const o = r.mul(s, ut), a = r.pow(o, e), i = r.mul(s, a), c = r.mul(r.mul(i, ut), a), l = r.mul(i, r.sub(c, r.ONE));
|
|
2098
2098
|
if (!r.eql(r.sqr(l), s))
|
|
@@ -2100,9 +2100,9 @@ function nc(t) {
|
|
|
2100
2100
|
return l;
|
|
2101
2101
|
};
|
|
2102
2102
|
}
|
|
2103
|
-
return
|
|
2103
|
+
return nc(t);
|
|
2104
2104
|
}
|
|
2105
|
-
const
|
|
2105
|
+
const sc = [
|
|
2106
2106
|
"create",
|
|
2107
2107
|
"isValid",
|
|
2108
2108
|
"is0",
|
|
@@ -2121,16 +2121,16 @@ const rc = [
|
|
|
2121
2121
|
"mulN",
|
|
2122
2122
|
"sqrN"
|
|
2123
2123
|
];
|
|
2124
|
-
function
|
|
2124
|
+
function qe(t) {
|
|
2125
2125
|
const e = {
|
|
2126
2126
|
ORDER: "bigint",
|
|
2127
2127
|
MASK: "bigint",
|
|
2128
2128
|
BYTES: "isSafeInteger",
|
|
2129
2129
|
BITS: "isSafeInteger"
|
|
2130
|
-
}, n =
|
|
2130
|
+
}, n = sc.reduce((r, s) => (r[s] = "function", r), e);
|
|
2131
2131
|
return Gt(t, n);
|
|
2132
2132
|
}
|
|
2133
|
-
function
|
|
2133
|
+
function Ir(t, e, n) {
|
|
2134
2134
|
if (n < U)
|
|
2135
2135
|
throw new Error("Expected power > 0");
|
|
2136
2136
|
if (n === U)
|
|
@@ -2142,21 +2142,21 @@ function vr(t, e, n) {
|
|
|
2142
2142
|
n & $ && (r = t.mul(r, s)), s = t.sqr(s), n >>= $;
|
|
2143
2143
|
return r;
|
|
2144
2144
|
}
|
|
2145
|
-
function
|
|
2145
|
+
function oc(t, e) {
|
|
2146
2146
|
const n = new Array(e.length), r = e.reduce((o, a, i) => t.is0(a) ? o : (n[i] = o, t.mul(o, a)), t.ONE), s = t.inv(r);
|
|
2147
2147
|
return e.reduceRight((o, a, i) => t.is0(a) ? o : (n[i] = t.mul(o, n[i]), t.mul(o, a)), s), n;
|
|
2148
2148
|
}
|
|
2149
|
-
function
|
|
2149
|
+
function We(t, e) {
|
|
2150
2150
|
const n = e !== void 0 ? e : t.toString(2).length, r = Math.ceil(n / 8);
|
|
2151
2151
|
return { nBitLength: n, nByteLength: r };
|
|
2152
2152
|
}
|
|
2153
|
-
function
|
|
2153
|
+
function Ke(t, e, n = !1, r = {}) {
|
|
2154
2154
|
if (t <= U)
|
|
2155
2155
|
throw new Error(`Expected Fp ORDER > 0, got ${t}`);
|
|
2156
|
-
const { nBitLength: s, nByteLength: o } =
|
|
2156
|
+
const { nBitLength: s, nByteLength: o } = We(t, e);
|
|
2157
2157
|
if (o > 2048)
|
|
2158
2158
|
throw new Error("Field lengths over 2048 bytes are not supported");
|
|
2159
|
-
const a =
|
|
2159
|
+
const a = rc(t), i = Object.freeze({
|
|
2160
2160
|
ORDER: t,
|
|
2161
2161
|
BITS: s,
|
|
2162
2162
|
BYTES: o,
|
|
@@ -2177,7 +2177,7 @@ function We(t, e, n = !1, r = {}) {
|
|
|
2177
2177
|
add: (c, l) => M(c + l, t),
|
|
2178
2178
|
sub: (c, l) => M(c - l, t),
|
|
2179
2179
|
mul: (c, l) => M(c * l, t),
|
|
2180
|
-
pow: (c, l) =>
|
|
2180
|
+
pow: (c, l) => Ir(i, c, l),
|
|
2181
2181
|
div: (c, l) => M(c * Ne(l, t), t),
|
|
2182
2182
|
// Same as above, but doesn't normalize
|
|
2183
2183
|
sqrN: (c) => c * c,
|
|
@@ -2186,31 +2186,31 @@ function We(t, e, n = !1, r = {}) {
|
|
|
2186
2186
|
mulN: (c, l) => c * l,
|
|
2187
2187
|
inv: (c) => Ne(c, t),
|
|
2188
2188
|
sqrt: r.sqrt || ((c) => a(i, c)),
|
|
2189
|
-
invertBatch: (c) =>
|
|
2189
|
+
invertBatch: (c) => oc(i, c),
|
|
2190
2190
|
// TODO: do we really need constant cmov?
|
|
2191
2191
|
// We don't have const-time bigints anyway, so probably will be not very useful
|
|
2192
2192
|
cmov: (c, l, d) => d ? l : c,
|
|
2193
|
-
toBytes: (c) => n ?
|
|
2193
|
+
toBytes: (c) => n ? xr(c, o) : Et(c, o),
|
|
2194
2194
|
fromBytes: (c) => {
|
|
2195
2195
|
if (c.length !== o)
|
|
2196
2196
|
throw new Error(`Fp.fromBytes: expected ${o}, got ${c.length}`);
|
|
2197
|
-
return n ?
|
|
2197
|
+
return n ? ze(c) : X(c);
|
|
2198
2198
|
}
|
|
2199
2199
|
});
|
|
2200
2200
|
return Object.freeze(i);
|
|
2201
2201
|
}
|
|
2202
|
-
function
|
|
2202
|
+
function ac(t, e, n = !1) {
|
|
2203
2203
|
t = V("privateHash", t);
|
|
2204
|
-
const r = t.length, s =
|
|
2204
|
+
const r = t.length, s = We(e).nByteLength + 8;
|
|
2205
2205
|
if (s < 24 || r < s || r > 1024)
|
|
2206
2206
|
throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${r}`);
|
|
2207
|
-
const o = n ?
|
|
2207
|
+
const o = n ? ze(t) : X(t);
|
|
2208
2208
|
return M(o, e - $) + $;
|
|
2209
2209
|
}
|
|
2210
2210
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2211
|
-
function
|
|
2211
|
+
function ic(t) {
|
|
2212
2212
|
const { Fp: e } = t;
|
|
2213
|
-
|
|
2213
|
+
qe(e);
|
|
2214
2214
|
for (const c of ["t", "roundsFull", "roundsPartial"])
|
|
2215
2215
|
if (typeof t[c] != "number" || !Number.isSafeInteger(t[c]))
|
|
2216
2216
|
throw new Error(`Poseidon: invalid param ${c}=${t[c]} (${typeof t[c]})`);
|
|
@@ -2220,7 +2220,7 @@ function ac(t) {
|
|
|
2220
2220
|
if (n === void 0 && (n = 5), typeof n != "number" || !Number.isSafeInteger(n))
|
|
2221
2221
|
throw new Error(`Poseidon wrong sboxPower=${n}`);
|
|
2222
2222
|
const r = BigInt(n);
|
|
2223
|
-
let s = (c) =>
|
|
2223
|
+
let s = (c) => Ir(e, c, r);
|
|
2224
2224
|
if (n === 3 ? s = (c) => e.mul(e.sqrN(c), c) : n === 5 && (s = (c) => e.mul(e.sqrN(e.sqrN(c)), c)), t.roundsFull % 2 !== 0)
|
|
2225
2225
|
throw new Error(`Poseidon roundsFull is not even: ${t.roundsFull}`);
|
|
2226
2226
|
const o = t.roundsFull + t.roundsPartial;
|
|
@@ -2248,8 +2248,8 @@ function ac(t) {
|
|
|
2248
2248
|
});
|
|
2249
2249
|
return Object.freeze({ ...t, rounds: o, sboxFn: s, roundConstants: a, mds: i });
|
|
2250
2250
|
}
|
|
2251
|
-
function
|
|
2252
|
-
const { t: e, Fp: n, rounds: r, sboxFn: s, reversePartialPowIdx: o } =
|
|
2251
|
+
function cc(t) {
|
|
2252
|
+
const { t: e, Fp: n, rounds: r, sboxFn: s, reversePartialPowIdx: o } = ic(t), a = Math.floor(t.roundsFull / 2), i = o ? e - 1 : 0, c = (d, u, w) => (d = d.map((m, S) => n.add(m, t.roundConstants[w][S])), u ? d = d.map((m) => s(m)) : d[i] = s(d[i]), d = t.mds.map((m) => m.reduce((S, f, g) => n.add(S, n.mulN(f, d[g])), n.ZERO)), d), l = function(u) {
|
|
2253
2253
|
if (!Array.isArray(u) || u.length !== e)
|
|
2254
2254
|
throw new Error(`Poseidon: wrong values (expected array of bigints with length ${e})`);
|
|
2255
2255
|
u = u.map((m) => {
|
|
@@ -2271,8 +2271,8 @@ function ic(t) {
|
|
|
2271
2271
|
return l.roundConstants = t.roundConstants, l;
|
|
2272
2272
|
}
|
|
2273
2273
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2274
|
-
const
|
|
2275
|
-
function
|
|
2274
|
+
const lc = BigInt(0), ve = BigInt(1);
|
|
2275
|
+
function uc(t, e) {
|
|
2276
2276
|
const n = (s, o) => {
|
|
2277
2277
|
const a = o.negate();
|
|
2278
2278
|
return s ? a : o;
|
|
@@ -2285,7 +2285,7 @@ function lc(t, e) {
|
|
|
2285
2285
|
// non-const time multiplication ladder
|
|
2286
2286
|
unsafeLadder(s, o) {
|
|
2287
2287
|
let a = t.ZERO, i = s;
|
|
2288
|
-
for (; o >
|
|
2288
|
+
for (; o > lc; )
|
|
2289
2289
|
o & ve && (a = a.add(i)), i = i.double(), o >>= ve;
|
|
2290
2290
|
return a;
|
|
2291
2291
|
},
|
|
@@ -2337,8 +2337,8 @@ function lc(t, e) {
|
|
|
2337
2337
|
}
|
|
2338
2338
|
};
|
|
2339
2339
|
}
|
|
2340
|
-
function
|
|
2341
|
-
return
|
|
2340
|
+
function Tr(t) {
|
|
2341
|
+
return qe(t.Fp), Gt(t, {
|
|
2342
2342
|
n: "bigint",
|
|
2343
2343
|
h: "bigint",
|
|
2344
2344
|
Gx: "field",
|
|
@@ -2347,14 +2347,14 @@ function Ir(t) {
|
|
|
2347
2347
|
nBitLength: "isSafeInteger",
|
|
2348
2348
|
nByteLength: "isSafeInteger"
|
|
2349
2349
|
}), Object.freeze({
|
|
2350
|
-
...
|
|
2350
|
+
...We(t.n, t.nBitLength),
|
|
2351
2351
|
...t,
|
|
2352
2352
|
p: t.Fp.ORDER
|
|
2353
2353
|
});
|
|
2354
2354
|
}
|
|
2355
2355
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2356
|
-
function
|
|
2357
|
-
const e =
|
|
2356
|
+
function dc(t) {
|
|
2357
|
+
const e = Tr(t);
|
|
2358
2358
|
Gt(e, {
|
|
2359
2359
|
a: "field",
|
|
2360
2360
|
b: "field"
|
|
@@ -2376,7 +2376,7 @@ function uc(t) {
|
|
|
2376
2376
|
}
|
|
2377
2377
|
return Object.freeze({ ...e });
|
|
2378
2378
|
}
|
|
2379
|
-
const { bytesToNumberBE:
|
|
2379
|
+
const { bytesToNumberBE: fc, hexToBytes: hc } = Qi, dt = {
|
|
2380
2380
|
// asn.1 DER encoding utils
|
|
2381
2381
|
Err: class extends Error {
|
|
2382
2382
|
constructor(e = "") {
|
|
@@ -2394,10 +2394,10 @@ const { bytesToNumberBE: dc, hexToBytes: fc } = Ji, dt = {
|
|
|
2394
2394
|
throw new e("Invalid signature integer: negative");
|
|
2395
2395
|
if (r[0] === 0 && !(r[1] & 128))
|
|
2396
2396
|
throw new e("Invalid signature integer: unnecessary leading zero");
|
|
2397
|
-
return { d:
|
|
2397
|
+
return { d: fc(r), l: t.subarray(n + 2) };
|
|
2398
2398
|
},
|
|
2399
2399
|
toSig(t) {
|
|
2400
|
-
const { Err: e } = dt, n = typeof t == "string" ?
|
|
2400
|
+
const { Err: e } = dt, n = typeof t == "string" ? hc(t) : t;
|
|
2401
2401
|
if (!(n instanceof Uint8Array))
|
|
2402
2402
|
throw new Error("ui8a expected");
|
|
2403
2403
|
let r = n.length;
|
|
@@ -2419,10 +2419,10 @@ const { bytesToNumberBE: dc, hexToBytes: fc } = Ji, dt = {
|
|
|
2419
2419
|
}
|
|
2420
2420
|
}, et = BigInt(0), q = BigInt(1);
|
|
2421
2421
|
BigInt(2);
|
|
2422
|
-
const
|
|
2422
|
+
const kn = BigInt(3);
|
|
2423
2423
|
BigInt(4);
|
|
2424
|
-
function
|
|
2425
|
-
const e =
|
|
2424
|
+
function pc(t) {
|
|
2425
|
+
const e = dc(t), { Fp: n } = e, r = e.toBytes || ((S, f, g) => {
|
|
2426
2426
|
const b = f.toAffine();
|
|
2427
2427
|
return jt(Uint8Array.from([4]), n.toBytes(b.x), n.toBytes(b.y));
|
|
2428
2428
|
}), s = e.fromBytes || ((S) => {
|
|
@@ -2555,7 +2555,7 @@ function hc(t) {
|
|
|
2555
2555
|
// https://eprint.iacr.org/2015/1060, algorithm 3
|
|
2556
2556
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
2557
2557
|
double() {
|
|
2558
|
-
const { a: f, b: g } = e, b = n.mul(g,
|
|
2558
|
+
const { a: f, b: g } = e, b = n.mul(g, kn), { px: E, py: x, pz: _ } = this;
|
|
2559
2559
|
let B = n.ZERO, A = n.ZERO, v = n.ZERO, T = n.mul(E, E), G = n.mul(x, x), R = n.mul(_, _), N = n.mul(E, x);
|
|
2560
2560
|
return N = n.add(N, N), v = n.mul(E, _), v = n.add(v, v), B = n.mul(f, v), A = n.mul(b, R), A = n.add(B, A), B = n.sub(G, A), A = n.add(G, A), A = n.mul(B, A), B = n.mul(N, B), v = n.mul(b, v), R = n.mul(f, R), N = n.sub(T, R), N = n.mul(f, N), N = n.add(N, v), v = n.add(T, T), T = n.add(v, T), T = n.add(T, R), T = n.mul(T, N), A = n.add(A, T), R = n.mul(x, _), R = n.add(R, R), T = n.mul(R, N), B = n.sub(B, T), v = n.mul(R, G), v = n.add(v, v), v = n.add(v, v), new u(B, A, v);
|
|
2561
2561
|
}
|
|
@@ -2567,7 +2567,7 @@ function hc(t) {
|
|
|
2567
2567
|
d(f);
|
|
2568
2568
|
const { px: g, py: b, pz: E } = this, { px: x, py: _, pz: B } = f;
|
|
2569
2569
|
let A = n.ZERO, v = n.ZERO, T = n.ZERO;
|
|
2570
|
-
const G = e.a, R = n.mul(e.b,
|
|
2570
|
+
const G = e.a, R = n.mul(e.b, kn);
|
|
2571
2571
|
let N = n.mul(g, x), L = n.mul(b, _), D = n.mul(E, B), rt = n.add(g, b), p = n.add(x, _);
|
|
2572
2572
|
rt = n.mul(rt, p), p = n.add(N, L), rt = n.sub(rt, p), p = n.add(g, E);
|
|
2573
2573
|
let y = n.add(x, B);
|
|
@@ -2670,7 +2670,7 @@ function hc(t) {
|
|
|
2670
2670
|
}
|
|
2671
2671
|
}
|
|
2672
2672
|
u.BASE = new u(e.Gx, e.Gy, n.ONE), u.ZERO = new u(n.ZERO, n.ONE, n.ZERO);
|
|
2673
|
-
const w = e.nBitLength, m =
|
|
2673
|
+
const w = e.nBitLength, m = uc(u, e.endo ? Math.ceil(w / 2) : w);
|
|
2674
2674
|
return {
|
|
2675
2675
|
CURVE: e,
|
|
2676
2676
|
ProjectivePoint: u,
|
|
@@ -2679,8 +2679,8 @@ function hc(t) {
|
|
|
2679
2679
|
isWithinCurveOrder: a
|
|
2680
2680
|
};
|
|
2681
2681
|
}
|
|
2682
|
-
function
|
|
2683
|
-
const e =
|
|
2682
|
+
function mc(t) {
|
|
2683
|
+
const e = Tr(t);
|
|
2684
2684
|
return Gt(e, {
|
|
2685
2685
|
hash: "hash",
|
|
2686
2686
|
hmac: "function",
|
|
@@ -2691,8 +2691,8 @@ function pc(t) {
|
|
|
2691
2691
|
lowS: "boolean"
|
|
2692
2692
|
}), Object.freeze({ lowS: !0, ...e });
|
|
2693
2693
|
}
|
|
2694
|
-
function
|
|
2695
|
-
const e =
|
|
2694
|
+
function gc(t) {
|
|
2695
|
+
const e = mc(t), { Fp: n, n: r } = e, s = n.BYTES + 1, o = 2 * n.BYTES + 1;
|
|
2696
2696
|
function a(p) {
|
|
2697
2697
|
return et < p && p < n.ORDER;
|
|
2698
2698
|
}
|
|
@@ -2702,7 +2702,7 @@ function mc(t) {
|
|
|
2702
2702
|
function c(p) {
|
|
2703
2703
|
return Ne(p, r);
|
|
2704
2704
|
}
|
|
2705
|
-
const { ProjectivePoint: l, normPrivateKeyToScalar: d, weierstrassEquation: u, isWithinCurveOrder: w } =
|
|
2705
|
+
const { ProjectivePoint: l, normPrivateKeyToScalar: d, weierstrassEquation: u, isWithinCurveOrder: w } = pc({
|
|
2706
2706
|
...e,
|
|
2707
2707
|
toBytes(p, y, I) {
|
|
2708
2708
|
const P = y.toAffine(), C = n.toBytes(P.x), j = jt;
|
|
@@ -2805,7 +2805,7 @@ function mc(t) {
|
|
|
2805
2805
|
* as per FIPS 186 B.4.1 with modulo bias being neglible.
|
|
2806
2806
|
*/
|
|
2807
2807
|
randomPrivateKey: () => {
|
|
2808
|
-
const p = e.randomBytes(n.BYTES + 8), y =
|
|
2808
|
+
const p = e.randomBytes(n.BYTES + 8), y = ac(p, r);
|
|
2809
2809
|
return Et(y, e.nByteLength);
|
|
2810
2810
|
},
|
|
2811
2811
|
/**
|
|
@@ -2863,21 +2863,21 @@ function mc(t) {
|
|
|
2863
2863
|
const wt = A(lt);
|
|
2864
2864
|
if (!w(wt))
|
|
2865
2865
|
return;
|
|
2866
|
-
const
|
|
2866
|
+
const Xe = c(wt), yt = l.BASE.multiply(wt).toAffine(), W = i(yt.x);
|
|
2867
2867
|
if (W === et)
|
|
2868
2868
|
return;
|
|
2869
|
-
const bt = i(
|
|
2869
|
+
const bt = i(Xe * i(at + W * ot));
|
|
2870
2870
|
if (bt === et)
|
|
2871
2871
|
return;
|
|
2872
|
-
let
|
|
2873
|
-
return j && S(bt) && (
|
|
2872
|
+
let Je = (yt.x === W ? 0 : 2) | Number(yt.y & q), Qe = bt;
|
|
2873
|
+
return j && S(bt) && (Qe = f(bt), Je ^= 1), new b(W, Qe, Je);
|
|
2874
2874
|
}
|
|
2875
2875
|
return { seed: Bt, k2sig: we };
|
|
2876
2876
|
}
|
|
2877
2877
|
const N = { lowS: e.lowS, prehash: !1 }, L = { lowS: e.lowS, prehash: !1 };
|
|
2878
2878
|
function D(p, y, I = N) {
|
|
2879
2879
|
const { seed: P, k2sig: C } = R(p, y, I);
|
|
2880
|
-
return
|
|
2880
|
+
return vr(e.hash.outputLen, e.nByteLength, e.hmac)(P, C);
|
|
2881
2881
|
}
|
|
2882
2882
|
l.BASE._setWindowSize(8);
|
|
2883
2883
|
function rt(p, y, I, P = L) {
|
|
@@ -2928,57 +2928,57 @@ function Ce(t) {
|
|
|
2928
2928
|
if (!Number.isSafeInteger(t) || t < 0)
|
|
2929
2929
|
throw new Error(`Wrong positive integer: ${t}`);
|
|
2930
2930
|
}
|
|
2931
|
-
function
|
|
2931
|
+
function wc(t) {
|
|
2932
2932
|
if (typeof t != "boolean")
|
|
2933
2933
|
throw new Error(`Expected boolean, not ${t}`);
|
|
2934
2934
|
}
|
|
2935
|
-
function
|
|
2935
|
+
function Br(t, ...e) {
|
|
2936
2936
|
if (!(t instanceof Uint8Array))
|
|
2937
2937
|
throw new TypeError("Expected Uint8Array");
|
|
2938
2938
|
if (e.length > 0 && !e.includes(t.length))
|
|
2939
2939
|
throw new TypeError(`Expected Uint8Array of length ${e}, not of length=${t.length}`);
|
|
2940
2940
|
}
|
|
2941
|
-
function
|
|
2941
|
+
function yc(t) {
|
|
2942
2942
|
if (typeof t != "function" || typeof t.create != "function")
|
|
2943
2943
|
throw new Error("Hash should be wrapped by utils.wrapConstructor");
|
|
2944
2944
|
Ce(t.outputLen), Ce(t.blockLen);
|
|
2945
2945
|
}
|
|
2946
|
-
function
|
|
2946
|
+
function bc(t, e = !0) {
|
|
2947
2947
|
if (t.destroyed)
|
|
2948
2948
|
throw new Error("Hash instance has been destroyed");
|
|
2949
2949
|
if (e && t.finished)
|
|
2950
2950
|
throw new Error("Hash#digest() has already been called");
|
|
2951
2951
|
}
|
|
2952
|
-
function
|
|
2953
|
-
|
|
2952
|
+
function Sc(t, e) {
|
|
2953
|
+
Br(t);
|
|
2954
2954
|
const n = e.outputLen;
|
|
2955
2955
|
if (t.length < n)
|
|
2956
2956
|
throw new Error(`digestInto() expects output buffer of length at least ${n}`);
|
|
2957
2957
|
}
|
|
2958
2958
|
const Zt = {
|
|
2959
2959
|
number: Ce,
|
|
2960
|
-
bool:
|
|
2961
|
-
bytes:
|
|
2962
|
-
hash:
|
|
2963
|
-
exists:
|
|
2964
|
-
output:
|
|
2960
|
+
bool: wc,
|
|
2961
|
+
bytes: Br,
|
|
2962
|
+
hash: yc,
|
|
2963
|
+
exists: bc,
|
|
2964
|
+
output: Sc
|
|
2965
2965
|
}, Ie = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
|
|
2966
2966
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2967
|
-
const
|
|
2968
|
-
if (!
|
|
2967
|
+
const Ec = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
2968
|
+
if (!Ec)
|
|
2969
2969
|
throw new Error("Non little-endian hardware is not supported");
|
|
2970
2970
|
Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
2971
|
-
function
|
|
2971
|
+
function Ac(t) {
|
|
2972
2972
|
if (typeof t != "string")
|
|
2973
2973
|
throw new TypeError(`utf8ToBytes expected string, got ${typeof t}`);
|
|
2974
2974
|
return new TextEncoder().encode(t);
|
|
2975
2975
|
}
|
|
2976
|
-
function
|
|
2977
|
-
if (typeof t == "string" && (t =
|
|
2976
|
+
function xc(t) {
|
|
2977
|
+
if (typeof t == "string" && (t = Ac(t)), !(t instanceof Uint8Array))
|
|
2978
2978
|
throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);
|
|
2979
2979
|
return t;
|
|
2980
2980
|
}
|
|
2981
|
-
function
|
|
2981
|
+
function vc(...t) {
|
|
2982
2982
|
if (!t.every((r) => r instanceof Uint8Array))
|
|
2983
2983
|
throw new Error("Uint8Array list expected");
|
|
2984
2984
|
if (t.length === 1)
|
|
@@ -2990,21 +2990,21 @@ function xc(...t) {
|
|
|
2990
2990
|
}
|
|
2991
2991
|
return n;
|
|
2992
2992
|
}
|
|
2993
|
-
class
|
|
2993
|
+
class Ic {
|
|
2994
2994
|
// Safe version that clones internal state
|
|
2995
2995
|
clone() {
|
|
2996
2996
|
return this._cloneInto();
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
2999
|
-
function
|
|
2999
|
+
function Tc(t = 32) {
|
|
3000
3000
|
if (Ie && typeof Ie.getRandomValues == "function")
|
|
3001
3001
|
return Ie.getRandomValues(new Uint8Array(t));
|
|
3002
3002
|
throw new Error("crypto.getRandomValues must be defined");
|
|
3003
3003
|
}
|
|
3004
|
-
class
|
|
3004
|
+
class _r extends Ic {
|
|
3005
3005
|
constructor(e, n) {
|
|
3006
3006
|
super(), this.finished = !1, this.destroyed = !1, Zt.hash(e);
|
|
3007
|
-
const r =
|
|
3007
|
+
const r = xc(n);
|
|
3008
3008
|
if (this.iHash = e.create(), typeof this.iHash.update != "function")
|
|
3009
3009
|
throw new TypeError("Expected instance of class which extends utils.Hash");
|
|
3010
3010
|
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
@@ -3036,51 +3036,51 @@ class Br extends vc {
|
|
|
3036
3036
|
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
3037
3037
|
}
|
|
3038
3038
|
}
|
|
3039
|
-
const
|
|
3040
|
-
|
|
3039
|
+
const Nr = (t, e, n) => new _r(t, e).update(n).digest();
|
|
3040
|
+
Nr.create = (t, e) => new _r(t, e);
|
|
3041
3041
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3042
|
-
function
|
|
3042
|
+
function Bc(t) {
|
|
3043
3043
|
return {
|
|
3044
3044
|
hash: t,
|
|
3045
|
-
hmac: (e, ...n) =>
|
|
3046
|
-
randomBytes:
|
|
3045
|
+
hmac: (e, ...n) => Nr(t, e, vc(...n)),
|
|
3046
|
+
randomBytes: Tc
|
|
3047
3047
|
};
|
|
3048
3048
|
}
|
|
3049
|
-
const
|
|
3050
|
-
function
|
|
3049
|
+
const Pn = BigInt("3618502788666131213697322783095070105526743751716087489154079457884512865583"), Cr = 252;
|
|
3050
|
+
function Rn(t) {
|
|
3051
3051
|
for (; t[0] === 0; )
|
|
3052
3052
|
t = t.subarray(1);
|
|
3053
|
-
const e = t.length * 8 -
|
|
3053
|
+
const e = t.length * 8 - Cr, n = X(t);
|
|
3054
3054
|
return e > 0 ? n >> BigInt(e) : n;
|
|
3055
3055
|
}
|
|
3056
|
-
function
|
|
3057
|
-
return typeof t == "string" && (t =
|
|
3056
|
+
function Or(t) {
|
|
3057
|
+
return typeof t == "string" && (t = Cc(t), t.length & 1 && (t = "0" + t)), pt(t);
|
|
3058
3058
|
}
|
|
3059
|
-
const
|
|
3059
|
+
const kr = gc({
|
|
3060
3060
|
a: BigInt(1),
|
|
3061
3061
|
b: BigInt("3141592653589793238462643383279502884197169399375105820974944592307816406665"),
|
|
3062
|
-
Fp:
|
|
3063
|
-
n:
|
|
3064
|
-
nBitLength:
|
|
3062
|
+
Fp: Ke(BigInt("0x800000000000011000000000000000000000000000000000000000000000001")),
|
|
3063
|
+
n: Pn,
|
|
3064
|
+
nBitLength: Cr,
|
|
3065
3065
|
Gx: BigInt("874739451078007766457464989774322083649278607533249481151382481072868806602"),
|
|
3066
3066
|
Gy: BigInt("152666792071518830868575557812948353041420400780739481342941381225525861407"),
|
|
3067
3067
|
h: BigInt(1),
|
|
3068
3068
|
lowS: !1,
|
|
3069
|
-
...
|
|
3070
|
-
bits2int:
|
|
3069
|
+
...Bc(Sr),
|
|
3070
|
+
bits2int: Rn,
|
|
3071
3071
|
bits2int_modN: (t) => {
|
|
3072
3072
|
const e = X(t).toString(16);
|
|
3073
|
-
return e.length === 63 && (t =
|
|
3073
|
+
return e.length === 63 && (t = Or(e + "0")), M(Rn(t), Pn);
|
|
3074
3074
|
}
|
|
3075
3075
|
});
|
|
3076
|
-
function Bc(t) {
|
|
3077
|
-
return V("", typeof t == "string" ? Cr(t) : t);
|
|
3078
|
-
}
|
|
3079
|
-
const { CURVE: Eu, ProjectivePoint: kt, Signature: Au, utils: xu } = Or;
|
|
3080
3076
|
function _c(t) {
|
|
3081
|
-
return
|
|
3077
|
+
return V("", typeof t == "string" ? Or(t) : t);
|
|
3082
3078
|
}
|
|
3079
|
+
const { CURVE: Au, ProjectivePoint: kt, Signature: xu, utils: vu } = kr;
|
|
3083
3080
|
function Nc(t) {
|
|
3081
|
+
return `0x${ht(t.subarray(1)).replace(/^0+/gm, "")}`;
|
|
3082
|
+
}
|
|
3083
|
+
function Cc(t) {
|
|
3084
3084
|
return t.replace(/^0x/i, "");
|
|
3085
3085
|
}
|
|
3086
3086
|
const Lt = [
|
|
@@ -3090,7 +3090,7 @@ const Lt = [
|
|
|
3090
3090
|
new kt(2138414695194151160943305727036575959195309218611738193261179310511854807447n, 113410276730064486255102093846540133784865286929052426931474106396135072156n, 1n),
|
|
3091
3091
|
new kt(2379962749567351885752724891227938183011949129833673362440656643086021394946n, 776496453633298175483985398648758586525933812536653089401905292063708816422n, 1n)
|
|
3092
3092
|
];
|
|
3093
|
-
function
|
|
3093
|
+
function Pr(t, e) {
|
|
3094
3094
|
const n = [];
|
|
3095
3095
|
let r = t;
|
|
3096
3096
|
for (let s = 0; s < 248; s++)
|
|
@@ -3100,8 +3100,8 @@ function kr(t, e) {
|
|
|
3100
3100
|
n.push(r), r = r.double();
|
|
3101
3101
|
return n;
|
|
3102
3102
|
}
|
|
3103
|
-
const
|
|
3104
|
-
function
|
|
3103
|
+
const Oc = Pr(Lt[1], Lt[2]), kc = Pr(Lt[3], Lt[4]);
|
|
3104
|
+
function Pc(t) {
|
|
3105
3105
|
let e;
|
|
3106
3106
|
if (typeof t == "bigint")
|
|
3107
3107
|
e = t;
|
|
@@ -3110,13 +3110,13 @@ function kc(t) {
|
|
|
3110
3110
|
throw new Error(`Invalid pedersenArg: ${t}`);
|
|
3111
3111
|
e = BigInt(t);
|
|
3112
3112
|
} else
|
|
3113
|
-
e = X(
|
|
3114
|
-
if (!(0n <= e && e <
|
|
3113
|
+
e = X(_c(t));
|
|
3114
|
+
if (!(0n <= e && e < kr.CURVE.Fp.ORDER))
|
|
3115
3115
|
throw new Error(`PedersenArg should be 0 <= value < CURVE.P: ${e}`);
|
|
3116
3116
|
return e;
|
|
3117
3117
|
}
|
|
3118
|
-
function
|
|
3119
|
-
let r =
|
|
3118
|
+
function $n(t, e, n) {
|
|
3119
|
+
let r = Pc(e);
|
|
3120
3120
|
for (let s = 0; s < 252; s++) {
|
|
3121
3121
|
const o = n[s];
|
|
3122
3122
|
if (o.equals(t))
|
|
@@ -3125,33 +3125,33 @@ function Rn(t, e, n) {
|
|
|
3125
3125
|
}
|
|
3126
3126
|
return t;
|
|
3127
3127
|
}
|
|
3128
|
-
function
|
|
3128
|
+
function Rc(t, e) {
|
|
3129
3129
|
let n = Lt[0];
|
|
3130
|
-
return n =
|
|
3130
|
+
return n = $n(n, t, Oc), n = $n(n, e, kc), Nc(n.toRawBytes(!0));
|
|
3131
3131
|
}
|
|
3132
|
-
const
|
|
3133
|
-
|
|
3134
|
-
const
|
|
3135
|
-
function
|
|
3136
|
-
const r = t.fromBytes(
|
|
3132
|
+
const $c = pe(250), Fc = (t) => X(Ui(t)) & $c;
|
|
3133
|
+
Ke(BigInt("14474011154664525231415395255581126252639794253786371766033694892385558855681"));
|
|
3134
|
+
const Uc = Ke(BigInt("3618502788666131213697322783095070105623107215331596699973092056135872020481"));
|
|
3135
|
+
function jc(t, e, n) {
|
|
3136
|
+
const r = t.fromBytes(Sr(pr(`${e}${n}`)));
|
|
3137
3137
|
return t.create(r);
|
|
3138
3138
|
}
|
|
3139
|
-
const
|
|
3139
|
+
const Lc = [
|
|
3140
3140
|
[3, 1, 1],
|
|
3141
3141
|
[1, -1, 1],
|
|
3142
3142
|
[1, 1, -2]
|
|
3143
3143
|
].map((t) => t.map(BigInt));
|
|
3144
|
-
function
|
|
3145
|
-
if (
|
|
3144
|
+
function Dc(t, e) {
|
|
3145
|
+
if (qe(t.Fp), !Number.isSafeInteger(t.rate) || !Number.isSafeInteger(t.capacity))
|
|
3146
3146
|
throw new Error(`Wrong poseidon opts: ${t}`);
|
|
3147
3147
|
const n = t.rate + t.capacity, r = t.roundsFull + t.roundsPartial, s = [];
|
|
3148
3148
|
for (let a = 0; a < r; a++) {
|
|
3149
3149
|
const i = [];
|
|
3150
3150
|
for (let c = 0; c < n; c++)
|
|
3151
|
-
i.push(
|
|
3151
|
+
i.push(jc(t.Fp, "Hades", n * a + c));
|
|
3152
3152
|
s.push(i);
|
|
3153
3153
|
}
|
|
3154
|
-
const o =
|
|
3154
|
+
const o = cc({
|
|
3155
3155
|
...t,
|
|
3156
3156
|
t: n,
|
|
3157
3157
|
sboxPower: 3,
|
|
@@ -3161,14 +3161,14 @@ function Lc(t, e) {
|
|
|
3161
3161
|
});
|
|
3162
3162
|
return o.m = n, o.rate = t.rate, o.capacity = t.capacity, o;
|
|
3163
3163
|
}
|
|
3164
|
-
|
|
3164
|
+
Dc({ Fp: Uc, rate: 2, capacity: 1, roundsFull: 8, roundsPartial: 83 }, Lc);
|
|
3165
3165
|
var Oe;
|
|
3166
3166
|
(function(t) {
|
|
3167
3167
|
t.NOT_STARTED = "NOT_STARTED", t.ONGOING = "ONGOING", t.AWAITING_FUNDS = "AWAITING_FUNDS", t.AWAITING_COMPLETION = "AWAITING_COMPLETION", t.COMPLETED = "COMPLETED", t.CANCELLED = "CANCELLED", t.ERROR = "ERROR";
|
|
3168
3168
|
})(Oe || (Oe = {}));
|
|
3169
|
-
const
|
|
3169
|
+
const Hc = h.object({
|
|
3170
3170
|
recoveryId: h.number()
|
|
3171
|
-
}),
|
|
3171
|
+
}), Iu = h.object({
|
|
3172
3172
|
feeToken: se,
|
|
3173
3173
|
signerSignature: h.object({
|
|
3174
3174
|
type: h.literal("StarknetKey"),
|
|
@@ -3178,23 +3178,25 @@ const Dc = h.object({
|
|
|
3178
3178
|
s: Pt
|
|
3179
3179
|
})
|
|
3180
3180
|
})
|
|
3181
|
-
}),
|
|
3181
|
+
}), Vc = h.nativeEnum(Oe), Rr = h.object({
|
|
3182
3182
|
recoveryId: h.number(),
|
|
3183
|
-
status:
|
|
3183
|
+
status: Vc,
|
|
3184
3184
|
completionTime: h.array(h.number()).optional()
|
|
3185
|
-
}), Vc = h.object({
|
|
3186
|
-
activeRecovery: Pr.optional().or(h.null()).optional(),
|
|
3187
|
-
minFees: h.record(h.number()).optional()
|
|
3188
3185
|
}), Mc = h.object({
|
|
3189
|
-
|
|
3186
|
+
activeRecovery: Rr.optional().or(h.null()).optional(),
|
|
3190
3187
|
minFees: h.record(h.number()).optional()
|
|
3191
|
-
}), Gc = h.
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3188
|
+
}), Gc = h.object({
|
|
3189
|
+
recovery: Rr.optional().or(h.null()).optional(),
|
|
3190
|
+
minFees: h.record(h.number()).optional()
|
|
3191
|
+
});
|
|
3192
|
+
var ke;
|
|
3193
|
+
(function(t) {
|
|
3194
|
+
t.UNDEPLOYED_ACCOUNT = "undeployedAccount", t.NOT_ENOUGH_TO_PAY_FEES = "notEnoughToPayFees", t.RECOVERY_ALREADY_EXISTS = "recoveryAlreadyExists";
|
|
3195
|
+
})(ke || (ke = {}));
|
|
3196
|
+
const zc = h.nativeEnum(ke), Tu = h.object({
|
|
3197
|
+
status: zc
|
|
3196
3198
|
});
|
|
3197
|
-
class
|
|
3199
|
+
class Bu {
|
|
3198
3200
|
constructor(e, n) {
|
|
3199
3201
|
this.apiBase = e, this.httpService = n;
|
|
3200
3202
|
}
|
|
@@ -3206,7 +3208,7 @@ class Tu {
|
|
|
3206
3208
|
* @returns A promise that resolves to the on-chain recovery details.
|
|
3207
3209
|
*/
|
|
3208
3210
|
async getRecovery(e, n) {
|
|
3209
|
-
const r = k(this.apiBase, "accounts", "starknet", e, "recovery", `${n}`), s = await this.httpService.get(r), o =
|
|
3211
|
+
const r = k(this.apiBase, "accounts", "starknet", e, "recovery", `${n}`), s = await this.httpService.get(r), o = Gc.safeParse(s);
|
|
3210
3212
|
return o.error ? null : o.data;
|
|
3211
3213
|
}
|
|
3212
3214
|
/**
|
|
@@ -3216,7 +3218,7 @@ class Tu {
|
|
|
3216
3218
|
* @returns A promise that resolves to the on-chain recovery details.
|
|
3217
3219
|
*/
|
|
3218
3220
|
async getActiveRecovery(e) {
|
|
3219
|
-
const n = k(this.apiBase, "accounts", "starknet", e, "recovery"), r = await this.httpService.get(n), s =
|
|
3221
|
+
const n = k(this.apiBase, "accounts", "starknet", e, "recovery"), r = await this.httpService.get(n), s = Mc.safeParse(r);
|
|
3220
3222
|
return s.error ? null : s.data;
|
|
3221
3223
|
}
|
|
3222
3224
|
/**
|
|
@@ -3228,7 +3230,7 @@ class Tu {
|
|
|
3228
3230
|
* @returns A promise that resolves to the recovery details.
|
|
3229
3231
|
*/
|
|
3230
3232
|
async startRecovery(e, n, r, s) {
|
|
3231
|
-
const { r: o, s: a } =
|
|
3233
|
+
const { r: o, s: a } = cs.starkCurve.sign(Rc(Fc(gs("utf8", "starknet:recovery")), r), s), i = {
|
|
3232
3234
|
feeToken: n,
|
|
3233
3235
|
signerSignature: {
|
|
3234
3236
|
type: "StarknetKey",
|
|
@@ -3241,7 +3243,7 @@ class Tu {
|
|
|
3241
3243
|
};
|
|
3242
3244
|
return await this.httpService.post(`${this.apiBase}/accounts/starknet/${e}/recovery`, {
|
|
3243
3245
|
body: JSON.stringify(i)
|
|
3244
|
-
},
|
|
3246
|
+
}, Hc);
|
|
3245
3247
|
}
|
|
3246
3248
|
/**
|
|
3247
3249
|
* Completes the recovery process for a given address and recovery ID.
|
|
@@ -3255,7 +3257,7 @@ class Tu {
|
|
|
3255
3257
|
return await this.httpService.post(r);
|
|
3256
3258
|
}
|
|
3257
3259
|
}
|
|
3258
|
-
async function
|
|
3260
|
+
async function _u() {
|
|
3259
3261
|
if ("brave" in navigator)
|
|
3260
3262
|
try {
|
|
3261
3263
|
return await navigator.brave.isBrave();
|
|
@@ -3264,25 +3266,25 @@ async function Bu() {
|
|
|
3264
3266
|
return !1;
|
|
3265
3267
|
}
|
|
3266
3268
|
let Te;
|
|
3267
|
-
function
|
|
3268
|
-
return Te || (Te = new
|
|
3269
|
+
function qc() {
|
|
3270
|
+
return Te || (Te = new ws(navigator.userAgent).getResult()), Te;
|
|
3269
3271
|
}
|
|
3270
3272
|
function me(t) {
|
|
3271
|
-
return
|
|
3273
|
+
return qc().browser.name === t;
|
|
3272
3274
|
}
|
|
3273
|
-
function
|
|
3275
|
+
function Nu() {
|
|
3274
3276
|
return me("Firefox");
|
|
3275
3277
|
}
|
|
3276
|
-
function
|
|
3278
|
+
function Cu() {
|
|
3277
3279
|
return me("Chrome");
|
|
3278
3280
|
}
|
|
3279
|
-
function
|
|
3281
|
+
function Ou() {
|
|
3280
3282
|
return me("Safari");
|
|
3281
3283
|
}
|
|
3282
|
-
function
|
|
3284
|
+
function ku() {
|
|
3283
3285
|
return me("Edge");
|
|
3284
3286
|
}
|
|
3285
|
-
const
|
|
3287
|
+
const Pu = h.string().refine((t) => ys(t, bs), "Invalid seedphrase"), Ze = [
|
|
3286
3288
|
{
|
|
3287
3289
|
address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
3288
3290
|
name: "Ether",
|
|
@@ -3459,7 +3461,7 @@ const ku = h.string().refine((t) => ws(t, ys), "Invalid seedphrase"), Ke = [
|
|
|
3459
3461
|
networkId: "mainnet-alpha",
|
|
3460
3462
|
image: "https://dv3jj1unlp2jl.cloudfront.net/128/color/ekubo.png"
|
|
3461
3463
|
}
|
|
3462
|
-
],
|
|
3464
|
+
], Wc = async (t, e, n) => {
|
|
3463
3465
|
const r = await n.callContract({
|
|
3464
3466
|
contractAddress: t,
|
|
3465
3467
|
entrypoint: "balanceOf",
|
|
@@ -3469,14 +3471,14 @@ const ku = h.string().refine((t) => ws(t, ys), "Invalid seedphrase"), Ke = [
|
|
|
3469
3471
|
low: r[0],
|
|
3470
3472
|
high: r[1]
|
|
3471
3473
|
})));
|
|
3472
|
-
},
|
|
3473
|
-
const r =
|
|
3474
|
+
}, Ru = async (t, e, n) => {
|
|
3475
|
+
const r = Ze.filter((o) => o.networkId === t);
|
|
3474
3476
|
return (await Promise.allSettled(r.map((o) => e.callContract({
|
|
3475
3477
|
contractAddress: o.address,
|
|
3476
3478
|
entrypoint: "balanceOf",
|
|
3477
3479
|
calldata: [n]
|
|
3478
3480
|
})))).reduce((o, a, i) => {
|
|
3479
|
-
if (a.status === "fulfilled" &&
|
|
3481
|
+
if (a.status === "fulfilled" && hs(a.value) || a.status === "rejected" || a.value[0] === "0x0" && a.value[1] === "0x0")
|
|
3480
3482
|
return o;
|
|
3481
3483
|
const c = BigInt(O.toHex(Dt.uint256ToBN({
|
|
3482
3484
|
low: a.value[0],
|
|
@@ -3487,44 +3489,44 @@ const ku = h.string().refine((t) => ws(t, ys), "Invalid seedphrase"), Ke = [
|
|
|
3487
3489
|
};
|
|
3488
3490
|
return o.push(l), o;
|
|
3489
3491
|
}, []);
|
|
3490
|
-
},
|
|
3492
|
+
}, $u = async () => Ze, Fu = ({ address: t, networkId: e }) => Ze.find((r) => r.address === t && r.networkId === e), Uu = ({ amount: t, decimals: e, unitCurrencyValue: n }) => {
|
|
3491
3493
|
if (!Y(t) || !Y(e) || !Y(n))
|
|
3492
3494
|
return;
|
|
3493
|
-
const r = Number(e), s = BigInt(t) *
|
|
3495
|
+
const r = Number(e), s = BigInt(t) * je(n.toString()).value;
|
|
3494
3496
|
return Vt({
|
|
3495
3497
|
value: s,
|
|
3496
3498
|
decimals: r + Ht
|
|
3497
3499
|
});
|
|
3498
|
-
},
|
|
3500
|
+
}, ju = ({ unitAmount: t, decimals: e }) => {
|
|
3499
3501
|
if (t === void 0 || !Y(t) || e === void 0 || !Y(e))
|
|
3500
3502
|
return;
|
|
3501
3503
|
const n = Number(e);
|
|
3502
3504
|
return xt(t.toString(), n).value.toString();
|
|
3503
|
-
},
|
|
3505
|
+
}, Lu = (t) => Y(t) ? Number(t) : 18, { UINT_256_MAX: Kc } = Dt, Zc = (t) => String(t) === String(Kc), Du = (t, e = "$", n) => {
|
|
3504
3506
|
if (t === void 0 || !Y(t))
|
|
3505
3507
|
return null;
|
|
3506
|
-
const r =
|
|
3508
|
+
const r = hi(t, n);
|
|
3507
3509
|
return [e, r].filter(Boolean).join("");
|
|
3508
|
-
},
|
|
3510
|
+
}, Yc = "Unlimited", Hu = ({ amount: t, decimals: e, symbol: n, showPlusSign: r = !1, withSymbol: s = !0, unlimitedText: o = Yc, prettyConfigOverrides: a }) => {
|
|
3509
3511
|
if (!Y(t))
|
|
3510
3512
|
return null;
|
|
3511
3513
|
let i, c = !1;
|
|
3512
|
-
if (
|
|
3514
|
+
if (Zc(t))
|
|
3513
3515
|
i = o;
|
|
3514
3516
|
else {
|
|
3515
3517
|
const d = Number(e), u = BigInt(t);
|
|
3516
3518
|
c = u > 0n;
|
|
3517
3519
|
const w = d > 0 ? Vt({ value: u, decimals: d }) : u.toString();
|
|
3518
|
-
i = d > 0 ?
|
|
3520
|
+
i = d > 0 ? pi(w, a) : w;
|
|
3519
3521
|
}
|
|
3520
3522
|
const l = [i, s && n].filter(Boolean).join(" ");
|
|
3521
3523
|
return r && c ? `+${l}` : l;
|
|
3522
3524
|
};
|
|
3523
|
-
var
|
|
3524
|
-
function
|
|
3525
|
+
var Xc = Yr, Jc = Xc;
|
|
3526
|
+
function Qc(t, e) {
|
|
3525
3527
|
function n(r, s) {
|
|
3526
3528
|
var o = e || {}, a;
|
|
3527
|
-
"randomize" in o || (o.randomize = !0), a =
|
|
3529
|
+
"randomize" in o || (o.randomize = !0), a = Jc.operation(o);
|
|
3528
3530
|
function i(d) {
|
|
3529
3531
|
s(d || new Error("Aborted"));
|
|
3530
3532
|
}
|
|
@@ -3551,9 +3553,9 @@ function Jc(t, e) {
|
|
|
3551
3553
|
}
|
|
3552
3554
|
return new Promise(n);
|
|
3553
3555
|
}
|
|
3554
|
-
var
|
|
3555
|
-
const
|
|
3556
|
-
class
|
|
3556
|
+
var tl = Qc;
|
|
3557
|
+
const el = /* @__PURE__ */ Xr(tl);
|
|
3558
|
+
class Vu {
|
|
3557
3559
|
constructor(e, n) {
|
|
3558
3560
|
this.apiBase = e, this.httpService = n, this.TOKENS_INFO_URL = "/tokens/info", this.TOKENS_DEFI_DECOMPOSITION_URL = "/tokens/defi/decomposition";
|
|
3559
3561
|
}
|
|
@@ -3563,10 +3565,10 @@ class Hu {
|
|
|
3563
3565
|
* @returns {Promise<ApiTokenInfo[]>} - The fetched tokens or undefined if there was an error or not default network
|
|
3564
3566
|
*/
|
|
3565
3567
|
async fetchTokensInfoFromBackend(e) {
|
|
3566
|
-
const n = k(this.apiBase, this.TOKENS_INFO_URL, e ?? "", "?chain=starknet"), r = await this.httpService.get(n), s =
|
|
3568
|
+
const n = k(this.apiBase, this.TOKENS_INFO_URL, e ?? "", "?chain=starknet"), r = await this.httpService.get(n), s = Jr.safeParse(r);
|
|
3567
3569
|
if (s.success)
|
|
3568
3570
|
return s.data.tokens;
|
|
3569
|
-
const o =
|
|
3571
|
+
const o = Qr.safeParse(r);
|
|
3570
3572
|
if (o.success)
|
|
3571
3573
|
return [o.data];
|
|
3572
3574
|
}
|
|
@@ -3577,7 +3579,7 @@ class Hu {
|
|
|
3577
3579
|
*/
|
|
3578
3580
|
async fetchAddressTokenBalancesFromBackend(e, n, r) {
|
|
3579
3581
|
const s = k(this.apiBase, "activity", "starknet", n, "account", e, "balance");
|
|
3580
|
-
return (await
|
|
3582
|
+
return (await el(
|
|
3581
3583
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3582
3584
|
async (i) => {
|
|
3583
3585
|
let c;
|
|
@@ -3586,7 +3588,7 @@ class Hu {
|
|
|
3586
3588
|
} catch {
|
|
3587
3589
|
return i(new Error("Error fetching")), [];
|
|
3588
3590
|
}
|
|
3589
|
-
const l =
|
|
3591
|
+
const l = ts.safeParse(c);
|
|
3590
3592
|
if (!l.success)
|
|
3591
3593
|
return i(new Error("Error parsing response")), [];
|
|
3592
3594
|
if (l.data.status !== "initialised")
|
|
@@ -3607,19 +3609,19 @@ class Hu {
|
|
|
3607
3609
|
}
|
|
3608
3610
|
async fetchDefiDecomposition(e) {
|
|
3609
3611
|
const n = k(this.apiBase, this.TOKENS_DEFI_DECOMPOSITION_URL, e, "?chain=starknet"), r = await this.httpService.get(n);
|
|
3610
|
-
if (!
|
|
3611
|
-
throw new
|
|
3612
|
+
if (!es.safeParse(r).success)
|
|
3613
|
+
throw new ns({ code: "TOKEN_DEFI_DECOMPOSITION_PARSING_ERROR" });
|
|
3612
3614
|
return r.dapps;
|
|
3613
3615
|
}
|
|
3614
3616
|
}
|
|
3615
|
-
const
|
|
3617
|
+
const Mu = (t, e, n, r) => ({
|
|
3616
3618
|
contractAddress: t,
|
|
3617
3619
|
entrypoint: "transfer",
|
|
3618
3620
|
calldata: mt.compile({
|
|
3619
3621
|
recipient: e,
|
|
3620
|
-
amount: Ut(
|
|
3622
|
+
amount: Ut(mi(n, r))
|
|
3621
3623
|
})
|
|
3622
|
-
}),
|
|
3624
|
+
}), Gu = (t, e, n, r) => ({
|
|
3623
3625
|
contractAddress: t,
|
|
3624
3626
|
entrypoint: "transferFrom",
|
|
3625
3627
|
calldata: mt.compile({
|
|
@@ -3628,7 +3630,7 @@ const Vu = (t, e, n, r) => ({
|
|
|
3628
3630
|
tokenId: Ut(r)
|
|
3629
3631
|
// OZ specs need a uint256 as tokenId
|
|
3630
3632
|
})
|
|
3631
|
-
}),
|
|
3633
|
+
}), zu = (t, e, n, r) => ({
|
|
3632
3634
|
contractAddress: t,
|
|
3633
3635
|
entrypoint: "safeTransferFrom",
|
|
3634
3636
|
calldata: mt.compile({
|
|
@@ -3639,14 +3641,14 @@ const Vu = (t, e, n, r) => ({
|
|
|
3639
3641
|
data_len: "0"
|
|
3640
3642
|
})
|
|
3641
3643
|
});
|
|
3642
|
-
function
|
|
3643
|
-
return
|
|
3644
|
+
function $r(t) {
|
|
3645
|
+
return $e(t.unit) === "WEI";
|
|
3644
3646
|
}
|
|
3645
|
-
function
|
|
3646
|
-
return
|
|
3647
|
+
function nl(t) {
|
|
3648
|
+
return $e(t.unit) === "FRI";
|
|
3647
3649
|
}
|
|
3648
3650
|
function At(t, e) {
|
|
3649
|
-
return
|
|
3651
|
+
return $r(t) ? {
|
|
3650
3652
|
...t,
|
|
3651
3653
|
maxFee: e(t.maxFee),
|
|
3652
3654
|
overallFee: e(t.overallFee),
|
|
@@ -3662,7 +3664,7 @@ function At(t, e) {
|
|
|
3662
3664
|
};
|
|
3663
3665
|
}
|
|
3664
3666
|
function Rt(t) {
|
|
3665
|
-
return
|
|
3667
|
+
return $r(t) ? {
|
|
3666
3668
|
maxFee: t.maxFee
|
|
3667
3669
|
} : {
|
|
3668
3670
|
amount: t.maxAmount,
|
|
@@ -3670,13 +3672,13 @@ function Rt(t) {
|
|
|
3670
3672
|
};
|
|
3671
3673
|
}
|
|
3672
3674
|
function Be(t) {
|
|
3673
|
-
return
|
|
3675
|
+
return nl({ unit: t }) ? Re : Hn;
|
|
3674
3676
|
}
|
|
3675
|
-
function
|
|
3677
|
+
function qu(t, e, n = 2) {
|
|
3676
3678
|
const r = BigInt(10 ** n), s = BigInt(Math.round(e * 10 ** n));
|
|
3677
3679
|
return t * s / r;
|
|
3678
3680
|
}
|
|
3679
|
-
const
|
|
3681
|
+
const Wu = [Re], Fr = (t, e = il) => {
|
|
3680
3682
|
if (t.max && "amount" in t.max)
|
|
3681
3683
|
return {
|
|
3682
3684
|
...t,
|
|
@@ -3685,7 +3687,7 @@ const qu = [Pe], $r = (t, e = al) => {
|
|
|
3685
3687
|
const n = 10000n, { amount: r, pricePerUnit: s, dataGasConsumed: o = 0n, dataGasPrice: a = 0n } = t, i = r * s + o * a;
|
|
3686
3688
|
if (i < 0)
|
|
3687
3689
|
throw Error("Cannot calculate max fee for negative fee");
|
|
3688
|
-
const c = O.toBigInt(
|
|
3690
|
+
const c = O.toBigInt(os({ estimatedFee: i })), l = Number(c) / Number(i), d = e(l), u = BigInt(Math.trunc(d * Number(n)));
|
|
3689
3691
|
return {
|
|
3690
3692
|
...t,
|
|
3691
3693
|
amount: r * u / n,
|
|
@@ -3696,38 +3698,38 @@ const qu = [Pe], $r = (t, e = al) => {
|
|
|
3696
3698
|
}, re = (t) => {
|
|
3697
3699
|
const { amount: e, pricePerUnit: n, dataGasConsumed: r = 0n, dataGasPrice: s = 0n } = t;
|
|
3698
3700
|
return e * n + r * s;
|
|
3699
|
-
},
|
|
3701
|
+
}, rl = (t) => {
|
|
3700
3702
|
if (t.max)
|
|
3701
3703
|
return "maxFee" in t.max ? t.max.maxFee : re(t.max);
|
|
3702
|
-
},
|
|
3703
|
-
const e =
|
|
3704
|
-
return e || re(
|
|
3705
|
-
},
|
|
3704
|
+
}, Pe = (t) => {
|
|
3705
|
+
const e = rl(t);
|
|
3706
|
+
return e || re(Fr(t));
|
|
3707
|
+
}, Ku = (t) => {
|
|
3706
3708
|
if (t.deployment && !nt(t.deployment.feeTokenAddress, t.transactions.feeTokenAddress))
|
|
3707
3709
|
throw Error("Cannot calculate estimated fees for different tokens");
|
|
3708
3710
|
const e = re(t.transactions), n = t.deployment ? re(t.deployment) : 0n;
|
|
3709
3711
|
return e + n;
|
|
3710
|
-
},
|
|
3712
|
+
}, Zu = (t) => {
|
|
3711
3713
|
if (t.deployment && !nt(t.deployment.feeTokenAddress, t.transactions.feeTokenAddress))
|
|
3712
3714
|
throw Error("Cannot calculate estimated fees for different tokens");
|
|
3713
|
-
const e = t.deployment ?
|
|
3715
|
+
const e = t.deployment ? Pe(t.deployment) : 0n, n = Pe(t.transactions);
|
|
3714
3716
|
return e + n;
|
|
3715
|
-
},
|
|
3717
|
+
}, Yu = (t, e) => [
|
|
3716
3718
|
{
|
|
3717
3719
|
contractAddress: t,
|
|
3718
3720
|
entrypoint: "transfer",
|
|
3719
|
-
calldata: mt.compile(
|
|
3721
|
+
calldata: mt.compile(rs.parse({
|
|
3720
3722
|
// We are using a dummy address (ETH here) as recipient to estimate the fee given we don't have a receipient yet
|
|
3721
3723
|
recipient: e,
|
|
3722
3724
|
// We are using the smallest possible amount to make sure this doesn't throw an error
|
|
3723
3725
|
amount: Dt.bnToUint256(BigInt(1))
|
|
3724
3726
|
}))
|
|
3725
3727
|
}
|
|
3726
|
-
],
|
|
3728
|
+
], sl = (t, e) => {
|
|
3727
3729
|
if (!t)
|
|
3728
3730
|
return {
|
|
3729
3731
|
transactions: {
|
|
3730
|
-
feeTokenAddress: e ??
|
|
3732
|
+
feeTokenAddress: e ?? Hn,
|
|
3731
3733
|
amount: 0n,
|
|
3732
3734
|
pricePerUnit: 0n,
|
|
3733
3735
|
dataGasConsumed: 0n,
|
|
@@ -3771,7 +3773,7 @@ const qu = [Pe], $r = (t, e = al) => {
|
|
|
3771
3773
|
};
|
|
3772
3774
|
}
|
|
3773
3775
|
throw Error("Unexpected simulation response length");
|
|
3774
|
-
},
|
|
3776
|
+
}, ol = ({ transaction: t, nonce: e, chainId: n, version: r, isDeploymentTransaction: s, cairoVersion: o, address: a, appDomain: i }) => {
|
|
3775
3777
|
let c = e;
|
|
3776
3778
|
s && t.type !== "DEPLOY_ACCOUNT" && (c = O.toHex(1));
|
|
3777
3779
|
const l = oe(t.calls);
|
|
@@ -3790,15 +3792,15 @@ const qu = [Pe], $r = (t, e = al) => {
|
|
|
3790
3792
|
appDomain: i
|
|
3791
3793
|
// appDomain: "https://starknetkit-blacked-listed.vercel.app", // to simulate blacklisted domain
|
|
3792
3794
|
};
|
|
3793
|
-
},
|
|
3795
|
+
}, al = (t, e) => {
|
|
3794
3796
|
const { transactions: n } = t, r = n.map((c) => {
|
|
3795
3797
|
if (!c.simulation)
|
|
3796
|
-
throw new
|
|
3798
|
+
throw new ss({ code: "SIMULATE_AND_REVIEW_FAILED" });
|
|
3797
3799
|
return c;
|
|
3798
3800
|
}), s = r.map((c) => ({
|
|
3799
3801
|
...c.simulation,
|
|
3800
3802
|
feeEstimation: At(c.simulation.feeEstimation, Number)
|
|
3801
|
-
})), o =
|
|
3803
|
+
})), o = sl(s, e), [a, i] = r.length === 1 ? [r[0], void 0] : [r[1], r[0]];
|
|
3802
3804
|
return {
|
|
3803
3805
|
...o,
|
|
3804
3806
|
transactions: {
|
|
@@ -3814,8 +3816,8 @@ const qu = [Pe], $r = (t, e = al) => {
|
|
|
3814
3816
|
max: Rt(At(i.simulation.feeEstimation, O.toBigInt))
|
|
3815
3817
|
} : void 0
|
|
3816
3818
|
};
|
|
3817
|
-
},
|
|
3818
|
-
const e =
|
|
3819
|
+
}, Xu = (t) => {
|
|
3820
|
+
const e = Fr(t), n = Pe(t);
|
|
3819
3821
|
return {
|
|
3820
3822
|
// for v1 transactions
|
|
3821
3823
|
maxFee: n,
|
|
@@ -3833,31 +3835,31 @@ const qu = [Pe], $r = (t, e = al) => {
|
|
|
3833
3835
|
}
|
|
3834
3836
|
}
|
|
3835
3837
|
};
|
|
3836
|
-
},
|
|
3838
|
+
}, Ju = (t) => {
|
|
3837
3839
|
const e = Math.sqrt(t);
|
|
3838
3840
|
return isNaN(e) ? Math.sqrt(2) : e;
|
|
3839
|
-
},
|
|
3841
|
+
}, il = (t) => {
|
|
3840
3842
|
const e = Math.cbrt(t);
|
|
3841
3843
|
return isNaN(e) ? Math.cbrt(2) : e;
|
|
3842
|
-
},
|
|
3843
|
-
function
|
|
3844
|
-
return
|
|
3844
|
+
}, Qu = (t) => t < 1 || isNaN(t) ? 1.1 : Math.log(t + 1) + 1, cl = [Re];
|
|
3845
|
+
function Ye({ address: t }) {
|
|
3846
|
+
return cl.some((e) => nt(t, e));
|
|
3845
3847
|
}
|
|
3846
|
-
function
|
|
3847
|
-
return t ?
|
|
3848
|
+
function td(t) {
|
|
3849
|
+
return t ? ba().some((e) => nt(e, t)) : !1;
|
|
3848
3850
|
}
|
|
3849
|
-
function
|
|
3850
|
-
return
|
|
3851
|
+
function Fn(t) {
|
|
3852
|
+
return Ye({
|
|
3851
3853
|
address: t
|
|
3852
3854
|
}) ? Z.TRANSACTION_VERSION.V3 : Z.TRANSACTION_VERSION.V1;
|
|
3853
3855
|
}
|
|
3854
|
-
function
|
|
3855
|
-
return
|
|
3856
|
+
function ed(t) {
|
|
3857
|
+
return Ye({ address: t }) ? Z.TRANSACTION_VERSION.F3 : Z.TRANSACTION_VERSION.F1;
|
|
3856
3858
|
}
|
|
3857
|
-
function
|
|
3858
|
-
return
|
|
3859
|
+
function nd(t, e) {
|
|
3860
|
+
return ls(e.contract) ? Ye({ address: t }) ? Z.TRANSACTION_VERSION.V3 : Z.TRANSACTION_VERSION.V2 : Z.TRANSACTION_VERSION.V1;
|
|
3859
3861
|
}
|
|
3860
|
-
class
|
|
3862
|
+
class rd {
|
|
3861
3863
|
constructor(e, n) {
|
|
3862
3864
|
this.apiBase = e, this.httpService = n;
|
|
3863
3865
|
}
|
|
@@ -3882,9 +3884,9 @@ class nd {
|
|
|
3882
3884
|
try {
|
|
3883
3885
|
if (!("getChainId" in e))
|
|
3884
3886
|
throw new Error("MISSING_METHOD");
|
|
3885
|
-
const i =
|
|
3887
|
+
const i = Fn(r), c = a ? "0x0" : await e.getNonce(), l = await e.getChainId(), d = {
|
|
3886
3888
|
transactions: n.map((f) => ({
|
|
3887
|
-
...
|
|
3889
|
+
...ol({
|
|
3888
3890
|
transaction: f,
|
|
3889
3891
|
nonce: c,
|
|
3890
3892
|
version: i,
|
|
@@ -3902,10 +3904,10 @@ class nd {
|
|
|
3902
3904
|
"Content-Type": "application/json"
|
|
3903
3905
|
},
|
|
3904
3906
|
body: JSON.stringify(d)
|
|
3905
|
-
},
|
|
3906
|
-
if (w.transactions.some((f) =>
|
|
3907
|
+
}, as);
|
|
3908
|
+
if (w.transactions.some((f) => is(f)))
|
|
3907
3909
|
return w;
|
|
3908
|
-
const S =
|
|
3910
|
+
const S = al(w, r);
|
|
3909
3911
|
return {
|
|
3910
3912
|
...w,
|
|
3911
3913
|
enrichedFeeEstimation: S
|
|
@@ -3952,7 +3954,7 @@ class nd {
|
|
|
3952
3954
|
}
|
|
3953
3955
|
async fetchFeesOnchain({ starknetAccount: e, calls: n, isDeployed: r, feeTokenAddress: s, accountDeployTransaction: o }) {
|
|
3954
3956
|
try {
|
|
3955
|
-
const a =
|
|
3957
|
+
const a = Fn(s), i = {
|
|
3956
3958
|
transactions: {
|
|
3957
3959
|
feeTokenAddress: s,
|
|
3958
3960
|
amount: 0n,
|
|
@@ -3965,7 +3967,7 @@ class nd {
|
|
|
3965
3967
|
if ("estimateFeeBulk" in e) {
|
|
3966
3968
|
const c = [
|
|
3967
3969
|
{
|
|
3968
|
-
type:
|
|
3970
|
+
type: cn.DEPLOY_ACCOUNT,
|
|
3969
3971
|
payload: {
|
|
3970
3972
|
classHash: o.classHash,
|
|
3971
3973
|
addressSalt: o.salt,
|
|
@@ -3974,7 +3976,7 @@ class nd {
|
|
|
3974
3976
|
}
|
|
3975
3977
|
},
|
|
3976
3978
|
{
|
|
3977
|
-
type:
|
|
3979
|
+
type: cn.INVOKE,
|
|
3978
3980
|
payload: n
|
|
3979
3981
|
}
|
|
3980
3982
|
], [l, d] = await e.estimateFeeBulk(c, {
|
|
@@ -4028,16 +4030,16 @@ class nd {
|
|
|
4028
4030
|
}
|
|
4029
4031
|
}
|
|
4030
4032
|
}
|
|
4031
|
-
const
|
|
4033
|
+
const sd = [
|
|
4032
4034
|
"account-upgrade",
|
|
4033
4035
|
"approve",
|
|
4034
4036
|
"set-approval-for-all",
|
|
4035
4037
|
"swap",
|
|
4036
4038
|
"transfer"
|
|
4037
|
-
],
|
|
4038
|
-
const n = t == null ? void 0 : t.some((s) => !
|
|
4039
|
+
], od = (t) => ({ showBalanceChange: vt(() => {
|
|
4040
|
+
const n = t == null ? void 0 : t.some((s) => !un(s.transfers)), r = t == null ? void 0 : t.some((s) => !un(s.approvals));
|
|
4039
4041
|
return t && (n || r);
|
|
4040
|
-
}, [t]) }), ge = (t) => t ? t.filter((e) => e.token.type === "erc20") : [],
|
|
4042
|
+
}, [t]) }), ge = (t) => t ? t.filter((e) => e.token.type === "erc20") : [], ad = (t) => vt(() => ge(t), [t]), id = (t) => ge(t).length > 0, cd = (t) => ge(t).some((n) => n.amount > 0n), ld = (t) => ge(t).some((n) => n.amount < 0n), Ur = (t) => t ? t.filter((e) => e.token.type === "erc721") : [], ud = (t) => vt(() => Ur(t), [t]), ll = (t) => Ur(t).length > 0, dd = (t) => vt(() => ll(t), [t]), fd = (t, e) => vt(() => t && e ? [
|
|
4041
4043
|
{
|
|
4042
4044
|
contractAddress: t.address,
|
|
4043
4045
|
entrypoint: "transfer",
|
|
@@ -4046,18 +4048,18 @@ const rd = [
|
|
|
4046
4048
|
amount: Ut(t.balance)
|
|
4047
4049
|
})
|
|
4048
4050
|
}
|
|
4049
|
-
] : [], [t, e]),
|
|
4050
|
-
const a =
|
|
4051
|
+
] : [], [t, e]), hd = ({ apiData: { apiBaseUrl: t, apiHeaders: e }, address: n, network: r, transactionReviewEnabled: s = !0, transactions: o }) => {
|
|
4052
|
+
const a = Gn(async () => {
|
|
4051
4053
|
if (!n || !r)
|
|
4052
4054
|
return;
|
|
4053
4055
|
if (!t)
|
|
4054
4056
|
throw "Transaction review endpoint is not defined";
|
|
4055
|
-
const c = k(t, "reviewer/transactions/review/starknet"), l =
|
|
4057
|
+
const c = k(t, "reviewer/transactions/review/starknet"), l = ps(o) ? o : [o], d = {
|
|
4056
4058
|
network: r,
|
|
4057
4059
|
account: n,
|
|
4058
4060
|
calls: l
|
|
4059
4061
|
};
|
|
4060
|
-
return
|
|
4062
|
+
return Jn(c, {
|
|
4061
4063
|
method: "POST",
|
|
4062
4064
|
headers: {
|
|
4063
4065
|
"Content-Type": "application/json",
|
|
@@ -4065,32 +4067,32 @@ const rd = [
|
|
|
4065
4067
|
},
|
|
4066
4068
|
body: JSON.stringify(d)
|
|
4067
4069
|
});
|
|
4068
|
-
}, [n, r, o]), i = vt(() =>
|
|
4069
|
-
return
|
|
4070
|
-
},
|
|
4070
|
+
}, [n, r, o]), i = vt(() => Ss({ transactions: o, address: n, network: r }), [o, n, r]);
|
|
4071
|
+
return zs(!!s, [i, "transactionReview"], a);
|
|
4072
|
+
}, pd = (t) => {
|
|
4071
4073
|
if (!t)
|
|
4072
4074
|
return {};
|
|
4073
|
-
const e = t.assessment === "warn" && t.reason !== "contract_is_not_verified", n = t.reason ? ` (Reason: ${
|
|
4075
|
+
const e = t.assessment === "warn" && t.reason !== "contract_is_not_verified", n = t.reason ? ` (Reason: ${qn(t.reason)})` : "", r = e ? t.reason === "recipient_is_token_address" ? "You are sending tokens to their own address. This is likely to burn them." : `This transaction has been flagged as dangerous. We recommend you reject this transaction unless you are sure.${n}` : void 0;
|
|
4074
4076
|
return {
|
|
4075
4077
|
warn: e,
|
|
4076
4078
|
reason: r
|
|
4077
4079
|
};
|
|
4078
|
-
},
|
|
4080
|
+
}, ul = (t) => {
|
|
4079
4081
|
var e;
|
|
4080
4082
|
if (t) {
|
|
4081
4083
|
for (const n of t.reviews)
|
|
4082
4084
|
if (((e = n.activity) == null ? void 0 : e.type) === "swap")
|
|
4083
4085
|
return n;
|
|
4084
4086
|
}
|
|
4085
|
-
},
|
|
4086
|
-
},
|
|
4087
|
+
}, md = (t) => {
|
|
4088
|
+
}, gd = (t, e) => {
|
|
4087
4089
|
var n;
|
|
4088
4090
|
if (e) {
|
|
4089
4091
|
for (const r of e.reviews)
|
|
4090
4092
|
if (((n = r.activity) == null ? void 0 : n.type) === t)
|
|
4091
4093
|
return r.activity;
|
|
4092
4094
|
}
|
|
4093
|
-
},
|
|
4095
|
+
}, wd = (t) => !!ul(t), yd = (t) => {
|
|
4094
4096
|
var e, n;
|
|
4095
4097
|
if (t) {
|
|
4096
4098
|
for (const r of t.reviews)
|
|
@@ -4100,7 +4102,7 @@ const rd = [
|
|
|
4100
4102
|
type: (n = r.activity) == null ? void 0 : n.type
|
|
4101
4103
|
};
|
|
4102
4104
|
}
|
|
4103
|
-
},
|
|
4105
|
+
}, dl = async ({ feeTokenAddress: t, calls: e, selectedAccount: n, transactionReviewService: r, appDomain: s, accountDeployTransaction: o }) => {
|
|
4104
4106
|
const a = {
|
|
4105
4107
|
type: "INVOKE",
|
|
4106
4108
|
calls: oe(e)
|
|
@@ -4109,7 +4111,7 @@ const rd = [
|
|
|
4109
4111
|
return;
|
|
4110
4112
|
const i = o ? [o, a] : [a];
|
|
4111
4113
|
return { result: await r.simulateAndReview(n, i, t, s, o) };
|
|
4112
|
-
},
|
|
4114
|
+
}, fl = async (t, e, n, r) => {
|
|
4113
4115
|
var w, m, S, f, g, b;
|
|
4114
4116
|
let s = !1;
|
|
4115
4117
|
const o = e.transactions.find((E) => {
|
|
@@ -4124,24 +4126,24 @@ const rd = [
|
|
|
4124
4126
|
const c = "amount" in e.enrichedFeeEstimation.transactions.max ? e.enrichedFeeEstimation.transactions.max.amount : "maxFee" in e.enrichedFeeEstimation.transactions.max ? e.enrichedFeeEstimation.transactions.max.maxFee : void 0, l = (b = o.simulation.summary.find((E) => E.sent && E.token.address === n)) == null ? void 0 : b.value;
|
|
4125
4127
|
if (!c || !l)
|
|
4126
4128
|
return s;
|
|
4127
|
-
const d = await
|
|
4129
|
+
const d = await Wc(n, t, r) ?? 0n;
|
|
4128
4130
|
return BigInt(d) > c + BigInt(l) || (s = !0), s;
|
|
4129
|
-
},
|
|
4131
|
+
}, bd = () => Gn(async ({ feeTokenAddress: e, calls: n, selectedAccount: r, transactionReviewService: s, appDomain: o, accountDeployPayload: a, provider: i }) => {
|
|
4130
4132
|
if (!r)
|
|
4131
4133
|
return;
|
|
4132
|
-
const c = await
|
|
4134
|
+
const c = await dl({
|
|
4133
4135
|
feeTokenAddress: e,
|
|
4134
4136
|
calls: n,
|
|
4135
4137
|
selectedAccount: r,
|
|
4136
4138
|
transactionReviewService: s,
|
|
4137
4139
|
appDomain: o,
|
|
4138
|
-
accountDeployTransaction:
|
|
4140
|
+
accountDeployTransaction: hl(a)
|
|
4139
4141
|
});
|
|
4140
4142
|
if (!c || !c.result || !e)
|
|
4141
4143
|
return;
|
|
4142
|
-
const l = await
|
|
4144
|
+
const l = await fl(r.address, c.result, e, i);
|
|
4143
4145
|
return { ...c.result, isSendingMoreThanBalanceAndGas: l };
|
|
4144
|
-
}, []),
|
|
4146
|
+
}, []), hl = (t) => t ? {
|
|
4145
4147
|
type: "DEPLOY_ACCOUNT",
|
|
4146
4148
|
calldata: t.calldata,
|
|
4147
4149
|
classHash: Pt.parse(t.class_hash),
|
|
@@ -4151,341 +4153,342 @@ const rd = [
|
|
|
4151
4153
|
export {
|
|
4152
4154
|
tt as ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES,
|
|
4153
4155
|
Jt as ARGENT_MULTISIG_CONTRACT_CLASS_HASHES,
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4156
|
+
Il as AddSmartAccountResponseSchema,
|
|
4157
|
+
Tl as AddSmartAcountRequestSchema,
|
|
4158
|
+
Es as BackendAccountSchema,
|
|
4159
|
+
pu as BackendNftService,
|
|
4160
|
+
Ad as BaseError,
|
|
4161
|
+
Js as C0_PROXY_CONTRACT_CLASS_HASHES,
|
|
4162
|
+
Rl as CacheService,
|
|
4161
4163
|
Ht as DEFAULT_TOKEN_DECIMALS,
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4164
|
+
$l as DateService,
|
|
4165
|
+
xd as ESTIMATE_ERROR_MESSAGES,
|
|
4166
|
+
Hn as ETH_TOKEN_ADDRESS,
|
|
4167
|
+
ss as EstimateError,
|
|
4168
|
+
vd as EventEmitterProvider,
|
|
4169
|
+
Id as EventsBySelector,
|
|
4170
|
+
Td as FEE_OVERHEAD,
|
|
4171
|
+
Le as HTTPService,
|
|
4172
|
+
tn as HTTP_ERROR_MESSAGE,
|
|
4171
4173
|
K as HttpError,
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4174
|
+
Yl as KnownDappsBackendService,
|
|
4175
|
+
rn as MultiSigner,
|
|
4176
|
+
Bu as OnchainRecoveryService,
|
|
4177
|
+
Yc as PRETTY_UNLIMITED,
|
|
4176
4178
|
Oe as RecoveryStatusEnum,
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
Bd as
|
|
4184
|
-
_d as
|
|
4185
|
-
Nd as
|
|
4186
|
-
Cd as
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
kd as
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
Rd as
|
|
4195
|
-
$d as
|
|
4196
|
-
Fd as
|
|
4197
|
-
Ud as
|
|
4198
|
-
jd as
|
|
4199
|
-
Ld as
|
|
4179
|
+
Jl as ResolveNameService,
|
|
4180
|
+
qr as STANDARD_DEVNET_ACCOUNT_CLASS_HASH,
|
|
4181
|
+
Re as STRK_TOKEN_ADDRESS,
|
|
4182
|
+
Fl as SWRService,
|
|
4183
|
+
Vl as StarknetAddressService,
|
|
4184
|
+
ke as StartOnchainRecoveryErrorStatusEnum,
|
|
4185
|
+
Bd as TOKEN_ERROR_MESSAGES,
|
|
4186
|
+
_d as TXV1_ACCOUNT_CLASS_HASH,
|
|
4187
|
+
Nd as TXV1_MULTISIG_CLASS_HASH,
|
|
4188
|
+
Cd as TXV3_ACCOUNT_CLASS_HASH,
|
|
4189
|
+
Od as TXV3_MULTISIG_CLASS_HASH,
|
|
4190
|
+
ns as TokenError,
|
|
4191
|
+
Vu as TokenServiceWeb,
|
|
4192
|
+
rd as TransactionReviewServiceWeb,
|
|
4193
|
+
kd as abiEntrySchema,
|
|
4194
|
+
Pd as abiSchema,
|
|
4195
|
+
Mc as activeOnchainRecoverySchema,
|
|
4196
|
+
Rd as addOwnersCalldataSchema,
|
|
4197
|
+
$d as addPluginCalldataSchema,
|
|
4198
|
+
Fd as addressInputCharactersAndLengthSchema,
|
|
4199
|
+
Ud as addressInputSchema,
|
|
4200
|
+
jd as addressOrDomainInputSchema,
|
|
4201
|
+
Ld as addressOrDomainSchema,
|
|
4202
|
+
Dd as addressOrEmptyUndefinedSchema,
|
|
4200
4203
|
se as addressSchema,
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4204
|
+
Dn as addressSchemaArgentBackend,
|
|
4205
|
+
Hd as addressSchemaBase,
|
|
4206
|
+
Vd as addressSchemaLooseLength,
|
|
4207
|
+
Md as addressSchemaStrictLength,
|
|
4208
|
+
Gd as airdropSchema,
|
|
4209
|
+
ts as apiAccountTokenBalancesSchema,
|
|
4210
|
+
zd as apiAirdropSchema,
|
|
4211
|
+
qd as apiCollateralizedDebtPositionSchema,
|
|
4212
|
+
Wd as apiCollateralizedDebtPositionsSchema,
|
|
4213
|
+
Kd as apiConcentratedLiquidityPositionSchema,
|
|
4214
|
+
Zd as apiConcentratedLiquidityPositionsSchema,
|
|
4215
|
+
Yd as apiDefiDecompositionProduct,
|
|
4216
|
+
Xd as apiDefiDecompositionProducts,
|
|
4217
|
+
Jd as apiDefiDecompositionSchema,
|
|
4218
|
+
Qd as apiDefiDecompositionToken,
|
|
4219
|
+
es as apiDefiPositionsSchema,
|
|
4220
|
+
tf as apiPriceDataResponseSchema,
|
|
4221
|
+
ef as apiPriceDetailsSchema,
|
|
4222
|
+
Qr as apiTokenInfoResponseSchema,
|
|
4223
|
+
nf as apiTokenInfoSchema,
|
|
4224
|
+
Jr as apiTokensInfoResponseSchema,
|
|
4225
|
+
sd as apiTransactionReviewActivityType,
|
|
4226
|
+
rf as apiUnclaimedRewardsSchema,
|
|
4227
|
+
sf as apiWalletResponseSchema,
|
|
4228
|
+
vs as argentBackendNetworkIdSchema,
|
|
4229
|
+
os as argentMaxFee,
|
|
4230
|
+
of as argentNameSchema,
|
|
4231
|
+
xs as argentNetworkIdSchema,
|
|
4232
|
+
Pl as bigDecimal,
|
|
4233
|
+
af as bigNumberSchema,
|
|
4234
|
+
cf as bigNumberishSchema,
|
|
4235
|
+
lf as booleanToStringSchema,
|
|
4236
|
+
hl as buildAccountDeployTransaction,
|
|
4237
|
+
Aa as buildConstructorCalldata,
|
|
4238
|
+
Yu as buildDummyTx,
|
|
4239
|
+
uf as builtinsSchema,
|
|
4240
|
+
df as byteCodeSchema,
|
|
4241
|
+
ff as cairo1EventSchema,
|
|
4242
|
+
hf as cairoAssemblySchema,
|
|
4243
|
+
pf as cairoVersionSchema,
|
|
4244
|
+
il as calculateCubeRootAdjustment,
|
|
4245
|
+
Qu as calculateNonLinearAdjustment,
|
|
4246
|
+
Ju as calculateSqrtAdjustment,
|
|
4247
|
+
mf as callDetailsSchema,
|
|
4248
|
+
jr as callSchema,
|
|
4249
|
+
gf as calldataSchema,
|
|
4247
4250
|
At as castFeeEstimation,
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4251
|
+
wf as changeGuardianCalldataSchema,
|
|
4252
|
+
yf as changeThresholdCalldataSchema,
|
|
4253
|
+
fl as checkGasFeeBalance,
|
|
4254
|
+
td as classHashSupportsTxV3,
|
|
4255
|
+
bf as collateralizedDebtGroupSchema,
|
|
4256
|
+
Sf as collateralizedDebtPositionSchema,
|
|
4257
|
+
Ef as collateralizedDebtPositionsSchema,
|
|
4258
|
+
Af as compiledContractClassSchema,
|
|
4259
|
+
xf as compiledSierraCasmSchema,
|
|
4260
|
+
vf as compiledSierraSchema,
|
|
4261
|
+
If as compressedProgramSchema,
|
|
4262
|
+
Tf as concentratedLiquidityPositionSchema,
|
|
4263
|
+
Bf as concentratedLiquidityPositionsSchema,
|
|
4264
|
+
Wr as constructorCallDataSchemaC0,
|
|
4265
|
+
Kr as constructorCallDataSchemaC1V1,
|
|
4266
|
+
_f as contractEntryPointFieldsSchema,
|
|
4267
|
+
Uu as convertTokenAmountToCurrencyValue,
|
|
4268
|
+
ju as convertTokenUnitAmountWithDecimals,
|
|
4269
|
+
Ia as dappContractSchema,
|
|
4270
|
+
va as dappLinkSchema,
|
|
4271
|
+
ru as daysBetween,
|
|
4272
|
+
fi as decodeBase58,
|
|
4273
|
+
nu as decodeBase58Array,
|
|
4274
|
+
Nf as defiDappsProductsSchema,
|
|
4275
|
+
Cf as defiPositionSchema,
|
|
4276
|
+
Of as defiPositionTypeSchema,
|
|
4277
|
+
kf as defiProductSchema,
|
|
4278
|
+
Pf as defiProductsSchema,
|
|
4279
|
+
Rf as denyTxV3,
|
|
4280
|
+
di as encodeBase58,
|
|
4281
|
+
eu as encodeBase58Array,
|
|
4279
4282
|
oe as ensureArray,
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4283
|
+
Lu as ensureDecimals,
|
|
4284
|
+
du as entryPointToHumanReadable,
|
|
4285
|
+
$f as entryPointsByTypeSchema,
|
|
4286
|
+
bu as equalNft,
|
|
4287
|
+
Mu as erc20TransferTransaction,
|
|
4288
|
+
zu as erc721SafeTransferFromTransaction,
|
|
4289
|
+
Gu as erc721TransferFromTransaction,
|
|
4290
|
+
Ff as escapeGuardianCalldataSchema,
|
|
4291
|
+
Pe as estimatedFeeToMaxFeeTotal,
|
|
4292
|
+
Xu as estimatedFeeToMaxResourceBounds,
|
|
4290
4293
|
re as estimatedFeeToTotal,
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4294
|
+
Zu as estimatedFeesToMaxFeeTotal,
|
|
4295
|
+
Ku as estimatedFeesToTotal,
|
|
4296
|
+
Uf as eventAbiSchema,
|
|
4297
|
+
jf as eventEntrySchema,
|
|
4298
|
+
Lf as executeOnPluginCalldataSchema,
|
|
4299
|
+
Ye as feeTokenNeedsTxV3Support,
|
|
4300
|
+
Df as feltSchema,
|
|
4301
|
+
Jn as fetchData,
|
|
4299
4302
|
Xt as fetcherError,
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4303
|
+
Wl as findImplementationForAccount,
|
|
4304
|
+
Hf as findTransfersAndApprovals,
|
|
4305
|
+
rr as formatAddress,
|
|
4306
|
+
Vf as formatFullAddress,
|
|
4307
|
+
Mf as formatTruncatedAddress,
|
|
4308
|
+
Gf as formatTruncatedSignerKey,
|
|
4309
|
+
zf as formatTruncatedString,
|
|
4310
|
+
qf as functionAbiSchema,
|
|
4311
|
+
Wf as functionAbiTypeSchema,
|
|
4309
4312
|
ee as generateAvatarImage,
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4313
|
+
xa as getAccountContractAddress,
|
|
4314
|
+
Ea as getAccountDeploymentPayload,
|
|
4315
|
+
Ll as getAccountIdentifier,
|
|
4316
|
+
Gr as getAddressFromArgentName,
|
|
4317
|
+
Xs as getAddressFromStarkName,
|
|
4318
|
+
hn as getArgentAccountClassHashes,
|
|
4319
|
+
ba as getArgentAccountClassHashesWithTxV3Support,
|
|
4320
|
+
ya as getArgentAccountWithMultiSignerClassHashes,
|
|
4321
|
+
Hl as getBackendTimeNowSeconds,
|
|
4322
|
+
qs as getBackendTimeSeconds,
|
|
4323
|
+
Ys as getCallFromStarkName,
|
|
4324
|
+
Ws as getChainIdFromNetworkId,
|
|
4325
|
+
li as getColor,
|
|
4326
|
+
_a as getDapplandLinkForDapp,
|
|
4327
|
+
Xl as getDapplandUrlForDapp,
|
|
4328
|
+
pd as getDisplayWarnAndReasonForTransactionReview,
|
|
4326
4329
|
ge as getERC20Transactions,
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4330
|
+
Ur as getERC721Transactions,
|
|
4331
|
+
sl as getEstimatedFeeFromBulkSimulation,
|
|
4332
|
+
al as getEstimatedFeeFromSimulationAndRespectWatermarkFee,
|
|
4333
|
+
ii as getInitials,
|
|
4334
|
+
Gl as getLastCairo0ArgentAccountClassHash,
|
|
4335
|
+
wa as getLatestArgentAccountClassHash,
|
|
4336
|
+
Ml as getLatestArgentMultisigClassHash,
|
|
4337
|
+
ql as getLatestLedgerAccountClassHash,
|
|
4338
|
+
zl as getLedgerAccountClassHashes,
|
|
4339
|
+
Kf as getMessageFromTrpcError,
|
|
4340
|
+
md as getNFTTransferActivity,
|
|
4341
|
+
tu as getNetworkAccountImageUrl,
|
|
4342
|
+
yu as getNftPicture,
|
|
4343
|
+
ol as getPayloadFromTransaction,
|
|
4344
|
+
Zf as getPrettyRpcError,
|
|
4345
|
+
dl as getReviewForTransactions,
|
|
4346
|
+
nn as getSignerForMultiSigner,
|
|
4347
|
+
ed as getSimulationTxVersionFromFeeToken,
|
|
4348
|
+
Zs as getStarknetIdContractAddressFromNetworkId,
|
|
4349
|
+
Wc as getTokenBalance,
|
|
4350
|
+
$u as getTokens,
|
|
4351
|
+
Ru as getTokensBalances,
|
|
4352
|
+
gd as getTransactionReviewActivityOfType,
|
|
4353
|
+
wd as getTransactionReviewHasSwap,
|
|
4354
|
+
ul as getTransactionReviewSwap,
|
|
4355
|
+
yd as getTransactionReviewWithType,
|
|
4356
|
+
Fn as getTxVersionFromFeeToken,
|
|
4357
|
+
nd as getTxVersionFromFeeTokenForDeclareContract,
|
|
4358
|
+
qc as getUAParserResult,
|
|
4356
4359
|
Ut as getUint256CalldataFromBN,
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4360
|
+
rl as getWatermarkedMaxFeeTotal,
|
|
4361
|
+
id as hasERC20Transactions,
|
|
4362
|
+
ll as hasERC721Transactions,
|
|
4363
|
+
cd as hasIncomingERC20Transactions,
|
|
4364
|
+
ld as hasOutgoingERC20Transactions,
|
|
4362
4365
|
Pt as hexSchema,
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4366
|
+
Yf as hexSchemaBase,
|
|
4367
|
+
oi as id,
|
|
4368
|
+
en as implementationSchema,
|
|
4369
|
+
Xf as includesAddress,
|
|
4370
|
+
Jf as inputAmountSchema,
|
|
4371
|
+
Nl as isAccountV4,
|
|
4372
|
+
_l as isAccountV5,
|
|
4373
|
+
Bl as isAccountV6,
|
|
4374
|
+
Hr as isAddress,
|
|
4375
|
+
iu as isAllowedAddressHexInputValue,
|
|
4376
|
+
cu as isAllowedNumericInputValue,
|
|
4377
|
+
kl as isArgentBackendNetworkId,
|
|
4378
|
+
Mr as isArgentName,
|
|
4379
|
+
Ol as isArgentNetworkId,
|
|
4380
|
+
_u as isBraveBrowser,
|
|
4378
4381
|
me as isBrowser,
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
+
Cu as isChromeBrowser,
|
|
4383
|
+
ou as isContractDeployed,
|
|
4384
|
+
ku as isEdgeBrowser,
|
|
4382
4385
|
nt as isEqualAddress,
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4386
|
+
Qf as isEqualArgentName,
|
|
4387
|
+
Sa as isEqualImplementation,
|
|
4388
|
+
th as isEqualStarknetDomainName,
|
|
4389
|
+
eh as isEqualStarknetId,
|
|
4390
|
+
nl as isFRI,
|
|
4391
|
+
su as isFeatureEnabled,
|
|
4392
|
+
Nu as isFirefoxBrowser,
|
|
4390
4393
|
Y as isNumeric,
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4394
|
+
Ou as isSafariBrowser,
|
|
4395
|
+
nh as isStarknetDomainName,
|
|
4396
|
+
Vr as isStarknetId,
|
|
4397
|
+
Zc as isUnlimitedAmount,
|
|
4398
|
+
Dr as isValidAddress,
|
|
4399
|
+
rh as isValidInputAmount,
|
|
4400
|
+
$r as isWEI,
|
|
4401
|
+
Lr as isZeroAddress,
|
|
4402
|
+
Ta as knownDappSchema,
|
|
4403
|
+
Ba as knownDappsSchema,
|
|
4404
|
+
sh as legacyContractClassSchema,
|
|
4405
|
+
oh as legacyEventSchema,
|
|
4406
|
+
ah as modifySnjsFeeOverhead,
|
|
4407
|
+
ih as multiTypeSchema,
|
|
4408
|
+
qu as multiplyBigIntByFloat,
|
|
4409
|
+
Ca as nameProviderResolutionSchema,
|
|
4410
|
+
Oa as nameResolutionAddressSchema,
|
|
4411
|
+
Pa as nameResolutionAddressesSchema,
|
|
4412
|
+
nr as nameResolutionStarknetIdSchema,
|
|
4413
|
+
Na as nameResolutionStarknetIdsSchema,
|
|
4414
|
+
au as nonNullable,
|
|
4415
|
+
Ln as normalizeAddress,
|
|
4416
|
+
ch as normalizeAddressOrDomain,
|
|
4417
|
+
lh as normalizeArgentName,
|
|
4418
|
+
uh as normalizeStarknetId,
|
|
4419
|
+
Gc as onchainRecoverySchema,
|
|
4420
|
+
dh as parseAmount,
|
|
4421
|
+
mi as parseAmountValue,
|
|
4422
|
+
lu as pluralise,
|
|
4423
|
+
Ul as postData,
|
|
4424
|
+
Cl as preferencesEndpointPayload,
|
|
4425
|
+
As as preferencesSchema,
|
|
4426
|
+
hi as prettifyCurrencyNumber,
|
|
4427
|
+
Du as prettifyCurrencyValue,
|
|
4428
|
+
ur as prettifyNumber,
|
|
4429
|
+
He as prettifyNumberConfig,
|
|
4430
|
+
Hu as prettifyTokenAmount,
|
|
4431
|
+
pi as prettifyTokenNumber,
|
|
4432
|
+
fh as productGroupsSchema,
|
|
4433
|
+
hh as programSchema,
|
|
4434
|
+
ka as providersNamesSchema,
|
|
4435
|
+
ph as pythonicHintsSchema,
|
|
4436
|
+
mh as rawArgsArraySchema,
|
|
4437
|
+
gh as rawArgsObjectSchema,
|
|
4438
|
+
wh as rawArgsSchema,
|
|
4439
|
+
uu as readFileAsString,
|
|
4440
|
+
Rr as recoveryBaseSchema,
|
|
4441
|
+
Iu as recoveryBodySchema,
|
|
4442
|
+
Vc as recoveryStatusSchema,
|
|
4443
|
+
yh as removeOwnersCalldataSchema,
|
|
4444
|
+
bh as removePluginCalldataSchema,
|
|
4445
|
+
Sh as replaceSignerCalldataSchema,
|
|
4446
|
+
Pu as seedphraseSchema,
|
|
4447
|
+
Eh as sierraContractEntryPointFieldsSchema,
|
|
4448
|
+
Ah as sierraEntryPointsByTypeSchema,
|
|
4449
|
+
xh as sierraProgramDebugInfoSchema,
|
|
4450
|
+
Ks as starkNameToCallDataDomain,
|
|
4451
|
+
vh as starknetDomainNameSchema,
|
|
4452
|
+
Zr as starknetIdSchema,
|
|
4453
|
+
Tu as startOnchainRecoveryErrorSchema,
|
|
4454
|
+
zc as startOnchainRecoveryErrorStatusSchema,
|
|
4455
|
+
Hc as startOnchainRecoverySchema,
|
|
4456
|
+
Ih as stringToBooleanSchema,
|
|
4457
|
+
ui as stripAddressZeroPadding,
|
|
4458
|
+
Th as structAbiSchema,
|
|
4459
|
+
Dl as swrRefetchDisabledConfig,
|
|
4457
4460
|
Rt as toMax,
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4461
|
+
Wu as tokensRequireTxV3Support,
|
|
4462
|
+
Bh as transactionReviewTransactionsSchema,
|
|
4463
|
+
_h as transactionReviewWarningSchema,
|
|
4464
|
+
rs as transferCalldataSchema,
|
|
4465
|
+
Nh as trpcErrorSchema,
|
|
4466
|
+
Ch as txVersionSchema,
|
|
4467
|
+
Oh as uint256Schema,
|
|
4468
|
+
kh as unclaimedRewardsSchema,
|
|
4466
4469
|
Be as unitToFeeTokenAddress,
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4470
|
+
fu as urlWithQuery,
|
|
4471
|
+
od as useBalanceChange,
|
|
4472
|
+
gu as useCollection,
|
|
4473
|
+
zs as useConditionallyEnabledSWR,
|
|
4474
|
+
Kl as useDebounce,
|
|
4475
|
+
Zl as useDebouncedValue,
|
|
4476
|
+
ad as useERC20Transactions,
|
|
4477
|
+
ud as useERC721Transactions,
|
|
4478
|
+
Ph as useEmitEvent,
|
|
4479
|
+
Rh as useEventEmitter,
|
|
4480
|
+
$h as useEventEmitterContext,
|
|
4481
|
+
Fh as useEventListener,
|
|
4482
|
+
dd as useHasERC721Transaction,
|
|
4483
|
+
Uh as useIsEventEmitterEnabled,
|
|
4484
|
+
fd as useMaxAmountTransaction,
|
|
4485
|
+
wu as useNft,
|
|
4486
|
+
mu as useNfts,
|
|
4487
|
+
Fu as useToken,
|
|
4488
|
+
hd as useTransactionReview,
|
|
4489
|
+
bd as useTransactionReviewV2webFetcher,
|
|
4490
|
+
jh as validChecksumAddressSchema,
|
|
4491
|
+
Lh as validateAddressRangeSchema,
|
|
4492
|
+
hu as voidify,
|
|
4493
|
+
jl as withPolling
|
|
4491
4494
|
};
|