@hypercerts-org/lexicon 0.9.0-beta.0 → 0.10.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +346 -164
- package/dist/exports.d.ts +1018 -0
- package/dist/exports.d.ts.map +1 -0
- package/dist/generated/exports.d.ts +1018 -0
- package/dist/generated/exports.d.ts.map +1 -0
- package/dist/generated/lexicons.d.ts +1805 -0
- package/dist/generated/lexicons.d.ts.map +1 -0
- package/dist/generated/types/app/certified/badge/award.d.ts +24 -0
- package/dist/generated/types/app/certified/badge/award.d.ts.map +1 -0
- package/dist/generated/types/app/certified/badge/definition.d.ts +25 -0
- package/dist/generated/types/app/certified/badge/definition.d.ts.map +1 -0
- package/dist/generated/types/app/certified/badge/response.d.ts +20 -0
- package/dist/generated/types/app/certified/badge/response.d.ts.map +1 -0
- package/dist/generated/types/app/certified/defs.d.ts +3 -0
- package/dist/generated/types/app/certified/defs.d.ts.map +1 -0
- package/dist/generated/types/app/certified/location.d.ts +29 -0
- package/dist/generated/types/app/certified/location.d.ts.map +1 -0
- package/dist/generated/types/com/atproto/repo/strongRef.d.ts +12 -0
- package/dist/generated/types/com/atproto/repo/strongRef.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/activity.d.ts +57 -0
- package/dist/generated/types/org/hypercerts/claim/activity.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/collection.d.ts +25 -0
- package/dist/generated/types/org/hypercerts/claim/collection.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/contribution.d.ts +24 -0
- package/dist/generated/types/org/hypercerts/claim/contribution.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/evaluation.d.ts +43 -0
- package/dist/generated/types/org/hypercerts/claim/evaluation.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/evidence.d.ts +29 -0
- package/dist/generated/types/org/hypercerts/claim/evidence.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/measurement.d.ts +30 -0
- package/dist/generated/types/org/hypercerts/claim/measurement.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/project.d.ts +29 -0
- package/dist/generated/types/org/hypercerts/claim/project.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/rights.d.ts +25 -0
- package/dist/generated/types/org/hypercerts/claim/rights.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/defs.d.ts +45 -0
- package/dist/generated/types/org/hypercerts/defs.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/funding/receipt.d.ts +34 -0
- package/dist/generated/types/org/hypercerts/funding/receipt.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/pages/linearDocument.d.ts +2 -0
- package/dist/generated/types/pub/leaflet/pages/linearDocument.d.ts.map +1 -0
- package/dist/generated/util.d.ts +37 -0
- package/dist/generated/util.d.ts.map +1 -0
- package/dist/index.cjs +2119 -955
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2054 -935
- package/dist/index.mjs.map +1 -1
- package/dist/lexicons.cjs +1002 -0
- package/dist/lexicons.cjs.map +1 -0
- package/dist/lexicons.d.ts +1805 -0
- package/dist/lexicons.d.ts.map +1 -0
- package/dist/lexicons.mjs +996 -0
- package/dist/lexicons.mjs.map +1 -0
- package/dist/types/app/certified/badge/award.d.ts +24 -0
- package/dist/types/app/certified/badge/award.d.ts.map +1 -0
- package/dist/types/app/certified/badge/definition.d.ts +25 -0
- package/dist/types/app/certified/badge/definition.d.ts.map +1 -0
- package/dist/types/app/certified/badge/response.d.ts +20 -0
- package/dist/types/app/certified/badge/response.d.ts.map +1 -0
- package/dist/types/app/certified/defs.d.ts +3 -0
- package/dist/types/app/certified/defs.d.ts.map +1 -0
- package/dist/types/app/certified/location.d.ts +29 -0
- package/dist/types/app/certified/location.d.ts.map +1 -0
- package/dist/types/com/atproto/repo/strongRef.d.ts +12 -0
- package/dist/types/com/atproto/repo/strongRef.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/activity.d.ts +57 -0
- package/dist/types/org/hypercerts/claim/activity.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/collection.d.ts +25 -0
- package/dist/types/org/hypercerts/claim/collection.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/contribution.d.ts +24 -0
- package/dist/types/org/hypercerts/claim/contribution.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/evaluation.d.ts +43 -0
- package/dist/types/org/hypercerts/claim/evaluation.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/evidence.d.ts +29 -0
- package/dist/types/org/hypercerts/claim/evidence.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/measurement.d.ts +30 -0
- package/dist/types/org/hypercerts/claim/measurement.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/project.d.ts +29 -0
- package/dist/types/org/hypercerts/claim/project.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/rights.d.ts +25 -0
- package/dist/types/org/hypercerts/claim/rights.d.ts.map +1 -0
- package/dist/types/org/hypercerts/defs.d.ts +45 -0
- package/dist/types/org/hypercerts/defs.d.ts.map +1 -0
- package/dist/types/org/hypercerts/funding/receipt.d.ts +34 -0
- package/dist/types/org/hypercerts/funding/receipt.d.ts.map +1 -0
- package/dist/types/pub/leaflet/pages/linearDocument.d.ts +2 -0
- package/dist/types/pub/leaflet/pages/linearDocument.d.ts.map +1 -0
- package/dist/util.d.ts +37 -0
- package/dist/util.d.ts.map +1 -0
- package/lexicons/app/certified/badge/award.json +36 -0
- package/lexicons/app/certified/badge/definition.json +53 -0
- package/lexicons/app/certified/badge/response.json +36 -0
- package/lexicons/app/certified/defs.json +4 -16
- package/lexicons/app/certified/location.json +5 -8
- package/lexicons/com/atproto/repo/strongRef.json +1 -1
- package/lexicons/org/hypercerts/claim/activity.json +135 -0
- package/lexicons/org/hypercerts/claim/collection.json +54 -0
- package/lexicons/org/hypercerts/claim/contribution.json +4 -11
- package/lexicons/org/hypercerts/claim/evaluation.json +50 -9
- package/lexicons/org/hypercerts/claim/evidence.json +29 -16
- package/lexicons/org/hypercerts/claim/measurement.json +18 -8
- package/lexicons/org/hypercerts/claim/project.json +64 -0
- package/lexicons/org/hypercerts/claim/rights.json +16 -3
- package/lexicons/org/hypercerts/defs.json +71 -0
- package/lexicons/org/hypercerts/funding/receipt.json +66 -0
- package/package.json +46 -26
- package/dist/index.d.ts +0 -2094
- package/lexicons/org/hypercerts/claim.json +0 -95
- package/lexicons/org/hypercerts/collection.json +0 -62
package/README.md
CHANGED
|
@@ -1,109 +1,185 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Hypercerts Lexicon Documentation
|
|
2
2
|
|
|
3
|
-
ATProto lexicon definitions
|
|
3
|
+
This repository contains ATProto lexicon definitions for the
|
|
4
|
+
Hypercerts protocol. Each lexicon defines a record type that can be
|
|
5
|
+
stored on the ATProto network.
|
|
6
|
+
|
|
7
|
+
## Entity Relationship Diagram
|
|
8
|
+
|
|
9
|
+
The following diagrams show the relationship between:
|
|
10
|
+
|
|
11
|
+
- data classes represented by ATProto lexicons, which model the data
|
|
12
|
+
sets relating to hypercerts
|
|
13
|
+
|
|
14
|
+
- contributors to activity records (modelled/identified by ATProto
|
|
15
|
+
DIDs rather than lexicons)
|
|
16
|
+
|
|
17
|
+
- hypercerts protocol tokens which are onchain representations of
|
|
18
|
+
activity records in ATProto
|
|
19
|
+
|
|
20
|
+
Note that contributors and tokens do not require lexicons.
|
|
21
|
+
|
|
22
|
+
To distinguish these in the diagrams, each class has one of the
|
|
23
|
+
following icons:
|
|
24
|
+
|
|
25
|
+
- "D" means "data class"
|
|
26
|
+
- "E" means "entity"
|
|
27
|
+
- "P" means "protocol"
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
<details>
|
|
32
|
+
<summary>View ERD with field details</summary>
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
</details>
|
|
4
37
|
|
|
5
38
|
## Installation
|
|
6
39
|
|
|
7
40
|
```bash
|
|
8
|
-
|
|
41
|
+
npm install @hypercerts-org/lexicon
|
|
9
42
|
```
|
|
10
43
|
|
|
11
|
-
## Features
|
|
12
|
-
|
|
13
|
-
- **Lexicon JSON Definitions**: ATProto-compliant lexicon schemas for all Hypercerts record types
|
|
14
|
-
- **Generated TypeScript Types**: Strongly-typed interfaces generated via `@atproto/lex-cli`
|
|
15
|
-
- **Runtime Validation**: `isRecord` and `validateRecord` functions for each type
|
|
16
|
-
- **Lexicon Registry**: Pre-configured registry for schema validation
|
|
17
|
-
|
|
18
44
|
## Usage
|
|
19
45
|
|
|
20
|
-
###
|
|
46
|
+
### Basic Import
|
|
21
47
|
|
|
22
48
|
```typescript
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} from
|
|
28
|
-
|
|
29
|
-
// Use
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
import {
|
|
50
|
+
HYPERCERTS_SCHEMAS,
|
|
51
|
+
ACTIVITY_NSID,
|
|
52
|
+
validate,
|
|
53
|
+
} from "@hypercerts-org/lexicon";
|
|
54
|
+
|
|
55
|
+
// Use with AT Protocol Agent
|
|
56
|
+
import { Agent } from "@atproto/api";
|
|
57
|
+
|
|
58
|
+
const agent = new Agent({ service: "https://bsky.social" });
|
|
59
|
+
|
|
60
|
+
// Register lexicons with the agent
|
|
61
|
+
agent.api.lex.add(...HYPERCERTS_SCHEMAS);
|
|
62
|
+
|
|
63
|
+
// Create a record
|
|
64
|
+
const activityRecord = {
|
|
65
|
+
$type: ACTIVITY_NSID,
|
|
66
|
+
title: "My Impact Work",
|
|
67
|
+
shortDescription: "Description here",
|
|
68
|
+
workScope: "Scope of work",
|
|
69
|
+
startDate: "2023-01-01T00:00:00Z",
|
|
70
|
+
endDate: "2023-12-31T23:59:59Z",
|
|
71
|
+
createdAt: new Date().toISOString(),
|
|
38
72
|
};
|
|
73
|
+
|
|
74
|
+
// Validate before creating
|
|
75
|
+
const validation = validate(ACTIVITY_NSID, activityRecord);
|
|
76
|
+
if (!validation.valid) {
|
|
77
|
+
console.error("Validation failed:", validation.errors);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
await agent.api.com.atproto.repo.createRecord({
|
|
81
|
+
repo: agent.session?.did,
|
|
82
|
+
collection: ACTIVITY_NSID,
|
|
83
|
+
record: activityRecord,
|
|
84
|
+
});
|
|
39
85
|
```
|
|
40
86
|
|
|
41
|
-
###
|
|
87
|
+
### Accessing NSIDs (Lexicon IDs)
|
|
42
88
|
|
|
43
|
-
|
|
44
|
-
import { OrgHypercertsClaim } from '@hypercerts-org/lexicon';
|
|
89
|
+
**Recommended**: Use individual NSID constants for cleaner, more readable code:
|
|
45
90
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// unknownValue is now typed as OrgHypercertsClaim.Main
|
|
49
|
-
console.log(unknownValue.title);
|
|
50
|
-
}
|
|
91
|
+
```typescript
|
|
92
|
+
import { ACTIVITY_NSID, COLLECTION_NSID } from "@hypercerts-org/lexicon";
|
|
51
93
|
|
|
52
|
-
//
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
}
|
|
57
|
-
console.error(result.error);
|
|
58
|
-
}
|
|
94
|
+
// Clean and explicit
|
|
95
|
+
const record = {
|
|
96
|
+
$type: ACTIVITY_NSID,
|
|
97
|
+
// ...
|
|
98
|
+
};
|
|
59
99
|
```
|
|
60
100
|
|
|
61
|
-
|
|
101
|
+
**Alternative**: Use the semantic NSID object when you need multiple NSIDs:
|
|
62
102
|
|
|
63
103
|
```typescript
|
|
64
|
-
import {
|
|
104
|
+
import { HYPERCERTS_NSIDS } from "@hypercerts-org/lexicon";
|
|
65
105
|
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// Full lexicon documents for registry
|
|
72
|
-
import { Lexicons } from '@atproto/lexicon';
|
|
73
|
-
const registry = new Lexicons(HYPERCERT_LEXICONS);
|
|
106
|
+
// Access via semantic keys
|
|
107
|
+
const activityId = HYPERCERTS_NSIDS.ACTIVITY;
|
|
108
|
+
const collectionId = HYPERCERTS_NSIDS.COLLECTION;
|
|
109
|
+
const rightsId = HYPERCERTS_NSIDS.RIGHTS;
|
|
74
110
|
```
|
|
75
111
|
|
|
76
|
-
|
|
112
|
+
**Type-based mapping**: If you need to map TypeScript type namespaces to NSIDs:
|
|
77
113
|
|
|
78
|
-
|
|
114
|
+
```typescript
|
|
115
|
+
import { HYPERCERTS_NSIDS_BY_TYPE } from "@hypercerts-org/lexicon";
|
|
79
116
|
|
|
117
|
+
// Access via type namespace names
|
|
118
|
+
const activityId = HYPERCERTS_NSIDS_BY_TYPE.OrgHypercertsClaimActivity;
|
|
119
|
+
const collectionId = HYPERCERTS_NSIDS_BY_TYPE.OrgHypercertsClaimCollection;
|
|
80
120
|
```
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
121
|
+
|
|
122
|
+
**Lightweight Bundle**: Import from `/lexicons` for runtime validation without TypeScript types (smaller bundle size):
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import { schemas, validate, ids } from "@hypercerts-org/lexicon/lexicons";
|
|
126
|
+
|
|
127
|
+
// Lighter bundle, type-based namespace access
|
|
128
|
+
const result = validate(ids.OrgHypercertsClaimActivity, record);
|
|
86
129
|
```
|
|
87
130
|
|
|
88
|
-
**
|
|
131
|
+
**Note**: Individual constants (e.g., `ACTIVITY_NSID`) are the recommended approach for most use cases as they provide the best developer experience with clear, concise naming.
|
|
89
132
|
|
|
90
|
-
|
|
133
|
+
### TypeScript Types
|
|
91
134
|
|
|
92
|
-
|
|
135
|
+
All lexicon types are exported as namespaces:
|
|
93
136
|
|
|
94
|
-
|
|
137
|
+
```typescript
|
|
138
|
+
import { OrgHypercertsClaimActivity } from "@hypercerts-org/lexicon";
|
|
95
139
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
140
|
+
// Use the Main type
|
|
141
|
+
const activity: OrgHypercertsClaimActivity.Main = {
|
|
142
|
+
$type: "org.hypercerts.claim.activity",
|
|
143
|
+
title: "My Impact Work",
|
|
144
|
+
// ... other fields
|
|
145
|
+
};
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Individual Lexicon Imports
|
|
149
|
+
|
|
150
|
+
Each lexicon is available in two forms as individual constants:
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import {
|
|
154
|
+
// Raw JSON (untyped) - direct import from JSON files
|
|
155
|
+
ACTIVITY_LEXICON_JSON,
|
|
156
|
+
RIGHTS_LEXICON_JSON,
|
|
157
|
+
|
|
158
|
+
// Typed LexiconDoc - from lexicons.get() at module initialization
|
|
159
|
+
ACTIVITY_LEXICON_DOC,
|
|
160
|
+
RIGHTS_LEXICON_DOC,
|
|
161
|
+
} from "@hypercerts-org/lexicon";
|
|
99
162
|
```
|
|
100
163
|
|
|
101
|
-
|
|
164
|
+
| Suffix | Type | Source | Use Case |
|
|
165
|
+
| ------- | -------------------- | ------------------------- | ------------------------------ |
|
|
166
|
+
| `_JSON` | Untyped JSON | Direct JSON import | Raw schema data |
|
|
167
|
+
| `_DOC` | `LexiconDoc` (typed) | `lexicons.get()` instance | Type-safe lexicon manipulation |
|
|
102
168
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
169
|
+
Or access all lexicons via semantic mapping objects:
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
import {
|
|
173
|
+
HYPERCERTS_LEXICON_JSON,
|
|
174
|
+
HYPERCERTS_LEXICON_DOC,
|
|
175
|
+
} from "@hypercerts-org/lexicon";
|
|
176
|
+
|
|
177
|
+
// Access via semantic keys (same keys as HYPERCERTS_NSIDS)
|
|
178
|
+
const activityJSON = HYPERCERTS_LEXICON_JSON.ACTIVITY;
|
|
179
|
+
const activityDoc = HYPERCERTS_LEXICON_DOC.ACTIVITY;
|
|
180
|
+
const rightsJSON = HYPERCERTS_LEXICON_JSON.RIGHTS;
|
|
181
|
+
const rightsDoc = HYPERCERTS_LEXICON_DOC.RIGHTS;
|
|
182
|
+
```
|
|
107
183
|
|
|
108
184
|
## Certified Lexicons
|
|
109
185
|
|
|
@@ -111,17 +187,19 @@ Certified lexicons are common/shared lexicons that can be used across multiple p
|
|
|
111
187
|
|
|
112
188
|
### Common Definitions
|
|
113
189
|
|
|
114
|
-
**Lexicon ID:** `
|
|
190
|
+
**Lexicon ID:** `org.hypercerts.defs`
|
|
115
191
|
|
|
116
192
|
**Description:** Common type definitions used across all certified protocols.
|
|
117
193
|
|
|
118
194
|
#### Defs
|
|
119
195
|
|
|
120
|
-
| Def
|
|
121
|
-
|
|
122
|
-
| `uri`
|
|
123
|
-
| `smallBlob`
|
|
124
|
-
| `largeBlob`
|
|
196
|
+
| Def | Type | Description | Comments |
|
|
197
|
+
| ------------ | -------- | ----------------------------------------- | --------------------------------------- |
|
|
198
|
+
| `uri` | `object` | Object containing a URI to external data | Has `uri` property (string, format uri) |
|
|
199
|
+
| `smallBlob` | `object` | Object containing a blob to external data | Has `blob` property (blob, up to 10MB) |
|
|
200
|
+
| `largeBlob` | `object` | Object containing a blob to external data | Has `blob` property (blob, up to 100MB) |
|
|
201
|
+
| `smallImage` | `object` | Object containing a small image | Has `image` property (blob, up to 5MB) |
|
|
202
|
+
| `largeImage` | `object` | Object containing a large image | Has `image` property (blob, up to 10MB) |
|
|
125
203
|
|
|
126
204
|
---
|
|
127
205
|
|
|
@@ -129,21 +207,68 @@ Certified lexicons are common/shared lexicons that can be used across multiple p
|
|
|
129
207
|
|
|
130
208
|
**Lexicon ID:** `app.certified.location`
|
|
131
209
|
|
|
132
|
-
**Description:** A location reference for use across certified protocols. For more information about
|
|
210
|
+
**Description:** A location reference for use across certified protocols. For more information about
|
|
133
211
|
|
|
134
|
-
**Key:** `
|
|
212
|
+
**Key:** `tid`
|
|
135
213
|
|
|
136
214
|
#### Properties
|
|
137
215
|
|
|
138
|
-
| Property
|
|
139
|
-
|
|
140
|
-
| `lpVersion`
|
|
141
|
-
| `srs`
|
|
142
|
-
| `locationType` | `string` | ✅
|
|
143
|
-
| `location`
|
|
144
|
-
| `name`
|
|
145
|
-
| `description`
|
|
146
|
-
| `createdAt`
|
|
216
|
+
| Property | Type | Required | Description |
|
|
217
|
+
| -------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
218
|
+
| `lpVersion` | `string` | ✅ | The version of the Location Protocol |
|
|
219
|
+
| `srs` | `string` | ✅ | The Spatial Reference System URI (e.g., http://www.opengis.net/def/crs/OGC/1.3/CRS84) that defines the coordinate system. |
|
|
220
|
+
| `locationType` | `string` | ✅ | An identifier for the format of the location data (e.g., coordinate-decimal, geojson-point) |
|
|
221
|
+
| `location` | `union` | ✅ | The location of where the work was performed as a URI or blob. |
|
|
222
|
+
| `name` | `string` | ❌ | Optional name for this location |
|
|
223
|
+
| `description` | `string` | ❌ | Optional description for this location |
|
|
224
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created |
|
|
225
|
+
|
|
226
|
+
### Badges Lexicon
|
|
227
|
+
|
|
228
|
+
**Lexicon IDs:** `app.certified.badge.definition`, `app.certified.badge.award`, `app.certified.badge.response`
|
|
229
|
+
|
|
230
|
+
**Description:** Defines badge metadata, award records, and recipient responses for certified badges that can be used across protocols.
|
|
231
|
+
|
|
232
|
+
#### Badge Definition
|
|
233
|
+
|
|
234
|
+
**Lexicon ID:** `app.certified.badge.definition`
|
|
235
|
+
|
|
236
|
+
**Key:** `tid`
|
|
237
|
+
|
|
238
|
+
| Property | Type | Required | Description |
|
|
239
|
+
| ---------------- | -------- | -------- | ---------------------------------------------------------------------- |
|
|
240
|
+
| `badgeType` | `string` | ✅ | Category of the badge (e.g., endorsement, participation, affiliation). |
|
|
241
|
+
| `title` | `string` | ✅ | Human-readable title of the badge. |
|
|
242
|
+
| `icon` | `blob` | ✅ | Icon representing the badge (accepted `image/*` types, maxSize 1MB). |
|
|
243
|
+
| `description` | `string` | ❌ | Optional short statement describing the badge. |
|
|
244
|
+
| `allowedIssuers` | `array` | ❌ | Optional allowlist of DIDs allowed to issue this badge. |
|
|
245
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. |
|
|
246
|
+
|
|
247
|
+
#### Badge Award
|
|
248
|
+
|
|
249
|
+
**Lexicon ID:** `app.certified.badge.award`
|
|
250
|
+
|
|
251
|
+
**Key:** `tid`
|
|
252
|
+
|
|
253
|
+
| Property | Type | Required | Description |
|
|
254
|
+
| ----------- | -------- | -------- | ------------------------------------------------------------------------------------ |
|
|
255
|
+
| `badge` | `ref` | ✅ | Reference to the badge definition for this award (`app.certified.badge.definition`). |
|
|
256
|
+
| `subject` | `union` | ✅ | Entity the badge award is for (either a DID or a specific AT Protocol record). |
|
|
257
|
+
| `note` | `string` | ❌ | Optional explanation for the award. |
|
|
258
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. |
|
|
259
|
+
|
|
260
|
+
#### Badge Response
|
|
261
|
+
|
|
262
|
+
**Lexicon ID:** `app.certified.badge.response`
|
|
263
|
+
|
|
264
|
+
**Key:** `tid`
|
|
265
|
+
|
|
266
|
+
| Property | Type | Required | Description |
|
|
267
|
+
| ------------ | -------- | -------- | ---------------------------------------------------------------------- |
|
|
268
|
+
| `badgeAward` | `ref` | ✅ | Reference to the badge award (`app.certified.badge.award`). |
|
|
269
|
+
| `response` | `string` | ✅ | Enum: `accepted` or `rejected`. |
|
|
270
|
+
| `weight` | `string` | ❌ | Optional relative weight assigned by the recipient (stored as string). |
|
|
271
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. |
|
|
147
272
|
|
|
148
273
|
---
|
|
149
274
|
|
|
@@ -151,9 +276,9 @@ Certified lexicons are common/shared lexicons that can be used across multiple p
|
|
|
151
276
|
|
|
152
277
|
Hypercerts-specific lexicons for tracking impact work and claims.
|
|
153
278
|
|
|
154
|
-
### Hypercerts
|
|
279
|
+
### Hypercerts Activity Claim
|
|
155
280
|
|
|
156
|
-
**Lexicon ID:** `org.hypercerts.claim.
|
|
281
|
+
**Lexicon ID:** `org.hypercerts.claim.activity`
|
|
157
282
|
|
|
158
283
|
**Description:** The main lexicon where everything is connected to. This is the hypercert record that tracks impact work.
|
|
159
284
|
|
|
@@ -161,42 +286,50 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
161
286
|
|
|
162
287
|
#### Properties
|
|
163
288
|
|
|
164
|
-
| Property
|
|
165
|
-
|
|
166
|
-
| `title`
|
|
167
|
-
| `shortDescription` | `string` | ✅
|
|
168
|
-
| `description`
|
|
169
|
-
| `image`
|
|
170
|
-
| `workScope`
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
177
|
-
| `createdAt`
|
|
289
|
+
| Property | Type | Required | Description | Comments |
|
|
290
|
+
| ------------------ | -------- | -------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
|
291
|
+
| `title` | `string` | ✅ | Title of the hypercert | |
|
|
292
|
+
| `shortDescription` | `string` | ✅ | Short blurb of the impact work done. | |
|
|
293
|
+
| `description` | `string` | ❌ | Optional longer description of the impact work done. | |
|
|
294
|
+
| `image` | `union` | ❌ | The hypercert visual representation as a URI or image blob | |
|
|
295
|
+
| `workScope` | `object` | ❌ | Logical scope of the work using label-based conditions | Object with `withinAllOf`, `withinAnyOf`, `withinNoneOf` arrays of labels |
|
|
296
|
+
| `startDate` | `string` | ✅ | When the work began | |
|
|
297
|
+
| `endDate` | `string` | ✅ | When the work ended | |
|
|
298
|
+
| `contributions` | `array` | ❌ | A strong reference to the contributions done to create the impact in the hypercerts | References must conform to `org.hypercerts.claim.contribution` |
|
|
299
|
+
| `rights` | `ref` | ❌ | A strong reference to the rights that this hypercert has | References must conform to `org.hypercerts.claim.rights` |
|
|
300
|
+
| `location` | `ref` | ❌ | A strong reference to the location where the work for done hypercert was located | References must conform to `app.certified.location` |
|
|
301
|
+
| `project` | `string` | ❌ | A reference (AT-URI) to the project record that this activity is part of | References must conform to `org.hypercerts.claim.project` |
|
|
302
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
303
|
+
|
|
304
|
+
#### Defs
|
|
305
|
+
|
|
306
|
+
##### activityWeight
|
|
307
|
+
|
|
308
|
+
| Property | Type | Required | Description |
|
|
309
|
+
| ---------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
310
|
+
| `activity` | `ref` | ✅ | A strong reference to a hypercert activity record. This activity must conform to the lexicon org.hypercerts.claim.activity |
|
|
311
|
+
| `weight` | `string` | ✅ | The relative weight/importance of this hypercert activity (stored as a string to avoid float precision issues). Weights can be any positive numeric values and do not need to sum to a specific total; normalization can be performed by the consuming application as needed. |
|
|
178
312
|
|
|
179
313
|
---
|
|
180
314
|
|
|
181
|
-
### Hypercerts
|
|
315
|
+
### Hypercerts Contribution
|
|
182
316
|
|
|
183
317
|
**Lexicon ID:** `org.hypercerts.claim.contribution`
|
|
184
318
|
|
|
185
319
|
**Description:** A contribution made toward a hypercert's impact.
|
|
186
320
|
|
|
187
|
-
**Key:** `
|
|
321
|
+
**Key:** `tid`
|
|
188
322
|
|
|
189
323
|
#### Properties
|
|
190
324
|
|
|
191
|
-
| Property
|
|
192
|
-
|
|
193
|
-
| `
|
|
194
|
-
| `
|
|
195
|
-
| `
|
|
196
|
-
| `
|
|
197
|
-
| `
|
|
198
|
-
| `
|
|
199
|
-
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
325
|
+
| Property | Type | Required | Description |
|
|
326
|
+
| -------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
327
|
+
| `role` | `string` | ❌ | Role or title of the contributor(s). |
|
|
328
|
+
| `contributors` | `array` | ✅ | List of the contributors (names, pseudonyms, or DIDs). If multiple contributors are stored in the same hypercertContribution, then they would have the exact same role. |
|
|
329
|
+
| `description` | `string` | ❌ | What the contribution concretely achieved |
|
|
330
|
+
| `startDate` | `string` | ❌ | When this contribution started. This should be a subset of the hypercert timeframe. |
|
|
331
|
+
| `endDate` | `string` | ❌ | When this contribution finished. This should be a subset of the hypercert timeframe. |
|
|
332
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created |
|
|
200
333
|
|
|
201
334
|
---
|
|
202
335
|
|
|
@@ -204,19 +337,22 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
204
337
|
|
|
205
338
|
**Lexicon ID:** `org.hypercerts.claim.evaluation`
|
|
206
339
|
|
|
207
|
-
**Description:** An evaluation of a hypercert
|
|
340
|
+
**Description:** An evaluation of a hypercert record (e.g. an activity and its impact).
|
|
208
341
|
|
|
209
342
|
**Key:** `tid`
|
|
210
343
|
|
|
211
344
|
#### Properties
|
|
212
345
|
|
|
213
|
-
| Property
|
|
214
|
-
|
|
215
|
-
| `subject`
|
|
216
|
-
| `evaluators`
|
|
217
|
-
| `
|
|
218
|
-
| `
|
|
219
|
-
| `
|
|
346
|
+
| Property | Type | Required | Description | Comments |
|
|
347
|
+
| -------------- | -------- | -------- | --------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
348
|
+
| `subject` | `ref` | ❌ | A strong reference to what is being evaluated | (e.g activity, measurement, contribution, etc.) |
|
|
349
|
+
| `evaluators` | `array` | ✅ | DIDs of the evaluators | |
|
|
350
|
+
| `content` | `array` | ❌ | Evaluation data (URIs or blobs) containing detailed reports or methodology | |
|
|
351
|
+
| `measurements` | `array` | ❌ | Optional references to the measurements that contributed to this evaluation | References must conform to `org.hypercerts.claim.measurement` |
|
|
352
|
+
| `summary` | `string` | ✅ | Brief evaluation summary | |
|
|
353
|
+
| `score` | `object` | ❌ | Optional overall score for this evaluation on a numeric scale | Object with `min`, `max`, and `value` (integers) |
|
|
354
|
+
| `location` | `ref` | ❌ | An optional reference for georeferenced evaluations | References must conform to `app.certified.location` |
|
|
355
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
220
356
|
|
|
221
357
|
---
|
|
222
358
|
|
|
@@ -224,19 +360,21 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
224
360
|
|
|
225
361
|
**Lexicon ID:** `org.hypercerts.claim.evidence`
|
|
226
362
|
|
|
227
|
-
**Description:** A piece of evidence
|
|
363
|
+
**Description:** A piece of evidence related to a hypercert record (e.g. an activity, project, claim, or evaluation). Evidence may support, clarify, or challenge the referenced subject.
|
|
228
364
|
|
|
229
|
-
**Key:** `
|
|
365
|
+
**Key:** `tid`
|
|
230
366
|
|
|
231
367
|
#### Properties
|
|
232
368
|
|
|
233
|
-
| Property
|
|
234
|
-
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `
|
|
369
|
+
| Property | Type | Required | Description | Comments |
|
|
370
|
+
| ------------------ | -------- | -------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
|
|
371
|
+
| `subject` | `ref` | ❌ | A strong reference to the record this evidence relates to | (e.g. an activity, project, claim, or evaluation) |
|
|
372
|
+
| `content` | `union` | ✅ | A piece of evidence (URI or blob) related to the subject record | May support, clarify, or challenge a hypercert claim |
|
|
373
|
+
| `title` | `string` | ✅ | Title to describe the nature of the evidence | |
|
|
374
|
+
| `shortDescription` | `string` | ❌ | Short description explaining what this evidence shows | |
|
|
375
|
+
| `description` | `string` | ❌ | Longer description describing the evidence in more detail | |
|
|
376
|
+
| `relationType` | `string` | ❌ | How this evidence relates to the subject | Known values: `supports`, `challenges`, `clarifies` |
|
|
377
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
240
378
|
|
|
241
379
|
---
|
|
242
380
|
|
|
@@ -244,27 +382,29 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
244
382
|
|
|
245
383
|
**Lexicon ID:** `org.hypercerts.claim.measurement`
|
|
246
384
|
|
|
247
|
-
**Description:**
|
|
385
|
+
**Description:** Measurement data related to a hypercert record (e.g. an activity and its impact).
|
|
248
386
|
|
|
249
387
|
**Key:** `tid`
|
|
250
388
|
|
|
251
389
|
#### Properties
|
|
252
390
|
|
|
253
|
-
| Property
|
|
254
|
-
|
|
255
|
-
| `
|
|
256
|
-
| `measurers`
|
|
257
|
-
| `metric`
|
|
258
|
-
| `value`
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
391
|
+
| Property | Type | Required | Description | Comments |
|
|
392
|
+
| ------------- | -------- | -------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
393
|
+
| `subject` | `ref` | ❌ | A strong reference to the record this measurement refers to | (e.g. an activity, project, or claim) |
|
|
394
|
+
| `measurers` | `array` | ✅ | DIDs of the entity (or entities) that measured this data | |
|
|
395
|
+
| `metric` | `string` | ✅ | The metric being measured | |
|
|
396
|
+
| `value` | `string` | ✅ | The measured value | |
|
|
397
|
+
| `methodType` | `string` | ❌ | Short identifier for the measurement methodology | |
|
|
398
|
+
| `methodURI` | `string` | ❌ | URI to methodology documentation, standard protocol, or measurement procedure | |
|
|
399
|
+
| `evidenceURI` | `array` | ❌ | URIs to related evidence or underlying data | (e.g. org.hypercerts.claim.evidence records or raw datasets) |
|
|
400
|
+
| `location` | `ref` | ❌ | A strong reference to the location where the measurement was taken | References must conform to `app.certified.location` |
|
|
401
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
262
402
|
|
|
263
403
|
---
|
|
264
404
|
|
|
265
|
-
### org.hypercerts.collection
|
|
405
|
+
### org.hypercerts.claim.collection
|
|
266
406
|
|
|
267
|
-
**Lexicon ID:** `org.hypercerts.collection`
|
|
407
|
+
**Lexicon ID:** `org.hypercerts.claim.collection`
|
|
268
408
|
|
|
269
409
|
**Description:** A collection/group of hypercerts that have a specific property.
|
|
270
410
|
|
|
@@ -272,22 +412,37 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
272
412
|
|
|
273
413
|
#### Properties
|
|
274
414
|
|
|
275
|
-
| Property
|
|
276
|
-
|
|
277
|
-
| `title`
|
|
278
|
-
| `shortDescription` | `string` | ❌
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
415
|
+
| Property | Type | Required | Description | Comments |
|
|
416
|
+
| ------------------ | -------- | -------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
417
|
+
| `title` | `string` | ✅ | The title of this collection | |
|
|
418
|
+
| `shortDescription` | `string` | ❌ | A short description of this collection | |
|
|
419
|
+
| `avatar` | `blob` | ❌ | Primary avatar image representing this collection across apps and views | Typically a square image |
|
|
420
|
+
| `coverPhoto` | `blob` | ❌ | The cover photo of this collection | |
|
|
421
|
+
| `activities` | `array` | ✅ | Array of activities with their associated weights in this collection | Each item references `org.hypercerts.claim.activity#activityWeight` |
|
|
422
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
282
423
|
|
|
283
|
-
|
|
424
|
+
---
|
|
284
425
|
|
|
285
|
-
|
|
426
|
+
### org.hypercerts.claim.project
|
|
286
427
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
428
|
+
**Lexicon ID:** `org.hypercerts.claim.project`
|
|
429
|
+
|
|
430
|
+
**Description:** A project that can include multiple activities, each of which may be linked to at most one project.
|
|
431
|
+
|
|
432
|
+
**Key:** `tid`
|
|
433
|
+
|
|
434
|
+
#### Properties
|
|
435
|
+
|
|
436
|
+
| Property | Type | Required | Description | Comments |
|
|
437
|
+
| ------------------ | -------- | -------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
438
|
+
| `title` | `string` | ✅ | Title of this project | |
|
|
439
|
+
| `shortDescription` | `string` | ✅ | Short summary of this project, suitable for previews and list views | |
|
|
440
|
+
| `description` | `ref` | ❌ | Rich-text description of this project, represented as a Leaflet linear document | References must conform to `pub.leaflet.pages.linearDocument#main` |
|
|
441
|
+
| `avatar` | `blob` | ❌ | Primary avatar image representing this project across apps and views | Typically a square logo or project identity image |
|
|
442
|
+
| `coverPhoto` | `blob` | ❌ | The cover photo of this project | |
|
|
443
|
+
| `activities` | `array` | ❌ | Array of activities with their associated weights in this project | Each item references `org.hypercerts.claim.activity#activityWeight` |
|
|
444
|
+
| `location` | `ref` | ❌ | A strong reference to a location record describing where the work took place | References must conform to `app.certified.location` |
|
|
445
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
291
446
|
|
|
292
447
|
---
|
|
293
448
|
|
|
@@ -295,18 +450,45 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
295
450
|
|
|
296
451
|
**Lexicon ID:** `org.hypercerts.claim.rights`
|
|
297
452
|
|
|
298
|
-
**Description:** Describes the rights that a
|
|
453
|
+
**Description:** Describes the rights that a contributor and/or an owner has, such as whether the hypercert can be sold, transferred, and under what conditions.
|
|
299
454
|
|
|
300
|
-
**Key:** `
|
|
455
|
+
**Key:** `tid`
|
|
456
|
+
|
|
457
|
+
#### Properties
|
|
458
|
+
|
|
459
|
+
| Property | Type | Required | Description | Comments |
|
|
460
|
+
| ------------------- | -------- | -------- | ----------------------------------------------------------------- | ----------- |
|
|
461
|
+
| `rightsName` | `string` | ✅ | Full name of the rights | |
|
|
462
|
+
| `rightsType` | `string` | ✅ | Short rights identifier for easier search | |
|
|
463
|
+
| `rightsDescription` | `string` | ✅ | Description of the rights of this hypercert | |
|
|
464
|
+
| `attachment` | `union` | ❌ | An attachment to define the rights further, e.g. a legal document | URI or blob |
|
|
465
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
### org.hypercerts.funding.receipt
|
|
470
|
+
|
|
471
|
+
**Lexicon ID:** `org.hypercerts.funding.receipt`
|
|
472
|
+
|
|
473
|
+
**Description:** Records a funding receipt for a payment from one user to another user. It may be recorded by the recipient, by the sender, or by a third party. The sender may remain anonymous.
|
|
474
|
+
|
|
475
|
+
**Key:** `tid`
|
|
301
476
|
|
|
302
477
|
#### Properties
|
|
303
478
|
|
|
304
|
-
| Property
|
|
305
|
-
|
|
306
|
-
| `
|
|
307
|
-
| `
|
|
308
|
-
| `
|
|
309
|
-
| `
|
|
479
|
+
| Property | Type | Required | Description | Comments |
|
|
480
|
+
| ---------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
481
|
+
| `from` | `string` | ✅ | DID of the sender who transferred the funds. If sender wants to stay anonymous, mark this explicitly. | Format: did |
|
|
482
|
+
| `to` | `string` | ✅ | The recipient of the funds, who can be identified by DID or a clear-text name. | |
|
|
483
|
+
| `amount` | `string` | ✅ | Amount of funding received. | |
|
|
484
|
+
| `currency` | `string` | ✅ | Currency of the payment (e.g. EUR, USD, ETH). | |
|
|
485
|
+
| `paymentRail` | `string` | ❌ | How the funds were transferred (e.g. bank_transfer, credit_card, onchain, cash, check, payment_processor). | |
|
|
486
|
+
| `paymentNetwork` | `string` | ❌ | Optional network within the payment rail (e.g. arbitrum, ethereum, sepa, visa, paypal). | |
|
|
487
|
+
| `transactionId` | `string` | ❌ | Identifier of the underlying payment transaction (e.g. bank reference, onchain transaction hash, or processor-specific ID). | Use paymentNetwork to specify the network where applicable. |
|
|
488
|
+
| `for` | `string` | ❌ | Optional reference to the activity, project, or organization this funding relates to. | Format: at-uri |
|
|
489
|
+
| `notes` | `string` | ❌ | Optional notes or additional context for this funding receipt. | maxLength: 500 |
|
|
490
|
+
| `occurredAt` | `string` | ❌ | Timestamp when the payment occurred. | Format: datetime |
|
|
491
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this receipt record was created. | Format: datetime |
|
|
310
492
|
|
|
311
493
|
---
|
|
312
494
|
|