@capxul/mcp 4.20.0-beta.34 → 4.20.0-beta.35
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/main.mjs +3 -25
- package/dist/{organizations-Cd8Dc62C.mjs → organizations-BsF9_r6L.mjs} +915 -365
- package/dist/{permission-approvals-CCCJ2aYL.mjs → permission-approvals-5ayOO0fo.mjs} +1 -1
- package/dist/secp256k1-CLeVBma1.mjs +2 -0
- package/dist/{secp256k1-b-_IancF.mjs → secp256k1-vkvPWdOZ.mjs} +2 -296
- package/dist/sha2-D5rBHwg7.mjs +422 -0
- package/package.json +3 -3
- package/dist/secp256k1-BSimfttS.mjs +0 -2
- package/dist/utils-CenTnkL6.mjs +0 -128
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Gn as CapxulError, H as asCapxulError, R as abandonPrepared, Wn as Errors, a as prepareConfiguration, d as verifiedPreparation, f as buildCommand, i as authorInvitation, l as preparePermission, mt as CAPXUL_OPERATIONS, nn as absurd, o as verifiedConfiguration, p as validateReplacementInput, u as preparedIdentity } from "./organizations-
|
|
1
|
+
import { Gn as CapxulError, H as asCapxulError, R as abandonPrepared, Wn as Errors, a as prepareConfiguration, d as verifiedPreparation, f as buildCommand, i as authorInvitation, l as preparePermission, mt as CAPXUL_OPERATIONS, nn as absurd, o as verifiedConfiguration, p as validateReplacementInput, u as preparedIdentity } from "./organizations-BsF9_r6L.mjs";
|
|
2
2
|
//#region ../../packages/sdk/src/accounts/permission-approvals.ts
|
|
3
3
|
/** Prepare a Permission write or an invitation's configuration for `signerAddress`, checked. */
|
|
4
4
|
function prepareVerifiedPermissionChange(deps, input, signerAddress, signal) {
|
|
@@ -1,298 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
|
|
3
|
-
/**
|
|
4
|
-
* Internal Merkle-Damgard hash utils.
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */
|
|
8
|
-
function setBigUint64(view, byteOffset, value, isLE) {
|
|
9
|
-
if (typeof view.setBigUint64 === "function") return view.setBigUint64(byteOffset, value, isLE);
|
|
10
|
-
const _32n = BigInt(32);
|
|
11
|
-
const _u32_max = BigInt(4294967295);
|
|
12
|
-
const wh = Number(value >> _32n & _u32_max);
|
|
13
|
-
const wl = Number(value & _u32_max);
|
|
14
|
-
const h = isLE ? 4 : 0;
|
|
15
|
-
const l = isLE ? 0 : 4;
|
|
16
|
-
view.setUint32(byteOffset + h, wh, isLE);
|
|
17
|
-
view.setUint32(byteOffset + l, wl, isLE);
|
|
18
|
-
}
|
|
19
|
-
/** Choice: a ? b : c */
|
|
20
|
-
function Chi(a, b, c) {
|
|
21
|
-
return a & b ^ ~a & c;
|
|
22
|
-
}
|
|
23
|
-
/** Majority function, true if any two inputs is true. */
|
|
24
|
-
function Maj(a, b, c) {
|
|
25
|
-
return a & b ^ a & c ^ b & c;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Merkle-Damgard hash construction base class.
|
|
29
|
-
* Could be used to create MD5, RIPEMD, SHA1, SHA2.
|
|
30
|
-
*/
|
|
31
|
-
var HashMD = class extends Hash {
|
|
32
|
-
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
33
|
-
super();
|
|
34
|
-
this.finished = false;
|
|
35
|
-
this.length = 0;
|
|
36
|
-
this.pos = 0;
|
|
37
|
-
this.destroyed = false;
|
|
38
|
-
this.blockLen = blockLen;
|
|
39
|
-
this.outputLen = outputLen;
|
|
40
|
-
this.padOffset = padOffset;
|
|
41
|
-
this.isLE = isLE;
|
|
42
|
-
this.buffer = new Uint8Array(blockLen);
|
|
43
|
-
this.view = createView(this.buffer);
|
|
44
|
-
}
|
|
45
|
-
update(data) {
|
|
46
|
-
aexists(this);
|
|
47
|
-
data = toBytes(data);
|
|
48
|
-
abytes$1(data);
|
|
49
|
-
const { view, buffer, blockLen } = this;
|
|
50
|
-
const len = data.length;
|
|
51
|
-
for (let pos = 0; pos < len;) {
|
|
52
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
|
53
|
-
if (take === blockLen) {
|
|
54
|
-
const dataView = createView(data);
|
|
55
|
-
for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
59
|
-
this.pos += take;
|
|
60
|
-
pos += take;
|
|
61
|
-
if (this.pos === blockLen) {
|
|
62
|
-
this.process(view, 0);
|
|
63
|
-
this.pos = 0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
this.length += data.length;
|
|
67
|
-
this.roundClean();
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
digestInto(out) {
|
|
71
|
-
aexists(this);
|
|
72
|
-
aoutput(out, this);
|
|
73
|
-
this.finished = true;
|
|
74
|
-
const { buffer, view, blockLen, isLE } = this;
|
|
75
|
-
let { pos } = this;
|
|
76
|
-
buffer[pos++] = 128;
|
|
77
|
-
clean(this.buffer.subarray(pos));
|
|
78
|
-
if (this.padOffset > blockLen - pos) {
|
|
79
|
-
this.process(view, 0);
|
|
80
|
-
pos = 0;
|
|
81
|
-
}
|
|
82
|
-
for (let i = pos; i < blockLen; i++) buffer[i] = 0;
|
|
83
|
-
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);
|
|
84
|
-
this.process(view, 0);
|
|
85
|
-
const oview = createView(out);
|
|
86
|
-
const len = this.outputLen;
|
|
87
|
-
if (len % 4) throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
88
|
-
const outLen = len / 4;
|
|
89
|
-
const state = this.get();
|
|
90
|
-
if (outLen > state.length) throw new Error("_sha2: outputLen bigger than state");
|
|
91
|
-
for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);
|
|
92
|
-
}
|
|
93
|
-
digest() {
|
|
94
|
-
const { buffer, outputLen } = this;
|
|
95
|
-
this.digestInto(buffer);
|
|
96
|
-
const res = buffer.slice(0, outputLen);
|
|
97
|
-
this.destroy();
|
|
98
|
-
return res;
|
|
99
|
-
}
|
|
100
|
-
_cloneInto(to) {
|
|
101
|
-
to || (to = new this.constructor());
|
|
102
|
-
to.set(...this.get());
|
|
103
|
-
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
|
104
|
-
to.destroyed = destroyed;
|
|
105
|
-
to.finished = finished;
|
|
106
|
-
to.length = length;
|
|
107
|
-
to.pos = pos;
|
|
108
|
-
if (length % blockLen) to.buffer.set(buffer);
|
|
109
|
-
return to;
|
|
110
|
-
}
|
|
111
|
-
clone() {
|
|
112
|
-
return this._cloneInto();
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.
|
|
117
|
-
* Check out `test/misc/sha2-gen-iv.js` for recomputation guide.
|
|
118
|
-
*/
|
|
119
|
-
/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */
|
|
120
|
-
const SHA256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
121
|
-
1779033703,
|
|
122
|
-
3144134277,
|
|
123
|
-
1013904242,
|
|
124
|
-
2773480762,
|
|
125
|
-
1359893119,
|
|
126
|
-
2600822924,
|
|
127
|
-
528734635,
|
|
128
|
-
1541459225
|
|
129
|
-
]);
|
|
130
|
-
//#endregion
|
|
131
|
-
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js
|
|
132
|
-
/**
|
|
133
|
-
* SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.
|
|
134
|
-
* SHA256 is the fastest hash implementable in JS, even faster than Blake3.
|
|
135
|
-
* Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and
|
|
136
|
-
* [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).
|
|
137
|
-
* @module
|
|
138
|
-
*/
|
|
139
|
-
/**
|
|
140
|
-
* Round constants:
|
|
141
|
-
* First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)
|
|
142
|
-
*/
|
|
143
|
-
const SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
|
144
|
-
1116352408,
|
|
145
|
-
1899447441,
|
|
146
|
-
3049323471,
|
|
147
|
-
3921009573,
|
|
148
|
-
961987163,
|
|
149
|
-
1508970993,
|
|
150
|
-
2453635748,
|
|
151
|
-
2870763221,
|
|
152
|
-
3624381080,
|
|
153
|
-
310598401,
|
|
154
|
-
607225278,
|
|
155
|
-
1426881987,
|
|
156
|
-
1925078388,
|
|
157
|
-
2162078206,
|
|
158
|
-
2614888103,
|
|
159
|
-
3248222580,
|
|
160
|
-
3835390401,
|
|
161
|
-
4022224774,
|
|
162
|
-
264347078,
|
|
163
|
-
604807628,
|
|
164
|
-
770255983,
|
|
165
|
-
1249150122,
|
|
166
|
-
1555081692,
|
|
167
|
-
1996064986,
|
|
168
|
-
2554220882,
|
|
169
|
-
2821834349,
|
|
170
|
-
2952996808,
|
|
171
|
-
3210313671,
|
|
172
|
-
3336571891,
|
|
173
|
-
3584528711,
|
|
174
|
-
113926993,
|
|
175
|
-
338241895,
|
|
176
|
-
666307205,
|
|
177
|
-
773529912,
|
|
178
|
-
1294757372,
|
|
179
|
-
1396182291,
|
|
180
|
-
1695183700,
|
|
181
|
-
1986661051,
|
|
182
|
-
2177026350,
|
|
183
|
-
2456956037,
|
|
184
|
-
2730485921,
|
|
185
|
-
2820302411,
|
|
186
|
-
3259730800,
|
|
187
|
-
3345764771,
|
|
188
|
-
3516065817,
|
|
189
|
-
3600352804,
|
|
190
|
-
4094571909,
|
|
191
|
-
275423344,
|
|
192
|
-
430227734,
|
|
193
|
-
506948616,
|
|
194
|
-
659060556,
|
|
195
|
-
883997877,
|
|
196
|
-
958139571,
|
|
197
|
-
1322822218,
|
|
198
|
-
1537002063,
|
|
199
|
-
1747873779,
|
|
200
|
-
1955562222,
|
|
201
|
-
2024104815,
|
|
202
|
-
2227730452,
|
|
203
|
-
2361852424,
|
|
204
|
-
2428436474,
|
|
205
|
-
2756734187,
|
|
206
|
-
3204031479,
|
|
207
|
-
3329325298
|
|
208
|
-
]);
|
|
209
|
-
/** Reusable temporary buffer. "W" comes straight from spec. */
|
|
210
|
-
const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
211
|
-
var SHA256 = class extends HashMD {
|
|
212
|
-
constructor(outputLen = 32) {
|
|
213
|
-
super(64, outputLen, 8, false);
|
|
214
|
-
this.A = SHA256_IV[0] | 0;
|
|
215
|
-
this.B = SHA256_IV[1] | 0;
|
|
216
|
-
this.C = SHA256_IV[2] | 0;
|
|
217
|
-
this.D = SHA256_IV[3] | 0;
|
|
218
|
-
this.E = SHA256_IV[4] | 0;
|
|
219
|
-
this.F = SHA256_IV[5] | 0;
|
|
220
|
-
this.G = SHA256_IV[6] | 0;
|
|
221
|
-
this.H = SHA256_IV[7] | 0;
|
|
222
|
-
}
|
|
223
|
-
get() {
|
|
224
|
-
const { A, B, C, D, E, F, G, H } = this;
|
|
225
|
-
return [
|
|
226
|
-
A,
|
|
227
|
-
B,
|
|
228
|
-
C,
|
|
229
|
-
D,
|
|
230
|
-
E,
|
|
231
|
-
F,
|
|
232
|
-
G,
|
|
233
|
-
H
|
|
234
|
-
];
|
|
235
|
-
}
|
|
236
|
-
set(A, B, C, D, E, F, G, H) {
|
|
237
|
-
this.A = A | 0;
|
|
238
|
-
this.B = B | 0;
|
|
239
|
-
this.C = C | 0;
|
|
240
|
-
this.D = D | 0;
|
|
241
|
-
this.E = E | 0;
|
|
242
|
-
this.F = F | 0;
|
|
243
|
-
this.G = G | 0;
|
|
244
|
-
this.H = H | 0;
|
|
245
|
-
}
|
|
246
|
-
process(view, offset) {
|
|
247
|
-
for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);
|
|
248
|
-
for (let i = 16; i < 64; i++) {
|
|
249
|
-
const W15 = SHA256_W[i - 15];
|
|
250
|
-
const W2 = SHA256_W[i - 2];
|
|
251
|
-
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
252
|
-
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
253
|
-
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
254
|
-
}
|
|
255
|
-
let { A, B, C, D, E, F, G, H } = this;
|
|
256
|
-
for (let i = 0; i < 64; i++) {
|
|
257
|
-
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
258
|
-
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
259
|
-
const T2 = (rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22)) + Maj(A, B, C) | 0;
|
|
260
|
-
H = G;
|
|
261
|
-
G = F;
|
|
262
|
-
F = E;
|
|
263
|
-
E = D + T1 | 0;
|
|
264
|
-
D = C;
|
|
265
|
-
C = B;
|
|
266
|
-
B = A;
|
|
267
|
-
A = T1 + T2 | 0;
|
|
268
|
-
}
|
|
269
|
-
A = A + this.A | 0;
|
|
270
|
-
B = B + this.B | 0;
|
|
271
|
-
C = C + this.C | 0;
|
|
272
|
-
D = D + this.D | 0;
|
|
273
|
-
E = E + this.E | 0;
|
|
274
|
-
F = F + this.F | 0;
|
|
275
|
-
G = G + this.G | 0;
|
|
276
|
-
H = H + this.H | 0;
|
|
277
|
-
this.set(A, B, C, D, E, F, G, H);
|
|
278
|
-
}
|
|
279
|
-
roundClean() {
|
|
280
|
-
clean(SHA256_W);
|
|
281
|
-
}
|
|
282
|
-
destroy() {
|
|
283
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
284
|
-
clean(this.buffer);
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
/**
|
|
288
|
-
* SHA2-256 hash function from RFC 4634.
|
|
289
|
-
*
|
|
290
|
-
* It is the fastest JS hash, even faster than Blake3.
|
|
291
|
-
* To break sha256 using birthday attack, attackers need to try 2^128 hashes.
|
|
292
|
-
* BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
|
|
293
|
-
*/
|
|
294
|
-
const sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
|
|
295
|
-
//#endregion
|
|
1
|
+
import { a as ahash, c as clean, d as randomBytes, i as aexists, l as concatBytes$1, n as Hash, o as anumber, p as toBytes, r as abytes$1, t as sha256 } from "./sha2-D5rBHwg7.mjs";
|
|
296
2
|
//#region ../../node_modules/.pnpm/@noble+curves@1.9.1/node_modules/@noble/curves/esm/abstract/utils.js
|
|
297
3
|
/**
|
|
298
4
|
* Hex, bytes and number utilities.
|
|
@@ -2214,4 +1920,4 @@ const secp256k1 = createCurve({
|
|
|
2214
1920
|
}
|
|
2215
1921
|
}, sha256);
|
|
2216
1922
|
//#endregion
|
|
2217
|
-
export {
|
|
1923
|
+
export { secp256k1 as t };
|