@hypercerts-org/lexicon 0.10.0-beta.9 → 0.11.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/CHANGELOG.md +907 -0
- package/README.md +420 -168
- package/SCHEMAS.md +897 -142
- package/dist/exports.d.ts +1876 -453
- package/dist/exports.d.ts.map +1 -1
- package/dist/generated/exports.d.ts +1876 -453
- package/dist/generated/exports.d.ts.map +1 -1
- package/dist/generated/lexicons.d.ts +3709 -1113
- package/dist/generated/lexicons.d.ts.map +1 -1
- package/dist/generated/types/app/bsky/richtext/facet.d.ts +44 -7
- package/dist/generated/types/app/bsky/richtext/facet.d.ts.map +1 -1
- package/dist/generated/types/app/certified/actor/organization.d.ts +32 -0
- package/dist/generated/types/app/certified/actor/organization.d.ts.map +1 -0
- package/dist/generated/types/app/certified/actor/profile.d.ts +30 -0
- package/dist/generated/types/app/certified/actor/profile.d.ts.map +1 -0
- package/dist/generated/types/app/certified/badge/award.d.ts +4 -3
- package/dist/generated/types/app/certified/badge/award.d.ts.map +1 -1
- package/dist/generated/types/app/certified/badge/definition.d.ts +3 -3
- package/dist/generated/types/app/certified/badge/definition.d.ts.map +1 -1
- package/dist/generated/types/app/certified/badge/response.d.ts +3 -3
- package/dist/generated/types/app/certified/badge/response.d.ts.map +1 -1
- package/dist/generated/types/app/certified/defs.d.ts +11 -1
- package/dist/generated/types/app/certified/defs.d.ts.map +1 -1
- package/dist/generated/types/app/certified/link/evm.d.ts +45 -0
- package/dist/generated/types/app/certified/link/evm.d.ts.map +1 -0
- package/dist/generated/types/app/certified/location.d.ts +13 -5
- package/dist/generated/types/app/certified/location.d.ts.map +1 -1
- package/dist/generated/types/org/hyperboards/board.d.ts +75 -0
- package/dist/generated/types/org/hyperboards/board.d.ts.map +1 -0
- package/dist/generated/types/org/hyperboards/displayProfile.d.ts +31 -0
- package/dist/generated/types/org/hyperboards/displayProfile.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/activity.d.ts +33 -11
- package/dist/generated/types/org/hypercerts/claim/activity.d.ts.map +1 -1
- package/dist/generated/types/org/hypercerts/claim/{contributionDetails.d.ts → contribution.d.ts} +6 -6
- package/dist/generated/types/org/hypercerts/claim/contribution.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/claim/contributorInformation.d.ts +2 -2
- package/dist/generated/types/org/hypercerts/claim/contributorInformation.d.ts.map +1 -1
- package/dist/generated/types/org/hypercerts/claim/rights.d.ts +3 -3
- package/dist/generated/types/org/hypercerts/claim/rights.d.ts.map +1 -1
- package/dist/generated/types/org/hypercerts/collection.d.ts +48 -0
- package/dist/generated/types/org/hypercerts/collection.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/context/acknowledgement.d.ts +25 -0
- package/dist/generated/types/org/hypercerts/context/acknowledgement.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/context/attachment.d.ts +37 -0
- package/dist/generated/types/org/hypercerts/context/attachment.d.ts.map +1 -0
- package/dist/{types/org/hypercerts/claim → generated/types/org/hypercerts/context}/evaluation.d.ts +15 -15
- package/dist/generated/types/org/hypercerts/context/evaluation.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/context/measurement.d.ts +43 -0
- package/dist/generated/types/org/hypercerts/context/measurement.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/defs.d.ts +19 -44
- package/dist/generated/types/org/hypercerts/defs.d.ts.map +1 -1
- package/dist/generated/types/org/hypercerts/funding/receipt.d.ts +18 -6
- package/dist/generated/types/org/hypercerts/funding/receipt.d.ts.map +1 -1
- package/dist/generated/types/org/hypercerts/workscope/cel.d.ts +20 -0
- package/dist/generated/types/org/hypercerts/workscope/cel.d.ts.map +1 -0
- package/dist/generated/types/org/hypercerts/workscope/tag.d.ts +36 -0
- package/dist/generated/types/org/hypercerts/workscope/tag.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/blockquote.d.ts +13 -0
- package/dist/generated/types/pub/leaflet/blocks/blockquote.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/bskyPost.d.ts +13 -0
- package/dist/generated/types/pub/leaflet/blocks/bskyPost.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/button.d.ts +12 -0
- package/dist/generated/types/pub/leaflet/blocks/button.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/code.d.ts +13 -0
- package/dist/generated/types/pub/leaflet/blocks/code.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/header.d.ts +14 -0
- package/dist/generated/types/pub/leaflet/blocks/header.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/horizontalRule.d.ts +10 -0
- package/dist/generated/types/pub/leaflet/blocks/horizontalRule.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/iframe.d.ts +12 -0
- package/dist/generated/types/pub/leaflet/blocks/iframe.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/image.d.ts +21 -0
- package/dist/generated/types/pub/leaflet/blocks/image.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/math.d.ts +11 -0
- package/dist/generated/types/pub/leaflet/blocks/math.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/orderedList.d.ts +31 -0
- package/dist/generated/types/pub/leaflet/blocks/orderedList.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/page.d.ts +11 -0
- package/dist/generated/types/pub/leaflet/blocks/page.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/poll.d.ts +12 -0
- package/dist/generated/types/pub/leaflet/blocks/poll.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/text.d.ts +14 -0
- package/dist/generated/types/pub/leaflet/blocks/text.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/unorderedList.d.ts +29 -0
- package/dist/generated/types/pub/leaflet/blocks/unorderedList.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/blocks/website.d.ts +14 -0
- package/dist/generated/types/pub/leaflet/blocks/website.d.ts.map +1 -0
- package/dist/generated/types/pub/leaflet/pages/linearDocument.d.ts +54 -1
- package/dist/generated/types/pub/leaflet/pages/linearDocument.d.ts.map +1 -1
- package/dist/generated/types/pub/leaflet/richtext/facet.d.ts +97 -0
- package/dist/generated/types/pub/leaflet/richtext/facet.d.ts.map +1 -0
- package/dist/index.cjs +5682 -1668
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5554 -1640
- package/dist/index.mjs.map +1 -1
- package/dist/lexicons.cjs +1846 -419
- package/dist/lexicons.cjs.map +1 -1
- package/dist/lexicons.d.ts +3709 -1113
- package/dist/lexicons.d.ts.map +1 -1
- package/dist/lexicons.mjs +1846 -419
- package/dist/lexicons.mjs.map +1 -1
- package/dist/tests/validate-external-lexicons.test.d.ts +2 -0
- package/dist/tests/validate-external-lexicons.test.d.ts.map +1 -0
- package/dist/tests/validate-funding-receipt.test.d.ts +2 -0
- package/dist/tests/validate-funding-receipt.test.d.ts.map +1 -0
- package/dist/tests/validate-link-evm.test.d.ts +2 -0
- package/dist/tests/validate-link-evm.test.d.ts.map +1 -0
- package/dist/tests/validate-rights.test.d.ts +2 -0
- package/dist/tests/validate-rights.test.d.ts.map +1 -0
- package/dist/types/app/bsky/richtext/facet.d.ts +44 -7
- package/dist/types/app/bsky/richtext/facet.d.ts.map +1 -1
- package/dist/types/app/certified/actor/organization.d.ts +32 -0
- package/dist/types/app/certified/actor/organization.d.ts.map +1 -0
- package/dist/types/app/certified/actor/profile.d.ts +30 -0
- package/dist/types/app/certified/actor/profile.d.ts.map +1 -0
- package/dist/types/app/certified/badge/award.d.ts +4 -3
- package/dist/types/app/certified/badge/award.d.ts.map +1 -1
- package/dist/types/app/certified/badge/definition.d.ts +3 -3
- package/dist/types/app/certified/badge/definition.d.ts.map +1 -1
- package/dist/types/app/certified/badge/response.d.ts +3 -3
- package/dist/types/app/certified/badge/response.d.ts.map +1 -1
- package/dist/types/app/certified/defs.d.ts +11 -1
- package/dist/types/app/certified/defs.d.ts.map +1 -1
- package/dist/types/app/certified/link/evm.d.ts +45 -0
- package/dist/types/app/certified/link/evm.d.ts.map +1 -0
- package/dist/types/app/certified/location.d.ts +13 -5
- package/dist/types/app/certified/location.d.ts.map +1 -1
- package/dist/types/org/hyperboards/board.d.ts +75 -0
- package/dist/types/org/hyperboards/board.d.ts.map +1 -0
- package/dist/types/org/hyperboards/displayProfile.d.ts +31 -0
- package/dist/types/org/hyperboards/displayProfile.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/activity.d.ts +33 -11
- package/dist/types/org/hypercerts/claim/activity.d.ts.map +1 -1
- package/dist/types/org/hypercerts/claim/{contributionDetails.d.ts → contribution.d.ts} +6 -6
- package/dist/types/org/hypercerts/claim/contribution.d.ts.map +1 -0
- package/dist/types/org/hypercerts/claim/contributorInformation.d.ts +2 -2
- package/dist/types/org/hypercerts/claim/contributorInformation.d.ts.map +1 -1
- package/dist/types/org/hypercerts/claim/rights.d.ts +3 -3
- package/dist/types/org/hypercerts/claim/rights.d.ts.map +1 -1
- package/dist/types/org/hypercerts/collection.d.ts +48 -0
- package/dist/types/org/hypercerts/collection.d.ts.map +1 -0
- package/dist/types/org/hypercerts/context/acknowledgement.d.ts +25 -0
- package/dist/types/org/hypercerts/context/acknowledgement.d.ts.map +1 -0
- package/dist/types/org/hypercerts/context/attachment.d.ts +37 -0
- package/dist/types/org/hypercerts/context/attachment.d.ts.map +1 -0
- package/dist/{generated/types/org/hypercerts/claim → types/org/hypercerts/context}/evaluation.d.ts +15 -15
- package/dist/types/org/hypercerts/context/evaluation.d.ts.map +1 -0
- package/dist/types/org/hypercerts/context/measurement.d.ts +43 -0
- package/dist/types/org/hypercerts/context/measurement.d.ts.map +1 -0
- package/dist/types/org/hypercerts/defs.d.ts +19 -44
- package/dist/types/org/hypercerts/defs.d.ts.map +1 -1
- package/dist/types/org/hypercerts/funding/receipt.d.ts +18 -6
- package/dist/types/org/hypercerts/funding/receipt.d.ts.map +1 -1
- package/dist/types/org/hypercerts/workscope/cel.d.ts +20 -0
- package/dist/types/org/hypercerts/workscope/cel.d.ts.map +1 -0
- package/dist/types/org/hypercerts/workscope/tag.d.ts +36 -0
- package/dist/types/org/hypercerts/workscope/tag.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/blockquote.d.ts +13 -0
- package/dist/types/pub/leaflet/blocks/blockquote.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/bskyPost.d.ts +13 -0
- package/dist/types/pub/leaflet/blocks/bskyPost.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/button.d.ts +12 -0
- package/dist/types/pub/leaflet/blocks/button.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/code.d.ts +13 -0
- package/dist/types/pub/leaflet/blocks/code.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/header.d.ts +14 -0
- package/dist/types/pub/leaflet/blocks/header.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/horizontalRule.d.ts +10 -0
- package/dist/types/pub/leaflet/blocks/horizontalRule.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/iframe.d.ts +12 -0
- package/dist/types/pub/leaflet/blocks/iframe.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/image.d.ts +21 -0
- package/dist/types/pub/leaflet/blocks/image.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/math.d.ts +11 -0
- package/dist/types/pub/leaflet/blocks/math.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/orderedList.d.ts +31 -0
- package/dist/types/pub/leaflet/blocks/orderedList.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/page.d.ts +11 -0
- package/dist/types/pub/leaflet/blocks/page.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/poll.d.ts +12 -0
- package/dist/types/pub/leaflet/blocks/poll.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/text.d.ts +14 -0
- package/dist/types/pub/leaflet/blocks/text.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/unorderedList.d.ts +29 -0
- package/dist/types/pub/leaflet/blocks/unorderedList.d.ts.map +1 -0
- package/dist/types/pub/leaflet/blocks/website.d.ts +14 -0
- package/dist/types/pub/leaflet/blocks/website.d.ts.map +1 -0
- package/dist/types/pub/leaflet/pages/linearDocument.d.ts +54 -1
- package/dist/types/pub/leaflet/pages/linearDocument.d.ts.map +1 -1
- package/dist/types/pub/leaflet/richtext/facet.d.ts +97 -0
- package/dist/types/pub/leaflet/richtext/facet.d.ts.map +1 -0
- package/lexicons/app/bsky/richtext/facet.json +51 -0
- package/lexicons/app/certified/actor/organization.json +70 -0
- package/lexicons/app/certified/actor/profile.json +61 -0
- package/lexicons/app/certified/badge/award.json +10 -3
- package/lexicons/app/certified/badge/definition.json +17 -4
- package/lexicons/app/certified/badge/response.json +5 -4
- package/lexicons/app/certified/defs.json +11 -3
- package/lexicons/app/certified/link/evm.json +88 -0
- package/lexicons/app/certified/location.json +29 -6
- package/lexicons/org/hyperboards/board.json +152 -0
- package/lexicons/org/hyperboards/displayProfile.json +64 -0
- package/lexicons/org/hypercerts/claim/activity.json +61 -39
- package/lexicons/org/hypercerts/claim/{contributionDetails.json → contribution.json} +4 -4
- package/lexicons/org/hypercerts/claim/contributorInformation.json +3 -2
- package/lexicons/org/hypercerts/claim/rights.json +5 -3
- package/lexicons/org/hypercerts/{claim/collection.json → collection.json} +33 -11
- package/lexicons/org/hypercerts/context/acknowledgement.json +42 -0
- package/lexicons/org/hypercerts/context/attachment.json +88 -0
- package/lexicons/org/hypercerts/{claim → context}/evaluation.json +25 -22
- package/lexicons/org/hypercerts/context/measurement.json +107 -0
- package/lexicons/org/hypercerts/defs.json +35 -89
- package/lexicons/org/hypercerts/funding/receipt.json +40 -14
- package/lexicons/org/hypercerts/workscope/cel.json +39 -0
- package/lexicons/org/hypercerts/workscope/tag.json +87 -0
- package/lexicons/pub/leaflet/blocks/blockquote.json +22 -0
- package/lexicons/pub/leaflet/blocks/bskyPost.json +19 -0
- package/lexicons/pub/leaflet/blocks/button.json +19 -0
- package/lexicons/pub/leaflet/blocks/code.json +21 -0
- package/lexicons/pub/leaflet/blocks/header.json +27 -0
- package/lexicons/pub/leaflet/blocks/horizontalRule.json +11 -0
- package/lexicons/pub/leaflet/blocks/iframe.json +21 -0
- package/lexicons/pub/leaflet/blocks/image.json +37 -0
- package/lexicons/pub/leaflet/blocks/math.json +15 -0
- package/lexicons/pub/leaflet/blocks/orderedList.json +54 -0
- package/lexicons/pub/leaflet/blocks/page.json +15 -0
- package/lexicons/pub/leaflet/blocks/poll.json +16 -0
- package/lexicons/pub/leaflet/blocks/text.json +26 -0
- package/lexicons/pub/leaflet/blocks/unorderedList.json +50 -0
- package/lexicons/pub/leaflet/blocks/website.json +27 -0
- package/lexicons/pub/leaflet/pages/linearDocument.json +98 -0
- package/lexicons/pub/leaflet/richtext/facet.json +149 -0
- package/package.json +4 -5
- package/dist/generated/types/org/hypercerts/claim/collection.d.ts +0 -41
- package/dist/generated/types/org/hypercerts/claim/collection.d.ts.map +0 -1
- package/dist/generated/types/org/hypercerts/claim/contributionDetails.d.ts.map +0 -1
- package/dist/generated/types/org/hypercerts/claim/evaluation.d.ts.map +0 -1
- package/dist/generated/types/org/hypercerts/claim/evidence.d.ts +0 -29
- package/dist/generated/types/org/hypercerts/claim/evidence.d.ts.map +0 -1
- package/dist/generated/types/org/hypercerts/claim/measurement.d.ts +0 -30
- package/dist/generated/types/org/hypercerts/claim/measurement.d.ts.map +0 -1
- package/dist/generated/types/org/hypercerts/helper/workScopeTag.d.ts +0 -31
- package/dist/generated/types/org/hypercerts/helper/workScopeTag.d.ts.map +0 -1
- package/dist/types/org/hypercerts/claim/collection.d.ts +0 -41
- package/dist/types/org/hypercerts/claim/collection.d.ts.map +0 -1
- package/dist/types/org/hypercerts/claim/contributionDetails.d.ts.map +0 -1
- package/dist/types/org/hypercerts/claim/evaluation.d.ts.map +0 -1
- package/dist/types/org/hypercerts/claim/evidence.d.ts +0 -29
- package/dist/types/org/hypercerts/claim/evidence.d.ts.map +0 -1
- package/dist/types/org/hypercerts/claim/measurement.d.ts +0 -30
- package/dist/types/org/hypercerts/claim/measurement.d.ts.map +0 -1
- package/dist/types/org/hypercerts/helper/workScopeTag.d.ts +0 -31
- package/dist/types/org/hypercerts/helper/workScopeTag.d.ts.map +0 -1
- package/lexicons/org/hypercerts/claim/evidence.json +0 -57
- package/lexicons/org/hypercerts/claim/measurement.json +0 -70
- package/lexicons/org/hypercerts/helper/workScopeTag.json +0 -65
package/README.md
CHANGED
|
@@ -1,39 +1,180 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Hypercerts protocol
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
# @hypercerts-org/lexicon
|
|
2
|
+
|
|
3
|
+
ATProto lexicon definitions and TypeScript types for the
|
|
4
|
+
[Hypercerts](https://hypercerts.org) protocol — a system for tracking,
|
|
5
|
+
evaluating, and funding impact work on the
|
|
6
|
+
[AT Protocol](https://atproto.com) network.
|
|
7
|
+
|
|
8
|
+
## Lexicon Map
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
CLAIMS ─ the core impact record and its parts
|
|
12
|
+
──────────────────────────────────────────────────────────────────────
|
|
13
|
+
activity ──────────┬──► collection ◄──┐ (recursive nesting)
|
|
14
|
+
(the hypercert) │ │ │
|
|
15
|
+
│ ▼ │
|
|
16
|
+
├──► contribution (role, timeframe)
|
|
17
|
+
├──► contributorInformation (identity, avatar)
|
|
18
|
+
├──► rights (licensing terms)
|
|
19
|
+
└──► workScope
|
|
20
|
+
├── cel (CEL expression)
|
|
21
|
+
└── tag (reusable scope atom)
|
|
22
|
+
|
|
23
|
+
CONTEXT ─ evidence, data, and social verification
|
|
24
|
+
──────────────────────────────────────────────────────────────────────
|
|
25
|
+
attachment ─────────────► activity / evaluation / ...
|
|
26
|
+
measurement ────────────► activity / ...
|
|
27
|
+
evaluation ─────────────► activity / attachment
|
|
28
|
+
└──────► measurement
|
|
29
|
+
acknowledgement ────────► activity / collection (bidirectional link)
|
|
30
|
+
|
|
31
|
+
FUNDING ─ payment records
|
|
32
|
+
──────────────────────────────────────────────────────────────────────
|
|
33
|
+
receipt ────────────────► activity (from funder → to recipient)
|
|
34
|
+
|
|
35
|
+
HYPERBOARDS ─ visual display layer (hyperboards.org)
|
|
36
|
+
──────────────────────────────────────────────────────────────────────
|
|
37
|
+
board ──────────────────► activity / collection
|
|
38
|
+
└── contributorConfig ► contributorInformation
|
|
39
|
+
displayProfile (per-user visual defaults)
|
|
40
|
+
|
|
41
|
+
CERTIFIED ─ shared lexicons (certified.app)
|
|
42
|
+
──────────────────────────────────────────────────────────────────────
|
|
43
|
+
location (geo coordinates, GeoJSON, H3, …)
|
|
44
|
+
actor/profile (user profile)
|
|
45
|
+
actor/organization (org metadata)
|
|
46
|
+
badge/definition ──► badge/award ──► badge/response
|
|
47
|
+
```
|
|
8
48
|
|
|
9
|
-
|
|
49
|
+
Every arrow (`►`) is a `strongRef` or union reference stored on the
|
|
50
|
+
AT Protocol network. Full field-level documentation is in
|
|
51
|
+
[SCHEMAS.md](SCHEMAS.md).
|
|
10
52
|
|
|
11
|
-
|
|
12
|
-
sets relating to hypercerts
|
|
53
|
+
## Consuming These Lexicons
|
|
13
54
|
|
|
14
|
-
|
|
15
|
-
|
|
55
|
+
If you are building a downstream application on top of these lexicons,
|
|
56
|
+
we strongly recommend **NOT** reading from `main` or other development
|
|
57
|
+
branches of the repository, but instead via the following published
|
|
58
|
+
releases:
|
|
16
59
|
|
|
17
|
-
-
|
|
18
|
-
|
|
60
|
+
- **For TypeScript / JavaScript code** — use [the npm package
|
|
61
|
+
`@hypercerts-org/lexicon`](https://www.npmjs.com/package/@hypercerts-org/lexicon),
|
|
62
|
+
which includes generated types, validation helpers, and schema
|
|
63
|
+
constants.
|
|
64
|
+
- **For other languages** — use the [tagged
|
|
65
|
+
releases](https://github.com/hypercerts-org/hypercerts-lexicon/releases)
|
|
66
|
+
published in this GitHub repository.
|
|
19
67
|
|
|
20
|
-
|
|
68
|
+
Both npm releases and git tags follow [SemVer](https://semver.org/).
|
|
69
|
+
For npm, you can depend on a version range to receive compatible
|
|
70
|
+
updates automatically. For GitHub releases/tags, pin a specific tag
|
|
71
|
+
or upgrade manually to a newer compatible SemVer release.
|
|
21
72
|
|
|
22
|
-
|
|
23
|
-
|
|
73
|
+
The raw lexicons published on ATProto can also be used, but they are
|
|
74
|
+
(unavoidably) missing useful context such as full documentation
|
|
75
|
+
(including changelogs), TypeScript type definitions, SemVer
|
|
76
|
+
guarantees, git history, and other tooling provided by the packaged
|
|
77
|
+
releases.
|
|
24
78
|
|
|
25
|
-
|
|
26
|
-
- "E" means "entity"
|
|
27
|
-
- "P" means "protocol"
|
|
79
|
+
### AI Agent Skill
|
|
28
80
|
|
|
29
|
-
|
|
81
|
+
If you use AI coding assistants (e.g. Claude Code, OpenCode), you can
|
|
82
|
+
install a skill that teaches your agent how to build with these
|
|
83
|
+
lexicons:
|
|
30
84
|
|
|
31
|
-
|
|
32
|
-
|
|
85
|
+
```bash
|
|
86
|
+
npx skills add hypercerts-org/hypercerts-lexicon
|
|
87
|
+
```
|
|
33
88
|
|
|
34
|
-
|
|
89
|
+
This installs the
|
|
90
|
+
[`building-with-hypercerts-lexicons`](.agents/skills/building-with-hypercerts-lexicons/SKILL.md)
|
|
91
|
+
skill, which provides your agent with guidance on package entry points,
|
|
92
|
+
TypeScript types, validation, all lexicon schemas, code examples, and
|
|
93
|
+
AT Protocol conventions.
|
|
94
|
+
|
|
95
|
+
## Maintenance and publishing releases
|
|
96
|
+
|
|
97
|
+
Clearly stability and predictability for users and developers are
|
|
98
|
+
essential.
|
|
99
|
+
|
|
100
|
+
Unfortunately AT Protocol doesn't support any kind of native
|
|
101
|
+
versioning or migrations which could support lexicon schema changes.
|
|
102
|
+
Instead, the AT Protocol community recommends minimising changes to
|
|
103
|
+
lexicons in general, and to avoid breaking changes wherever possible:
|
|
104
|
+
|
|
105
|
+
- https://atproto.com/guides/lexicon-style-guide
|
|
106
|
+
- https://www.pfrazee.com/blog/lexicon-guidance
|
|
107
|
+
|
|
108
|
+
This project intends to follow that guidance as much as possible
|
|
109
|
+
whilst retaining a pragmatic approach. In practice that means:
|
|
110
|
+
|
|
111
|
+
- Changes to other tooling within this repository which _do not touch
|
|
112
|
+
lexicons_ may be made at any time as long as they follow
|
|
113
|
+
[SemVer](https://semver.org/) to avoid negative impact on
|
|
114
|
+
developers.
|
|
115
|
+
|
|
116
|
+
- Non-breaking changes to lexicons, such as adding an optional
|
|
117
|
+
property or updating a `description`, may be made sparingly. While
|
|
118
|
+
these changes are backwards-compatible at the protocol level, they
|
|
119
|
+
may still require consuming applications and indexers to update
|
|
120
|
+
their schemas for consistent UX.
|
|
121
|
+
|
|
122
|
+
- Breaking changes to lexicons will only be made in exceptional
|
|
123
|
+
circumstances. Specifically, a breaking change will only proceed
|
|
124
|
+
**if and only if**:
|
|
125
|
+
- the broader community — not just the Hypercerts core team —
|
|
126
|
+
agrees that the benefits clearly outweigh the cost of the
|
|
127
|
+
breakage, **and**
|
|
128
|
+
- full consideration is given to all affected parties across the
|
|
129
|
+
community and wider ecosystem, not only those involved in the
|
|
130
|
+
decision, **and**
|
|
131
|
+
- no viable alternative exists, such as releasing a new `.v2`
|
|
132
|
+
version of the lexicon or introducing a `v2` field.
|
|
133
|
+
|
|
134
|
+
To date, breaking changes have only occurred during the early
|
|
135
|
+
stages of launching Hypercerts on AT Protocol, before external
|
|
136
|
+
consumers were building against the lexicons. We intend to keep
|
|
137
|
+
it that way.
|
|
138
|
+
|
|
139
|
+
It is also worth noting that members of the ATProto community have
|
|
140
|
+
been working on tooling to make these problems easier to deal with in
|
|
141
|
+
future, e.g. see https://panproto.dev/
|
|
142
|
+
|
|
143
|
+
## Use of branches
|
|
144
|
+
|
|
145
|
+
`main` is the only evergreen branch and the default branch on GitHub.
|
|
146
|
+
We aim to minimise deviations between `main` and versions published on
|
|
147
|
+
npm and ATProto. However the publishing processes involve several
|
|
148
|
+
moving parts (including third-party systems), and it is technically
|
|
149
|
+
impossible to update all three at the same time. So **please do not
|
|
150
|
+
assume they will always be perfectly in sync**.
|
|
151
|
+
|
|
152
|
+
See [docs/PUBLISHING.md](docs/PUBLISHING.md) for the full release workflow.
|
|
153
|
+
|
|
154
|
+
> If you see a `develop` branch, it is a stale leftover from a
|
|
155
|
+
> previous workflow and is no longer used; do not open pull requests
|
|
156
|
+
> against it.
|
|
157
|
+
|
|
158
|
+
## Contributing / development
|
|
159
|
+
|
|
160
|
+
Please see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
161
|
+
|
|
162
|
+
### Project Structure
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
lexicons/ Source of truth (committed)
|
|
166
|
+
org/hypercerts/ Hypercerts protocol lexicons
|
|
167
|
+
org/hyperboards/ Hyperboards visual layer lexicons
|
|
168
|
+
app/certified/ Shared/certified lexicons
|
|
169
|
+
com/atproto/ ATProto external references
|
|
170
|
+
|
|
171
|
+
generated/ Auto-generated TypeScript (gitignored)
|
|
172
|
+
dist/ Built bundles (gitignored)
|
|
173
|
+
scripts/ Build and codegen scripts
|
|
174
|
+
```
|
|
35
175
|
|
|
36
|
-
|
|
176
|
+
> **Never edit `generated/` or `dist/` directly** — they are
|
|
177
|
+
> regenerated from lexicon JSON files.
|
|
37
178
|
|
|
38
179
|
## Installation
|
|
39
180
|
|
|
@@ -41,9 +182,7 @@ following icons:
|
|
|
41
182
|
npm install @hypercerts-org/lexicon
|
|
42
183
|
```
|
|
43
184
|
|
|
44
|
-
##
|
|
45
|
-
|
|
46
|
-
### Basic Import
|
|
185
|
+
## Quick Start
|
|
47
186
|
|
|
48
187
|
```typescript
|
|
49
188
|
import {
|
|
@@ -51,8 +190,6 @@ import {
|
|
|
51
190
|
ACTIVITY_NSID,
|
|
52
191
|
validate,
|
|
53
192
|
} from "@hypercerts-org/lexicon";
|
|
54
|
-
|
|
55
|
-
// Use with AT Protocol Agent
|
|
56
193
|
import { Agent } from "@atproto/api";
|
|
57
194
|
|
|
58
195
|
const agent = new Agent({ service: "https://bsky.social" });
|
|
@@ -60,116 +197,152 @@ const agent = new Agent({ service: "https://bsky.social" });
|
|
|
60
197
|
// Register lexicons with the agent
|
|
61
198
|
agent.api.lex.add(...HYPERCERTS_SCHEMAS);
|
|
62
199
|
|
|
63
|
-
//
|
|
64
|
-
const
|
|
200
|
+
// Build a record
|
|
201
|
+
const record = {
|
|
65
202
|
$type: ACTIVITY_NSID,
|
|
66
|
-
title: "
|
|
67
|
-
shortDescription: "
|
|
68
|
-
workScope: {
|
|
69
|
-
uri: "at://did:plc:alice/org.hypercerts.claim.workscope/abc123",
|
|
70
|
-
cid: "...",
|
|
71
|
-
},
|
|
72
|
-
startDate: "2023-01-01T00:00:00Z",
|
|
73
|
-
endDate: "2023-12-31T23:59:59Z",
|
|
203
|
+
title: "Reforestation in Amazon Basin 2024",
|
|
204
|
+
shortDescription: "Planted 5,000 native trees across 12 hectares",
|
|
74
205
|
createdAt: new Date().toISOString(),
|
|
75
206
|
};
|
|
76
207
|
|
|
77
|
-
// Validate before
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
80
|
-
console.error("Validation failed:", validation.errors);
|
|
81
|
-
}
|
|
208
|
+
// Validate before writing
|
|
209
|
+
const result = validate(ACTIVITY_NSID, record);
|
|
210
|
+
if (!result.valid) throw new Error(JSON.stringify(result.errors));
|
|
82
211
|
|
|
212
|
+
// Write to the network
|
|
83
213
|
await agent.api.com.atproto.repo.createRecord({
|
|
84
214
|
repo: agent.session?.did,
|
|
85
215
|
collection: ACTIVITY_NSID,
|
|
86
|
-
record
|
|
216
|
+
record,
|
|
87
217
|
});
|
|
88
218
|
```
|
|
89
219
|
|
|
90
|
-
|
|
220
|
+
## Lexicon Reference
|
|
221
|
+
|
|
222
|
+
### Claims (`org.hypercerts.claim.*`)
|
|
223
|
+
|
|
224
|
+
| Lexicon | NSID | Description |
|
|
225
|
+
| --------------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
226
|
+
| **Activity** | `org.hypercerts.claim.activity` | The main hypercert record — describes impact work with title, description, contributors, work scope, timeframe, locations, and rights. |
|
|
227
|
+
| **Contribution** | `org.hypercerts.claim.contribution` | Details about a specific contribution: role, description, and timeframe. |
|
|
228
|
+
| **Contributor Information** | `org.hypercerts.claim.contributorInformation` | Identity record for a contributor: identifier (DID or URI), display name, and avatar. |
|
|
229
|
+
| **Rights** | `org.hypercerts.claim.rights` | Licensing and rights terms (e.g. "CC BY-SA 4.0") attached to an activity. |
|
|
230
|
+
|
|
231
|
+
### Collections (`org.hypercerts.*`)
|
|
232
|
+
|
|
233
|
+
| Lexicon | NSID | Description |
|
|
234
|
+
| -------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
235
|
+
| **Collection** | `org.hypercerts.collection` | A named, weighted group of activities and/or other collections. Supports recursive nesting. Used for projects, portfolios, favourites, funding rounds, etc. |
|
|
236
|
+
|
|
237
|
+
### Context (`org.hypercerts.context.*`)
|
|
238
|
+
|
|
239
|
+
| Lexicon | NSID | Description |
|
|
240
|
+
| ------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
241
|
+
| **Attachment** | `org.hypercerts.context.attachment` | Documents, reports, evidence, or other files linked to a record. |
|
|
242
|
+
| **Measurement** | `org.hypercerts.context.measurement` | Quantitative data point (metric + unit + value) linked to one or more records. |
|
|
243
|
+
| **Evaluation** | `org.hypercerts.context.evaluation` | An assessment of a record with evaluators, summary, score, and supporting measurements. |
|
|
244
|
+
| **Acknowledgement** | `org.hypercerts.context.acknowledgement` | Bidirectional link: confirms or rejects inclusion of a record in another context. |
|
|
245
|
+
|
|
246
|
+
### Work Scope (`org.hypercerts.workscope.*`)
|
|
247
|
+
|
|
248
|
+
| Lexicon | NSID | Description |
|
|
249
|
+
| ------------------ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
250
|
+
| **Tag** | `org.hypercerts.workscope.tag` | Reusable scope atom (topic, domain, method, …) with taxonomy support, aliases, and linked ontologies. |
|
|
251
|
+
| **CEL Expression** | `org.hypercerts.workscope.cel` | Structured work scope using [CEL](https://github.com/google/cel-spec) expressions over tags. Embedded inline in activity records. |
|
|
252
|
+
|
|
253
|
+
### Funding (`org.hypercerts.funding.*`)
|
|
254
|
+
|
|
255
|
+
| Lexicon | NSID | Description |
|
|
256
|
+
| ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
257
|
+
| **Receipt** | `org.hypercerts.funding.receipt` | Records a payment to a recipient, with amount, currency, payment rail, and optional transaction ID. The sender (`from`) is optional to support anonymous funders. |
|
|
91
258
|
|
|
92
|
-
|
|
259
|
+
### Hyperboards (`org.hyperboards.*`)
|
|
260
|
+
|
|
261
|
+
| Lexicon | NSID | Description |
|
|
262
|
+
| ------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
263
|
+
| **Board** | `org.hyperboards.board` | Visual presentation layer wrapping an activity or collection with background, colors, aspect ratio, and per-contributor styling. |
|
|
264
|
+
| **Display Profile** | `org.hyperboards.displayProfile` | Per-user visual defaults (avatar, hover image, video, click-through URL) reusable across boards. Singleton record (`literal:self`). |
|
|
265
|
+
|
|
266
|
+
### Certified (`app.certified.*`)
|
|
267
|
+
|
|
268
|
+
| Lexicon | NSID | Description |
|
|
269
|
+
| -------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
270
|
+
| **Location** | `app.certified.location` | Geographic reference using the [Location Protocol](https://spec.decentralizedgeo.org) (coordinates, GeoJSON, H3, WKT, etc.). |
|
|
271
|
+
| **Profile** | `app.certified.actor.profile` | User account profile with display name, bio, avatar, and banner. |
|
|
272
|
+
| **Organization** | `app.certified.actor.organization` | Organization metadata: legal structure, URLs, location, founding date. |
|
|
273
|
+
| **Badge Definition** | `app.certified.badge.definition` | Defines a badge type with title, icon, and optional issuer allowlist. |
|
|
274
|
+
| **Badge Award** | `app.certified.badge.award` | Awards a badge to a user, project, or activity. |
|
|
275
|
+
| **Badge Response** | `app.certified.badge.response` | Recipient accepts or rejects a badge award. |
|
|
276
|
+
| **EVM Link** | `app.certified.link.evm` | Verifiable ATProto DID ↔ EVM wallet link via EIP-712 signature. Extensible for future proof methods (e.g. ERC-1271, ERC-6492). |
|
|
277
|
+
|
|
278
|
+
> **Full property tables** → [SCHEMAS.md](SCHEMAS.md)
|
|
279
|
+
|
|
280
|
+
## Entity Relationship Diagram
|
|
281
|
+
|
|
282
|
+

|
|
283
|
+
|
|
284
|
+
<details>
|
|
285
|
+
<summary>View ERD with field details</summary>
|
|
286
|
+
|
|
287
|
+

|
|
288
|
+
|
|
289
|
+
</details>
|
|
290
|
+
|
|
291
|
+
## Usage
|
|
292
|
+
|
|
293
|
+
### Accessing NSIDs
|
|
294
|
+
|
|
295
|
+
Individual constants (recommended):
|
|
93
296
|
|
|
94
297
|
```typescript
|
|
95
298
|
import { ACTIVITY_NSID, COLLECTION_NSID } from "@hypercerts-org/lexicon";
|
|
96
|
-
|
|
97
|
-
// Clean and explicit
|
|
98
|
-
const record = {
|
|
99
|
-
$type: ACTIVITY_NSID,
|
|
100
|
-
// ...
|
|
101
|
-
};
|
|
102
299
|
```
|
|
103
300
|
|
|
104
|
-
|
|
301
|
+
Semantic object:
|
|
105
302
|
|
|
106
303
|
```typescript
|
|
107
304
|
import { HYPERCERTS_NSIDS } from "@hypercerts-org/lexicon";
|
|
108
305
|
|
|
109
|
-
|
|
110
|
-
const activityId = HYPERCERTS_NSIDS.ACTIVITY;
|
|
111
|
-
const collectionId = HYPERCERTS_NSIDS.COLLECTION;
|
|
112
|
-
const rightsId = HYPERCERTS_NSIDS.RIGHTS;
|
|
306
|
+
const id = HYPERCERTS_NSIDS.ACTIVITY;
|
|
113
307
|
```
|
|
114
308
|
|
|
115
|
-
|
|
309
|
+
Type-based mapping:
|
|
116
310
|
|
|
117
311
|
```typescript
|
|
118
312
|
import { HYPERCERTS_NSIDS_BY_TYPE } from "@hypercerts-org/lexicon";
|
|
119
313
|
|
|
120
|
-
|
|
121
|
-
const activityId = HYPERCERTS_NSIDS_BY_TYPE.OrgHypercertsClaimActivity;
|
|
122
|
-
const collectionId = HYPERCERTS_NSIDS_BY_TYPE.OrgHypercertsClaimCollection;
|
|
314
|
+
const id = HYPERCERTS_NSIDS_BY_TYPE.OrgHypercertsClaimActivity;
|
|
123
315
|
```
|
|
124
316
|
|
|
125
|
-
|
|
317
|
+
Lightweight bundle (no TypeScript types, smaller bundle):
|
|
126
318
|
|
|
127
319
|
```typescript
|
|
128
320
|
import { schemas, validate, ids } from "@hypercerts-org/lexicon/lexicons";
|
|
129
|
-
|
|
130
|
-
// Lighter bundle, type-based namespace access
|
|
131
|
-
const result = validate(ids.OrgHypercertsClaimActivity, record);
|
|
132
321
|
```
|
|
133
322
|
|
|
134
|
-
**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.
|
|
135
|
-
|
|
136
323
|
### TypeScript Types
|
|
137
324
|
|
|
138
|
-
All lexicon types are exported as namespaces:
|
|
139
|
-
|
|
140
325
|
```typescript
|
|
141
326
|
import { OrgHypercertsClaimActivity } from "@hypercerts-org/lexicon";
|
|
142
327
|
|
|
143
|
-
// Use the Main type
|
|
144
328
|
const activity: OrgHypercertsClaimActivity.Main = {
|
|
145
329
|
$type: "org.hypercerts.claim.activity",
|
|
146
330
|
title: "My Impact Work",
|
|
147
|
-
|
|
331
|
+
shortDescription: "...",
|
|
332
|
+
createdAt: new Date().toISOString(),
|
|
148
333
|
};
|
|
149
334
|
```
|
|
150
335
|
|
|
151
|
-
###
|
|
152
|
-
|
|
153
|
-
Each lexicon is available in two forms as individual constants:
|
|
336
|
+
### Lexicon Documents
|
|
154
337
|
|
|
155
338
|
```typescript
|
|
156
339
|
import {
|
|
157
|
-
//
|
|
158
|
-
|
|
159
|
-
RIGHTS_LEXICON_JSON,
|
|
160
|
-
|
|
161
|
-
// Typed LexiconDoc - from lexicons.get() at module initialization
|
|
162
|
-
ACTIVITY_LEXICON_DOC,
|
|
163
|
-
RIGHTS_LEXICON_DOC,
|
|
340
|
+
ACTIVITY_LEXICON_JSON, // raw JSON (untyped)
|
|
341
|
+
ACTIVITY_LEXICON_DOC, // LexiconDoc (typed)
|
|
164
342
|
} from "@hypercerts-org/lexicon";
|
|
165
343
|
```
|
|
166
344
|
|
|
167
|
-
|
|
168
|
-
| ------- | -------------------- | ------------------------- | ------------------------------ |
|
|
169
|
-
| `_JSON` | Untyped JSON | Direct JSON import | Raw schema data |
|
|
170
|
-
| `_DOC` | `LexiconDoc` (typed) | `lexicons.get()` instance | Type-safe lexicon manipulation |
|
|
171
|
-
|
|
172
|
-
Or access all lexicons via semantic mapping objects:
|
|
345
|
+
Or via semantic mapping objects:
|
|
173
346
|
|
|
174
347
|
```typescript
|
|
175
348
|
import {
|
|
@@ -177,126 +350,205 @@ import {
|
|
|
177
350
|
HYPERCERTS_LEXICON_DOC,
|
|
178
351
|
} from "@hypercerts-org/lexicon";
|
|
179
352
|
|
|
180
|
-
|
|
181
|
-
const activityJSON = HYPERCERTS_LEXICON_JSON.ACTIVITY;
|
|
182
|
-
const activityDoc = HYPERCERTS_LEXICON_DOC.ACTIVITY;
|
|
183
|
-
const rightsJSON = HYPERCERTS_LEXICON_JSON.RIGHTS;
|
|
184
|
-
const rightsDoc = HYPERCERTS_LEXICON_DOC.RIGHTS;
|
|
353
|
+
const doc = HYPERCERTS_LEXICON_DOC.ACTIVITY;
|
|
185
354
|
```
|
|
186
355
|
|
|
187
|
-
##
|
|
356
|
+
## Examples
|
|
188
357
|
|
|
189
|
-
|
|
190
|
-
property tables, see [SCHEMAS.md](SCHEMAS.md).
|
|
358
|
+
### Creating Activities with Work Scope
|
|
191
359
|
|
|
192
|
-
|
|
360
|
+
```typescript
|
|
361
|
+
import { ACTIVITY_NSID } from "@hypercerts-org/lexicon";
|
|
193
362
|
|
|
194
|
-
|
|
363
|
+
const activity = {
|
|
364
|
+
$type: ACTIVITY_NSID,
|
|
365
|
+
title: "Mangrove Restoration in Mombasa",
|
|
366
|
+
shortDescription: "Restored 3 hectares of mangrove forest",
|
|
367
|
+
// Structured work scope via CEL expression:
|
|
368
|
+
workScope: {
|
|
369
|
+
$type: "org.hypercerts.workscope.cel",
|
|
370
|
+
expression:
|
|
371
|
+
"scope.hasAll(['mangrove_restoration']) && location.country == 'KE'",
|
|
372
|
+
usedTags: [
|
|
373
|
+
{
|
|
374
|
+
uri: "at://did:plc:alice/org.hypercerts.workscope.tag/3k2abc",
|
|
375
|
+
cid: "...",
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
version: "v1",
|
|
379
|
+
createdAt: new Date().toISOString(),
|
|
380
|
+
},
|
|
381
|
+
startDate: "2024-01-01T00:00:00Z",
|
|
382
|
+
endDate: "2024-12-31T23:59:59Z",
|
|
383
|
+
createdAt: new Date().toISOString(),
|
|
384
|
+
};
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### Creating Collections (Projects, Portfolios, etc.)
|
|
195
388
|
|
|
196
389
|
```typescript
|
|
197
|
-
import {
|
|
390
|
+
import { COLLECTION_NSID } from "@hypercerts-org/lexicon";
|
|
198
391
|
|
|
199
|
-
const
|
|
200
|
-
$type:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
392
|
+
const project = {
|
|
393
|
+
$type: COLLECTION_NSID,
|
|
394
|
+
type: "project",
|
|
395
|
+
title: "Carbon Offset Initiative",
|
|
396
|
+
shortDescription: "Activities focused on carbon reduction and reforestation",
|
|
204
397
|
items: [
|
|
205
|
-
// Reference to an activity
|
|
206
398
|
{
|
|
207
|
-
|
|
208
|
-
|
|
399
|
+
itemIdentifier: {
|
|
400
|
+
uri: "at://did:plc:alice/org.hypercerts.claim.activity/3k2abc",
|
|
401
|
+
cid: "...",
|
|
402
|
+
},
|
|
209
403
|
},
|
|
210
|
-
// Reference to another activity
|
|
211
404
|
{
|
|
212
|
-
|
|
213
|
-
|
|
405
|
+
itemIdentifier: {
|
|
406
|
+
uri: "at://did:plc:bob/org.hypercerts.claim.activity/7x9def",
|
|
407
|
+
cid: "...",
|
|
408
|
+
},
|
|
214
409
|
},
|
|
215
|
-
//
|
|
410
|
+
// Collections can contain other collections (recursive nesting):
|
|
216
411
|
{
|
|
217
|
-
|
|
218
|
-
|
|
412
|
+
itemIdentifier: {
|
|
413
|
+
uri: "at://did:plc:carol/org.hypercerts.collection/4m5ghi",
|
|
414
|
+
cid: "...",
|
|
415
|
+
},
|
|
219
416
|
},
|
|
220
417
|
],
|
|
221
418
|
createdAt: new Date().toISOString(),
|
|
222
419
|
};
|
|
223
420
|
```
|
|
224
421
|
|
|
225
|
-
### Creating
|
|
422
|
+
### Creating Location Records
|
|
423
|
+
|
|
424
|
+
```typescript
|
|
425
|
+
import { LOCATION_NSID } from "@hypercerts-org/lexicon";
|
|
426
|
+
|
|
427
|
+
// Decimal coordinates
|
|
428
|
+
const location = {
|
|
429
|
+
$type: LOCATION_NSID,
|
|
430
|
+
lpVersion: "1.0",
|
|
431
|
+
srs: "http://www.opengis.net/def/crs/OGC/1.3/CRS84",
|
|
432
|
+
locationType: "coordinate-decimal",
|
|
433
|
+
location: { string: "-3.4653, -62.2159" },
|
|
434
|
+
name: "Amazon Research Station",
|
|
435
|
+
createdAt: new Date().toISOString(),
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
// GeoJSON
|
|
439
|
+
const geoLocation = {
|
|
440
|
+
$type: LOCATION_NSID,
|
|
441
|
+
lpVersion: "1.0",
|
|
442
|
+
srs: "http://www.opengis.net/def/crs/OGC/1.3/CRS84",
|
|
443
|
+
locationType: "geojson-point",
|
|
444
|
+
location: { string: '{"type":"Point","coordinates":[-62.2159,-3.4653]}' },
|
|
445
|
+
name: "Research Station Alpha",
|
|
446
|
+
createdAt: new Date().toISOString(),
|
|
447
|
+
};
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### Acknowledging Inclusion
|
|
226
451
|
|
|
227
|
-
|
|
228
|
-
|
|
452
|
+
When one user includes another's record (e.g. adding an activity to a
|
|
453
|
+
collection), the owner can confirm or reject with an acknowledgement:
|
|
229
454
|
|
|
230
455
|
```typescript
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
cid: "...",
|
|
456
|
+
import { ACKNOWLEDGEMENT_NSID } from "@hypercerts-org/lexicon";
|
|
457
|
+
|
|
458
|
+
const ack = {
|
|
459
|
+
$type: ACKNOWLEDGEMENT_NSID,
|
|
460
|
+
subject: {
|
|
461
|
+
uri: "at://did:plc:bob/org.hypercerts.claim.activity/3k2abc",
|
|
462
|
+
cid: "bafy...",
|
|
239
463
|
},
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
464
|
+
context: {
|
|
465
|
+
uri: "at://did:plc:alice/org.hypercerts.collection/7x9def",
|
|
466
|
+
cid: "bafy...",
|
|
467
|
+
},
|
|
468
|
+
acknowledged: true, // false to reject
|
|
469
|
+
createdAt: new Date().toISOString(),
|
|
470
|
+
};
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Creating Attachments
|
|
474
|
+
|
|
475
|
+
```typescript
|
|
476
|
+
import { ATTACHMENT_NSID } from "@hypercerts-org/lexicon";
|
|
477
|
+
|
|
478
|
+
const attachment = {
|
|
479
|
+
$type: ATTACHMENT_NSID,
|
|
480
|
+
title: "Field Survey Report",
|
|
481
|
+
contentType: "report",
|
|
482
|
+
subjects: [
|
|
245
483
|
{
|
|
246
|
-
uri: "at://did:plc:
|
|
484
|
+
uri: "at://did:plc:alice/org.hypercerts.claim.activity/abc123",
|
|
247
485
|
cid: "...",
|
|
248
486
|
},
|
|
249
487
|
],
|
|
488
|
+
content: [
|
|
489
|
+
{ uri: "https://example.com/reports/survey-2024.pdf" },
|
|
490
|
+
{ uri: "ipfs://Qm..." },
|
|
491
|
+
],
|
|
492
|
+
shortDescription: "Quarterly field survey documenting project progress",
|
|
250
493
|
createdAt: new Date().toISOString(),
|
|
251
494
|
};
|
|
252
495
|
```
|
|
253
496
|
|
|
254
|
-
|
|
255
|
-
"favorites", or any other collection type. The `description` field
|
|
256
|
-
supports rich-text via Leaflet linear documents.
|
|
497
|
+
## Development
|
|
257
498
|
|
|
258
|
-
###
|
|
499
|
+
### Commands
|
|
259
500
|
|
|
260
|
-
|
|
501
|
+
```bash
|
|
502
|
+
npm run gen-api # Regenerate TypeScript types from lexicons
|
|
503
|
+
npm run build # Build distributable bundles (ESM, CJS, types)
|
|
504
|
+
npm run check # Validate + typecheck + build (run before committing)
|
|
505
|
+
npm run lint # Check formatting (Prettier + ESLint)
|
|
506
|
+
npm run format # Auto-fix formatting
|
|
507
|
+
npm run gen-schemas-md # Regenerate SCHEMAS.md
|
|
508
|
+
npm run test # Run tests
|
|
509
|
+
```
|
|
261
510
|
|
|
262
|
-
|
|
263
|
-
import { COLLECTION_NSID } from "@hypercerts-org/lexicon";
|
|
511
|
+
### Linking ATProto Identity to EVM Wallets
|
|
264
512
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
513
|
+
The `app.certified.link.evm` record enables verifiable linking between
|
|
514
|
+
an ATProto DID and an EVM wallet address. The link is proven via a
|
|
515
|
+
cryptographic signature, allowing any verifier to confirm that the
|
|
516
|
+
wallet owner authorized the binding. Currently supports EOA wallets
|
|
517
|
+
via EIP-712 typed data signatures; the `proof` field is an open union
|
|
518
|
+
to allow future signature methods (e.g. ERC-1271, ERC-6492).
|
|
519
|
+
|
|
520
|
+
```typescript
|
|
521
|
+
import { LINK_EVM_NSID } from "@hypercerts-org/lexicon";
|
|
522
|
+
|
|
523
|
+
const evmLinkRecord = {
|
|
524
|
+
$type: LINK_EVM_NSID,
|
|
525
|
+
address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
|
|
526
|
+
proof: {
|
|
527
|
+
$type: "app.certified.link.evm#eip712Proof",
|
|
528
|
+
signature: "0xabc123...", // truncated for readability; real signatures are 130-132 hex chars
|
|
529
|
+
message: {
|
|
530
|
+
$type: "app.certified.link.evm#eip712Message",
|
|
531
|
+
did: "did:plc:alice",
|
|
532
|
+
evmAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
|
|
533
|
+
chainId: "1",
|
|
534
|
+
timestamp: "1709500000",
|
|
535
|
+
nonce: "0",
|
|
536
|
+
},
|
|
273
537
|
},
|
|
274
|
-
items: [
|
|
275
|
-
// ... collection items
|
|
276
|
-
],
|
|
277
538
|
createdAt: new Date().toISOString(),
|
|
278
539
|
};
|
|
279
540
|
```
|
|
280
541
|
|
|
281
|
-
**
|
|
282
|
-
are optional and support either embedded image blobs or URI references to
|
|
283
|
-
external images.
|
|
284
|
-
|
|
285
|
-
### Adding Locations to Activities
|
|
286
|
-
|
|
287
|
-
The `locations` field in activity records is an array of strong references
|
|
288
|
-
(`com.atproto.repo.strongRef`) pointing to `app.certified.location` records.
|
|
289
|
-
Each strong reference contains two required fields:
|
|
542
|
+
**Key fields:**
|
|
290
543
|
|
|
291
|
-
- `
|
|
292
|
-
|
|
544
|
+
- `address` (required): 0x-prefixed EVM wallet address (EIP-55
|
|
545
|
+
checksummed, 42 chars)
|
|
546
|
+
- `proof` (required): Open union containing the cryptographic proof of
|
|
547
|
+
wallet ownership. Each variant bundles its signature with the
|
|
548
|
+
corresponding message format. Currently the only variant is
|
|
549
|
+
`#eip712Proof` for EOA wallets.
|
|
550
|
+
- `createdAt` (required): Timestamp when the record was created
|
|
293
551
|
|
|
294
|
-
|
|
552
|
+
## License
|
|
295
553
|
|
|
296
|
-
|
|
297
|
-
`app.certified.location` lexicon schema
|
|
298
|
-
- The `uri` field must be a valid ATProto URI pointing to an existing location record
|
|
299
|
-
- The `cid` field must match the current CID of the referenced location record
|
|
300
|
-
- The `locations` field is optional; activities can be created without location data
|
|
301
|
-
- When using the sidecar pattern (same TID), ensure the location record is created
|
|
302
|
-
or updated alongside the activity record for consistency
|
|
554
|
+
MIT
|