@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.js CHANGED
@@ -28136,12 +28136,11 @@ var StringifiedTokenIdSchema = NonEmptyStringSchema.regex(
28136
28136
  examples: ["#456789", "#1000000"],
28137
28137
  example: "#456789"
28138
28138
  });
28139
- var Sha256HashSchema = z.hash("sha256", {
28140
- error: "Must be a SHA256 hash as 32-byte hex string"
28139
+ var Sha256HashSchema = z.string().regex(/^[a-f0-9]{64}$/, {
28140
+ error: "Must be a SHA-256 hash as 32-byte lowercase hex string (no 0x prefix)"
28141
28141
  }).meta({
28142
- format: void 0,
28143
28142
  title: "SHA-256 Hash",
28144
- description: "SHA-256 cryptographic hash as hexadecimal string",
28143
+ description: "SHA-256 cryptographic hash as canonical lowercase hexadecimal string",
28145
28144
  examples: [
28146
28145
  "87f633634cc4b02f628685651f0a29b7bfa22a0bd841f725c6772dd00a58d489"
28147
28146
  ]
@@ -28604,7 +28603,7 @@ var NftIpfsSchema = BaseIpfsSchema.safeExtend({
28604
28603
  "External link URLs must be unique"
28605
28604
  ).optional().meta({
28606
28605
  title: "External Links",
28607
- description: "Optional list of public resource links with labels"
28606
+ description: "Supplementary reference links (label, URL, optional description) displayed on the NFT page"
28608
28607
  }),
28609
28608
  attributes: uniqueBy(
28610
28609
  NftAttributeSchema,
@@ -29416,7 +29415,7 @@ var ReceiptIdentitySchema = z.strictObject({
29416
29415
  }),
29417
29416
  external_id: ExternalIdSchema.optional().meta({
29418
29417
  title: "Identity External ID",
29419
- description: "Unique identifier for the buyer or beneficiary in the Carrot platform"
29418
+ description: "Unique identifier of the associated entity in the Carrot platform"
29420
29419
  }),
29421
29420
  external_url: ExternalUrlSchema.optional().meta({
29422
29421
  title: "Identity External URL",
@@ -29485,7 +29484,7 @@ function buildSchemaUrl(schemaPath) {
29485
29484
  return `${getSchemaBaseUrl()}/${cleanPath}`;
29486
29485
  }
29487
29486
  function getSchemaVersionOrDefault() {
29488
- return "0.5.0";
29487
+ return "1.0.0";
29489
29488
  }
29490
29489
 
29491
29490
  // src/shared/schema-validation.ts
@@ -30059,7 +30058,7 @@ var MassIDWastePropertiesSchema = z.strictObject({
30059
30058
  local_classification: MassIDLocalClassificationSchema.optional(),
30060
30059
  weight_kg: WeightKgSchema.meta({
30061
30060
  title: "Net Weight",
30062
- description: "Net weight of the waste batch in kilograms (kg)",
30061
+ description: "Weight in kilograms of the entire waste batch tracked through the chain of custody",
30063
30062
  examples: [3e3]
30064
30063
  })
30065
30064
  }).meta({
@@ -30102,7 +30101,7 @@ var MassIDBaseEventSchema = z.strictObject({
30102
30101
  participant_id_hash: ParticipantIdHashSchema,
30103
30102
  location_id_hash: Sha256HashSchema.meta({
30104
30103
  title: "Location ID Hash",
30105
- description: "Reference to location in the locations array"
30104
+ description: "Hash reference to the geographic location where this event occurred; matches an entry in `data.locations`"
30106
30105
  })
30107
30106
  }).meta({
30108
30107
  title: "MassID Base Event",
@@ -31036,7 +31035,7 @@ var CreditPurchaseReceiptBuyerAttributeSchema = NftAttributeSchema.omit({
31036
31035
  var CreditPurchaseReceiptRetirementDateAttributeSchema = createDateAttributeSchema({
31037
31036
  traitType: "Retirement Date",
31038
31037
  title: "Retirement Date",
31039
- description: "Unix timestamp in milliseconds when credits were retired (if retirement occurred)"
31038
+ 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)"
31040
31039
  });
31041
31040
  var CreditPurchaseReceiptRetirementReceiptAttributeSchema = NftAttributeSchema.safeExtend({
31042
31041
  trait_type: z.literal("Retirement Receipt"),
@@ -31080,18 +31079,18 @@ var CreditPurchaseReceiptAttributesSchema = createOrderedAttributesSchema({
31080
31079
  });
31081
31080
  var CreditPurchaseReceiptIdentitySchema = ReceiptIdentitySchema;
31082
31081
  var CreditPurchaseReceiptBuyerSchema = z.strictObject({
31083
- wallet_address: EthereumAddressSchema.meta({
31082
+ id_hash: Sha256HashSchema.meta({
31083
+ title: "Buyer ID Hash",
31084
+ description: "Anonymized pseudonymous identifier linking this buyer to off-chain records via a keyed hash"
31085
+ }),
31086
+ wallet_address: EthereumAddressSchema.optional().meta({
31084
31087
  title: "Buyer Wallet Address",
31085
31088
  description: "Ethereum address receiving the credits"
31086
31089
  }),
31087
- id: ExternalIdSchema.optional().meta({
31088
- title: "Buyer ID",
31089
- description: "Unique identifier for the buyer"
31090
- }),
31091
31090
  identity: CreditPurchaseReceiptIdentitySchema.optional()
31092
31091
  }).meta({
31093
31092
  title: "Buyer",
31094
- description: "Buyer information including wallet address, optional ID, and optional identity"
31093
+ description: "Buyer information including hashed identifier, optional wallet address, and optional identity"
31095
31094
  });
31096
31095
  var CreditPurchaseReceiptCollectionSchema = createReceiptCollectionSchema({
31097
31096
  meta: {
@@ -31507,24 +31506,32 @@ var CreditRetirementReceiptAttributesSchema = createOrderedAttributesSchema({
31507
31506
  });
31508
31507
  var CreditRetirementReceiptIdentitySchema = ReceiptIdentitySchema;
31509
31508
  var CreditRetirementReceiptBeneficiarySchema = z.strictObject({
31510
- beneficiary_id: ExternalIdSchema.meta({
31511
- title: "Retirement Beneficiary ID",
31512
- description: "UUID identifying the beneficiary of the retirement (bytes16 normalized to UUID)"
31509
+ id_hash: Sha256HashSchema.meta({
31510
+ title: "Beneficiary ID Hash",
31511
+ description: "Anonymized pseudonymous identifier linking this beneficiary to off-chain records via a keyed hash"
31512
+ }),
31513
+ wallet_address: EthereumAddressSchema.optional().meta({
31514
+ title: "Beneficiary Wallet Address",
31515
+ description: "Ethereum address associated with the beneficiary, when available"
31513
31516
  }),
31514
31517
  identity: CreditRetirementReceiptIdentitySchema.optional()
31515
31518
  }).meta({
31516
31519
  title: "Beneficiary",
31517
- description: "Beneficiary receiving the retirement benefit"
31520
+ description: "Beneficiary receiving the retirement benefit, identified by a hashed identifier with optional wallet address and identity"
31518
31521
  });
31519
31522
  var CreditRetirementReceiptCreditHolderSchema = z.strictObject({
31520
- wallet_address: EthereumAddressSchema.meta({
31523
+ id_hash: Sha256HashSchema.meta({
31524
+ title: "Credit Holder ID Hash",
31525
+ description: "Anonymized pseudonymous identifier linking this credit holder to off-chain records via a keyed hash"
31526
+ }),
31527
+ wallet_address: EthereumAddressSchema.optional().meta({
31521
31528
  title: "Credit Holder Wallet Address",
31522
- description: "Ethereum address of the credit holder surrendering credits"
31529
+ description: "Ethereum address of the wallet that held and surrendered the credits"
31523
31530
  }),
31524
31531
  identity: CreditRetirementReceiptIdentitySchema.optional()
31525
31532
  }).meta({
31526
31533
  title: "Credit Holder",
31527
- description: "Credit holder wallet and optional identity information"
31534
+ description: "Credit holder information including hashed identifier, optional wallet address, and optional identity"
31528
31535
  });
31529
31536
  var CreditRetirementReceiptCollectionSchema = createReceiptCollectionSchema({
31530
31537
  meta: {