@carrot-foundation/schemas 0.1.6
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/LICENSE +201 -0
- package/README.md +45 -0
- package/dist/index.js +1 -0
- package/dist/mass-id/index.js +2 -0
- package/dist/mass-id/mass-id.data.schema.js +346 -0
- package/dist/mass-id/mass-id.schema.js +162 -0
- package/dist/shared/base.schema.js +127 -0
- package/dist/shared/definitions.schema.js +283 -0
- package/dist/shared/entities/location.schema.js +68 -0
- package/dist/shared/entities/participant.schema.js +24 -0
- package/dist/shared/helpers.schema.js +16 -0
- package/dist/shared/nft.schema.js +193 -0
- package/package.json +89 -0
- package/schemas/ipfs/collection/collection.example.json +25 -0
- package/schemas/ipfs/collection/collection.schema.json +47 -0
- package/schemas/ipfs/credit/credit.example.json +27 -0
- package/schemas/ipfs/credit/credit.schema.json +61 -0
- package/schemas/ipfs/gas-id/gas-id.attributes.schema.json +219 -0
- package/schemas/ipfs/gas-id/gas-id.data.schema.json +120 -0
- package/schemas/ipfs/gas-id/gas-id.example.json +245 -0
- package/schemas/ipfs/gas-id/gas-id.schema.json +29 -0
- package/schemas/ipfs/mass-id/mass-id.example.json +318 -0
- package/schemas/ipfs/mass-id/mass-id.schema.json +1325 -0
- package/schemas/ipfs/mass-id-audit/mass-id-audit.data.schema.json +130 -0
- package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +291 -0
- package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +26 -0
- package/schemas/ipfs/methodology/methodology.data.schema.json +121 -0
- package/schemas/ipfs/methodology/methodology.example.json +222 -0
- package/schemas/ipfs/methodology/methodology.schema.json +26 -0
- package/schemas/ipfs/purchase-id/purchase-id.attributes.schema.json +91 -0
- package/schemas/ipfs/purchase-id/purchase-id.data.schema.json +337 -0
- package/schemas/ipfs/purchase-id/purchase-id.example.json +224 -0
- package/schemas/ipfs/purchase-id/purchase-id.schema.json +29 -0
- package/schemas/ipfs/recycled-id/recycled-id.attributes.schema.json +202 -0
- package/schemas/ipfs/recycled-id/recycled-id.data.schema.json +63 -0
- package/schemas/ipfs/recycled-id/recycled-id.example.json +213 -0
- package/schemas/ipfs/recycled-id/recycled-id.schema.json +29 -0
- package/schemas/ipfs/shared/base/base.schema.json +163 -0
- package/schemas/ipfs/shared/certificate/certificate.schema.json +145 -0
- package/schemas/ipfs/shared/definitions/definitions.schema.json +250 -0
- package/schemas/ipfs/shared/entities/location/location.schema.json +95 -0
- package/schemas/ipfs/shared/entities/participant/participant.schema.json +28 -0
- package/schemas/ipfs/shared/nft/nft.schema.json +182 -0
- package/schemas/ipfs/shared/references/audit-reference/audit-reference.schema.json +42 -0
- package/schemas/ipfs/shared/references/gas-id-reference/gas-id-reference.schema.json +27 -0
- package/schemas/ipfs/shared/references/mass-id-reference/mass-id-reference.schema.json +27 -0
- package/schemas/ipfs/shared/references/methodology-reference/methodology-reference.schema.json +34 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/nft/nft.schema.json",
|
|
4
|
+
"title": "Carrot NFT IPFS Record",
|
|
5
|
+
"description": "NFT-specific fields for Carrot IPFS records.",
|
|
6
|
+
"unevaluatedProperties": false,
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "../base/base.schema.json"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": [
|
|
14
|
+
"blockchain",
|
|
15
|
+
"name",
|
|
16
|
+
"short_name",
|
|
17
|
+
"description",
|
|
18
|
+
"image",
|
|
19
|
+
"attributes"
|
|
20
|
+
],
|
|
21
|
+
"properties": {
|
|
22
|
+
"schema": {
|
|
23
|
+
"properties": {
|
|
24
|
+
"type": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": ["MassID", "RecycledID", "GasID", "PurchaseID"],
|
|
27
|
+
"title": "NFT Metadata Type",
|
|
28
|
+
"description": "Type/category of this NFT schema.",
|
|
29
|
+
"example": "MassID"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"blockchain": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"title": "NFT Blockchain Information",
|
|
36
|
+
"description": "Blockchain-specific information for the NFT.",
|
|
37
|
+
"required": [
|
|
38
|
+
"smart_contract_address",
|
|
39
|
+
"chain_id",
|
|
40
|
+
"network_name",
|
|
41
|
+
"token_id"
|
|
42
|
+
],
|
|
43
|
+
"properties": {
|
|
44
|
+
"smart_contract_address": {
|
|
45
|
+
"$ref": "../definitions/definitions.schema.json#/$defs/ethereum_address",
|
|
46
|
+
"title": "Smart Contract Address"
|
|
47
|
+
},
|
|
48
|
+
"chain_id": {
|
|
49
|
+
"$ref": "../definitions/definitions.schema.json#/$defs/chain_id"
|
|
50
|
+
},
|
|
51
|
+
"network_name": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"title": "Blockchain Network Name",
|
|
54
|
+
"description": "Name of the blockchain network.",
|
|
55
|
+
"minLength": 5,
|
|
56
|
+
"maxLength": 100,
|
|
57
|
+
"example": "Polygon"
|
|
58
|
+
},
|
|
59
|
+
"token_id": {
|
|
60
|
+
"$ref": "../definitions/definitions.schema.json#/$defs/token_id"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"additionalProperties": false
|
|
64
|
+
},
|
|
65
|
+
"name": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"minLength": 1,
|
|
68
|
+
"maxLength": 100,
|
|
69
|
+
"title": "NFT Name",
|
|
70
|
+
"description": "Full display name for this NFT, including extra context.",
|
|
71
|
+
"example": "MassID #123 • Organic • 1.79t"
|
|
72
|
+
},
|
|
73
|
+
"short_name": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"minLength": 1,
|
|
76
|
+
"maxLength": 50,
|
|
77
|
+
"title": "NFT Short Name",
|
|
78
|
+
"description": "Compact name for UI summaries, tables, or tooltips.",
|
|
79
|
+
"example": "MassID #123"
|
|
80
|
+
},
|
|
81
|
+
"description": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"minLength": 10,
|
|
84
|
+
"maxLength": 500,
|
|
85
|
+
"title": "NFT Description",
|
|
86
|
+
"description": "Human-readable summary of the NFT's role and context. Ideally, maximum 300 characters.",
|
|
87
|
+
"example": "This MassID represents a recorded and traceable mass of organic waste."
|
|
88
|
+
},
|
|
89
|
+
"image": {
|
|
90
|
+
"$ref": "../definitions/definitions.schema.json#/$defs/ipfs_uri",
|
|
91
|
+
"title": "NFT Image",
|
|
92
|
+
"description": "IPFS URI pointing to the preview image."
|
|
93
|
+
},
|
|
94
|
+
"background_color": {
|
|
95
|
+
"$ref": "../definitions/definitions.schema.json#/$defs/hex_color",
|
|
96
|
+
"title": "NFT Background Color",
|
|
97
|
+
"description": "Hex color code for marketplace background display."
|
|
98
|
+
},
|
|
99
|
+
"animation_url": {
|
|
100
|
+
"$ref": "../definitions/definitions.schema.json#/$defs/ipfs_uri",
|
|
101
|
+
"title": "NFT Animation URL",
|
|
102
|
+
"description": "IPFS URI pointing to an animated or interactive media file."
|
|
103
|
+
},
|
|
104
|
+
"external_links": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"maxItems": 10,
|
|
107
|
+
"uniqueItems": true,
|
|
108
|
+
"title": "NFT External Links",
|
|
109
|
+
"description": "Optional list of public resource links with labels.",
|
|
110
|
+
"items": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"required": ["label", "url", "description"],
|
|
113
|
+
"properties": {
|
|
114
|
+
"label": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"minLength": 1,
|
|
117
|
+
"maxLength": 50,
|
|
118
|
+
"title": "NFT External Link Label",
|
|
119
|
+
"description": "Display name for the external link.",
|
|
120
|
+
"example": "View on Carrot Explorer"
|
|
121
|
+
},
|
|
122
|
+
"url": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"format": "uri",
|
|
125
|
+
"title": "NFT External Link URL",
|
|
126
|
+
"description": "Direct URI to the linked resource.",
|
|
127
|
+
"example": "https://explorer.carrot.eco/document/ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
|
|
128
|
+
},
|
|
129
|
+
"description": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"minLength": 10,
|
|
132
|
+
"maxLength": 100,
|
|
133
|
+
"title": "NFT External Link Description",
|
|
134
|
+
"description": "Optional context about what the link provides.",
|
|
135
|
+
"example": "Complete chain of custody and audit trail"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"additionalProperties": false
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"attributes": {
|
|
142
|
+
"type": "array",
|
|
143
|
+
"title": "NFT Attributes",
|
|
144
|
+
"description": "List of visual traits and filterable attributes compatible with NFT marketplaces.",
|
|
145
|
+
"items": {
|
|
146
|
+
"type": "object",
|
|
147
|
+
"required": ["trait_type", "value"],
|
|
148
|
+
"properties": {
|
|
149
|
+
"trait_type": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"maxLength": 50,
|
|
152
|
+
"description": "Name of the trait or attribute.",
|
|
153
|
+
"example": "Waste Type"
|
|
154
|
+
},
|
|
155
|
+
"value": {
|
|
156
|
+
"oneOf": [
|
|
157
|
+
{ "type": "string" },
|
|
158
|
+
{ "type": "number" },
|
|
159
|
+
{ "type": "boolean" }
|
|
160
|
+
],
|
|
161
|
+
"description": "Value of the trait - can be string, number, or boolean.",
|
|
162
|
+
"example": "Organic"
|
|
163
|
+
},
|
|
164
|
+
"display_type": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"enum": ["number", "date", "boost_number", "boost_percentage"],
|
|
167
|
+
"description": "How the trait should be displayed in marketplace UIs.",
|
|
168
|
+
"example": "number"
|
|
169
|
+
},
|
|
170
|
+
"max_value": {
|
|
171
|
+
"$ref": "../definitions/definitions.schema.json#/$defs/non_negative_float",
|
|
172
|
+
"description": "Maximum possible value for numeric traits.",
|
|
173
|
+
"example": 100.5
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"additionalProperties": false
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/references/audit-reference/audit-reference.schema.json",
|
|
4
|
+
"title": "Audit Reference",
|
|
5
|
+
"description": "Reference to Audit record.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"date",
|
|
9
|
+
"external_id",
|
|
10
|
+
"external_url",
|
|
11
|
+
"methodology_compliance",
|
|
12
|
+
"rules_executed",
|
|
13
|
+
"report"
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"date": {
|
|
17
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/iso_date",
|
|
18
|
+
"title": "Audit Date",
|
|
19
|
+
"description": "Date when the audit was completed"
|
|
20
|
+
},
|
|
21
|
+
"external_id": {
|
|
22
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/external_id"
|
|
23
|
+
},
|
|
24
|
+
"external_url": {
|
|
25
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/external_url",
|
|
26
|
+
"description": "URL to view the audit on Carrot Explorer"
|
|
27
|
+
},
|
|
28
|
+
"report": {
|
|
29
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/ipfs_uri",
|
|
30
|
+
"title": "Audit Report",
|
|
31
|
+
"description": "IPFS URI of the audit report"
|
|
32
|
+
},
|
|
33
|
+
"methodology_compliance": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"enum": ["PASSED", "FAILED"]
|
|
36
|
+
},
|
|
37
|
+
"rules_executed": {
|
|
38
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/non_negative_integer"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/references/gas-id-reference/gas-id-reference.schema.json",
|
|
4
|
+
"title": "GasID Reference",
|
|
5
|
+
"description": "Reference to a GasID record.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["external_id", "token_id", "external_url", "uri"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"external_id": {
|
|
10
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/external_id",
|
|
11
|
+
"description": "Unique identifier for the GasID."
|
|
12
|
+
},
|
|
13
|
+
"token_id": {
|
|
14
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/token_id",
|
|
15
|
+
"description": "NFT token ID of the GasID."
|
|
16
|
+
},
|
|
17
|
+
"external_url": {
|
|
18
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/external_url",
|
|
19
|
+
"description": "URL to view the GasID on Carrot Explorer."
|
|
20
|
+
},
|
|
21
|
+
"uri": {
|
|
22
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/ipfs_uri",
|
|
23
|
+
"description": "IPFS URI of the GasID record."
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"additionalProperties": false
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/references/mass-id-reference/mass-id-reference.schema.json",
|
|
4
|
+
"title": "MassID Reference",
|
|
5
|
+
"description": "Reference to a MassID record.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["external_id", "token_id", "external_url", "uri"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"external_id": {
|
|
10
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/external_id",
|
|
11
|
+
"description": "Unique identifier for the MassID."
|
|
12
|
+
},
|
|
13
|
+
"token_id": {
|
|
14
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/token_id",
|
|
15
|
+
"description": "NFT token ID of the MassID."
|
|
16
|
+
},
|
|
17
|
+
"external_url": {
|
|
18
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/external_url",
|
|
19
|
+
"description": "URL to view the MassID on Carrot Explorer."
|
|
20
|
+
},
|
|
21
|
+
"uri": {
|
|
22
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/ipfs_uri",
|
|
23
|
+
"description": "IPFS URI of the MassID record."
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"additionalProperties": false
|
|
27
|
+
}
|
package/schemas/ipfs/shared/references/methodology-reference/methodology-reference.schema.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/references/methodology-reference/methodology-reference.schema.json",
|
|
4
|
+
"title": "Methodology Reference",
|
|
5
|
+
"description": "Reference to a methodology record.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["external_id", "name", "version", "external_url"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"external_id": {
|
|
10
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/external_id",
|
|
11
|
+
"description": "Unique identifier for the methodology."
|
|
12
|
+
},
|
|
13
|
+
"name": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 5,
|
|
16
|
+
"maxLength": 150,
|
|
17
|
+
"description": "Human-readable name of the methodology.",
|
|
18
|
+
"example": "BOLD Carbon (CH₄)"
|
|
19
|
+
},
|
|
20
|
+
"version": {
|
|
21
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/semantic_version",
|
|
22
|
+
"description": "Version of the methodology."
|
|
23
|
+
},
|
|
24
|
+
"external_url": {
|
|
25
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/external_url",
|
|
26
|
+
"description": "URL to view the methodology on Carrot Explorer."
|
|
27
|
+
},
|
|
28
|
+
"uri": {
|
|
29
|
+
"$ref": "../../definitions/definitions.schema.json#/$defs/ipfs_uri",
|
|
30
|
+
"description": "IPFS URI to the methodology record."
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"additionalProperties": false
|
|
34
|
+
}
|