@openvtc/trust-tasks 0.25.1 → 0.25.2
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/CHANGELOG.md +18 -0
- package/dist/_shared/components.d.ts +304 -2
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.d.ts +4 -4
- package/dist/device/list/0.1/payload.d.ts.map +1 -1
- package/dist/device/list/0.1/payload.js +6 -2
- package/dist/device/list/0.1/payload.js.map +1 -1
- package/dist/device/list/0.2/payload.d.ts +4 -4
- package/dist/device/list/0.2/payload.d.ts.map +1 -1
- package/dist/device/list/0.2/payload.js +6 -2
- package/dist/device/list/0.2/payload.js.map +1 -1
- package/dist/device/register/0.1/payload.d.ts +4 -4
- package/dist/device/register/0.1/payload.d.ts.map +1 -1
- package/dist/device/register/0.1/payload.js +6 -2
- package/dist/device/register/0.1/payload.js.map +1 -1
- package/dist/device/register/0.2/payload.d.ts +4 -4
- package/dist/device/register/0.2/payload.d.ts.map +1 -1
- package/dist/device/register/0.2/payload.js +6 -2
- package/dist/device/register/0.2/payload.js.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/vetting/_shared/0.1/hidden-vetting.d.ts +16 -0
- package/dist/vetting/_shared/0.1/hidden-vetting.d.ts.map +1 -0
- package/dist/vetting/_shared/0.1/hidden-vetting.js +6 -0
- package/dist/vetting/_shared/0.1/hidden-vetting.js.map +1 -0
- package/dist/vetting/attestation/0.1/payload.d.ts +94 -146
- package/dist/vetting/attestation/0.1/payload.d.ts.map +1 -1
- package/dist/vetting/attestation/0.1/payload.js +43 -43
- package/dist/vetting/attestation/0.1/payload.js.map +1 -1
- package/dist/vta/_shared/0.4/pcs-engine.d.ts +16 -0
- package/dist/vta/_shared/0.4/pcs-engine.d.ts.map +1 -0
- package/dist/vta/_shared/0.4/pcs-engine.js +6 -0
- package/dist/vta/_shared/0.4/pcs-engine.js.map +1 -0
- package/dist/vta/pcs/applications/create/0.1/payload.d.ts +1215 -0
- package/dist/vta/pcs/applications/create/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/applications/create/0.1/payload.js +724 -0
- package/dist/vta/pcs/applications/create/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/applications/delete/0.1/payload.d.ts +253 -0
- package/dist/vta/pcs/applications/delete/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/applications/delete/0.1/payload.js +146 -0
- package/dist/vta/pcs/applications/delete/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/applications/show/0.1/payload.d.ts +733 -0
- package/dist/vta/pcs/applications/show/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/applications/show/0.1/payload.js +450 -0
- package/dist/vta/pcs/applications/show/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/attest/0.1/payload.d.ts +1456 -0
- package/dist/vta/pcs/attest/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/attest/0.1/payload.js +876 -0
- package/dist/vta/pcs/attest/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/prove/0.1/payload.d.ts +1348 -0
- package/dist/vta/pcs/prove/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/prove/0.1/payload.js +804 -0
- package/dist/vta/pcs/prove/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/root-accept/0.1/payload.d.ts +1100 -0
- package/dist/vta/pcs/root-accept/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/root-accept/0.1/payload.js +634 -0
- package/dist/vta/pcs/root-accept/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/root-request/0.1/payload.d.ts +880 -0
- package/dist/vta/pcs/root-request/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/root-request/0.1/payload.js +496 -0
- package/dist/vta/pcs/root-request/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts +612 -0
- package/dist/vta/pcs/tokens/abandon/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/tokens/abandon/0.1/payload.js +355 -0
- package/dist/vta/pcs/tokens/abandon/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts +1149 -0
- package/dist/vta/pcs/tokens/accept/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/tokens/accept/0.1/payload.js +657 -0
- package/dist/vta/pcs/tokens/accept/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/tokens/request/0.1/payload.d.ts +908 -0
- package/dist/vta/pcs/tokens/request/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/tokens/request/0.1/payload.js +508 -0
- package/dist/vta/pcs/tokens/request/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts +1423 -0
- package/dist/vta/pcs/verify-attestation/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/verify-attestation/0.1/payload.js +850 -0
- package/dist/vta/pcs/verify-attestation/0.1/payload.js.map +1 -0
- package/dist/vta/pcs/vetter/show/0.1/payload.d.ts +605 -0
- package/dist/vta/pcs/vetter/show/0.1/payload.d.ts.map +1 -0
- package/dist/vta/pcs/vetter/show/0.1/payload.js +351 -0
- package/dist/vta/pcs/vetter/show/0.1/payload.js.map +1 -0
- package/dist/vtc/vetting/hidden/publish/0.1/payload.d.ts +403 -486
- package/dist/vtc/vetting/hidden/publish/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/vetting/hidden/publish/0.1/payload.js +240 -240
- package/dist/vtc/vetting/hidden/publish/0.1/payload.js.map +1 -1
- package/dist/vtc/vetting/hidden/show/0.1/payload.d.ts +482 -565
- package/dist/vtc/vetting/hidden/show/0.1/payload.d.ts.map +1 -1
- package/dist/vtc/vetting/hidden/show/0.1/payload.js +294 -294
- package/dist/vtc/vetting/hidden/show/0.1/payload.js.map +1 -1
- package/package.json +1 -1
- package/src/_shared/components.ts +308 -2
- package/src/device/list/0.1/payload.ts +6 -2
- package/src/device/list/0.2/payload.ts +6 -2
- package/src/device/register/0.1/payload.ts +6 -2
- package/src/device/register/0.2/payload.ts +6 -2
- package/src/index.ts +14 -0
- package/src/vetting/_shared/0.1/hidden-vetting.ts +17 -0
- package/src/vetting/attestation/0.1/payload.ts +49 -101
- package/src/vta/_shared/0.4/pcs-engine.ts +17 -0
- package/src/vta/pcs/applications/create/0.1/payload.ts +768 -0
- package/src/vta/pcs/applications/delete/0.1/payload.ts +182 -0
- package/src/vta/pcs/applications/show/0.1/payload.ts +482 -0
- package/src/vta/pcs/attest/0.1/payload.ts +943 -0
- package/src/vta/pcs/prove/0.1/payload.ts +845 -0
- package/src/vta/pcs/root-accept/0.1/payload.ts +681 -0
- package/src/vta/pcs/root-request/0.1/payload.ts +559 -0
- package/src/vta/pcs/tokens/abandon/0.1/payload.ts +392 -0
- package/src/vta/pcs/tokens/accept/0.1/payload.ts +713 -0
- package/src/vta/pcs/tokens/request/0.1/payload.ts +581 -0
- package/src/vta/pcs/verify-attestation/0.1/payload.ts +888 -0
- package/src/vta/pcs/vetter/show/0.1/payload.ts +387 -0
- package/src/vtc/vetting/hidden/publish/0.1/payload.ts +247 -331
- package/src/vtc/vetting/hidden/show/0.1/payload.ts +295 -379
|
@@ -0,0 +1,713 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/pcs/tokens/accept/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { CommunityParameters, Ext, Multibase, PublishedConfig, PublishedEvent, TickLength, Tier, TokenDraw, VetterSummary } from "../../../../../_shared/components.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A vetter's client hands its VTA the community's answer to a token draw; the VTA unblinds the tokens into the vetter's wallet.
|
|
11
|
+
*/
|
|
12
|
+
export interface VTAPCSTokensAcceptPayload {
|
|
13
|
+
/**
|
|
14
|
+
* The context the engine belongs to. Its key is derived from this context's base.
|
|
15
|
+
*/
|
|
16
|
+
contextId: string;
|
|
17
|
+
/**
|
|
18
|
+
* The community's DID: the helper whose parameters the engine runs under.
|
|
19
|
+
*/
|
|
20
|
+
community: string;
|
|
21
|
+
/**
|
|
22
|
+
* The community's published hidden-vetting parameters, copied verbatim from its join manifest.
|
|
23
|
+
*/
|
|
24
|
+
parameters: CommunityParameters;
|
|
25
|
+
/**
|
|
26
|
+
* The payload of the community's vtc/vetting/vetters/pcs-tokens/0.1 response, without its ext.
|
|
27
|
+
*/
|
|
28
|
+
response: {
|
|
29
|
+
label: string;
|
|
30
|
+
tick: number;
|
|
31
|
+
/**
|
|
32
|
+
* @minItems 1
|
|
33
|
+
* @maxItems 64
|
|
34
|
+
*/
|
|
35
|
+
preCredentials: [string, ...string[]];
|
|
36
|
+
};
|
|
37
|
+
ext?: Ext;
|
|
38
|
+
}
|
|
39
|
+
export interface VTAPCSTokensAcceptResponsePayload {
|
|
40
|
+
/**
|
|
41
|
+
* Tokens taken into the wallet.
|
|
42
|
+
*/
|
|
43
|
+
received: number;
|
|
44
|
+
vetter: VetterSummary;
|
|
45
|
+
ext?: Ext;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
49
|
+
export type { CommunityParameters, Ext, Multibase, PublishedConfig, PublishedEvent, TickLength, Tier, TokenDraw, VetterSummary };
|
|
50
|
+
|
|
51
|
+
/** Trust Task type URI. */
|
|
52
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/pcs/tokens/accept/0.1" as const;
|
|
53
|
+
|
|
54
|
+
/** Stable alias for this specification's request payload shape. */
|
|
55
|
+
export type Payload = VTAPCSTokensAcceptPayload;
|
|
56
|
+
|
|
57
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
58
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/pcs/tokens/accept/0.1#response" as const;
|
|
59
|
+
|
|
60
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
61
|
+
export type Response = VTAPCSTokensAcceptResponsePayload;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* This specification's payload schema, as a value.
|
|
65
|
+
*
|
|
66
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
67
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
68
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
69
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
70
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
71
|
+
*/
|
|
72
|
+
export const PAYLOAD_SCHEMA = {
|
|
73
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
74
|
+
"$id": "https://trusttasks.org/spec/vta/pcs/tokens/accept/0.1",
|
|
75
|
+
"title": "VTA PCS — Tokens — Accept — payload",
|
|
76
|
+
"description": "A vetter's client hands its VTA the community's answer to a token draw; the VTA unblinds the tokens into the vetter's wallet.",
|
|
77
|
+
"type": "object",
|
|
78
|
+
"additionalProperties": false,
|
|
79
|
+
"required": [
|
|
80
|
+
"contextId",
|
|
81
|
+
"community",
|
|
82
|
+
"parameters",
|
|
83
|
+
"response"
|
|
84
|
+
],
|
|
85
|
+
"properties": {
|
|
86
|
+
"contextId": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"minLength": 1,
|
|
89
|
+
"description": "The context the engine belongs to. Its key is derived from this context's base."
|
|
90
|
+
},
|
|
91
|
+
"community": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"minLength": 1,
|
|
94
|
+
"description": "The community's DID: the helper whose parameters the engine runs under."
|
|
95
|
+
},
|
|
96
|
+
"parameters": {
|
|
97
|
+
"$ref": "#/$defs/CommunityParameters",
|
|
98
|
+
"description": "The community's published hidden-vetting parameters, copied verbatim from its join manifest."
|
|
99
|
+
},
|
|
100
|
+
"response": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"required": [
|
|
104
|
+
"label",
|
|
105
|
+
"tick",
|
|
106
|
+
"preCredentials"
|
|
107
|
+
],
|
|
108
|
+
"description": "The payload of the community's vtc/vetting/vetters/pcs-tokens/0.1 response, without its ext.",
|
|
109
|
+
"properties": {
|
|
110
|
+
"label": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"minLength": 1,
|
|
113
|
+
"maxLength": 128
|
|
114
|
+
},
|
|
115
|
+
"tick": {
|
|
116
|
+
"type": "integer",
|
|
117
|
+
"minimum": 0
|
|
118
|
+
},
|
|
119
|
+
"preCredentials": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"minItems": 1,
|
|
122
|
+
"maxItems": 64,
|
|
123
|
+
"items": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"ext": {
|
|
131
|
+
"$ref": "#/$defs/Ext"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"$defs": {
|
|
135
|
+
"Response": {
|
|
136
|
+
"$anchor": "response",
|
|
137
|
+
"title": "VTA PCS — Tokens — Accept — response payload",
|
|
138
|
+
"type": "object",
|
|
139
|
+
"additionalProperties": false,
|
|
140
|
+
"required": [
|
|
141
|
+
"received",
|
|
142
|
+
"vetter"
|
|
143
|
+
],
|
|
144
|
+
"properties": {
|
|
145
|
+
"received": {
|
|
146
|
+
"type": "integer",
|
|
147
|
+
"minimum": 0,
|
|
148
|
+
"description": "Tokens taken into the wallet."
|
|
149
|
+
},
|
|
150
|
+
"vetter": {
|
|
151
|
+
"$ref": "#/$defs/VetterSummary"
|
|
152
|
+
},
|
|
153
|
+
"ext": {
|
|
154
|
+
"$ref": "#/$defs/Ext"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"Ext": {
|
|
159
|
+
"title": "Ext",
|
|
160
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
161
|
+
"type": "object",
|
|
162
|
+
"minProperties": 1,
|
|
163
|
+
"additionalProperties": true,
|
|
164
|
+
"propertyNames": {
|
|
165
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"VetterSummary": {
|
|
169
|
+
"title": "VetterSummary",
|
|
170
|
+
"description": "A vetter engine as the VTA holds it, without its key, its credentials or its tokens.",
|
|
171
|
+
"type": "object",
|
|
172
|
+
"additionalProperties": false,
|
|
173
|
+
"required": [
|
|
174
|
+
"contextId",
|
|
175
|
+
"community",
|
|
176
|
+
"memberDid",
|
|
177
|
+
"suite",
|
|
178
|
+
"id",
|
|
179
|
+
"enrolledLabels",
|
|
180
|
+
"pendingLabels",
|
|
181
|
+
"tokensFree",
|
|
182
|
+
"tokensHeld",
|
|
183
|
+
"drawsInFlight",
|
|
184
|
+
"attested"
|
|
185
|
+
],
|
|
186
|
+
"properties": {
|
|
187
|
+
"contextId": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"minLength": 1
|
|
190
|
+
},
|
|
191
|
+
"community": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"minLength": 1
|
|
194
|
+
},
|
|
195
|
+
"memberDid": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"minLength": 1,
|
|
198
|
+
"description": "The member DID the engine draws tokens as. Bound into every token request."
|
|
199
|
+
},
|
|
200
|
+
"suite": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"minLength": 1,
|
|
203
|
+
"maxLength": 64
|
|
204
|
+
},
|
|
205
|
+
"id": {
|
|
206
|
+
"$ref": "#/$defs/Multibase",
|
|
207
|
+
"description": "The vetter's PCS identifier for this community."
|
|
208
|
+
},
|
|
209
|
+
"enrolledLabels": {
|
|
210
|
+
"type": "array",
|
|
211
|
+
"description": "Class labels this vetter holds a credential under, newest first.",
|
|
212
|
+
"items": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"pattern": "^vetter/[0-9]{4}-[0-9]{2}$"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"pendingLabels": {
|
|
218
|
+
"type": "array",
|
|
219
|
+
"description": "Class labels requested and not yet accepted.",
|
|
220
|
+
"items": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"pattern": "^vetter/[0-9]{4}-[0-9]{2}$"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"tokensFree": {
|
|
226
|
+
"type": "integer",
|
|
227
|
+
"minimum": 0,
|
|
228
|
+
"description": "Tokens held and not reserved."
|
|
229
|
+
},
|
|
230
|
+
"tokensHeld": {
|
|
231
|
+
"type": "integer",
|
|
232
|
+
"minimum": 0,
|
|
233
|
+
"description": "Tokens held in all."
|
|
234
|
+
},
|
|
235
|
+
"drawsInFlight": {
|
|
236
|
+
"type": "array",
|
|
237
|
+
"description": "Draws requested and not yet accepted or abandoned.",
|
|
238
|
+
"items": {
|
|
239
|
+
"$ref": "#/$defs/TokenDraw"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"attested": {
|
|
243
|
+
"type": "integer",
|
|
244
|
+
"minimum": 0,
|
|
245
|
+
"description": "Attestations made through this engine."
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"TokenDraw": {
|
|
250
|
+
"title": "TokenDraw",
|
|
251
|
+
"description": "One draw of the token drip: a label and a tick.",
|
|
252
|
+
"type": "object",
|
|
253
|
+
"additionalProperties": false,
|
|
254
|
+
"required": [
|
|
255
|
+
"label",
|
|
256
|
+
"tick"
|
|
257
|
+
],
|
|
258
|
+
"properties": {
|
|
259
|
+
"label": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"minLength": 1,
|
|
262
|
+
"maxLength": 128
|
|
263
|
+
},
|
|
264
|
+
"tick": {
|
|
265
|
+
"type": "integer",
|
|
266
|
+
"minimum": 0
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"Multibase": {
|
|
271
|
+
"title": "Multibase",
|
|
272
|
+
"description": "A binary value, multibase base58btc over the suite's canonical encoding.",
|
|
273
|
+
"type": "string",
|
|
274
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
275
|
+
},
|
|
276
|
+
"CommunityParameters": {
|
|
277
|
+
"title": "CommunityParameters",
|
|
278
|
+
"description": "The community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.",
|
|
279
|
+
"$ref": "#/$defs/PublishedConfig"
|
|
280
|
+
},
|
|
281
|
+
"PublishedConfig": {
|
|
282
|
+
"title": "PublishedConfig",
|
|
283
|
+
"description": "The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.",
|
|
284
|
+
"type": "object",
|
|
285
|
+
"additionalProperties": false,
|
|
286
|
+
"required": [
|
|
287
|
+
"suite",
|
|
288
|
+
"helperKey",
|
|
289
|
+
"tokenKey",
|
|
290
|
+
"vetterLabels",
|
|
291
|
+
"tokenLabels",
|
|
292
|
+
"dripPerTick",
|
|
293
|
+
"tickLength",
|
|
294
|
+
"events"
|
|
295
|
+
],
|
|
296
|
+
"properties": {
|
|
297
|
+
"suite": {
|
|
298
|
+
"type": "string",
|
|
299
|
+
"minLength": 1
|
|
300
|
+
},
|
|
301
|
+
"helperKey": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"minLength": 1,
|
|
304
|
+
"description": "The helper verification key, multibase — named for its role on the wire rather than for hvk."
|
|
305
|
+
},
|
|
306
|
+
"tokenKey": {
|
|
307
|
+
"type": "string",
|
|
308
|
+
"minLength": 1,
|
|
309
|
+
"description": "The token verification key, multibase — named for its role on the wire rather than for tvk."
|
|
310
|
+
},
|
|
311
|
+
"vetterLabels": {
|
|
312
|
+
"type": "array",
|
|
313
|
+
"items": {
|
|
314
|
+
"type": "string",
|
|
315
|
+
"minLength": 1
|
|
316
|
+
},
|
|
317
|
+
"description": "Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period."
|
|
318
|
+
},
|
|
319
|
+
"tokenLabels": {
|
|
320
|
+
"type": "array",
|
|
321
|
+
"items": {
|
|
322
|
+
"type": "string",
|
|
323
|
+
"minLength": 1
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"dripPerTick": {
|
|
327
|
+
"type": "integer",
|
|
328
|
+
"minimum": 1
|
|
329
|
+
},
|
|
330
|
+
"tickLength": {
|
|
331
|
+
"$ref": "#/$defs/TickLength"
|
|
332
|
+
},
|
|
333
|
+
"events": {
|
|
334
|
+
"type": "array",
|
|
335
|
+
"items": {
|
|
336
|
+
"$ref": "#/$defs/PublishedEvent"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"PublishedEvent": {
|
|
342
|
+
"title": "PublishedEvent",
|
|
343
|
+
"description": "The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.",
|
|
344
|
+
"type": "object",
|
|
345
|
+
"additionalProperties": false,
|
|
346
|
+
"required": [
|
|
347
|
+
"eventId",
|
|
348
|
+
"startDate",
|
|
349
|
+
"endDate",
|
|
350
|
+
"groupFloor",
|
|
351
|
+
"tiers"
|
|
352
|
+
],
|
|
353
|
+
"properties": {
|
|
354
|
+
"eventId": {
|
|
355
|
+
"type": "string",
|
|
356
|
+
"minLength": 1
|
|
357
|
+
},
|
|
358
|
+
"startDate": {
|
|
359
|
+
"type": "string",
|
|
360
|
+
"format": "date"
|
|
361
|
+
},
|
|
362
|
+
"endDate": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"format": "date"
|
|
365
|
+
},
|
|
366
|
+
"groupFloor": {
|
|
367
|
+
"type": "integer",
|
|
368
|
+
"minimum": 1
|
|
369
|
+
},
|
|
370
|
+
"tiers": {
|
|
371
|
+
"type": "array",
|
|
372
|
+
"items": {
|
|
373
|
+
"$ref": "#/$defs/Tier"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
"Tier": {
|
|
379
|
+
"title": "Tier",
|
|
380
|
+
"type": "object",
|
|
381
|
+
"additionalProperties": false,
|
|
382
|
+
"required": [
|
|
383
|
+
"name",
|
|
384
|
+
"dripPerTick"
|
|
385
|
+
],
|
|
386
|
+
"properties": {
|
|
387
|
+
"name": {
|
|
388
|
+
"type": "string",
|
|
389
|
+
"minLength": 1,
|
|
390
|
+
"description": "How the menu names it: desk, busy-desk."
|
|
391
|
+
},
|
|
392
|
+
"dripPerTick": {
|
|
393
|
+
"type": "integer",
|
|
394
|
+
"minimum": 1,
|
|
395
|
+
"description": "How many tokens a tick under this tier yields."
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
"TickLength": {
|
|
400
|
+
"title": "TickLength",
|
|
401
|
+
"type": "string",
|
|
402
|
+
"pattern": "^P(?:\\d+D(?:T\\d+H)?|T\\d+H)$",
|
|
403
|
+
"description": "The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`)."
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
} as const;
|
|
407
|
+
|
|
408
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
409
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
410
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
411
|
+
"$ref": "#/$defs/Response",
|
|
412
|
+
"$defs": {
|
|
413
|
+
"Response": {
|
|
414
|
+
"$anchor": "response",
|
|
415
|
+
"title": "VTA PCS — Tokens — Accept — response payload",
|
|
416
|
+
"type": "object",
|
|
417
|
+
"additionalProperties": false,
|
|
418
|
+
"required": [
|
|
419
|
+
"received",
|
|
420
|
+
"vetter"
|
|
421
|
+
],
|
|
422
|
+
"properties": {
|
|
423
|
+
"received": {
|
|
424
|
+
"type": "integer",
|
|
425
|
+
"minimum": 0,
|
|
426
|
+
"description": "Tokens taken into the wallet."
|
|
427
|
+
},
|
|
428
|
+
"vetter": {
|
|
429
|
+
"$ref": "#/$defs/VetterSummary"
|
|
430
|
+
},
|
|
431
|
+
"ext": {
|
|
432
|
+
"$ref": "#/$defs/Ext"
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"Ext": {
|
|
437
|
+
"title": "Ext",
|
|
438
|
+
"description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
|
|
439
|
+
"type": "object",
|
|
440
|
+
"minProperties": 1,
|
|
441
|
+
"additionalProperties": true,
|
|
442
|
+
"propertyNames": {
|
|
443
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
"VetterSummary": {
|
|
447
|
+
"title": "VetterSummary",
|
|
448
|
+
"description": "A vetter engine as the VTA holds it, without its key, its credentials or its tokens.",
|
|
449
|
+
"type": "object",
|
|
450
|
+
"additionalProperties": false,
|
|
451
|
+
"required": [
|
|
452
|
+
"contextId",
|
|
453
|
+
"community",
|
|
454
|
+
"memberDid",
|
|
455
|
+
"suite",
|
|
456
|
+
"id",
|
|
457
|
+
"enrolledLabels",
|
|
458
|
+
"pendingLabels",
|
|
459
|
+
"tokensFree",
|
|
460
|
+
"tokensHeld",
|
|
461
|
+
"drawsInFlight",
|
|
462
|
+
"attested"
|
|
463
|
+
],
|
|
464
|
+
"properties": {
|
|
465
|
+
"contextId": {
|
|
466
|
+
"type": "string",
|
|
467
|
+
"minLength": 1
|
|
468
|
+
},
|
|
469
|
+
"community": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"minLength": 1
|
|
472
|
+
},
|
|
473
|
+
"memberDid": {
|
|
474
|
+
"type": "string",
|
|
475
|
+
"minLength": 1,
|
|
476
|
+
"description": "The member DID the engine draws tokens as. Bound into every token request."
|
|
477
|
+
},
|
|
478
|
+
"suite": {
|
|
479
|
+
"type": "string",
|
|
480
|
+
"minLength": 1,
|
|
481
|
+
"maxLength": 64
|
|
482
|
+
},
|
|
483
|
+
"id": {
|
|
484
|
+
"$ref": "#/$defs/Multibase",
|
|
485
|
+
"description": "The vetter's PCS identifier for this community."
|
|
486
|
+
},
|
|
487
|
+
"enrolledLabels": {
|
|
488
|
+
"type": "array",
|
|
489
|
+
"description": "Class labels this vetter holds a credential under, newest first.",
|
|
490
|
+
"items": {
|
|
491
|
+
"type": "string",
|
|
492
|
+
"pattern": "^vetter/[0-9]{4}-[0-9]{2}$"
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
"pendingLabels": {
|
|
496
|
+
"type": "array",
|
|
497
|
+
"description": "Class labels requested and not yet accepted.",
|
|
498
|
+
"items": {
|
|
499
|
+
"type": "string",
|
|
500
|
+
"pattern": "^vetter/[0-9]{4}-[0-9]{2}$"
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
"tokensFree": {
|
|
504
|
+
"type": "integer",
|
|
505
|
+
"minimum": 0,
|
|
506
|
+
"description": "Tokens held and not reserved."
|
|
507
|
+
},
|
|
508
|
+
"tokensHeld": {
|
|
509
|
+
"type": "integer",
|
|
510
|
+
"minimum": 0,
|
|
511
|
+
"description": "Tokens held in all."
|
|
512
|
+
},
|
|
513
|
+
"drawsInFlight": {
|
|
514
|
+
"type": "array",
|
|
515
|
+
"description": "Draws requested and not yet accepted or abandoned.",
|
|
516
|
+
"items": {
|
|
517
|
+
"$ref": "#/$defs/TokenDraw"
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
"attested": {
|
|
521
|
+
"type": "integer",
|
|
522
|
+
"minimum": 0,
|
|
523
|
+
"description": "Attestations made through this engine."
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
"TokenDraw": {
|
|
528
|
+
"title": "TokenDraw",
|
|
529
|
+
"description": "One draw of the token drip: a label and a tick.",
|
|
530
|
+
"type": "object",
|
|
531
|
+
"additionalProperties": false,
|
|
532
|
+
"required": [
|
|
533
|
+
"label",
|
|
534
|
+
"tick"
|
|
535
|
+
],
|
|
536
|
+
"properties": {
|
|
537
|
+
"label": {
|
|
538
|
+
"type": "string",
|
|
539
|
+
"minLength": 1,
|
|
540
|
+
"maxLength": 128
|
|
541
|
+
},
|
|
542
|
+
"tick": {
|
|
543
|
+
"type": "integer",
|
|
544
|
+
"minimum": 0
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
"Multibase": {
|
|
549
|
+
"title": "Multibase",
|
|
550
|
+
"description": "A binary value, multibase base58btc over the suite's canonical encoding.",
|
|
551
|
+
"type": "string",
|
|
552
|
+
"pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
|
|
553
|
+
},
|
|
554
|
+
"CommunityParameters": {
|
|
555
|
+
"title": "CommunityParameters",
|
|
556
|
+
"description": "The community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.",
|
|
557
|
+
"$ref": "#/$defs/PublishedConfig"
|
|
558
|
+
},
|
|
559
|
+
"PublishedConfig": {
|
|
560
|
+
"title": "PublishedConfig",
|
|
561
|
+
"description": "The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.",
|
|
562
|
+
"type": "object",
|
|
563
|
+
"additionalProperties": false,
|
|
564
|
+
"required": [
|
|
565
|
+
"suite",
|
|
566
|
+
"helperKey",
|
|
567
|
+
"tokenKey",
|
|
568
|
+
"vetterLabels",
|
|
569
|
+
"tokenLabels",
|
|
570
|
+
"dripPerTick",
|
|
571
|
+
"tickLength",
|
|
572
|
+
"events"
|
|
573
|
+
],
|
|
574
|
+
"properties": {
|
|
575
|
+
"suite": {
|
|
576
|
+
"type": "string",
|
|
577
|
+
"minLength": 1
|
|
578
|
+
},
|
|
579
|
+
"helperKey": {
|
|
580
|
+
"type": "string",
|
|
581
|
+
"minLength": 1,
|
|
582
|
+
"description": "The helper verification key, multibase — named for its role on the wire rather than for hvk."
|
|
583
|
+
},
|
|
584
|
+
"tokenKey": {
|
|
585
|
+
"type": "string",
|
|
586
|
+
"minLength": 1,
|
|
587
|
+
"description": "The token verification key, multibase — named for its role on the wire rather than for tvk."
|
|
588
|
+
},
|
|
589
|
+
"vetterLabels": {
|
|
590
|
+
"type": "array",
|
|
591
|
+
"items": {
|
|
592
|
+
"type": "string",
|
|
593
|
+
"minLength": 1
|
|
594
|
+
},
|
|
595
|
+
"description": "Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period."
|
|
596
|
+
},
|
|
597
|
+
"tokenLabels": {
|
|
598
|
+
"type": "array",
|
|
599
|
+
"items": {
|
|
600
|
+
"type": "string",
|
|
601
|
+
"minLength": 1
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
"dripPerTick": {
|
|
605
|
+
"type": "integer",
|
|
606
|
+
"minimum": 1
|
|
607
|
+
},
|
|
608
|
+
"tickLength": {
|
|
609
|
+
"$ref": "#/$defs/TickLength"
|
|
610
|
+
},
|
|
611
|
+
"events": {
|
|
612
|
+
"type": "array",
|
|
613
|
+
"items": {
|
|
614
|
+
"$ref": "#/$defs/PublishedEvent"
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
"PublishedEvent": {
|
|
620
|
+
"title": "PublishedEvent",
|
|
621
|
+
"description": "The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.",
|
|
622
|
+
"type": "object",
|
|
623
|
+
"additionalProperties": false,
|
|
624
|
+
"required": [
|
|
625
|
+
"eventId",
|
|
626
|
+
"startDate",
|
|
627
|
+
"endDate",
|
|
628
|
+
"groupFloor",
|
|
629
|
+
"tiers"
|
|
630
|
+
],
|
|
631
|
+
"properties": {
|
|
632
|
+
"eventId": {
|
|
633
|
+
"type": "string",
|
|
634
|
+
"minLength": 1
|
|
635
|
+
},
|
|
636
|
+
"startDate": {
|
|
637
|
+
"type": "string",
|
|
638
|
+
"format": "date"
|
|
639
|
+
},
|
|
640
|
+
"endDate": {
|
|
641
|
+
"type": "string",
|
|
642
|
+
"format": "date"
|
|
643
|
+
},
|
|
644
|
+
"groupFloor": {
|
|
645
|
+
"type": "integer",
|
|
646
|
+
"minimum": 1
|
|
647
|
+
},
|
|
648
|
+
"tiers": {
|
|
649
|
+
"type": "array",
|
|
650
|
+
"items": {
|
|
651
|
+
"$ref": "#/$defs/Tier"
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
},
|
|
656
|
+
"Tier": {
|
|
657
|
+
"title": "Tier",
|
|
658
|
+
"type": "object",
|
|
659
|
+
"additionalProperties": false,
|
|
660
|
+
"required": [
|
|
661
|
+
"name",
|
|
662
|
+
"dripPerTick"
|
|
663
|
+
],
|
|
664
|
+
"properties": {
|
|
665
|
+
"name": {
|
|
666
|
+
"type": "string",
|
|
667
|
+
"minLength": 1,
|
|
668
|
+
"description": "How the menu names it: desk, busy-desk."
|
|
669
|
+
},
|
|
670
|
+
"dripPerTick": {
|
|
671
|
+
"type": "integer",
|
|
672
|
+
"minimum": 1,
|
|
673
|
+
"description": "How many tokens a tick under this tier yields."
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
"TickLength": {
|
|
678
|
+
"title": "TickLength",
|
|
679
|
+
"type": "string",
|
|
680
|
+
"pattern": "^P(?:\\d+D(?:T\\d+H)?|T\\d+H)$",
|
|
681
|
+
"description": "The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`)."
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
} as const;
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
688
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
689
|
+
* per-specification and cannot be derived from the document alone, and
|
|
690
|
+
* item 2 needs the schema this carries.
|
|
691
|
+
*/
|
|
692
|
+
export const SPEC = {
|
|
693
|
+
typeUri: TYPE_URI,
|
|
694
|
+
isBearer: false,
|
|
695
|
+
isProofRequired: true,
|
|
696
|
+
isRecipientRequired: true,
|
|
697
|
+
isIssuedAtRequired: true,
|
|
698
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
699
|
+
} as const;
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
703
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
704
|
+
* parties (§7.3 item 5).
|
|
705
|
+
*/
|
|
706
|
+
export const RESPONSE_SPEC = {
|
|
707
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
708
|
+
isBearer: false,
|
|
709
|
+
isProofRequired: false,
|
|
710
|
+
isRecipientRequired: true,
|
|
711
|
+
isIssuedAtRequired: true,
|
|
712
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
713
|
+
} as const;
|