@carrot-foundation/schemas 0.2.3 → 0.2.4
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/dist/index.cjs +108 -173
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +108 -173
- package/dist/index.js.map +1 -1
- package/package.json +20 -20
- package/schemas/ipfs/collection/collection.example.json +3 -3
- package/schemas/ipfs/collection/collection.schema.json +75 -75
- package/schemas/ipfs/credit/credit.example.json +3 -3
- package/schemas/ipfs/credit/credit.schema.json +82 -82
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.example.json +4 -4
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json +394 -386
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.example.json +4 -4
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.schema.json +430 -422
- package/schemas/ipfs/gas-id/gas-id.example.json +4 -4
- package/schemas/ipfs/gas-id/gas-id.schema.json +419 -411
- package/schemas/ipfs/mass-id/mass-id.example.json +4 -4
- package/schemas/ipfs/mass-id/mass-id.schema.json +498 -494
- package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +3 -3
- package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +220 -212
- package/schemas/ipfs/methodology/methodology.example.json +3 -3
- package/schemas/ipfs/methodology/methodology.schema.json +121 -121
- package/schemas/ipfs/recycled-id/recycled-id.example.json +4 -4
- package/schemas/ipfs/recycled-id/recycled-id.schema.json +373 -365
- package/schemas/schema-hashes.json +10 -10
|
@@ -1,58 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"title": "Credit IPFS Record",
|
|
4
|
-
"description": "Credit token metadata stored in IPFS, extending the base schema with ERC20-specific details",
|
|
5
|
-
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.2.3/schemas/ipfs/credit/credit.schema.json",
|
|
6
|
-
"version": "0.2.3",
|
|
7
3
|
"type": "object",
|
|
8
4
|
"properties": {
|
|
9
5
|
"$schema": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"format": "uri",
|
|
10
8
|
"title": "JSON Schema URI",
|
|
11
9
|
"description": "URI of the JSON Schema used to validate this record",
|
|
12
|
-
"example": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/base/base.schema.json"
|
|
13
|
-
"type": "string",
|
|
14
|
-
"format": "uri"
|
|
10
|
+
"example": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/shared/base/base.schema.json"
|
|
15
11
|
},
|
|
16
12
|
"schema": {
|
|
17
13
|
"type": "object",
|
|
18
14
|
"properties": {
|
|
19
15
|
"hash": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^[0-9a-fA-F]{64}$",
|
|
20
18
|
"title": "Schema Hash",
|
|
21
19
|
"description": "SHA-256 hash of the JSON Schema this record was validated against",
|
|
22
20
|
"examples": [
|
|
23
21
|
"87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489"
|
|
24
|
-
]
|
|
25
|
-
"type": "string",
|
|
26
|
-
"pattern": "^[0-9a-fA-F]{64}$"
|
|
22
|
+
]
|
|
27
23
|
},
|
|
28
24
|
"type": {
|
|
29
|
-
"title": "Credit Schema Type",
|
|
30
|
-
"description": "Schema type identifier for this record",
|
|
31
25
|
"type": "string",
|
|
32
|
-
"const": "Credit"
|
|
26
|
+
"const": "Credit",
|
|
27
|
+
"title": "Credit Schema Type",
|
|
28
|
+
"description": "Schema type identifier for this record"
|
|
33
29
|
},
|
|
34
30
|
"version": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"pattern": "^v?\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?(\\+[a-zA-Z0-9.-]+)?$",
|
|
35
34
|
"title": "Schema Version",
|
|
36
35
|
"description": "Version of the schema, using semantic versioning",
|
|
37
36
|
"examples": [
|
|
38
37
|
"0.1.0",
|
|
39
38
|
"1.0.0",
|
|
40
39
|
"2.1.3"
|
|
41
|
-
]
|
|
42
|
-
"type": "string",
|
|
43
|
-
"minLength": 1,
|
|
44
|
-
"pattern": "^v?\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?(\\+[a-zA-Z0-9.-]+)?$"
|
|
40
|
+
]
|
|
45
41
|
},
|
|
46
42
|
"ipfs_uri": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"minLength": 1,
|
|
45
|
+
"pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
|
|
47
46
|
"title": "Schema IPFS URI",
|
|
48
47
|
"description": "IPFS URI for this JSON Schema when the primary schema URI is unavailable",
|
|
49
48
|
"examples": [
|
|
50
49
|
"ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
|
|
51
50
|
"ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
|
|
52
|
-
]
|
|
53
|
-
"type": "string",
|
|
54
|
-
"minLength": 1,
|
|
55
|
-
"pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
|
|
51
|
+
]
|
|
56
52
|
}
|
|
57
53
|
},
|
|
58
54
|
"required": [
|
|
@@ -64,99 +60,97 @@
|
|
|
64
60
|
"additionalProperties": false
|
|
65
61
|
},
|
|
66
62
|
"created_at": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"format": "date-time",
|
|
65
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
|
|
67
66
|
"title": "Created At",
|
|
68
67
|
"description": "ISO 8601 creation timestamp for this record",
|
|
69
68
|
"examples": [
|
|
70
69
|
"2024-12-05T11:02:47.000Z"
|
|
71
|
-
]
|
|
72
|
-
"type": "string",
|
|
73
|
-
"format": "date-time",
|
|
74
|
-
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
|
|
70
|
+
]
|
|
75
71
|
},
|
|
76
72
|
"external_id": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"format": "uuid",
|
|
75
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
|
|
77
76
|
"title": "External ID",
|
|
78
77
|
"description": "UUID identifier for external system references",
|
|
79
78
|
"examples": [
|
|
80
79
|
"ad44dd3f-f176-4b98-bf78-5ee6e77d0530"
|
|
81
|
-
]
|
|
82
|
-
"type": "string",
|
|
83
|
-
"format": "uuid",
|
|
84
|
-
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$"
|
|
80
|
+
]
|
|
85
81
|
},
|
|
86
82
|
"external_url": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"format": "uri",
|
|
87
85
|
"title": "External URL",
|
|
88
86
|
"description": "URL pointing to external resources",
|
|
89
87
|
"examples": [
|
|
90
88
|
"https://explore.carrot.eco/",
|
|
91
89
|
"https://whitepaper.carrot.eco/"
|
|
92
|
-
]
|
|
93
|
-
"type": "string",
|
|
94
|
-
"format": "uri"
|
|
90
|
+
]
|
|
95
91
|
},
|
|
96
92
|
"viewer_reference": {
|
|
97
|
-
"title": "Metadata Viewer Reference",
|
|
98
|
-
"description": "References to the metadata viewer dApp, including immutable and latest entry points",
|
|
99
93
|
"type": "object",
|
|
100
94
|
"properties": {
|
|
101
95
|
"ipfs_uri": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"minLength": 1,
|
|
98
|
+
"pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
|
|
102
99
|
"title": "Viewer IPFS URI",
|
|
103
100
|
"description": "IPFS URI of the metadata viewer dApp build",
|
|
104
101
|
"examples": [
|
|
105
102
|
"ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
|
|
106
103
|
"ipfs://bafybeihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku"
|
|
107
|
-
]
|
|
108
|
-
"type": "string",
|
|
109
|
-
"minLength": 1,
|
|
110
|
-
"pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
|
|
104
|
+
]
|
|
111
105
|
},
|
|
112
106
|
"integrity_hash": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"pattern": "^[0-9a-fA-F]{64}$",
|
|
113
109
|
"title": "Viewer Integrity Hash",
|
|
114
110
|
"description": "SHA-256 hash of the published viewer bundle to verify integrity",
|
|
115
111
|
"examples": [
|
|
116
112
|
"87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489"
|
|
117
|
-
]
|
|
118
|
-
"type": "string",
|
|
119
|
-
"pattern": "^[0-9a-fA-F]{64}$"
|
|
113
|
+
]
|
|
120
114
|
}
|
|
121
115
|
},
|
|
122
116
|
"required": [
|
|
123
117
|
"ipfs_uri",
|
|
124
118
|
"integrity_hash"
|
|
125
119
|
],
|
|
126
|
-
"additionalProperties": false
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"title": "Metadata Viewer Reference",
|
|
122
|
+
"description": "References to the metadata viewer dApp, including immutable and latest entry points"
|
|
127
123
|
},
|
|
128
124
|
"environment": {
|
|
129
|
-
"title": "Record Environment",
|
|
130
|
-
"description": "Environment information for the record",
|
|
131
125
|
"type": "object",
|
|
132
126
|
"properties": {
|
|
133
127
|
"blockchain_network": {
|
|
134
|
-
"title": "Blockchain Network",
|
|
135
|
-
"description": "Blockchain network where this record is deployed",
|
|
136
128
|
"type": "string",
|
|
137
129
|
"enum": [
|
|
138
130
|
"mainnet",
|
|
139
131
|
"testnet"
|
|
140
|
-
]
|
|
132
|
+
],
|
|
133
|
+
"title": "Blockchain Network",
|
|
134
|
+
"description": "Blockchain network where this record is deployed"
|
|
141
135
|
},
|
|
142
136
|
"deployment": {
|
|
143
|
-
"title": "Deployment Environment",
|
|
144
|
-
"description": "System environment where this record was generated",
|
|
145
137
|
"type": "string",
|
|
146
138
|
"enum": [
|
|
147
139
|
"production",
|
|
148
140
|
"development",
|
|
149
141
|
"testing"
|
|
150
|
-
]
|
|
142
|
+
],
|
|
143
|
+
"title": "Deployment Environment",
|
|
144
|
+
"description": "System environment where this record was generated"
|
|
151
145
|
},
|
|
152
146
|
"data_set_name": {
|
|
153
|
-
"title": "Data Set Name",
|
|
154
|
-
"description": "Name of the data set for this record",
|
|
155
147
|
"type": "string",
|
|
156
148
|
"enum": [
|
|
157
149
|
"TEST",
|
|
158
150
|
"PROD"
|
|
159
|
-
]
|
|
151
|
+
],
|
|
152
|
+
"title": "Data Set Name",
|
|
153
|
+
"description": "Name of the data set for this record"
|
|
160
154
|
}
|
|
161
155
|
},
|
|
162
156
|
"required": [
|
|
@@ -164,7 +158,9 @@
|
|
|
164
158
|
"deployment",
|
|
165
159
|
"data_set_name"
|
|
166
160
|
],
|
|
167
|
-
"additionalProperties": false
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"title": "Record Environment",
|
|
163
|
+
"description": "Environment information for the record"
|
|
168
164
|
},
|
|
169
165
|
"data": {
|
|
170
166
|
"title": "Custom Data",
|
|
@@ -176,73 +172,73 @@
|
|
|
176
172
|
"additionalProperties": {}
|
|
177
173
|
},
|
|
178
174
|
"symbol": {
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
"examples": [
|
|
175
|
+
"type": "string",
|
|
176
|
+
"enum": [
|
|
182
177
|
"C-CARB.CH4",
|
|
183
178
|
"C-BIOW"
|
|
184
179
|
],
|
|
185
|
-
"
|
|
186
|
-
"
|
|
180
|
+
"title": "Credit Token Symbol",
|
|
181
|
+
"description": "ERC20 token symbol identifier",
|
|
182
|
+
"examples": [
|
|
187
183
|
"C-CARB.CH4",
|
|
188
184
|
"C-BIOW"
|
|
189
185
|
]
|
|
190
186
|
},
|
|
191
187
|
"slug": {
|
|
192
|
-
"
|
|
193
|
-
"
|
|
194
|
-
"examples": [
|
|
188
|
+
"type": "string",
|
|
189
|
+
"enum": [
|
|
195
190
|
"carbon-methane",
|
|
196
191
|
"biowaste"
|
|
197
192
|
],
|
|
198
|
-
"
|
|
199
|
-
"
|
|
193
|
+
"title": "Credit Token Slug",
|
|
194
|
+
"description": "URL-friendly identifier for the credit token",
|
|
195
|
+
"examples": [
|
|
200
196
|
"carbon-methane",
|
|
201
197
|
"biowaste"
|
|
202
198
|
]
|
|
203
199
|
},
|
|
204
200
|
"name": {
|
|
205
|
-
"
|
|
206
|
-
"
|
|
207
|
-
"examples": [
|
|
201
|
+
"type": "string",
|
|
202
|
+
"enum": [
|
|
208
203
|
"Carrot Carbon (CH₄)",
|
|
209
204
|
"Carrot Biowaste"
|
|
210
205
|
],
|
|
211
|
-
"
|
|
212
|
-
"
|
|
206
|
+
"title": "Credit Token Name",
|
|
207
|
+
"description": "Human-readable display name for the credit token",
|
|
208
|
+
"examples": [
|
|
213
209
|
"Carrot Carbon (CH₄)",
|
|
214
210
|
"Carrot Biowaste"
|
|
215
211
|
]
|
|
216
212
|
},
|
|
217
213
|
"decimals": {
|
|
214
|
+
"type": "integer",
|
|
215
|
+
"minimum": 0,
|
|
216
|
+
"maximum": 18,
|
|
218
217
|
"title": "Token Decimals",
|
|
219
218
|
"description": "Number of decimal places for the ERC20 token",
|
|
220
219
|
"examples": [
|
|
221
220
|
18
|
|
222
|
-
]
|
|
223
|
-
"type": "integer",
|
|
224
|
-
"minimum": 0,
|
|
225
|
-
"maximum": 18
|
|
221
|
+
]
|
|
226
222
|
},
|
|
227
223
|
"image": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"minLength": 1,
|
|
226
|
+
"pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$",
|
|
228
227
|
"title": "Token Image",
|
|
229
228
|
"description": "IPFS URI pointing to the token's visual representation image",
|
|
230
229
|
"examples": [
|
|
231
230
|
"ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm"
|
|
232
|
-
]
|
|
233
|
-
"type": "string",
|
|
234
|
-
"minLength": 1,
|
|
235
|
-
"pattern": "^ipfs:\\/\\/(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|[bB][a-z2-7]{58,}|[zZ][1-9A-HJ-NP-Za-km-z]{48,})(?:\\/[^\\s]*)?$"
|
|
231
|
+
]
|
|
236
232
|
},
|
|
237
233
|
"description": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"minLength": 50,
|
|
236
|
+
"maxLength": 1000,
|
|
238
237
|
"title": "Token Description",
|
|
239
238
|
"description": "Comprehensive description of the credit token, its purpose, and impact",
|
|
240
239
|
"examples": [
|
|
241
240
|
"Carrot Carbon (C-CARB.CH4) represents verified carbon emissions reductions from organic waste composting projects. Each token equals one metric ton of CO2 equivalent prevented from entering the atmosphere through sustainable waste management practices."
|
|
242
|
-
]
|
|
243
|
-
"type": "string",
|
|
244
|
-
"minLength": 50,
|
|
245
|
-
"maxLength": 1000
|
|
241
|
+
]
|
|
246
242
|
}
|
|
247
243
|
},
|
|
248
244
|
"required": [
|
|
@@ -258,5 +254,9 @@
|
|
|
258
254
|
"image",
|
|
259
255
|
"description"
|
|
260
256
|
],
|
|
261
|
-
"additionalProperties": false
|
|
257
|
+
"additionalProperties": false,
|
|
258
|
+
"title": "Credit IPFS Record",
|
|
259
|
+
"description": "Credit token metadata stored in IPFS, extending the base schema with ERC20-specific details",
|
|
260
|
+
"$id": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.2.4/schemas/ipfs/credit/credit.schema.json",
|
|
261
|
+
"version": "0.2.4"
|
|
262
262
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.2.
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/0.2.4/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json",
|
|
3
3
|
"schema": {
|
|
4
|
-
"hash": "
|
|
4
|
+
"hash": "4c2acfb482d73246fc6bead2cbe0fe45c37d51ef6058eaba8da95501ec9a02e4",
|
|
5
5
|
"type": "CreditPurchaseReceipt",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.4",
|
|
7
7
|
"ipfs_uri": "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm"
|
|
8
8
|
},
|
|
9
9
|
"environment": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"created_at": "2025-02-03T12:45:30.000Z",
|
|
21
21
|
"external_id": "f1a2b3c4-d5e6-4789-9012-34567890abcd",
|
|
22
22
|
"external_url": "https://explore.carrot.eco/document/f1a2b3c4-d5e6-4789-9012-34567890abcd",
|
|
23
|
-
"audit_data_hash": "
|
|
23
|
+
"audit_data_hash": "c49a39d9a4a265669682b8a147e5ecb439e8f31a304298db05b14497f064691b",
|
|
24
24
|
"viewer_reference": {
|
|
25
25
|
"ipfs_uri": "ipfs://bafybeigdyrztvzl5cceubvaxob7iqh6f3f7s36c74ojav2xsz2uib2g3vm",
|
|
26
26
|
"integrity_hash": "87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489"
|