@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.
- package/dist/main-BV1Yv9Hy.js +92 -0
- package/dist/main-DmNP-t33.mjs +13625 -0
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.cjs +1 -1
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +748 -750
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.cjs +1 -1
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +40 -39
- package/dist/node_modules/web3/lib/esm/index.cjs +1 -1
- package/dist/node_modules/web3/lib/esm/index.js +42 -41
- package/dist/node_modules/web3/lib/esm/version.cjs +1 -1
- package/dist/node_modules/web3/lib/esm/version.js +1 -1
- package/dist/node_modules/web3-eth/lib/esm/schemas.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/schemas.js +113 -88
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.cjs +3 -1
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.js +242 -217
- package/dist/node_modules/web3-eth-contract/lib/esm/encoding.cjs +1 -1
- package/dist/node_modules/web3-eth-contract/lib/esm/encoding.js +43 -37
- package/dist/node_modules/web3-eth-ens/lib/esm/config.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/config.js +3 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.js +34 -13
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.js +48 -36
- package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.js +2 -2
- package/dist/node_modules/web3-utils/lib/esm/converters.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/converters.js +52 -50
- package/dist/node_modules/web3-utils/lib/esm/uint8array.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/uint8array.js +13 -13
- package/dist/node_modules/web3-validator/lib/esm/utils.cjs +1 -1
- package/dist/node_modules/web3-validator/lib/esm/utils.js +76 -87
- package/dist/node_modules/web3-validator/lib/esm/validator.cjs +1 -1
- package/dist/node_modules/web3-validator/lib/esm/validator.js +49 -47
- package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.cjs +1 -1
- package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.js +168 -158
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +73 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +1 -73
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +20 -25
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-Bk_OtXgv.js +1 -0
- package/dist/web-VFuzUsNl.mjs +54 -0
- package/package.json +1 -1
@@ -1,21 +1,21 @@
|
|
1
|
-
import { keccak256 as
|
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
|
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
|
7
|
-
import { hexToUint8Array as
|
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
|
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
|
15
|
-
import { isNullish as
|
16
|
-
import { isUint8Array as
|
17
|
-
import { utf8ToBytes as
|
18
|
-
const
|
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]),
|
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
|
53
|
-
throw new
|
54
|
-
}, { uint8ArrayToHexString:
|
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 =
|
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)$/, ""),
|
62
|
-
}, m0 = h, h0 = h,
|
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
|
-
},
|
71
|
-
if (typeof t == "string" &&
|
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 (
|
88
|
+
if (x(t) && !b(t) && !y(t))
|
87
89
|
return r ? "bytes" : `0x${t}`;
|
88
|
-
if (
|
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
|
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
|
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" &&
|
113
|
+
if (typeof t == "string" && x(t))
|
112
114
|
return t.startsWith("-") ? -BigInt(t.substring(1)) : BigInt(t);
|
113
|
-
throw new
|
115
|
+
throw new A(t);
|
114
116
|
}, y0 = (t, r) => {
|
115
|
-
const n =
|
117
|
+
const n = N[r];
|
116
118
|
if (!n)
|
117
|
-
throw new
|
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 =
|
127
|
+
const n = N[r];
|
126
128
|
if (!n)
|
127
|
-
throw new
|
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,
|
129
|
-
return
|
130
|
-
},
|
131
|
-
if (!
|
132
|
-
throw new
|
133
|
-
const r = t.toLowerCase().replace(/^0x/i, ""), n =
|
134
|
-
if (
|
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
|
-
},
|
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
|
152
|
+
throw new D(t);
|
151
153
|
};
|
152
154
|
export {
|
153
|
-
|
154
|
-
|
155
|
+
X as asciiToHex,
|
156
|
+
$ as bytesToHex,
|
155
157
|
d as bytesToUint8Array,
|
156
|
-
|
157
|
-
|
158
|
+
N as ethUnitMap,
|
159
|
+
x0 as fromAscii,
|
158
160
|
c0 as fromDecimal,
|
159
161
|
m0 as fromUtf8,
|
160
162
|
y0 as fromWei,
|
161
|
-
|
162
|
-
|
163
|
+
Z as hexToAscii,
|
164
|
+
H as hexToBytes,
|
163
165
|
p as hexToNumber,
|
164
166
|
g0 as hexToNumberString,
|
165
|
-
|
166
|
-
|
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
|
-
|
172
|
-
|
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
|
-
|
180
|
+
R as utf8ToBytes,
|
179
181
|
h as utf8ToHex
|
180
182
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
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
|
2
|
-
var
|
3
|
-
return
|
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
|
6
|
-
const
|
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
|
8
|
+
for (const e of n)
|
9
9
|
r.set(e, o), o += e.length;
|
10
10
|
return r;
|
11
11
|
}
|
12
|
-
function c(
|
13
|
-
if (
|
12
|
+
function c(n, t) {
|
13
|
+
if (n === t)
|
14
14
|
return !0;
|
15
|
-
if (
|
15
|
+
if (n.byteLength !== t.byteLength)
|
16
16
|
return !1;
|
17
|
-
for (let r = 0; r <
|
18
|
-
if (
|
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
|
-
|
24
|
-
|
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
|
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
|
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
|
8
|
-
let t = e.replace(/ /, ""),
|
9
|
-
if (e.includes("[") && (t = t.slice(0, t.indexOf("[")), s = [...e.matchAll(/(?:\[(\d*)\])/g)].map((
|
10
|
-
return { baseType: t, isArray: r, baseTypeSize:
|
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
|
-
|
12
|
+
n = parseInt(t.substring(3), 10), t = "int";
|
13
13
|
else if (t.startsWith("uint"))
|
14
|
-
|
14
|
+
n = parseInt(e.substring(4), 10), t = "uint";
|
15
15
|
else if (t.startsWith("bytes"))
|
16
|
-
|
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:
|
20
|
-
},
|
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 && !
|
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
|
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
|
57
|
-
w(s) ? (
|
58
|
-
const { baseType:
|
59
|
-
let
|
60
|
-
for (let
|
61
|
-
|
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:
|
84
|
-
|
85
|
-
|
86
|
-
};
|
87
|
-
|
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(
|
90
|
-
|
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
|
93
|
-
}, H = (e) => A(e), E = (e, t) => t === 1 ? e : E(e[0], t - 1),
|
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,
|
96
|
-
let o,
|
97
|
-
w(
|
98
|
-
const { baseType:
|
99
|
-
if (
|
100
|
-
r.push(
|
101
|
-
else if (
|
102
|
-
const
|
103
|
-
for (const
|
104
|
-
if (
|
105
|
-
const z = E(
|
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(
|
108
|
-
|
96
|
+
T.push(d(c, W, n));
|
97
|
+
a.push(T);
|
109
98
|
} else
|
110
|
-
|
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
|
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,
|
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,
|
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,
|
130
|
+
}, J = (e, t, n = "0") => {
|
142
131
|
if (typeof e == "string" && !b(e))
|
143
|
-
return e.padStart(t,
|
144
|
-
const r = typeof e == "string" && b(e) ? e : N(e), [s,
|
145
|
-
return `${s}${
|
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
|
150
|
-
const r =
|
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
|
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
|
164
|
-
if (e >=
|
165
|
-
return e -
|
166
|
-
if (e >=
|
167
|
-
return e - (
|
168
|
-
if (e >=
|
169
|
-
return e - (
|
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
|
175
|
-
const
|
176
|
-
for (let s = 0,
|
177
|
-
const o =
|
178
|
-
if (o === void 0 ||
|
179
|
-
throw new
|
180
|
-
r[s] = o * 16 +
|
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
|
-
|
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"),
|
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;
|