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
package/README.md CHANGED
@@ -9,7 +9,7 @@ Project Name: signify-ts
9
9
 
10
10
  ## Signify - KERI Signing at the Edge
11
11
 
12
- Of the five functions in a KERI agent,
12
+ Of the five functions in a KERI agent,
13
13
 
14
14
  1. Key generation
15
15
  2. Encrypted key storage
@@ -19,33 +19,66 @@ Of the five functions in a KERI agent,
19
19
 
20
20
  Signify-TS splits off two, key generation and event signing into a TypeScript library to provide "signing at the edge".
21
21
  It accomplishes this by using [libsodium](https://doc.libsodium.org/) to generate ed25519 key pairs for signing and x25519 key pairs for encrypting the
22
- private keys, next public keys and salts used to generate the private keys. The encrypted private key and salts are then stored on a
23
- remote cloud agent that never has access to the decryption keys. New key pair sets (current and next) will be generated
22
+ private keys, next public keys and salts used to generate the private keys. The encrypted private key and salts are then stored on a
23
+ remote cloud agent that never has access to the decryption keys. New key pair sets (current and next) will be generated
24
24
  for inception and rotation events with only the public keys and blake3 hash of the next keys made available to the agent.
25
25
 
26
26
  The communication protocol between a Signify client and [KERI](https://github.com/WebOfTrust/keri) agent will encode all cryptographic primitives as CESR base64
27
- encoded strings for the initial implementation. Support for binary CESR can be added in the future.
28
-
27
+ encoded strings for the initial implementation. Support for binary CESR can be added in the future.
29
28
 
30
29
  ### Environment Setup
31
30
 
32
31
  The code is built using Typescript and running code locally requires a Mac or Linux OS.
33
32
 
34
- - Install [Node.js](https://nodejs.org)
35
-
33
+ - Install [Node.js](https://nodejs.org)
36
34
 
37
- - Install dependencies:
35
+ - Install dependencies:
38
36
  ```bash
39
37
  npm install
40
38
  ```
41
39
 
42
40
  Typescript source files needs to be transpiled before running scripts or integration tests
43
41
 
44
- - Build:
42
+ - Generate types:
43
+
44
+ To generate TypeScript types from KERIA OpenAPI docs dynamically
45
+
46
+ ```
47
+ npm run generate:types
48
+ ```
49
+
50
+ We can specify KERIA spec url by this command:
51
+
52
+ ```
53
+ SPEC_URL=http://localhost:3902/spec.yaml npm run generate:types
54
+ ```
55
+
56
+ - Build:
57
+
45
58
  ```bash
46
59
  npm run build
47
60
  ```
48
61
 
62
+ - ready() must be called before library is useable. Example minimum viable client code.
63
+
64
+ ```javascript
65
+ import { randomPasscode, ready, SignifyClient, Tier } from 'signify-ts';
66
+
67
+ await ready();
68
+
69
+ const bran = randomPasscode();
70
+ const url = 'http://127.0.0.1:3901';
71
+ const boot_url = 'http://127.0.0.1:3903';
72
+ const actualSignifyClient = new SignifyClient(
73
+ url,
74
+ bran,
75
+ Tier.low,
76
+ boot_url
77
+ );
78
+
79
+ console.log(actualSignifyClient);
80
+ ```
81
+
49
82
  ### Unit testing
50
83
 
51
84
  To run unit tests
@@ -59,28 +92,34 @@ npm test
59
92
  The integration tests depends on a local instance of KERIA, vLEI-Server and Witness Demo. These are specified in the [Docker Compose](./docker-compose.yaml) file. To start the dependencies, use docker compose:
60
93
 
61
94
  ```bash
62
- docker compose up deps
95
+ docker compose up --wait
63
96
  ```
64
97
 
65
- If successful, it should print someting like this:
98
+ If successful, it should print something like this:
66
99
 
67
100
  ```bash
68
- $ docker compose up deps
69
- [+] Running 5/4
101
+ $ docker compose up --wait
102
+ [+] Running 4/4
70
103
  ✔ Network signify-ts_default Created 0.0s
71
- ✔ Container signify-ts-vlei-server-1 Created 0.1s
72
- ✔ Container signify-ts-keria-1 Created 0.1s
73
- ✔ Container signify-ts-witness-demo-1 Created 0.1s
74
- ✔ Container signify-ts-deps-1 Created 0.0s
75
- Attaching to signify-ts-deps-1
76
- signify-ts-deps-1 | Dependencies running
77
- signify-ts-deps-1 exited with code 0
104
+ ✔ Container signify-ts-vlei-server-1 Healthy 5.7s
105
+ ✔ Container signify-ts-keria-1 Healthy 6.2s
106
+ ✔ Container signify-ts-witness-demo-1 Healthy 6.2s
107
+ ```
108
+
109
+ It is possible to change the keria image by using environment variables. For example, to use weboftrust/keria:0.1.3, do:
110
+
111
+ ```bash
112
+ export KERIA_IMAGE_TAG=0.1.3
113
+ docker compose pull
114
+ docker compose up --wait
78
115
  ```
79
116
 
80
- **Important!** The integration tests runs on the build output in `dist/` directory. Make sure to run build before running the integration tests.
117
+ To use another repository, you can do:
81
118
 
82
119
  ```bash
83
- npm run build
120
+ export KERIA_IMAGE=gleif/keria
121
+ docker compose pull
122
+ docker compose up --wait
84
123
  ```
85
124
 
86
125
  Use the npm script "test:integration" to run all integration tests in sequence:
@@ -89,33 +128,64 @@ Use the npm script "test:integration" to run all integration tests in sequence:
89
128
  npm run test:integration
90
129
  ```
91
130
 
92
- Or, use execute `jest` directly to run a specific integration test, for example:
131
+ To execute a specific integration test, you can use:
93
132
 
94
133
  ```bash
95
- npx jest examples/integration-scripts/credentials.test.ts
134
+ npm run test:integration -- test-integration/credentials.test.ts
96
135
  ```
97
136
 
98
137
  It is also possible to run the tests using local instances of vLEI, Keria, and witness network. Set the environment variable `TEST_ENVIRONMENT` to `local`, e.g:
99
138
 
100
139
  ```
101
- TEST_ENVIRONMENT=local npx jest examples/integration-scripts/credentials.test.ts
140
+ TEST_ENVIRONMENT=local npm run test:integration test-integration/credentials.test.ts
102
141
  ```
103
142
 
104
143
  This changes the discovery urls to use `localhost` instead of the hostnames inside the docker network.
105
144
 
106
- ### Old integration scripts
107
-
108
- To run any of the old integration scripts that has not yet been converted to an integration test. Use `ts-node-esm`
109
-
110
- ```bash
111
- npx ts-node-esm examples/integration-scripts/challenge.ts
112
- ```
113
-
114
145
  # Diagrams
115
146
 
116
147
  Account Creation Workflow
117
148
 
118
149
  ![Account Creation](/diagrams/account-creation-workflow.png)
119
150
 
120
-
121
151
  ![Account Creation Webpage](/diagrams/account-creation-webpage-workflow.png)
152
+
153
+ # Publishing
154
+
155
+ This package is published on npm: https://www.npmjs.com/package/signify-ts.
156
+
157
+ If you need to publish a version under your own scope, you can use the [publish script](./publish.sh). This enables you to create development packages. For example:
158
+
159
+ ```bash
160
+ NPM_PACKAGE_SCOPE=@myorg DRY_RUN=1 ./publish.sh
161
+ npm notice Tarball Details
162
+ npm notice name: @myorg/signify-ts
163
+ npm notice version: 0.3.0-rc1-dev.8fa9919
164
+ npm notice filename: myorg-signify-ts-0.3.0-rc1-dev.8fa9919.tgz
165
+ npm notice package size: 81.0 kB
166
+ npm notice unpacked size: 370.0 kB
167
+ npm notice shasum: 8c160bc99d9ec552e6c478c20922cae3388a8ace
168
+ npm notice integrity: sha512-WRuD5PKFN3WBl[...]xVieCIS0UpVeg==
169
+ npm notice total files: 96
170
+ npm notice
171
+ npm notice Publishing to https://registry.npmjs.org/ with tag dev and default access (dry-run)
172
+ + @myorg/signify-ts@0.3.0-rc1-dev.8fa9919
173
+ ```
174
+
175
+ Set the `NPM_PUBLISH_TAG` to `latest` to skip the commit hash suffix in the version:
176
+
177
+ ```bash
178
+ NPM_PUBLISH_TAG=latest NPM_PACKAGE_SCOPE=@myorg DRY_RUN=1 ./publish.sh
179
+ npm notice Tarball Details
180
+ npm notice name: @myorg/signify-ts
181
+ npm notice version: 0.3.0-rc1
182
+ npm notice filename: myorg-signify-ts-0.3.0-rc1.tgz
183
+ npm notice package size: 80.9 kB
184
+ npm notice unpacked size: 370.0 kB
185
+ npm notice shasum: 8c9e4edcf19802e8acaf5996a36061a9c335b1c4
186
+ npm notice integrity: sha512-V1y2W3zs4Ccsn[...]vKY3WWgalcuBQ==
187
+ npm notice total files: 96
188
+ npm notice
189
+ npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access (dry-run)
190
+ + @myorg/signify-ts@0.3.0-rc1
191
+ ```
package/dist/exports.d.ts CHANGED
@@ -1,40 +1,40 @@
1
- export * from './ready';
2
- export * from './math';
3
- export * from './keri/app/habery';
4
- export * from './keri/app/controller';
5
- export * from './keri/app/aiding';
6
- export * from './keri/app/clienting';
7
- export * from './keri/app/contacting';
8
- export * from './keri/app/coring';
9
- export * from './keri/app/credentialing';
10
- export * from './keri/app/escrowing';
11
- export * from './keri/app/exchanging';
12
- export * from './keri/app/grouping';
13
- export * from './keri/app/notifying';
14
- export * from './keri/core/authing';
15
- export * from './keri/core/cigar';
16
- export * from './keri/core/cipher';
17
- export * from './keri/core/core';
18
- export * from './keri/core/counter';
19
- export * from './keri/core/decrypter';
20
- export * from './keri/core/diger';
21
- export * from './keri/core/encrypter';
22
- export * from './keri/core/eventing';
23
- export * from './keri/core/httping';
24
- export * from './keri/core/indexer';
25
- export * from './keri/core/keeping';
26
- export * from './keri/core/kering';
27
- export * from './keri/core/manager';
28
- export * from './keri/core/matter';
29
- export * from './keri/core/number';
30
- export * from './keri/core/prefixer';
31
- export * from './keri/core/saider';
32
- export * from './keri/core/salter';
33
- export * from './keri/core/seqner';
34
- export * from './keri/core/serder';
35
- export * from './keri/core/siger';
36
- export * from './keri/core/signer';
37
- export * from './keri/core/tholder';
38
- export * from './keri/core/utils';
39
- export * from './keri/core/verfer';
40
- export * from './keri/end/ending';
1
+ export * from './ready.ts';
2
+ export * from './keri/app/habery.ts';
3
+ export * from './keri/app/controller.ts';
4
+ export * from './keri/app/aiding.ts';
5
+ export * from './keri/app/clienting.ts';
6
+ export * from './keri/app/contacting.ts';
7
+ export * from './keri/app/coring.ts';
8
+ export * from './keri/app/credentialing.ts';
9
+ export * from './keri/app/escrowing.ts';
10
+ export * from './keri/app/exchanging.ts';
11
+ export * from './keri/app/grouping.ts';
12
+ export * from './keri/app/notifying.ts';
13
+ export * from './keri/core/authing.ts';
14
+ export * from './keri/core/cigar.ts';
15
+ export * from './keri/core/cipher.ts';
16
+ export * from './keri/core/core.ts';
17
+ export * from './keri/core/counter.ts';
18
+ export * from './keri/core/decrypter.ts';
19
+ export * from './keri/core/diger.ts';
20
+ export * from './keri/core/encrypter.ts';
21
+ export * from './keri/core/eventing.ts';
22
+ export * from './keri/core/httping.ts';
23
+ export * from './keri/core/indexer.ts';
24
+ export * from './keri/core/keeping.ts';
25
+ export * from './keri/core/kering.ts';
26
+ export * from './keri/core/manager.ts';
27
+ export * from './keri/core/matter.ts';
28
+ export * from './keri/core/number.ts';
29
+ export * from './keri/core/prefixer.ts';
30
+ export * from './keri/core/saider.ts';
31
+ export * from './keri/core/salter.ts';
32
+ export * from './keri/core/seqner.ts';
33
+ export * from './keri/core/serder.ts';
34
+ export * from './keri/core/siger.ts';
35
+ export * from './keri/core/signer.ts';
36
+ export * from './keri/core/tholder.ts';
37
+ export * from './keri/core/utils.ts';
38
+ export * from './keri/core/verfer.ts';
39
+ export * from './keri/core/keyState.ts';
40
+ export * from './keri/end/ending.ts';
@@ -0,0 +1,40 @@
1
+ export * from "./ready.js";
2
+ export * from "./keri/app/habery.js";
3
+ export * from "./keri/app/controller.js";
4
+ export * from "./keri/app/aiding.js";
5
+ export * from "./keri/app/clienting.js";
6
+ export * from "./keri/app/contacting.js";
7
+ export * from "./keri/app/coring.js";
8
+ export * from "./keri/app/credentialing.js";
9
+ export * from "./keri/app/escrowing.js";
10
+ export * from "./keri/app/exchanging.js";
11
+ export * from "./keri/app/grouping.js";
12
+ export * from "./keri/app/notifying.js";
13
+ export * from "./keri/core/authing.js";
14
+ export * from "./keri/core/cigar.js";
15
+ export * from "./keri/core/cipher.js";
16
+ export * from "./keri/core/core.js";
17
+ export * from "./keri/core/counter.js";
18
+ export * from "./keri/core/decrypter.js";
19
+ export * from "./keri/core/diger.js";
20
+ export * from "./keri/core/encrypter.js";
21
+ export * from "./keri/core/eventing.js";
22
+ export * from "./keri/core/httping.js";
23
+ export * from "./keri/core/indexer.js";
24
+ export * from "./keri/core/keeping.js";
25
+ export * from "./keri/core/kering.js";
26
+ export * from "./keri/core/manager.js";
27
+ export * from "./keri/core/matter.js";
28
+ export * from "./keri/core/number.js";
29
+ export * from "./keri/core/prefixer.js";
30
+ export * from "./keri/core/saider.js";
31
+ export * from "./keri/core/salter.js";
32
+ export * from "./keri/core/seqner.js";
33
+ export * from "./keri/core/serder.js";
34
+ export * from "./keri/core/siger.js";
35
+ export * from "./keri/core/signer.js";
36
+ export * from "./keri/core/tholder.js";
37
+ export * from "./keri/core/utils.js";
38
+ export * from "./keri/core/verfer.js";
39
+ export * from "./keri/core/keyState.js";
40
+ export * from "./keri/end/ending.js";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import './buffer-polyfill';
2
- import * as exp from './exports';
3
- export * from './exports';
1
+ import * as exp from './exports.ts';
2
+ export * from './exports.ts';
4
3
  export default exp;
package/dist/index.js CHANGED
@@ -1,8 +1,3 @@
1
-
2
- 'use strict'
3
-
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./signify-ts.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./signify-ts.cjs.development.js')
8
- }
1
+ import * as exp from "./exports.js";
2
+ export * from "./exports.js";
3
+ export default exp;
@@ -1,7 +1,8 @@
1
- import { Tier } from '../core/salter';
2
- import { Algos } from '../core/manager';
3
- import { Serder } from '../core/serder';
4
- import { KeyManager } from '../core/keeping';
1
+ import { Tier } from '../core/salter.ts';
2
+ import { Algos } from '../core/manager.ts';
3
+ import { Serder } from '../core/serder.ts';
4
+ import { IdentifierManagerFactory } from '../core/keeping.ts';
5
+ import { HabState } from '../core/keyState.ts';
5
6
  /** Arguments required to create an identfier */
6
7
  export interface CreateIdentiferArgs {
7
8
  transferable?: boolean;
@@ -19,9 +20,9 @@ export interface CreateIdentiferArgs {
19
20
  rstates?: any[];
20
21
  prxs?: any[];
21
22
  nxts?: any[];
22
- mhab?: any;
23
- keys?: any[];
24
- ndigs?: any[];
23
+ mhab?: HabState;
24
+ keys?: string[];
25
+ ndigs?: string[];
25
26
  bran?: string;
26
27
  count?: number;
27
28
  ncount?: number;
@@ -49,7 +50,13 @@ export interface RotateIdentifierArgs {
49
50
  export interface IdentifierDeps {
50
51
  fetch(pathname: string, method: string, body: unknown, headers?: Headers): Promise<Response>;
51
52
  pidx: number;
52
- manager: KeyManager | null;
53
+ manager: IdentifierManagerFactory | null;
54
+ }
55
+ /**
56
+ * Updatable information for a managed identifier
57
+ */
58
+ export interface IdentifierInfo {
59
+ name: string;
53
60
  }
54
61
  /** Identifier */
55
62
  export declare class Identifier {
@@ -70,10 +77,18 @@ export declare class Identifier {
70
77
  /**
71
78
  * Get information for a managed identifier
72
79
  * @async
73
- * @param {string} name Name or alias of the identifier
74
- * @returns {Promise<any>} A promise to the identifier information
80
+ * @param {string} name Prefix or alias of the identifier
81
+ * @returns {Promise<HabState>} A promise to the identifier information
75
82
  */
76
- get(name: string): Promise<any>;
83
+ get(name: string): Promise<HabState>;
84
+ /**
85
+ * Update managed identifier
86
+ * @async
87
+ * @param {string} name Prefix or alias of the identifier
88
+ * @param {IdentifierInfo} info Information to update for the given identifier
89
+ * @returns {Promise<HabState>} A promise to the identifier information after updating
90
+ */
91
+ update(name: string, info: IdentifierInfo): Promise<HabState>;
77
92
  /**
78
93
  * Create a managed identifier
79
94
  * @async
@@ -85,11 +100,16 @@ export declare class Identifier {
85
100
  /**
86
101
  * Generate an interaction event in a managed identifier
87
102
  * @async
88
- * @param {string} name Name or alias of the identifier
103
+ * @param {string} name Prefix or alias of the identifier
89
104
  * @param {any} [data] Option data to be anchored in the interaction event
90
105
  * @returns {Promise<EventResult>} A promise to the interaction event result
91
106
  */
92
107
  interact(name: string, data?: any): Promise<EventResult>;
108
+ createInteract(name: string, data?: any): Promise<{
109
+ serder: any;
110
+ sigs: any;
111
+ jsondata: any;
112
+ }>;
93
113
  /**
94
114
  * Generate a rotation event in a managed identifier
95
115
  * @param {string} name Name or alias of the identifier
@@ -130,8 +150,8 @@ export declare class Identifier {
130
150
  export declare class EventResult {
131
151
  private readonly _serder;
132
152
  private readonly _sigs;
133
- private readonly promise;
134
- constructor(serder: Serder, sigs: string[], promise: Promise<Response> | Response);
153
+ private readonly response;
154
+ constructor(serder: Serder, sigs: string[], response: Response);
135
155
  get serder(): Serder;
136
156
  get sigs(): string[];
137
157
  op(): Promise<any>;