@gardenfi/utils 2.1.2-beta.4 → 2.1.2-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +5 -5
- package/dist/index101.cjs +1 -2
- package/dist/index101.js +11 -3
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +18 -16
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +6 -643
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +5 -173
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +2 -2
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +9 -9
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +3 -3
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +1 -1
- package/dist/index23.cjs +1 -2
- package/dist/index23.js +40 -49
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +45 -24
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +25 -41
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +6 -45
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +12 -24
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +15 -6
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +5 -13
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +12 -14
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +10 -5
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +12 -13
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +11 -10
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +13 -12
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +23 -11
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +55 -13
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +16 -23
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +5 -55
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +8 -16
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +23 -22
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +171 -5
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +103 -8
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +20 -170
- package/dist/index43.cjs +2 -1
- package/dist/index43.js +44 -97
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +24 -21
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +38 -10
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +32 -32
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +69 -6
- package/dist/index48.cjs +1 -2
- package/dist/index48.js +110 -57
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +68 -2
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +2 -7
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +16 -4
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +222 -10
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +231 -7
- package/dist/index54.cjs +1 -5
- package/dist/index54.js +9 -53
- package/dist/index55.cjs +1 -2
- package/dist/index55.js +30 -30
- package/dist/index56.cjs +2 -1
- package/dist/index56.js +59 -5
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +22 -2
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +101 -18
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +3 -8
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +16 -9
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +8 -11
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +10 -6
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +11 -13
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +12 -31
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +18 -14
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +6 -64
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +40 -25
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +79 -3
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +14 -3
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +18 -8
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +8 -191
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +3 -17
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +189 -9
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +63 -18
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +2 -41
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +6 -34
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +11 -69
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +8 -113
- package/dist/index79.cjs +5 -1
- package/dist/index79.js +50 -61
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +2 -2
- package/dist/index81.cjs +2 -1
- package/dist/index81.js +33 -15
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +5 -223
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +6 -231
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +32 -8
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +25 -40
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +3 -105
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +10 -16
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +18 -77
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +8 -18
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +16 -10
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +638 -33
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +173 -5
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +12 -10
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +128 -2
- package/dist/index95.cjs +2 -1
- package/dist/index95.js +3 -128
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +2 -7
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +2 -2
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +2 -2
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +35 -17
- package/package.json +1 -1
package/dist/index73.js
CHANGED
|
@@ -1,14 +1,194 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { AbiEncodingLengthMismatchError as y, InvalidAbiEncodingTypeError as u, InvalidArrayError as g, AbiEncodingArrayLengthMismatchError as l, AbiEncodingBytesSizeMismatchError as b } from "./index79.js";
|
|
2
|
+
import { InvalidAddressError as w } from "./index32.js";
|
|
3
|
+
import { BaseError as A } from "./index56.js";
|
|
4
|
+
import { IntegerOutOfRangeError as x } from "./index54.js";
|
|
5
|
+
import { isAddress as z } from "./index33.js";
|
|
6
|
+
import { concat as f } from "./index65.js";
|
|
7
|
+
import { padHex as d } from "./index55.js";
|
|
8
|
+
import { size as a } from "./index72.js";
|
|
9
|
+
import { slice as E } from "./index99.js";
|
|
10
|
+
import { numberToHex as m, boolToHex as P, stringToHex as S } from "./index24.js";
|
|
11
|
+
import { integerRegex as I } from "./index86.js";
|
|
12
|
+
function K(e, t) {
|
|
13
|
+
if (e.length !== t.length)
|
|
14
|
+
throw new y({
|
|
15
|
+
expectedLength: e.length,
|
|
16
|
+
givenLength: t.length
|
|
9
17
|
});
|
|
18
|
+
const o = L({
|
|
19
|
+
params: e,
|
|
20
|
+
values: t
|
|
21
|
+
}), n = h(o);
|
|
22
|
+
return n.length === 0 ? "0x" : n;
|
|
23
|
+
}
|
|
24
|
+
function L({ params: e, values: t }) {
|
|
25
|
+
const o = [];
|
|
26
|
+
for (let n = 0; n < e.length; n++)
|
|
27
|
+
o.push(p({ param: e[n], value: t[n] }));
|
|
28
|
+
return o;
|
|
29
|
+
}
|
|
30
|
+
function p({ param: e, value: t }) {
|
|
31
|
+
const o = W(e.type);
|
|
32
|
+
if (o) {
|
|
33
|
+
const [n, r] = o;
|
|
34
|
+
return M(t, { length: n, param: { ...e, type: r } });
|
|
35
|
+
}
|
|
36
|
+
if (e.type === "tuple")
|
|
37
|
+
return H(t, {
|
|
38
|
+
param: e
|
|
39
|
+
});
|
|
40
|
+
if (e.type === "address")
|
|
41
|
+
return B(t);
|
|
42
|
+
if (e.type === "bool")
|
|
43
|
+
return T(t);
|
|
44
|
+
if (e.type.startsWith("uint") || e.type.startsWith("int")) {
|
|
45
|
+
const n = e.type.startsWith("int"), [, , r = "256"] = I.exec(e.type) ?? [];
|
|
46
|
+
return $(t, {
|
|
47
|
+
signed: n,
|
|
48
|
+
size: Number(r)
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (e.type.startsWith("bytes"))
|
|
52
|
+
return N(t, { param: e });
|
|
53
|
+
if (e.type === "string")
|
|
54
|
+
return C(t);
|
|
55
|
+
throw new u(e.type, {
|
|
56
|
+
docsPath: "/docs/contract/encodeAbiParameters"
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function h(e) {
|
|
60
|
+
let t = 0;
|
|
61
|
+
for (let i = 0; i < e.length; i++) {
|
|
62
|
+
const { dynamic: c, encoded: s } = e[i];
|
|
63
|
+
c ? t += 32 : t += a(s);
|
|
64
|
+
}
|
|
65
|
+
const o = [], n = [];
|
|
66
|
+
let r = 0;
|
|
67
|
+
for (let i = 0; i < e.length; i++) {
|
|
68
|
+
const { dynamic: c, encoded: s } = e[i];
|
|
69
|
+
c ? (o.push(m(t + r, { size: 32 })), n.push(s), r += a(s)) : o.push(s);
|
|
70
|
+
}
|
|
71
|
+
return f([...o, ...n]);
|
|
72
|
+
}
|
|
73
|
+
function B(e) {
|
|
74
|
+
if (!z(e))
|
|
75
|
+
throw new w({ address: e });
|
|
76
|
+
return { dynamic: !1, encoded: d(e.toLowerCase()) };
|
|
77
|
+
}
|
|
78
|
+
function M(e, { length: t, param: o }) {
|
|
79
|
+
const n = t === null;
|
|
80
|
+
if (!Array.isArray(e))
|
|
81
|
+
throw new g(e);
|
|
82
|
+
if (!n && e.length !== t)
|
|
83
|
+
throw new l({
|
|
84
|
+
expectedLength: t,
|
|
85
|
+
givenLength: e.length,
|
|
86
|
+
type: `${o.type}[${t}]`
|
|
87
|
+
});
|
|
88
|
+
let r = !1;
|
|
89
|
+
const i = [];
|
|
90
|
+
for (let c = 0; c < e.length; c++) {
|
|
91
|
+
const s = p({ param: o, value: e[c] });
|
|
92
|
+
s.dynamic && (r = !0), i.push(s);
|
|
10
93
|
}
|
|
94
|
+
if (n || r) {
|
|
95
|
+
const c = h(i);
|
|
96
|
+
if (n) {
|
|
97
|
+
const s = m(i.length, { size: 32 });
|
|
98
|
+
return {
|
|
99
|
+
dynamic: !0,
|
|
100
|
+
encoded: i.length > 0 ? f([s, c]) : s
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (r)
|
|
104
|
+
return { dynamic: !0, encoded: c };
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
dynamic: !1,
|
|
108
|
+
encoded: f(i.map(({ encoded: c }) => c))
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function N(e, { param: t }) {
|
|
112
|
+
const [, o] = t.type.split("bytes"), n = a(e);
|
|
113
|
+
if (!o) {
|
|
114
|
+
let r = e;
|
|
115
|
+
return n % 32 !== 0 && (r = d(r, {
|
|
116
|
+
dir: "right",
|
|
117
|
+
size: Math.ceil((e.length - 2) / 2 / 32) * 32
|
|
118
|
+
})), {
|
|
119
|
+
dynamic: !0,
|
|
120
|
+
encoded: f([d(m(n, { size: 32 })), r])
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (n !== Number.parseInt(o))
|
|
124
|
+
throw new b({
|
|
125
|
+
expectedSize: Number.parseInt(o),
|
|
126
|
+
value: e
|
|
127
|
+
});
|
|
128
|
+
return { dynamic: !1, encoded: d(e, { dir: "right" }) };
|
|
129
|
+
}
|
|
130
|
+
function T(e) {
|
|
131
|
+
if (typeof e != "boolean")
|
|
132
|
+
throw new A(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);
|
|
133
|
+
return { dynamic: !1, encoded: d(P(e)) };
|
|
134
|
+
}
|
|
135
|
+
function $(e, { signed: t, size: o = 256 }) {
|
|
136
|
+
if (typeof o == "number") {
|
|
137
|
+
const n = 2n ** (BigInt(o) - (t ? 1n : 0n)) - 1n, r = t ? -n - 1n : 0n;
|
|
138
|
+
if (e > n || e < r)
|
|
139
|
+
throw new x({
|
|
140
|
+
max: n.toString(),
|
|
141
|
+
min: r.toString(),
|
|
142
|
+
signed: t,
|
|
143
|
+
size: o / 8,
|
|
144
|
+
value: e.toString()
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
dynamic: !1,
|
|
149
|
+
encoded: m(e, {
|
|
150
|
+
size: 32,
|
|
151
|
+
signed: t
|
|
152
|
+
})
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function C(e) {
|
|
156
|
+
const t = S(e), o = Math.ceil(a(t) / 32), n = [];
|
|
157
|
+
for (let r = 0; r < o; r++)
|
|
158
|
+
n.push(d(E(t, r * 32, (r + 1) * 32), {
|
|
159
|
+
dir: "right"
|
|
160
|
+
}));
|
|
161
|
+
return {
|
|
162
|
+
dynamic: !0,
|
|
163
|
+
encoded: f([
|
|
164
|
+
d(m(a(t), { size: 32 })),
|
|
165
|
+
...n
|
|
166
|
+
])
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function H(e, { param: t }) {
|
|
170
|
+
let o = !1;
|
|
171
|
+
const n = [];
|
|
172
|
+
for (let r = 0; r < t.components.length; r++) {
|
|
173
|
+
const i = t.components[r], c = Array.isArray(e) ? r : i.name, s = p({
|
|
174
|
+
param: i,
|
|
175
|
+
value: e[c]
|
|
176
|
+
});
|
|
177
|
+
n.push(s), s.dynamic && (o = !0);
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
dynamic: o,
|
|
181
|
+
encoded: o ? h(n) : f(n.map(({ encoded: r }) => r))
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function W(e) {
|
|
185
|
+
const t = e.match(/^(.*)\[(\d+)?\]$/);
|
|
186
|
+
return t ? (
|
|
187
|
+
// Return `null` if the array is dynamic.
|
|
188
|
+
[t[2] ? Number(t[2]) : null, t[1]]
|
|
189
|
+
) : void 0;
|
|
11
190
|
}
|
|
12
191
|
export {
|
|
13
|
-
|
|
192
|
+
K as encodeAbiParameters,
|
|
193
|
+
W as getArrayComponents
|
|
14
194
|
};
|
package/dist/index74.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index79.cjs"),z=require("./index32.cjs"),o=require("./index85.cjs"),T=require("./index33.cjs"),u=require("./index72.cjs"),q=require("./index24.cjs"),g=require("./index86.cjs");function P(e){const{domain:n,message:b,primaryType:a,types:r}=e,c=(l,h)=>{for(const v of l){const{name:I,type:s}=v,t=h[I],y=s.match(g.integerRegex);if(y&&(typeof t=="number"||typeof t=="bigint")){const[w,i,D]=y;q.numberToHex(t,{signed:i==="int",size:Number.parseInt(D)/8})}if(s==="address"&&typeof t=="string"&&!T.isAddress(t))throw new z.InvalidAddressError({address:t});const f=s.match(g.bytesRegex);if(f){const[w,i]=f;if(i&&u.size(t)!==Number.parseInt(i))throw new E.BytesSizeMismatchError({expectedSize:Number.parseInt(i),givenSize:u.size(t)})}const p=r[s];p&&(x(s),c(p,t))}};if(r.EIP712Domain&&n){if(typeof n!="object")throw new o.InvalidDomainError({domain:n});c(r.EIP712Domain,n)}if(a!=="EIP712Domain")if(r[a])c(r[a],b);else throw new o.InvalidPrimaryTypeError({primaryType:a,types:r})}function d({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function x(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new o.InvalidStructTypeError({type:e})}exports.getTypesForEIP712Domain=d;exports.validateTypedData=P;
|
package/dist/index74.js
CHANGED
|
@@ -1,22 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { BytesSizeMismatchError as m } from "./index79.js";
|
|
2
|
+
import { InvalidAddressError as w } from "./index32.js";
|
|
3
|
+
import { InvalidDomainError as E, InvalidPrimaryTypeError as z, InvalidStructTypeError as D } from "./index85.js";
|
|
4
|
+
import { isAddress as T } from "./index33.js";
|
|
5
|
+
import { size as y } from "./index72.js";
|
|
6
|
+
import { numberToHex as x } from "./index24.js";
|
|
7
|
+
import { integerRegex as P, bytesRegex as S } from "./index86.js";
|
|
8
|
+
function j(e) {
|
|
9
|
+
const { domain: n, message: g, primaryType: o, types: r } = e, f = (h, b) => {
|
|
10
|
+
for (const u of h) {
|
|
11
|
+
const { name: l, type: s } = u, t = b[l], a = s.match(P);
|
|
12
|
+
if (a && (typeof t == "number" || typeof t == "bigint")) {
|
|
13
|
+
const [I, i, v] = a;
|
|
14
|
+
x(t, {
|
|
15
|
+
signed: i === "int",
|
|
16
|
+
size: Number.parseInt(v) / 8
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
if (s === "address" && typeof t == "string" && !T(t))
|
|
20
|
+
throw new w({ address: t });
|
|
21
|
+
const p = s.match(S);
|
|
22
|
+
if (p) {
|
|
23
|
+
const [I, i] = p;
|
|
24
|
+
if (i && y(t) !== Number.parseInt(i))
|
|
25
|
+
throw new m({
|
|
26
|
+
expectedSize: Number.parseInt(i),
|
|
27
|
+
givenSize: y(t)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const c = r[s];
|
|
31
|
+
c && (_(s), f(c, t));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
if (r.EIP712Domain && n) {
|
|
35
|
+
if (typeof n != "object")
|
|
36
|
+
throw new E({ domain: n });
|
|
37
|
+
f(r.EIP712Domain, n);
|
|
38
|
+
}
|
|
39
|
+
if (o !== "EIP712Domain")
|
|
40
|
+
if (r[o])
|
|
41
|
+
f(r[o], g);
|
|
42
|
+
else
|
|
43
|
+
throw new z({ primaryType: o, types: r });
|
|
16
44
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
45
|
+
function F({ domain: e }) {
|
|
46
|
+
return [
|
|
47
|
+
typeof (e == null ? void 0 : e.name) == "string" && { name: "name", type: "string" },
|
|
48
|
+
(e == null ? void 0 : e.version) && { name: "version", type: "string" },
|
|
49
|
+
(typeof (e == null ? void 0 : e.chainId) == "number" || typeof (e == null ? void 0 : e.chainId) == "bigint") && {
|
|
50
|
+
name: "chainId",
|
|
51
|
+
type: "uint256"
|
|
52
|
+
},
|
|
53
|
+
(e == null ? void 0 : e.verifyingContract) && {
|
|
54
|
+
name: "verifyingContract",
|
|
55
|
+
type: "address"
|
|
56
|
+
},
|
|
57
|
+
(e == null ? void 0 : e.salt) && { name: "salt", type: "bytes32" }
|
|
58
|
+
].filter(Boolean);
|
|
59
|
+
}
|
|
60
|
+
function _(e) {
|
|
61
|
+
if (e === "address" || e === "bool" || e === "string" || e.startsWith("bytes") || e.startsWith("uint") || e.startsWith("int"))
|
|
62
|
+
throw new D({ type: e });
|
|
19
63
|
}
|
|
20
64
|
export {
|
|
21
|
-
|
|
65
|
+
F as getTypesForEIP712Domain,
|
|
66
|
+
j as validateTypedData
|
|
22
67
|
};
|
package/dist/index75.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="2.26.3";exports.version=e;
|
package/dist/index75.js
CHANGED
|
@@ -1,43 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Hash as H, toBytes as p } from "./index77.js";
|
|
3
|
-
class r extends H {
|
|
4
|
-
constructor(t, i) {
|
|
5
|
-
super(), this.finished = !1, this.destroyed = !1, c(t);
|
|
6
|
-
const h = p(i);
|
|
7
|
-
if (this.iHash = t.create(), typeof this.iHash.update != "function")
|
|
8
|
-
throw new Error("Expected instance of class which extends utils.Hash");
|
|
9
|
-
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
10
|
-
const o = this.blockLen, e = new Uint8Array(o);
|
|
11
|
-
e.set(h.length > o ? t.create().update(h).digest() : h);
|
|
12
|
-
for (let s = 0; s < e.length; s++)
|
|
13
|
-
e[s] ^= 54;
|
|
14
|
-
this.iHash.update(e), this.oHash = t.create();
|
|
15
|
-
for (let s = 0; s < e.length; s++)
|
|
16
|
-
e[s] ^= 106;
|
|
17
|
-
this.oHash.update(e), e.fill(0);
|
|
18
|
-
}
|
|
19
|
-
update(t) {
|
|
20
|
-
return a(this), this.iHash.update(t), this;
|
|
21
|
-
}
|
|
22
|
-
digestInto(t) {
|
|
23
|
-
a(this), u(t, this.outputLen), this.finished = !0, this.iHash.digestInto(t), this.oHash.update(t), this.oHash.digestInto(t), this.destroy();
|
|
24
|
-
}
|
|
25
|
-
digest() {
|
|
26
|
-
const t = new Uint8Array(this.oHash.outputLen);
|
|
27
|
-
return this.digestInto(t), t;
|
|
28
|
-
}
|
|
29
|
-
_cloneInto(t) {
|
|
30
|
-
t || (t = Object.create(Object.getPrototypeOf(this), {}));
|
|
31
|
-
const { oHash: i, iHash: h, finished: o, destroyed: e, blockLen: s, outputLen: d } = this;
|
|
32
|
-
return t = t, t.finished = o, t.destroyed = e, t.blockLen = s, t.outputLen = d, t.oHash = i._cloneInto(t.oHash), t.iHash = h._cloneInto(t.iHash), t;
|
|
33
|
-
}
|
|
34
|
-
destroy() {
|
|
35
|
-
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const l = (n, t, i) => new r(n, t).update(i).digest();
|
|
39
|
-
l.create = (n, t) => new r(n, t);
|
|
1
|
+
const o = "2.26.3";
|
|
40
2
|
export {
|
|
41
|
-
|
|
42
|
-
l as hmac
|
|
3
|
+
o as version
|
|
43
4
|
};
|
package/dist/index76.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index56.cjs");class i extends e.BaseError{constructor({chainId:r}){super(typeof r=="number"?`Chain ID "${r}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}exports.InvalidChainIdError=i;
|
package/dist/index76.js
CHANGED
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
7
|
-
}
|
|
8
|
-
function i(e, ...t) {
|
|
9
|
-
if (!o(e))
|
|
10
|
-
throw new Error("Uint8Array expected");
|
|
11
|
-
if (t.length > 0 && !t.includes(e.length))
|
|
12
|
-
throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length);
|
|
13
|
-
}
|
|
14
|
-
function f(e) {
|
|
15
|
-
if (typeof e != "function" || typeof e.create != "function")
|
|
16
|
-
throw new Error("Hash should be wrapped by utils.wrapConstructor");
|
|
17
|
-
n(e.outputLen), n(e.blockLen);
|
|
18
|
-
}
|
|
19
|
-
function s(e, t = !0) {
|
|
20
|
-
if (e.destroyed)
|
|
21
|
-
throw new Error("Hash instance has been destroyed");
|
|
22
|
-
if (t && e.finished)
|
|
23
|
-
throw new Error("Hash#digest() has already been called");
|
|
24
|
-
}
|
|
25
|
-
function u(e, t) {
|
|
26
|
-
i(e);
|
|
27
|
-
const r = t.outputLen;
|
|
28
|
-
if (e.length < r)
|
|
29
|
-
throw new Error("digestInto() expects output buffer of length at least " + r);
|
|
1
|
+
import { BaseError as i } from "./index56.js";
|
|
2
|
+
class o extends i {
|
|
3
|
+
constructor({ chainId: r }) {
|
|
4
|
+
super(typeof r == "number" ? `Chain ID "${r}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
|
|
5
|
+
}
|
|
30
6
|
}
|
|
31
7
|
export {
|
|
32
|
-
|
|
33
|
-
s as aexists,
|
|
34
|
-
f as ahash,
|
|
35
|
-
n as anumber,
|
|
36
|
-
u as aoutput
|
|
8
|
+
o as InvalidChainIdError
|
|
37
9
|
};
|
package/dist/index77.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(n,{args:a,eventName:t}={}){return{...n,blockHash:n.blockHash?n.blockHash:null,blockNumber:n.blockNumber?BigInt(n.blockNumber):null,logIndex:n.logIndex?Number(n.logIndex):null,transactionHash:n.transactionHash?n.transactionHash:null,transactionIndex:n.transactionIndex?Number(n.transactionIndex):null,...t?{args:a,eventName:t}:{}}}exports.formatLog=r;
|
package/dist/index77.js
CHANGED
|
@@ -1,72 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return t << 32 - e | t >>> e;
|
|
12
|
-
}
|
|
13
|
-
const b = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
14
|
-
function c(t) {
|
|
15
|
-
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
16
|
-
}
|
|
17
|
-
function a(t) {
|
|
18
|
-
for (let e = 0; e < t.length; e++)
|
|
19
|
-
t[e] = c(t[e]);
|
|
20
|
-
}
|
|
21
|
-
function s(t) {
|
|
22
|
-
if (typeof t != "string")
|
|
23
|
-
throw new Error("utf8ToBytes expected string, got " + typeof t);
|
|
24
|
-
return new Uint8Array(new TextEncoder().encode(t));
|
|
25
|
-
}
|
|
26
|
-
function y(t) {
|
|
27
|
-
return typeof t == "string" && (t = s(t)), i(t), t;
|
|
28
|
-
}
|
|
29
|
-
function x(...t) {
|
|
30
|
-
let e = 0;
|
|
31
|
-
for (let n = 0; n < t.length; n++) {
|
|
32
|
-
const r = t[n];
|
|
33
|
-
i(r), e += r.length;
|
|
34
|
-
}
|
|
35
|
-
const f = new Uint8Array(e);
|
|
36
|
-
for (let n = 0, r = 0; n < t.length; n++) {
|
|
37
|
-
const u = t[n];
|
|
38
|
-
f.set(u, r), r += u.length;
|
|
39
|
-
}
|
|
40
|
-
return f;
|
|
41
|
-
}
|
|
42
|
-
class h {
|
|
43
|
-
// Safe version that clones internal state
|
|
44
|
-
clone() {
|
|
45
|
-
return this._cloneInto();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function B(t) {
|
|
49
|
-
const e = (n) => t().update(y(n)).digest(), f = t();
|
|
50
|
-
return e.outputLen = f.outputLen, e.blockLen = f.blockLen, e.create = () => t(), e;
|
|
51
|
-
}
|
|
52
|
-
function d(t = 32) {
|
|
53
|
-
if (o && typeof o.getRandomValues == "function")
|
|
54
|
-
return o.getRandomValues(new Uint8Array(t));
|
|
55
|
-
if (o && typeof o.randomBytes == "function")
|
|
56
|
-
return o.randomBytes(t);
|
|
57
|
-
throw new Error("crypto.getRandomValues must be defined");
|
|
1
|
+
function r(n, { args: t, eventName: a } = {}) {
|
|
2
|
+
return {
|
|
3
|
+
...n,
|
|
4
|
+
blockHash: n.blockHash ? n.blockHash : null,
|
|
5
|
+
blockNumber: n.blockNumber ? BigInt(n.blockNumber) : null,
|
|
6
|
+
logIndex: n.logIndex ? Number(n.logIndex) : null,
|
|
7
|
+
transactionHash: n.transactionHash ? n.transactionHash : null,
|
|
8
|
+
transactionIndex: n.transactionIndex ? Number(n.transactionIndex) : null,
|
|
9
|
+
...a ? { args: t, eventName: a } : {}
|
|
10
|
+
};
|
|
58
11
|
}
|
|
59
12
|
export {
|
|
60
|
-
|
|
61
|
-
c as byteSwap,
|
|
62
|
-
a as byteSwap32,
|
|
63
|
-
x as concatBytes,
|
|
64
|
-
m as createView,
|
|
65
|
-
b as isLE,
|
|
66
|
-
d as randomBytes,
|
|
67
|
-
w as rotr,
|
|
68
|
-
y as toBytes,
|
|
69
|
-
g as u32,
|
|
70
|
-
s as utf8ToBytes,
|
|
71
|
-
B as wrapConstructor
|
|
13
|
+
r as formatLog
|
|
72
14
|
};
|
package/dist/index78.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};exports.transactionType=e;
|
package/dist/index78.js
CHANGED
|
@@ -1,115 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
961987163,
|
|
9
|
-
1508970993,
|
|
10
|
-
2453635748,
|
|
11
|
-
2870763221,
|
|
12
|
-
3624381080,
|
|
13
|
-
310598401,
|
|
14
|
-
607225278,
|
|
15
|
-
1426881987,
|
|
16
|
-
1925078388,
|
|
17
|
-
2162078206,
|
|
18
|
-
2614888103,
|
|
19
|
-
3248222580,
|
|
20
|
-
3835390401,
|
|
21
|
-
4022224774,
|
|
22
|
-
264347078,
|
|
23
|
-
604807628,
|
|
24
|
-
770255983,
|
|
25
|
-
1249150122,
|
|
26
|
-
1555081692,
|
|
27
|
-
1996064986,
|
|
28
|
-
2554220882,
|
|
29
|
-
2821834349,
|
|
30
|
-
2952996808,
|
|
31
|
-
3210313671,
|
|
32
|
-
3336571891,
|
|
33
|
-
3584528711,
|
|
34
|
-
113926993,
|
|
35
|
-
338241895,
|
|
36
|
-
666307205,
|
|
37
|
-
773529912,
|
|
38
|
-
1294757372,
|
|
39
|
-
1396182291,
|
|
40
|
-
1695183700,
|
|
41
|
-
1986661051,
|
|
42
|
-
2177026350,
|
|
43
|
-
2456956037,
|
|
44
|
-
2730485921,
|
|
45
|
-
2820302411,
|
|
46
|
-
3259730800,
|
|
47
|
-
3345764771,
|
|
48
|
-
3516065817,
|
|
49
|
-
3600352804,
|
|
50
|
-
4094571909,
|
|
51
|
-
275423344,
|
|
52
|
-
430227734,
|
|
53
|
-
506948616,
|
|
54
|
-
659060556,
|
|
55
|
-
883997877,
|
|
56
|
-
958139571,
|
|
57
|
-
1322822218,
|
|
58
|
-
1537002063,
|
|
59
|
-
1747873779,
|
|
60
|
-
1955562222,
|
|
61
|
-
2024104815,
|
|
62
|
-
2227730452,
|
|
63
|
-
2361852424,
|
|
64
|
-
2428436474,
|
|
65
|
-
2756734187,
|
|
66
|
-
3204031479,
|
|
67
|
-
3329325298
|
|
68
|
-
]), b = /* @__PURE__ */ new Uint32Array([
|
|
69
|
-
1779033703,
|
|
70
|
-
3144134277,
|
|
71
|
-
1013904242,
|
|
72
|
-
2773480762,
|
|
73
|
-
1359893119,
|
|
74
|
-
2600822924,
|
|
75
|
-
528734635,
|
|
76
|
-
1541459225
|
|
77
|
-
]), h = /* @__PURE__ */ new Uint32Array(64);
|
|
78
|
-
class w extends m {
|
|
79
|
-
constructor() {
|
|
80
|
-
super(64, 32, 8, !1), this.A = b[0] | 0, this.B = b[1] | 0, this.C = b[2] | 0, this.D = b[3] | 0, this.E = b[4] | 0, this.F = b[5] | 0, this.G = b[6] | 0, this.H = b[7] | 0;
|
|
81
|
-
}
|
|
82
|
-
get() {
|
|
83
|
-
const { A: d, B: o, C: t, D: s, E: a, F: f, G: c, H: e } = this;
|
|
84
|
-
return [d, o, t, s, a, f, c, e];
|
|
85
|
-
}
|
|
86
|
-
// prettier-ignore
|
|
87
|
-
set(d, o, t, s, a, f, c, e) {
|
|
88
|
-
this.A = d | 0, this.B = o | 0, this.C = t | 0, this.D = s | 0, this.E = a | 0, this.F = f | 0, this.G = c | 0, this.H = e | 0;
|
|
89
|
-
}
|
|
90
|
-
process(d, o) {
|
|
91
|
-
for (let x = 0; x < 16; x++, o += 4)
|
|
92
|
-
h[x] = d.getUint32(o, !1);
|
|
93
|
-
for (let x = 16; x < 64; x++) {
|
|
94
|
-
const A = h[x - 15], n = h[x - 2], C = i(A, 7) ^ i(A, 18) ^ A >>> 3, H = i(n, 17) ^ i(n, 19) ^ n >>> 10;
|
|
95
|
-
h[x] = H + h[x - 7] + C + h[x - 16] | 0;
|
|
96
|
-
}
|
|
97
|
-
let { A: t, B: s, C: a, D: f, E: c, F: e, G: r, H: l } = this;
|
|
98
|
-
for (let x = 0; x < 64; x++) {
|
|
99
|
-
const A = i(c, 6) ^ i(c, 11) ^ i(c, 25), n = l + A + p(c, e, r) + g[x] + h[x] | 0, H = (i(t, 2) ^ i(t, 13) ^ i(t, 22)) + u(t, s, a) | 0;
|
|
100
|
-
l = r, r = e, e = c, c = f + n | 0, f = a, a = s, s = t, t = n + H | 0;
|
|
101
|
-
}
|
|
102
|
-
t = t + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, f = f + this.D | 0, c = c + this.E | 0, e = e + this.F | 0, r = r + this.G | 0, l = l + this.H | 0, this.set(t, s, a, f, c, e, r, l);
|
|
103
|
-
}
|
|
104
|
-
roundClean() {
|
|
105
|
-
h.fill(0);
|
|
106
|
-
}
|
|
107
|
-
destroy() {
|
|
108
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const G = /* @__PURE__ */ D(() => new w());
|
|
1
|
+
const e = {
|
|
2
|
+
"0x0": "legacy",
|
|
3
|
+
"0x1": "eip2930",
|
|
4
|
+
"0x2": "eip1559",
|
|
5
|
+
"0x3": "eip4844",
|
|
6
|
+
"0x4": "eip7702"
|
|
7
|
+
};
|
|
112
8
|
export {
|
|
113
|
-
|
|
114
|
-
G as sha256
|
|
9
|
+
e as transactionType
|
|
115
10
|
};
|
package/dist/index79.cjs
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index72.cjs"),n=require("./index56.cjs");class o extends n.BaseError{constructor({expectedLength:r,givenLength:e,type:t}){super([`ABI encoding array length mismatch for type ${t}.`,`Expected length: ${r}`,`Given length: ${e}`].join(`
|
|
2
|
+
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class a extends n.BaseError{constructor({expectedSize:r,value:e}){super(`Size of bytes "${e}" (bytes${i.size(e)}) does not match expected size (bytes${r}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class c extends n.BaseError{constructor({expectedLength:r,givenLength:e}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${r}`,`Given length (values): ${e}`].join(`
|
|
3
|
+
`),{name:"AbiEncodingLengthMismatchError"})}}class d extends n.BaseError{constructor({expectedSize:r,givenSize:e}){super(`Expected bytes${r}, got bytes${e}.`,{name:"BytesSizeMismatchError"})}}class E extends n.BaseError{constructor(r,{docsPath:e}){super([`Type "${r}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
4
|
+
`),{docsPath:e,name:"InvalidAbiEncodingType"})}}class g extends n.BaseError{constructor(r){super([`Value "${r}" is not a valid array.`].join(`
|
|
5
|
+
`),{name:"InvalidArrayError"})}}exports.AbiEncodingArrayLengthMismatchError=o;exports.AbiEncodingBytesSizeMismatchError=a;exports.AbiEncodingLengthMismatchError=c;exports.BytesSizeMismatchError=d;exports.InvalidAbiEncodingTypeError=E;exports.InvalidArrayError=g;
|