@ozdao/prometheus-framework 0.2.89 → 0.2.90

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. package/dist/main-BV1Yv9Hy.js +92 -0
  2. package/dist/main-DmNP-t33.mjs +13625 -0
  3. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.cjs +1 -1
  4. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +748 -750
  5. package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.cjs +1 -1
  6. package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +40 -39
  7. package/dist/node_modules/web3/lib/esm/index.cjs +1 -1
  8. package/dist/node_modules/web3/lib/esm/index.js +42 -41
  9. package/dist/node_modules/web3/lib/esm/version.cjs +1 -1
  10. package/dist/node_modules/web3/lib/esm/version.js +1 -1
  11. package/dist/node_modules/web3-eth/lib/esm/schemas.cjs +1 -1
  12. package/dist/node_modules/web3-eth/lib/esm/schemas.js +113 -88
  13. package/dist/node_modules/web3-eth-contract/lib/esm/contract.cjs +3 -1
  14. package/dist/node_modules/web3-eth-contract/lib/esm/contract.js +242 -217
  15. package/dist/node_modules/web3-eth-contract/lib/esm/encoding.cjs +1 -1
  16. package/dist/node_modules/web3-eth-contract/lib/esm/encoding.js +43 -37
  17. package/dist/node_modules/web3-eth-ens/lib/esm/config.cjs +1 -1
  18. package/dist/node_modules/web3-eth-ens/lib/esm/config.js +3 -1
  19. package/dist/node_modules/web3-eth-ens/lib/esm/ens.cjs +1 -1
  20. package/dist/node_modules/web3-eth-ens/lib/esm/ens.js +34 -13
  21. package/dist/node_modules/web3-eth-ens/lib/esm/resolver.cjs +1 -1
  22. package/dist/node_modules/web3-eth-ens/lib/esm/resolver.js +48 -36
  23. package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.cjs +1 -1
  24. package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.js +2 -2
  25. package/dist/node_modules/web3-utils/lib/esm/converters.cjs +1 -1
  26. package/dist/node_modules/web3-utils/lib/esm/converters.js +52 -50
  27. package/dist/node_modules/web3-utils/lib/esm/uint8array.cjs +1 -1
  28. package/dist/node_modules/web3-utils/lib/esm/uint8array.js +13 -13
  29. package/dist/node_modules/web3-validator/lib/esm/utils.cjs +1 -1
  30. package/dist/node_modules/web3-validator/lib/esm/utils.js +76 -87
  31. package/dist/node_modules/web3-validator/lib/esm/validator.cjs +1 -1
  32. package/dist/node_modules/web3-validator/lib/esm/validator.js +49 -47
  33. package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.cjs +1 -1
  34. package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.js +168 -158
  35. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +73 -1
  37. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  38. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +1 -73
  39. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
  41. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  42. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
  43. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
  45. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
  46. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
  47. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  55. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  56. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  57. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  58. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  59. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  65. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  67. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  69. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  73. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  75. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
  77. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
  79. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  81. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  83. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  85. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  87. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  89. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  91. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  95. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  97. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  99. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  101. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  107. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  109. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  111. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  113. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  115. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +20 -25
  117. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  119. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  123. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  125. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  127. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  129. package/dist/prometheus-framework.cjs.js +1 -1
  130. package/dist/prometheus-framework.es.js +1 -1
  131. package/dist/style.css +1 -1
  132. package/dist/web-Bk_OtXgv.js +1 -0
  133. package/dist/web-VFuzUsNl.mjs +54 -0
  134. package/package.json +1 -1
@@ -1,21 +1,21 @@
1
- import { keccak256 as H } from "../../../ethereum-cryptography/esm/keccak.js";
1
+ import { keccak256 as U } from "../../../ethereum-cryptography/esm/keccak.js";
2
2
  import { bytesToUtf8 as w } from "../../../ethereum-cryptography/esm/utils.js";
3
- import { InvalidBytesError as E, HexProcessingError as U, InvalidNumberError as a, InvalidUnitError as A, InvalidAddressError as C, InvalidBooleanError as W } from "../../../web3-errors/lib/esm/errors/utils_errors.js";
3
+ import { InvalidBytesError as C, HexProcessingError as W, InvalidNumberError as A, InvalidUnitError as S, InvalidAddressError as k, InvalidBooleanError as D } from "../../../web3-errors/lib/esm/errors/utils_errors.js";
4
4
  import "../../../web3-errors/lib/esm/errors/rpc_errors.js";
5
5
  import "../../../web3-validator/lib/esm/formats.js";
6
- import * as k from "../../../web3-validator/lib/esm/utils.js";
7
- import { hexToUint8Array as D, hexToNumber as M, numberToHex as _, uint8ArrayToHexString as F, ensureIfUint8Array as G } from "../../../web3-validator/lib/esm/utils.js";
6
+ import * as M from "../../../web3-validator/lib/esm/utils.js";
7
+ import { hexToUint8Array as _, hexToNumber as F, numberToHex as G, uint8ArrayToHexString as L, ensureIfUint8Array as O } from "../../../web3-validator/lib/esm/utils.js";
8
8
  import { validator as s } from "../../../web3-validator/lib/esm/default_validator.js";
9
- import { isAddress as S } from "../../../web3-validator/lib/esm/validation/address.js";
9
+ import { isAddress as a } from "../../../web3-validator/lib/esm/validation/address.js";
10
10
  import "../../../web3-types/lib/esm/data_format_types.js";
11
11
  import "../../../web3-types/lib/esm/eth_types.js";
12
12
  import "../../../web3-types/lib/esm/web3_base_provider.js";
13
13
  import { isInt as b, isUInt as y } from "../../../web3-validator/lib/esm/validation/numbers.js";
