signify-ts 0.2.1 → 0.3.0-rc2

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 (128) hide show
  1. package/README.md +104 -34
  2. package/dist/exports.d.ts +40 -40
  3. package/dist/exports.js +40 -0
  4. package/dist/index.d.ts +2 -3
  5. package/dist/index.js +3 -8
  6. package/dist/keri/app/aiding.d.ts +34 -14
  7. package/{src/keri/app/aiding.ts → dist/keri/app/aiding.js} +104 -235
  8. package/dist/keri/app/clienting.d.ts +57 -22
  9. package/{src/keri/app/clienting.ts → dist/keri/app/clienting.js} +145 -234
  10. package/dist/keri/app/contacting.d.ts +33 -21
  11. package/{src/keri/app/contacting.ts → dist/keri/app/contacting.js} +25 -62
  12. package/dist/keri/app/controller.d.ts +49 -6
  13. package/{src/keri/app/controller.ts → dist/keri/app/controller.js} +79 -185
  14. package/dist/keri/app/coring.d.ts +30 -8
  15. package/{src/keri/app/coring.ts → dist/keri/app/coring.js} +62 -51
  16. package/dist/keri/app/credentialing.d.ts +183 -65
  17. package/dist/keri/app/credentialing.js +540 -0
  18. package/dist/keri/app/delegating.d.ts +18 -0
  19. package/dist/keri/app/delegating.js +24 -0
  20. package/dist/keri/app/escrowing.d.ts +1 -1
  21. package/{src/keri/app/escrowing.ts → dist/keri/app/escrowing.js} +2 -8
  22. package/dist/keri/app/exchanging.d.ts +7 -6
  23. package/{src/keri/app/exchanging.ts → dist/keri/app/exchanging.js} +33 -110
  24. package/dist/keri/app/grouping.d.ts +2 -2
  25. package/{src/keri/app/grouping.ts → dist/keri/app/grouping.js} +6 -25
  26. package/dist/keri/app/habery.d.ts +2 -2
  27. package/dist/keri/app/habery.js +117 -0
  28. package/dist/keri/app/notifying.d.ts +2 -2
  29. package/{src/keri/app/notifying.ts → dist/keri/app/notifying.js} +7 -17
  30. package/dist/keri/core/authing.d.ts +2 -2
  31. package/{src/keri/core/authing.ts → dist/keri/core/authing.js} +26 -42
  32. package/dist/keri/core/base64.d.ts +2 -0
  33. package/dist/keri/core/base64.js +16 -0
  34. package/dist/keri/core/bexter.d.ts +1 -1
  35. package/{src/keri/core/bexter.ts → dist/keri/core/bexter.js} +18 -32
  36. package/dist/keri/core/cigar.d.ts +2 -2
  37. package/dist/keri/core/cigar.js +13 -0
  38. package/dist/keri/core/cipher.d.ts +1 -1
  39. package/{src/keri/core/cipher.ts → dist/keri/core/cipher.js} +10 -19
  40. package/dist/keri/core/core.d.ts +117 -9
  41. package/dist/keri/core/core.js +385 -0
  42. package/dist/keri/core/counter.d.ts +2 -2
  43. package/dist/keri/core/counter.js +221 -0
  44. package/dist/keri/core/decrypter.d.ts +4 -4
  45. package/{src/keri/core/decrypter.ts → dist/keri/core/decrypter.js} +23 -40
  46. package/dist/keri/core/diger.d.ts +3 -3
  47. package/{src/keri/core/diger.ts → dist/keri/core/diger.js} +18 -33
  48. package/dist/keri/core/encrypter.d.ts +2 -2
  49. package/{src/keri/core/encrypter.ts → dist/keri/core/encrypter.js} +18 -38
  50. package/dist/keri/core/eventing.d.ts +4 -4
  51. package/{src/keri/core/eventing.ts → dist/keri/core/eventing.js} +134 -321
  52. package/dist/keri/core/httping.d.ts +11 -4
  53. package/{src/keri/core/httping.ts → dist/keri/core/httping.js} +36 -101
  54. package/dist/keri/core/indexer.d.ts +1 -1
  55. package/dist/keri/core/indexer.js +407 -0
  56. package/dist/keri/core/keeping.d.ts +98 -46
  57. package/dist/keri/core/keeping.js +365 -0
  58. package/{src/keri/core/kering.ts → dist/keri/core/kering.js} +1 -3
  59. package/dist/keri/core/keyState.d.ts +85 -0
  60. package/dist/keri/core/keyState.js +1 -0
  61. package/dist/keri/core/manager.d.ts +147 -12
  62. package/dist/keri/core/manager.js +880 -0
  63. package/dist/keri/core/matter.d.ts +1 -1
  64. package/dist/keri/core/matter.js +460 -0
  65. package/dist/keri/core/number.d.ts +1 -1
  66. package/{src/keri/core/number.ts → dist/keri/core/number.js} +21 -30
  67. package/dist/keri/core/pather.d.ts +2 -2
  68. package/{src/keri/core/pather.ts → dist/keri/core/pather.js} +12 -27
  69. package/dist/keri/core/prefixer.d.ts +10 -10
  70. package/dist/keri/core/prefixer.js +182 -0
  71. package/dist/keri/core/saider.d.ts +2 -12
  72. package/dist/keri/core/saider.js +107 -0
  73. package/dist/keri/core/salter.d.ts +45 -3
  74. package/dist/keri/core/salter.js +117 -0
  75. package/dist/keri/core/seqner.d.ts +1 -1
  76. package/{src/keri/core/seqner.ts → dist/keri/core/seqner.js} +20 -21
  77. package/dist/keri/core/serder.d.ts +25 -12
  78. package/dist/keri/core/serder.js +133 -0
  79. package/dist/keri/core/siger.d.ts +2 -2
  80. package/{src/keri/core/siger.ts → dist/keri/core/siger.js} +4 -14
  81. package/dist/keri/core/signer.d.ts +4 -4
  82. package/dist/keri/core/signer.js +84 -0
  83. package/{src/keri/core/tholder.ts → dist/keri/core/tholder.js} +69 -94
  84. package/dist/keri/core/utils.d.ts +1 -1
  85. package/{src/keri/core/utils.ts → dist/keri/core/utils.js} +30 -60
  86. package/dist/keri/core/vdring.d.ts +2 -2
  87. package/dist/keri/core/vdring.js +61 -0
  88. package/dist/keri/core/verfer.d.ts +2 -6
  89. package/dist/keri/core/verfer.js +37 -0
  90. package/dist/keri/end/ending.d.ts +10 -8
  91. package/dist/keri/end/ending.js +136 -0
  92. package/{src/ready.ts → dist/ready.js} +1 -2
  93. package/dist/types/keria-api-schema.d.ts +304 -0
  94. package/dist/types/keria-api-schema.js +2 -0
  95. package/package.json +53 -50
  96. package/dist/buffer-polyfill.d.ts +0 -1
  97. package/dist/math.d.ts +0 -1
  98. package/dist/signify-ts.cjs +0 -7842
  99. package/dist/signify-ts.cjs.development.js +0 -9501
  100. package/dist/signify-ts.cjs.development.js.map +0 -1
  101. package/dist/signify-ts.cjs.map +0 -7
  102. package/dist/signify-ts.cjs.production.min.js +0 -2
  103. package/dist/signify-ts.cjs.production.min.js.map +0 -1
  104. package/dist/signify-ts.esm.js +0 -9345
  105. package/dist/signify-ts.esm.js.map +0 -1
  106. package/dist/signify-ts.mjs +0 -7818
  107. package/dist/signify-ts.mjs.map +0 -7
  108. package/src/buffer-polyfill.ts +0 -5
  109. package/src/exports.ts +0 -44
  110. package/src/index.ts +0 -4
  111. package/src/keri/app/credentialing.ts +0 -841
  112. package/src/keri/app/habery.ts +0 -185
  113. package/src/keri/core/cigar.ts +0 -18
  114. package/src/keri/core/core.ts +0 -326
  115. package/src/keri/core/counter.ts +0 -273
  116. package/src/keri/core/indexer.ts +0 -509
  117. package/src/keri/core/keeping.ts +0 -684
  118. package/src/keri/core/manager.ts +0 -1183
  119. package/src/keri/core/matter.ts +0 -521
  120. package/src/keri/core/prefixer.ts +0 -233
  121. package/src/keri/core/saider.ts +0 -186
  122. package/src/keri/core/salter.ts +0 -120
  123. package/src/keri/core/serder.ts +0 -163
  124. package/src/keri/core/signer.ts +0 -133
  125. package/src/keri/core/vdring.ts +0 -94
  126. package/src/keri/core/verfer.ts +0 -47
  127. package/src/keri/end/ending.ts +0 -170
  128. package/src/math.ts +0 -3
