@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.
Files changed (138) hide show
  1. package/README.md +202 -256
  2. package/dist/{add-KF4m4jFK.js → add-sji6scSD.js} +1 -1
  3. package/dist/{all-wallets-D6NAjQgX.js → all-wallets-B4H-890E.js} +1 -1
  4. package/dist/{app-store-D7TTn-EO.js → app-store-Z433s97G.js} +1 -1
  5. package/dist/{apple-DjX2E2hE.js → apple-b8Lxj7nb.js} +1 -1
  6. package/dist/{arrow-bottom-C0YrNJYB.js → arrow-bottom-M9oWWo_9.js} +1 -1
  7. package/dist/{arrow-bottom-circle-Dlxvx_XG.js → arrow-bottom-circle-N9c4CXY1.js} +1 -1
  8. package/dist/{arrow-left-x8_-lUyK.js → arrow-left-Dw8AKfwf.js} +1 -1
  9. package/dist/{arrow-right-BTZybj80.js → arrow-right-DwLQZSC_.js} +1 -1
  10. package/dist/{arrow-top-LzH7iLCp.js → arrow-top-zhUjkBe1.js} +1 -1
  11. package/dist/{bank-23jp-IV_.js → bank-CbQdnILK.js} +1 -1
  12. package/dist/{browser-EjoorDid.js → browser-xAqNwt7z.js} +1 -1
  13. package/dist/{card-DGgWwtwC.js → card-Dr1QBmWp.js} +1 -1
  14. package/dist/{ccip-BMANewTU.js → ccip-BIGqktC1.js} +6 -6
  15. package/dist/{checkmark-B1qcQhBo.js → checkmark-BhT1dTgG.js} +1 -1
  16. package/dist/{checkmark-bold-Cyc4IEEJ.js → checkmark-bold-CPB29wqQ.js} +1 -1
  17. package/dist/{chevron-bottom-ClHs08rB.js → chevron-bottom-BhNyx2II.js} +1 -1
  18. package/dist/{chevron-left-O8h_551_.js → chevron-left-CGuEjQlY.js} +1 -1
  19. package/dist/{chevron-right-DP3xpyIA.js → chevron-right-CvIRRsqZ.js} +1 -1
  20. package/dist/{chevron-top-CuwkBUs9.js → chevron-top-RSzCqjBd.js} +1 -1
  21. package/dist/{chrome-store-zfT_aJ3R.js → chrome-store-Cs8dAgs0.js} +1 -1
  22. package/dist/{clock-DHZqivIS.js → clock-fhZO5otC.js} +1 -1
  23. package/dist/{close-Cp9rNAw4.js → close-BPuztrdR.js} +1 -1
  24. package/dist/{coinPlaceholder-U7-T1KKQ.js → coinPlaceholder-C8X2i7Kh.js} +1 -1
  25. package/dist/{compass-Ds5-PRSR.js → compass-WMc5huk0.js} +1 -1
  26. package/dist/{copy-Jg4HdIMf.js → copy-DVAeT17y.js} +1 -1
  27. package/dist/core/api.d.ts +10 -1
  28. package/dist/core/wallet.d.ts +23 -2
  29. package/dist/{cursor-DmMevduB.js → cursor-BJ4YLXfy.js} +1 -1
  30. package/dist/{cursor-transparent-Dn9-1SV8.js → cursor-transparent-DN2fLQN4.js} +1 -1
  31. package/dist/dcp-sdk.umd.js +603 -603
  32. package/dist/dcp.d.ts +11 -1
  33. package/dist/{desktop-C4udXXlZ.js → desktop-6avxisBw.js} +1 -1
  34. package/dist/{disconnect-wd1BYLxt.js → disconnect-AReVI8Gk.js} +1 -1
  35. package/dist/{discord-DthxuCAP.js → discord-CxrI30BZ.js} +1 -1
  36. package/dist/{email-B3jSnUFE.js → email-B8dIIaay.js} +24 -24
  37. package/dist/{embedded-wallet-CJHmoBI2.js → embedded-wallet-C_5hF7rM.js} +24 -24
  38. package/dist/{etherscan-Cjp4xfMW.js → etherscan-BnAy8cIF.js} +1 -1
  39. package/dist/{exclamation-triangle-CRNR5WOy.js → exclamation-triangle-Bu7nHwx9.js} +1 -1
  40. package/dist/{extension-Cydk0mZt.js → extension-F0LIhvcf.js} +1 -1
  41. package/dist/{external-link-CuPTAoq9.js → external-link-CP6phyaM.js} +1 -1
  42. package/dist/{facebook-CghqXmdf.js → facebook-BtQ-Io2y.js} +1 -1
  43. package/dist/{farcaster-BREqMX4y.js → farcaster-BmaN1ugd.js} +1 -1
  44. package/dist/{filters-Dn_Ys7ew.js → filters-DpEwoOmy.js} +1 -1
  45. package/dist/{github-C-A7JmIY.js → github-q7qO9V-b.js} +1 -1
  46. package/dist/{google-CCdM_naE.js → google-DH_ZE8bW.js} +1 -1
  47. package/dist/{hashTypedData-D2Qmzscs.js → hashTypedData-ZH9ZnWu3.js} +6 -6
  48. package/dist/{help-circle-DIH4vyj3.js → help-circle-BAQVmKas.js} +1 -1
  49. package/dist/{id-DkJ0gBuy.js → id-Cj68Zwgo.js} +1 -1
  50. package/dist/{if-defined-BciplFKz.js → if-defined-CNte9B3N.js} +89 -89
  51. package/dist/{image-qMjyiXM0.js → image-BKJDw6N-.js} +1 -1
  52. package/dist/{index-BpXOsxzU.js → index-5mp7WkhV.js} +2 -2
  53. package/dist/{index-CX60z_g2.js → index-7toZMdtG.js} +32 -32
  54. package/dist/{index-CMPIqsB1.js → index-B1uKzdvN.js} +3 -3
  55. package/dist/{index-eW8y-mXH.js → index-BHFZVF-b.js} +3 -3
  56. package/dist/{index-DiHImG4L.js → index-BJ7cbG3N.js} +12400 -11573
  57. package/dist/{index-CqVegmN4.js → index-BKwa5JSA.js} +10 -10
  58. package/dist/{index-D-IzHD_8.js → index-BP4B9VUt.js} +2 -2
  59. package/dist/{index-DmOMXRG1.js → index-BVdzXHpO.js} +11 -11
  60. package/dist/{index-B2iDt0TJ.js → index-BYND0GJ9.js} +2 -2
  61. package/dist/{index-lbhz9evJ.js → index-BaJ0zEbh.js} +2 -2
  62. package/dist/{index-B7K86vWu.js → index-BdSIrl-R.js} +38 -38
  63. package/dist/{index-C4BX3QW8.js → index-Bh0MPFwP.js} +3 -3
  64. package/dist/{index-BBkcvSiY.js → index-Bsh7_qTp.js} +53 -53
  65. package/dist/{index-DoSYqTQg.js → index-BwnXTNNg.js} +3 -3
  66. package/dist/{index-Ij6XA6_4.js → index-C0kPDbg_.js} +2 -2
  67. package/dist/{index-fxzIDZsb.js → index-CKikVKe2.js} +2 -2
  68. package/dist/{index-SzyBYfzA.js → index-CPTcEPbD.js} +1582 -1881
  69. package/dist/{index-C27dwOyE.js → index-ChVh0Hkp.js} +3 -3
  70. package/dist/{index-CwB_qRfM.js → index-Cle_NnnS.js} +6 -6
  71. package/dist/{index-CUdQyyFn.js → index-CmWdvIFT.js} +2 -2
  72. package/dist/{index-1adX-Fit.js → index-D2AMA8Bu.js} +2 -2
  73. package/dist/{index-CTYngdl0.js → index-D5r0iSq4.js} +1 -1
  74. package/dist/index-D6h-qfpt.js +276 -0
  75. package/dist/{index-CppCc1n8.js → index-DAUM8CO4.js} +2 -2
  76. package/dist/{index-DtCsAVBg.js → index-DGjZW6uR.js} +2 -2
  77. package/dist/{index-CxOF7GqE.js → index-DQe94z7X.js} +3 -3
  78. package/dist/{index-AvC0IGDl.js → index-DTo6w99t.js} +101 -101
  79. package/dist/{index-B5zkXsLJ.js → index-DYdXjap2.js} +9 -9
  80. package/dist/{index-BdjxQs66.js → index-DceCxNV5.js} +5 -5
  81. package/dist/{index-Da8oZh8H.js → index-DobBVPe4.js} +14 -14
  82. package/dist/{index-DRNiFv9I.js → index-Dy4NyE6l.js} +7 -7
  83. package/dist/{index-Bijd4_Ns.js → index-Uw9cSw0q.js} +3 -3
  84. package/dist/{index-DpHXq5_E.js → index-f3LXSfM5.js} +6 -6
  85. package/dist/{index--3Zp0jAb.js → index-qiuyrukh.js} +2 -2
  86. package/dist/{index-CuiyMA8F.js → index-zddvaohA.js} +3 -3
  87. package/dist/index.d.ts +1 -1
  88. package/dist/index.js +1 -1
  89. package/dist/{info-DMIGgjkL.js → info-RfPsmroW.js} +1 -1
  90. package/dist/{info-circle-CJuIKZSx.js → info-circle-DFKHB_ZN.js} +1 -1
  91. package/dist/{lightbulb-qFT6WEWV.js → lightbulb-B-Bykj9X.js} +1 -1
  92. package/dist/{localBatchGatewayRequest-CsMVMFBc.js → localBatchGatewayRequest-CjGcn5nM.js} +1 -1
  93. package/dist/{mail-DoYgQvOt.js → mail-mBAgGuw5.js} +1 -1
  94. package/dist/{mobile-URtsh7o-.js → mobile-Dhh3ndkf.js} +1 -1
  95. package/dist/{more-DoQd10TF.js → more-D1h7UTvg.js} +1 -1
  96. package/dist/{network-placeholder-BBA2Ue6C.js → network-placeholder-Dqynvc-t.js} +1 -1
  97. package/dist/{nftPlaceholder-C9RXWz9k.js → nftPlaceholder-Df7MW4MM.js} +1 -1
  98. package/dist/{off-YcuDQczT.js → off-BmG3cHTX.js} +1 -1
  99. package/dist/{onramp-BfqDIx4o.js → onramp-C401Aenb.js} +46 -46
  100. package/dist/{parseSignature-280HB24T.js → parseSignature-S8VEpRHC.js} +967 -1222
  101. package/dist/{play-store-sFaloG_r.js → play-store-4q1fzL_P.js} +1 -1
  102. package/dist/{plus-l0wekSht.js → plus-603Gs3yG.js} +1 -1
  103. package/dist/{qr-code-CihrUU4G.js → qr-code-Dgwhf6M1.js} +1 -1
  104. package/dist/{receive-dfY1Cu-g.js → receive-CYXbbEUR.js} +10 -10
  105. package/dist/{recycle-horizontal-nXu6YaPw.js → recycle-horizontal-Bu8zZ563.js} +1 -1
  106. package/dist/{ref-huAzXCX0.js → ref-DpmKRWBK.js} +2 -2
  107. package/dist/{refresh-D2ZbVeNC.js → refresh-BMZFu0mu.js} +1 -1
  108. package/dist/{reown-logo-BMaTMJmc.js → reown-logo-BXph7ThY.js} +1 -1
  109. package/dist/{search-YVM9q3J-.js → search-Cm_V42Y_.js} +1 -1
  110. package/dist/{secp256k1-DPQgTBwQ.js → secp256k1-C0iX1TUr.js} +19 -19
  111. package/dist/{secp256k1-BrysY3Sv.js → secp256k1-DOQBqE4Z.js} +1 -1
  112. package/dist/{send-BwQZPKxI.js → send-BSMYxDuP.js} +1 -1
  113. package/dist/{send-GyetMVu1.js → send-C8EeIzRB.js} +20 -20
  114. package/dist/{socials-B0W91J9k.js → socials-DQrHQajs.js} +15 -15
  115. package/dist/{swapHorizontal-Dy_oQEkp.js → swapHorizontal-98rnJewS.js} +1 -1
  116. package/dist/{swapHorizontalBold-C4JpaMpc.js → swapHorizontalBold-C299FjEt.js} +1 -1
  117. package/dist/{swapHorizontalMedium-D5NuVZFh.js → swapHorizontalMedium-Cqm6i4WJ.js} +1 -1
  118. package/dist/{swapHorizontalRoundedBold-Bq4P2MCj.js → swapHorizontalRoundedBold-De7hFfqZ.js} +1 -1
  119. package/dist/{swapVertical-CVQ8Mg03.js → swapVertical-DSL75l8L.js} +1 -1
  120. package/dist/{swaps-CA04SSdK.js → swaps-BuTNp65Y.js} +24 -24
  121. package/dist/{telegram-BP4SgW_L.js → telegram-cJP7hgUb.js} +1 -1
  122. package/dist/{three-dots-BJYGJ-dQ.js → three-dots-DHnEh28O.js} +1 -1
  123. package/dist/{transactions-Bq-98Tsg.js → transactions-DujFkB-M.js} +3 -3
  124. package/dist/{twitch-DTATWo9M.js → twitch-CR2iGcBo.js} +1 -1
  125. package/dist/{twitterIcon-D5UWPInb.js → twitterIcon-E5TAQjOn.js} +1 -1
  126. package/dist/types.d.ts +60 -0
  127. package/dist/ui/Modal.d.ts +3 -3
  128. package/dist/ui/index.d.ts +2 -2
  129. package/dist/{verify-Byvj8Wi1.js → verify-DEukUJp0.js} +1 -1
  130. package/dist/{verify-filled-B40taNm0.js → verify-filled-BXsx1i_p.js} +1 -1
  131. package/dist/{w3m-modal-HV6SE74G.js → w3m-modal-Bm7BqVng.js} +40 -40
  132. package/dist/{wallet-Cp-6Kk88.js → wallet-CzyyvdrT.js} +1 -1
  133. package/dist/{wallet-placeholder-C3juwA9o.js → wallet-placeholder-BrcmyGEe.js} +1 -1
  134. package/dist/{walletconnect-CRkIiLCx.js → walletconnect-BSYogWiE.js} +1 -1
  135. package/dist/{warning-circle-DtvCLwG4.js → warning-circle-Cgp2BW3m.js} +1 -1
  136. package/dist/{x-Cqyx5eCt.js → x-BJinLpTw.js} +1 -1
  137. package/package.json +1 -1
  138. package/dist/index-B2-vKLd8.js +0 -276
