@interop/wallet-core 0.48.0 → 0.50.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.
Files changed (163) hide show
  1. package/README.md +5 -2
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +118 -0
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -0
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +174 -0
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -0
  6. package/dist/clientAnnex/forget.d.ts +138 -0
  7. package/dist/clientAnnex/forget.d.ts.map +1 -0
  8. package/dist/clientAnnex/forget.js +133 -0
  9. package/dist/clientAnnex/forget.js.map +1 -0
  10. package/dist/clientAnnex/forgetLast.d.ts +267 -0
  11. package/dist/clientAnnex/forgetLast.d.ts.map +1 -0
  12. package/dist/clientAnnex/forgetLast.js +374 -0
  13. package/dist/clientAnnex/forgetLast.js.map +1 -0
  14. package/dist/clientAnnex/gc.d.ts +255 -0
  15. package/dist/clientAnnex/gc.d.ts.map +1 -0
  16. package/dist/clientAnnex/gc.js +445 -0
  17. package/dist/clientAnnex/gc.js.map +1 -0
  18. package/dist/clientAnnex/index.d.ts +60 -0
  19. package/dist/clientAnnex/index.d.ts.map +1 -0
  20. package/dist/clientAnnex/index.js +60 -0
  21. package/dist/clientAnnex/index.js.map +1 -0
  22. package/dist/{unlock → clientAnnex}/ladder.d.ts +99 -23
  23. package/dist/clientAnnex/ladder.d.ts.map +1 -0
  24. package/dist/clientAnnex/ladder.js +474 -0
  25. package/dist/clientAnnex/ladder.js.map +1 -0
  26. package/dist/clientAnnex/ladderAnchored.d.ts +276 -0
  27. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -0
  28. package/dist/clientAnnex/ladderAnchored.js +631 -0
  29. package/dist/clientAnnex/ladderAnchored.js.map +1 -0
  30. package/dist/{webvh/companion.d.ts → clientAnnex/log.d.ts} +373 -152
  31. package/dist/clientAnnex/log.d.ts.map +1 -0
  32. package/dist/{webvh/companion.js → clientAnnex/log.js} +654 -261
  33. package/dist/clientAnnex/log.js.map +1 -0
  34. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +103 -0
  35. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -0
  36. package/dist/clientAnnex/recoveryLadderAnchored.js +263 -0
  37. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -0
  38. package/dist/{unlock → clientAnnex}/selfEnroll.d.ts +1 -1
  39. package/dist/clientAnnex/selfEnroll.d.ts.map +1 -0
  40. package/dist/{unlock → clientAnnex}/selfEnroll.js +1 -1
  41. package/dist/clientAnnex/selfEnroll.js.map +1 -0
  42. package/dist/clientAnnex/zcap.d.ts +49 -0
  43. package/dist/clientAnnex/zcap.d.ts.map +1 -0
  44. package/dist/clientAnnex/zcap.js +101 -0
  45. package/dist/clientAnnex/zcap.js.map +1 -0
  46. package/dist/clients/index.d.ts +9 -6
  47. package/dist/clients/index.d.ts.map +1 -1
  48. package/dist/clients/index.js +8 -5
  49. package/dist/clients/index.js.map +1 -1
  50. package/dist/clients/listing.d.ts +32 -0
  51. package/dist/clients/listing.d.ts.map +1 -1
  52. package/dist/clients/listing.js +47 -1
  53. package/dist/clients/listing.js.map +1 -1
  54. package/dist/clients/revocation.d.ts +33 -1
  55. package/dist/clients/revocation.d.ts.map +1 -1
  56. package/dist/clients/revocation.js +16 -4
  57. package/dist/clients/revocation.js.map +1 -1
  58. package/dist/enrollment/index.d.ts +6 -4
  59. package/dist/enrollment/index.d.ts.map +1 -1
  60. package/dist/enrollment/index.js +6 -4
  61. package/dist/enrollment/index.js.map +1 -1
  62. package/dist/enrollment/onboardingInvite.d.ts +5 -88
  63. package/dist/enrollment/onboardingInvite.d.ts.map +1 -1
  64. package/dist/enrollment/onboardingInvite.js +5 -168
  65. package/dist/enrollment/onboardingInvite.js.map +1 -1
  66. package/dist/genesis/index.d.ts +5 -0
  67. package/dist/genesis/index.d.ts.map +1 -1
  68. package/dist/genesis/index.js +5 -0
  69. package/dist/genesis/index.js.map +1 -1
  70. package/dist/keys/index.d.ts +1 -1
  71. package/dist/keys/index.d.ts.map +1 -1
  72. package/dist/keys/index.js +1 -1
  73. package/dist/keys/index.js.map +1 -1
  74. package/dist/keys/spaceEpochs.d.ts +7 -2
  75. package/dist/keys/spaceEpochs.d.ts.map +1 -1
  76. package/dist/keys/spaceEpochs.js +8 -2
  77. package/dist/keys/spaceEpochs.js.map +1 -1
  78. package/dist/keys/userKeyRoster.d.ts +39 -0
  79. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  80. package/dist/keys/userKeyRoster.js +43 -1
  81. package/dist/keys/userKeyRoster.js.map +1 -1
  82. package/dist/recovery/index.d.ts +5 -3
  83. package/dist/recovery/index.d.ts.map +1 -1
  84. package/dist/recovery/index.js +4 -2
  85. package/dist/recovery/index.js.map +1 -1
  86. package/dist/recovery/recoveryDelegation.d.ts +35 -12
  87. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  88. package/dist/recovery/recoveryDelegation.js +84 -86
  89. package/dist/recovery/recoveryDelegation.js.map +1 -1
  90. package/dist/recovery/recoveryWebvh.d.ts +32 -1
  91. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  92. package/dist/recovery/recoveryWebvh.js +2 -2
  93. package/dist/recovery/recoveryWebvh.js.map +1 -1
  94. package/dist/request/capabilityRequest.d.ts +33 -0
  95. package/dist/request/capabilityRequest.d.ts.map +1 -0
  96. package/dist/request/capabilityRequest.js +35 -0
  97. package/dist/request/capabilityRequest.js.map +1 -0
  98. package/dist/request/ephemeralExchange.d.ts +118 -0
  99. package/dist/request/ephemeralExchange.d.ts.map +1 -0
  100. package/dist/request/ephemeralExchange.js +224 -0
  101. package/dist/request/ephemeralExchange.js.map +1 -0
  102. package/dist/request/index.d.ts +6 -0
  103. package/dist/request/index.d.ts.map +1 -1
  104. package/dist/request/index.js +6 -0
  105. package/dist/request/index.js.map +1 -1
  106. package/dist/space/activity.d.ts +38 -0
  107. package/dist/space/activity.d.ts.map +1 -1
  108. package/dist/space/activity.js +41 -1
  109. package/dist/space/activity.js.map +1 -1
  110. package/dist/space/index.d.ts +1 -1
  111. package/dist/space/index.d.ts.map +1 -1
  112. package/dist/space/index.js +1 -1
  113. package/dist/space/index.js.map +1 -1
  114. package/dist/unlock/index.d.ts +11 -23
  115. package/dist/unlock/index.d.ts.map +1 -1
  116. package/dist/unlock/index.js +10 -21
  117. package/dist/unlock/index.js.map +1 -1
  118. package/dist/unlock/retire.d.ts +47 -3
  119. package/dist/unlock/retire.d.ts.map +1 -1
  120. package/dist/unlock/retire.js +21 -5
  121. package/dist/unlock/retire.js.map +1 -1
  122. package/dist/unlock/standingWebvh.d.ts +37 -82
  123. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  124. package/dist/unlock/standingWebvh.js +64 -247
  125. package/dist/unlock/standingWebvh.js.map +1 -1
  126. package/dist/unlock/unlockRecord.d.ts +13 -6
  127. package/dist/unlock/unlockRecord.d.ts.map +1 -1
  128. package/dist/unlock/unlockRecord.js +14 -8
  129. package/dist/unlock/unlockRecord.js.map +1 -1
  130. package/dist/webvh/delegatedLogStore.d.ts +5 -5
  131. package/dist/webvh/delegatedLogStore.js +1 -1
  132. package/dist/webvh/didWebvh.d.ts +20 -10
  133. package/dist/webvh/didWebvh.d.ts.map +1 -1
  134. package/dist/webvh/didWebvh.js +17 -17
  135. package/dist/webvh/didWebvh.js.map +1 -1
  136. package/dist/webvh/index.d.ts +9 -23
  137. package/dist/webvh/index.d.ts.map +1 -1
  138. package/dist/webvh/index.js +9 -22
  139. package/dist/webvh/index.js.map +1 -1
  140. package/dist/webvh/revokeClient.d.ts +77 -5
  141. package/dist/webvh/revokeClient.d.ts.map +1 -1
  142. package/dist/webvh/revokeClient.js +154 -61
  143. package/dist/webvh/revokeClient.js.map +1 -1
  144. package/dist/webvh/standingZcap.d.ts +11 -1
  145. package/dist/webvh/standingZcap.d.ts.map +1 -1
  146. package/dist/webvh/standingZcap.js +13 -14
  147. package/dist/webvh/standingZcap.js.map +1 -1
  148. package/dist/webvh/wasIdStore.d.ts +13 -7
  149. package/dist/webvh/wasIdStore.d.ts.map +1 -1
  150. package/dist/webvh/wasIdStore.js +8 -4
  151. package/dist/webvh/wasIdStore.js.map +1 -1
  152. package/dist/webvh/zcap.d.ts +0 -24
  153. package/dist/webvh/zcap.d.ts.map +1 -1
  154. package/dist/webvh/zcap.js +0 -42
  155. package/dist/webvh/zcap.js.map +1 -1
  156. package/package.json +40 -34
  157. package/dist/unlock/ladder.d.ts.map +0 -1
  158. package/dist/unlock/ladder.js +0 -254
  159. package/dist/unlock/ladder.js.map +0 -1
  160. package/dist/unlock/selfEnroll.d.ts.map +0 -1
  161. package/dist/unlock/selfEnroll.js.map +0 -1
  162. package/dist/webvh/companion.d.ts.map +0 -1
  163. package/dist/webvh/companion.js.map +0 -1
