@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.
Files changed (47) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +45 -0
  3. package/dist/index.js +1 -0
  4. package/dist/mass-id/index.js +2 -0
  5. package/dist/mass-id/mass-id.data.schema.js +346 -0
  6. package/dist/mass-id/mass-id.schema.js +162 -0
  7. package/dist/shared/base.schema.js +127 -0
  8. package/dist/shared/definitions.schema.js +283 -0
  9. package/dist/shared/entities/location.schema.js +68 -0
  10. package/dist/shared/entities/participant.schema.js +24 -0
  11. package/dist/shared/helpers.schema.js +16 -0
  12. package/dist/shared/nft.schema.js +193 -0
  13. package/package.json +89 -0
  14. package/schemas/ipfs/collection/collection.example.json +25 -0
  15. package/schemas/ipfs/collection/collection.schema.json +47 -0
  16. package/schemas/ipfs/credit/credit.example.json +27 -0
  17. package/schemas/ipfs/credit/credit.schema.json +61 -0
  18. package/schemas/ipfs/gas-id/gas-id.attributes.schema.json +219 -0
  19. package/schemas/ipfs/gas-id/gas-id.data.schema.json +120 -0
  20. package/schemas/ipfs/gas-id/gas-id.example.json +245 -0
  21. package/schemas/ipfs/gas-id/gas-id.schema.json +29 -0
  22. package/schemas/ipfs/mass-id/mass-id.example.json +318 -0
  23. package/schemas/ipfs/mass-id/mass-id.schema.json +1325 -0
  24. package/schemas/ipfs/mass-id-audit/mass-id-audit.data.schema.json +130 -0
  25. package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +291 -0
  26. package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +26 -0
  27. package/schemas/ipfs/methodology/methodology.data.schema.json +121 -0
  28. package/schemas/ipfs/methodology/methodology.example.json +222 -0
  29. package/schemas/ipfs/methodology/methodology.schema.json +26 -0
  30. package/schemas/ipfs/purchase-id/purchase-id.attributes.schema.json +91 -0
  31. package/schemas/ipfs/purchase-id/purchase-id.data.schema.json +337 -0
  32. package/schemas/ipfs/purchase-id/purchase-id.example.json +224 -0
  33. package/schemas/ipfs/purchase-id/purchase-id.schema.json +29 -0
  34. package/schemas/ipfs/recycled-id/recycled-id.attributes.schema.json +202 -0
  35. package/schemas/ipfs/recycled-id/recycled-id.data.schema.json +63 -0
  36. package/schemas/ipfs/recycled-id/recycled-id.example.json +213 -0
  37. package/schemas/ipfs/recycled-id/recycled-id.schema.json +29 -0
  38. package/schemas/ipfs/shared/base/base.schema.json +163 -0
  39. package/schemas/ipfs/shared/certificate/certificate.schema.json +145 -0
  40. package/schemas/ipfs/shared/definitions/definitions.schema.json +250 -0
  41. package/schemas/ipfs/shared/entities/location/location.schema.json +95 -0
  42. package/schemas/ipfs/shared/entities/participant/participant.schema.json +28 -0
  43. package/schemas/ipfs/shared/nft/nft.schema.json +182 -0
  44. package/schemas/ipfs/shared/references/audit-reference/audit-reference.schema.json +42 -0
  45. package/schemas/ipfs/shared/references/gas-id-reference/gas-id-reference.schema.json +27 -0
  46. package/schemas/ipfs/shared/references/mass-id-reference/mass-id-reference.schema.json +27 -0
  47. package/schemas/ipfs/shared/references/methodology-reference/methodology-reference.schema.json +34 -0