14
- import { isHexStrict as m, isHex as B } from "../../../web3-validator/lib/esm/validation/string.js";
15
- import { isNullish as L } from "../../../web3-validator/lib/esm/validation/object.js";
16
- import { isUint8Array as O } from "./uint8array.js";
17
- import { utf8ToBytes as V } from "../../../@noble/hashes/esm/utils.js";
18
- const T = {
14
+ import { isHexStrict as m, isHex as x } from "../../../web3-validator/lib/esm/validation/string.js";
15
+ import { isNullish as V } from "../../../web3-validator/lib/esm/validation/object.js";
16
+ import { isUint8Array as T } from "./uint8array.js";
17
+ import { utf8ToBytes as z } from "../../../@noble/hashes/esm/utils.js";
18
+ const N = {
19
19
  noether: BigInt(0),
20
20
  wei: BigInt(1),
21
21
  kwei: BigInt(1e3),
@@ -44,22 +44,22 @@ const T = {
44
44
  gether: BigInt("1000000000000000000000000000"),
45
45
  tether: BigInt("1000000000000000000000000000000")
46
46
  }, d = (t) => {
47
- if (s.validate(["bytes"], [t]), O(t))
47
+ if (s.validate(["bytes"], [t]), T(t))
48
48
  return t;
49
49
  if (Array.isArray(t))
50
50
  return new Uint8Array(t);
51
51
  if (typeof t == "string")
52
- return D(t);
53
- throw new E(t);
54
- }, { uint8ArrayToHexString: u } = k, z = (t) => u(d(t)), N = (t) => typeof t == "string" && t.slice(0, 2).toLowerCase() !== "0x" ? d(`0x${t}`) : d(t), p = (t) => (s.validate(["hex"], [t]), M(t)), f0 = p, g = (t, r) => {
52
+ return _(t);
53
+ throw new C(t);
54
+ }, { uint8ArrayToHexString: P } = M, $ = (t) => P(d(t)), H = (t) => typeof t == "string" && t.slice(0, 2).toLowerCase() !== "0x" ? d(`0x${t}`) : d(t), p = (t) => (s.validate(["hex"], [t]), F(t)), f0 = p, g = (t, r) => {
55
55
  typeof t != "bigint" && s.validate(["int"], [t]);
56
- let n = _(t);
56
+ let n = G(t);
57
57
  return r && (!n.startsWith("-") && n.length % 2 === 1 ? n = "0x0".concat(n.slice(2)) : n.length % 2 === 0 && n.startsWith("-") && (n = "-0x0".concat(n.slice(3)))), n;
58
58
  }, c0 = g, g0 = (t) => p(t).toString(), h = (t) => {
59
59
  s.validate(["string"], [t]);
60
60
  let r = t.replace(/^(?:\u0000)/, "");
61
- return r = r.replace(/(?:\u0000)$/, ""), z(new TextEncoder().encode(r));
62
- }, m0 = h, h0 = h, $ = (t) => w(N(t)), I0 = (t) => typeof t == "string" ? $(t) : (s.validate(["bytes"], [t]), w(t)), P = V, x0 = $, R = (t) => {
61
+ return r = r.replace(/(?:\u0000)$/, ""), $(new TextEncoder().encode(r));
62
+ }, m0 = h, h0 = h, E = (t) => w(H(t)), I0 = (t) => typeof t == "string" ? E(t) : (s.validate(["bytes"], [t]), w(t)), R = z, B0 = E, X = (t) => {
63
63
  s.validate(["string"], [t]);
64
64
  let r = "";
65
65
  for (let n = 0; n < t.length; n += 1) {
@@ -67,8 +67,8 @@ const T = {
67
67
  r += i.length % 2 !== 0 ? `0${i}` : i;
68
68
  }
69
69
  return `0x${r}`;
70
- }, B0 = R, X = (t) => new TextDecoder("ascii").decode(N(t)), d0 = X, p0 = (t, r) => {
71
- if (typeof t == "string" && S(t))
70
+ }, x0 = X, Z = (t) => new TextDecoder("ascii").decode(H(t)), d0 = Z, p0 = (t, r) => {
71
+ if (typeof t == "string" && a(t))
72
72
  return r ? "address" : `0x${t.toLowerCase().replace(/^0x/i, "")}`;
73
73
  if (typeof t == "boolean")
74
74
  return r ? "bool" : t ? "0x01" : "0x00";
@@ -76,6 +76,8 @@ const T = {
76
76
  return r ? t < 0 ? "int256" : "uint256" : g(t);
77
77
  if (typeof t == "bigint")
78
78
  return r ? "bigint" : g(t);
79
+ if (T(t))
80
+ return r ? "bytes" : $(t);
79
81
  if (typeof t == "object" && t)
80
82
  return r ? "string" : h(JSON.stringify(t));
81
83
  if (typeof t == "string") {
@@ -83,17 +85,17 @@ const T = {
83
85
  return r ? "int256" : g(t);
84
86
  if (m(t))
85
87
  return r ? "bytes" : t;
86
- if (B(t) && !b(t) && !y(t))
88
+ if (x(t) && !b(t) && !y(t))
87
89
  return r ? "bytes" : `0x${t}`;
88
- if (B(t) && !b(t) && y(t))
90
+ if (x(t) && !b(t) && y(t))
89
91
  return r ? "uint" : g(t);
90
92
  if (!Number.isFinite(t))
91
93
  return r ? "string" : h(t);
92
94
  }
93
- throw new U(t);
95
+ throw new W(t);
94
96
  }, I = (t) => {
95
97
  if (typeof t == "number")
96
- return t;
98
+ return t > 1e20 ? BigInt(t) : t;
97
99
  if (typeof t == "bigint")
98
100
  return t >= Number.MIN_SAFE_INTEGER && t <= Number.MAX_SAFE_INTEGER ? Number(t) : t;
99
101
  if (typeof t == "string" && m(t))
@@ -101,20 +103,20 @@ const T = {
101
103
  try {
102
104
  return I(BigInt(t));
103
105
  } catch {
104
- throw new a(t);
106
+ throw new A(t);
105
107
  }
106
108
  }, b0 = (t) => {
107
109
  if (typeof t == "number")
108
110
  return BigInt(t);
109
111
  if (typeof t == "bigint")
110
112
  return t;
111
- if (typeof t == "string" && B(t))
113
+ if (typeof t == "string" && x(t))
112
114
  return t.startsWith("-") ? -BigInt(t.substring(1)) : BigInt(t);
113
- throw new a(t);
115
+ throw new A(t);
114
116
  }, y0 = (t, r) => {
115
- const n = T[r];
117
+ const n = N[r];
116
118
  if (!n)
117
- throw new A(r);
119
+ throw new S(r);
118
120
  const i = String(I(t)), o = n.toString().length - 1;
119
121
  if (o <= 0)
120
122
  return i.toString();
@@ -122,23 +124,23 @@ const T = {
122
124
  return f === "" ? `0.${c}` : c === "" ? f : `${f}.${c}`;
123
125
  }, w0 = (t, r) => {
124
126
  s.validate(["number"], [t]);
125
- const n = T[r];
127
+ const n = N[r];
126
128
  if (!n)
127
- throw new A(r);
128
- const [i, o] = String(typeof t == "string" && !m(t) ? t : I(t)).split(".").concat(""), f = BigInt(`${i}${o}`) * n, c = n.toString().length - 1, x = Math.min(o.length, c);
129
- return x === 0 ? f.toString() : f.toString().padStart(x, "0").slice(0, -x);
130
- }, a0 = (t) => {
131
- if (!S(t, !1))
132
- throw new C(t);
133
- const r = t.toLowerCase().replace(/^0x/i, ""), n = F(H(G(P(r))));
134
- if (L(n) || n === "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")
129
+ throw new S(r);
130
+ const [i, o] = String(typeof t == "string" && !m(t) ? t : I(t)).split(".").concat(""), f = BigInt(`${i}${o}`) * n, c = n.toString().length - 1, B = Math.min(o.length, c);
131
+ return B === 0 ? f.toString() : f.toString().padStart(B, "0").slice(0, -B);
132
+ }, A0 = (t) => {
133
+ if (!a(t, !1))
134
+ throw new k(t);
135
+ const r = t.toLowerCase().replace(/^0x/i, ""), n = L(U(O(R(r))));
136
+ if (V(n) || n === "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")
135
137
  return "";
136
138
  let i = "0x";
137
139
  const o = n.replace(/^0x/i, "");
138
140
  for (let e = 0; e < r.length; e += 1)
139
141
  parseInt(o[e], 16) > 7 ? i += r[e].toUpperCase() : i += r[e];
140
142
  return i;
141
- }, A0 = (t) => {
143
+ }, S0 = (t) => {
142
144
  if (typeof t == "boolean")
143
145
  return t;
144
146
  if (typeof t == "number" && (t === 0 || t === 1) || typeof t == "bigint" && (t === BigInt(0) || t === BigInt(1)))
@@ -147,34 +149,34 @@ const T = {
147
149
  return t === "true" ? !0 : t === "false" ? !1 : !!Number(t);
148
150
  if (typeof t == "string" && m(t) && (t === "0x1" || t === "0x0"))
149
151
  return !!I(t);
150
- throw new W(t);
152
+ throw new D(t);
151
153
  };
152
154
  export {
153
- R as asciiToHex,
154
- z as bytesToHex,
155
+ X as asciiToHex,
156
+ $ as bytesToHex,
155
157
  d as bytesToUint8Array,
156
- T as ethUnitMap,
157
- B0 as fromAscii,
158
+ N as ethUnitMap,
159
+ x0 as fromAscii,
158
160
  c0 as fromDecimal,
159
161
  m0 as fromUtf8,
160
162
  y0 as fromWei,
161
- X as hexToAscii,
162
- N as hexToBytes,
163
+ Z as hexToAscii,
164
+ H as hexToBytes,
163
165
  p as hexToNumber,
164
166
  g0 as hexToNumberString,
165
- x0 as hexToString,
166
- $ as hexToUtf8,
167
+ B0 as hexToString,
168
+ E as hexToUtf8,
167
169
  g as numberToHex,
168
170
  h0 as stringToHex,
169
171
  d0 as toAscii,
170
172
  b0 as toBigInt,
171
- A0 as toBool,
172
- a0 as toChecksumAddress,
173
+ S0 as toBool,
174
+ A0 as toChecksumAddress,
173
175
  f0 as toDecimal,
174
176
  p0 as toHex,
175
177
  I as toNumber,
176
178
  I0 as toUtf8,
177
179
  w0 as toWei,
178
- P as utf8ToBytes,
180
+ R as utf8ToBytes,
179
181
  h as utf8ToHex
180
182
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(t){var r;return t instanceof Uint8Array||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="Uint8Array"}function l(...t){const r=t.reduce((e,u)=>e+u.length,0),n=new Uint8Array(r);let i=0;for(const e of t)n.set(e,i),i+=e.length;return n}function s(t,r){if(t===r)return!0;if(t.byteLength!==r.byteLength)return!1;for(let n=0;n<t.byteLength;n+=1)if(t[n]!==r[n])return!1;return!0}exports.isUint8Array=o;exports.uint8ArrayConcat=l;exports.uint8ArrayEquals=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(r){var t,n;return r instanceof Uint8Array||((t=r==null?void 0:r.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"||((n=r==null?void 0:r.constructor)===null||n===void 0?void 0:n.name)==="Buffer"}function l(...r){const t=r.reduce((e,o)=>e+o.length,0),n=new Uint8Array(t);let i=0;for(const e of r)n.set(e,i),i+=e.length;return n}function c(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let n=0;n<r.byteLength;n+=1)if(r[n]!==t[n])return!1;return!0}exports.isUint8Array=u;exports.uint8ArrayConcat=l;exports.uint8ArrayEquals=c;
@@ -1,26 +1,26 @@
1
- function f(t) {
2
- var n;
3
- return t instanceof Uint8Array || ((n = t == null ? void 0 : t.constructor) === null || n === void 0 ? void 0 : n.name) === "Uint8Array";
1
+ function l(n) {
2
+ var t, r;
3
+ return n instanceof Uint8Array || ((t = n == null ? void 0 : n.constructor) === null || t === void 0 ? void 0 : t.name) === "Uint8Array" || ((r = n == null ? void 0 : n.constructor) === null || r === void 0 ? void 0 : r.name) === "Buffer";
4
4
  }
5
- function l(...t) {
6
- const n = t.reduce((e, u) => e + u.length, 0), r = new Uint8Array(n);
5
+ function f(...n) {
6
+ const t = n.reduce((e, u) => e + u.length, 0), r = new Uint8Array(t);
7
7
  let o = 0;
8
- for (const e of t)
8
+ for (const e of n)
9
9
  r.set(e, o), o += e.length;
10
10
  return r;
11
11
  }
12
- function c(t, n) {
13
- if (t === n)
12
+ function c(n, t) {
13
+ if (n === t)
14
14
  return !0;
15
- if (t.byteLength !== n.byteLength)
15
+ if (n.byteLength !== t.byteLength)
16
16
  return !1;
17
- for (let r = 0; r < t.byteLength; r += 1)
18
- if (t[r] !== n[r])
17
+ for (let r = 0; r < n.byteLength; r += 1)
18
+ if (n[r] !== t[r])
19
19
  return !1;
20
20
  return !0;
21
21
  }
22
22
  export {
23
- f as isUint8Array,
24
- l as uint8ArrayConcat,
23
+ l as isUint8Array,
24
+ f as uint8ArrayConcat,
25
25
  c as uint8ArrayEquals
26
26
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../../../web3-errors/lib/esm/errors/utils_errors.cjs");require("../../../web3-errors/lib/esm/errors/rpc_errors.cjs");const W=require("./constants.cjs"),N=require("./validation/abi.cjs"),b=require("./validation/string.cjs"),E=require("./errors.cjs"),q=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],g=e=>{let t=e.replace(/ /,""),i,r=!1,s=[];if(e.includes("[")&&(t=t.slice(0,t.indexOf("[")),s=[...e.matchAll(/(?:\[(\d*)\])/g)].map(n=>parseInt(n[1],10)).map(n=>Number.isNaN(n)?-1:n),r=s.length>0),W.VALID_ETH_BASE_TYPES.includes(t))return{baseType:t,isArray:r,baseTypeSize:i,arraySizes:s};if(t.startsWith("int"))i=parseInt(t.substring(3),10),t="int";else if(t.startsWith("uint"))i=parseInt(e.substring(4),10),t="uint";else if(t.startsWith("bytes"))i=parseInt(t.substring(5),10),t="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:s};return{baseType:t,isArray:r,baseTypeSize:i,arraySizes:s}},T=(e,t={})=>{if(Object.keys(t).includes("type"))throw new E.Web3ValidatorError([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);const{baseType:r,baseTypeSize:s}=g(e);if(!r&&!q.includes(e))throw new E.Web3ValidatorError([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(r){if(r==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${r}${s??""}`,required:!0}}return e?{format:e,required:!0}:{}},A=(e,t="/0")=>{const i={type:"array",items:[],maxItems:e.length,minItems:e.length};for(const[r,s]of e.entries()){let n,o,f=[];N.isAbiParameterSchema(s)?(n=s.type,o=s.name,f=s.components):typeof s=="string"?(n=s,o=`${t}/${r}`):Array.isArray(s)&&(s[0]&&typeof s[0]=="string"&&s[0].startsWith("tuple")&&!Array.isArray(s[0])&&s[1]&&Array.isArray(s[1])?(n=s[0],o=`${t}/${r}`,f=s[1]):(n="tuple",o=`${t}/${r}`,f=s));const{baseType:c,isArray:h,arraySizes:p}=g(n);let u,m=i;for(let a=p.length-1;a>0;a-=1)u={type:"array",items:[],maxItems:p[a],minItems:p[a]},p[a]<0&&(delete u.maxItems,delete u.minItems),Array.isArray(m.items)?m.items.length===0?m.items=u:m.items.push(u):m.items=[m.items,u],m=u;if(c==="tuple"&&!h){const a=A(f,o);a.$id=o,m.items.push(a)}else if(c==="tuple"&&h){const a=p[0],l={$id:o,type:"array",items:A(f,o),maxItems:a,minItems:a};a<0&&(delete l.maxItems,delete l.minItems),m.items.push(l)}else if(h){const a=p[0],l={type:"array",$id:o,items:T(String(c)),minItems:a,maxItems:a};a<0&&(delete l.maxItems,delete l.minItems),m.items.push(l)}else Array.isArray(m.items)?m.items.push(Object.assign({$id:o},T(n))):m.items.items.push(Object.assign({$id:o},T(n)));m=i}return i},_=e=>A(e),S=(e,t)=>t===1?e:S(e[0],t-1),d=(e,t,i)=>{const r=[];for(const[s,n]of e.entries()){let o,f,c=[];N.isAbiParameterSchema(n)?(o=n.type,f=n.name,c=n.components):typeof n=="string"?o=n:Array.isArray(n)&&(n[1]&&Array.isArray(n[1])?(o=n[0],c=n[1]):(o="tuple",c=n));const{baseType:h,isArray:p,arraySizes:u}=g(o),m=Array.isArray(t)?t[s]:t[f];if(h==="tuple"&&!p)r.push(d(c,m,i));else if(h==="tuple"&&p){const a=[];for(const l of m)if(u.length>1){const z=S(l,u.length-1),$=[];for(const H of z)$.push(d(c,H,i));a.push($)}else a.push(d(c,l,i));r.push(a)}else r.push(m)}return i=i??[],i.push(...r),i},B=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error(`Invalid code point: ${e}`)},U=e=>{if(!b.isHexStrict(e))throw new Error("Invalid hex string");const[t,i]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=BigInt(i);return r>Number.MAX_SAFE_INTEGER?t?-r:r:r<Number.MIN_SAFE_INTEGER?r:t?-1*Number(r):Number(r)},x=e=>{if((typeof e=="number"||typeof e=="bigint")&&e<0)return`-0x${e.toString(16).slice(1)}`;if((typeof e=="number"||typeof e=="bigint")&&e>=0)return`0x${e.toString(16)}`;if(typeof e=="string"&&b.isHexStrict(e)){const[t,i]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=i.split(/^(-)?0(x|X)/).slice(-1)[0];return`${t?"-":""}0x${r.replace(/^0+/,"").toLowerCase()}`}if(typeof e=="string"&&!b.isHexStrict(e))return x(BigInt(e));throw new I.InvalidNumberError(e)},C=(e,t,i="0")=>{if(typeof e=="string"&&!b.isHexStrict(e))return e.padStart(t,i);const r=typeof e=="string"&&b.isHexStrict(e)?e:x(e),[s,n]=r.startsWith("-")?["-0x",r.slice(3)]:["0x",r.slice(2)];return`${s}${n.padStart(t,i)}`};function F(e){let t="0x";for(const i of e){const r=i.toString(16);t+=r.length===1?`0${r}`:r}return t}const y={zero:48,nine:57,A:65,F:70,a:97,f:102};function w(e){if(e>=y.zero&&e<=y.nine)return e-y.zero;if(e>=y.A&&e<=y.F)return e-(y.A-10);if(e>=y.a&&e<=y.f)return e-(y.a-10)}function J(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new I.InvalidBytesError(`hex string has odd length: ${e}`);const i=(e.length-t)/2,r=new Uint8Array(i);for(let s=0,n=t;s<i;s+=1){const o=w(e.charCodeAt(n++)),f=w(e.charCodeAt(n++));if(o===void 0||f===void 0)throw new I.InvalidBytesError(`Invalid byte sequence ("${e[n-2]}${e[n-1]}" in "${e}").`);r[s]=o*16+f}return r}function O(e){var t;return!(e instanceof Uint8Array)&&((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"?Uint8Array.from(e):e}exports.abiSchemaToJsonSchema=A;exports.codePointToInt=B;exports.ensureIfUint8Array=O;exports.ethAbiToJsonSchema=_;exports.fetchArrayElement=S;exports.hexToNumber=U;exports.hexToUint8Array=J;exports.numberToHex=x;exports.padLeft=C;exports.parseBaseType=g;exports.transformJsonDataToAbiFormat=d;exports.uint8ArrayToHexString=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../../../web3-errors/lib/esm/errors/utils_errors.cjs");require("../../../web3-errors/lib/esm/errors/rpc_errors.cjs");const W=require("./constants.cjs"),N=require("./validation/abi.cjs"),b=require("./validation/string.cjs"),E=require("./errors.cjs"),q=["hex","number","blockNumber","blockNumberOrTag","filter","bloom"],g=e=>{let t=e.replace(/ /,""),n,r=!1,s=[];if(e.includes("[")&&(t=t.slice(0,t.indexOf("[")),s=[...e.matchAll(/(?:\[(\d*)\])/g)].map(i=>parseInt(i[1],10)).map(i=>Number.isNaN(i)?-1:i),r=s.length>0),W.VALID_ETH_BASE_TYPES.includes(t))return{baseType:t,isArray:r,baseTypeSize:n,arraySizes:s};if(t.startsWith("int"))n=parseInt(t.substring(3),10),t="int";else if(t.startsWith("uint"))n=parseInt(e.substring(4),10),t="uint";else if(t.startsWith("bytes"))n=parseInt(t.substring(5),10),t="bytes";else return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:s};return{baseType:t,isArray:r,baseTypeSize:n,arraySizes:s}},T=(e,t={})=>{if(Object.keys(t).includes("type"))throw new E.Web3ValidatorError([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);const{baseType:r,baseTypeSize:s}=g(e);if(!r&&!q.includes(e))throw new E.Web3ValidatorError([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(r){if(r==="tuple")throw new Error('"tuple" type is not implemented directly.');return{format:`${r}${s??""}`,required:!0}}return e?{format:e,required:!0}:{}},d=(e,t="/0")=>{const n={type:"array",items:[],maxItems:e.length,minItems:e.length};for(const[r,s]of e.entries()){let i,o,f=[];N.isAbiParameterSchema(s)?(i=s.type,o=s.name,f=s.components):typeof s=="string"?(i=s,o=`${t}/${r}`):Array.isArray(s)&&(s[0]&&typeof s[0]=="string"&&s[0].startsWith("tuple")&&!Array.isArray(s[0])&&s[1]&&Array.isArray(s[1])?(i=s[0],o=`${t}/${r}`,f=s[1]):(i="tuple",o=`${t}/${r}`,f=s));const{baseType:u,isArray:y,arraySizes:p}=g(i);let m,c=n;for(let a=p.length-1;a>0;a-=1)m={type:"array",$id:o,items:[],maxItems:p[a],minItems:p[a]},p[a]<0&&(delete m.maxItems,delete m.minItems),Array.isArray(c.items)?c.items.length===0?c.items=[m]:c.items.push(m):c.items=[c.items,m],c=m;if(u==="tuple"&&!y){const a=d(f,o);a.$id=o,c.items.push(a)}else if(u==="tuple"&&y){const a=p[0],h=Object.assign({type:"array",$id:o,items:d(f,o)},a>=0&&{minItems:a,maxItems:a});c.items.push(h)}else if(y){const a=p[0],h=Object.assign({type:"array",$id:o,items:T(i)},a>=0&&{minItems:a,maxItems:a});c.items.push(h)}else Array.isArray(c.items)?c.items.push(Object.assign({$id:o},T(i))):c.items.push(Object.assign({$id:o},T(i)));c=n}return n},_=e=>d(e),I=(e,t)=>t===1?e:I(e[0],t-1),A=(e,t,n)=>{const r=[];for(const[s,i]of e.entries()){let o,f,u=[];N.isAbiParameterSchema(i)?(o=i.type,f=i.name,u=i.components):typeof i=="string"?o=i:Array.isArray(i)&&(i[1]&&Array.isArray(i[1])?(o=i[0],u=i[1]):(o="tuple",u=i));const{baseType:y,isArray:p,arraySizes:m}=g(o),c=Array.isArray(t)?t[s]:t[f];if(y==="tuple"&&!p)r.push(A(u,c,n));else if(y==="tuple"&&p){const a=[];for(const h of c)if(m.length>1){const z=I(h,m.length-1),$=[];for(const H of z)$.push(A(u,H,n));a.push($)}else a.push(A(u,h,n));r.push(a)}else r.push(c)}return n=n??[],n.push(...r),n},B=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error(`Invalid code point: ${e}`)},O=e=>{if(!b.isHexStrict(e))throw new Error("Invalid hex string");const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=BigInt(n);return r>Number.MAX_SAFE_INTEGER?t?-r:r:r<Number.MIN_SAFE_INTEGER?r:t?-1*Number(r):Number(r)},x=e=>{if((typeof e=="number"||typeof e=="bigint")&&e<0)return`-0x${e.toString(16).slice(1)}`;if((typeof e=="number"||typeof e=="bigint")&&e>=0)return`0x${e.toString(16)}`;if(typeof e=="string"&&b.isHexStrict(e)){const[t,n]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],r=n.split(/^(-)?0(x|X)/).slice(-1)[0];return`${t?"-":""}0x${r.replace(/^0+/,"").toLowerCase()}`}if(typeof e=="string"&&!b.isHexStrict(e))return x(BigInt(e));throw new S.InvalidNumberError(e)},U=(e,t,n="0")=>{if(typeof e=="string"&&!b.isHexStrict(e))return e.padStart(t,n);const r=typeof e=="string"&&b.isHexStrict(e)?e:x(e),[s,i]=r.startsWith("-")?["-0x",r.slice(3)]:["0x",r.slice(2)];return`${s}${i.padStart(t,n)}`};function j(e){let t="0x";for(const n of e){const r=n.toString(16);t+=r.length===1?`0${r}`:r}return t}const l={zero:48,nine:57,A:65,F:70,a:97,f:102};function w(e){if(e>=l.zero&&e<=l.nine)return e-l.zero;if(e>=l.A&&e<=l.F)return e-(l.A-10);if(e>=l.a&&e<=l.f)return e-(l.a-10)}function C(e){let t=0;if(e.startsWith("0")&&(e[1]==="x"||e[1]==="X")&&(t=2),e.length%2!==0)throw new S.InvalidBytesError(`hex string has odd length: ${e}`);const n=(e.length-t)/2,r=new Uint8Array(n);for(let s=0,i=t;s<n;s+=1){const o=w(e.charCodeAt(i++)),f=w(e.charCodeAt(i++));if(o===void 0||f===void 0)throw new S.InvalidBytesError(`Invalid byte sequence ("${e[i-2]}${e[i-1]}" in "${e}").`);r[s]=o*16+f}return r}function F(e){var t;return!(e instanceof Uint8Array)&&((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="Uint8Array"?Uint8Array.from(e):e}exports.abiSchemaToJsonSchema=d;exports.codePointToInt=B;exports.ensureIfUint8Array=F;exports.ethAbiToJsonSchema=_;exports.fetchArrayElement=I;exports.hexToNumber=O;exports.hexToUint8Array=C;exports.numberToHex=x;exports.padLeft=U;exports.parseBaseType=g;exports.transformJsonDataToAbiFormat=A;exports.uint8ArrayToHexString=j;
@@ -1,23 +1,23 @@
1
- import { InvalidNumberError as _, InvalidBytesError as x } from "../../../web3-errors/lib/esm/errors/utils_errors.js";
1
+ import { InvalidNumberError as _, InvalidBytesError as $ } from "../../../web3-errors/lib/esm/errors/utils_errors.js";
2
2
  import "../../../web3-errors/lib/esm/errors/rpc_errors.js";
3
3
  import { VALID_ETH_BASE_TYPES as C } from "./constants.js";
4
4
  import { isAbiParameterSchema as w } from "./validation/abi.js";
5
5
  import { isHexStrict as b } from "./validation/string.js";
6
6
  import { Web3ValidatorError as S } from "./errors.js";
7
- const B = ["hex", "number", "blockNumber", "blockNumberOrTag", "filter", "bloom"], I = (e) => {
8
- let t = e.replace(/ /, ""), i, r = !1, s = [];
9
- if (e.includes("[") && (t = t.slice(0, t.indexOf("[")), s = [...e.matchAll(/(?:\[(\d*)\])/g)].map((n) => parseInt(n[1], 10)).map((n) => Number.isNaN(n) ? -1 : n), r = s.length > 0), C.includes(t))
10
- return { baseType: t, isArray: r, baseTypeSize: i, arraySizes: s };
7
+ const O = ["hex", "number", "blockNumber", "blockNumberOrTag", "filter", "bloom"], I = (e) => {
8
+ let t = e.replace(/ /, ""), n, r = !1, s = [];
9
+ if (e.includes("[") && (t = t.slice(0, t.indexOf("[")), s = [...e.matchAll(/(?:\[(\d*)\])/g)].map((i) => parseInt(i[1], 10)).map((i) => Number.isNaN(i) ? -1 : i), r = s.length > 0), C.includes(t))
10
+ return { baseType: t, isArray: r, baseTypeSize: n, arraySizes: s };
11
11
  if (t.startsWith("int"))
12
- i = parseInt(t.substring(3), 10), t = "int";
12
+ n = parseInt(t.substring(3), 10), t = "int";
13
13
  else if (t.startsWith("uint"))
14
- i = parseInt(e.substring(4), 10), t = "uint";
14
+ n = parseInt(e.substring(4), 10), t = "uint";
15
15
  else if (t.startsWith("bytes"))
16
- i = parseInt(t.substring(5), 10), t = "bytes";
16
+ n = parseInt(t.substring(5), 10), t = "bytes";
17
17
  else
18
18
  return { baseType: void 0, isArray: !1, baseTypeSize: void 0, arraySizes: s };
19
- return { baseType: t, isArray: r, baseTypeSize: i, arraySizes: s };
20
- }, d = (e, t = {}) => {
19
+ return { baseType: t, isArray: r, baseTypeSize: n, arraySizes: s };
20
+ }, g = (e, t = {}) => {
21
21
  if (Object.keys(t).includes("type"))
22
22
  throw new S([
23
23
  {
@@ -29,7 +29,7 @@ const B = ["hex", "number", "blockNumber", "blockNumberOrTag", "filter", "bloom"
29
29
  }
30
30
  ]);
31
31
  const { baseType: r, baseTypeSize: s } = I(e);
32
- if (!r && !B.includes(e))
32
+ if (!r && !O.includes(e))
33
33
  throw new S([
34
34
  {
35
35
  keyword: "eth",
@@ -46,73 +46,62 @@ const B = ["hex", "number", "blockNumber", "blockNumberOrTag", "filter", "bloom"
46
46
  }
47
47
  return e ? { format: e, required: !0 } : {};
48
48
  }, A = (e, t = "/0") => {
49
- const i = {
49
+ const n = {
50
50
  type: "array",
51
51
  items: [],
52
52
  maxItems: e.length,
53
53
  minItems: e.length
54
54
  };
55
55
  for (const [r, s] of e.entries()) {
56
- let n, o, f = [];
57
- w(s) ? (n = s.type, o = s.name, f = s.components) : typeof s == "string" ? (n = s, o = `${t}/${r}`) : Array.isArray(s) && (s[0] && typeof s[0] == "string" && s[0].startsWith("tuple") && !Array.isArray(s[0]) && s[1] && Array.isArray(s[1]) ? (n = s[0], o = `${t}/${r}`, f = s[1]) : (n = "tuple", o = `${t}/${r}`, f = s));
58
- const { baseType: p, isArray: h, arraySizes: c } = I(n);
59
- let l, a = i;
60
- for (let m = c.length - 1; m > 0; m -= 1)
61
- l = {
62
- type: "array",
63
- items: [],
64
- maxItems: c[m],
65
- minItems: c[m]
66
- }, c[m] < 0 && (delete l.maxItems, delete l.minItems), Array.isArray(a.items) ? a.items.length === 0 ? a.items = l : a.items.push(l) : a.items = [a.items, l], a = l;
67
- if (p === "tuple" && !h) {
68
- const m = A(f, o);
69
- m.$id = o, a.items.push(m);
70
- } else if (p === "tuple" && h) {
71
- const m = c[0], u = {
72
- $id: o,
73
- type: "array",
74
- items: A(f, o),
75
- maxItems: m,
76
- minItems: m
77
- };
78
- m < 0 && (delete u.maxItems, delete u.minItems), a.items.push(u);
79
- } else if (h) {
80
- const m = c[0], u = {
56
+ let i, o, m = [];
57
+ w(s) ? (i = s.type, o = s.name, m = s.components) : typeof s == "string" ? (i = s, o = `${t}/${r}`) : Array.isArray(s) && (s[0] && typeof s[0] == "string" && s[0].startsWith("tuple") && !Array.isArray(s[0]) && s[1] && Array.isArray(s[1]) ? (i = s[0], o = `${t}/${r}`, m = s[1]) : (i = "tuple", o = `${t}/${r}`, m = s));
58
+ const { baseType: c, isArray: y, arraySizes: l } = I(i);
59
+ let p, f = n;
60
+ for (let a = l.length - 1; a > 0; a -= 1)
61
+ p = {
81
62
  type: "array",
82
63
  $id: o,
83
- items: d(String(p)),
84
- minItems: m,
85
- maxItems: m
86
- };
87
- m < 0 && (delete u.maxItems, delete u.minItems), a.items.push(u);
64
+ items: [],
65
+ maxItems: l[a],
66
+ minItems: l[a]
67
+ }, l[a] < 0 && (delete p.maxItems, delete p.minItems), Array.isArray(f.items) ? f.items.length === 0 ? f.items = [p] : f.items.push(p) : f.items = [f.items, p], f = p;
68
+ if (c === "tuple" && !y) {
69
+ const a = A(m, o);
70
+ a.$id = o, f.items.push(a);
71
+ } else if (c === "tuple" && y) {
72
+ const a = l[0], h = Object.assign({ type: "array", $id: o, items: A(m, o) }, a >= 0 && { minItems: a, maxItems: a });
73
+ f.items.push(h);
74
+ } else if (y) {
75
+ const a = l[0], h = Object.assign({ type: "array", $id: o, items: g(i) }, a >= 0 && { minItems: a, maxItems: a });
76
+ f.items.push(h);
88
77
  } else
89
- Array.isArray(a.items) ? a.items.push(Object.assign({ $id: o }, d(n))) : a.items.items.push(Object.assign({ $id: o }, d(n)));
90
- a = i;
78
+ Array.isArray(f.items) ? f.items.push(Object.assign({ $id: o }, g(i))) : f.items.push(Object.assign({ $id: o }, g(i)));
79
+ f = n;
91
80
  }
92
- return i;
93
- }, H = (e) => A(e), E = (e, t) => t === 1 ? e : E(e[0], t - 1), g = (e, t, i) => {
81
+ return n;
82
+ }, H = (e) => A(e), E = (e, t) => t === 1 ? e : E(e[0], t - 1), d = (e, t, n) => {
94
83
  const r = [];
95
- for (const [s, n] of e.entries()) {
96
- let o, f, p = [];
97
- w(n) ? (o = n.type, f = n.name, p = n.components) : typeof n == "string" ? o = n : Array.isArray(n) && (n[1] && Array.isArray(n[1]) ? (o = n[0], p = n[1]) : (o = "tuple", p = n));
98
- const { baseType: h, isArray: c, arraySizes: l } = I(o), a = Array.isArray(t) ? t[s] : t[f];
99
- if (h === "tuple" && !c)
100
- r.push(g(p, a, i));
101
- else if (h === "tuple" && c) {
102
- const m = [];
103
- for (const u of a)
104
- if (l.length > 1) {
105
- const z = E(u, l.length - 1), T = [];
84
+ for (const [s, i] of e.entries()) {
85
+ let o, m, c = [];
86
+ w(i) ? (o = i.type, m = i.name, c = i.components) : typeof i == "string" ? o = i : Array.isArray(i) && (i[1] && Array.isArray(i[1]) ? (o = i[0], c = i[1]) : (o = "tuple", c = i));
87
+ const { baseType: y, isArray: l, arraySizes: p } = I(o), f = Array.isArray(t) ? t[s] : t[m];
88
+ if (y === "tuple" && !l)
89
+ r.push(d(c, f, n));
90
+ else if (y === "tuple" && l) {
91
+ const a = [];
92
+ for (const h of f)
93
+ if (p.length > 1) {
94
+ const z = E(h, p.length - 1), T = [];
106
95
  for (const W of z)
107
- T.push(g(p, W, i));
108
- m.push(T);
96
+ T.push(d(c, W, n));
97
+ a.push(T);
109
98
  } else
110
- m.push(g(p, u, i));
111
- r.push(m);
112
- } else
99
+ a.push(d(c, h, n));
113
100
  r.push(a);
101
+ } else
102
+ r.push(f);
114
103
  }
115
- return i = i ?? [], i.push(...r), i;
104
+ return n = n ?? [], n.push(...r), n;
116
105
  }, L = (e) => {
117
106
  if (e >= 48 && e <= 57)
118
107
  return e - 48;
@@ -124,7 +113,7 @@ const B = ["hex", "number", "blockNumber", "blockNumberOrTag", "filter", "bloom"
124
113
  }, q = (e) => {
125
114
  if (!b(e))
126
115
  throw new Error("Invalid hex string");
127
- const [t, i] = e.startsWith("-") ? [!0, e.slice(1)] : [!1, e], r = BigInt(i);
116
+ const [t, n] = e.startsWith("-") ? [!0, e.slice(1)] : [!1, e], r = BigInt(n);
128
117
  return r > Number.MAX_SAFE_INTEGER ? t ? -r : r : r < Number.MIN_SAFE_INTEGER ? r : t ? -1 * Number(r) : Number(r);
129
118
  }, N = (e) => {
130
119
  if ((typeof e == "number" || typeof e == "bigint") && e < 0)
@@ -132,27 +121,27 @@ const B = ["hex", "number", "blockNumber", "blockNumberOrTag", "filter", "bloom"
132
121
  if ((typeof e == "number" || typeof e == "bigint") && e >= 0)
133
122
  return `0x${e.toString(16)}`;
134
123
  if (typeof e == "string" && b(e)) {
135
- const [t, i] = e.startsWith("-") ? [!0, e.slice(1)] : [!1, e], r = i.split(/^(-)?0(x|X)/).slice(-1)[0];
124
+ const [t, n] = e.startsWith("-") ? [!0, e.slice(1)] : [!1, e], r = n.split(/^(-)?0(x|X)/).slice(-1)[0];
136
125
  return `${t ? "-" : ""}0x${r.replace(/^0+/, "").toLowerCase()}`;
137
126
  }
138
127
  if (typeof e == "string" && !b(e))
139
128
  return N(BigInt(e));
140
129
  throw new _(e);
141
- }, J = (e, t, i = "0") => {
130
+ }, J = (e, t, n = "0") => {
142
131
  if (typeof e == "string" && !b(e))
143
- return e.padStart(t, i);
144
- const r = typeof e == "string" && b(e) ? e : N(e), [s, n] = r.startsWith("-") ? ["-0x", r.slice(3)] : ["0x", r.slice(2)];
145
- return `${s}${n.padStart(t, i)}`;
132
+ return e.padStart(t, n);
133
+ const r = typeof e == "string" && b(e) ? e : N(e), [s, i] = r.startsWith("-") ? ["-0x", r.slice(3)] : ["0x", r.slice(2)];
134
+ return `${s}${i.padStart(t, n)}`;
146
135
  };
147
136
  function M(e) {
148
137
  let t = "0x";
149
- for (const i of e) {
150
- const r = i.toString(16);
138
+ for (const n of e) {
139
+ const r = n.toString(16);
151
140
  t += r.length === 1 ? `0${r}` : r;
152
141
  }
153
142
  return t;
154
143
  }
155
- const y = {
144
+ const u = {
156
145
  zero: 48,
157
146
  nine: 57,
158
147
  A: 65,
@@ -160,24 +149,24 @@ const y = {
160
149
  a: 97,
161
150
  f: 102
162
151
  };
163
- function $(e) {
164
- if (e >= y.zero && e <= y.nine)
165
- return e - y.zero;
166
- if (e >= y.A && e <= y.F)
167
- return e - (y.A - 10);
168
- if (e >= y.a && e <= y.f)
169
- return e - (y.a - 10);
152
+ function x(e) {
153
+ if (e >= u.zero && e <= u.nine)
154
+ return e - u.zero;
155
+ if (e >= u.A && e <= u.F)
156
+ return e - (u.A - 10);
157
+ if (e >= u.a && e <= u.f)
158
+ return e - (u.a - 10);
170
159
  }
171
160
  function R(e) {
172
161
  let t = 0;
173
162
  if (e.startsWith("0") && (e[1] === "x" || e[1] === "X") && (t = 2), e.length % 2 !== 0)
174
- throw new x(`hex string has odd length: ${e}`);
175
- const i = (e.length - t) / 2, r = new Uint8Array(i);
176
- for (let s = 0, n = t; s < i; s += 1) {
177
- const o = $(e.charCodeAt(n++)), f = $(e.charCodeAt(n++));
178
- if (o === void 0 || f === void 0)
179
- throw new x(`Invalid byte sequence ("${e[n - 2]}${e[n - 1]}" in "${e}").`);
180
- r[s] = o * 16 + f;
163
+ throw new $(`hex string has odd length: ${e}`);
164
+ const n = (e.length - t) / 2, r = new Uint8Array(n);
165
+ for (let s = 0, i = t; s < n; s += 1) {
166
+ const o = x(e.charCodeAt(i++)), m = x(e.charCodeAt(i++));
167
+ if (o === void 0 || m === void 0)
168
+ throw new $(`Invalid byte sequence ("${e[i - 2]}${e[i - 1]}" in "${e}").`);
169
+ r[s] = o * 16 + m;
181
170
  }
182
171
  return r;
183
172
  }
@@ -196,6 +185,6 @@ export {
196
185
  N as numberToHex,
197
186
  J as padLeft,
198
187
  I as parseBaseType,
199
- g as transformJsonDataToAbiFormat,
188
+ d as transformJsonDataToAbiFormat,
200
189
  M as uint8ArrayToHexString
201
190
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../web3-errors/lib/esm/errors/rpc_errors.cjs");const g=require("../../../web3-errors/lib/esm/errors/schema_errors.cjs"),o=require("../../../zod/lib/index.cjs"),b=require("./errors.cjs"),y=require("./formats.cjs"),v=t=>{if((!(t!=null&&t.type)||(t==null?void 0:t.type)==="object")&&(t!=null&&t.properties)){const i={};for(const e of Object.keys(t.properties)){const n=v(t.properties[e]);n&&(i[e]=n)}return Array.isArray(t.required)?o.default.object(i).partial().required(t.required.reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:!0}),{})):o.default.object(i).partial()}if((t==null?void 0:t.type)==="array"&&(t!=null&&t.items)){if(Array.isArray(t.items)&&t.items.length>0){const i=[];for(const e of t.items){const n=v(e);n&&i.push(n)}return o.default.tuple(i)}return o.default.array(v(t.items))}if(t.oneOf&&Array.isArray(t.oneOf))return o.default.union(t.oneOf.map(i=>v(i)));if(t!=null&&t.format){if(!y.default[t.format])throw new g.SchemaFormatError(t.format);return o.default.any().refine(y.default[t.format],i=>({params:{value:i,format:t.format}}))}return t!=null&&t.type&&(t==null?void 0:t.type)!=="object"&&typeof o.default[String(t.type)]=="function"?o.default[String(t.type)]():o.default.object({data:o.default.any()}).partial()};class d{static factory(){return d.validatorInstance||(d.validatorInstance=new d),d.validatorInstance}validate(i,e,n){var r,l;const u=v(i).safeParse(e);if(!u.success){const f=this.convertErrors((l=(r=u.error)===null||r===void 0?void 0:r.issues)!==null&&l!==void 0?l:[]);if(f){if(n!=null&&n.silent)return f;throw new b.Web3ValidatorError(f)}}}convertErrors(i){if(i&&Array.isArray(i)&&i.length>0)return i.map(e=>{var n;let r,l,a,u;u=e.path.join("/");const f=String(e.path[e.path.length-1]),p=e.path.join("/");if(e.code===o.ZodIssueCode.too_big)l="maxItems",u=`${p}/maxItems`,a={limit:e.maximum},r=`must NOT have more than ${e.maximum} items`;else if(e.code===o.ZodIssueCode.too_small)l="minItems",u=`${p}/minItems`,a={limit:e.minimum},r=`must NOT have fewer than ${e.minimum} items`;else if(e.code===o.ZodIssueCode.custom){const{value:s,format:m}=(n=e.params)!==null&&n!==void 0?n:{};typeof s>"u"?r=`value at "/${u}" is required`:r=`value "${typeof s=="object"?JSON.stringify(s):s}" at "/${u}" must pass "${m}" validation`,a={value:s}}return{keyword:l??f,instancePath:p?`/${p}`:"",schemaPath:u?`#${u}`:"#",params:a??{value:e.message},message:r??e.message}})}}exports.Validator=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../web3-errors/lib/esm/errors/rpc_errors.cjs");const g=require("../../../web3-errors/lib/esm/errors/schema_errors.cjs"),o=require("../../../zod/lib/index.cjs"),I=require("./errors.cjs"),p=require("./formats.cjs"),v=t=>{if((!(t!=null&&t.type)||(t==null?void 0:t.type)==="object")&&(t!=null&&t.properties)){const n={};for(const e of Object.keys(t.properties)){const i=v(t.properties[e]);i&&(n[e]=i)}return Array.isArray(t.required)?o.default.object(n).partial().required(t.required.reduce((e,i)=>Object.assign(Object.assign({},e),{[i]:!0}),{})):o.default.object(n).partial()}if((t==null?void 0:t.type)==="array"&&(t!=null&&t.items)){if(Array.isArray(t.items)&&t.items.length>1&&t.maxItems!==void 0&&new Set(t.items.map(i=>i.$id)).size===t.items.length){const i=[];for(const r of t.items){const u=v(r);u&&i.push(u)}return o.default.tuple(i)}const n=Array.isArray(t.items)?t.items[0]:t.items;let e=o.default.array(v(n));return e=t.minItems!==void 0?e.min(t.minItems):e,e=t.maxItems!==void 0?e.max(t.maxItems):e,e}if(t.oneOf&&Array.isArray(t.oneOf))return o.default.union(t.oneOf.map(n=>v(n)));if(t!=null&&t.format){if(!p.default[t.format])throw new g.SchemaFormatError(t.format);return o.default.any().refine(p.default[t.format],n=>({params:{value:n,format:t.format}}))}return t!=null&&t.type&&(t==null?void 0:t.type)!=="object"&&typeof o.default[String(t.type)]=="function"?o.default[String(t.type)]():o.default.object({data:o.default.any()}).partial()};class a{static factory(){return a.validatorInstance||(a.validatorInstance=new a),a.validatorInstance}validate(n,e,i){var r,u;const d=v(n).safeParse(e);if(!d.success){const f=this.convertErrors((u=(r=d.error)===null||r===void 0?void 0:r.issues)!==null&&u!==void 0?u:[]);if(f){if(i!=null&&i.silent)return f;throw new I.Web3ValidatorError(f)}}}convertErrors(n){if(n&&Array.isArray(n)&&n.length>0)return n.map(e=>{var i;let r,u,l,d;d=e.path.join("/");const f=String(e.path[e.path.length-1]),m=e.path.join("/");if(e.code===o.ZodIssueCode.too_big)u="maxItems",d=`${m}/maxItems`,l={limit:e.maximum},r=`must NOT have more than ${e.maximum} items`;else if(e.code===o.ZodIssueCode.too_small)u="minItems",d=`${m}/minItems`,l={limit:e.minimum},r=`must NOT have fewer than ${e.minimum} items`;else if(e.code===o.ZodIssueCode.custom){const{value:s,format:y}=(i=e.params)!==null&&i!==void 0?i:{};typeof s>"u"?r=`value at "/${d}" is required`:r=`value "${typeof s=="object"?JSON.stringify(s):s}" at "/${d}" must pass "${y}" validation`,l={value:s}}return{keyword:u??f,instancePath:m?`/${m}`:"",schemaPath:d?`#${d}`:"#",params:l??{value:e.message},message:r??e.message}})}}exports.Validator=a;