@@ -10,45 +10,33 @@
10
10
  * - `standingClientFromUnlockSeed` / `unlockClientIdentityFromSeed` -- the
11
11
  * deterministic client identity a credential derives (roster wrap target,
12
12
  * binding MAC key), shared with the recovery-code derivation.
13
- * - `generateLadderSeed` / `ladderRung` / `attributeLadderRung` -- the
14
- * update-key ladder: latent-and-consumed did:webvh update authority from a
15
- * random seed carried in the unlock record, current rung recovered from the
16
- * log itself, ambiguity failing closed. `ladderVmKeyMultibase` derives the
17
- * ladder VM (the stable sibling), the document-visible key a client-less
18
- * account anchors on.
19
- * - `createClientlessAccountLog` -- the client-less genesis log: an account
20
- * with zero enrolled durable clients, `updateKeys` = [rung 0], the ladder
21
- * VM under `assertionMethod` and `capabilityDelegation` only, and the
22
- * credential's `keyAgreement` posture folded into genesis. The window it
23
- * opens is closed atomically by the first durable self-enrollment's add
24
- * entry.
25
13
  * - `wrapUnlockRecord` / `unwrapUnlockRecord` / `remintUnlockRecordDelegations`
26
14
  * -- the unlock record codec: the credential-authenticated shell-and-core
