@interop/wallet-core 0.86.0 → 0.87.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/ceremonyEvents.d.ts +116 -0
- package/dist/ceremonyEvents.d.ts.map +1 -0
- package/dist/ceremonyEvents.js +282 -0
- package/dist/ceremonyEvents.js.map +1 -0
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +17 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
- package/dist/clientAnnex/credentialAnchoredGenesis.js +45 -3
- package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
- package/dist/clientAnnex/establish.d.ts +22 -0
- package/dist/clientAnnex/establish.d.ts.map +1 -1
- package/dist/clientAnnex/establish.js +67 -7
- package/dist/clientAnnex/establish.js.map +1 -1
- package/dist/clientAnnex/forget.d.ts +35 -2
- package/dist/clientAnnex/forget.d.ts.map +1 -1
- package/dist/clientAnnex/forget.js +85 -8
- package/dist/clientAnnex/forget.js.map +1 -1
- package/dist/clientAnnex/forgetLast.d.ts +26 -2
- package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
- package/dist/clientAnnex/forgetLast.js +82 -2
- package/dist/clientAnnex/forgetLast.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +6 -5
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +3 -3
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/ladderAnchored.d.ts +7 -4
- package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/ladderAnchored.js +11 -5
- package/dist/clientAnnex/ladderAnchored.js.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
- package/dist/clientAnnex/recoveryLadderAnchored.js +15 -4
- package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
- package/dist/clientAnnex/selfEnroll.d.ts +23 -1
- package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
- package/dist/clientAnnex/selfEnroll.js +45 -1
- package/dist/clientAnnex/selfEnroll.js.map +1 -1
- package/dist/clients/index.d.ts +2 -2
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/index.js +1 -1
- package/dist/clients/index.js.map +1 -1
- package/dist/clients/revocation.d.ts +20 -1
- package/dist/clients/revocation.d.ts.map +1 -1
- package/dist/clients/revocation.js +76 -1
- package/dist/clients/revocation.js.map +1 -1
- package/dist/enrollment/enrollment.d.ts +23 -2
- package/dist/enrollment/enrollment.d.ts.map +1 -1
- package/dist/enrollment/enrollment.js +75 -4
- package/dist/enrollment/enrollment.js.map +1 -1
- package/dist/enrollment/index.d.ts +2 -2
- package/dist/enrollment/index.d.ts.map +1 -1
- package/dist/enrollment/index.js +1 -1
- package/dist/enrollment/index.js.map +1 -1
- package/dist/enrollment/onboardingResponse.d.ts +26 -5
- package/dist/enrollment/onboardingResponse.d.ts.map +1 -1
- package/dist/enrollment/onboardingResponse.js +2 -14
- package/dist/enrollment/onboardingResponse.js.map +1 -1
- package/dist/errorName.d.ts +19 -0
- package/dist/errorName.d.ts.map +1 -0
- package/dist/errorName.js +27 -0
- package/dist/errorName.js.map +1 -0
- package/dist/genesis/accountGenesis.d.ts +27 -1
- package/dist/genesis/accountGenesis.d.ts.map +1 -1
- package/dist/genesis/accountGenesis.js +60 -2
- package/dist/genesis/accountGenesis.js.map +1 -1
- package/dist/genesis/index.d.ts +2 -2
- package/dist/genesis/index.d.ts.map +1 -1
- package/dist/genesis/index.js +1 -1
- package/dist/genesis/index.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/labelText.d.ts +24 -0
- package/dist/labelText.d.ts.map +1 -0
- package/dist/labelText.js +26 -0
- package/dist/labelText.js.map +1 -0
- package/dist/log.d.ts +6 -4
- package/dist/log.d.ts.map +1 -1
- package/dist/log.js +8 -5
- package/dist/log.js.map +1 -1
- package/dist/menders/ids.d.ts +4 -1
- package/dist/menders/ids.d.ts.map +1 -1
- package/dist/menders/ids.js +4 -1
- package/dist/menders/ids.js.map +1 -1
- package/dist/menders/index.d.ts +2 -1
- package/dist/menders/index.d.ts.map +1 -1
- package/dist/menders/index.js +2 -1
- package/dist/menders/index.js.map +1 -1
- package/dist/menders/runner.d.ts +5 -24
- package/dist/menders/runner.d.ts.map +1 -1
- package/dist/menders/runner.js +25 -18
- package/dist/menders/runner.js.map +1 -1
- package/dist/menders/vocabulary.d.ts +3 -1
- package/dist/menders/vocabulary.d.ts.map +1 -1
- package/dist/menders/vocabulary.js +3 -1
- package/dist/menders/vocabulary.js.map +1 -1
- package/dist/recovery/continuation.d.ts +40 -1
- package/dist/recovery/continuation.d.ts.map +1 -1
- package/dist/recovery/continuation.js +48 -1
- package/dist/recovery/continuation.js.map +1 -1
- package/dist/recovery/index.d.ts +2 -2
- package/dist/recovery/index.d.ts.map +1 -1
- package/dist/recovery/index.js +1 -1
- package/dist/recovery/index.js.map +1 -1
- package/dist/recovery/recoveryWebvh.d.ts +21 -2
- package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
- package/dist/recovery/recoveryWebvh.js +88 -31
- package/dist/recovery/recoveryWebvh.js.map +1 -1
- package/dist/space/ceremony.d.ts +3 -1
- package/dist/space/ceremony.d.ts.map +1 -1
- package/dist/space/ceremony.js +3 -1
- package/dist/space/ceremony.js.map +1 -1
- package/dist/unlock/index.d.ts +2 -2
- package/dist/unlock/index.d.ts.map +1 -1
- package/dist/unlock/index.js +1 -1
- package/dist/unlock/index.js.map +1 -1
- package/dist/unlock/retire.d.ts +21 -1
- package/dist/unlock/retire.d.ts.map +1 -1
- package/dist/unlock/retire.js +79 -1
- package/dist/unlock/retire.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,34 @@
|
|
|
1
|
+
import { ceremonyEvents } from '../ceremonyEvents.js';
|
|
2
|
+
import { log } from '../log.js';
|
|
1
3
|
import { assertCanonicalClientKeys, clientAdditionFields, withLogConflictRetry } from '../webvh/didWebvh.js';
|
|
2
4
|
import { publishUnlockKey, removeUnlockKey } from '../unlock/standingWebvh.js';
|
|
3
|
-
import { recoveryContinuationOnce } from './continuation.js';
|
|
5
|
+
import { RECOVERY_CODE_SPEND_REFUSALS, recoveryContinuationOnce, spendOutcome } from './continuation.js';
|
|
4
6
|
// The continuation's shared core and the names both variants read live in
|
|
5
7
|
// `continuation.ts`; this module stays their public home.
|
|
6
|
-
export { RecoveryCredentialStandingError, RecoveryKeyNotCommittedError, recoveryVmId, retiredCredentialVmIdsFromLog } from './continuation.js';
|
|
8
|
+
export { RECOVERY_CODE_SPEND_STAGES, RecoveryCredentialStandingError, RecoveryKeyNotCommittedError, recoveryVmId, retiredCredentialVmIdsFromLog } from './continuation.js';
|
|
9
|
+
/**
|
|
10
|
+
* The issuance's stages on the ceremony event channel: the entry each `part`
|
|
11
|
+
* writes -- the key entry (`'key'`), the authority entry (`'authority'`), or
|
|
12
|
+
* the merged entry (`'all'`).
|
|
13
|
+
*/
|
|
14
|
+
export const RECOVERY_CODE_ISSUANCE_STAGES = [
|
|
15
|
+
'key-entry',
|
|
16
|
+
'authority-entry',
|
|
17
|
+
'inventory-entry'
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* The revocation's one stage on the ceremony event channel: the entry that
|
|
21
|
+
* removes the code's inventory. The roster-side half is the caller's.
|
|
22
|
+
*/
|
|
23
|
+
export const RECOVERY_CODE_REVOCATION_STAGES = ['inventory-removal'];
|
|
24
|
+
/**
|
|
25
|
+
* The stage each issuance `part` reports.
|
|
26
|
+
*/
|
|
27
|
+
const ISSUANCE_STAGE_OF_PART = {
|
|
28
|
+
key: 'key-entry',
|
|
29
|
+
authority: 'authority-entry',
|
|
30
|
+
all: 'inventory-entry'
|
|
31
|
+
};
|
|
7
32
|
/**
|
|
8
33
|
* ISSUANCE: publishes a recovery code's split configuration into the
|
|
9
34
|
* document -- the code's `keyAgreement` verification method (an ordinary,
|
|
@@ -41,21 +66,32 @@ export { RecoveryCredentialStandingError, RecoveryKeyNotCommittedError, recovery
|
|
|
41
66
|
* DID and the document and log as this call leaves them
|
|
42
67
|
*/
|
|
43
68
|
export async function publishRecoveryKey({ idStore, signer, recovery, ladderSeed, part, expectedDid }) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
69
|
+
// One event run per entry-writing call: the ladder branch's split issuance
|
|
70
|
+
// is two runs, one per `part`. No code-derived value enters an event.
|
|
71
|
+
const events = ceremonyEvents({
|
|
72
|
+
ceremony: 'recovery-code-issuance',
|
|
73
|
+
log,
|
|
74
|
+
refusals: ['LadderAttributionError', 'AccountLogMissingError']
|
|
75
|
+
});
|
|
76
|
+
return events.run(async () => {
|
|
77
|
+
const published = await publishUnlockKey({
|
|
78
|
+
idStore,
|
|
79
|
+
signer,
|
|
80
|
+
unlockKeys: {
|
|
81
|
+
keyAgreement: {
|
|
82
|
+
publicKeyMultibase: recovery.keyAgreementKeyMultibase
|
|
83
|
+
},
|
|
84
|
+
updateKeyMultibase: recovery.updateKeyMultibase
|
|
50
85
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
86
|
+
// Every code carries a ladder, so the authority half of its
|
|
87
|
+
// inventory is that ladder's VM beside the rung-0 commitment.
|
|
88
|
+
ladderSeed,
|
|
89
|
+
...(part !== undefined ? { part } : {}),
|
|
90
|
+
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
91
|
+
verb: 'issuing a recovery code'
|
|
92
|
+
});
|
|
93
|
+
events.stage(ISSUANCE_STAGE_OF_PART[part ?? 'all']);
|
|
94
|
+
return published;
|
|
59
95
|
});
|
|
60
96
|
}
|
|
61
97
|
/**
|
|
@@ -89,19 +125,32 @@ export async function publishRecoveryKey({ idStore, signer, recovery, ladderSeed
|
|
|
89
125
|
* {@link publishRecoveryKey}
|
|
90
126
|
*/
|
|
91
127
|
export async function removeRecoveryKey({ idStore, signer, recovery, ladderSeed, projectionStore, expectedDid }) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
128
|
+
const events = ceremonyEvents({
|
|
129
|
+
ceremony: 'recovery-code-revocation',
|
|
130
|
+
log,
|
|
131
|
+
refusals: [
|
|
132
|
+
'UnclaimedLadderVmRetirementError',
|
|
133
|
+
'LadderAttributionError',
|
|
134
|
+
'AccountLogMissingError'
|
|
135
|
+
]
|
|
136
|
+
});
|
|
137
|
+
return events.run(async () => {
|
|
138
|
+
const removed = await removeUnlockKey({
|
|
139
|
+
idStore,
|
|
140
|
+
signer,
|
|
141
|
+
unlockKeys: {
|
|
142
|
+
keyAgreement: {
|
|
143
|
+
publicKeyMultibase: recovery.keyAgreementKeyMultibase
|
|
144
|
+
},
|
|
145
|
+
updateKeyMultibase: recovery.updateKeyMultibase
|
|
98
146
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
147
|
+
...(ladderSeed ? { ladderSeed } : {}),
|
|
148
|
+
...(projectionStore ? { projectionStore } : {}),
|
|
149
|
+
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
150
|
+
verb: 'revoking a recovery code'
|
|
151
|
+
});
|
|
152
|
+
events.stage('inventory-removal');
|
|
153
|
+
return removed;
|
|
105
154
|
});
|
|
106
155
|
}
|
|
107
156
|
/**
|
|
@@ -199,7 +248,14 @@ export async function recoverWebvhClient(options) {
|
|
|
199
248
|
keyAgreementKeyMultibase: options.newClientKeys.keyAgreementKeyMultibase
|
|
200
249
|
});
|
|
201
250
|
const { newClientKeys, newClientUpdateSeeds, onCommitted, expectedDid, ...shared } = options;
|
|
202
|
-
|
|
251
|
+
// One run outside the conflict retry: a lost compare-and-swap re-enters
|
|
252
|
+
// the body under the same run, and the emitter reports each stage once.
|
|
253
|
+
const events = ceremonyEvents({
|
|
254
|
+
ceremony: 'recovery-code-spend',
|
|
255
|
+
log,
|
|
256
|
+
refusals: RECOVERY_CODE_SPEND_REFUSALS
|
|
257
|
+
});
|
|
258
|
+
const outcome = await events.run(() => withLogConflictRetry(() => recoveryContinuationOnce({
|
|
203
259
|
...shared,
|
|
204
260
|
successor: {
|
|
205
261
|
updateKeyMultibase: newClientKeys.updateKeyMultibase,
|
|
@@ -225,8 +281,9 @@ export async function recoverWebvhClient(options) {
|
|
|
225
281
|
});
|
|
226
282
|
return { methods, ...relations };
|
|
227
283
|
},
|
|
228
|
-
...(expectedDid !== undefined ? { expectedDid } : {})
|
|
229
|
-
|
|
284
|
+
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
285
|
+
events
|
|
286
|
+
})), spendOutcome);
|
|
230
287
|
// The document and log stay inside: the remembered session re-verifies
|
|
231
288
|
// the log for itself once it is the controller.
|
|
232
289
|
const { doc: _doc, log: _log, ...rest } = outcome;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recoveryWebvh.js","sourceRoot":"","sources":["../../src/recovery/recoveryWebvh.ts"],"names":[],"mappings":"AAwCA,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAM7B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG9E,OAAO,
|
|
1
|
+
{"version":3,"file":"recoveryWebvh.js","sourceRoot":"","sources":["../../src/recovery/recoveryWebvh.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC/B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAM7B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAA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E;QACvE,wEAAwE;QACxE,qEAAqE;QACrE,oEAAoE;QACpE,wEAAwE;QACxE,sEAAsE;QACtE,iEAAiE;QACjE,qEAAqE;QACrE,qEAAqE;QACrE,mCAAmC;QACnC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;YACjB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,oBAAoB,CAAC;gBAClD,UAAU,EAAE,GAAG;gBACf,mBAAmB,EAAE,aAAa,CAAC,mBAAmB;gBACtD,wBAAwB,EAAE,aAAa,CAAC,wBAAwB;aACjE,CAAC,CAAA;YACF,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAA;QAClC,CAAC;QACD,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM;KACP,CAAC,CACH,EACH,YAAY,CACb,CAAA;IACD,uEAAuE;IACvE,gDAAgD;IAChD,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAA;IACjD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/space/ceremony.d.ts
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* wallet runs. Most have a shared half in this package; some are still
|
|
7
7
|
* implemented app-side. The ids are code-only identifiers (nothing persists
|
|
8
8
|
* them yet); each names one ceremony documented in the wallets' ceremony
|
|
9
|
-
* inventories.
|
|
9
|
+
* inventories. Code-only means no stored record and no account or annex log
|
|
10
|
+
* entry carries one. The ceremony event channel (`ceremonyEvents.ts`) is a
|
|
11
|
+
* separate diagnostics surface, and its events do carry them.
|
|
10
12
|
*/
|
|
11
13
|
/**
|
|
12
14
|
* The account ceremony ids, in ceremony-inventory order. The last four
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ceremony.d.ts","sourceRoot":"","sources":["../../src/space/ceremony.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"ceremony.d.ts","sourceRoot":"","sources":["../../src/space/ceremony.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,gXAiBf,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
package/dist/space/ceremony.js
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* wallet runs. Most have a shared half in this package; some are still
|
|
7
7
|
* implemented app-side. The ids are code-only identifiers (nothing persists
|
|
8
8
|
* them yet); each names one ceremony documented in the wallets' ceremony
|
|
9
|
-
* inventories.
|
|
9
|
+
* inventories. Code-only means no stored record and no account or annex log
|
|
10
|
+
* entry carries one. The ceremony event channel (`ceremonyEvents.ts`) is a
|
|
11
|
+
* separate diagnostics surface, and its events do carry them.
|
|
10
12
|
*/
|
|
11
13
|
/**
|
|
12
14
|
* The account ceremony ids, in ceremony-inventory order. The last four
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ceremony.js","sourceRoot":"","sources":["../../src/space/ceremony.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"ceremony.js","sourceRoot":"","sources":["../../src/space/ceremony.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,iBAAiB;IACjB,6BAA6B;IAC7B,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,wBAAwB;IACxB,qBAAqB;IACrB,0BAA0B;IAC1B,4BAA4B;IAC5B,eAAe;IACf,wBAAwB;IACxB,qBAAqB;IACrB,kBAAkB;IAClB,aAAa;IACb,mBAAmB;IACnB,eAAe;CACP,CAAA"}
|
package/dist/unlock/index.d.ts
CHANGED
|
@@ -42,6 +42,6 @@ export type { SealedRecordMember, SignedUnlockRecord, UnlockRecordContents, Unlo
|
|
|
42
42
|
export { assertLadderVmClaimed, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
43
43
|
export type { CredentialKeyAgreementMethod, LadderVmRemovalReport, StandingUnlockKeys, UnlockKeyAgreementPublication, UnlockLogStore } from './standingWebvh.js';
|
|
44
44
|
export { UNLOCK_MANAGEMENT_ACTIONS } from './managementZcap.js';
|
|
45
|
-
export { retireUnlockCredential } from './retire.js';
|
|
46
|
-
export type { ClientAnnexInventoryRetirement, ClientAnnexSwapRevokeOutcome, UnlockCredentialRetirementResult } from './retire.js';
|
|
45
|
+
export { retireUnlockCredential, UNLOCK_CREDENTIAL_RETIREMENT_STAGES } from './retire.js';
|
|
46
|
+
export type { UnlockCredentialRetirementStage, ClientAnnexInventoryRetirement, ClientAnnexSwapRevokeOutcome, UnlockCredentialRetirementResult } from './retire.js';
|
|
47
47
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,EAClB,6BAA6B,EAC7B,cAAc,EACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACpC,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,+BAA+B,EAC/B,8BAA8B,EAC9B,4BAA4B,EAC5B,gCAAgC,EACjC,MAAM,aAAa,CAAA"}
|
package/dist/unlock/index.js
CHANGED
|
@@ -39,5 +39,5 @@ export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentit
|
|
|
39
39
|
export { computeUnlockBinding, LADDER_SEED_BYTES, recordSealedRecipientKeys, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unlockRecordSealedTo, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
|
|
40
40
|
export { assertLadderVmClaimed, ladderVmClaimOf, preflightUnlockCredentialRetirement, publishUnlockKey, removeUnlockKey, UnclaimedLadderVmRetirementError, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
|
|
41
41
|
export { UNLOCK_MANAGEMENT_ACTIONS } from './managementZcap.js';
|
|
42
|
-
export { retireUnlockCredential } from './retire.js';
|
|
42
|
+
export { retireUnlockCredential, UNLOCK_CREDENTIAL_RETIREMENT_STAGES } from './retire.js';
|
|
43
43
|
//# sourceMappingURL=index.js.map
|
package/dist/unlock/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAS3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,mCAAmC,EACnC,gBAAgB,EAChB,eAAe,EACf,gCAAgC,EAChC,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAS3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EACL,sBAAsB,EACtB,mCAAmC,EACpC,MAAM,aAAa,CAAA"}
|
package/dist/unlock/retire.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ import type { CollectionEncryption } from '@interop/was-client';
|
|
|
89
89
|
import type { EncryptionDescriptorStore } from '@interop/was-client/edv/core';
|
|
90
90
|
import { type CascadeCollections, type RosterSealReport, type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
|
|
91
91
|
import type { WebvhIdStore } from '../webvh/index.js';
|
|
92
|
+
import { type CeremonyEmitter } from '../ceremonyEvents.js';
|
|
92
93
|
import type { AccountLogSigner } from '../webvh/accountEntry.js';
|
|
93
94
|
import { type LadderVmRemovalReport, type StandingUnlockKeys } from './standingWebvh.js';
|
|
94
95
|
/**
|
|
@@ -111,6 +112,18 @@ export interface UnlockCredentialRetirementResult {
|
|
|
111
112
|
rosterDescriptor?: CollectionEncryption;
|
|
112
113
|
clientAnnex?: ClientAnnexInventoryRetirement;
|
|
113
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* The stages the retirement reports on the ceremony event channel, in the
|
|
117
|
+
* order they land: the document inventory edit, the annex reach (when the
|
|
118
|
+
* closure ran and was not skipped), the roster rotation, and the collection
|
|
119
|
+
* fan-out (when every collection converged). A stage that found its work
|
|
120
|
+
* already done carries `prior: true`.
|
|
121
|
+
*/
|
|
122
|
+
export declare const UNLOCK_CREDENTIAL_RETIREMENT_STAGES: readonly ["inventory-edit", "annex-inventory", "roster-rotation", "collection-epochs"];
|
|
123
|
+
/**
|
|
124
|
+
* One value of {@link UNLOCK_CREDENTIAL_RETIREMENT_STAGES}.
|
|
125
|
+
*/
|
|
126
|
+
export type UnlockCredentialRetirementStage = (typeof UNLOCK_CREDENTIAL_RETIREMENT_STAGES)[number];
|
|
114
127
|
/**
|
|
115
128
|
* What the swap arm's revoke stage did with the old generation's embedded
|
|
116
129
|
* delegation, carried on a `swapped` report so a caller retiring a suspect
|
|
@@ -198,7 +211,12 @@ export interface ClientAnnexInventoryRetirement {
|
|
|
198
211
|
* the session keeps operating without a re-login
|
|
199
212
|
* @returns {Promise<UnlockCredentialRetirementResult>}
|
|
200
213
|
*/
|
|
201
|
-
export declare function retireUnlockCredential(
|
|
214
|
+
export declare function retireUnlockCredential(options: Omit<Parameters<typeof runUnlockCredentialRetirement>[0], 'events'>): Promise<UnlockCredentialRetirementResult>;
|
|
215
|
+
/**
|
|
216
|
+
* The body of {@link retireUnlockCredential}, one run under its event
|
|
217
|
+
* emitter.
|
|
218
|
+
*/
|
|
219
|
+
declare function runUnlockCredentialRetirement({ idStore, signer, unlockKeys, ladderSeed, projectionStore, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexInventory, onRotationAdopted, events }: {
|
|
202
220
|
idStore: WebvhIdStore;
|
|
203
221
|
signer: AccountLogSigner;
|
|
204
222
|
unlockKeys: StandingUnlockKeys;
|
|
@@ -222,5 +240,7 @@ export declare function retireUnlockCredential({ idStore, signer, unlockKeys, la
|
|
|
222
240
|
onRotationAdopted?: (rotation: {
|
|
223
241
|
userKey: UserKey;
|
|
224
242
|
}) => Promise<void>;
|
|
243
|
+
events: CeremonyEmitter<UnlockCredentialRetirementStage>;
|
|
225
244
|
}): Promise<UnlockCredentialRetirementResult>;
|
|
245
|
+
export {};
|
|
226
246
|
//# sourceMappingURL=retire.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFG;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,8BAA8B,CAAA;AAC7E,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;;;;GASG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,OAAO,CAAA;IACh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CAAA;KACjB,KAAK,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAC7C,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACrE,MAAM,EAAE,eAAe,CAAC,+BAA+B,CAAC,CAAA;CACzD,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAgF5C"}
|
package/dist/unlock/retire.js
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import { rotateRosterToDocumentAndCascade } from '../keys/index.js';
|
|
2
|
+
import { ceremonyEvents } from '../ceremonyEvents.js';
|
|
3
|
+
import { log as walletLog } from '../log.js';
|
|
2
4
|
import { removeUnlockKey } from './standingWebvh.js';
|
|
5
|
+
/**
|
|
6
|
+
* The stages the retirement reports on the ceremony event channel, in the
|
|
7
|
+
* order they land: the document inventory edit, the annex reach (when the
|
|
8
|
+
* closure ran and was not skipped), the roster rotation, and the collection
|
|
9
|
+
* fan-out (when every collection converged). A stage that found its work
|
|
10
|
+
* already done carries `prior: true`.
|
|
11
|
+
*/
|
|
12
|
+
export const UNLOCK_CREDENTIAL_RETIREMENT_STAGES = [
|
|
13
|
+
'inventory-edit',
|
|
14
|
+
'annex-inventory',
|
|
15
|
+
'roster-rotation',
|
|
16
|
+
'collection-epochs'
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* The retirement's typed refusals, matched by `err.name`: the retirement
|
|
20
|
+
* gate's unclaimed ladder VM, and an attributed inventory that names a
|
|
21
|
+
* surviving client's key. Both refuse before the edit publishes.
|
|
22
|
+
*/
|
|
23
|
+
const UNLOCK_CREDENTIAL_RETIREMENT_REFUSALS = [
|
|
24
|
+
'UnclaimedLadderVmRetirementError',
|
|
25
|
+
'LadderAttributionError'
|
|
26
|
+
];
|
|
3
27
|
/**
|
|
4
28
|
* Retires one standing unlock credential from an account. See the module doc
|
|
5
29
|
* for the order and the convergence story. Once the inventory edit lands, a
|
|
@@ -59,7 +83,34 @@ import { removeUnlockKey } from './standingWebvh.js';
|
|
|
59
83
|
* the session keeps operating without a re-login
|
|
60
84
|
* @returns {Promise<UnlockCredentialRetirementResult>}
|
|
61
85
|
*/
|
|
62
|
-
export async function retireUnlockCredential(
|
|
86
|
+
export async function retireUnlockCredential(options) {
|
|
87
|
+
const events = ceremonyEvents({
|
|
88
|
+
ceremony: 'unlock-credential-rotation',
|
|
89
|
+
log: walletLog,
|
|
90
|
+
refusals: UNLOCK_CREDENTIAL_RETIREMENT_REFUSALS
|
|
91
|
+
});
|
|
92
|
+
// Detail is counts alone: the retired credential's identifiers derive
|
|
93
|
+
// from its unlock secret, and the ladder arm runs on transient sessions.
|
|
94
|
+
return events.run(() => runUnlockCredentialRetirement({ ...options, events }), result => {
|
|
95
|
+
const failedStages = (result.clientAnnex?.reason === 'failed' ? 1 : 0) +
|
|
96
|
+
(result.rosterSeal?.outcome === 'failed' ? 1 : 0);
|
|
97
|
+
const failedCollections = result.collections.failed.length;
|
|
98
|
+
// A `no-ladder-seed` skip left the annex inventory standing.
|
|
99
|
+
const partial = failedStages > 0 ||
|
|
100
|
+
failedCollections > 0 ||
|
|
101
|
+
result.clientAnnex?.reason === 'no-ladder-seed' ||
|
|
102
|
+
(result.ladderVm?.unclaimed.length ?? 0) > 0;
|
|
103
|
+
return {
|
|
104
|
+
outcome: partial ? 'partial' : 'clean',
|
|
105
|
+
detail: { failedStages, failedCollections }
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The body of {@link retireUnlockCredential}, one run under its event
|
|
111
|
+
* emitter.
|
|
112
|
+
*/
|
|
113
|
+
async function runUnlockCredentialRetirement({ idStore, signer, unlockKeys, ladderSeed, projectionStore, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexInventory, onRotationAdopted, events }) {
|
|
63
114
|
// 1. The document inventory edit -- the credential's standing, first. It
|
|
64
115
|
// resolves the document as it now stands, which is what stage 2 resolves
|
|
65
116
|
// its remaining recipients from.
|
|
@@ -72,6 +123,7 @@ export async function retireUnlockCredential({ idStore, signer, unlockKeys, ladd
|
|
|
72
123
|
...(expectedDid !== undefined ? { expectedDid } : {}),
|
|
73
124
|
...(verb !== undefined ? { verb } : {})
|
|
74
125
|
});
|
|
126
|
+
events.stage('inventory-edit');
|
|
75
127
|
// 1b. The annex reach, against the post-edit document: strike the
|
|
76
128
|
// retired credential's rung inventory out of the pointed generation, or swap
|
|
77
129
|
// the generation out from under it. Best-effort by contract, enforced here:
|
|
@@ -85,6 +137,11 @@ export async function retireUnlockCredential({ idStore, signer, unlockKeys, ladd
|
|
|
85
137
|
catch {
|
|
86
138
|
clientAnnex = { action: 'skipped', reason: 'failed' };
|
|
87
139
|
}
|
|
140
|
+
if (clientAnnex.action !== 'skipped') {
|
|
141
|
+
events.stage('annex-inventory', {
|
|
142
|
+
...(clientAnnex.action === 'clean' ? { prior: true } : {})
|
|
143
|
+
});
|
|
144
|
+
}
|
|
88
145
|
}
|
|
89
146
|
// 2. The shared roster-and-cascade tail: the roster rotation onto the
|
|
90
147
|
// post-edit document (with its post-edit minimum controller version and its seal
|
|
@@ -100,6 +157,12 @@ export async function retireUnlockCredential({ idStore, signer, unlockKeys, ladd
|
|
|
100
157
|
...(onUserKeyAdopted ? { onUserKeyAdopted } : {}),
|
|
101
158
|
collections
|
|
102
159
|
});
|
|
160
|
+
if (tail.rosterDescriptor && tail.userKey) {
|
|
161
|
+
events.stage('roster-rotation', {
|
|
162
|
+
...(tail.rotated ? {} : { prior: true })
|
|
163
|
+
});
|
|
164
|
+
collectionStage({ events, collections: tail.collections });
|
|
165
|
+
}
|
|
103
166
|
if (!tail.rosterDescriptor || !tail.userKey) {
|
|
104
167
|
// No roster to rotate: the inventory edit has landed, so the credential IS
|
|
105
168
|
// retired -- a completed ceremony with nothing rotated.
|
|
@@ -125,4 +188,19 @@ export async function retireUnlockCredential({ idStore, signer, unlockKeys, ladd
|
|
|
125
188
|
...(clientAnnex ? { clientAnnex } : {})
|
|
126
189
|
};
|
|
127
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Emits the collection fan-out's stage when every collection converged, with
|
|
193
|
+
* `prior: true` when none needed a write.
|
|
194
|
+
*
|
|
195
|
+
* @param options {object}
|
|
196
|
+
* @param options.events {CeremonyEmitter} the running ceremony's emitter
|
|
197
|
+
* @param options.collections {UserKeyCascadeResult} the fan-out's result
|
|
198
|
+
*/
|
|
199
|
+
function collectionStage({ events, collections }) {
|
|
200
|
+
if (collections.failed.length > 0) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const wrote = Object.values(collections.outcomes).some(outcome => outcome !== 'noop');
|
|
204
|
+
events.stage('collection-epochs', { ...(wrote ? {} : { prior: true }) });
|
|
205
|
+
}
|
|
128
206
|
//# sourceMappingURL=retire.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAyFA,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAyFA,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,cAAc,EAAwB,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,EACL,eAAe,EAGhB,MAAM,oBAAoB,CAAA;AAuB3B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;CACX,CAAA;AAQV;;;;GAIG;AACH,MAAM,qCAAqC,GAAG;IAC5C,kCAAkC;IAClC,wBAAwB;CACzB,CAAA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ED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,QAAQ;QACR,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxC,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,eAAe,CAAC,EACvB,MAAM,EACN,WAAW,EAIZ;IACC,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,OAAM;IACR,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,IAAI,CACpD,OAAO,CAAC,EAAE,CAAC,OAAO,KAAK,MAAM,CAC9B,CAAA;IACD,MAAM,CAAC,KAAK,CAAC,mBAAmB,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;AAC1E,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.87.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"vitest": "^4.1.7"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@interop/was-client": ">=0.
|
|
56
|
+
"@interop/was-client": ">=0.80.0 <1.0.0"
|
|
57
57
|
},
|
|
58
58
|
"files": [
|
|
59
59
|
"dist",
|