tenjin-cli 0.1.0-alpha.1 → 0.1.0-alpha.3
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/NOTICE.md +33 -0
- package/README.md +167 -16
- package/dist/{_esm-ZH2J4QEH.js → _esm-C5CRWCYU.js} +2 -2
- package/dist/_esm-FEASBWRP.js +881 -0
- package/dist/buy-EE6SEXP6.js +1598 -0
- package/dist/buy-EE6SEXP6.js.map +1 -0
- package/dist/candidate-ERMSYYQZ.js +127 -0
- package/dist/candidate-ERMSYYQZ.js.map +1 -0
- package/dist/{ccip-UCLT5VOW.js → ccip-NQXCEK2U.js} +6 -5
- package/dist/ccip-XR5NE5QK.js +19 -0
- package/dist/chunk-2I4QTOLB.js +11 -0
- package/dist/chunk-2I4QTOLB.js.map +1 -0
- package/dist/chunk-3OV7E5G5.js +18 -0
- package/dist/chunk-3OV7E5G5.js.map +1 -0
- package/dist/chunk-4ONXEEQL.js +152 -0
- package/dist/chunk-4ONXEEQL.js.map +1 -0
- package/dist/chunk-5CLSD5YN.js +209 -0
- package/dist/chunk-5CLSD5YN.js.map +1 -0
- package/dist/chunk-662MSGZB.js +286 -0
- package/dist/chunk-662MSGZB.js.map +1 -0
- package/dist/chunk-7KUW4MJD.js +59 -0
- package/dist/chunk-7KUW4MJD.js.map +1 -0
- package/dist/{doctor-3QBYN46N.js → chunk-AWPAWHNX.js} +88 -93
- package/dist/chunk-AWPAWHNX.js.map +1 -0
- package/dist/chunk-CYOF7ROH.js +70 -0
- package/dist/chunk-CYOF7ROH.js.map +1 -0
- package/dist/chunk-DXTQ3CSI.js +171 -0
- package/dist/chunk-DXTQ3CSI.js.map +1 -0
- package/dist/{chunk-EZROUI5U.js → chunk-ESPNTPQ2.js} +80 -8
- package/dist/chunk-ESPNTPQ2.js.map +1 -0
- package/dist/chunk-FJPLRISB.js +79 -0
- package/dist/chunk-FJPLRISB.js.map +1 -0
- package/dist/chunk-GO75V3NZ.js +160 -0
- package/dist/chunk-GO75V3NZ.js.map +1 -0
- package/dist/chunk-HIVZG55D.js +204 -0
- package/dist/chunk-HIVZG55D.js.map +1 -0
- package/dist/chunk-HSDCI7OV.js +7806 -0
- package/dist/chunk-HSDCI7OV.js.map +1 -0
- package/dist/chunk-JPHG2JW3.js +96 -0
- package/dist/chunk-JPHG2JW3.js.map +1 -0
- package/dist/{chunk-ZPZFPVDN.js → chunk-MUBUQVC3.js} +1 -1
- package/dist/chunk-MUBUQVC3.js.map +1 -0
- package/dist/{chunk-T4LKNY7T.js → chunk-NCE5NSN6.js} +166 -11
- package/dist/chunk-NCE5NSN6.js.map +1 -0
- package/dist/{chunk-YG2DO46P.js → chunk-OYMYCW7J.js} +18 -3
- package/dist/{chunk-YG2DO46P.js.map → chunk-OYMYCW7J.js.map} +1 -1
- package/dist/{chunk-Q53IYV2G.js → chunk-QVX5MWJZ.js} +20 -17
- package/dist/{chunk-Q53IYV2G.js.map → chunk-QVX5MWJZ.js.map} +1 -1
- package/dist/{chunk-CUWUHTIL.js → chunk-RBJPAZFI.js} +16 -202
- package/dist/chunk-RBJPAZFI.js.map +1 -0
- package/dist/chunk-RRN3YTK7.js +6199 -0
- package/dist/chunk-RRN3YTK7.js.map +1 -0
- package/dist/chunk-RY4XKNV3.js +140 -0
- package/dist/chunk-RY4XKNV3.js.map +1 -0
- package/dist/chunk-S3IGX57D.js +14682 -0
- package/dist/chunk-S3IGX57D.js.map +1 -0
- package/dist/chunk-TLCMMYLY.js +126 -0
- package/dist/chunk-TLCMMYLY.js.map +1 -0
- package/dist/{chunk-IPOWB3G3.js → chunk-UGX7YPX2.js} +3314 -306
- package/dist/chunk-UGX7YPX2.js.map +1 -0
- package/dist/chunk-UO22YNY4.js +69 -0
- package/dist/chunk-UO22YNY4.js.map +1 -0
- package/dist/{config-CEFTL5ZL.js → chunk-XHC6FCGZ.js} +115 -18
- package/dist/chunk-XHC6FCGZ.js.map +1 -0
- package/dist/chunk-XJIW7USF.js +217 -0
- package/dist/chunk-XJIW7USF.js.map +1 -0
- package/dist/{chunk-BRJHUQSY.js → chunk-YALGASEU.js} +1548 -1452
- package/dist/chunk-YALGASEU.js.map +1 -0
- package/dist/{chunk-DXPYFVKG.js → chunk-YN5SHIXQ.js} +6 -6
- package/dist/chunk-YN5SHIXQ.js.map +1 -0
- package/dist/chunk-Z52RA3NC.js +137 -0
- package/dist/chunk-Z52RA3NC.js.map +1 -0
- package/dist/{chunk-EXBMF5X7.js → chunk-Z6MFJV5Z.js} +151 -19
- package/dist/chunk-Z6MFJV5Z.js.map +1 -0
- package/dist/chunk-ZABPQJ3M.js +83 -0
- package/dist/chunk-ZABPQJ3M.js.map +1 -0
- package/dist/{chunk-LPRVHM7P.js → chunk-ZMHYXMO6.js} +1655 -114
- package/dist/chunk-ZMHYXMO6.js.map +1 -0
- package/dist/{chunk-3IMLRUZE.js → chunk-ZXTAQYNA.js} +6 -2
- package/dist/{cli-WA65NP4Y.js → cli-SBXI5AMS.js} +177 -177
- package/dist/cli-SBXI5AMS.js.map +1 -0
- package/dist/config-VELDKLHY.js +21 -0
- package/dist/doctor-T3KWNNP2.js +20 -0
- package/dist/doctor-T3KWNNP2.js.map +1 -0
- package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js +18 -0
- package/dist/ethersCompat-Df4a6QIZ-3YZIAXDK.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/inspect-LMKOXE4Y.js +96 -0
- package/dist/inspect-LMKOXE4Y.js.map +1 -0
- package/dist/install-LEX3ENQ6.js +387 -0
- package/dist/install-LEX3ENQ6.js.map +1 -0
- package/dist/lookup-ZPN2Q67N.js +129 -0
- package/dist/lookup-ZPN2Q67N.js.map +1 -0
- package/dist/{mine.wasm-GQECMSGN.js → mine.wasm-6PIT3DK6.js} +2 -2
- package/dist/outcome-N7TAK6WR.js +66 -0
- package/dist/outcome-N7TAK6WR.js.map +1 -0
- package/dist/publish-BKBQQAW4.js +1478 -0
- package/dist/publish-BKBQQAW4.js.map +1 -0
- package/dist/{secp256k1-BEZS642W.js → secp256k1-N3ZHU7LB.js} +5 -4
- package/dist/secp256k1-N3ZHU7LB.js.map +1 -0
- package/dist/usdc-JIAJW4SV.js +22 -0
- package/dist/usdc-JIAJW4SV.js.map +1 -0
- package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js +14 -0
- package/dist/viemAdapter-By13KInL-ZZE6UV4Y.js.map +1 -0
- package/dist/{wallet-XD576HF3.js → wallet-CWEMYVIH.js} +28 -22
- package/dist/{wallet-XD576HF3.js.map → wallet-CWEMYVIH.js.map} +1 -1
- package/dist/wallet-PA54CRBL.js +30 -0
- package/dist/wallet-PA54CRBL.js.map +1 -0
- package/package.json +19 -16
- package/skills/tenjin/SKILL.md +199 -0
- package/skills/tenjin-publish/SKILL.md +111 -0
- package/skills/tenjin-search/SKILL.md +133 -0
- package/dist/chunk-BRJHUQSY.js.map +0 -1
- package/dist/chunk-CUWUHTIL.js.map +0 -1
- package/dist/chunk-DXPYFVKG.js.map +0 -1
- package/dist/chunk-EXBMF5X7.js.map +0 -1
- package/dist/chunk-EZROUI5U.js.map +0 -1
- package/dist/chunk-IPOWB3G3.js.map +0 -1
- package/dist/chunk-LPRVHM7P.js.map +0 -1
- package/dist/chunk-T4LKNY7T.js.map +0 -1
- package/dist/chunk-ZPZFPVDN.js.map +0 -1
- package/dist/cli-WA65NP4Y.js.map +0 -1
- package/dist/config-CEFTL5ZL.js.map +0 -1
- package/dist/doctor-3QBYN46N.js.map +0 -1
- package/dist/usdc-44R6XZF2.js +0 -18
- package/dist/wallet-ELBTBMXO.js +0 -20
- /package/dist/{_esm-ZH2J4QEH.js.map → _esm-C5CRWCYU.js.map} +0 -0
- /package/dist/{ccip-UCLT5VOW.js.map → _esm-FEASBWRP.js.map} +0 -0
- /package/dist/{chunk-3IMLRUZE.js.map → ccip-NQXCEK2U.js.map} +0 -0
- /package/dist/{secp256k1-BEZS642W.js.map → ccip-XR5NE5QK.js.map} +0 -0
- /package/dist/{usdc-44R6XZF2.js.map → chunk-ZXTAQYNA.js.map} +0 -0
- /package/dist/{wallet-ELBTBMXO.js.map → config-VELDKLHY.js.map} +0 -0
- /package/dist/{mine.wasm-GQECMSGN.js.map → mine.wasm-6PIT3DK6.js.map} +0 -0
|
@@ -1,149 +1,13 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
-
// node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/cryptoNode.js
|
|
4
|
-
import * as nc from "crypto";
|
|
5
|
-
var crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && "randomBytes" in nc ? nc : void 0;
|
|
6
|
-
|
|
7
|
-
// node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
|
|
8
|
-
function isBytes(a) {
|
|
9
|
-
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
10
|
-
}
|
|
11
|
-
function anumber(n) {
|
|
12
|
-
if (!Number.isSafeInteger(n) || n < 0)
|
|
13
|
-
throw new Error("positive integer expected, got " + n);
|
|
14
|
-
}
|
|
15
|
-
function abytes(b, ...lengths) {
|
|
16
|
-
if (!isBytes(b))
|
|
17
|
-
throw new Error("Uint8Array expected");
|
|
18
|
-
if (lengths.length > 0 && !lengths.includes(b.length))
|
|
19
|
-
throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
|
|
20
|
-
}
|
|
21
|
-
function ahash(h) {
|
|
22
|
-
if (typeof h !== "function" || typeof h.create !== "function")
|
|
23
|
-
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
24
|
-
anumber(h.outputLen);
|
|
25
|
-
anumber(h.blockLen);
|
|
26
|
-
}
|
|
27
|
-
function aexists(instance, checkFinished = true) {
|
|
28
|
-
if (instance.destroyed)
|
|
29
|
-
throw new Error("Hash instance has been destroyed");
|
|
30
|
-
if (checkFinished && instance.finished)
|
|
31
|
-
throw new Error("Hash#digest() has already been called");
|
|
32
|
-
}
|
|
33
|
-
function aoutput(out, instance) {
|
|
34
|
-
abytes(out);
|
|
35
|
-
const min = instance.outputLen;
|
|
36
|
-
if (out.length < min) {
|
|
37
|
-
throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function u32(arr) {
|
|
41
|
-
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
|
42
|
-
}
|
|
43
|
-
function clean(...arrays) {
|
|
44
|
-
for (let i = 0; i < arrays.length; i++) {
|
|
45
|
-
arrays[i].fill(0);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function createView(arr) {
|
|
49
|
-
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
50
|
-
}
|
|
51
|
-
function rotr(word, shift) {
|
|
52
|
-
return word << 32 - shift | word >>> shift;
|
|
53
|
-
}
|
|
54
|
-
function rotl(word, shift) {
|
|
55
|
-
return word << shift | word >>> 32 - shift >>> 0;
|
|
56
|
-
}
|
|
57
|
-
var isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
|
|
58
|
-
function byteSwap(word) {
|
|
59
|
-
return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
|
|
60
|
-
}
|
|
61
|
-
function byteSwap32(arr) {
|
|
62
|
-
for (let i = 0; i < arr.length; i++) {
|
|
63
|
-
arr[i] = byteSwap(arr[i]);
|
|
64
|
-
}
|
|
65
|
-
return arr;
|
|
66
|
-
}
|
|
67
|
-
var swap32IfBE = isLE ? (u) => u : byteSwap32;
|
|
68
|
-
var nextTick = async () => {
|
|
69
|
-
};
|
|
70
|
-
async function asyncLoop(iters, tick, cb) {
|
|
71
|
-
let ts = Date.now();
|
|
72
|
-
for (let i = 0; i < iters; i++) {
|
|
73
|
-
cb(i);
|
|
74
|
-
const diff = Date.now() - ts;
|
|
75
|
-
if (diff >= 0 && diff < tick)
|
|
76
|
-
continue;
|
|
77
|
-
await nextTick();
|
|
78
|
-
ts += diff;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function utf8ToBytes(str) {
|
|
82
|
-
if (typeof str !== "string")
|
|
83
|
-
throw new Error("string expected");
|
|
84
|
-
return new Uint8Array(new TextEncoder().encode(str));
|
|
85
|
-
}
|
|
86
|
-
function toBytes(data) {
|
|
87
|
-
if (typeof data === "string")
|
|
88
|
-
data = utf8ToBytes(data);
|
|
89
|
-
abytes(data);
|
|
90
|
-
return data;
|
|
91
|
-
}
|
|
92
|
-
function kdfInputToBytes(data) {
|
|
93
|
-
if (typeof data === "string")
|
|
94
|
-
data = utf8ToBytes(data);
|
|
95
|
-
abytes(data);
|
|
96
|
-
return data;
|
|
97
|
-
}
|
|
98
|
-
function concatBytes(...arrays) {
|
|
99
|
-
let sum = 0;
|
|
100
|
-
for (let i = 0; i < arrays.length; i++) {
|
|
101
|
-
const a = arrays[i];
|
|
102
|
-
abytes(a);
|
|
103
|
-
sum += a.length;
|
|
104
|
-
}
|
|
105
|
-
const res = new Uint8Array(sum);
|
|
106
|
-
for (let i = 0, pad = 0; i < arrays.length; i++) {
|
|
107
|
-
const a = arrays[i];
|
|
108
|
-
res.set(a, pad);
|
|
109
|
-
pad += a.length;
|
|
110
|
-
}
|
|
111
|
-
return res;
|
|
112
|
-
}
|
|
113
|
-
function checkOpts(defaults, opts) {
|
|
114
|
-
if (opts !== void 0 && {}.toString.call(opts) !== "[object Object]")
|
|
115
|
-
throw new Error("options should be object or undefined");
|
|
116
|
-
const merged = Object.assign(defaults, opts);
|
|
117
|
-
return merged;
|
|
118
|
-
}
|
|
119
|
-
var Hash = class {
|
|
120
|
-
};
|
|
121
|
-
function createHasher(hashCons) {
|
|
122
|
-
const hashC = (msg) => hashCons().update(toBytes(msg)).digest();
|
|
123
|
-
const tmp = hashCons();
|
|
124
|
-
hashC.outputLen = tmp.outputLen;
|
|
125
|
-
hashC.blockLen = tmp.blockLen;
|
|
126
|
-
hashC.create = () => hashCons();
|
|
127
|
-
return hashC;
|
|
128
|
-
}
|
|
129
|
-
function randomBytes(bytesLength = 32) {
|
|
130
|
-
if (crypto && typeof crypto.getRandomValues === "function") {
|
|
131
|
-
return crypto.getRandomValues(new Uint8Array(bytesLength));
|
|
132
|
-
}
|
|
133
|
-
if (crypto && typeof crypto.randomBytes === "function") {
|
|
134
|
-
return Uint8Array.from(crypto.randomBytes(bytesLength));
|
|
135
|
-
}
|
|
136
|
-
throw new Error("crypto.getRandomValues must be defined");
|
|
137
|
-
}
|
|
138
|
-
|
|
139
3
|
// node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/abstract/utils.js
|
|
140
4
|
var _0n = /* @__PURE__ */ BigInt(0);
|
|
141
5
|
var _1n = /* @__PURE__ */ BigInt(1);
|
|
142
|
-
function
|
|
6
|
+
function isBytes(a) {
|
|
143
7
|
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
144
8
|
}
|
|
145
|
-
function
|
|
146
|
-
if (!
|
|
9
|
+
function abytes(item) {
|
|
10
|
+
if (!isBytes(item))
|
|
147
11
|
throw new Error("Uint8Array expected");
|
|
148
12
|
}
|
|
149
13
|
function abool(title, value) {
|
|
@@ -165,7 +29,7 @@ var hasHexBuiltin = (
|
|
|
165
29
|
);
|
|
166
30
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
167
31
|
function bytesToHex(bytes) {
|
|
168
|
-
|
|
32
|
+
abytes(bytes);
|
|
169
33
|
if (hasHexBuiltin)
|
|
170
34
|
return bytes.toHex();
|
|
171
35
|
let hex = "";
|
|
@@ -209,7 +73,7 @@ function bytesToNumberBE(bytes) {
|
|
|
209
73
|
return hexToNumber(bytesToHex(bytes));
|
|
210
74
|
}
|
|
211
75
|
function bytesToNumberLE(bytes) {
|
|
212
|
-
|
|
76
|
+
abytes(bytes);
|
|
213
77
|
return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));
|
|
214
78
|
}
|
|
215
79
|
function numberToBytesBE(n, len) {
|
|
@@ -226,7 +90,7 @@ function ensureBytes(title, hex, expectedLength) {
|
|
|
226
90
|
} catch (e) {
|
|
227
91
|
throw new Error(title + " must be hex string or Uint8Array, cause: " + e);
|
|
228
92
|
}
|
|
229
|
-
} else if (
|
|
93
|
+
} else if (isBytes(hex)) {
|
|
230
94
|
res = Uint8Array.from(hex);
|
|
231
95
|
} else {
|
|
232
96
|
throw new Error(title + " must be hex string or Uint8Array");
|
|
@@ -236,11 +100,11 @@ function ensureBytes(title, hex, expectedLength) {
|
|
|
236
100
|
throw new Error(title + " of length " + expectedLength + " expected, got " + len);
|
|
237
101
|
return res;
|
|
238
102
|
}
|
|
239
|
-
function
|
|
103
|
+
function concatBytes(...arrays) {
|
|
240
104
|
let sum = 0;
|
|
241
105
|
for (let i = 0; i < arrays.length; i++) {
|
|
242
106
|
const a = arrays[i];
|
|
243
|
-
|
|
107
|
+
abytes(a);
|
|
244
108
|
sum += a.length;
|
|
245
109
|
}
|
|
246
110
|
const res = new Uint8Array(sum);
|
|
@@ -259,7 +123,7 @@ function equalBytes(a, b) {
|
|
|
259
123
|
diff |= a[i] ^ b[i];
|
|
260
124
|
return diff === 0;
|
|
261
125
|
}
|
|
262
|
-
function
|
|
126
|
+
function utf8ToBytes(str) {
|
|
263
127
|
if (typeof str !== "string")
|
|
264
128
|
throw new Error("string expected");
|
|
265
129
|
return new Uint8Array(new TextEncoder().encode(str));
|
|
@@ -316,7 +180,7 @@ function createHmacDrbg(hashLen, qByteLen, hmacFn) {
|
|
|
316
180
|
out.push(sl);
|
|
317
181
|
len += v.length;
|
|
318
182
|
}
|
|
319
|
-
return
|
|
183
|
+
return concatBytes(...out);
|
|
320
184
|
};
|
|
321
185
|
const genUntil = (seed, pred) => {
|
|
322
186
|
reset();
|
|
@@ -334,7 +198,7 @@ var validatorFns = {
|
|
|
334
198
|
function: (val) => typeof val === "function",
|
|
335
199
|
boolean: (val) => typeof val === "boolean",
|
|
336
200
|
string: (val) => typeof val === "string",
|
|
337
|
-
stringOrUint8Array: (val) => typeof val === "string" ||
|
|
201
|
+
stringOrUint8Array: (val) => typeof val === "string" || isBytes(val),
|
|
338
202
|
isSafeInteger: (val) => Number.isSafeInteger(val),
|
|
339
203
|
array: (val) => Array.isArray(val),
|
|
340
204
|
field: (val, object) => object.Fp.isValid(val),
|
|
@@ -370,51 +234,9 @@ function memoized(fn) {
|
|
|
370
234
|
};
|
|
371
235
|
}
|
|
372
236
|
|
|
373
|
-
// node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js
|
|
374
|
-
var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
375
|
-
var _32n = /* @__PURE__ */ BigInt(32);
|
|
376
|
-
function fromBig(n, le = false) {
|
|
377
|
-
if (le)
|
|
378
|
-
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
379
|
-
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
380
|
-
}
|
|
381
|
-
function split(lst, le = false) {
|
|
382
|
-
const len = lst.length;
|
|
383
|
-
let Ah = new Uint32Array(len);
|
|
384
|
-
let Al = new Uint32Array(len);
|
|
385
|
-
for (let i = 0; i < len; i++) {
|
|
386
|
-
const { h, l } = fromBig(lst[i], le);
|
|
387
|
-
[Ah[i], Al[i]] = [h, l];
|
|
388
|
-
}
|
|
389
|
-
return [Ah, Al];
|
|
390
|
-
}
|
|
391
|
-
var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
|
|
392
|
-
var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
393
|
-
var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
394
|
-
var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
395
|
-
|
|
396
237
|
export {
|
|
397
|
-
|
|
238
|
+
isBytes,
|
|
398
239
|
abytes,
|
|
399
|
-
ahash,
|
|
400
|
-
aexists,
|
|
401
|
-
aoutput,
|
|
402
|
-
u32,
|
|
403
|
-
clean,
|
|
404
|
-
createView,
|
|
405
|
-
rotr,
|
|
406
|
-
rotl,
|
|
407
|
-
swap32IfBE,
|
|
408
|
-
asyncLoop,
|
|
409
|
-
toBytes,
|
|
410
|
-
kdfInputToBytes,
|
|
411
|
-
concatBytes,
|
|
412
|
-
checkOpts,
|
|
413
|
-
Hash,
|
|
414
|
-
createHasher,
|
|
415
|
-
randomBytes,
|
|
416
|
-
isBytes2 as isBytes,
|
|
417
|
-
abytes2,
|
|
418
240
|
abool,
|
|
419
241
|
numberToHexUnpadded,
|
|
420
242
|
bytesToHex,
|
|
@@ -424,28 +246,20 @@ export {
|
|
|
424
246
|
numberToBytesBE,
|
|
425
247
|
numberToBytesLE,
|
|
426
248
|
ensureBytes,
|
|
427
|
-
|
|
249
|
+
concatBytes,
|
|
428
250
|
equalBytes,
|
|
429
|
-
|
|
251
|
+
utf8ToBytes,
|
|
430
252
|
inRange,
|
|
431
253
|
aInRange,
|
|
432
254
|
bitLen,
|
|
433
255
|
bitMask,
|
|
434
256
|
createHmacDrbg,
|
|
435
257
|
validateObject,
|
|
436
|
-
memoized
|
|
437
|
-
split,
|
|
438
|
-
rotlSH,
|
|
439
|
-
rotlSL,
|
|
440
|
-
rotlBH,
|
|
441
|
-
rotlBL
|
|
258
|
+
memoized
|
|
442
259
|
};
|
|
443
260
|
/*! Bundled license information:
|
|
444
261
|
|
|
445
|
-
@noble/hashes/esm/utils.js:
|
|
446
|
-
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
447
|
-
|
|
448
262
|
@noble/curves/esm/abstract/utils.js:
|
|
449
263
|
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
450
264
|
*/
|
|
451
|
-
//# sourceMappingURL=chunk-
|
|
265
|
+
//# sourceMappingURL=chunk-RBJPAZFI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/src/abstract/utils.ts"],"sourcesContent":["/**\n * Hex, bytes and number utilities.\n * @module\n */\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nexport type Hex = Uint8Array | string; // hex strings are accepted for simplicity\nexport type PrivKey = Hex | bigint; // bigints are accepted to ease learning curve\nexport type CHash = {\n (message: Uint8Array | string): Uint8Array;\n blockLen: number;\n outputLen: number;\n create(opts?: { dkLen?: number }): any; // For shake\n};\nexport type FHash = (message: Uint8Array | string) => Uint8Array;\n\nexport function isBytes(a: unknown): a is Uint8Array {\n return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array');\n}\n\nexport function abytes(item: unknown): void {\n if (!isBytes(item)) throw new Error('Uint8Array expected');\n}\n\nexport function abool(title: string, value: boolean): void {\n if (typeof value !== 'boolean') throw new Error(title + ' boolean expected, got ' + value);\n}\n\n// Used in weierstrass, der\nexport function numberToHexUnpadded(num: number | bigint): string {\n const hex = num.toString(16);\n return hex.length & 1 ? '0' + hex : hex;\n}\n\nexport function hexToNumber(hex: string): bigint {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n return hex === '' ? _0n : BigInt('0x' + hex); // Big Endian\n}\n\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin: boolean =\n // @ts-ignore\n typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function';\n\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) =>\n i.toString(16).padStart(2, '0')\n);\n\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin) return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;\nfunction asciiToBase16(ch: number): number | undefined {\n if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex: string): Uint8Array {\n if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);\n // @ts-ignore\n if (hasHexBuiltin) return Uint8Array.fromHex(hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes: Uint8Array): bigint {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes: Uint8Array): bigint {\n abytes(bytes);\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\n\nexport function numberToBytesBE(n: number | bigint, len: number): Uint8Array {\n return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n: number | bigint, len: number): Uint8Array {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n: number | bigint): Uint8Array {\n return hexToBytes(numberToHexUnpadded(n));\n}\n\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title: string, hex: Hex, expectedLength?: number): Uint8Array {\n let res: Uint8Array;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n } catch (e) {\n throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e);\n }\n } else if (isBytes(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n } else {\n throw new Error(title + ' must be hex string or Uint8Array');\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len);\n return res;\n}\n\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays: Uint8Array[]): Uint8Array {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n\n// Compares 2 u8a-s in kinda constant time\nexport function equalBytes(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i];\n return diff === 0;\n}\n\n// Global symbols in both browsers and Node.js since v11\n// See https://github.com/microsoft/TypeScript/issues/31535\ndeclare const TextEncoder: any;\n\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str: string): Uint8Array {\n if (typeof str !== 'string') throw new Error('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n\n// Is positive bigint\nconst isPosBig = (n: bigint) => typeof n === 'bigint' && _0n <= n;\n\nexport function inRange(n: bigint, min: bigint, max: bigint): boolean {\n return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;\n}\n\n/**\n * Asserts min <= n < max. NOTE: It's < max and not <= max.\n * @example\n * aInRange('x', x, 1n, 256n); // would assume x is in (1n..255n)\n */\nexport function aInRange(title: string, n: bigint, min: bigint, max: bigint): void {\n // Why min <= n < max and not a (min < n < max) OR b (min <= n <= max)?\n // consider P=256n, min=0n, max=P\n // - a for min=0 would require -1: `inRange('x', x, -1n, P)`\n // - b would commonly require subtraction: `inRange('x', x, 0n, P - 1n)`\n // - our way is the cleanest: `inRange('x', x, 0n, P)\n if (!inRange(n, min, max))\n throw new Error('expected valid ' + title + ': ' + min + ' <= n < ' + max + ', got ' + n);\n}\n\n// Bit operations\n\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n * TODO: merge with nLength in modular\n */\nexport function bitLen(n: bigint): number {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1);\n return len;\n}\n\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n: bigint, pos: number): bigint {\n return (n >> BigInt(pos)) & _1n;\n}\n\n/**\n * Sets single bit at position.\n */\nexport function bitSet(n: bigint, pos: number, value: boolean): bigint {\n return n | ((value ? _1n : _0n) << BigInt(pos));\n}\n\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n: number): bigint => (_1n << BigInt(n)) - _1n;\n\n// DRBG\n\nconst u8n = (len: number) => new Uint8Array(len); // creates Uint8Array\nconst u8fr = (arr: ArrayLike<number>) => Uint8Array.from(arr); // another shortcut\ntype Pred<T> = (v: Uint8Array) => T | undefined;\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG<Key>(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg<T>(\n hashLen: number,\n qByteLen: number,\n hmacFn: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array\n): (seed: Uint8Array, predicate: Pred<T>) => T {\n if (typeof hashLen !== 'number' || hashLen < 2) throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2) throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function') throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b: Uint8Array[]) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n(0)) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0) return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000) throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out: Uint8Array[] = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed: Uint8Array, pred: Pred<T>): T => {\n reset();\n reseed(seed); // Steps D-G\n let res: T | undefined = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen()))) reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n\n// Validating curves and fields\n\nconst validatorFns = {\n bigint: (val: any): boolean => typeof val === 'bigint',\n function: (val: any): boolean => typeof val === 'function',\n boolean: (val: any): boolean => typeof val === 'boolean',\n string: (val: any): boolean => typeof val === 'string',\n stringOrUint8Array: (val: any): boolean => typeof val === 'string' || isBytes(val),\n isSafeInteger: (val: any): boolean => Number.isSafeInteger(val),\n array: (val: any): boolean => Array.isArray(val),\n field: (val: any, object: any): any => (object as any).Fp.isValid(val),\n hash: (val: any): boolean => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n} as const;\ntype Validator = keyof typeof validatorFns;\ntype ValMap<T extends Record<string, any>> = { [K in keyof T]?: Validator };\n// type Record<K extends string | number | symbol, T> = { [P in K]: T; }\n\nexport function validateObject<T extends Record<string, any>>(\n object: T,\n validators: ValMap<T>,\n optValidators: ValMap<T> = {}\n): T {\n const checkField = (fieldName: keyof T, type: Validator, isOptional: boolean) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function') throw new Error('invalid validator function');\n\n const val = object[fieldName as keyof typeof object];\n if (isOptional && val === undefined) return;\n if (!checkVal(val, object)) {\n throw new Error(\n 'param ' + String(fieldName) + ' is invalid. Expected ' + type + ', got ' + val\n );\n }\n };\n for (const [fieldName, type] of Object.entries(validators)) checkField(fieldName, type!, false);\n for (const [fieldName, type] of Object.entries(optValidators)) checkField(fieldName, type!, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n\n/**\n * throws not implemented error\n */\nexport const notImplemented = (): never => {\n throw new Error('not implemented');\n};\n\n/**\n * Memoizes (caches) computation result.\n * Uses WeakMap: the value is going auto-cleaned by GC after last reference is removed.\n */\nexport function memoized<T extends object, R, O extends any[]>(\n fn: (arg: T, ...args: O) => R\n): (arg: T, ...args: O) => R {\n const map = new WeakMap<T, R>();\n return (arg: T, ...args: O): R => {\n const val = map.get(arg);\n if (val !== undefined) return val;\n const computed = fn(arg, ...args);\n map.set(arg, computed);\n return computed;\n };\n}\n"],"mappings":";;;AAUA,IAAM,MAAsB,uBAAO,CAAC;AACpC,IAAM,MAAsB,uBAAO,CAAC;AAW9B,SAAU,QAAQ,GAAU;AAChC,SAAO,aAAa,cAAe,YAAY,OAAO,CAAC,KAAK,EAAE,YAAY,SAAS;AACrF;AAEM,SAAU,OAAO,MAAa;AAClC,MAAI,CAAC,QAAQ,IAAI;AAAG,UAAM,IAAI,MAAM,qBAAqB;AAC3D;AAEM,SAAU,MAAM,OAAe,OAAc;AACjD,MAAI,OAAO,UAAU;AAAW,UAAM,IAAI,MAAM,QAAQ,4BAA4B,KAAK;AAC3F;AAGM,SAAU,oBAAoB,KAAoB;AACtD,QAAM,MAAM,IAAI,SAAS,EAAE;AAC3B,SAAO,IAAI,SAAS,IAAI,MAAM,MAAM;AACtC;AAEM,SAAU,YAAY,KAAW;AACrC,MAAI,OAAO,QAAQ;AAAU,UAAM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