signify-ts 0.2.0 → 0.3.0-rc1

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 (61) hide show
  1. package/README.md +48 -26
  2. package/dist/exports.d.ts +1 -1
  3. package/dist/index.d.ts +0 -1
  4. package/dist/keri/app/aiding.d.ts +29 -9
  5. package/dist/keri/app/clienting.d.ts +28 -13
  6. package/dist/keri/app/contacting.d.ts +31 -19
  7. package/dist/keri/app/coring.d.ts +26 -2
  8. package/dist/keri/app/credentialing.d.ts +189 -49
  9. package/dist/keri/app/delegating.d.ts +18 -0
  10. package/dist/keri/app/exchanging.d.ts +4 -3
  11. package/dist/keri/app/notifying.d.ts +1 -1
  12. package/dist/keri/core/base64.d.ts +4 -0
  13. package/dist/keri/core/core.d.ts +2 -0
  14. package/dist/keri/core/httping.d.ts +2 -0
  15. package/dist/keri/core/keeping.d.ts +60 -41
  16. package/dist/keri/core/saider.d.ts +1 -0
  17. package/dist/keri/core/state.d.ts +62 -0
  18. package/dist/keri/end/ending.d.ts +10 -8
  19. package/dist/signify-ts.cjs +683 -538
  20. package/dist/signify-ts.cjs.map +4 -4
  21. package/dist/signify-ts.mjs +683 -538
  22. package/dist/signify-ts.mjs.map +4 -4
  23. package/package.json +33 -10
  24. package/src/exports.ts +1 -1
  25. package/src/index.ts +0 -1
  26. package/src/keri/app/aiding.ts +64 -35
  27. package/src/keri/app/clienting.ts +47 -50
  28. package/src/keri/app/contacting.ts +36 -21
  29. package/src/keri/app/coring.ts +81 -3
  30. package/src/keri/app/credentialing.ts +382 -197
  31. package/src/keri/app/delegating.ts +33 -0
  32. package/src/keri/app/exchanging.ts +24 -21
  33. package/src/keri/app/notifying.ts +2 -2
  34. package/src/keri/core/authing.ts +12 -5
  35. package/src/keri/core/base64.ts +28 -0
  36. package/src/keri/core/bexter.ts +4 -3
  37. package/src/keri/core/core.ts +2 -0
  38. package/src/keri/core/diger.ts +1 -1
  39. package/src/keri/core/eventing.ts +4 -4
  40. package/src/keri/core/httping.ts +6 -3
  41. package/src/keri/core/indexer.ts +4 -4
  42. package/src/keri/core/keeping.ts +143 -105
  43. package/src/keri/core/matter.ts +5 -5
  44. package/src/keri/core/number.ts +1 -1
  45. package/src/keri/core/prefixer.ts +2 -2
  46. package/src/keri/core/saider.ts +1 -1
  47. package/src/keri/core/serder.ts +1 -1
  48. package/src/keri/core/state.ts +69 -0
  49. package/src/keri/core/tholder.ts +5 -6
  50. package/src/keri/end/ending.ts +78 -81
  51. package/dist/buffer-polyfill.d.ts +0 -1
  52. package/dist/index.js +0 -8
  53. package/dist/math.d.ts +0 -1
  54. package/dist/signify-ts.cjs.development.js +0 -9501
  55. package/dist/signify-ts.cjs.development.js.map +0 -1
  56. package/dist/signify-ts.cjs.production.min.js +0 -2
  57. package/dist/signify-ts.cjs.production.min.js.map +0 -1
  58. package/dist/signify-ts.esm.js +0 -9345
  59. package/dist/signify-ts.esm.js.map +0 -1
  60. package/src/buffer-polyfill.ts +0 -5
  61. package/src/math.ts +0 -3
@@ -2,6 +2,7 @@ import { SignifyClient } from './clienting';
2
2
  import { Dict } from '../core/core';
3
3
  import { Serder } from '../core/serder';
4
4
  import { Operation } from './coring';
5
+ import { HabState } from '../core/state';
5
6
  /** Types of credentials */
