@carrot-foundation/schemas 0.2.3 → 0.3.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.
Files changed (27) hide show
  1. package/README.md +144 -116
  2. package/dist/index.cjs +204 -267
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +23 -23
  5. package/dist/index.d.ts +23 -23
  6. package/dist/index.js +204 -267
  7. package/dist/index.js.map +1 -1
  8. package/package.json +20 -20
  9. package/schemas/ipfs/collection/collection.example.json +3 -3
  10. package/schemas/ipfs/collection/collection.schema.json +77 -77
  11. package/schemas/ipfs/credit/credit.example.json +4 -4
  12. package/schemas/ipfs/credit/credit.schema.json +85 -85
  13. package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.example.json +15 -15
  14. package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json +432 -424
  15. package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.example.json +15 -15
  16. package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.schema.json +465 -457
  17. package/schemas/ipfs/gas-id/gas-id.example.json +9 -9
  18. package/schemas/ipfs/gas-id/gas-id.schema.json +448 -432
  19. package/schemas/ipfs/mass-id/mass-id.example.json +7 -7
  20. package/schemas/ipfs/mass-id/mass-id.schema.json +533 -512
  21. package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +57 -57
  22. package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +225 -217
  23. package/schemas/ipfs/methodology/methodology.example.json +5 -5
  24. package/schemas/ipfs/methodology/methodology.schema.json +124 -124
  25. package/schemas/ipfs/recycled-id/recycled-id.example.json +9 -9
  26. package/schemas/ipfs/recycled-id/recycled-id.schema.json +400 -384
  27. package/schemas/schema-hashes.json +10 -10
package/dist/index.cjs CHANGED
@@ -13,8 +13,8 @@ var canonicalize__default = /*#__PURE__*/_interopDefault(canonicalize);
13
13
  // src/mass-id/mass-id.attributes.ts
14
14
  var NonEmptyStringSchema = zod.z.string().min(1, "Cannot be empty").meta({
15
15
  title: "Non-Empty String",
16
- description: "A string that contains at least one character",
17
- examples: ["Example text", "Sample value"]
16
+ description: "A non-empty string (minimum one character)",
17
+ examples: ["example-value", "Hello World"]
18
18
  });
