@argent/x-shared 1.32.7 → 1.32.8
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 +37 -36
- package/dist/simulation.js +1 -1
- package/dist/simulation.mjs +2 -2
- package/dist/transactionVersion-DEi2xnLR.js +1 -0
- package/dist/{transactionVersion-DLjpblNo.mjs → transactionVersion-xln1MPWP.mjs} +289 -288
- package/dist/utils/starknet/starknet.d.ts +7 -0
- package/package.json +1 -1
- package/dist/transactionVersion-CqtzoGMU.js +0 -1
|
@@ -28,10 +28,10 @@ const jt = e.string().refine((t) => {
|
|
|
28
28
|
} catch {
|
|
29
29
|
}
|
|
30
30
|
return !1;
|
|
31
|
-
}, "Invalid address (validation error)"), Ve = e.string().regex(/^0x[0-9a-fA-F]+$/, "Invalid address"), Xr = Ve.min(50, "Addresses must at least be 50 characters long").max(66, "Addresses must at most be 66 characters long"), Hr = Ve.length(66, "Address must be 66 characters long"), K = Xr.pipe(jt).transform((t) => `0x${(t.startsWith("0x") ? t.slice(2) : t).padStart(64, "0")}`),
|
|
31
|
+
}, "Invalid address (validation error)"), Ve = e.string().regex(/^0x[0-9a-fA-F]+$/, "Invalid address"), Xr = Ve.min(50, "Addresses must at least be 50 characters long").max(66, "Addresses must at most be 66 characters long"), Hr = Ve.length(66, "Address must be 66 characters long"), K = Xr.pipe(jt).transform((t) => `0x${(t.startsWith("0x") ? t.slice(2) : t).padStart(64, "0")}`), Ua = K.or(e.literal("")).transform((t) => t === "" ? void 0 : t).optional(), H = Ve.transform((t) => `0x${t.replace(/^0x/, "").toLowerCase().padStart(64, "0")}`), zr = (t) => K.safeParse(t).success, qr = zr, $e = (t) => Pr(t), Fa = (t) => {
|
|
32
32
|
const o = $e(t), E = o.slice(0, 2), T = o.slice(2, 6), N = o.slice(-4);
|
|
33
33
|
return `${E}${T}…${N}`;
|
|
34
|
-
},
|
|
34
|
+
}, xa = (t) => {
|
|
35
35
|
const o = $e(t), E = o.slice(0, 2), N = o.slice(2).match(/.{1,4}/g) || [];
|
|
36
36
|
return `${E} ${N.join(" ")}`;
|
|
37
37
|
}, Wr = (t) => !/^0x[0-9a-f]{63,64}$/.test(t), Kr = (t, o) => {
|
|
@@ -46,15 +46,15 @@ const jt = e.string().refine((t) => {
|
|
|
46
46
|
} catch {
|
|
47
47
|
}
|
|
48
48
|
return !1;
|
|
49
|
-
},
|
|
49
|
+
}, Ba = (t, o) => !!(o != null && o.some((E) => Kr(E, t))), Ma = Pt((t) => {
|
|
50
50
|
const o = t.slice(0, 6), E = t.slice(-4);
|
|
51
51
|
return `${o}…${E}`;
|
|
52
|
-
}),
|
|
52
|
+
}), Ga = Pt((t, o) => {
|
|
53
53
|
if (t.length < o)
|
|
54
54
|
return t;
|
|
55
55
|
const E = Math.floor((o - 1) / 2), T = t.slice(0, E), N = t.slice(-E);
|
|
56
56
|
return `${T}…${N}`;
|
|
57
|
-
}),
|
|
57
|
+
}), Va = e.string().regex(/^[a-zA-Z0-9.-]*$/g, "Invalid address character").max(66, "Address cannot be over 66 characters"), Zr = Hr.pipe(jt).pipe($r), Xe = e.string().regex(/^([a-zA-Z0-9-]+\.)+argent.xyz$/, "Invalid Argent name").max(253, "Argent name cannot be over 253 characters"), Jr = (t) => Xe.safeParse(t).success, Qr = (t, o) => {
|
|
58
58
|
try {
|
|
59
59
|
return o ? et(t) === et(o) : !1;
|
|
60
60
|
} catch {
|
|
@@ -69,19 +69,19 @@ const jt = e.string().refine((t) => {
|
|
|
69
69
|
}, tt = (t) => ht.parse(t).toLowerCase(), mt = e.union([
|
|
70
70
|
Xe,
|
|
71
71
|
ht
|
|
72
|
-
]),
|
|
72
|
+
]), $a = e.union([
|
|
73
73
|
K,
|
|
74
74
|
mt
|
|
75
|
-
]),
|
|
75
|
+
]), Xa = e.union([
|
|
76
76
|
Zr,
|
|
77
77
|
mt
|
|
78
|
-
]),
|
|
78
|
+
]), Ha = (t) => mt.safeParse(t).success, za = (t, o) => {
|
|
79
79
|
try {
|
|
80
80
|
return o ? Qr(t, o) || tn(t, o) : !1;
|
|
81
81
|
} catch {
|
|
82
82
|
}
|
|
83
83
|
return !1;
|
|
84
|
-
},
|
|
84
|
+
}, qa = (t) => en(t) ? tt(t) : Jr(t) ? et(t) : $e(t), rn = e.union([e.literal("0"), e.literal("1")]), Wa = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", Ka = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", Ya = "0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003", Za = "0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f", Ja = "0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48", Qa = "0x6e150953b26271a740bf2b6e9bca17cc52c68d765f761295de51ceb8526ee72", ei = "0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f";
|
|
85
85
|
function nn(t) {
|
|
86
86
|
var o = [];
|
|
87
87
|
if (t.length === 0)
|
|
@@ -135,7 +135,7 @@ var St;
|
|
|
135
135
|
(function(t) {
|
|
136
136
|
t.FAILED_TO_FETCH_URL = "Failed to fetch url", t.FAILED_TO_POST_URL = "Failed to post url";
|
|
137
137
|
})(St || (St = {}));
|
|
138
|
-
const
|
|
138
|
+
const ti = e.object({
|
|
139
139
|
walletAddress: H,
|
|
140
140
|
ens: Xe,
|
|
141
141
|
chain: e.enum(["ethereum", "starknet"]),
|
|
@@ -144,7 +144,7 @@ const ei = e.object({
|
|
|
144
144
|
}).or(e.object({
|
|
145
145
|
status: e.string()
|
|
146
146
|
}));
|
|
147
|
-
async function
|
|
147
|
+
async function ri(t, o, E, T = "starknet") {
|
|
148
148
|
const N = {
|
|
149
149
|
ens: t,
|
|
150
150
|
chain: T
|
|
@@ -177,7 +177,7 @@ var nt;
|
|
|
177
177
|
(function(t) {
|
|
178
178
|
t.NOT_VALID = "Invalid call";
|
|
179
179
|
})(nt || (nt = {}));
|
|
180
|
-
class
|
|
180
|
+
class ni extends we {
|
|
181
181
|
constructor(o) {
|
|
182
182
|
super(o, nt), this.name = "CallError";
|
|
183
183
|
}
|
|
@@ -186,7 +186,7 @@ var at;
|
|
|
186
186
|
(function(t) {
|
|
187
187
|
t.NO_NETWORK_OR_MULTICALL = "Missing networkId or multicall", t.NOT_FOUND = "Network not found";
|
|
188
188
|
})(at || (at = {}));
|
|
189
|
-
class
|
|
189
|
+
class ai extends we {
|
|
190
190
|
constructor(o) {
|
|
191
191
|
super(o, at), this.name = "NetworkError";
|
|
192
192
|
}
|
|
@@ -201,38 +201,38 @@ const De = e.union([e.string(), e.number(), e.bigint()]), sn = e.object({
|
|
|
201
201
|
sn,
|
|
202
202
|
e.any(),
|
|
203
203
|
e.boolean()
|
|
204
|
-
]), ln = e.lazy(() => e.record(e.union([Be, e.array(Be), gt]))), gt = e.lazy(() => e.union([ln, cn])), un = e.lazy(() => e.object({
|
|
204
|
+
]), ln = e.lazy(() => e.record(e.union([Be, e.array(Be), gt]))), gt = e.lazy(() => e.union([ln, cn])), un = e.union([gt, on]).optional(), fn = e.lazy(() => e.object({
|
|
205
205
|
contractAddress: e.string(),
|
|
206
|
-
calldata:
|
|
206
|
+
calldata: un,
|
|
207
207
|
entrypoint: e.string().optional()
|
|
208
|
-
})), bt = e.lazy(() =>
|
|
208
|
+
})), bt = e.lazy(() => fn.and(e.object({
|
|
209
209
|
entrypoint: e.string()
|
|
210
|
-
}))), he = e.string().refine((t) => typeof parseInt(t) == "number"),
|
|
210
|
+
}))), he = e.string().refine((t) => typeof parseInt(t) == "number"), ii = e.tuple([he]), si = e.tuple([he]), oi = e.object({
|
|
211
211
|
new_threshold: e.string().refine((t) => typeof parseInt(t) == "number"),
|
|
212
212
|
signers_to_add: e.array(he)
|
|
213
|
-
}),
|
|
213
|
+
}), ci = e.object({
|
|
214
214
|
new_threshold: e.string().refine((t) => typeof parseInt(t) == "number"),
|
|
215
215
|
signers_to_remove: e.array(he)
|
|
216
|
-
}),
|
|
216
|
+
}), li = e.object({
|
|
217
217
|
signer_to_remove: he,
|
|
218
218
|
signer_to_add: he
|
|
219
|
-
}),
|
|
219
|
+
}), ui = e.tuple([he]), fi = e.tuple([he]), pi = e.tuple([he]), hi = e.tuple([he]).rest(he), mi = e.object({
|
|
220
220
|
recipient: K,
|
|
221
221
|
amount: e.object({
|
|
222
222
|
low: De,
|
|
223
223
|
high: De
|
|
224
224
|
})
|
|
225
|
-
}),
|
|
225
|
+
}), pn = e.string().regex(/^(0x)?[0-9a-fA-F]+$/, "Invalid hex string"), Me = pn.transform((t) => {
|
|
226
226
|
const o = t.startsWith("0x") ? t.slice(2) : t;
|
|
227
227
|
return `0x${o.length % 2 === 0 ? o : `0${o}`}`;
|
|
228
|
-
}),
|
|
228
|
+
}), di = e.object({
|
|
229
229
|
cairoVersion: rn,
|
|
230
230
|
accountClassHash: Me
|
|
231
|
-
}),
|
|
231
|
+
}), hn = e.array(e.string()), gi = e.object({
|
|
232
232
|
implementation: e.string(),
|
|
233
233
|
selector: Me,
|
|
234
|
-
calldata:
|
|
235
|
-
}),
|
|
234
|
+
calldata: hn
|
|
235
|
+
}), Ei = e.object({
|
|
236
236
|
owner: e.string(),
|
|
237
237
|
guardian: e.string().optional().transform((t) => t ?? "0")
|
|
238
238
|
});
|
|
@@ -240,7 +240,7 @@ var Tt;
|
|
|
240
240
|
(function(t) {
|
|
241
241
|
t.Starknet = "Starknet", t.Secp256k1 = "Secp256k1", t.Secp256r1 = "Secp256r1", t.Eip191 = "Eip191", t.Webauthn = "Webauthn";
|
|
242
242
|
})(Tt || (Tt = {}));
|
|
243
|
-
function
|
|
243
|
+
function Ii(t, o) {
|
|
244
244
|
const E = {
|
|
245
245
|
Starknet: void 0,
|
|
246
246
|
Secp256k1: void 0,
|
|
@@ -254,12 +254,12 @@ var it;
|
|
|
254
254
|
(function(t) {
|
|
255
255
|
t.NOT_FOUND = "Account not found", t.CALCULATED_ADDRESS_NO_MATCH = "Calculated address does not match account address";
|
|
256
256
|
})(it || (it = {}));
|
|
257
|
-
class
|
|
257
|
+
class Ai extends we {
|
|
258
258
|
constructor(o) {
|
|
259
259
|
super(o, it), this.name = "AccountError";
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function mn(t) {
|
|
263
263
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
264
264
|
}
|
|
265
265
|
var st = { exports: {} };
|
|
@@ -885,11 +885,11 @@ var st = { exports: {} };
|
|
|
885
885
|
return l === null ? null : me(l[2] + "." + (l[3] || "0") + "." + (l[4] || "0"), s);
|
|
886
886
|
}
|
|
887
887
|
})(st, st.exports);
|
|
888
|
-
var
|
|
889
|
-
const
|
|
888
|
+
var dn = st.exports;
|
|
889
|
+
const Ni = /* @__PURE__ */ mn(dn), Si = (t) => t == null ? [] : Array.isArray(t) ? t : [t], bi = e.any().refine((t) => typeof t == "bigint", {
|
|
890
890
|
message: "Value must be a BigInt"
|
|
891
891
|
}).transform((t) => BigInt(t));
|
|
892
|
-
var
|
|
892
|
+
var gn = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, qe = Math.ceil, ce = Math.floor, ne = "[BigNumber Error] ", yt = ne + "Number primitive has more than 15 significant digits: ", pe = 1e14, U = 14, We = 9007199254740991, Ke = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], Re = 1e7, Z = 1e9;
|
|
893
893
|
function kt(t) {
|
|
894
894
|
var o, E, T, N = R.prototype = { constructor: R, toString: null, valueOf: null }, D = new R(1), w = 20, k = 4, L = -7, A = 21, d = -1e7, Y = 1e7, P = !1, fe = 1, ee = 0, Ie = {
|
|
895
895
|
prefix: "",
|
|
@@ -918,7 +918,7 @@ function kt(t) {
|
|
|
918
918
|
}
|
|
919
919
|
g = String(n);
|
|
920
920
|
} else {
|
|
921
|
-
if (!
|
|
921
|
+
if (!gn.test(g = String(n))) return T(m, g, c);
|
|
922
922
|
m.s = g.charCodeAt(0) == 45 ? (g = g.slice(1), -1) : 1;
|
|
923
923
|
}
|
|
924
924
|
(p = g.indexOf(".")) > -1 && (g = g.replace(".", "")), (I = g.search(/e/i)) > 0 ? (p < 0 && (p = I), p += +g.slice(I + 1), g = g.substring(0, I)) : p < 0 && (p = g.length);
|
|
@@ -1506,8 +1506,8 @@ function Se(t, o, E) {
|
|
|
1506
1506
|
} else o < T && (t = t.slice(0, o) + "." + t.slice(o));
|
|
1507
1507
|
return t;
|
|
1508
1508
|
}
|
|
1509
|
-
var
|
|
1510
|
-
const
|
|
1509
|
+
var Ti = kt();
|
|
1510
|
+
const yi = e.boolean().transform((t) => String(t)), Ri = e.string().transform((t) => t === "true");
|
|
1511
1511
|
var ot;
|
|
1512
1512
|
(function(t) {
|
|
1513
1513
|
t[t.function = 0] = "function", t[t.l1_handler = 1] = "l1_handler", t[t.constructor = 2] = "constructor";
|
|
@@ -1520,75 +1520,75 @@ const Ut = e.array(e.string()), Ye = e.object({
|
|
|
1520
1520
|
CONSTRUCTOR: e.array(Ye),
|
|
1521
1521
|
EXTERNAL: e.array(Ye),
|
|
1522
1522
|
L1_HANDLER: e.array(Ye)
|
|
1523
|
-
}),
|
|
1523
|
+
}), vi = e.string(), En = e.object({
|
|
1524
1524
|
builtins: Ut,
|
|
1525
1525
|
data: e.array(e.string())
|
|
1526
1526
|
}), ct = e.object({
|
|
1527
1527
|
name: e.string(),
|
|
1528
1528
|
type: e.union([e.literal("felt"), e.literal("felt*"), e.string()])
|
|
1529
|
-
}),
|
|
1529
|
+
}), In = e.nativeEnum(ot), An = e.object({
|
|
1530
1530
|
inputs: e.array(ct),
|
|
1531
1531
|
name: e.string(),
|
|
1532
1532
|
outputs: e.array(ct),
|
|
1533
1533
|
stateMutability: e.literal("view").optional(),
|
|
1534
1534
|
state_mutability: e.string().optional(),
|
|
1535
|
-
type:
|
|
1535
|
+
type: In
|
|
1536
1536
|
}), lt = e.object({
|
|
1537
1537
|
name: e.string(),
|
|
1538
1538
|
type: e.union([e.literal("felt"), e.literal("felt*"), e.string()]),
|
|
1539
1539
|
kind: e.union([e.literal("key"), e.literal("data")])
|
|
1540
|
-
}),
|
|
1540
|
+
}), Nn = e.object({
|
|
1541
1541
|
name: e.string(),
|
|
1542
1542
|
type: e.literal("event"),
|
|
1543
1543
|
data: e.array(lt),
|
|
1544
1544
|
keys: e.array(lt)
|
|
1545
|
-
}),
|
|
1545
|
+
}), Sn = e.object({
|
|
1546
1546
|
name: e.string(),
|
|
1547
1547
|
members: e.array(lt),
|
|
1548
1548
|
kind: e.literal("struct"),
|
|
1549
1549
|
type: e.literal("event")
|
|
1550
|
-
}),
|
|
1550
|
+
}), bn = e.object({
|
|
1551
1551
|
members: e.array(ct.and(e.object({
|
|
1552
1552
|
offset: e.number()
|
|
1553
1553
|
}))),
|
|
1554
1554
|
name: e.string(),
|
|
1555
1555
|
size: e.number(),
|
|
1556
1556
|
type: e.literal("struct")
|
|
1557
|
-
}),
|
|
1558
|
-
program:
|
|
1557
|
+
}), Tn = e.union([Sn, Nn]), xt = e.array(e.union([An, Tn, bn, e.any()])), yn = e.object({
|
|
1558
|
+
program: En,
|
|
1559
1559
|
entry_points_by_type: Ft,
|
|
1560
1560
|
abi: xt
|
|
1561
|
-
}), Bt = e.array(e.string()),
|
|
1561
|
+
}), Bt = e.array(e.string()), Rn = e.object({
|
|
1562
1562
|
type_names: e.array(e.tuple([e.number(), e.string()])),
|
|
1563
1563
|
libfunc_names: e.array(e.tuple([e.number(), e.string()])),
|
|
1564
1564
|
user_func_names: e.array(e.tuple([e.number(), e.string()]))
|
|
1565
1565
|
}), Ze = e.object({
|
|
1566
1566
|
selector: e.string(),
|
|
1567
1567
|
function_idx: e.number()
|
|
1568
|
-
}),
|
|
1568
|
+
}), vn = e.object({
|
|
1569
1569
|
CONSTRUCTOR: e.array(Ze),
|
|
1570
1570
|
EXTERNAL: e.array(Ze),
|
|
1571
1571
|
L1_HANDLER: e.array(Ze)
|
|
1572
|
-
}),
|
|
1572
|
+
}), On = e.object({
|
|
1573
1573
|
sierra_program: Bt,
|
|
1574
|
-
sierra_program_debug_info:
|
|
1574
|
+
sierra_program_debug_info: Rn.optional(),
|
|
1575
1575
|
contract_class_version: e.string(),
|
|
1576
|
-
entry_points_by_type:
|
|
1576
|
+
entry_points_by_type: vn,
|
|
1577
1577
|
abi: xt
|
|
1578
|
-
}),
|
|
1578
|
+
}), wn = e.array(e.tuple([e.number(), e.array(e.string())])), _n = e.object({
|
|
1579
1579
|
prime: e.string(),
|
|
1580
1580
|
compiler_version: e.string(),
|
|
1581
1581
|
bytecode: Bt,
|
|
1582
1582
|
hints: e.array(e.any()),
|
|
1583
|
-
pythonic_hints:
|
|
1583
|
+
pythonic_hints: wn,
|
|
1584
1584
|
entry_points_by_type: Ft
|
|
1585
|
-
}),
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
]), Mt = Br(null), Gt = () => Mr(Mt),
|
|
1585
|
+
}), Oi = _n, wi = e.union([
|
|
1586
|
+
yn,
|
|
1587
|
+
On
|
|
1588
|
+
]), Mt = Br(null), Gt = () => Mr(Mt), _i = () => {
|
|
1589
1589
|
var t;
|
|
1590
1590
|
return !!((t = Gt()) != null && t.emitter);
|
|
1591
|
-
},
|
|
1591
|
+
}, Li = ({ emitter: t, children: o }) => /* @__PURE__ */ xr(Mt.Provider, { value: {
|
|
1592
1592
|
emitter: t
|
|
1593
1593
|
}, children: o });
|
|
1594
1594
|
let Rt = !1;
|
|
@@ -1600,20 +1600,20 @@ const Vt = () => {
|
|
|
1600
1600
|
return;
|
|
1601
1601
|
}
|
|
1602
1602
|
return t;
|
|
1603
|
-
},
|
|
1603
|
+
}, Ci = () => {
|
|
1604
1604
|
const t = Vt();
|
|
1605
1605
|
return t ? t.emit.bind(t) : kr;
|
|
1606
|
-
},
|
|
1606
|
+
}, Di = () => {
|
|
1607
1607
|
const t = Vt();
|
|
1608
1608
|
return (E, T) => {
|
|
1609
1609
|
Gr(() => t ? t.on(E, T) : void 0, [E, T]);
|
|
1610
1610
|
};
|
|
1611
1611
|
};
|
|
1612
|
-
var
|
|
1612
|
+
var Ln = {};
|
|
1613
1613
|
function ue(t, o) {
|
|
1614
1614
|
typeof o == "boolean" && (o = { forever: o }), this._originalTimeouts = JSON.parse(JSON.stringify(t)), this._timeouts = t, this._options = o || {}, this._maxRetryTime = o && o.maxRetryTime || 1 / 0, this._fn = null, this._errors = [], this._attempts = 1, this._operationTimeout = null, this._operationTimeoutCb = null, this._timeout = null, this._operationStart = null, this._timer = null, this._options.forever && (this._cachedTimeouts = this._timeouts.slice(0));
|
|
1615
1615
|
}
|
|
1616
|
-
var
|
|
1616
|
+
var Cn = ue;
|
|
1617
1617
|
ue.prototype.reset = function() {
|
|
1618
1618
|
this._attempts = 1, this._timeouts = this._originalTimeouts.slice(0);
|
|
1619
1619
|
};
|
|
@@ -1670,7 +1670,7 @@ ue.prototype.mainError = function() {
|
|
|
1670
1670
|
return o;
|
|
1671
1671
|
};
|
|
1672
1672
|
(function(t) {
|
|
1673
|
-
var o =
|
|
1673
|
+
var o = Cn;
|
|
1674
1674
|
t.operation = function(E) {
|
|
1675
1675
|
var T = t.timeouts(E);
|
|
1676
1676
|
return new o(T, {
|
|
@@ -1718,12 +1718,12 @@ ue.prototype.mainError = function() {
|
|
|
1718
1718
|
}).bind(E, L), E[k].options = T;
|
|
1719
1719
|
}
|
|
1720
1720
|
};
|
|
1721
|
-
})(
|
|
1721
|
+
})(Ln);
|
|
1722
1722
|
var ut;
|
|
1723
1723
|
(function(t) {
|
|
1724
1724
|
t.NO_TOKEN_API_URL = "NO_TOKEN_API_URL is not defined", t.NO_TOKEN_PRICE_API_URL = "NO_TOKEN_PRICE_API_URL is not defined", t.TOKENS_DEFI_DECOMPOSITION_URL = "TOKENS_DEFI_DECOMPOSITION_URL is not defined", t.TOKENS_AIRDROPS_API_URL = "TOKENS_AIRDROPS_API_URL is not defined", t.TOKEN_PARSING_ERROR = "Unable to parse token data response", t.TOKEN_PRICE_PARSING_ERROR = "Unable to parse token price response", t.TOKEN_DEFI_DECOMPOSITION_PARSING_ERROR = "Unable to parse token defi decomposition response", t.TOKEN_PRICE_NOT_FOUND = "Token price not found", t.TOKEN_NOT_FOUND = "Token not found", t.TOKEN_DETAILS_NOT_FOUND = "Token details not found", t.FEE_TOKEN_NOT_FOUND = "Fee token not found", t.UNABLE_TO_CALCULATE_CURRENCY_VALUE = "Unable to calculate currency value", t.UNSAFE_DECIMALS = "Unsafe decimals in token";
|
|
1725
1725
|
})(ut || (ut = {}));
|
|
1726
|
-
class
|
|
1726
|
+
class Pi extends we {
|
|
1727
1727
|
constructor(o) {
|
|
1728
1728
|
super(o, ut), this.name = "TokenError";
|
|
1729
1729
|
}
|
|
@@ -1731,7 +1731,7 @@ class Di extends we {
|
|
|
1731
1731
|
const $t = e.union([
|
|
1732
1732
|
e.literal("concentratedLiquidityPosition"),
|
|
1733
1733
|
e.literal("collateralizedDebtPosition")
|
|
1734
|
-
]),
|
|
1734
|
+
]), ji = e.object({
|
|
1735
1735
|
status: e.literal("initialising")
|
|
1736
1736
|
}).or(e.object({
|
|
1737
1737
|
status: e.literal("initialised"),
|
|
@@ -1766,15 +1766,15 @@ const $t = e.union([
|
|
|
1766
1766
|
rank: e.number()
|
|
1767
1767
|
}).optional(),
|
|
1768
1768
|
tags: e.array(e.string()).optional()
|
|
1769
|
-
}),
|
|
1769
|
+
}), ki = e.object({
|
|
1770
1770
|
tokens: e.array(Pe)
|
|
1771
|
-
}),
|
|
1771
|
+
}), Ui = Pe, Xt = e.object({
|
|
1772
1772
|
pricingId: e.number(),
|
|
1773
1773
|
ethValue: e.string(),
|
|
1774
1774
|
ccyValue: e.string(),
|
|
1775
1775
|
ethDayChange: e.string(),
|
|
1776
1776
|
ccyDayChange: e.string()
|
|
1777
|
-
}),
|
|
1777
|
+
}), Fi = e.object({
|
|
1778
1778
|
prices: e.array(Xt)
|
|
1779
1779
|
}), vt = e.object({
|
|
1780
1780
|
tokenAddress: H,
|
|
@@ -1794,7 +1794,7 @@ const $t = e.union([
|
|
|
1794
1794
|
token0: vt,
|
|
1795
1795
|
token1: vt
|
|
1796
1796
|
})
|
|
1797
|
-
}),
|
|
1797
|
+
}), xi = e.array(zt), qt = Ht.extend({
|
|
1798
1798
|
data: e.object({
|
|
1799
1799
|
apy: e.string().optional(),
|
|
1800
1800
|
group: e.number().optional(),
|
|
@@ -1802,7 +1802,7 @@ const $t = e.union([
|
|
|
1802
1802
|
debt: e.boolean(),
|
|
1803
1803
|
lending: e.boolean()
|
|
1804
1804
|
})
|
|
1805
|
-
}),
|
|
1805
|
+
}), Bi = e.array(qt), Dn = e.array(zt.or(qt)), Pn = e.object({
|
|
1806
1806
|
name: e.string(),
|
|
1807
1807
|
manageUrl: e.string(),
|
|
1808
1808
|
type: $t,
|
|
@@ -1810,23 +1810,23 @@ const $t = e.union([
|
|
|
1810
1810
|
name: e.string().optional(),
|
|
1811
1811
|
healthRatio: e.string().optional()
|
|
1812
1812
|
})).optional(),
|
|
1813
|
-
positions:
|
|
1814
|
-
}), Pn = e.object({
|
|
1815
|
-
dappId: e.string(),
|
|
1816
|
-
products: e.array(Dn)
|
|
1817
|
-
}), Bi = e.object({
|
|
1818
|
-
dapps: e.array(Pn)
|
|
1813
|
+
positions: Dn
|
|
1819
1814
|
}), jn = e.object({
|
|
1815
|
+
dappId: e.string(),
|
|
1816
|
+
products: e.array(Pn)
|
|
1817
|
+
}), Mi = e.object({
|
|
1818
|
+
dapps: e.array(jn)
|
|
1819
|
+
}), kn = e.object({
|
|
1820
1820
|
name: e.string().optional(),
|
|
1821
1821
|
tokenAddress: K,
|
|
1822
1822
|
amount: e.string().optional(),
|
|
1823
1823
|
claimUrl: e.string().optional(),
|
|
1824
1824
|
claimStart: e.number(),
|
|
1825
1825
|
claimEnd: e.number().optional()
|
|
1826
|
-
}),
|
|
1826
|
+
}), Gi = e.object({
|
|
1827
1827
|
accountAddress: K,
|
|
1828
1828
|
chain: e.string(),
|
|
1829
|
-
airdrops: e.array(
|
|
1829
|
+
airdrops: e.array(kn)
|
|
1830
1830
|
}), He = e.object({
|
|
1831
1831
|
address: K,
|
|
1832
1832
|
networkId: e.string({ required_error: "Network is required" })
|
|
@@ -1845,15 +1845,15 @@ const Wt = He.required().extend({
|
|
|
1845
1845
|
category: e.string().optional(),
|
|
1846
1846
|
dappId: e.string().optional(),
|
|
1847
1847
|
brandColor: e.string().optional()
|
|
1848
|
-
}), kn = Wt.extend({
|
|
1849
|
-
balance: e.string()
|
|
1850
1848
|
}), Un = Wt.extend({
|
|
1849
|
+
balance: e.string()
|
|
1850
|
+
}), Fn = Wt.extend({
|
|
1851
1851
|
currencyValue: e.string(),
|
|
1852
1852
|
ccyDayChange: e.string().optional(),
|
|
1853
1853
|
ethDayChange: e.string().optional(),
|
|
1854
1854
|
unitCurrencyValue: e.string().optional()
|
|
1855
|
-
}), Et =
|
|
1856
|
-
...
|
|
1855
|
+
}), Et = Fn.extend({
|
|
1856
|
+
...Un.shape
|
|
1857
1857
|
});
|
|
1858
1858
|
e.array(Et);
|
|
1859
1859
|
He.extend({
|
|
@@ -1879,7 +1879,7 @@ const Ot = Et.extend({
|
|
|
1879
1879
|
unitCurrencyValueToken1: e.string().optional(),
|
|
1880
1880
|
token0: Ot,
|
|
1881
1881
|
token1: Ot
|
|
1882
|
-
}),
|
|
1882
|
+
}), Vi = e.array(Yt), $i = e.object({
|
|
1883
1883
|
name: e.string().optional(),
|
|
1884
1884
|
healthRatio: e.string().optional(),
|
|
1885
1885
|
accountAddress: K.optional()
|
|
@@ -1895,24 +1895,24 @@ const Ot = Et.extend({
|
|
|
1895
1895
|
token: Et.optional(),
|
|
1896
1896
|
accountAddress: K.optional(),
|
|
1897
1897
|
accountAddressGroup: e.string().optional()
|
|
1898
|
-
}),
|
|
1898
|
+
}), Xi = e.array(Zt), xn = Yt.or(Zt), Bn = e.record(e.object({
|
|
1899
1899
|
name: e.string().optional(),
|
|
1900
1900
|
healthRatio: e.string().optional(),
|
|
1901
1901
|
accountAddress: K.optional()
|
|
1902
|
-
})),
|
|
1902
|
+
})), Mn = e.object({
|
|
1903
1903
|
type: $t,
|
|
1904
1904
|
manageUrl: e.string().url().optional(),
|
|
1905
1905
|
name: e.string(),
|
|
1906
|
-
positions: e.array(
|
|
1906
|
+
positions: e.array(xn),
|
|
1907
1907
|
// other types will be added when available from be
|
|
1908
1908
|
positionsTotalValue: e.string(),
|
|
1909
1909
|
brandColor: e.string().optional(),
|
|
1910
|
-
groups:
|
|
1910
|
+
groups: Bn.optional(),
|
|
1911
1911
|
accountAddress: K
|
|
1912
|
-
}),
|
|
1912
|
+
}), Gn = e.array(Mn), Hi = e.object({
|
|
1913
1913
|
dappId: e.string(),
|
|
1914
|
-
products:
|
|
1915
|
-
}),
|
|
1914
|
+
products: Gn
|
|
1915
|
+
}), Vn = e.object({
|
|
1916
1916
|
name: e.string().optional(),
|
|
1917
1917
|
tokenAddress: K,
|
|
1918
1918
|
token: Pe.optional(),
|
|
@@ -1920,11 +1920,11 @@ const Ot = Et.extend({
|
|
|
1920
1920
|
claimUrl: e.string().optional(),
|
|
1921
1921
|
claimStart: e.number(),
|
|
1922
1922
|
claimEnd: e.number().optional()
|
|
1923
|
-
}),
|
|
1923
|
+
}), zi = e.array(Vn), $n = (t, o = 18) => Vr(t.replace(",", "."), Number(o)), Xn = e.string().trim().refine((t) => t !== "", {
|
|
1924
1924
|
message: "Amount is required"
|
|
1925
1925
|
}).refine((t) => {
|
|
1926
1926
|
try {
|
|
1927
|
-
const o =
|
|
1927
|
+
const o = $n(t).value;
|
|
1928
1928
|
if (o < 0n)
|
|
1929
1929
|
throw new Error("Amount must be positive");
|
|
1930
1930
|
if (o === 0n)
|
|
@@ -1935,7 +1935,7 @@ const Ot = Et.extend({
|
|
|
1935
1935
|
throw new Error("Amount should be a number");
|
|
1936
1936
|
}
|
|
1937
1937
|
return !0;
|
|
1938
|
-
}, { message: "Invalid amount" }),
|
|
1938
|
+
}, { message: "Invalid amount" }), qi = (t) => !!Xn.parse(t), Hn = e.object({
|
|
1939
1939
|
data: e.object({
|
|
1940
1940
|
code: e.string().optional(),
|
|
1941
1941
|
// "STARKNAME_NOT_FOUND",
|
|
@@ -1944,52 +1944,52 @@ const Ot = Et.extend({
|
|
|
1944
1944
|
message: e.string()
|
|
1945
1945
|
// "foo.stark not found"
|
|
1946
1946
|
})
|
|
1947
|
-
}),
|
|
1948
|
-
const o =
|
|
1947
|
+
}), Wi = (t) => {
|
|
1948
|
+
const o = Hn.safeParse(t);
|
|
1949
1949
|
if (o.success)
|
|
1950
1950
|
return o.data.data.message;
|
|
1951
|
-
},
|
|
1951
|
+
}, zn = 3, Jt = process.env.FEE_OVERHEAD ? parseFloat(process.env.FEE_OVERHEAD) : zn, qn = 1.5, Ge = 10, Wn = ({ estimatedFee: t, overheadMultiplier: o = Jt }) => {
|
|
1952
1952
|
const T = be.toBigInt(t) * BigInt(o * Ge) / BigInt(Ge);
|
|
1953
1953
|
return be.toHex(T);
|
|
1954
|
-
},
|
|
1954
|
+
}, Ki = ({ suggestedMaxFee: t, overheadMultiplier: o = Jt, starknetJsOverheadMultiplier: E = qn }) => {
|
|
1955
1955
|
const N = be.toBigInt(t) * BigInt(Ge) / BigInt(E * Ge);
|
|
1956
|
-
return
|
|
1956
|
+
return Wn({ estimatedFee: N, overheadMultiplier: o });
|
|
1957
1957
|
};
|
|
1958
1958
|
var ft;
|
|
1959
1959
|
(function(t) {
|
|
1960
1960
|
t.SIMULATE_AND_REVIEW_FAILED = "Missing simulation";
|
|
1961
1961
|
})(ft || (ft = {}));
|
|
1962
|
-
class
|
|
1962
|
+
class Yi extends we {
|
|
1963
1963
|
constructor(o) {
|
|
1964
1964
|
super(o, ft), this.name = "EstimateError";
|
|
1965
1965
|
}
|
|
1966
1966
|
}
|
|
1967
|
-
const
|
|
1967
|
+
const Zi = e.object({
|
|
1968
1968
|
type: e.enum(["DECLARE", "DEPLOY", "DEPLOY_ACCOUNT", "INVOKE"]).default("INVOKE"),
|
|
1969
1969
|
calls: e.array(bt).or(bt).optional(),
|
|
1970
1970
|
calldata: e.array(e.string()).optional(),
|
|
1971
1971
|
classHash: Me.optional(),
|
|
1972
1972
|
salt: Me.optional(),
|
|
1973
1973
|
signature: e.array(e.string()).optional()
|
|
1974
|
-
}),
|
|
1974
|
+
}), Kn = e.object({
|
|
1975
1975
|
amount: e.bigint(),
|
|
1976
1976
|
pricePerUnit: e.bigint()
|
|
1977
1977
|
}).or(e.object({ maxFee: e.bigint() })), wt = e.object({
|
|
1978
1978
|
feeTokenAddress: K,
|
|
1979
1979
|
amount: e.bigint(),
|
|
1980
1980
|
pricePerUnit: e.bigint(),
|
|
1981
|
-
max:
|
|
1981
|
+
max: Kn.optional(),
|
|
1982
1982
|
dataGasConsumed: e.bigint().optional(),
|
|
1983
1983
|
dataGasPrice: e.bigint().optional()
|
|
1984
|
-
}),
|
|
1984
|
+
}), Yn = e.object({
|
|
1985
1985
|
deployment: wt.optional(),
|
|
1986
1986
|
transactions: wt
|
|
1987
|
-
}),
|
|
1987
|
+
}), Zn = e.union([
|
|
1988
1988
|
e.literal("critical"),
|
|
1989
1989
|
e.literal("high"),
|
|
1990
1990
|
e.literal("caution"),
|
|
1991
1991
|
e.literal("info")
|
|
1992
|
-
]),
|
|
1992
|
+
]), Jn = e.string(), Qn = e.object({
|
|
1993
1993
|
name: e.string(),
|
|
1994
1994
|
url: e.string(),
|
|
1995
1995
|
position: e.number()
|
|
@@ -2048,23 +2048,23 @@ const Yi = e.object({
|
|
|
2048
2048
|
name: e.string(),
|
|
2049
2049
|
properties: e.array(_t),
|
|
2050
2050
|
defaultProperties: e.array(_t).optional()
|
|
2051
|
-
}),
|
|
2051
|
+
}), ea = e.union([
|
|
2052
2052
|
e.literal("verified"),
|
|
2053
2053
|
e.literal("neutral"),
|
|
2054
2054
|
e.literal("partial"),
|
|
2055
2055
|
e.literal("warn")
|
|
2056
|
-
]),
|
|
2056
|
+
]), ta = e.object({
|
|
2057
2057
|
unknown_token: e.unknown().optional(),
|
|
2058
2058
|
date_of_addition: e.string().optional(),
|
|
2059
2059
|
contract_address: K.optional(),
|
|
2060
2060
|
reason: e.string().optional(),
|
|
2061
2061
|
value: e.string().or(e.number()).optional()
|
|
2062
2062
|
}), er = e.object({
|
|
2063
|
-
reason:
|
|
2064
|
-
details:
|
|
2065
|
-
severity:
|
|
2066
|
-
}),
|
|
2067
|
-
assessment:
|
|
2063
|
+
reason: Jn,
|
|
2064
|
+
details: ta.optional(),
|
|
2065
|
+
severity: Zn
|
|
2066
|
+
}), ra = e.object({
|
|
2067
|
+
assessment: ea,
|
|
2068
2068
|
warnings: e.array(er).optional(),
|
|
2069
2069
|
assessmentReasons: e.array(e.string()).optional(),
|
|
2070
2070
|
assessmentDetails: e.object({
|
|
@@ -2077,7 +2077,7 @@ const Yi = e.object({
|
|
|
2077
2077
|
logoUrl: e.string(),
|
|
2078
2078
|
iconUrl: e.string(),
|
|
2079
2079
|
argentVerified: e.boolean(),
|
|
2080
|
-
links: e.array(
|
|
2080
|
+
links: e.array(Qn)
|
|
2081
2081
|
}), rr = e.object({
|
|
2082
2082
|
assessment: e.union([
|
|
2083
2083
|
e.literal("verified"),
|
|
@@ -2090,13 +2090,13 @@ const Yi = e.object({
|
|
|
2090
2090
|
contract_address: e.string()
|
|
2091
2091
|
}).optional(),
|
|
2092
2092
|
targetedDapp: tr.optional(),
|
|
2093
|
-
reviews: e.array(
|
|
2093
|
+
reviews: e.array(ra)
|
|
2094
2094
|
}).optional(), nr = e.object({
|
|
2095
2095
|
banner: e.string().nullable().optional(),
|
|
2096
2096
|
preview: e.string().nullable().optional(),
|
|
2097
2097
|
full: e.string().nullable().optional(),
|
|
2098
2098
|
original: e.string().nullable().optional()
|
|
2099
|
-
}),
|
|
2099
|
+
}), na = e.object({
|
|
2100
2100
|
twitter: e.string().optional(),
|
|
2101
2101
|
external: e.string().optional(),
|
|
2102
2102
|
discord: e.string().optional()
|
|
@@ -2111,15 +2111,15 @@ const Yi = e.object({
|
|
|
2111
2111
|
iconUrl: e.string().optional(),
|
|
2112
2112
|
unknown: e.boolean().optional(),
|
|
2113
2113
|
imageUrls: nr.optional(),
|
|
2114
|
-
links:
|
|
2115
|
-
}),
|
|
2114
|
+
links: na.optional()
|
|
2115
|
+
}), aa = e.object({
|
|
2116
2116
|
tokenAddress: H,
|
|
2117
2117
|
owner: H,
|
|
2118
2118
|
spender: H,
|
|
2119
2119
|
value: e.string().optional(),
|
|
2120
2120
|
approvalForAll: e.boolean(),
|
|
2121
2121
|
details: It.optional()
|
|
2122
|
-
}),
|
|
2122
|
+
}), ia = e.object({
|
|
2123
2123
|
tokenAddress: H,
|
|
2124
2124
|
from: H,
|
|
2125
2125
|
to: H,
|
|
@@ -2132,7 +2132,7 @@ const Yi = e.object({
|
|
|
2132
2132
|
gasUsage: ve,
|
|
2133
2133
|
dataGasPrice: ve.optional(),
|
|
2134
2134
|
dataGasConsumed: ve.optional()
|
|
2135
|
-
},
|
|
2135
|
+
}, sa = e.object({
|
|
2136
2136
|
...Lt,
|
|
2137
2137
|
unit: e.string().transform((t) => t.toUpperCase()).pipe(e.literal("WEI")),
|
|
2138
2138
|
maxFee: ve
|
|
@@ -2141,7 +2141,7 @@ const Yi = e.object({
|
|
|
2141
2141
|
unit: e.string().transform((t) => t.toUpperCase()).pipe(e.literal("FRI")),
|
|
2142
2142
|
maxAmount: ve,
|
|
2143
2143
|
maxPricePerUnit: ve
|
|
2144
|
-
})),
|
|
2144
|
+
})), oa = e.object({
|
|
2145
2145
|
type: e.string(),
|
|
2146
2146
|
label: e.string(),
|
|
2147
2147
|
tokenId: e.string().optional(),
|
|
@@ -2154,36 +2154,36 @@ const Yi = e.object({
|
|
|
2154
2154
|
description: e.string().optional(),
|
|
2155
2155
|
imageUrls: nr.optional()
|
|
2156
2156
|
}).optional()
|
|
2157
|
-
}), oa = e.object({
|
|
2158
|
-
approvals: e.array(na).optional(),
|
|
2159
|
-
transfers: e.array(aa).optional(),
|
|
2160
|
-
calculatedNonce: e.string().optional(),
|
|
2161
|
-
feeEstimation: ia,
|
|
2162
|
-
summary: e.array(sa).optional()
|
|
2163
2157
|
}), ca = e.object({
|
|
2158
|
+
approvals: e.array(aa).optional(),
|
|
2159
|
+
transfers: e.array(ia).optional(),
|
|
2160
|
+
calculatedNonce: e.string().optional(),
|
|
2161
|
+
feeEstimation: sa,
|
|
2162
|
+
summary: e.array(oa).optional()
|
|
2163
|
+
}), la = e.object({
|
|
2164
2164
|
label: e.string().optional(),
|
|
2165
2165
|
code: e.number().optional(),
|
|
2166
2166
|
message: e.string().optional(),
|
|
2167
2167
|
error: e.string().optional()
|
|
2168
2168
|
}), ar = e.object({
|
|
2169
2169
|
reviewOfTransaction: rr,
|
|
2170
|
-
simulation:
|
|
2170
|
+
simulation: ca,
|
|
2171
2171
|
simulationError: e.undefined()
|
|
2172
2172
|
}), ir = e.object({
|
|
2173
2173
|
reviewOfTransaction: rr,
|
|
2174
2174
|
simulation: e.undefined(),
|
|
2175
|
-
simulationError:
|
|
2176
|
-
}), sr = ar.or(ir),
|
|
2175
|
+
simulationError: la
|
|
2176
|
+
}), sr = ar.or(ir), Ji = e.object({
|
|
2177
2177
|
transactions: e.array(sr)
|
|
2178
|
-
}),
|
|
2178
|
+
}), Qi = e.object({
|
|
2179
2179
|
transactions: e.array(sr),
|
|
2180
|
-
enrichedFeeEstimation:
|
|
2180
|
+
enrichedFeeEstimation: Yn.optional(),
|
|
2181
2181
|
isBackendDown: e.boolean().default(!1).optional()
|
|
2182
2182
|
});
|
|
2183
|
-
function
|
|
2183
|
+
function es(t) {
|
|
2184
2184
|
return ar.safeParse(t).success;
|
|
2185
2185
|
}
|
|
2186
|
-
function
|
|
2186
|
+
function ts(t) {
|
|
2187
2187
|
return ir.safeParse(t).success;
|
|
2188
2188
|
}
|
|
2189
2189
|
const or = e.object({
|
|
@@ -2200,20 +2200,20 @@ const or = e.object({
|
|
|
2200
2200
|
currency: e.string(),
|
|
2201
2201
|
currencyAmount: e.number()
|
|
2202
2202
|
}).optional().nullable()
|
|
2203
|
-
}), At = e.enum(["ethereum", "starknet", "zksync", "zksync2"]),
|
|
2203
|
+
}), At = e.enum(["ethereum", "starknet", "zksync", "zksync2"]), ua = e.object({
|
|
2204
2204
|
type: e.enum(["payment", "gasFee"]),
|
|
2205
2205
|
leg: e.enum(["credit", "debit"]),
|
|
2206
2206
|
asset: Ce,
|
|
2207
2207
|
counterParty: H.optional(),
|
|
2208
2208
|
counterPartyNetwork: At.optional()
|
|
2209
|
-
}),
|
|
2209
|
+
}), fa = e.object({
|
|
2210
2210
|
address: H,
|
|
2211
2211
|
network: At,
|
|
2212
2212
|
type: e.enum(["wallet", "token"])
|
|
2213
|
-
}),
|
|
2213
|
+
}), pa = e.object({
|
|
2214
2214
|
chainId: e.enum(["TESTNET", "MAINNET", "SEPOLIA"]),
|
|
2215
2215
|
ethereumNetwork: e.enum(["mainnet", "sepolia"])
|
|
2216
|
-
}),
|
|
2216
|
+
}), ha = e.enum([
|
|
2217
2217
|
"approval",
|
|
2218
2218
|
"changePubKey",
|
|
2219
2219
|
"dappInteraction",
|
|
@@ -2234,10 +2234,10 @@ const or = e.object({
|
|
|
2234
2234
|
"cancelEscape",
|
|
2235
2235
|
"accountUpgraded",
|
|
2236
2236
|
"multisigConfigurationUpdated"
|
|
2237
|
-
]),
|
|
2237
|
+
]), ma = e.object({
|
|
2238
2238
|
name: e.string(),
|
|
2239
2239
|
parameters: e.array(e.unknown()).optional()
|
|
2240
|
-
}),
|
|
2240
|
+
}), da = e.object({
|
|
2241
2241
|
activeAt: e.string().optional(),
|
|
2242
2242
|
newGuardian: e.string().optional(),
|
|
2243
2243
|
newImplementation: e.string().optional(),
|
|
@@ -2269,15 +2269,15 @@ const or = e.object({
|
|
|
2269
2269
|
e.object({
|
|
2270
2270
|
type: e.literal("security"),
|
|
2271
2271
|
action: cr,
|
|
2272
|
-
context:
|
|
2272
|
+
context: da.optional()
|
|
2273
2273
|
}),
|
|
2274
2274
|
e.object({
|
|
2275
2275
|
type: e.literal("dappInteraction"),
|
|
2276
2276
|
dappAddress: H,
|
|
2277
|
-
function:
|
|
2277
|
+
function: ma.optional().nullable()
|
|
2278
2278
|
// This object is often null. It happens when we were unable to get the ABI or failed decoding the function call
|
|
2279
2279
|
})
|
|
2280
|
-
]),
|
|
2280
|
+
]), ga = e.union([
|
|
2281
2281
|
Ct,
|
|
2282
2282
|
e.object({
|
|
2283
2283
|
type: e.literal("multicall"),
|
|
@@ -2285,7 +2285,7 @@ const or = e.object({
|
|
|
2285
2285
|
details: Ct
|
|
2286
2286
|
}))
|
|
2287
2287
|
})
|
|
2288
|
-
]),
|
|
2288
|
+
]), Ea = e.object({
|
|
2289
2289
|
dappId: e.string(),
|
|
2290
2290
|
name: e.string().optional().nullable()
|
|
2291
2291
|
}), lr = e.object({
|
|
@@ -2311,7 +2311,7 @@ const or = e.object({
|
|
|
2311
2311
|
}).optional().nullable()
|
|
2312
2312
|
})
|
|
2313
2313
|
])
|
|
2314
|
-
}),
|
|
2314
|
+
}), Ia = e.object({
|
|
2315
2315
|
type: e.string(),
|
|
2316
2316
|
// "gas" for example
|
|
2317
2317
|
to: H,
|
|
@@ -2331,32 +2331,32 @@ const or = e.object({
|
|
|
2331
2331
|
wallet: H,
|
|
2332
2332
|
txSender: H,
|
|
2333
2333
|
source: e.string(),
|
|
2334
|
-
type:
|
|
2334
|
+
type: ha,
|
|
2335
2335
|
group: e.enum(["finance", "security"]),
|
|
2336
2336
|
submitted: e.number(),
|
|
2337
2337
|
lastModified: e.number(),
|
|
2338
2338
|
transaction: or,
|
|
2339
|
-
transfers: e.array(
|
|
2339
|
+
transfers: e.array(ua),
|
|
2340
2340
|
// to be clarified
|
|
2341
|
-
fees: e.array(
|
|
2342
|
-
relatedAddresses: e.array(
|
|
2341
|
+
fees: e.array(Ia).optional(),
|
|
2342
|
+
relatedAddresses: e.array(fa).nullable(),
|
|
2343
2343
|
network: e.string(),
|
|
2344
|
-
networkDetails:
|
|
2345
|
-
details:
|
|
2344
|
+
networkDetails: pa.optional(),
|
|
2345
|
+
details: ga,
|
|
2346
2346
|
transferSummary: e.array(lr).optional(),
|
|
2347
|
-
dapp:
|
|
2347
|
+
dapp: Ea.optional(),
|
|
2348
2348
|
actions: e.array(Qt).optional(),
|
|
2349
2349
|
title: e.string().optional(),
|
|
2350
2350
|
multisigDetails: e.object({
|
|
2351
2351
|
signers: e.array(H)
|
|
2352
2352
|
}).optional()
|
|
2353
|
-
}),
|
|
2353
|
+
}), Aa = e.object({
|
|
2354
2354
|
title: e.string().optional(),
|
|
2355
2355
|
shortTitle: e.string().optional(),
|
|
2356
2356
|
subtitle: e.string().optional(),
|
|
2357
2357
|
/** let's not import the keys from x-ui here */
|
|
2358
2358
|
icon: e.string().optional()
|
|
2359
|
-
}),
|
|
2359
|
+
}), Na = "native", Sa = "rejected", ba = "cancelled", Ta = "queued", rs = fr.pick({
|
|
2360
2360
|
status: !0,
|
|
2361
2361
|
actions: !0,
|
|
2362
2362
|
submitted: !0,
|
|
@@ -2368,33 +2368,33 @@ const or = e.object({
|
|
|
2368
2368
|
status: e.union([
|
|
2369
2369
|
ur,
|
|
2370
2370
|
e.enum([
|
|
2371
|
-
Na,
|
|
2372
2371
|
Sa,
|
|
2373
|
-
ba
|
|
2372
|
+
ba,
|
|
2373
|
+
Ta
|
|
2374
2374
|
])
|
|
2375
2375
|
]),
|
|
2376
|
-
type: e.literal(
|
|
2376
|
+
type: e.literal(Na),
|
|
2377
2377
|
transaction: or.pick({
|
|
2378
2378
|
hash: !0
|
|
2379
2379
|
}),
|
|
2380
2380
|
dapp: tr.optional(),
|
|
2381
|
-
meta:
|
|
2382
|
-
}),
|
|
2383
|
-
activities:
|
|
2381
|
+
meta: Aa.optional()
|
|
2382
|
+
}), ya = e.array(fr), ns = e.object({
|
|
2383
|
+
activities: ya,
|
|
2384
2384
|
page: e.number(),
|
|
2385
2385
|
pageSize: e.number(),
|
|
2386
2386
|
totalElements: e.number(),
|
|
2387
2387
|
totalPages: e.number()
|
|
2388
2388
|
});
|
|
2389
|
-
function
|
|
2389
|
+
function as(t) {
|
|
2390
2390
|
return cr.safeParse(t).success;
|
|
2391
2391
|
}
|
|
2392
|
-
const pr = (t) => lr.safeParse(t).success,
|
|
2392
|
+
const pr = (t) => lr.safeParse(t).success, is = (t) => pr(t) && t.asset.type === "token", ss = (t) => pr(t) && t.asset.type === "nft", Dt = {
|
|
2393
2393
|
Transfer: Nt.getSelectorFromName("Transfer"),
|
|
2394
2394
|
// 0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9
|
|
2395
2395
|
Approval: Nt.getSelectorFromName("Approval")
|
|
2396
2396
|
// 0x134692b230b9e1ffa39098904722134159652b09c5bc41d88d6698779d228ff
|
|
2397
|
-
},
|
|
2397
|
+
}, Ra = (t, o, E) => {
|
|
2398
2398
|
for (const T of t) {
|
|
2399
2399
|
const { events: N, internal_calls: D } = T;
|
|
2400
2400
|
for (const w of N)
|
|
@@ -2410,13 +2410,13 @@ const pr = (t) => lr.safeParse(t).success, as = (t) => pr(t) && t.asset.type ===
|
|
|
2410
2410
|
to: w.data[1],
|
|
2411
2411
|
value: Qe.uint256ToBN({ low: w.data[2], high: w.data[3] }).toString()
|
|
2412
2412
|
});
|
|
2413
|
-
D &&
|
|
2413
|
+
D && Ra(D, o, E);
|
|
2414
2414
|
}
|
|
2415
2415
|
return { approvals: o, transfers: E };
|
|
2416
|
-
},
|
|
2416
|
+
}, va = /(0x[a-fA-F0-9]+)\s*\('(.*?)'\)/, os = (t) => {
|
|
2417
2417
|
if (!Ur(t))
|
|
2418
2418
|
return;
|
|
2419
|
-
const o = t.match(
|
|
2419
|
+
const o = t.match(va);
|
|
2420
2420
|
if (o && !Fr(o[2]))
|
|
2421
2421
|
return o[2];
|
|
2422
2422
|
};
|
|
@@ -2424,162 +2424,162 @@ var pt;
|
|
|
2424
2424
|
(function(t) {
|
|
2425
2425
|
t.SIMULATE_AND_REVIEW_FAILED = "Something went wrong fetching review", t.NO_CALLS_FOUND = "No calls found", t.ONCHAIN_FEE_ESTIMATION_FAILED = "Failed to estimate fees onchain";
|
|
2426
2426
|
})(pt || (pt = {}));
|
|
2427
|
-
class
|
|
2427
|
+
class cs extends we {
|
|
2428
2428
|
constructor(o) {
|
|
2429
2429
|
super(o, pt), this.name = "ReviewError";
|
|
2430
2430
|
}
|
|
2431
2431
|
}
|
|
2432
|
-
const
|
|
2432
|
+
const ls = e.object({
|
|
2433
2433
|
reason: e.string(),
|
|
2434
2434
|
severity: e.string().optional(),
|
|
2435
2435
|
title: e.string(),
|
|
2436
2436
|
description: e.string().optional()
|
|
2437
|
-
}),
|
|
2437
|
+
}), Oa = Object.values(xe.TRANSACTION_VERSION), us = e.string().default("0x3").refine((t) => {
|
|
2438
2438
|
const o = be.toBigInt(t);
|
|
2439
|
-
return
|
|
2439
|
+
return Oa.map((E) => be.toBigInt(E)).includes(o);
|
|
2440
2440
|
}).transform((t) => be.toHex(t));
|
|
2441
|
-
function
|
|
2441
|
+
function fs(t) {
|
|
2442
2442
|
if (t === xe.TRANSACTION_VERSION.V3 || t === xe.TRANSACTION_VERSION.F3)
|
|
2443
2443
|
throw Error("Only txv1 is supported");
|
|
2444
2444
|
}
|
|
2445
2445
|
export {
|
|
2446
|
-
|
|
2446
|
+
xa as $,
|
|
2447
2447
|
ke as A,
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2448
|
+
Ti as B,
|
|
2449
|
+
ni as C,
|
|
2450
|
+
Ui as D,
|
|
2451
|
+
ji as E,
|
|
2452
|
+
Mi as F,
|
|
2453
|
+
Ka as G,
|
|
2454
2454
|
dt as H,
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2455
|
+
Wa as I,
|
|
2456
|
+
mi as J,
|
|
2457
|
+
sa as K,
|
|
2458
|
+
Yi as L,
|
|
2459
2459
|
Tt as M,
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2460
|
+
ai as N,
|
|
2461
|
+
Wn as O,
|
|
2462
|
+
Ji as P,
|
|
2463
|
+
ts as Q,
|
|
2464
|
+
cs as R,
|
|
2465
|
+
ei as S,
|
|
2466
|
+
Pi as T,
|
|
2467
2467
|
jt as U,
|
|
2468
2468
|
$r as V,
|
|
2469
2469
|
Ve as W,
|
|
2470
2470
|
Xr as X,
|
|
2471
2471
|
Hr as Y,
|
|
2472
|
-
|
|
2473
|
-
|
|
2472
|
+
Ua as Z,
|
|
2473
|
+
Fa as _,
|
|
2474
2474
|
St as a,
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2475
|
+
us as a$,
|
|
2476
|
+
Ba as a0,
|
|
2477
|
+
Ma as a1,
|
|
2478
|
+
Ga as a2,
|
|
2479
2479
|
mt as a3,
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2480
|
+
$a as a4,
|
|
2481
|
+
Xa as a5,
|
|
2482
|
+
Ha as a6,
|
|
2483
|
+
za as a7,
|
|
2484
|
+
qa as a8,
|
|
2485
|
+
Va as a9,
|
|
2486
|
+
Gi as aA,
|
|
2487
2487
|
Yt as aB,
|
|
2488
|
-
|
|
2489
|
-
|
|
2488
|
+
Vi as aC,
|
|
2489
|
+
$i as aD,
|
|
2490
2490
|
Zt as aE,
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2491
|
+
Xi as aF,
|
|
2492
|
+
xn as aG,
|
|
2493
|
+
Bn as aH,
|
|
2494
|
+
Mn as aI,
|
|
2495
|
+
Gn as aJ,
|
|
2496
|
+
Hi as aK,
|
|
2497
2497
|
$t as aL,
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2498
|
+
Vn as aM,
|
|
2499
|
+
zi as aN,
|
|
2500
|
+
$n as aO,
|
|
2501
|
+
Xn as aP,
|
|
2502
|
+
qi as aQ,
|
|
2503
|
+
Hn as aR,
|
|
2504
|
+
Wi as aS,
|
|
2505
2505
|
Jt as aT,
|
|
2506
|
-
|
|
2506
|
+
Ki as aU,
|
|
2507
2507
|
ft as aV,
|
|
2508
|
-
|
|
2508
|
+
Zi as aW,
|
|
2509
2509
|
Dt as aX,
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2510
|
+
Ra as aY,
|
|
2511
|
+
os as aZ,
|
|
2512
|
+
ls as a_,
|
|
2513
2513
|
Zr as aa,
|
|
2514
2514
|
Xe as ab,
|
|
2515
2515
|
Qr as ac,
|
|
2516
2516
|
et as ad,
|
|
2517
2517
|
rn as ae,
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2518
|
+
Ya as af,
|
|
2519
|
+
Za as ag,
|
|
2520
|
+
Ja as ah,
|
|
2521
|
+
Qa as ai,
|
|
2522
|
+
ti as aj,
|
|
2523
2523
|
tn as ak,
|
|
2524
2524
|
tt as al,
|
|
2525
2525
|
we as am,
|
|
2526
2526
|
ut as an,
|
|
2527
2527
|
Pe as ao,
|
|
2528
2528
|
Xt as ap,
|
|
2529
|
-
|
|
2529
|
+
Fi as aq,
|
|
2530
2530
|
vt as ar,
|
|
2531
2531
|
zt as as,
|
|
2532
|
-
|
|
2532
|
+
xi as at,
|
|
2533
2533
|
qt as au,
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2534
|
+
Bi as av,
|
|
2535
|
+
Dn as aw,
|
|
2536
|
+
Pn as ax,
|
|
2537
|
+
jn as ay,
|
|
2538
|
+
kn as az,
|
|
2539
2539
|
qr as b,
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2540
|
+
Aa as b$,
|
|
2541
|
+
fs as b0,
|
|
2542
|
+
bi as b1,
|
|
2543
|
+
pn as b2,
|
|
2544
|
+
yi as b3,
|
|
2545
|
+
Ri as b4,
|
|
2546
2546
|
De as b5,
|
|
2547
2547
|
sn as b6,
|
|
2548
2548
|
on as b7,
|
|
2549
2549
|
cn as b8,
|
|
2550
2550
|
Be as b9,
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2551
|
+
Tn as bA,
|
|
2552
|
+
xt as bB,
|
|
2553
|
+
yn as bC,
|
|
2554
|
+
Bt as bD,
|
|
2555
|
+
Rn as bE,
|
|
2556
|
+
Ze as bF,
|
|
2557
2557
|
vn as bG,
|
|
2558
2558
|
On as bH,
|
|
2559
2559
|
wn as bI,
|
|
2560
|
-
|
|
2560
|
+
_n as bJ,
|
|
2561
2561
|
Oi as bK,
|
|
2562
|
-
|
|
2563
|
-
|
|
2562
|
+
wi as bL,
|
|
2563
|
+
Gt as bM,
|
|
2564
2564
|
_i as bN,
|
|
2565
|
-
|
|
2566
|
-
|
|
2565
|
+
Li as bO,
|
|
2566
|
+
Vt as bP,
|
|
2567
2567
|
Ci as bQ,
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2568
|
+
Di as bR,
|
|
2569
|
+
pr as bS,
|
|
2570
|
+
lr as bT,
|
|
2571
|
+
Na as bU,
|
|
2572
|
+
rs as bV,
|
|
2573
|
+
ua as bW,
|
|
2574
2574
|
ga as bX,
|
|
2575
2575
|
Ea as bY,
|
|
2576
|
-
|
|
2577
|
-
|
|
2576
|
+
Ia as bZ,
|
|
2577
|
+
fr as b_,
|
|
2578
2578
|
ln as ba,
|
|
2579
2579
|
gt as bb,
|
|
2580
2580
|
un as bc,
|
|
2581
|
-
|
|
2582
|
-
|
|
2581
|
+
fn as bd,
|
|
2582
|
+
he as be,
|
|
2583
2583
|
ii as bf,
|
|
2584
2584
|
si as bg,
|
|
2585
2585
|
oi as bh,
|
|
@@ -2588,16 +2588,16 @@ export {
|
|
|
2588
2588
|
ui as bk,
|
|
2589
2589
|
fi as bl,
|
|
2590
2590
|
pi as bm,
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2591
|
+
hi as bn,
|
|
2592
|
+
Ut as bo,
|
|
2593
|
+
Ye as bp,
|
|
2594
|
+
Ft as bq,
|
|
2595
|
+
vi as br,
|
|
2596
|
+
En as bs,
|
|
2597
|
+
ct as bt,
|
|
2598
2598
|
In as bu,
|
|
2599
|
-
|
|
2600
|
-
|
|
2599
|
+
An as bv,
|
|
2600
|
+
lt as bw,
|
|
2601
2601
|
Nn as bx,
|
|
2602
2602
|
Sn as by,
|
|
2603
2603
|
bn as bz,
|
|
@@ -2605,44 +2605,45 @@ export {
|
|
|
2605
2605
|
Sa as c0,
|
|
2606
2606
|
ba as c1,
|
|
2607
2607
|
Ta as c2,
|
|
2608
|
-
|
|
2608
|
+
ya as c3,
|
|
2609
2609
|
ns as c4,
|
|
2610
2610
|
as as c5,
|
|
2611
2611
|
is as c6,
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2612
|
+
ss as c7,
|
|
2613
|
+
wt as c8,
|
|
2614
|
+
Yn as c9,
|
|
2615
|
+
_t as ca,
|
|
2616
|
+
Qt as cb,
|
|
2617
2617
|
ea as cc,
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2618
|
+
ta as cd,
|
|
2619
|
+
er as ce,
|
|
2620
|
+
ra as cf,
|
|
2621
|
+
tr as cg,
|
|
2622
2622
|
Qi as ch,
|
|
2623
|
-
|
|
2623
|
+
es as ci,
|
|
2624
2624
|
Zn as cj,
|
|
2625
|
+
Jn as ck,
|
|
2625
2626
|
zr as d,
|
|
2626
2627
|
en as e,
|
|
2627
2628
|
Jr as f,
|
|
2628
|
-
|
|
2629
|
+
ri as g,
|
|
2629
2630
|
Kr as h,
|
|
2630
2631
|
Yr as i,
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2632
|
+
di as j,
|
|
2633
|
+
Ai as k,
|
|
2634
|
+
Ii as l,
|
|
2635
|
+
gi as m,
|
|
2635
2636
|
$e as n,
|
|
2636
|
-
|
|
2637
|
+
Ei as o,
|
|
2637
2638
|
Vr as p,
|
|
2638
2639
|
H as q,
|
|
2639
2640
|
ht as r,
|
|
2640
|
-
|
|
2641
|
+
Ni as s,
|
|
2641
2642
|
K as t,
|
|
2642
2643
|
an as u,
|
|
2643
|
-
|
|
2644
|
+
Si as v,
|
|
2644
2645
|
Me as w,
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2646
|
+
Ln as x,
|
|
2647
|
+
mn as y,
|
|
2648
|
+
ki as z
|
|
2648
2649
|
};
|