signify-ts 0.1.1 → 0.2.1

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 (115) hide show
  1. package/README.md +96 -47
  2. package/dist/buffer-polyfill.d.ts +1 -0
  3. package/dist/exports.d.ts +40 -0
  4. package/dist/index.d.ts +4 -3
  5. package/dist/keri/app/aiding.d.ts +138 -0
  6. package/dist/keri/app/clienting.d.ts +182 -0
  7. package/dist/keri/app/contacting.d.ts +93 -0
  8. package/dist/keri/app/controller.d.ts +49 -0
  9. package/dist/keri/app/coring.d.ts +121 -0
  10. package/dist/keri/app/credentialing.d.ts +245 -0
  11. package/dist/keri/app/escrowing.d.ts +19 -0
  12. package/dist/keri/app/exchanging.d.ts +60 -0
  13. package/dist/keri/app/grouping.d.ts +44 -0
  14. package/dist/keri/app/habery.d.ts +48 -47
  15. package/dist/keri/app/notifying.d.ts +34 -0
  16. package/dist/keri/core/authing.d.ts +10 -9
  17. package/dist/keri/core/bexter.d.ts +7 -0
  18. package/dist/keri/core/cigar.d.ts +8 -8
  19. package/dist/keri/core/cipher.d.ts +5 -5
  20. package/dist/keri/core/core.d.ts +59 -53
  21. package/dist/keri/core/counter.d.ts +43 -43
  22. package/dist/keri/core/decrypter.d.ts +10 -10
  23. package/dist/keri/core/diger.d.ts +21 -21
  24. package/dist/keri/core/encrypter.d.ts +9 -9
  25. package/dist/keri/core/eventing.d.ts +54 -21
  26. package/dist/keri/core/httping.d.ts +44 -34
  27. package/dist/keri/core/indexer.d.ts +98 -88
  28. package/dist/keri/core/keeping.d.ts +103 -1
  29. package/dist/keri/core/kering.d.ts +5 -5
  30. package/dist/keri/core/manager.d.ts +174 -172
  31. package/dist/keri/core/matter.d.ts +116 -69
  32. package/dist/keri/core/number.d.ts +7 -6
  33. package/dist/keri/core/pather.d.ts +7 -0
  34. package/dist/keri/core/prefixer.d.ts +15 -15
  35. package/dist/keri/core/saider.d.ts +23 -23
  36. package/dist/keri/core/salter.d.ts +23 -23
  37. package/dist/keri/core/seqner.d.ts +15 -0
  38. package/dist/keri/core/serder.d.ts +31 -23
  39. package/dist/keri/core/siger.d.ts +18 -18
  40. package/dist/keri/core/signer.d.ts +34 -34
  41. package/dist/keri/core/tholder.d.ts +29 -14
  42. package/dist/keri/core/utils.d.ts +20 -15
  43. package/dist/keri/core/vdring.d.ts +16 -0
  44. package/dist/keri/core/verfer.d.ts +13 -12
  45. package/dist/keri/end/ending.d.ts +13 -13
  46. package/dist/math.d.ts +1 -0
  47. package/dist/ready.d.ts +1 -0
  48. package/dist/signify-ts.cjs +7842 -0
  49. package/dist/signify-ts.cjs.development.js +6369 -256
  50. package/dist/signify-ts.cjs.development.js.map +1 -1
  51. package/dist/signify-ts.cjs.map +7 -0
  52. package/dist/signify-ts.cjs.production.min.js +1 -1
  53. package/dist/signify-ts.cjs.production.min.js.map +1 -1
  54. package/dist/signify-ts.esm.js +6205 -229
  55. package/dist/signify-ts.esm.js.map +1 -1
  56. package/dist/signify-ts.mjs +7818 -0
  57. package/dist/signify-ts.mjs.map +7 -0
  58. package/package.json +49 -49
  59. package/src/buffer-polyfill.ts +5 -0
  60. package/src/exports.ts +44 -0
  61. package/src/index.ts +4 -5
  62. package/src/keri/app/aiding.ts +493 -0
  63. package/src/keri/app/clienting.ts +492 -0
  64. package/src/keri/app/contacting.ts +188 -0
  65. package/src/keri/app/controller.ts +372 -0
  66. package/src/keri/app/coring.ts +225 -0
  67. package/src/keri/app/credentialing.ts +841 -0
  68. package/src/keri/app/escrowing.ts +34 -0
  69. package/src/keri/app/exchanging.ts +220 -0
  70. package/src/keri/app/grouping.ts +90 -0
  71. package/src/keri/app/habery.ts +118 -85
  72. package/src/keri/app/notifying.ts +69 -0
  73. package/src/keri/core/authing.ts +73 -85
  74. package/src/keri/core/bexter.ts +138 -0
  75. package/src/keri/core/cigar.ts +10 -11
  76. package/src/keri/core/cipher.ts +23 -14
  77. package/src/keri/core/core.ts +223 -81
  78. package/src/keri/core/counter.ts +182 -116
  79. package/src/keri/core/decrypter.ts +48 -34
  80. package/src/keri/core/diger.ts +23 -22
  81. package/src/keri/core/encrypter.ts +37 -27
  82. package/src/keri/core/eventing.ts +468 -106
  83. package/src/keri/core/httping.ts +151 -105
  84. package/src/keri/core/indexer.ts +313 -211
  85. package/src/keri/core/keeping.ts +679 -3
  86. package/src/keri/core/kering.ts +4 -6
  87. package/src/keri/core/manager.ts +660 -499
  88. package/src/keri/core/matter.ts +382 -148
  89. package/src/keri/core/number.ts +56 -11
  90. package/src/keri/core/pather.ts +98 -0
  91. package/src/keri/core/prefixer.ts +122 -101
  92. package/src/keri/core/saider.ts +104 -76
  93. package/src/keri/core/salter.ts +71 -40
  94. package/src/keri/core/seqner.ts +46 -0
  95. package/src/keri/core/serder.ts +102 -38
  96. package/src/keri/core/siger.ts +19 -18
  97. package/src/keri/core/signer.ts +73 -53
  98. package/src/keri/core/tholder.ts +196 -30
  99. package/src/keri/core/utils.ts +121 -50
  100. package/src/keri/core/vdring.ts +94 -0
  101. package/src/keri/core/verfer.ts +22 -9
  102. package/src/keri/end/ending.ts +111 -101
  103. package/src/math.ts +3 -0
  104. package/src/ready.ts +5 -0
  105. package/dist/keri/app/accountant.d.ts +0 -10
  106. package/dist/keri/app/apping.d.ts +0 -1
  107. package/dist/keri/app/client.d.ts +0 -7
  108. package/dist/keri/app/signify.d.ts +0 -6
  109. package/src/keri/app/accountant.ts +0 -35
  110. package/src/keri/app/apping.ts +0 -12
  111. package/src/keri/app/client.ts +0 -30
  112. package/src/keri/app/signify.ts +0 -12
  113. package/src/keri/app/tsconfig.json +0 -100
  114. package/src/keri/core/tsconfig.json +0 -100
  115. package/src/keri/end/tsconfig.json +0 -100
