@hypercerts-org/lexicon 0.8.0-beta.0 → 0.10.0-beta.0
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 +249 -180
- package/README.md.orig +267 -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 +31 -38
- package/types/index.ts +1257 -0
- package/types/lexicons.ts +1071 -0
- package/types/types/app/certified/badge/award.ts +48 -0
- package/types/types/app/certified/badge/definition.ts +49 -0
- package/types/types/app/certified/badge/response.ts +44 -0
- package/types/types/app/certified/defs.ts +14 -0
- package/types/types/app/certified/location.ts +49 -0
- package/types/types/com/atproto/repo/strongRef.ts +31 -0
- package/types/types/org/hypercerts/claim/activity.ts +99 -0
- package/types/types/org/hypercerts/claim/collection.ts +49 -0
- package/types/types/org/hypercerts/claim/contribution.ts +48 -0
- package/types/types/org/hypercerts/claim/evaluation.ts +77 -0
- package/types/types/org/hypercerts/claim/evidence.ts +53 -0
- package/types/types/org/hypercerts/claim/measurement.ts +54 -0
- package/types/types/org/hypercerts/claim/project.ts +53 -0
- package/types/types/org/hypercerts/claim/rights.ts +49 -0
- package/types/types/org/hypercerts/defs.ts +96 -0
- package/types/types/org/hypercerts/funding/receipt.ts +58 -0
- package/types/util.ts +82 -0
- package/dist/index.cjs +0 -1472
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -2094
- package/dist/index.mjs +0 -1441
- package/dist/index.mjs.map +0 -1
- package/lexicons/org/hypercerts/claim.json +0 -95
- package/lexicons/org/hypercerts/collection.json +0 -62
package/README.md
CHANGED
|
@@ -1,127 +1,92 @@
|
|
|
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.
|
|
4
6
|
|
|
5
|
-
##
|
|
7
|
+
## Entity Relationship Diagram
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
pnpm add @hypercerts-org/lexicon
|
|
9
|
-
```
|
|
9
|
+
The following diagrams show the relationship between:
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- data classes represented by ATProto lexicons, which model the data
|
|
12
|
+
sets relating to hypercerts
|
|
12
13
|
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
- **Runtime Validation**: `isRecord` and `validateRecord` functions for each type
|
|
16
|
-
- **Lexicon Registry**: Pre-configured registry for schema validation
|
|
17
|
-
|
|
18
|
-
## Usage
|
|
14
|
+
- contributors to activity records (modelled/identified by ATProto
|
|
15
|
+
DIDs rather than lexicons)
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```typescript
|
|
23
|
-
import type {
|
|
24
|
-
OrgHypercertsClaim,
|
|
25
|
-
OrgHypercertsCollection,
|
|
26
|
-
OrgHypercertsClaimRights
|
|
27
|
-
} from '@hypercerts-org/lexicon';
|
|
28
|
-
|
|
29
|
-
// Use the Main type for full records (includes $type)
|
|
30
|
-
const claim: OrgHypercertsClaim.Main = {
|
|
31
|
-
$type: 'org.hypercerts.claim',
|
|
32
|
-
title: 'My Impact Work',
|
|
33
|
-
shortDescription: 'Description here',
|
|
34
|
-
workScope: 'Scope of work',
|
|
35
|
-
workTimeFrameFrom: '2023-01-01T00:00:00Z',
|
|
36
|
-
workTimeFrameTo: '2023-12-31T23:59:59Z',
|
|
37
|
-
createdAt: new Date().toISOString()
|
|
38
|
-
};
|
|
39
|
-
```
|
|
17
|
+
- hypercerts protocol tokens which are onchain representations of
|
|
18
|
+
activity records in ATProto
|
|
40
19
|
|
|
41
|
-
|
|
20
|
+
Note that contributors and tokens do not require lexicons.
|
|
42
21
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// Check if a value matches the type
|
|
47
|
-
if (OrgHypercertsClaim.isRecord(unknownValue)) {
|
|
48
|
-
// unknownValue is now typed as OrgHypercertsClaim.Main
|
|
49
|
-
console.log(unknownValue.title);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Validate with detailed error information
|
|
53
|
-
const result = OrgHypercertsClaim.validateRecord(data);
|
|
54
|
-
if (result.success) {
|
|
55
|
-
// data is valid
|
|
56
|
-
} else {
|
|
57
|
-
console.error(result.error);
|
|
58
|
-
}
|
|
59
|
-
```
|
|
22
|
+
To distinguish these in the diagrams, each class has one of the
|
|
23
|
+
following icons:
|
|
60
24
|
|
|
61
|
-
|
|
25
|
+
- "D" means "data class"
|
|
26
|
+
- "E" means "entity"
|
|
27
|
+
- "P" means "protocol"
|
|
62
28
|
|
|
63
|
-
|
|
64
|
-
import { HYPERCERT_LEXICONS, HYPERCERT_COLLECTIONS } from '@hypercerts-org/lexicon';
|
|
29
|
+