19
19
  var SlugSchema = NonEmptyStringSchema.regex(
20
20
  /^[a-z0-9-]+$/,
@@ -64,7 +64,8 @@ var PositiveIntegerSchema = zod.z.number().int().min(1).meta({
64
64
  });
65
65
  var CreditAmountSchema = NonNegativeFloatSchema.meta({
66
66
  title: "Credit Amount",
67
- description: "Amount of credits issued"
67
+ description: "Number of environmental impact credits issued, purchased, or retired",
68
+ examples: [1.5, 100, 2500.75]
68
69
  });
69
70
  var UsdcAmountSchema = NonNegativeFloatSchema.refine(
70
71
  (value) => {
@@ -28041,16 +28042,16 @@ var IsoCountrySubdivisionCodeSchema = zod.z.string().regex(
28041
28042
  "Must be a valid Brazil subdivision code"
28042
28043
  ).meta({
28043
28044
  title: "Country Subdivision Code",
28044
- description: "Subdivision code following ISO 3166-2 standard",
28045
- examples: ["BR-AP", "BR-DF"]
28045
+ description: "State or region code following the ISO 3166-2 standard (e.g., BR-SP for S\xE3o Paulo)",
28046
+ examples: ["BR-SP", "BR-RS", "BR-AP", "BR-DF"]
28046
28047
  });
28047
28048
  var CitySchema = NonEmptyStringSchema.max(50).refine(
28048
28049
  (data) => BRAZIL_MUNICIPALITIES.some((municipality) => municipality.name === data),
28049
28050
  "Must be a valid Brazil municipality"
28050
28051
  ).meta({
28051
28052
  title: "City",
28052
- description: "City name",
28053
- examples: ["Bras\xEDlia", "S\xE3o Paulo"]
28053
+ description: "Name of the Brazilian municipality where the activity takes place",
28054
+ examples: ["Bras\xEDlia", "S\xE3o Paulo", "Carazinho", "Jundia\xED"]
28054
28055
  });
28055
28056
  var LatitudeSchema = zod.z.number().min(-90).max(90).multipleOf(0.1).meta({
28056
28057
  title: "Latitude",
@@ -28117,7 +28118,7 @@ var UuidSchema = zod.z.uuidv4().meta({
28117
28118
  });
28118
28119
  var ExternalIdSchema = UuidSchema.meta({
28119
28120
  title: "External ID",
28120
- description: "UUID identifier for external system references"
28121
+ description: "UUID v4 identifier linking this IPFS record to its counterpart in the Carrot platform and other consuming systems"
28121
28122
  });
28122
28123
  var TokenIdSchema = NonEmptyStringSchema.regex(
28123
28124
  /^\d+$/,
@@ -28131,9 +28132,10 @@ var StringifiedTokenIdSchema = NonEmptyStringSchema.regex(
28131
28132
  /^#\d+$/,
28132
28133
  "Must match pattern #<token_id>"
28133
28134
  ).meta({
28134
- title: "Token ID",
28135
- description: "Token ID represented as #<token_id>",
28136
- example: "#123"
28135
+ title: "Display Token ID",
28136
+ description: "Human-readable token ID prefixed with # for display purposes (e.g., #456789)",
28137
+ examples: ["#456789", "#1000000"],
28138
+ example: "#456789"
28137
28139
  });
28138
28140
  var Sha256HashSchema = zod.z.hash("sha256", {
28139
28141
  error: "Must be a SHA256 hash as 32-byte hex string"
@@ -28147,7 +28149,7 @@ var Sha256HashSchema = zod.z.hash("sha256", {
28147
28149
  });
28148
28150
  var ParticipantIdHashSchema = Sha256HashSchema.meta({
28149
28151
  title: "Participant ID Hash",
28150
- description: "SHA-256 hash representing a participant identifier (SHA-256 hex string)",
28152
+ description: "SHA-256 hash anonymizing a participant identity \u2014 used to link records without exposing personal data",
28151
28153
  examples: [
28152
28154
  "87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489"
28153
28155
  ]
@@ -28222,8 +28224,8 @@ var RecordSchemaTypeSchema = zod.z.enum([
28222
28224
  "Collection"
28223
28225
  ]).meta({
28224
28226
  title: "Schema Type",
28225
- description: "Type of schema in the Carrot ecosystem",
28226
- examples: ["MassID", "RecycledID", "GasID"]
28227
+ description: "Identifies the record type within the Carrot ecosystem (e.g., MassID for waste tracking, GasID for prevented emissions certificates)",
28228
+ examples: ["MassID", "GasID", "Credit", "CreditPurchaseReceipt"]
28227
28229
  });
28228
28230
  var CreditTokenNameSchema = zod.z.enum(["Carrot Carbon (CH\u2084)", "Carrot Biowaste"]).meta({
28229
28231
  title: "Credit Token Name",
@@ -28242,12 +28244,12 @@ var CreditTokenSymbolSchema = zod.z.enum(["C-CARB.CH4", "C-BIOW"]).meta({
28242
28244
  });
28243
28245
  var CreditTypeSchema = zod.z.enum(["Biowaste", "Carbon (CH\u2084)"]).meta({
28244
28246
  title: "Credit Type",
28245
- description: "Type of credit issued",
28247
+ description: "Category of environmental credit \u2014 indicates the impact pathway (biowaste diversion or methane prevention)",
28246
28248
  examples: ["Biowaste", "Carbon (CH\u2084)"]
28247
28249
  });
28248
28250
  var GasTypeSchema = zod.z.enum(["Methane (CH\u2084)"]).meta({
28249
28251
  title: "Gas Type",
28250
- description: "Type of gas prevented",
28252
+ description: "Greenhouse gas type whose emission was prevented through the waste management activity",
28251
28253
  examples: ["Methane (CH\u2084)"]
28252
28254
  });
28253
28255
  var VehicleTypeSchema = zod.z.enum([
@@ -28263,8 +28265,8 @@ var VehicleTypeSchema = zod.z.enum([
28263
28265
  "Truck"
28264
28266
  ]).meta({
28265
28267
  title: "Vehicle Type",
28266
- description: "Type of vehicle used for waste transportation operations",
28267
- examples: ["Truck"]
28268
+ description: "Type of vehicle used to transport waste between collection and processing sites",
28269
+ examples: ["Truck", "Motorcycle", "Cart"]
28268
28270
  });
28269
28271
  var ScaleTypeSchema = zod.z.enum([
28270
28272
  "Bin Scale",
@@ -28279,18 +28281,18 @@ var ScaleTypeSchema = zod.z.enum([
28279
28281
  "Weighbridge (Truck Scale)"
28280
28282
  ]).meta({
28281
28283
  title: "Scale Type",
28282
- description: "Type of scale used to weigh the load",
28283
- examples: ["Weighbridge (Truck Scale)"]
28284
+ description: "Type of weighing equipment used to measure the waste load at a collection or processing site",
28285
+ examples: ["Weighbridge (Truck Scale)", "Floor Scale"]
28284
28286
  });
28285
28287
  var WeighingCaptureMethodSchema = zod.z.enum(["Digital", "Manual", "Photo (Scale + Cargo)", "Transport Manifest"]).meta({
28286
28288
  title: "Weighing Capture Method",
28287
- description: "Method used to capture weight data",
28288
- examples: ["Digital", "Manual"]
28289
+ description: "How the weight measurement was recorded \u2014 digital readout, manual entry, photo evidence, or transport manifest",
28290
+ examples: ["Digital", "Photo (Scale + Cargo)"]
28289
28291
  });
28290
28292
  var ContainerTypeSchema = zod.z.enum(["Bag", "Bin", "Drum", "Pail", "Street Bin", "Truck", "Waste Box"]).meta({
28291
28293
  title: "Container Type",
28292
- description: "Type of container holding the waste",
28293
- examples: ["Bag", "Bin"]
28294
+ description: "Type of container used to hold or transport the waste material",
28295
+ examples: ["Bag", "Bin", "Truck"]
28294
28296
  });
28295
28297
  var CollectionSlugSchema = zod.z.enum([
28296
28298
  "bold-innovators",
@@ -28299,7 +28301,7 @@ var CollectionSlugSchema = zod.z.enum([
28299
28301
  "bold-brazil"
28300
28302
  ]).meta({
28301
28303
  title: "Collection Slug",
28302
- description: "URL-friendly identifier for a collection",
28304
+ description: "URL-friendly identifier for an environmental credit collection, used in URIs and API references",
28303
28305
  examples: ["bold-cold-start-carazinho", "bold-brazil"]
28304
28306
  });
28305
28307
  var ParticipantRoleSchema = zod.z.enum([
@@ -28319,7 +28321,7 @@ var ParticipantRoleSchema = zod.z.enum([
28319
28321
  });
28320
28322
  var WasteTypeSchema = zod.z.enum(["Organic"]).meta({
28321
28323
  title: "Waste Type",
28322
- description: "Category or type of waste material",
28324
+ description: "Broad classification of the waste material being tracked (e.g., Organic)",
28323
28325
  examples: ["Organic"]
28324
28326
  });
28325
28327
  var WasteSubtypeSchema = zod.z.enum([
@@ -28332,8 +28334,8 @@ var WasteSubtypeSchema = zod.z.enum([
28332
28334
  "Wood and Wood Products"
28333
28335
  ]).meta({
28334
28336
  title: "Waste Subtype",
28335
- description: "Specific subcategory of waste within a waste type",
28336
- examples: ["Food, Food Waste and Beverages", "Domestic Sludge"]
28337
+ description: "Detailed subcategory of the waste material, refining the broad waste type classification",
28338
+ examples: ["Food, Food Waste and Beverages", "Garden, Yard and Park Waste"]
28337
28339
  });
28338
28340
  var CollectionNameSchema = zod.z.enum([
28339
28341
  "BOLD Innovators",
@@ -28342,7 +28344,7 @@ var CollectionNameSchema = zod.z.enum([
28342
28344
  "BOLD Brazil"
28343
28345
  ]).meta({
28344
28346
  title: "Collection Name",
28345
- description: "Display name of the collection",
28347
+ description: "Human-readable display name for the environmental credit collection",
28346
28348
  examples: ["BOLD Cold Start - Carazinho", "BOLD Brazil"]
28347
28349
  });
28348
28350
  var MethodologyNameSchema = zod.z.enum([
@@ -28368,7 +28370,7 @@ var MethodologySlugSchema = zod.z.enum(["bold-recycling", "bold-carbon-ch4"]).me
28368
28370
  });
28369
28371
  var CertificateTypeSchema = zod.z.enum(["GasID", "RecycledID"]).meta({
28370
28372
  title: "Certificate Type",
28371
- description: "Type of certificate (e.g., GasID, RecycledID)",
28373
+ description: "Type of certificate \u2014 GasID for methane prevention, RecycledID for waste recycling",
28372
28374
  examples: ["GasID", "RecycledID"]
28373
28375
  });
28374
28376
 
@@ -28636,26 +28638,58 @@ var NftIpfsSchema = BaseIpfsSchema.safeExtend({
28636
28638
  });
28637
28639
 
28638
28640
  // src/shared/schemas/core/nft-name.schemas.ts
28639
- var MassIDNameSchema = NonEmptyStringSchema.max(100).regex(
28640
- /^MassID #\d+ • .+ • .+t$/,
28641
- 'Name must match format: "MassID #[token_id] \u2022 [waste_type] \u2022 [weight]t"'
28642
- ).meta({
28641
+ function buildNameSchemas(config) {
28642
+ const {
28643
+ prefix,
28644
+ regexSuffix,
28645
+ formatHint,
28646
+ title,
28647
+ description,
28648
+ examples,
28649
+ maxLength = 100
28650
+ } = config;
28651
+ const meta = { title, description, examples };
28652
+ const schema = NonEmptyStringSchema.max(maxLength).regex(
28653
+ new RegExp(`^${prefix} #\\d+${regexSuffix}$`),
28654
+ `Name must match format: "${prefix} #[token_id] \u2022 ${formatHint}"`
28655
+ ).meta(meta);
28656
+ const createSchema = (tokenId) => NonEmptyStringSchema.max(maxLength).regex(
28657
+ new RegExp(String.raw`^${prefix} #${tokenId}${regexSuffix}$`),
28658
+ `Name must match format: "${prefix} #${tokenId} \u2022 ${formatHint}"`
28659
+ ).meta(meta);
28660
+ return { schema, createSchema };
28661
+ }
28662
+ function buildShortNameSchemas(config) {
28663
+ const { prefix, title, description, examples, maxLength = 50 } = config;
28664
+ const meta = { title, description, examples };
28665
+ const schema = NonEmptyStringSchema.max(maxLength).regex(
28666
+ new RegExp(`^${prefix} #\\d+$`),
28667
+ `Short name must match format: "${prefix} #[token_id]"`
28668
+ ).meta(meta);
28669
+ const createSchema = (tokenId) => NonEmptyStringSchema.max(maxLength).refine(
28670
+ (val) => val === `${prefix} #${tokenId}`,
28671
+ `Short name must be exactly "${prefix} #${tokenId}"`
28672
+ ).meta(meta);
28673
+ return { schema, createSchema };
28674
+ }
28675
+ var massIDName = buildNameSchemas({
28676
+ prefix: "MassID",
28677
+ regexSuffix: " \u2022 .+ \u2022 .+t",
28678
+ formatHint: "[waste_type] \u2022 [weight]t",
28643
28679
  title: "MassID Name",
28644
28680
  description: 'Full display name for this MassID NFT. Format: "MassID #[token_id] \u2022 [waste_type] \u2022 [weight]t"',
28645
- examples: [
28646
- "MassID #1034 \u2022 Organic \u2022 3.25t",
28647
- "MassID #123 \u2022 Plastic \u2022 2.5t"
28648
- ]
28681
+ examples: ["MassID #1034 \u2022 Organic \u2022 3.25t", "MassID #123 \u2022 Plastic \u2022 2.5t"]
28649
28682
  });
28650
- var MassIDShortNameSchema = NonEmptyStringSchema.max(50).regex(/^MassID #\d+$/, 'Short name must match format: "MassID #[token_id]"').meta({
28683
+ var massIDShortName = buildShortNameSchemas({
28684
+ prefix: "MassID",
28651
28685
  title: "MassID Short Name",
28652
28686
  description: 'Compact name for UI summaries, tables, or tooltips. Format: "MassID #[token_id]"',
28653
28687
  examples: ["MassID #1034", "MassID #123"]
28654
28688
  });
28655
- var GasIDNameSchema = NonEmptyStringSchema.max(100).regex(
28656
- /^GasID #\d+ • .+ • .+t CO₂e$/,
28657
- 'Name must match format: "GasID #[token_id] \u2022 [methodology] \u2022 [co2e]t CO\u2082e"'
28658
- ).meta({
28689
+ var gasIDName = buildNameSchemas({
28690
+ prefix: "GasID",
28691
+ regexSuffix: " \u2022 .+ \u2022 .+t CO\u2082e",
28692
+ formatHint: "[methodology] \u2022 [co2e]t CO\u2082e",
28659
28693
  title: "GasID Name",
28660
28694
  description: 'Full display name for this GasID NFT. Format: "GasID #[token_id] \u2022 [methodology] \u2022 [co2e]t CO\u2082e"',
28661
28695
  examples: [
@@ -28663,15 +28697,16 @@ var GasIDNameSchema = NonEmptyStringSchema.max(100).regex(
28663
28697
  "GasID #789 \u2022 BOLD Carbon (CH\u2084) \u2022 1.2t CO\u2082e"
28664
28698
  ]
28665
28699
  });
28666
- var GasIDShortNameSchema = NonEmptyStringSchema.max(50).regex(/^GasID #\d+$/, 'Short name must match format: "GasID #[token_id]"').meta({
28700
+ var gasIDShortName = buildShortNameSchemas({
28701
+ prefix: "GasID",
28667
28702
  title: "GasID Short Name",
28668
28703
  description: 'Compact name for UI summaries, tables, or tooltips. Format: "GasID #[token_id]"',
28669
28704
  examples: ["GasID #456", "GasID #789"]
28670
28705
  });
28671
- var RecycledIDNameSchema = NonEmptyStringSchema.max(100).regex(
28672
- /^RecycledID #\d+ • .+ • .+t Recycled$/,
28673
- 'Name must match format: "RecycledID #[token_id] \u2022 [methodology] \u2022 [weight]t Recycled"'
28674
- ).meta({
28706
+ var recycledIDName = buildNameSchemas({
28707
+ prefix: "RecycledID",
28708
+ regexSuffix: " \u2022 .+ \u2022 .+t Recycled",
28709
+ formatHint: "[methodology] \u2022 [weight]t Recycled",
28675
28710
  title: "RecycledID Name",
28676
28711
  description: 'Full display name for this RecycledID NFT. Format: "RecycledID #[token_id] \u2022 [methodology] \u2022 [weight]t Recycled"',
28677
28712
  examples: [
@@ -28679,18 +28714,16 @@ var RecycledIDNameSchema = NonEmptyStringSchema.max(100).regex(
28679
28714
  "RecycledID #456 \u2022 BOLD Recycling \u2022 2.5t Recycled"
28680
28715
  ]
28681
28716
  });
28682
- var RecycledIDShortNameSchema = NonEmptyStringSchema.max(50).regex(
28683
- /^RecycledID #\d+$/,
28684
- 'Short name must match format: "RecycledID #[token_id]"'
28685
- ).meta({
28717
+ var recycledIDShortName = buildShortNameSchemas({
28718
+ prefix: "RecycledID",
28686
28719
  title: "RecycledID Short Name",
28687
28720
  description: 'Compact name for UI summaries, tables, or tooltips. Format: "RecycledID #[token_id]"',
28688
28721
  examples: ["RecycledID #789", "RecycledID #456"]
28689
28722
  });
28690
- var CreditPurchaseReceiptNameSchema = NonEmptyStringSchema.max(100).regex(
28691
- /^Credit Purchase Receipt #\d+ • .+ Credits Purchased$/,
28692
- 'Name must match format: "Credit Purchase Receipt #[token_id] \u2022 [amount] Credits Purchased"'
28693
- ).meta({
28723
+ var creditPurchaseReceiptName = buildNameSchemas({
28724
+ prefix: "Credit Purchase Receipt",
28725
+ regexSuffix: " \u2022 .+ Credits Purchased",
28726
+ formatHint: "[amount] Credits Purchased",
28694
28727
  title: "Credit Purchase Receipt Name",
28695
28728
  description: 'Full display name for this Credit Purchase Receipt NFT. Format: "Credit Purchase Receipt #[token_id] \u2022 [amount] Credits Purchased"',
28696
28729
  examples: [
@@ -28698,18 +28731,16 @@ var CreditPurchaseReceiptNameSchema = NonEmptyStringSchema.max(100).regex(
28698
28731
  "Credit Purchase Receipt #1200 \u2022 15.0 Credits Purchased"
28699
28732
  ]
28700
28733
  });
28701
- var CreditPurchaseReceiptShortNameSchema = NonEmptyStringSchema.max(50).regex(
28702
- /^Purchase Receipt #\d+$/,
28703
- 'Short name must match format: "Purchase Receipt #[token_id]"'
28704
- ).meta({
28734
+ var creditPurchaseReceiptShortName = buildShortNameSchemas({
28735
+ prefix: "Purchase Receipt",
28705
28736
  title: "Credit Purchase Receipt Short Name",
28706
28737
  description: 'Compact name for UI summaries, tables, or tooltips. Format: "Purchase Receipt #[token_id]"',
28707
28738
  examples: ["Purchase Receipt #987", "Purchase Receipt #1200"]
28708
28739
  });
28709
- var CreditRetirementReceiptNameSchema = NonEmptyStringSchema.max(100).regex(
28710
- /^Credit Retirement Receipt #\d+ • .+ Credits Retired$/,
28711
- 'Name must match format: "Credit Retirement Receipt #[token_id] \u2022 [amount] Credits Retired"'
28712
- ).meta({
28740
+ var creditRetirementReceiptName = buildNameSchemas({
28741
+ prefix: "Credit Retirement Receipt",
28742
+ regexSuffix: " \u2022 .+ Credits Retired",
28743
+ formatHint: "[amount] Credits Retired",
28713
28744
  title: "Credit Retirement Receipt Name",
28714
28745
  description: 'Full display name for this Credit Retirement Receipt NFT. Format: "Credit Retirement Receipt #[token_id] \u2022 [amount] Credits Retired"',
28715
28746
  examples: [
@@ -28717,145 +28748,36 @@ var CreditRetirementReceiptNameSchema = NonEmptyStringSchema.max(100).regex(
28717
28748
  "Credit Retirement Receipt #1200 \u2022 3.0 Credits Retired"
28718
28749
  ]
28719
28750
  });
28720
- var CreditRetirementReceiptShortNameSchema = NonEmptyStringSchema.max(
28721
- 50
28722
- ).regex(
28723
- /^Retirement Receipt #\d+$/,
28724
- 'Short name must match format: "Retirement Receipt #[token_id]"'
28725
- ).meta({
28726
- title: "Credit Retirement Receipt Short Name",
28727
- description: 'Compact name for UI summaries, tables, or tooltips. Format: "Retirement Receipt #[token_id]"',
28728
- examples: ["Retirement Receipt #1245", "Retirement Receipt #1200"]
28729
- });
28730
- var createMassIDNameSchema = (tokenId) => {
28731
- const escapedTokenId = tokenId.replace("#", String.raw`\#`);
28732
- return NonEmptyStringSchema.max(100).regex(
28733
- new RegExp(String.raw`^MassID #${escapedTokenId} • .+ • .+t$`),
28734
- `Name must match format: "MassID #${tokenId} \u2022 [waste_type] \u2022 [weight]t"`
28735
- ).meta({
28736
- title: "MassID Name",
28737
- description: 'Full display name for this MassID NFT. Format: "MassID #[token_id] \u2022 [waste_type] \u2022 [weight]t"',
28738
- examples: [
28739
- "MassID #1034 \u2022 Organic \u2022 3.25t",
28740
- "MassID #123 \u2022 Plastic \u2022 2.5t"
28741
- ]
28742
- });
28743
- };
28744
- var createGasIDNameSchema = (tokenId) => {
28745
- const escapedTokenId = tokenId.replace("#", String.raw`\#`);
28746
- return NonEmptyStringSchema.max(100).regex(
28747
- new RegExp(String.raw`^GasID #${escapedTokenId} • .+ • .+t CO₂e$`),
28748
- `Name must match format: "GasID #${tokenId} \u2022 [methodology] \u2022 [co2e]t CO\u2082e"`
28749
- ).meta({
28750
- title: "GasID Name",
28751
- description: 'Full display name for this GasID NFT. Format: "GasID #[token_id] \u2022 [methodology] \u2022 [co2e]t CO\u2082e"',
28752
- examples: [
28753
- "GasID #456 \u2022 BOLD Carbon (CH\u2084) \u2022 0.86t CO\u2082e",
28754
- "GasID #789 \u2022 BOLD Carbon (CH\u2084) \u2022 1.2t CO\u2082e"
28755
- ]
28756
- });
28757
- };
28758
- var createRecycledIDNameSchema = (tokenId) => {
28759
- const escapedTokenId = tokenId.replace("#", String.raw`\#`);
28760
- return NonEmptyStringSchema.max(100).regex(
28761
- new RegExp(
28762
- String.raw`^RecycledID #${escapedTokenId} • .+ • .+t Recycled$`
28763
- ),
28764
- `Name must match format: "RecycledID #${tokenId} \u2022 [methodology] \u2022 [weight]t Recycled"`
28765
- ).meta({
28766
- title: "RecycledID Name",
28767
- description: 'Full display name for this RecycledID NFT. Format: "RecycledID #[token_id] \u2022 [methodology] \u2022 [weight]t Recycled"',
28768
- examples: [
28769
- "RecycledID #789 \u2022 BOLD Recycling \u2022 3.25t Recycled",
28770
- "RecycledID #456 \u2022 BOLD Recycling \u2022 2.5t Recycled"
28771
- ]
28772
- });
28773
- };
28774
- var createCreditPurchaseReceiptNameSchema = (tokenId) => {
28775
- const escapedTokenId = tokenId.replace("#", String.raw`\#`);
28776
- return NonEmptyStringSchema.max(100).regex(
28777
- new RegExp(
28778
- String.raw`^Credit Purchase Receipt #${escapedTokenId} • .+ Credits Purchased$`
28779
- ),
28780
- `Name must match format: "Credit Purchase Receipt #${tokenId} \u2022 [amount] Credits Purchased"`
28781
- ).meta({
28782
- title: "Credit Purchase Receipt Name",
28783
- description: 'Full display name for this Credit Purchase Receipt NFT. Format: "Credit Purchase Receipt #[token_id] \u2022 [amount] Credits Purchased"',
28784
- examples: [
28785
- "Credit Purchase Receipt #987 \u2022 8.5 Credits Purchased",
28786
- "Credit Purchase Receipt #1200 \u2022 15.0 Credits Purchased"
28787
- ]
28788
- });
28789
- };
28790
- var createCreditRetirementReceiptNameSchema = (tokenId) => {
28791
- const escapedTokenId = tokenId.replace("#", String.raw`\#`);
28792
- return NonEmptyStringSchema.max(100).regex(
28793
- new RegExp(
28794
- String.raw`^Credit Retirement Receipt #${escapedTokenId} • .+ Credits Retired$`
28795
- ),
28796
- `Name must match format: "Credit Retirement Receipt #${tokenId} \u2022 [amount] Credits Retired"`
28797
- ).meta({
28798
- title: "Credit Retirement Receipt Name",
28799
- description: 'Full display name for this Credit Retirement Receipt NFT. Format: "Credit Retirement Receipt #[token_id] \u2022 [amount] Credits Retired"',
28800
- examples: [
28801
- "Credit Retirement Receipt #1245 \u2022 10.5 Credits Retired",
28802
- "Credit Retirement Receipt #1200 \u2022 3.0 Credits Retired"
28803
- ]
28804
- });
28805
- };
28806
- var createMassIDShortNameSchema = (tokenId) => NonEmptyStringSchema.max(50).refine(
28807
- (val) => val === `MassID #${tokenId}`,
28808
- `Short name must be exactly "MassID #${tokenId}"`
28809
- ).meta({
28810
- title: "MassID Short Name",
28811
- description: 'Compact name for UI summaries, tables, or tooltips. Format: "MassID #[token_id]"',
28812
- examples: ["MassID #1034", "MassID #123"]
28813
- });
28814
- var createGasIDShortNameSchema = (tokenId) => NonEmptyStringSchema.max(50).refine(
28815
- (val) => val === `GasID #${tokenId}`,
28816
- `Short name must be exactly "GasID #${tokenId}"`
28817
- ).meta({
28818
- title: "GasID Short Name",
28819
- description: 'Compact name for UI summaries, tables, or tooltips. Format: "GasID #[token_id]"',
28820
- examples: ["GasID #456", "GasID #789"]
28821
- });
28822
- var createRecycledIDShortNameSchema = (tokenId) => NonEmptyStringSchema.max(50).refine(
28823
- (val) => val === `RecycledID #${tokenId}`,
28824
- `Short name must be exactly "RecycledID #${tokenId}"`
28825
- ).meta({
28826
- title: "RecycledID Short Name",
28827
- description: 'Compact name for UI summaries, tables, or tooltips. Format: "RecycledID #[token_id]"',
28828
- examples: ["RecycledID #789", "RecycledID #456"]
28829
- });
28830
- var createCreditPurchaseReceiptShortNameSchema = (tokenId) => NonEmptyStringSchema.max(50).refine(
28831
- (val) => val === `Purchase Receipt #${tokenId}`,
28832
- `Short name must be exactly "Purchase Receipt #${tokenId}"`
28833
- ).meta({
28834
- title: "Credit Purchase Receipt Short Name",
28835
- description: 'Compact name for UI summaries, tables, or tooltips. Format: "Purchase Receipt #[token_id]"',
28836
- examples: ["Purchase Receipt #987", "Purchase Receipt #1200"]
28837
- });
28838
- var createCreditRetirementReceiptShortNameSchema = (tokenId) => NonEmptyStringSchema.max(50).refine(
28839
- (val) => val === `Retirement Receipt #${tokenId}`,
28840
- `Short name must be exactly "Retirement Receipt #${tokenId}"`
28841
- ).meta({
28751
+ var creditRetirementReceiptShortName = buildShortNameSchemas({
28752
+ prefix: "Retirement Receipt",
28842
28753
  title: "Credit Retirement Receipt Short Name",
28843
28754
  description: 'Compact name for UI summaries, tables, or tooltips. Format: "Retirement Receipt #[token_id]"',
28844
28755
  examples: ["Retirement Receipt #1245", "Retirement Receipt #1200"]
28845
28756
  });
28757
+ var MassIDNameSchema = massIDName.schema;
28758
+ var MassIDShortNameSchema = massIDShortName.schema;
28759
+ var createMassIDNameSchema = massIDName.createSchema;
28760
+ var createMassIDShortNameSchema = massIDShortName.createSchema;
28761
+ var GasIDNameSchema = gasIDName.schema;
28762
+ var GasIDShortNameSchema = gasIDShortName.schema;
28763
+ var createGasIDNameSchema = gasIDName.createSchema;
28764
+ var createGasIDShortNameSchema = gasIDShortName.createSchema;
28765
+ var RecycledIDNameSchema = recycledIDName.schema;
28766
+ var RecycledIDShortNameSchema = recycledIDShortName.schema;
28767
+ var createRecycledIDNameSchema = recycledIDName.createSchema;
28768
+ var createRecycledIDShortNameSchema = recycledIDShortName.createSchema;
28769
+ var CreditPurchaseReceiptNameSchema = creditPurchaseReceiptName.schema;
28770
+ var CreditPurchaseReceiptShortNameSchema = creditPurchaseReceiptShortName.schema;
28771
+ var createCreditPurchaseReceiptNameSchema = creditPurchaseReceiptName.createSchema;
28772
+ var createCreditPurchaseReceiptShortNameSchema = creditPurchaseReceiptShortName.createSchema;
28773
+ var CreditRetirementReceiptNameSchema = creditRetirementReceiptName.schema;
28774
+ var CreditRetirementReceiptShortNameSchema = creditRetirementReceiptShortName.schema;
28775
+ var createCreditRetirementReceiptNameSchema = creditRetirementReceiptName.createSchema;
28776
+ var createCreditRetirementReceiptShortNameSchema = creditRetirementReceiptShortName.createSchema;
28846
28777
  function getSchemaMetadata(schema) {
28847
- if (typeof schema.meta === "function") {
28848
- const meta = schema.meta();
28849
- if (meta && typeof meta === "object") {
28850
- return meta;
28851
- }
28852
- }
28853
- try {
28854
- const meta = zod.z.globalRegistry.get(schema);
28855
- if (meta && typeof meta === "object") {
28856
- return meta;
28857
- }
28858
- } catch {
28778
+ const meta = schema.meta();
28779
+ if (meta && typeof meta === "object") {
28780
+ return meta;
28859
28781
  }
28860
28782
  return void 0;
28861
28783
  }
@@ -28883,7 +28805,7 @@ function extractTraitType(schema) {
28883
28805
  if (meta?.title) {
28884
28806
  const title = meta.title;
28885
28807
  if (title.endsWith(" Attribute")) {
28886
- const inferred = title.slice(0, -11);
28808
+ const inferred = title.slice(0, -" Attribute".length);
28887
28809
  if (inferred.length > 3) {
28888
28810
  return inferred;
28889
28811
  }
@@ -29395,7 +29317,7 @@ var AuditRuleExecutionResultsSchema = zod.z.array(AuditRuleExecutionResultSchema
29395
29317
  var ParticipantSchema = zod.z.strictObject({
29396
29318
  id_hash: Sha256HashSchema.meta({
29397
29319
  title: "Participant ID Hash",
29398
- description: "Anonymized identifier for the participant"
29320
+ description: "SHA-256 hash anonymizing the real participant identifier for privacy"
29399
29321
  }),
29400
29322
  roles: uniqueArrayItems(
29401
29323
  ParticipantRoleSchema,
@@ -29406,26 +29328,26 @@ var ParticipantSchema = zod.z.strictObject({
29406
29328
  })
29407
29329
  }).meta({
29408
29330
  title: "Participant",
29409
- description: "A participant in the waste management supply chain"
29331
+ description: "An entity (person, company, or cooperative) involved in the waste management supply chain"
29410
29332
  });
29411
29333
  var CoordinatesSchema = zod.z.strictObject({
29412
29334
  latitude: LatitudeSchema,
29413
29335
  longitude: LongitudeSchema
29414
29336
  }).meta({
29415
29337
  title: "Coordinates",
29416
- description: "GPS coordinates of the location"
29338
+ description: "Approximate GPS coordinates of the site (city-level precision for privacy)"
29417
29339
  });
29418
29340
  var LocationSchema = zod.z.strictObject({
29419
29341
  id_hash: Sha256HashSchema.meta({
29420
29342
  title: "Location ID Hash",
29421
- description: "Anonymized identifier for the location"
29343
+ description: "SHA-256 hash anonymizing the real location identifier for privacy"
29422
29344
  }),
29423
29345
  city: CitySchema,
29424
29346
  subdivision_code: IsoCountrySubdivisionCodeSchema,
29425
29347
  country_code: IsoCountryCodeSchema,
29426
29348
  responsible_participant_id_hash: Sha256HashSchema.meta({
29427
29349
  title: "Responsible Participant ID Hash",
29428
- description: "Anonymized ID of the participant responsible for this location"
29350
+ description: "SHA-256 hash identifying the participant responsible for operations at this location"
29429
29351
  }),
29430
29352
  coordinates: CoordinatesSchema
29431
29353
  }).superRefine((record, ctx) => {
@@ -29454,17 +29376,17 @@ var WastePropertiesSchema = zod.z.strictObject({
29454
29376
  var SummaryBaseSchema = zod.z.strictObject({
29455
29377
  total_certificates: PositiveIntegerSchema.meta({
29456
29378
  title: "Total Certificates",
29457
- description: "Total number of certificates represented in the receipt"
29379
+ description: "Total number of certificates (GasID or RecycledID) included in this receipt"
29458
29380
  })
29459
29381
  });
29460
- var CreditPurchaseReceiptSummarySchema = SummaryBaseSchema.extend({
29382
+ var CreditPurchaseReceiptSummarySchema = SummaryBaseSchema.safeExtend({
29461
29383
  total_amount_usdc: UsdcAmountSchema.meta({
29462
29384
  title: "Total Amount (USDC)",
29463
- description: "Total amount paid in USDC for the purchase"
29385
+ description: "Total amount paid in USDC stablecoin for the credit purchase"
29464
29386
  }),
29465
29387
  total_credits: CreditAmountSchema.meta({
29466
29388
  title: "Total Credits",
29467
- description: "Total amount of credits purchased"
29389
+ description: "Total number of environmental impact credits purchased in this transaction"
29468
29390
  }),
29469
29391
  purchased_at: IsoDateTimeSchema.meta({
29470
29392
  title: "Purchased At",
@@ -29472,12 +29394,12 @@ var CreditPurchaseReceiptSummarySchema = SummaryBaseSchema.extend({
29472
29394
  })
29473
29395
  }).meta({
29474
29396
  title: "Credit Purchase Receipt Summary",
29475
- description: "Summary totals for the credit purchase including amounts and collections represented"
29397
+ description: "Summary totals for the credit purchase including payment amount, credit quantity, certificate count, and timestamp"
29476
29398
  });
29477
- var CreditRetirementReceiptSummarySchema = SummaryBaseSchema.extend({
29399
+ var CreditRetirementReceiptSummarySchema = SummaryBaseSchema.safeExtend({
29478
29400
  total_credits_retired: CreditAmountSchema.meta({
29479
29401
  title: "Total Credits Retired",
29480
- description: "Total amount of credits retired"
29402
+ description: "Total number of environmental impact credits permanently retired (removed from circulation)"
29481
29403
  }),
29482
29404
  retired_at: IsoDateTimeSchema.meta({
29483
29405
  title: "Retired At",
@@ -29485,25 +29407,25 @@ var CreditRetirementReceiptSummarySchema = SummaryBaseSchema.extend({
29485
29407
  })
29486
29408
  }).meta({
29487
29409
  title: "Credit Retirement Receipt Summary",
29488
- description: "Summary totals for the credit retirement including amounts and collections represented"
29410
+ description: "Summary totals for the credit retirement including credit quantity, certificate count, and timestamp"
29489
29411
  });
29490
29412
  var ReceiptIdentitySchema = zod.z.strictObject({
29491
29413
  name: NonEmptyStringSchema.max(100).meta({
29492
29414
  title: "Identity Name",
29493
- description: "Display name for the participant",
29415
+ description: "Display name of the buyer or beneficiary on the receipt",
29494
29416
  examples: ["EcoTech Solutions Inc.", "Climate Action Corp"]
29495
29417
  }),
29496
29418
  external_id: ExternalIdSchema.meta({
29497
29419
  title: "Identity External ID",
29498
- description: "External identifier for the participant"
29420
+ description: "Unique identifier for the buyer or beneficiary in the Carrot platform"
29499
29421
  }),
29500
29422
  external_url: ExternalUrlSchema.meta({
29501
29423
  title: "Identity External URL",
29502
- description: "External URL for the participant profile"
29424
+ description: "Link to the buyer or beneficiary profile page on the Carrot platform"
29503
29425
  })
29504
29426
  }).meta({
29505
29427
  title: "Identity",
29506
- description: "Participant identity information"
29428
+ description: "Identity information for the buyer or beneficiary associated with this receipt"
29507
29429
  });
29508
29430
  function createReceiptCollectionSchema(params) {
29509
29431
  const { meta } = params;
@@ -29511,27 +29433,27 @@ function createReceiptCollectionSchema(params) {
29511
29433
  slug: CollectionSlugSchema,
29512
29434
  external_id: ExternalIdSchema.meta({
29513
29435
  title: "Collection External ID",
29514
- description: "External identifier for the collection"
29436
+ description: "Unique identifier for the collection in the Carrot platform"
29515
29437
  }),
29516
29438
  name: CollectionNameSchema,
29517
29439
  external_url: ExternalUrlSchema.meta({
29518
29440
  title: "Collection External URL",
29519
- description: "External URL for the collection"
29441
+ description: "Link to the collection page on the Carrot platform"
29520
29442
  }),
29521
29443
  ipfs_uri: IpfsUriSchema.meta({
29522
29444
  title: "Collection IPFS URI",
29523
- description: "IPFS URI for the collection metadata"
29445
+ description: "IPFS URI pointing to the immutable collection metadata record"
29524
29446
  })
29525
29447
  }).meta(meta);
29526
29448
  }
29527
29449
  var CertificateCollectionItemPurchaseSchema = zod.z.strictObject({
29528
29450
  slug: CollectionSlugSchema.meta({
29529
29451
  title: "Collection Slug",
29530
- description: "Slug of the collection"
29452
+ description: "URL-friendly identifier of the collection this certificate belongs to"
29531
29453
  }),
29532
29454
  purchased_amount: CreditAmountSchema.meta({
29533
- title: "Collection Purchased Amount",
29534
- description: "Credits purchased from this collection for this certificate"
29455
+ title: "Purchased Amount",
29456
+ description: "Number of credits purchased from this collection for this certificate"
29535
29457
  }),
29536
29458
  retired_amount: CreditAmountSchema.meta({
29537
29459
  title: "Collection Retired Amount",
@@ -29559,7 +29481,7 @@ function buildSchemaUrl(schemaPath) {
29559
29481
  return `${getSchemaBaseUrl()}/${cleanPath}`;
29560
29482
  }
29561
29483
  function getSchemaVersionOrDefault() {
29562
- return "0.2.3";
29484
+ return "0.3.0";
29563
29485
  }
29564
29486
 
29565
29487
  // src/shared/schema-validation.ts
@@ -30162,7 +30084,7 @@ var MassIDAttachmentSchema = zod.z.strictObject({
30162
30084
  })
30163
30085
  }).meta({
30164
30086
  title: "MassID Attachment",
30165
- description: "Attachment associated with a specific MassID event, linked by event_id"
30087
+ description: "Regulatory document (Transport Manifest or Recycling Manifest) linked to a specific lifecycle event via event_id"
30166
30088
  });
30167
30089
  var MassIDBaseEventSchema = zod.z.strictObject({
30168
30090
  event_id: UuidSchema.meta({
@@ -30180,7 +30102,7 @@ var MassIDBaseEventSchema = zod.z.strictObject({
30180
30102
  })
30181
30103
  }).meta({
30182
30104
  title: "MassID Base Event",
30183
- description: "Base MassID event definition shared across event types"
30105
+ description: "Common fields for all MassID lifecycle events: identifier, timestamp, participant reference, and location reference"
30184
30106
  });
30185
30107
  var buildMassIDEventSchema = (eventName, description) => MassIDBaseEventSchema.safeExtend({
30186
30108
  event_name: zod.z.literal(eventName).meta({
@@ -30206,7 +30128,7 @@ var PickUpEventSchema = buildMassIDEventSchema(
30206
30128
  })
30207
30129
  }).optional().meta({
30208
30130
  title: "Pick-up Event Data",
30209
- description: "Data associated with the pick-up event"
30131
+ description: "Optional vehicle and weight details captured during waste pick-up"
30210
30132
  })
30211
30133
  });
30212
30134
  var WeighingEventSchema = buildMassIDEventSchema(
@@ -30353,7 +30275,7 @@ var MassIDDataSchema = zod.z.strictObject({
30353
30275
  );
30354
30276
  }, "All responsible participant ID hashes in locations must exist in participants array").meta({
30355
30277
  title: "MassID Data",
30356
- description: "MassID data containing waste tracking events and supporting information"
30278
+ description: "Complete MassID data including waste properties, geographic locations, supply-chain participants, chronological lifecycle events, and regulatory attachments"
30357
30279
  });
30358
30280
  var isPickUpEvent = (event) => event.event_name === "Pick-up";
30359
30281
  var isWeighingEvent = (event) => event.event_name === "Weighing";
@@ -30361,7 +30283,7 @@ var isDropOffEvent = (event) => event.event_name === "Drop-off";
30361
30283
  var isRecyclingEvent = (event) => event.event_name === "Recycling";
30362
30284
  var MassIDIpfsSchemaMeta = {
30363
30285
  title: "MassID NFT IPFS Record",
30364
- description: "Complete MassID NFT IPFS record schema defining waste tracking metadata, chain of custody events, and NFT display attributes",
30286
+ description: "Complete MassID NFT IPFS record including waste classification, chain-of-custody lifecycle events, geographic locations, supply-chain participants, and NFT display attributes",
30365
30287
  $id: buildSchemaUrl("mass-id/mass-id.schema.json"),
30366
30288
  version: getSchemaVersionOrDefault()
30367
30289
  };
@@ -30369,7 +30291,7 @@ var MassIDIpfsSchema = NftIpfsSchema.safeExtend({
30369
30291
  schema: NftIpfsSchema.shape.schema.safeExtend({
30370
30292
  type: zod.z.literal("MassID").meta({
30371
30293
  title: "MassID Schema Type",
30372
- description: "Schema type identifier for this record"
30294
+ description: "Discriminator value identifying this record as a MassID waste-traceability certificate"
30373
30295
  })
30374
30296
  }),
30375
30297
  name: MassIDNameSchema,
@@ -30392,6 +30314,22 @@ var MassIDIpfsSchema = NftIpfsSchema.safeExtend({
30392
30314
  path: ["short_name"],
30393
30315
  message: `Short name token_id must match blockchain.token_id: ${record.blockchain.token_id}`
30394
30316
  });
30317
+ const nameSchema = createMassIDNameSchema(record.blockchain.token_id);
30318
+ validateFormattedName({
30319
+ ctx,
30320
+ name: record.name,
30321
+ schema: nameSchema,
30322
+ path: ["name"]
30323
+ });
30324
+ const shortNameSchema = createMassIDShortNameSchema(
30325
+ record.blockchain.token_id
30326
+ );
30327
+ validateFormattedName({
30328
+ ctx,
30329
+ name: record.short_name,
30330
+ schema: shortNameSchema,
30331
+ path: ["short_name"]
30332
+ });
30395
30333
  const { data, attributes } = record;
30396
30334
  const attributeByTraitType = createAttributeMap(attributes);
30397
30335
  validateAttributeValue({
@@ -30521,7 +30459,7 @@ var GasIDAttributeGasTypeSchema = NftAttributeSchema.safeExtend({
30521
30459
  value: GasTypeSchema
30522
30460
  }).meta({
30523
30461
  title: "Gas Type Attribute",
30524
- description: "Gas type attribute"
30462
+ description: "Type of greenhouse gas whose emissions were prevented (e.g., Methane (CH\u2084))"
30525
30463
  });
30526
30464
  var GasIDAttributeCo2ePreventedSchema = createNumericAttributeSchema({
30527
30465
  traitType: "CO\u2082e Prevented (kg)",
@@ -30575,7 +30513,7 @@ var GasIDSummarySchema = zod.z.strictObject({
30575
30513
  })
30576
30514
  }).meta({
30577
30515
  title: "GasID Summary",
30578
- description: "Summary information for the GasID certificate"
30516
+ description: "Key metrics for the GasID certificate including gas type, credit details, prevented emissions, and issuance timestamps"
30579
30517
  });
30580
30518
  var CalculationValueSchema = zod.z.strictObject({
30581
30519
  reference: NonEmptyStringSchema.max(3).meta({
@@ -30599,7 +30537,7 @@ var CalculationValueSchema = zod.z.strictObject({
30599
30537
  })
30600
30538
  }).meta({
30601
30539
  title: "Calculation Value",
30602
- description: "Single value used in the emissions calculation"
30540
+ description: "Named parameter or computed result used in the prevented emissions formula"
30603
30541
  });
30604
30542
  var PreventedEmissionsCalculationSchema = zod.z.strictObject({
30605
30543
  formula: NonEmptyStringSchema.max(100).meta({
@@ -30618,11 +30556,11 @@ var PreventedEmissionsCalculationSchema = zod.z.strictObject({
30618
30556
  }),
30619
30557
  values: zod.z.array(CalculationValueSchema).min(1).meta({
30620
30558
  title: "Calculation Values",
30621
- description: "Values used to calculate the prevented emissions"
30559
+ description: "Input parameters and computed result used in the prevented emissions formula"
30622
30560
  })
30623
30561
  }).meta({
30624
30562
  title: "Prevented Emissions Calculation",
30625
- description: "Details of the prevented emissions calculation"
30563
+ description: "Methodology-based calculation of prevented CO\u2082e emissions, including formula, method, input values, and computation timestamp"
30626
30564
  });
30627
30565
  var GasIDDataSchema = zod.z.strictObject({
30628
30566
  summary: GasIDSummarySchema,
@@ -30632,16 +30570,16 @@ var GasIDDataSchema = zod.z.strictObject({
30632
30570
  waste_properties: WastePropertiesSchema,
30633
30571
  origin_location: LocationSchema.meta({
30634
30572
  title: "Source Waste Origin Location",
30635
- description: "Location of the waste origin"
30573
+ description: "Geographic location where the source waste was originally collected"
30636
30574
  }),
30637
30575
  prevented_emissions_calculation: PreventedEmissionsCalculationSchema
30638
30576
  }).meta({
30639
30577
  title: "GasID Data",
30640
- description: "Complete data structure for GasID certificate"
30578
+ description: "Complete GasID certificate data including summary metrics, methodology reference, audit trail, source MassID, waste properties, origin location, and emissions calculation"
30641
30579
  });
30642
30580
  var GasIDIpfsSchemaMeta = {
30643
30581
  title: "GasID NFT IPFS Record",
30644
- description: "Complete GasID NFT IPFS record including fixed attributes and detailed carbon emissions prevention data",
30582
+ description: "Complete GasID NFT IPFS record including prevented emissions calculation, source waste provenance, methodology reference, and NFT display attributes",
30645
30583
  $id: buildSchemaUrl("gas-id/gas-id.schema.json"),
30646
30584
  version: getSchemaVersionOrDefault()
30647
30585
  };
@@ -30649,7 +30587,7 @@ var GasIDIpfsSchema = NftIpfsSchema.safeExtend({
30649
30587
  schema: NftIpfsSchema.shape.schema.safeExtend({
30650
30588
  type: zod.z.literal("GasID").meta({
30651
30589
  title: "GasID Schema Type",
30652
- description: "GasID NFT schema type"
30590
+ description: "Discriminator value identifying this record as a GasID prevented-emissions certificate"
30653
30591
  })
30654
30592
  }),
30655
30593
  name: GasIDNameSchema,
@@ -30859,7 +30797,7 @@ var RecycledIDSummarySchema = zod.z.strictObject({
30859
30797
  })
30860
30798
  }).meta({
30861
30799
  title: "RecycledID Summary",
30862
- description: "Summary information for the RecycledID certificate"
30800
+ description: "Key metrics for the RecycledID certificate including recycled weight, credit details, and issuance timestamps"
30863
30801
  });
30864
30802
  var RecycledIDDataSchema = zod.z.strictObject({
30865
30803
  summary: RecycledIDSummarySchema,
@@ -30869,15 +30807,15 @@ var RecycledIDDataSchema = zod.z.strictObject({
30869
30807
  waste_properties: WastePropertiesSchema,
30870
30808
  origin_location: LocationSchema.meta({
30871
30809
  title: "RecycledID Origin Location",
30872
- description: "Source waste origin location details"
30810
+ description: "Geographic location where the source waste was originally collected"
30873
30811
  })
30874
30812
  }).meta({
30875
30813
  title: "RecycledID Data",
30876
- description: "Complete data structure for RecycledID certificate"
30814
+ description: "Complete RecycledID certificate data including summary metrics, methodology reference, audit trail, source MassID, waste properties, and origin location"
30877
30815
  });
30878
30816
  var RecycledIDIpfsSchemaMeta = {
30879
30817
  title: "RecycledID NFT IPFS Record",
30880
- description: "Complete RecycledID NFT IPFS record including fixed attributes and recycling outcome data",
30818
+ description: "Complete RecycledID NFT IPFS record including recycling outcome metrics, source waste provenance, methodology reference, and NFT display attributes",
30881
30819
  $id: buildSchemaUrl("recycled-id/recycled-id.schema.json"),
30882
30820
  version: getSchemaVersionOrDefault()
30883
30821
  };
@@ -30885,7 +30823,7 @@ var RecycledIDIpfsSchema = NftIpfsSchema.safeExtend({
30885
30823
  schema: NftIpfsSchema.shape.schema.safeExtend({
30886
30824
  type: zod.z.literal("RecycledID").meta({
30887
30825
  title: "RecycledID Schema Type",
30888
- description: "RecycledID NFT schema type"
30826
+ description: "Discriminator value identifying this record as a RecycledID recycling-outcome certificate"
30889
30827
  })
30890
30828
  }),
30891
30829
  name: RecycledIDNameSchema,
@@ -31163,7 +31101,7 @@ var CreditPurchaseReceiptDataSchema = zod.z.strictObject({
31163
31101
  "Collection slugs must be unique"
31164
31102
  ).min(1).meta({
31165
31103
  title: "Collections",
31166
- description: "Collections included in the purchase"
31104
+ description: "Impact collections referenced by this purchase, each identified by a unique slug"
31167
31105
  }),
31168
31106
  credits: uniqueBy(
31169
31107
  CreditPurchaseReceiptCreditSchema,
@@ -31171,7 +31109,7 @@ var CreditPurchaseReceiptDataSchema = zod.z.strictObject({
31171
31109
  "Credit slugs must be unique"
31172
31110
  ).min(1).meta({
31173
31111
  title: "Credits",
31174
- description: "Credits included in the purchase"
31112
+ description: "Credit token types involved in this purchase, each identified by a unique slug and symbol"
31175
31113
  }),
31176
31114
  certificates: uniqueBy(
31177
31115
  CreditPurchaseReceiptCertificateSchema,
@@ -31179,7 +31117,7 @@ var CreditPurchaseReceiptDataSchema = zod.z.strictObject({
31179
31117
  "Certificate token_ids must be unique"
31180
31118
  ).min(1).meta({
31181
31119
  title: "Certificates",
31182
- description: "Certificates involved in the purchase"
31120
+ description: "Environmental certificates allocated in this purchase, each linking a credit type to collection-level purchased and retired amounts"
31183
31121
  }),
31184
31122
  retirement_receipt: CreditPurchaseReceiptRetirementReceiptSchema.optional()
31185
31123
  }).superRefine((data, ctx) => {
@@ -31279,7 +31217,7 @@ var CreditPurchaseReceiptDataSchema = zod.z.strictObject({
31279
31217
  });
31280
31218
  var CreditPurchaseReceiptIpfsSchemaMeta = {
31281
31219
  title: "CreditPurchaseReceipt NFT IPFS Record",
31282
- description: "Complete CreditPurchaseReceipt NFT IPFS record including attributes and credit purchase data",
31220
+ description: "Complete CreditPurchaseReceipt NFT IPFS record including purchase summary, buyer details, credit breakdowns, certificate allocations, and NFT display attributes",
31283
31221
  $id: buildSchemaUrl(
31284
31222
  "credit-purchase-receipt/credit-purchase-receipt.schema.json"
31285
31223
  ),
@@ -31289,7 +31227,7 @@ var CreditPurchaseReceiptIpfsSchema = NftIpfsSchema.safeExtend({
31289
31227
  schema: NftIpfsSchema.shape.schema.safeExtend({
31290
31228
  type: zod.z.literal("CreditPurchaseReceipt").meta({
31291
31229
  title: "CreditPurchaseReceipt Schema Type",
31292
- description: "Schema type identifier for this record"
31230
+ description: "Discriminator value identifying this record as a CreditPurchaseReceipt transaction proof"
31293
31231
  })
31294
31232
  }),
31295
31233
  name: CreditPurchaseReceiptNameSchema,
@@ -31625,7 +31563,7 @@ var CreditRetirementReceiptDataSchema = zod.z.strictObject({
31625
31563
  "Collection slugs must be unique"
31626
31564
  ).min(1).meta({
31627
31565
  title: "Collections",
31628
- description: "Collections included in the retirement"
31566
+ description: "Impact collections referenced by this retirement, each identified by a unique slug"
31629
31567
  }),
31630
31568
  credits: uniqueBy(
31631
31569
  CreditRetirementReceiptCreditSchema,
@@ -31633,7 +31571,7 @@ var CreditRetirementReceiptDataSchema = zod.z.strictObject({
31633
31571
  "Credit slugs must be unique"
31634
31572
  ).min(1).meta({
31635
31573
  title: "Credits",
31636
- description: "Credits included in the retirement"
31574
+ description: "Credit token types retired in this receipt, each identified by a unique slug and symbol"
31637
31575
  }),
31638
31576
  certificates: uniqueBy(
31639
31577
  CreditRetirementReceiptCertificateSchema,
@@ -31641,7 +31579,7 @@ var CreditRetirementReceiptDataSchema = zod.z.strictObject({
31641
31579
  "Certificate token_ids must be unique"
31642
31580
  ).min(1).meta({
31643
31581
  title: "Certificates",
31644
- description: "Certificates retired in this receipt"
31582
+ description: "Environmental certificates retired in this receipt, each linking collection-level retired amounts to per-credit breakdowns"
31645
31583
  }),
31646
31584
  purchase_receipt: CreditPurchaseReceiptReferenceSchema.optional()
31647
31585
  }).superRefine((data, ctx) => {
@@ -31766,7 +31704,7 @@ var CreditRetirementReceiptDataSchema = zod.z.strictObject({
31766
31704
  });
31767
31705
  var CreditRetirementReceiptIpfsSchemaMeta = {
31768
31706
  title: "CreditRetirementReceipt NFT IPFS Record",
31769
- description: "Complete CreditRetirementReceipt NFT IPFS record including attributes and credit retirement data",
31707
+ description: "Complete CreditRetirementReceipt NFT IPFS record including retirement summary, beneficiary and credit holder details, credit breakdowns, certificate allocations, and NFT display attributes",
31770
31708
  $id: buildSchemaUrl(
31771
31709
  "credit-retirement-receipt/credit-retirement-receipt.schema.json"
31772
31710
  ),
@@ -31776,7 +31714,7 @@ var CreditRetirementReceiptIpfsSchema = NftIpfsSchema.safeExtend({
31776
31714
  schema: NftIpfsSchema.shape.schema.safeExtend({
31777
31715
  type: zod.z.literal("CreditRetirementReceipt").meta({
31778
31716
  title: "CreditRetirementReceipt Schema Type",
31779
- description: "Schema type identifier for this record"
31717
+ description: "Discriminator value identifying this record as a CreditRetirementReceipt permanent-offset proof"
31780
31718
  })
31781
31719
  }),
31782
31720
  name: CreditRetirementReceiptNameSchema,
@@ -31929,7 +31867,7 @@ var CollectionSchema = BaseIpfsSchema.safeExtend({
31929
31867
  schema: BaseIpfsSchema.shape.schema.safeExtend({
31930
31868
  type: zod.z.literal("Collection").meta({
31931
31869
  title: "Collection Schema Type",
31932
- description: "Schema type identifier for this record"
31870
+ description: "Discriminator value identifying this record as a Collection grouping of credits and receipts"
31933
31871
  })
31934
31872
  }),
31935
31873
  data: zod.z.record(zod.z.string(), zod.z.unknown()).optional().meta({
@@ -31963,7 +31901,7 @@ var CreditSchema = BaseIpfsSchema.safeExtend({
31963
31901
  schema: BaseIpfsSchema.shape.schema.safeExtend({
31964
31902
  type: zod.z.literal("Credit").meta({
31965
31903
  title: "Credit Schema Type",
31966
- description: "Schema type identifier for this record"
31904
+ description: "Discriminator value identifying this record as a Credit environmental-impact token"
31967
31905
  })
31968
31906
  }),
31969
31907
  data: zod.z.record(zod.z.string(), zod.z.unknown()).optional().meta({
@@ -31989,7 +31927,7 @@ var CreditSchema = BaseIpfsSchema.safeExtend({
31989
31927
  title: "Token Description",
31990
31928
  description: "Comprehensive description of the credit token, its purpose, and impact",
31991
31929
  examples: [
31992
- "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."
31930
+ "Carrot Carbon (C-CARB.CH4) represents verified prevented emissions from organic waste composting projects. Each token equals one metric ton of CO\u2082 equivalent (CO\u2082e) prevented from entering the atmosphere through sustainable waste management practices."
31993
31931
  ]
31994
31932
  })
31995
31933
  }).meta(CreditSchemaMeta);
@@ -31999,7 +31937,7 @@ var MethodologyDataSchema = zod.z.strictObject({
31999
31937
  slug: MethodologySlugSchema,
32000
31938
  version: SemanticVersionSchema.meta({
32001
31939
  title: "Methodology Version",
32002
- description: "Version of the methodology"
31940
+ description: "Semantic version of this methodology revision (e.g., 1.0.0)"
32003
31941
  }),
32004
31942
  description: zod.z.string().min(50).max(2e3).meta({
32005
31943
  title: "Methodology Description",
@@ -32029,7 +31967,7 @@ var MethodologyDataSchema = zod.z.strictObject({
32029
31967
  // src/methodology/methodology.schema.ts
32030
31968
  var MethodologySchemaMeta = {
32031
31969
  title: "Methodology IPFS Record",
32032
- description: "Methodology metadata stored in IPFS, extending the base schema with methodology data and audit rules",
31970
+ description: "Methodology metadata stored in IPFS, defining the environmental impact measurement approach including versioning, documentation, and MassID audit rules",
32033
31971
  $id: buildSchemaUrl("methodology/methodology.schema.json"),
32034
31972
  version: getSchemaVersionOrDefault()
32035
31973
  };
@@ -32037,7 +31975,7 @@ var MethodologySchema = BaseIpfsSchema.safeExtend({
32037
31975
  schema: BaseIpfsSchema.shape.schema.safeExtend({
32038
31976
  type: zod.z.literal("Methodology").meta({
32039
31977
  title: "Methodology Schema Type",
32040
- description: "Schema type identifier for this record"
31978
+ description: "Discriminator value identifying this record as a Methodology impact-measurement definition"
32041
31979
  })
32042
31980
  }),
32043
31981
  data: MethodologyDataSchema
@@ -32067,7 +32005,7 @@ var MassIDAuditSummarySchema = zod.z.strictObject({
32067
32005
  }
32068
32006
  }).meta({
32069
32007
  title: "Audit Summary",
32070
- description: "Summary of audit execution results"
32008
+ description: "Overview of the audit execution including start time, completion time, and overall pass/fail result"
32071
32009
  });
32072
32010
  var MassIDAuditDataSchema = zod.z.strictObject({
32073
32011
  methodology: MethodologyReferenceSchema,
@@ -32077,9 +32015,9 @@ var MassIDAuditDataSchema = zod.z.strictObject({
32077
32015
  audit_summary: MassIDAuditSummarySchema,
32078
32016
  rule_execution_results: AuditRuleExecutionResultsSchema
32079
32017
  }).superRefine((data, ctx) => {
32080
- const hasGasId = !!data.gas_id;
32081
- const hasRecycledId = !!data.recycled_id;
32082
- if (!hasGasId && !hasRecycledId) {
32018
+ const hasGasID = !!data.gas_id;
32019
+ const hasRecycledID = !!data.recycled_id;
32020
+ if (!hasGasID && !hasRecycledID) {
32083
32021
  ctx.addIssue({
32084
32022
  code: "custom",
32085
32023
  path: ["gas_id"],
@@ -32091,7 +32029,7 @@ var MassIDAuditDataSchema = zod.z.strictObject({
32091
32029
  message: "Either gas_id or recycled_id must be provided"
32092
32030
  });
32093
32031
  }
32094
- if (hasGasId && hasRecycledId) {
32032
+ if (hasGasID && hasRecycledID) {
32095
32033
  ctx.addIssue({
32096
32034
  code: "custom",
32097
32035
  path: ["gas_id"],
@@ -32111,7 +32049,7 @@ var MassIDAuditDataSchema = zod.z.strictObject({
32111
32049
  // src/mass-id-audit/mass-id-audit.schema.ts
32112
32050
  var MassIDAuditSchemaMeta = {
32113
32051
  title: "MassID Audit IPFS Record",
32114
- description: "MassID audit metadata stored in IPFS, extending the base schema with audit results and references",
32052
+ description: "MassID audit record stored in IPFS, containing methodology reference, audit summary, rule execution results, and links to the source MassID and resulting GasID or RecycledID",
32115
32053
  $id: buildSchemaUrl("mass-id-audit/mass-id-audit.schema.json"),
32116
32054
  version: getSchemaVersionOrDefault()
32117
32055
  };
@@ -32119,12 +32057,11 @@ var MassIDAuditSchema = BaseIpfsSchema.safeExtend({
32119
32057
  schema: BaseIpfsSchema.shape.schema.safeExtend({
32120
32058
  type: zod.z.literal("MassID Audit").meta({
32121
32059
  title: "MassID Audit Schema Type",
32122
- description: "MassID Audit schema type"
32060
+ description: "Discriminator value identifying this record as a MassID Audit methodology-rule execution report"
32123
32061
  })
32124
32062
  }),
32125
32063
  data: MassIDAuditDataSchema
32126
32064
  }).meta(MassIDAuditSchemaMeta);
32127
- /* v8 ignore file -- @preserve */
32128
32065
 
32129
32066
  exports.ALLOWED_BLOCKCHAIN_NETWORKS = ALLOWED_BLOCKCHAIN_NETWORKS;
32130
32067
  exports.AuditReferenceSchema = AuditReferenceSchema;