27
15
  * layout (controller, email, pointer under the binding MAC; the bridge and
28
- * companion-Space `delegatedClients` delegations re-mintable; the ladder
29
- * seed sealed and carried verbatim).
16
+ * client-annex Space `delegatedClients` delegations re-mintable; the ladder
17
+ * seed sealed and carried verbatim, its `LADDER_SEED_BYTES` size owned by
18
+ * the record format).
30
19
  * - `publishUnlockKey` / `removeUnlockKey` -- the merged document posture
31
20
  * edit, parameterized by credential class: a verbatim `keyAgreement` entry,
32
21
  * or a `MultikeyCommitment` entry for a low-entropy-derived key.
33
22
  * - `retireUnlockCredential` -- the retirement ceremony behind "change my
34
23
  * passphrase" and "remove this passkey": the posture edit, then the shared
35
24
  * roster rotation and collection fan-out off the retired credential's wrap.
36
- * - `selfEnrollWebvhClient` / `selfEnrollClientCore` -- the self-enrolling
37
- * continuation (reveal a rung, add an ordinary client, retire the rung) and
38
- * the composed completion a fresh browser runs end to end.
25
+ *
26
+ * The ladder itself, and every ceremony that exercises it (the ladder-anchored
27
+ * genesis, self-enrollment, the forget ceremony), live in
28
+ * `@interop/wallet-core/clientAnnex` -- what stays here is the posture and
29
+ * record machinery every wallet needs regardless of posture.
39
30
  *
40
31
  * Kept out of the root export: this subpath pulls the webkms-client / ezcap /
41
32
  * was-client dependency graph (the same isolation pattern as `./keyring`).
42
33
  */
43
34
  export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentityFromSeed } from './standingClient.js';
44
35
  export type { StandingUnlockClient, UnlockClientIdentity } from './standingClient.js';