|
|
65
30
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
console.log(HYPERCERT_COLLECTIONS.COLLECTION); // 'org.hypercerts.collection'
|
|
69
|
-
console.log(HYPERCERT_COLLECTIONS.RIGHTS); // 'org.hypercerts.claim.rights'
|
|
31
|
+
<details>
|
|
32
|
+
<summary>View ERD with field details</summary>
|
|
70
33
|
|
|
71
|
-
|
|
72
|
-
import { Lexicons } from '@atproto/lexicon';
|
|
73
|
-
const registry = new Lexicons(HYPERCERT_LEXICONS);
|
|
74
|
-
```
|
|
34
|
+

|
|
75
35
|
|
|
76
|
-
|
|
36
|
+
</details>
|
|
77
37
|
|
|
78
|
-
|
|
38
|
+
## Installation
|
|
79
39
|
|
|
40
|
+
```bash
|
|
41
|
+
npm i @hypercerts-org/lexicon
|
|
80
42
|
```
|
|
81
|
-
@hypercerts-org/lexicon
|
|
82
|
-
├── OrgHypercertsClaim.Main → sdk-core: HypercertClaim
|
|
83
|
-
├── OrgHypercertsClaimRights.Main → sdk-core: HypercertRights
|
|
84
|
-
├── OrgHypercertsCollection.Main → sdk-core: HypercertCollection
|
|
85
|
-
└── ...etc
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Recommendation**: Import types from `@hypercerts-org/sdk-core` for cleaner imports, unless you need direct access to validation functions.
|
|
89
|
-
|
|
90
|
-
## Development
|
|
91
43
|
|
|
92
|
-
|
|
44
|
+
## Usage
|
|
93
45
|
|
|
94
|
-
|
|
46
|
+
```typescript
|
|
47
|
+
import { AtpBaseClient } from "@hypercerts-org/lexicon";
|
|
48
|
+
import type { HypercertClaim } from "@hypercerts-org/lexicon";
|
|
49
|
+
|
|
50
|
+
const client = new AtpBaseClient({
|
|
51
|
+
service: "https://bsky.social",
|
|
52
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const hypercert: HypercertClaim = {
|
|
56
|
+
$type: "org.hypercerts.claim.activity",
|
|
57
|
+
title: "My Impact Work",
|
|
58
|
+
shortDescription: "Description here",
|
|
59
|
+
workScope: "Scope of work",
|
|
60
|
+
startDate: "2023-01-01T00:00:00Z",
|
|
61
|
+
endDate: "2023-12-31T23:59:59Z",
|
|
62
|
+
createdAt: new Date().toISOString(),
|
|
63
|
+
};
|
|
95
64
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
65
|
+
await client.org.hypercerts.claim.activity.create(
|
|
66
|
+
{ repo: "did:plc:example" },
|
|
67
|
+
hypercert,
|
|
68
|
+
);
|
|
99
69
|
```
|
|
100
70
|
|
|
101
|
-
### Adding New Lexicons
|
|
102
|
-
|
|
103
|
-
1. Add lexicon JSON file to `lexicons/` directory
|
|
104
|
-
2. Run `pnpm generate` to regenerate types
|
|
105
|
-
3. Export new types from `src/index.ts`
|
|
106
|
-
4. Update `HYPERCERT_COLLECTIONS` if adding a new collection
|
|
107
|
-
|
|
108
71
|
## Certified Lexicons
|
|
109
72
|
|
|
110
73
|
Certified lexicons are common/shared lexicons that can be used across multiple protocols.
|
|
111
74
|
|
|
112
75
|
### Common Definitions
|
|
113
76
|
|
|
114
|
-
**Lexicon ID:** `
|
|
77
|
+
**Lexicon ID:** `org.hypercerts.defs`
|
|
115
78
|
|
|
116
79
|
**Description:** Common type definitions used across all certified protocols.
|
|
117
80
|
|
|
118
81
|
#### Defs
|
|
119
82
|
|
|
120
|
-
| Def
|
|
121
|
-
|
|
122
|
-
| `uri`
|
|
123
|
-
| `smallBlob`
|
|
124
|
-
| `largeBlob`
|
|
83
|
+
| Def | Type | Description | Comments |
|
|
84
|
+
| ------------ | -------- | ----------------------------------------- | --------------------------------------- |
|
|
85
|
+
| `uri` | `object` | Object containing a URI to external data | Has `uri` property (string, format uri) |
|
|
86
|
+
| `smallBlob` | `object` | Object containing a blob to external data | Has `blob` property (blob, up to 10MB) |
|
|
87
|
+
| `largeBlob` | `object` | Object containing a blob to external data | Has `blob` property (blob, up to 100MB) |
|
|
88
|
+
| `smallImage` | `object` | Object containing a small image | Has `image` property (blob, up to 5MB) |
|
|
89
|
+
| `largeImage` | `object` | Object containing a large image | Has `image` property (blob, up to 10MB) |
|
|
125
90
|
|
|
126
91
|
---
|
|
127
92
|
|
|
@@ -129,21 +94,68 @@ Certified lexicons are common/shared lexicons that can be used across multiple p
|
|
|
129
94
|
|
|
130
95
|
**Lexicon ID:** `app.certified.location`
|
|
131
96
|
|
|
132
|
-
**Description:** A location reference for use across certified protocols. For more information about
|
|
97
|
+
**Description:** A location reference for use across certified protocols. For more information about
|
|
133
98
|
|
|
134
|
-
**Key:** `
|
|
99
|
+
**Key:** `tid`
|
|
135
100
|
|
|
136
101
|
#### Properties
|
|
137
102
|
|
|
138
|
-
| Property
|
|
139
|
-
|
|
140
|
-
| `lpVersion`
|
|
141
|
-
| `srs`
|
|
142
|
-
| `locationType` | `string` | ✅
|
|
143
|
-
| `location`
|
|
144
|
-
| `name`
|
|
145
|
-
| `description`
|
|
146
|
-
| `createdAt`
|
|
103
|
+
| Property | Type | Required | Description |
|
|
104
|
+
| -------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
105
|
+
| `lpVersion` | `string` | ✅ | The version of the Location Protocol |
|
|
106
|
+
| `srs` | `string` | ✅ | The Spatial Reference System URI (e.g., http://www.opengis.net/def/crs/OGC/1.3/CRS84) that defines the coordinate system. |
|
|
107
|
+
| `locationType` | `string` | ✅ | An identifier for the format of the location data (e.g., coordinate-decimal, geojson-point) |
|
|
108
|
+
| `location` | `union` | ✅ | The location of where the work was performed as a URI or blob. |
|
|
109
|
+
| `name` | `string` | ❌ | Optional name for this location |
|
|
110
|
+
| `description` | `string` | ❌ | Optional description for this location |
|
|
111
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created |
|
|
112
|
+
|
|
113
|
+
### Badges Lexicon
|
|
114
|
+
|
|
115
|
+
**Lexicon IDs:** `app.certified.badge.definition`, `app.certified.badge.award`, `app.certified.badge.response`
|
|
116
|
+
|
|
117
|
+
**Description:** Defines badge metadata, award records, and recipient responses for certified badges that can be used across protocols.
|
|
118
|
+
|
|
119
|
+
#### Badge Definition
|
|
120
|
+
|
|
121
|
+
**Lexicon ID:** `app.certified.badge.definition`
|
|
122
|
+
|
|
123
|
+
**Key:** `tid`
|
|
124
|
+
|
|
125
|
+
| Property | Type | Required | Description |
|
|
126
|
+
| ---------------- | -------- | -------- | ---------------------------------------------------------------------- |
|
|
127
|
+
| `badgeType` | `string` | ✅ | Category of the badge (e.g., endorsement, participation, affiliation). |
|
|
128
|
+
| `title` | `string` | ✅ | Human-readable title of the badge. |
|
|
129
|
+
| `icon` | `blob` | ✅ | Icon representing the badge (accepted `image/*` types, maxSize 1MB). |
|
|
130
|
+
| `description` | `string` | ❌ | Optional short statement describing the badge. |
|
|
131
|
+
| `allowedIssuers` | `array` | ❌ | Optional allowlist of DIDs allowed to issue this badge. |
|
|
132
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. |
|
|
133
|
+
|
|
134
|
+
#### Badge Award
|
|
135
|
+
|
|
136
|
+
**Lexicon ID:** `app.certified.badge.award`
|
|
137
|
+
|
|
138
|
+
**Key:** `tid`
|
|
139
|
+
|
|
140
|
+
| Property | Type | Required | Description |
|
|
141
|
+
| ----------- | -------- | -------- | ------------------------------------------------------------------------------------ |
|
|
142
|
+
| `badge` | `ref` | ✅ | Reference to the badge definition for this award (`app.certified.badge.definition`). |
|
|
143
|
+
| `subject` | `union` | ✅ | Entity the badge award is for (either a DID or a specific AT Protocol record). |
|
|
144
|
+
| `note` | `string` | ❌ | Optional explanation for the award. |
|
|
145
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. |
|
|
146
|
+
|
|
147
|
+
#### Badge Response
|
|
148
|
+
|
|
149
|
+
**Lexicon ID:** `app.certified.badge.response`
|
|
150
|
+
|
|
151
|
+
**Key:** `tid`
|
|
152
|
+
|
|
153
|
+
| Property | Type | Required | Description |
|
|
154
|
+
| ------------ | -------- | -------- | ---------------------------------------------------------------------- |
|
|
155
|
+
| `badgeAward` | `ref` | ✅ | Reference to the badge award (`app.certified.badge.award`). |
|
|
156
|
+
| `response` | `string` | ✅ | Enum: `accepted` or `rejected`. |
|
|
157
|
+
| `weight` | `string` | ❌ | Optional relative weight assigned by the recipient (stored as string). |
|
|
158
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created. |
|
|
147
159
|
|
|
148
160
|
---
|
|
149
161
|
|
|
@@ -151,9 +163,9 @@ Certified lexicons are common/shared lexicons that can be used across multiple p
|
|
|
151
163
|
|
|
152
164
|
Hypercerts-specific lexicons for tracking impact work and claims.
|
|
153
165
|
|
|
154
|
-
### Hypercerts
|
|
166
|
+
### Hypercerts Activity Claim
|
|
155
167
|
|
|
156
|
-
**Lexicon ID:** `org.hypercerts.claim.
|
|
168
|
+
**Lexicon ID:** `org.hypercerts.claim.activity`
|
|
157
169
|
|
|
158
170
|
**Description:** The main lexicon where everything is connected to. This is the hypercert record that tracks impact work.
|
|
159
171
|
|
|
@@ -161,42 +173,50 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
161
173
|
|
|
162
174
|
#### Properties
|
|
163
175
|
|
|
164
|
-
| Property
|
|
165
|
-
|
|
166
|
-
| `title`
|
|
167
|
-
| `shortDescription` | `string` | ✅
|
|
168
|
-
| `description`
|
|
169
|
-
| `image`
|
|
170
|
-
| `workScope`
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
177
|
-
| `createdAt`
|
|
176
|
+
| Property | Type | Required | Description | Comments |
|
|
177
|
+
| ------------------ | -------- | -------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
|
178
|
+
| `title` | `string` | ✅ | Title of the hypercert | |
|
|
179
|
+
| `shortDescription` | `string` | ✅ | Short blurb of the impact work done. | |
|
|
180
|
+
| `description` | `string` | ❌ | Optional longer description of the impact work done. | |
|
|
181
|
+
| `image` | `union` | ❌ | The hypercert visual representation as a URI or image blob | |
|
|
182
|
+
| `workScope` | `object` | ❌ | Logical scope of the work using label-based conditions | Object with `withinAllOf`, `withinAnyOf`, `withinNoneOf` arrays of labels |
|
|
183
|
+
| `startDate` | `string` | ✅ | When the work began | |
|
|
184
|
+
| `endDate` | `string` | ✅ | When the work ended | |
|
|
185
|
+
| `contributions` | `array` | ❌ | A strong reference to the contributions done to create the impact in the hypercerts | References must conform to `org.hypercerts.claim.contribution` |
|
|
186
|
+
| `rights` | `ref` | ❌ | A strong reference to the rights that this hypercert has | References must conform to `org.hypercerts.claim.rights` |
|
|
187
|
+
| `location` | `ref` | ❌ | A strong reference to the location where the work for done hypercert was located | References must conform to `app.certified.location` |
|
|
188
|
+
| `project` | `string` | ❌ | A reference (AT-URI) to the project record that this activity is part of | References must conform to `org.hypercerts.claim.project` |
|
|
189
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
190
|
+
|
|
191
|
+
#### Defs
|
|
192
|
+
|
|
193
|
+
##### activityWeight
|
|
194
|
+
|
|
195
|
+
| Property | Type | Required | Description |
|
|
196
|
+
| ---------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
197
|
+
| `activity` | `ref` | ✅ | A strong reference to a hypercert activity record. This activity must conform to the lexicon org.hypercerts.claim.activity |
|
|
198
|
+
| `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
199
|
|
|
179
200
|
---
|
|
180
201
|
|
|
181
|
-
### Hypercerts
|
|
202
|
+
### Hypercerts Contribution
|
|
182
203
|
|
|
183
204
|
**Lexicon ID:** `org.hypercerts.claim.contribution`
|
|
184
205
|
|
|
185
206
|
**Description:** A contribution made toward a hypercert's impact.
|
|
186
207
|
|
|
187
|
-
**Key:** `
|
|
208
|
+
**Key:** `tid`
|
|
188
209
|
|
|
189
210
|
#### Properties
|
|
190
211
|
|
|
191
|
-
| Property
|
|
192
|
-
|
|
193
|
-
| `
|
|
194
|
-
| `
|
|
195
|
-
| `
|
|
196
|
-
| `
|
|
197
|
-
| `
|
|
198
|
-
| `
|
|
199
|
-
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
212
|
+
| Property | Type | Required | Description |
|
|
213
|
+
| -------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
214
|
+
| `role` | `string` | ❌ | Role or title of the contributor(s). |
|
|
215
|
+
| `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. |
|
|
216
|
+
| `description` | `string` | ❌ | What the contribution concretely achieved |
|
|
217
|
+
| `startDate` | `string` | ❌ | When this contribution started. This should be a subset of the hypercert timeframe. |
|
|
218
|
+
| `endDate` | `string` | ❌ | When this contribution finished. This should be a subset of the hypercert timeframe. |
|
|
219
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created |
|
|
200
220
|
|
|
201
221
|
---
|
|
202
222
|
|
|
@@ -204,19 +224,22 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
204
224
|
|
|
205
225
|
**Lexicon ID:** `org.hypercerts.claim.evaluation`
|
|
206
226
|
|
|
207
|
-
**Description:** An evaluation of a hypercert
|
|
227
|
+
**Description:** An evaluation of a hypercert record (e.g. an activity and its impact).
|
|
208
228
|
|
|
209
229
|
**Key:** `tid`
|
|
210
230
|
|
|
211
231
|
#### Properties
|
|
212
232
|
|
|
213
|
-
| Property
|
|
214
|
-
|
|
215
|
-
| `subject`
|
|
216
|
-
| `evaluators`
|
|
217
|
-
| `
|
|
218
|
-
| `
|
|
219
|
-
| `
|
|
233
|
+
| Property | Type | Required | Description | Comments |
|
|
234
|
+
| -------------- | -------- | -------- | --------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
235
|
+
| `subject` | `ref` | ❌ | A strong reference to what is being evaluated | (e.g activity, measurement, contribution, etc.) |
|
|
236
|
+
| `evaluators` | `array` | ✅ | DIDs of the evaluators | |
|
|
237
|
+
| `content` | `array` | ❌ | Evaluation data (URIs or blobs) containing detailed reports or methodology | |
|
|
238
|
+
| `measurements` | `array` | ❌ | Optional references to the measurements that contributed to this evaluation | References must conform to `org.hypercerts.claim.measurement` |
|
|
239
|
+
| `summary` | `string` | ✅ | Brief evaluation summary | |
|
|
240
|
+
| `score` | `object` | ❌ | Optional overall score for this evaluation on a numeric scale | Object with `min`, `max`, and `value` (integers) |
|
|
241
|
+
| `location` | `ref` | ❌ | An optional reference for georeferenced evaluations | References must conform to `app.certified.location` |
|
|
242
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
220
243
|
|
|
221
244
|
---
|
|
222
245
|
|
|
@@ -224,19 +247,21 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
224
247
|
|
|
225
248
|
**Lexicon ID:** `org.hypercerts.claim.evidence`
|
|
226
249
|
|
|
227
|
-
**Description:** A piece of evidence
|
|
250
|
+
**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
251
|
|
|
229
|
-
**Key:** `
|
|
252
|
+
**Key:** `tid`
|
|
230
253
|
|
|
231
254
|
#### Properties
|
|
232
255
|
|
|
233
|
-
| Property
|
|
234
|
-
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `
|
|
256
|
+
| Property | Type | Required | Description | Comments |
|
|
257
|
+
| ------------------ | -------- | -------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
|
|
258
|
+
| `subject` | `ref` | ❌ | A strong reference to the record this evidence relates to | (e.g. an activity, project, claim, or evaluation) |
|
|
259
|
+
| `content` | `union` | ✅ | A piece of evidence (URI or blob) related to the subject record | May support, clarify, or challenge a hypercert claim |
|
|
260
|
+
| `title` | `string` | ✅ | Title to describe the nature of the evidence | |
|
|
261
|
+
| `shortDescription` | `string` | ❌ | Short description explaining what this evidence shows | |
|
|
262
|
+
| `description` | `string` | ❌ | Longer description describing the evidence in more detail | |
|
|
263
|
+
| `relationType` | `string` | ❌ | How this evidence relates to the subject | Known values: `supports`, `challenges`, `clarifies` |
|
|
264
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
240
265
|
|
|
241
266
|
---
|
|
242
267
|
|
|
@@ -244,27 +269,29 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
244
269
|
|
|
245
270
|
**Lexicon ID:** `org.hypercerts.claim.measurement`
|
|
246
271
|
|
|
247
|
-
**Description:**
|
|
272
|
+
**Description:** Measurement data related to a hypercert record (e.g. an activity and its impact).
|
|
248
273
|
|
|
249
274
|
**Key:** `tid`
|
|
250
275
|
|
|
251
276
|
#### Properties
|
|
252
277
|
|
|
253
|
-
| Property
|
|
254
|
-
|
|
255
|
-
| `
|
|
256
|
-
| `measurers`
|
|
257
|
-
| `metric`
|
|
258
|
-
| `value`
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
278
|
+
| Property | Type | Required | Description | Comments |
|
|
279
|
+
| ------------- | -------- | -------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
280
|
+
| `subject` | `ref` | ❌ | A strong reference to the record this measurement refers to | (e.g. an activity, project, or claim) |
|
|
281
|
+
| `measurers` | `array` | ✅ | DIDs of the entity (or entities) that measured this data | |
|
|
282
|
+
| `metric` | `string` | ✅ | The metric being measured | |
|
|
283
|
+
| `value` | `string` | ✅ | The measured value | |
|
|
284
|
+
| `methodType` | `string` | ❌ | Short identifier for the measurement methodology | |
|
|
285
|
+
| `methodURI` | `string` | ❌ | URI to methodology documentation, standard protocol, or measurement procedure | |
|
|
286
|
+
| `evidenceURI` | `array` | ❌ | URIs to related evidence or underlying data | (e.g. org.hypercerts.claim.evidence records or raw datasets) |
|
|
287
|
+
| `location` | `ref` | ❌ | A strong reference to the location where the measurement was taken | References must conform to `app.certified.location` |
|
|
288
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
262
289
|
|
|
263
290
|
---
|
|
264
291
|
|
|
265
|
-
### org.hypercerts.collection
|
|
292
|
+
### org.hypercerts.claim.collection
|
|
266
293
|
|
|
267
|
-
**Lexicon ID:** `org.hypercerts.collection`
|
|
294
|
+
**Lexicon ID:** `org.hypercerts.claim.collection`
|
|
268
295
|
|
|
269
296
|
**Description:** A collection/group of hypercerts that have a specific property.
|
|
270
297
|
|
|
@@ -272,22 +299,37 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
272
299
|
|
|
273
300
|
#### Properties
|
|
274
301
|
|
|
275
|
-
| Property
|
|
276
|
-
|
|
277
|
-
| `title`
|
|
278
|
-
| `shortDescription` | `string` | ❌
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
302
|
+
| Property | Type | Required | Description | Comments |
|
|
303
|
+
| ------------------ | -------- | -------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
304
|
+
| `title` | `string` | ✅ | The title of this collection | |
|
|
305
|
+
| `shortDescription` | `string` | ❌ | A short description of this collection | |
|
|
306
|
+
| `avatar` | `blob` | ❌ | Primary avatar image representing this collection across apps and views | Typically a square image |
|
|
307
|
+
| `coverPhoto` | `blob` | ❌ | The cover photo of this collection | |
|
|
308
|
+
| `activities` | `array` | ✅ | Array of activities with their associated weights in this collection | Each item references `org.hypercerts.claim.activity#activityWeight` |
|
|
309
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
282
310
|
|
|
283
|
-
|
|
311
|
+
---
|
|
284
312
|
|
|
285
|
-
|
|
313
|
+
### org.hypercerts.claim.project
|
|
286
314
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
315
|
+
**Lexicon ID:** `org.hypercerts.claim.project`
|
|
316
|
+
|
|
317
|
+
**Description:** A project that can include multiple activities, each of which may be linked to at most one project.
|
|
318
|
+
|
|
319
|
+
**Key:** `tid`
|
|
320
|
+
|
|
321
|
+
#### Properties
|
|
322
|
+
|
|
323
|
+
| Property | Type | Required | Description | Comments |
|
|
324
|
+
| ------------------ | -------- | -------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
325
|
+
| `title` | `string` | ✅ | Title of this project | |
|
|
326
|
+
| `shortDescription` | `string` | ✅ | Short summary of this project, suitable for previews and list views | |
|
|
327
|
+
| `description` | `ref` | ❌ | Rich-text description of this project, represented as a Leaflet linear document | References must conform to `pub.leaflet.pages.linearDocument#main` |
|
|
328
|
+
| `avatar` | `blob` | ❌ | Primary avatar image representing this project across apps and views | Typically a square logo or project identity image |
|
|
329
|
+
| `coverPhoto` | `blob` | ❌ | The cover photo of this project | |
|
|
330
|
+
| `activities` | `array` | ❌ | Array of activities with their associated weights in this project | Each item references `org.hypercerts.claim.activity#activityWeight` |
|
|
331
|
+
| `location` | `ref` | ❌ | A strong reference to a location record describing where the work took place | References must conform to `app.certified.location` |
|
|
332
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
291
333
|
|
|
292
334
|
---
|
|
293
335
|
|
|
@@ -295,18 +337,45 @@ Hypercerts-specific lexicons for tracking impact work and claims.
|
|
|
295
337
|
|
|
296
338
|
**Lexicon ID:** `org.hypercerts.claim.rights`
|
|
297
339
|
|
|
298
|
-
**Description:** Describes the rights that a
|
|
340
|
+
**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
341
|
|
|
300
|
-
**Key:** `
|
|
342
|
+
**Key:** `tid`
|
|
343
|
+
|
|
344
|
+
#### Properties
|
|
345
|
+
|
|
346
|
+
| Property | Type | Required | Description | Comments |
|
|
347
|
+
| ------------------- | -------- | -------- | ----------------------------------------------------------------- | ----------- |
|
|
348
|
+
| `rightsName` | `string` | ✅ | Full name of the rights | |
|
|
349
|
+
| `rightsType` | `string` | ✅ | Short rights identifier for easier search | |
|
|
350
|
+
| `rightsDescription` | `string` | ✅ | Description of the rights of this hypercert | |
|
|
351
|
+
| `attachment` | `union` | ❌ | An attachment to define the rights further, e.g. a legal document | URI or blob |
|
|
352
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this record was originally created | |
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
### org.hypercerts.funding.receipt
|
|
357
|
+
|
|
358
|
+
**Lexicon ID:** `org.hypercerts.funding.receipt`
|
|
359
|
+
|
|
360
|
+
**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.
|
|
361
|
+
|
|
362
|
+
**Key:** `tid`
|
|
301
363
|
|
|
302
364
|
#### Properties
|
|
303
365
|
|
|
304
|
-
| Property
|
|
305
|
-
|
|
306
|
-
| `
|
|
307
|
-
| `
|
|
308
|
-
| `
|
|
309
|
-
| `
|
|
366
|
+
| Property | Type | Required | Description | Comments |
|
|
367
|
+
| ---------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
368
|
+
| `from` | `string` | ✅ | DID of the sender who transferred the funds. If sender wants to stay anonymous, mark this explicitly. | Format: did |
|
|
369
|
+
| `to` | `string` | ✅ | The recipient of the funds, who can be identified by DID or a clear-text name. | |
|
|
370
|
+
| `amount` | `string` | ✅ | Amount of funding received. | |
|
|
371
|
+
| `currency` | `string` | ✅ | Currency of the payment (e.g. EUR, USD, ETH). | |
|
|
372
|
+
| `paymentRail` | `string` | ❌ | How the funds were transferred (e.g. bank_transfer, credit_card, onchain, cash, check, payment_processor). | |
|
|
373
|
+
| `paymentNetwork` | `string` | ❌ | Optional network within the payment rail (e.g. arbitrum, ethereum, sepa, visa, paypal). | |
|
|
374
|
+
| `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. |
|
|
375
|
+
| `for` | `string` | ❌ | Optional reference to the activity, project, or organization this funding relates to. | Format: at-uri |
|
|
376
|
+
| `notes` | `string` | ❌ | Optional notes or additional context for this funding receipt. | maxLength: 500 |
|
|
377
|
+
| `occurredAt` | `string` | ❌ | Timestamp when the payment occurred. | Format: datetime |
|
|
378
|
+
| `createdAt` | `string` | ✅ | Client-declared timestamp when this receipt record was created. | Format: datetime |
|
|
310
379
|
|
|
311
380
|
---
|
|
312
381
|
|