@gardenfi/utils 2.1.3-beta.1 → 2.1.3-beta.11
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/index104.cjs +1 -1
- package/dist/index104.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +71 -42
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +2 -2
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +1 -1
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +1 -1
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +1 -1
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +1 -1
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +4 -4
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +36 -34
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +15 -18
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +2 -2
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +43 -43
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +3 -113
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +13 -31
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +1 -1
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +1 -1
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +2 -2
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +58 -32
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +3 -3
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +3 -3
- package/dist/index247.cjs +1 -2
- package/dist/index247.js +13 -24
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +15 -13
- package/dist/index249.cjs +2 -1
- package/dist/index249.js +23 -14
- package/dist/index25.cjs +16 -1
- package/dist/index25.js +113 -11
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +32 -58
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +1 -1
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +31 -13
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +103 -16
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +13 -220
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +214 -6
- package/dist/index28.cjs +1 -16
- package/dist/index28.js +11 -113
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +7 -7
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +7 -27
- package/dist/index282.cjs +1 -1
- package/dist/index282.js +26 -34
- package/dist/index283.cjs +1 -1
- package/dist/index283.js +13 -12
- package/dist/index284.cjs +1 -1
- package/dist/index284.js +89 -51
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +3 -67
- package/dist/index286.cjs +1 -1
- package/dist/index286.js +140 -3
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +143 -128
- package/dist/index288.cjs +1 -1
- package/dist/index288.js +9 -155
- package/dist/index289.cjs +1 -1
- package/dist/index289.js +111 -7
- package/dist/index290.cjs +2 -1
- package/dist/index290.js +116 -95
- package/dist/index291.cjs +1 -2
- package/dist/index291.js +8 -131
- package/dist/index292.cjs +1 -1
- package/dist/index292.js +19 -40
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +43 -2
- package/dist/index294.cjs +1 -1
- package/dist/index294.js +74 -202
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +2 -69
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +68 -11
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +656 -18
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +197 -633
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +78 -73
- package/dist/index300.cjs +2 -2
- package/dist/index300.js +7 -7
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +1 -1
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +2 -2
- package/dist/index305.cjs +1 -1
- package/dist/index305.js +1 -1
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +2 -2
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +1 -1
- package/dist/index310.cjs +1 -1
- package/dist/index310.js +1 -1
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +5 -105
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +2 -5
- package/dist/index313.cjs +1 -1
- package/dist/index313.js +22 -2
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +1 -1
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +40 -21
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +24 -24
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +98 -97
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +1 -1
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +53 -51
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +4 -4
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +44 -42
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +15 -15
- package/package.json +1 -1
- package/dist/index314.cjs +0 -1
- package/dist/index314.js +0 -22
- package/dist/index315.cjs +0 -1
- package/dist/index315.js +0 -74
- package/dist/index316.cjs +0 -1
- package/dist/index316.js +0 -24
package/dist/index299.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 B=require("./index279.cjs"),m=require("./index298.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const E=BigInt(0),A=BigInt(1);function N(e,a){const t=a.negate();return e?t:a}function x(e,a){if(!Number.isSafeInteger(e)||e<=0||e>a)throw new Error("invalid window size, expected [1.."+a+"], got W="+e)}function b(e,a){x(e,a);const t=Math.ceil(a/e)+1,n=2**(e-1),o=2**e,i=m.bitMask(e),r=BigInt(e);return{windows:t,windowSize:n,mask:i,maxNumber:o,shiftBy:r}}function M(e,a,t){const{windowSize:n,mask:o,maxNumber:i,shiftBy:r}=t;let f=Number(e&o),s=e>>r;f>n&&(f-=i,s+=A);const c=a*n,d=c+Math.abs(f)-1,g=f===0,l=f<0,u=a%2!==0;return{nextN:s,offset:d,isZero:g,isNeg:l,isNegF:u,offsetF:c}}function O(e,a){if(!Array.isArray(e))throw new Error("array expected");e.forEach((t,n)=>{if(!(t instanceof a))throw new Error("invalid point at index "+n)})}function z(e,a){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((t,n)=>{if(!a.isValid(t))throw new Error("invalid scalar at index "+n)})}const S=new WeakMap,I=new WeakMap;function F(e){return I.get(e)||1}function k(e,a){return{constTimeNegate:N,hasPrecomputes(t){return F(t)!==1},unsafeLadder(t,n,o=e.ZERO){let i=t;for(;n>E;)n&A&&(o=o.add(i)),i=i.double(),n>>=A;return o},precomputeWindow(t,n){const{windows:o,windowSize:i}=b(n,a),r=[];let f=t,s=f;for(let c=0;c<o;c++){s=f,r.push(s);for(let d=1;d<i;d++)s=s.add(f),r.push(s);f=s.double()}return r},wNAF(t,n,o){let i=e.ZERO,r=e.BASE;const f=b(t,a);for(let s=0;s<f.windows;s++){const{nextN:c,offset:d,isZero:g,isNeg:l,isNegF:u,offsetF:h}=M(o,s,f);o=c,g?r=r.add(N(u,n[h])):i=i.add(N(l,n[d]))}return{p:i,f:r}},wNAFUnsafe(t,n,o,i=e.ZERO){const r=b(t,a);for(let f=0;f<r.windows&&o!==E;f++){const{nextN:s,offset:c,isZero:d,isNeg:g}=M(o,f,r);if(o=s,!d){const l=n[c];i=i.add(g?l.negate():l)}}return i},getPrecomputes(t,n,o){let i=S.get(n);return i||(i=this.precomputeWindow(n,t),t!==1&&S.set(n,o(i))),i},wNAFCached(t,n,o){const i=F(t);return this.wNAF(i,this.getPrecomputes(i,t,o),n)},wNAFCachedUnsafe(t,n,o,i){const r=F(t);return r===1?this.unsafeLadder(t,n,i):this.wNAFUnsafe(r,this.getPrecomputes(r,t,o),n,i)},setWindowSize(t,n){x(n,a),I.set(t,n),S.delete(t)}}}function L(e,a,t,n){O(t,e),z(n,a);const o=t.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const r=e.ZERO,f=m.bitLen(BigInt(o));let s=1;f>12?s=f-3:f>4?s=f-2:f>0&&(s=2);const c=m.bitMask(s),d=new Array(Number(c)+1).fill(r),g=Math.floor((a.BITS-1)/s)*s;let l=r;for(let u=g;u>=0;u-=s){d.fill(r);for(let w=0;w<i;w++){const p=n[w],y=Number(p>>BigInt(u)&c);d[y]=d[y].add(t[w])}let h=r;for(let w=d.length-1,p=r;w>0;w--)p=p.add(d[w]),h=h.add(p);if(l=l.add(h),u!==0)for(let w=0;w<s;w++)l=l.double()}return l}function Z(e){return B.validateField(e.Fp),m.validateObject(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...B.nLength(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}exports.pippenger=L;exports.validateBasic=Z;exports.wNAF=k;
|
package/dist/index299.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { validateField as
|
|
2
|
-
import { validateObject as
|
|
1
|
+
import { validateField as M, nLength as z } from "./index279.js";
|
|
2
|
+
import { validateObject as O, bitLen as k, bitMask as x } from "./index298.js";
|
|
3
3
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const t =
|
|
7
|
-
return e ? t :
|
|
4
|
+
const E = BigInt(0), F = BigInt(1);
|
|
5
|
+
function m(e, a) {
|
|
6
|
+
const t = a.negate();
|
|
7
|
+
return e ? t : a;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
if (!Number.isSafeInteger(e) || e <= 0 || e >
|
|
11
|
-
throw new Error("invalid window size, expected [1.." +
|
|
9
|
+
function y(e, a) {
|
|
10
|
+
if (!Number.isSafeInteger(e) || e <= 0 || e > a)
|
|
11
|
+
throw new Error("invalid window size, expected [1.." + a + "], got W=" + e);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
const t = Math.ceil(
|
|
13
|
+
function N(e, a) {
|
|
14
|
+
y(e, a);
|
|
15
|
+
const t = Math.ceil(a / e) + 1, n = 2 ** (e - 1), i = 2 ** e, o = x(e), r = BigInt(e);
|
|
16
16
|
return { windows: t, windowSize: n, mask: o, maxNumber: i, shiftBy: r };
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function B(e, a, t) {
|
|
19
19
|
const { windowSize: n, mask: i, maxNumber: o, shiftBy: r } = t;
|
|
20
|
-
let f = Number(e & i),
|
|
21
|
-
f > n && (f -= o,
|
|
22
|
-
const
|
|
23
|
-
return { nextN:
|
|
20
|
+
let f = Number(e & i), s = e >> r;
|
|
21
|
+
f > n && (f -= o, s += F);
|
|
22
|
+
const c = a * n, d = c + Math.abs(f) - 1, g = f === 0, l = f < 0, u = a % 2 !== 0;
|
|
23
|
+
return { nextN: s, offset: d, isZero: g, isNeg: l, isNegF: u, offsetF: c };
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function L(e, a) {
|
|
26
26
|
if (!Array.isArray(e))
|
|
27
27
|
throw new Error("array expected");
|
|
28
28
|
e.forEach((t, n) => {
|
|
29
|
-
if (!(t instanceof
|
|
29
|
+
if (!(t instanceof a))
|
|
30
30
|
throw new Error("invalid point at index " + n);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Z(e, a) {
|
|
34
34
|
if (!Array.isArray(e))
|
|
35
35
|
throw new Error("array of scalars expected");
|
|
36
36
|
e.forEach((t, n) => {
|
|
37
|
-
if (!
|
|
37
|
+
if (!a.isValid(t))
|
|
38
38
|
throw new Error("invalid scalar at index " + n);
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
43
|
-
return
|
|
41
|
+
const b = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap();
|
|
42
|
+
function S(e) {
|
|
43
|
+
return I.get(e) || 1;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function v(e, a) {
|
|
46
46
|
return {
|
|
47
|
-
constTimeNegate:
|
|
47
|
+
constTimeNegate: m,
|
|
48
48
|
hasPrecomputes(t) {
|
|
49
|
-
return
|
|
49
|
+
return S(t) !== 1;
|
|
50
50
|
},
|
|
51
51
|
// non-const time multiplication ladder
|
|
52
52
|
unsafeLadder(t, n, i = e.ZERO) {
|
|
53
53
|
let o = t;
|
|
54
|
-
for (; n >
|
|
55
|
-
n &
|
|
54
|
+
for (; n > E; )
|
|
55
|
+
n & F && (i = i.add(o)), o = o.double(), n >>= F;
|
|
56
56
|
return i;
|
|
57
57
|
},
|
|
58
58
|
/**
|
|
@@ -68,13 +68,13 @@ function R(e, s) {
|
|
|
68
68
|
* @returns precomputed point tables flattened to a single array
|
|
69
69
|
*/
|
|
70
70
|
precomputeWindow(t, n) {
|
|
71
|
-
const { windows: i, windowSize: o } =
|
|
72
|
-
let f = t,
|
|
73
|
-
for (let
|
|
74
|
-
|
|
75
|
-
for (let
|
|
76
|
-
|
|
77
|
-
f =
|
|
71
|
+
const { windows: i, windowSize: o } = N(n, a), r = [];
|
|
72
|
+
let f = t, s = f;
|
|
73
|
+
for (let c = 0; c < i; c++) {
|
|
74
|
+
s = f, r.push(s);
|
|
75
|
+
for (let d = 1; d < o; d++)
|
|
76
|
+
s = s.add(f), r.push(s);
|
|
77
|
+
f = s.double();
|
|
78
78
|
}
|
|
79
79
|
return r;
|
|
80
80
|
},
|
|
@@ -87,10 +87,10 @@ function R(e, s) {
|
|
|
87
87
|
*/
|
|
88
88
|
wNAF(t, n, i) {
|
|
89
89
|
let o = e.ZERO, r = e.BASE;
|
|
90
|
-
const f =
|
|
91
|
-
for (let
|
|
92
|
-
const { nextN:
|
|
93
|
-
i =
|
|
90
|
+
const f = N(t, a);
|
|
91
|
+
for (let s = 0; s < f.windows; s++) {
|
|
92
|
+
const { nextN: c, offset: d, isZero: g, isNeg: l, isNegF: u, offsetF: h } = B(i, s, f);
|
|
93
|
+
i = c, g ? r = r.add(m(u, n[h])) : o = o.add(m(l, n[d]));
|
|
94
94
|
}
|
|
95
95
|
return { p: o, f: r };
|
|
96
96
|
},
|
|
@@ -103,58 +103,63 @@ function R(e, s) {
|
|
|
103
103
|
* @returns point
|
|
104
104
|
*/
|
|
105
105
|
wNAFUnsafe(t, n, i, o = e.ZERO) {
|
|
106
|
-
const r =
|
|
107
|
-
for (let f = 0; f < r.windows && i !==
|
|
108
|
-
const { nextN:
|
|
109
|
-
if (i =
|
|
110
|
-
const
|
|
111
|
-
o = o.add(
|
|
106
|
+
const r = N(t, a);
|
|
107
|
+
for (let f = 0; f < r.windows && i !== E; f++) {
|
|
108
|
+
const { nextN: s, offset: c, isZero: d, isNeg: g } = B(i, f, r);
|
|
109
|
+
if (i = s, !d) {
|
|
110
|
+
const l = n[c];
|
|
111
|
+
o = o.add(g ? l.negate() : l);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
return o;
|
|
115
115
|
},
|
|
116
116
|
getPrecomputes(t, n, i) {
|
|
117
|
-
let o =
|
|
118
|
-
return o || (o = this.precomputeWindow(n, t), t !== 1 &&
|
|
117
|
+
let o = b.get(n);
|
|
118
|
+
return o || (o = this.precomputeWindow(n, t), t !== 1 && b.set(n, i(o))), o;
|
|
119
119
|
},
|
|
120
120
|
wNAFCached(t, n, i) {
|
|
121
|
-
const o =
|
|
121
|
+
const o = S(t);
|
|
122
122
|
return this.wNAF(o, this.getPrecomputes(o, t, i), n);
|
|
123
123
|
},
|
|
124
124
|
wNAFCachedUnsafe(t, n, i, o) {
|
|
125
|
-
const r =
|
|
125
|
+
const r = S(t);
|
|
126
126
|
return r === 1 ? this.unsafeLadder(t, n, o) : this.wNAFUnsafe(r, this.getPrecomputes(r, t, i), n, o);
|
|
127
127
|
},
|
|
128
128
|
// We calculate precomputes for elliptic curve point multiplication
|
|
129
129
|
// using windowed method. This specifies window size and
|
|
130
130
|
// stores precomputed values. Usually only base point would be precomputed.
|
|
131
131
|
setWindowSize(t, n) {
|
|
132
|
-
|
|
132
|
+
y(n, a), I.set(t, n), b.delete(t);
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
|
|
136
|
+
function U(e, a, t, n) {
|
|
137
|
+
L(t, e), Z(n, a);
|
|
138
|
+
const i = t.length, o = n.length;
|
|
139
|
+
if (i !== o)
|
|
138
140
|
throw new Error("arrays of points and scalars must have equal length");
|
|
139
|
-
const
|
|
140
|
-
let
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
const r = e.ZERO, f = k(BigInt(i));
|
|
142
|
+
let s = 1;
|
|
143
|
+
f > 12 ? s = f - 3 : f > 4 ? s = f - 2 : f > 0 && (s = 2);
|
|
144
|
+
const c = x(s), d = new Array(Number(c) + 1).fill(r), g = Math.floor((a.BITS - 1) / s) * s;
|
|
145
|
+
let l = r;
|
|
146
|
+
for (let u = g; u >= 0; u -= s) {
|
|
147
|
+
d.fill(r);
|
|
148
|
+
for (let w = 0; w < o; w++) {
|
|
149
|
+
const p = n[w], A = Number(p >> BigInt(u) & c);
|
|
150
|
+
d[A] = d[A].add(t[w]);
|
|
146
151
|
}
|
|
147
|
-
let
|
|
148
|
-
for (let
|
|
149
|
-
|
|
150
|
-
if (
|
|
151
|
-
for (let
|
|
152
|
-
|
|
152
|
+
let h = r;
|
|
153
|
+
for (let w = d.length - 1, p = r; w > 0; w--)
|
|
154
|
+
p = p.add(d[w]), h = h.add(p);
|
|
155
|
+
if (l = l.add(h), u !== 0)
|
|
156
|
+
for (let w = 0; w < s; w++)
|
|
157
|
+
l = l.double();
|
|
153
158
|
}
|
|
154
|
-
return
|
|
159
|
+
return l;
|
|
155
160
|
}
|
|
156
|
-
function
|
|
157
|
-
return
|
|
161
|
+
function C(e) {
|
|
162
|
+
return M(e.Fp), O(e, {
|
|
158
163
|
n: "bigint",
|
|
159
164
|
h: "bigint",
|
|
160
165
|
Gx: "field",
|
|
@@ -163,13 +168,13 @@ function v(e) {
|
|
|
163
168
|
nBitLength: "isSafeInteger",
|
|
164
169
|
nByteLength: "isSafeInteger"
|
|
165
170
|
}), Object.freeze({
|
|
166
|
-
...
|
|
171
|
+
...z(e.n, e.nBitLength),
|
|
167
172
|
...e,
|
|
168
173
|
p: e.Fp.ORDER
|
|
169
174
|
});
|
|
170
175
|
}
|
|
171
176
|
export {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
177
|
+
U as pippenger,
|
|
178
|
+
C as validateBasic,
|
|
179
|
+
v as wNAF
|
|
175
180
|
};
|
package/dist/index300.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`);super(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index310.cjs");class c extends Error{constructor(r,e={}){const a=(()=>{var s;if(e.cause instanceof c){if(e.cause.details)return e.cause.details;if(e.cause.shortMessage)return e.cause.shortMessage}return e.cause&&"details"in e.cause&&typeof e.cause.details=="string"?e.cause.details:(s=e.cause)!=null&&s.message?e.cause.message:e.details})(),u=e.cause instanceof c&&e.cause.docsPath||e.docsPath,i=`https://oxlib.sh${u??""}`,d=[r||"An error occurred.",...e.metaMessages?["",...e.metaMessages]:[],...a||u?["",a?`Details: ${a}`:void 0,u?`See: ${i}`:void 0]:[]].filter(s=>typeof s=="string").join(`
|
|
2
|
+
`);super(d,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${n.getVersion()}`}),this.cause=e.cause,this.details=a,this.docs=i,this.docsPath=u,this.shortMessage=r}walk(r){return l(this,r)}}function l(t,r){return r!=null&&r(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?l(t.cause,r):r?null:t}exports.BaseError=c;
|
package/dist/index300.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getVersion as n } from "./index310.js";
|
|
2
2
|
class c extends Error {
|
|
3
3
|
constructor(t, e = {}) {
|
|
4
|
-
const
|
|
4
|
+
const a = (() => {
|
|
5
5
|
var s;
|
|
6
6
|
if (e.cause instanceof c) {
|
|
7
7
|
if (e.cause.details)
|
|
@@ -9,14 +9,14 @@ class c extends Error {
|
|
|
9
9
|
if (e.cause.shortMessage)
|
|
10
10
|
return e.cause.shortMessage;
|
|
11
11
|
}
|
|
12
|
-
return (s = e.cause) != null && s.message ? e.cause.message : e.details;
|
|
13
|
-
})(),
|
|
12
|
+
return e.cause && "details" in e.cause && typeof e.cause.details == "string" ? e.cause.details : (s = e.cause) != null && s.message ? e.cause.message : e.details;
|
|
13
|
+
})(), u = e.cause instanceof c && e.cause.docsPath || e.docsPath, i = `https://oxlib.sh${u ?? ""}`, d = [
|
|
14
14
|
t || "An error occurred.",
|
|
15
15
|
...e.metaMessages ? ["", ...e.metaMessages] : [],
|
|
16
|
-
...
|
|
16
|
+
...a || u ? [
|
|
17
17
|
"",
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
a ? `Details: ${a}` : void 0,
|
|
19
|
+
u ? `See: ${i}` : void 0
|
|
20
20
|
] : []
|
|
21
21
|
].filter((s) => typeof s == "string").join(`
|
|
22
22
|
`);
|
|
@@ -55,7 +55,7 @@ class c extends Error {
|
|
|
55
55
|
configurable: !0,
|
|
56
56
|
writable: !0,
|
|
57
57
|
value: `ox@${n()}`
|
|
58
|
-
}), this.cause = e.cause, this.details =
|
|
58
|
+
}), this.cause = e.cause, this.details = a, this.docs = i, this.docsPath = u, this.shortMessage = t;
|
|
59
59
|
}
|
|
60
60
|
walk(t) {
|
|
61
61
|
return l(this, t);
|
package/dist/index302.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index287.cjs");function n(t,e){if(i.size(t)>e)throw new i.SizeOverflowError({givenSize:i.size(t),maxSize:e})}function o(t,e){if(typeof e=="number"&&e>0&&e>i.size(t)-1)throw new i.SliceOffsetOutOfBoundsError({offset:e,position:"start",size:i.size(t)})}function z(t,e,r){if(typeof e=="number"&&typeof r=="number"&&i.size(t)!==r-e)throw new i.SliceOffsetOutOfBoundsError({offset:r,position:"end",size:i.size(t)})}function a(t,e={}){const{dir:r,size:s=32}=e;if(s===0)return t;const f=t.replace("0x","");if(f.length>s*2)throw new i.SizeExceedsPaddingSizeError({size:Math.ceil(f.length/2),targetSize:s,type:"Hex"});return`0x${f[r==="right"?"padEnd":"padStart"](s*2,"0")}`}exports.assertEndOffset=z;exports.assertSize=n;exports.assertStartOffset=o;exports.pad=a;
|
package/dist/index302.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SizeExceedsPaddingSizeError as s, size as i, SliceOffsetOutOfBoundsError as f, SizeOverflowError as p } from "./
|
|
1
|
+
import { SizeExceedsPaddingSizeError as s, size as i, SliceOffsetOutOfBoundsError as f, SizeOverflowError as p } from "./index287.js";
|
|
2
2
|
function c(t, e) {
|
|
3
3
|
if (i(t) > e)
|
|
4
4
|
throw new p({
|
package/dist/index303.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index225.cjs"),o=require("./index308.cjs"),n=require("./index287.cjs");function i(e,r={}){const{as:s=typeof e=="string"?"Hex":"Bytes"}=r,t=c.keccak_256(o.from(e));return s==="Bytes"?t:n.fromBytes(t)}exports.keccak256=i;
|
package/dist/index303.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { keccak_256 as f } from "./
|
|
1
|
+
import { keccak_256 as f } from "./index225.js";
|
|
2
2
|
import { from as m } from "./index308.js";
|
|
3
|
-
import { fromBytes as s } from "./
|
|
3
|
+
import { fromBytes as s } from "./index287.js";
|
|
4
4
|
function p(t, o = {}) {
|
|
5
5
|
const { as: e = typeof t == "string" ? "Hex" : "Bytes" } = o, r = f(m(t));
|
|
6
6
|
return e === "Bytes" ? r : s(r);
|
package/dist/index305.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index308.cjs"),c=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index308.cjs"),c=require("./index311.cjs"),o=require("./index300.cjs"),m=require("./index303.cjs"),b=/^0x[a-fA-F0-9]{40}$/;function i(e,t={}){const{strict:s=!0}=t;if(!b.test(e))throw new a({address:e,cause:new l});if(s){if(e.toLowerCase()===e)return;if(d(e)!==e)throw new a({address:e,cause:new h})}}function d(e){if(c.checksum.has(e))return c.checksum.get(e);i(e,{strict:!1});const t=e.substring(2).toLowerCase(),s=m.keccak256(f.fromString(t),{as:"Bytes"}),n=t.split("");for(let r=0;r<40;r+=2)s[r>>1]>>4>=8&&n[r]&&(n[r]=n[r].toUpperCase()),(s[r>>1]&15)>=8&&n[r+1]&&(n[r+1]=n[r+1].toUpperCase());const u=`0x${n.join("")}`;return c.checksum.set(e,u),u}function p(e,t={}){const{strict:s=!0}=t??{};try{return i(e,{strict:s}),!0}catch{return!1}}class a extends o.BaseError{constructor({address:t,cause:s}){super(`Address "${t}" is invalid.`,{cause:s}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class l extends o.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class h extends o.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}exports.InvalidAddressError=a;exports.InvalidChecksumError=h;exports.InvalidInputError=l;exports.assert=i;exports.checksum=d;exports.validate=p;
|
package/dist/index305.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fromString as d } from "./index308.js";
|
|
2
|
-
import { checksum as o } from "./
|
|
2
|
+
import { checksum as o } from "./index311.js";
|
|
3
3
|
import { BaseError as c } from "./index300.js";
|
|
4
4
|
import { keccak256 as f } from "./index303.js";
|
|
5
5
|
const l = /^0x[a-fA-F0-9]{40}$/;
|
package/dist/index307.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index290.cjs"),w=require("./index305.cjs"),N=require("./index300.cjs"),c=require("./index287.cjs"),x=require("./index306.cjs");function P({checksumAddress:e,parameters:r,values:n}){const t=[];for(let o=0;o<r.length;o++)t.push(f({checksumAddress:e,parameter:r[o],value:n[o]}));return t}function f({checksumAddress:e=!1,parameter:r,value:n}){const t=r,o=S(t.type);if(o){const[i,s]=o;return h(n,{checksumAddress:e,length:i,parameter:{...t,type:s}})}if(t.type==="tuple")return A(n,{checksumAddress:e,parameter:t});if(t.type==="address")return y(n,{checksum:e});if(t.type==="bool")return g(n);if(t.type.startsWith("uint")||t.type.startsWith("int")){const i=t.type.startsWith("int"),[,,s="256"]=x.integerRegex.exec(t.type)??[];return b(n,{signed:i,size:Number(s)})}if(t.type.startsWith("bytes"))return l(n,{type:t.type});if(t.type==="string")return z(n);throw new m.InvalidTypeError(t.type)}function u(e){let r=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:a}=e[i];s?r+=32:r+=c.size(a)}const n=[],t=[];let o=0;for(let i=0;i<e.length;i++){const{dynamic:s,encoded:a}=e[i];s?(n.push(c.fromNumber(r+o,{size:32})),t.push(a),o+=c.size(a)):n.push(a)}return c.concat(...n,...t)}function y(e,r){const{checksum:n=!1}=r;return w.assert(e,{strict:n}),{dynamic:!1,encoded:c.padLeft(e.toLowerCase())}}function h(e,r){const{checksumAddress:n,length:t,parameter:o}=r,i=t===null;if(!Array.isArray(e))throw new m.InvalidArrayError(e);if(!i&&e.length!==t)throw new m.ArrayLengthMismatchError({expectedLength:t,givenLength:e.length,type:`${o.type}[${t}]`});let s=!1;const a=[];for(let d=0;d<e.length;d++){const p=f({checksumAddress:n,parameter:o,value:e[d]});p.dynamic&&(s=!0),a.push(p)}if(i||s){const d=u(a);if(i){const p=c.fromNumber(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?c.concat(p,d):p}}if(s)return{dynamic:!0,encoded:d}}return{dynamic:!1,encoded:c.concat(...a.map(({encoded:d})=>d))}}function l(e,{type:r}){const[,n]=r.split("bytes"),t=c.size(e);if(!n){let o=e;return t%32!==0&&(o=c.padRight(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:c.concat(c.padLeft(c.fromNumber(t,{size:32})),o)}}if(t!==Number.parseInt(n))throw new m.BytesSizeMismatchError({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:c.padRight(e)}}function g(e){if(typeof e!="boolean")throw new N.BaseError(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:c.padLeft(c.fromBoolean(e))}}function b(e,{signed:r,size:n}){if(typeof n=="number"){const t=2n**(BigInt(n)-(r?1n:0n))-1n,o=r?-t-1n:0n;if(e>t||e<o)throw new c.IntegerOutOfRangeError({max:t.toString(),min:o.toString(),signed:r,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:c.fromNumber(e,{size:32,signed:r})}}function z(e){const r=c.fromString(e),n=Math.ceil(c.size(r)/32),t=[];for(let o=0;o<n;o++)t.push(c.padRight(c.slice(r,o*32,(o+1)*32)));return{dynamic:!0,encoded:c.concat(c.padRight(c.fromNumber(c.size(r),{size:32})),...t)}}function A(e,r){const{checksumAddress:n,parameter:t}=r;let o=!1;const i=[];for(let s=0;s<t.components.length;s++){const a=t.components[s],d=Array.isArray(e)?s:a.name,p=f({checksumAddress:n,parameter:a,value:e[d]});i.push(p),p.dynamic&&(o=!0)}return{dynamic:o,encoded:o?u(i):c.concat(...i.map(({encoded:s})=>s))}}function S(e){const r=e.match(/^(.*)\[(\d+)?\]$/);return r?[r[2]?Number(r[2]):null,r[1]]:void 0}exports.encode=u;exports.encodeAddress=y;exports.encodeArray=h;exports.encodeBoolean=g;exports.encodeBytes=l;exports.encodeNumber=b;exports.encodeString=z;exports.encodeTuple=A;exports.getArrayComponents=S;exports.prepareParameter=f;exports.prepareParameters=P;
|
package/dist/index307.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { InvalidTypeError as g, InvalidArrayError as b, ArrayLengthMismatchError as w, BytesSizeMismatchError as z } from "./
|
|
1
|
+
import { InvalidTypeError as g, InvalidArrayError as b, ArrayLengthMismatchError as w, BytesSizeMismatchError as z } from "./index290.js";
|
|
2
2
|
import { assert as x } from "./index305.js";
|
|
3
3
|
import { BaseError as S } from "./index300.js";
|
|
4
|
-
import { size as d, fromNumber as f, concat as p, padLeft as h, fromBoolean as A, IntegerOutOfRangeError as E, padRight as y, fromString as I, slice as B } from "./
|
|
4
|
+
import { size as d, fromNumber as f, concat as p, padLeft as h, fromBoolean as A, IntegerOutOfRangeError as E, padRight as y, fromString as I, slice as B } from "./index287.js";
|
|
5
5
|
import { integerRegex as L } from "./index306.js";
|
|
6
6
|
function q({ checksumAddress: e, parameters: n, values: r }) {
|
|
7
7
|
const t = [];
|
package/dist/index308.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index300.cjs"),y=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index300.cjs"),y=require("./index287.cjs"),s=require("./index309.cjs"),z=require("./index302.cjs"),S=new TextEncoder;function x(e){return e instanceof Uint8Array?e:typeof e=="string"?h(e):g(e)}function g(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function h(e,t={}){const{size:r}=t;let n=e;r&&(z.assertSize(e,r),n=y.padRight(e,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);const d=i.length/2,f=new Uint8Array(d);for(let c=0,o=0;c<d;c++){const u=s.charCodeToBase16(i.charCodeAt(o++)),b=s.charCodeToBase16(i.charCodeAt(o++));if(u===void 0||b===void 0)throw new a.BaseError(`Invalid byte sequence ("${i[o-2]}${i[o-1]}" in "${i}").`);f[c]=u*16+b}return f}function m(e,t={}){const{size:r}=t,n=S.encode(e);return typeof r=="number"?(s.assertSize(n,r),l(n,r)):n}function l(e,t){return s.pad(e,{dir:"right",size:t})}function E(e){return e.length}class p extends a.BaseError{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class $ extends a.BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}exports.SizeExceedsPaddingSizeError=$;exports.SizeOverflowError=p;exports.from=x;exports.fromArray=g;exports.fromHex=h;exports.fromString=m;exports.padRight=l;exports.size=E;
|
package/dist/index308.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseError as c } from "./index300.js";
|
|
2
|
-
import { padRight as h } from "./
|
|
2
|
+
import { padRight as h } from "./index287.js";
|
|
3
3
|
import { charCodeToBase16 as b, assertSize as g, pad as m } from "./index309.js";
|
|
4
4
|
import { assertSize as p } from "./index302.js";
|
|
5
5
|
const l = /* @__PURE__ */ new TextEncoder();
|
package/dist/index310.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index312.cjs");function r(){return e.version}exports.getVersion=r;
|
package/dist/index310.js
CHANGED
package/dist/index311.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 c=require("./index313.cjs"),e={checksum:new c.LruMap(8192)},s=e.checksum;exports.checksum=s;
|
package/dist/index311.js
CHANGED
|
@@ -1,107 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), g.push((n + 1) * (n + 2) / 2 % 64);
|
|
6
|
-
let o = R;
|
|
7
|
-
for (let r = 0; r < 7; r++)
|
|
8
|
-
t = (t << f ^ (t >> q) * z) % v, t & j && (o ^= f << (f << /* @__PURE__ */ BigInt(r)) - f);
|
|
9
|
-
B.push(o);
|
|
10
|
-
}
|
|
11
|
-
const A = L(B, !0), C = A[0], D = A[1], O = (n, t, s) => s > 32 ? m(n, t, s) : T(n, t, s), w = (n, t, s) => s > 32 ? F(n, t, s) : S(n, t, s);
|
|
12
|
-
function G(n, t = 24) {
|
|
13
|
-
const s = new Uint32Array(10);
|
|
14
|
-
for (let i = 24 - t; i < 24; i++) {
|
|
15
|
-
for (let e = 0; e < 10; e++)
|
|
16
|
-
s[e] = n[e] ^ n[e + 10] ^ n[e + 20] ^ n[e + 30] ^ n[e + 40];
|
|
17
|
-
for (let e = 0; e < 10; e += 2) {
|
|
18
|
-
const h = (e + 8) % 10, l = (e + 2) % 10, u = s[l], c = s[l + 1], b = O(u, c, 1) ^ s[h], H = w(u, c, 1) ^ s[h + 1];
|
|
19
|
-
for (let a = 0; a < 50; a += 10)
|
|
20
|
-
n[e + a] ^= b, n[e + a + 1] ^= H;
|
|
21
|
-
}
|
|
22
|
-
let o = n[2], r = n[3];
|
|
23
|
-
for (let e = 0; e < 24; e++) {
|
|
24
|
-
const h = g[e], l = O(o, r, h), u = w(o, r, h), c = _[e];
|
|
25
|
-
o = n[c], r = n[c + 1], n[c] = l, n[c + 1] = u;
|
|
26
|
-
}
|
|
27
|
-
for (let e = 0; e < 50; e += 10) {
|
|
28
|
-
for (let h = 0; h < 10; h++)
|
|
29
|
-
s[h] = n[e + h];
|
|
30
|
-
for (let h = 0; h < 10; h++)
|
|
31
|
-
n[e + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
|
|
32
|
-
}
|
|
33
|
-
n[0] ^= C[i], n[1] ^= D[i];
|
|
34
|
-
}
|
|
35
|
-
y(s);
|
|
36
|
-
}
|
|
37
|
-
class p extends E {
|
|
38
|
-
// NOTE: we accept arguments in bytes instead of bits here.
|
|
39
|
-
constructor(t, s, i, o = !1, r = 24) {
|
|
40
|
-
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = t, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, d(i), !(0 < t && t < 200))
|
|
41
|
-
throw new Error("only keccak-f1600 function is supported");
|
|
42
|
-
this.state = new Uint8Array(200), this.state32 = U(this.state);
|
|
43
|
-
}
|
|
44
|
-
clone() {
|
|
45
|
-
return this._cloneInto();
|
|
46
|
-
}
|
|
47
|
-
keccak() {
|
|
48
|
-
I(this.state32), G(this.state32, this.rounds), I(this.state32), this.posOut = 0, this.pos = 0;
|
|
49
|
-
}
|
|
50
|
-
update(t) {
|
|
51
|
-
x(this), t = P(t), k(t);
|
|
52
|
-
const { blockLen: s, state: i } = this, o = t.length;
|
|
53
|
-
for (let r = 0; r < o; ) {
|
|
54
|
-
const e = Math.min(s - this.pos, o - r);
|
|
55
|
-
for (let h = 0; h < e; h++)
|
|
56
|
-
i[this.pos++] ^= t[r++];
|
|
57
|
-
this.pos === s && this.keccak();
|
|
58
|
-
}
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
finish() {
|
|
62
|
-
if (this.finished)
|
|
63
|
-
return;
|
|
64
|
-
this.finished = !0;
|
|
65
|
-
const { state: t, suffix: s, pos: i, blockLen: o } = this;
|
|
66
|
-
t[i] ^= s, s & 128 && i === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
|
|
67
|
-
}
|
|
68
|
-
writeInto(t) {
|
|
69
|
-
x(this, !1), k(t), this.finish();
|
|
70
|
-
const s = this.state, { blockLen: i } = this;
|
|
71
|
-
for (let o = 0, r = t.length; o < r; ) {
|
|
72
|
-
this.posOut >= i && this.keccak();
|
|
73
|
-
const e = Math.min(i - this.posOut, r - o);
|
|
74
|
-
t.set(s.subarray(this.posOut, this.posOut + e), o), this.posOut += e, o += e;
|
|
75
|
-
}
|
|
76
|
-
return t;
|
|
77
|
-
}
|
|
78
|
-
xofInto(t) {
|
|
79
|
-
if (!this.enableXOF)
|
|
80
|
-
throw new Error("XOF is not possible for this instance");
|
|
81
|
-
return this.writeInto(t);
|
|
82
|
-
}
|
|
83
|
-
xof(t) {
|
|
84
|
-
return d(t), this.xofInto(new Uint8Array(t));
|
|
85
|
-
}
|
|
86
|
-
digestInto(t) {
|
|
87
|
-
if (M(t, this), this.finished)
|
|
88
|
-
throw new Error("digest() was already called");
|
|
89
|
-
return this.writeInto(t), this.destroy(), t;
|
|
90
|
-
}
|
|
91
|
-
digest() {
|
|
92
|
-
return this.digestInto(new Uint8Array(this.outputLen));
|
|
93
|
-
}
|
|
94
|
-
destroy() {
|
|
95
|
-
this.destroyed = !0, y(this.state);
|
|
96
|
-
}
|
|
97
|
-
_cloneInto(t) {
|
|
98
|
-
const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: e } = this;
|
|
99
|
-
return t || (t = new p(s, i, o, e, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = i, t.outputLen = o, t.enableXOF = e, t.destroyed = this.destroyed, t;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const J = (n, t, s) => X(() => new p(t, n, s)), Q = J(1, 136, 256 / 8);
|
|
1
|
+
import { LruMap as c } from "./index313.js";
|
|
2
|
+
const e = {
|
|
3
|
+
checksum: /* @__PURE__ */ new c(8192)
|
|
4
|
+
}, m = e.checksum;
|
|
103
5
|
export {
|
|
104
|
-
|
|
105
|
-
G as keccakP,
|
|
106
|
-
Q as keccak_256
|
|
6
|
+
m as checksum
|
|
107
7
|
};
|
package/dist/index312.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="0.1.1";exports.version=e;
|
package/dist/index312.js
CHANGED
package/dist/index313.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class i extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}exports.LruMap=i;
|
package/dist/index313.js
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
class r extends Map {
|
|
2
|
+
constructor(e) {
|
|
3
|
+
super(), Object.defineProperty(this, "maxSize", {
|
|
4
|
+
enumerable: !0,
|
|
5
|
+
configurable: !0,
|
|
6
|
+
writable: !0,
|
|
7
|
+
value: void 0
|
|
8
|
+
}), this.maxSize = e;
|
|
9
|
+
}
|
|
10
|
+
get(e) {
|
|
11
|
+
const t = super.get(e);
|
|
12
|
+
return super.has(e) && t !== void 0 && (this.delete(e), super.set(e, t)), t;
|
|
13
|
+
}
|
|
14
|
+
set(e, t) {
|
|
15
|
+
if (super.set(e, t), this.maxSize && this.size > this.maxSize) {
|
|
16
|
+
const s = this.keys().next().value;
|
|
17
|
+
s && this.delete(s);
|
|
18
|
+
}
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
2
22
|
export {
|
|
3
|
-
|
|
23
|
+
r as LruMap
|
|
4
24
|
};
|
package/dist/index36.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index45.cjs"),g=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index45.cjs"),g=require("./index249.cjs"),q=require("./index177.cjs"),C=require("./index221.cjs"),h=require("./index29.cjs"),l=require("./index108.cjs");async function p(n,i){const{abi:c,account:r=n.account,address:o,args:e,dataSuffix:a,functionName:s,...u}=i;if(typeof r>"u")throw new g.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const t=r?w.parseAccount(r):null,d=q.encodeFunctionData({abi:c,args:e,functionName:s});try{return await h.getAction(n,l.sendTransaction,"sendTransaction")({data:`${d}${a?a.replace("0x",""):""}`,to:o,account:t,...u})}catch(f){throw C.getContractError(f,{abi:c,address:o,args:e,docsPath:"/docs/contract/writeContract",functionName:s,sender:t==null?void 0:t.address})}}exports.writeContract=p;
|
package/dist/index36.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAccount as u } from "./index45.js";
|
|
2
|
-
import { AccountNotFoundError as p } from "./
|
|
2
|
+
import { AccountNotFoundError as p } from "./index249.js";
|
|
3
3
|
import { encodeFunctionData as w } from "./index177.js";
|
|
4
4
|
import { getContractError as h } from "./index221.js";
|
|
5
5
|
import { getAction as C } from "./index29.js";
|