@interop/wallet-core 0.42.0 → 0.44.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/clients/rosterPolicy.d.ts +7 -2
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +19 -11
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/keyring/index.d.ts +3 -2
- package/dist/keyring/index.d.ts.map +1 -1
- package/dist/keyring/index.js +3 -2
- package/dist/keyring/index.js.map +1 -1
- package/dist/keyring/kdf.d.ts +20 -0
- package/dist/keyring/kdf.d.ts.map +1 -1
- package/dist/keyring/kdf.js +13 -0
- package/dist/keyring/kdf.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
* continuity reason `rollback` (see {@link isRosterRefusal}), which lands in
|
|
25
25
|
* the transport class instead. Anything in that class (an unreachable
|
|
26
26
|
* server, a transport hiccup, the rollback) is warned about and resolves
|
|
27
|
-
* `null`, so the start keeps working from the cached key.
|
|
27
|
+
* `null`, so the start keeps working from the cached key. A throw from the
|
|
28
|
+
* app's adoption callback is a third class of its own: the read succeeded
|
|
29
|
+
* but the adopted key and epoch pin did not persist, so it propagates
|
|
30
|
+
* verbatim rather than degrading to the cached key.
|
|
28
31
|
*
|
|
29
32
|
* - {@link convergeUserKeyRosterToAccount} -- the roster stage of the
|
|
30
33
|
* cascade-completion sweep, which the collection fan-out then runs behind. A
|
|
@@ -93,7 +96,9 @@ export interface AdoptedUserKey {
|
|
|
93
96
|
* @param [options.onRosterRead] {Function} called with the
|
|
94
97
|
* {@link AdoptedUserKey} of every successful read (whether or not it rotated),
|
|
95
98
|
* so the epoch pin advances to the epoch just authenticated; the key and the
|
|
96
|
-
* pin must persist atomically
|
|
99
|
+
* pin must persist atomically. A throw from this callback propagates to the
|
|
100
|
+
* caller verbatim -- it means the adopted key and pin did NOT persist, which
|
|
101
|
+
* is neither a transport hiccup nor a roster refusal
|
|
97
102
|
* @returns {Promise<UserKeyRosterReadResult | null>} the read, or `null` when
|
|
98
103
|
* the account has no roster yet or the server could not be reached
|
|
99
104
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,oBAAoB,CAAA;CACjC;AA2CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,KAAK,EACL,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,YAAY,EACb,EAAE;IACD,KAAK,EAAE,yBAAyB,CAAA;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1D,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAoC1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,8BAA8B,CAAC,EACnD,OAAO,EACP,KAAK,EACL,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EACjB,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAA;IAC1B,KAAK,EAAE,yBAAyB,CAAA;IAChC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;IAChC,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,kBAAkB,CAAC,EAAE,mBAAmB,CAAA;IACxC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9D,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;CACjC,CAAC,CAwGD"}
|
|
@@ -64,27 +64,21 @@ function isRosterRefusal(err) {
|
|
|
64
64
|
* @param [options.onRosterRead] {Function} called with the
|
|
65
65
|
* {@link AdoptedUserKey} of every successful read (whether or not it rotated),
|
|
66
66
|
* so the epoch pin advances to the epoch just authenticated; the key and the
|
|
67
|
-
* pin must persist atomically
|
|
67
|
+
* pin must persist atomically. A throw from this callback propagates to the
|
|
68
|
+
* caller verbatim -- it means the adopted key and pin did NOT persist, which
|
|
69
|
+
* is neither a transport hiccup nor a roster refusal
|
|
68
70
|
* @returns {Promise<UserKeyRosterReadResult | null>} the read, or `null` when
|
|
69
71
|
* the account has no roster yet or the server could not be reached
|
|
70
72
|
*/
|
|
71
73
|
export async function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgreementKey, pinnedEpochId, onRosterRead }) {
|
|
74
|
+
let read;
|
|
72
75
|
try {
|
|
73
|
-
|
|
76
|
+
read = await readUserKeyRoster({
|
|
74
77
|
store,
|
|
75
78
|
...(userKey ? { userKey } : {}),
|
|
76
79
|
clientKeyAgreementKey,
|
|
77
80
|
pinnedEpochId
|
|
78
81
|
});
|
|
79
|
-
if (!read) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
await onRosterRead?.({
|
|
83
|
-
userKey: read.userKey,
|
|
84
|
-
latestEpochId: read.latestEpochId,
|
|
85
|
-
descriptor: read.descriptor
|
|
86
|
-
});
|
|
87
|
-
return read;
|
|
88
82
|
}
|
|
89
83
|
catch (err) {
|
|
90
84
|
if (isRosterRefusal(err)) {
|
|
@@ -96,6 +90,20 @@ export async function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgree
|
|
|
96
90
|
'user key:', err);
|
|
97
91
|
return null;
|
|
98
92
|
}
|
|
93
|
+
if (!read) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
// The adoption callback runs OUTSIDE the transport catch: the roster read
|
|
97
|
+
// itself succeeded, so a throw here is the app failing to persist the
|
|
98
|
+
// adopted key and epoch pin, and swallowing it into the warn-and-null path
|
|
99
|
+
// would report a broken persist as an offline start (the session would
|
|
100
|
+
// proceed on the retired cached key with the pin never advanced).
|
|
101
|
+
await onRosterRead?.({
|
|
102
|
+
userKey: read.userKey,
|
|
103
|
+
latestEpochId: read.latestEpochId,
|
|
104
|
+
descriptor: read.descriptor
|
|
105
|
+
});
|
|
106
|
+
return read;
|
|
99
107
|
}
|
|
100
108
|
/**
|
|
101
109
|
* Converges the roster onto the account's locally verified did:webvh document,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AA4DA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAS,eAAe,CAAC,GAAY;IACnC,MAAM,IAAI,GAAI,GAAiC,EAAE,IAAI,CAAA;IACrD,IAAI,IAAI,KAAK,4BAA4B,EAAE,CAAC;QAC1C,OAAQ,GAA4B,CAAC,MAAM,KAAK,UAAU,CAAA;IAC5D,CAAC;IACD,OAAO,CACL,IAAI,KAAK,2BAA2B;QACpC,IAAI,KAAK,8BAA8B;QACvC,IAAI,KAAK,6BAA6B;QACtC,IAAI,KAAK,0BAA0B,CACpC,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,EAC9C,KAAK,EACL,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,YAAY,EAOb;IACC,IAAI,IAAoC,CAAA;IACxC,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,iBAAiB,CAAC;YAC7B,KAAK;YACL,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/B,qBAAqB;YACrB,aAAa;SACd,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAA;QACX,CAAC;QACD,yEAAyE;QACzE,+DAA+D;QAC/D,OAAO,CAAC,IAAI,CACV,+DAA+D;YAC7D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,IAAI,KAAK,CACb,iEAAiE;YAC/D,mEAAmE;YACnE,kBAAkB,EACpB,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAA;IACH,CAAC;IACD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,oEAAoE;YACpE,MAAM,CACT,CAAA;IACH,CAAC;IACD,MAAM,gBAAgB,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM;QACN,iBAAiB;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAA;AACH,CAAC"}
|
package/dist/keyring/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* unlock secret (a passphrase, a passkey PRF output) locates an account
|
|
7
7
|
* without authorizing anything against it.
|
|
8
8
|
*
|
|
9
|
-
* - `deriveUnlockIdentity` / `
|
|
9
|
+
* - `deriveUnlockIdentity` / `unlockIdentityFromSeed` / `KEYRING_KDF` /
|
|
10
|
+
* `unlockSpaceIdFor` -- the
|
|
10
11
|
* wire-level unlock derivation (implemented over `@noble/hashes`, so it runs
|
|
11
12
|
* unchanged where WebCrypto's `deriveBits` is unavailable) and the unlock
|
|
12
13
|
* Space addressing convention.
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
* Kept out of the root export: this subpath pulls the webkms-client / ezcap /
|
|
34
35
|
* was-client dependency graph (the same isolation pattern as `./identity`).
|
|
35
36
|
*/
|
|
36
|
-
export { deriveUnlockIdentity, deriveUnlockSeed, KEYRING_KDF, UNLOCK_HANDLE, UNLOCK_KEY_NAME, unlockSpaceIdFor } from './kdf.js';
|
|
37
|
+
export { deriveUnlockIdentity, deriveUnlockSeed, unlockIdentityFromSeed, KEYRING_KDF, UNLOCK_HANDLE, UNLOCK_KEY_NAME, unlockSpaceIdFor } from './kdf.js';
|
|
37
38
|
export type { UnlockIdentity, UnlockKdf } from './kdf.js';
|
|
38
39
|
export { KEYRING_RECORD_VERSION, mintRecordEncryption, parseRecordCreatedAt, parseRecordFrame, parseRecordPointer, recordCipher, recordCreatedAtStamp, RecordProofError, recordProofKeyMultibase, recordSealCipher, recordSignerFromAgent, signRecordFrame, unwrapKeyringRecord, verifyRecordProof, wrapKeyringRecord } from './record.js';
|
|
39
40
|
export type { AccountPointer, KeyringRecordContents, RecordProof, RecordSigner, SignedRecord } from './record.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAgB,EACjB,MAAM,UAAU,CAAA;AACjB,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzD,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,YAAY,EACZ,YAAY,EACb,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,iBAAiB,EACjB,+BAA+B,EAC/B,iBAAiB,EACjB,gBAAgB,EAChB,8BAA8B,EAC9B,gBAAgB,EAChB,8BAA8B,EAC9B,iBAAiB,EAClB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/keyring/index.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* unlock secret (a passphrase, a passkey PRF output) locates an account
|
|
7
7
|
* without authorizing anything against it.
|
|
8
8
|
*
|
|
9
|
-
* - `deriveUnlockIdentity` / `
|
|
9
|
+
* - `deriveUnlockIdentity` / `unlockIdentityFromSeed` / `KEYRING_KDF` /
|
|
10
|
+
* `unlockSpaceIdFor` -- the
|
|
10
11
|
* wire-level unlock derivation (implemented over `@noble/hashes`, so it runs
|
|
11
12
|
* unchanged where WebCrypto's `deriveBits` is unavailable) and the unlock
|
|
12
13
|
* Space addressing convention.
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
* Kept out of the root export: this subpath pulls the webkms-client / ezcap /
|
|
34
35
|
* was-client dependency graph (the same isolation pattern as `./identity`).
|
|
35
36
|
*/
|
|
36
|
-
export { deriveUnlockIdentity, deriveUnlockSeed, KEYRING_KDF, UNLOCK_HANDLE, UNLOCK_KEY_NAME, unlockSpaceIdFor } from './kdf.js';
|
|
37
|
+
export { deriveUnlockIdentity, deriveUnlockSeed, unlockIdentityFromSeed, KEYRING_KDF, UNLOCK_HANDLE, UNLOCK_KEY_NAME, unlockSpaceIdFor } from './kdf.js';
|
|
37
38
|
export { KEYRING_RECORD_VERSION, mintRecordEncryption, parseRecordCreatedAt, parseRecordFrame, parseRecordPointer, recordCipher, recordCreatedAtStamp, RecordProofError, recordProofKeyMultibase, recordSealCipher, recordSignerFromAgent, signRecordFrame, unwrapKeyringRecord, verifyRecordProof, wrapKeyringRecord } from './record.js';
|
|
38
39
|
export { deleteUnlockSpace, deleteUnlockSpaceWithCapability, ensureUnlockSpace, getUnlockKeyring, getUnlockKeyringWithCapability, putUnlockKeyring, putUnlockKeyringWithCapability, UNLOCK_SPACE_NAME } from './unlockSpace.js';
|
|
39
40
|
export { fetchKeyringRecord } from './fetch.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keyring/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAgB,EACjB,MAAM,UAAU,CAAA;AAGjB,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,aAAa,CAAA;AASpB,OAAO,EACL,iBAAiB,EACjB,+BAA+B,EAC/B,iBAAiB,EACjB,gBAAgB,EAChB,8BAA8B,EAC9B,gBAAgB,EAChB,8BAA8B,EAC9B,iBAAiB,EAClB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/keyring/kdf.d.ts
CHANGED
|
@@ -101,6 +101,26 @@ export declare function deriveUnlockIdentity({ secret, kdf }: {
|
|
|
101
101
|
recordSigner: import("./record.js").RecordSigner;
|
|
102
102
|
spaceId: string;
|
|
103
103
|
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Assembles the unlock identity from an already-derived 32-byte unlock seed.
|
|
106
|
+
* The seam that lets an app run the expensive stretch once per typed secret:
|
|
107
|
+
* `deriveUnlockSeed` yields the seed, and both this assembly and the
|
|
108
|
+
* standing-credential expansion (`unlock/standingClient`) consume it.
|
|
109
|
+
*
|
|
110
|
+
* @param options {object}
|
|
111
|
+
* @param options.seed {Uint8Array} the method's 32-byte unlock seed
|
|
112
|
+
* @returns {Promise<object>}
|
|
113
|
+
*/
|
|
114
|
+
export declare function unlockIdentityFromSeed({ seed }: {
|
|
115
|
+
seed: Uint8Array;
|
|
116
|
+
}): Promise<{
|
|
117
|
+
agent: CapabilityAgent;
|
|
118
|
+
zcapClient: import("@interop/ezcap").ZcapClient;
|
|
119
|
+
keyAgreementKey: import("@interop/data-integrity-core").IKeyAgreementKey;
|
|
120
|
+
keyResolver: import("@interop/data-integrity-core").IKeyResolver;
|
|
121
|
+
recordSigner: import("./record.js").RecordSigner;
|
|
122
|
+
spaceId: string;
|
|
123
|
+
}>;
|
|
104
124
|
/**
|
|
105
125
|
* The unlock Space id an unlock identity addresses:
|
|
106
126
|
* `base64url(SHA-256(did))`, unpadded -- a discovery convention, not an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kdf.d.ts","sourceRoot":"","sources":["../../src/keyring/kdf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAQxD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,eAAO,MAAM,eAAe,eAAe,CAAA;AAQ3C;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GACjB;IACE,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,QAAQ,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,GACD;IACE,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAA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CAAC,EACrC,MAAM,EACN,GAAG,EACJ,EAAE;IACD,MAAM,EAAE,MAAM,GAAG,UAAU,CAAA;IAC3B,GAAG,EAAE,SAAS,CAAA;CACf,GAAG,OAAO,CAAC,UAAU,CAAC,CAsBtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,GAAG,EACJ,EAAE;IACD,MAAM,EAAE,MAAM,GAAG,UAAU,CAAA;IAC3B,GAAG,EAAE,SAAS,CAAA;CACf;;;;;;;GAGA;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE;;;;;;;GA4B1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEjE;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAA"}
|
package/dist/keyring/kdf.js
CHANGED
|
@@ -116,6 +116,19 @@ export async function deriveUnlockSeed({ secret, kdf }) {
|
|
|
116
116
|
*/
|
|
117
117
|
export async function deriveUnlockIdentity({ secret, kdf }) {
|
|
118
118
|
const seed = await deriveUnlockSeed({ secret, kdf });
|
|
119
|
+
return unlockIdentityFromSeed({ seed });
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Assembles the unlock identity from an already-derived 32-byte unlock seed.
|
|
123
|
+
* The seam that lets an app run the expensive stretch once per typed secret:
|
|
124
|
+
* `deriveUnlockSeed` yields the seed, and both this assembly and the
|
|
125
|
+
* standing-credential expansion (`unlock/standingClient`) consume it.
|
|
126
|
+
*
|
|
127
|
+
* @param options {object}
|
|
128
|
+
* @param options.seed {Uint8Array} the method's 32-byte unlock seed
|
|
129
|
+
* @returns {Promise<object>}
|
|
130
|
+
*/
|
|
131
|
+
export async function unlockIdentityFromSeed({ seed }) {
|
|
119
132
|
const agent = await CapabilityAgent.fromSeed({
|
|
120
133
|
seed,
|
|
121
134
|
handle: UNLOCK_HANDLE,
|
package/dist/keyring/kdf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kdf.js","sourceRoot":"","sources":["../../src/keyring/kdf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEnD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAA;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAA;AAE3C;;;GAGG;AACH,MAAM,iBAAiB,GAAG,EAAE,CAAA;AA0B5B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GAAc;IACpC,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,OAAO;IACnB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,8BAA8B;CACrC,CAAA;AAED;;;;;;GAMG;AACH,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,MAAM,CAAA;IACf,CAAC;IACD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,MAAM,CAAA;IACf,CAAC;IACD,M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M,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACrE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interop/wallet-core",
|
|
3
3
|
"description": "Shared wallet-domain logic (WAS sync engine core and wallet Space layout contracts) for Interop wallet apps.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.44.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|