6
7
  export declare class CredentialTypes {
7
8
  static issued: string;
@@ -14,43 +15,56 @@ export interface CredentialFilter {
14
15
  skip?: number;
15
16
  limit?: number;
16
17
  }
17
- export interface IssueCredentialArgs {
18
+ export interface CredentialSubject {
18
19
  /**
19
- * Name of the issuer identifier
20
+ * Issuee, or holder of the credential.
20
21
  */
21
- issuerName: string;
22
+ i?: string;
22
23
  /**
23
- * QB64 AID of credential registry
24
+ * Timestamp of issuance.
24
25
  */
25
- registryId: string;
26
+ dt?: string;
26
27
  /**
27
- * SAID Of the schema
28
+ * Privacy salt
28
29
  */
29
- schemaId: string;
30
+ u?: string;
31
+ [key: string]: unknown;
32
+ }
33
+ export interface CredentialData {
34
+ v?: string;
35
+ d?: string;
30
36
  /**
31
- * Prefix of recipient identifier
37
+ * Privacy salt
32
38
  */
33
- recipient?: string;
39
+ u?: string;
34
40
  /**
35
- * Credential data
41
+ * Issuer of the credential.
36
42
  */
37
- data?: Record<string, unknown>;
43
+ i?: string;
38
44
  /**
39
- * Credential rules
45
+ * Registry id.
40
46
  */
41
- rules?: string | Record<string, unknown>;
47
+ ri?: string;
42
48
  /**
43
- * Credential sources
49
+ * Schema id
44
50
  */
45
- source?: Record<string, unknown>;
51
+ s?: string;
46
52
  /**
47
- * Datetime to set for the credential
53
+ * Credential subject data
48
54
  */
49
- datetime?: string;
55
+ a: CredentialSubject;
56
+ /**
57
+ * Credential source section
58
+ */
59
+ e?: {
60
+ [key: string]: unknown;
61
+ };
50
62
  /**
51
- * Flag to issue a credential with privacy preserving features
63
+ * Credential rules section
52
64
  */
53
- privacy?: boolean;
65
+ r?: {
66
+ [key: string]: unknown;
67
+ };
54
68
  }
55
69
  export interface IssueCredentialResult {
56
70
  acdc: Serder;
@@ -58,6 +72,76 @@ export interface IssueCredentialResult {
58
72
  iss: Serder;
59
73
  op: Operation;
60
74
  }
75
+ export interface RevokeCredentialResult {
76
+ anc: Serder;
77
+ rev: Serder;
78
+ op: Operation;
79
+ }
80
+ export interface IpexApplyArgs {
81
+ /**
82
+ * Alias for the IPEX sender AID
83
+ */
84
+ senderName: string;
85
+ /**
86
+ * Prefix of the IPEX recipient AID
87
+ */
88
+ recipient: string;
89
+ /**
90
+ * Message to send
91
+ */
92
+ message?: string;
93
+ /**
94
+ * SAID of schema to apply for
95
+ */
96
+ schemaSaid: string;
97
+ /**
98
+ * Optional attributes for selective disclosure
99
+ */
100
+ attributes?: Record<string, unknown>;
101
+ datetime?: string;
102
+ }
103
+ export interface IpexOfferArgs {
104
+ /**
105
+ * Alias for the IPEX sender AID
106
+ */
107
+ senderName: string;
108
+ /**
109
+ * Prefix of the IPEX recipient AID
110
+ */
111
+ recipient: string;
112
+ /**
113
+ * Message to send
114
+ */
115
+ message?: string;
116
+ /**
117
+ * ACDC to offer
118
+ */
119
+ acdc: Serder;
120
+ /**
121
+ * Optional qb64 SAID of apply message this offer is responding to
122
+ */
123
+ applySaid?: string;
124
+ datetime?: string;
125
+ }
126
+ export interface IpexAgreeArgs {
127
+ /**
128
+ * Alias for the IPEX sender AID
129
+ */
130
+ senderName: string;
131
+ /**
132
+ * Prefix of the IPEX recipient AID
133
+ */
134
+ recipient: string;
135
+ /**
136
+ * Message to send
137
+ */
138
+ message?: string;
139
+ /**
140
+ * qb64 SAID of offer message this agree is responding to
141
+ */
142
+ offerSaid: string;
143
+ datetime?: string;
144
+ }
61
145
  export interface IpexGrantArgs {
62
146
  /**
63
147
  * Alias for the IPEX sender AID
@@ -74,7 +158,7 @@ export interface IpexGrantArgs {
74
158
  /**
75
159
  * qb64 SAID of agree message this grant is responding to
76
160
  */
77
- agree?: string;
161
+ agreeSaid?: string;
78
162
  datetime?: string;
79
163
  acdc: Serder;
80
164
  acdcAttachment?: string;
@@ -83,6 +167,48 @@ export interface IpexGrantArgs {
83
167
  anc: Serder;
84
168
  ancAttachment?: string;
85
169
  }
170
+ export interface IpexAdmitArgs {
171
+ /**
172
+ * Alias for the IPEX sender AID
173
+ */
174
+ senderName: string;
175
+ /**
176
+ * Prefix of the IPEX recipient AID
177
+ */
178
+ recipient: string;
179
+ /**
180
+ * Message to send
181
+ */
182
+ message?: string;
183
+ /**
184
+ * qb64 SAID of agree message this admit is responding to
185
+ */
186
+ grantSaid: string;
187
+ datetime?: string;
188
+ }
189
+ export type CredentialState = {
190
+ vn: [number, number];
191
+ i: string;
192
+ s: string;
193
+ d: string;
194
+ ri: string;
195
+ a: {
196
+ s: number;
197
+ d: string;
198
+ };
199
+ dt: string;
200
+ et: string;
201
+ } & ({
202
+ et: 'iss' | 'rev';
203
+ ra: Record<string, never>;
204
+ } | {
205
+ et: 'bis' | 'brv';
206
+ ra: {
207
+ i: string;
208
+ s: string;
209
+ d: string;
210
+ };
211
+ });
86
212
  /**
87
213
  * Credentials
88
214
  */
@@ -109,37 +235,33 @@ export declare class Credentials {
109
235
  */
110
236
  get(said: string, includeCESR?: boolean): Promise<any>;
111
237
  /**
112
- * Issue a credential
238
+ * Delete a credential from the DB
239
+ * @async
240
+ * @param {string} said - SAID of the credential
241
+ * @returns {Promise<void>}
113
242
  */
114
- issue(args: IssueCredentialArgs): Promise<IssueCredentialResult>;
243
+ delete(said: string): Promise<void>;
115
244
  /**
116
- * Revoke credential
245
+ * Get the state of a credential
117
246
  * @async
118
- * @param {string} name Name or alias of the identifier
119
- * @param {string} said SAID of the credential
120
- * @returns {Promise<any>} A promise to the long-running operation
247
+ * @param {string} ri - management registry identifier
248
+ * @param {string} said - SAID of the credential
249
+ * @returns {Promise<CredentialState>} A promise to the credential registry state
121
250
  */
122
- revoke(name: string, said: string): Promise<any>;
251
+ state(ri: string, said: string): Promise<CredentialState>;
123
252
  /**
124
- * Present a credential
125
- * @async
126
- * @param {string} name Name or alias of the identifier
127
- * @param {string} said SAID of the credential
128
- * @param {string} recipient Identifier prefix of the receiver of the presentation
129
- * @param {boolean} [include=true] Flag to indicate whether to stream credential alongside presentation exchange message
130
- * @returns {Promise<string>} A promise to the long-running operation
253
+ * Issue a credential
131
254
  */
132
- present(name: string, said: string, recipient: string, include?: boolean): Promise<string>;
255
+ issue(name: string, args: CredentialData): Promise<IssueCredentialResult>;
133
256
  /**
134
- * Request a presentation of a credential
257
+ * Revoke credential
135
258
  * @async
136
259
  * @param {string} name Name or alias of the identifier
137
- * @param {string} recipient Identifier prefix of the receiver of the presentation
138
- * @param {string} schema SAID of the schema
139
- * @param {string} [issuer] Optional prefix of the issuer of the credential
140
- * @returns {Promise<string>} A promise to the long-running operation
260
+ * @param {string} said SAID of the credential
261
+ * @param {string} datetime date time of revocation
262
+ * @returns {Promise<any>} A promise to the long-running operation
141
263
  */
142
- request(name: string, recipient: string, schema: string, issuer?: string): Promise<string>;
264
+ revoke(name: string, said: string, datetime?: string): Promise<RevokeCredentialResult>;
143
265
  }
144
266
  export interface CreateRegistryArgs {
145
267
  name: string;
@@ -184,7 +306,16 @@ export declare class Registries {
184
306
  * @returns {Promise<[any, Serder, any[], object]> } A promise to the long-running operation
185
307
  */
186
308
  create({ name, registryName, noBackers, toad, baks, nonce, }: CreateRegistryArgs): Promise<RegistryResult>;
187
- createFromEvents(hab: Dict<any>, name: string, registryName: string, vcp: Dict<any>, ixn: Dict<any>, sigs: any[]): Promise<Response>;
309
+ createFromEvents(hab: HabState, name: string, registryName: string, vcp: Dict<any>, ixn: Dict<any>, sigs: any[]): Promise<Response>;
310
+ /**
311
+ * Rename a registry
312
+ * @async
313
+ * @param {string} name Name or alias of the identifier
314
+ * @param {string} registryName Current registry name
315
+ * @param {string} newName New registry name
316
+ * @returns {Promise<any>} A promise to the registry record
317
+ */
318
+ rename(name: string, registryName: string, newName: string): Promise<any>;
188
319
  }
189
320
  /**
190
321
  * Schemas
@@ -220,6 +351,21 @@ export declare class Ipex {
220
351
  * @param {SignifyClient} client
221
352
  */
222
353
  constructor(client: SignifyClient);
354
+ /**
355
+ * Create an IPEX apply EXN message
356
+ */
357
+ apply(args: IpexApplyArgs): Promise<[Serder, string[], string]>;
358
+ submitApply(name: string, exn: Serder, sigs: string[], recp: string[]): Promise<any>;
359
+ /**
360
+ * Create an IPEX offer EXN message
361
+ */
362
+ offer(args: IpexOfferArgs): Promise<[Serder, string[], string]>;
363
+ submitOffer(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
364
+ /**
365
+ * Create an IPEX agree EXN message
366
+ */
367
+ agree(args: IpexAgreeArgs): Promise<[Serder, string[], string]>;
368
+ submitAgree(name: string, exn: Serder, sigs: string[], recp: string[]): Promise<any>;
223
369
  /**
224
370
  * Create an IPEX grant EXN message
225
371
  */
@@ -227,13 +373,7 @@ export declare class Ipex {
227
373
  submitGrant(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
228
374
  /**
229
375
  * Create an IPEX admit EXN message
230
- * @async
231
- * @param {string} name Name or alias of the identifier
232
- * @param {string} message accompany human readable description of the credential being admitted
233
- * @param {string} grant qb64 SAID of grant message this admit is responding to
234
- * @param {string} datetime Optional datetime to set for the credential
235
- * @returns {Promise<[Serder, string[], string]>} A promise to the long-running operation
236
376
  */
237
- admit(name: string, message: string, grant: string, datetime?: string): Promise<[Serder, string[], string]>;
377
+ admit(args: IpexAdmitArgs): Promise<[Serder, string[], string]>;
238
378
  submitAdmit(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
239
379
  }
@@ -0,0 +1,18 @@
1
+ import { EventResult } from './aiding';
2
+ import { SignifyClient } from './clienting';
3
+ export declare class Delegations {
4
+ client: SignifyClient;
5
+ /**
6
+ * Delegations
7
+ * @param {SignifyClient} client
8
+ */
9
+ constructor(client: SignifyClient);
10
+ /**
11
+ * Approve the delegation via interaction event
12
+ * @async
13
+ * @param {string} name Name or alias of the identifier
14
+ * @param {any} [data] The anchoring interaction event
15
+ * @returns {Promise<EventResult>} A promise to the delegated approval result
16
+ */
17
+ approve(name: string, data?: any): Promise<EventResult>;
18
+ }
@@ -1,6 +1,7 @@
1
1
  import { SignifyClient } from './clienting';
2
2
  import { Dict } from '../core/core';
3
3
  import { Serder } from '../core/serder';
4
+ import { HabState } from '../core/state';
4
5
  /**
5
6
  * Exchanges
6
7
  */
@@ -23,7 +24,7 @@ export declare class Exchanges {
23
24
  * @param datetime
24
25
  * @param dig
25
26
  */
26
- createExchangeMessage(sender: Dict<any>, route: string, payload: Dict<any>, embeds: Dict<any>, recipient?: string, datetime?: string, dig?: string): Promise<[Serder, string[], string]>;
27
+ createExchangeMessage(sender: HabState, route: string, payload: Dict<any>, embeds: Dict<any>, recipient: string, datetime?: string, dig?: string): Promise<[Serder, string[], string]>;
27
28
  /**
28
29
  * Send exn messages to list of recipients
29
30
  * @async
@@ -36,7 +37,7 @@ export declare class Exchanges {
36
37
  * @param embeds
37
38
  * @param recipients
38
39
  */
39
- send(name: string, topic: string, sender: Dict<any>, route: string, payload: Dict<any>, embeds: Dict<any>, recipients: string[]): Promise<any>;
40
+ send(name: string, topic: string, sender: HabState, route: string, payload: Dict<any>, embeds: Dict<any>, recipients: string[]): Promise<any>;
40
41
  /**
41
42
  * Send exn messaget to list of recipients
42
43
  * @async
@@ -57,4 +58,4 @@ export declare class Exchanges {
57
58
  */
58
59
  get(said: string): Promise<any>;
59
60
  }
60
- export declare function exchange(route: string, payload: Dict<any>, sender: string, recipient?: string, date?: string, dig?: string, modifiers?: Dict<any>, embeds?: Dict<any>): [Serder, Uint8Array];
61
+ export declare function exchange(route: string, payload: Dict<any>, sender: string, recipient: string, date?: string, dig?: string, modifiers?: Dict<any>, embeds?: Dict<any>): [Serder, Uint8Array];
@@ -28,7 +28,7 @@ export declare class Notifications {
28
28
  * Delete a notification
29
29
  * @async
30
30
  * @param {string} said SAID of the notification
31
- * @returns {Promise<any>} A promise to the result of the deletion
31
+ * @returns {Promise<void>}
32
32
  */
33
33
  delete(said: string): Promise<void>;
34
34
  }
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ import { Buffer } from 'buffer';
3
+ export declare function encodeBase64Url(buffer: Buffer): string;
4
+ export declare function decodeBase64Url(input: string): Buffer;
@@ -24,6 +24,8 @@ export declare const Ilks: {
24
24
  vcp: string;
25
25
  iss: string;
26
26
  rev: string;
27
+ bis: string;
28
+ brv: string;
27
29
  };
28
30
  export declare const IcpLabels: string[];
29
31
  export declare const DipLabels: string[];
@@ -1,6 +1,8 @@
1
1
  import { Signer } from './signer';
2
2
  import { Cigar } from './cigar';
3
3
  import { Siger } from './siger';
4
+ export declare const HEADER_SIG_INPUT: string;
5
+ export declare const HEADER_SIG_TIME: string;
4
6
  export declare function normalize(header: string): string;
5
7
  export interface SiginputArgs {
6
8
  name: string;
@@ -2,23 +2,56 @@ import { Salter } from './salter';
2
2
  import { Algos } from './manager';
3
3
  import { Tier } from './salter';
4
4
  import { Signer } from './signer';
5
- import { Siger } from './siger';
6
- import { Cigar } from './cigar';
7
- export {};
5
+ import { HabState, State } from './state';
8
6
  /** External module definition */
7
+ export interface ExternalModuleType {
8
+ new (pidx: number, args: KeeperParams): Keeper;
9
+ }
9
10
  export interface ExternalModule {
10
11
  type: string;
11
12
  name: string;
12
- module: any;
13
+ module: ExternalModuleType;
14
+ }
15
+ export type KeeperResult = [string[], string[]];
16
+ export type SignResult = string[];
17
+ export interface KeeperParams {
18
+ [key: string]: unknown;
19
+ }
20
+ export interface SaltyParams extends KeeperParams {
21
+ pidx: number;
22
+ kidx: number;
23
+ tier: Tier;
24
+ transferable: boolean;
25
+ stem: string | undefined;
26
+ icodes: string[] | undefined;
27
+ ncodes: string[] | undefined;
28
+ dcode: string | undefined;
29
+ sxlt: string | undefined;
30
+ }
31
+ export interface RandyParams extends KeeperParams {
32
+ nxts?: string[];
33
+ prxs?: string[];
34
+ transferable: boolean;
35
+ }
36
+ export interface GroupParams extends KeeperParams {
37
+ mhab: HabState;
38
+ }
39
+ export interface Keeper<T extends KeeperParams = KeeperParams> {
40
+ algo: Algos;
41
+ signers: Signer[];
42
+ params(): T;
43
+ incept(transferable: boolean): Promise<KeeperResult>;
44
+ rotate(ncodes: string[], transferable: boolean, states?: State[], rstates?: State[]): Promise<KeeperResult>;
45
+ sign(ser: Uint8Array, indexed?: boolean, indices?: number[], ondices?: number[]): Promise<SignResult>;
13
46
  }
14
47
  export declare class KeyManager {
15
- private salter?;
16
- private modules?;
48
+ private salter;
49
+ private modules;
17
50
  constructor(salter: Salter, externalModules?: ExternalModule[]);
18
- new(algo: Algos, pidx: number, kargs: any): any;
19
- get(aid: any): any;
51
+ new(algo: Algos, pidx: number, kargs: any): Keeper<KeeperParams> | GroupKeeper;
52
+ get(aid: HabState): Keeper;
20
53
  }
21
- export declare class SaltyKeeper {
54
+ export declare class SaltyKeeper implements Keeper {
22
55
  private aeid;
23
56
  private encrypter;
24
57
  private decrypter;
@@ -40,23 +73,13 @@ export declare class SaltyKeeper {
40
73
  private creator;
41
74
  algo: Algos;
42
75
  signers: Signer[];
43
- constructor(salter: Salter, pidx: number, kidx?: number, tier?: Tier, transferable?: boolean, stem?: undefined, code?: string, count?: number, icodes?: string[] | undefined, ncode?: string, ncount?: number, ncodes?: string[] | undefined, dcode?: string, bran?: string | undefined, sxlt?: undefined);
44
- params(): {
45
- sxlt: string | undefined;
46
- pidx: number;
47
- kidx: number;
48
- stem: string | undefined;
49
- tier: Tier;
50
- icodes: string[] | undefined;
51
- ncodes: string[] | undefined;
52
- dcode: string | undefined;
53
- transferable: boolean;
54
- };
55
- incept(transferable: boolean): string[][];
56
- rotate(ncodes: string[], transferable: boolean, ..._: any[]): string[][];
57
- sign(ser: Uint8Array, indexed?: boolean, indices?: number[] | undefined, ondices?: number[] | undefined): string[];
76
+ constructor(salter: Salter, pidx: number, kidx?: number, tier?: Tier, transferable?: boolean, stem?: string | undefined, code?: string, count?: number, icodes?: string[] | undefined, ncode?: string, ncount?: number, ncodes?: string[] | undefined, dcode?: string, bran?: string | undefined, sxlt?: string | undefined);
77
+ params(): SaltyParams;
78
+ incept(transferable: boolean): Promise<KeeperResult>;
79
+ rotate(ncodes: string[], transferable: boolean): Promise<[string[], string[]]>;
80
+ sign(ser: Uint8Array, indexed?: boolean, indices?: number[] | undefined, ondices?: number[] | undefined): Promise<SignResult>;
58
81
  }
59
- export declare class RandyKeeper {
82
+ export declare class RandyKeeper implements Keeper {
60
83
  private salter;
61
84
  private code;
62
85
  private count;
@@ -75,29 +98,25 @@ export declare class RandyKeeper {
75
98
  algo: Algos;
76
99
  signers: Signer[];
77
100
  constructor(salter: Salter, code: string | undefined, count: number | undefined, icodes: string[] | undefined, transferable: boolean | undefined, ncode: string | undefined, ncount: number | undefined, ncodes: string[], dcode?: string, prxs?: string[] | undefined, nxts?: string[] | undefined);
78
- params(): {
79
- nxts: string[] | undefined;
80
- prxs: string[] | undefined;
81
- transferable: boolean;
82
- };
83
- incept(transferable: boolean): string[][];
84
- rotate(ncodes: string[], transferable: boolean, ..._: any[]): any[][];
85
- sign(ser: Uint8Array, indexed?: boolean, indices?: number[] | undefined, ondices?: number[] | undefined): any[];
101
+ params(): RandyParams;
102
+ incept(transferable: boolean): Promise<KeeperResult>;
103
+ rotate(ncodes: string[], transferable: boolean): Promise<KeeperResult>;
104
+ sign(ser: Uint8Array, indexed?: boolean, indices?: number[] | undefined, ondices?: number[] | undefined): Promise<SignResult>;
86
105
  }
87
- export declare class GroupKeeper {
106
+ export declare class GroupKeeper implements Keeper {
88
107
  private manager;
89
108
  private mhab;
90
109
  private gkeys;
91
110
  private gdigs;
92
111
  algo: Algos;
93
112
  signers: Signer[];
94
- constructor(manager: KeyManager, mhab?: undefined, states?: any[] | undefined, rstates?: any[] | undefined, keys?: any[] | undefined, ndigs?: any[] | undefined);
95
- incept(..._: any): (string[] | undefined)[];
96
- rotate(_ncodes: string[], _transferable: boolean, states: any[], rstates: any[], ..._: any): string[][];
97
- sign(ser: Uint8Array, indexed?: boolean, _indices?: number[] | undefined, _ondices?: number[] | undefined): Promise<Siger[] | Cigar[]>;
113
+ constructor(manager: KeyManager, mhab: HabState, states?: State[] | undefined, rstates?: State[] | undefined, keys?: string[], ndigs?: string[]);
114
+ incept(): Promise<KeeperResult>;
115
+ rotate(_ncodes: string[], _transferable: boolean, states: State[], rstates: State[]): Promise<KeeperResult>;
116
+ sign(ser: Uint8Array, indexed?: boolean): Promise<SignResult>;
98
117
  params(): {
99
- mhab: any;
100
- keys: string[] | undefined;
101
- ndigs: string[] | undefined;
118
+ mhab: HabState;
119
+ keys: string[];
120
+ ndigs: string[];
102
121
  };
103
122
  }
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { Matter, MatterArgs } from './matter';
3
3
  import { Dict, Serials } from './core';
4
+ import { Buffer } from 'buffer';
4
5
  export declare enum Ids {
5
6
  d = "d"
6
7
  }
@@ -0,0 +1,62 @@
1
+ import { Algos } from './manager';
2
+ import { Tier } from './salter';
3
+ export interface State {
4
+ vn: [number, number];
5
+ i: string;
6
+ s: string;
7
+ p?: string;
8
+ d: string;
9
+ f: string;
10
+ dt: string;
11
+ et: string;
12
+ kt: string | string[];
13
+ k: string[];
14
+ nt: string | string[];
15
+ n: string[];
16
+ bt: string;
17
+ b: string[];
18
+ c: string[];
19
+ ee: EstablishmentState;
20
+ di?: string;
21
+ }
22
+ export interface EstablishmentState {
23
+ d: string;
24
+ s: string;
25
+ }
26
+ export interface SaltyState {
27
+ sxlt: string;
28
+ pidx: number;
29
+ kidx: number;
30
+ stem: string;
31
+ tier: Tier;
32
+ dcode: string;
33
+ icodes: string[];
34
+ ncodes: string[];
35
+ transferable: boolean;
36
+ }
37
+ export interface RandyState {
38
+ prxs: string[];
39
+ nxts: string[];
40
+ }
41
+ export interface GroupState {
42
+ mhab: HabState;
43
+ keys: string[];
44
+ ndigs: string[];
45
+ }
46
+ export interface ExternState {
47
+ extern_type: string;
48
+ pidx: number;
49
+ [key: string]: unknown;
50
+ }
51
+ export interface HabState {
52
+ name: string;
53
+ prefix: string;
54
+ transferable: boolean;
55
+ state: State;
56
+ windexes: unknown[];
57
+ icp_dt: string;
58
+ [Algos.salty]?: SaltyState;
59
+ [Algos.randy]?: RandyState;
60
+ [Algos.group]?: GroupState;
61
+ [Algos.extern]?: ExternState;
62
+ }
@@ -1,13 +1,15 @@
1
+ import { Siger } from '../core/siger';
2
+ import { Cigar } from '../core/cigar';
1
3
  export declare const FALSY: (string | number | boolean)[];
2
4
  export declare const TRUTHY: (string | number | boolean)[];
3
5
  export declare class Signage {
4
- constructor(markers: any, indexed?: boolean, signer?: string, ordinal?: string, digest?: string, kind?: string);
5
- markers: any;
6
- indexed: boolean | undefined;
7
- signer: string | undefined;
8
- ordinal: string | undefined;
9
- digest: string | undefined;
10
- kind: string | undefined;
6
+ readonly markers: (Siger | Cigar)[] | Map<string, string | Siger | Cigar>;
7
+ readonly indexed?: boolean | undefined;
8
+ readonly signer?: string | undefined;
9
+ readonly ordinal?: string | undefined;
10
+ readonly digest?: string | undefined;
11
+ readonly kind?: string | undefined;
12
+ constructor(markers: (Siger | Cigar)[] | Map<string, string | Siger | Cigar>, indexed?: boolean | undefined, signer?: string | undefined, ordinal?: string | undefined, digest?: string | undefined, kind?: string | undefined);
11
13
  }
12
- export declare function signature(signages: Array<Signage>): Headers;
14
+ export declare function signature(signages: Signage[]): Headers;
13
15
  export declare function designature(value: string): Signage[];