@@ -0,0 +1,121 @@
1
+ import { SignifyClient } from './clienting';
2
+ export declare function randomPasscode(): string;
3
+ export declare function randomNonce(): string;
4
+ export declare class Oobis {
5
+ client: SignifyClient;
6
+ /**
7
+ * Oobis
8
+ * @param {SignifyClient} client
9
+ */
10
+ constructor(client: SignifyClient);
11
+ /**
12
+ * Get the OOBI(s) for a managed indentifier for a given role
13
+ * @param {string} name Name or alias of the identifier
14
+ * @param {string} role Authorized role
15
+ * @returns {Promise<any>} A promise to the OOBI(s)
16
+ */
17
+ get(name: string, role?: string): Promise<any>;
18
+ /**
19
+ * Resolve an OOBI
20
+ * @async
21
+ * @param {string} oobi The OOBI to be resolver
22
+ * @param {string} [alias] Optional name or alias to link the OOBI resolution to a contact
23
+ * @returns {Promise<any>} A promise to the long-running operation
24
+ */
25
+ resolve(oobi: string, alias?: string): Promise<any>;
26
+ }
27
+ export interface Operation<T = unknown> {
28
+ name: string;
29
+ metadata?: {
30
+ depends?: Operation;
31
+ [property: string]: any;
32
+ };
33
+ done?: boolean;
34
+ error?: any;
35
+ response?: T;
36
+ }
37
+ /**
38
+ * Operations
39
+ * @remarks
40
+ * Operations represent the status and result of long running tasks performed by KERIA agent
41
+ */
42
+ export declare class Operations {
43
+ client: SignifyClient;
44
+ /**
45
+ * Operations
46
+ * @param {SignifyClient} client
47
+ */
48
+ constructor(client: SignifyClient);
49
+ /**
50
+ * Get operation status
51
+ * @async
52
+ * @param {string} name Name of the operation
53
+ * @returns {Promise<Operation>} A promise to the status of the operation
54
+ */
55
+ get<T = unknown>(name: string): Promise<Operation<T>>;
56
+ /**
57
+ * List operations
58
+ * @async
59
+ * @param {string} type Select operations by type
60
+ * @returns {Promise<Operation[]>} A list of operations
61
+ */
62
+ list(type?: string): Promise<Operation<any>[]>;
63
+ /**
64
+ * Delete operation
65
+ * @async
66
+ * @param {string} name Name of the operation
67
+ */
68
+ delete(name: string): Promise<void>;
69
+ }
70
+ /**
71
+ * KeyEvents
72
+ */
73
+ export declare class KeyEvents {
74
+ client: SignifyClient;
75
+ /**
76
+ * KeyEvents
77
+ * @param {SignifyClient} client
78
+ */
79
+ constructor(client: SignifyClient);
80
+ /**
81
+ * Retrieve key events for an identifier
82
+ * @async
83
+ * @param {string} pre Identifier prefix
84
+ * @returns {Promise<any>} A promise to the key events
85
+ */
86
+ get(pre: string): Promise<any>;
87
+ }
88
+ /**
89
+ * KeyStates
90
+ */
91
+ export declare class KeyStates {
92
+ client: SignifyClient;
93
+ /**
94
+ * KeyStates
95
+ * @param {SignifyClient} client
96
+ */
97
+ constructor(client: SignifyClient);
98
+ /**
99
+ * Retriene the key state for an identifier
100
+ * @async
101
+ * @param {string} pre Identifier prefix
102
+ * @returns {Promise<any>} A promise to the key states
103
+ */
104
+ get(pre: string): Promise<any>;
105
+ /**
106
+ * Retrieve the key state for a list of identifiers
107
+ * @async
108
+ * @param {Array<string>} pres List of identifier prefixes
109
+ * @returns {Promise<any>} A promise to the key states
110
+ */
111
+ list(pres: string[]): Promise<any>;
112
+ /**
113
+ * Query the key state of an identifier for a given sequence number or anchor
114
+ * @async
115
+ * @param {string} pre Identifier prefix
116
+ * @param {number} [sn] Optional sequence number
117
+ * @param {any} [anchor] Optional anchor
118
+ * @returns {Promise<any>} A promise to the long-running operation
119
+ */
120
+ query(pre: string, sn?: string, anchor?: any): Promise<any>;
121
+ }
@@ -0,0 +1,245 @@
1
+ import { SignifyClient } from './clienting';
2
+ import { Dict } from '../core/core';
3
+ import { Serder } from '../core/serder';
4
+ import { Operation } from './coring';
5
+ /** Types of credentials */
6
+ export declare class CredentialTypes {
7
+ static issued: string;
8
+ static received: string;
9
+ }
10
+ /** Credential filter parameters */
11
+ export interface CredentialFilter {
12
+ filter?: object;
13
+ sort?: object[];
14
+ skip?: number;
15
+ limit?: number;
16
+ }
17
+ export interface IssueCredentialArgs {
18
+ /**
19
+ * Name of the issuer identifier
20
+ */
21
+ issuerName: string;
22
+ /**
23
+ * QB64 AID of credential registry
24
+ */
25
+ registryId: string;
26
+ /**
27
+ * SAID Of the schema
28
+ */
29
+ schemaId: string;
30
+ /**
31
+ * Prefix of recipient identifier
32
+ */
33
+ recipient?: string;
34
+ /**
35
+ * Credential data
36
+ */
37
+ data?: Record<string, unknown>;
38
+ /**
39
+ * Credential rules
40
+ */
41
+ rules?: string | Record<string, unknown>;
42
+ /**
43
+ * Credential sources
44
+ */
45
+ source?: Record<string, unknown>;
46
+ /**
47
+ * Datetime to set for the credential
48
+ */
49
+ datetime?: string;
50
+ /**
51
+ * Flag to issue a credential with privacy preserving features
52
+ */
53
+ privacy?: boolean;
54
+ }
55
+ export interface IssueCredentialResult {
56
+ acdc: Serder;
57
+ anc: Serder;
58
+ iss: Serder;
59
+ op: Operation;
60
+ }
61
+ export interface RevokeCredentialResult {
62
+ anc: Serder;
63
+ rev: Serder;
64
+ op: Operation;
65
+ }
66
+ export interface IpexGrantArgs {
67
+ /**
68
+ * Alias for the IPEX sender AID
69
+ */
70
+ senderName: string;
71
+ /**
72
+ * Prefix of the IPEX recipient AID
73
+ */
74
+ recipient: string;
75
+ /**
76
+ * Message to send
77
+ */
78
+ message?: string;
79
+ /**
80
+ * qb64 SAID of agree message this grant is responding to
81
+ */
82
+ agree?: string;
83
+ datetime?: string;
84
+ acdc: Serder;
85
+ acdcAttachment?: string;
86
+ iss: Serder;
87
+ issAttachment?: string;
88
+ anc: Serder;
89
+ ancAttachment?: string;
90
+ }
91
+ /**
92
+ * Credentials
93
+ */
94
+ export declare class Credentials {
95
+ client: SignifyClient;
96
+ /**
97
+ * Credentials
98
+ * @param {SignifyClient} client
99
+ */
100
+ constructor(client: SignifyClient);
101
+ /**
102
+ * List credentials
103
+ * @async
104
+ * @param {CredentialFilter} [kargs] Optional parameters to filter the credentials
105
+ * @returns {Promise<any>} A promise to the list of credentials
106
+ */
107
+ list(kargs?: CredentialFilter): Promise<any>;
108
+ /**
109
+ * Get a credential
110
+ * @async
111
+ * @param {string} said - SAID of the credential
112
+ * @param {boolean} [includeCESR=false] - Optional flag export the credential in CESR format
113
+ * @returns {Promise<any>} A promise to the credential
114
+ */
115
+ get(said: string, includeCESR?: boolean): Promise<any>;
116
+ /**
117
+ * Issue a credential
118
+ */
119
+ issue(args: IssueCredentialArgs): Promise<IssueCredentialResult>;
120
+ /**
121
+ * Revoke credential
122
+ * @async
123
+ * @param {string} name Name or alias of the identifier
124
+ * @param {string} said SAID of the credential
125
+ * @param {string} datetime date time of revocation
126
+ * @returns {Promise<any>} A promise to the long-running operation
127
+ */
128
+ revoke(name: string, said: string, datetime?: string): Promise<RevokeCredentialResult>;
129
+ /**
130
+ * Present a credential
131
+ * @async
132
+ * @param {string} name Name or alias of the identifier
133
+ * @param {string} said SAID of the credential
134
+ * @param {string} recipient Identifier prefix of the receiver of the presentation
135
+ * @param {boolean} [include=true] Flag to indicate whether to stream credential alongside presentation exchange message
136
+ * @returns {Promise<string>} A promise to the long-running operation
137
+ */
138
+ present(name: string, said: string, recipient: string, include?: boolean): Promise<string>;
139
+ /**
140
+ * Request a presentation of a credential
141
+ * @async
142
+ * @param {string} name Name or alias of the identifier
143
+ * @param {string} recipient Identifier prefix of the receiver of the presentation
144
+ * @param {string} schema SAID of the schema
145
+ * @param {string} [issuer] Optional prefix of the issuer of the credential
146
+ * @returns {Promise<string>} A promise to the long-running operation
147
+ */
148
+ request(name: string, recipient: string, schema: string, issuer?: string): Promise<string>;
149
+ }
150
+ export interface CreateRegistryArgs {
151
+ name: string;
152
+ registryName: string;
153
+ toad?: string | number | undefined;
154
+ noBackers?: boolean;
155
+ baks?: string[];
156
+ nonce?: string;
157
+ }
158
+ export declare class RegistryResult {
159
+ private readonly _regser;
160
+ private readonly _serder;
161
+ private readonly _sigs;
162
+ private readonly promise;
163
+ constructor(regser: Serder, serder: Serder, sigs: any[], promise: Promise<Response>);
164
+ get regser(): any;
165
+ get serder(): Serder;
166
+ get sigs(): string[];
167
+ op(): Promise<any>;
168
+ }
169
+ /**
170
+ * Registries
171
+ */
172
+ export declare class Registries {
173
+ client: SignifyClient;
174
+ /**
175
+ * Registries
176
+ * @param {SignifyClient} client
177
+ */
178
+ constructor(client: SignifyClient);
179
+ /**
180
+ * List registries
181
+ * @async
182
+ * @param {string} name Name or alias of the identifier
183
+ * @returns {Promise<any>} A promise to the list of registries
184
+ */
185
+ list(name: string): Promise<any>;
186
+ /**
187
+ * Create a registry
188
+ * @async
189
+ * @param {CreateRegistryArgs}
190
+ * @returns {Promise<[any, Serder, any[], object]> } A promise to the long-running operation
191
+ */
192
+ create({ name, registryName, noBackers, toad, baks, nonce, }: CreateRegistryArgs): Promise<RegistryResult>;
193
+ createFromEvents(hab: Dict<any>, name: string, registryName: string, vcp: Dict<any>, ixn: Dict<any>, sigs: any[]): Promise<Response>;
194
+ }
195
+ /**
196
+ * Schemas
197
+ */
198
+ export declare class Schemas {
199
+ client: SignifyClient;
200
+ /**
201
+ * Schemas
202
+ * @param {SignifyClient} client
203
+ */
204
+ constructor(client: SignifyClient);
205
+ /**
206
+ * Get a schema
207
+ * @async
208
+ * @param {string} said SAID of the schema
209
+ * @returns {Promise<any>} A promise to the schema
210
+ */
211
+ get(said: string): Promise<any>;
212
+ /**
213
+ * List schemas
214
+ * @async
215
+ * @returns {Promise<any>} A promise to the list of schemas
216
+ */
217
+ list(): Promise<any>;
218
+ }
219
+ /**
220
+ * Ipex
221
+ */
222
+ export declare class Ipex {
223
+ client: SignifyClient;
224
+ /**
225
+ * Schemas
226
+ * @param {SignifyClient} client
227
+ */
228
+ constructor(client: SignifyClient);
229
+ /**
230
+ * Create an IPEX grant EXN message
231
+ */
232
+ grant(args: IpexGrantArgs): Promise<[Serder, string[], string]>;
233
+ submitGrant(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
234
+ /**
235
+ * Create an IPEX admit EXN message
236
+ * @async
237
+ * @param {string} name Name or alias of the identifier
238
+ * @param {string} message accompany human readable description of the credential being admitted
239
+ * @param {string} grant qb64 SAID of grant message this admit is responding to
240
+ * @param {string} datetime Optional datetime to set for the credential
241
+ * @returns {Promise<[Serder, string[], string]>} A promise to the long-running operation
242
+ */
243
+ admit(name: string, message: string, grant: string, datetime?: string): Promise<[Serder, string[], string]>;
244
+ submitAdmit(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
245
+ }
@@ -0,0 +1,19 @@
1
+ import { SignifyClient } from './clienting';
2
+ /**
3
+ * Escrows
4
+ */
5
+ export declare class Escrows {
6
+ client: SignifyClient;
7
+ /**
8
+ * Escrows
9
+ * @param {SignifyClient} client
10
+ */
11
+ constructor(client: SignifyClient);
12
+ /**
13
+ * List replay messages
14
+ * @async
15
+ * @param {string} [route] Optional route in the replay message
16
+ * @returns {Promise<any>} A promise to the list of replay messages
17
+ */
18
+ listReply(route?: string): Promise<any>;
19
+ }
@@ -0,0 +1,60 @@
1
+ import { SignifyClient } from './clienting';
2
+ import { Dict } from '../core/core';
3
+ import { Serder } from '../core/serder';
4
+ /**
5
+ * Exchanges
6
+ */
7
+ export declare class Exchanges {
8
+ client: SignifyClient;
9
+ /**
10
+ * Exchanges
11
+ * @param {SignifyClient} client
12
+ */
13
+ constructor(client: SignifyClient);
14
+ /**
15
+ * Create exn message
16
+ * @async
17
+ * @returns {Promise<any>} A promise to the list of replay messages
18
+ * @param sender
19
+ * @param route
20
+ * @param payload
21
+ * @param embeds
22
+ * @param recipient
23
+ * @param datetime
24
+ * @param dig
25
+ */
26
+ createExchangeMessage(sender: Dict<any>, route: string, payload: Dict<any>, embeds: Dict<any>, recipient?: string, datetime?: string, dig?: string): Promise<[Serder, string[], string]>;
27
+ /**
28
+ * Send exn messages to list of recipients
29
+ * @async
30
+ * @returns {Promise<any>} A promise to the list of replay messages
31
+ * @param name
32
+ * @param topic
33
+ * @param sender
34
+ * @param route
35
+ * @param payload
36
+ * @param embeds
37
+ * @param recipients
38
+ */
39
+ send(name: string, topic: string, sender: Dict<any>, route: string, payload: Dict<any>, embeds: Dict<any>, recipients: string[]): Promise<any>;
40
+ /**
41
+ * Send exn messaget to list of recipients
42
+ * @async
43
+ * @returns {Promise<any>} A promise to the list of replay messages
44
+ * @param name
45
+ * @param topic
46
+ * @param exn
47
+ * @param sigs
48
+ * @param atc
49
+ * @param recipients
50
+ */
51
+ sendFromEvents(name: string, topic: string, exn: Serder, sigs: string[], atc: string, recipients: string[]): Promise<any>;
52
+ /**
53
+ * Get exn message by said
54
+ * @async
55
+ * @returns A promise to the exn message
56
+ * @param said The said of the exn message
57
+ */
58
+ get(said: string): Promise<any>;
59
+ }
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];
@@ -0,0 +1,44 @@
1
+ import { SignifyClient } from './clienting';
2
+ import { Dict } from '../core/core';
3
+ /**
4
+ * Groups
5
+ */
6
+ export declare class Groups {
7
+ client: SignifyClient;
8
+ /**
9
+ * Groups
10
+ * @param {SignifyClient} client
11
+ */
12
+ constructor(client: SignifyClient);
13
+ /**
14
+ * Get group request messages
15
+ * @async
16
+ * @param {string} [said] SAID of exn message to load
17
+ * @returns {Promise<any>} A promise to the list of replay messages
18
+ */
19
+ getRequest(said: string): Promise<any>;
20
+ /**
21
+ * Send multisig exn request messages to other group members
22
+ * @async
23
+ * @param {string} [name] human readable name of group AID
24
+ * @param {Dict<any>} [exn] exn message to send to other members
25
+ * @param {string[]} [sigs] signature of the participant over the exn
26
+ * @param {string} [atc] additional attachments from embedded events in exn
27
+ * @returns {Promise<any>} A promise to the list of replay messages
28
+ */
29
+ sendRequest(name: string, exn: Dict<any>, sigs: string[], atc: string): Promise<any>;
30
+ /**
31
+ * Join multisig group using rotation event.
32
+ * This can be used by participants being asked to contribute keys to a rotation event to join an existing group.
33
+ * @async
34
+ * @param {string} [name] human readable name of group AID
35
+ * @param {any} [rot] rotation event
36
+ * @param {any} [sigs] signatures
37
+ * @param {string} [gid] prefix
38
+ * @param {string[]} [smids] array of particpants
39
+ * @param {string[]} [rmids] array of particpants
40
+ * @returns {Promise<any>} A promise to the list of replay messages
41
+ */
42
+ join(name: string, rot: any, sigs: any, //string[],
43
+ gid: string, smids: string[], rmids: string[]): Promise<any>;
44
+ }
@@ -1,47 +1,48 @@
1
- import { Manager } from "../core/manager";
2
- import { Serder } from "../core/serder";
3
- export declare class TraitCodex {
4
- EstOnly: string;
5
- DoNotDelegate: string;
6
- }
7
- export declare const TraitDex: TraitCodex;
8
- export interface HaberyArgs {
9
- name: string;
10
- passcode?: string;
11
- seed?: string | undefined;
12
- aeid?: string | undefined;
13
- pidx?: number | undefined;
14
- salt?: string | undefined;
15
- tier?: string | undefined;
16
- }
17
- export interface MakeHabArgs {
18
- code?: string;
19
- transferable?: boolean;
20
- isith?: string;
21
- icount?: number;
22
- nsith?: string;
23
- ncount?: number;
24
- toad?: string | number;
25
- wits?: Array<string>;
26
- delpre?: string;
27
- estOnly?: boolean;
28
- DnD?: boolean;
29
- data?: any;
30
- }
31
- export declare class Hab {
32
- name: string;
33
- serder: Serder;
34
- constructor(name: string, icp: Serder);
35
- get pre(): string;
36
- }
37
- export declare class Habery {
38
- private readonly _name;
39
- private readonly _mgr;
40
- private readonly _habs;
41
- constructor({ name, passcode, seed, aeid, pidx, salt }: HaberyArgs);
42
- get mgr(): Manager;
43
- get habs(): Array<Hab>;
44
- habByName(name: string): Hab | undefined;
45
- makeHab(name: string, { code, transferable, isith, icount, nsith, ncount, toad, wits, delpre, estOnly, DnD, data }: MakeHabArgs): Hab;
46
- get name(): string;
47
- }
1
+ import { Manager } from '../core/manager';
2
+ import { Serder } from '../core/serder';
3
+ export declare class TraitCodex {
4
+ EstOnly: string;
5
+ DoNotDelegate: string;
6
+ NoBackers: string;
7
+ }
8
+ export declare const TraitDex: TraitCodex;
9
+ export interface HaberyArgs {
10
+ name: string;
11
+ passcode?: string;
12
+ seed?: string | undefined;
13
+ aeid?: string | undefined;
14
+ pidx?: number | undefined;
15
+ salt?: string | undefined;
16
+ tier?: string | undefined;
17
+ }
18
+ export interface MakeHabArgs {
19
+ code?: string;
20
+ transferable?: boolean;
21
+ isith?: string;
22
+ icount?: number;
23
+ nsith?: string;
24
+ ncount?: number;
25
+ toad?: string | number;
26
+ wits?: Array<string>;
27
+ delpre?: string;
28
+ estOnly?: boolean;
29
+ DnD?: boolean;
30
+ data?: any;
31
+ }
32
+ export declare class Hab {
33
+ name: string;
34
+ serder: Serder;
35
+ constructor(name: string, icp: Serder);
36
+ get pre(): string;
37
+ }
38
+ export declare class Habery {
39
+ private readonly _name;
40
+ private readonly _mgr;
41
+ private readonly _habs;
42
+ constructor({ name, passcode, seed, aeid, pidx, salt }: HaberyArgs);
43
+ get mgr(): Manager;
44
+ get habs(): Array<Hab>;
45
+ habByName(name: string): Hab | undefined;
46
+ makeHab(name: string, { code, transferable, isith, icount, nsith, ncount, toad, wits, delpre, estOnly, DnD, data, }: MakeHabArgs): Hab;
47
+ get name(): string;
48
+ }
@@ -0,0 +1,34 @@
1
+ import { SignifyClient } from './clienting';
2
+ /**
3
+ * Notifications
4
+ */
5
+ export declare class Notifications {
6
+ client: SignifyClient;
7
+ /**
8
+ * Notifications
9
+ * @param {SignifyClient} client
10
+ */
11
+ constructor(client: SignifyClient);
12
+ /**
13
+ * List notifications
14
+ * @async
15
+ * @param {number} [start=0] Start index of list of notifications, defaults to 0
16
+ * @param {number} [end=24] End index of list of notifications, defaults to 24
17
+ * @returns {Promise<any>} A promise to the list of notifications
18
+ */
19
+ list(start?: number, end?: number): Promise<any>;
20
+ /**
21
+ * Mark a notification as read
22
+ * @async
23
+ * @param {string} said SAID of the notification
24
+ * @returns {Promise<string>} A promise to the result of the marking
25
+ */
26
+ mark(said: string): Promise<string>;
27
+ /**
28
+ * Delete a notification
29
+ * @async
30
+ * @param {string} said SAID of the notification
31
+ * @returns {Promise<any>} A promise to the result of the deletion
32
+ */
33
+ delete(said: string): Promise<void>;
34
+ }
@@ -1,9 +1,10 @@
1
- import { Signer } from "./signer";
2
- export declare class Authenticater {
3
- static DefaultFields: string[];
4
- private _verfer;
5
- private readonly _csig;
6
- constructor(csig: Signer, aaid: string);
7
- verify(headers: Headers, method: string, path: string): boolean;
8
- sign(headers: Headers, method: string, path: string, fields?: Array<string>): Headers;
9
- }
1
+ import { Signer } from './signer';
2
+ import { Verfer } from './verfer';
3
+ export declare class Authenticater {
4
+ static DefaultFields: string[];
5
+ private _verfer;
6
+ private readonly _csig;
7
+ constructor(csig: Signer, verfer: Verfer);
8
+ verify(headers: Headers, method: string, path: string): boolean;
9
+ sign(headers: Headers, method: string, path: string, fields?: Array<string>): Headers;
10
+ }
@@ -0,0 +1,7 @@
1
+ import { Matter, MatterArgs } from './matter';
2
+ export declare const Reb64: RegExp;
3
+ export declare class Bexter extends Matter {
4
+ constructor({ raw, code, qb64b, qb64, qb2 }: MatterArgs, bext?: string);
5
+ static _rawify(bext: string): Uint8Array;
6
+ get bext(): string;
7
+ }
@@ -1,8 +1,8 @@
1
- import { Verfer } from "./verfer";
2
- import { Matter, MatterArgs } from "./matter";
3
- export declare class Cigar extends Matter {
4
- private _verfer;
5
- constructor({ raw, code, qb64, qb64b, qb2 }: MatterArgs, verfer?: Verfer);
6
- get verfer(): Verfer | undefined;
7
- set verfer(verfer: Verfer | undefined);
8
- }
1
+ import { Verfer } from './verfer';
2
+ import { Matter, MatterArgs } from './matter';
3
+ export declare class Cigar extends Matter {
4
+ private _verfer;
5
+ constructor({ raw, code, qb64, qb64b, qb2 }: MatterArgs, verfer?: Verfer);
6
+ get verfer(): Verfer | undefined;
7
+ set verfer(verfer: Verfer | undefined);
8
+ }
@@ -1,5 +1,5 @@
1
- import { Matter, MatterArgs } from "./matter";
2
- export declare class Cipher extends Matter {
3
- constructor({ raw, code, qb64, qb64b, qb2 }: MatterArgs);
4
- decrypt(prikey?: Uint8Array | undefined, seed?: Uint8Array | undefined): any;
5
- }
1
+ import { Matter, MatterArgs } from './matter';
2
+ export declare class Cipher extends Matter {
3
+ constructor({ raw, code, qb64, qb64b, qb2 }: MatterArgs);
4
+ decrypt(prikey?: Uint8Array | undefined, seed?: Uint8Array | undefined): any;
5
+ }