@carrot-foundation/schemas 0.5.0 → 1.0.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.
package/dist/index.cjs CHANGED
@@ -28142,12 +28142,11 @@ var StringifiedTokenIdSchema = NonEmptyStringSchema.regex(
28142
28142
  examples: ["#456789", "#1000000"],
28143
28143
  example: "#456789"
28144
28144
  });
28145
- var Sha256HashSchema = zod.z.hash("sha256", {
28146
- error: "Must be a SHA256 hash as 32-byte hex string"
28145
+ var Sha256HashSchema = zod.z.string().regex(/^[a-f0-9]{64}$/, {
28146
+ error: "Must be a SHA-256 hash as 32-byte lowercase hex string (no 0x prefix)"
28147
28147
  }).meta({
28148
- format: void 0,
28149
28148
  title: "SHA-256 Hash",
28150
- description: "SHA-256 cryptographic hash as hexadecimal string",
28149
+ description: "SHA-256 cryptographic hash as canonical lowercase hexadecimal string",
28151
28150
  examples: [
28152
28151
  "87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489"
28153
28152
  ]
@@ -28610,7 +28609,7 @@ var NftIpfsSchema = BaseIpfsSchema.safeExtend({
28610
28609
  "External link URLs must be unique"
28611
28610
  ).optional().meta({
28612
28611
  title: "External Links",
28613
- description: "Optional list of public resource links with labels"
28612
+ description: "Supplementary reference links (label, URL, optional description) displayed on the NFT page"
28614
28613
  }),
28615
28614
  attributes: uniqueBy(
28616
28615
  NftAttributeSchema,
@@ -29422,7 +29421,7 @@ var ReceiptIdentitySchema = zod.z.strictObject({
29422
29421
  }),
29423
29422
  external_id: ExternalIdSchema.optional().meta({
29424
29423
  title: "Identity External ID",
29425
- description: "Unique identifier for the buyer or beneficiary in the Carrot platform"
29424
+ description: "Unique identifier of the associated entity in the Carrot platform"
29426
29425
  }),
29427
29426
  external_url: ExternalUrlSchema.optional().meta({
29428
29427
  title: "Identity External URL",
@@ -29491,7 +29490,7 @@ function buildSchemaUrl(schemaPath) {
29491
29490
  return `${getSchemaBaseUrl()}/${cleanPath}`;
29492
29491
  }
29493
29492
  function getSchemaVersionOrDefault() {
29494
- return "0.5.0";
29493
+ return "1.0.0";
29495
29494
  }
29496
29495
 
29497
29496
  // src/shared/schema-validation.ts
@@ -30065,7 +30064,7 @@ var MassIDWastePropertiesSchema = zod.z.strictObject({
30065
30064
  local_classification: MassIDLocalClassificationSchema.optional(),
30066
30065
  weight_kg: WeightKgSchema.meta({
30067
30066
  title: "Net Weight",
30068
- description: "Net weight of the waste batch in kilograms (kg)",
30067
+ description: "Weight in kilograms of the entire waste batch tracked through the chain of custody",
30069
30068
  examples: [3e3]
30070
30069
  })
30071
30070
  }).meta({
@@ -30108,7 +30107,7 @@ var MassIDBaseEventSchema = zod.z.strictObject({
30108
30107
  participant_id_hash: ParticipantIdHashSchema,
30109
30108
  location_id_hash: Sha256HashSchema.meta({
30110
30109
  title: "Location ID Hash",
30111
- description: "Reference to location in the locations array"
30110
+ description: "Hash reference to the geographic location where this event occurred; matches an entry in `data.locations`"
30112
30111
  })
30113
30112
  }).meta({
30114
30113
  title: "MassID Base Event",
@@ -31042,7 +31041,7 @@ var CreditPurchaseReceiptBuyerAttributeSchema = NftAttributeSchema.omit({
31042
31041
  var CreditPurchaseReceiptRetirementDateAttributeSchema = createDateAttributeSchema({
31043
31042
  traitType: "Retirement Date",
31044
31043
  title: "Retirement Date",
31045
- description: "Unix timestamp in milliseconds when credits were retired (if retirement occurred)"
31044
+ description: "Unix timestamp in milliseconds when credits were retired; present in the attributes array only when the purchase has been retired (data.retirement_receipt is set)"
31046
31045
  });
31047
31046
  var CreditPurchaseReceiptRetirementReceiptAttributeSchema = NftAttributeSchema.safeExtend({
31048
31047
  trait_type: zod.z.literal("Retirement Receipt"),
@@ -31086,18 +31085,18 @@ var CreditPurchaseReceiptAttributesSchema = createOrderedAttributesSchema({
31086
31085
  });
31087
31086
  var CreditPurchaseReceiptIdentitySchema = ReceiptIdentitySchema;
31088
31087
  var CreditPurchaseReceiptBuyerSchema = zod.z.strictObject({
31089
- wallet_address: EthereumAddressSchema.meta({
31088
+ id_hash: Sha256HashSchema.meta({
31089
+ title: "Buyer ID Hash",
31090
+ description: "Anonymized pseudonymous identifier linking this buyer to off-chain records via a keyed hash"
31091
+ }),
31092
+ wallet_address: EthereumAddressSchema.optional().meta({
31090
31093
  title: "Buyer Wallet Address",
31091
31094
  description: "Ethereum address receiving the credits"
31092
31095
  }),
31093
- id: ExternalIdSchema.optional().meta({
31094
- title: "Buyer ID",
31095
- description: "Unique identifier for the buyer"
31096
- }),
31097
31096
  identity: CreditPurchaseReceiptIdentitySchema.optional()
31098
31097
  }).meta({
31099
31098
  title: "Buyer",
31100
- description: "Buyer information including wallet address, optional ID, and optional identity"
31099
+ description: "Buyer information including hashed identifier, optional wallet address, and optional identity"
31101
31100
  });
31102
31101
  var CreditPurchaseReceiptCollectionSchema = createReceiptCollectionSchema({
31103
31102
  meta: {
@@ -31513,24 +31512,32 @@ var CreditRetirementReceiptAttributesSchema = createOrderedAttributesSchema({
31513
31512
  });
31514
31513
  var CreditRetirementReceiptIdentitySchema = ReceiptIdentitySchema;
31515
31514
  var CreditRetirementReceiptBeneficiarySchema = zod.z.strictObject({
31516
- beneficiary_id: ExternalIdSchema.meta({
31517
- title: "Retirement Beneficiary ID",
31518
- description: "UUID identifying the beneficiary of the retirement (bytes16 normalized to UUID)"
31515
+ id_hash: Sha256HashSchema.meta({
31516
+ title: "Beneficiary ID Hash",
31517
+ description: "Anonymized pseudonymous identifier linking this beneficiary to off-chain records via a keyed hash"
31518
+ }),
31519
+ wallet_address: EthereumAddressSchema.optional().meta({
31520
+ title: "Beneficiary Wallet Address",
31521
+ description: "Ethereum address associated with the beneficiary, when available"
31519
31522
  }),
31520
31523
  identity: CreditRetirementReceiptIdentitySchema.optional()
31521
31524
  }).meta({
31522
31525
  title: "Beneficiary",
31523
- description: "Beneficiary receiving the retirement benefit"
31526
+ description: "Beneficiary receiving the retirement benefit, identified by a hashed identifier with optional wallet address and identity"
31524
31527
  });
31525
31528
  var CreditRetirementReceiptCreditHolderSchema = zod.z.strictObject({
31526
- wallet_address: EthereumAddressSchema.meta({
31529
+ id_hash: Sha256HashSchema.meta({
31530
+ title: "Credit Holder ID Hash",
31531
+ description: "Anonymized pseudonymous identifier linking this credit holder to off-chain records via a keyed hash"
31532
+ }),
31533
+ wallet_address: EthereumAddressSchema.optional().meta({
31527
31534
  title: "Credit Holder Wallet Address",
31528
- description: "Ethereum address of the credit holder surrendering credits"
31535
+ description: "Ethereum address of the wallet that held and surrendered the credits"
31529
31536
  }),
31530
31537
  identity: CreditRetirementReceiptIdentitySchema.optional()
31531
31538
  }).meta({
31532
31539
  title: "Credit Holder",
31533
- description: "Credit holder wallet and optional identity information"
31540
+ description: "Credit holder information including hashed identifier, optional wallet address, and optional identity"
31534
31541
  });
31535
31542
  var CreditRetirementReceiptCollectionSchema = createReceiptCollectionSchema({
31536
31543
  meta: {