@@ -0,0 +1,120 @@
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/gas-id/gas-id.data.schema.json",
4
+ "title": "GasID Data",
5
+ "type": "object",
6
+ "required": [
7
+ "summary",
8
+ "methodology",
9
+ "audit",
10
+ "mass_id",
11
+ "waste_classification",
12
+ "origin_location",
13
+ "prevented_emissions_calculation",
14
+ "accredited_participants"
15
+ ],
16
+ "properties": {
17
+ "summary": {
18
+ "type": "object",
19
+ "required": [
20
+ "gas_type",
21
+ "credit_type",
22
+ "credit_amount",
23
+ "prevented_co2e_kg"
24
+ ],
25
+ "properties": {
26
+ "gas_type": {
27
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
28
+ "title": "Gas Type",
29
+ "description": "Type of gas prevented"
30
+ },
31
+ "credit_type": {
32
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
33
+ "title": "Credit Type",
34
+ "description": "Type of credit issued"
35
+ },
36
+ "credit_amount": {
37
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_negative_float",
38
+ "title": "Credit Amount",
39
+ "description": "Amount of credits issued"
40
+ },
41
+ "prevented_co2e_kg": {
42
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/weight_kg",
43
+ "title": "Prevented Emissions (CO₂e kg)",
44
+ "description": "CO₂e weight of the prevented emissions"
45
+ }
46
+ },
47
+ "additionalProperties": false
48
+ },
49
+ "methodology": {
50
+ "$ref": "../shared/references/methodology-reference/methodology-reference.schema.json"
51
+ },
52
+ "audit": {
53
+ "$ref": "../shared/references/audit-reference/audit-reference.schema.json"
54
+ },
55
+ "mass_id": {
56
+ "$ref": "../shared/references/mass-id-reference/mass-id-reference.schema.json"
57
+ },
58
+ "waste_classification": {
59
+ "$ref": "../shared/certificate/certificate.schema.json#/$defs/waste_classification"
60
+ },
61
+ "origin_location": {
62
+ "$ref": "../shared/entities/location/location.schema.json",
63
+ "title": "Source Waste Origin Location",
64
+ "description": "Location of the waste origin"
65
+ },
66
+ "prevented_emissions_calculation": {
67
+ "type": "object",
68
+ "required": ["formula", "method", "date", "values"],
69
+ "properties": {
70
+ "formula": {
71
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
72
+ "title": "Calculation Formula",
73
+ "description": "Formula used to calculate the prevented emissions",
74
+ "maxLength": 100
75
+ },
76
+ "method": {
77
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
78
+ "title": "Calculation Method",
79
+ "description": "Method used to calculate the prevented emissions",
80
+ "maxLength": 100
81
+ },
82
+ "date": {
83
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/iso_date",
84
+ "title": "Calculation Date",
85
+ "description": "Date when the calculation was performed"
86
+ },
87
+ "values": {
88
+ "type": "array",
89
+ "title": "Calculation Values",
90
+ "description": "Values used to calculate the prevented emissions",
91
+ "items": {
92
+ "type": "object",
93
+ "required": ["reference", "value", "label"],
94
+ "properties": {
95
+ "reference": {
96
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
97
+ "maxLength": 3
98
+ },
99
+ "value": {
100
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_negative_float"
101
+ },
102
+ "label": {
103
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
104
+ "maxLength": 100
105
+ }
106
+ }
107
+ }
108
+ }
109
+ },
110
+ "additionalProperties": false
111
+ },
112
+ "accredited_participants": {
113
+ "$ref": "../shared/certificate/certificate.schema.json#/$defs/accredited_participants"
114
+ },
115
+ "participant_rewards": {
116
+ "$ref": "../shared/certificate/certificate.schema.json#/$defs/participant_rewards"
117
+ }
118
+ },
119
+ "additionalProperties": false
120
+ }
@@ -0,0 +1,245 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/gas-id/gas-id.schema.json",
3
+ "schema": {
4
+ "hash": "0xa1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456",
5
+ "type": "GasID",
6
+ "version": "v0.1.0"
7
+ },
8
+ "environment": {
9
+ "blockchain_network": "mainnet",
10
+ "deployment": "production",
11
+ "data_set_name": "TEST"
12
+ },
13
+ "blockchain": {
14
+ "smart_contract_address": "0x742d35cc6634c0532925a3b8d8b5c2d4c7f8e1a9",
15
+ "chain_id": 1,
16
+ "network_name": "Ethereum Mainnet",
17
+ "token_id": "456"
18
+ },
19
+ "created_at": "2025-06-24T13:02:25.000Z",
20
+ "external_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
21
+ "external_url": "https://explore.carrot.eco/document/f47ac10b-58cc-4372-a567-0e02b2c3d479",
22
+ "content_hash": "a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456",
23
+ "creator": {
24
+ "name": "Carrot Foundation",
25
+ "id": "1f060fa2-7b80-462f-888d-253a79912717"
26
+ },
27
+ "name": "GasID #456 • BOLD Carbon (CH₄) • 2.09t CO₂e",
28
+ "short_name": "GasID #456",
29
+ "description": "This GasID certifies 2.09 metric tons of CO₂e emissions prevented through BOLD Carbon (CH₄) methodology composting of 3 metric tons of organic waste from Macapá, Brazil.",
30
+ "image": "ipfs://QmGasIdHash456/gas-id-bold-carbon.png",
31
+ "background_color": "#1B4332",
32
+ "external_links": [
33
+ {
34
+ "label": "View on Carrot Explorer",
35
+ "url": "https://explore.carrot.eco/document/f47ac10b-58cc-4372-a567-0e02b2c3d479",
36
+ "description": "Complete GasID details and audit trail"
37
+ },
38
+ {
39
+ "label": "MassID",
40
+ "url": "https://explore.carrot.eco/document/6f520d88-864d-432d-bf9f-5c3166c4818f",
41
+ "description": "Originating waste batch with full chain of custody"
42
+ },
43
+ {
44
+ "label": "BOLD Carbon (CH₄) Methodology",
45
+ "url": "https://explore.carrot.eco/document/bold-carbon-ch4",
46
+ "description": "Complete methodology specification and rules"
47
+ },
48
+ {
49
+ "label": "Carrot White Paper",
50
+ "url": "https://carrot.eco/whitepaper",
51
+ "description": "Carrot ecosystem overview and technical foundation"
52
+ }
53
+ ],
54
+ "attributes": [
55
+ {
56
+ "trait_type": "Methodology",
57
+ "value": "BOLD Carbon (CH₄)"
58
+ },
59
+ {
60
+ "trait_type": "Gas Type",
61
+ "value": "Methane (CH₄)"
62
+ },
63
+ {
64
+ "trait_type": "CO₂e Prevented (kg)",
65
+ "value": 2089.74,
66
+ "display_type": "number"
67
+ },
68
+ {
69
+ "trait_type": "Credit Amount",
70
+ "value": 2.08974,
71
+ "display_type": "number"
72
+ },
73
+ {
74
+ "trait_type": "Credit Type",
75
+ "value": "Carrot Carbon"
76
+ },
77
+ {
78
+ "trait_type": "Source Waste Type",
79
+ "value": "Organic"
80
+ },
81
+ {
82
+ "trait_type": "Source Weight (kg)",
83
+ "value": 3000,
84
+ "display_type": "number"
85
+ },
86
+ {
87
+ "trait_type": "Origin Country",
88
+ "value": "Brazil"
89
+ },
90
+ {
91
+ "trait_type": "Origin Municipality",
92
+ "value": "Macapá"
93
+ },
94
+ {
95
+ "trait_type": "Recycler",
96
+ "value": "Eco Reciclagem"
97
+ },
98
+ {
99
+ "trait_type": "MassID",
100
+ "value": "#123"
101
+ },
102
+ {
103
+ "trait_type": "MassID Recycling Date",
104
+ "value": "2025-02-22",
105
+ "display_type": "date"
106
+ }
107
+ ],
108
+ "data": {
109
+ "summary": {
110
+ "gas_type": "Methane (CH₄)",
111
+ "credit_type": "Carrot Carbon (C-CARB)",
112
+ "credit_amount": 0.85615,
113
+ "prevented_co2e_kg": 856.15012
114
+ },
115
+ "methodology": {
116
+ "external_id": "f47ac10b-58cc-4372-a567-0e02b2c3d480",
117
+ "name": "BOLD Carbon (CH₄)",
118
+ "version": "1.3.0",
119
+ "external_url": "https://explore.carrot.eco/document/f47ac10b-58cc-4372-a567-0e02b2c3d480",
120
+ "uri": "ipfs://QmMethodologyHash/bold-carbon-ch4-v1.3.0.pdf"
121
+ },
122
+ "audit": {
123
+ "date": "2025-06-24",
124
+ "external_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
125
+ "external_url": "https://explore.carrot.eco/document/a1b2c3d4-e5f6-7890-1234-567890abcdef",
126
+ "methodology_compliance": "PASSED",
127
+ "rules_executed": 21,
128
+ "report": "ipfs://QmVerificationHash/mass-id-audit.json"
129
+ },
130
+ "mass_id": {
131
+ "external_id": "6f520d88-864d-432d-bf9f-5c3166c4818f",
132
+ "token_id": "123",
133
+ "external_url": "https://explore.carrot.eco/document/6f520d88-864d-432d-bf9f-5c3166c4818f",
134
+ "uri": "ipfs://QmYx8FdKl2mN9pQ7rS6tV8wB3cE4fG5hI9jK0lM1nO2pQ3r/mass-id.json"
135
+ },
136
+ "waste_classification": {
137
+ "primary_type": "Organic",
138
+ "subtype": "Food, Food Waste and Beverages",
139
+ "net_weight_kg": 3000
140
+ },
141
+ "origin_location": {
142
+ "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
143
+ "municipality": "Macapá",
144
+ "administrative_division": "Amapá",
145
+ "administrative_division_code": "BR-AP",
146
+ "country": "Brazil",
147
+ "country_code": "BR",
148
+ "coordinates": {
149
+ "latitude": -0.034934,
150
+ "longitude": -51.07045,
151
+ "precision_level": "city"
152
+ },
153
+ "facility_type": "Waste Generation",
154
+ "responsible_participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf"
155
+ },
156
+ "prevented_emissions_calculation": {
157
+ "formula": "(1 - B) * W * E = R",
158
+ "method": "UNFCCC AMS-III.F",
159
+ "date": "2025-06-24",
160
+ "values": [
161
+ {
162
+ "reference": "E",
163
+ "value": 0.029,
164
+ "label": "Exceeding Emission Coefficient"
165
+ },
166
+ {
167
+ "reference": "B",
168
+ "value": 0.067,
169
+ "label": "Prevented Emissions by Waste Subtype and Baseline Per Ton"
170
+ },
171
+ {
172
+ "reference": "W",
173
+ "value": 13160,
174
+ "label": "Waste Weight"
175
+ },
176
+ {
177
+ "reference": "R",
178
+ "value": 856.15012,
179
+ "label": "Prevented Emissions (CO₂e kg)"
180
+ }
181
+ ]
182
+ },
183
+ "accredited_participants": [
184
+ {
185
+ "participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
186
+ "name": "Eco Reciclagem",
187
+ "role": "Recycler",
188
+ "accreditation_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
189
+ "external_url": "https://explore.carrot.eco/document/acc-5021ea45-5b35-4749-8a85-83dc0c6f7cbf"
190
+ },
191
+ {
192
+ "participant_id": "6f520d88-864d-432d-bf9f-5c3166c4818f",
193
+ "name": "Enlatados Produção",
194
+ "role": "Waste Generator",
195
+ "accreditation_id": "6f520d88-864d-432d-bf9f-5c3166c4818f",
196
+ "external_url": "https://explore.carrot.eco/document/acc-6f520d88-864d-432d-bf9f-5c3166c4818f"
197
+ }
198
+ ],
199
+ "participant_rewards": {
200
+ "distribution_basis": "BOLD Carbon (CH₄) methodology rewards calculation",
201
+ "reward_allocations": [
202
+ {
203
+ "participant_id": "6f520d88-864d-432d-bf9f-5c3166c4818f",
204
+ "participant_name": "Enlatados Produção",
205
+ "role": "Waste Generator",
206
+ "reward_percentage": 25.0,
207
+ "large_business_discount_applied": true,
208
+ "effective_percentage": 12.5
209
+ },
210
+ {
211
+ "participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
212
+ "participant_name": "Eco Reciclagem",
213
+ "role": "Hauler",
214
+ "reward_percentage": 20.0,
215
+ "effective_percentage": 20.0
216
+ },
217
+ {
218
+ "participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
219
+ "participant_name": "Eco Reciclagem",
220
+ "role": "Processor",
221
+ "reward_percentage": 15.0,
222
+ "effective_percentage": 15.0
223
+ },
224
+ {
225
+ "participant_id": "5021ea45-5b35-4749-8a85-83dc0c6f7cbf",
226
+ "participant_name": "Eco Reciclagem",
227
+ "role": "Recycler",
228
+ "reward_percentage": 25.0,
229
+ "effective_percentage": 25.0
230
+ },
231
+ {
232
+ "participant_id": "e710790f-5909-4a54-ab89-6a59819472ee",
233
+ "participant_name": "Carrot Foundation",
234
+ "role": "Network Integrator",
235
+ "reward_percentage": 15.0,
236
+ "effective_percentage": 15.0
237
+ }
238
+ ],
239
+ "distribution_notes": {
240
+ "large_business_discount_applied": "50% reduction applied to participants with >$4M annual revenue",
241
+ "redirected_rewards": "Discounted rewards from large businesses redirected to accredited NGOs"
242
+ }
243
+ }
244
+ }
245
+ }
@@ -0,0 +1,29 @@
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/gas-id/gas-id.schema.json",
4
+ "title": "GasID NFT IPFS Record",
5
+ "unevaluatedProperties": false,
6
+ "allOf": [
7
+ {
8
+ "$ref": "../shared/nft/nft.schema.json"
9
+ },
10
+ {
11
+ "type": "object",
12
+ "properties": {
13
+ "schema": {
14
+ "properties": {
15
+ "type": {
16
+ "const": "GasID"
17
+ }
18
+ }
19
+ },
20
+ "attributes": {
21
+ "$ref": "./gas-id.attributes.schema.json"
22
+ },
23
+ "data": {
24
+ "$ref": "./gas-id.data.schema.json"
25
+ }
26
+ }
27
+ }
28
+ ]
29
+ }