@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,193 @@
1
+ import { z } from 'zod';
2
+ import { BaseIpfsSchema } from './base.schema.js';
3
+ import { EthereumAddressSchema, BlockchainChainIdSchema, TokenIdSchema, IpfsUriSchema, HexColorSchema, NonNegativeFloatSchema, RecordSchemaTypeSchema, } from './definitions.schema.js';
4
+ import { uniqueBy } from './helpers.schema.js';
5
+ const NftSchemaTypeSchema = RecordSchemaTypeSchema.extract([
6
+ 'MassID',
7
+ 'RecycledID',
8
+ 'GasID',
9
+ 'PurchaseID',
10
+ ]).meta({
11
+ title: 'NFT Schema Type',
12
+ description: 'Type of schema for NFT records',
13
+ });
14
+ const BlockchainReferenceSchema = z
15
+ .strictObject({
16
+ smart_contract_address: EthereumAddressSchema.meta({
17
+ title: 'Smart Contract Address',
18
+ }),
19
+ chain_id: BlockchainChainIdSchema.meta({
20
+ title: 'Chain ID',
21
+ description: 'Blockchain chain ID',
22
+ }),
23
+ network_name: z.string().min(5).max(100).meta({
24
+ title: 'Network Name',
25
+ description: 'Name of the blockchain network',
26
+ }),
27
+ token_id: TokenIdSchema.meta({
28
+ title: 'Token ID',
29
+ description: 'NFT token ID',
30
+ }),
31
+ })
32
+ .meta({
33
+ title: 'Blockchain Information',
34
+ description: 'Blockchain-specific information for the NFT',
35
+ });
36
+ const ExternalLinkSchema = z
37
+ .strictObject({
38
+ label: z.string().min(1).max(50).meta({
39
+ title: 'Link Label',
40
+ description: 'Display name for the external link',
41
+ }),
42
+ url: z.url('Must be a valid URI').meta({
43
+ title: 'Link URL',
44
+ description: 'Direct URI to the linked resource',
45
+ }),
46
+ description: z.string().min(10).max(100).optional().meta({
47
+ title: 'Link Description',
48
+ description: 'Optional context about what the link provides',
49
+ }),
50
+ })
51
+ .meta({
52
+ title: 'External Link',
53
+ description: 'External link with label and description',
54
+ });
55
+ const NftAttributeSchema = z
56
+ .strictObject({
57
+ trait_type: z.string().max(50).meta({
58
+ title: 'Trait Type',
59
+ description: 'Name of the trait or attribute',
60
+ }),
61
+ value: z.union([z.string(), z.number(), z.boolean()]).meta({
62
+ title: 'Trait Value',
63
+ description: 'Value of the trait - can be string, number, or boolean',
64
+ }),
65
+ display_type: z
66
+ .enum(['number', 'date', 'boost_number', 'boost_percentage'])
67
+ .optional()
68
+ .meta({
69
+ title: 'Display Type',
70
+ description: 'How the trait should be displayed in marketplace UIs',
71
+ }),
72
+ max_value: NonNegativeFloatSchema.optional().meta({
73
+ title: 'Max Value',
74
+ description: 'Maximum possible value for numeric traits',
75
+ }),
76
+ })
77
+ .meta({
78
+ title: 'NFT Attribute',
79
+ description: 'NFT attribute or trait with type and value',
80
+ });
81
+ export const NftIpfsSchema = BaseIpfsSchema.safeExtend({
82
+ schema: BaseIpfsSchema.shape.schema.safeExtend({
83
+ type: NftSchemaTypeSchema.meta({
84
+ title: 'NFT Schema Type',
85
+ description: 'Type/category of this NFT schema',
86
+ }),
87
+ }),
88
+ blockchain: BlockchainReferenceSchema,
89
+ name: z
90
+ .string()
91
+ .min(1)
92
+ .max(100)
93
+ .meta({
94
+ title: 'NFT Name',
95
+ description: 'Full display name for this NFT, including extra context',
96
+ examples: [
97
+ 'MassID #123 • Organic • 3.0t',
98
+ 'RecycledID #456 • Plastic • 2.5t',
99
+ 'GasID #789 • Methane • 1000 m³',
100
+ ],
101
+ }),
102
+ short_name: z
103
+ .string()
104
+ .min(1)
105
+ .max(50)
106
+ .meta({
107
+ title: 'Short Name',
108
+ description: 'Compact name for UI summaries, tables, or tooltips',
109
+ examples: ['MassID #123', 'RecycledID #456', 'GasID #789'],
110
+ }),
111
+ description: z
112
+ .string()
113
+ .min(10)
114
+ .max(500)
115
+ .meta({
116
+ title: 'Description',
117
+ description: "Human-readable summary of the NFT's role and context. Ideally, maximum 300 characters.",
118
+ examples: [
119
+ 'This MassID represents 3 metric tons of organic food waste from Enlatados Produção, tracked through complete chain of custody from generation to composting.',
120
+ 'This RecycledID represents 2.5 metric tons of recycled plastic bottles processed by Green Solutions Ltd.',
121
+ ],
122
+ }),
123
+ image: IpfsUriSchema.meta({
124
+ title: 'Image URI',
125
+ description: 'IPFS URI pointing to the preview image',
126
+ }),
127
+ background_color: HexColorSchema.optional().meta({
128
+ title: 'Background Color',
129
+ description: 'Hex color code for marketplace background display',
130
+ }),
131
+ animation_url: IpfsUriSchema.optional().meta({
132
+ title: 'Animation URL',
133
+ description: 'IPFS URI pointing to an animated or interactive media file',
134
+ examples: [
135
+ 'ipfs://QmAnimation123/mass-id-animation.mp4',
136
+ 'ipfs://QmInteractive456/recycled-visualization.webm',
137
+ ],
138
+ }),
139
+ external_links: uniqueBy(ExternalLinkSchema, (link) => link.url, 'External link URLs must be unique')
140
+ .max(10)
141
+ .optional()
142
+ .meta({
143
+ title: 'External Links',
144
+ description: 'Optional list of public resource links with labels',
145
+ examples: [
146
+ [
147
+ {
148
+ label: 'Carrot Explorer',
149
+ url: 'https://explore.carrot.eco/document/ad44dd3f-f176-4b98-bf78-5ee6e77d0530',
150
+ description: 'Complete chain of custody and audit trail',
151
+ },
152
+ {
153
+ label: 'Carrot White Paper',
154
+ url: 'https://carrot.eco/whitepaper.pdf',
155
+ description: 'Carrot Foundation technical and impact white paper',
156
+ },
157
+ ],
158
+ ],
159
+ }),
160
+ attributes: uniqueBy(NftAttributeSchema, (attr) => attr.trait_type, 'Attribute trait_type values must be unique').meta({
161
+ title: 'NFT Attributes',
162
+ description: 'List of visual traits and filterable attributes compatible with NFT marketplaces',
163
+ examples: [
164
+ [
165
+ {
166
+ trait_type: 'Waste Type',
167
+ value: 'Organic',
168
+ },
169
+ {
170
+ trait_type: 'Waste Subtype',
171
+ value: 'Food, Food Waste and Beverages',
172
+ },
173
+ {
174
+ trait_type: 'Weight (kg)',
175
+ value: 3000,
176
+ display_type: 'number',
177
+ },
178
+ {
179
+ trait_type: 'Origin Country',
180
+ value: 'Brazil',
181
+ },
182
+ {
183
+ trait_type: 'Pick-up Date',
184
+ value: '2024-12-05',
185
+ display_type: 'date',
186
+ },
187
+ ],
188
+ ],
189
+ }),
190
+ }).meta({
191
+ title: 'NFT IPFS Record',
192
+ description: 'NFT-specific fields for Carrot IPFS records',
193
+ });
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@carrot-foundation/schemas",
3
+ "version": "0.1.6",
4
+ "description": "Carrot schema definitions and zod validation schemas",
5
+ "license": "Apache-2.0",
6
+ "private": false,
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.js",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "./schemas/*": {
18
+ "import": "./schemas/*",
19
+ "require": "./schemas/*",
20
+ "default": "./schemas/*"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist/**/*",
25
+ "schemas/**/*"
26
+ ],
27
+ "packageManager": "pnpm@10.14.0",
28
+ "engines": {
29
+ "node": ">=22"
30
+ },
31
+ "keywords": [
32
+ "carrot",
33
+ "ipfs",
34
+ "schema",
35
+ "validation",
36
+ "zod",
37
+ "typescript",
38
+ "blockchain",
39
+ "json-schema"
40
+ ],
41
+ "author": "Carrot Foundation",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/carrot-foundation/schemas.git"
45
+ },
46
+ "scripts": {
47
+ "build": "tsc",
48
+ "check-refs": "node scripts/check-refs.js",
49
+ "clean": "rm -rf dist",
50
+ "generate-ipfs-schemas": "node scripts/generate-ipfs-schemas.js",
51
+ "lint": "eslint .",
52
+ "lint:fix": "eslint . --fix",
53
+ "pkgJsonLint": "npmPkgJsonLint .",
54
+ "prebuild": "pnpm clean",
55
+ "pregenerate-ipfs-schemas": "pnpm build",
56
+ "preinstall": "npx only-allow pnpm",
57
+ "prepare": "husky",
58
+ "prepublishOnly": "pnpm build",
59
+ "type-check": "tsc --noEmit",
60
+ "validate-schemas": "node scripts/validate-schemas.js"
61
+ },
62
+ "dependencies": {
63
+ "zod": "4.1.9"
64
+ },
65
+ "devDependencies": {
66
+ "@commitlint/cli": "19.8.1",
67
+ "@commitlint/config-conventional": "19.8.1",
68
+ "@cspell/dict-pt-br": "2.4.2",
69
+ "@eslint/js": "9.36.0",
70
+ "@tsconfig/recommended": "1.0.10",
71
+ "@types/node": "22.15.0",
72
+ "ajv": "8.17.1",
73
+ "ajv-formats": "3.0.1",
74
+ "cspell": "9.2.0",
75
+ "eslint": "9.36.0",
76
+ "glob": "11.0.3",
77
+ "globals": "16.4.0",
78
+ "husky": "9.1.7",
79
+ "jiti": "2.6.1",
80
+ "lint-staged": "16.1.4",
81
+ "npm-package-json-lint": "9.0.0",
82
+ "npm-package-json-lint-config-default": "8.0.1",
83
+ "typescript": "5.3.3",
84
+ "typescript-eslint": "8.45.0"
85
+ },
86
+ "publishConfig": {
87
+ "access": "public"
88
+ }
89
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/credit/credit.schema.json",
3
+ "schema": {
4
+ "hash": "0x8b33fe7f20e0b71c003e63f7db6da83fedef22b4229b5089b78554fc8a2cb987",
5
+ "type": "Collection",
6
+ "version": "v0.1.0"
7
+ },
8
+ "environment": {
9
+ "blockchain_network": "testnet",
10
+ "deployment": "production",
11
+ "data_set_name": "TEST"
12
+ },
13
+ "created_at": "2024-12-05T14:30:00.000Z",
14
+ "external_id": "8f2c3445-ef89-4de7-8d95-7c814d5c8af9",
15
+ "external_url": "https://explore.carrot.eco/collection/bold-cold-start-carazinho",
16
+ "content_hash": "8b33fe7f20e0b71c003e63f7db6da83fedef22b4229b5089b78554fc8a2cb987",
17
+ "creator": {
18
+ "name": "Carrot Foundation",
19
+ "id": "fcdc0eb6-fae9-4aed-8523-a53953910a73"
20
+ },
21
+ "name": "BOLD Cold Start - Carazinho",
22
+ "slug": "bold-cold-start-carazinho",
23
+ "image": "ipfs://QmCollectionImageHash/bold-cold-start-carazinho-icon.png",
24
+ "description": "Cold Start is a limited-edition collection created for early supporters of BOLD - Breakthrough in Organic Landfill Diversion. This purchase contributes to reducing global waste and promoting circularity, with funds distributed via smart contract to local recycling operations and communities."
25
+ }
@@ -0,0 +1,47 @@
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/collection/collection.schema.json",
4
+ "title": "Collection IPFS Record",
5
+ "unevaluatedProperties": false,
6
+ "allOf": [
7
+ {
8
+ "$ref": "../shared/base/base.schema.json"
9
+ },
10
+ {
11
+ "type": "object",
12
+ "required": ["name", "description", "image"],
13
+ "properties": {
14
+ "schema": {
15
+ "properties": {
16
+ "type": {
17
+ "const": "Collection"
18
+ }
19
+ }
20
+ },
21
+ "name": {
22
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
23
+ "title": "Collection Name",
24
+ "example": "BOLD Cold Start - Carazinho"
25
+ },
26
+ "slug": {
27
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/slug",
28
+ "title": "Collection Slug",
29
+ "example": "bold-cold-start-carazinho"
30
+ },
31
+ "image": {
32
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/ipfs_uri",
33
+ "title": "Collection Image",
34
+ "description": "IPFS URI pointing to the collection's visual representation image.",
35
+ "example": "ipfs://QmCollectionImageHash/collection-icon.png"
36
+ },
37
+ "description": {
38
+ "type": "string",
39
+ "minLength": 50,
40
+ "maxLength": 1000,
41
+ "title": "Collection Description",
42
+ "example": "Cold Start is a limited-edition collection created for early supporters of BOLD - Breakthrough in Organic Landfill Diversion. This purchase contributes to reducing global waste and promoting circularity, with funds distributed via smart contract to local recycling operations and communities."
43
+ }
44
+ }
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/carrot-foundation/schemas/refs/heads/main/schemas/ipfs/credit/credit.schema.json",
3
+ "schema": {
4
+ "hash": "0x8b33fe7f20e0b71c003e63f7db6da83fedef22b4229b5089b78554fc8a2cb987",
5
+ "type": "Credit",
6
+ "version": "v0.1.0"
7
+ },
8
+ "environment": {
9
+ "blockchain_network": "testnet",
10
+ "deployment": "production",
11
+ "data_set_name": "TEST"
12
+ },
13
+ "created_at": "2024-12-05T14:30:00.000Z",
14
+ "external_id": "8f2c3445-ef89-4de7-8d95-7c814d5c8af9",
15
+ "external_url": "https://explore.carrot.eco/credit/carrot-carbon",
16
+ "content_hash": "8b33fe7f20e0b71c003e63f7db6da83fedef22b4229b5089b78554fc8a2cb987",
17
+ "creator": {
18
+ "name": "Carrot Foundation",
19
+ "id": "89bb07f3-1a6f-4d8a-aa1d-b5cbdb342c78"
20
+ },
21
+ "symbol": "C-CARB",
22
+ "slug": "carbon",
23
+ "name": "Carrot Carbon",
24
+ "decimals": 18,
25
+ "image": "ipfs://QmCreditImageHash/c-carb-icon.png",
26
+ "description": "Carrot Carbon (C-CARB) 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. These credits are generated through the BOLD Carbon methodology and provide transparent, traceable environmental impact."
27
+ }
@@ -0,0 +1,61 @@
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/credit/credit.schema.json",
4
+ "title": "Credit IPFS Record",
5
+ "description": "Complete schema for Credit ERC20 token IPFS records, extending the base Carrot schema with credit-specific data.",
6
+ "unevaluatedProperties": false,
7
+ "allOf": [
8
+ {
9
+ "$ref": "../shared/base/base.schema.json"
10
+ },
11
+ {
12
+ "type": "object",
13
+ "required": ["symbol", "name", "decimals", "image", "description"],
14
+ "properties": {
15
+ "schema": {
16
+ "properties": {
17
+ "type": {
18
+ "const": "Credit"
19
+ }
20
+ }
21
+ },
22
+ "symbol": {
23
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/token_symbol"
24
+ },
25
+ "slug": {
26
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/slug",
27
+ "title": "Token Slug",
28
+ "example": "carbon"
29
+ },
30
+ "name": {
31
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
32
+ "title": "Token Name",
33
+ "description": "Full human-readable name of the ERC20 token.",
34
+ "example": "Carrot Carbon"
35
+ },
36
+ "decimals": {
37
+ "type": "integer",
38
+ "minimum": 0,
39
+ "maximum": 18,
40
+ "title": "Token Decimals",
41
+ "description": "Number of decimal places for the ERC20 token.",
42
+ "example": 18
43
+ },
44
+ "image": {
45
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/ipfs_uri",
46
+ "title": "Token Image",
47
+ "description": "IPFS URI pointing to the token's visual representation image.",
48
+ "example": "ipfs://QmTokenImageHash/credit-icon.png"
49
+ },
50
+ "description": {
51
+ "type": "string",
52
+ "minLength": 50,
53
+ "maxLength": 1000,
54
+ "title": "Token Description",
55
+ "description": "Comprehensive description of the credit token, its purpose, environmental impact, and utility within the Carrot ecosystem.",
56
+ "example": "Carrot Carbon (C-CARB) 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."
57
+ }
58
+ }
59
+ }
60
+ ]
61
+ }
@@ -0,0 +1,219 @@
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.attributes.schema.json",
4
+ "$defs": {
5
+ "attribute_methodology": {
6
+ "type": "object",
7
+ "required": ["trait_type", "value"],
8
+ "properties": {
9
+ "trait_type": {
10
+ "const": "Methodology"
11
+ },
12
+ "value": {
13
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
14
+ "maxLength": 100,
15
+ "description": "Name of the carbon methodology used for certification",
16
+ "example": "BOLD Carbon (CH₄)"
17
+ }
18
+ },
19
+ "additionalProperties": false
20
+ },
21
+ "attribute_gas_type": {
22
+ "type": "object",
23
+ "required": ["trait_type", "value"],
24
+ "properties": {
25
+ "trait_type": {
26
+ "const": "Gas Type"
27
+ },
28
+ "value": {
29
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
30
+ "maxLength": 100,
31
+ "description": "Type of gas emitted",
32
+ "example": "Methane (CH₄)"
33
+ }
34
+ },
35
+ "additionalProperties": false
36
+ },
37
+ "attribute_co2e_prevented": {
38
+ "type": "object",
39
+ "required": ["trait_type", "value", "display_type"],
40
+ "properties": {
41
+ "trait_type": {
42
+ "const": "CO₂e Prevented (kg)"
43
+ },
44
+ "value": {
45
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_negative_float",
46
+ "description": "Total CO₂ equivalent emissions prevented in kilograms"
47
+ },
48
+ "display_type": {
49
+ "const": "number"
50
+ }
51
+ },
52
+ "additionalProperties": false
53
+ },
54
+ "attribute_credit_amount": {
55
+ "type": "object",
56
+ "required": ["trait_type", "value", "display_type"],
57
+ "properties": {
58
+ "trait_type": {
59
+ "const": "Credit Amount"
60
+ },
61
+ "value": {
62
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_negative_float",
63
+ "description": "Amount of credits issued"
64
+ },
65
+ "display_type": {
66
+ "const": "number"
67
+ }
68
+ },
69
+ "additionalProperties": false
70
+ },
71
+ "attribute_credit_type": {
72
+ "type": "object",
73
+ "required": ["trait_type", "value"],
74
+ "properties": {
75
+ "trait_type": {
76
+ "const": "Credit Type"
77
+ },
78
+ "value": {
79
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
80
+ "maxLength": 100,
81
+ "description": "Type of credit issued",
82
+ "example": "Carrot Carbon"
83
+ }
84
+ },
85
+ "additionalProperties": false
86
+ },
87
+ "attribute_source_waste_type": {
88
+ "type": "object",
89
+ "required": ["trait_type", "value"],
90
+ "properties": {
91
+ "trait_type": {
92
+ "const": "Source Waste Type"
93
+ },
94
+ "value": {
95
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/waste_type"
96
+ }
97
+ },
98
+ "additionalProperties": false
99
+ },
100
+ "attribute_source_weight": {
101
+ "type": "object",
102
+ "required": ["trait_type", "value", "display_type"],
103
+ "properties": {
104
+ "trait_type": {
105
+ "const": "Source Weight (kg)"
106
+ },
107
+ "value": {
108
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/weight_kg"
109
+ },
110
+ "display_type": {
111
+ "const": "number"
112
+ }
113
+ },
114
+ "additionalProperties": false
115
+ },
116
+ "attribute_origin_country": {
117
+ "type": "object",
118
+ "required": ["trait_type", "value"],
119
+ "properties": {
120
+ "trait_type": {
121
+ "const": "Origin Country"
122
+ },
123
+ "value": {
124
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
125
+ "maxLength": 100,
126
+ "description": "Country where the waste was generated",
127
+ "example": "Brazil"
128
+ }
129
+ },
130
+ "additionalProperties": false
131
+ },
132
+ "attribute_origin_municipality": {
133
+ "type": "object",
134
+ "required": ["trait_type", "value"],
135
+ "properties": {
136
+ "trait_type": {
137
+ "const": "Origin Municipality"
138
+ },
139
+ "value": {
140
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
141
+ "maxLength": 100,
142
+ "description": "Municipality where the waste was generated",
143
+ "example": "Macapá"
144
+ }
145
+ },
146
+ "additionalProperties": false
147
+ },
148
+ "attribute_recycler": {
149
+ "type": "object",
150
+ "required": ["trait_type", "value"],
151
+ "properties": {
152
+ "trait_type": {
153
+ "const": "Recycler"
154
+ },
155
+ "value": {
156
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
157
+ "maxLength": 100,
158
+ "description": "Organization that processed the waste",
159
+ "example": "Eco Reciclagem"
160
+ }
161
+ },
162
+ "additionalProperties": false
163
+ },
164
+ "attribute_mass_id_token_id": {
165
+ "type": "object",
166
+ "required": ["trait_type", "value"],
167
+ "properties": {
168
+ "trait_type": {
169
+ "const": "MassID"
170
+ },
171
+ "value": {
172
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/non_empty_string",
173
+ "pattern": "^#[0-9]+$",
174
+ "description": "Token ID of the source MassID NFT",
175
+ "example": "#123"
176
+ }
177
+ },
178
+ "additionalProperties": false
179
+ },
180
+ "attribute_mass_id_recycling_date": {
181
+ "type": "object",
182
+ "required": ["trait_type", "value", "display_type"],
183
+ "properties": {
184
+ "trait_type": {
185
+ "const": "MassID Recycling Date"
186
+ },
187
+ "value": {
188
+ "$ref": "../shared/definitions/definitions.schema.json#/$defs/iso_date",
189
+ "description": "Date when the source waste was recycled",
190
+ "example": "2025-02-22"
191
+ },
192
+ "display_type": {
193
+ "const": "date"
194
+ }
195
+ },
196
+ "additionalProperties": false
197
+ }
198
+ },
199
+ "title": "GasID NFT Attribute Array",
200
+ "description": "Schema for the fixed set of GasID NFT attributes, enforcing order and type for each trait.",
201
+ "type": "array",
202
+ "prefixItems": [
203
+ { "$ref": "#/$defs/attribute_methodology" },
204
+ { "$ref": "#/$defs/attribute_gas_type" },
205
+ { "$ref": "#/$defs/attribute_co2e_prevented" },
206
+ { "$ref": "#/$defs/attribute_credit_amount" },
207
+ { "$ref": "#/$defs/attribute_credit_type" },
208
+ { "$ref": "#/$defs/attribute_source_waste_type" },
209
+ { "$ref": "#/$defs/attribute_source_weight" },
210
+ { "$ref": "#/$defs/attribute_origin_country" },
211
+ { "$ref": "#/$defs/attribute_origin_municipality" },
212
+ { "$ref": "#/$defs/attribute_recycler" },
213
+ { "$ref": "#/$defs/attribute_mass_id_token_id" },
214
+ { "$ref": "#/$defs/attribute_mass_id_recycling_date" }
215
+ ],
216
+ "items": false,
217
+ "minItems": 12,
218
+ "maxItems": 12
219
+ }