@majikah/majik-signature-client 0.4.0 → 0.5.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.
|
@@ -160,6 +160,11 @@ export declare class MajikSignatureClient {
|
|
|
160
160
|
lockAccount(id: string): void;
|
|
161
161
|
lockAllAccounts(): void;
|
|
162
162
|
verifyPassphrase(id: string, passphrase: string): Promise<boolean>;
|
|
163
|
+
/**
|
|
164
|
+
* Update the metadata (e.g., label) of an owned account.
|
|
165
|
+
* This updates both the contact directory and the local ownAccounts cache.
|
|
166
|
+
*/
|
|
167
|
+
updateOwnAccountMeta(id: string, meta: Partial<MajikContactMeta>): Promise<void>;
|
|
163
168
|
updatePassphrase(id: string, currentPassphrase: string, newPassphrase: string): Promise<void>;
|
|
164
169
|
replacePassphrase(backup: string, mnemonic: string, newPassphrase: string, id: string, label?: string): Promise<MajikKey>;
|
|
165
170
|
listOwnAccounts(majikahOnly?: boolean): MajikContact[];
|
|
@@ -357,6 +357,22 @@ export class MajikSignatureClient {
|
|
|
357
357
|
async verifyPassphrase(id, passphrase) {
|
|
358
358
|
return this._keys.isPassphraseValid(id, passphrase);
|
|
359
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* Update the metadata (e.g., label) of an owned account.
|
|
362
|
+
* This updates both the contact directory and the local ownAccounts cache.
|
|
363
|
+
*/
|
|
364
|
+
async updateOwnAccountMeta(id, meta) {
|
|
365
|
+
if (!this._ownAccounts.has(id)) {
|
|
366
|
+
throw new Error(`Account not found in own accounts: "${id}"`);
|
|
367
|
+
}
|
|
368
|
+
// 1. Update the contact record in the shared directory
|
|
369
|
+
await this._contacts.updateContactMeta(id, meta);
|
|
370
|
+
// 2. Fetch the updated contact and sync the local _ownAccounts map
|
|
371
|
+
const updatedContact = this._contacts.getContact(id);
|
|
372
|
+
if (updatedContact) {
|
|
373
|
+
this._ownAccounts.set(id, updatedContact);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
360
376
|
async updatePassphrase(id, currentPassphrase, newPassphrase) {
|
|
361
377
|
try {
|
|
362
378
|
await this._keys.updatePassphrase(id, currentPassphrase, newPassphrase);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@majikah/majik-signature-client",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Majik Signature Client is a hybrid post-quantum content signing and verification library for the Majikah ecosystem. Built on top of Majik Key, it provides tamper-proof, forgery-resistant digital signatures for any content format — using a dual-algorithm architecture that combines classical Ed25519 with post-quantum ML-DSA-87 (FIPS-204).",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.5.1",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "Zelijah",
|
|
8
8
|
"main": "./dist/index.js",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@majikah/majik-cjson": "^0.0.3",
|
|
56
56
|
"@majikah/majik-contact": "^0.0.6",
|
|
57
|
-
"@majikah/majik-file": "^0.1.
|
|
58
|
-
"@majikah/majik-key": "^0.3.
|
|
59
|
-
"@majikah/majik-signature": "^0.
|
|
57
|
+
"@majikah/majik-file": "^0.1.12",
|
|
58
|
+
"@majikah/majik-key": "^0.3.2",
|
|
59
|
+
"@majikah/majik-signature": "^0.2.0",
|
|
60
60
|
"@stablelib/ed25519": "^2.1.0",
|
|
61
61
|
"ed2curve": "^0.3.0",
|
|
62
62
|
"fflate": "^0.8.3"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@types/node": "^
|
|
65
|
+
"@types/node": "^26.1.1"
|
|
66
66
|
}
|
|
67
67
|
}
|