@calimero-network/mero-js 35.0.0 → 35.1.0
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/client/recovery-key.d.ts +2 -0
- package/dist/client/recovery-key.js +2 -2
- package/dist/index.browser.mjs +3 -3
- package/dist/index.browser.mjs.map +4 -4
- package/dist/index.cjs +304 -2
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.mjs +304 -2
- package/dist/index.mjs.map +4 -4
- package/dist/package/pack.d.ts +93 -0
- package/dist/package/pack.js +370 -0
- package/package.json +1 -1
|
@@ -21,3 +21,5 @@ export declare function recoveryMessage(org: string, account: string, nonce: str
|
|
|
21
21
|
export declare function recoveryPublicKey(seed: Uint8Array): Promise<string>;
|
|
22
22
|
/** The seed's signature (base64url) handing `org` to `account` under `nonce`. */
|
|
23
23
|
export declare function signRecovery(seed: Uint8Array, org: string, account: string, nonce: string): Promise<string>;
|
|
24
|
+
export declare function privateKey(seed: Uint8Array, extractable: boolean): Promise<CryptoKey>;
|
|
25
|
+
export declare const buf: (b: Uint8Array) => ArrayBuffer;
|
|
@@ -60,11 +60,11 @@ function checkSeed(seed) {
|
|
|
60
60
|
if (seed.length !== 32)
|
|
61
61
|
throw new Error('a recovery seed is 32 bytes');
|
|
62
62
|
}
|
|
63
|
-
function privateKey(seed, extractable) {
|
|
63
|
+
export function privateKey(seed, extractable) {
|
|
64
64
|
checkSeed(seed);
|
|
65
65
|
const pkcs8 = new Uint8Array(PKCS8_ED25519.length + 32);
|
|
66
66
|
pkcs8.set(PKCS8_ED25519);
|
|
67
67
|
pkcs8.set(seed, PKCS8_ED25519.length);
|
|
68
68
|
return crypto.subtle.importKey('pkcs8', buf(pkcs8), { name: 'Ed25519' }, extractable, ['sign']);
|
|
69
69
|
}
|
|
70
|
-
const buf = (b) => b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
|
|
70
|
+
export const buf = (b) => b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength);
|