@gardenfi/utils 2.4.3 → 2.4.5
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/index10.cjs +1 -1
- package/dist/index10.js +4 -4
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +4 -4
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +3 -3
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +2 -2
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +1 -1
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +13 -31
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +3 -3
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +58 -32
- package/dist/index26.cjs +16 -1
- package/dist/index26.js +113 -11
- package/dist/index261.cjs +2 -1
- package/dist/index261.js +40 -102
- package/dist/index262.cjs +1 -1
- package/dist/index262.js +2 -7
- package/dist/index263.cjs +1 -1
- package/dist/index263.js +5 -224
- package/dist/index264.cjs +1 -1
- package/dist/index264.js +10 -6
- package/dist/index265.cjs +1 -1
- package/dist/index265.js +20 -7
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +8 -26
- package/dist/index267.cjs +1 -1
- package/dist/index267.js +66 -5
- package/dist/index268.cjs +1 -2
- package/dist/index268.js +64 -40
- package/dist/index269.cjs +1 -1
- package/dist/index269.js +187 -2
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +32 -58
- package/dist/index270.cjs +1 -1
- package/dist/index270.js +20 -8
- package/dist/index271.cjs +1 -1
- package/dist/index271.js +40 -17
- package/dist/index272.cjs +1 -1
- package/dist/index272.js +76 -8
- package/dist/index273.cjs +1 -1
- package/dist/index273.js +40 -66
- package/dist/index274.cjs +1 -1
- package/dist/index274.js +15 -64
- package/dist/index275.cjs +1 -1
- package/dist/index275.js +12 -185
- package/dist/index276.cjs +1 -1
- package/dist/index276.js +11 -21
- package/dist/index277.cjs +2 -1
- package/dist/index277.js +18 -42
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +13 -75
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +11 -40
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +31 -13
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +102 -15
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +6 -13
- package/dist/index282.cjs +1 -1
- package/dist/index282.js +222 -10
- package/dist/index283.cjs +1 -2
- package/dist/index283.js +6 -18
- package/dist/index284.cjs +1 -1
- package/dist/index284.js +7 -15
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +26 -11
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +1 -1
- package/dist/index29.cjs +1 -16
- package/dist/index29.js +11 -113
- package/dist/index292.cjs +1 -1
- package/dist/index292.js +2 -2
- package/dist/index294.cjs +1 -1
- package/dist/index294.js +138 -10
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +42 -19
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +73 -134
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +2 -43
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +10 -77
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +20 -2
- package/dist/index300.cjs +1 -1
- package/dist/index300.js +68 -698
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +675 -178
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +200 -67
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +1 -1
- package/dist/index306.cjs +1 -1
- package/dist/index306.js +1 -1
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +1 -1
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +4 -63
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +59 -40
- package/dist/index313.cjs +1 -1
- package/dist/index313.js +44 -4
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +1 -1
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +2 -2
- package/package.json +1 -1
package/dist/index302.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 y=require("./index294.cjs"),v=require("./index282.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const m=BigInt(0),h=BigInt(1);function b(t,r){const e=r.negate();return t?e:r}function B(t,r,e){const n=s=>s.pz,i=v.FpInvertBatch(t.Fp,e.map(n));return e.map((s,a)=>s.toAffine(i[a])).map(t.fromAffine)}function I(t,r){if(!Number.isSafeInteger(t)||t<=0||t>r)throw new Error("invalid window size, expected [1.."+r+"], got W="+t)}function E(t,r){I(t,r);const e=Math.ceil(r/t)+1,n=2**(t-1),i=2**t,o=y.bitMask(t),s=BigInt(t);return{windows:e,windowSize:n,mask:o,maxNumber:i,shiftBy:s}}function M(t,r,e){const{windowSize:n,mask:i,maxNumber:o,shiftBy:s}=e;let a=Number(t&i),f=t>>s;a>n&&(a-=o,f+=h);const d=r*n,c=d+Math.abs(a)-1,p=a===0,l=a<0,w=r%2!==0;return{nextN:f,offset:c,isZero:p,isNeg:l,isNegF:w,offsetF:d}}function O(t,r){if(!Array.isArray(t))throw new Error("array expected");t.forEach((e,n)=>{if(!(e instanceof r))throw new Error("invalid point at index "+n)})}function R(t,r){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((e,n)=>{if(!r.isValid(e))throw new Error("invalid scalar at index "+n)})}const N=new WeakMap,Z=new WeakMap;function A(t){return Z.get(t)||1}function x(t){if(t!==m)throw new Error("invalid wNAF")}function j(t,r){return{constTimeNegate:b,hasPrecomputes(e){return A(e)!==1},unsafeLadder(e,n,i=t.ZERO){let o=e;for(;n>m;)n&h&&(i=i.add(o)),o=o.double(),n>>=h;return i},precomputeWindow(e,n){const{windows:i,windowSize:o}=E(n,r),s=[];let a=e,f=a;for(let d=0;d<i;d++){f=a,s.push(f);for(let c=1;c<o;c++)f=f.add(a),s.push(f);a=f.double()}return s},wNAF(e,n,i){let o=t.ZERO,s=t.BASE;const a=E(e,r);for(let f=0;f<a.windows;f++){const{nextN:d,offset:c,isZero:p,isNeg:l,isNegF:w,offsetF:g}=M(i,f,a);i=d,p?s=s.add(b(w,n[g])):o=o.add(b(l,n[c]))}return x(i),{p:o,f:s}},wNAFUnsafe(e,n,i,o=t.ZERO){const s=E(e,r);for(let a=0;a<s.windows&&i!==m;a++){const{nextN:f,offset:d,isZero:c,isNeg:p}=M(i,a,s);if(i=f,!c){const l=n[d];o=o.add(p?l.negate():l)}}return x(i),o},getPrecomputes(e,n,i){let o=N.get(n);return o||(o=this.precomputeWindow(n,e),e!==1&&(typeof i=="function"&&(o=i(o)),N.set(n,o))),o},wNAFCached(e,n,i){const o=A(e);return this.wNAF(o,this.getPrecomputes(o,e,i),n)},wNAFCachedUnsafe(e,n,i,o){const s=A(e);return s===1?this.unsafeLadder(e,n,o):this.wNAFUnsafe(s,this.getPrecomputes(s,e,i),n,o)},setWindowSize(e,n){I(n,r),Z.set(e,n),N.delete(e)}}}function _(t,r,e,n){let i=r,o=t.ZERO,s=t.ZERO;for(;e>m||n>m;)e&h&&(o=o.add(i)),n&h&&(s=s.add(i)),i=i.double(),e>>=h,n>>=h;return{p1:o,p2:s}}function C(t,r,e,n){O(e,t),R(n,r);const i=e.length,o=n.length;if(i!==o)throw new Error("arrays of points and scalars must have equal length");const s=t.ZERO,a=y.bitLen(BigInt(i));let f=1;a>12?f=a-3:a>4?f=a-2:a>0&&(f=2);const d=y.bitMask(f),c=new Array(Number(d)+1).fill(s),p=Math.floor((r.BITS-1)/f)*f;let l=s;for(let w=p;w>=0;w-=f){c.fill(s);for(let u=0;u<o;u++){const F=n[u],S=Number(F>>BigInt(w)&d);c[S]=c[S].add(e[u])}let g=s;for(let u=c.length-1,F=s;u>0;u--)F=F.add(c[u]),g=g.add(F);if(l=l.add(g),w!==0)for(let u=0;u<f;u++)l=l.double()}return l}function z(t,r){if(r){if(r.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return v.validateField(r),r}else return v.Field(t)}function k(t,r,e={}){if(!r||typeof r!="object")throw new Error(`expected valid ${t} CURVE object`);for(const a of["p","n","h"]){const f=r[a];if(!(typeof f=="bigint"&&f>m))throw new Error(`CURVE.${a} must be positive bigint`)}const n=z(r.p,e.Fp),i=z(r.n,e.Fn),s=["Gx","Gy","a","b"];for(const a of s)if(!n.isValid(r[a]))throw new Error(`CURVE.${a} must be valid field element of CURVE.Fp`);return{Fp:n,Fn:i}}exports._createCurveFields=k;exports.mulEndoUnsafe=_;exports.negateCt=b;exports.normalizeZ=B;exports.pippenger=C;exports.wNAF=j;
|
package/dist/index302.js
CHANGED
|
@@ -1,71 +1,204 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { bitLen as B, bitMask as z } from "./index294.js";
|
|
2
|
+
import { validateField as Z, Field as O, FpInvertBatch as R } from "./index282.js";
|
|
3
|
+
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
4
|
+
const g = BigInt(0), h = BigInt(1);
|
|
5
|
+
function b(t, r) {
|
|
6
|
+
const e = r.negate();
|
|
7
|
+
return t ? e : r;
|
|
8
|
+
}
|
|
9
|
+
function L(t, r, e) {
|
|
10
|
+
const n = (s) => s.pz, i = R(t.Fp, e.map(n));
|
|
11
|
+
return e.map((s, f) => s.toAffine(i[f])).map(t.fromAffine);
|
|
12
|
+
}
|
|
13
|
+
function I(t, r) {
|
|
14
|
+
if (!Number.isSafeInteger(t) || t <= 0 || t > r)
|
|
15
|
+
throw new Error("invalid window size, expected [1.." + r + "], got W=" + t);
|
|
16
|
+
}
|
|
17
|
+
function E(t, r) {
|
|
18
|
+
I(t, r);
|
|
19
|
+
const e = Math.ceil(r / t) + 1, n = 2 ** (t - 1), i = 2 ** t, o = z(t), s = BigInt(t);
|
|
20
|
+
return { windows: e, windowSize: n, mask: o, maxNumber: i, shiftBy: s };
|
|
21
|
+
}
|
|
22
|
+
function v(t, r, e) {
|
|
23
|
+
const { windowSize: n, mask: i, maxNumber: o, shiftBy: s } = e;
|
|
24
|
+
let f = Number(t & i), a = t >> s;
|
|
25
|
+
f > n && (f -= o, a += h);
|
|
26
|
+
const d = r * n, c = d + Math.abs(f) - 1, p = f === 0, l = f < 0, u = r % 2 !== 0;
|
|
27
|
+
return { nextN: a, offset: c, isZero: p, isNeg: l, isNegF: u, offsetF: d };
|
|
28
|
+
}
|
|
29
|
+
function j(t, r) {
|
|
30
|
+
if (!Array.isArray(t))
|
|
31
|
+
throw new Error("array expected");
|
|
32
|
+
t.forEach((e, n) => {
|
|
33
|
+
if (!(e instanceof r))
|
|
34
|
+
throw new Error("invalid point at index " + n);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function _(t, r) {
|
|
38
|
+
if (!Array.isArray(t))
|
|
39
|
+
throw new Error("array of scalars expected");
|
|
40
|
+
t.forEach((e, n) => {
|
|
41
|
+
if (!r.isValid(e))
|
|
42
|
+
throw new Error("invalid scalar at index " + n);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const N = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap();
|
|
46
|
+
function A(t) {
|
|
47
|
+
return M.get(t) || 1;
|
|
48
|
+
}
|
|
49
|
+
function S(t) {
|
|
50
|
+
if (t !== g)
|
|
51
|
+
throw new Error("invalid wNAF");
|
|
52
|
+
}
|
|
53
|
+
function U(t, r) {
|
|
54
|
+
return {
|
|
55
|
+
constTimeNegate: b,
|
|
56
|
+
hasPrecomputes(e) {
|
|
57
|
+
return A(e) !== 1;
|
|
58
|
+
},
|
|
59
|
+
// non-const time multiplication ladder
|
|
60
|
+
unsafeLadder(e, n, i = t.ZERO) {
|
|
61
|
+
let o = e;
|
|
62
|
+
for (; n > g; )
|
|
63
|
+
n & h && (i = i.add(o)), o = o.double(), n >>= h;
|
|
64
|
+
return i;
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* Creates a wNAF precomputation window. Used for caching.
|
|
68
|
+
* Default window size is set by `utils.precompute()` and is equal to 8.
|
|
69
|
+
* Number of precomputed points depends on the curve size:
|
|
70
|
+
* 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
|
|
71
|
+
* - 𝑊 is the window size
|
|
72
|
+
* - 𝑛 is the bitlength of the curve order.
|
|
73
|
+
* For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
|
|
74
|
+
* @param elm Point instance
|
|
75
|
+
* @param W window size
|
|
76
|
+
* @returns precomputed point tables flattened to a single array
|
|
77
|
+
*/
|
|
78
|
+
precomputeWindow(e, n) {
|
|
79
|
+
const { windows: i, windowSize: o } = E(n, r), s = [];
|
|
80
|
+
let f = e, a = f;
|
|
81
|
+
for (let d = 0; d < i; d++) {
|
|
82
|
+
a = f, s.push(a);
|
|
83
|
+
for (let c = 1; c < o; c++)
|
|
84
|
+
a = a.add(f), s.push(a);
|
|
85
|
+
f = a.double();
|
|
86
|
+
}
|
|
87
|
+
return s;
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
|
|
91
|
+
* @param W window size
|
|
92
|
+
* @param precomputes precomputed tables
|
|
93
|
+
* @param n scalar (we don't check here, but should be less than curve order)
|
|
94
|
+
* @returns real and fake (for const-time) points
|
|
95
|
+
*/
|
|
96
|
+
wNAF(e, n, i) {
|
|
97
|
+
let o = t.ZERO, s = t.BASE;
|
|
98
|
+
const f = E(e, r);
|
|
99
|
+
for (let a = 0; a < f.windows; a++) {
|
|
100
|
+
const { nextN: d, offset: c, isZero: p, isNeg: l, isNegF: u, offsetF: m } = v(i, a, f);
|
|
101
|
+
i = d, p ? s = s.add(b(u, n[m])) : o = o.add(b(l, n[c]));
|
|
102
|
+
}
|
|
103
|
+
return S(i), { p: o, f: s };
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form.
|
|
107
|
+
* @param W window size
|
|
108
|
+
* @param precomputes precomputed tables
|
|
109
|
+
* @param n scalar (we don't check here, but should be less than curve order)
|
|
110
|
+
* @param acc accumulator point to add result of multiplication
|
|
111
|
+
* @returns point
|
|
112
|
+
*/
|
|
113
|
+
wNAFUnsafe(e, n, i, o = t.ZERO) {
|
|
114
|
+
const s = E(e, r);
|
|
115
|
+
for (let f = 0; f < s.windows && i !== g; f++) {
|
|
116
|
+
const { nextN: a, offset: d, isZero: c, isNeg: p } = v(i, f, s);
|
|
117
|
+
if (i = a, !c) {
|
|
118
|
+
const l = n[d];
|
|
119
|
+
o = o.add(p ? l.negate() : l);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return S(i), o;
|
|
123
|
+
},
|
|
124
|
+
getPrecomputes(e, n, i) {
|
|
125
|
+
let o = N.get(n);
|
|
126
|
+
return o || (o = this.precomputeWindow(n, e), e !== 1 && (typeof i == "function" && (o = i(o)), N.set(n, o))), o;
|
|
127
|
+
},
|
|
128
|
+
wNAFCached(e, n, i) {
|
|
129
|
+
const o = A(e);
|
|
130
|
+
return this.wNAF(o, this.getPrecomputes(o, e, i), n);
|
|
131
|
+
},
|
|
132
|
+
wNAFCachedUnsafe(e, n, i, o) {
|
|
133
|
+
const s = A(e);
|
|
134
|
+
return s === 1 ? this.unsafeLadder(e, n, o) : this.wNAFUnsafe(s, this.getPrecomputes(s, e, i), n, o);
|
|
135
|
+
},
|
|
136
|
+
// We calculate precomputes for elliptic curve point multiplication
|
|
137
|
+
// using windowed method. This specifies window size and
|
|
138
|
+
// stores precomputed values. Usually only base point would be precomputed.
|
|
139
|
+
setWindowSize(e, n) {
|
|
140
|
+
I(n, r), M.set(e, n), N.delete(e);
|
|
11
141
|
}
|
|
12
|
-
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function $(t, r, e, n) {
|
|
145
|
+
let i = r, o = t.ZERO, s = t.ZERO;
|
|
146
|
+
for (; e > g || n > g; )
|
|
147
|
+
e & h && (o = o.add(i)), n & h && (s = s.add(i)), i = i.double(), e >>= h, n >>= h;
|
|
148
|
+
return { p1: o, p2: s };
|
|
149
|
+
}
|
|
150
|
+
function D(t, r, e, n) {
|
|
151
|
+
j(e, t), _(n, r);
|
|
152
|
+
const i = e.length, o = n.length;
|
|
153
|
+
if (i !== o)
|
|
154
|
+
throw new Error("arrays of points and scalars must have equal length");
|
|
155
|
+
const s = t.ZERO, f = B(BigInt(i));
|
|
156
|
+
let a = 1;
|
|
157
|
+
f > 12 ? a = f - 3 : f > 4 ? a = f - 2 : f > 0 && (a = 2);
|
|
158
|
+
const d = z(a), c = new Array(Number(d) + 1).fill(s), p = Math.floor((r.BITS - 1) / a) * a;
|
|
159
|
+
let l = s;
|
|
160
|
+
for (let u = p; u >= 0; u -= a) {
|
|
161
|
+
c.fill(s);
|
|
162
|
+
for (let w = 0; w < o; w++) {
|
|
163
|
+
const F = n[w], y = Number(F >> BigInt(u) & d);
|
|
164
|
+
c[y] = c[y].add(e[w]);
|
|
165
|
+
}
|
|
166
|
+
let m = s;
|
|
167
|
+
for (let w = c.length - 1, F = s; w > 0; w--)
|
|
168
|
+
F = F.add(c[w]), m = m.add(F);
|
|
169
|
+
if (l = l.add(m), u !== 0)
|
|
170
|
+
for (let w = 0; w < a; w++)
|
|
171
|
+
l = l.double();
|
|
172
|
+
}
|
|
173
|
+
return l;
|
|
174
|
+
}
|
|
175
|
+
function x(t, r) {
|
|
176
|
+
if (r) {
|
|
177
|
+
if (r.ORDER !== t)
|
|
178
|
+
throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
|
|
179
|
+
return Z(r), r;
|
|
180
|
+
} else
|
|
181
|
+
return O(t);
|
|
182
|
+
}
|
|
183
|
+
function G(t, r, e = {}) {
|
|
184
|
+
if (!r || typeof r != "object")
|
|
185
|
+
throw new Error(`expected valid ${t} CURVE object`);
|
|
186
|
+
for (const f of ["p", "n", "h"]) {
|
|
187
|
+
const a = r[f];
|
|
188
|
+
if (!(typeof a == "bigint" && a > g))
|
|
189
|
+
throw new Error(`CURVE.${f} must be positive bigint`);
|
|
190
|
+
}
|
|
191
|
+
const n = x(r.p, e.Fp), i = x(r.n, e.Fn), s = ["Gx", "Gy", "a", "b"];
|
|
192
|
+
for (const f of s)
|
|
193
|
+
if (!n.isValid(r[f]))
|
|
194
|
+
throw new Error(`CURVE.${f} must be valid field element of CURVE.Fp`);
|
|
195
|
+
return { Fp: n, Fn: i };
|
|
13
196
|
}
|
|
14
|
-
const p = /* @__PURE__ */ new Map([
|
|
15
|
-
// Unnamed
|
|
16
|
-
["address", { type: "address" }],
|
|
17
|
-
["bool", { type: "bool" }],
|
|
18
|
-
["bytes", { type: "bytes" }],
|
|
19
|
-
["bytes32", { type: "bytes32" }],
|
|
20
|
-
["int", { type: "int256" }],
|
|
21
|
-
["int256", { type: "int256" }],
|
|
22
|
-
["string", { type: "string" }],
|
|
23
|
-
["uint", { type: "uint256" }],
|
|
24
|
-
["uint8", { type: "uint8" }],
|
|
25
|
-
["uint16", { type: "uint16" }],
|
|
26
|
-
["uint24", { type: "uint24" }],
|
|
27
|
-
["uint32", { type: "uint32" }],
|
|
28
|
-
["uint64", { type: "uint64" }],
|
|
29
|
-
["uint96", { type: "uint96" }],
|
|
30
|
-
["uint112", { type: "uint112" }],
|
|
31
|
-
["uint160", { type: "uint160" }],
|
|
32
|
-
["uint192", { type: "uint192" }],
|
|
33
|
-
["uint256", { type: "uint256" }],
|
|
34
|
-
// Named
|
|
35
|
-
["address owner", { type: "address", name: "owner" }],
|
|
36
|
-
["address to", { type: "address", name: "to" }],
|
|
37
|
-
["bool approved", { type: "bool", name: "approved" }],
|
|
38
|
-
["bytes _data", { type: "bytes", name: "_data" }],
|
|
39
|
-
["bytes data", { type: "bytes", name: "data" }],
|
|
40
|
-
["bytes signature", { type: "bytes", name: "signature" }],
|
|
41
|
-
["bytes32 hash", { type: "bytes32", name: "hash" }],
|
|
42
|
-
["bytes32 r", { type: "bytes32", name: "r" }],
|
|
43
|
-
["bytes32 root", { type: "bytes32", name: "root" }],
|
|
44
|
-
["bytes32 s", { type: "bytes32", name: "s" }],
|
|
45
|
-
["string name", { type: "string", name: "name" }],
|
|
46
|
-
["string symbol", { type: "string", name: "symbol" }],
|
|
47
|
-
["string tokenURI", { type: "string", name: "tokenURI" }],
|
|
48
|
-
["uint tokenId", { type: "uint256", name: "tokenId" }],
|
|
49
|
-
["uint8 v", { type: "uint8", name: "v" }],
|
|
50
|
-
["uint256 balance", { type: "uint256", name: "balance" }],
|
|
51
|
-
["uint256 tokenId", { type: "uint256", name: "tokenId" }],
|
|
52
|
-
["uint256 value", { type: "uint256", name: "value" }],
|
|
53
|
-
// Indexed
|
|
54
|
-
[
|
|
55
|
-
"event:address indexed from",
|
|
56
|
-
{ type: "address", name: "from", indexed: !0 }
|
|
57
|
-
],
|
|
58
|
-
["event:address indexed to", { type: "address", name: "to", indexed: !0 }],
|
|
59
|
-
[
|
|
60
|
-
"event:uint indexed tokenId",
|
|
61
|
-
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
62
|
-
],
|
|
63
|
-
[
|
|
64
|
-
"event:uint256 indexed tokenId",
|
|
65
|
-
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
66
|
-
]
|
|
67
|
-
]);
|
|
68
197
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
198
|
+
G as _createCurveFields,
|
|
199
|
+
$ as mulEndoUnsafe,
|
|
200
|
+
b as negateCt,
|
|
201
|
+
L as normalizeZ,
|
|
202
|
+
D as pippenger,
|
|
203
|
+
U as wNAF
|
|
71
204
|
};
|
package/dist/index303.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index311.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
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/index303.js
CHANGED
package/dist/index306.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index228.cjs"),o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index228.cjs"),o=require("./index312.cjs"),n=require("./index290.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/index306.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { keccak_256 as f } from "./index228.js";
|
|
2
|
-
import { from as m } from "./
|
|
2
|
+
import { from as m } from "./index312.js";
|
|
3
3
|
import { fromBytes as s } from "./index290.js";
|
|
4
4
|
function p(t, o = {}) {
|
|
5
5
|
const { as: e = typeof t == "string" ? "Hex" : "Bytes" } = o, r = f(m(t));
|
package/dist/index308.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index312.cjs"),c=require("./index314.cjs"),o=require("./index303.cjs"),m=require("./index306.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/index308.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 e=require("./index315.cjs");function r(){return e.version}exports.getVersion=r;
|
package/dist/index311.js
CHANGED
|
@@ -1,66 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { assertSize as p } from "./index305.js";
|
|
5
|
-
const l = /* @__PURE__ */ new TextEncoder();
|
|
6
|
-
function E(e) {
|
|
7
|
-
return e instanceof Uint8Array ? e : typeof e == "string" ? y(e) : z(e);
|
|
8
|
-
}
|
|
9
|
-
function z(e) {
|
|
10
|
-
return e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
11
|
-
}
|
|
12
|
-
function y(e, t = {}) {
|
|
13
|
-
const { size: r } = t;
|
|
14
|
-
let n = e;
|
|
15
|
-
r && (p(e, r), n = h(e, r));
|
|
16
|
-
let i = n.slice(2);
|
|
17
|
-
i.length % 2 && (i = `0${i}`);
|
|
18
|
-
const f = i.length / 2, a = new Uint8Array(f);
|
|
19
|
-
for (let s = 0, o = 0; s < f; s++) {
|
|
20
|
-
const d = b(i.charCodeAt(o++)), u = b(i.charCodeAt(o++));
|
|
21
|
-
if (d === void 0 || u === void 0)
|
|
22
|
-
throw new c(`Invalid byte sequence ("${i[o - 2]}${i[o - 1]}" in "${i}").`);
|
|
23
|
-
a[s] = d * 16 + u;
|
|
24
|
-
}
|
|
25
|
-
return a;
|
|
26
|
-
}
|
|
27
|
-
function C(e, t = {}) {
|
|
28
|
-
const { size: r } = t, n = l.encode(e);
|
|
29
|
-
return typeof r == "number" ? (g(n, r), x(n, r)) : n;
|
|
30
|
-
}
|
|
31
|
-
function x(e, t) {
|
|
32
|
-
return m(e, { dir: "right", size: t });
|
|
33
|
-
}
|
|
34
|
-
function U(e) {
|
|
35
|
-
return e.length;
|
|
36
|
-
}
|
|
37
|
-
class B extends c {
|
|
38
|
-
constructor({ givenSize: t, maxSize: r }) {
|
|
39
|
-
super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`), Object.defineProperty(this, "name", {
|
|
40
|
-
enumerable: !0,
|
|
41
|
-
configurable: !0,
|
|
42
|
-
writable: !0,
|
|
43
|
-
value: "Bytes.SizeOverflowError"
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
class O extends c {
|
|
48
|
-
constructor({ size: t, targetSize: r, type: n }) {
|
|
49
|
-
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
|
|
50
|
-
enumerable: !0,
|
|
51
|
-
configurable: !0,
|
|
52
|
-
writable: !0,
|
|
53
|
-
value: "Bytes.SizeExceedsPaddingSizeError"
|
|
54
|
-
});
|
|
55
|
-
}
|
|
1
|
+
import { version as r } from "./index315.js";
|
|
2
|
+
function e() {
|
|
3
|
+
return r;
|
|
56
4
|
}
|
|
57
5
|
export {
|
|
58
|
-
|
|
59
|
-
B as SizeOverflowError,
|
|
60
|
-
E as from,
|
|
61
|
-
z as fromArray,
|
|
62
|
-
y as fromHex,
|
|
63
|
-
C as fromString,
|
|
64
|
-
x as padRight,
|
|
65
|
-
U as size
|
|
6
|
+
e as getVersion
|
|
66
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 a=require("./index303.cjs"),y=require("./index290.cjs"),s=require("./index313.cjs"),z=require("./index305.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/index312.js
CHANGED
|
@@ -1,47 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { BaseError as c } from "./index303.js";
|
|
2
|
+
import { padRight as h } from "./index290.js";
|
|
3
|
+
import { charCodeToBase16 as b, assertSize as g, pad as m } from "./index313.js";
|
|
4
|
+
import { assertSize as p } from "./index305.js";
|
|
5
|
+
const l = /* @__PURE__ */ new TextEncoder();
|
|
6
|
+
function E(e) {
|
|
7
|
+
return e instanceof Uint8Array ? e : typeof e == "string" ? y(e) : z(e);
|
|
8
|
+
}
|
|
9
|
+
function z(e) {
|
|
10
|
+
return e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
11
|
+
}
|
|
12
|
+
function y(e, t = {}) {
|
|
13
|
+
const { size: r } = t;
|
|
14
|
+
let n = e;
|
|
15
|
+
r && (p(e, r), n = h(e, r));
|
|
16
|
+
let i = n.slice(2);
|
|
17
|
+
i.length % 2 && (i = `0${i}`);
|
|
18
|
+
const f = i.length / 2, a = new Uint8Array(f);
|
|
19
|
+
for (let s = 0, o = 0; s < f; s++) {
|
|
20
|
+
const d = b(i.charCodeAt(o++)), u = b(i.charCodeAt(o++));
|
|
21
|
+
if (d === void 0 || u === void 0)
|
|
22
|
+
throw new c(`Invalid byte sequence ("${i[o - 2]}${i[o - 1]}" in "${i}").`);
|
|
23
|
+
a[s] = d * 16 + u;
|
|
24
|
+
}
|
|
25
|
+
return a;
|
|
26
|
+
}
|
|
27
|
+
function C(e, t = {}) {
|
|
28
|
+
const { size: r } = t, n = l.encode(e);
|
|
29
|
+
return typeof r == "number" ? (g(n, r), x(n, r)) : n;
|
|
30
|
+
}
|
|
31
|
+
function x(e, t) {
|
|
32
|
+
return m(e, { dir: "right", size: t });
|
|
33
|
+
}
|
|
34
|
+
function U(e) {
|
|
35
|
+
return e.length;
|
|
36
|
+
}
|
|
37
|
+
class B extends c {
|
|
38
|
+
constructor({ givenSize: t, maxSize: r }) {
|
|
39
|
+
super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`), Object.defineProperty(this, "name", {
|
|
40
|
+
enumerable: !0,
|
|
41
|
+
configurable: !0,
|
|
42
|
+
writable: !0,
|
|
43
|
+
value: "Bytes.SizeOverflowError"
|
|
7
44
|
});
|
|
45
|
+
}
|
|
8
46
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
function s(e) {
|
|
18
|
-
if (e >= n.zero && e <= n.nine)
|
|
19
|
-
return e - n.zero;
|
|
20
|
-
if (e >= n.A && e <= n.F)
|
|
21
|
-
return e - (n.A - 10);
|
|
22
|
-
if (e >= n.a && e <= n.f)
|
|
23
|
-
return e - (n.a - 10);
|
|
24
|
-
}
|
|
25
|
-
function S(e, t = {}) {
|
|
26
|
-
const { dir: z, size: i = 32 } = t;
|
|
27
|
-
if (i === 0)
|
|
28
|
-
return e;
|
|
29
|
-
if (e.length > i)
|
|
30
|
-
throw new a({
|
|
31
|
-
size: e.length,
|
|
32
|
-
targetSize: i,
|
|
33
|
-
type: "Bytes"
|
|
47
|
+
class O extends c {
|
|
48
|
+
constructor({ size: t, targetSize: r, type: n }) {
|
|
49
|
+
super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`), Object.defineProperty(this, "name", {
|
|
50
|
+
enumerable: !0,
|
|
51
|
+
configurable: !0,
|
|
52
|
+
writable: !0,
|
|
53
|
+
value: "Bytes.SizeExceedsPaddingSizeError"
|
|
34
54
|
});
|
|
35
|
-
const o = new Uint8Array(i);
|
|
36
|
-
for (let r = 0; r < i; r++) {
|
|
37
|
-
const f = z === "right";
|
|
38
|
-
o[f ? r : i - r - 1] = e[f ? r : e.length - r - 1];
|
|
39
55
|
}
|
|
40
|
-
return o;
|
|
41
56
|
}
|
|
42
57
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
O as SizeExceedsPaddingSizeError,
|
|
59
|
+
B as SizeOverflowError,
|
|
60
|
+
E as from,
|
|
61
|
+
z as fromArray,
|
|
62
|
+
y as fromHex,
|
|
63
|
+
C as fromString,
|
|
64
|
+
x as padRight,
|
|
65
|
+
U as size
|
|
47
66
|
};
|
package/dist/index313.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 o=require("./index312.cjs");function s(e,t){if(o.size(e)>t)throw new o.SizeOverflowError({givenSize:o.size(e),maxSize:t})}const n={zero:48,nine:57,A:65,F:70,a:97,f:102};function u(e){if(e>=n.zero&&e<=n.nine)return e-n.zero;if(e>=n.A&&e<=n.F)return e-(n.A-10);if(e>=n.a&&e<=n.f)return e-(n.a-10)}function z(e,t={}){const{dir:f,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new o.SizeExceedsPaddingSizeError({size:e.length,targetSize:r,type:"Bytes"});const d=new Uint8Array(r);for(let i=0;i<r;i++){const a=f==="right";d[a?i:r-i-1]=e[a?i:e.length-i-1]}return d}exports.assertSize=s;exports.charCodeMap=n;exports.charCodeToBase16=u;exports.pad=z;
|
package/dist/index313.js
CHANGED
|
@@ -1,7 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function e
|
|
3
|
-
|
|
1
|
+
import { size as d, SizeOverflowError as u, SizeExceedsPaddingSizeError as a } from "./index312.js";
|
|
2
|
+
function p(e, t) {
|
|
3
|
+
if (d(e) > t)
|
|
4
|
+
throw new u({
|
|
5
|
+
givenSize: d(e),
|
|
6
|
+
maxSize: t
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
const n = {
|
|
10
|
+
zero: 48,
|
|
11
|
+
nine: 57,
|
|
12
|
+
A: 65,
|
|
13
|
+
F: 70,
|
|
14
|
+
a: 97,
|
|
15
|
+
f: 102
|
|
16
|
+
};
|
|
17
|
+
function s(e) {
|
|
18
|
+
if (e >= n.zero && e <= n.nine)
|
|
19
|
+
return e - n.zero;
|
|
20
|
+
if (e >= n.A && e <= n.F)
|
|
21
|
+
return e - (n.A - 10);
|
|
22
|
+
if (e >= n.a && e <= n.f)
|
|
23
|
+
return e - (n.a - 10);
|
|
24
|
+
}
|
|
25
|
+
function S(e, t = {}) {
|
|
26
|
+
const { dir: z, size: i = 32 } = t;
|
|
27
|
+
if (i === 0)
|
|
28
|
+
return e;
|
|
29
|
+
if (e.length > i)
|
|
30
|
+
throw new a({
|
|
31
|
+
size: e.length,
|
|
32
|
+
targetSize: i,
|
|
33
|
+
type: "Bytes"
|
|
34
|
+
});
|
|
35
|
+
const o = new Uint8Array(i);
|
|
36
|
+
for (let r = 0; r < i; r++) {
|
|
37
|
+
const f = z === "right";
|
|
38
|
+
o[f ? r : i - r - 1] = e[f ? r : e.length - r - 1];
|
|
39
|
+
}
|
|
40
|
+
return o;
|
|
4
41
|
}
|
|
5
42
|
export {
|
|
6
|
-
|
|
43
|
+
p as assertSize,
|
|
44
|
+
n as charCodeMap,
|
|
45
|
+
s as charCodeToBase16,
|
|
46
|
+
S as pad
|
|
7
47
|
};
|
package/dist/index53.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index50.cjs"),j=require("./index221.cjs"),u=require("./index45.cjs"),l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index50.cjs"),j=require("./index221.cjs"),u=require("./index45.cjs"),l=require("./index276.cjs");function C(s,i={}){return{async request(h){var w;const{body:r,onRequest:o=i.onRequest,onResponse:p=i.onResponse,timeout:d=i.timeout??1e4}=h,f={...i.fetchOptions??{},...h.fetchOptions??{}},{headers:q,method:m,signal:T}=f;try{const t=await j.withTimeout(async({signal:a})=>{const c={...f,body:Array.isArray(r)?u.stringify(r.map(g=>({jsonrpc:"2.0",id:g.id??l.idCache.take(),...g}))):u.stringify({jsonrpc:"2.0",id:r.id??l.idCache.take(),...r}),headers:{"Content-Type":"application/json",...q},method:m||"POST",signal:T||(d>0?a:null)},R=new Request(s,c),y=await(o==null?void 0:o(R,c))??{...c,url:s};return await fetch(y.url??s,y)},{errorInstance:new n.TimeoutError({body:r,url:s}),timeout:d,signal:!0});p&&await p(t);let e;if((w=t.headers.get("Content-Type"))!=null&&w.startsWith("application/json"))e=await t.json();else{e=await t.text();try{e=JSON.parse(e||"{}")}catch(a){if(t.ok)throw a;e={error:e}}}if(!t.ok)throw new n.HttpRequestError({body:r,details:u.stringify(e.error)||t.statusText,headers:t.headers,status:t.status,url:s});return e}catch(t){throw t instanceof n.HttpRequestError||t instanceof n.TimeoutError?t:new n.HttpRequestError({body:r,cause:t,url:s})}}}}exports.getHttpRpcClient=C;
|
package/dist/index53.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TimeoutError as g, HttpRequestError as c } from "./index50.js";
|
|
2
2
|
import { withTimeout as k } from "./index221.js";
|
|
3
3
|
import { stringify as p } from "./index45.js";
|
|
4
|
-
import { idCache as l } from "./
|
|
4
|
+
import { idCache as l } from "./index276.js";
|
|
5
5
|
function H(s, o = {}) {
|
|
6
6
|
return {
|
|
7
7
|
async request(h) {
|
package/dist/index98.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index226.cjs"),f=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index226.cjs"),f=require("./index277.cjs"),h=require("./index278.cjs"),M=require("./index253.cjs");async function S(a,r){const{address:i,domain:t,message:s,nonce:n,scheme:d,signature:c,time:o=new Date,...g}=r,e=f.parseSiweMessage(s);if(!e.address||!h.validateSiweMessage({address:i,domain:t,message:e,nonce:n,scheme:d,time:o}))return!1;const u=l.hashMessage(s);return M.verifyHash(a,{address:e.address,hash:u,signature:c,...g})}exports.verifySiweMessage=S;
|
package/dist/index98.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hashMessage as g } from "./index226.js";
|
|
2
|
-
import { parseSiweMessage as l } from "./
|
|
3
|
-
import { validateSiweMessage as p } from "./
|
|
2
|
+
import { parseSiweMessage as l } from "./index277.js";
|
|
3
|
+
import { validateSiweMessage as p } from "./index278.js";
|
|
4
4
|
import { verifyHash as h } from "./index253.js";
|
|
5
5
|
async function S(a, r) {
|
|
6
6
|
const { address: i, domain: t, message: s, nonce: o, scheme: n, signature: d, time: m = /* @__PURE__ */ new Date(), ...f } = r, e = l(s);
|