signify-ts 0.2.1 → 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.
- package/README.md +48 -26
- package/dist/exports.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/keri/app/aiding.d.ts +29 -9
- package/dist/keri/app/clienting.d.ts +28 -13
- package/dist/keri/app/contacting.d.ts +31 -19
- package/dist/keri/app/coring.d.ts +26 -2
- package/dist/keri/app/credentialing.d.ts +183 -49
- package/dist/keri/app/delegating.d.ts +18 -0
- package/dist/keri/app/exchanging.d.ts +4 -3
- package/dist/keri/app/notifying.d.ts +1 -1
- package/dist/keri/core/base64.d.ts +4 -0
- package/dist/keri/core/core.d.ts +2 -0
- package/dist/keri/core/httping.d.ts +2 -0
- package/dist/keri/core/keeping.d.ts +60 -41
- package/dist/keri/core/saider.d.ts +1 -0
- package/dist/keri/core/state.d.ts +62 -0
- package/dist/keri/end/ending.d.ts +10 -8
- package/dist/signify-ts.cjs +672 -534
- package/dist/signify-ts.cjs.map +4 -4
- package/dist/signify-ts.mjs +673 -535
- package/dist/signify-ts.mjs.map +4 -4
- package/package.json +33 -10
- package/src/exports.ts +1 -1
- package/src/index.ts +0 -1
- package/src/keri/app/aiding.ts +64 -35
- package/src/keri/app/clienting.ts +47 -50
- package/src/keri/app/contacting.ts +36 -21
- package/src/keri/app/coring.ts +81 -3
- package/src/keri/app/credentialing.ts +361 -197
- package/src/keri/app/delegating.ts +33 -0
- package/src/keri/app/exchanging.ts +24 -21
- package/src/keri/app/notifying.ts +2 -2
- package/src/keri/core/authing.ts +12 -5
- package/src/keri/core/base64.ts +28 -0
- package/src/keri/core/bexter.ts +4 -3
- package/src/keri/core/core.ts +2 -0
- package/src/keri/core/diger.ts +1 -1
- package/src/keri/core/eventing.ts +4 -4
- package/src/keri/core/httping.ts +6 -3
- package/src/keri/core/indexer.ts +4 -4
- package/src/keri/core/keeping.ts +143 -105
- package/src/keri/core/matter.ts +5 -5
- package/src/keri/core/number.ts +1 -1
- package/src/keri/core/prefixer.ts +2 -2
- package/src/keri/core/saider.ts +1 -1
- package/src/keri/core/serder.ts +1 -1
- package/src/keri/core/state.ts +69 -0
- package/src/keri/core/tholder.ts +5 -6
- package/src/keri/end/ending.ts +78 -81
- package/dist/buffer-polyfill.d.ts +0 -1
- package/dist/index.js +0 -8
- package/dist/math.d.ts +0 -1
- package/dist/signify-ts.cjs.development.js +0 -9501
- package/dist/signify-ts.cjs.development.js.map +0 -1
- package/dist/signify-ts.cjs.production.min.js +0 -2
- package/dist/signify-ts.cjs.production.min.js.map +0 -1
- package/dist/signify-ts.esm.js +0 -9345
- package/dist/signify-ts.esm.js.map +0 -1
- package/src/buffer-polyfill.ts +0 -5
- 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
|
|
18
|
+
export interface CredentialSubject {
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* Issuee, or holder of the credential.
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
i?: string;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* Timestamp of issuance.
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
+
dt?: string;
|
|
26
27
|
/**
|
|
27
|
-
*
|
|
28
|
+
* Privacy salt
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
+
u?: string;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface CredentialData {
|
|
34
|
+
v?: string;
|
|
35
|
+
d?: string;
|
|
30
36
|
/**
|
|
31
|
-
*
|
|
37
|
+
* Privacy salt
|
|
32
38
|
*/
|
|
33
|
-
|
|
39
|
+
u?: string;
|
|
34
40
|
/**
|
|
35
|
-
*
|
|
41
|
+
* Issuer of the credential.
|
|
36
42
|
*/
|
|
37
|
-
|
|
43
|
+
i?: string;
|
|
38
44
|
/**
|
|
39
|
-
*
|
|
45
|
+
* Registry id.
|
|
40
46
|
*/
|
|
41
|
-
|
|
47
|
+
ri?: string;
|
|
42
48
|
/**
|
|
43
|
-
*
|
|
49
|
+
* Schema id
|
|
44
50
|
*/
|
|
45
|
-
|
|
51
|
+
s?: string;
|
|
46
52
|
/**
|
|
47
|
-
*
|
|
53
|
+
* Credential subject data
|
|
48
54
|
*/
|
|
49
|
-
|
|
55
|
+
a: CredentialSubject;
|
|
56
|
+
/**
|
|
57
|
+
* Credential source section
|
|
58
|
+
*/
|
|
59
|
+
e?: {
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
};
|
|
50
62
|
/**
|
|
51
|
-
*
|
|
63
|
+
* Credential rules section
|
|
52
64
|
*/
|
|
53
|
-
|
|
65
|
+
r?: {
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
};
|
|
54
68
|
}
|
|
55
69
|
export interface IssueCredentialResult {
|
|
56
70
|
acdc: Serder;
|
|
@@ -63,6 +77,71 @@ export interface RevokeCredentialResult {
|
|
|
63
77
|
rev: Serder;
|
|
64
78
|
op: Operation;
|
|
65
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
|
+
}
|
|
66
145
|
export interface IpexGrantArgs {
|
|
67
146
|
/**
|
|
68
147
|
* Alias for the IPEX sender AID
|
|
@@ -79,7 +158,7 @@ export interface IpexGrantArgs {
|
|
|
79
158
|
/**
|
|
80
159
|
* qb64 SAID of agree message this grant is responding to
|
|
81
160
|
*/
|
|
82
|
-
|
|
161
|
+
agreeSaid?: string;
|
|
83
162
|
datetime?: string;
|
|
84
163
|
acdc: Serder;
|
|
85
164
|
acdcAttachment?: string;
|
|
@@ -88,6 +167,48 @@ export interface IpexGrantArgs {
|
|
|
88
167
|
anc: Serder;
|
|
89
168
|
ancAttachment?: string;
|
|
90
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
|
+
});
|
|
91
212
|
/**
|
|
92
213
|
* Credentials
|
|
93
214
|
*/
|
|
@@ -113,10 +234,25 @@ export declare class Credentials {
|
|
|
113
234
|
* @returns {Promise<any>} A promise to the credential
|
|
114
235
|
*/
|
|
115
236
|
get(said: string, includeCESR?: boolean): Promise<any>;
|
|
237
|
+
/**
|
|
238
|
+
* Delete a credential from the DB
|
|
239
|
+
* @async
|
|
240
|
+
* @param {string} said - SAID of the credential
|
|
241
|
+
* @returns {Promise<void>}
|
|
242
|
+
*/
|
|
243
|
+
delete(said: string): Promise<void>;
|
|
244
|
+
/**
|
|
245
|
+
* Get the state of a credential
|
|
246
|
+
* @async
|
|
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
|
|
250
|
+
*/
|
|
251
|
+
state(ri: string, said: string): Promise<CredentialState>;
|
|
116
252
|
/**
|
|
117
253
|
* Issue a credential
|
|
118
254
|
*/
|
|
119
|
-
issue(args:
|
|
255
|
+
issue(name: string, args: CredentialData): Promise<IssueCredentialResult>;
|
|
120
256
|
/**
|
|
121
257
|
* Revoke credential
|
|
122
258
|
* @async
|
|
@@ -126,26 +262,6 @@ export declare class Credentials {
|
|
|
126
262
|
* @returns {Promise<any>} A promise to the long-running operation
|
|
127
263
|
*/
|
|
128
264
|
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
265
|
}
|
|
150
266
|
export interface CreateRegistryArgs {
|
|
151
267
|
name: string;
|
|
@@ -190,7 +306,16 @@ export declare class Registries {
|
|
|
190
306
|
* @returns {Promise<[any, Serder, any[], object]> } A promise to the long-running operation
|
|
191
307
|
*/
|
|
192
308
|
create({ name, registryName, noBackers, toad, baks, nonce, }: CreateRegistryArgs): Promise<RegistryResult>;
|
|
193
|
-
createFromEvents(hab:
|
|
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>;
|
|
194
319
|
}
|
|
195
320
|
/**
|
|
196
321
|
* Schemas
|
|
@@ -226,6 +351,21 @@ export declare class Ipex {
|
|
|
226
351
|
* @param {SignifyClient} client
|
|
227
352
|
*/
|
|
228
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>;
|
|
229
369
|
/**
|
|
230
370
|
* Create an IPEX grant EXN message
|
|
231
371
|
*/
|
|
@@ -233,13 +373,7 @@ export declare class Ipex {
|
|
|
233
373
|
submitGrant(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
|
|
234
374
|
/**
|
|
235
375
|
* 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
376
|
*/
|
|
243
|
-
admit(
|
|
377
|
+
admit(args: IpexAdmitArgs): Promise<[Serder, string[], string]>;
|
|
244
378
|
submitAdmit(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
|
|
245
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:
|
|
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:
|
|
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
|
|
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<
|
|
31
|
+
* @returns {Promise<void>}
|
|
32
32
|
*/
|
|
33
33
|
delete(said: string): Promise<void>;
|
|
34
34
|
}
|
package/dist/keri/core/core.d.ts
CHANGED
|
@@ -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 {
|
|
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:
|
|
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):
|
|
19
|
-
get(aid:
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
|
95
|
-
incept(
|
|
96
|
-
rotate(_ncodes: string[], _transferable: boolean, states:
|
|
97
|
-
sign(ser: Uint8Array, indexed?: boolean
|
|
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:
|
|
100
|
-
keys: string[]
|
|
101
|
-
ndigs: string[]
|
|
118
|
+
mhab: HabState;
|
|
119
|
+
keys: string[];
|
|
120
|
+
ndigs: string[];
|
|
102
121
|
};
|
|
103
122
|
}
|
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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:
|
|
14
|
+
export declare function signature(signages: Signage[]): Headers;
|
|
13
15
|
export declare function designature(value: string): Signage[];
|