@interop/wallet-core 0.101.1 → 0.104.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/README.md +36 -17
- package/dist/audiences/audienceGrant.d.ts +49 -0
- package/dist/audiences/audienceGrant.d.ts.map +1 -0
- package/dist/audiences/audienceGrant.js +46 -0
- package/dist/audiences/audienceGrant.js.map +1 -0
- package/dist/audiences/index.d.ts +10 -0
- package/dist/audiences/index.d.ts.map +1 -0
- package/dist/audiences/index.js +10 -0
- package/dist/audiences/index.js.map +1 -0
- package/dist/clientAnnex/grantRevocation.d.ts +0 -18
- package/dist/clientAnnex/grantRevocation.d.ts.map +1 -1
- package/dist/clientAnnex/grantRevocation.js +2 -40
- package/dist/clientAnnex/grantRevocation.js.map +1 -1
- package/dist/clientAnnex/index.d.ts +2 -1
- package/dist/clientAnnex/index.d.ts.map +1 -1
- package/dist/clientAnnex/index.js +2 -1
- package/dist/clientAnnex/index.js.map +1 -1
- package/dist/clientAnnex/log.d.ts +4 -42
- package/dist/clientAnnex/log.d.ts.map +1 -1
- package/dist/clientAnnex/log.js +10 -65
- package/dist/clientAnnex/log.js.map +1 -1
- package/dist/clients/rosterPolicy.d.ts.map +1 -1
- package/dist/clients/rosterPolicy.js +3 -1
- package/dist/clients/rosterPolicy.js.map +1 -1
- package/dist/connections/didKey.d.ts +27 -0
- package/dist/connections/didKey.d.ts.map +1 -1
- package/dist/connections/didKey.js +42 -6
- package/dist/connections/didKey.js.map +1 -1
- package/dist/connections/entry.d.ts +95 -13
- package/dist/connections/entry.d.ts.map +1 -1
- package/dist/connections/entry.js +102 -16
- package/dist/connections/entry.js.map +1 -1
- package/dist/connections/grantProof.d.ts +64 -0
- package/dist/connections/grantProof.d.ts.map +1 -0
- package/dist/connections/grantProof.js +195 -0
- package/dist/connections/grantProof.js.map +1 -0
- package/dist/connections/grants.d.ts +225 -3
- package/dist/connections/grants.d.ts.map +1 -1
- package/dist/connections/grants.js +293 -8
- package/dist/connections/grants.js.map +1 -1
- package/dist/connections/index.d.ts +22 -8
- package/dist/connections/index.d.ts.map +1 -1
- package/dist/connections/index.js +19 -6
- package/dist/connections/index.js.map +1 -1
- package/dist/connections/read.d.ts.map +1 -1
- package/dist/connections/read.js +2 -1
- package/dist/connections/read.js.map +1 -1
- package/dist/connections/resourceId.d.ts +33 -0
- package/dist/connections/resourceId.d.ts.map +1 -1
- package/dist/connections/resourceId.js +88 -8
- package/dist/connections/resourceId.js.map +1 -1
- package/dist/connections/upsert.d.ts +252 -7
- package/dist/connections/upsert.d.ts.map +1 -1
- package/dist/connections/upsert.js +674 -41
- package/dist/connections/upsert.js.map +1 -1
- package/dist/connections/writers.js +2 -1
- package/dist/connections/writers.js.map +1 -1
- package/dist/descriptors/index.d.ts +5 -0
- package/dist/descriptors/index.d.ts.map +1 -1
- package/dist/descriptors/index.js +5 -0
- package/dist/descriptors/index.js.map +1 -1
- package/dist/descriptors/logSource.d.ts +9 -4
- package/dist/descriptors/logSource.d.ts.map +1 -1
- package/dist/descriptors/logSource.js +13 -6
- package/dist/descriptors/logSource.js.map +1 -1
- package/dist/jsonObject.d.ts +16 -0
- package/dist/jsonObject.d.ts.map +1 -0
- package/dist/jsonObject.js +18 -0
- package/dist/jsonObject.js.map +1 -0
- package/dist/keys/index.d.ts +13 -9
- package/dist/keys/index.d.ts.map +1 -1
- package/dist/keys/index.js +11 -7
- package/dist/keys/index.js.map +1 -1
- package/dist/keys/userKeyCascade.d.ts +46 -0
- package/dist/keys/userKeyCascade.d.ts.map +1 -1
- package/dist/keys/userKeyCascade.js +153 -65
- package/dist/keys/userKeyCascade.js.map +1 -1
- package/dist/keys/userKeyRoster.d.ts +60 -7
- package/dist/keys/userKeyRoster.d.ts.map +1 -1
- package/dist/keys/userKeyRoster.js +165 -47
- package/dist/keys/userKeyRoster.js.map +1 -1
- package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
- package/dist/keys/userKeyRosterCascade.js +1 -0
- package/dist/keys/userKeyRosterCascade.js.map +1 -1
- package/dist/menders/ids.d.ts +1 -1
- package/dist/menders/ids.d.ts.map +1 -1
- package/dist/menders/ids.js +20 -4
- package/dist/menders/ids.js.map +1 -1
- package/dist/resourceLog/controller.d.ts +11 -7
- package/dist/resourceLog/controller.d.ts.map +1 -1
- package/dist/resourceLog/controller.js +15 -31
- package/dist/resourceLog/controller.js.map +1 -1
- package/dist/resourceLog/document.d.ts +9 -11
- package/dist/resourceLog/document.d.ts.map +1 -1
- package/dist/resourceLog/document.js +9 -11
- package/dist/resourceLog/document.js.map +1 -1
- package/dist/space/collections.d.ts +23 -3
- package/dist/space/collections.d.ts.map +1 -1
- package/dist/space/collections.js +26 -2
- package/dist/space/collections.js.map +1 -1
- package/dist/space/inboxMessage.d.ts +47 -0
- package/dist/space/inboxMessage.d.ts.map +1 -0
- package/dist/space/inboxMessage.js +86 -0
- package/dist/space/inboxMessage.js.map +1 -0
- package/dist/space/index.d.ts +6 -1
- package/dist/space/index.d.ts.map +1 -1
- package/dist/space/index.js +5 -1
- package/dist/space/index.js.map +1 -1
- package/dist/sync/contactsConflict.d.ts +23 -10
- package/dist/sync/contactsConflict.d.ts.map +1 -1
- package/dist/sync/contactsConflict.js +40 -21
- package/dist/sync/contactsConflict.js.map +1 -1
- package/dist/unlock/index.d.ts +1 -1
- 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/webvh/clientAnnexDid.d.ts +76 -0
- package/dist/webvh/clientAnnexDid.d.ts.map +1 -0
- package/dist/webvh/clientAnnexDid.js +117 -0
- package/dist/webvh/clientAnnexDid.js.map +1 -0
- package/dist/webvh/didWebProjection.d.ts +38 -5
- package/dist/webvh/didWebProjection.d.ts.map +1 -1
- package/dist/webvh/didWebProjection.js +35 -22
- package/dist/webvh/didWebProjection.js.map +1 -1
- package/dist/webvh/documentDids.d.ts +3 -3
- package/dist/webvh/documentDids.js +3 -3
- package/dist/webvh/index.d.ts +4 -3
- package/dist/webvh/index.d.ts.map +1 -1
- package/dist/webvh/index.js +4 -3
- package/dist/webvh/index.js.map +1 -1
- package/dist/webvh/standingZcap.d.ts +27 -2
- package/dist/webvh/standingZcap.d.ts.map +1 -1
- package/dist/webvh/standingZcap.js +42 -4
- package/dist/webvh/standingZcap.js.map +1 -1
- package/package.json +14 -7
package/dist/webvh/index.js
CHANGED
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
* through, over the parameterized `wasWebvhLogStore` (any collection's
|
|
64
64
|
* `did.jsonl`), which also serves a client-annex generation's log.
|
|
65
65
|
* - `ensureDidWebProjection` / `putDidWebProjection` -- the `did:web`
|
|
66
|
-
* projection (`id/did.json`) writers
|
|
66
|
+
* projection (`id/did.json`) writers, with the ensure's compare exported on
|
|
67
|
+
* its own as `didWebProjectionCurrent`. The publish tails PUT it
|
|
67
68
|
* unconditionally behind a won log compare-and-swap; the ensure compares
|
|
68
69
|
* the served document against the one the resolved log derives and writes
|
|
69
70
|
* only on a difference -- re-resolving through the caller's optional
|
|
@@ -94,9 +95,9 @@
|
|
|
94
95
|
export { assertCanonicalClientKeys, BYOE_CONTEXT_URL, clientAdditionFields, clientKeyAgreementController, commitmentMatchesKey, didWebvhControllerTemplate, ensureDidWebvh, keyAgreementCommitment, keyAgreementTwinMultibase, MULTIKEY_COMMITMENT_VM_TYPE, markedVerificationMethodPair, mintClientWebvhUpdateKeys, rotateWebvhUpdateKey, servedHead, updateKeyMultibase, WebvhLogConflictError, withLogConflictRetry, withThreadedHeadOnce } from './didWebvh.js';
|
|
95
96
|
export { accountControllerResolver, accountLogPinId, logResourcePinId, AccountLogMissingError, verifiedAccountLogOf, verifyAccountLog } from './verifyLog.js';
|
|
96
97
|
export { wasWebvhIdStore, wasWebvhLogStore } from './wasIdStore.js';
|
|
97
|
-
export { ensureDidWebProjection, putDidWebProjection } from './didWebProjection.js';
|
|
98
|
+
export { didWebProjectionCurrent, ensureDidWebProjection, putDidWebProjection } from './didWebProjection.js';
|
|
98
99
|
export { delegatedWebvhLogStore } from './delegatedLogStore.js';
|
|
99
|
-
export { delegationAtExpiry, delegationExpired, delegationProofKeyId, delegationSignerGone, recordedZcapStale, REVOCATION_CLOCK_SKEW_MS, STANDING_ZCAP_TTL_MS, standingZcapStale, ZCAP_RENEWAL_WINDOW_MS, zcapExpiring } from './standingZcap.js';
|
|
100
|
+
export { delegationAtExpiry, delegationExpired, delegationProofKeyId, delegationSignerGone, recordedZcapStale, REVOCATION_CLOCK_SKEW_MS, STANDING_ZCAP_TTL_MS, standingZcapStale, embeddedParentCapability, firstDelegationProof, ZCAP_RENEWAL_WINDOW_MS, zcapExpiring } from './standingZcap.js';
|
|
100
101
|
export { attributeClientUpdateKey, delegationKeyInDocument, documentKeyMultibases, enrolledClientVmIds, isLastEnrolledClient, listEnrolledWebvhClients, markedKeyAgreementMethods, markedKeyAgreementMultibases } from './listClients.js';
|
|
101
102
|
export { mergeVerificationMethods } from './mergeMethods.js';
|
|
102
103
|
export { accountLogDids, walletClientDid } from './documentDids.js';
|
package/dist/webvh/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webvh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webvh/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,qBAAq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L,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,kBAAkB,CAAA;AAsBzB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAGzC,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,WAAW,EACX,eAAe,EAChB,MAAM,WAAW,CAAA"}
|
|
@@ -22,15 +22,19 @@ export declare const ZCAP_RENEWAL_WINDOW_MS: number;
|
|
|
22
22
|
* records beside its registry entries. The re-mint passes and the wallets'
|
|
23
23
|
* login-time checks all ask this one predicate. A record carrying no expiry
|
|
24
24
|
* (or an unparseable one) is uncheckable and therefore not assumed healthy,
|
|
25
|
-
* matching the rot check's treatment of a missing `delegationKeyId`.
|
|
25
|
+
* matching the rot check's treatment of a missing `delegationKeyId`. The
|
|
26
|
+
* window is {@link ZCAP_RENEWAL_WINDOW_MS} unless a caller with a window of
|
|
27
|
+
* its own (the agent grant renewal) passes one.
|
|
26
28
|
*
|
|
27
29
|
* @param options {object}
|
|
28
30
|
* @param [options.expires] {string} the recorded ISO 8601 expiry
|
|
31
|
+
* @param [options.windowMs] {number} the renewal window
|
|
29
32
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
30
33
|
* @returns {boolean}
|
|
31
34
|
*/
|
|
32
|
-
export declare function zcapExpiring({ expires, now }: {
|
|
35
|
+
export declare function zcapExpiring({ expires, windowMs, now }: {
|
|
33
36
|
expires?: string;
|
|
37
|
+
windowMs?: number;
|
|
34
38
|
now?: number;
|
|
35
39
|
}): boolean;
|
|
36
40
|
/**
|
|
@@ -89,6 +93,27 @@ export declare function delegationAtExpiry({ zcap, now }: {
|
|
|
89
93
|
* @returns {string | undefined}
|
|
90
94
|
*/
|
|
91
95
|
export declare function delegationProofKeyId(delegation: IZcap): string | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* The one proof a delegation is read by. A delegated zcap carries exactly
|
|
98
|
+
* one `capabilityDelegation` proof, but the wire shape allows an array, so
|
|
99
|
+
* the first proof of a set is the one every reader here takes. Returns
|
|
100
|
+
* `undefined` when the proof is absent or not an object.
|
|
101
|
+
*
|
|
102
|
+
* @param delegation {IZcap}
|
|
103
|
+
* @returns {Record<string, unknown> | undefined}
|
|
104
|
+
*/
|
|
105
|
+
export declare function firstDelegationProof(delegation: IZcap): Record<string, unknown> | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* The parent capability a delegation embeds as the last link of its
|
|
108
|
+
* `proof.capabilityChain`, when the chain embeds one (an object rather than
|
|
109
|
+
* an id string), read off {@link firstDelegationProof}. A grant a transient session minted embeds its parent, the generation
|
|
110
|
+
* delegation, there; a grant delegated under the Space root carries only the
|
|
111
|
+
* root's id string.
|
|
112
|
+
*
|
|
113
|
+
* @param zcap {IZcap}
|
|
114
|
+
* @returns {IZcap | undefined}
|
|
115
|
+
*/
|
|
116
|
+
export declare function embeddedParentCapability(zcap: IZcap): IZcap | undefined;
|
|
92
117
|
/**
|
|
93
118
|
* Whether a delegation's proof key has checkably left the verified account
|
|
94
119
|
* document under `capabilityDelegation` -- the current-key-set rule read for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standingZcap.d.ts","sourceRoot":"","sources":["../../src/webvh/standingZcap.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAEzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,QAA4B,CAAA;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAA2B,CAAA;AAE9D
|
|
1
|
+
{"version":3,"file":"standingZcap.d.ts","sourceRoot":"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AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,GAAG,EACJ,EAAE;IACD,IAAI,EAAE,KAAK,CAAA;IACX,GAAG,EAAE,oBAAoB,CAAA;CAC1B,GAAG,OAAO,CASV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,GAAG,EACH,eAAe,EACf,OAAO,EACP,qBAA0B,EAC1B,GAAgB,EACjB,EAAE;IACD,GAAG,CAAC,EAAE,oBAAoB,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAA;IAChC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAuBV;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,GAAG,EACH,qBAAqB,EACrB,GAAG,EACJ,EAAE;IACD,IAAI,EAAE,KAAK,CAAA;IACX,GAAG,CAAC,EAAE,oBAAoB,CAAA;IAC1B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAA;IAChC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAUV"}
|
|
@@ -43,14 +43,17 @@ export const ZCAP_RENEWAL_WINDOW_MS = 30 * 24 * 60 * 60 * 1000;
|
|
|
43
43
|
* records beside its registry entries. The re-mint passes and the wallets'
|
|
44
44
|
* login-time checks all ask this one predicate. A record carrying no expiry
|
|
45
45
|
* (or an unparseable one) is uncheckable and therefore not assumed healthy,
|
|
46
|
-
* matching the rot check's treatment of a missing `delegationKeyId`.
|
|
46
|
+
* matching the rot check's treatment of a missing `delegationKeyId`. The
|
|
47
|
+
* window is {@link ZCAP_RENEWAL_WINDOW_MS} unless a caller with a window of
|
|
48
|
+
* its own (the agent grant renewal) passes one.
|
|
47
49
|
*
|
|
48
50
|
* @param options {object}
|
|
49
51
|
* @param [options.expires] {string} the recorded ISO 8601 expiry
|
|
52
|
+
* @param [options.windowMs] {number} the renewal window
|
|
50
53
|
* @param [options.now] {number} epoch milliseconds, for tests
|
|
51
54
|
* @returns {boolean}
|
|
52
55
|
*/
|
|
53
|
-
export function zcapExpiring({ expires, now = Date.now() }) {
|
|
56
|
+
export function zcapExpiring({ expires, windowMs = ZCAP_RENEWAL_WINDOW_MS, now = Date.now() }) {
|
|
54
57
|
if (!expires) {
|
|
55
58
|
return true;
|
|
56
59
|
}
|
|
@@ -58,7 +61,7 @@ export function zcapExpiring({ expires, now = Date.now() }) {
|
|
|
58
61
|
if (Number.isNaN(expiresAt)) {
|
|
59
62
|
return true;
|
|
60
63
|
}
|
|
61
|
-
return expiresAt - now <=
|
|
64
|
+
return expiresAt - now <= windowMs;
|
|
62
65
|
}
|
|
63
66
|
/**
|
|
64
67
|
* How far the client's clock may run ahead of or behind the server's before
|
|
@@ -131,9 +134,44 @@ export function delegationAtExpiry({ zcap, now }) {
|
|
|
131
134
|
* @returns {string | undefined}
|
|
132
135
|
*/
|
|
133
136
|
export function delegationProofKeyId(delegation) {
|
|
137
|
+
const single = firstDelegationProof(delegation);
|
|
138
|
+
const keyId = single
|
|
139
|
+
?.verificationMethod;
|
|
140
|
+
return typeof keyId === 'string' ? keyId : undefined;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The one proof a delegation is read by. A delegated zcap carries exactly
|
|
144
|
+
* one `capabilityDelegation` proof, but the wire shape allows an array, so
|
|
145
|
+
* the first proof of a set is the one every reader here takes. Returns
|
|
146
|
+
* `undefined` when the proof is absent or not an object.
|
|
147
|
+
*
|
|
148
|
+
* @param delegation {IZcap}
|
|
149
|
+
* @returns {Record<string, unknown> | undefined}
|
|
150
|
+
*/
|
|
151
|
+
export function firstDelegationProof(delegation) {
|
|
134
152
|
const { proof } = delegation;
|
|
135
153
|
const single = Array.isArray(proof) ? proof[0] : proof;
|
|
136
|
-
return single
|
|
154
|
+
return single !== null && typeof single === 'object'
|
|
155
|
+
? single
|
|
156
|
+
: undefined;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The parent capability a delegation embeds as the last link of its
|
|
160
|
+
* `proof.capabilityChain`, when the chain embeds one (an object rather than
|
|
161
|
+
* an id string), read off {@link firstDelegationProof}. A grant a transient session minted embeds its parent, the generation
|
|
162
|
+
* delegation, there; a grant delegated under the Space root carries only the
|
|
163
|
+
* root's id string.
|
|
164
|
+
*
|
|
165
|
+
* @param zcap {IZcap}
|
|
166
|
+
* @returns {IZcap | undefined}
|
|
167
|
+
*/
|
|
168
|
+
export function embeddedParentCapability(zcap) {
|
|
169
|
+
const chain = firstDelegationProof(zcap)?.capabilityChain;
|
|
170
|
+
if (!Array.isArray(chain) || chain.length === 0) {
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
const last = chain[chain.length - 1];
|
|
174
|
+
return last !== null && typeof last === 'object' ? last : undefined;
|
|
137
175
|
}
|
|
138
176
|
/**
|
|
139
177
|
* Whether a delegation's proof key has checkably left the verified account
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standingZcap.js","sourceRoot":"","sources":["../../src/webvh/standingZcap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAG1D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAE7D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAE9D
|
|
1
|
+
{"version":3,"file":"standingZcap.js","sourceRoot":"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AC,CAAC,EAAE,CAAC;QACzE,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtC,CAAC,CAAA;AACJ,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.104.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "pnpm run clear && tsc",
|
|
@@ -23,12 +23,13 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@interop/capability-agent": "^0.2.1",
|
|
25
25
|
"@interop/data-integrity-core": "^8.8.0",
|
|
26
|
-
"@interop/
|
|
26
|
+
"@interop/data-integrity-proof": "^3.4.7",
|
|
27
|
+
"@interop/did-method-webvh": "^5.13.0",
|
|
27
28
|
"@interop/ed25519-signature": "^7.2.3",
|
|
28
29
|
"@interop/ed25519-verification-key": "^8.2.1",
|
|
29
|
-
"@interop/ezcap": "^7.5.
|
|
30
|
+
"@interop/ezcap": "^7.5.1",
|
|
30
31
|
"@interop/social-core": "^0.8.1",
|
|
31
|
-
"@interop/vh-resource-log": "^0.
|
|
32
|
+
"@interop/vh-resource-log": "^0.7.0",
|
|
32
33
|
"@interop/x25519-key-agreement-key": "^5.4.1",
|
|
33
34
|
"@noble/ciphers": "^2.3.0",
|
|
34
35
|
"@noble/hashes": "^2.3.0",
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"@eslint/js": "^10.0.1",
|
|
40
41
|
"@interop/logger": "^0.2.0",
|
|
41
42
|
"@interop/storage-core": "^0.35.1",
|
|
42
|
-
"@interop/was-client": "^0.
|
|
43
|
+
"@interop/was-client": "^0.93.2",
|
|
43
44
|
"@playwright/test": "^1.60.0",
|
|
44
45
|
"@types/node": "^26.0.1",
|
|
45
46
|
"@vitest/coverage-v8": "^4.1.7",
|
|
@@ -52,10 +53,10 @@
|
|
|
52
53
|
"typescript-eslint": "^8.59.4",
|
|
53
54
|
"vite": "^8.0.14",
|
|
54
55
|
"vitest": "^4.1.7",
|
|
55
|
-
"was-teaching-server": "^0.
|
|
56
|
+
"was-teaching-server": "^0.42.1"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
|
-
"@interop/was-client": ">=0.
|
|
59
|
+
"@interop/was-client": ">=0.92.0 <1.0.0"
|
|
59
60
|
},
|
|
60
61
|
"files": [
|
|
61
62
|
"dist",
|
|
@@ -201,6 +202,12 @@
|
|
|
201
202
|
"import": "./dist/clients/index.js",
|
|
202
203
|
"default": "./dist/clients/index.js"
|
|
203
204
|
},
|
|
205
|
+
"./audiences": {
|
|
206
|
+
"types": "./dist/audiences/index.d.ts",
|
|
207
|
+
"react-native": "./dist/audiences/index.js",
|
|
208
|
+
"import": "./dist/audiences/index.js",
|
|
209
|
+
"default": "./dist/audiences/index.js"
|
|
210
|
+
},
|
|
204
211
|
"./connections": {
|
|
205
212
|
"types": "./dist/connections/index.d.ts",
|
|
206
213
|
"react-native": "./dist/connections/index.js",
|