45
- export { attributeLadderRung, companionRung, companionRungSeed, generateLadderSeed, LADDER_MAX_SCAN, LADDER_SEED_BYTES, LadderAttributionError, ladderRung, ladderRungSeed, ladderVmKeyMultibase, ladderVmSeed } from './ladder.js';
46
- export type { LadderRung, LadderRungState } from './ladder.js';
47
- export { computeUnlockBinding, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
36
+ export { computeUnlockBinding, LADDER_SEED_BYTES, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
48
37
  export type { SealedRecordMember, SignedUnlockRecord, UnlockRecordContents, UnlockRecordProofState } from './unlockRecord.js';
49
- export { createClientlessAccountLog, publishUnlockKey, removeUnlockKey, selfEnrollWebvhClient, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
38
+ export { publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
50
39
  export type { StandingUnlockKeys, UnlockKeyAgreementPublication, UnlockLogStore } from './standingWebvh.js';
51
40
  export { retireUnlockCredential } from './retire.js';
52
- export type { UnlockCredentialRetirementResult } from './retire.js';
53
- export { selfEnrollClientCore } from './selfEnroll.js';
41
+ export type { ClientAnnexPostureRetirement, UnlockCredentialRetirementResult } from './retire.js';
54
42
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;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,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE9D,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,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10
10
  * - `standingClientFromUnlockSeed` / `unlockClientIdentityFromSeed` -- the
11
11
  * deterministic client identity a credential derives (roster wrap target,
12
12
  * binding MAC key), shared with the recovery-code derivation.
13
- * - `generateLadderSeed` / `ladderRung` / `attributeLadderRung` -- the
14
- * update-key ladder: latent-and-consumed did:webvh update authority from a
15
- * random seed carried in the unlock record, current rung recovered from the
16
- * log itself, ambiguity failing closed. `ladderVmKeyMultibase` derives the
17
- * ladder VM (the stable sibling), the document-visible key a client-less
18
- * account anchors on.
19
- * - `createClientlessAccountLog` -- the client-less genesis log: an account
20
- * with zero enrolled durable clients, `updateKeys` = [rung 0], the ladder
21
- * VM under `assertionMethod` and `capabilityDelegation` only, and the
22
- * credential's `keyAgreement` posture folded into genesis. The window it
23
- * opens is closed atomically by the first durable self-enrollment's add
24
- * entry.
25
13
  * - `wrapUnlockRecord` / `unwrapUnlockRecord` / `remintUnlockRecordDelegations`
26
14
  * -- the unlock record codec: the credential-authenticated shell-and-core
27
15
  * layout (controller, email, pointer under the binding MAC; the bridge and
28
- * companion-Space `delegatedClients` delegations re-mintable; the ladder
29
- * seed sealed and carried verbatim).
16
+ * client-annex Space `delegatedClients` delegations re-mintable; the ladder
17
+ * seed sealed and carried verbatim, its `LADDER_SEED_BYTES` size owned by
18
+ * the record format).
30
19
  * - `publishUnlockKey` / `removeUnlockKey` -- the merged document posture
31
20
  * edit, parameterized by credential class: a verbatim `keyAgreement` entry,
32
21
  * or a `MultikeyCommitment` entry for a low-entropy-derived key.
33
22
  * - `retireUnlockCredential` -- the retirement ceremony behind "change my
34
23
  * passphrase" and "remove this passkey": the posture edit, then the shared
35
24
  * roster rotation and collection fan-out off the retired credential's wrap.
36
- * - `selfEnrollWebvhClient` / `selfEnrollClientCore` -- the self-enrolling
37
- * continuation (reveal a rung, add an ordinary client, retire the rung) and
38
- * the composed completion a fresh browser runs end to end.
25
+ *
26
+ * The ladder itself, and every ceremony that exercises it (the ladder-anchored
27
+ * genesis, self-enrollment, the forget ceremony), live in
28
+ * `@interop/wallet-core/clientAnnex` -- what stays here is the posture and
29
+ * record machinery every wallet needs regardless of posture.
39
30
  *
40
31
  * Kept out of the root export: this subpath pulls the webkms-client / ezcap /
41
32
  * was-client dependency graph (the same isolation pattern as `./keyring`).
42
33
  */
43
34
  export { standingClientFromUnlockSeed, STANDING_CLIENT_SALT, unlockClientIdentityFromSeed } from './standingClient.js';
44
- export { attributeLadderRung, companionRung, companionRungSeed, generateLadderSeed, LADDER_MAX_SCAN, LADDER_SEED_BYTES, LadderAttributionError, ladderRung, ladderRungSeed, ladderVmKeyMultibase, ladderVmSeed } from './ladder.js';
45
- export { computeUnlockBinding, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
46
- export { createClientlessAccountLog, publishUnlockKey, removeUnlockKey, selfEnrollWebvhClient, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
35
+ export { computeUnlockBinding, LADDER_SEED_BYTES, remintUnlockRecordDelegations, UnlockBindingError, unlockRecordBinding, unwrapUnlockRecord, wrapUnlockRecord } from './unlockRecord.js';
36
+ export { publishUnlockKey, removeUnlockKey, unlockKeyVerificationMethod, unlockKeyVmId } from './standingWebvh.js';
47
37
  export { retireUnlockCredential } from './retire.js';
48
- export { selfEnrollClientCore } from './selfEnroll.js';
49
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACb,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAO3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/unlock/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAA;AAM5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,aAAa,EACd,MAAM,oBAAoB,CAAA;AAO3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
@@ -35,6 +35,24 @@
35
35
  * the app deletes as part of the change-method ceremony, and no other
36
36
  * credential's bridge chains through it.
37
37
  *
38
+ * The client annex reach is its own stage (1b, the injected
39
+ * `retireClientAnnexPosture` closure), between the document edit and the
40
+ * roster tail: a standing credential's annex rung-0 key and hash live in
41
+ * the pointed generation's log, kept nowhere the account document edit can
42
+ * reach, so without it a retired credential keeps annex-write authority
43
+ * for the life of the generation. The closure runs strike-or-swap: a
44
+ * dedicated strike entry signed by a distinct committed rung
45
+ * (`retireClientAnnexRung`) where the ceremony holds one, else a fresh
46
+ * generation minted from a surviving credential's seed and re-pointed under
47
+ * account-log update authority (`swapClientAnnexGeneration`), the retired rung
48
+ * dying with the old generation. It also owns retiring the credential's
49
+ * `delegatedClients` sibling: no server revocation is possible or needed --
50
+ * the sibling delegation's record dies with the unlock Space the caller
51
+ * deletes, and a swap (or the ordinary GC cadence) retires the generation it
52
+ * targeted. Best-effort by contract: the closure catches its own failures
53
+ * and reports them, so the roster rotation -- the ceremony's essential
54
+ * remedy -- always runs.
55
+ *
38
56
  * Convergence is the design: every stage detects its own completion from
39
57
  * durable state alone -- the posture edit no-ops when the document is already
40
58
  * settled, the rotation no-ops once every current-epoch recipient is
@@ -68,6 +86,20 @@ export interface UnlockCredentialRetirementResult {
68
86
  document: object;
69
87
  userKey?: UserKey;
70
88
  rosterDescriptor?: CollectionEncryption;
89
+ clientAnnex?: ClientAnnexPostureRetirement;
90
+ }
91
+ /**
92
+ * What the annex-posture stage reports: `struck` (a strike entry dropped
93
+ * the retired rung's key and hash), `swapped` (a fresh generation replaced
94
+ * the old one wholesale), `clean` (the pointed generation held no posture
95
+ * for the retired credential), or `skipped` with the reason (`no-pointer`:
96
+ * the account has no annex posture; `no-ladder-seed`: the ceremony holds
97
+ * no seed that could strike or swap; `failed`: the closure's best-effort
98
+ * catch).
99
+ */
100
+ export interface ClientAnnexPostureRetirement {
101
+ action: 'struck' | 'swapped' | 'clean' | 'skipped';
102
+ reason?: 'no-pointer' | 'no-ladder-seed' | 'failed';
71
103
  }
72
104
  /**
73
105
  * Retires one standing unlock credential from an account. See the module doc
@@ -80,8 +112,12 @@ export interface UnlockCredentialRetirementResult {
80
112
  * @param options.updateKeys {ClientWebvhUpdateKeys} the RETIRING (enrolled)
81
113
  * client's own did:webvh update-key seeds, which sign the posture edit
82
114
  * @param options.unlockKeys {StandingUnlockKeys} the retired credential's
83
- * public posture (its key-agreement publication and its committed update
84
- * key)
115
+ * public posture (its key-agreement publication and its recorded update
116
+ * key, which the posture edit treats as a ladder anchor rather than truth
117
+ * -- see `removeUnlockKey`)
118
+ * @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
119
+ * seed, when the ceremony holds the credential's secret; it strengthens the
120
+ * ladder attribution but is not required
85
121
  * @param [options.expectedDid] {string} the account DID from the caller's
86
122
  * stored account pointer; supplied, the posture edit refuses a `did.jsonl`
87
123
  * resolving to any other account
@@ -98,15 +134,20 @@ export interface UnlockCredentialRetirementResult {
98
134
  * called with `{ userKey, latestEpochId, descriptor }` after the roster read
99
135
  * and BEFORE the fan-out. The key and the epoch pin must persist atomically
100
136
  * @param options.collections {CascadeCollections} the fan-out's work
137
+ * @param [options.retireClientAnnexPosture] {Function} `({ document }) =>
138
+ * Promise<ClientAnnexPostureRetirement>` -- the annex reach (stage 1b in
139
+ * the module doc), run against the post-edit document; expected to catch
140
+ * its own failures and report them
101
141
  * @param [options.onRotationAdopted] {Function} `({ userKey }) =>
102
142
  * Promise<void>` -- the live-session adoption of a rotated key, run last so
103
143
  * the session keeps operating without a re-login
104
144
  * @returns {Promise<UnlockCredentialRetirementResult>}
105
145
  */
106
- export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, onRotationAdopted }: {
146
+ export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexPosture, onRotationAdopted }: {
107
147
  idStore: WebvhIdStore;
108
148
  updateKeys: ClientWebvhUpdateKeys;
109
149
  unlockKeys: StandingUnlockKeys;
150
+ ladderSeed?: Uint8Array;
110
151
  expectedDid?: string;
111
152
  verb?: string;
112
153
  rosterStore: EncryptionDescriptorStore;
@@ -119,6 +160,9 @@ export declare function retireUnlockCredential({ idStore, updateKeys, unlockKeys
119
160
  descriptor: CollectionEncryption;
120
161
  }) => Promise<void>;
121
162
  collections: CascadeCollections;
163
+ retireClientAnnexPosture?: (options: {
164
+ document: object;
165
+ }) => Promise<ClientAnnexPostureRetirement>;
122
166
  onRotationAdopted?: (rotation: {
123
167
  userKey: UserKey;
124
168
  }) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"retire.d.ts","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;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,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE7E;;;;;;;GAOG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,OAAO,EACP,UAAU,EACV,UAAU,EACV,WAAW,EACX,IAAI,EACJ,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EAClB,EAAE;IACD,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EAAE,OAAO,CAAA;QAChB,aAAa,EAAE,MAAM,CAAA;QACrB,UAAU,EAAE,oBAAoB,CAAA;KACjC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,wBAAwB,CAAC,EAAE,CAAC,OAAO,EAAE;QACnC,QAAQ,EAAE,MAAM,CAAA;KACjB,KAAK,OAAO,CAAC,4BAA4B,CAAC,CAAA;IAC3C,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAyD5C"}
@@ -11,8 +11,12 @@ import { removeUnlockKey } from './standingWebvh.js';
11
11
  * @param options.updateKeys {ClientWebvhUpdateKeys} the RETIRING (enrolled)
12
12
  * client's own did:webvh update-key seeds, which sign the posture edit
13
13
  * @param options.unlockKeys {StandingUnlockKeys} the retired credential's
14
- * public posture (its key-agreement publication and its committed update
15
- * key)
14
+ * public posture (its key-agreement publication and its recorded update
15
+ * key, which the posture edit treats as a ladder anchor rather than truth
16
+ * -- see `removeUnlockKey`)
17
+ * @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
18
+ * seed, when the ceremony holds the credential's secret; it strengthens the
19
+ * ladder attribution but is not required
16
20
  * @param [options.expectedDid] {string} the account DID from the caller's
17
21
  * stored account pointer; supplied, the posture edit refuses a `did.jsonl`
18
22
  * resolving to any other account
@@ -29,12 +33,16 @@ import { removeUnlockKey } from './standingWebvh.js';
29
33
  * called with `{ userKey, latestEpochId, descriptor }` after the roster read
30
34
  * and BEFORE the fan-out. The key and the epoch pin must persist atomically
31
35
  * @param options.collections {CascadeCollections} the fan-out's work
36
+ * @param [options.retireClientAnnexPosture] {Function} `({ document }) =>
37
+ * Promise<ClientAnnexPostureRetirement>` -- the annex reach (stage 1b in
38
+ * the module doc), run against the post-edit document; expected to catch
39
+ * its own failures and report them
32
40
  * @param [options.onRotationAdopted] {Function} `({ userKey }) =>
33
41
  * Promise<void>` -- the live-session adoption of a rotated key, run last so
34
42
  * the session keeps operating without a re-login
35
43
  * @returns {Promise<UnlockCredentialRetirementResult>}
36
44
  */
37
- export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, onRotationAdopted }) {
45
+ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, retireClientAnnexPosture, onRotationAdopted }) {
38
46
  // 1. The document posture edit -- the credential's standing, first. It
39
47
  // resolves the document as it now stands, which is what stage 2 resolves
40
48
  // its remaining recipients from.
@@ -42,9 +50,15 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
42
50
  idStore,
43
51
  updateKeys,
44
52
  unlockKeys,
53
+ ...(ladderSeed ? { ladderSeed } : {}),
45
54
  ...(expectedDid !== undefined ? { expectedDid } : {}),
46
55
  ...(verb !== undefined ? { verb } : {})
47
56
  });