@@ -1,50 +1,50 @@
1
- import { dT as yt, dU as _t, dV as Ut, I as _n, dW as gt, dX as wt, dY as vt, a as Un, dZ as Dn, d_ as X, d$ as B, e0 as V, e1 as Dt, e2 as Mn, e3 as Vn, e4 as G, e5 as re, e6 as L, e7 as ue, e8 as Mt, e9 as qn, ea as We, eb as _, ec as jn, ed as Gn, ee as Hn, ef as Wn, eg as _e, a1 as F, bl as Vt, M as xt, cZ as Zn, ci as Jn, cf as Pe, bZ as qt, bi as jt, eh as Ze, c0 as y, bk as q, ei as I, ej as Gt, ek as be, c4 as Je, c7 as H, bm as Ht, cM as Ye, bh as Ee, cq as fe, el as de, em as Ie, en as Ke, eo as Be, aJ as Wt, ep as Qe, bg as Zt, V as Jt, W as Yt, bT as le, eq as Yn, bR as ee, bM as te, bL as Pt, er as Kn, cm as Qn, aa as At, bE as Kt, b$ as he, bY as ce, bB as Qt, bA as Ne, es as Et, c2 as pe, et as Xt, eu as U, ev as It, ew as Xn, cr as en, cd as tn, ex as er, ey as tr, H as nr, bD as j, bq as Z, a0 as se, bF as Fe, c1 as rr, b_ as sr, da as ar, db as ir, T as or, ez as cr, $ as ur, a7 as Ce, w as Xe, ap as et, ax as fr, eA as dr, bI as lr, bJ as hr, eB as pr, eC as mr, eD as br, b7 as yr, cs as gr, c3 as ne, bs as wr, bu as vr, bt as xr, bw as Pr, b5 as Ar, br as tt, eE as Er, bp as nn, eF as Ir, bW as rn, eG as sn, eH as Br, eI as Nr, c6 as Cr, E as Tr, ad as $r, eJ as kr, az as zr, t as Rr, co as Sr, r as Fr, eK as Lr, eL as an, q as Bt, bj as Or, v as _r, a8 as Ur, bS as Dr, a9 as Mr, eM as oe, cc as Vr, eN as qr, eO as jr, eP as Gr, eQ as Hr, eR as Wr, eS as Zr, eT as Jr, eU as Yr, eV as Kr, eW as Qr, eX as Xr, eY as es, eZ as ts, e_ as ns, e$ as rs, f0 as ss, j as as } from "./index-DiHImG4L.js";
2
- import { l as nt } from "./localBatchGatewayRequest-CsMVMFBc.js";
3
- import { s as on } from "./secp256k1-BrysY3Sv.js";
4
- import { h as cn, e as is } from "./hashTypedData-D2Qmzscs.js";
5
- function Nt(e) {
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 = yt(e);
8
+ t = ot(e);
9
9
  else {
10
- const n = _t(e), r = e.length;
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 (!Ut(a)) {
14
- t = yt(a, n);
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 _n({ signature: e });
20
+ throw new kn({ signature: e });
21
21
  return t;
22
22
  }
23
- function Ct(e) {
23
+ function yt(e) {
24
24
  const t = [];
25
25
  if (typeof e == "string") {
26
- const n = gt(e), r = n.length;
26
+ const n = ct(e), r = n.length;
27
27
  for (let s = 0; s < r; s++)
28
- t.push(wt(n[s], { modifiers: vt }));
28
+ t.push(ut(n[s], { modifiers: ft }));
29
29
  } else {
30
- const n = _t(e), r = e.length;
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 (Ut(a))
33
+ if (Ct(a))
34
34
  continue;
35
- const i = gt(a), o = i.length;
35
+ const i = ct(a), o = i.length;
36
36
  for (let c = 0; c < o; c++)
37
- t.push(wt(i[c], { modifiers: vt, structs: n }));
37
+ t.push(ut(i[c], { modifiers: ft, structs: n }));
38
38
  }
39
39
  }
40
40
  if (t.length === 0)
41
- throw new Un({ params: e });
41
+ throw new Rn({ params: e });
42
42
  return t;
43
43
  }
44
- function ye(e, t) {
45
- if (Y(e) > t)
46
- throw new vs({
47
- givenSize: Y(e),
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 Tt(e) {
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 os(e, t = {}) {
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 xs({
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 un(e, t = {}) {
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 cs = /* @__PURE__ */ new TextDecoder(), us = /* @__PURE__ */ new TextEncoder();
92
- function fs(e) {
93
- return e instanceof Uint8Array ? e : typeof e == "string" ? fn(e) : ds(e);
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 ds(e) {
95
+ function Vr(e) {
96
96
  return e instanceof Uint8Array ? e : new Uint8Array(e);
97
97
  }
98
- function fn(e, t = {}) {
98
+ function tn(e, t = {}) {
99
99
  const { size: n } = t;
100
100
  let r = e;
101
- n && (Dn(e, n), r = X(e, 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 = Tt(s.charCodeAt(c++)), f = Tt(s.charCodeAt(c++));
106
+ const u = wt(s.charCodeAt(c++)), f = wt(s.charCodeAt(c++));
107
107
  if (u === void 0 || f === void 0)
108
- throw new B(`Invalid byte sequence ("${s[c - 2]}${s[c - 1]}" in "${s}").`);
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 ls(e, t = {}) {
114
- const { size: n } = t, r = us.encode(e);
115
- return typeof n == "number" ? (ye(r, n), hs(r, n)) : r;
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 hs(e, t) {
118
- return os(e, { dir: "right", size: t });
117
+ function Hr(e, t) {
118
+ return Dr(e, { dir: "right", size: t });
119
119
  }
120
- function Y(e) {
120
+ function Z(e) {
121
121
  return e.length;
122
122
  }
123
- function ps(e, t, n, r = {}) {
123
+ function Gr(e, t, n, r = {}) {
124
124
  const { strict: s } = r;
125
125
  return e.slice(t, n);
126
126
  }
127
- function ms(e, t = {}) {
127
+ function Zr(e, t = {}) {
128
128
  const { size: n } = t;
129
- typeof n < "u" && ye(e, n);
130
- const r = V(e, t);
131
- return Mn(r, t);
129
+ typeof n < "u" && ue(e, n);
130
+ const r = q(e, t);
131
+ return Tn(r, t);
132
132
  }
133
- function bs(e, t = {}) {
133
+ function Jr(e, t = {}) {
134
134
  const { size: n } = t;
135
135
  let r = e;
136
- if (typeof n < "u" && (ye(r, n), r = dn(r)), r.length > 1 || r[0] > 1)
137
- throw new ws(r);
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" && ye(e, n);
143
- const r = V(e, t);
144
- return Dt(r, t);
142
+ typeof n < "u" && ue(e, n);
143
+ const r = q(e, t);
144
+ return kt(r, t);
145
145
  }
146
- function ys(e, t = {}) {
146
+ function Yr(e, t = {}) {
147
147
  const { size: n } = t;
148
148
  let r = e;
149
- return typeof n < "u" && (ye(r, n), r = gs(r)), cs.decode(r);
149
+ return typeof n < "u" && (ue(r, n), r = Kr(r)), Mr.decode(r);
150
150
  }
151
- function dn(e) {
152
- return un(e, { dir: "left" });
151
+ function nn(e) {
152
+ return en(e, { dir: "left" });
153
153
  }
154
- function gs(e) {
155
- return un(e, { dir: "right" });
154
+ function Kr(e) {
155
+ return en(e, { dir: "right" });
156
156
  }
157
- class ws extends B {
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 vs extends B {
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 xs extends B {
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 Ps extends Map {
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 As = {
213
- checksum: /* @__PURE__ */ new Ps(8192)
214
- }, Le = As.checksum;
215
- function ln(e, t = {}) {
216
- const { as: n = typeof e == "string" ? "Hex" : "Bytes" } = t, r = Vn(fs(e));
217
- return n === "Bytes" ? r : V(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 Es = /^0x[a-fA-F0-9]{40}$/;
220
- function Te(e, t = {}) {
219
+ const rs = /^0x[a-fA-F0-9]{40}$/;
220
+ function xe(e, t = {}) {
221
221
  const { strict: n = !0 } = t;
222
- if (!Es.test(e))
223
- throw new $t({
222
+ if (!rs.test(e))
223
+ throw new vt({
224
224
  address: e,
225
- cause: new Is()
225
+ cause: new ss()
226
226
  });
227
227
  if (n) {
228
228
  if (e.toLowerCase() === e)
229
229
  return;
230
- if (hn(e) !== e)
231
- throw new $t({
230
+ if (sn(e) !== e)
231
+ throw new vt({
232
232
  address: e,
233
- cause: new Bs()
233
+ cause: new as()
234
234
  });
235
235
  }
236
236
  }
237
- function hn(e) {
238
- if (Le.has(e))
239
- return Le.get(e);
240
- Te(e, { strict: !1 });
241
- const t = e.substring(2).toLowerCase(), n = ln(ls(t), { as: "Bytes" }), r = t.split("");
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 Le.set(e, s), s;
245
+ return $e.set(e, s), s;
246
246
  }
247
- function Ue(e, t = {}) {
247
+ function Re(e, t = {}) {
248
248
  const { strict: n = !0 } = t ?? {};
249
249
  try {
250
- return Te(e, { strict: n }), !0;
250
+ return xe(e, { strict: n }), !0;
251
251
  } catch {
252
252
  return !1;
253
253
  }
254
254
  }
255
- class $t extends B {
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 Is extends B {
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 Bs extends B {
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 Ns = /^(.*)\[([0-9]*)\]$/, Cs = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, pn = /^(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)?$/, kt = 2n ** 256n - 1n;
288
- function Q(e, t, n) {
289
- const { checksumAddress: r, staticPosition: s } = n, a = at(t.type);
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 $s(e, { ...t, type: o }, { checksumAddress: r, length: i, staticPosition: s });
292
+ return us(e, { ...t, type: o }, { checksumAddress: r, length: i, staticPosition: s });
293
293
  }
294
294
  if (t.type === "tuple")
295
- return Ss(e, t, {
295
+ return hs(e, t, {
296
296
  checksumAddress: r,
297
297
  staticPosition: s
298
298
  });
299
299
  if (t.type === "address")
300
- return Ts(e, { checksum: r });
300
+ return cs(e, { checksum: r });
301
301
  if (t.type === "bool")
302
- return ks(e);
302
+ return fs(e);
303
303
  if (t.type.startsWith("bytes"))
304
- return zs(e, t, { staticPosition: s });
304
+ return ds(e, t, { staticPosition: s });
305
305
  if (t.type.startsWith("uint") || t.type.startsWith("int"))
306
- return Rs(e, t);
306
+ return ls(e, t);
307
307
  if (t.type === "string")
308
- return Fs(e, { staticPosition: s });
309
- throw new ot(t.type);
308
+ return ps(e, { staticPosition: s });
309
+ throw new Qe(t.type);
310
310
  }
311
- const zt = 32, De = 32;
312
- function Ts(e, t = {}) {
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 ? hn(a) : a)(V(ps(r, -20))), 32];
314
+ return [((a) => n ? sn(a) : a)(q(Gr(r, -20))), 32];
315
315
  }
316
- function $s(e, t, n) {
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(De)), u = a + c, f = u + zt;
319
+ const c = M(e.readBytes(Se)), u = a + c, f = u + xt;
320
320
  e.setPosition(u);
321
- const d = M(e.readBytes(zt)), l = me(t);
321
+ const d = M(e.readBytes(xt)), l = oe(t);
322
322
  let h = 0;
323
- const g = [];
324
- for (let v = 0; v < d; ++v) {
325
- e.setPosition(f + (l ? v * 32 : h));
326
- const [p, m] = Q(e, t, {
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, g.push(p);
330
+ h += m, b.push(p);
331
331
  }
332
- return e.setPosition(a + 32), [g, 32];
332
+ return e.setPosition(a + 32), [b, 32];
333
333
  }
334
- if (me(t)) {
335
- const c = M(e.readBytes(De)), u = a + c, f = [];
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] = Q(e, t, {
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] = Q(e, t, {
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 ks(e) {
358
- return [bs(e.readBytes(32), { size: 32 }), 32];
357
+ function fs(e) {
358
+ return [Jr(e.readBytes(32), { size: 32 }), 32];
359
359
  }
360
- function zs(e, t, { staticPosition: n }) {
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), [V(c), 32];
369
+ return e.setPosition(n + 32), [q(c), 32];
370
370
  }
371
- return [V(e.readBytes(Number.parseInt(s, 10), 32)), 32];
371
+ return [q(e.readBytes(Number.parseInt(s, 10), 32)), 32];
372
372
  }
373
- function Rs(e, t) {
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 ? ms(s, { signed: n }) : M(s, { signed: n }),
376
+ r > 48 ? Zr(s, { signed: n }) : M(s, { signed: n }),
377
377
  32
378
378
  ];
379
379
  }
380
- function Ss(e, t, n) {
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 (me(t)) {
384
- const c = M(e.readBytes(De)), u = s + c;
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] = Q(e, d, {
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] = Q(e, u, {
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 Fs(e, { staticPosition: t }) {
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 = ys(dn(a));
411
+ const a = e.readBytes(s, 32), i = Yr(nn(a));
412
412
  return e.setPosition(t + 32), [i, 32];
413
413
  }
414
- function Ls({ checksumAddress: e, parameters: t, values: n }) {
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(rt({
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 rt({ checksumAddress: e = !1, parameter: t, value: n }) {
425
- const r = t, s = at(r.type);
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 _s(n, {
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 qs(n, {
438
+ return xs(n, {
439
439
  checksumAddress: e,
440
440
  parameter: r
441
441
  });
442
442
  if (r.type === "address")
443
- return Os(n, {
443
+ return bs(n, {
444
444
  checksum: e
445
445
  });
446
446
  if (r.type === "bool")
447
- return Ds(n);
447
+ return ws(n);
448
448
  if (r.type.startsWith("uint") || r.type.startsWith("int")) {
449
- const a = r.type.startsWith("int"), [, , i = "256"] = pn.exec(r.type) ?? [];
450
- return Ms(n, {
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 Us(n, { type: r.type });
456
+ return ys(n, { type: r.type });
457
457
  if (r.type === "string")
458
- return Vs(n);
459
- throw new ot(r.type);
458
+ return As(n);
459
+ throw new Qe(r.type);
460
460
  }
461
- function st(e) {
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 += G(o);
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(re(t + s, { size: 32 })), r.push(o), s += G(o)) : n.push(o);
471
+ i ? (n.push(X(t + s, { size: 32 })), r.push(o), s += V(o)) : n.push(o);
472
472
  }
473
- return L(...n, ...r);
473
+ return F(...n, ...r);
474
474
  }
475
- function Os(e, t) {
475
+ function bs(e, t) {
476
476
  const { checksum: n = !1 } = t;
477
- return Te(e, { strict: n }), {
477
+ return xe(e, { strict: n }), {
478
478
  dynamic: !1,
479
- encoded: ue(e.toLowerCase())
479
+ encoded: se(e.toLowerCase())
480
480
  };
481
481
  }
482
- function _s(e, t) {
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 Qs(e);
485
+ throw new Rs(e);
486
486
  if (!a && e.length !== r)
487
- throw new Ks({
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 = rt({
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 = st(o);
503
+ const c = Je(o);
504
504
  if (a) {
505
- const u = re(o.length, { size: 32 });
505
+ const u = X(o.length, { size: 32 });
506
506
  return {
507
507
  dynamic: !0,
508
- encoded: o.length > 0 ? L(u, c) : u
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: L(...o.map(({ encoded: c }) => c))
516
+ encoded: F(...o.map(({ encoded: c }) => c))
517
517
  };
518
518
  }
519
- function Us(e, { type: t }) {
520
- const [, n] = t.split("bytes"), r = G(e);
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 = X(s, Math.ceil((e.length - 2) / 2 / 32) * 32)), {
523
+ return r % 32 !== 0 && (s = K(s, Math.ceil((e.length - 2) / 2 / 32) * 32)), {
524
524
  dynamic: !0,
525
- encoded: L(ue(re(r, { size: 32 })), s)
525
+ encoded: F(se(X(r, { size: 32 })), s)
526
526
  };
527
527
  }
528
528
  if (r !== Number.parseInt(n, 10))
529
- throw new bn({
529
+ throw new cn({
530
530
  expectedSize: Number.parseInt(n, 10),
531
531
  value: e
532
532
  });
533
- return { dynamic: !1, encoded: X(e) };
533
+ return { dynamic: !1, encoded: K(e) };
534
534
  }
535
- function Ds(e) {
535
+ function ws(e) {
536
536
  if (typeof e != "boolean")
537
- throw new B(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
538
- return { dynamic: !1, encoded: ue(Mt(e)) };
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 Ms(e, { signed: t, size: n }) {
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 qn({
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: re(e, {
554
+ encoded: X(e, {
555
555
  size: 32,
556
556
  signed: t
557
557
  })
558
558
  };
559
559
  }
560
- function Vs(e) {
561
- const t = We(e), n = Math.ceil(G(t) / 32), r = [];
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(X(_(t, s * 32, (s + 1) * 32)));
563
+ r.push(K(L(t, s * 32, (s + 1) * 32)));
564
564
  return {
565
565
  dynamic: !0,
566
- encoded: L(X(re(G(t), { size: 32 })), ...r)
566
+ encoded: F(K(X(V(t), { size: 32 })), ...r)
567
567
  };
568
568
  }
569
- function qs(e, t) {
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 = rt({
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 ? st(a) : L(...a.map(({ encoded: i }) => i))
583
+ encoded: s ? Je(a) : F(...a.map(({ encoded: i }) => i))
584
584
  };
585
585
  }
586
- function at(e) {
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 me(e) {
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(me);
600
- const n = at(e.type);
601
- return !!(n && me({
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 js = {
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 Ws({
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 Hs({
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 Rt({ offset: e });
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 Rt({ offset: e });
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 Gs(e, { recursiveReadLimit: t = 8192 } = {}) {
729
- const n = Object.create(js);
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 Rt extends B {
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 Hs extends B {
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 Ws extends B {
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 Zs(e, t, n = {}) {
763
- const { as: r = "Array", checksumAddress: s = !1 } = n, a = typeof t == "string" ? fn(t) : t, i = Gs(a);
764
- if (Y(a) === 0 && e.length > 0)
765
- throw new Ys();
766
- if (Y(a) && Y(a) < 32)
767
- throw new Js({
768
- data: typeof t == "string" ? t : V(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: Y(a)
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] = Q(i, f, {
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 it(e, t, n) {
785
+ function Ke(e, t, n) {
786
786
  const { checksumAddress: r = !1 } = {};
787
787
  if (e.length !== t.length)
788
- throw new yn({
788
+ throw new un({
789
789
  expectedLength: e.length,
790
790
  givenLength: t.length
791
791
  });
792
- const s = Ls({
792
+ const s = ms({
793
793
  checksumAddress: r,
794
794
  parameters: e,
795
795
  values: t
796
- }), a = st(s);
796
+ }), a = Je(s);
797
797
  return a.length === 0 ? "0x" : a;
798
798
  }
799
- function Me(e, t) {
799
+ function Te(e, t) {
800
800
  if (e.length !== t.length)
801
- throw new yn({
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(Me.encode(s, a));
808
+ n.push(Te.encode(s, a));
809
809
  }
810
- return L(...n);
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 Te(c), ue(c.toLowerCase(), s ? 32 : 0);
816
+ return xe(c), se(c.toLowerCase(), s ? 32 : 0);
817
817
  }
818
818
  if (n === "string")
819
- return We(r);
819
+ return Ue(r);
820
820
  if (n === "bytes")
821
821
  return r;
822
822
  if (n === "bool")
823
- return ue(Mt(r), s ? 32 : 1);
824
- const a = n.match(pn);
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 re(r, {
827
+ return X(r, {
828
828
  size: s ? 32 : d,
829
829
  signed: u === "int"
830
830
  });
831
831
  }
832
- const i = n.match(Cs);
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 bn({
836
+ throw new cn({
837
837
  expectedSize: Number.parseInt(u, 10),
838
838
  value: r
839
839
  });
840
- return X(r, s ? 32 : 0);
840
+ return K(r, s ? 32 : 0);
841
841
  }
842
- const o = n.match(Ns);
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" : L(...f);
847
+ return f.length === 0 ? "0x" : F(...f);
848
848
  }
849
- throw new ot(n);
849
+ throw new Qe(n);
850
850
  }
851
851
  e.encode = t;
852
- })(Me || (Me = {}));
853
- function mn(e) {
854
- return Array.isArray(e) && typeof e[0] == "string" || typeof e == "string" ? Ct(e) : e;
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 Js extends B {
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: (${jn(n)})`,
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 Ys extends B {
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 Ks extends B {
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 bn extends B {
891
+ class cn extends I {
892
892
  constructor({ expectedSize: t, value: n }) {
893
- super(`Size of bytes "${n}" (bytes${G(n)}) does not match expected size (bytes${t}).`), Object.defineProperty(this, "name", {
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 yn extends B {
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 Qs extends B {
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 ot extends B {
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 gn(e, t = {}) {
936
+ function fn(e, t = {}) {
937
937
  const { recovered: n } = t;
938
938
  if (typeof e.r > "u")
939
- throw new Oe({ signature: e });
939
+ throw new Ce({ signature: e });
940
940
  if (typeof e.s > "u")
941
- throw new Oe({ signature: e });
941
+ throw new Ce({ signature: e });
942
942
  if (n && typeof e.yParity > "u")
943
- throw new Oe({ signature: e });
944
- if (e.r < 0n || e.r > kt)
945
- throw new aa({ value: e.r });
946
- if (e.s < 0n || e.s > kt)
947
- throw new ia({ value: e.s });
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 ut({ value: e.yParity });
949
+ throw new et({ value: e.yParity });
950
950
  }
951
- function Xs(e) {
952
- return wn(V(e));
951
+ function Ss(e) {
952
+ return dn(q(e));
953
953
  }
954
- function wn(e) {
954
+ function dn(e) {
955
955
  if (e.length !== 130 && e.length !== 132)
956
- throw new sa({ signature: e });
957
- const t = BigInt(_(e, 0, 32)), n = BigInt(_(e, 32, 64)), r = (() => {
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 ct(s);
961
+ return Xe(s);
962
962
  } catch {
963
- throw new ut({ value: s });
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 ea(e) {
975
+ function Ts(e) {
976
976
  if (!(typeof e.r > "u") && !(typeof e.s > "u"))
977
- return ta(e);
977
+ return zs(e);
978
978
  }
979
- function ta(e) {
980
- const t = typeof e == "string" ? wn(e) : e instanceof Uint8Array ? Xs(e) : typeof e.r == "string" ? ra(e) : e.v ? na(e) : {
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 gn(t), t;
985
+ return fn(t), t;
986
986
  }
987
- function na(e) {
987
+ function Fs(e) {
988
988
  return {
989
989
  r: e.r,
990
990
  s: e.s,
991
- yParity: ct(e.v)
991
+ yParity: Xe(e.v)
992
992
  };
993
993
  }
994
- function ra(e) {
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 = ct(n)), typeof r != "number")
999
- throw new ut({ value: e.yParity });
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 ct(e) {
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 oa({ value: e });
1015
+ throw new Ds({ value: e });
1016
1016
  }
1017
- class sa extends B {
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 ${G(Hn(t))} bytes.`
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 Oe extends B {
1032
+ class Ce extends I {
1033
1033
  constructor({ signature: t }) {
1034
- super(`Signature \`${Gn(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`), Object.defineProperty(this, "name", {
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 aa extends B {
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 ia extends B {
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 ut extends B {
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 oa extends B {
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 ca(e, t = {}) {
1083
- return typeof e.chainId == "string" ? ua(e) : { ...e, ...t.signature };
1082
+ function Ms(e, t = {}) {
1083
+ return typeof e.chainId == "string" ? qs(e) : { ...e, ...t.signature };
1084
1084
  }
1085
- function ua(e) {
1086
- const { address: t, chainId: n, nonce: r } = e, s = ea(e);
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 fa = "0x8010801080108010801080108010801080108010801080108010801080108010", da = mn("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");
1095
- function vn(e) {
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 (_(e, -32) !== fa)
1098
- throw new pa(e);
1097
+ if (L(e, -32) !== js)
1098
+ throw new Gs(e);
1099
1099
  } else
1100
- gn(e.authorization);
1100
+ fn(e.authorization);
1101
1101
  }
1102
- function la(e) {
1103
- vn(e);
1104
- const t = Dt(_(e, -64, -32)), n = _(e, -t - 64, -64), r = _(e, 0, -t - 64), [s, a, i] = Zs(da, n);
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: ca({
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 ha(e) {
1118
+ function Hs(e) {
1119
1119
  try {
1120
- return vn(e), !0;
1120
+ return ln(e), !0;
1121
1121
  } catch {
1122
1122
  return !1;
1123
1123
  }
1124
1124
  }
1125
- let pa = class extends B {
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 Ve(e) {
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 B("Unable to normalize signature.");
1157
+ throw new I("Unable to normalize signature.");
1158
1158
  return s;
1159
1159
  }
1160
- function qe(e, t) {
1160
+ function Fe(e, t) {
1161
1161
  const n = typeof e, r = t.type;
1162
1162
  switch (r) {
1163
1163
  case "address":
1164
- return Ue(e, { strict: !1 });
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) => qe(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) => qe(s, {
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 xn(e, t, n) {
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 xn(s.components, a.components, n[r]);
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") ? Ue(n[r], {
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") ? Ue(n[r], {
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 Pn(e, t = {}) {
1194
- const { prepare: n = !0 } = t, r = Array.isArray(e) || typeof e == "string" ? Nt(e) : e;
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: K(r) } : {}
1197
+ ...n ? { hash: J(r) } : {}
1198
1198
  };
1199
1199
  }
1200
- function $e(e, t, n) {
1201
- const { args: r = [], prepare: s = !0 } = n ?? {}, a = Wn(t, { strict: !1 }), i = e.filter((u) => a ? u.type === "function" || u.type === "error" ? An(u) === _(t, 0, 4) : u.type === "event" ? K(u) === t : !1 : "name" in u && u.name === t);
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 Ae({ name: t });
1203
+ throw new be({ name: t });
1204
1204
  if (i.length === 1)
1205
1205
  return {
1206
1206
  ...i[0],
1207
- ...s ? { hash: K(i[0]) } : {}
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: K(u) } : {}
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 ? qe(d, h) : !1;
1225
+ return h ? Fe(d, h) : !1;
1226
1226
  })) {
1227
1227
  if (o && "inputs" in o && o.inputs) {
1228
- const d = xn(u.inputs, o.inputs, r);
1228
+ const d = hn(u.inputs, o.inputs, r);
1229
1229
  if (d)
1230
- throw new ba({
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 Ae({ name: t });
1248
+ throw new be({ name: t });
1249
1249
  return {
1250
1250
  ...c,
1251
- ...s ? { hash: K(c) } : {}
1251
+ ...s ? { hash: J(c) } : {}
1252
1252
  };
1253
1253
  }
1254
- function An(...e) {
1254
+ function mn(...e) {
1255
1255
  const t = (() => {
1256
1256
  if (Array.isArray(e[0])) {
1257
1257
  const [n, r] = e;
1258
- return $e(n, r);
1258
+ return Ee(n, r);
1259
1259
  }
1260
1260
  return e[0];
1261
1261
  })();
1262
- return _(K(t), 0, 4);
1262
+ return L(J(t), 0, 4);
1263
1263
  }
1264
- function ma(...e) {
1264
+ function Zs(...e) {
1265
1265
  const t = (() => {
1266
1266
  if (Array.isArray(e[0])) {
1267
1267
  const [r, s] = e;
1268
- return $e(r, s);
1268
+ return Ee(r, s);
1269
1269
  }
1270
1270
  return e[0];
1271
- })(), n = typeof t == "string" ? t : _e(t);
1272
- return Ve(n);
1271
+ })(), n = typeof t == "string" ? t : ke(t);
1272
+ return ze(n);
1273
1273
  }
1274
- function K(...e) {
1274
+ function J(...e) {
1275
1275
  const t = (() => {
1276
1276
  if (Array.isArray(e[0])) {
1277
1277
  const [n, r] = e;
1278
- return $e(n, r);
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 : ln(We(ma(t)));
1282
+ return typeof t != "string" && "hash" in t && t.hash ? t.hash : rn(Ue(Zs(t)));
1283
1283
  }
1284
- class ba extends B {
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 \`${Ve(_e(t.abiItem))}\`, and`,
1290
- `\`${n.type}\` in \`${Ve(_e(n.abiItem))}\``,
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 Ae extends B {
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 ya(...e) {
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 [wa(i), o];
1319
+ return [Qs(i), o];
1320
1320
  }
1321
1321
  return e;
1322
1322
  })(), { bytecode: r, args: s } = n;
1323
- return L(r, (a = t.inputs) != null && a.length && (s != null && s.length) ? it(t.inputs, s) : "0x");
1323
+ return F(r, (a = t.inputs) != null && a.length && (s != null && s.length) ? Ke(t.inputs, s) : "0x");
1324
1324
  }
1325
- function ga(e) {
1326
- return Pn(e);
1325
+ function Ks(e) {
1326
+ return pn(e);
1327
1327
  }
1328
- function wa(e) {
1328
+ function Qs(e) {
1329
1329
  const t = e.find((n) => n.type === "constructor");
1330
1330
  if (!t)
1331
- throw new Ae({ name: "constructor" });
1331
+ throw new be({ name: "constructor" });
1332
1332
  return t;
1333
1333
  }
1334
- function va(...e) {
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 [St(u, f, { args: d }), d];
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 ? St([t, ...r], t.name, {
1342
+ })(), { overloads: r } = t, s = r ? Pt([t, ...r], t.name, {
1343
1343
  args: n
1344
- }) : t, a = xa(s), i = n.length > 0 ? it(s.inputs, n) : void 0;
1345
- return i ? L(a, i) : a;
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 J(e, t = {}) {
1348
- return Pn(e, t);
1347
+ function G(e, t = {}) {
1348
+ return pn(e, t);
1349
1349
  }
1350
- function St(e, t, n) {
1351
- const r = $e(e, t, n);
1350
+ function Pt(e, t, n) {
1351
+ const r = Ee(e, t, n);
1352
1352
  if (r.type !== "function")
1353
- throw new Ae({ name: t, type: "function" });
1353
+ throw new be({ name: t, type: "function" });
1354
1354
  return r;
1355
1355
  }
1356
- function xa(e) {
1357
- return An(e);
1356
+ function ea(e) {
1357
+ return mn(e);
1358
1358
  }
1359
- const En = "0x6492649264926492649264926492649264926492649264926492649264926492";
1360
- function Pa(e) {
1361
- if (_(e, -32) !== En)
1362
- throw new Ia(e);
1359
+ const bn = "0x6492649264926492649264926492649264926492649264926492649264926492";
1360
+ function ta(e) {
1361
+ if (L(e, -32) !== bn)
1362
+ throw new sa(e);
1363
1363
  }
1364
- function Aa(e) {
1364
+ function na(e) {
1365
1365
  const { data: t, signature: n, to: r } = e;
1366
- return L(it(mn("address, bytes, bytes"), [
1366
+ return F(Ke(on("address, bytes, bytes"), [
1367
1367
  r,
1368
1368
  t,
1369
1369
  n
1370
- ]), En);
1370
+ ]), bn);
1371
1371
  }
1372
- function Ea(e) {
1372
+ function ra(e) {
1373
1373
  try {
1374
- return Pa(e), !0;
1374
+ return ta(e), !0;
1375
1375
  } catch {
1376
1376
  return !1;
1377
1377
  }
1378
1378
  }
1379
- class Ia extends B {
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 Ba extends F {
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 Ft = "/docs/contract/encodeEventTopics";
1397
- function ge(e) {
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 = Vt({ abi: t, name: n });
1402
+ const u = St({ abi: t, name: n });
1403
1403
  if (!u)
1404
- throw new xt(n, { docsPath: Ft });
1404
+ throw new dt(n, { docsPath: It });
1405
1405
  s = u;
1406
1406
  }
1407
1407
  if (s.type !== "event")
1408
- throw new xt(void 0, { docsPath: Ft });
1409
- const a = Zn(s), i = Jn(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, g) => Lt({ param: d, value: f[l][g] })) : typeof f[l] < "u" && f[l] !== null ? Lt({ param: d, value: f[l] }) : null)) ?? []);
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 Lt({ param: e, value: t }) {
1417
+ function Nt({ param: e, value: t }) {
1418
1418
  if (e.type === "string" || e.type === "bytes")
1419
- return Pe(qt(t));
1419
+ return he(Tt(t));
1420
1420
  if (e.type === "tuple" || e.type.match(/^(.*)\[(\d+)?\]$/))
1421
- throw new Ba(e.type);
1422
- return jt([e], [t]);
1421
+ throw new aa(e.type);
1422
+ return zt([e], [t]);
1423
1423
  }
1424
- async function In(e, t) {
1425
- const { address: n, abi: r, args: s, eventName: a, fromBlock: i, strict: o, toBlock: c } = t, u = Ze(e, {
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 ? ge({
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" ? y(i) : i,
1437
- toBlock: typeof c == "bigint" ? y(c) : c,
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 Na(e, t) {
1453
- const { abi: n, address: r, args: s, functionName: a, dataSuffix: i, ...o } = t, c = q({
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 I(e, Gt, "estimateGas")({
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 ? be(o.account) : void 0;
1466
- throw Je(u, {
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 ft(e, { address: t, blockHash: n, fromBlock: r, toBlock: s, event: a, events: i, args: o, strict: c } = {}) {
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((v) => ge({
1480
- abi: [v],
1481
- eventName: v.name,
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" ? y(r) : r,
1495
- toBlock: typeof s == "bigint" ? y(s) : s
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((g) => H(g));
1500
- return f ? Ht({
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 Bn(e, t) {
1508
- const { abi: n, address: r, args: s, blockHash: a, eventName: i, fromBlock: o, toBlock: c, strict: u } = t, f = i ? Vt({ abi: n, name: i }) : void 0, d = f ? void 0 : n.filter((l) => l.type === "event");
1509
- return I(e, ft, "getLogs")({
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 Ca(e, t) {
1521
- const { abi: n, address: r, args: s, dataSuffix: a, functionName: i, ...o } = t, c = o.account ? be(o.account) : e.account, u = q({ abi: n, args: s, functionName: i });
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 I(e, Ye, "call")({
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 = Ee({
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 Je(f, {
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 Ta(e, t) {
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 = fe([
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 de(m, { onLogs: u, onError: c }, (w) => {
1573
- let b;
1574
- o !== void 0 && (b = o - 1n);
1575
- let x, N = !1;
1576
- const T = Ie(async () => {
1577
- var A;
1578
- if (!N) {
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
- x = await I(e, In, "createContractEventFilter")({
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
- N = !0;
1590
+ $ = !0;
1591
1591
  return;
1592
1592
  }
1593
1593
  try {
1594
1594
  let E;
1595
- if (x)
1596
- E = await I(e, Ke, "getFilterChanges")({ filter: x });
1595
+ if (A)
1596
+ E = await P(e, je, "getFilterChanges")({ filter: A });
1597
1597
  else {
1598
- const C = await I(e, Be, "getBlockNumber")({});
1599
- b && b < C ? E = await I(e, Bn, "getContractEvents")({
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: b + 1n,
1605
- toBlock: C,
1604
+ fromBlock: g + 1n,
1605
+ toBlock: N,
1606
1606
  strict: p
1607
- }) : E = [], b = C;
1607
+ }) : E = [], g = N;
1608
1608
  }
1609
1609
  if (E.length === 0)
1610
1610
  return;
1611
1611
  if (a)
1612
- w.onLogs(E);
1612
+ y.onLogs(E);
1613
1613
  else
1614
- for (const C of E)
1615
- w.onLogs([C]);
1614
+ for (const N of E)
1615
+ y.onLogs([N]);
1616
1616
  } catch (E) {
1617
- x && E instanceof Wt && (N = !1), (A = w.onError) == null || A.call(w, E);
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
- x && await I(e, Qe, "uninstallFilter")({ filter: x }), T();
1624
+ A && await P(e, Ve, "uninstallFilter")({ filter: A }), C();
1625
1625
  };
1626
1626
  });
1627
1627
  })() : (() => {
1628
- const p = l ?? !1, m = fe([
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 w = !0, b = () => w = !1;
1639
- return de(m, { onLogs: u, onError: c }, (x) => ((async () => {
1638
+ let y = !0, g = () => y = !1;
1639
+ return ie(m, { onLogs: u, onError: c }, (A) => ((async () => {
1640
1640
  try {
1641
- const N = (() => {
1641
+ const $ = (() => {
1642
1642
  if (e.transport.type === "fallback") {
1643
- const E = e.transport.transports.find((C) => C.config.type === "webSocket" || C.config.type === "ipc");
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
- })(), T = i ? ge({
1647
+ })(), C = i ? fe({
1648
1648
  abi: n,
1649
1649
  eventName: i,
1650
1650
  args: s
1651
- }) : [], { unsubscribe: A } = await N.subscribe({
1652
- params: ["logs", { address: r, topics: T }],
1651
+ }) : [], { unsubscribe: x } = await $.subscribe({
1652
+ params: ["logs", { address: r, topics: C }],
1653
1653
  onData(E) {
1654
- var R;
1655
- if (!w)
1654
+ var T;
1655
+ if (!y)
1656
1656
  return;
1657
- const C = E.result;
1657
+ const N = E.result;
1658
1658
  try {
1659
- const { eventName: $, args: k } = Zt({
1659
+ const { eventName: k, args: R } = _t({
1660
1660
  abi: n,
1661
- data: C.data,
1662
- topics: C.topics,
1661
+ data: N.data,
1662
+ topics: N.topics,
1663
1663
  strict: l
1664
- }), S = H(C, {
1665
- args: k,
1666
- eventName: $
1664
+ }), z = W(N, {
1665
+ args: R,
1666
+ eventName: k
1667
1667
  });
1668
- x.onLogs([S]);
1669
- } catch ($) {
1670
- let k, S;
1671
- if ($ instanceof Jt || $ instanceof Yt) {
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
- k = $.abiItem.name, S = (R = $.abiItem.inputs) == null ? void 0 : R.some((ve) => !("name" in ve && ve.name));
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 Re = H(C, {
1677
- args: S ? [] : {},
1678
- eventName: k
1676
+ const Ie = W(N, {
1677
+ args: z ? [] : {},
1678
+ eventName: R
1679
1679
  });
1680
- x.onLogs([Re]);
1680
+ A.onLogs([Ie]);
1681
1681
  }
1682
1682
  },
1683
1683
  onError(E) {
1684
- var C;
1685
- (C = x.onError) == null || C.call(x, E);
1684
+ var N;
1685
+ (N = A.onError) == null || N.call(A, E);
1686
1686
  }
1687
1687
  });
1688
- b = A, w || b();
1689
- } catch (N) {
1690
- c == null || c(N);
1688
+ g = x, y || g();
1689
+ } catch ($) {
1690
+ c == null || c($);
1691
1691
  }
1692
- })(), () => b()));
1692
+ })(), () => g()));
1693
1693
  })();
1694
1694
  }
1695
- class $a extends F {
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 ka = "0x5792579257925792579257925792579257925792579257925792579257925792", za = y(0, {
1707
+ const fa = "0x5792579257925792579257925792579257925792579257925792579257925792", da = B(0, {
1708
1708
  size: 32
1709
1709
  });
1710
- async function Ra(e, t) {
1710
+ async function la(e, t) {
1711
1711
  async function n(f) {
1712
- if (f.endsWith(ka.slice(2))) {
1713
- const l = te(Pt(f, -64, -32)), h = Pt(f, 0, -64).slice(2).match(/.{1,64}/g), g = await Promise.all(h.map((p) => za.slice(2) !== p ? e.request({
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)), v = g.some((p) => p === null) ? 100 : g.every((p) => (p == null ? void 0 : p.status) === "0x1") ? 200 : g.every((p) => (p == null ? void 0 : p.status) === "0x0") ? 500 : 600;
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: le(l),
1720
- receipts: g.filter(Boolean),
1721
- status: v,
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 ? le(s) : void 0,
1738
+ chainId: s ? pe(s) : void 0,
1739
1739
  receipts: (a == null ? void 0 : a.map((f) => ({
1740
1740
  ...f,
1741
- blockNumber: ee(f.blockNumber),
1742
- gasUsed: ee(f.gasUsed),
1743
- status: Yn[f.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 Zi(e, t) {
1750
+ async function gi(e, t) {
1751
1751
  const {
1752
1752
  id: n,
1753
1753
  pollingInterval: r = e.pollingInterval,
1754
- status: s = ({ statusCode: v }) => v === 200 || v >= 300,
1754
+ status: s = ({ statusCode: w }) => w === 200 || w >= 300,
1755
1755
  retryCount: a = 4,
1756
- retryDelay: i = ({ count: v }) => ~~(1 << v) * 200,
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 = fe(["waitForCallsStatus", e.uid, n]), { promise: f, resolve: d, reject: l } = Kn();
1760
+ } = t, u = ae(["waitForCallsStatus", e.uid, n]), { promise: f, resolve: d, reject: l } = jn();
1761
1761
  let h;
1762
- const g = de(u, { resolve: d, reject: l }, (v) => {
1763
- const p = Ie(async () => {
1764
- const m = (w) => {
1765
- clearTimeout(h), p(), w(), g();
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 w = await Qn(async () => {
1769
- const b = await I(e, Ra, "getCallsStatus")({ id: n });
1770
- if (c && b.status === "failure")
1771
- throw new $a(b);
1772
- return b;
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(w))
1777
+ if (!s(y))
1778
1778
  return;
1779
- m(() => v.resolve(w));
1780
- } catch (w) {
1781
- m(() => v.reject(w));
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
- g(), clearTimeout(h), l(new Sa({ id: n }));
1790
+ b(), clearTimeout(h), l(new ha({ id: n }));
1791
1791
  }, o) : void 0, await f;
1792
1792
  }
1793
- class Sa extends F {
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 dt(e) {
1798
+ function nt(e) {
1799
1799
  var n, r, s, a, i, o;
1800
- if (!(e instanceof F))
1800
+ if (!(e instanceof U))
1801
1801
  return !1;
1802
- const t = e.walk((c) => c instanceof At);
1803
- return t instanceof At ? ((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;
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 Nn(e) {
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 Kt(t) ? t : null;
1809
+ return qt(t) ? t : null;
1810
1810
  }
1811
- function je(e) {
1811
+ function Oe(e) {
1812
1812
  let t = new Uint8Array(32).fill(0);
1813
1813
  if (!e)
1814
- return he(t);
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 = Nn(n[r]), a = s ? qt(s) : Pe(ce(n[r]), "bytes");
1818
- t = Pe(Qt([t, a]), "bytes");
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 he(t);
1820
+ return me(t);
1821
1821
  }
1822
- function Fa(e) {
1822
+ function pa(e) {
1823
1823
  return `[${e.slice(2)}]`;
1824
1824
  }
1825
- function La(e) {
1825
+ function ma(e) {
1826
1826
  const t = new Uint8Array(32).fill(0);
1827
- return e ? Nn(e) || Pe(ce(e)) : he(t);
1827
+ return e ? wn(e) || he(re(e)) : me(t);
1828
1828
  }
1829
- function lt(e) {
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(ce(t).byteLength + 2);
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 = ce(s[a]);
1838
- i.byteLength > 255 && (i = ce(Fa(La(s[a])))), n[r] = i.length, n.set(i, r + 1), r += i.length + 1;
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 Oa(e, t) {
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 Ne({
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 ? [je(a), BigInt(s)] : [je(a)];
1856
+ const d = s != null ? [Oe(a), BigInt(s)] : [Oe(a)];
1857
1857
  try {
1858
- const l = q({
1859
- abi: Et,
1858
+ const l = j({
1859
+ abi: pt,
1860
1860
  functionName: "addr",
1861
1861
  args: d
1862
1862
  }), h = {
1863
1863
  address: u,
1864
- abi: Xt,
1864
+ abi: Vt,
1865
1865
  functionName: "resolveWithGateways",
1866
1866
  args: [
1867
- pe(lt(a)),
1867
+ We(rt(a)),
1868
1868
  l,
1869
- i ?? [nt]
1869
+ i ?? [Ge]
1870
1870
  ],
1871
1871
  blockNumber: n,
1872
1872
  blockTag: r
1873
- }, v = await I(e, U, "readContract")(h);
1874
- if (v[0] === "0x")
1873
+ }, w = await P(e, _, "readContract")(h);
1874
+ if (w[0] === "0x")
1875
1875
  return null;
1876
- const p = Ee({
1877
- abi: Et,
1876
+ const p = ge({
1877
+ abi: pt,
1878
1878
  args: d,
1879
1879
  functionName: "addr",
1880
- data: v[0]
1880
+ data: w[0]
1881
1881
  });
1882
- return p === "0x" || te(p) === "0x00" ? null : p;
1882
+ return p === "0x" || Mt(p) === "0x00" ? null : p;
1883
1883
  } catch (l) {
1884
1884
  if (o)
1885
1885
  throw l;
1886
- if (dt(l))
1886
+ if (nt(l))
1887
1887
  return null;
1888
1888
  throw l;
1889
1889
  }
1890
1890
  }
1891
- class _a extends F {
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 ie extends F {
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 ht extends F {
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 Ua extends F {
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 Da = /(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/, Ma = /^(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>\/.*)?$/, Va = /^data:([a-zA-Z\-/+]*);base64,([^"].*)/, qa = /^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;
1921
- async function ja(e) {
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 Ot(e, t) {
1940
+ function Bt(e, t) {
1941
1941
  return e ? e.endsWith("/") ? e.slice(0, -1) : e : t;
1942
1942
  }
1943
- function Cn({ uri: e, gatewayUrls: t }) {
1944
- const n = Va.test(e);
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 = Ot(t == null ? void 0 : t.ipfs, "https://ipfs.io"), s = Ot(t == null ? void 0 : t.arweave, "https://arweave.net"), a = e.match(Da), { protocol: i, subpath: o, target: c, subtarget: u = "" } = (a == null ? void 0 : a.groups) || {}, f = i === "ipns:/" || o === "ipns/", d = i === "ipfs:/" || o === "ipfs/" || Ma.test(e);
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(qa, "");
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 ht({ uri: e });
1971
+ throw new st({ uri: e });
1972
1972
  }
1973
- function Tn(e) {
1973
+ function An(e) {
1974
1974
  if (typeof e != "object" || !("image" in e) && !("image_url" in e) && !("image_data" in e))
1975
- throw new _a({ data: e });
1975
+ throw new ga({ data: e });
1976
1976
  return e.image || e.image_url || e.image_data;
1977
1977
  }
1978
- async function Ga({ gatewayUrls: e, uri: t }) {
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 pt({
1981
+ return await at({
1982
1982
  gatewayUrls: e,
1983
- uri: Tn(n)
1983
+ uri: An(n)
1984
1984
  });
1985
1985
  } catch {
1986
- throw new ht({ uri: t });
1986
+ throw new st({ uri: t });
1987
1987
  }
1988
1988
  }
1989
- async function pt({ gatewayUrls: e, uri: t }) {
1990
- const { uri: n, isOnChain: r } = Cn({ uri: t, gatewayUrls: e });
1991
- if (r || await ja(n))
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 ht({ uri: t });
1993
+ throw new st({ uri: t });
1994
1994
  }
1995
- function Ha(e) {
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 ie({ reason: "Only EIP-155 supported" });
2000
+ throw new te({ reason: "Only EIP-155 supported" });
2001
2001
  if (!i)
2002
- throw new ie({ reason: "Chain ID not found" });
2002
+ throw new te({ reason: "Chain ID not found" });
2003
2003
  if (!c)
2004
- throw new ie({
2004
+ throw new te({
2005
2005
  reason: "Contract address not found"
2006
2006
  });
2007
2007
  if (!s)
2008
- throw new ie({ reason: "Token ID not found" });
2008
+ throw new te({ reason: "Token ID not found" });
2009
2009
  if (!o)
2010
- throw new ie({ reason: "ERC namespace not found" });
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 Wa(e, { nft: t }) {
2018
+ async function Na(e, { nft: t }) {
2019
2019
  if (t.namespace === "erc721")
2020
- return U(e, {
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 U(e, {
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 Ua({ namespace: t.namespace });
2049
+ throw new ya({ namespace: t.namespace });
2050
2050
  }
2051
- async function Za(e, { gatewayUrls: t, record: n }) {
2052
- return /eip155:/i.test(n) ? Ja(e, { gatewayUrls: t, record: n }) : pt({ uri: n, gatewayUrls: t });
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 Ja(e, { gatewayUrls: t, record: n }) {
2055
- const r = Ha(n), s = await Wa(e, { nft: r }), { uri: a, isOnChain: i, isEncoded: o } = Cn({ uri: s, gatewayUrls: t });
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 pt({ uri: Tn(f), gatewayUrls: t });
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")), Ga({
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 $n(e, t) {
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 Ne({
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: Xt,
2089
+ abi: Vt,
2090
2090
  args: [
2091
- pe(lt(a)),
2092
- q({
2093
- abi: It,
2091
+ We(rt(a)),
2092
+ j({
2093
+ abi: mt,
2094
2094
  functionName: "text",
2095
- args: [je(a), s]
2095
+ args: [Oe(a), s]
2096
2096
  }),
2097
- i ?? [nt]
2097
+ i ?? [Ge]
2098
2098
  ],
2099
2099
  functionName: "resolveWithGateways",
2100
2100
  blockNumber: n,
2101
2101
  blockTag: r
2102
- }, h = await I(e, U, "readContract")(d);
2102
+ }, h = await P(e, _, "readContract")(d);
2103
2103
  if (h[0] === "0x")
2104
2104
  return null;
2105
- const g = Ee({
2106
- abi: It,
2105
+ const b = ge({
2106
+ abi: mt,
2107
2107
  functionName: "text",
2108
2108
  data: h[0]
2109
2109
  });
2110
- return g === "" ? null : g;
2110
+ return b === "" ? null : b;
2111
2111
  } catch (d) {
2112
2112
  if (o)
2113
2113
  throw d;
2114
- if (dt(d))
2114
+ if (nt(d))
2115
2115
  return null;
2116
2116
  throw d;
2117
2117
  }
2118
2118
  }
2119
- async function Ya(e, { blockNumber: t, blockTag: n, assetGatewayUrls: r, name: s, gatewayUrls: a, strict: i, universalResolverAddress: o }) {
2120
- const c = await I(e, $n, "getEnsText")({
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 Za(e, {
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 Ka(e, t) {
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 Ne({
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: Xn,
2156
- args: [n, a, i ?? [nt]],
2155
+ abi: Wn,
2156
+ args: [n, a, i ?? [Ge]],
2157
2157
  functionName: "reverseWithGateways",
2158
2158
  blockNumber: r,
2159
2159
  blockTag: s
2160
- }, d = I(e, U, "readContract"), [l] = await d(f);
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 (dt(f))
2165
+ if (nt(f))
2166
2166
  return null;
2167
2167
  throw f;
2168
2168
  }
2169
2169
  }
2170
- async function Qa(e, t) {
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 Ne({
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 I(e, U, "readContract")({
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: [pe(lt(s))],
2200
+ args: [We(rt(s))],
2201
2201
  blockNumber: n,
2202
2202
  blockTag: r
2203
2203
  });
2204
2204
  return c;
2205
2205
  }
2206
- async function kn(e, t) {
2207
- var p, m, w;
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, ...g } = t, v = n ? be(n) : void 0;
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
- en(t);
2211
- const x = (typeof r == "bigint" ? y(r) : void 0) || s, N = (w = (m = (p = e.chain) == null ? void 0 : p.formatters) == null ? void 0 : m.transactionRequest) == null ? void 0 : w.format, A = (N || tn)({
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
- ...er(g, { format: N }),
2214
- account: v,
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: [A, x]
2226
+ params: [x, A]
2227
2227
  });
2228
2228
  return {
2229
2229
  accessList: E.accessList,
2230
2230
  gasUsed: BigInt(E.gasUsed)
2231
2231
  };
2232
- } catch (b) {
2233
- throw tr(b, {
2232
+ } catch (g) {
2233
+ throw Gn(g, {
2234
2234
  ...t,
2235
- account: v,
2235
+ account: w,
2236
2236
  chain: e.chain
2237
2237
  });
2238
2238
  }
2239
2239
  }
2240
- async function Xa(e) {
2241
- const t = Ze(e, {
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 zn(e, { address: t, args: n, event: r, events: s, fromBlock: a, strict: i, toBlock: o } = {}) {
2249
- const c = s ?? (r ? [r] : void 0), u = Ze(e, {
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) => ge({
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" ? y(a) : a,
2264
- toBlock: typeof o == "bigint" ? y(o) : o,
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 ei(e) {
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 ti(e, { blockHash: t, blockNumber: n, blockTag: r = "latest" } = {}) {
2288
- const s = n !== void 0 ? y(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 }), le(a);
2296
+ }, { dedupe: !!s }), pe(a);
2297
2297
  }
2298
- async function Ge(e, { address: t, blockNumber: n, blockTag: r = "latest" }) {
2299
- const s = n !== void 0 ? y(n) : void 0, a = await e.request({
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 ni extends F {
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 ri(e, t) {
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 I(e, U, "readContract")({
2323
- abi: si,
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 ni({ address: n }) : i;
2342
+ throw i.name === "ContractFunctionExecutionError" && i.cause.name === "ContractFunctionZeroDataError" ? new Fa({ address: n }) : i;
2343
2343
  }
2344
2344
  }
2345
- const si = [
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 ai(e) {
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 ii(e, { blockCount: t, blockNumber: n, blockTag: r = "latest", rewardPercentiles: s }) {
2372
- const a = typeof n == "bigint" ? y(n) : void 0, i = await e.request({
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
- y(t),
2375
+ B(t),
2376
2376
  a || r,
2377
2377
  s
2378
2378
  ]
2379
2379
  }, { dedupe: !!a });
2380
- return ai(i);
2380
+ return _a(i);
2381
2381
  }
2382
- async function oi(e, { filter: t }) {
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) => H(a));
2387
- return t.abi ? Ht({
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 Ji(e, t) {
2393
+ function yi(e, t) {
2394
2394
  if (e.length !== t.length)
2395
- throw new nr({
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(Rn(s, a));
2402
+ n.push(In(s, a));
2403
2403
  }
2404
- return j(n);
2404
+ return Ae(n);
2405
2405
  }
2406
- function Rn(e, t, n = !1) {
2406
+ function In(e, t, n = !1) {
2407
2407
  if (e === "address") {
2408
2408
  const i = t;
2409
- if (!Z(i))
2410
- throw new se({ address: i });
2411
- return Fe(i.toLowerCase(), {
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 rr(t);
2416
+ return Yn(t);
2417
2417
  if (e === "bytes")
2418
2418
  return t;
2419
2419
  if (e === "bool")
2420
- return Fe(sr(t), { size: n ? 32 : 1 });
2421
- const r = e.match(ar);
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 y(t, {
2424
+ return B(t, {
2425
2425
  size: n ? 32 : u,
2426
2426
  signed: o === "int"
2427
2427
  });
2428
2428
  }
2429
- const s = e.match(ir);
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 or({
2433
+ throw new er({
2434
2434
  expectedSize: Number.parseInt(o, 10),
2435
2435
  givenSize: (t.length - 2) / 2
2436
2436
  });
2437
- return Fe(t, { dir: "right", size: n ? 32 : null });
2437
+ return Be(t, { dir: "right", size: n ? 32 : null });
2438
2438
  }
2439
- const a = e.match(cr);
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(Rn(o, t[u], !0));
2444
- return c.length === 0 ? "0x" : j(c);
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
- return t;
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 gi({ address: e, authorization: t, signature: n }) {
2699
- return tt(nn(e), await Er({
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 Ki(e) {
2705
- const { source: t } = e, n = /* @__PURE__ */ new Map(), r = new Ir(8192), s = /* @__PURE__ */ new Map(), a = ({ address: i, chainId: o }) => `${i}.${o}`;
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 wi = "0x6492649264926492649264926492649264926492649264926492649264926492";
2736
- function Qi(e) {
2737
- const { address: t, data: n, signature: r, to: s = "hex" } = e, a = j([
2738
- jt([{ type: "address" }, { type: "bytes" }, { type: "bytes" }], [t, n, r]),
2739
- wi
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 : rn(a);
2491
+ return s === "hex" ? a : Jt(a);
2742
2492
  }
2743
- function vi(e) {
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 xi(e) {
2499
+ function Va(e) {
2750
2500
  return {
2751
2501
  ...e,
2752
2502
  balance: e.balance ? BigInt(e.balance) : void 0,
2753
- nonce: e.nonce ? le(e.nonce) : void 0,
2754
- storageProof: e.storageProof ? vi(e.storageProof) : void 0
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 Pi(e, { address: t, blockNumber: n, blockTag: r, storageKeys: s }) {
2758
- const a = r ?? "latest", i = n !== void 0 ? y(n) : void 0, o = await e.request({
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 xi(o);
2512
+ return Va(o);
2763
2513
  }
2764
- async function Ai(e, { address: t, blockNumber: n, blockTag: r = "latest", slot: s }) {
2765
- const a = n !== void 0 ? y(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 Ei(e, { hash: t, transactionReceipt: n }) {
2521
+ async function Ga(e, { hash: t, transactionReceipt: n }) {
2772
2522
  const [r, s] = await Promise.all([
2773
- I(e, Be, "getBlockNumber")({}),
2774
- t ? I(e, sn, "getTransaction")({ hash: t }) : void 0
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 He(e, t) {
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 ? Br(l.blockOverrides) : void 0, g = l.calls.map((p) => {
2784
- const m = p, w = m.account ? be(m.account) : void 0, b = m.abi ? q(m) : m.data, x = {
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: w,
2787
- data: m.dataSuffix ? Qt([b || "0x", m.dataSuffix]) : b,
2788
- from: m.from ?? (w == null ? void 0 : w.address)
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 en(x), tn(x);
2791
- }), v = l.stateOverrides ? Nr(l.stateOverrides) : void 0;
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: g,
2795
- stateOverrides: v
2544
+ calls: b,
2545
+ stateOverrides: w
2796
2546
  });
2797
2547
  }
2798
- const f = (typeof n == "bigint" ? y(n) : void 0) || r;
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
- ...Cr(l),
2807
- calls: l.calls.map((g, v) => {
2808
- var R, $;
2809
- const { abi: p, args: m, functionName: w, to: b } = s[h].calls[v], x = ((R = g.error) == null ? void 0 : R.data) ?? g.returnData, N = BigInt(g.gasUsed), T = ($ = g.logs) == null ? void 0 : $.map((k) => H(k)), A = g.status === "0x1" ? "success" : "failure", E = p && A === "success" && x !== "0x" ? Ee({
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: x,
2812
- functionName: w
2813
- }) : null, C = (() => {
2814
- var S;
2815
- if (A === "success")
2561
+ data: A,
2562
+ functionName: y
2563
+ }) : null, N = (() => {
2564
+ var z;
2565
+ if (x === "success")
2816
2566
  return;
2817
- let k;
2818
- if (((S = g.error) == null ? void 0 : S.data) === "0x" ? k = new Tr() : g.error && (k = new $r(g.error)), !!k)
2819
- return Je(k, {
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: b ?? "0x",
2571
+ address: g ?? "0x",
2822
2572
  args: m,
2823
- functionName: w ?? "<unknown>"
2573
+ functionName: y ?? "<unknown>"
2824
2574
  });
2825
2575
  })();
2826
2576
  return {
2827
- data: x,
2828
- gasUsed: N,
2829
- logs: T,
2830
- status: A,
2831
- ...A === "success" ? {
2577
+ data: A,
2578
+ gasUsed: $,
2579
+ logs: C,
2580
+ status: x,
2581
+ ...x === "success" ? {
2832
2582
  result: E
2833
2583
  } : {
2834
- error: C
2584
+ error: N
2835
2585
  }
2836
2586
  };
2837
2587
  })
2838
2588
  }));
2839
2589
  } catch (c) {
2840
- const u = c, f = kr(u, {});
2841
- throw f instanceof zr ? u : f;
2590
+ const u = c, f = fr(u, {});
2591
+ throw f instanceof dr ? u : f;
2842
2592
  }
2843
2593
  }
2844
- const Ii = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", O = "0x0000000000000000000000000000000000000000", Bi = "0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";
2845
- async function Ni(e, t) {
2846
- const { blockNumber: n, blockTag: r, calls: s, stateOverrides: a, traceAssetChanges: i, traceTransfers: o, validation: c } = t, u = t.account ? be(t.account) : void 0;
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 F("`account` is required when `traceAssetChanges` is true");
2849
- const f = u ? ya(ga("constructor(bytes, bytes)"), {
2850
- bytecode: Rr,
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
- Bi,
2853
- va(J("function getBalance(address)"), [u.address])
2602
+ Ja,
2603
+ Xs(G("function getBalance(address)"), [u.address])
2854
2604
  ]
2855
- }) : void 0, d = i ? await Promise.all(t.calls.map(async (P) => {
2856
- if (!P.data && !P.abi)
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: z } = await kn(e, {
2608
+ const { accessList: S } = await En(e, {
2859
2609
  account: u.address,
2860
- ...P,
2861
- data: P.abi ? q(P) : P.data
2610
+ ...v,
2611
+ data: v.abi ? j(v) : v.data
2862
2612
  });
2863
- return z.map(({ address: ae, storageKeys: xe }) => xe.length > 0 ? ae : null);
2864
- })).then((P) => P.flat().filter(Boolean)) : [], l = await He(e, {
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((P, z) => ({
2626
+ calls: d.map((v, S) => ({
2877
2627
  abi: [
2878
- J("function balanceOf(address) returns (uint256)")
2628
+ G("function balanceOf(address) returns (uint256)")
2879
2629
  ],
2880
2630
  functionName: "balanceOf",
2881
2631
  args: [u.address],
2882
- to: P,
2632
+ to: v,
2883
2633
  from: O,
2884
- nonce: z
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((P) => ({
2896
- ...P,
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((P, z) => ({
2658
+ calls: d.map((v, S) => ({
2909
2659
  abi: [
2910
- J("function balanceOf(address) returns (uint256)")
2660
+ G("function balanceOf(address) returns (uint256)")
2911
2661
  ],
2912
2662
  functionName: "balanceOf",
2913
2663
  args: [u.address],
2914
- to: P,
2664
+ to: v,
2915
2665
  from: O,
2916
- nonce: z
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((P, z) => ({
2928
- to: P,
2677
+ calls: d.map((v, S) => ({
2678
+ to: v,
2929
2679
  abi: [
2930
- J("function decimals() returns (uint256)")
2680
+ G("function decimals() returns (uint256)")
2931
2681
  ],
2932
2682
  functionName: "decimals",
2933
2683
  from: O,
2934
- nonce: z
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((P, z) => ({
2946
- to: P,
2695
+ calls: d.map((v, S) => ({
2696
+ to: v,
2947
2697
  abi: [
2948
- J("function tokenURI(uint256) returns (string)")
2698
+ G("function tokenURI(uint256) returns (string)")
2949
2699
  ],
2950
2700
  functionName: "tokenURI",
2951
2701
  args: [0n],
2952
2702
  from: O,
2953
- nonce: z
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((P, z) => ({
2965
- to: P,
2966
- abi: [J("function symbol() returns (string)")],
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: z
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], [g, v, , p, m, w, b, x] = i ? l : [], { calls: N, ...T } = h, A = N.slice(0, -1) ?? [], E = (g == null ? void 0 : g.calls) ?? [], C = (v == null ? void 0 : v.calls) ?? [], R = [...E, ...C].map((P) => P.status === "success" ? ee(P.data) : null), $ = (p == null ? void 0 : p.calls) ?? [], k = (m == null ? void 0 : m.calls) ?? [], S = [...$, ...k].map((P) => P.status === "success" ? ee(P.data) : null), Re = ((w == null ? void 0 : w.calls) ?? []).map((P) => P.status === "success" ? P.result : null), ve = ((x == null ? void 0 : x.calls) ?? []).map((P) => P.status === "success" ? P.result : null), Sn = ((b == null ? void 0 : b.calls) ?? []).map((P) => P.status === "success" ? P.result : null), Se = [];
2983
- for (const [P, z] of S.entries()) {
2984
- const ae = R[P];
2985
- if (typeof z != "bigint" || typeof ae != "bigint")
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 xe = Re[P - 1], Fn = ve[P - 1], Ln = Sn[P - 1], bt = P === 0 ? {
2988
- address: Ii,
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[P - 1],
2993
- decimals: Ln || xe ? Number(xe ?? 1) : void 0,
2994
- symbol: Fn ?? void 0
2742
+ address: d[v - 1],
2743
+ decimals: $n || le ? Number(le ?? 1) : void 0,
2744
+ symbol: Bn ?? void 0
2995
2745
  };
2996
- Se.some((On) => On.token.address === bt.address) || Se.push({
2997
- token: bt,
2746
+ Ne.some((Cn) => Cn.token.address === it.address) || Ne.push({
2747
+ token: it,
2998
2748
  value: {
2999
- pre: ae,
3000
- post: z,
3001
- diff: z - ae
2749
+ pre: ee,
2750
+ post: S,
2751
+ diff: S - ee
3002
2752
  }
3003
2753
  });
3004
2754
  }
3005
2755
  return {
3006
- assetChanges: Se,
3007
- block: T,
3008
- results: A
2756
+ assetChanges: Ne,
2757
+ block: C,
2758
+ results: x
3009
2759
  };
3010
2760
  }
3011
- function Ci({ r: e, s: t, to: n = "hex", v: r, yParity: s }) {
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 on.Signature(ee(e), ee(t)).toCompactHex()}${a === 0 ? "1b" : "1c"}`;
3019
- return n === "hex" ? i : rn(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 ze(e, t) {
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 Kt(h) ? h : typeof h == "object" && "r" in h && "s" in h ? Ci(h) : he(h);
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 ha(i) ? await Ti(e, {
2778
+ return Hs(i) ? await Qa(e, {
3029
2779
  ...t,
3030
2780
  multicallAddress: a,
3031
2781
  signature: i
3032
- }) : await $i(e, {
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 (tt(nn(n), await Sr({ hash: r, signature: i })))
2789
+ if (He(Zt(n), await hr({ hash: r, signature: i })))
3040
2790
  return !0;
3041
2791
  } catch {
3042
2792
  }
3043
- if (h instanceof W)
2793
+ if (h instanceof H)
3044
2794
  return !1;
3045
2795
  throw h;
3046
2796
  }
3047
2797
  }
3048
- async function Ti(e, t) {
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 } = la(t.signature);
3051
- if (await Ge(e, {
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
- }) === j(["0xef0100", o.address]))
3056
- return await ki(e, {
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: y(o.r, { size: 32 }),
3068
- s: y(o.s, { size: 32 }),
2817
+ r: B(o.r, { size: 32 }),
2818
+ s: B(o.s, { size: 32 }),
3069
2819
  yParity: o.yParity
3070
2820
  };
3071
- if (!await gi({
2821
+ if (!await Ma({
3072
2822
  address: n,
3073
2823
  authorization: l
3074
2824
  }))
3075
- throw new W();
3076
- const g = await I(e, U, "readContract")({
3077
- ...i ? { address: i } : { code: Lr },
2825
+ throw new H();
2826
+ const b = await P(e, _, "readContract")({
2827
+ ...i ? { address: i } : { code: mr },
3078
2828
  authorizationList: [l],
3079
- abi: Fr,
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: q({
3096
- abi: an,
2845
+ callData: j({
2846
+ abi: Kt,
3097
2847
  functionName: "isValidSignature",
3098
2848
  args: [a, u]
3099
2849
  })
3100
2850
  }
3101
2851
  ]
3102
2852
  ]
3103
- }), v = (p = g[g.length - 1]) == null ? void 0 : p.returnData;
3104
- if (v != null && v.startsWith("0x1626ba7e"))
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 W();
2856
+ throw new H();
3107
2857
  }
3108
- async function $i(e, t) {
3109
- const { address: n, factory: r, factoryData: s, hash: a, signature: i, verifierAddress: o, ...c } = t, u = await (async () => !r && !s || Ea(i) ? i : Aa({
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: q({
3116
- abi: Bt,
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: Or({
3123
- abi: Bt,
2872
+ data: br({
2873
+ abi: bt,
3124
2874
  args: [n, a, u],
3125
- bytecode: _r
2875
+ bytecode: gr
3126
2876
  }),
3127
2877
  ...c
3128
- }, { data: d } = await I(e, Ye, "call")(f).catch((l) => {
3129
- throw l instanceof Ur ? new W() : l;
2878
+ }, { data: d } = await P(e, qe, "call")(f).catch((l) => {
2879
+ throw l instanceof yr ? new H() : l;
3130
2880
  });
3131
- if (Dr(d ?? "0x0"))
2881
+ if (wr(d ?? "0x0"))
3132
2882
  return !0;
3133
- throw new W();
2883
+ throw new H();
3134
2884
  }
3135
- async function ki(e, t) {
2885
+ async function ei(e, t) {
3136
2886
  const { address: n, blockNumber: r, blockTag: s, hash: a, signature: i } = t;
3137
- if ((await I(e, U, "readContract")({
2887
+ if ((await P(e, _, "readContract")({
3138
2888
  address: n,
3139
- abi: an,
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 Mr ? new W() : c;
2895
+ throw c instanceof vr ? new H() : c;
3146
2896
  })).startsWith("0x1626ba7e"))
3147
2897
  return !0;
3148
- throw new W();
2898
+ throw new H();
3149
2899
  }
3150
- class W extends Error {
2900
+ class H extends Error {
3151
2901
  }
3152
- async function zi(e, { address: t, message: n, factory: r, factoryData: s, signature: a, ...i }) {
3153
- const o = cn(n);
3154
- return I(e, ze, "verifyHash")({
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 Ri(e, t) {
3164
- const { address: n, factory: r, factoryData: s, signature: a, message: i, primaryType: o, types: c, domain: u, ...f } = t, d = is({ message: i, primaryType: o, types: c, domain: u });
3165
- return I(e, ze, "verifyHash")({
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 Si(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 }) {
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 g = fe([
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 de(g, { onBlock: s, onError: a }, (v) => Ie(async () => {
2937
+ return ie(b, { onBlock: s, onError: a }, (w) => ye(async () => {
3188
2938
  var p;
3189
2939
  try {
3190
- const m = await I(e, oe, "getBlock")({
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 w = (d == null ? void 0 : d.number) + 1n; w < m.number; w++) {
3199
- const b = await I(e, oe, "getBlock")({
3200
- blockNumber: w,
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
- v.onBlock(b, d), d = b;
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) && (v.onBlock(m, d), d = m);
2960
+ m.number !== null && m.number > d.number) && (w.onBlock(m, d), d = m);
3211
2961
  } catch (m) {
3212
- (p = v.onError) == null || p.call(v, m);
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 g = !0, v = !0, p = () => g = !1;
2969
+ let b = !0, w = !0, p = () => b = !1;
3220
2970
  return (async () => {
3221
2971
  try {
3222
- r && I(e, oe, "getBlock")({
2972
+ r && P(e, ne, "getBlock")({
3223
2973
  blockTag: t,
3224
2974
  includeTransactions: f
3225
- }).then((b) => {
3226
- g && v && (s(b, void 0), v = !1);
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 b = e.transport.transports.find((x) => x.config.type === "webSocket" || x.config.type === "ipc");
3231
- return b ? b.value : e.transport;
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: w } = await m.subscribe({
2984
+ })(), { unsubscribe: y } = await m.subscribe({
3235
2985
  params: ["newHeads"],
3236
- async onData(b) {
3237
- var N;
3238
- if (!g)
2986
+ async onData(g) {
2987
+ var $;
2988
+ if (!b)
3239
2989
  return;
3240
- const x = await I(e, oe, "getBlock")({
3241
- blockNumber: (N = b.result) == null ? void 0 : N.number,
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
- g && (s(x, d), v = !1, d = x);
2995
+ b && (s(A, d), w = !1, d = A);
3246
2996
  },
3247
- onError(b) {
3248
- a == null || a(b);
2997
+ onError(g) {
2998
+ a == null || a(g);
3249
2999
  }
3250
3000
  });
3251
- p = w, g || 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 Fi(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 }) {
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 = fe([
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 de(p, { onLogs: c, onError: o }, (m) => {
3272
- let w;
3273
- i !== void 0 && (w = i - 1n);
3274
- let b, x = !1;
3275
- const N = Ie(async () => {
3276
- var T;
3277
- if (!x) {
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
- b = await I(e, zn, "createEventFilter")({
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
- x = !0;
3039
+ A = !0;
3290
3040
  return;
3291
3041
  }
3292
3042
  try {
3293
- let A;
3294
- if (b)
3295
- A = await I(e, Ke, "getFilterChanges")({ filter: b });
3043
+ let x;
3044
+ if (g)
3045
+ x = await P(e, je, "getFilterChanges")({ filter: g });
3296
3046
  else {
3297
- const E = await I(e, Be, "getBlockNumber")({});
3298
- w && w !== E ? A = await I(e, ft, "getLogs")({
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: w + 1n,
3053
+ fromBlock: y + 1n,
3304
3054
  toBlock: E
3305
- }) : A = [], w = E;
3055
+ }) : x = [], y = E;
3306
3056
  }
3307
- if (A.length === 0)
3057
+ if (x.length === 0)
3308
3058
  return;
3309
3059
  if (r)
3310
- m.onLogs(A);
3060
+ m.onLogs(x);
3311
3061
  else
3312
- for (const E of A)
3062
+ for (const E of x)
3313
3063
  m.onLogs([E]);
3314
- } catch (A) {
3315
- b && A instanceof Wt && (x = !1), (T = m.onError) == null || T.call(m, A);
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
- b && await I(e, Qe, "uninstallFilter")({ filter: b }), N();
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 w = (() => {
3079
+ const y = (() => {
3330
3080
  if (e.transport.type === "fallback") {
3331
- const T = e.transport.transports.find((A) => A.config.type === "webSocket" || A.config.type === "ipc");
3332
- return T ? T.value : e.transport;
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
- })(), b = a ?? (s ? [s] : void 0);
3336
- let x = [];
3337
- b && (x = [b.flatMap((A) => ge({
3338
- abi: [A],
3339
- eventName: A.name,
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 && (x = x[0]));
3342
- const { unsubscribe: N } = await w.subscribe({
3343
- params: ["logs", { address: t, topics: x }],
3344
- onData(T) {
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 A = T.result;
3098
+ const x = C.result;
3349
3099
  try {
3350
- const { eventName: C, args: R } = Zt({
3351
- abi: b ?? [],
3352
- data: A.data,
3353
- topics: A.topics,
3100
+ const { eventName: N, args: T } = _t({
3101
+ abi: g ?? [],
3102
+ data: x.data,
3103
+ topics: x.topics,
3354
3104
  strict: h
3355
- }), $ = H(A, { args: R, eventName: C });
3356
- c([$]);
3357
- } catch (C) {
3358
- let R, $;
3359
- if (C instanceof Jt || C instanceof Yt) {
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
- R = C.abiItem.name, $ = (E = C.abiItem.inputs) == null ? void 0 : E.some((S) => !("name" in S && S.name));
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 k = H(A, {
3365
- args: $ ? [] : {},
3366
- eventName: R
3114
+ const R = W(x, {
3115
+ args: k ? [] : {},
3116
+ eventName: T
3367
3117
  });
3368
- c([k]);
3118
+ c([R]);
3369
3119
  }
3370
3120
  },
3371
- onError(T) {
3372
- o == null || o(T);
3121
+ onError(C) {
3122
+ o == null || o(C);
3373
3123
  }
3374
3124
  });
3375
- m = N, p || m();
3376
- } catch (w) {
3377
- o == null || o(w);
3125
+ m = $, p || m();
3126
+ } catch (y) {
3127
+ o == null || o(y);
3378
3128
  }
3379
3129
  })(), () => m();
3380
3130
  })();
3381
3131
  }
3382
- function Li(e) {
3132
+ function ai(e) {
3383
3133
  var d, l, h;
3384
- const { scheme: t, statement: n, ...r } = ((d = e.match(Oi)) == null ? void 0 : d.groups) ?? {}, { chainId: s, expirationTime: a, issuedAt: i, notBefore: o, requestId: c, ...u } = ((l = e.match(_i)) == null ? void 0 : l.groups) ?? {}, f = (h = e.split("Resources:")[1]) == null ? void 0 : h.split(`
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 Oi = /^(?:(?<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)?/, _i = /(?: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>.+))?/;
3400
- function Ui(e) {
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 || !Z(r.address, { strict: !1 }) || t && !tt(r.address, t))
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 Di(e, t) {
3413
- const { address: n, domain: r, message: s, nonce: a, scheme: i, signature: o, time: c = /* @__PURE__ */ new Date(), ...u } = t, f = Li(s);
3414
- if (!f.address || !Ui({
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 = cn(s);
3424
- return ze(e, {
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 Mi(e, { serializedTransaction: t, throwOnReceiptRevert: n, timeout: r }) {
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, y(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) || Vr)(s);
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 qr({ receipt: i });
3188
+ throw new xr({ receipt: i });
3439
3189
  return i;
3440
3190
  }
3441
- function Vi(e) {
3191
+ function di(e) {
3442
3192
  return {
3443
- call: (t) => Ye(e, t),
3444
- createAccessList: (t) => kn(e, t),
3445
- createBlockFilter: () => Xa(e),
3446
- createContractEventFilter: (t) => In(e, t),
3447
- createEventFilter: (t) => zn(e, t),
3448
- createPendingTransactionFilter: () => ss(e),
3449
- estimateContractGas: (t) => Na(e, t),
3450
- estimateGas: (t) => Gt(e, t),
3451
- getBalance: (t) => rs(e, t),
3452
- getBlobBaseFee: () => ei(e),
3453
- getBlock: (t) => oe(e, t),
3454
- getBlockNumber: (t) => Be(e, t),
3455
- getBlockTransactionCount: (t) => ti(e, t),
3456
- getBytecode: (t) => Ge(e, t),
3457
- getChainId: () => ns(e),
3458
- getCode: (t) => Ge(e, t),
3459
- getContractEvents: (t) => Bn(e, t),
3460
- getEip712Domain: (t) => ri(e, t),
3461
- getEnsAddress: (t) => Oa(e, t),
3462
- getEnsAvatar: (t) => Ya(e, t),
3463
- getEnsName: (t) => Ka(e, t),
3464
- getEnsResolver: (t) => Qa(e, t),
3465
- getEnsText: (t) => $n(e, t),
3466
- getFeeHistory: (t) => ii(e, t),
3467
- estimateFeesPerGas: (t) => ts(e, t),
3468
- getFilterChanges: (t) => Ke(e, t),
3469
- getFilterLogs: (t) => oi(e, t),
3470
- getGasPrice: () => es(e),
3471
- getLogs: (t) => ft(e, t),
3472
- getProof: (t) => Pi(e, t),
3473
- estimateMaxPriorityFeePerGas: (t) => Xr(e, t),
3474
- fillTransaction: (t) => Qr(e, t),
3475
- getStorageAt: (t) => Ai(e, t),
3476
- getTransaction: (t) => sn(e, t),
3477
- getTransactionConfirmations: (t) => Ei(e, t),
3478
- getTransactionCount: (t) => Kr(e, t),
3479
- getTransactionReceipt: (t) => Yr(e, t),
3480
- multicall: (t) => Jr(e, t),
3481
- prepareTransactionRequest: (t) => Zr(e, t),
3482
- readContract: (t) => U(e, t),
3483
- sendRawTransaction: (t) => Wr(e, t),
3484
- sendRawTransactionSync: (t) => Mi(e, t),
3485
- simulate: (t) => He(e, t),
3486
- simulateBlocks: (t) => He(e, t),
3487
- simulateCalls: (t) => Ni(e, t),
3488
- simulateContract: (t) => Ca(e, t),
3489
- verifyHash: (t) => ze(e, t),
3490
- verifyMessage: (t) => zi(e, t),
3491
- verifySiweMessage: (t) => Di(e, t),
3492
- verifyTypedData: (t) => Ri(e, t),
3493
- uninstallFilter: (t) => Qe(e, t),
3494
- waitForTransactionReceipt: (t) => Hr(e, t),
3495
- watchBlocks: (t) => Si(e, t),
3496
- watchBlockNumber: (t) => Gr(e, t),
3497
- watchContractEvent: (t) => Ta(e, t),
3498
- watchEvent: (t) => Fi(e, t),
3499
- watchPendingTransactions: (t) => jr(e, 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 Xi(e) {
3252
+ function Ai(e) {
3503
3253
  const { key: t = "public", name: n = "Public Client" } = e;
3504
- return as({
3254
+ return _r({
3505
3255
  ...e,
3506
3256
  key: t,
3507
3257
  name: n,
3508
3258
  type: "publicClient"
3509
- }).extend(Vi);
3259
+ }).extend(di);
3510
3260
  }
3511
- function eo(e) {
3512
- const { r: t, s: n } = on.Signature.fromCompact(e.slice(2, 130)), r = +`0x${e.slice(130)}`, [s, a] = (() => {
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: y(t, { size: 32 }),
3523
- s: y(n, { size: 32 }),
3272
+ r: B(t, { size: 32 }),
3273
+ s: B(n, { size: 32 }),
3524
3274
  v: s,
3525
3275
  yParity: a
3526
3276
  } : {
3527
- r: y(t, { size: 32 }),
3528
- s: y(n, { size: 32 }),
3277
+ r: B(t, { size: 32 }),
3278
+ s: B(n, { size: 32 }),
3529
3279
  yParity: a
3530
3280
  };
3531
3281
  }
3532
3282
  export {
3533
- $a as B,
3534
- ie as E,
3535
- Ba as F,
3536
- Sa as W,
3537
- Ct as a,
3538
- Vi as b,
3539
- Xi as c,
3540
- Ua as d,
3541
- Ii as e,
3542
- ht as f,
3543
- ge as g,
3544
- Ji as h,
3545
- Ki as i,
3546
- eo as j,
3547
- Ci as k,
3548
- La as l,
3549
- mt as m,
3550
- je as n,
3551
- fi as o,
3552
- Nt as p,
3553
- di as q,
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
  };