@keri-ts/wallet 0.0.0-stage → 2.0.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.
@@ -0,0 +1,56 @@
1
+ /** Application inventory records, separate from public KEL/TEL/exchange evidence. */
2
+ import type { Operation } from "effection";
3
+ import { Komer, LMDBer, type LMDBerOptions, Suber } from "keri-ts/db";
4
+ import { RawRecord } from "keri-ts/runtime";
5
+ /** Exact issued view and its accepted registry reference; no derivation secret. */
6
+ export interface IssuedCredential {
7
+ credential: string;
8
+ registry: string;
9
+ controller: string;
10
+ update: string;
11
+ raw: string;
12
+ encoding: "base64";
13
+ /** Original bound Issuee ordinal (hex) and event digest, when supplied. */
14
+ bound: {
15
+ bn: string;
16
+ bd: string;
17
+ } | null;
18
+ }
19
+ /** Consent to one exact Grant/Admit pair; admitted is local time, not publication. */
20
+ export interface AdmittedCredential {
21
+ credential: string;
22
+ grant: string;
23
+ admit: string;
24
+ holder: string;
25
+ admitted: string;
26
+ }
27
+ /** Komer hydration of issued application records. */
28
+ export declare class IssuedRecord extends RawRecord<IssuedCredential> implements IssuedCredential {
29
+ credential: string;
30
+ registry: string;
31
+ controller: string;
32
+ update: string;
33
+ raw: string;
34
+ encoding: "base64";
35
+ bound: IssuedCredential["bound"];
36
+ }
37
+ /** Komer hydration of explicit consent records. */
38
+ export declare class AdmittedRecord extends RawRecord<AdmittedCredential> implements AdmittedCredential {
39
+ credential: string;
40
+ grant: string;
41
+ admit: string;
42
+ holder: string;
43
+ admitted: string;
44
+ }
45
+ /** Own only wallet inventory; protocol acceptance remains in the borrowed processors. */
46
+ export declare class WalletBaser extends LMDBer {
47
+ issued: Komer<IssuedRecord>;
48
+ admitted: Komer<AdmittedRecord>;
49
+ credentials: Suber;
50
+ constructor(options?: LMDBerOptions);
51
+ /** Rebind the application's ordinary typed tables on joined reopen. */
52
+ reopen(options?: Partial<LMDBerOptions>): Operation<boolean>;
53
+ }
54
+ /** Acquire a wallet environment; callers join close after all borrowed users finish. */
55
+ export declare function createWalletBaser(options?: LMDBerOptions): Operation<WalletBaser>;
56
+ //# sourceMappingURL=storing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storing.d.ts","sourceRoot":"","sources":["../../src/src/storing.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAwB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAElE,mFAAmF;AACnF,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,QAAQ,CAAC;IACnB,2EAA2E;IAC3E,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC1C;AACD,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,qDAAqD;AACrD,qBAAa,YAAa,SAAQ,SAAS,CAAC,gBAAgB,CAAE,YAAW,gBAAgB;IAC/E,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAC1C;AACD,mDAAmD;AACnD,qBAAa,cAAe,SAAQ,SAAS,CAAC,kBAAkB,CAAE,YAAW,kBAAkB;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAC1B;AACD,yFAAyF;AACzF,qBAAa,WAAY,SAAQ,MAAM;IACrC,MAAM,EAAG,KAAK,CAAC,YAAY,CAAC,CAAC;IAC7B,QAAQ,EAAG,KAAK,CAAC,cAAc,CAAC,CAAC;IACjC,WAAW,EAAG,KAAK,CAAC;gBAER,OAAO,GAAE,aAAkB;IAUvC,uEAAuE;IAC7D,MAAM,CAAC,OAAO,GAAE,OAAO,CAAC,aAAa,CAAM,GAAG,SAAS,CAAC,OAAO,CAAC;CAY3E;AACD,wFAAwF;AACxF,wBAAiB,iBAAiB,CAAC,OAAO,GAAE,aAAkB,GAAG,SAAS,CAAC,WAAW,CAAC,CAItF"}
@@ -0,0 +1,77 @@
1
+ /** Explicit ACDC inventory and consent over borrowed authenticated protocol evidence. */
2
+ import { SerderACDC, type SerderKERI, type Versionage } from "cesr-ts";
3
+ import { type Operation } from "effection";
4
+ import { type RegistryStore } from "keri-ts/db";
5
+ import { type Exchanger, type Habery, type Receiptor, type RegistryDisclosure, type WitnessAuthMap } from "keri-ts/runtime";
6
+ import { type AdmittedCredential, type IssuedCredential, WalletBaser } from "./storing.js";
7
+ /** Borrowed protocol owners and the application's separately owned inventory environment. */
8
+ export interface WalletOptions {
9
+ hby: Habery;
10
+ registry: RegistryStore;
11
+ exc: Exchanger;
12
+ db: WalletBaser;
13
+ }
14
+ /** Exact admitted node streams; no fuller cached section replaces retained disclosure. */
15
+ export interface HeldCredential {
16
+ credential: SerderACDC;
17
+ proof: Uint8Array;
18
+ artifacts: Uint8Array[];
19
+ grant: SerderKERI;
20
+ admit: string;
21
+ }
22
+ /** A signed response prepared after consent/current policy; intake and delivery remain caller-owned. */
23
+ export interface PreparedAdmit {
24
+ admit: SerderKERI;
25
+ wire: Uint8Array;
26
+ support: Uint8Array;
27
+ }
28
+ /** Inventory owns consent, never protocol acceptance, current standing or custody. */
29
+ export declare class Wallet {
30
+ readonly hby: Habery;
31
+ readonly registry: RegistryStore;
32
+ readonly exc: Exchanger;
33
+ readonly db: WalletBaser;
34
+ constructor({ hby, registry, exc, db }: WalletOptions);
35
+ /** Verify accepted local issuance, or return identical retained history without fresh proof. */
36
+ recordIssued(acdc: SerderACDC, update: string, { blinder }?: {
37
+ blinder?: RegistryDisclosure;
38
+ }): IssuedCredential;
39
+ /** Reconstruct the original serialization without asserting present registry standing. */
40
+ issuedCredential(said: string): SerderACDC;
41
+ /** Authenticate accepted outer evidence through existing replay, without current node policy. */
42
+ private accepted;
43
+ /** New use requires current node evidence and a valid root under shared issued-state policy. */
44
+ private graphAccepted;
45
+ /** Resolve only the origin actually carried by this accepted Grant. */
46
+ private origin;
47
+ /** Freeze an unsigned response only after explicit consent, exact prior authentication and current root truth. */
48
+ prepareAdmitBody(grant: string, holder: string, { consent, message, gvrsn }?: {
49
+ consent?: boolean;
50
+ message?: string;
51
+ gvrsn?: Versionage;
52
+ }): Operation<SerderKERI>;
53
+ /** Sign an individual response; group approval consumes the same unsigned body through its own exact-stream owner. */
54
+ prepareAdmit(grant: string, holder: string, { consent, message, gvrsn, receiptor, auths }?: {
55
+ consent?: boolean;
56
+ message?: string;
57
+ gvrsn?: Versionage;
58
+ receiptor?: Receiptor;
59
+ auths?: WitnessAuthMap;
60
+ }): Operation<PreparedAdmit>;
61
+ /** Record explicit local consent to one accepted, linked Grant/Admit pair. */
62
+ recordAdmission(grant: string, admit: string, { consent }?: {
63
+ consent?: boolean;
64
+ }): Promise<AdmittedCredential>;
65
+ /** Read the original admitted proof; later disclosures and current policy cannot expand it. */
66
+ heldCredential(grant: string, { presenterAuthorized }?: {
67
+ presenterAuthorized?: boolean;
68
+ }): Promise<HeldCredential>;
69
+ /** List historical references, with no current-standing or private-capability claim. */
70
+ inventory(): {
71
+ issued: IssuedCredential[];
72
+ held: AdmittedCredential[];
73
+ };
74
+ /** List distinct explicit disclosure admissions for the same credential. */
75
+ admissions(credential: string): AdmittedCredential[];
76
+ }
77
+ //# sourceMappingURL=wallet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/src/wallet.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAIL,UAAU,EACV,KAAK,UAAU,EACf,KAAK,UAAU,EAEhB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAML,KAAK,SAAS,EACd,KAAK,MAAM,EAIX,KAAK,SAAS,EACd,KAAK,kBAAkB,EAIvB,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3F,6FAA6F;AAC7F,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,aAAa,CAAC;IACxB,GAAG,EAAE,SAAS,CAAC;IACf,EAAE,EAAE,WAAW,CAAC;CACjB;AACD,0FAA0F;AAC1F,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AACD,wGAAwG;AACxG,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,E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