57
+ // 1b. The annex reach, against the post-edit document: strike the
58
+ // retired credential's rung posture out of the pointed generation, or swap
59
+ // the generation out from under it. Best-effort by the closure's own
60
+ // contract, so the roster rotation below always runs.
61
+ const clientAnnex = await retireClientAnnexPosture?.({ document: doc });
48
62
  // 2. The shared roster-and-cascade tail: the roster rotation onto the
49
63
  // post-edit document (with its post-edit controller floor and its seal
50
64
  // backstop), then the collection fan-out onto the fresh key.
@@ -65,7 +79,8 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
65
79
  return {
66
80
  rotated: false,
67
81
  collections: tail.collections,
68
- document: doc
82
+ document: doc,
83
+ ...(clientAnnex ? { clientAnnex } : {})
69
84
  };
70
85
  }
71
86
  if (tail.rotated) {
@@ -77,7 +92,8 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
77
92
  collections: tail.collections,
78
93
  document: doc,
79
94
  userKey: tail.userKey,
80
- rosterDescriptor: tail.rosterDescriptor
95
+ rosterDescriptor: tail.rosterDescriptor,
96
+ ...(clientAnnex ? { clientAnnex } : {})
81
97
  };
82
98
  }
83
99
  //# sourceMappingURL=retire.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAoDA,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,eAAe,EAA2B,MAAM,oBAAoB,CAAA;AAmB7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAC3C,OAAO,EACP,UAAU,EACV,UAAU,EACV,WAAW,EACX,IAAI,EACJ,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EAkBlB;IACC,uEAAuE;IACvE,yEAAyE;IACzE,iCAAiC;IACjC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,eAAe,CAAC;QAC9C,OAAO;QACP,UAAU;QACV,UAAU;QACV,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxC,CAAC,CAAA;IAEF,sEAAsE;IACtE,uEAAuE;IACvE,6DAA6D;IAC7D,MAAM,IAAI,GAAG,MAAM,gCAAgC,CAAC;QAClD,WAAW;QACX,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC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AAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,GAAG;YACb,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxC,CAAA;IACH,CAAC;IAED,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,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"}
