@directcryptopay/sdk 0.1.0 → 0.2.1
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/README.md +202 -256
- package/dist/{add-KF4m4jFK.js → add-sji6scSD.js} +1 -1
- package/dist/{all-wallets-D6NAjQgX.js → all-wallets-B4H-890E.js} +1 -1
- package/dist/{app-store-D7TTn-EO.js → app-store-Z433s97G.js} +1 -1
- package/dist/{apple-DjX2E2hE.js → apple-b8Lxj7nb.js} +1 -1
- package/dist/{arrow-bottom-C0YrNJYB.js → arrow-bottom-M9oWWo_9.js} +1 -1
- package/dist/{arrow-bottom-circle-Dlxvx_XG.js → arrow-bottom-circle-N9c4CXY1.js} +1 -1
- package/dist/{arrow-left-x8_-lUyK.js → arrow-left-Dw8AKfwf.js} +1 -1
- package/dist/{arrow-right-BTZybj80.js → arrow-right-DwLQZSC_.js} +1 -1
- package/dist/{arrow-top-LzH7iLCp.js → arrow-top-zhUjkBe1.js} +1 -1
- package/dist/{bank-23jp-IV_.js → bank-CbQdnILK.js} +1 -1
- package/dist/{browser-EjoorDid.js → browser-xAqNwt7z.js} +1 -1
- package/dist/{card-DGgWwtwC.js → card-Dr1QBmWp.js} +1 -1
- package/dist/{ccip-BMANewTU.js → ccip-BIGqktC1.js} +6 -6
- package/dist/{checkmark-B1qcQhBo.js → checkmark-BhT1dTgG.js} +1 -1
- package/dist/{checkmark-bold-Cyc4IEEJ.js → checkmark-bold-CPB29wqQ.js} +1 -1
- package/dist/{chevron-bottom-ClHs08rB.js → chevron-bottom-BhNyx2II.js} +1 -1
- package/dist/{chevron-left-O8h_551_.js → chevron-left-CGuEjQlY.js} +1 -1
- package/dist/{chevron-right-DP3xpyIA.js → chevron-right-CvIRRsqZ.js} +1 -1
- package/dist/{chevron-top-CuwkBUs9.js → chevron-top-RSzCqjBd.js} +1 -1
- package/dist/{chrome-store-zfT_aJ3R.js → chrome-store-Cs8dAgs0.js} +1 -1
- package/dist/{clock-DHZqivIS.js → clock-fhZO5otC.js} +1 -1
- package/dist/{close-Cp9rNAw4.js → close-BPuztrdR.js} +1 -1
- package/dist/{coinPlaceholder-U7-T1KKQ.js → coinPlaceholder-C8X2i7Kh.js} +1 -1
- package/dist/{compass-Ds5-PRSR.js → compass-WMc5huk0.js} +1 -1
- package/dist/{copy-Jg4HdIMf.js → copy-DVAeT17y.js} +1 -1
- package/dist/core/api.d.ts +10 -1
- package/dist/core/wallet.d.ts +23 -2
- package/dist/{cursor-DmMevduB.js → cursor-BJ4YLXfy.js} +1 -1
- package/dist/{cursor-transparent-Dn9-1SV8.js → cursor-transparent-DN2fLQN4.js} +1 -1
- package/dist/dcp-sdk.umd.js +603 -603
- package/dist/dcp.d.ts +11 -1
- package/dist/{desktop-C4udXXlZ.js → desktop-6avxisBw.js} +1 -1
- package/dist/{disconnect-wd1BYLxt.js → disconnect-AReVI8Gk.js} +1 -1
- package/dist/{discord-DthxuCAP.js → discord-CxrI30BZ.js} +1 -1
- package/dist/{email-B3jSnUFE.js → email-B8dIIaay.js} +24 -24
- package/dist/{embedded-wallet-CJHmoBI2.js → embedded-wallet-C_5hF7rM.js} +24 -24
- package/dist/{etherscan-Cjp4xfMW.js → etherscan-BnAy8cIF.js} +1 -1
- package/dist/{exclamation-triangle-CRNR5WOy.js → exclamation-triangle-Bu7nHwx9.js} +1 -1
- package/dist/{extension-Cydk0mZt.js → extension-F0LIhvcf.js} +1 -1
- package/dist/{external-link-CuPTAoq9.js → external-link-CP6phyaM.js} +1 -1
- package/dist/{facebook-CghqXmdf.js → facebook-BtQ-Io2y.js} +1 -1
- package/dist/{farcaster-BREqMX4y.js → farcaster-BmaN1ugd.js} +1 -1
- package/dist/{filters-Dn_Ys7ew.js → filters-DpEwoOmy.js} +1 -1
- package/dist/{github-C-A7JmIY.js → github-q7qO9V-b.js} +1 -1
- package/dist/{google-CCdM_naE.js → google-DH_ZE8bW.js} +1 -1
- package/dist/{hashTypedData-D2Qmzscs.js → hashTypedData-ZH9ZnWu3.js} +6 -6
- package/dist/{help-circle-DIH4vyj3.js → help-circle-BAQVmKas.js} +1 -1
- package/dist/{id-DkJ0gBuy.js → id-Cj68Zwgo.js} +1 -1
- package/dist/{if-defined-BciplFKz.js → if-defined-CNte9B3N.js} +89 -89
- package/dist/{image-qMjyiXM0.js → image-BKJDw6N-.js} +1 -1
- package/dist/{index-BpXOsxzU.js → index-5mp7WkhV.js} +2 -2
- package/dist/{index-CX60z_g2.js → index-7toZMdtG.js} +32 -32
- package/dist/{index-CMPIqsB1.js → index-B1uKzdvN.js} +3 -3
- package/dist/{index-eW8y-mXH.js → index-BHFZVF-b.js} +3 -3
- package/dist/{index-DiHImG4L.js → index-BJ7cbG3N.js} +12400 -11573
- package/dist/{index-CqVegmN4.js → index-BKwa5JSA.js} +10 -10
- package/dist/{index-D-IzHD_8.js → index-BP4B9VUt.js} +2 -2
- package/dist/{index-DmOMXRG1.js → index-BVdzXHpO.js} +11 -11
- package/dist/{index-B2iDt0TJ.js → index-BYND0GJ9.js} +2 -2
- package/dist/{index-lbhz9evJ.js → index-BaJ0zEbh.js} +2 -2
- package/dist/{index-B7K86vWu.js → index-BdSIrl-R.js} +38 -38
- package/dist/{index-C4BX3QW8.js → index-Bh0MPFwP.js} +3 -3
- package/dist/{index-BBkcvSiY.js → index-Bsh7_qTp.js} +53 -53
- package/dist/{index-DoSYqTQg.js → index-BwnXTNNg.js} +3 -3
- package/dist/{index-Ij6XA6_4.js → index-C0kPDbg_.js} +2 -2
- package/dist/{index-fxzIDZsb.js → index-CKikVKe2.js} +2 -2
- package/dist/{index-SzyBYfzA.js → index-CPTcEPbD.js} +1582 -1881
- package/dist/{index-C27dwOyE.js → index-ChVh0Hkp.js} +3 -3
- package/dist/{index-CwB_qRfM.js → index-Cle_NnnS.js} +6 -6
- package/dist/{index-CUdQyyFn.js → index-CmWdvIFT.js} +2 -2
- package/dist/{index-1adX-Fit.js → index-D2AMA8Bu.js} +2 -2
- package/dist/{index-CTYngdl0.js → index-D5r0iSq4.js} +1 -1
- package/dist/index-D6h-qfpt.js +276 -0
- package/dist/{index-CppCc1n8.js → index-DAUM8CO4.js} +2 -2
- package/dist/{index-DtCsAVBg.js → index-DGjZW6uR.js} +2 -2
- package/dist/{index-CxOF7GqE.js → index-DQe94z7X.js} +3 -3
- package/dist/{index-AvC0IGDl.js → index-DTo6w99t.js} +101 -101
- package/dist/{index-B5zkXsLJ.js → index-DYdXjap2.js} +9 -9
- package/dist/{index-BdjxQs66.js → index-DceCxNV5.js} +5 -5
- package/dist/{index-Da8oZh8H.js → index-DobBVPe4.js} +14 -14
- package/dist/{index-DRNiFv9I.js → index-Dy4NyE6l.js} +7 -7
- package/dist/{index-Bijd4_Ns.js → index-Uw9cSw0q.js} +3 -3
- package/dist/{index-DpHXq5_E.js → index-f3LXSfM5.js} +6 -6
- package/dist/{index--3Zp0jAb.js → index-qiuyrukh.js} +2 -2
- package/dist/{index-CuiyMA8F.js → index-zddvaohA.js} +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{info-DMIGgjkL.js → info-RfPsmroW.js} +1 -1
- package/dist/{info-circle-CJuIKZSx.js → info-circle-DFKHB_ZN.js} +1 -1
- package/dist/{lightbulb-qFT6WEWV.js → lightbulb-B-Bykj9X.js} +1 -1
- package/dist/{localBatchGatewayRequest-CsMVMFBc.js → localBatchGatewayRequest-CjGcn5nM.js} +1 -1
- package/dist/{mail-DoYgQvOt.js → mail-mBAgGuw5.js} +1 -1
- package/dist/{mobile-URtsh7o-.js → mobile-Dhh3ndkf.js} +1 -1
- package/dist/{more-DoQd10TF.js → more-D1h7UTvg.js} +1 -1
- package/dist/{network-placeholder-BBA2Ue6C.js → network-placeholder-Dqynvc-t.js} +1 -1
- package/dist/{nftPlaceholder-C9RXWz9k.js → nftPlaceholder-Df7MW4MM.js} +1 -1
- package/dist/{off-YcuDQczT.js → off-BmG3cHTX.js} +1 -1
- package/dist/{onramp-BfqDIx4o.js → onramp-C401Aenb.js} +46 -46
- package/dist/{parseSignature-280HB24T.js → parseSignature-S8VEpRHC.js} +967 -1222
- package/dist/{play-store-sFaloG_r.js → play-store-4q1fzL_P.js} +1 -1
- package/dist/{plus-l0wekSht.js → plus-603Gs3yG.js} +1 -1
- package/dist/{qr-code-CihrUU4G.js → qr-code-Dgwhf6M1.js} +1 -1
- package/dist/{receive-dfY1Cu-g.js → receive-CYXbbEUR.js} +10 -10
- package/dist/{recycle-horizontal-nXu6YaPw.js → recycle-horizontal-Bu8zZ563.js} +1 -1
- package/dist/{ref-huAzXCX0.js → ref-DpmKRWBK.js} +2 -2
- package/dist/{refresh-D2ZbVeNC.js → refresh-BMZFu0mu.js} +1 -1
- package/dist/{reown-logo-BMaTMJmc.js → reown-logo-BXph7ThY.js} +1 -1
- package/dist/{search-YVM9q3J-.js → search-Cm_V42Y_.js} +1 -1
- package/dist/{secp256k1-DPQgTBwQ.js → secp256k1-C0iX1TUr.js} +19 -19
- package/dist/{secp256k1-BrysY3Sv.js → secp256k1-DOQBqE4Z.js} +1 -1
- package/dist/{send-BwQZPKxI.js → send-BSMYxDuP.js} +1 -1
- package/dist/{send-GyetMVu1.js → send-C8EeIzRB.js} +20 -20
- package/dist/{socials-B0W91J9k.js → socials-DQrHQajs.js} +15 -15
- package/dist/{swapHorizontal-Dy_oQEkp.js → swapHorizontal-98rnJewS.js} +1 -1
- package/dist/{swapHorizontalBold-C4JpaMpc.js → swapHorizontalBold-C299FjEt.js} +1 -1
- package/dist/{swapHorizontalMedium-D5NuVZFh.js → swapHorizontalMedium-Cqm6i4WJ.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-Bq4P2MCj.js → swapHorizontalRoundedBold-De7hFfqZ.js} +1 -1
- package/dist/{swapVertical-CVQ8Mg03.js → swapVertical-DSL75l8L.js} +1 -1
- package/dist/{swaps-CA04SSdK.js → swaps-BuTNp65Y.js} +24 -24
- package/dist/{telegram-BP4SgW_L.js → telegram-cJP7hgUb.js} +1 -1
- package/dist/{three-dots-BJYGJ-dQ.js → three-dots-DHnEh28O.js} +1 -1
- package/dist/{transactions-Bq-98Tsg.js → transactions-DujFkB-M.js} +3 -3
- package/dist/{twitch-DTATWo9M.js → twitch-CR2iGcBo.js} +1 -1
- package/dist/{twitterIcon-D5UWPInb.js → twitterIcon-E5TAQjOn.js} +1 -1
- package/dist/types.d.ts +60 -0
- package/dist/ui/Modal.d.ts +3 -3
- package/dist/ui/index.d.ts +2 -2
- package/dist/{verify-Byvj8Wi1.js → verify-DEukUJp0.js} +1 -1
- package/dist/{verify-filled-B40taNm0.js → verify-filled-BXsx1i_p.js} +1 -1
- package/dist/{w3m-modal-HV6SE74G.js → w3m-modal-Bm7BqVng.js} +40 -40
- package/dist/{wallet-Cp-6Kk88.js → wallet-CzyyvdrT.js} +1 -1
- package/dist/{wallet-placeholder-C3juwA9o.js → wallet-placeholder-BrcmyGEe.js} +1 -1
- package/dist/{walletconnect-CRkIiLCx.js → walletconnect-BSYogWiE.js} +1 -1
- package/dist/{warning-circle-DtvCLwG4.js → warning-circle-Cgp2BW3m.js} +1 -1
- package/dist/{x-Cqyx5eCt.js → x-BJinLpTw.js} +1 -1
- package/package.json +1 -1
- package/dist/index-B2-vKLd8.js +0 -276
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as
|
|
3
|
-
import { s as
|
|
4
|
-
import { h as
|
|
5
|
-
function
|
|
1
|
+
import { dY as ot, dZ as $t, d_ as Ct, I as kn, d$ as ct, e0 as ut, e1 as ft, a as Rn, e2 as Sn, e3 as K, e4 as I, e5 as q, e6 as kt, e7 as Tn, e8 as zn, e9 as V, ea as X, eb as F, ec as se, ed as Rt, ee as Fn, ef as Ue, eg as L, eh as On, ei as Ln, ej as _n, ek as Un, el as ke, a1 as U, bl as St, M as dt, d2 as Dn, ci as Mn, cf as he, bZ as Tt, bi as zt, em as De, c0 as B, bk as j, en as P, eo as Ft, ep as ce, c4 as Me, c7 as W, bm as Ot, cR as qe, bh as ge, cq as ae, eq as ie, er as ye, es as je, et as we, aJ as Lt, eu as Ve, bg as _t, V as Ut, W as Dt, bT as pe, ev as qn, bR as Q, bM as Mt, bL as lt, ew as jn, cm as Vn, aa as ht, bE as qt, b$ as me, bY as re, bB as jt, bA as ve, ex as pt, c2 as We, ey as Vt, ez as _, eA as mt, eB as Wn, cr as Wt, cd as Ht, eC as Hn, eD as Gn, H as Zn, bD as Ae, bq as Gt, a0 as Jn, bF as Be, c1 as Yn, b_ as Kn, df as Qn, dg as Xn, T as er, eE as tr, $ as nr, br as He, eF as rr, bp as Zt, eG as sr, bW as Jt, eH as Yt, eI as ar, eJ as ir, c6 as or, E as cr, ad as ur, eK as fr, az as dr, t as lr, co as hr, r as pr, eL as mr, eM as Kt, q as bt, bj as br, v as gr, a8 as yr, bS as wr, a9 as vr, eN as ne, cc as Ar, eO as xr, eP as Er, eQ as Pr, eR as Ir, eS as Nr, eT as Br, eU as $r, eV as Cr, eW as kr, eX as Rr, eY as Sr, eZ as Tr, e_ as zr, e$ as Fr, f0 as Or, f1 as Lr, j as _r } from "./index-BJ7cbG3N.js";
|
|
2
|
+
import { l as Ge } from "./localBatchGatewayRequest-CjGcn5nM.js";
|
|
3
|
+
import { s as Qt } from "./secp256k1-DOQBqE4Z.js";
|
|
4
|
+
import { h as Xt, e as Ur } from "./hashTypedData-ZH9ZnWu3.js";
|
|
5
|
+
function gt(e) {
|
|
6
6
|
let t;
|
|
7
7
|
if (typeof e == "string")
|
|
8
|
-
t =
|
|
8
|
+
t = ot(e);
|
|
9
9
|
else {
|
|
10
|
-
const n =
|
|
10
|
+
const n = $t(e), r = e.length;
|
|
11
11
|
for (let s = 0; s < r; s++) {
|
|
12
12
|
const a = e[s];
|
|
13
|
-
if (!
|
|
14
|
-
t =
|
|
13
|
+
if (!Ct(a)) {
|
|
14
|
+
t = ot(a, n);
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
if (!t)
|
|
20
|
-
throw new
|
|
20
|
+
throw new kn({ signature: e });
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function yt(e) {
|
|
24
24
|
const t = [];
|
|
25
25
|
if (typeof e == "string") {
|
|
26
|
-
const n =
|
|
26
|
+
const n = ct(e), r = n.length;
|
|
27
27
|
for (let s = 0; s < r; s++)
|
|
28
|
-
t.push(
|
|
28
|
+
t.push(ut(n[s], { modifiers: ft }));
|
|
29
29
|
} else {
|
|
30
|
-
const n =
|
|
30
|
+
const n = $t(e), r = e.length;
|
|
31
31
|
for (let s = 0; s < r; s++) {
|
|
32
32
|
const a = e[s];
|
|
33
|
-
if (
|
|
33
|
+
if (Ct(a))
|
|
34
34
|
continue;
|
|
35
|
-
const i =
|
|
35
|
+
const i = ct(a), o = i.length;
|
|
36
36
|
for (let c = 0; c < o; c++)
|
|
37
|
-
t.push(
|
|
37
|
+
t.push(ut(i[c], { modifiers: ft, structs: n }));
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
if (t.length === 0)
|
|
41
|
-
throw new
|
|
41
|
+
throw new Rn({ params: e });
|
|
42
42
|
return t;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
if (
|
|
46
|
-
throw new
|
|
47
|
-
givenSize:
|
|
44
|
+
function ue(e, t) {
|
|
45
|
+
if (Z(e) > t)
|
|
46
|
+
throw new Xr({
|
|
47
|
+
givenSize: Z(e),
|
|
48
48
|
maxSize: t
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -56,7 +56,7 @@ const D = {
|
|
|
56
56
|
a: 97,
|
|
57
57
|
f: 102
|
|
58
58
|
};
|
|
59
|
-
function
|
|
59
|
+
function wt(e) {
|
|
60
60
|
if (e >= D.zero && e <= D.nine)
|
|
61
61
|
return e - D.zero;
|
|
62
62
|
if (e >= D.A && e <= D.F)
|
|
@@ -64,12 +64,12 @@ function Tt(e) {
|
|
|
64
64
|
if (e >= D.a && e <= D.f)
|
|
65
65
|
return e - (D.a - 10);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function Dr(e, t = {}) {
|
|
68
68
|
const { dir: n, size: r = 32 } = t;
|
|
69
69
|
if (r === 0)
|
|
70
70
|
return e;
|
|
71
71
|
if (e.length > r)
|
|
72
|
-
throw new
|
|
72
|
+
throw new es({
|
|
73
73
|
size: e.length,
|
|
74
74
|
targetSize: r,
|
|
75
75
|
type: "Bytes"
|
|
@@ -81,80 +81,80 @@ function os(e, t = {}) {
|
|
|
81
81
|
}
|
|
82
82
|
return s;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function en(e, t = {}) {
|
|
85
85
|
const { dir: n = "left" } = t;
|
|
86
86
|
let r = e, s = 0;
|
|
87
87
|
for (let a = 0; a < r.length - 1 && r[n === "left" ? a : r.length - a - 1].toString() === "0"; a++)
|
|
88
88
|
s++;
|
|
89
89
|
return r = n === "left" ? r.slice(s) : r.slice(0, r.length - s), r;
|
|
90
90
|
}
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
return e instanceof Uint8Array ? e : typeof e == "string" ?
|
|
91
|
+
const Mr = /* @__PURE__ */ new TextDecoder(), qr = /* @__PURE__ */ new TextEncoder();
|
|
92
|
+
function jr(e) {
|
|
93
|
+
return e instanceof Uint8Array ? e : typeof e == "string" ? tn(e) : Vr(e);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Vr(e) {
|
|
96
96
|
return e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function tn(e, t = {}) {
|
|
99
99
|
const { size: n } = t;
|
|
100
100
|
let r = e;
|
|
101
|
-
n && (
|
|
101
|
+
n && (Sn(e, n), r = K(e, n));
|
|
102
102
|
let s = r.slice(2);
|
|
103
103
|
s.length % 2 && (s = `0${s}`);
|
|
104
104
|
const a = s.length / 2, i = new Uint8Array(a);
|
|
105
105
|
for (let o = 0, c = 0; o < a; o++) {
|
|
106
|
-
const u =
|
|
106
|
+
const u = wt(s.charCodeAt(c++)), f = wt(s.charCodeAt(c++));
|
|
107
107
|
if (u === void 0 || f === void 0)
|
|
108
|
-
throw new
|
|
108
|
+
throw new I(`Invalid byte sequence ("${s[c - 2]}${s[c - 1]}" in "${s}").`);
|
|
109
109
|
i[o] = u * 16 + f;
|
|
110
110
|
}
|
|
111
111
|
return i;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
const { size: n } = t, r =
|
|
115
|
-
return typeof n == "number" ? (
|
|
113
|
+
function Wr(e, t = {}) {
|
|
114
|
+
const { size: n } = t, r = qr.encode(e);
|
|
115
|
+
return typeof n == "number" ? (ue(r, n), Hr(r, n)) : r;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
117
|
+
function Hr(e, t) {
|
|
118
|
+
return Dr(e, { dir: "right", size: t });
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Z(e) {
|
|
121
121
|
return e.length;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function Gr(e, t, n, r = {}) {
|
|
124
124
|
const { strict: s } = r;
|
|
125
125
|
return e.slice(t, n);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Zr(e, t = {}) {
|
|
128
128
|
const { size: n } = t;
|
|
129
|
-
typeof n < "u" &&
|
|
130
|
-
const r =
|
|
131
|
-
return
|
|
129
|
+
typeof n < "u" && ue(e, n);
|
|
130
|
+
const r = q(e, t);
|
|
131
|
+
return Tn(r, t);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Jr(e, t = {}) {
|
|
134
134
|
const { size: n } = t;
|
|
135
135
|
let r = e;
|
|
136
|
-
if (typeof n < "u" && (
|
|
137
|
-
throw new
|
|
136
|
+
if (typeof n < "u" && (ue(r, n), r = nn(r)), r.length > 1 || r[0] > 1)
|
|
137
|
+
throw new Qr(r);
|
|
138
138
|
return !!r[0];
|
|
139
139
|
}
|
|
140
140
|
function M(e, t = {}) {
|
|
141
141
|
const { size: n } = t;
|
|
142
|
-
typeof n < "u" &&
|
|
143
|
-
const r =
|
|
144
|
-
return
|
|
142
|
+
typeof n < "u" && ue(e, n);
|
|
143
|
+
const r = q(e, t);
|
|
144
|
+
return kt(r, t);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Yr(e, t = {}) {
|
|
147
147
|
const { size: n } = t;
|
|
148
148
|
let r = e;
|
|
149
|
-
return typeof n < "u" && (
|
|
149
|
+
return typeof n < "u" && (ue(r, n), r = Kr(r)), Mr.decode(r);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
return
|
|
151
|
+
function nn(e) {
|
|
152
|
+
return en(e, { dir: "left" });
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
return
|
|
154
|
+
function Kr(e) {
|
|
155
|
+
return en(e, { dir: "right" });
|
|
156
156
|
}
|
|
157
|
-
class
|
|
157
|
+
class Qr extends I {
|
|
158
158
|
constructor(t) {
|
|
159
159
|
super(`Bytes value \`${t}\` is not a valid boolean.`, {
|
|
160
160
|
metaMessages: [
|
|
@@ -168,7 +168,7 @@ class ws extends B {
|
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
class
|
|
171
|
+
class Xr extends I {
|
|
172
172
|
constructor({ givenSize: t, maxSize: n }) {
|
|
173
173
|
super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`), Object.defineProperty(this, "name", {
|
|
174
174
|
enumerable: !0,
|
|
@@ -178,7 +178,7 @@ class vs extends B {
|
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
class
|
|
181
|
+
class es extends I {
|
|
182
182
|
constructor({ size: t, targetSize: n, type: r }) {
|
|
183
183
|
super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`), Object.defineProperty(this, "name", {
|
|
184
184
|
enumerable: !0,
|
|
@@ -188,7 +188,7 @@ class xs extends B {
|
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
class
|
|
191
|
+
class ts extends Map {
|
|
192
192
|
constructor(t) {
|
|
193
193
|
super(), Object.defineProperty(this, "maxSize", {
|
|
194
194
|
enumerable: !0,
|
|
@@ -209,50 +209,50 @@ class Ps extends Map {
|
|
|
209
209
|
return this;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
const
|
|
213
|
-
checksum: /* @__PURE__ */ new
|
|
214
|
-
},
|
|
215
|
-
function
|
|
216
|
-
const { as: n = typeof e == "string" ? "Hex" : "Bytes" } = t, r =
|
|
217
|
-
return n === "Bytes" ? r :
|
|
212
|
+
const ns = {
|
|
213
|
+
checksum: /* @__PURE__ */ new ts(8192)
|
|
214
|
+
}, $e = ns.checksum;
|
|
215
|
+
function rn(e, t = {}) {
|
|
216
|
+
const { as: n = typeof e == "string" ? "Hex" : "Bytes" } = t, r = zn(jr(e));
|
|
217
|
+
return n === "Bytes" ? r : q(r);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
function
|
|
219
|
+
const rs = /^0x[a-fA-F0-9]{40}$/;
|
|
220
|
+
function xe(e, t = {}) {
|
|
221
221
|
const { strict: n = !0 } = t;
|
|
222
|
-
if (!
|
|
223
|
-
throw new
|
|
222
|
+
if (!rs.test(e))
|
|
223
|
+
throw new vt({
|
|
224
224
|
address: e,
|
|
225
|
-
cause: new
|
|
225
|
+
cause: new ss()
|
|
226
226
|
});
|
|
227
227
|
if (n) {
|
|
228
228
|
if (e.toLowerCase() === e)
|
|
229
229
|
return;
|
|
230
|
-
if (
|
|
231
|
-
throw new
|
|
230
|
+
if (sn(e) !== e)
|
|
231
|
+
throw new vt({
|
|
232
232
|
address: e,
|
|
233
|
-
cause: new
|
|
233
|
+
cause: new as()
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
if (
|
|
239
|
-
return
|
|
240
|
-
|
|
241
|
-
const t = e.substring(2).toLowerCase(), n =
|
|
237
|
+
function sn(e) {
|
|
238
|
+
if ($e.has(e))
|
|
239
|
+
return $e.get(e);
|
|
240
|
+
xe(e, { strict: !1 });
|
|
241
|
+
const t = e.substring(2).toLowerCase(), n = rn(Wr(t), { as: "Bytes" }), r = t.split("");
|
|
242
242
|
for (let a = 0; a < 40; a += 2)
|
|
243
243
|
n[a >> 1] >> 4 >= 8 && r[a] && (r[a] = r[a].toUpperCase()), (n[a >> 1] & 15) >= 8 && r[a + 1] && (r[a + 1] = r[a + 1].toUpperCase());
|
|
244
244
|
const s = `0x${r.join("")}`;
|
|
245
|
-
return
|
|
245
|
+
return $e.set(e, s), s;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function Re(e, t = {}) {
|
|
248
248
|
const { strict: n = !0 } = t ?? {};
|
|
249
249
|
try {
|
|
250
|
-
return
|
|
250
|
+
return xe(e, { strict: n }), !0;
|
|
251
251
|
} catch {
|
|
252
252
|
return !1;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
class
|
|
255
|
+
class vt extends I {
|
|
256
256
|
constructor({ address: t, cause: n }) {
|
|
257
257
|
super(`Address "${t}" is invalid.`, {
|
|
258
258
|
cause: n
|
|
@@ -264,7 +264,7 @@ class $t extends B {
|
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
class
|
|
267
|
+
class ss extends I {
|
|
268
268
|
constructor() {
|
|
269
269
|
super("Address is not a 20 byte (40 hexadecimal character) value."), Object.defineProperty(this, "name", {
|
|
270
270
|
enumerable: !0,
|
|
@@ -274,7 +274,7 @@ class Is extends B {
|
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
class
|
|
277
|
+
class as extends I {
|
|
278
278
|
constructor() {
|
|
279
279
|
super("Address does not match its checksum counterpart."), Object.defineProperty(this, "name", {
|
|
280
280
|
enumerable: !0,
|
|
@@ -284,58 +284,58 @@ class Bs extends B {
|
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
const
|
|
288
|
-
function
|
|
289
|
-
const { checksumAddress: r, staticPosition: s } = n, a =
|
|
287
|
+
const is = /^(.*)\[([0-9]*)\]$/, os = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, an = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/, At = 2n ** 256n - 1n;
|
|
288
|
+
function Y(e, t, n) {
|
|
289
|
+
const { checksumAddress: r, staticPosition: s } = n, a = Ye(t.type);
|
|
290
290
|
if (a) {
|
|
291
291
|
const [i, o] = a;
|
|
292
|
-
return
|
|
292
|
+
return us(e, { ...t, type: o }, { checksumAddress: r, length: i, staticPosition: s });
|
|
293
293
|
}
|
|
294
294
|
if (t.type === "tuple")
|
|
295
|
-
return
|
|
295
|
+
return hs(e, t, {
|
|
296
296
|
checksumAddress: r,
|
|
297
297
|
staticPosition: s
|
|
298
298
|
});
|
|
299
299
|
if (t.type === "address")
|
|
300
|
-
return
|
|
300
|
+
return cs(e, { checksum: r });
|
|
301
301
|
if (t.type === "bool")
|
|
302
|
-
return
|
|
302
|
+
return fs(e);
|
|
303
303
|
if (t.type.startsWith("bytes"))
|
|
304
|
-
return
|
|
304
|
+
return ds(e, t, { staticPosition: s });
|
|
305
305
|
if (t.type.startsWith("uint") || t.type.startsWith("int"))
|
|
306
|
-
return
|
|
306
|
+
return ls(e, t);
|
|
307
307
|
if (t.type === "string")
|
|
308
|
-
return
|
|
309
|
-
throw new
|
|
308
|
+
return ps(e, { staticPosition: s });
|
|
309
|
+
throw new Qe(t.type);
|
|
310
310
|
}
|
|
311
|
-
const
|
|
312
|
-
function
|
|
311
|
+
const xt = 32, Se = 32;
|
|
312
|
+
function cs(e, t = {}) {
|
|
313
313
|
const { checksum: n = !1 } = t, r = e.readBytes(32);
|
|
314
|
-
return [((a) => n ?
|
|
314
|
+
return [((a) => n ? sn(a) : a)(q(Gr(r, -20))), 32];
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function us(e, t, n) {
|
|
317
317
|
const { checksumAddress: r, length: s, staticPosition: a } = n;
|
|
318
318
|
if (!s) {
|
|
319
|
-
const c = M(e.readBytes(
|
|
319
|
+
const c = M(e.readBytes(Se)), u = a + c, f = u + xt;
|
|
320
320
|
e.setPosition(u);
|
|
321
|
-
const d = M(e.readBytes(
|
|
321
|
+
const d = M(e.readBytes(xt)), l = oe(t);
|
|
322
322
|
let h = 0;
|
|
323
|
-
const
|
|
324
|
-
for (let
|
|
325
|
-
e.setPosition(f + (l ?
|
|
326
|
-
const [p, m] =
|
|
323
|
+
const b = [];
|
|
324
|
+
for (let w = 0; w < d; ++w) {
|
|
325
|
+
e.setPosition(f + (l ? w * 32 : h));
|
|
326
|
+
const [p, m] = Y(e, t, {
|
|
327
327
|
checksumAddress: r,
|
|
328
328
|
staticPosition: f
|
|
329
329
|
});
|
|
330
|
-
h += m,
|
|
330
|
+
h += m, b.push(p);
|
|
331
331
|
}
|
|
332
|
-
return e.setPosition(a + 32), [
|
|
332
|
+
return e.setPosition(a + 32), [b, 32];
|
|
333
333
|
}
|
|
334
|
-
if (
|
|
335
|
-
const c = M(e.readBytes(
|
|
334
|
+
if (oe(t)) {
|
|
335
|
+
const c = M(e.readBytes(Se)), u = a + c, f = [];
|
|
336
336
|
for (let d = 0; d < s; ++d) {
|
|
337
337
|
e.setPosition(u + d * 32);
|
|
338
|
-
const [l] =
|
|
338
|
+
const [l] = Y(e, t, {
|
|
339
339
|
checksumAddress: r,
|
|
340
340
|
staticPosition: u
|
|
341
341
|
});
|
|
@@ -346,7 +346,7 @@ function $s(e, t, n) {
|
|
|
346
346
|
let i = 0;
|
|
347
347
|
const o = [];
|
|
348
348
|
for (let c = 0; c < s; ++c) {
|
|
349
|
-
const [u, f] =
|
|
349
|
+
const [u, f] = Y(e, t, {
|
|
350
350
|
checksumAddress: r,
|
|
351
351
|
staticPosition: a + i
|
|
352
352
|
});
|
|
@@ -354,10 +354,10 @@ function $s(e, t, n) {
|
|
|
354
354
|
}
|
|
355
355
|
return [o, i];
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
return [
|
|
357
|
+
function fs(e) {
|
|
358
|
+
return [Jr(e.readBytes(32), { size: 32 }), 32];
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function ds(e, t, { staticPosition: n }) {
|
|
361
361
|
const [r, s] = t.type.split("bytes");
|
|
362
362
|
if (!s) {
|
|
363
363
|
const i = M(e.readBytes(32));
|
|
@@ -366,26 +366,26 @@ function zs(e, t, { staticPosition: n }) {
|
|
|
366
366
|
if (o === 0)
|
|
367
367
|
return e.setPosition(n + 32), ["0x", 32];
|
|
368
368
|
const c = e.readBytes(o);
|
|
369
|
-
return e.setPosition(n + 32), [
|
|
369
|
+
return e.setPosition(n + 32), [q(c), 32];
|
|
370
370
|
}
|
|
371
|
-
return [
|
|
371
|
+
return [q(e.readBytes(Number.parseInt(s, 10), 32)), 32];
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function ls(e, t) {
|
|
374
374
|
const n = t.type.startsWith("int"), r = Number.parseInt(t.type.split("int")[1] || "256", 10), s = e.readBytes(32);
|
|
375
375
|
return [
|
|
376
|
-
r > 48 ?
|
|
376
|
+
r > 48 ? Zr(s, { signed: n }) : M(s, { signed: n }),
|
|
377
377
|
32
|
|
378
378
|
];
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function hs(e, t, n) {
|
|
381
381
|
const { checksumAddress: r, staticPosition: s } = n, a = t.components.length === 0 || t.components.some(({ name: c }) => !c), i = a ? [] : {};
|
|
382
382
|
let o = 0;
|
|
383
|
-
if (
|
|
384
|
-
const c = M(e.readBytes(
|
|
383
|
+
if (oe(t)) {
|
|
384
|
+
const c = M(e.readBytes(Se)), u = s + c;
|
|
385
385
|
for (let f = 0; f < t.components.length; ++f) {
|
|
386
386
|
const d = t.components[f];
|
|
387
387
|
e.setPosition(u + o);
|
|
388
|
-
const [l, h] =
|
|
388
|
+
const [l, h] = Y(e, d, {
|
|
389
389
|
checksumAddress: r,
|
|
390
390
|
staticPosition: u
|
|
391
391
|
});
|
|
@@ -394,7 +394,7 @@ function Ss(e, t, n) {
|
|
|
394
394
|
return e.setPosition(s + 32), [i, 32];
|
|
395
395
|
}
|
|
396
396
|
for (let c = 0; c < t.components.length; ++c) {
|
|
397
|
-
const u = t.components[c], [f, d] =
|
|
397
|
+
const u = t.components[c], [f, d] = Y(e, u, {
|
|
398
398
|
checksumAddress: r,
|
|
399
399
|
staticPosition: s
|
|
400
400
|
});
|
|
@@ -402,30 +402,30 @@ function Ss(e, t, n) {
|
|
|
402
402
|
}
|
|
403
403
|
return [i, o];
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function ps(e, { staticPosition: t }) {
|
|
406
406
|
const n = M(e.readBytes(32)), r = t + n;
|
|
407
407
|
e.setPosition(r);
|
|
408
408
|
const s = M(e.readBytes(32));
|
|
409
409
|
if (s === 0)
|
|
410
410
|
return e.setPosition(t + 32), ["", 32];
|
|
411
|
-
const a = e.readBytes(s, 32), i =
|
|
411
|
+
const a = e.readBytes(s, 32), i = Yr(nn(a));
|
|
412
412
|
return e.setPosition(t + 32), [i, 32];
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function ms({ checksumAddress: e, parameters: t, values: n }) {
|
|
415
415
|
const r = [];
|
|
416
416
|
for (let s = 0; s < t.length; s++)
|
|
417
|
-
r.push(
|
|
417
|
+
r.push(Ze({
|
|
418
418
|
checksumAddress: e,
|
|
419
419
|
parameter: t[s],
|
|
420
420
|
value: n[s]
|
|
421
421
|
}));
|
|
422
422
|
return r;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
const r = t, s =
|
|
424
|
+
function Ze({ checksumAddress: e = !1, parameter: t, value: n }) {
|
|
425
|
+
const r = t, s = Ye(r.type);
|
|
426
426
|
if (s) {
|
|
427
427
|
const [a, i] = s;
|
|
428
|
-
return
|
|
428
|
+
return gs(n, {
|
|
429
429
|
checksumAddress: e,
|
|
430
430
|
length: a,
|
|
431
431
|
parameter: {
|
|
@@ -435,56 +435,56 @@ function rt({ checksumAddress: e = !1, parameter: t, value: n }) {
|
|
|
435
435
|
});
|
|
436
436
|
}
|
|
437
437
|
if (r.type === "tuple")
|
|
438
|
-
return
|
|
438
|
+
return xs(n, {
|
|
439
439
|
checksumAddress: e,
|
|
440
440
|
parameter: r
|
|
441
441
|
});
|
|
442
442
|
if (r.type === "address")
|
|
443
|
-
return
|
|
443
|
+
return bs(n, {
|
|
444
444
|
checksum: e
|
|
445
445
|
});
|
|
446
446
|
if (r.type === "bool")
|
|
447
|
-
return
|
|
447
|
+
return ws(n);
|
|
448
448
|
if (r.type.startsWith("uint") || r.type.startsWith("int")) {
|
|
449
|
-
const a = r.type.startsWith("int"), [, , i = "256"] =
|
|
450
|
-
return
|
|
449
|
+
const a = r.type.startsWith("int"), [, , i = "256"] = an.exec(r.type) ?? [];
|
|
450
|
+
return vs(n, {
|
|
451
451
|
signed: a,
|
|
452
452
|
size: Number(i)
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
455
|
if (r.type.startsWith("bytes"))
|
|
456
|
-
return
|
|
456
|
+
return ys(n, { type: r.type });
|
|
457
457
|
if (r.type === "string")
|
|
458
|
-
return
|
|
459
|
-
throw new
|
|
458
|
+
return As(n);
|
|
459
|
+
throw new Qe(r.type);
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function Je(e) {
|
|
462
462
|
let t = 0;
|
|
463
463
|
for (let a = 0; a < e.length; a++) {
|
|
464
464
|
const { dynamic: i, encoded: o } = e[a];
|
|
465
|
-
i ? t += 32 : t +=
|
|
465
|
+
i ? t += 32 : t += V(o);
|
|
466
466
|
}
|
|
467
467
|
const n = [], r = [];
|
|
468
468
|
let s = 0;
|
|
469
469
|
for (let a = 0; a < e.length; a++) {
|
|
470
470
|
const { dynamic: i, encoded: o } = e[a];
|
|
471
|
-
i ? (n.push(
|
|
471
|
+
i ? (n.push(X(t + s, { size: 32 })), r.push(o), s += V(o)) : n.push(o);
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return F(...n, ...r);
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function bs(e, t) {
|
|
476
476
|
const { checksum: n = !1 } = t;
|
|
477
|
-
return
|
|
477
|
+
return xe(e, { strict: n }), {
|
|
478
478
|
dynamic: !1,
|
|
479
|
-
encoded:
|
|
479
|
+
encoded: se(e.toLowerCase())
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function gs(e, t) {
|
|
483
483
|
const { checksumAddress: n, length: r, parameter: s } = t, a = r === null;
|
|
484
484
|
if (!Array.isArray(e))
|
|
485
|
-
throw new
|
|
485
|
+
throw new Rs(e);
|
|
486
486
|
if (!a && e.length !== r)
|
|
487
|
-
throw new
|
|
487
|
+
throw new ks({
|
|
488
488
|
expectedLength: r,
|
|
489
489
|
givenLength: e.length,
|
|
490
490
|
type: `${s.type}[${r}]`
|
|
@@ -492,7 +492,7 @@ function _s(e, t) {
|
|
|
492
492
|
let i = !1;
|
|
493
493
|
const o = [];
|
|
494
494
|
for (let c = 0; c < e.length; c++) {
|
|
495
|
-
const u =
|
|
495
|
+
const u = Ze({
|
|
496
496
|
checksumAddress: n,
|
|
497
497
|
parameter: s,
|
|
498
498
|
value: e[c]
|
|
@@ -500,12 +500,12 @@ function _s(e, t) {
|
|
|
500
500
|
u.dynamic && (i = !0), o.push(u);
|
|
501
501
|
}
|
|
502
502
|
if (a || i) {
|
|
503
|
-
const c =
|
|
503
|
+
const c = Je(o);
|
|
504
504
|
if (a) {
|
|
505
|
-
const u =
|
|
505
|
+
const u = X(o.length, { size: 32 });
|
|
506
506
|
return {
|
|
507
507
|
dynamic: !0,
|
|
508
|
-
encoded: o.length > 0 ?
|
|
508
|
+
encoded: o.length > 0 ? F(u, c) : u
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
if (i)
|
|
@@ -513,35 +513,35 @@ function _s(e, t) {
|
|
|
513
513
|
}
|
|
514
514
|
return {
|
|
515
515
|
dynamic: !1,
|
|
516
|
-
encoded:
|
|
516
|
+
encoded: F(...o.map(({ encoded: c }) => c))
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
const [, n] = t.split("bytes"), r =
|
|
519
|
+
function ys(e, { type: t }) {
|
|
520
|
+
const [, n] = t.split("bytes"), r = V(e);
|
|
521
521
|
if (!n) {
|
|
522
522
|
let s = e;
|
|
523
|
-
return r % 32 !== 0 && (s =
|
|
523
|
+
return r % 32 !== 0 && (s = K(s, Math.ceil((e.length - 2) / 2 / 32) * 32)), {
|
|
524
524
|
dynamic: !0,
|
|
525
|
-
encoded:
|
|
525
|
+
encoded: F(se(X(r, { size: 32 })), s)
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
528
|
if (r !== Number.parseInt(n, 10))
|
|
529
|
-
throw new
|
|
529
|
+
throw new cn({
|
|
530
530
|
expectedSize: Number.parseInt(n, 10),
|
|
531
531
|
value: e
|
|
532
532
|
});
|
|
533
|
-
return { dynamic: !1, encoded:
|
|
533
|
+
return { dynamic: !1, encoded: K(e) };
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function ws(e) {
|
|
536
536
|
if (typeof e != "boolean")
|
|
537
|
-
throw new
|
|
538
|
-
return { dynamic: !1, encoded:
|
|
537
|
+
throw new I(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
|
|
538
|
+
return { dynamic: !1, encoded: se(Rt(e)) };
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function vs(e, { signed: t, size: n }) {
|
|
541
541
|
if (typeof n == "number") {
|
|
542
542
|
const r = 2n ** (BigInt(n) - (t ? 1n : 0n)) - 1n, s = t ? -r - 1n : 0n;
|
|
543
543
|
if (e > r || e < s)
|
|
544
|
-
throw new
|
|
544
|
+
throw new Fn({
|
|
545
545
|
max: r.toString(),
|
|
546
546
|
min: s.toString(),
|
|
547
547
|
signed: t,
|
|
@@ -551,27 +551,27 @@ function Ms(e, { signed: t, size: n }) {
|
|
|
551
551
|
}
|
|
552
552
|
return {
|
|
553
553
|
dynamic: !1,
|
|
554
|
-
encoded:
|
|
554
|
+
encoded: X(e, {
|
|
555
555
|
size: 32,
|
|
556
556
|
signed: t
|
|
557
557
|
})
|
|
558
558
|
};
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
const t =
|
|
560
|
+
function As(e) {
|
|
561
|
+
const t = Ue(e), n = Math.ceil(V(t) / 32), r = [];
|
|
562
562
|
for (let s = 0; s < n; s++)
|
|
563
|
-
r.push(
|
|
563
|
+
r.push(K(L(t, s * 32, (s + 1) * 32)));
|
|
564
564
|
return {
|
|
565
565
|
dynamic: !0,
|
|
566
|
-
encoded:
|
|
566
|
+
encoded: F(K(X(V(t), { size: 32 })), ...r)
|
|
567
567
|
};
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function xs(e, t) {
|
|
570
570
|
const { checksumAddress: n, parameter: r } = t;
|
|
571
571
|
let s = !1;
|
|
572
572
|
const a = [];
|
|
573
573
|
for (let i = 0; i < r.components.length; i++) {
|
|
574
|
-
const o = r.components[i], c = Array.isArray(e) ? i : o.name, u =
|
|
574
|
+
const o = r.components[i], c = Array.isArray(e) ? i : o.name, u = Ze({
|
|
575
575
|
checksumAddress: n,
|
|
576
576
|
parameter: o,
|
|
577
577
|
value: e[c]
|
|
@@ -580,30 +580,30 @@ function qs(e, t) {
|
|
|
580
580
|
}
|
|
581
581
|
return {
|
|
582
582
|
dynamic: s,
|
|
583
|
-
encoded: s ?
|
|
583
|
+
encoded: s ? Je(a) : F(...a.map(({ encoded: i }) => i))
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function Ye(e) {
|
|
587
587
|
const t = e.match(/^(.*)\[(\d+)?\]$/);
|
|
588
588
|
return t ? (
|
|
589
589
|
// Return `null` if the array is dynamic.
|
|
590
590
|
[t[2] ? Number(t[2]) : null, t[1]]
|
|
591
591
|
) : void 0;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function oe(e) {
|
|
594
594
|
var r;
|
|
595
595
|
const { type: t } = e;
|
|
596
596
|
if (t === "string" || t === "bytes" || t.endsWith("[]"))
|
|
597
597
|
return !0;
|
|
598
598
|
if (t === "tuple")
|
|
599
|
-
return (r = e.components) == null ? void 0 : r.some(
|
|
600
|
-
const n =
|
|
601
|
-
return !!(n &&
|
|
599
|
+
return (r = e.components) == null ? void 0 : r.some(oe);
|
|
600
|
+
const n = Ye(e.type);
|
|
601
|
+
return !!(n && oe({
|
|
602
602
|
...e,
|
|
603
603
|
type: n[1]
|
|
604
604
|
}));
|
|
605
605
|
}
|
|
606
|
-
const
|
|
606
|
+
const Es = {
|
|
607
607
|
bytes: new Uint8Array(),
|
|
608
608
|
dataView: new DataView(new ArrayBuffer(0)),
|
|
609
609
|
position: 0,
|
|
@@ -612,21 +612,21 @@ const js = {
|
|
|
612
612
|
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
|
613
613
|
assertReadLimit() {
|
|
614
614
|
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
|
615
|
-
throw new
|
|
615
|
+
throw new Ns({
|
|
616
616
|
count: this.recursiveReadCount + 1,
|
|
617
617
|
limit: this.recursiveReadLimit
|
|
618
618
|
});
|
|
619
619
|
},
|
|
620
620
|
assertPosition(e) {
|
|
621
621
|
if (e < 0 || e > this.bytes.length - 1)
|
|
622
|
-
throw new
|
|
622
|
+
throw new Is({
|
|
623
623
|
length: this.bytes.length,
|
|
624
624
|
position: e
|
|
625
625
|
});
|
|
626
626
|
},
|
|
627
627
|
decrementPosition(e) {
|
|
628
628
|
if (e < 0)
|
|
629
|
-
throw new
|
|
629
|
+
throw new Et({ offset: e });
|
|
630
630
|
const t = this.position - e;
|
|
631
631
|
this.assertPosition(t), this.position = t;
|
|
632
632
|
},
|
|
@@ -635,7 +635,7 @@ const js = {
|
|
|
635
635
|
},
|
|
636
636
|
incrementPosition(e) {
|
|
637
637
|
if (e < 0)
|
|
638
|
-
throw new
|
|
638
|
+
throw new Et({ offset: e });
|
|
639
639
|
const t = this.position + e;
|
|
640
640
|
this.assertPosition(t), this.position = t;
|
|
641
641
|
},
|
|
@@ -725,11 +725,11 @@ const js = {
|
|
|
725
725
|
this.positionReadCount.set(this.position, e + 1), e > 0 && this.recursiveReadCount++;
|
|
726
726
|
}
|
|
727
727
|
};
|
|
728
|
-
function
|
|
729
|
-
const n = Object.create(
|
|
728
|
+
function Ps(e, { recursiveReadLimit: t = 8192 } = {}) {
|
|
729
|
+
const n = Object.create(Es);
|
|
730
730
|
return n.bytes = e, n.dataView = new DataView(e.buffer, e.byteOffset, e.byteLength), n.positionReadCount = /* @__PURE__ */ new Map(), n.recursiveReadLimit = t, n;
|
|
731
731
|
}
|
|
732
|
-
class
|
|
732
|
+
class Et extends I {
|
|
733
733
|
constructor({ offset: t }) {
|
|
734
734
|
super(`Offset \`${t}\` cannot be negative.`), Object.defineProperty(this, "name", {
|
|
735
735
|
enumerable: !0,
|
|
@@ -739,7 +739,7 @@ class Rt extends B {
|
|
|
739
739
|
});
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
|
-
class
|
|
742
|
+
class Is extends I {
|
|
743
743
|
constructor({ length: t, position: n }) {
|
|
744
744
|
super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`), Object.defineProperty(this, "name", {
|
|
745
745
|
enumerable: !0,
|
|
@@ -749,7 +749,7 @@ class Hs extends B {
|
|
|
749
749
|
});
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
class
|
|
752
|
+
class Ns extends I {
|
|
753
753
|
constructor({ count: t, limit: n }) {
|
|
754
754
|
super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`), Object.defineProperty(this, "name", {
|
|
755
755
|
enumerable: !0,
|
|
@@ -759,22 +759,22 @@ class Ws extends B {
|
|
|
759
759
|
});
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
const { as: r = "Array", checksumAddress: s = !1 } = n, a = typeof t == "string" ?
|
|
764
|
-
if (
|
|
765
|
-
throw new
|
|
766
|
-
if (
|
|
767
|
-
throw new
|
|
768
|
-
data: typeof t == "string" ? t :
|
|
762
|
+
function Bs(e, t, n = {}) {
|
|
763
|
+
const { as: r = "Array", checksumAddress: s = !1 } = n, a = typeof t == "string" ? tn(t) : t, i = Ps(a);
|
|
764
|
+
if (Z(a) === 0 && e.length > 0)
|
|
765
|
+
throw new Cs();
|
|
766
|
+
if (Z(a) && Z(a) < 32)
|
|
767
|
+
throw new $s({
|
|
768
|
+
data: typeof t == "string" ? t : q(t),
|
|
769
769
|
parameters: e,
|
|
770
|
-
size:
|
|
770
|
+
size: Z(a)
|
|
771
771
|
});
|
|
772
772
|
let o = 0;
|
|
773
773
|
const c = r === "Array" ? [] : {};
|
|
774
774
|
for (let u = 0; u < e.length; ++u) {
|
|
775
775
|
const f = e[u];
|
|
776
776
|
i.setPosition(o);
|
|
777
|
-
const [d, l] =
|
|
777
|
+
const [d, l] = Y(i, f, {
|
|
778
778
|
checksumAddress: s,
|
|
779
779
|
staticPosition: 0
|
|
780
780
|
});
|
|
@@ -782,82 +782,82 @@ function Zs(e, t, n = {}) {
|
|
|
782
782
|
}
|
|
783
783
|
return c;
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function Ke(e, t, n) {
|
|
786
786
|
const { checksumAddress: r = !1 } = {};
|
|
787
787
|
if (e.length !== t.length)
|
|
788
|
-
throw new
|
|
788
|
+
throw new un({
|
|
789
789
|
expectedLength: e.length,
|
|
790
790
|
givenLength: t.length
|
|
791
791
|
});
|
|
792
|
-
const s =
|
|
792
|
+
const s = ms({
|
|
793
793
|
checksumAddress: r,
|
|
794
794
|
parameters: e,
|
|
795
795
|
values: t
|
|
796
|
-
}), a =
|
|
796
|
+
}), a = Je(s);
|
|
797
797
|
return a.length === 0 ? "0x" : a;
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function Te(e, t) {
|
|
800
800
|
if (e.length !== t.length)
|
|
801
|
-
throw new
|
|
801
|
+
throw new un({
|
|
802
802
|
expectedLength: e.length,
|
|
803
803
|
givenLength: t.length
|
|
804
804
|
});
|
|
805
805
|
const n = [];
|
|
806
806
|
for (let r = 0; r < e.length; r++) {
|
|
807
807
|
const s = e[r], a = t[r];
|
|
808
|
-
n.push(
|
|
808
|
+
n.push(Te.encode(s, a));
|
|
809
809
|
}
|
|
810
|
-
return
|
|
810
|
+
return F(...n);
|
|
811
811
|
}
|
|
812
812
|
(function(e) {
|
|
813
813
|
function t(n, r, s = !1) {
|
|
814
814
|
if (n === "address") {
|
|
815
815
|
const c = r;
|
|
816
|
-
return
|
|
816
|
+
return xe(c), se(c.toLowerCase(), s ? 32 : 0);
|
|
817
817
|
}
|
|
818
818
|
if (n === "string")
|
|
819
|
-
return
|
|
819
|
+
return Ue(r);
|
|
820
820
|
if (n === "bytes")
|
|
821
821
|
return r;
|
|
822
822
|
if (n === "bool")
|
|
823
|
-
return
|
|
824
|
-
const a = n.match(
|
|
823
|
+
return se(Rt(r), s ? 32 : 1);
|
|
824
|
+
const a = n.match(an);
|
|
825
825
|
if (a) {
|
|
826
826
|
const [c, u, f = "256"] = a, d = Number.parseInt(f, 10) / 8;
|
|
827
|
-
return
|
|
827
|
+
return X(r, {
|
|
828
828
|
size: s ? 32 : d,
|
|
829
829
|
signed: u === "int"
|
|
830
830
|
});
|
|
831
831
|
}
|
|
832
|
-
const i = n.match(
|
|
832
|
+
const i = n.match(os);
|
|
833
833
|
if (i) {
|
|
834
834
|
const [c, u] = i;
|
|
835
835
|
if (Number.parseInt(u, 10) !== (r.length - 2) / 2)
|
|
836
|
-
throw new
|
|
836
|
+
throw new cn({
|
|
837
837
|
expectedSize: Number.parseInt(u, 10),
|
|
838
838
|
value: r
|
|
839
839
|
});
|
|
840
|
-
return
|
|
840
|
+
return K(r, s ? 32 : 0);
|
|
841
841
|
}
|
|
842
|
-
const o = n.match(
|
|
842
|
+
const o = n.match(is);
|
|
843
843
|
if (o && Array.isArray(r)) {
|
|
844
844
|
const [c, u] = o, f = [];
|
|
845
845
|
for (let d = 0; d < r.length; d++)
|
|
846
846
|
f.push(t(u, r[d], !0));
|
|
847
|
-
return f.length === 0 ? "0x" :
|
|
847
|
+
return f.length === 0 ? "0x" : F(...f);
|
|
848
848
|
}
|
|
849
|
-
throw new
|
|
849
|
+
throw new Qe(n);
|
|
850
850
|
}
|
|
851
851
|
e.encode = t;
|
|
852
|
-
})(
|
|
853
|
-
function
|
|
854
|
-
return Array.isArray(e) && typeof e[0] == "string" || typeof e == "string" ?
|
|
852
|
+
})(Te || (Te = {}));
|
|
853
|
+
function on(e) {
|
|
854
|
+
return Array.isArray(e) && typeof e[0] == "string" || typeof e == "string" ? yt(e) : e;
|
|
855
855
|
}
|
|
856
|
-
class
|
|
856
|
+
class $s extends I {
|
|
857
857
|
constructor({ data: t, parameters: n, size: r }) {
|
|
858
858
|
super(`Data size of ${r} bytes is too small for given parameters.`, {
|
|
859
859
|
metaMessages: [
|
|
860
|
-
`Params: (${
|
|
860
|
+
`Params: (${On(n)})`,
|
|
861
861
|
`Data: ${t} (${r} bytes)`
|
|
862
862
|
]
|
|
863
863
|
}), Object.defineProperty(this, "name", {
|
|
@@ -868,7 +868,7 @@ class Js extends B {
|
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
|
-
class
|
|
871
|
+
class Cs extends I {
|
|
872
872
|
constructor() {
|
|
873
873
|
super('Cannot decode zero data ("0x") with ABI parameters.'), Object.defineProperty(this, "name", {
|
|
874
874
|
enumerable: !0,
|
|
@@ -878,7 +878,7 @@ class Ys extends B {
|
|
|
878
878
|
});
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
|
-
class
|
|
881
|
+
class ks extends I {
|
|
882
882
|
constructor({ expectedLength: t, givenLength: n, type: r }) {
|
|
883
883
|
super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`), Object.defineProperty(this, "name", {
|
|
884
884
|
enumerable: !0,
|
|
@@ -888,9 +888,9 @@ class Ks extends B {
|
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
class
|
|
891
|
+
class cn extends I {
|
|
892
892
|
constructor({ expectedSize: t, value: n }) {
|
|
893
|
-
super(`Size of bytes "${n}" (bytes${
|
|
893
|
+
super(`Size of bytes "${n}" (bytes${V(n)}) does not match expected size (bytes${t}).`), Object.defineProperty(this, "name", {
|
|
894
894
|
enumerable: !0,
|
|
895
895
|
configurable: !0,
|
|
896
896
|
writable: !0,
|
|
@@ -898,7 +898,7 @@ class bn extends B {
|
|
|
898
898
|
});
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
|
-
class
|
|
901
|
+
class un extends I {
|
|
902
902
|
constructor({ expectedLength: t, givenLength: n }) {
|
|
903
903
|
super([
|
|
904
904
|
"ABI encoding parameters/values length mismatch.",
|
|
@@ -913,7 +913,7 @@ class yn extends B {
|
|
|
913
913
|
});
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
|
-
class
|
|
916
|
+
class Rs extends I {
|
|
917
917
|
constructor(t) {
|
|
918
918
|
super(`Value \`${t}\` is not a valid array.`), Object.defineProperty(this, "name", {
|
|
919
919
|
enumerable: !0,
|
|
@@ -923,7 +923,7 @@ class Qs extends B {
|
|
|
923
923
|
});
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
|
-
class
|
|
926
|
+
class Qe extends I {
|
|
927
927
|
constructor(t) {
|
|
928
928
|
super(`Type \`${t}\` is not a valid ABI Type.`), Object.defineProperty(this, "name", {
|
|
929
929
|
enumerable: !0,
|
|
@@ -933,34 +933,34 @@ class ot extends B {
|
|
|
933
933
|
});
|
|
934
934
|
}
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function fn(e, t = {}) {
|
|
937
937
|
const { recovered: n } = t;
|
|
938
938
|
if (typeof e.r > "u")
|
|
939
|
-
throw new
|
|
939
|
+
throw new Ce({ signature: e });
|
|
940
940
|
if (typeof e.s > "u")
|
|
941
|
-
throw new
|
|
941
|
+
throw new Ce({ signature: e });
|
|
942
942
|
if (n && typeof e.yParity > "u")
|
|
943
|
-
throw new
|
|
944
|
-
if (e.r < 0n || e.r >
|
|
945
|
-
throw new
|
|
946
|
-
if (e.s < 0n || e.s >
|
|
947
|
-
throw new
|
|
943
|
+
throw new Ce({ signature: e });
|
|
944
|
+
if (e.r < 0n || e.r > At)
|
|
945
|
+
throw new _s({ value: e.r });
|
|
946
|
+
if (e.s < 0n || e.s > At)
|
|
947
|
+
throw new Us({ value: e.s });
|
|
948
948
|
if (typeof e.yParity == "number" && e.yParity !== 0 && e.yParity !== 1)
|
|
949
|
-
throw new
|
|
949
|
+
throw new et({ value: e.yParity });
|
|
950
950
|
}
|
|
951
|
-
function
|
|
952
|
-
return
|
|
951
|
+
function Ss(e) {
|
|
952
|
+
return dn(q(e));
|
|
953
953
|
}
|
|
954
|
-
function
|
|
954
|
+
function dn(e) {
|
|
955
955
|
if (e.length !== 130 && e.length !== 132)
|
|
956
|
-
throw new
|
|
957
|
-
const t = BigInt(
|
|
956
|
+
throw new Ls({ signature: e });
|
|
957
|
+
const t = BigInt(L(e, 0, 32)), n = BigInt(L(e, 32, 64)), r = (() => {
|
|
958
958
|
const s = +`0x${e.slice(130)}`;
|
|
959
959
|
if (!Number.isNaN(s))
|
|
960
960
|
try {
|
|
961
|
-
return
|
|
961
|
+
return Xe(s);
|
|
962
962
|
} catch {
|
|
963
|
-
throw new
|
|
963
|
+
throw new et({ value: s });
|
|
964
964
|
}
|
|
965
965
|
})();
|
|
966
966
|
return typeof r > "u" ? {
|
|
@@ -972,31 +972,31 @@ function wn(e) {
|
|
|
972
972
|
yParity: r
|
|
973
973
|
};
|
|
974
974
|
}
|
|
975
|
-
function
|
|
975
|
+
function Ts(e) {
|
|
976
976
|
if (!(typeof e.r > "u") && !(typeof e.s > "u"))
|
|
977
|
-
return
|
|
977
|
+
return zs(e);
|
|
978
978
|
}
|
|
979
|
-
function
|
|
980
|
-
const t = typeof e == "string" ?
|
|
979
|
+
function zs(e) {
|
|
980
|
+
const t = typeof e == "string" ? dn(e) : e instanceof Uint8Array ? Ss(e) : typeof e.r == "string" ? Os(e) : e.v ? Fs(e) : {
|
|
981
981
|
r: e.r,
|
|
982
982
|
s: e.s,
|
|
983
983
|
...typeof e.yParity < "u" ? { yParity: e.yParity } : {}
|
|
984
984
|
};
|
|
985
|
-
return
|
|
985
|
+
return fn(t), t;
|
|
986
986
|
}
|
|
987
|
-
function
|
|
987
|
+
function Fs(e) {
|
|
988
988
|
return {
|
|
989
989
|
r: e.r,
|
|
990
990
|
s: e.s,
|
|
991
|
-
yParity:
|
|
991
|
+
yParity: Xe(e.v)
|
|
992
992
|
};
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function Os(e) {
|
|
995
995
|
const t = (() => {
|
|
996
996
|
const n = e.v ? Number(e.v) : void 0;
|
|
997
997
|
let r = e.yParity ? Number(e.yParity) : void 0;
|
|
998
|
-
if (typeof n == "number" && typeof r != "number" && (r =
|
|
999
|
-
throw new
|
|
998
|
+
if (typeof n == "number" && typeof r != "number" && (r = Xe(n)), typeof r != "number")
|
|
999
|
+
throw new et({ value: e.yParity });
|
|
1000
1000
|
return r;
|
|
1001
1001
|
})();
|
|
1002
1002
|
return {
|
|
@@ -1005,21 +1005,21 @@ function ra(e) {
|
|
|
1005
1005
|
yParity: t
|
|
1006
1006
|
};
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1008
|
+
function Xe(e) {
|
|
1009
1009
|
if (e === 0 || e === 27)
|
|
1010
1010
|
return 0;
|
|
1011
1011
|
if (e === 1 || e === 28)
|
|
1012
1012
|
return 1;
|
|
1013
1013
|
if (e >= 35)
|
|
1014
1014
|
return e % 2 === 0 ? 1 : 0;
|
|
1015
|
-
throw new
|
|
1015
|
+
throw new Ds({ value: e });
|
|
1016
1016
|
}
|
|
1017
|
-
class
|
|
1017
|
+
class Ls extends I {
|
|
1018
1018
|
constructor({ signature: t }) {
|
|
1019
1019
|
super(`Value \`${t}\` is an invalid signature size.`, {
|
|
1020
1020
|
metaMessages: [
|
|
1021
1021
|
"Expected: 64 bytes or 65 bytes.",
|
|
1022
|
-
`Received ${
|
|
1022
|
+
`Received ${V(_n(t))} bytes.`
|
|
1023
1023
|
]
|
|
1024
1024
|
}), Object.defineProperty(this, "name", {
|
|
1025
1025
|
enumerable: !0,
|
|
@@ -1029,9 +1029,9 @@ class sa extends B {
|
|
|
1029
1029
|
});
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
|
-
class
|
|
1032
|
+
class Ce extends I {
|
|
1033
1033
|
constructor({ signature: t }) {
|
|
1034
|
-
super(`Signature \`${
|
|
1034
|
+
super(`Signature \`${Ln(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`), Object.defineProperty(this, "name", {
|
|
1035
1035
|
enumerable: !0,
|
|
1036
1036
|
configurable: !0,
|
|
1037
1037
|
writable: !0,
|
|
@@ -1039,7 +1039,7 @@ class Oe extends B {
|
|
|
1039
1039
|
});
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
|
-
class
|
|
1042
|
+
class _s extends I {
|
|
1043
1043
|
constructor({ value: t }) {
|
|
1044
1044
|
super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`), Object.defineProperty(this, "name", {
|
|
1045
1045
|
enumerable: !0,
|
|
@@ -1049,7 +1049,7 @@ class aa extends B {
|
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
|
-
class
|
|
1052
|
+
class Us extends I {
|
|
1053
1053
|
constructor({ value: t }) {
|
|
1054
1054
|
super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`), Object.defineProperty(this, "name", {
|
|
1055
1055
|
enumerable: !0,
|
|
@@ -1059,7 +1059,7 @@ class ia extends B {
|
|
|
1059
1059
|
});
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
|
-
class
|
|
1062
|
+
class et extends I {
|
|
1063
1063
|
constructor({ value: t }) {
|
|
1064
1064
|
super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`), Object.defineProperty(this, "name", {
|
|
1065
1065
|
enumerable: !0,
|
|
@@ -1069,7 +1069,7 @@ class ut extends B {
|
|
|
1069
1069
|
});
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
|
-
class
|
|
1072
|
+
class Ds extends I {
|
|
1073
1073
|
constructor({ value: t }) {
|
|
1074
1074
|
super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`), Object.defineProperty(this, "name", {
|
|
1075
1075
|
enumerable: !0,
|
|
@@ -1079,11 +1079,11 @@ class oa extends B {
|
|
|
1079
1079
|
});
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return typeof e.chainId == "string" ?
|
|
1082
|
+
function Ms(e, t = {}) {
|
|
1083
|
+
return typeof e.chainId == "string" ? qs(e) : { ...e, ...t.signature };
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1086
|
-
const { address: t, chainId: n, nonce: r } = e, s =
|
|
1085
|
+
function qs(e) {
|
|
1086
|
+
const { address: t, chainId: n, nonce: r } = e, s = Ts(e);
|
|
1087
1087
|
return {
|
|
1088
1088
|
address: t,
|
|
1089
1089
|
chainId: Number(n),
|
|
@@ -1091,19 +1091,19 @@ function ua(e) {
|
|
|
1091
1091
|
...s
|
|
1092
1092
|
};
|
|
1093
1093
|
}
|
|
1094
|
-
const
|
|
1095
|
-
function
|
|
1094
|
+
const js = "0x8010801080108010801080108010801080108010801080108010801080108010", Vs = on("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");
|
|
1095
|
+
function ln(e) {
|
|
1096
1096
|
if (typeof e == "string") {
|
|
1097
|
-
if (
|
|
1098
|
-
throw new
|
|
1097
|
+
if (L(e, -32) !== js)
|
|
1098
|
+
throw new Gs(e);
|
|
1099
1099
|
} else
|
|
1100
|
-
|
|
1100
|
+
fn(e.authorization);
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1103
|
-
|
|
1104
|
-
const t =
|
|
1102
|
+
function Ws(e) {
|
|
1103
|
+
ln(e);
|
|
1104
|
+
const t = kt(L(e, -64, -32)), n = L(e, -t - 64, -64), r = L(e, 0, -t - 64), [s, a, i] = Bs(Vs, n);
|
|
1105
1105
|
return {
|
|
1106
|
-
authorization:
|
|
1106
|
+
authorization: Ms({
|
|
1107
1107
|
address: s.delegation,
|
|
1108
1108
|
chainId: Number(s.chainId),
|
|
1109
1109
|
nonce: s.nonce,
|
|
@@ -1115,14 +1115,14 @@ function la(e) {
|
|
|
1115
1115
|
...i && i !== "0x" ? { data: i, to: a } : {}
|
|
1116
1116
|
};
|
|
1117
1117
|
}
|
|
1118
|
-
function
|
|
1118
|
+
function Hs(e) {
|
|
1119
1119
|
try {
|
|
1120
|
-
return
|
|
1120
|
+
return ln(e), !0;
|
|
1121
1121
|
} catch {
|
|
1122
1122
|
return !1;
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
|
-
let
|
|
1125
|
+
let Gs = class extends I {
|
|
1126
1126
|
constructor(t) {
|
|
1127
1127
|
super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`), Object.defineProperty(this, "name", {
|
|
1128
1128
|
enumerable: !0,
|
|
@@ -1132,7 +1132,7 @@ let pa = class extends B {
|
|
|
1132
1132
|
});
|
|
1133
1133
|
}
|
|
1134
1134
|
};
|
|
1135
|
-
function
|
|
1135
|
+
function ze(e) {
|
|
1136
1136
|
let t = !0, n = "", r = 0, s = "", a = !1;
|
|
1137
1137
|
for (let i = 0; i < e.length; i++) {
|
|
1138
1138
|
const o = e[i];
|
|
@@ -1154,14 +1154,14 @@ function Ve(e) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
1156
|
if (!a)
|
|
1157
|
-
throw new
|
|
1157
|
+
throw new I("Unable to normalize signature.");
|
|
1158
1158
|
return s;
|
|
1159
1159
|
}
|
|
1160
|
-
function
|
|
1160
|
+
function Fe(e, t) {
|
|
1161
1161
|
const n = typeof e, r = t.type;
|
|
1162
1162
|
switch (r) {
|
|
1163
1163
|
case "address":
|
|
1164
|
-
return
|
|
1164
|
+
return Re(e, { strict: !1 });
|
|
1165
1165
|
case "bool":
|
|
1166
1166
|
return n === "boolean";
|
|
1167
1167
|
case "function":
|
|
@@ -1169,42 +1169,42 @@ function qe(e, t) {
|
|
|
1169
1169
|
case "string":
|
|
1170
1170
|
return n === "string";
|
|
1171
1171
|
default:
|
|
1172
|
-
return r === "tuple" && "components" in t ? Object.values(t.components).every((s, a) =>
|
|
1172
|
+
return r === "tuple" && "components" in t ? Object.values(t.components).every((s, a) => Fe(Object.values(e)[a], s)) : /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r) ? n === "number" || n === "bigint" : /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r) ? n === "string" || e instanceof Uint8Array : /[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r) ? Array.isArray(e) && e.every((s) => Fe(s, {
|
|
1173
1173
|
...t,
|
|
1174
1174
|
// Pop off `[]` or `[M]` from end of type
|
|
1175
1175
|
type: r.replace(/(\[[0-9]{0,}\])$/, "")
|
|
1176
1176
|
})) : !1;
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1179
|
+
function hn(e, t, n) {
|
|
1180
1180
|
for (const r in e) {
|
|
1181
1181
|
const s = e[r], a = t[r];
|
|
1182
1182
|
if (s.type === "tuple" && a.type === "tuple" && "components" in s && "components" in a)
|
|
1183
|
-
return
|
|
1183
|
+
return hn(s.components, a.components, n[r]);
|
|
1184
1184
|
const i = [s.type, a.type];
|
|
1185
|
-
if (i.includes("address") && i.includes("bytes20") ? !0 : i.includes("address") && i.includes("string") ?
|
|
1185
|
+
if (i.includes("address") && i.includes("bytes20") ? !0 : i.includes("address") && i.includes("string") ? Re(n[r], {
|
|
1186
1186
|
strict: !1
|
|
1187
|
-
}) : i.includes("address") && i.includes("bytes") ?
|
|
1187
|
+
}) : i.includes("address") && i.includes("bytes") ? Re(n[r], {
|
|
1188
1188
|
strict: !1
|
|
1189
1189
|
}) : !1)
|
|
1190
1190
|
return i;
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1194
|
-
const { prepare: n = !0 } = t, r = Array.isArray(e) || typeof e == "string" ?
|
|
1193
|
+
function pn(e, t = {}) {
|
|
1194
|
+
const { prepare: n = !0 } = t, r = Array.isArray(e) || typeof e == "string" ? gt(e) : e;
|
|
1195
1195
|
return {
|
|
1196
1196
|
...r,
|
|
1197
|
-
...n ? { hash:
|
|
1197
|
+
...n ? { hash: J(r) } : {}
|
|
1198
1198
|
};
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const { args: r = [], prepare: s = !0 } = n ?? {}, a =
|
|
1200
|
+
function Ee(e, t, n) {
|
|
1201
|
+
const { args: r = [], prepare: s = !0 } = n ?? {}, a = Un(t, { strict: !1 }), i = e.filter((u) => a ? u.type === "function" || u.type === "error" ? mn(u) === L(t, 0, 4) : u.type === "event" ? J(u) === t : !1 : "name" in u && u.name === t);
|
|
1202
1202
|
if (i.length === 0)
|
|
1203
|
-
throw new
|
|
1203
|
+
throw new be({ name: t });
|
|
1204
1204
|
if (i.length === 1)
|
|
1205
1205
|
return {
|
|
1206
1206
|
...i[0],
|
|
1207
|
-
...s ? { hash:
|
|
1207
|
+
...s ? { hash: J(i[0]) } : {}
|
|
1208
1208
|
};
|
|
1209
1209
|
let o;
|
|
1210
1210
|
for (const u of i) {
|
|
@@ -1214,7 +1214,7 @@ function $e(e, t, n) {
|
|
|
1214
1214
|
if (!u.inputs || u.inputs.length === 0)
|
|
1215
1215
|
return {
|
|
1216
1216
|
...u,
|
|
1217
|
-
...s ? { hash:
|
|
1217
|
+
...s ? { hash: J(u) } : {}
|
|
1218
1218
|
};
|
|
1219
1219
|
continue;
|
|
1220
1220
|
}
|
|
@@ -1222,12 +1222,12 @@ function $e(e, t, n) {
|
|
|
1222
1222
|
continue;
|
|
1223
1223
|
if (r.every((d, l) => {
|
|
1224
1224
|
const h = "inputs" in u && u.inputs[l];
|
|
1225
|
-
return h ?
|
|
1225
|
+
return h ? Fe(d, h) : !1;
|
|
1226
1226
|
})) {
|
|
1227
1227
|
if (o && "inputs" in o && o.inputs) {
|
|
1228
|
-
const d =
|
|
1228
|
+
const d = hn(u.inputs, o.inputs, r);
|
|
1229
1229
|
if (d)
|
|
1230
|
-
throw new
|
|
1230
|
+
throw new Js({
|
|
1231
1231
|
abiItem: u,
|
|
1232
1232
|
type: d[0]
|
|
1233
1233
|
}, {
|
|
@@ -1245,49 +1245,49 @@ function $e(e, t, n) {
|
|
|
1245
1245
|
return { ...u, overloads: f };
|
|
1246
1246
|
})();
|
|
1247
1247
|
if (!c)
|
|
1248
|
-
throw new
|
|
1248
|
+
throw new be({ name: t });
|
|
1249
1249
|
return {
|
|
1250
1250
|
...c,
|
|
1251
|
-
...s ? { hash:
|
|
1251
|
+
...s ? { hash: J(c) } : {}
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function mn(...e) {
|
|
1255
1255
|
const t = (() => {
|
|
1256
1256
|
if (Array.isArray(e[0])) {
|
|
1257
1257
|
const [n, r] = e;
|
|
1258
|
-
return
|
|
1258
|
+
return Ee(n, r);
|
|
1259
1259
|
}
|
|
1260
1260
|
return e[0];
|
|
1261
1261
|
})();
|
|
1262
|
-
return
|
|
1262
|
+
return L(J(t), 0, 4);
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function Zs(...e) {
|
|
1265
1265
|
const t = (() => {
|
|
1266
1266
|
if (Array.isArray(e[0])) {
|
|
1267
1267
|
const [r, s] = e;
|
|
1268
|
-
return
|
|
1268
|
+
return Ee(r, s);
|
|
1269
1269
|
}
|
|
1270
1270
|
return e[0];
|
|
1271
|
-
})(), n = typeof t == "string" ? t :
|
|
1272
|
-
return
|
|
1271
|
+
})(), n = typeof t == "string" ? t : ke(t);
|
|
1272
|
+
return ze(n);
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function J(...e) {
|
|
1275
1275
|
const t = (() => {
|
|
1276
1276
|
if (Array.isArray(e[0])) {
|
|
1277
1277
|
const [n, r] = e;
|
|
1278
|
-
return
|
|
1278
|
+
return Ee(n, r);
|
|
1279
1279
|
}
|
|
1280
1280
|
return e[0];
|
|
1281
1281
|
})();
|
|
1282
|
-
return typeof t != "string" && "hash" in t && t.hash ? t.hash :
|
|
1282
|
+
return typeof t != "string" && "hash" in t && t.hash ? t.hash : rn(Ue(Zs(t)));
|
|
1283
1283
|
}
|
|
1284
|
-
class
|
|
1284
|
+
class Js extends I {
|
|
1285
1285
|
constructor(t, n) {
|
|
1286
1286
|
super("Found ambiguous types in overloaded ABI Items.", {
|
|
1287
1287
|
metaMessages: [
|
|
1288
1288
|
// TODO: abitype to add support for signature-formatted ABI items.
|
|
1289
|
-
`\`${t.type}\` in \`${
|
|
1290
|
-
`\`${n.type}\` in \`${
|
|
1289
|
+
`\`${t.type}\` in \`${ze(ke(t.abiItem))}\`, and`,
|
|
1290
|
+
`\`${n.type}\` in \`${ze(ke(n.abiItem))}\``,
|
|
1291
1291
|
"",
|
|
1292
1292
|
"These types encode differently and cannot be distinguished at runtime.",
|
|
1293
1293
|
"Remove one of the ambiguous items in the ABI."
|
|
@@ -1300,7 +1300,7 @@ class ba extends B {
|
|
|
1300
1300
|
});
|
|
1301
1301
|
}
|
|
1302
1302
|
}
|
|
1303
|
-
class
|
|
1303
|
+
class be extends I {
|
|
1304
1304
|
constructor({ name: t, data: n, type: r = "item" }) {
|
|
1305
1305
|
const s = t ? ` with name "${t}"` : n ? ` with data "${n}"` : "";
|
|
1306
1306
|
super(`ABI ${r}${s} not found.`), Object.defineProperty(this, "name", {
|
|
@@ -1311,72 +1311,72 @@ class Ae extends B {
|
|
|
1311
1311
|
});
|
|
1312
1312
|
}
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function Ys(...e) {
|
|
1315
1315
|
var a;
|
|
1316
1316
|
const [t, n] = (() => {
|
|
1317
1317
|
if (Array.isArray(e[0])) {
|
|
1318
1318
|
const [i, o] = e;
|
|
1319
|
-
return [
|
|
1319
|
+
return [Qs(i), o];
|
|
1320
1320
|
}
|
|
1321
1321
|
return e;
|
|
1322
1322
|
})(), { bytecode: r, args: s } = n;
|
|
1323
|
-
return
|
|
1323
|
+
return F(r, (a = t.inputs) != null && a.length && (s != null && s.length) ? Ke(t.inputs, s) : "0x");
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1326
|
-
return
|
|
1325
|
+
function Ks(e) {
|
|
1326
|
+
return pn(e);
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function Qs(e) {
|
|
1329
1329
|
const t = e.find((n) => n.type === "constructor");
|
|
1330
1330
|
if (!t)
|
|
1331
|
-
throw new
|
|
1331
|
+
throw new be({ name: "constructor" });
|
|
1332
1332
|
return t;
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1334
|
+
function Xs(...e) {
|
|
1335
1335
|
const [t, n = []] = (() => {
|
|
1336
1336
|
if (Array.isArray(e[0])) {
|
|
1337
1337
|
const [u, f, d] = e;
|
|
1338
|
-
return [
|
|
1338
|
+
return [Pt(u, f, { args: d }), d];
|
|
1339
1339
|
}
|
|
1340
1340
|
const [o, c] = e;
|
|
1341
1341
|
return [o, c];
|
|
1342
|
-
})(), { overloads: r } = t, s = r ?
|
|
1342
|
+
})(), { overloads: r } = t, s = r ? Pt([t, ...r], t.name, {
|
|
1343
1343
|
args: n
|
|
1344
|
-
}) : t, a =
|
|
1345
|
-
return i ?
|
|
1344
|
+
}) : t, a = ea(s), i = n.length > 0 ? Ke(s.inputs, n) : void 0;
|
|
1345
|
+
return i ? F(a, i) : a;
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1348
|
-
return
|
|
1347
|
+
function G(e, t = {}) {
|
|
1348
|
+
return pn(e, t);
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1351
|
-
const r =
|
|
1350
|
+
function Pt(e, t, n) {
|
|
1351
|
+
const r = Ee(e, t, n);
|
|
1352
1352
|
if (r.type !== "function")
|
|
1353
|
-
throw new
|
|
1353
|
+
throw new be({ name: t, type: "function" });
|
|
1354
1354
|
return r;
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1357
|
-
return
|
|
1356
|
+
function ea(e) {
|
|
1357
|
+
return mn(e);
|
|
1358
1358
|
}
|
|
1359
|
-
const
|
|
1360
|
-
function
|
|
1361
|
-
if (
|
|
1362
|
-
throw new
|
|
1359
|
+
const bn = "0x6492649264926492649264926492649264926492649264926492649264926492";
|
|
1360
|
+
function ta(e) {
|
|
1361
|
+
if (L(e, -32) !== bn)
|
|
1362
|
+
throw new sa(e);
|
|
1363
1363
|
}
|
|
1364
|
-
function
|
|
1364
|
+
function na(e) {
|
|
1365
1365
|
const { data: t, signature: n, to: r } = e;
|
|
1366
|
-
return
|
|
1366
|
+
return F(Ke(on("address, bytes, bytes"), [
|
|
1367
1367
|
r,
|
|
1368
1368
|
t,
|
|
1369
1369
|
n
|
|
1370
|
-
]),
|
|
1370
|
+
]), bn);
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1372
|
+
function ra(e) {
|
|
1373
1373
|
try {
|
|
1374
|
-
return
|
|
1374
|
+
return ta(e), !0;
|
|
1375
1375
|
} catch {
|
|
1376
1376
|
return !1;
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
|
-
class
|
|
1379
|
+
class sa extends I {
|
|
1380
1380
|
constructor(t) {
|
|
1381
1381
|
super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`), Object.defineProperty(this, "name", {
|
|
1382
1382
|
enumerable: !0,
|
|
@@ -1386,45 +1386,45 @@ class Ia extends B {
|
|
|
1386
1386
|
});
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
|
-
class
|
|
1389
|
+
class aa extends U {
|
|
1390
1390
|
constructor(t) {
|
|
1391
1391
|
super(`Filter type "${t}" is not supported.`, {
|
|
1392
1392
|
name: "FilterTypeNotSupportedError"
|
|
1393
1393
|
});
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
|
-
const
|
|
1397
|
-
function
|
|
1396
|
+
const It = "/docs/contract/encodeEventTopics";
|
|
1397
|
+
function fe(e) {
|
|
1398
1398
|
var c;
|
|
1399
1399
|
const { abi: t, eventName: n, args: r } = e;
|
|
1400
1400
|
let s = t[0];
|
|
1401
1401
|
if (n) {
|
|
1402
|
-
const u =
|
|
1402
|
+
const u = St({ abi: t, name: n });
|
|
1403
1403
|
if (!u)
|
|
1404
|
-
throw new
|
|
1404
|
+
throw new dt(n, { docsPath: It });
|
|
1405
1405
|
s = u;
|
|
1406
1406
|
}
|
|
1407
1407
|
if (s.type !== "event")
|
|
1408
|
-
throw new
|
|
1409
|
-
const a =
|
|
1408
|
+
throw new dt(void 0, { docsPath: It });
|
|
1409
|
+
const a = Dn(s), i = Mn(a);
|
|
1410
1410
|
let o = [];
|
|
1411
1411
|
if (r && "inputs" in s) {
|
|
1412
1412
|
const u = (c = s.inputs) == null ? void 0 : c.filter((d) => "indexed" in d && d.indexed), f = Array.isArray(r) ? r : Object.values(r).length > 0 ? (u == null ? void 0 : u.map((d) => r[d.name])) ?? [] : [];
|
|
1413
|
-
f.length > 0 && (o = (u == null ? void 0 : u.map((d, l) => Array.isArray(f[l]) ? f[l].map((h,
|
|
1413
|
+
f.length > 0 && (o = (u == null ? void 0 : u.map((d, l) => Array.isArray(f[l]) ? f[l].map((h, b) => Nt({ param: d, value: f[l][b] })) : typeof f[l] < "u" && f[l] !== null ? Nt({ param: d, value: f[l] }) : null)) ?? []);
|
|
1414
1414
|
}
|
|
1415
1415
|
return [i, ...o];
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function Nt({ param: e, value: t }) {
|
|
1418
1418
|
if (e.type === "string" || e.type === "bytes")
|
|
1419
|
-
return
|
|
1419
|
+
return he(Tt(t));
|
|
1420
1420
|
if (e.type === "tuple" || e.type.match(/^(.*)\[(\d+)?\]$/))
|
|
1421
|
-
throw new
|
|
1422
|
-
return
|
|
1421
|
+
throw new aa(e.type);
|
|
1422
|
+
return zt([e], [t]);
|
|
1423
1423
|
}
|
|
1424
|
-
async function
|
|
1425
|
-
const { address: n, abi: r, args: s, eventName: a, fromBlock: i, strict: o, toBlock: c } = t, u =
|
|
1424
|
+
async function gn(e, t) {
|
|
1425
|
+
const { address: n, abi: r, args: s, eventName: a, fromBlock: i, strict: o, toBlock: c } = t, u = De(e, {
|
|
1426
1426
|
method: "eth_newFilter"
|
|
1427
|
-
}), f = a ?
|
|
1427
|
+
}), f = a ? fe({
|
|
1428
1428
|
abi: r,
|
|
1429
1429
|
args: s,
|
|
1430
1430
|
eventName: a
|
|
@@ -1433,8 +1433,8 @@ async function In(e, t) {
|
|
|
1433
1433
|
params: [
|
|
1434
1434
|
{
|
|
1435
1435
|
address: n,
|
|
1436
|
-
fromBlock: typeof i == "bigint" ?
|
|
1437
|
-
toBlock: typeof c == "bigint" ?
|
|
1436
|
+
fromBlock: typeof i == "bigint" ? B(i) : i,
|
|
1437
|
+
toBlock: typeof c == "bigint" ? B(c) : c,
|
|
1438
1438
|
topics: f
|
|
1439
1439
|
}
|
|
1440
1440
|
]
|
|
@@ -1449,21 +1449,21 @@ async function In(e, t) {
|
|
|
1449
1449
|
type: "event"
|
|
1450
1450
|
};
|
|
1451
1451
|
}
|
|
1452
|
-
async function
|
|
1453
|
-
const { abi: n, address: r, args: s, functionName: a, dataSuffix: i, ...o } = t, c =
|
|
1452
|
+
async function ia(e, t) {
|
|
1453
|
+
const { abi: n, address: r, args: s, functionName: a, dataSuffix: i, ...o } = t, c = j({
|
|
1454
1454
|
abi: n,
|
|
1455
1455
|
args: s,
|
|
1456
1456
|
functionName: a
|
|
1457
1457
|
});
|
|
1458
1458
|
try {
|
|
1459
|
-
return await
|
|
1459
|
+
return await P(e, Ft, "estimateGas")({
|
|
1460
1460
|
data: `${c}${i ? i.replace("0x", "") : ""}`,
|
|
1461
1461
|
to: r,
|
|
1462
1462
|
...o
|
|
1463
1463
|
});
|
|
1464
1464
|
} catch (u) {
|
|
1465
|
-
const f = o.account ?
|
|
1466
|
-
throw
|
|
1465
|
+
const f = o.account ? ce(o.account) : void 0;
|
|
1466
|
+
throw Me(u, {
|
|
1467
1467
|
abi: n,
|
|
1468
1468
|
address: r,
|
|
1469
1469
|
args: s,
|
|
@@ -1473,12 +1473,12 @@ async function Na(e, t) {
|
|
|
1473
1473
|
});
|
|
1474
1474
|
}
|
|
1475
1475
|
}
|
|
1476
|
-
async function
|
|
1476
|
+
async function tt(e, { address: t, blockHash: n, fromBlock: r, toBlock: s, event: a, events: i, args: o, strict: c } = {}) {
|
|
1477
1477
|
const u = c ?? !1, f = i ?? (a ? [a] : void 0);
|
|
1478
1478
|
let d = [];
|
|
1479
|
-
f && (d = [f.flatMap((
|
|
1480
|
-
abi: [
|
|
1481
|
-
eventName:
|
|
1479
|
+
f && (d = [f.flatMap((w) => fe({
|
|
1480
|
+
abi: [w],
|
|
1481
|
+
eventName: w.name,
|
|
1482
1482
|
args: i ? void 0 : o
|
|
1483
1483
|
}))], a && (d = d[0]));
|
|
1484
1484
|
let l;
|
|
@@ -1491,22 +1491,22 @@ async function ft(e, { address: t, blockHash: n, fromBlock: r, toBlock: s, event
|
|
|
1491
1491
|
{
|
|
1492
1492
|
address: t,
|
|
1493
1493
|
topics: d,
|
|
1494
|
-
fromBlock: typeof r == "bigint" ?
|
|
1495
|
-
toBlock: typeof s == "bigint" ?
|
|
1494
|
+
fromBlock: typeof r == "bigint" ? B(r) : r,
|
|
1495
|
+
toBlock: typeof s == "bigint" ? B(s) : s
|
|
1496
1496
|
}
|
|
1497
1497
|
]
|
|
1498
1498
|
});
|
|
1499
|
-
const h = l.map((
|
|
1500
|
-
return f ?
|
|
1499
|
+
const h = l.map((b) => W(b));
|
|
1500
|
+
return f ? Ot({
|
|
1501
1501
|
abi: f,
|
|
1502
1502
|
args: o,
|
|
1503
1503
|
logs: h,
|
|
1504
1504
|
strict: u
|
|
1505
1505
|
}) : h;
|
|
1506
1506
|
}
|
|
1507
|
-
async function
|
|
1508
|
-
const { abi: n, address: r, args: s, blockHash: a, eventName: i, fromBlock: o, toBlock: c, strict: u } = t, f = i ?
|
|
1509
|
-
return
|
|
1507
|
+
async function yn(e, t) {
|
|
1508
|
+
const { abi: n, address: r, args: s, blockHash: a, eventName: i, fromBlock: o, toBlock: c, strict: u } = t, f = i ? St({ abi: n, name: i }) : void 0, d = f ? void 0 : n.filter((l) => l.type === "event");
|
|
1509
|
+
return P(e, tt, "getLogs")({
|
|
1510
1510
|
address: r,
|
|
1511
1511
|
args: s,
|
|
1512
1512
|
blockHash: a,
|
|
@@ -1517,16 +1517,16 @@ async function Bn(e, t) {
|
|
|
1517
1517
|
strict: u
|
|
1518
1518
|
});
|
|
1519
1519
|
}
|
|
1520
|
-
async function
|
|
1521
|
-
const { abi: n, address: r, args: s, dataSuffix: a, functionName: i, ...o } = t, c = o.account ?
|
|
1520
|
+
async function oa(e, t) {
|
|
1521
|
+
const { abi: n, address: r, args: s, dataSuffix: a, functionName: i, ...o } = t, c = o.account ? ce(o.account) : e.account, u = j({ abi: n, args: s, functionName: i });
|
|
1522
1522
|
try {
|
|
1523
|
-
const { data: f } = await
|
|
1523
|
+
const { data: f } = await P(e, qe, "call")({
|
|
1524
1524
|
batch: !1,
|
|
1525
1525
|
data: `${u}${a ? a.replace("0x", "") : ""}`,
|
|
1526
1526
|
to: r,
|
|
1527
1527
|
...o,
|
|
1528
1528
|
account: c
|
|
1529
|
-
}), d =
|
|
1529
|
+
}), d = ge({
|
|
1530
1530
|
abi: n,
|
|
1531
1531
|
args: s,
|
|
1532
1532
|
functionName: i,
|
|
@@ -1545,7 +1545,7 @@ async function Ca(e, t) {
|
|
|
1545
1545
|
}
|
|
1546
1546
|
};
|
|
1547
1547
|
} catch (f) {
|
|
1548
|
-
throw
|
|
1548
|
+
throw Me(f, {
|
|
1549
1549
|
abi: n,
|
|
1550
1550
|
address: r,
|
|
1551
1551
|
args: s,
|
|
@@ -1555,10 +1555,10 @@ async function Ca(e, t) {
|
|
|
1555
1555
|
});
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function ca(e, t) {
|
|
1559
1559
|
const { abi: n, address: r, args: s, batch: a = !0, eventName: i, fromBlock: o, onError: c, onLogs: u, poll: f, pollingInterval: d = e.pollingInterval, strict: l } = t;
|
|
1560
1560
|
return (typeof f < "u" ? f : typeof o == "bigint" ? !0 : !(e.transport.type === "webSocket" || e.transport.type === "ipc" || e.transport.type === "fallback" && (e.transport.transports[0].config.type === "webSocket" || e.transport.transports[0].config.type === "ipc"))) ? (() => {
|
|
1561
|
-
const p = l ?? !1, m =
|
|
1561
|
+
const p = l ?? !1, m = ae([
|
|
1562
1562
|
"watchContractEvent",
|
|
1563
1563
|
r,
|
|
1564
1564
|
s,
|
|
@@ -1569,15 +1569,15 @@ function Ta(e, t) {
|
|
|
1569
1569
|
p,
|
|
1570
1570
|
o
|
|
1571
1571
|
]);
|
|
1572
|
-
return
|
|
1573
|
-
let
|
|
1574
|
-
o !== void 0 && (
|
|
1575
|
-
let
|
|
1576
|
-
const
|
|
1577
|
-
var
|
|
1578
|
-
if (
|
|
1572
|
+
return ie(m, { onLogs: u, onError: c }, (y) => {
|
|
1573
|
+
let g;
|
|
1574
|
+
o !== void 0 && (g = o - 1n);
|
|
1575
|
+
let A, $ = !1;
|
|
1576
|
+
const C = ye(async () => {
|
|
1577
|
+
var x;
|
|
1578
|
+
if (!$) {
|
|
1579
1579
|
try {
|
|
1580
|
-
|
|
1580
|
+
A = await P(e, gn, "createContractEventFilter")({
|
|
1581
1581
|
abi: n,
|
|
1582
1582
|
address: r,
|
|
1583
1583
|
args: s,
|
|
@@ -1587,45 +1587,45 @@ function Ta(e, t) {
|
|
|
1587
1587
|
});
|
|
1588
1588
|
} catch {
|
|
1589
1589
|
}
|
|
1590
|
-
|
|
1590
|
+
$ = !0;
|
|
1591
1591
|
return;
|
|
1592
1592
|
}
|
|
1593
1593
|
try {
|
|
1594
1594
|
let E;
|
|
1595
|
-
if (
|
|
1596
|
-
E = await
|
|
1595
|
+
if (A)
|
|
1596
|
+
E = await P(e, je, "getFilterChanges")({ filter: A });
|
|
1597
1597
|
else {
|
|
1598
|
-
const
|
|
1599
|
-
|
|
1598
|
+
const N = await P(e, we, "getBlockNumber")({});
|
|
1599
|
+
g && g < N ? E = await P(e, yn, "getContractEvents")({
|
|
1600
1600
|
abi: n,
|
|
1601
1601
|
address: r,
|
|
1602
1602
|
args: s,
|
|
1603
1603
|
eventName: i,
|
|
1604
|
-
fromBlock:
|
|
1605
|
-
toBlock:
|
|
1604
|
+
fromBlock: g + 1n,
|
|
1605
|
+
toBlock: N,
|
|
1606
1606
|
strict: p
|
|
1607
|
-
}) : E = [],
|
|
1607
|
+
}) : E = [], g = N;
|
|
1608
1608
|
}
|
|
1609
1609
|
if (E.length === 0)
|
|
1610
1610
|
return;
|
|
1611
1611
|
if (a)
|
|
1612
|
-
|
|
1612
|
+
y.onLogs(E);
|
|
1613
1613
|
else
|
|
1614
|
-
for (const
|
|
1615
|
-
|
|
1614
|
+
for (const N of E)
|
|
1615
|
+
y.onLogs([N]);
|
|
1616
1616
|
} catch (E) {
|
|
1617
|
-
|
|
1617
|
+
A && E instanceof Lt && ($ = !1), (x = y.onError) == null || x.call(y, E);
|
|
1618
1618
|
}
|
|
1619
1619
|
}, {
|
|
1620
1620
|
emitOnBegin: !0,
|
|
1621
1621
|
interval: d
|
|
1622
1622
|
});
|
|
1623
1623
|
return async () => {
|
|
1624
|
-
|
|
1624
|
+
A && await P(e, Ve, "uninstallFilter")({ filter: A }), C();
|
|
1625
1625
|
};
|
|
1626
1626
|
});
|
|
1627
1627
|
})() : (() => {
|
|
1628
|
-
const p = l ?? !1, m =
|
|
1628
|
+
const p = l ?? !1, m = ae([
|
|
1629
1629
|
"watchContractEvent",
|
|
1630
1630
|
r,
|
|
1631
1631
|
s,
|
|
@@ -1635,64 +1635,64 @@ function Ta(e, t) {
|
|
|
1635
1635
|
d,
|
|
1636
1636
|
p
|
|
1637
1637
|
]);
|
|
1638
|
-
let
|
|
1639
|
-
return
|
|
1638
|
+
let y = !0, g = () => y = !1;
|
|
1639
|
+
return ie(m, { onLogs: u, onError: c }, (A) => ((async () => {
|
|
1640
1640
|
try {
|
|
1641
|
-
const
|
|
1641
|
+
const $ = (() => {
|
|
1642
1642
|
if (e.transport.type === "fallback") {
|
|
1643
|
-
const E = e.transport.transports.find((
|
|
1643
|
+
const E = e.transport.transports.find((N) => N.config.type === "webSocket" || N.config.type === "ipc");
|
|
1644
1644
|
return E ? E.value : e.transport;
|
|
1645
1645
|
}
|
|
1646
1646
|
return e.transport;
|
|
1647
|
-
})(),
|
|
1647
|
+
})(), C = i ? fe({
|
|
1648
1648
|
abi: n,
|
|
1649
1649
|
eventName: i,
|
|
1650
1650
|
args: s
|
|
1651
|
-
}) : [], { unsubscribe:
|
|
1652
|
-
params: ["logs", { address: r, topics:
|
|
1651
|
+
}) : [], { unsubscribe: x } = await $.subscribe({
|
|
1652
|
+
params: ["logs", { address: r, topics: C }],
|
|
1653
1653
|
onData(E) {
|
|
1654
|
-
var
|
|
1655
|
-
if (!
|
|
1654
|
+
var T;
|
|
1655
|
+
if (!y)
|
|
1656
1656
|
return;
|
|
1657
|
-
const
|
|
1657
|
+
const N = E.result;
|
|
1658
1658
|
try {
|
|
1659
|
-
const { eventName:
|
|
1659
|
+
const { eventName: k, args: R } = _t({
|
|
1660
1660
|
abi: n,
|
|
1661
|
-
data:
|
|
1662
|
-
topics:
|
|
1661
|
+
data: N.data,
|
|
1662
|
+
topics: N.topics,
|
|
1663
1663
|
strict: l
|
|
1664
|
-
}),
|
|
1665
|
-
args:
|
|
1666
|
-
eventName:
|
|
1664
|
+
}), z = W(N, {
|
|
1665
|
+
args: R,
|
|
1666
|
+
eventName: k
|
|
1667
1667
|
});
|
|
1668
|
-
|
|
1669
|
-
} catch (
|
|
1670
|
-
let
|
|
1671
|
-
if (
|
|
1668
|
+
A.onLogs([z]);
|
|
1669
|
+
} catch (k) {
|
|
1670
|
+
let R, z;
|
|
1671
|
+
if (k instanceof Ut || k instanceof Dt) {
|
|
1672
1672
|
if (l)
|
|
1673
1673
|
return;
|
|
1674
|
-
|
|
1674
|
+
R = k.abiItem.name, z = (T = k.abiItem.inputs) == null ? void 0 : T.some((de) => !("name" in de && de.name));
|
|
1675
1675
|
}
|
|
1676
|
-
const
|
|
1677
|
-
args:
|
|
1678
|
-
eventName:
|
|
1676
|
+
const Ie = W(N, {
|
|
1677
|
+
args: z ? [] : {},
|
|
1678
|
+
eventName: R
|
|
1679
1679
|
});
|
|
1680
|
-
|
|
1680
|
+
A.onLogs([Ie]);
|
|
1681
1681
|
}
|
|
1682
1682
|
},
|
|
1683
1683
|
onError(E) {
|
|
1684
|
-
var
|
|
1685
|
-
(
|
|
1684
|
+
var N;
|
|
1685
|
+
(N = A.onError) == null || N.call(A, E);
|
|
1686
1686
|
}
|
|
1687
1687
|
});
|
|
1688
|
-
|
|
1689
|
-
} catch (
|
|
1690
|
-
c == null || c(
|
|
1688
|
+
g = x, y || g();
|
|
1689
|
+
} catch ($) {
|
|
1690
|
+
c == null || c($);
|
|
1691
1691
|
}
|
|
1692
|
-
})(), () =>
|
|
1692
|
+
})(), () => g()));
|
|
1693
1693
|
})();
|
|
1694
1694
|
}
|
|
1695
|
-
class
|
|
1695
|
+
class ua extends U {
|
|
1696
1696
|
constructor(t) {
|
|
1697
1697
|
super(`Call bundle failed with status: ${t.statusCode}`, {
|
|
1698
1698
|
name: "BundleFailedError"
|
|
@@ -1704,21 +1704,21 @@ class $a extends F {
|
|
|
1704
1704
|
}), this.result = t;
|
|
1705
1705
|
}
|
|
1706
1706
|
}
|
|
1707
|
-
const
|
|
1707
|
+
const fa = "0x5792579257925792579257925792579257925792579257925792579257925792", da = B(0, {
|
|
1708
1708
|
size: 32
|
|
1709
1709
|
});
|
|
1710
|
-
async function
|
|
1710
|
+
async function la(e, t) {
|
|
1711
1711
|
async function n(f) {
|
|
1712
|
-
if (f.endsWith(
|
|
1713
|
-
const l =
|
|
1712
|
+
if (f.endsWith(fa.slice(2))) {
|
|
1713
|
+
const l = Mt(lt(f, -64, -32)), h = lt(f, 0, -64).slice(2).match(/.{1,64}/g), b = await Promise.all(h.map((p) => da.slice(2) !== p ? e.request({
|
|
1714
1714
|
method: "eth_getTransactionReceipt",
|
|
1715
1715
|
params: [`0x${p}`]
|
|
1716
|
-
}, { dedupe: !0 }) : void 0)),
|
|
1716
|
+
}, { dedupe: !0 }) : void 0)), w = b.some((p) => p === null) ? 100 : b.every((p) => (p == null ? void 0 : p.status) === "0x1") ? 200 : b.every((p) => (p == null ? void 0 : p.status) === "0x0") ? 500 : 600;
|
|
1717
1717
|
return {
|
|
1718
1718
|
atomic: !1,
|
|
1719
|
-
chainId:
|
|
1720
|
-
receipts:
|
|
1721
|
-
status:
|
|
1719
|
+
chainId: pe(l),
|
|
1720
|
+
receipts: b.filter(Boolean),
|
|
1721
|
+
status: w,
|
|
1722
1722
|
version: "2.0.0"
|
|
1723
1723
|
};
|
|
1724
1724
|
}
|
|
@@ -1735,50 +1735,50 @@ async function Ra(e, t) {
|
|
|
1735
1735
|
...o,
|
|
1736
1736
|
atomic: r,
|
|
1737
1737
|
// @ts-expect-error: for backwards compatibility
|
|
1738
|
-
chainId: s ?
|
|
1738
|
+
chainId: s ? pe(s) : void 0,
|
|
1739
1739
|
receipts: (a == null ? void 0 : a.map((f) => ({
|
|
1740
1740
|
...f,
|
|
1741
|
-
blockNumber:
|
|
1742
|
-
gasUsed:
|
|
1743
|
-
status:
|
|
1741
|
+
blockNumber: Q(f.blockNumber),
|
|
1742
|
+
gasUsed: Q(f.gasUsed),
|
|
1743
|
+
status: qn[f.status]
|
|
1744
1744
|
}))) ?? [],
|
|
1745
1745
|
statusCode: u,
|
|
1746
1746
|
status: c,
|
|
1747
1747
|
version: i
|
|
1748
1748
|
};
|
|
1749
1749
|
}
|
|
1750
|
-
async function
|
|
1750
|
+
async function gi(e, t) {
|
|
1751
1751
|
const {
|
|
1752
1752
|
id: n,
|
|
1753
1753
|
pollingInterval: r = e.pollingInterval,
|
|
1754
|
-
status: s = ({ statusCode:
|
|
1754
|
+
status: s = ({ statusCode: w }) => w === 200 || w >= 300,
|
|
1755
1755
|
retryCount: a = 4,
|
|
1756
|
-
retryDelay: i = ({ count:
|
|
1756
|
+
retryDelay: i = ({ count: w }) => ~~(1 << w) * 200,
|
|
1757
1757
|
// exponential backoff
|
|
1758
1758
|
timeout: o = 6e4,
|
|
1759
1759
|
throwOnFailure: c = !1
|
|
1760
|
-
} = t, u =
|
|
1760
|
+
} = t, u = ae(["waitForCallsStatus", e.uid, n]), { promise: f, resolve: d, reject: l } = jn();
|
|
1761
1761
|
let h;
|
|
1762
|
-
const
|
|
1763
|
-
const p =
|
|
1764
|
-
const m = (
|
|
1765
|
-
clearTimeout(h), p(),
|
|
1762
|
+
const b = ie(u, { resolve: d, reject: l }, (w) => {
|
|
1763
|
+
const p = ye(async () => {
|
|
1764
|
+
const m = (y) => {
|
|
1765
|
+
clearTimeout(h), p(), y(), b();
|
|
1766
1766
|
};
|
|
1767
1767
|
try {
|
|
1768
|
-
const
|
|
1769
|
-
const
|
|
1770
|
-
if (c &&
|
|
1771
|
-
throw new
|
|
1772
|
-
return
|
|
1768
|
+
const y = await Vn(async () => {
|
|
1769
|
+
const g = await P(e, la, "getCallsStatus")({ id: n });
|
|
1770
|
+
if (c && g.status === "failure")
|
|
1771
|
+
throw new ua(g);
|
|
1772
|
+
return g;
|
|
1773
1773
|
}, {
|
|
1774
1774
|
retryCount: a,
|
|
1775
1775
|
delay: i
|
|
1776
1776
|
});
|
|
1777
|
-
if (!s(
|
|
1777
|
+
if (!s(y))
|
|
1778
1778
|
return;
|
|
1779
|
-
m(() =>
|
|
1780
|
-
} catch (
|
|
1781
|
-
m(() =>
|
|
1779
|
+
m(() => w.resolve(y));
|
|
1780
|
+
} catch (y) {
|
|
1781
|
+
m(() => w.reject(y));
|
|
1782
1782
|
}
|
|
1783
1783
|
}, {
|
|
1784
1784
|
interval: r,
|
|
@@ -1787,65 +1787,65 @@ async function Zi(e, t) {
|
|
|
1787
1787
|
return p;
|
|
1788
1788
|
});
|
|
1789
1789
|
return h = o ? setTimeout(() => {
|
|
1790
|
-
|
|
1790
|
+
b(), clearTimeout(h), l(new ha({ id: n }));
|
|
1791
1791
|
}, o) : void 0, await f;
|
|
1792
1792
|
}
|
|
1793
|
-
class
|
|
1793
|
+
class ha extends U {
|
|
1794
1794
|
constructor({ id: t }) {
|
|
1795
1795
|
super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`, { name: "WaitForCallsStatusTimeoutError" });
|
|
1796
1796
|
}
|
|
1797
1797
|
}
|
|
1798
|
-
function
|
|
1798
|
+
function nt(e) {
|
|
1799
1799
|
var n, r, s, a, i, o;
|
|
1800
|
-
if (!(e instanceof
|
|
1800
|
+
if (!(e instanceof U))
|
|
1801
1801
|
return !1;
|
|
1802
|
-
const t = e.walk((c) => c instanceof
|
|
1803
|
-
return t instanceof
|
|
1802
|
+
const t = e.walk((c) => c instanceof ht);
|
|
1803
|
+
return t instanceof ht ? ((n = t.data) == null ? void 0 : n.errorName) === "HttpError" || ((r = t.data) == null ? void 0 : r.errorName) === "ResolverError" || ((s = t.data) == null ? void 0 : s.errorName) === "ResolverNotContract" || ((a = t.data) == null ? void 0 : a.errorName) === "ResolverNotFound" || ((i = t.data) == null ? void 0 : i.errorName) === "ReverseAddressMismatch" || ((o = t.data) == null ? void 0 : o.errorName) === "UnsupportedResolverProfile" : !1;
|
|
1804
1804
|
}
|
|
1805
|
-
function
|
|
1805
|
+
function wn(e) {
|
|
1806
1806
|
if (e.length !== 66 || e.indexOf("[") !== 0 || e.indexOf("]") !== 65)
|
|
1807
1807
|
return null;
|
|
1808
1808
|
const t = `0x${e.slice(1, 65)}`;
|
|
1809
|
-
return
|
|
1809
|
+
return qt(t) ? t : null;
|
|
1810
1810
|
}
|
|
1811
|
-
function
|
|
1811
|
+
function Oe(e) {
|
|
1812
1812
|
let t = new Uint8Array(32).fill(0);
|
|
1813
1813
|
if (!e)
|
|
1814
|
-
return
|
|
1814
|
+
return me(t);
|
|
1815
1815
|
const n = e.split(".");
|
|
1816
1816
|
for (let r = n.length - 1; r >= 0; r -= 1) {
|
|
1817
|
-
const s =
|
|
1818
|
-
t =
|
|
1817
|
+
const s = wn(n[r]), a = s ? Tt(s) : he(re(n[r]), "bytes");
|
|
1818
|
+
t = he(jt([t, a]), "bytes");
|
|
1819
1819
|
}
|
|
1820
|
-
return
|
|
1820
|
+
return me(t);
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1822
|
+
function pa(e) {
|
|
1823
1823
|
return `[${e.slice(2)}]`;
|
|
1824
1824
|
}
|
|
1825
|
-
function
|
|
1825
|
+
function ma(e) {
|
|
1826
1826
|
const t = new Uint8Array(32).fill(0);
|
|
1827
|
-
return e ?
|
|
1827
|
+
return e ? wn(e) || he(re(e)) : me(t);
|
|
1828
1828
|
}
|
|
1829
|
-
function
|
|
1829
|
+
function rt(e) {
|
|
1830
1830
|
const t = e.replace(/^\.|\.$/gm, "");
|
|
1831
1831
|
if (t.length === 0)
|
|
1832
1832
|
return new Uint8Array(1);
|
|
1833
|
-
const n = new Uint8Array(
|
|
1833
|
+
const n = new Uint8Array(re(t).byteLength + 2);
|
|
1834
1834
|
let r = 0;
|
|
1835
1835
|
const s = t.split(".");
|
|
1836
1836
|
for (let a = 0; a < s.length; a++) {
|
|
1837
|
-
let i =
|
|
1838
|
-
i.byteLength > 255 && (i =
|
|
1837
|
+
let i = re(s[a]);
|
|
1838
|
+
i.byteLength > 255 && (i = re(pa(ma(s[a])))), n[r] = i.length, n.set(i, r + 1), r += i.length + 1;
|
|
1839
1839
|
}
|
|
1840
1840
|
return n.byteLength !== r + 1 ? n.slice(0, r + 1) : n;
|
|
1841
1841
|
}
|
|
1842
|
-
async function
|
|
1842
|
+
async function ba(e, t) {
|
|
1843
1843
|
const { blockNumber: n, blockTag: r, coinType: s, name: a, gatewayUrls: i, strict: o } = t, { chain: c } = e, u = (() => {
|
|
1844
1844
|
if (t.universalResolverAddress)
|
|
1845
1845
|
return t.universalResolverAddress;
|
|
1846
1846
|
if (!c)
|
|
1847
1847
|
throw new Error("client chain not configured. universalResolverAddress is required.");
|
|
1848
|
-
return
|
|
1848
|
+
return ve({
|
|
1849
1849
|
blockNumber: n,
|
|
1850
1850
|
chain: c,
|
|
1851
1851
|
contract: "ensUniversalResolver"
|
|
@@ -1853,42 +1853,42 @@ async function Oa(e, t) {
|
|
|
1853
1853
|
})(), f = c == null ? void 0 : c.ensTlds;
|
|
1854
1854
|
if (f && !f.some((l) => a.endsWith(l)))
|
|
1855
1855
|
return null;
|
|
1856
|
-
const d = s != null ? [
|
|
1856
|
+
const d = s != null ? [Oe(a), BigInt(s)] : [Oe(a)];
|
|
1857
1857
|
try {
|
|
1858
|
-
const l =
|
|
1859
|
-
abi:
|
|
1858
|
+
const l = j({
|
|
1859
|
+
abi: pt,
|
|
1860
1860
|
functionName: "addr",
|
|
1861
1861
|
args: d
|
|
1862
1862
|
}), h = {
|
|
1863
1863
|
address: u,
|
|
1864
|
-
abi:
|
|
1864
|
+
abi: Vt,
|
|
1865
1865
|
functionName: "resolveWithGateways",
|
|
1866
1866
|
args: [
|
|
1867
|
-
|
|
1867
|
+
We(rt(a)),
|
|
1868
1868
|
l,
|
|
1869
|
-
i ?? [
|
|
1869
|
+
i ?? [Ge]
|
|
1870
1870
|
],
|
|
1871
1871
|
blockNumber: n,
|
|
1872
1872
|
blockTag: r
|
|
1873
|
-
},
|
|
1874
|
-
if (
|
|
1873
|
+
}, w = await P(e, _, "readContract")(h);
|
|
1874
|
+
if (w[0] === "0x")
|
|
1875
1875
|
return null;
|
|
1876
|
-
const p =
|
|
1877
|
-
abi:
|
|
1876
|
+
const p = ge({
|
|
1877
|
+
abi: pt,
|
|
1878
1878
|
args: d,
|
|
1879
1879
|
functionName: "addr",
|
|
1880
|
-
data:
|
|
1880
|
+
data: w[0]
|
|
1881
1881
|
});
|
|
1882
|
-
return p === "0x" ||
|
|
1882
|
+
return p === "0x" || Mt(p) === "0x00" ? null : p;
|
|
1883
1883
|
} catch (l) {
|
|
1884
1884
|
if (o)
|
|
1885
1885
|
throw l;
|
|
1886
|
-
if (
|
|
1886
|
+
if (nt(l))
|
|
1887
1887
|
return null;
|
|
1888
1888
|
throw l;
|
|
1889
1889
|
}
|
|
1890
1890
|
}
|
|
1891
|
-
class
|
|
1891
|
+
class ga extends U {
|
|
1892
1892
|
constructor({ data: t }) {
|
|
1893
1893
|
super("Unable to extract image from metadata. The metadata may be malformed or invalid.", {
|
|
1894
1894
|
metaMessages: [
|
|
@@ -1900,25 +1900,25 @@ class _a extends F {
|
|
|
1900
1900
|
});
|
|
1901
1901
|
}
|
|
1902
1902
|
}
|
|
1903
|
-
class
|
|
1903
|
+
class te extends U {
|
|
1904
1904
|
constructor({ reason: t }) {
|
|
1905
1905
|
super(`ENS NFT avatar URI is invalid. ${t}`, {
|
|
1906
1906
|
name: "EnsAvatarInvalidNftUriError"
|
|
1907
1907
|
});
|
|
1908
1908
|
}
|
|
1909
1909
|
}
|
|
1910
|
-
class
|
|
1910
|
+
class st extends U {
|
|
1911
1911
|
constructor({ uri: t }) {
|
|
1912
1912
|
super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`, { name: "EnsAvatarUriResolutionError" });
|
|
1913
1913
|
}
|
|
1914
1914
|
}
|
|
1915
|
-
class
|
|
1915
|
+
class ya extends U {
|
|
1916
1916
|
constructor({ namespace: t }) {
|
|
1917
1917
|
super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`, { name: "EnsAvatarUnsupportedNamespaceError" });
|
|
1918
1918
|
}
|
|
1919
1919
|
}
|
|
1920
|
-
const
|
|
1921
|
-
async function
|
|
1920
|
+
const wa = /(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/, va = /^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/, Aa = /^data:([a-zA-Z\-/+]*);base64,([^"].*)/, xa = /^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;
|
|
1921
|
+
async function Ea(e) {
|
|
1922
1922
|
try {
|
|
1923
1923
|
const t = await fetch(e, { method: "HEAD" });
|
|
1924
1924
|
if (t.status === 200) {
|
|
@@ -1937,14 +1937,14 @@ async function ja(e) {
|
|
|
1937
1937
|
});
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function Bt(e, t) {
|
|
1941
1941
|
return e ? e.endsWith("/") ? e.slice(0, -1) : e : t;
|
|
1942
1942
|
}
|
|
1943
|
-
function
|
|
1944
|
-
const n =
|
|
1943
|
+
function vn({ uri: e, gatewayUrls: t }) {
|
|
1944
|
+
const n = Aa.test(e);
|
|
1945
1945
|
if (n)
|
|
1946
1946
|
return { uri: e, isOnChain: !0, isEncoded: n };
|
|
1947
|
-
const r =
|
|
1947
|
+
const r = Bt(t == null ? void 0 : t.ipfs, "https://ipfs.io"), s = Bt(t == null ? void 0 : t.arweave, "https://arweave.net"), a = e.match(wa), { protocol: i, subpath: o, target: c, subtarget: u = "" } = (a == null ? void 0 : a.groups) || {}, f = i === "ipns:/" || o === "ipns/", d = i === "ipfs:/" || o === "ipfs/" || va.test(e);
|
|
1948
1948
|
if (e.startsWith("http") && !f && !d) {
|
|
1949
1949
|
let h = e;
|
|
1950
1950
|
return t != null && t.arweave && (h = e.replace(/https:\/\/arweave.net/g, t == null ? void 0 : t.arweave)), { uri: h, isOnChain: !1, isEncoded: !1 };
|
|
@@ -1961,53 +1961,53 @@ function Cn({ uri: e, gatewayUrls: t }) {
|
|
|
1961
1961
|
isOnChain: !1,
|
|
1962
1962
|
isEncoded: !1
|
|
1963
1963
|
};
|
|
1964
|
-
let l = e.replace(
|
|
1964
|
+
let l = e.replace(xa, "");
|
|
1965
1965
|
if (l.startsWith("<svg") && (l = `data:image/svg+xml;base64,${btoa(l)}`), l.startsWith("data:") || l.startsWith("{"))
|
|
1966
1966
|
return {
|
|
1967
1967
|
uri: l,
|
|
1968
1968
|
isOnChain: !0,
|
|
1969
1969
|
isEncoded: !1
|
|
1970
1970
|
};
|
|
1971
|
-
throw new
|
|
1971
|
+
throw new st({ uri: e });
|
|
1972
1972
|
}
|
|
1973
|
-
function
|
|
1973
|
+
function An(e) {
|
|
1974
1974
|
if (typeof e != "object" || !("image" in e) && !("image_url" in e) && !("image_data" in e))
|
|
1975
|
-
throw new
|
|
1975
|
+
throw new ga({ data: e });
|
|
1976
1976
|
return e.image || e.image_url || e.image_data;
|
|
1977
1977
|
}
|
|
1978
|
-
async function
|
|
1978
|
+
async function Pa({ gatewayUrls: e, uri: t }) {
|
|
1979
1979
|
try {
|
|
1980
1980
|
const n = await fetch(t).then((s) => s.json());
|
|
1981
|
-
return await
|
|
1981
|
+
return await at({
|
|
1982
1982
|
gatewayUrls: e,
|
|
1983
|
-
uri:
|
|
1983
|
+
uri: An(n)
|
|
1984
1984
|
});
|
|
1985
1985
|
} catch {
|
|
1986
|
-
throw new
|
|
1986
|
+
throw new st({ uri: t });
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
|
-
async function
|
|
1990
|
-
const { uri: n, isOnChain: r } =
|
|
1991
|
-
if (r || await
|
|
1989
|
+
async function at({ gatewayUrls: e, uri: t }) {
|
|
1990
|
+
const { uri: n, isOnChain: r } = vn({ uri: t, gatewayUrls: e });
|
|
1991
|
+
if (r || await Ea(n))
|
|
1992
1992
|
return n;
|
|
1993
|
-
throw new
|
|
1993
|
+
throw new st({ uri: t });
|
|
1994
1994
|
}
|
|
1995
|
-
function
|
|
1995
|
+
function Ia(e) {
|
|
1996
1996
|
let t = e;
|
|
1997
1997
|
t.startsWith("did:nft:") && (t = t.replace("did:nft:", "").replace(/_/g, "/"));
|
|
1998
1998
|
const [n, r, s] = t.split("/"), [a, i] = n.split(":"), [o, c] = r.split(":");
|
|
1999
1999
|
if (!a || a.toLowerCase() !== "eip155")
|
|
2000
|
-
throw new
|
|
2000
|
+
throw new te({ reason: "Only EIP-155 supported" });
|
|
2001
2001
|
if (!i)
|
|
2002
|
-
throw new
|
|
2002
|
+
throw new te({ reason: "Chain ID not found" });
|
|
2003
2003
|
if (!c)
|
|
2004
|
-
throw new
|
|
2004
|
+
throw new te({
|
|
2005
2005
|
reason: "Contract address not found"
|
|
2006
2006
|
});
|
|
2007
2007
|
if (!s)
|
|
2008
|
-
throw new
|
|
2008
|
+
throw new te({ reason: "Token ID not found" });
|
|
2009
2009
|
if (!o)
|
|
2010
|
-
throw new
|
|
2010
|
+
throw new te({ reason: "ERC namespace not found" });
|
|
2011
2011
|
return {
|
|
2012
2012
|
chainID: Number.parseInt(i, 10),
|
|
2013
2013
|
namespace: o.toLowerCase(),
|
|
@@ -2015,9 +2015,9 @@ function Ha(e) {
|
|
|
2015
2015
|
tokenID: s
|
|
2016
2016
|
};
|
|
2017
2017
|
}
|
|
2018
|
-
async function
|
|
2018
|
+
async function Na(e, { nft: t }) {
|
|
2019
2019
|
if (t.namespace === "erc721")
|
|
2020
|
-
return
|
|
2020
|
+
return _(e, {
|
|
2021
2021
|
address: t.contractAddress,
|
|
2022
2022
|
abi: [
|
|
2023
2023
|
{
|
|
@@ -2032,7 +2032,7 @@ async function Wa(e, { nft: t }) {
|
|
|
2032
2032
|
args: [BigInt(t.tokenID)]
|
|
2033
2033
|
});
|
|
2034
2034
|
if (t.namespace === "erc1155")
|
|
2035
|
-
return
|
|
2035
|
+
return _(e, {
|
|
2036
2036
|
address: t.contractAddress,
|
|
2037
2037
|
abi: [
|
|
2038
2038
|
{
|
|
@@ -2046,13 +2046,13 @@ async function Wa(e, { nft: t }) {
|
|
|
2046
2046
|
functionName: "uri",
|
|
2047
2047
|
args: [BigInt(t.tokenID)]
|
|
2048
2048
|
});
|
|
2049
|
-
throw new
|
|
2049
|
+
throw new ya({ namespace: t.namespace });
|
|
2050
2050
|
}
|
|
2051
|
-
async function
|
|
2052
|
-
return /eip155:/i.test(n) ?
|
|
2051
|
+
async function Ba(e, { gatewayUrls: t, record: n }) {
|
|
2052
|
+
return /eip155:/i.test(n) ? $a(e, { gatewayUrls: t, record: n }) : at({ uri: n, gatewayUrls: t });
|
|
2053
2053
|
}
|
|
2054
|
-
async function
|
|
2055
|
-
const r =
|
|
2054
|
+
async function $a(e, { gatewayUrls: t, record: n }) {
|
|
2055
|
+
const r = Ia(n), s = await Na(e, { nft: r }), { uri: a, isOnChain: i, isEncoded: o } = vn({ uri: s, gatewayUrls: t });
|
|
2056
2056
|
if (i && (a.includes("data:application/json;base64,") || a.startsWith("{"))) {
|
|
2057
2057
|
const u = o ? (
|
|
2058
2058
|
// if it is encoded, decode it
|
|
@@ -2061,21 +2061,21 @@ async function Ja(e, { gatewayUrls: t, record: n }) {
|
|
|
2061
2061
|
// if it isn't encoded assume it is a JSON string, but it could be anything (it will error if it is)
|
|
2062
2062
|
a
|
|
2063
2063
|
), f = JSON.parse(u);
|
|
2064
|
-
return
|
|
2064
|
+
return at({ uri: An(f), gatewayUrls: t });
|
|
2065
2065
|
}
|
|
2066
2066
|
let c = r.tokenID;
|
|
2067
|
-
return r.namespace === "erc1155" && (c = c.replace("0x", "").padStart(64, "0")),
|
|
2067
|
+
return r.namespace === "erc1155" && (c = c.replace("0x", "").padStart(64, "0")), Pa({
|
|
2068
2068
|
gatewayUrls: t,
|
|
2069
2069
|
uri: a.replace(/(?:0x)?{id}/, c)
|
|
2070
2070
|
});
|
|
2071
2071
|
}
|
|
2072
|
-
async function
|
|
2072
|
+
async function xn(e, t) {
|
|
2073
2073
|
const { blockNumber: n, blockTag: r, key: s, name: a, gatewayUrls: i, strict: o } = t, { chain: c } = e, u = (() => {
|
|
2074
2074
|
if (t.universalResolverAddress)
|
|
2075
2075
|
return t.universalResolverAddress;
|
|
2076
2076
|
if (!c)
|
|
2077
2077
|
throw new Error("client chain not configured. universalResolverAddress is required.");
|
|
2078
|
-
return
|
|
2078
|
+
return ve({
|
|
2079
2079
|
blockNumber: n,
|
|
2080
2080
|
chain: c,
|
|
2081
2081
|
contract: "ensUniversalResolver"
|
|
@@ -2086,38 +2086,38 @@ async function $n(e, t) {
|
|
|
2086
2086
|
try {
|
|
2087
2087
|
const d = {
|
|
2088
2088
|
address: u,
|
|
2089
|
-
abi:
|
|
2089
|
+
abi: Vt,
|
|
2090
2090
|
args: [
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
abi:
|
|
2091
|
+
We(rt(a)),
|
|
2092
|
+
j({
|
|
2093
|
+
abi: mt,
|
|
2094
2094
|
functionName: "text",
|
|
2095
|
-
args: [
|
|
2095
|
+
args: [Oe(a), s]
|
|
2096
2096
|
}),
|
|
2097
|
-
i ?? [
|
|
2097
|
+
i ?? [Ge]
|
|
2098
2098
|
],
|
|
2099
2099
|
functionName: "resolveWithGateways",
|
|
2100
2100
|
blockNumber: n,
|
|
2101
2101
|
blockTag: r
|
|
2102
|
-
}, h = await
|
|
2102
|
+
}, h = await P(e, _, "readContract")(d);
|
|
2103
2103
|
if (h[0] === "0x")
|
|
2104
2104
|
return null;
|
|
2105
|
-
const
|
|
2106
|
-
abi:
|
|
2105
|
+
const b = ge({
|
|
2106
|
+
abi: mt,
|
|
2107
2107
|
functionName: "text",
|
|
2108
2108
|
data: h[0]
|
|
2109
2109
|
});
|
|
2110
|
-
return
|
|
2110
|
+
return b === "" ? null : b;
|
|
2111
2111
|
} catch (d) {
|
|
2112
2112
|
if (o)
|
|
2113
2113
|
throw d;
|
|
2114
|
-
if (
|
|
2114
|
+
if (nt(d))
|
|
2115
2115
|
return null;
|
|
2116
2116
|
throw d;
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
|
-
async function
|
|
2120
|
-
const c = await
|
|
2119
|
+
async function Ca(e, { blockNumber: t, blockTag: n, assetGatewayUrls: r, name: s, gatewayUrls: a, strict: i, universalResolverAddress: o }) {
|
|
2120
|
+
const c = await P(e, xn, "getEnsText")({
|
|
2121
2121
|
blockNumber: t,
|
|
2122
2122
|
blockTag: n,
|
|
2123
2123
|
key: "avatar",
|
|
@@ -2129,7 +2129,7 @@ async function Ya(e, { blockNumber: t, blockTag: n, assetGatewayUrls: r, name: s
|
|
|
2129
2129
|
if (!c)
|
|
2130
2130
|
return null;
|
|
2131
2131
|
try {
|
|
2132
|
-
return await
|
|
2132
|
+
return await Ba(e, {
|
|
2133
2133
|
record: c,
|
|
2134
2134
|
gatewayUrls: r
|
|
2135
2135
|
});
|
|
@@ -2137,13 +2137,13 @@ async function Ya(e, { blockNumber: t, blockTag: n, assetGatewayUrls: r, name: s
|
|
|
2137
2137
|
return null;
|
|
2138
2138
|
}
|
|
2139
2139
|
}
|
|
2140
|
-
async function
|
|
2140
|
+
async function ka(e, t) {
|
|
2141
2141
|
const { address: n, blockNumber: r, blockTag: s, coinType: a = 60n, gatewayUrls: i, strict: o } = t, { chain: c } = e, u = (() => {
|
|
2142
2142
|
if (t.universalResolverAddress)
|
|
2143
2143
|
return t.universalResolverAddress;
|
|
2144
2144
|
if (!c)
|
|
2145
2145
|
throw new Error("client chain not configured. universalResolverAddress is required.");
|
|
2146
|
-
return
|
|
2146
|
+
return ve({
|
|
2147
2147
|
blockNumber: r,
|
|
2148
2148
|
chain: c,
|
|
2149
2149
|
contract: "ensUniversalResolver"
|
|
@@ -2152,28 +2152,28 @@ async function Ka(e, t) {
|
|
|
2152
2152
|
try {
|
|
2153
2153
|
const f = {
|
|
2154
2154
|
address: u,
|
|
2155
|
-
abi:
|
|
2156
|
-
args: [n, a, i ?? [
|
|
2155
|
+
abi: Wn,
|
|
2156
|
+
args: [n, a, i ?? [Ge]],
|
|
2157
2157
|
functionName: "reverseWithGateways",
|
|
2158
2158
|
blockNumber: r,
|
|
2159
2159
|
blockTag: s
|
|
2160
|
-
}, d =
|
|
2160
|
+
}, d = P(e, _, "readContract"), [l] = await d(f);
|
|
2161
2161
|
return l || null;
|
|
2162
2162
|
} catch (f) {
|
|
2163
2163
|
if (o)
|
|
2164
2164
|
throw f;
|
|
2165
|
-
if (
|
|
2165
|
+
if (nt(f))
|
|
2166
2166
|
return null;
|
|
2167
2167
|
throw f;
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
2170
|
-
async function
|
|
2170
|
+
async function Ra(e, t) {
|
|
2171
2171
|
const { blockNumber: n, blockTag: r, name: s } = t, { chain: a } = e, i = (() => {
|
|
2172
2172
|
if (t.universalResolverAddress)
|
|
2173
2173
|
return t.universalResolverAddress;
|
|
2174
2174
|
if (!a)
|
|
2175
2175
|
throw new Error("client chain not configured. universalResolverAddress is required.");
|
|
2176
|
-
return
|
|
2176
|
+
return ve({
|
|
2177
2177
|
blockNumber: n,
|
|
2178
2178
|
chain: a,
|
|
2179
2179
|
contract: "ensUniversalResolver"
|
|
@@ -2181,7 +2181,7 @@ async function Qa(e, t) {
|
|
|
2181
2181
|
})(), o = a == null ? void 0 : a.ensTlds;
|
|
2182
2182
|
if (o && !o.some((u) => s.endsWith(u)))
|
|
2183
2183
|
throw new Error(`${s} is not a valid ENS TLD (${o == null ? void 0 : o.join(", ")}) for chain "${a.name}" (id: ${a.id}).`);
|
|
2184
|
-
const [c] = await
|
|
2184
|
+
const [c] = await P(e, _, "readContract")({
|
|
2185
2185
|
address: i,
|
|
2186
2186
|
abi: [
|
|
2187
2187
|
{
|
|
@@ -2197,21 +2197,21 @@ async function Qa(e, t) {
|
|
|
2197
2197
|
}
|
|
2198
2198
|
],
|
|
2199
2199
|
functionName: "findResolver",
|
|
2200
|
-
args: [
|
|
2200
|
+
args: [We(rt(s))],
|
|
2201
2201
|
blockNumber: n,
|
|
2202
2202
|
blockTag: r
|
|
2203
2203
|
});
|
|
2204
2204
|
return c;
|
|
2205
2205
|
}
|
|
2206
|
-
async function
|
|
2207
|
-
var p, m,
|
|
2208
|
-
const { account: n = e.account, blockNumber: r, blockTag: s = "latest", blobs: a, data: i, gas: o, gasPrice: c, maxFeePerBlobGas: u, maxFeePerGas: f, maxPriorityFeePerGas: d, to: l, value: h, ...
|
|
2206
|
+
async function En(e, t) {
|
|
2207
|
+
var p, m, y;
|
|
2208
|
+
const { account: n = e.account, blockNumber: r, blockTag: s = "latest", blobs: a, data: i, gas: o, gasPrice: c, maxFeePerBlobGas: u, maxFeePerGas: f, maxPriorityFeePerGas: d, to: l, value: h, ...b } = t, w = n ? ce(n) : void 0;
|
|
2209
2209
|
try {
|
|
2210
|
-
|
|
2211
|
-
const
|
|
2210
|
+
Wt(t);
|
|
2211
|
+
const A = (typeof r == "bigint" ? B(r) : void 0) || s, $ = (y = (m = (p = e.chain) == null ? void 0 : p.formatters) == null ? void 0 : m.transactionRequest) == null ? void 0 : y.format, x = ($ || Ht)({
|
|
2212
2212
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
2213
|
-
...
|
|
2214
|
-
account:
|
|
2213
|
+
...Hn(b, { format: $ }),
|
|
2214
|
+
account: w,
|
|
2215
2215
|
blobs: a,
|
|
2216
2216
|
data: i,
|
|
2217
2217
|
gas: o,
|
|
@@ -2223,34 +2223,34 @@ async function kn(e, t) {
|
|
|
2223
2223
|
value: h
|
|
2224
2224
|
}, "createAccessList"), E = await e.request({
|
|
2225
2225
|
method: "eth_createAccessList",
|
|
2226
|
-
params: [
|
|
2226
|
+
params: [x, A]
|
|
2227
2227
|
});
|
|
2228
2228
|
return {
|
|
2229
2229
|
accessList: E.accessList,
|
|
2230
2230
|
gasUsed: BigInt(E.gasUsed)
|
|
2231
2231
|
};
|
|
2232
|
-
} catch (
|
|
2233
|
-
throw
|
|
2232
|
+
} catch (g) {
|
|
2233
|
+
throw Gn(g, {
|
|
2234
2234
|
...t,
|
|
2235
|
-
account:
|
|
2235
|
+
account: w,
|
|
2236
2236
|
chain: e.chain
|
|
2237
2237
|
});
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
|
-
async function
|
|
2241
|
-
const t =
|
|
2240
|
+
async function Sa(e) {
|
|
2241
|
+
const t = De(e, {
|
|
2242
2242
|
method: "eth_newBlockFilter"
|
|
2243
2243
|
}), n = await e.request({
|
|
2244
2244
|
method: "eth_newBlockFilter"
|
|
2245
2245
|
});
|
|
2246
2246
|
return { id: n, request: t(n), type: "block" };
|
|
2247
2247
|
}
|
|
2248
|
-
async function
|
|
2249
|
-
const c = s ?? (r ? [r] : void 0), u =
|
|
2248
|
+
async function Pn(e, { address: t, args: n, event: r, events: s, fromBlock: a, strict: i, toBlock: o } = {}) {
|
|
2249
|
+
const c = s ?? (r ? [r] : void 0), u = De(e, {
|
|
2250
2250
|
method: "eth_newFilter"
|
|
2251
2251
|
});
|
|
2252
2252
|
let f = [];
|
|
2253
|
-
c && (f = [c.flatMap((h) =>
|
|
2253
|
+
c && (f = [c.flatMap((h) => fe({
|
|
2254
2254
|
abi: [h],
|
|
2255
2255
|
eventName: h.name,
|
|
2256
2256
|
args: n
|
|
@@ -2260,8 +2260,8 @@ async function zn(e, { address: t, args: n, event: r, events: s, fromBlock: a, s
|
|
|
2260
2260
|
params: [
|
|
2261
2261
|
{
|
|
2262
2262
|
address: t,
|
|
2263
|
-
fromBlock: typeof a == "bigint" ?
|
|
2264
|
-
toBlock: typeof o == "bigint" ?
|
|
2263
|
+
fromBlock: typeof a == "bigint" ? B(a) : a,
|
|
2264
|
+
toBlock: typeof o == "bigint" ? B(o) : o,
|
|
2265
2265
|
...f.length ? { topics: f } : {}
|
|
2266
2266
|
}
|
|
2267
2267
|
]
|
|
@@ -2278,14 +2278,14 @@ async function zn(e, { address: t, args: n, event: r, events: s, fromBlock: a, s
|
|
|
2278
2278
|
type: "event"
|
|
2279
2279
|
};
|
|
2280
2280
|
}
|
|
2281
|
-
async function
|
|
2281
|
+
async function Ta(e) {
|
|
2282
2282
|
const t = await e.request({
|
|
2283
2283
|
method: "eth_blobBaseFee"
|
|
2284
2284
|
});
|
|
2285
2285
|
return BigInt(t);
|
|
2286
2286
|
}
|
|
2287
|
-
async function
|
|
2288
|
-
const s = n !== void 0 ?
|
|
2287
|
+
async function za(e, { blockHash: t, blockNumber: n, blockTag: r = "latest" } = {}) {
|
|
2288
|
+
const s = n !== void 0 ? B(n) : void 0;
|
|
2289
2289
|
let a;
|
|
2290
2290
|
return t ? a = await e.request({
|
|
2291
2291
|
method: "eth_getBlockTransactionCountByHash",
|
|
@@ -2293,17 +2293,17 @@ async function ti(e, { blockHash: t, blockNumber: n, blockTag: r = "latest" } =
|
|
|
2293
2293
|
}, { dedupe: !0 }) : a = await e.request({
|
|
2294
2294
|
method: "eth_getBlockTransactionCountByNumber",
|
|
2295
2295
|
params: [s || r]
|
|
2296
|
-
}, { dedupe: !!s }),
|
|
2296
|
+
}, { dedupe: !!s }), pe(a);
|
|
2297
2297
|
}
|
|
2298
|
-
async function
|
|
2299
|
-
const s = n !== void 0 ?
|
|
2298
|
+
async function Le(e, { address: t, blockNumber: n, blockTag: r = "latest" }) {
|
|
2299
|
+
const s = n !== void 0 ? B(n) : void 0, a = await e.request({
|
|
2300
2300
|
method: "eth_getCode",
|
|
2301
2301
|
params: [t, s || r]
|
|
2302
2302
|
}, { dedupe: !!s });
|
|
2303
2303
|
if (a !== "0x")
|
|
2304
2304
|
return a;
|
|
2305
2305
|
}
|
|
2306
|
-
class
|
|
2306
|
+
class Fa extends U {
|
|
2307
2307
|
constructor({ address: t }) {
|
|
2308
2308
|
super(`No EIP-712 domain found on contract "${t}".`, {
|
|
2309
2309
|
metaMessages: [
|
|
@@ -2316,11 +2316,11 @@ class ni extends F {
|
|
|
2316
2316
|
});
|
|
2317
2317
|
}
|
|
2318
2318
|
}
|
|
2319
|
-
async function
|
|
2319
|
+
async function Oa(e, t) {
|
|
2320
2320
|
const { address: n, factory: r, factoryData: s } = t;
|
|
2321
2321
|
try {
|
|
2322
|
-
const [a, i, o, c, u, f, d] = await
|
|
2323
|
-
abi:
|
|
2322
|
+
const [a, i, o, c, u, f, d] = await P(e, _, "readContract")({
|
|
2323
|
+
abi: La,
|
|
2324
2324
|
address: n,
|
|
2325
2325
|
functionName: "eip712Domain",
|
|
2326
2326
|
factory: r,
|
|
@@ -2339,10 +2339,10 @@ async function ri(e, t) {
|
|
|
2339
2339
|
};
|
|
2340
2340
|
} catch (a) {
|
|
2341
2341
|
const i = a;
|
|
2342
|
-
throw i.name === "ContractFunctionExecutionError" && i.cause.name === "ContractFunctionZeroDataError" ? new
|
|
2342
|
+
throw i.name === "ContractFunctionExecutionError" && i.cause.name === "ContractFunctionZeroDataError" ? new Fa({ address: n }) : i;
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
|
-
const
|
|
2345
|
+
const La = [
|
|
2346
2346
|
{
|
|
2347
2347
|
inputs: [],
|
|
2348
2348
|
name: "eip712Domain",
|
|
@@ -2359,7 +2359,7 @@ const si = [
|
|
|
2359
2359
|
type: "function"
|
|
2360
2360
|
}
|
|
2361
2361
|
];
|
|
2362
|
-
function
|
|
2362
|
+
function _a(e) {
|
|
2363
2363
|
var t;
|
|
2364
2364
|
return {
|
|
2365
2365
|
baseFeePerGas: e.baseFeePerGas.map((n) => BigInt(n)),
|
|
@@ -2368,341 +2368,91 @@ function ai(e) {
|
|
|
2368
2368
|
reward: (t = e.reward) == null ? void 0 : t.map((n) => n.map((r) => BigInt(r)))
|
|
2369
2369
|
};
|
|
2370
2370
|
}
|
|
2371
|
-
async function
|
|
2372
|
-
const a = typeof n == "bigint" ?
|
|
2371
|
+
async function Ua(e, { blockCount: t, blockNumber: n, blockTag: r = "latest", rewardPercentiles: s }) {
|
|
2372
|
+
const a = typeof n == "bigint" ? B(n) : void 0, i = await e.request({
|
|
2373
2373
|
method: "eth_feeHistory",
|
|
2374
2374
|
params: [
|
|
2375
|
-
|
|
2375
|
+
B(t),
|
|
2376
2376
|
a || r,
|
|
2377
2377
|
s
|
|
2378
2378
|
]
|
|
2379
2379
|
}, { dedupe: !!a });
|
|
2380
|
-
return
|
|
2380
|
+
return _a(i);
|
|
2381
2381
|
}
|
|
2382
|
-
async function
|
|
2382
|
+
async function Da(e, { filter: t }) {
|
|
2383
2383
|
const n = t.strict ?? !1, s = (await t.request({
|
|
2384
2384
|
method: "eth_getFilterLogs",
|
|
2385
2385
|
params: [t.id]
|
|
2386
|
-
})).map((a) =>
|
|
2387
|
-
return t.abi ?
|
|
2386
|
+
})).map((a) => W(a));
|
|
2387
|
+
return t.abi ? Ot({
|
|
2388
2388
|
abi: t.abi,
|
|
2389
2389
|
logs: s,
|
|
2390
2390
|
strict: n
|
|
2391
2391
|
}) : s;
|
|
2392
2392
|
}
|
|
2393
|
-
function
|
|
2393
|
+
function yi(e, t) {
|
|
2394
2394
|
if (e.length !== t.length)
|
|
2395
|
-
throw new
|
|
2395
|
+
throw new Zn({
|
|
2396
2396
|
expectedLength: e.length,
|
|
2397
2397
|
givenLength: t.length
|
|
2398
2398
|
});
|
|
2399
2399
|
const n = [];
|
|
2400
2400
|
for (let r = 0; r < e.length; r++) {
|
|
2401
2401
|
const s = e[r], a = t[r];
|
|
2402
|
-
n.push(
|
|
2402
|
+
n.push(In(s, a));
|
|
2403
2403
|
}
|
|
2404
|
-
return
|
|
2404
|
+
return Ae(n);
|
|
2405
2405
|
}
|
|
2406
|
-
function
|
|
2406
|
+
function In(e, t, n = !1) {
|
|
2407
2407
|
if (e === "address") {
|
|
2408
2408
|
const i = t;
|
|
2409
|
-
if (!
|
|
2410
|
-
throw new
|
|
2411
|
-
return
|
|
2409
|
+
if (!Gt(i))
|
|
2410
|
+
throw new Jn({ address: i });
|
|
2411
|
+
return Be(i.toLowerCase(), {
|
|
2412
2412
|
size: n ? 32 : null
|
|
2413
2413
|
});
|
|
2414
2414
|
}
|
|
2415
2415
|
if (e === "string")
|
|
2416
|
-
return
|
|
2416
|
+
return Yn(t);
|
|
2417
2417
|
if (e === "bytes")
|
|
2418
2418
|
return t;
|
|
2419
2419
|
if (e === "bool")
|
|
2420
|
-
return
|
|
2421
|
-
const r = e.match(
|
|
2420
|
+
return Be(Kn(t), { size: n ? 32 : 1 });
|
|
2421
|
+
const r = e.match(Qn);
|
|
2422
2422
|
if (r) {
|
|
2423
2423
|
const [i, o, c = "256"] = r, u = Number.parseInt(c, 10) / 8;
|
|
2424
|
-
return
|
|
2424
|
+
return B(t, {
|
|
2425
2425
|
size: n ? 32 : u,
|
|
2426
2426
|
signed: o === "int"
|
|
2427
2427
|
});
|
|
2428
2428
|
}
|
|
2429
|
-
const s = e.match(
|
|
2429
|
+
const s = e.match(Xn);
|
|
2430
2430
|
if (s) {
|
|
2431
2431
|
const [i, o] = s;
|
|
2432
2432
|
if (Number.parseInt(o, 10) !== (t.length - 2) / 2)
|
|
2433
|
-
throw new
|
|
2433
|
+
throw new er({
|
|
2434
2434
|
expectedSize: Number.parseInt(o, 10),
|
|
2435
2435
|
givenSize: (t.length - 2) / 2
|
|
2436
2436
|
});
|
|
2437
|
-
return
|
|
2437
|
+
return Be(t, { dir: "right", size: n ? 32 : null });
|
|
2438
2438
|
}
|
|
2439
|
-
const a = e.match(
|
|
2439
|
+
const a = e.match(tr);
|
|
2440
2440
|
if (a && Array.isArray(t)) {
|
|
2441
2441
|
const [i, o] = a, c = [];
|
|
2442
2442
|
for (let u = 0; u < t.length; u++)
|
|
2443
|
-
c.push(
|
|
2444
|
-
return c.length === 0 ? "0x" :
|
|
2445
|
-
}
|
|
2446
|
-
throw new ur(e);
|
|
2447
|
-
}
|
|
2448
|
-
function ci(e) {
|
|
2449
|
-
const { authorizationList: t } = e;
|
|
2450
|
-
if (t)
|
|
2451
|
-
for (const n of t) {
|
|
2452
|
-
const { chainId: r } = n, s = n.address;
|
|
2453
|
-
if (!Z(s))
|
|
2454
|
-
throw new se({ address: s });
|
|
2455
|
-
if (r < 0)
|
|
2456
|
-
throw new Ce({ chainId: r });
|
|
2457
|
-
}
|
|
2458
|
-
mt(e);
|
|
2459
|
-
}
|
|
2460
|
-
function ui(e) {
|
|
2461
|
-
const { blobVersionedHashes: t } = e;
|
|
2462
|
-
if (t) {
|
|
2463
|
-
if (t.length === 0)
|
|
2464
|
-
throw new dr();
|
|
2465
|
-
for (const n of t) {
|
|
2466
|
-
const r = lr(n), s = le(hr(n, 0, 1));
|
|
2467
|
-
if (r !== 32)
|
|
2468
|
-
throw new pr({ hash: n, size: r });
|
|
2469
|
-
if (s !== mr)
|
|
2470
|
-
throw new br({
|
|
2471
|
-
hash: n,
|
|
2472
|
-
version: s
|
|
2473
|
-
});
|
|
2474
|
-
}
|
|
2475
|
-
}
|
|
2476
|
-
mt(e);
|
|
2477
|
-
}
|
|
2478
|
-
function mt(e) {
|
|
2479
|
-
const { chainId: t, maxPriorityFeePerGas: n, maxFeePerGas: r, to: s } = e;
|
|
2480
|
-
if (t <= 0)
|
|
2481
|
-
throw new Ce({ chainId: t });
|
|
2482
|
-
if (s && !Z(s))
|
|
2483
|
-
throw new se({ address: s });
|
|
2484
|
-
if (r && r > Xe)
|
|
2485
|
-
throw new et({ maxFeePerGas: r });
|
|
2486
|
-
if (n && r && n > r)
|
|
2487
|
-
throw new fr({ maxFeePerGas: r, maxPriorityFeePerGas: n });
|
|
2488
|
-
}
|
|
2489
|
-
function fi(e) {
|
|
2490
|
-
const { chainId: t, maxPriorityFeePerGas: n, gasPrice: r, maxFeePerGas: s, to: a } = e;
|
|
2491
|
-
if (t <= 0)
|
|
2492
|
-
throw new Ce({ chainId: t });
|
|
2493
|
-
if (a && !Z(a))
|
|
2494
|
-
throw new se({ address: a });
|
|
2495
|
-
if (n || s)
|
|
2496
|
-
throw new F("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
|
|
2497
|
-
if (r && r > Xe)
|
|
2498
|
-
throw new et({ maxFeePerGas: r });
|
|
2499
|
-
}
|
|
2500
|
-
function di(e) {
|
|
2501
|
-
const { chainId: t, maxPriorityFeePerGas: n, gasPrice: r, maxFeePerGas: s, to: a } = e;
|
|
2502
|
-
if (a && !Z(a))
|
|
2503
|
-
throw new se({ address: a });
|
|
2504
|
-
if (typeof t < "u" && t <= 0)
|
|
2505
|
-
throw new Ce({ chainId: t });
|
|
2506
|
-
if (n || s)
|
|
2507
|
-
throw new F("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
|
|
2508
|
-
if (r && r > Xe)
|
|
2509
|
-
throw new et({ maxFeePerGas: r });
|
|
2510
|
-
}
|
|
2511
|
-
function ke(e) {
|
|
2512
|
-
if (!e || e.length === 0)
|
|
2513
|
-
return [];
|
|
2514
|
-
const t = [];
|
|
2515
|
-
for (let n = 0; n < e.length; n++) {
|
|
2516
|
-
const { address: r, storageKeys: s } = e[n];
|
|
2517
|
-
for (let a = 0; a < s.length; a++)
|
|
2518
|
-
if (s[a].length - 2 !== 64)
|
|
2519
|
-
throw new yr({ storageKey: s[a] });
|
|
2520
|
-
if (!Z(r, { strict: !1 }))
|
|
2521
|
-
throw new se({ address: r });
|
|
2522
|
-
t.push([r, s]);
|
|
2443
|
+
c.push(In(o, t[u], !0));
|
|
2444
|
+
return c.length === 0 ? "0x" : Ae(c);
|
|
2523
2445
|
}
|
|
2524
|
-
|
|
2525
|
-
}
|
|
2526
|
-
function Yi(e, t) {
|
|
2527
|
-
const n = gr(e);
|
|
2528
|
-
return n === "eip1559" ? pi(e, t) : n === "eip2930" ? mi(e, t) : n === "eip4844" ? hi(e, t) : n === "eip7702" ? li(e, t) : bi(e, t);
|
|
2529
|
-
}
|
|
2530
|
-
function li(e, t) {
|
|
2531
|
-
const { authorizationList: n, chainId: r, gas: s, nonce: a, to: i, value: o, maxFeePerGas: c, maxPriorityFeePerGas: u, accessList: f, data: d } = e;
|
|
2532
|
-
ci(e);
|
|
2533
|
-
const l = ke(f), h = yi(n);
|
|
2534
|
-
return j([
|
|
2535
|
-
"0x04",
|
|
2536
|
-
ne([
|
|
2537
|
-
y(r),
|
|
2538
|
-
a ? y(a) : "0x",
|
|
2539
|
-
u ? y(u) : "0x",
|
|
2540
|
-
c ? y(c) : "0x",
|
|
2541
|
-
s ? y(s) : "0x",
|
|
2542
|
-
i ?? "0x",
|
|
2543
|
-
o ? y(o) : "0x",
|
|
2544
|
-
d ?? "0x",
|
|
2545
|
-
l,
|
|
2546
|
-
h,
|
|
2547
|
-
...we(e, t)
|
|
2548
|
-
])
|
|
2549
|
-
]);
|
|
2550
|
-
}
|
|
2551
|
-
function hi(e, t) {
|
|
2552
|
-
const { chainId: n, gas: r, nonce: s, to: a, value: i, maxFeePerBlobGas: o, maxFeePerGas: c, maxPriorityFeePerGas: u, accessList: f, data: d } = e;
|
|
2553
|
-
ui(e);
|
|
2554
|
-
let l = e.blobVersionedHashes, h = e.sidecars;
|
|
2555
|
-
if (e.blobs && (typeof l > "u" || typeof h > "u")) {
|
|
2556
|
-
const b = typeof e.blobs[0] == "string" ? e.blobs : e.blobs.map((T) => he(T)), x = e.kzg, N = wr({
|
|
2557
|
-
blobs: b,
|
|
2558
|
-
kzg: x
|
|
2559
|
-
});
|
|
2560
|
-
if (typeof l > "u" && (l = vr({
|
|
2561
|
-
commitments: N
|
|
2562
|
-
})), typeof h > "u") {
|
|
2563
|
-
const T = xr({ blobs: b, commitments: N, kzg: x });
|
|
2564
|
-
h = Pr({ blobs: b, commitments: N, proofs: T });
|
|
2565
|
-
}
|
|
2566
|
-
}
|
|
2567
|
-
const g = ke(f), v = [
|
|
2568
|
-
y(n),
|
|
2569
|
-
s ? y(s) : "0x",
|
|
2570
|
-
u ? y(u) : "0x",
|
|
2571
|
-
c ? y(c) : "0x",
|
|
2572
|
-
r ? y(r) : "0x",
|
|
2573
|
-
a ?? "0x",
|
|
2574
|
-
i ? y(i) : "0x",
|
|
2575
|
-
d ?? "0x",
|
|
2576
|
-
g,
|
|
2577
|
-
o ? y(o) : "0x",
|
|
2578
|
-
l ?? [],
|
|
2579
|
-
...we(e, t)
|
|
2580
|
-
], p = [], m = [], w = [];
|
|
2581
|
-
if (h)
|
|
2582
|
-
for (let b = 0; b < h.length; b++) {
|
|
2583
|
-
const { blob: x, commitment: N, proof: T } = h[b];
|
|
2584
|
-
p.push(x), m.push(N), w.push(T);
|
|
2585
|
-
}
|
|
2586
|
-
return j([
|
|
2587
|
-
"0x03",
|
|
2588
|
-
h ? (
|
|
2589
|
-
// If sidecars are enabled, envelope turns into a "wrapper":
|
|
2590
|
-
ne([v, p, m, w])
|
|
2591
|
-
) : (
|
|
2592
|
-
// If sidecars are disabled, standard envelope is used:
|
|
2593
|
-
ne(v)
|
|
2594
|
-
)
|
|
2595
|
-
]);
|
|
2596
|
-
}
|
|
2597
|
-
function pi(e, t) {
|
|
2598
|
-
const { chainId: n, gas: r, nonce: s, to: a, value: i, maxFeePerGas: o, maxPriorityFeePerGas: c, accessList: u, data: f } = e;
|
|
2599
|
-
mt(e);
|
|
2600
|
-
const d = ke(u), l = [
|
|
2601
|
-
y(n),
|
|
2602
|
-
s ? y(s) : "0x",
|
|
2603
|
-
c ? y(c) : "0x",
|
|
2604
|
-
o ? y(o) : "0x",
|
|
2605
|
-
r ? y(r) : "0x",
|
|
2606
|
-
a ?? "0x",
|
|
2607
|
-
i ? y(i) : "0x",
|
|
2608
|
-
f ?? "0x",
|
|
2609
|
-
d,
|
|
2610
|
-
...we(e, t)
|
|
2611
|
-
];
|
|
2612
|
-
return j([
|
|
2613
|
-
"0x02",
|
|
2614
|
-
ne(l)
|
|
2615
|
-
]);
|
|
2616
|
-
}
|
|
2617
|
-
function mi(e, t) {
|
|
2618
|
-
const { chainId: n, gas: r, data: s, nonce: a, to: i, value: o, accessList: c, gasPrice: u } = e;
|
|
2619
|
-
fi(e);
|
|
2620
|
-
const f = ke(c), d = [
|
|
2621
|
-
y(n),
|
|
2622
|
-
a ? y(a) : "0x",
|
|
2623
|
-
u ? y(u) : "0x",
|
|
2624
|
-
r ? y(r) : "0x",
|
|
2625
|
-
i ?? "0x",
|
|
2626
|
-
o ? y(o) : "0x",
|
|
2627
|
-
s ?? "0x",
|
|
2628
|
-
f,
|
|
2629
|
-
...we(e, t)
|
|
2630
|
-
];
|
|
2631
|
-
return j([
|
|
2632
|
-
"0x01",
|
|
2633
|
-
ne(d)
|
|
2634
|
-
]);
|
|
2635
|
-
}
|
|
2636
|
-
function bi(e, t) {
|
|
2637
|
-
const { chainId: n = 0, gas: r, data: s, nonce: a, to: i, value: o, gasPrice: c } = e;
|
|
2638
|
-
di(e);
|
|
2639
|
-
let u = [
|
|
2640
|
-
a ? y(a) : "0x",
|
|
2641
|
-
c ? y(c) : "0x",
|
|
2642
|
-
r ? y(r) : "0x",
|
|
2643
|
-
i ?? "0x",
|
|
2644
|
-
o ? y(o) : "0x",
|
|
2645
|
-
s ?? "0x"
|
|
2646
|
-
];
|
|
2647
|
-
if (t) {
|
|
2648
|
-
const f = (() => {
|
|
2649
|
-
if (t.v >= 35n)
|
|
2650
|
-
return (t.v - 35n) / 2n > 0 ? t.v : 27n + (t.v === 35n ? 0n : 1n);
|
|
2651
|
-
if (n > 0)
|
|
2652
|
-
return BigInt(n * 2) + BigInt(35n + t.v - 27n);
|
|
2653
|
-
const h = 27n + (t.v === 27n ? 0n : 1n);
|
|
2654
|
-
if (t.v !== h)
|
|
2655
|
-
throw new Ar({ v: t.v });
|
|
2656
|
-
return h;
|
|
2657
|
-
})(), d = te(t.r), l = te(t.s);
|
|
2658
|
-
u = [
|
|
2659
|
-
...u,
|
|
2660
|
-
y(f),
|
|
2661
|
-
d === "0x00" ? "0x" : d,
|
|
2662
|
-
l === "0x00" ? "0x" : l
|
|
2663
|
-
];
|
|
2664
|
-
} else n > 0 && (u = [
|
|
2665
|
-
...u,
|
|
2666
|
-
y(n),
|
|
2667
|
-
"0x",
|
|
2668
|
-
"0x"
|
|
2669
|
-
]);
|
|
2670
|
-
return ne(u);
|
|
2671
|
-
}
|
|
2672
|
-
function we(e, t) {
|
|
2673
|
-
const n = t ?? e, { v: r, yParity: s } = n;
|
|
2674
|
-
if (typeof n.r > "u")
|
|
2675
|
-
return [];
|
|
2676
|
-
if (typeof n.s > "u")
|
|
2677
|
-
return [];
|
|
2678
|
-
if (typeof r > "u" && typeof s > "u")
|
|
2679
|
-
return [];
|
|
2680
|
-
const a = te(n.r), i = te(n.s);
|
|
2681
|
-
return [typeof s == "number" ? s ? y(1) : "0x" : r === 0n ? "0x" : r === 1n ? y(1) : r === 27n ? "0x" : y(1), a === "0x00" ? "0x" : a, i === "0x00" ? "0x" : i];
|
|
2682
|
-
}
|
|
2683
|
-
function yi(e) {
|
|
2684
|
-
if (!e || e.length === 0)
|
|
2685
|
-
return [];
|
|
2686
|
-
const t = [];
|
|
2687
|
-
for (const n of e) {
|
|
2688
|
-
const { chainId: r, nonce: s, ...a } = n, i = n.address;
|
|
2689
|
-
t.push([
|
|
2690
|
-
r ? pe(r) : "0x",
|
|
2691
|
-
i,
|
|
2692
|
-
s ? pe(s) : "0x",
|
|
2693
|
-
...we({}, a)
|
|
2694
|
-
]);
|
|
2695
|
-
}
|
|
2696
|
-
return t;
|
|
2446
|
+
throw new nr(e);
|
|
2697
2447
|
}
|
|
2698
|
-
async function
|
|
2699
|
-
return
|
|
2448
|
+
async function Ma({ address: e, authorization: t, signature: n }) {
|
|
2449
|
+
return He(Zt(e), await rr({
|
|
2700
2450
|
authorization: t,
|
|
2701
2451
|
signature: n
|
|
2702
2452
|
}));
|
|
2703
2453
|
}
|
|
2704
|
-
function
|
|
2705
|
-
const { source: t } = e, n = /* @__PURE__ */ new Map(), r = new
|
|
2454
|
+
function wi(e) {
|
|
2455
|
+
const { source: t } = e, n = /* @__PURE__ */ new Map(), r = new sr(8192), s = /* @__PURE__ */ new Map(), a = ({ address: i, chainId: o }) => `${i}.${o}`;
|
|
2706
2456
|
return {
|
|
2707
2457
|
async consume({ address: i, chainId: o, client: c }) {
|
|
2708
2458
|
const u = a({ address: i, chainId: o }), f = this.get({ address: i, chainId: o, client: c });
|
|
@@ -2732,70 +2482,70 @@ function Ki(e) {
|
|
|
2732
2482
|
}
|
|
2733
2483
|
};
|
|
2734
2484
|
}
|
|
2735
|
-
const
|
|
2736
|
-
function
|
|
2737
|
-
const { address: t, data: n, signature: r, to: s = "hex" } = e, a =
|
|
2738
|
-
|
|
2739
|
-
|
|
2485
|
+
const qa = "0x6492649264926492649264926492649264926492649264926492649264926492";
|
|
2486
|
+
function vi(e) {
|
|
2487
|
+
const { address: t, data: n, signature: r, to: s = "hex" } = e, a = Ae([
|
|
2488
|
+
zt([{ type: "address" }, { type: "bytes" }, { type: "bytes" }], [t, n, r]),
|
|
2489
|
+
qa
|
|
2740
2490
|
]);
|
|
2741
|
-
return s === "hex" ? a :
|
|
2491
|
+
return s === "hex" ? a : Jt(a);
|
|
2742
2492
|
}
|
|
2743
|
-
function
|
|
2493
|
+
function ja(e) {
|
|
2744
2494
|
return e.map((t) => ({
|
|
2745
2495
|
...t,
|
|
2746
2496
|
value: BigInt(t.value)
|
|
2747
2497
|
}));
|
|
2748
2498
|
}
|
|
2749
|
-
function
|
|
2499
|
+
function Va(e) {
|
|
2750
2500
|
return {
|
|
2751
2501
|
...e,
|
|
2752
2502
|
balance: e.balance ? BigInt(e.balance) : void 0,
|
|
2753
|
-
nonce: e.nonce ?
|
|
2754
|
-
storageProof: e.storageProof ?
|
|
2503
|
+
nonce: e.nonce ? pe(e.nonce) : void 0,
|
|
2504
|
+
storageProof: e.storageProof ? ja(e.storageProof) : void 0
|
|
2755
2505
|
};
|
|
2756
2506
|
}
|
|
2757
|
-
async function
|
|
2758
|
-
const a = r ?? "latest", i = n !== void 0 ?
|
|
2507
|
+
async function Wa(e, { address: t, blockNumber: n, blockTag: r, storageKeys: s }) {
|
|
2508
|
+
const a = r ?? "latest", i = n !== void 0 ? B(n) : void 0, o = await e.request({
|
|
2759
2509
|
method: "eth_getProof",
|
|
2760
2510
|
params: [t, s, i || a]
|
|
2761
2511
|
});
|
|
2762
|
-
return
|
|
2512
|
+
return Va(o);
|
|
2763
2513
|
}
|
|
2764
|
-
async function
|
|
2765
|
-
const a = n !== void 0 ?
|
|
2514
|
+
async function Ha(e, { address: t, blockNumber: n, blockTag: r = "latest", slot: s }) {
|
|
2515
|
+
const a = n !== void 0 ? B(n) : void 0;
|
|
2766
2516
|
return await e.request({
|
|
2767
2517
|
method: "eth_getStorageAt",
|
|
2768
2518
|
params: [t, s, a || r]
|
|
2769
2519
|
});
|
|
2770
2520
|
}
|
|
2771
|
-
async function
|
|
2521
|
+
async function Ga(e, { hash: t, transactionReceipt: n }) {
|
|
2772
2522
|
const [r, s] = await Promise.all([
|
|
2773
|
-
|
|
2774
|
-
t ?
|
|
2523
|
+
P(e, we, "getBlockNumber")({}),
|
|
2524
|
+
t ? P(e, Yt, "getTransaction")({ hash: t }) : void 0
|
|
2775
2525
|
]), a = (n == null ? void 0 : n.blockNumber) || (s == null ? void 0 : s.blockNumber);
|
|
2776
2526
|
return a ? r - a + 1n : 0n;
|
|
2777
2527
|
}
|
|
2778
|
-
async function
|
|
2528
|
+
async function _e(e, t) {
|
|
2779
2529
|
const { blockNumber: n, blockTag: r = e.experimental_blockTag ?? "latest", blocks: s, returnFullTransactions: a, traceTransfers: i, validation: o } = t;
|
|
2780
2530
|
try {
|
|
2781
2531
|
const c = [];
|
|
2782
2532
|
for (const l of s) {
|
|
2783
|
-
const h = l.blockOverrides ?
|
|
2784
|
-
const m = p,
|
|
2533
|
+
const h = l.blockOverrides ? ar(l.blockOverrides) : void 0, b = l.calls.map((p) => {
|
|
2534
|
+
const m = p, y = m.account ? ce(m.account) : void 0, g = m.abi ? j(m) : m.data, A = {
|
|
2785
2535
|
...m,
|
|
2786
|
-
account:
|
|
2787
|
-
data: m.dataSuffix ?
|
|
2788
|
-
from: m.from ?? (
|
|
2536
|
+
account: y,
|
|
2537
|
+
data: m.dataSuffix ? jt([g || "0x", m.dataSuffix]) : g,
|
|
2538
|
+
from: m.from ?? (y == null ? void 0 : y.address)
|
|
2789
2539
|
};
|
|
2790
|
-
return
|
|
2791
|
-
}),
|
|
2540
|
+
return Wt(A), Ht(A);
|
|
2541
|
+
}), w = l.stateOverrides ? ir(l.stateOverrides) : void 0;
|
|
2792
2542
|
c.push({
|
|
2793
2543
|
blockOverrides: h,
|
|
2794
|
-
calls:
|
|
2795
|
-
stateOverrides:
|
|
2544
|
+
calls: b,
|
|
2545
|
+
stateOverrides: w
|
|
2796
2546
|
});
|
|
2797
2547
|
}
|
|
2798
|
-
const f = (typeof n == "bigint" ?
|
|
2548
|
+
const f = (typeof n == "bigint" ? B(n) : void 0) || r;
|
|
2799
2549
|
return (await e.request({
|
|
2800
2550
|
method: "eth_simulateV1",
|
|
2801
2551
|
params: [
|
|
@@ -2803,65 +2553,65 @@ async function He(e, t) {
|
|
|
2803
2553
|
f
|
|
2804
2554
|
]
|
|
2805
2555
|
})).map((l, h) => ({
|
|
2806
|
-
...
|
|
2807
|
-
calls: l.calls.map((
|
|
2808
|
-
var
|
|
2809
|
-
const { abi: p, args: m, functionName:
|
|
2556
|
+
...or(l),
|
|
2557
|
+
calls: l.calls.map((b, w) => {
|
|
2558
|
+
var T, k;
|
|
2559
|
+
const { abi: p, args: m, functionName: y, to: g } = s[h].calls[w], A = ((T = b.error) == null ? void 0 : T.data) ?? b.returnData, $ = BigInt(b.gasUsed), C = (k = b.logs) == null ? void 0 : k.map((R) => W(R)), x = b.status === "0x1" ? "success" : "failure", E = p && x === "success" && A !== "0x" ? ge({
|
|
2810
2560
|
abi: p,
|
|
2811
|
-
data:
|
|
2812
|
-
functionName:
|
|
2813
|
-
}) : null,
|
|
2814
|
-
var
|
|
2815
|
-
if (
|
|
2561
|
+
data: A,
|
|
2562
|
+
functionName: y
|
|
2563
|
+
}) : null, N = (() => {
|
|
2564
|
+
var z;
|
|
2565
|
+
if (x === "success")
|
|
2816
2566
|
return;
|
|
2817
|
-
let
|
|
2818
|
-
if (((
|
|
2819
|
-
return
|
|
2567
|
+
let R;
|
|
2568
|
+
if (((z = b.error) == null ? void 0 : z.data) === "0x" ? R = new cr() : b.error && (R = new ur(b.error)), !!R)
|
|
2569
|
+
return Me(R, {
|
|
2820
2570
|
abi: p ?? [],
|
|
2821
|
-
address:
|
|
2571
|
+
address: g ?? "0x",
|
|
2822
2572
|
args: m,
|
|
2823
|
-
functionName:
|
|
2573
|
+
functionName: y ?? "<unknown>"
|
|
2824
2574
|
});
|
|
2825
2575
|
})();
|
|
2826
2576
|
return {
|
|
2827
|
-
data:
|
|
2828
|
-
gasUsed:
|
|
2829
|
-
logs:
|
|
2830
|
-
status:
|
|
2831
|
-
...
|
|
2577
|
+
data: A,
|
|
2578
|
+
gasUsed: $,
|
|
2579
|
+
logs: C,
|
|
2580
|
+
status: x,
|
|
2581
|
+
...x === "success" ? {
|
|
2832
2582
|
result: E
|
|
2833
2583
|
} : {
|
|
2834
|
-
error:
|
|
2584
|
+
error: N
|
|
2835
2585
|
}
|
|
2836
2586
|
};
|
|
2837
2587
|
})
|
|
2838
2588
|
}));
|
|
2839
2589
|
} catch (c) {
|
|
2840
|
-
const u = c, f =
|
|
2841
|
-
throw f instanceof
|
|
2590
|
+
const u = c, f = fr(u, {});
|
|
2591
|
+
throw f instanceof dr ? u : f;
|
|
2842
2592
|
}
|
|
2843
2593
|
}
|
|
2844
|
-
const
|
|
2845
|
-
async function
|
|
2846
|
-
const { blockNumber: n, blockTag: r, calls: s, stateOverrides: a, traceAssetChanges: i, traceTransfers: o, validation: c } = t, u = t.account ?
|
|
2594
|
+
const Za = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", O = "0x0000000000000000000000000000000000000000", Ja = "0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";
|
|
2595
|
+
async function Ya(e, t) {
|
|
2596
|
+
const { blockNumber: n, blockTag: r, calls: s, stateOverrides: a, traceAssetChanges: i, traceTransfers: o, validation: c } = t, u = t.account ? ce(t.account) : void 0;
|
|
2847
2597
|
if (i && !u)
|
|
2848
|
-
throw new
|
|
2849
|
-
const f = u ?
|
|
2850
|
-
bytecode:
|
|
2598
|
+
throw new U("`account` is required when `traceAssetChanges` is true");
|
|
2599
|
+
const f = u ? Ys(Ks("constructor(bytes, bytes)"), {
|
|
2600
|
+
bytecode: lr,
|
|
2851
2601
|
args: [
|
|
2852
|
-
|
|
2853
|
-
|
|
2602
|
+
Ja,
|
|
2603
|
+
Xs(G("function getBalance(address)"), [u.address])
|
|
2854
2604
|
]
|
|
2855
|
-
}) : void 0, d = i ? await Promise.all(t.calls.map(async (
|
|
2856
|
-
if (!
|
|
2605
|
+
}) : void 0, d = i ? await Promise.all(t.calls.map(async (v) => {
|
|
2606
|
+
if (!v.data && !v.abi)
|
|
2857
2607
|
return;
|
|
2858
|
-
const { accessList:
|
|
2608
|
+
const { accessList: S } = await En(e, {
|
|
2859
2609
|
account: u.address,
|
|
2860
|
-
...
|
|
2861
|
-
data:
|
|
2610
|
+
...v,
|
|
2611
|
+
data: v.abi ? j(v) : v.data
|
|
2862
2612
|
});
|
|
2863
|
-
return
|
|
2864
|
-
})).then((
|
|
2613
|
+
return S.map(({ address: ee, storageKeys: le }) => le.length > 0 ? ee : null);
|
|
2614
|
+
})).then((v) => v.flat().filter(Boolean)) : [], l = await _e(e, {
|
|
2865
2615
|
blockNumber: n,
|
|
2866
2616
|
blockTag: r,
|
|
2867
2617
|
blocks: [
|
|
@@ -2873,15 +2623,15 @@ async function Ni(e, t) {
|
|
|
2873
2623
|
},
|
|
2874
2624
|
// Asset pre balances
|
|
2875
2625
|
{
|
|
2876
|
-
calls: d.map((
|
|
2626
|
+
calls: d.map((v, S) => ({
|
|
2877
2627
|
abi: [
|
|
2878
|
-
|
|
2628
|
+
G("function balanceOf(address) returns (uint256)")
|
|
2879
2629
|
],
|
|
2880
2630
|
functionName: "balanceOf",
|
|
2881
2631
|
args: [u.address],
|
|
2882
|
-
to:
|
|
2632
|
+
to: v,
|
|
2883
2633
|
from: O,
|
|
2884
|
-
nonce:
|
|
2634
|
+
nonce: S
|
|
2885
2635
|
})),
|
|
2886
2636
|
stateOverrides: [
|
|
2887
2637
|
{
|
|
@@ -2892,8 +2642,8 @@ async function Ni(e, t) {
|
|
|
2892
2642
|
}
|
|
2893
2643
|
] : [],
|
|
2894
2644
|
{
|
|
2895
|
-
calls: [...s, {}].map((
|
|
2896
|
-
...
|
|
2645
|
+
calls: [...s, {}].map((v) => ({
|
|
2646
|
+
...v,
|
|
2897
2647
|
from: u == null ? void 0 : u.address
|
|
2898
2648
|
})),
|
|
2899
2649
|
stateOverrides: a
|
|
@@ -2905,15 +2655,15 @@ async function Ni(e, t) {
|
|
|
2905
2655
|
},
|
|
2906
2656
|
// Asset post balances
|
|
2907
2657
|
{
|
|
2908
|
-
calls: d.map((
|
|
2658
|
+
calls: d.map((v, S) => ({
|
|
2909
2659
|
abi: [
|
|
2910
|
-
|
|
2660
|
+
G("function balanceOf(address) returns (uint256)")
|
|
2911
2661
|
],
|
|
2912
2662
|
functionName: "balanceOf",
|
|
2913
2663
|
args: [u.address],
|
|
2914
|
-
to:
|
|
2664
|
+
to: v,
|
|
2915
2665
|
from: O,
|
|
2916
|
-
nonce:
|
|
2666
|
+
nonce: S
|
|
2917
2667
|
})),
|
|
2918
2668
|
stateOverrides: [
|
|
2919
2669
|
{
|
|
@@ -2924,14 +2674,14 @@ async function Ni(e, t) {
|
|
|
2924
2674
|
},
|
|
2925
2675
|
// Decimals
|
|
2926
2676
|
{
|
|
2927
|
-
calls: d.map((
|
|
2928
|
-
to:
|
|
2677
|
+
calls: d.map((v, S) => ({
|
|
2678
|
+
to: v,
|
|
2929
2679
|
abi: [
|
|
2930
|
-
|
|
2680
|
+
G("function decimals() returns (uint256)")
|
|
2931
2681
|
],
|
|
2932
2682
|
functionName: "decimals",
|
|
2933
2683
|
from: O,
|
|
2934
|
-
nonce:
|
|
2684
|
+
nonce: S
|
|
2935
2685
|
})),
|
|
2936
2686
|
stateOverrides: [
|
|
2937
2687
|
{
|
|
@@ -2942,15 +2692,15 @@ async function Ni(e, t) {
|
|
|
2942
2692
|
},
|
|
2943
2693
|
// Token URI
|
|
2944
2694
|
{
|
|
2945
|
-
calls: d.map((
|
|
2946
|
-
to:
|
|
2695
|
+
calls: d.map((v, S) => ({
|
|
2696
|
+
to: v,
|
|
2947
2697
|
abi: [
|
|
2948
|
-
|
|
2698
|
+
G("function tokenURI(uint256) returns (string)")
|
|
2949
2699
|
],
|
|
2950
2700
|
functionName: "tokenURI",
|
|
2951
2701
|
args: [0n],
|
|
2952
2702
|
from: O,
|
|
2953
|
-
nonce:
|
|
2703
|
+
nonce: S
|
|
2954
2704
|
})),
|
|
2955
2705
|
stateOverrides: [
|
|
2956
2706
|
{
|
|
@@ -2961,12 +2711,12 @@ async function Ni(e, t) {
|
|
|
2961
2711
|
},
|
|
2962
2712
|
// Symbols
|
|
2963
2713
|
{
|
|
2964
|
-
calls: d.map((
|
|
2965
|
-
to:
|
|
2966
|
-
abi: [
|
|
2714
|
+
calls: d.map((v, S) => ({
|
|
2715
|
+
to: v,
|
|
2716
|
+
abi: [G("function symbol() returns (string)")],
|
|
2967
2717
|
functionName: "symbol",
|
|
2968
2718
|
from: O,
|
|
2969
|
-
nonce:
|
|
2719
|
+
nonce: S
|
|
2970
2720
|
})),
|
|
2971
2721
|
stateOverrides: [
|
|
2972
2722
|
{
|
|
@@ -2979,81 +2729,81 @@ async function Ni(e, t) {
|
|
|
2979
2729
|
],
|
|
2980
2730
|
traceTransfers: o,
|
|
2981
2731
|
validation: c
|
|
2982
|
-
}), h = i ? l[2] : l[0], [
|
|
2983
|
-
for (const [
|
|
2984
|
-
const
|
|
2985
|
-
if (typeof
|
|
2732
|
+
}), h = i ? l[2] : l[0], [b, w, , p, m, y, g, A] = i ? l : [], { calls: $, ...C } = h, x = $.slice(0, -1) ?? [], E = (b == null ? void 0 : b.calls) ?? [], N = (w == null ? void 0 : w.calls) ?? [], T = [...E, ...N].map((v) => v.status === "success" ? Q(v.data) : null), k = (p == null ? void 0 : p.calls) ?? [], R = (m == null ? void 0 : m.calls) ?? [], z = [...k, ...R].map((v) => v.status === "success" ? Q(v.data) : null), Ie = ((y == null ? void 0 : y.calls) ?? []).map((v) => v.status === "success" ? v.result : null), de = ((A == null ? void 0 : A.calls) ?? []).map((v) => v.status === "success" ? v.result : null), Nn = ((g == null ? void 0 : g.calls) ?? []).map((v) => v.status === "success" ? v.result : null), Ne = [];
|
|
2733
|
+
for (const [v, S] of z.entries()) {
|
|
2734
|
+
const ee = T[v];
|
|
2735
|
+
if (typeof S != "bigint" || typeof ee != "bigint")
|
|
2986
2736
|
continue;
|
|
2987
|
-
const
|
|
2988
|
-
address:
|
|
2737
|
+
const le = Ie[v - 1], Bn = de[v - 1], $n = Nn[v - 1], it = v === 0 ? {
|
|
2738
|
+
address: Za,
|
|
2989
2739
|
decimals: 18,
|
|
2990
2740
|
symbol: "ETH"
|
|
2991
2741
|
} : {
|
|
2992
|
-
address: d[
|
|
2993
|
-
decimals:
|
|
2994
|
-
symbol:
|
|
2742
|
+
address: d[v - 1],
|
|
2743
|
+
decimals: $n || le ? Number(le ?? 1) : void 0,
|
|
2744
|
+
symbol: Bn ?? void 0
|
|
2995
2745
|
};
|
|
2996
|
-
|
|
2997
|
-
token:
|
|
2746
|
+
Ne.some((Cn) => Cn.token.address === it.address) || Ne.push({
|
|
2747
|
+
token: it,
|
|
2998
2748
|
value: {
|
|
2999
|
-
pre:
|
|
3000
|
-
post:
|
|
3001
|
-
diff:
|
|
2749
|
+
pre: ee,
|
|
2750
|
+
post: S,
|
|
2751
|
+
diff: S - ee
|
|
3002
2752
|
}
|
|
3003
2753
|
});
|
|
3004
2754
|
}
|
|
3005
2755
|
return {
|
|
3006
|
-
assetChanges:
|
|
3007
|
-
block:
|
|
3008
|
-
results:
|
|
2756
|
+
assetChanges: Ne,
|
|
2757
|
+
block: C,
|
|
2758
|
+
results: x
|
|
3009
2759
|
};
|
|
3010
2760
|
}
|
|
3011
|
-
function
|
|
2761
|
+
function Ka({ r: e, s: t, to: n = "hex", v: r, yParity: s }) {
|
|
3012
2762
|
const a = (() => {
|
|
3013
2763
|
if (s === 0 || s === 1)
|
|
3014
2764
|
return s;
|
|
3015
2765
|
if (r && (r === 27n || r === 28n || r >= 35n))
|
|
3016
2766
|
return r % 2n === 0n ? 1 : 0;
|
|
3017
2767
|
throw new Error("Invalid `v` or `yParity` value");
|
|
3018
|
-
})(), i = `0x${new
|
|
3019
|
-
return n === "hex" ? i :
|
|
2768
|
+
})(), i = `0x${new Qt.Signature(Q(e), Q(t)).toCompactHex()}${a === 0 ? "1b" : "1c"}`;
|
|
2769
|
+
return n === "hex" ? i : Jt(i);
|
|
3020
2770
|
}
|
|
3021
|
-
async function
|
|
2771
|
+
async function Pe(e, t) {
|
|
3022
2772
|
var o, c, u, f, d, l;
|
|
3023
2773
|
const { address: n, hash: r, erc6492VerifierAddress: s = t.universalSignatureVerifierAddress ?? ((u = (c = (o = e.chain) == null ? void 0 : o.contracts) == null ? void 0 : c.erc6492Verifier) == null ? void 0 : u.address), multicallAddress: a = t.multicallAddress ?? ((l = (d = (f = e.chain) == null ? void 0 : f.contracts) == null ? void 0 : d.multicall3) == null ? void 0 : l.address) } = t, i = (() => {
|
|
3024
2774
|
const h = t.signature;
|
|
3025
|
-
return
|
|
2775
|
+
return qt(h) ? h : typeof h == "object" && "r" in h && "s" in h ? Ka(h) : me(h);
|
|
3026
2776
|
})();
|
|
3027
2777
|
try {
|
|
3028
|
-
return
|
|
2778
|
+
return Hs(i) ? await Qa(e, {
|
|
3029
2779
|
...t,
|
|
3030
2780
|
multicallAddress: a,
|
|
3031
2781
|
signature: i
|
|
3032
|
-
}) : await
|
|
2782
|
+
}) : await Xa(e, {
|
|
3033
2783
|
...t,
|
|
3034
2784
|
verifierAddress: s,
|
|
3035
2785
|
signature: i
|
|
3036
2786
|
});
|
|
3037
2787
|
} catch (h) {
|
|
3038
2788
|
try {
|
|
3039
|
-
if (
|
|
2789
|
+
if (He(Zt(n), await hr({ hash: r, signature: i })))
|
|
3040
2790
|
return !0;
|
|
3041
2791
|
} catch {
|
|
3042
2792
|
}
|
|
3043
|
-
if (h instanceof
|
|
2793
|
+
if (h instanceof H)
|
|
3044
2794
|
return !1;
|
|
3045
2795
|
throw h;
|
|
3046
2796
|
}
|
|
3047
2797
|
}
|
|
3048
|
-
async function
|
|
2798
|
+
async function Qa(e, t) {
|
|
3049
2799
|
var p;
|
|
3050
|
-
const { address: n, blockNumber: r, blockTag: s, hash: a, multicallAddress: i } = t, { authorization: o, data: c, signature: u, to: f } =
|
|
3051
|
-
if (await
|
|
2800
|
+
const { address: n, blockNumber: r, blockTag: s, hash: a, multicallAddress: i } = t, { authorization: o, data: c, signature: u, to: f } = Ws(t.signature);
|
|
2801
|
+
if (await Le(e, {
|
|
3052
2802
|
address: n,
|
|
3053
2803
|
blockNumber: r,
|
|
3054
2804
|
blockTag: s
|
|
3055
|
-
}) ===
|
|
3056
|
-
return await
|
|
2805
|
+
}) === Ae(["0xef0100", o.address]))
|
|
2806
|
+
return await ei(e, {
|
|
3057
2807
|
address: n,
|
|
3058
2808
|
blockNumber: r,
|
|
3059
2809
|
blockTag: s,
|
|
@@ -3064,19 +2814,19 @@ async function Ti(e, t) {
|
|
|
3064
2814
|
address: o.address,
|
|
3065
2815
|
chainId: Number(o.chainId),
|
|
3066
2816
|
nonce: Number(o.nonce),
|
|
3067
|
-
r:
|
|
3068
|
-
s:
|
|
2817
|
+
r: B(o.r, { size: 32 }),
|
|
2818
|
+
s: B(o.s, { size: 32 }),
|
|
3069
2819
|
yParity: o.yParity
|
|
3070
2820
|
};
|
|
3071
|
-
if (!await
|
|
2821
|
+
if (!await Ma({
|
|
3072
2822
|
address: n,
|
|
3073
2823
|
authorization: l
|
|
3074
2824
|
}))
|
|
3075
|
-
throw new
|
|
3076
|
-
const
|
|
3077
|
-
...i ? { address: i } : { code:
|
|
2825
|
+
throw new H();
|
|
2826
|
+
const b = await P(e, _, "readContract")({
|
|
2827
|
+
...i ? { address: i } : { code: mr },
|
|
3078
2828
|
authorizationList: [l],
|
|
3079
|
-
abi:
|
|
2829
|
+
abi: pr,
|
|
3080
2830
|
blockNumber: r,
|
|
3081
2831
|
blockTag: "pending",
|
|
3082
2832
|
functionName: "aggregate3",
|
|
@@ -3092,66 +2842,66 @@ async function Ti(e, t) {
|
|
|
3092
2842
|
{
|
|
3093
2843
|
allowFailure: !0,
|
|
3094
2844
|
target: n,
|
|
3095
|
-
callData:
|
|
3096
|
-
abi:
|
|
2845
|
+
callData: j({
|
|
2846
|
+
abi: Kt,
|
|
3097
2847
|
functionName: "isValidSignature",
|
|
3098
2848
|
args: [a, u]
|
|
3099
2849
|
})
|
|
3100
2850
|
}
|
|
3101
2851
|
]
|
|
3102
2852
|
]
|
|
3103
|
-
}),
|
|
3104
|
-
if (
|
|
2853
|
+
}), w = (p = b[b.length - 1]) == null ? void 0 : p.returnData;
|
|
2854
|
+
if (w != null && w.startsWith("0x1626ba7e"))
|
|
3105
2855
|
return !0;
|
|
3106
|
-
throw new
|
|
2856
|
+
throw new H();
|
|
3107
2857
|
}
|
|
3108
|
-
async function
|
|
3109
|
-
const { address: n, factory: r, factoryData: s, hash: a, signature: i, verifierAddress: o, ...c } = t, u = await (async () => !r && !s ||
|
|
2858
|
+
async function Xa(e, t) {
|
|
2859
|
+
const { address: n, factory: r, factoryData: s, hash: a, signature: i, verifierAddress: o, ...c } = t, u = await (async () => !r && !s || ra(i) ? i : na({
|
|
3110
2860
|
data: s,
|
|
3111
2861
|
signature: i,
|
|
3112
2862
|
to: r
|
|
3113
2863
|
}))(), f = o ? {
|
|
3114
2864
|
to: o,
|
|
3115
|
-
data:
|
|
3116
|
-
abi:
|
|
2865
|
+
data: j({
|
|
2866
|
+
abi: bt,
|
|
3117
2867
|
functionName: "isValidSig",
|
|
3118
2868
|
args: [n, a, u]
|
|
3119
2869
|
}),
|
|
3120
2870
|
...c
|
|
3121
2871
|
} : {
|
|
3122
|
-
data:
|
|
3123
|
-
abi:
|
|
2872
|
+
data: br({
|
|
2873
|
+
abi: bt,
|
|
3124
2874
|
args: [n, a, u],
|
|
3125
|
-
bytecode:
|
|
2875
|
+
bytecode: gr
|
|
3126
2876
|
}),
|
|
3127
2877
|
...c
|
|
3128
|
-
}, { data: d } = await
|
|
3129
|
-
throw l instanceof
|
|
2878
|
+
}, { data: d } = await P(e, qe, "call")(f).catch((l) => {
|
|
2879
|
+
throw l instanceof yr ? new H() : l;
|
|
3130
2880
|
});
|
|
3131
|
-
if (
|
|
2881
|
+
if (wr(d ?? "0x0"))
|
|
3132
2882
|
return !0;
|
|
3133
|
-
throw new
|
|
2883
|
+
throw new H();
|
|
3134
2884
|
}
|
|
3135
|
-
async function
|
|
2885
|
+
async function ei(e, t) {
|
|
3136
2886
|
const { address: n, blockNumber: r, blockTag: s, hash: a, signature: i } = t;
|
|
3137
|
-
if ((await
|
|
2887
|
+
if ((await P(e, _, "readContract")({
|
|
3138
2888
|
address: n,
|
|
3139
|
-
abi:
|
|
2889
|
+
abi: Kt,
|
|
3140
2890
|
args: [a, i],
|
|
3141
2891
|
blockNumber: r,
|
|
3142
2892
|
blockTag: s,
|
|
3143
2893
|
functionName: "isValidSignature"
|
|
3144
2894
|
}).catch((c) => {
|
|
3145
|
-
throw c instanceof
|
|
2895
|
+
throw c instanceof vr ? new H() : c;
|
|
3146
2896
|
})).startsWith("0x1626ba7e"))
|
|
3147
2897
|
return !0;
|
|
3148
|
-
throw new
|
|
2898
|
+
throw new H();
|
|
3149
2899
|
}
|
|
3150
|
-
class
|
|
2900
|
+
class H extends Error {
|
|
3151
2901
|
}
|
|
3152
|
-
async function
|
|
3153
|
-
const o =
|
|
3154
|
-
return
|
|
2902
|
+
async function ti(e, { address: t, message: n, factory: r, factoryData: s, signature: a, ...i }) {
|
|
2903
|
+
const o = Xt(n);
|
|
2904
|
+
return P(e, Pe, "verifyHash")({
|
|
3155
2905
|
address: t,
|
|
3156
2906
|
factory: r,
|
|
3157
2907
|
factoryData: s,
|
|
@@ -3160,9 +2910,9 @@ async function zi(e, { address: t, message: n, factory: r, factoryData: s, signa
|
|
|
3160
2910
|
...i
|
|
3161
2911
|
});
|
|
3162
2912
|
}
|
|
3163
|
-
async function
|
|
3164
|
-
const { address: n, factory: r, factoryData: s, signature: a, message: i, primaryType: o, types: c, domain: u, ...f } = t, d =
|
|
3165
|
-
return
|
|
2913
|
+
async function ni(e, t) {
|
|
2914
|
+
const { address: n, factory: r, factoryData: s, signature: a, message: i, primaryType: o, types: c, domain: u, ...f } = t, d = Ur({ message: i, primaryType: o, types: c, domain: u });
|
|
2915
|
+
return P(e, Pe, "verifyHash")({
|
|
3166
2916
|
address: n,
|
|
3167
2917
|
factory: r,
|
|
3168
2918
|
factoryData: s,
|
|
@@ -3171,11 +2921,11 @@ async function Ri(e, t) {
|
|
|
3171
2921
|
...f
|
|
3172
2922
|
});
|
|
3173
2923
|
}
|
|
3174
|
-
function
|
|
2924
|
+
function ri(e, { blockTag: t = e.experimental_blockTag ?? "latest", emitMissed: n = !1, emitOnBegin: r = !1, onBlock: s, onError: a, includeTransactions: i, poll: o, pollingInterval: c = e.pollingInterval }) {
|
|
3175
2925
|
const u = typeof o < "u" ? o : !(e.transport.type === "webSocket" || e.transport.type === "ipc" || e.transport.type === "fallback" && (e.transport.transports[0].config.type === "webSocket" || e.transport.transports[0].config.type === "ipc")), f = i ?? !1;
|
|
3176
2926
|
let d;
|
|
3177
2927
|
return u ? (() => {
|
|
3178
|
-
const
|
|
2928
|
+
const b = ae([
|
|
3179
2929
|
"watchBlocks",
|
|
3180
2930
|
e.uid,
|
|
3181
2931
|
t,
|
|
@@ -3184,10 +2934,10 @@ function Si(e, { blockTag: t = e.experimental_blockTag ?? "latest", emitMissed:
|
|
|
3184
2934
|
f,
|
|
3185
2935
|
c
|
|
3186
2936
|
]);
|
|
3187
|
-
return
|
|
2937
|
+
return ie(b, { onBlock: s, onError: a }, (w) => ye(async () => {
|
|
3188
2938
|
var p;
|
|
3189
2939
|
try {
|
|
3190
|
-
const m = await
|
|
2940
|
+
const m = await P(e, ne, "getBlock")({
|
|
3191
2941
|
blockTag: t,
|
|
3192
2942
|
includeTransactions: f
|
|
3193
2943
|
});
|
|
@@ -3195,70 +2945,70 @@ function Si(e, { blockTag: t = e.experimental_blockTag ?? "latest", emitMissed:
|
|
|
3195
2945
|
if (m.number === d.number)
|
|
3196
2946
|
return;
|
|
3197
2947
|
if (m.number - d.number > 1 && n)
|
|
3198
|
-
for (let
|
|
3199
|
-
const
|
|
3200
|
-
blockNumber:
|
|
2948
|
+
for (let y = (d == null ? void 0 : d.number) + 1n; y < m.number; y++) {
|
|
2949
|
+
const g = await P(e, ne, "getBlock")({
|
|
2950
|
+
blockNumber: y,
|
|
3201
2951
|
includeTransactions: f
|
|
3202
2952
|
});
|
|
3203
|
-
|
|
2953
|
+
w.onBlock(g, d), d = g;
|
|
3204
2954
|
}
|
|
3205
2955
|
}
|
|
3206
2956
|
// If no previous block exists, emit.
|
|
3207
2957
|
((d == null ? void 0 : d.number) == null || // If the block tag is "pending" with no block number, emit.
|
|
3208
2958
|
t === "pending" && (m == null ? void 0 : m.number) == null || // If the next block number is greater than the previous block number, emit.
|
|
3209
2959
|
// We don't want to emit blocks in the past.
|
|
3210
|
-
m.number !== null && m.number > d.number) && (
|
|
2960
|
+
m.number !== null && m.number > d.number) && (w.onBlock(m, d), d = m);
|
|
3211
2961
|
} catch (m) {
|
|
3212
|
-
(p =
|
|
2962
|
+
(p = w.onError) == null || p.call(w, m);
|
|
3213
2963
|
}
|
|
3214
2964
|
}, {
|
|
3215
2965
|
emitOnBegin: r,
|
|
3216
2966
|
interval: c
|
|
3217
2967
|
}));
|
|
3218
2968
|
})() : (() => {
|
|
3219
|
-
let
|
|
2969
|
+
let b = !0, w = !0, p = () => b = !1;
|
|
3220
2970
|
return (async () => {
|
|
3221
2971
|
try {
|
|
3222
|
-
r &&
|
|
2972
|
+
r && P(e, ne, "getBlock")({
|
|
3223
2973
|
blockTag: t,
|
|
3224
2974
|
includeTransactions: f
|
|
3225
|
-
}).then((
|
|
3226
|
-
|
|
2975
|
+
}).then((g) => {
|
|
2976
|
+
b && w && (s(g, void 0), w = !1);
|
|
3227
2977
|
}).catch(a);
|
|
3228
2978
|
const m = (() => {
|
|
3229
2979
|
if (e.transport.type === "fallback") {
|
|
3230
|
-
const
|
|
3231
|
-
return
|
|
2980
|
+
const g = e.transport.transports.find((A) => A.config.type === "webSocket" || A.config.type === "ipc");
|
|
2981
|
+
return g ? g.value : e.transport;
|
|
3232
2982
|
}
|
|
3233
2983
|
return e.transport;
|
|
3234
|
-
})(), { unsubscribe:
|
|
2984
|
+
})(), { unsubscribe: y } = await m.subscribe({
|
|
3235
2985
|
params: ["newHeads"],
|
|
3236
|
-
async onData(
|
|
3237
|
-
var
|
|
3238
|
-
if (!
|
|
2986
|
+
async onData(g) {
|
|
2987
|
+
var $;
|
|
2988
|
+
if (!b)
|
|
3239
2989
|
return;
|
|
3240
|
-
const
|
|
3241
|
-
blockNumber: (
|
|
2990
|
+
const A = await P(e, ne, "getBlock")({
|
|
2991
|
+
blockNumber: ($ = g.result) == null ? void 0 : $.number,
|
|
3242
2992
|
includeTransactions: f
|
|
3243
2993
|
}).catch(() => {
|
|
3244
2994
|
});
|
|
3245
|
-
|
|
2995
|
+
b && (s(A, d), w = !1, d = A);
|
|
3246
2996
|
},
|
|
3247
|
-
onError(
|
|
3248
|
-
a == null || a(
|
|
2997
|
+
onError(g) {
|
|
2998
|
+
a == null || a(g);
|
|
3249
2999
|
}
|
|
3250
3000
|
});
|
|
3251
|
-
p =
|
|
3001
|
+
p = y, b || p();
|
|
3252
3002
|
} catch (m) {
|
|
3253
3003
|
a == null || a(m);
|
|
3254
3004
|
}
|
|
3255
3005
|
})(), () => p();
|
|
3256
3006
|
})();
|
|
3257
3007
|
}
|
|
3258
|
-
function
|
|
3008
|
+
function si(e, { address: t, args: n, batch: r = !0, event: s, events: a, fromBlock: i, onError: o, onLogs: c, poll: u, pollingInterval: f = e.pollingInterval, strict: d }) {
|
|
3259
3009
|
const l = typeof u < "u" ? u : typeof i == "bigint" ? !0 : !(e.transport.type === "webSocket" || e.transport.type === "ipc" || e.transport.type === "fallback" && (e.transport.transports[0].config.type === "webSocket" || e.transport.transports[0].config.type === "ipc")), h = d ?? !1;
|
|
3260
3010
|
return l ? (() => {
|
|
3261
|
-
const p =
|
|
3011
|
+
const p = ae([
|
|
3262
3012
|
"watchEvent",
|
|
3263
3013
|
t,
|
|
3264
3014
|
n,
|
|
@@ -3268,15 +3018,15 @@ function Fi(e, { address: t, args: n, batch: r = !0, event: s, events: a, fromBl
|
|
|
3268
3018
|
f,
|
|
3269
3019
|
i
|
|
3270
3020
|
]);
|
|
3271
|
-
return
|
|
3272
|
-
let
|
|
3273
|
-
i !== void 0 && (
|
|
3274
|
-
let
|
|
3275
|
-
const
|
|
3276
|
-
var
|
|
3277
|
-
if (!
|
|
3021
|
+
return ie(p, { onLogs: c, onError: o }, (m) => {
|
|
3022
|
+
let y;
|
|
3023
|
+
i !== void 0 && (y = i - 1n);
|
|
3024
|
+
let g, A = !1;
|
|
3025
|
+
const $ = ye(async () => {
|
|
3026
|
+
var C;
|
|
3027
|
+
if (!A) {
|
|
3278
3028
|
try {
|
|
3279
|
-
|
|
3029
|
+
g = await P(e, Pn, "createEventFilter")({
|
|
3280
3030
|
address: t,
|
|
3281
3031
|
args: n,
|
|
3282
3032
|
event: s,
|
|
@@ -3286,102 +3036,102 @@ function Fi(e, { address: t, args: n, batch: r = !0, event: s, events: a, fromBl
|
|
|
3286
3036
|
});
|
|
3287
3037
|
} catch {
|
|
3288
3038
|
}
|
|
3289
|
-
|
|
3039
|
+
A = !0;
|
|
3290
3040
|
return;
|
|
3291
3041
|
}
|
|
3292
3042
|
try {
|
|
3293
|
-
let
|
|
3294
|
-
if (
|
|
3295
|
-
|
|
3043
|
+
let x;
|
|
3044
|
+
if (g)
|
|
3045
|
+
x = await P(e, je, "getFilterChanges")({ filter: g });
|
|
3296
3046
|
else {
|
|
3297
|
-
const E = await
|
|
3298
|
-
|
|
3047
|
+
const E = await P(e, we, "getBlockNumber")({});
|
|
3048
|
+
y && y !== E ? x = await P(e, tt, "getLogs")({
|
|
3299
3049
|
address: t,
|
|
3300
3050
|
args: n,
|
|
3301
3051
|
event: s,
|
|
3302
3052
|
events: a,
|
|
3303
|
-
fromBlock:
|
|
3053
|
+
fromBlock: y + 1n,
|
|
3304
3054
|
toBlock: E
|
|
3305
|
-
}) :
|
|
3055
|
+
}) : x = [], y = E;
|
|
3306
3056
|
}
|
|
3307
|
-
if (
|
|
3057
|
+
if (x.length === 0)
|
|
3308
3058
|
return;
|
|
3309
3059
|
if (r)
|
|
3310
|
-
m.onLogs(
|
|
3060
|
+
m.onLogs(x);
|
|
3311
3061
|
else
|
|
3312
|
-
for (const E of
|
|
3062
|
+
for (const E of x)
|
|
3313
3063
|
m.onLogs([E]);
|
|
3314
|
-
} catch (
|
|
3315
|
-
|
|
3064
|
+
} catch (x) {
|
|
3065
|
+
g && x instanceof Lt && (A = !1), (C = m.onError) == null || C.call(m, x);
|
|
3316
3066
|
}
|
|
3317
3067
|
}, {
|
|
3318
3068
|
emitOnBegin: !0,
|
|
3319
3069
|
interval: f
|
|
3320
3070
|
});
|
|
3321
3071
|
return async () => {
|
|
3322
|
-
|
|
3072
|
+
g && await P(e, Ve, "uninstallFilter")({ filter: g }), $();
|
|
3323
3073
|
};
|
|
3324
3074
|
});
|
|
3325
3075
|
})() : (() => {
|
|
3326
3076
|
let p = !0, m = () => p = !1;
|
|
3327
3077
|
return (async () => {
|
|
3328
3078
|
try {
|
|
3329
|
-
const
|
|
3079
|
+
const y = (() => {
|
|
3330
3080
|
if (e.transport.type === "fallback") {
|
|
3331
|
-
const
|
|
3332
|
-
return
|
|
3081
|
+
const C = e.transport.transports.find((x) => x.config.type === "webSocket" || x.config.type === "ipc");
|
|
3082
|
+
return C ? C.value : e.transport;
|
|
3333
3083
|
}
|
|
3334
3084
|
return e.transport;
|
|
3335
|
-
})(),
|
|
3336
|
-
let
|
|
3337
|
-
|
|
3338
|
-
abi: [
|
|
3339
|
-
eventName:
|
|
3085
|
+
})(), g = a ?? (s ? [s] : void 0);
|
|
3086
|
+
let A = [];
|
|
3087
|
+
g && (A = [g.flatMap((x) => fe({
|
|
3088
|
+
abi: [x],
|
|
3089
|
+
eventName: x.name,
|
|
3340
3090
|
args: n
|
|
3341
|
-
}))], s && (
|
|
3342
|
-
const { unsubscribe:
|
|
3343
|
-
params: ["logs", { address: t, topics:
|
|
3344
|
-
onData(
|
|
3091
|
+
}))], s && (A = A[0]));
|
|
3092
|
+
const { unsubscribe: $ } = await y.subscribe({
|
|
3093
|
+
params: ["logs", { address: t, topics: A }],
|
|
3094
|
+
onData(C) {
|
|
3345
3095
|
var E;
|
|
3346
3096
|
if (!p)
|
|
3347
3097
|
return;
|
|
3348
|
-
const
|
|
3098
|
+
const x = C.result;
|
|
3349
3099
|
try {
|
|
3350
|
-
const { eventName:
|
|
3351
|
-
abi:
|
|
3352
|
-
data:
|
|
3353
|
-
topics:
|
|
3100
|
+
const { eventName: N, args: T } = _t({
|
|
3101
|
+
abi: g ?? [],
|
|
3102
|
+
data: x.data,
|
|
3103
|
+
topics: x.topics,
|
|
3354
3104
|
strict: h
|
|
3355
|
-
}),
|
|
3356
|
-
c([
|
|
3357
|
-
} catch (
|
|
3358
|
-
let
|
|
3359
|
-
if (
|
|
3105
|
+
}), k = W(x, { args: T, eventName: N });
|
|
3106
|
+
c([k]);
|
|
3107
|
+
} catch (N) {
|
|
3108
|
+
let T, k;
|
|
3109
|
+
if (N instanceof Ut || N instanceof Dt) {
|
|
3360
3110
|
if (d)
|
|
3361
3111
|
return;
|
|
3362
|
-
|
|
3112
|
+
T = N.abiItem.name, k = (E = N.abiItem.inputs) == null ? void 0 : E.some((z) => !("name" in z && z.name));
|
|
3363
3113
|
}
|
|
3364
|
-
const
|
|
3365
|
-
args:
|
|
3366
|
-
eventName:
|
|
3114
|
+
const R = W(x, {
|
|
3115
|
+
args: k ? [] : {},
|
|
3116
|
+
eventName: T
|
|
3367
3117
|
});
|
|
3368
|
-
c([
|
|
3118
|
+
c([R]);
|
|
3369
3119
|
}
|
|
3370
3120
|
},
|
|
3371
|
-
onError(
|
|
3372
|
-
o == null || o(
|
|
3121
|
+
onError(C) {
|
|
3122
|
+
o == null || o(C);
|
|
3373
3123
|
}
|
|
3374
3124
|
});
|
|
3375
|
-
m =
|
|
3376
|
-
} catch (
|
|
3377
|
-
o == null || o(
|
|
3125
|
+
m = $, p || m();
|
|
3126
|
+
} catch (y) {
|
|
3127
|
+
o == null || o(y);
|
|
3378
3128
|
}
|
|
3379
3129
|
})(), () => m();
|
|
3380
3130
|
})();
|
|
3381
3131
|
}
|
|
3382
|
-
function
|
|
3132
|
+
function ai(e) {
|
|
3383
3133
|
var d, l, h;
|
|
3384
|
-
const { scheme: t, statement: n, ...r } = ((d = e.match(
|
|
3134
|
+
const { scheme: t, statement: n, ...r } = ((d = e.match(ii)) == null ? void 0 : d.groups) ?? {}, { chainId: s, expirationTime: a, issuedAt: i, notBefore: o, requestId: c, ...u } = ((l = e.match(oi)) == null ? void 0 : l.groups) ?? {}, f = (h = e.split("Resources:")[1]) == null ? void 0 : h.split(`
|
|
3385
3135
|
- `).slice(1);
|
|
3386
3136
|
return {
|
|
3387
3137
|
...r,
|
|
@@ -3396,22 +3146,22 @@ function Li(e) {
|
|
|
3396
3146
|
...n ? { statement: n } : {}
|
|
3397
3147
|
};
|
|
3398
3148
|
}
|
|
3399
|
-
const
|
|
3400
|
-
function
|
|
3149
|
+
const ii = /^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/, oi = /(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;
|
|
3150
|
+
function ci(e) {
|
|
3401
3151
|
const { address: t, domain: n, message: r, nonce: s, scheme: a, time: i = /* @__PURE__ */ new Date() } = e;
|
|
3402
3152
|
if (n && r.domain !== n || s && r.nonce !== s || a && r.scheme !== a || r.expirationTime && i >= r.expirationTime || r.notBefore && i < r.notBefore)
|
|
3403
3153
|
return !1;
|
|
3404
3154
|
try {
|
|
3405
|
-
if (!r.address || !
|
|
3155
|
+
if (!r.address || !Gt(r.address, { strict: !1 }) || t && !He(r.address, t))
|
|
3406
3156
|
return !1;
|
|
3407
3157
|
} catch {
|
|
3408
3158
|
return !1;
|
|
3409
3159
|
}
|
|
3410
3160
|
return !0;
|
|
3411
3161
|
}
|
|
3412
|
-
async function
|
|
3413
|
-
const { address: n, domain: r, message: s, nonce: a, scheme: i, signature: o, time: c = /* @__PURE__ */ new Date(), ...u } = t, f =
|
|
3414
|
-
if (!f.address || !
|
|
3162
|
+
async function ui(e, t) {
|
|
3163
|
+
const { address: n, domain: r, message: s, nonce: a, scheme: i, signature: o, time: c = /* @__PURE__ */ new Date(), ...u } = t, f = ai(s);
|
|
3164
|
+
if (!f.address || !ci({
|
|
3415
3165
|
address: n,
|
|
3416
3166
|
domain: r,
|
|
3417
3167
|
message: f,
|
|
@@ -3420,96 +3170,96 @@ async function Di(e, t) {
|
|
|
3420
3170
|
time: c
|
|
3421
3171
|
}))
|
|
3422
3172
|
return !1;
|
|
3423
|
-
const l =
|
|
3424
|
-
return
|
|
3173
|
+
const l = Xt(s);
|
|
3174
|
+
return Pe(e, {
|
|
3425
3175
|
address: f.address,
|
|
3426
3176
|
hash: l,
|
|
3427
3177
|
signature: o,
|
|
3428
3178
|
...u
|
|
3429
3179
|
});
|
|
3430
3180
|
}
|
|
3431
|
-
async function
|
|
3181
|
+
async function fi(e, { serializedTransaction: t, throwOnReceiptRevert: n, timeout: r }) {
|
|
3432
3182
|
var o, c, u;
|
|
3433
3183
|
const s = await e.request({
|
|
3434
3184
|
method: "eth_sendRawTransactionSync",
|
|
3435
|
-
params: r ? [t,
|
|
3436
|
-
}, { retryCount: 0 }), i = (((u = (c = (o = e.chain) == null ? void 0 : o.formatters) == null ? void 0 : c.transactionReceipt) == null ? void 0 : u.format) ||
|
|
3185
|
+
params: r ? [t, B(r)] : [t]
|
|
3186
|
+
}, { retryCount: 0 }), i = (((u = (c = (o = e.chain) == null ? void 0 : o.formatters) == null ? void 0 : c.transactionReceipt) == null ? void 0 : u.format) || Ar)(s);
|
|
3437
3187
|
if (i.status === "reverted" && n)
|
|
3438
|
-
throw new
|
|
3188
|
+
throw new xr({ receipt: i });
|
|
3439
3189
|
return i;
|
|
3440
3190
|
}
|
|
3441
|
-
function
|
|
3191
|
+
function di(e) {
|
|
3442
3192
|
return {
|
|
3443
|
-
call: (t) =>
|
|
3444
|
-
createAccessList: (t) =>
|
|
3445
|
-
createBlockFilter: () =>
|
|
3446
|
-
createContractEventFilter: (t) =>
|
|
3447
|
-
createEventFilter: (t) =>
|
|
3448
|
-
createPendingTransactionFilter: () =>
|
|
3449
|
-
estimateContractGas: (t) =>
|
|
3450
|
-
estimateGas: (t) =>
|
|
3451
|
-
getBalance: (t) =>
|
|
3452
|
-
getBlobBaseFee: () =>
|
|
3453
|
-
getBlock: (t) =>
|
|
3454
|
-
getBlockNumber: (t) =>
|
|
3455
|
-
getBlockTransactionCount: (t) =>
|
|
3456
|
-
getBytecode: (t) =>
|
|
3457
|
-
getChainId: () =>
|
|
3458
|
-
getCode: (t) =>
|
|
3459
|
-
getContractEvents: (t) =>
|
|
3460
|
-
getEip712Domain: (t) =>
|
|
3461
|
-
getEnsAddress: (t) =>
|
|
3462
|
-
getEnsAvatar: (t) =>
|
|
3463
|
-
getEnsName: (t) =>
|
|
3464
|
-
getEnsResolver: (t) =>
|
|
3465
|
-
getEnsText: (t) =>
|
|
3466
|
-
getFeeHistory: (t) =>
|
|
3467
|
-
estimateFeesPerGas: (t) =>
|
|
3468
|
-
getFilterChanges: (t) =>
|
|
3469
|
-
getFilterLogs: (t) =>
|
|
3470
|
-
getGasPrice: () =>
|
|
3471
|
-
getLogs: (t) =>
|
|
3472
|
-
getProof: (t) =>
|
|
3473
|
-
estimateMaxPriorityFeePerGas: (t) =>
|
|
3474
|
-
fillTransaction: (t) =>
|
|
3475
|
-
getStorageAt: (t) =>
|
|
3476
|
-
getTransaction: (t) =>
|
|
3477
|
-
getTransactionConfirmations: (t) =>
|
|
3478
|
-
getTransactionCount: (t) =>
|
|
3479
|
-
getTransactionReceipt: (t) =>
|
|
3480
|
-
multicall: (t) =>
|
|
3481
|
-
prepareTransactionRequest: (t) =>
|
|
3482
|
-
readContract: (t) =>
|
|
3483
|
-
sendRawTransaction: (t) =>
|
|
3484
|
-
sendRawTransactionSync: (t) =>
|
|
3485
|
-
simulate: (t) =>
|
|
3486
|
-
simulateBlocks: (t) =>
|
|
3487
|
-
simulateCalls: (t) =>
|
|
3488
|
-
simulateContract: (t) =>
|
|
3489
|
-
verifyHash: (t) =>
|
|
3490
|
-
verifyMessage: (t) =>
|
|
3491
|
-
verifySiweMessage: (t) =>
|
|
3492
|
-
verifyTypedData: (t) =>
|
|
3493
|
-
uninstallFilter: (t) =>
|
|
3494
|
-
waitForTransactionReceipt: (t) =>
|
|
3495
|
-
watchBlocks: (t) =>
|
|
3496
|
-
watchBlockNumber: (t) =>
|
|
3497
|
-
watchContractEvent: (t) =>
|
|
3498
|
-
watchEvent: (t) =>
|
|
3499
|
-
watchPendingTransactions: (t) =>
|
|
3193
|
+
call: (t) => qe(e, t),
|
|
3194
|
+
createAccessList: (t) => En(e, t),
|
|
3195
|
+
createBlockFilter: () => Sa(e),
|
|
3196
|
+
createContractEventFilter: (t) => gn(e, t),
|
|
3197
|
+
createEventFilter: (t) => Pn(e, t),
|
|
3198
|
+
createPendingTransactionFilter: () => Lr(e),
|
|
3199
|
+
estimateContractGas: (t) => ia(e, t),
|
|
3200
|
+
estimateGas: (t) => Ft(e, t),
|
|
3201
|
+
getBalance: (t) => Or(e, t),
|
|
3202
|
+
getBlobBaseFee: () => Ta(e),
|
|
3203
|
+
getBlock: (t) => ne(e, t),
|
|
3204
|
+
getBlockNumber: (t) => we(e, t),
|
|
3205
|
+
getBlockTransactionCount: (t) => za(e, t),
|
|
3206
|
+
getBytecode: (t) => Le(e, t),
|
|
3207
|
+
getChainId: () => Fr(e),
|
|
3208
|
+
getCode: (t) => Le(e, t),
|
|
3209
|
+
getContractEvents: (t) => yn(e, t),
|
|
3210
|
+
getEip712Domain: (t) => Oa(e, t),
|
|
3211
|
+
getEnsAddress: (t) => ba(e, t),
|
|
3212
|
+
getEnsAvatar: (t) => Ca(e, t),
|
|
3213
|
+
getEnsName: (t) => ka(e, t),
|
|
3214
|
+
getEnsResolver: (t) => Ra(e, t),
|
|
3215
|
+
getEnsText: (t) => xn(e, t),
|
|
3216
|
+
getFeeHistory: (t) => Ua(e, t),
|
|
3217
|
+
estimateFeesPerGas: (t) => zr(e, t),
|
|
3218
|
+
getFilterChanges: (t) => je(e, t),
|
|
3219
|
+
getFilterLogs: (t) => Da(e, t),
|
|
3220
|
+
getGasPrice: () => Tr(e),
|
|
3221
|
+
getLogs: (t) => tt(e, t),
|
|
3222
|
+
getProof: (t) => Wa(e, t),
|
|
3223
|
+
estimateMaxPriorityFeePerGas: (t) => Sr(e, t),
|
|
3224
|
+
fillTransaction: (t) => Rr(e, t),
|
|
3225
|
+
getStorageAt: (t) => Ha(e, t),
|
|
3226
|
+
getTransaction: (t) => Yt(e, t),
|
|
3227
|
+
getTransactionConfirmations: (t) => Ga(e, t),
|
|
3228
|
+
getTransactionCount: (t) => kr(e, t),
|
|
3229
|
+
getTransactionReceipt: (t) => Cr(e, t),
|
|
3230
|
+
multicall: (t) => $r(e, t),
|
|
3231
|
+
prepareTransactionRequest: (t) => Br(e, t),
|
|
3232
|
+
readContract: (t) => _(e, t),
|
|
3233
|
+
sendRawTransaction: (t) => Nr(e, t),
|
|
3234
|
+
sendRawTransactionSync: (t) => fi(e, t),
|
|
3235
|
+
simulate: (t) => _e(e, t),
|
|
3236
|
+
simulateBlocks: (t) => _e(e, t),
|
|
3237
|
+
simulateCalls: (t) => Ya(e, t),
|
|
3238
|
+
simulateContract: (t) => oa(e, t),
|
|
3239
|
+
verifyHash: (t) => Pe(e, t),
|
|
3240
|
+
verifyMessage: (t) => ti(e, t),
|
|
3241
|
+
verifySiweMessage: (t) => ui(e, t),
|
|
3242
|
+
verifyTypedData: (t) => ni(e, t),
|
|
3243
|
+
uninstallFilter: (t) => Ve(e, t),
|
|
3244
|
+
waitForTransactionReceipt: (t) => Ir(e, t),
|
|
3245
|
+
watchBlocks: (t) => ri(e, t),
|
|
3246
|
+
watchBlockNumber: (t) => Pr(e, t),
|
|
3247
|
+
watchContractEvent: (t) => ca(e, t),
|
|
3248
|
+
watchEvent: (t) => si(e, t),
|
|
3249
|
+
watchPendingTransactions: (t) => Er(e, t)
|
|
3500
3250
|
};
|
|
3501
3251
|
}
|
|
3502
|
-
function
|
|
3252
|
+
function Ai(e) {
|
|
3503
3253
|
const { key: t = "public", name: n = "Public Client" } = e;
|
|
3504
|
-
return
|
|
3254
|
+
return _r({
|
|
3505
3255
|
...e,
|
|
3506
3256
|
key: t,
|
|
3507
3257
|
name: n,
|
|
3508
3258
|
type: "publicClient"
|
|
3509
|
-
}).extend(
|
|
3259
|
+
}).extend(di);
|
|
3510
3260
|
}
|
|
3511
|
-
function
|
|
3512
|
-
const { r: t, s: n } =
|
|
3261
|
+
function xi(e) {
|
|
3262
|
+
const { r: t, s: n } = Qt.Signature.fromCompact(e.slice(2, 130)), r = +`0x${e.slice(130)}`, [s, a] = (() => {
|
|
3513
3263
|
if (r === 0 || r === 1)
|
|
3514
3264
|
return [void 0, r];
|
|
3515
3265
|
if (r === 27)
|
|
@@ -3519,42 +3269,37 @@ function eo(e) {
|
|
|
3519
3269
|
throw new Error("Invalid yParityOrV value");
|
|
3520
3270
|
})();
|
|
3521
3271
|
return typeof s < "u" ? {
|
|
3522
|
-
r:
|
|
3523
|
-
s:
|
|
3272
|
+
r: B(t, { size: 32 }),
|
|
3273
|
+
s: B(n, { size: 32 }),
|
|
3524
3274
|
v: s,
|
|
3525
3275
|
yParity: a
|
|
3526
3276
|
} : {
|
|
3527
|
-
r:
|
|
3528
|
-
s:
|
|
3277
|
+
r: B(t, { size: 32 }),
|
|
3278
|
+
s: B(n, { size: 32 }),
|
|
3529
3279
|
yParity: a
|
|
3530
3280
|
};
|
|
3531
3281
|
}
|
|
3532
3282
|
export {
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
ke as r,
|
|
3555
|
-
Qi as s,
|
|
3556
|
-
Yi as t,
|
|
3557
|
-
Ge as u,
|
|
3558
|
-
Zi as w,
|
|
3283
|
+
ua as B,
|
|
3284
|
+
te as E,
|
|
3285
|
+
aa as F,
|
|
3286
|
+
ha as W,
|
|
3287
|
+
yt as a,
|
|
3288
|
+
di as b,
|
|
3289
|
+
Ai as c,
|
|
3290
|
+
ya as d,
|
|
3291
|
+
Za as e,
|
|
3292
|
+
st as f,
|
|
3293
|
+
fe as g,
|
|
3294
|
+
yi as h,
|
|
3295
|
+
wi as i,
|
|
3296
|
+
xi as j,
|
|
3297
|
+
Ka as k,
|
|
3298
|
+
ma as l,
|
|
3299
|
+
Le as m,
|
|
3300
|
+
Oe as n,
|
|
3301
|
+
gt as p,
|
|
3302
|
+
vi as s,
|
|
3303
|
+
gi as w,
|
|
3559
3304
|
O as z
|
|
3560
3305
|
};
|