@@ -1,44 +1,37 @@
1
- import { SignifyClient } from './clienting';
2
1
  import libsodium from 'libsodium-wrappers-sumo';
3
- import { Salter } from '../core/salter';
4
- import { Matter, MtrDex } from '../core/matter';
5
-
6
- export function randomPasscode(): string {
2
+ import { Salter } from "../core/salter.js";
3
+ import { Matter, MtrDex } from "../core/matter.js";
4
+ export function randomPasscode() {
7
5
  const raw = libsodium.randombytes_buf(16);
8
6
  const salter = new Salter({ raw: raw });
9
-
10
- return salter.qb64.substring(2);
7
+ // https://github.com/WebOfTrust/signify-ts/issues/242
8
+ return salter.qb64.substring(2, 23);
11
9
  }
12
-
13
- export function randomNonce(): string {
10
+ export function randomNonce() {
14
11
  const seed = libsodium.randombytes_buf(libsodium.crypto_sign_SEEDBYTES);
15
12
  const seedqb64 = new Matter({ raw: seed, code: MtrDex.Ed25519_Seed });
16
13
  return seedqb64.qb64;
17
14
  }
18
-
19
15
  export class Oobis {
20
- public client: SignifyClient;
21
16
  /**
22
17
  * Oobis
23
18
  * @param {SignifyClient} client
24
19
  */
25
- constructor(client: SignifyClient) {
20
+ constructor(client) {
26
21
  this.client = client;
27
22
  }
28
-
29
23
  /**
30
24
  * Get the OOBI(s) for a managed indentifier for a given role
31
25
  * @param {string} name Name or alias of the identifier
32
26
  * @param {string} role Authorized role
33
27
  * @returns {Promise<any>} A promise to the OOBI(s)
34
28
  */
35
- async get(name: string, role: string = 'agent'): Promise<any> {
29
+ async get(name, role = 'agent') {
36
30
  const path = `/identifiers/${name}/oobis?role=${role}`;
37
31
  const method = 'GET';
38
32
  const res = await this.client.fetch(path, method, null);
39
33
  return await res.json();
40
34
  }
41
-
42
35
  /**
43
36
  * Resolve an OOBI
44
37
  * @async
@@ -46,9 +39,9 @@ export class Oobis {
46
39
  * @param {string} [alias] Optional name or alias to link the OOBI resolution to a contact
47
40
  * @returns {Promise<any>} A promise to the long-running operation
48
41
  */
49
- async resolve(oobi: string, alias?: string): Promise<any> {
42
+ async resolve(oobi, alias) {
50
43
  const path = `/oobis`;
51
- const data: any = {
44
+ const data = {
52
45
  url: oobi,
53
46
  };
54
47
  if (alias !== undefined) {
@@ -59,40 +52,26 @@ export class Oobis {
59
52
  return await res.json();
60
53
  }
61
54
  }
62
-
63
- export interface Operation<T = unknown> {
64
- name: string;
65
- metadata?: {
66
- depends?: Operation;
67
- [property: string]: any;
68
- };
69
- done?: boolean;
70
- error?: any;
71
- response?: T;
72
- }
73
-
74
55
  /**
75
56
  * Operations
76
57
  * @remarks
77
58
  * Operations represent the status and result of long running tasks performed by KERIA agent
78
59
  */
79
60
  export class Operations {
80
- public client: SignifyClient;
81
61
  /**
82
62
  * Operations
83
63
  * @param {SignifyClient} client
84
64
  */
85
- constructor(client: SignifyClient) {
65
+ constructor(client) {
86
66
  this.client = client;
87
67
  }
88
-
89
68
  /**
90
69
  * Get operation status
91
70
  * @async
92
71
  * @param {string} name Name of the operation
93
72
  * @returns {Promise<Operation>} A promise to the status of the operation
94
73
  */
95
- async get<T = unknown>(name: string): Promise<Operation<T>> {
74
+ async get(name) {
96
75
  const path = `/operations/${name}`;
97
76
  const data = null;
98
77
  const method = 'GET';
@@ -105,7 +84,7 @@ export class Operations {
105
84
  * @param {string} type Select operations by type
106
85
  * @returns {Promise<Operation[]>} A list of operations
107
86
  */
108
- async list(type?: string): Promise<Operation<any>[]> {
87
+ async list(type) {
109
88
  const params = new URLSearchParams();
110
89
  if (type !== undefined) {
111
90
  params.append('type', type);
@@ -121,34 +100,57 @@ export class Operations {
121
100
  * @async
122
101
  * @param {string} name Name of the operation
123
102
  */
124
- async delete(name: string): Promise<void> {
103
+ async delete(name) {
125
104
  const path = `/operations/${name}`;
126
105
  const data = null;
127
106
  const method = 'DELETE';
128
107
  await this.client.fetch(path, method, data);
129
108
  }
109
+ /**
110
+ * Poll for operation to become completed.
111
+ */
112
+ async wait(op, options = {}) {
113
+ var _a, _b, _c, _d, _e, _f;
114
+ const minSleep = (_a = options.minSleep) !== null && _a !== void 0 ? _a : 10;
115
+ const maxSleep = (_b = options.maxSleep) !== null && _b !== void 0 ? _b : 10000;
116
+ const increaseFactor = (_c = options.increaseFactor) !== null && _c !== void 0 ? _c : 50;
117
+ if (((_e = (_d = op.metadata) === null || _d === void 0 ? void 0 : _d.depends) === null || _e === void 0 ? void 0 : _e.done) === false) {
118
+ await this.wait(op.metadata.depends, options);
119
+ }
120
+ if (op.done === true) {
121
+ return op;
122
+ }
123
+ let retries = 0;
124
+ while (true) {
125
+ op = await this.get(op.name);
126
+ const delay = Math.max(minSleep, Math.min(maxSleep, 2 ** retries * increaseFactor));
127
+ retries++;
128
+ if (op.done === true) {
129
+ return op;
130
+ }
131
+ await new Promise((resolve) => setTimeout(resolve, delay));
132
+ (_f = options.signal) === null || _f === void 0 ? void 0 : _f.throwIfAborted();
133
+ }
134
+ }
130
135
  }
131
-
132
136
  /**
133
137
  * KeyEvents
134
138
  */
135
139
  export class KeyEvents {
136
- public client: SignifyClient;
137
140
  /**
138
141
  * KeyEvents
139
142
  * @param {SignifyClient} client
140
143
  */
141
- constructor(client: SignifyClient) {
144
+ constructor(client) {
142
145
  this.client = client;
143
146
  }
144
-
145
147
  /**
146
148
  * Retrieve key events for an identifier
147
149
  * @async
148
150
  * @param {string} pre Identifier prefix
149
151
  * @returns {Promise<any>} A promise to the key events
150
152
  */
151
- async get(pre: string): Promise<any> {
153
+ async get(pre) {
152
154
  const path = `/events?pre=${pre}`;
153
155
  const data = null;
154
156
  const method = 'GET';
@@ -156,48 +158,43 @@ export class KeyEvents {
156
158
  return await res.json();
157
159
  }
158
160
  }
159
-
160
161
  /**
161
162
  * KeyStates
162
163
  */
163
164
  export class KeyStates {
164
- public client: SignifyClient;
165
165
  /**
166
166
  * KeyStates
167
167
  * @param {SignifyClient} client
168
168
  */
169
- constructor(client: SignifyClient) {
169
+ constructor(client) {
170
170
  this.client = client;
171
171
  }
172
-
173
172
  /**
174
173
  * Retriene the key state for an identifier
175
174
  * @async
176
175
  * @param {string} pre Identifier prefix
177
176
  * @returns {Promise<any>} A promise to the key states
178
177
  */
179
- async get(pre: string): Promise<any> {
178
+ async get(pre) {
180
179
  const path = `/states?pre=${pre}`;
181
180
  const data = null;
182
181
  const method = 'GET';
183
182
  const res = await this.client.fetch(path, method, data);
184
183
  return await res.json();
185
184
  }
186
-
187
185
  /**
188
186
  * Retrieve the key state for a list of identifiers
189
187
  * @async
190
188
  * @param {Array<string>} pres List of identifier prefixes
191
189
  * @returns {Promise<any>} A promise to the key states
192
190
  */
193
- async list(pres: string[]): Promise<any> {
191
+ async list(pres) {
194
192
  const path = `/states?${pres.map((pre) => `pre=${pre}`).join('&')}`;
195
193
  const data = null;
196
194
  const method = 'GET';
197
195
  const res = await this.client.fetch(path, method, data);
198
196
  return await res.json();
199
197
  }
200
-
201
198
  /**
202
199
  * Query the key state of an identifier for a given sequence number or anchor
203
200
  * @async
@@ -206,9 +203,9 @@ export class KeyStates {
206
203
  * @param {any} [anchor] Optional anchor
207
204
  * @returns {Promise<any>} A promise to the long-running operation
208
205
  */
209
- async query(pre: string, sn?: string, anchor?: any): Promise<any> {
206
+ async query(pre, sn, anchor) {
210
207
  const path = `/queries`;
211
- const data: any = {
208
+ const data = {
212
209
  pre: pre,
213
210
  };
214
211
  if (sn !== undefined) {
@@ -217,9 +214,23 @@ export class KeyStates {
217
214
  if (anchor !== undefined) {
218
215
  data.anchor = anchor;
219
216
  }
220
-
221
217
  const method = 'POST';
222
218
  const res = await this.client.fetch(path, method, data);
223
219
  return await res.json();
224
220
  }
225
221
  }
222
+ export class Config {
223
+ /**
224
+ * Config
225
+ * @param {SignifyClient} client
226
+ */
227
+ constructor(client) {
228
+ this.client = client;
229
+ }
230
+ async get() {
231
+ const path = `/config`;
232
+ const method = 'GET';
233
+ const res = await this.client.fetch(path, method, null);
234
+ return await res.json();
235
+ }
236
+ }
@@ -1,7 +1,12 @@
1
- import { SignifyClient } from './clienting';
2
- import { Dict } from '../core/core';
3
- import { Serder } from '../core/serder';
4
- import { Operation } from './coring';
1
+ import { SignifyClient } from './clienting.ts';
2
+ import { Dict } from '../core/core.ts';
3
+ import { Serder } from '../core/serder.ts';
4
+ import { Operation } from './coring.ts';
5
+ import { HabState } from '../core/keyState.ts';
6
+ import { components } from '../../types/keria-api-schema.ts';
7
+ export type CredentialResult = components['schemas']['Credential'];
8
+ export type Registry = components['schemas']['Registry'];
9
+ export type Schema = components['schemas']['Schema'];
5
10
  /** Types of credentials */
6
11
  export declare class CredentialTypes {
7
12
  static issued: string;
@@ -14,43 +19,56 @@ export interface CredentialFilter {
14
19
  skip?: number;
15
20
  limit?: number;
16
21
  }
17
- export interface IssueCredentialArgs {
22
+ export interface CredentialSubject {
18
23
  /**
19
- * Name of the issuer identifier
24
+ * Issuee, or holder of the credential.
20
25
  */
21
- issuerName: string;
26
+ i?: string;
22
27
  /**
23
- * QB64 AID of credential registry
28
+ * Timestamp of issuance.
24
29
  */
25
- registryId: string;
30
+ dt?: string;
26
31
  /**
27
- * SAID Of the schema
32
+ * Privacy salt
28
33
  */
29
- schemaId: string;
34
+ u?: string;
35
+ [key: string]: unknown;
36
+ }
37
+ export interface CredentialData {
38
+ v?: string;
39
+ d?: string;
30
40
  /**
31
- * Prefix of recipient identifier
41
+ * Privacy salt
32
42
  */
33
- recipient?: string;
43
+ u?: string;
34
44
  /**
35
- * Credential data
45
+ * Issuer of the credential.
36
46
  */
37
- data?: Record<string, unknown>;
47
+ i?: string;
38
48
  /**
39
- * Credential rules
49
+ * Registry id.
40
50
  */
41
- rules?: string | Record<string, unknown>;
51
+ ri?: string;
42
52
  /**
43
- * Credential sources
53
+ * Schema id
44
54
  */
45
- source?: Record<string, unknown>;
55
+ s?: string;
46
56
  /**
47
- * Datetime to set for the credential
57
+ * Credential subject data
48
58
  */
49
- datetime?: string;
59
+ a: CredentialSubject;
60
+ /**
61
+ * Credential source section
62
+ */
63
+ e?: {
64
+ [key: string]: unknown;
65
+ };
50
66
  /**
51
- * Flag to issue a credential with privacy preserving features
67
+ * Credential rules section
52
68
  */
53
- privacy?: boolean;
69
+ r?: {
70
+ [key: string]: unknown;
71
+ };
54
72
  }
55
73
  export interface IssueCredentialResult {
56
74
  acdc: Serder;
@@ -63,6 +81,71 @@ export interface RevokeCredentialResult {
63
81
  rev: Serder;
64
82
  op: Operation;
65
83
  }
84
+ export interface IpexApplyArgs {
85
+ /**
86
+ * Alias for the IPEX sender AID
87
+ */
88
+ senderName: string;
89
+ /**
90
+ * Prefix of the IPEX recipient AID
91
+ */
92
+ recipient: string;
93
+ /**
94
+ * Message to send
95
+ */
96
+ message?: string;
97
+ /**
98
+ * SAID of schema to apply for
99
+ */
100
+ schemaSaid: string;
101
+ /**
102
+ * Optional attributes for selective disclosure
103
+ */
104
+ attributes?: Record<string, unknown>;
105
+ datetime?: string;
106
+ }
107
+ export interface IpexOfferArgs {
108
+ /**
109
+ * Alias for the IPEX sender AID
110
+ */
111
+ senderName: string;
112
+ /**
113
+ * Prefix of the IPEX recipient AID
114
+ */
115
+ recipient: string;
116
+ /**
117
+ * Message to send
118
+ */
119
+ message?: string;
120
+ /**
121
+ * ACDC to offer
122
+ */
123
+ acdc: Serder;
124
+ /**
125
+ * Optional qb64 SAID of apply message this offer is responding to
126
+ */
127
+ applySaid?: string;
128
+ datetime?: string;
129
+ }
130
+ export interface IpexAgreeArgs {
131
+ /**
132
+ * Alias for the IPEX sender AID
133
+ */
134
+ senderName: string;
135
+ /**
136
+ * Prefix of the IPEX recipient AID
137
+ */
138
+ recipient: string;
139
+ /**
140
+ * Message to send
141
+ */
142
+ message?: string;
143
+ /**
144
+ * qb64 SAID of offer message this agree is responding to
145
+ */
146
+ offerSaid: string;
147
+ datetime?: string;
148
+ }
66
149
  export interface IpexGrantArgs {
67
150
  /**
68
151
  * Alias for the IPEX sender AID
@@ -79,7 +162,7 @@ export interface IpexGrantArgs {
79
162
  /**
80
163
  * qb64 SAID of agree message this grant is responding to
81
164
  */
82
- agree?: string;
165
+ agreeSaid?: string;
83
166
  datetime?: string;
84
167
  acdc: Serder;
85
168
  acdcAttachment?: string;
@@ -88,6 +171,26 @@ export interface IpexGrantArgs {
88
171
  anc: Serder;
89
172
  ancAttachment?: string;
90
173
  }
174
+ export interface IpexAdmitArgs {
175
+ /**
176
+ * Alias for the IPEX sender AID
177
+ */
178
+ senderName: string;
179
+ /**
180
+ * Prefix of the IPEX recipient AID
181
+ */
182
+ recipient: string;
183
+ /**
184
+ * Message to send
185
+ */
186
+ message?: string;
187
+ /**
188
+ * qb64 SAID of agree message this admit is responding to
189
+ */
190
+ grantSaid: string;
191
+ datetime?: string;
192
+ }
193
+ export type CredentialState = components['schemas']['CredentialState'];
91
194
  /**
92
195
  * Credentials
93
196
  */
@@ -102,50 +205,47 @@ export declare class Credentials {
102
205
  * List credentials
103
206
  * @async
104
207
  * @param {CredentialFilter} [kargs] Optional parameters to filter the credentials
105
- * @returns {Promise<any>} A promise to the list of credentials
208
+ * @returns {Promise<CredentialResult[]>} A promise to the list of credentials
106
209
  */
107
- list(kargs?: CredentialFilter): Promise<any>;
210
+ list(kargs?: CredentialFilter): Promise<CredentialResult[]>;
108
211
  /**
109
212
  * Get a credential
110
213
  * @async
111
214
  * @param {string} said - SAID of the credential
112
215
  * @param {boolean} [includeCESR=false] - Optional flag export the credential in CESR format
113
- * @returns {Promise<any>} A promise to the credential
216
+ * @returns {Promise<CredentialResult | string>} A promise to the credential
114
217
  */
115
- get(said: string, includeCESR?: boolean): Promise<any>;
218
+ get(said: string): Promise<CredentialResult>;
219
+ get(said: string, includeCESR: false): Promise<CredentialResult>;
220
+ get(said: string, includeCESR: true): Promise<string>;
116
221
  /**
117
- * Issue a credential
222
+ * Delete a credential from the DB
223
+ * @async
224
+ * @param {string} said - SAID of the credential
225
+ * @returns {Promise<void>}
118
226
  */
119
- issue(args: IssueCredentialArgs): Promise<IssueCredentialResult>;
227
+ delete(said: string): Promise<void>;
120
228
  /**
121
- * Revoke credential
229
+ * Get the state of a credential
122
230
  * @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
231
+ * @param {string} ri - management registry identifier
232
+ * @param {string} said - SAID of the credential
233
+ * @returns {Promise<CredentialState>} A promise to the credential registry state
127
234
  */
128
- revoke(name: string, said: string, datetime?: string): Promise<RevokeCredentialResult>;
235
+ state(ri: string, said: string): Promise<CredentialState>;
129
236
  /**
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
237
+ * Creates a credential in the specified registry to be GRANTed with IPEX to the intended recipient
137
238
  */
138
- present(name: string, said: string, recipient: string, include?: boolean): Promise<string>;
239
+ issue(name: string, args: CredentialData): Promise<IssueCredentialResult>;
139
240
  /**
140
- * Request a presentation of a credential
241
+ * Revoke credential
141
242
  * @async
142
243
  * @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
244
+ * @param {string} said SAID of the credential
245
+ * @param {string} datetime date time of revocation
246
+ * @returns {Promise<RevokeCredentialResult>} A promise to the long-running operation
147
247
  */
148
- request(name: string, recipient: string, schema: string, issuer?: string): Promise<string>;
248
+ revoke(name: string, said: string, datetime?: string): Promise<RevokeCredentialResult>;
149
249
  }
150
250
  export interface CreateRegistryArgs {
151
251
  name: string;
@@ -164,7 +264,7 @@ export declare class RegistryResult {
164
264
  get regser(): any;
165
265
  get serder(): Serder;
166
266
  get sigs(): string[];
167
- op(): Promise<any>;
267
+ op(): Promise<Registry>;
168
268
  }
169
269
  /**
170
270
  * Registries
@@ -180,9 +280,9 @@ export declare class Registries {
180
280
  * List registries
181
281
  * @async
182
282
  * @param {string} name Name or alias of the identifier
183
- * @returns {Promise<any>} A promise to the list of registries
283
+ * @returns {Promise<Registry[]>} A promise to the list of registries
184
284
  */
185
- list(name: string): Promise<any>;
285
+ list(name: string): Promise<Registry[]>;
186
286
  /**
187
287
  * Create a registry
188
288
  * @async
@@ -190,7 +290,16 @@ export declare class Registries {
190
290
  * @returns {Promise<[any, Serder, any[], object]> } A promise to the long-running operation
191
291
  */
192
292
  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>;
293
+ createFromEvents(hab: HabState, name: string, registryName: string, vcp: Dict<any>, ixn: Dict<any>, sigs: any[]): Promise<Response>;
294
+ /**
295
+ * Rename a registry
296
+ * @async
297
+ * @param {string} name Name or alias of the identifier
298
+ * @param {string} registryName Current registry name
299
+ * @param {string} newName New registry name
300
+ * @returns {Promise<Registry>} A promise to the registry record
301
+ */
302
+ rename(name: string, registryName: string, newName: string): Promise<Registry>;
194
303
  }
195
304
  /**
196
305
  * Schemas
@@ -206,15 +315,15 @@ export declare class Schemas {
206
315
  * Get a schema
207
316
  * @async
208
317
  * @param {string} said SAID of the schema
209
- * @returns {Promise<any>} A promise to the schema
318
+ * @returns {Promise<Schema>} A promise to the schema
210
319
  */
211
- get(said: string): Promise<any>;
320
+ get(said: string): Promise<Schema>;
212
321
  /**
213
322
  * List schemas
214
323
  * @async
215
- * @returns {Promise<any>} A promise to the list of schemas
324
+ * @returns {Promise<Schema[]>} A promise to the list of schemas
216
325
  */
217
- list(): Promise<any>;
326
+ list(): Promise<Schema[]>;
218
327
  }
219
328
  /**
220
329
  * Ipex
@@ -226,6 +335,21 @@ export declare class Ipex {
226
335
  * @param {SignifyClient} client
227
336
  */
228
337
  constructor(client: SignifyClient);
338
+ /**
339
+ * Create an IPEX apply EXN message
340
+ */
341
+ apply(args: IpexApplyArgs): Promise<[Serder, string[], string]>;
342
+ submitApply(name: string, exn: Serder, sigs: string[], recp: string[]): Promise<any>;
343
+ /**
344
+ * Create an IPEX offer EXN message
345
+ */
346
+ offer(args: IpexOfferArgs): Promise<[Serder, string[], string]>;
347
+ submitOffer(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
348
+ /**
349
+ * Create an IPEX agree EXN message
350
+ */
351
+ agree(args: IpexAgreeArgs): Promise<[Serder, string[], string]>;
352
+ submitAgree(name: string, exn: Serder, sigs: string[], recp: string[]): Promise<any>;
229
353
  /**
230
354
  * Create an IPEX grant EXN message
231
355
  */
@@ -233,13 +357,7 @@ export declare class Ipex {
233
357
  submitGrant(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
234
358
  /**
235
359
  * 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
360
  */
243
- admit(name: string, message: string, grant: string, datetime?: string): Promise<[Serder, string[], string]>;
361
+ admit(args: IpexAdmitArgs): Promise<[Serder, string[], string]>;
244
362
  submitAdmit(name: string, exn: Serder, sigs: string[], atc: string, recp: string[]): Promise<any>;
245
363
  }