@@ -1,9 +1,10 @@
1
1
  import type { DIDDoc, DIDLog, VerificationMethod } from '@interop/did-method-webvh';
2
- import type { ClientWebvhUpdateKeys, WebvhEnrollmentKeys, WebvhIdStore } from '../webvh/didWebvh.js';
2
+ import type { ClientWebvhUpdateKeys, PublishedWebvhLog, WebvhIdStore } from '../webvh/didWebvh.js';
3
3
  /**
4
- * The narrow store seam the self-enrollment continuation writes through: a
5
- * public read of the log and the delegated `did.jsonl` PUT. A subset of
6
- * {@link WebvhIdStore}, so an app's remote-store class satisfies it too.
4
+ * The narrow store seam the self-enrolling and delegated-bridge ceremonies
5
+ * write through: a public read of the log and the delegated `did.jsonl` PUT.
6
+ * A subset of {@link WebvhIdStore}, so an app's remote-store class satisfies
7
+ * it too.
7
8
  */
8
9
  export type UnlockLogStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
9
10
  /**
@@ -63,44 +64,18 @@ export declare function unlockKeyVerificationMethod({ did, keyAgreement }: {
63
64
  keyAgreement: UnlockKeyAgreementPublication;
64
65
  }): VerificationMethod;
65
66
  /**
66
- * CLIENT-LESS GENESIS: assembles the one-entry did:webvh log of an account
67
- * with zero enrolled durable clients, anchored on the minting credential's
68
- * ladder alone. Everything derives from the ladder seed: rung 0 is the sole
69
- * `updateKeys` member and signs the entry, `nextKeyHashes` commits rung 0's
70
- * own carry-over hash plus rung 1 (the staged rung) -- the carry-over hash is
71
- * what the first durable self-enrollment's reveal-and-commit entry,
72
- * re-stating `updateKeys` containing rung 0, requires --
73
- * and the ladder VM (the stable sibling) is published under `assertionMethod`
74
- * and `capabilityDelegation` only. The credential's `keyAgreement` posture
75
- * entry is FOLDED INTO GENESIS -- no enrolled client exists to run the
76
- * separate bind entry ({@link publishUnlockKey}) -- so the genesis
77
- * `keyAgreement` array holds only the credential's entry.
78
- *
79
- * The client-less window this opens is closed by the credential's first
80
- * durable self-enrollment ({@link selfEnrollWebvhClient}), whose add entry
81
- * atomically publishes the client, retires rung 0, and removes the ladder VM.
82
- *
83
- * The caller owns publication (conditional, create-only) and the pointer
84
- * write that follows; this assembles and signs the log only.
67
+ * Reads and resolves the published log through the narrow store seam.
85
68
  *
86
69
  * @param options {object}
87
- * @param options.wasServerUrl {string}
88
- * @param options.spaceId {string}
89
- * @param options.ladderSeed {Uint8Array} the credential's ladder seed
90
- * @param options.keyAgreement {UnlockKeyAgreementPublication} the
91
- * credential's key-agreement publication (commitment or verbatim)
92
- * @returns {Promise<{ log: DIDLog, webDoc: object, did: string }>}
70
+ * @param options.store {UnlockLogStore}
71
+ * @param [options.expectedDid] {string} the account DID the log must resolve
72
+ * to, where the caller holds one
73
+ * @returns {Promise<PublishedWebvhLog>}
93
74
  */
