@argent/x-shared 1.27.0 → 1.29.0
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/features/simulation/activity/schema.d.ts +338 -338
- package/dist/features/simulation/activity/utils/createNativeActivity.d.ts +10 -10
- package/dist/features/simulation/activity/utils/index.d.ts +1 -0
- package/dist/features/simulation/activity/utils/isUpgradeActivity.d.ts +3 -0
- package/dist/features/simulation/transactionReview/schema.d.ts +1562 -1562
- package/dist/index.d.ts +10 -9
- package/dist/index.js +3 -3
- package/dist/index.mjs +3937 -2230
- package/dist/knownDapps/schema.d.ts +22 -22
- package/dist/knownDapps/utils/getDapplandUrl.d.ts +1 -1
- package/dist/nameResolution/ResolveNameService.d.ts +1 -1
- package/dist/nameResolution/schema.d.ts +4 -4
- package/dist/onchainRecovery/IOnchainRecoveryService.d.ts +13 -0
- package/dist/onchainRecovery/OnchainRecoveryService.d.ts +18 -0
- package/dist/onchainRecovery/index.d.ts +3 -0
- package/dist/onchainRecovery/schema.d.ts +73 -0
- package/dist/{schema-THcYC9Pj.mjs → schema-3qaq9ugL.mjs} +141 -141
- package/dist/{schema-CtZY8-Gm.js → schema-C-_pmcO7.js} +1 -1
- package/dist/simulation.js +1 -1
- package/dist/simulation.mjs +113 -93
- package/dist/tokens/service/implementation.d.ts +1 -1
- package/dist/tokens/service/types/backend.model.d.ts +20 -20
- package/dist/tokens/service/types/defiPosition.model.d.ts +236 -236
- package/dist/tokens/service/types/token.model.d.ts +24 -24
- package/dist/tokens/service/types/unclaimedRewards.model.d.ts +8 -8
- package/dist/transactions/errors.d.ts +4 -4
- package/dist/transactions/useTransactionReviewV2web.d.ts +56 -56
- package/dist/utils/starknet/starknetSchemas.d.ts +212 -212
- package/package.json +2 -1
|
@@ -4,65 +4,39 @@ import { memoize as gt, noop as or } from "lodash-es";
|
|
|
4
4
|
import { createContext as cr, useContext as lr, useEffect as ur } from "react";
|
|
5
5
|
import { validateChecksumAddress as fr, validateAndParseAddress as hr, getChecksumAddress as pr, num as ze, constants as dr, CairoCustomEnum as mr } from "starknet";
|
|
6
6
|
import "swr";
|
|
7
|
-
function Er(n) {
|
|
8
|
-
var p = [];
|
|
9
|
-
if (n.length === 0)
|
|
10
|
-
return "";
|
|
11
|
-
if (typeof n[0] != "string")
|
|
12
|
-
throw new TypeError("Url must be a string. Received " + n[0]);
|
|
13
|
-
if (n[0].match(/^[^/:]+:\/*$/) && n.length > 1) {
|
|
14
|
-
var R = n.shift();
|
|
15
|
-
n[0] = R + n[0];
|
|
16
|
-
}
|
|
17
|
-
n[0].match(/^file:\/\/\//) ? n[0] = n[0].replace(/^([^/:]+):\/*/, "$1:///") : n[0] = n[0].replace(/^([^/:]+):\/*/, "$1://");
|
|
18
|
-
for (var _ = 0; _ < n.length; _++) {
|
|
19
|
-
var S = n[_];
|
|
20
|
-
if (typeof S != "string")
|
|
21
|
-
throw new TypeError("Url must be a string. Received " + S);
|
|
22
|
-
S !== "" && (_ > 0 && (S = S.replace(/^[\/]+/, "")), _ < n.length - 1 ? S = S.replace(/[\/]+$/, "") : S = S.replace(/[\/]+$/, "/"), p.push(S));
|
|
23
|
-
}
|
|
24
|
-
var B = p.join("/");
|
|
25
|
-
B = B.replace(/\/(\?|&|#[^!])/g, "$1");
|
|
26
|
-
var M = B.split("?");
|
|
27
|
-
return B = M.shift() + (M.length > 0 ? "?" : "") + M.join("&"), B;
|
|
28
|
-
}
|
|
29
|
-
function gr() {
|
|
30
|
-
var n;
|
|
31
|
-
return typeof arguments[0] == "object" ? n = arguments[0] : n = [].slice.call(arguments), Er(n);
|
|
32
|
-
}
|
|
33
7
|
const It = e.string().refine((n) => {
|
|
34
8
|
if (n.toLowerCase() === n)
|
|
35
9
|
return !0;
|
|
36
10
|
try {
|
|
37
|
-
return fr(n) &&
|
|
11
|
+
return fr(n) && Sr(n);
|
|
38
12
|
} catch {
|
|
39
13
|
}
|
|
40
14
|
return !1;
|
|
41
|
-
}, "Invalid address (checksum error)"),
|
|
15
|
+
}, "Invalid address (checksum error)"), Er = e.string().refine((n) => {
|
|
42
16
|
try {
|
|
43
17
|
return hr(n);
|
|
44
18
|
} catch {
|
|
45
19
|
}
|
|
46
20
|
return !1;
|
|
47
|
-
}, "Invalid address (validation error)"), ke = e.string().regex(/^0x[0-9a-fA-F]+$/, "Invalid address"),
|
|
21
|
+
}, "Invalid address (validation error)"), ke = e.string().regex(/^0x[0-9a-fA-F]+$/, "Invalid address"), gr = ke.min(50, "Addresses must at least be 50 characters long").max(66, "Addresses must at most be 66 characters long"), Ir = ke.length(66, "Address must be 66 characters long"), Te = gr.pipe(It).transform((n) => `0x${(n.startsWith("0x") ? n.slice(2) : n).padStart(64, "0")}`), xn = Te.or(e.literal("")).transform((n) => n === "" ? void 0 : n).optional(), q = ke.transform((n) => `0x${n.replace(/^0x/, "").toLowerCase().padStart(64, "0")}`), Ar = (n) => Te.safeParse(n).success, Nr = Ar, Ue = (n) => pr(n), Mn = (n) => {
|
|
48
22
|
const p = Ue(n), R = p.slice(0, 2), _ = p.slice(2, 6), S = p.slice(-4);
|
|
49
23
|
return `${R}${_}…${S}`;
|
|
50
24
|
}, Gn = (n) => {
|
|
51
25
|
const p = Ue(n), R = p.slice(0, 2), S = p.slice(2).match(/.{1,4}/g) || [];
|
|
52
26
|
return `${R} ${S.join(" ")}`;
|
|
53
|
-
},
|
|
27
|
+
}, Sr = (n) => !/^0x[0-9a-f]{63,64}$/.test(n), Rr = (n, p) => {
|
|
54
28
|
try {
|
|
55
29
|
return !n || !p ? !1 : ze.hexToDecimalString(n) === ze.hexToDecimalString(p);
|
|
56
30
|
} catch {
|
|
57
31
|
}
|
|
58
32
|
return !1;
|
|
59
|
-
},
|
|
33
|
+
}, Or = (n) => {
|
|
60
34
|
try {
|
|
61
35
|
return ze.toBigInt(ke.parse(n)) === dr.ZERO;
|
|
62
36
|
} catch {
|
|
63
37
|
}
|
|
64
38
|
return !1;
|
|
65
|
-
}, Bn = (n, p) => !!(p != null && p.some((R) =>
|
|
39
|
+
}, Bn = (n, p) => !!(p != null && p.some((R) => Rr(R, n))), $n = gt((n) => {
|
|
66
40
|
const p = n.slice(0, 6), R = n.slice(-4);
|
|
67
41
|
return `${p}…${R}`;
|
|
68
42
|
}), Xn = gt((n, p) => {
|
|
@@ -70,13 +44,13 @@ const It = e.string().refine((n) => {
|
|
|
70
44
|
return n;
|
|
71
45
|
const R = Math.floor((p - 1) / 2), _ = n.slice(0, R), S = n.slice(-R);
|
|
72
46
|
return `${_}…${S}`;
|
|
73
|
-
}), Vn = e.string().regex(/^[a-zA-Z0-9.-]*$/g, "Invalid address character").max(66, "Address cannot be over 66 characters"),
|
|
47
|
+
}), Vn = e.string().regex(/^[a-zA-Z0-9.-]*$/g, "Invalid address character").max(66, "Address cannot be over 66 characters"), vr = Ir.pipe(It).pipe(Er), Fe = e.string().regex(/^([a-zA-Z0-9-]+\.)+argent.xyz$/, "Invalid Argent name").max(253, "Argent name cannot be over 253 characters"), Tr = (n) => Fe.safeParse(n).success, wr = (n, p) => {
|
|
74
48
|
try {
|
|
75
49
|
return p ? qe(n) === qe(p) : !1;
|
|
76
50
|
} catch {
|
|
77
51
|
}
|
|
78
52
|
return !1;
|
|
79
|
-
}, qe = (n) => Fe.parse(n).toLowerCase(), nt = e.string().regex(/^([a-zA-Z0-9-]+\.)+stark$/, "Invalid Starknet ID").max(50, "Starknet ID cannot be over 50 characters"),
|
|
53
|
+
}, qe = (n) => Fe.parse(n).toLowerCase(), nt = e.string().regex(/^([a-zA-Z0-9-]+\.)+stark$/, "Invalid Starknet ID").max(50, "Starknet ID cannot be over 50 characters"), yr = (n) => nt.safeParse(n).success, br = (n, p) => {
|
|
80
54
|
try {
|
|
81
55
|
return p ? We(n) === We(p) : !1;
|
|
82
56
|
} catch {
|
|
@@ -89,15 +63,41 @@ const It = e.string().refine((n) => {
|
|
|
89
63
|
Te,
|
|
90
64
|
at
|
|
91
65
|
]), zn = e.union([
|
|
92
|
-
|
|
66
|
+
vr,
|
|
93
67
|
at
|
|
94
68
|
]), qn = (n) => at.safeParse(n).success, Wn = (n, p) => {
|
|
95
69
|
try {
|
|
96
|
-
return p ?
|
|
70
|
+
return p ? wr(n, p) || br(n, p) : !1;
|
|
97
71
|
} catch {
|
|
98
72
|
}
|
|
99
73
|
return !1;
|
|
100
|
-
}, Yn = (n) =>
|
|
74
|
+
}, Yn = (n) => yr(n) ? We(n) : Tr(n) ? qe(n) : Ue(n), Lr = e.union([e.literal("0"), e.literal("1")]), Zn = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", Kn = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", Jn = "0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003", Qn = "0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f", ea = "0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48", ta = "0x6e150953b26271a740bf2b6e9bca17cc52c68d765f761295de51ceb8526ee72", ra = "0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f";
|
|
75
|
+
function Cr(n) {
|
|
76
|
+
var p = [];
|
|
77
|
+
if (n.length === 0)
|
|
78
|
+
return "";
|
|
79
|
+
if (typeof n[0] != "string")
|
|
80
|
+
throw new TypeError("Url must be a string. Received " + n[0]);
|
|
81
|
+
if (n[0].match(/^[^/:]+:\/*$/) && n.length > 1) {
|
|
82
|
+
var R = n.shift();
|
|
83
|
+
n[0] = R + n[0];
|
|
84
|
+
}
|
|
85
|
+
n[0].match(/^file:\/\/\//) ? n[0] = n[0].replace(/^([^/:]+):\/*/, "$1:///") : n[0] = n[0].replace(/^([^/:]+):\/*/, "$1://");
|
|
86
|
+
for (var _ = 0; _ < n.length; _++) {
|
|
87
|
+
var S = n[_];
|
|
88
|
+
if (typeof S != "string")
|
|
89
|
+
throw new TypeError("Url must be a string. Received " + S);
|
|
90
|
+
S !== "" && (_ > 0 && (S = S.replace(/^[\/]+/, "")), _ < n.length - 1 ? S = S.replace(/[\/]+$/, "") : S = S.replace(/[\/]+$/, "/"), p.push(S));
|
|
91
|
+
}
|
|
92
|
+
var B = p.join("/");
|
|
93
|
+
B = B.replace(/\/(\?|&|#[^!])/g, "$1");
|
|
94
|
+
var M = B.split("?");
|
|
95
|
+
return B = M.shift() + (M.length > 0 ? "?" : "") + M.join("&"), B;
|
|
96
|
+
}
|
|
97
|
+
function _r() {
|
|
98
|
+
var n;
|
|
99
|
+
return typeof arguments[0] == "object" ? n = arguments[0] : n = [].slice.call(arguments), Cr(n);
|
|
100
|
+
}
|
|
101
101
|
class xe extends Error {
|
|
102
102
|
constructor({ code: p, message: R, options: _ = {} }, S) {
|
|
103
103
|
const { error: B, context: M } = _;
|
|
@@ -138,19 +138,19 @@ async function aa(n, p, R, _ = "starknet") {
|
|
|
138
138
|
const S = {
|
|
139
139
|
ens: n,
|
|
140
140
|
chain: _
|
|
141
|
-
}, B = new URLSearchParams(S), M =
|
|
141
|
+
}, B = new URLSearchParams(S), M = _r(R, "wallet", `?${B}`);
|
|
142
142
|
try {
|
|
143
143
|
const F = await p.get(M), L = F && "walletAddress" in F ? F.walletAddress : void 0;
|
|
144
144
|
if (!L)
|
|
145
145
|
throw new _e({
|
|
146
146
|
code: "NO_ADDRESS_FROM_ARGENT_NAME"
|
|
147
147
|
});
|
|
148
|
-
if (
|
|
148
|
+
if (Or(L))
|
|
149
149
|
throw new _e({
|
|
150
150
|
code: "ARGENT_NAME_NOT_FOUND",
|
|
151
151
|
message: `${n} not found`
|
|
152
152
|
});
|
|
153
|
-
if (!
|
|
153
|
+
if (!Nr(L))
|
|
154
154
|
throw new _e({
|
|
155
155
|
code: "ARGENT_NAME_INVALID_ADDRESS",
|
|
156
156
|
message: `${n} resolved to an invalid address (${L})`
|
|
@@ -216,7 +216,7 @@ const Le = e.union([e.string(), e.number(), e.bigint()]), Dr = e.object({
|
|
|
216
216
|
const p = n.startsWith("0x") ? n.slice(2) : n;
|
|
217
217
|
return `0x${p.length % 2 === 0 ? p : `0${p}`}`;
|
|
218
218
|
}), Ia = e.object({
|
|
219
|
-
cairoVersion:
|
|
219
|
+
cairoVersion: Lr,
|
|
220
220
|
accountClassHash: At
|
|
221
221
|
}), xr = e.array(e.string()), Aa = e.object({
|
|
222
222
|
implementation: e.string(),
|
|
@@ -2017,101 +2017,101 @@ function Xa(n) {
|
|
|
2017
2017
|
}
|
|
2018
2018
|
const Bt = (n) => xt.safeParse(n).success, Va = (n) => Bt(n) && n.asset.type === "token", Ha = (n) => Bt(n) && n.asset.type === "nft";
|
|
2019
2019
|
export {
|
|
2020
|
-
|
|
2020
|
+
Yn as $,
|
|
2021
2021
|
_e as A,
|
|
2022
2022
|
wa as B,
|
|
2023
2023
|
sa as C,
|
|
2024
|
-
|
|
2024
|
+
pn as D,
|
|
2025
2025
|
Zn as E,
|
|
2026
|
-
|
|
2027
|
-
|
|
2026
|
+
Ua as F,
|
|
2027
|
+
Ma as G,
|
|
2028
2028
|
st as H,
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2029
|
+
It as I,
|
|
2030
|
+
Er as J,
|
|
2031
|
+
ke as K,
|
|
2032
|
+
gr as L,
|
|
2033
2033
|
ut as M,
|
|
2034
2034
|
ia as N,
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2035
|
+
Ir as O,
|
|
2036
|
+
xn as P,
|
|
2037
|
+
Mn as Q,
|
|
2038
|
+
Gn as R,
|
|
2039
2039
|
ra as S,
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2040
|
+
Bn as T,
|
|
2041
|
+
$n as U,
|
|
2042
|
+
Xn as V,
|
|
2043
|
+
at as W,
|
|
2044
|
+
Hn as X,
|
|
2045
|
+
zn as Y,
|
|
2046
|
+
qn as Z,
|
|
2047
|
+
Wn as _,
|
|
2048
2048
|
lt as a,
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2049
|
+
ja as a$,
|
|
2050
|
+
Vn as a0,
|
|
2051
|
+
vr as a1,
|
|
2052
|
+
Fe as a2,
|
|
2053
|
+
wr as a3,
|
|
2054
|
+
qe as a4,
|
|
2055
|
+
Lr as a5,
|
|
2056
|
+
Jn as a6,
|
|
2057
|
+
Qn as a7,
|
|
2058
|
+
ea as a8,
|
|
2059
|
+
ta as a9,
|
|
2060
|
+
Xe as aA,
|
|
2061
|
+
Rt as aB,
|
|
2062
|
+
La as aC,
|
|
2063
|
+
$r as aD,
|
|
2064
|
+
tt as aE,
|
|
2065
|
+
Xr as aF,
|
|
2066
|
+
Vr as aG,
|
|
2067
|
+
rt as aH,
|
|
2068
|
+
Hr as aI,
|
|
2069
|
+
zr as aJ,
|
|
2070
|
+
qr as aK,
|
|
2071
|
+
Wr as aL,
|
|
2072
|
+
Ot as aM,
|
|
2073
|
+
Yr as aN,
|
|
2074
|
+
vt as aO,
|
|
2075
|
+
Zr as aP,
|
|
2076
|
+
Ve as aQ,
|
|
2077
|
+
Kr as aR,
|
|
2078
|
+
Jr as aS,
|
|
2079
|
+
Qr as aT,
|
|
2080
|
+
en as aU,
|
|
2081
|
+
Ca as aV,
|
|
2082
|
+
_a as aW,
|
|
2083
|
+
wt as aX,
|
|
2084
|
+
Da as aY,
|
|
2085
|
+
Pa as aZ,
|
|
2086
|
+
yt as a_,
|
|
2087
|
+
na as aa,
|
|
2088
|
+
br as ab,
|
|
2089
|
+
We as ac,
|
|
2090
|
+
Ta as ad,
|
|
2091
|
+
Fr as ae,
|
|
2092
|
+
ya as af,
|
|
2093
|
+
ba as ag,
|
|
2094
|
+
Le as ah,
|
|
2095
|
+
Dr as ai,
|
|
2096
|
+
Pr as aj,
|
|
2097
|
+
jr as ak,
|
|
2098
|
+
je as al,
|
|
2099
|
+
kr as am,
|
|
2100
|
+
it as an,
|
|
2101
|
+
Ur as ao,
|
|
2102
|
+
ue as ap,
|
|
2103
|
+
ca as aq,
|
|
2104
|
+
la as ar,
|
|
2105
|
+
ua as as,
|
|
2106
|
+
fa as at,
|
|
2107
|
+
ha as au,
|
|
2108
|
+
pa as av,
|
|
2109
|
+
da as aw,
|
|
2110
|
+
ma as ax,
|
|
2111
|
+
Ea as ay,
|
|
2112
|
+
St as az,
|
|
2113
|
+
Nr as b,
|
|
2114
|
+
ka as b0,
|
|
2115
2115
|
Bt as b1,
|
|
2116
2116
|
xt as b2,
|
|
2117
2117
|
yn as b3,
|
|
@@ -2145,27 +2145,27 @@ export {
|
|
|
2145
2145
|
nn as bv,
|
|
2146
2146
|
an as bw,
|
|
2147
2147
|
oa as c,
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2148
|
+
Ar as d,
|
|
2149
|
+
yr as e,
|
|
2150
|
+
Tr as f,
|
|
2151
2151
|
aa as g,
|
|
2152
|
-
|
|
2153
|
-
|
|
2152
|
+
Rr as h,
|
|
2153
|
+
Or as i,
|
|
2154
2154
|
Ia as j,
|
|
2155
2155
|
Ra as k,
|
|
2156
2156
|
Sa as l,
|
|
2157
2157
|
Aa as m,
|
|
2158
2158
|
Ue as n,
|
|
2159
2159
|
Na as o,
|
|
2160
|
-
|
|
2161
|
-
q,
|
|
2160
|
+
q as p,
|
|
2161
|
+
nt as q,
|
|
2162
2162
|
Te as r,
|
|
2163
2163
|
Oa as s,
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2164
|
+
va as t,
|
|
2165
|
+
_r as u,
|
|
2166
|
+
At as v,
|
|
2167
|
+
Mr as w,
|
|
2168
|
+
xe as x,
|
|
2169
|
+
Kn as y,
|
|
2170
|
+
ga as z
|
|
2171
2171
|
};
|