@gardenfi/utils 2.0.6-beta.9 → 2.1.0-beta.1
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 +28 -5
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +3 -11
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +12 -2
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +18 -19
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +18 -6
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +644 -5
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +168 -33
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +11 -126
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +128 -2
- package/dist/index109.cjs +1 -2
- package/dist/index109.js +2 -3
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +2 -68
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +32 -64
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +39 -2
- package/dist/index113.cjs +2 -1
- package/dist/index113.js +3 -35
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +5 -41
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +10 -643
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +16 -227
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +6 -172
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +5 -19
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +5 -5
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +11 -11
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +23 -23
- 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 -1
- package/dist/index23.js +41 -17
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +44 -6
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +24 -44
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +6 -21
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +13 -8
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +15 -31
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +5 -26
- package/dist/index30.cjs +1 -2
- package/dist/index30.js +13 -65
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +10 -51
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +12 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +11 -24
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +13 -75
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +2 -2
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +55 -7
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +16 -32
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +5 -15
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +9 -2
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +171 -8
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +102 -19
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +21 -41
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +17 -25
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +7 -6
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +20 -12
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +8 -15
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +31 -5
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +26 -13
- package/dist/index49.cjs +2 -1
- package/dist/index49.js +65 -10
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +51 -12
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +12 -11
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +24 -13
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +75 -55
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +7 -16
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +32 -5
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +15 -8
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +2 -172
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +7 -102
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +20 -21
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +40 -6
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +33 -11
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +68 -33
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +112 -8
- package/dist/index64.cjs +1 -2
- package/dist/index64.js +65 -57
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +2 -2
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +16 -6
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +223 -4
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +230 -10
- package/dist/index69.cjs +1 -5
- package/dist/index69.js +9 -53
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +34 -3
- package/dist/index71.cjs +2 -2
- package/dist/index71.js +57 -32
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +21 -5
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +8 -21
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +18 -8
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +42 -10
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +8 -11
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +104 -6
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +3 -13
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +16 -31
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +8 -14
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +9 -63
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +11 -27
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +14 -3
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +6 -3
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +78 -8
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +14 -191
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +18 -18
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +184 -105
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +62 -14
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +84 -69
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +4 -223
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +2 -43
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +5 -103
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +11 -17
- package/dist/index94.cjs +5 -1
- package/dist/index94.js +51 -73
- package/dist/index95.cjs +2 -1
- package/dist/index95.js +33 -17
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +5 -11
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +3 -19
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +6 -38
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +31 -11
- package/dist/src/lib/auth/siwe/siwe.d.ts +1 -1
- package/package.json +3 -1
package/dist/index116.js
CHANGED
|
@@ -1,234 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (!h(t))
|
|
8
|
-
throw new Error("Uint8Array expected");
|
|
9
|
-
}
|
|
10
|
-
function O(t, n) {
|
|
11
|
-
if (typeof n != "boolean")
|
|
12
|
-
throw new Error(t + " boolean expected, got " + n);
|
|
13
|
-
}
|
|
14
|
-
const T = /* @__PURE__ */ Array.from({ length: 256 }, (t, n) => n.toString(16).padStart(2, "0"));
|
|
15
|
-
function B(t) {
|
|
16
|
-
b(t);
|
|
17
|
-
let n = "";
|
|
18
|
-
for (let r = 0; r < t.length; r++)
|
|
19
|
-
n += T[t[r]];
|
|
20
|
-
return n;
|
|
21
|
-
}
|
|
22
|
-
function S(t) {
|
|
23
|
-
const n = t.toString(16);
|
|
24
|
-
return n.length & 1 ? "0" + n : n;
|
|
25
|
-
}
|
|
26
|
-
function U(t) {
|
|
27
|
-
if (typeof t != "string")
|
|
28
|
-
throw new Error("hex string expected, got " + typeof t);
|
|
29
|
-
return t === "" ? d : BigInt("0x" + t);
|
|
30
|
-
}
|
|
31
|
-
const s = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
32
|
-
function E(t) {
|
|
33
|
-
if (t >= s._0 && t <= s._9)
|
|
34
|
-
return t - s._0;
|
|
35
|
-
if (t >= s.A && t <= s.F)
|
|
36
|
-
return t - (s.A - 10);
|
|
37
|
-
if (t >= s.a && t <= s.f)
|
|
38
|
-
return t - (s.a - 10);
|
|
39
|
-
}
|
|
40
|
-
function m(t) {
|
|
41
|
-
if (typeof t != "string")
|
|
42
|
-
throw new Error("hex string expected, got " + typeof t);
|
|
43
|
-
const n = t.length, r = n / 2;
|
|
44
|
-
if (n % 2)
|
|
45
|
-
throw new Error("hex string expected, got unpadded hex of length " + n);
|
|
46
|
-
const e = new Uint8Array(r);
|
|
47
|
-
for (let o = 0, i = 0; o < r; o++, i += 2) {
|
|
48
|
-
const a = E(t.charCodeAt(i)), f = E(t.charCodeAt(i + 1));
|
|
49
|
-
if (a === void 0 || f === void 0) {
|
|
50
|
-
const c = t[i] + t[i + 1];
|
|
51
|
-
throw new Error('hex string expected, got non-hex character "' + c + '" at index ' + i);
|
|
52
|
-
}
|
|
53
|
-
e[o] = a * 16 + f;
|
|
1
|
+
import { BaseError as o } from "./index71.js";
|
|
2
|
+
class i extends o {
|
|
3
|
+
constructor({ offset: e }) {
|
|
4
|
+
super(`Offset \`${e}\` cannot be negative.`, {
|
|
5
|
+
name: "NegativeOffsetError"
|
|
6
|
+
});
|
|
54
7
|
}
|
|
55
|
-
return e;
|
|
56
|
-
}
|
|
57
|
-
function V(t) {
|
|
58
|
-
return U(B(t));
|
|
59
|
-
}
|
|
60
|
-
function H(t) {
|
|
61
|
-
return b(t), U(B(Uint8Array.from(t).reverse()));
|
|
62
|
-
}
|
|
63
|
-
function v(t, n) {
|
|
64
|
-
return m(t.toString(16).padStart(n * 2, "0"));
|
|
65
|
-
}
|
|
66
|
-
function C(t, n) {
|
|
67
|
-
return v(t, n).reverse();
|
|
68
|
-
}
|
|
69
|
-
function M(t) {
|
|
70
|
-
return m(S(t));
|
|
71
|
-
}
|
|
72
|
-
function R(t, n, r) {
|
|
73
|
-
let e;
|
|
74
|
-
if (typeof n == "string")
|
|
75
|
-
try {
|
|
76
|
-
e = m(n);
|
|
77
|
-
} catch (i) {
|
|
78
|
-
throw new Error(t + " must be hex string or Uint8Array, cause: " + i);
|
|
79
|
-
}
|
|
80
|
-
else if (h(n))
|
|
81
|
-
e = Uint8Array.from(n);
|
|
82
|
-
else
|
|
83
|
-
throw new Error(t + " must be hex string or Uint8Array");
|
|
84
|
-
const o = e.length;
|
|
85
|
-
if (typeof r == "number" && o !== r)
|
|
86
|
-
throw new Error(t + " of length " + r + " expected, got " + o);
|
|
87
|
-
return e;
|
|
88
8
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const o = t[e];
|
|
93
|
-
b(o), n += o.length;
|
|
9
|
+
class n extends o {
|
|
10
|
+
constructor({ length: e, position: r }) {
|
|
11
|
+
super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`, { name: "PositionOutOfBoundsError" });
|
|
94
12
|
}
|
|
95
|
-
const r = new Uint8Array(n);
|
|
96
|
-
for (let e = 0, o = 0; e < t.length; e++) {
|
|
97
|
-
const i = t[e];
|
|
98
|
-
r.set(i, o), o += i.length;
|
|
99
|
-
}
|
|
100
|
-
return r;
|
|
101
|
-
}
|
|
102
|
-
function j(t, n) {
|
|
103
|
-
if (t.length !== n.length)
|
|
104
|
-
return !1;
|
|
105
|
-
let r = 0;
|
|
106
|
-
for (let e = 0; e < t.length; e++)
|
|
107
|
-
r |= t[e] ^ n[e];
|
|
108
|
-
return r === 0;
|
|
109
|
-
}
|
|
110
|
-
function z(t) {
|
|
111
|
-
if (typeof t != "string")
|
|
112
|
-
throw new Error("string expected");
|
|
113
|
-
return new Uint8Array(new TextEncoder().encode(t));
|
|
114
|
-
}
|
|
115
|
-
const w = (t) => typeof t == "bigint" && d <= t;
|
|
116
|
-
function N(t, n, r) {
|
|
117
|
-
return w(t) && w(n) && w(r) && n <= t && t < r;
|
|
118
|
-
}
|
|
119
|
-
function D(t, n, r, e) {
|
|
120
|
-
if (!N(n, r, e))
|
|
121
|
-
throw new Error("expected valid " + t + ": " + r + " <= n < " + e + ", got " + n);
|
|
122
|
-
}
|
|
123
|
-
function G(t) {
|
|
124
|
-
let n;
|
|
125
|
-
for (n = 0; t > d; t >>= y, n += 1)
|
|
126
|
-
;
|
|
127
|
-
return n;
|
|
128
|
-
}
|
|
129
|
-
function P(t, n) {
|
|
130
|
-
return t >> BigInt(n) & y;
|
|
131
13
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function J(t, n, r) {
|
|
137
|
-
if (typeof t != "number" || t < 2)
|
|
138
|
-
throw new Error("hashLen must be a number");
|
|
139
|
-
if (typeof n != "number" || n < 2)
|
|
140
|
-
throw new Error("qByteLen must be a number");
|
|
141
|
-
if (typeof r != "function")
|
|
142
|
-
throw new Error("hmacFn must be a function");
|
|
143
|
-
let e = p(t), o = p(t), i = 0;
|
|
144
|
-
const a = () => {
|
|
145
|
-
e.fill(1), o.fill(0), i = 0;
|
|
146
|
-
}, f = (...u) => r(o, e, ...u), c = (u = p()) => {
|
|
147
|
-
o = f(A([0]), u), e = f(), u.length !== 0 && (o = f(A([1]), u), e = f());
|
|
148
|
-
}, x = () => {
|
|
149
|
-
if (i++ >= 1e3)
|
|
150
|
-
throw new Error("drbg: tried 1000 values");
|
|
151
|
-
let u = 0;
|
|
152
|
-
const l = [];
|
|
153
|
-
for (; u < n; ) {
|
|
154
|
-
e = f();
|
|
155
|
-
const g = e.slice();
|
|
156
|
-
l.push(g), u += e.length;
|
|
157
|
-
}
|
|
158
|
-
return _(...l);
|
|
159
|
-
};
|
|
160
|
-
return (u, l) => {
|
|
161
|
-
a(), c(u);
|
|
162
|
-
let g;
|
|
163
|
-
for (; !(g = l(x())); )
|
|
164
|
-
c();
|
|
165
|
-
return a(), g;
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
const k = {
|
|
169
|
-
bigint: (t) => typeof t == "bigint",
|
|
170
|
-
function: (t) => typeof t == "function",
|
|
171
|
-
boolean: (t) => typeof t == "boolean",
|
|
172
|
-
string: (t) => typeof t == "string",
|
|
173
|
-
stringOrUint8Array: (t) => typeof t == "string" || h(t),
|
|
174
|
-
isSafeInteger: (t) => Number.isSafeInteger(t),
|
|
175
|
-
array: (t) => Array.isArray(t),
|
|
176
|
-
field: (t, n) => n.Fp.isValid(t),
|
|
177
|
-
hash: (t) => typeof t == "function" && Number.isSafeInteger(t.outputLen)
|
|
178
|
-
};
|
|
179
|
-
function K(t, n, r = {}) {
|
|
180
|
-
const e = (o, i, a) => {
|
|
181
|
-
const f = k[i];
|
|
182
|
-
if (typeof f != "function")
|
|
183
|
-
throw new Error("invalid validator function");
|
|
184
|
-
const c = t[o];
|
|
185
|
-
if (!(a && c === void 0) && !f(c, t))
|
|
186
|
-
throw new Error("param " + String(o) + " is invalid. Expected " + i + ", got " + c);
|
|
187
|
-
};
|
|
188
|
-
for (const [o, i] of Object.entries(n))
|
|
189
|
-
e(o, i, !1);
|
|
190
|
-
for (const [o, i] of Object.entries(r))
|
|
191
|
-
e(o, i, !0);
|
|
192
|
-
return t;
|
|
193
|
-
}
|
|
194
|
-
const Q = () => {
|
|
195
|
-
throw new Error("not implemented");
|
|
196
|
-
};
|
|
197
|
-
function X(t) {
|
|
198
|
-
const n = /* @__PURE__ */ new WeakMap();
|
|
199
|
-
return (r, ...e) => {
|
|
200
|
-
const o = n.get(r);
|
|
201
|
-
if (o !== void 0)
|
|
202
|
-
return o;
|
|
203
|
-
const i = t(r, ...e);
|
|
204
|
-
return n.set(r, i), i;
|
|
205
|
-
};
|
|
14
|
+
class c extends o {
|
|
15
|
+
constructor({ count: e, limit: r }) {
|
|
16
|
+
super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
17
|
+
}
|
|
206
18
|
}
|
|
207
19
|
export {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
P as bitGet,
|
|
212
|
-
G as bitLen,
|
|
213
|
-
q as bitMask,
|
|
214
|
-
W as bitSet,
|
|
215
|
-
B as bytesToHex,
|
|
216
|
-
V as bytesToNumberBE,
|
|
217
|
-
H as bytesToNumberLE,
|
|
218
|
-
_ as concatBytes,
|
|
219
|
-
J as createHmacDrbg,
|
|
220
|
-
R as ensureBytes,
|
|
221
|
-
j as equalBytes,
|
|
222
|
-
m as hexToBytes,
|
|
223
|
-
U as hexToNumber,
|
|
224
|
-
N as inRange,
|
|
225
|
-
h as isBytes,
|
|
226
|
-
X as memoized,
|
|
227
|
-
Q as notImplemented,
|
|
228
|
-
v as numberToBytesBE,
|
|
229
|
-
C as numberToBytesLE,
|
|
230
|
-
S as numberToHexUnpadded,
|
|
231
|
-
M as numberToVarBytesBE,
|
|
232
|
-
z as utf8ToBytes,
|
|
233
|
-
K as validateObject
|
|
20
|
+
i as NegativeOffsetError,
|
|
21
|
+
n as PositionOutOfBoundsError,
|
|
22
|
+
c as RecursiveReadLimitExceededError
|
|
234
23
|
};
|
package/dist/index117.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("./index63.cjs"),s=require("./index78.cjs"),r=require("./index36.cjs");function o(t,i){return e.sha256(s.isHex(t,{strict:!1})?r.toBytes(t):t)}exports.sha256=o;
|
package/dist/index117.js
CHANGED
|
@@ -1,175 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const t = r.negate();
|
|
7
|
-
return e ? t : r;
|
|
8
|
-
}
|
|
9
|
-
function A(e, r) {
|
|
10
|
-
if (!Number.isSafeInteger(e) || e <= 0 || e > r)
|
|
11
|
-
throw new Error("invalid window size, expected [1.." + r + "], got W=" + e);
|
|
12
|
-
}
|
|
13
|
-
function b(e, r) {
|
|
14
|
-
A(e, r);
|
|
15
|
-
const t = Math.ceil(r / e) + 1, n = 2 ** (e - 1);
|
|
16
|
-
return { windows: t, windowSize: n };
|
|
17
|
-
}
|
|
18
|
-
function L(e, r) {
|
|
19
|
-
if (!Array.isArray(e))
|
|
20
|
-
throw new Error("array expected");
|
|
21
|
-
e.forEach((t, n) => {
|
|
22
|
-
if (!(t instanceof r))
|
|
23
|
-
throw new Error("invalid point at index " + n);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function k(e, r) {
|
|
27
|
-
if (!Array.isArray(e))
|
|
28
|
-
throw new Error("array of scalars expected");
|
|
29
|
-
e.forEach((t, n) => {
|
|
30
|
-
if (!r.isValid(t))
|
|
31
|
-
throw new Error("invalid scalar at index " + n);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const B = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap();
|
|
35
|
-
function S(e) {
|
|
36
|
-
return E.get(e) || 1;
|
|
37
|
-
}
|
|
38
|
-
function v(e, r) {
|
|
39
|
-
return {
|
|
40
|
-
constTimeNegate: m,
|
|
41
|
-
hasPrecomputes(t) {
|
|
42
|
-
return S(t) !== 1;
|
|
43
|
-
},
|
|
44
|
-
// non-const time multiplication ladder
|
|
45
|
-
unsafeLadder(t, n, i = e.ZERO) {
|
|
46
|
-
let o = t;
|
|
47
|
-
for (; n > I; )
|
|
48
|
-
n & p && (i = i.add(o)), o = o.double(), n >>= p;
|
|
49
|
-
return i;
|
|
50
|
-
},
|
|
51
|
-
/**
|
|
52
|
-
* Creates a wNAF precomputation window. Used for caching.
|
|
53
|
-
* Default window size is set by `utils.precompute()` and is equal to 8.
|
|
54
|
-
* Number of precomputed points depends on the curve size:
|
|
55
|
-
* 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
|
|
56
|
-
* - 𝑊 is the window size
|
|
57
|
-
* - 𝑛 is the bitlength of the curve order.
|
|
58
|
-
* For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
|
|
59
|
-
* @param elm Point instance
|
|
60
|
-
* @param W window size
|
|
61
|
-
* @returns precomputed point tables flattened to a single array
|
|
62
|
-
*/
|
|
63
|
-
precomputeWindow(t, n) {
|
|
64
|
-
const { windows: i, windowSize: o } = b(n, r), a = [];
|
|
65
|
-
let c = t, d = c;
|
|
66
|
-
for (let h = 0; h < i; h++) {
|
|
67
|
-
d = c, a.push(d);
|
|
68
|
-
for (let w = 1; w < o; w++)
|
|
69
|
-
d = d.add(c), a.push(d);
|
|
70
|
-
c = d.double();
|
|
71
|
-
}
|
|
72
|
-
return a;
|
|
73
|
-
},
|
|
74
|
-
/**
|
|
75
|
-
* Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
|
|
76
|
-
* @param W window size
|
|
77
|
-
* @param precomputes precomputed tables
|
|
78
|
-
* @param n scalar (we don't check here, but should be less than curve order)
|
|
79
|
-
* @returns real and fake (for const-time) points
|
|
80
|
-
*/
|
|
81
|
-
wNAF(t, n, i) {
|
|
82
|
-
const { windows: o, windowSize: a } = b(t, r);
|
|
83
|
-
let c = e.ZERO, d = e.BASE;
|
|
84
|
-
const h = BigInt(2 ** t - 1), w = 2 ** t, l = BigInt(t);
|
|
85
|
-
for (let u = 0; u < o; u++) {
|
|
86
|
-
const s = u * a;
|
|
87
|
-
let f = Number(i & h);
|
|
88
|
-
i >>= l, f > a && (f -= w, i += p);
|
|
89
|
-
const g = s, N = s + Math.abs(f) - 1, y = u % 2 !== 0, M = f < 0;
|
|
90
|
-
f === 0 ? d = d.add(m(y, n[g])) : c = c.add(m(M, n[N]));
|
|
91
|
-
}
|
|
92
|
-
return { p: c, f: d };
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form.
|
|
96
|
-
* @param W window size
|
|
97
|
-
* @param precomputes precomputed tables
|
|
98
|
-
* @param n scalar (we don't check here, but should be less than curve order)
|
|
99
|
-
* @param acc accumulator point to add result of multiplication
|
|
100
|
-
* @returns point
|
|
101
|
-
*/
|
|
102
|
-
wNAFUnsafe(t, n, i, o = e.ZERO) {
|
|
103
|
-
const { windows: a, windowSize: c } = b(t, r), d = BigInt(2 ** t - 1), h = 2 ** t, w = BigInt(t);
|
|
104
|
-
for (let l = 0; l < a; l++) {
|
|
105
|
-
const u = l * c;
|
|
106
|
-
if (i === I)
|
|
107
|
-
break;
|
|
108
|
-
let s = Number(i & d);
|
|
109
|
-
if (i >>= w, s > c && (s -= h, i += p), s === 0)
|
|
110
|
-
continue;
|
|
111
|
-
let f = n[u + Math.abs(s) - 1];
|
|
112
|
-
s < 0 && (f = f.negate()), o = o.add(f);
|
|
113
|
-
}
|
|
114
|
-
return o;
|
|
115
|
-
},
|
|
116
|
-
getPrecomputes(t, n, i) {
|
|
117
|
-
let o = B.get(n);
|
|
118
|
-
return o || (o = this.precomputeWindow(n, t), t !== 1 && B.set(n, i(o))), o;
|
|
119
|
-
},
|
|
120
|
-
wNAFCached(t, n, i) {
|
|
121
|
-
const o = S(t);
|
|
122
|
-
return this.wNAF(o, this.getPrecomputes(o, t, i), n);
|
|
123
|
-
},
|
|
124
|
-
wNAFCachedUnsafe(t, n, i, o) {
|
|
125
|
-
const a = S(t);
|
|
126
|
-
return a === 1 ? this.unsafeLadder(t, n, o) : this.wNAFUnsafe(a, this.getPrecomputes(a, t, i), n, o);
|
|
127
|
-
},
|
|
128
|
-
// We calculate precomputes for elliptic curve point multiplication
|
|
129
|
-
// using windowed method. This specifies window size and
|
|
130
|
-
// stores precomputed values. Usually only base point would be precomputed.
|
|
131
|
-
setWindowSize(t, n) {
|
|
132
|
-
A(n, r), E.set(t, n), B.delete(t);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
function Z(e, r, t, n) {
|
|
137
|
-
if (L(t, e), k(n, r), t.length !== n.length)
|
|
138
|
-
throw new Error("arrays of points and scalars must have equal length");
|
|
139
|
-
const i = e.ZERO, o = O(BigInt(t.length)), a = o > 12 ? o - 3 : o > 4 ? o - 2 : o ? 2 : 1, c = (1 << a) - 1, d = new Array(c + 1).fill(i), h = Math.floor((r.BITS - 1) / a) * a;
|
|
140
|
-
let w = i;
|
|
141
|
-
for (let l = h; l >= 0; l -= a) {
|
|
142
|
-
d.fill(i);
|
|
143
|
-
for (let s = 0; s < n.length; s++) {
|
|
144
|
-
const f = n[s], g = Number(f >> BigInt(l) & BigInt(c));
|
|
145
|
-
d[g] = d[g].add(t[s]);
|
|
146
|
-
}
|
|
147
|
-
let u = i;
|
|
148
|
-
for (let s = d.length - 1, f = i; s > 0; s--)
|
|
149
|
-
f = f.add(d[s]), u = u.add(f);
|
|
150
|
-
if (w = w.add(u), l !== 0)
|
|
151
|
-
for (let s = 0; s < a; s++)
|
|
152
|
-
w = w.double();
|
|
153
|
-
}
|
|
154
|
-
return w;
|
|
155
|
-
}
|
|
156
|
-
function U(e) {
|
|
157
|
-
return z(e.Fp), x(e, {
|
|
158
|
-
n: "bigint",
|
|
159
|
-
h: "bigint",
|
|
160
|
-
Gx: "field",
|
|
161
|
-
Gy: "field"
|
|
162
|
-
}, {
|
|
163
|
-
nBitLength: "isSafeInteger",
|
|
164
|
-
nByteLength: "isSafeInteger"
|
|
165
|
-
}), Object.freeze({
|
|
166
|
-
...F(e.n, e.nBitLength),
|
|
167
|
-
...e,
|
|
168
|
-
p: e.Fp.ORDER
|
|
169
|
-
});
|
|
1
|
+
import { sha256 as o } from "./index63.js";
|
|
2
|
+
import { isHex as s } from "./index78.js";
|
|
3
|
+
import { toBytes as r } from "./index36.js";
|
|
4
|
+
function p(t, i) {
|
|
5
|
+
return o(s(t, { strict: !1 }) ? r(t) : t);
|
|
170
6
|
}
|
|
171
7
|
export {
|
|
172
|
-
|
|
173
|
-
U as validateBasic,
|
|
174
|
-
v as wNAF
|
|
8
|
+
p as sha256
|
|
175
9
|
};
|
package/dist/index118.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 t=6,s=32,e=4096,n=s*e,o=n*t-1-1*e*t;exports.bytesPerBlob=n;exports.bytesPerFieldElement=s;exports.fieldElementsPerBlob=e;exports.maxBytesPerTransaction=o;
|
package/dist/index118.js
CHANGED
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
function f(t, r = !1) {
|
|
3
|
-
return r ? { h: Number(t & o), l: Number(t >> i & o) } : { h: Number(t >> i & o) | 0, l: Number(t & o) | 0 };
|
|
4
|
-
}
|
|
5
|
-
function h(t, r = !1) {
|
|
6
|
-
let n = new Uint32Array(t.length), l = new Uint32Array(t.length);
|
|
7
|
-
for (let e = 0; e < t.length; e++) {
|
|
8
|
-
const { h: c, l: u } = f(t[e], r);
|
|
9
|
-
[n[e], l[e]] = [c, u];
|
|
10
|
-
}
|
|
11
|
-
return [n, l];
|
|
12
|
-
}
|
|
13
|
-
const g = (t, r, n) => t << n | r >>> 32 - n, m = (t, r, n) => r << n | t >>> 32 - n, A = (t, r, n) => r << n - 32 | t >>> 64 - n, B = (t, r, n) => t << n - 32 | r >>> 64 - n;
|
|
1
|
+
const e = 32, s = 4096, t = 131072, l = 761855;
|
|
14
2
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
m as rotlSL,
|
|
20
|
-
h as split
|
|
3
|
+
t as bytesPerBlob,
|
|
4
|
+
e as bytesPerFieldElement,
|
|
5
|
+
s as fieldElementsPerBlob,
|
|
6
|
+
l as maxBytesPerTransaction
|
|
21
7
|
};
|
package/dist/index15.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index17.cjs"),n=require("viem"),s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index17.cjs"),n=require("viem"),s=require("./index22.cjs"),l=require("./index20.cjs"),o={42161:l.mainnet,421614:s.sepolia},b=async e=>{const{chain:t}=e;if(!t)return r.Err("No chain found");const a=(u=>u in o)(t.id)?o[t.id]:t;return await i(a)},i=async e=>{const t=n.createPublicClient({chain:e,transport:n.http()});try{const c=await t.getBlockNumber();return r.Ok(Number(c))}catch(c){return r.Err("Failed to fetch evm block number",c)}},m=async e=>{try{const t=await e.getLatestTip();return r.Ok(t)}catch(t){return r.Err("Failed to fetch bitcoin block number",t)}};exports._fetchEVMBlockNumber=i;exports.fetchBitcoinBlockNumber=m;exports.fetchEVMBlockNumber=b;
|
package/dist/index15.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ok as n, Err as o } from "./index17.js";
|
|
2
2
|
import { createPublicClient as s, http as m } from "viem";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { sepolia as u } from "./index22.js";
|
|
4
|
+
import { mainnet as b } from "./index20.js";
|
|
5
5
|
const e = {
|
|
6
|
-
42161:
|
|
7
|
-
421614:
|
|
6
|
+
42161: b,
|
|
7
|
+
421614: u
|
|
8
8
|
}, N = async (r) => {
|
|
9
9
|
const { chain: t } = r;
|
|
10
10
|
if (!t) return o("No chain found");
|
package/dist/index18.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("./index44.cjs"),k=require("./index49.cjs"),g=require("./index54.cjs"),O=require("./index55.cjs"),S=require("./index58.cjs"),y=require("./index59.cjs"),$=require("./index57.cjs"),P=require("./index43.cjs"),W=require("./index48.cjs"),q=require("./index51.cjs"),x=require("./index53.cjs");async function z(n,{confirmations:c=1,hash:p,onReplaced:h,pollingInterval:m=n.pollingInterval,retryCount:w=6,retryDelay:R=({count:d})=>~~(1<<d)*200,timeout:N=18e4}){const d=$.stringify(["waitForTransactionReceipt",n.uid,p]);let a,o,e,i=!1;const{promise:B,resolve:F,reject:v}=S.withResolvers(),A=N?setTimeout(()=>v(new k.WaitForTransactionReceiptTimeoutError({hash:p})),N):void 0,j=O.observe(d,{onReplaced:h,resolve:F,reject:v},r=>{const E=g.getAction(n,x.watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:m,async onBlockNumber(_){const u=b=>{clearTimeout(A),E(),b(),j()};let l=_;if(!i)try{if(e){if(c>1&&(!e.blockNumber||l-e.blockNumber+1n<c))return;u(()=>r.resolve(e));return}if(a||(i=!0,await y.withRetry(async()=>{a=await g.getAction(n,W.getTransaction,"getTransaction")({hash:p}),a.blockNumber&&(l=a.blockNumber)},{delay:R,retryCount:w}),i=!1),e=await g.getAction(n,q.getTransactionReceipt,"getTransactionReceipt")({hash:p}),c>1&&(!e.blockNumber||l-e.blockNumber+1n<c))return;u(()=>r.resolve(e))}catch(b){if(b instanceof k.TransactionNotFoundError||b instanceof k.TransactionReceiptNotFoundError){if(!a){i=!1;return}try{o=a,i=!0;const f=await y.withRetry(()=>g.getAction(n,P.getBlock,"getBlock")({blockNumber:l,includeTransactions:!0}),{delay:R,retryCount:w,shouldRetry:({error:s})=>s instanceof M.BlockNotFoundError});i=!1;const t=f.transactions.find(({from:s,nonce:I})=>s===o.from&&I===o.nonce);if(!t||(e=await g.getAction(n,q.getTransactionReceipt,"getTransactionReceipt")({hash:t.hash}),c>1&&(!e.blockNumber||l-e.blockNumber+1n<c)))return;let T="replaced";t.to===o.to&&t.value===o.value&&t.input===o.input?T="repriced":t.from===t.to&&t.value===0n&&(T="cancelled"),u(()=>{var s;(s=r.onReplaced)==null||s.call(r,{reason:T,replacedTransaction:o,transaction:t,transactionReceipt:e}),r.resolve(e)})}catch(f){u(()=>r.reject(f))}}else u(()=>r.reject(b))}}})});return B}exports.waitForTransactionReceipt=z;
|
package/dist/index18.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { BlockNotFoundError as A } from "./
|
|
2
|
-
import { WaitForTransactionReceiptTimeoutError as M, TransactionNotFoundError as O, TransactionReceiptNotFoundError as W } from "./
|
|
3
|
-
import { getAction as f } from "./
|
|
4
|
-
import { observe as q } from "./
|
|
5
|
-
import { withResolvers as z } from "./
|
|
6
|
-
import { withRetry as v } from "./
|
|
7
|
-
import { stringify as G } from "./
|
|
8
|
-
import { getBlock as H } from "./
|
|
9
|
-
import { getTransaction as J } from "./
|
|
10
|
-
import { getTransactionReceipt as R } from "./
|
|
11
|
-
import { watchBlockNumber as K } from "./
|
|
1
|
+
import { BlockNotFoundError as A } from "./index44.js";
|
|
2
|
+
import { WaitForTransactionReceiptTimeoutError as M, TransactionNotFoundError as O, TransactionReceiptNotFoundError as W } from "./index49.js";
|
|
3
|
+
import { getAction as f } from "./index54.js";
|
|
4
|
+
import { observe as q } from "./index55.js";
|
|
5
|
+
import { withResolvers as z } from "./index58.js";
|
|
6
|
+
import { withRetry as v } from "./index59.js";
|
|
7
|
+
import { stringify as G } from "./index57.js";
|
|
8
|
+
import { getBlock as H } from "./index43.js";
|
|
9
|
+
import { getTransaction as J } from "./index48.js";
|
|
10
|
+
import { getTransactionReceipt as R } from "./index51.js";
|
|
11
|
+
import { watchBlockNumber as K } from "./index53.js";
|
|
12
12
|
async function D(o, {
|
|
13
13
|
confirmations: a = 1,
|
|
14
14
|
hash: m,
|
package/dist/index19.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("./index23.cjs"),u=require("./index24.cjs"),a=require("./index25.cjs"),g=require("./index26.cjs"),y=require("./index27.cjs"),d=require("./index28.cjs"),T=require("./index29.cjs"),l=require("./index30.cjs"),q=require("./index31.cjs");function A(s,t={}){const{nonceManager:c}=t,e=u.toHex(i.secp256k1.getPublicKey(s.slice(2),!1)),o=g.publicKeyToAddress(e);return{...a.toAccount({address:o,nonceManager:c,async sign({hash:n}){return y.sign({hash:n,privateKey:s,to:"hex"})},async signAuthorization(n){return d.signAuthorization({...n,privateKey:s})},async signMessage({message:n}){return T.signMessage({message:n,privateKey:s})},async signTransaction(n,{serializer:r}={}){return l.signTransaction({privateKey:s,transaction:n,serializer:r})},async signTypedData(n){return q.signTypedData({...n,privateKey:s})}}),publicKey:e,source:"privateKey"}}exports.privateKeyToAccount=A;
|
package/dist/index19.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { secp256k1 as e } from "./
|
|
2
|
-
import { toHex as a } from "./
|
|
3
|
-
import { toAccount as m } from "./
|
|
4
|
-
import { publicKeyToAddress as u } from "./
|
|
5
|
-
import { sign as g } from "./
|
|
6
|
-
import {
|
|
7
|
-
import { signMessage as f } from "./
|
|
8
|
-
import { signTransaction as
|
|
9
|
-
import { signTypedData as
|
|
10
|
-
function
|
|
11
|
-
const { nonceManager: s } = t, r = a(e.getPublicKey(
|
|
1
|
+
import { secp256k1 as e } from "./index23.js";
|
|
2
|
+
import { toHex as a } from "./index24.js";
|
|
3
|
+
import { toAccount as m } from "./index25.js";
|
|
4
|
+
import { publicKeyToAddress as u } from "./index26.js";
|
|
5
|
+
import { sign as g } from "./index27.js";
|
|
6
|
+
import { signAuthorization as p } from "./index28.js";
|
|
7
|
+
import { signMessage as f } from "./index29.js";
|
|
8
|
+
import { signTransaction as y } from "./index30.js";
|
|
9
|
+
import { signTypedData as d } from "./index31.js";
|
|
10
|
+
function H(n, t = {}) {
|
|
11
|
+
const { nonceManager: s } = t, r = a(e.getPublicKey(n.slice(2), !1)), c = u(r);
|
|
12
12
|
return {
|
|
13
13
|
...m({
|
|
14
|
-
address:
|
|
14
|
+
address: c,
|
|
15
15
|
nonceManager: s,
|
|
16
|
-
async sign({ hash:
|
|
17
|
-
return g({ hash:
|
|
16
|
+
async sign({ hash: o }) {
|
|
17
|
+
return g({ hash: o, privateKey: n, to: "hex" });
|
|
18
18
|
},
|
|
19
|
-
async
|
|
20
|
-
return p({ ...
|
|
19
|
+
async signAuthorization(o) {
|
|
20
|
+
return p({ ...o, privateKey: n });
|
|
21
21
|
},
|
|
22
|
-
async signMessage({ message:
|
|
23
|
-
return f({ message:
|
|
22
|
+
async signMessage({ message: o }) {
|
|
23
|
+
return f({ message: o, privateKey: n });
|
|
24
24
|
},
|
|
25
|
-
async signTransaction(
|
|
26
|
-
return
|
|
25
|
+
async signTransaction(o, { serializer: i } = {}) {
|
|
26
|
+
return y({ privateKey: n, transaction: o, serializer: i });
|
|
27
27
|
},
|
|
28
|
-
async signTypedData(
|
|
29
|
-
return
|
|
28
|
+
async signTypedData(o) {
|
|
29
|
+
return d({ ...o, privateKey: n });
|
|
30
30
|
}
|
|
31
31
|
}),
|
|
32
32
|
publicKey: r,
|
|
@@ -34,5 +34,5 @@ function k(o, t = {}) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
H as privateKeyToAccount
|
|
38
38
|
};
|
package/dist/index20.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("./index73.cjs"),t=e.defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});exports.mainnet=t;
|
package/dist/index20.js
CHANGED
package/dist/index21.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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("./index102.cjs"),M=require("./index42.cjs"),h=require("./index103.cjs");function R(r){const{chainId:o,domain:s,expirationTime:l,issuedAt:m=new Date,nonce:a,notBefore:f,requestId:w,resources:g,scheme:i,uri:c,version:d}=r;{if(o!==Math.floor(o))throw new e.SiweInvalidMessageFieldError({field:"chainId",metaMessages:["- Chain ID must be a EIP-155 chain ID.","- See https://eips.ethereum.org/EIPS/eip-155","",`Provided value: ${o}`]});if(!(E.test(s)||F.test(s)||b.test(s)))throw new e.SiweInvalidMessageFieldError({field:"domain",metaMessages:["- Domain must be an RFC 3986 authority.","- See https://www.rfc-editor.org/rfc/rfc3986","",`Provided value: ${s}`]});if(!A.test(a))throw new e.SiweInvalidMessageFieldError({field:"nonce",metaMessages:["- Nonce must be at least 8 characters.","- Nonce must be alphanumeric.","",`Provided value: ${a}`]});if(!h.isUri(c))throw new e.SiweInvalidMessageFieldError({field:"uri",metaMessages:["- URI must be a RFC 3986 URI referring to the resource that is the subject of the signing.","- See https://www.rfc-editor.org/rfc/rfc3986","",`Provided value: ${c}`]});if(d!=="1")throw new e.SiweInvalidMessageFieldError({field:"version",metaMessages:["- Version must be '1'.","",`Provided value: ${d}`]});if(i&&!P.test(i))throw new e.SiweInvalidMessageFieldError({field:"scheme",metaMessages:["- Scheme must be an RFC 3986 URI scheme.","- See https://www.rfc-editor.org/rfc/rfc3986#section-3.1","",`Provided value: ${i}`]});const t=r.statement;if(t!=null&&t.includes(`
|
|
2
2
|
`))throw new e.SiweInvalidMessageFieldError({field:"statement",metaMessages:["- Statement must not include '\\n'.","",`Provided value: ${t}`]})}const $=M.getAddress(r.address),v=i?`${i}://${s}`:s,I=r.statement?`${r.statement}
|
|
3
3
|
`:"",S=`${v} wants you to sign in with your Ethereum account:
|
|
4
4
|
${$}
|
package/dist/index21.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SiweInvalidMessageFieldError as e } from "./
|
|
2
|
-
import { getAddress as S } from "./
|
|
3
|
-
import { isUri as $ } from "./
|
|
1
|
+
import { SiweInvalidMessageFieldError as e } from "./index102.js";
|
|
2
|
+
import { getAddress as S } from "./index42.js";
|
|
3
|
+
import { isUri as $ } from "./index103.js";
|
|
4
4
|
function C(n) {
|
|
5
5
|
const { chainId: i, domain: s, expirationTime: u, issuedAt: g = /* @__PURE__ */ new Date(), nonce: a, notBefore: m, requestId: h, resources: w, scheme: o, uri: c, version: f } = n;
|
|
6
6
|
{
|