94
- export declare function createClientlessAccountLog({ wasServerUrl, spaceId, ladderSeed, keyAgreement }: {
95
- wasServerUrl: string;
96
- spaceId: string;
97
- ladderSeed: Uint8Array;
98
- keyAgreement: UnlockKeyAgreementPublication;
99
- }): Promise<{
100
- log: DIDLog;
101
- webDoc: object;
102
- did: string;
103
- }>;
75
+ export declare function readLogOrThrow({ store, expectedDid }: {
76
+ store: UnlockLogStore;
77
+ expectedDid?: string;
78
+ }): Promise<PublishedWebvhLog>;
104
79
  /**
105
80
  * BIND (run by an enrolled client, root authority): publishes a standing
106
81
  * credential's split posture into the document -- one entry adding the
@@ -139,13 +114,29 @@ export declare function publishUnlockKey(options: {
139
114
  }>;
140
115
  /**
141
116
  * REMOVAL (run by an enrolled client, root authority): removes a standing
142
- * credential's posture from the document -- its `keyAgreement` entry and its
143
- * committed update-key hash -- in one entry. Idempotent. The roster-side half
144
- * (rotating the user key epoch off the credential's wrap) is the caller's,
145
- * and runs after this so the resolver's document no longer backs the removed
146
- * entry.
117
+ * credential's posture from the document -- its `keyAgreement` entry and
118
+ * everything of its ladder that still stands -- in one entry. Idempotent. The
119
+ * roster-side half (rotating the user key epoch off the credential's wrap) is
120
+ * the caller's, and runs after this so the resolver's document no longer
121
+ * backs the removed entry.
122
+ *
123
+ * The recorded `unlockKeys.updateKeyMultibase` is treated as an ANCHOR, not
124
+ * as truth: a credential that has self-enrolled since its bind advanced its
125
+ * standing commitment past the recorded rung, so the removal resolves the
126
+ * ladder's current footprint from the log itself
127
+ * ({@link attributeLadderPosture}) and strikes all of it -- every committed
128
+ * hash the ladder accounts for AND, for a torn self-enrollment, the revealed
129
+ * rung key still sitting in `updateKeys` (plus the never-claimed hashes its
130
+ * reveal entry committed). Trusting the recorded multibase alone would leave
131
+ * the live rung commitment standing: a latent re-seizure credential via the
132
+ * reveal mechanism. A supplied `ladderSeed` strengthens the attribution (every
133
+ * rung known a priori, independent of the anchor's staleness); without it the
134
+ * log walk alone resolves the footprint. For a single-key credential (a
135
+ * recovery code, a never-self-enrolled bind) the resolution degenerates to
136
+ * exactly the recorded key's hash, as before.
147
137
  *
148
- * @param options {object} see {@link publishUnlockKey}
138
+ * @param options {object} see {@link publishUnlockKey}, plus
139
+ * `[ladderSeed]` -- the retired credential's ladder seed, when in hand
149
140
  * @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} see
150
141
  * {@link publishUnlockKey}
151
142
  */
@@ -153,6 +144,7 @@ export declare function removeUnlockKey(options: {
153
144
  idStore: WebvhIdStore;
154
145
  updateKeys: ClientWebvhUpdateKeys;
155
146
  unlockKeys: StandingUnlockKeys;
147
+ ladderSeed?: Uint8Array;
156
148
  expectedDid?: string;
157
149
  verb?: string;
158
150
  }): Promise<{
@@ -160,41 +152,4 @@ export declare function removeUnlockKey(options: {
160
152
  doc: DIDDoc;
161
153
  log: DIDLog;
162
154
  }>;
163
- /**
164
- * SELF-ENROLLMENT (run by the credential-derived client through the delegated
165
- * `did.jsonl` PUT): writes the standing continuation described in the module
166
- * doc -- the reveal-and-commit entry signed by the attributed ladder rung,
167
- * then the add entry signed by the new ordinary client's update key, which
168
- * also retires the spent rung. Resumable from durable state alone: a
169
- * completed continuation is detected by the new client's update key already
170
- * being authorized (no-op), a torn one by the attribution finding the rung
171
- * already revealed. Both entries publish conditionally on the read they were
172
- * built on, and a race lost to a concurrent ceremony re-runs from the top --
173
- * re-attributing, which is exactly the retry-up-the-ladder resolution.
174
- *
175
- * @param options {object}
176
- * @param options.store {UnlockLogStore} public log read + delegated PUT
177
- * @param options.ladderSeed {Uint8Array} the credential's ladder seed, from
178
- * its unlock record
179
- * @param options.newClientKeys {WebvhEnrollmentKeys} the new ordinary
180
- * client's public halves
181
- * @param options.newClientUpdateSeeds {ClientWebvhUpdateKeys} the new
182
- * client's update-key seeds (minted by the self-enrolling flow, which
183
- * therefore holds them and can sign the add entry)
184
- * @param [options.expectedDid] {string} the account DID the log must resolve
185
- * to, from the credential-authenticated pointer
186
- * @returns {Promise<{ did: string, webDoc?: object }>} the account DID and,
187
- * when the add entry ran here, the final `did.json` projection for the
188
- * enrolled session to republish
189
- */
190
- export declare function selfEnrollWebvhClient(options: {
191
- store: UnlockLogStore;
192
- ladderSeed: Uint8Array;
193
- newClientKeys: WebvhEnrollmentKeys;
194
- newClientUpdateSeeds: ClientWebvhUpdateKeys;
195
- expectedDid?: string;
196
- }): Promise<{
197
- did: string;
198
- webDoc?: object;
199
- }>;
200
155
  //# sourceMappingURL=standingWebvh.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"standingWebvh.d.ts","sourceRoot":"","sources":["../../src/unlock/standingWebvh.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EACN,kBAAkB,EACnB,MAAM,2BAA2B,CAAA;AAmBlC,OAAO,KAAK,EACV,qBAAqB,EAErB,mBAAmB,EACnB,YAAY,EACb,MAAM,sBAAsB,CAAA;AAO7B;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,YAAY,EACZ,kBAAkB,GAAG,eAAe,CACrC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GACvC;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,6BAA6B,CAAA;IAC3C,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,YAAY,EACb,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,6BAA6B,CAAA;CAC5C,GAAG,MAAM,CAMT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,GAAG,EACH,YAAY,EACb,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,6BAA6B,CAAA;CAC5C,GAAG,kBAAkB,CAgBrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG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