@carrot-foundation/schemas 0.1.49 → 0.1.51
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 +213 -229
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +176 -168
- package/dist/index.d.ts +176 -168
- package/dist/index.js +208 -228
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/ipfs/collection/collection.example.json +5 -5
- package/schemas/ipfs/collection/collection.schema.json +2 -2
- package/schemas/ipfs/credit/credit.example.json +5 -5
- package/schemas/ipfs/credit/credit.schema.json +2 -2
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.example.json +8 -8
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json +6 -17
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.example.json +7 -7
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.schema.json +5 -16
- package/schemas/ipfs/gas-id/gas-id.example.json +17 -15
- package/schemas/ipfs/gas-id/gas-id.schema.json +29 -17
- package/schemas/ipfs/mass-id/mass-id.example.json +13 -13
- package/schemas/ipfs/mass-id/mass-id.schema.json +31 -62
- package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +150 -150
- package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +2 -2
- package/schemas/ipfs/methodology/methodology.example.json +89 -89
- package/schemas/ipfs/methodology/methodology.schema.json +2 -2
- package/schemas/ipfs/recycled-id/recycled-id.example.json +17 -15
- package/schemas/ipfs/recycled-id/recycled-id.schema.json +24 -13
- package/schemas/schema-hashes.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -43,8 +43,8 @@ var NonNegativeFloatSchema = zod.z.number().min(0).meta({
|
|
|
43
43
|
examples: [0, 45.2, 72.5]
|
|
44
44
|
});
|
|
45
45
|
var WeightKgSchema = NonNegativeFloatSchema.meta({
|
|
46
|
-
title: "Weight
|
|
47
|
-
description: "Weight measurement in kilograms",
|
|
46
|
+
title: "Weight",
|
|
47
|
+
description: "Weight measurement in kilograms (kg)",
|
|
48
48
|
examples: [500.35, 3e3]
|
|
49
49
|
});
|
|
50
50
|
var PercentageSchema = NonNegativeFloatSchema.max(100).meta({
|
|
@@ -28225,6 +28225,11 @@ var CreditTypeSchema = zod.z.enum(["Biowaste", "Carbon (CH\u2084)"]).meta({
|
|
|
28225
28225
|
description: "Type of credit issued",
|
|
28226
28226
|
examples: ["Biowaste", "Carbon (CH\u2084)"]
|
|
28227
28227
|
});
|
|
28228
|
+
var GasTypeSchema = zod.z.enum(["Methane (CH\u2084)"]).meta({
|
|
28229
|
+
title: "Gas Type",
|
|
28230
|
+
description: "Type of gas prevented",
|
|
28231
|
+
examples: ["Methane (CH\u2084)"]
|
|
28232
|
+
});
|
|
28228
28233
|
var VehicleTypeSchema = zod.z.enum([
|
|
28229
28234
|
"Bicycle",
|
|
28230
28235
|
"Boat",
|
|
@@ -28600,6 +28605,70 @@ var NftIpfsSchema = BaseIpfsSchema.safeExtend({
|
|
|
28600
28605
|
title: "NFT IPFS Record",
|
|
28601
28606
|
description: "NFT-specific fields for Carrot IPFS records"
|
|
28602
28607
|
});
|
|
28608
|
+
function getSchemaMetadata(schema) {
|
|
28609
|
+
return schema._def?.metadata;
|
|
28610
|
+
}
|
|
28611
|
+
function mergeSchemaMeta(schema, newMeta) {
|
|
28612
|
+
const baseMeta = getSchemaMetadata(schema);
|
|
28613
|
+
const merged = {
|
|
28614
|
+
title: newMeta.title,
|
|
28615
|
+
description: newMeta.description
|
|
28616
|
+
};
|
|
28617
|
+
if (baseMeta?.examples) {
|
|
28618
|
+
merged.examples = baseMeta.examples;
|
|
28619
|
+
}
|
|
28620
|
+
return merged;
|
|
28621
|
+
}
|
|
28622
|
+
function createDateAttributeSchema(params) {
|
|
28623
|
+
const { omitMaxValue = true } = params;
|
|
28624
|
+
const base = omitMaxValue ? NftAttributeSchema.omit({ max_value: true }) : NftAttributeSchema;
|
|
28625
|
+
const descriptionLower = params.description.toLowerCase();
|
|
28626
|
+
const alreadyMentionsUnix = descriptionLower.includes("unix") || descriptionLower.includes("unix timestamp");
|
|
28627
|
+
const metaDescription = alreadyMentionsUnix ? `${params.description} attribute` : `${params.description} attribute using Unix timestamp in milliseconds`;
|
|
28628
|
+
return base.safeExtend({
|
|
28629
|
+
trait_type: zod.z.literal(params.traitType),
|
|
28630
|
+
value: UnixTimestampSchema.meta(
|
|
28631
|
+
mergeSchemaMeta(UnixTimestampSchema, {
|
|
28632
|
+
title: params.title,
|
|
28633
|
+
description: params.description
|
|
28634
|
+
})
|
|
28635
|
+
),
|
|
28636
|
+
display_type: zod.z.literal("date")
|
|
28637
|
+
}).meta({
|
|
28638
|
+
title: `${params.title} Attribute`,
|
|
28639
|
+
description: metaDescription
|
|
28640
|
+
});
|
|
28641
|
+
}
|
|
28642
|
+
function createWeightAttributeSchema(params) {
|
|
28643
|
+
return NftAttributeSchema.safeExtend({
|
|
28644
|
+
trait_type: zod.z.literal(params.traitType),
|
|
28645
|
+
value: WeightKgSchema.meta(
|
|
28646
|
+
mergeSchemaMeta(WeightKgSchema, {
|
|
28647
|
+
title: params.title,
|
|
28648
|
+
description: params.description
|
|
28649
|
+
})
|
|
28650
|
+
),
|
|
28651
|
+
display_type: zod.z.literal("number")
|
|
28652
|
+
}).meta({
|
|
28653
|
+
title: `${params.title} Attribute`,
|
|
28654
|
+
description: `${params.description} attribute with numeric display`
|
|
28655
|
+
});
|
|
28656
|
+
}
|
|
28657
|
+
function createNumericAttributeSchema(params) {
|
|
28658
|
+
return NftAttributeSchema.safeExtend({
|
|
28659
|
+
trait_type: zod.z.literal(params.traitType),
|
|
28660
|
+
value: params.valueSchema.meta(
|
|
28661
|
+
mergeSchemaMeta(params.valueSchema, {
|
|
28662
|
+
title: params.title,
|
|
28663
|
+
description: params.description
|
|
28664
|
+
})
|
|
28665
|
+
),
|
|
28666
|
+
display_type: zod.z.literal("number")
|
|
28667
|
+
}).meta({
|
|
28668
|
+
title: `${params.title} Attribute`,
|
|
28669
|
+
description: `${params.description} attribute with numeric display`
|
|
28670
|
+
});
|
|
28671
|
+
}
|
|
28603
28672
|
var MethodologyAttributeSchema = NftAttributeSchema.safeExtend({
|
|
28604
28673
|
trait_type: zod.z.literal("Methodology"),
|
|
28605
28674
|
value: MethodologyNameSchema
|
|
@@ -28607,13 +28676,11 @@ var MethodologyAttributeSchema = NftAttributeSchema.safeExtend({
|
|
|
28607
28676
|
title: "Methodology Attribute",
|
|
28608
28677
|
description: "Methodology used for certification"
|
|
28609
28678
|
});
|
|
28610
|
-
var CreditAmountAttributeSchema =
|
|
28611
|
-
|
|
28612
|
-
|
|
28613
|
-
|
|
28614
|
-
|
|
28615
|
-
title: "Credit Amount Attribute",
|
|
28616
|
-
description: "Credit amount attribute with numeric display"
|
|
28679
|
+
var CreditAmountAttributeSchema = createNumericAttributeSchema({
|
|
28680
|
+
traitType: "Credit Amount",
|
|
28681
|
+
title: "Credit Amount",
|
|
28682
|
+
description: "Credit amount",
|
|
28683
|
+
valueSchema: CreditAmountSchema
|
|
28617
28684
|
});
|
|
28618
28685
|
var CreditTypeAttributeSchema = NftAttributeSchema.safeExtend({
|
|
28619
28686
|
trait_type: zod.z.literal("Credit Type"),
|
|
@@ -28629,34 +28696,10 @@ var SourceWasteTypeAttributeSchema = NftAttributeSchema.safeExtend({
|
|
|
28629
28696
|
title: "Source Waste Type Attribute",
|
|
28630
28697
|
description: "Source waste type attribute"
|
|
28631
28698
|
});
|
|
28632
|
-
var SourceWeightAttributeSchema =
|
|
28633
|
-
|
|
28634
|
-
|
|
28635
|
-
|
|
28636
|
-
description: "Weight of the source waste in kilograms"
|
|
28637
|
-
}),
|
|
28638
|
-
display_type: zod.z.literal("number")
|
|
28639
|
-
}).meta({
|
|
28640
|
-
title: "Source Weight Attribute",
|
|
28641
|
-
description: "Source weight attribute with numeric display"
|
|
28642
|
-
});
|
|
28643
|
-
var OriginCityAttributeSchema = NftAttributeSchema.safeExtend({
|
|
28644
|
-
trait_type: zod.z.literal("Origin City"),
|
|
28645
|
-
value: CitySchema
|
|
28646
|
-
}).meta({
|
|
28647
|
-
title: "Origin City Attribute",
|
|
28648
|
-
description: "Origin municipality attribute"
|
|
28649
|
-
});
|
|
28650
|
-
var RecyclerAttributeSchema = NftAttributeSchema.safeExtend({
|
|
28651
|
-
trait_type: zod.z.literal("Recycler"),
|
|
28652
|
-
value: NonEmptyStringSchema.max(100).meta({
|
|
28653
|
-
title: "Recycler",
|
|
28654
|
-
description: "Organization that processed the waste",
|
|
28655
|
-
example: "Eco Reciclagem"
|
|
28656
|
-
})
|
|
28657
|
-
}).meta({
|
|
28658
|
-
title: "Recycler Attribute",
|
|
28659
|
-
description: "Recycler attribute"
|
|
28699
|
+
var SourceWeightAttributeSchema = createWeightAttributeSchema({
|
|
28700
|
+
traitType: "Source Weight (kg)",
|
|
28701
|
+
title: "Source Weight",
|
|
28702
|
+
description: "Weight of the source waste in kilograms"
|
|
28660
28703
|
});
|
|
28661
28704
|
var MassIDTokenIdAttributeSchema = NftAttributeSchema.safeExtend({
|
|
28662
28705
|
trait_type: zod.z.literal("MassID"),
|
|
@@ -28668,18 +28711,24 @@ var MassIDTokenIdAttributeSchema = NftAttributeSchema.safeExtend({
|
|
|
28668
28711
|
title: "MassID Token ID Attribute",
|
|
28669
28712
|
description: "MassID token ID attribute"
|
|
28670
28713
|
});
|
|
28671
|
-
var MassIDRecyclingDateAttributeSchema =
|
|
28672
|
-
|
|
28673
|
-
|
|
28674
|
-
|
|
28675
|
-
|
|
28676
|
-
|
|
28677
|
-
|
|
28678
|
-
|
|
28679
|
-
|
|
28714
|
+
var MassIDRecyclingDateAttributeSchema = createDateAttributeSchema({
|
|
28715
|
+
traitType: "MassID Recycling Date",
|
|
28716
|
+
title: "MassID Recycling Date",
|
|
28717
|
+
description: "Unix timestamp in milliseconds when the source waste was recycled"
|
|
28718
|
+
});
|
|
28719
|
+
var CertificateIssuanceDateAttributeSchema = createDateAttributeSchema(
|
|
28720
|
+
{
|
|
28721
|
+
traitType: "Certificate Issuance Date",
|
|
28722
|
+
title: "Certificate Issuance Date",
|
|
28723
|
+
description: "Unix timestamp in milliseconds when the certificate was issued"
|
|
28724
|
+
}
|
|
28725
|
+
);
|
|
28726
|
+
var OriginCityAttributeSchema = NftAttributeSchema.safeExtend({
|
|
28727
|
+
trait_type: zod.z.literal("Origin City"),
|
|
28728
|
+
value: CitySchema
|
|
28680
28729
|
}).meta({
|
|
28681
|
-
title: "
|
|
28682
|
-
description: "
|
|
28730
|
+
title: "Origin City Attribute",
|
|
28731
|
+
description: "Origin municipality attribute"
|
|
28683
28732
|
});
|
|
28684
28733
|
var AuditResultSchema = zod.z.enum(["PASSED", "FAILED"]).meta({
|
|
28685
28734
|
title: "Audit Result",
|
|
@@ -29001,10 +29050,10 @@ var LocationSchema = zod.z.strictObject({
|
|
|
29001
29050
|
title: "Location",
|
|
29002
29051
|
description: "Geographic location with address and coordinate information"
|
|
29003
29052
|
});
|
|
29004
|
-
var
|
|
29005
|
-
|
|
29006
|
-
title: "Source Waste
|
|
29007
|
-
description: "
|
|
29053
|
+
var WastePropertiesSchema = zod.z.strictObject({
|
|
29054
|
+
type: WasteTypeSchema.meta({
|
|
29055
|
+
title: "Source Waste Type",
|
|
29056
|
+
description: "Type of the source waste"
|
|
29008
29057
|
}),
|
|
29009
29058
|
subtype: WasteSubtypeSchema.meta({
|
|
29010
29059
|
title: "Source Waste Subtype",
|
|
@@ -29012,11 +29061,11 @@ var WasteClassificationSchema = zod.z.strictObject({
|
|
|
29012
29061
|
}),
|
|
29013
29062
|
net_weight_kg: WeightKgSchema.meta({
|
|
29014
29063
|
title: "Source Waste Net Weight",
|
|
29015
|
-
description: "Net weight of the source waste"
|
|
29064
|
+
description: "Net weight of the source waste in kilograms (kg)"
|
|
29016
29065
|
})
|
|
29017
29066
|
}).meta({
|
|
29018
|
-
title: "Waste
|
|
29019
|
-
description: "
|
|
29067
|
+
title: "Waste Properties",
|
|
29068
|
+
description: "Properties of the source waste (MassID)"
|
|
29020
29069
|
});
|
|
29021
29070
|
var AccreditedParticipantSchema = zod.z.strictObject({
|
|
29022
29071
|
participant_id: UuidSchema.meta({
|
|
@@ -29292,7 +29341,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
29292
29341
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
29293
29342
|
}
|
|
29294
29343
|
function getSchemaVersionOrDefault() {
|
|
29295
|
-
return "0.1.
|
|
29344
|
+
return "0.1.51";
|
|
29296
29345
|
}
|
|
29297
29346
|
|
|
29298
29347
|
// src/shared/schema-validation.ts
|
|
@@ -29478,17 +29527,12 @@ var MassIDAttributeWasteSubtypeSchema = NftAttributeSchema.safeExtend({
|
|
|
29478
29527
|
title: "Waste Subtype Attribute",
|
|
29479
29528
|
description: "Regulatory or operational waste subtype (e.g., Food, Food Waste and Beverages)"
|
|
29480
29529
|
});
|
|
29481
|
-
var MassIDAttributeWeightSchema =
|
|
29482
|
-
|
|
29483
|
-
|
|
29484
|
-
display_type: zod.z.literal("number")
|
|
29485
|
-
}).meta({
|
|
29486
|
-
title: "Weight Attribute (kg)",
|
|
29530
|
+
var MassIDAttributeWeightSchema = createWeightAttributeSchema({
|
|
29531
|
+
traitType: "Weight (kg)",
|
|
29532
|
+
title: "Weight",
|
|
29487
29533
|
description: "Net batch weight in kilograms (kg) for this MassID"
|
|
29488
29534
|
});
|
|
29489
|
-
var MassIDAttributeOriginCitySchema = OriginCityAttributeSchema
|
|
29490
|
-
value: CitySchema
|
|
29491
|
-
});
|
|
29535
|
+
var MassIDAttributeOriginCitySchema = OriginCityAttributeSchema;
|
|
29492
29536
|
var MassIDAttributePickUpVehicleTypeSchema = NftAttributeSchema.safeExtend({
|
|
29493
29537
|
trait_type: zod.z.literal("Pick-up Vehicle Type"),
|
|
29494
29538
|
value: VehicleTypeSchema.meta({
|
|
@@ -29553,38 +29597,20 @@ var MassIDAttributeScaleTypeSchema = NftAttributeSchema.safeExtend({
|
|
|
29553
29597
|
title: "Scale Type Attribute",
|
|
29554
29598
|
description: "Scale type attribute (optional)"
|
|
29555
29599
|
});
|
|
29556
|
-
var MassIDAttributePickUpDateSchema =
|
|
29557
|
-
|
|
29558
|
-
|
|
29559
|
-
|
|
29560
|
-
description: "Unix timestamp in milliseconds when the waste was picked up from the source"
|
|
29561
|
-
}),
|
|
29562
|
-
display_type: zod.z.literal("date")
|
|
29563
|
-
}).meta({
|
|
29564
|
-
title: "Pick-up Date Attribute",
|
|
29565
|
-
description: "Pick-up date attribute with Unix timestamp"
|
|
29600
|
+
var MassIDAttributePickUpDateSchema = createDateAttributeSchema({
|
|
29601
|
+
traitType: "Pick-up Date",
|
|
29602
|
+
title: "Pick-up Date",
|
|
29603
|
+
description: "Unix timestamp in milliseconds when the waste was picked up from the source"
|
|
29566
29604
|
});
|
|
29567
|
-
var MassIDAttributeDropOffDateSchema =
|
|
29568
|
-
|
|
29569
|
-
|
|
29570
|
-
|
|
29571
|
-
description: "Unix timestamp in milliseconds when the waste was dropped off at the destination"
|
|
29572
|
-
}),
|
|
29573
|
-
display_type: zod.z.literal("date")
|
|
29574
|
-
}).meta({
|
|
29575
|
-
title: "Drop-off Date Attribute",
|
|
29576
|
-
description: "Drop-off date attribute with Unix timestamp"
|
|
29605
|
+
var MassIDAttributeDropOffDateSchema = createDateAttributeSchema({
|
|
29606
|
+
traitType: "Drop-off Date",
|
|
29607
|
+
title: "Drop-off Date",
|
|
29608
|
+
description: "Unix timestamp in milliseconds when the waste was dropped off at the destination"
|
|
29577
29609
|
});
|
|
29578
|
-
var MassIDAttributeRecyclingDateSchema =
|
|
29579
|
-
|
|
29580
|
-
|
|
29581
|
-
|
|
29582
|
-
description: "Unix timestamp in milliseconds when the waste was recycled/processed"
|
|
29583
|
-
}),
|
|
29584
|
-
display_type: zod.z.literal("date")
|
|
29585
|
-
}).meta({
|
|
29586
|
-
title: "Recycling Date Attribute",
|
|
29587
|
-
description: "Recycling date attribute with Unix timestamp"
|
|
29610
|
+
var MassIDAttributeRecyclingDateSchema = createDateAttributeSchema({
|
|
29611
|
+
traitType: "Recycling Date",
|
|
29612
|
+
title: "Recycling Date",
|
|
29613
|
+
description: "Unix timestamp in milliseconds when the waste was recycled/processed"
|
|
29588
29614
|
});
|
|
29589
29615
|
var MassIDAttributesSchema = uniqueBy(
|
|
29590
29616
|
zod.z.union([
|
|
@@ -29629,8 +29655,8 @@ var MassIDWastePropertiesSchema = zod.z.strictObject({
|
|
|
29629
29655
|
description: "Specific subcategory of waste material"
|
|
29630
29656
|
}),
|
|
29631
29657
|
local_classification: MassIDLocalClassificationSchema.optional(),
|
|
29632
|
-
|
|
29633
|
-
title: "Net Weight
|
|
29658
|
+
net_weight_kg: WeightKgSchema.meta({
|
|
29659
|
+
title: "Net Weight",
|
|
29634
29660
|
description: "Net weight of the waste batch in kilograms (kg)",
|
|
29635
29661
|
examples: [3e3]
|
|
29636
29662
|
})
|
|
@@ -29701,8 +29727,8 @@ var PickUpEventSchema = buildMassIDEventSchema(
|
|
|
29701
29727
|
vehicle_type: VehicleTypeSchema.optional().meta({
|
|
29702
29728
|
description: "Type of vehicle used for pick-up operations"
|
|
29703
29729
|
}),
|
|
29704
|
-
|
|
29705
|
-
title: "Pick-up Waste Weight
|
|
29730
|
+
weight_kg: WeightKgSchema.optional().meta({
|
|
29731
|
+
title: "Pick-up Waste Weight",
|
|
29706
29732
|
description: "Weight of the waste picked up at the origin location in kilograms (kg)"
|
|
29707
29733
|
})
|
|
29708
29734
|
}).optional().meta({
|
|
@@ -29723,17 +29749,17 @@ var WeighingEventSchema = buildMassIDEventSchema(
|
|
|
29723
29749
|
vehicle_type: VehicleTypeSchema.optional().meta({
|
|
29724
29750
|
description: "Type of vehicle used during weighing"
|
|
29725
29751
|
}),
|
|
29726
|
-
|
|
29727
|
-
title: "Container Capacity
|
|
29728
|
-
description: "Maximum container capacity in kilograms"
|
|
29752
|
+
container_capacity_kg: WeightKgSchema.optional().meta({
|
|
29753
|
+
title: "Container Capacity",
|
|
29754
|
+
description: "Maximum container capacity in kilograms (kg)"
|
|
29729
29755
|
}),
|
|
29730
|
-
|
|
29731
|
-
title: "Gross Weight
|
|
29732
|
-
description: "Total weight including vehicle/container before tare"
|
|
29756
|
+
gross_weight_kg: WeightKgSchema.optional().meta({
|
|
29757
|
+
title: "Gross Weight",
|
|
29758
|
+
description: "Total weight including vehicle/container before tare in kilograms (kg)"
|
|
29733
29759
|
}),
|
|
29734
|
-
|
|
29735
|
-
title: "Tare Weight
|
|
29736
|
-
description: "Weight of the empty vehicle or container"
|
|
29760
|
+
tare_kg: WeightKgSchema.optional().meta({
|
|
29761
|
+
title: "Tare Weight",
|
|
29762
|
+
description: "Weight of the empty vehicle or container in kilograms (kg)"
|
|
29737
29763
|
})
|
|
29738
29764
|
}).optional().meta({
|
|
29739
29765
|
title: "Weighing Event Data",
|
|
@@ -29749,13 +29775,13 @@ var SortingEventSchema = buildMassIDEventSchema(
|
|
|
29749
29775
|
"Sorting or segregation of waste materials"
|
|
29750
29776
|
).safeExtend({
|
|
29751
29777
|
data: zod.z.strictObject({
|
|
29752
|
-
|
|
29753
|
-
title: "Initial Weight
|
|
29754
|
-
description: "Weight of the material entering the sorting process in kilograms"
|
|
29778
|
+
initial_weight_kg: WeightKgSchema.optional().meta({
|
|
29779
|
+
title: "Initial Weight",
|
|
29780
|
+
description: "Weight of the material entering the sorting process in kilograms (kg)"
|
|
29755
29781
|
}),
|
|
29756
|
-
|
|
29757
|
-
title: "Deducted Weight
|
|
29758
|
-
description: "Weight removed during sorting (e.g., contaminants or moisture) in kilograms"
|
|
29782
|
+
deducted_weight_kg: WeightKgSchema.optional().meta({
|
|
29783
|
+
title: "Deducted Weight",
|
|
29784
|
+
description: "Weight removed during sorting (e.g., contaminants or moisture) in kilograms (kg)"
|
|
29759
29785
|
})
|
|
29760
29786
|
}).optional().meta({
|
|
29761
29787
|
title: "Sorting Event Data",
|
|
@@ -29937,8 +29963,8 @@ var MassIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
29937
29963
|
);
|
|
29938
29964
|
assertAttributeMatches(
|
|
29939
29965
|
"Weight (kg)",
|
|
29940
|
-
data.waste_properties.
|
|
29941
|
-
"waste_properties.
|
|
29966
|
+
data.waste_properties.net_weight_kg,
|
|
29967
|
+
"waste_properties.net_weight_kg"
|
|
29942
29968
|
);
|
|
29943
29969
|
assertAttributeMatches(
|
|
29944
29970
|
"Local Waste Classification ID",
|
|
@@ -30007,34 +30033,25 @@ var MassIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30007
30033
|
var GasIDAttributeMethodologySchema = MethodologyAttributeSchema;
|
|
30008
30034
|
var GasIDAttributeGasTypeSchema = NftAttributeSchema.safeExtend({
|
|
30009
30035
|
trait_type: zod.z.literal("Gas Type"),
|
|
30010
|
-
value:
|
|
30011
|
-
title: "Gas Type",
|
|
30012
|
-
description: "Type of gas prevented",
|
|
30013
|
-
examples: ["Methane (CH\u2084)", "Carbon Dioxide (CO\u2082)"]
|
|
30014
|
-
})
|
|
30036
|
+
value: GasTypeSchema
|
|
30015
30037
|
}).meta({
|
|
30016
30038
|
title: "Gas Type Attribute",
|
|
30017
30039
|
description: "Gas type attribute"
|
|
30018
30040
|
});
|
|
30019
|
-
var GasIDAttributeCo2ePreventedSchema =
|
|
30020
|
-
|
|
30021
|
-
|
|
30022
|
-
|
|
30023
|
-
|
|
30024
|
-
}),
|
|
30025
|
-
display_type: zod.z.literal("number")
|
|
30026
|
-
}).meta({
|
|
30027
|
-
title: "CO\u2082e Prevented Attribute",
|
|
30028
|
-
description: "CO\u2082e prevented attribute with numeric display"
|
|
30041
|
+
var GasIDAttributeCo2ePreventedSchema = createNumericAttributeSchema({
|
|
30042
|
+
traitType: "CO\u2082e Prevented (kg)",
|
|
30043
|
+
title: "CO\u2082e Prevented",
|
|
30044
|
+
description: "Total CO\u2082 equivalent emissions prevented in kilograms",
|
|
30045
|
+
valueSchema: NonNegativeFloatSchema
|
|
30029
30046
|
});
|
|
30030
30047
|
var GasIDAttributeCreditAmountSchema = CreditAmountAttributeSchema;
|
|
30031
30048
|
var GasIDAttributeCreditTypeSchema = CreditTypeAttributeSchema;
|
|
30032
30049
|
var GasIDAttributeSourceWasteTypeSchema = SourceWasteTypeAttributeSchema;
|
|
30033
30050
|
var GasIDAttributeSourceWeightSchema = SourceWeightAttributeSchema;
|
|
30034
30051
|
var GasIDAttributeOriginCitySchema = OriginCityAttributeSchema;
|
|
30035
|
-
var GasIDAttributeRecyclerSchema = RecyclerAttributeSchema;
|
|
30036
30052
|
var GasIDAttributeMassIDTokenIdSchema = MassIDTokenIdAttributeSchema;
|
|
30037
30053
|
var GasIDAttributeMassIDRecyclingDateSchema = MassIDRecyclingDateAttributeSchema;
|
|
30054
|
+
var GasIDAttributeCertificateIssuanceDateSchema = CertificateIssuanceDateAttributeSchema;
|
|
30038
30055
|
var GasIDAttributesSchema = zod.z.tuple([
|
|
30039
30056
|
GasIDAttributeMethodologySchema,
|
|
30040
30057
|
GasIDAttributeGasTypeSchema,
|
|
@@ -30044,24 +30061,24 @@ var GasIDAttributesSchema = zod.z.tuple([
|
|
|
30044
30061
|
GasIDAttributeSourceWasteTypeSchema,
|
|
30045
30062
|
GasIDAttributeSourceWeightSchema,
|
|
30046
30063
|
GasIDAttributeOriginCitySchema,
|
|
30047
|
-
GasIDAttributeRecyclerSchema,
|
|
30048
30064
|
GasIDAttributeMassIDTokenIdSchema,
|
|
30049
|
-
GasIDAttributeMassIDRecyclingDateSchema
|
|
30065
|
+
GasIDAttributeMassIDRecyclingDateSchema,
|
|
30066
|
+
GasIDAttributeCertificateIssuanceDateSchema
|
|
30050
30067
|
]).meta({
|
|
30051
30068
|
title: "GasID NFT Attribute Array",
|
|
30052
30069
|
description: "Schema for the fixed set of GasID NFT attributes, enforcing order and type for each trait"
|
|
30053
30070
|
});
|
|
30054
30071
|
var GasIDSummarySchema = zod.z.strictObject({
|
|
30055
|
-
gas_type:
|
|
30056
|
-
title: "Gas Type",
|
|
30057
|
-
description: "Type of gas prevented",
|
|
30058
|
-
examples: ["Methane (CH\u2084)", "Carbon Dioxide (CO\u2082)"]
|
|
30059
|
-
}),
|
|
30072
|
+
gas_type: GasTypeSchema,
|
|
30060
30073
|
credit_type: CreditTypeSchema,
|
|
30061
30074
|
credit_amount: CreditAmountSchema,
|
|
30062
30075
|
prevented_co2e_kg: WeightKgSchema.meta({
|
|
30063
|
-
title: "Prevented Emissions (CO\u2082e
|
|
30064
|
-
description: "CO\u2082e weight of the prevented emissions"
|
|
30076
|
+
title: "Prevented Emissions (CO\u2082e)",
|
|
30077
|
+
description: "CO\u2082e weight of the prevented emissions in kilograms (kg)"
|
|
30078
|
+
}),
|
|
30079
|
+
issued_at: IsoDateTimeSchema.meta({
|
|
30080
|
+
title: "Issued At",
|
|
30081
|
+
description: "ISO 8601 timestamp when the certificate was issued"
|
|
30065
30082
|
})
|
|
30066
30083
|
}).meta({
|
|
30067
30084
|
title: "GasID Summary",
|
|
@@ -30119,7 +30136,7 @@ var GasIDDataSchema = zod.z.strictObject({
|
|
|
30119
30136
|
methodology: MethodologyReferenceSchema,
|
|
30120
30137
|
audit: AuditReferenceSchema,
|
|
30121
30138
|
mass_id: MassIDReferenceSchema,
|
|
30122
|
-
|
|
30139
|
+
waste_properties: WastePropertiesSchema,
|
|
30123
30140
|
origin_location: LocationSchema.meta({
|
|
30124
30141
|
title: "Source Waste Origin Location",
|
|
30125
30142
|
description: "Location of the waste origin"
|
|
@@ -30157,25 +30174,21 @@ var GasIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30157
30174
|
}
|
|
30158
30175
|
}).meta(GasIDIpfsSchemaMeta);
|
|
30159
30176
|
var RecycledIDAttributeMethodologySchema = MethodologyAttributeSchema;
|
|
30160
|
-
var RecycledIDAttributeRecycledMassWeightSchema =
|
|
30161
|
-
|
|
30162
|
-
|
|
30177
|
+
var RecycledIDAttributeRecycledMassWeightSchema = createWeightAttributeSchema(
|
|
30178
|
+
{
|
|
30179
|
+
traitType: "Recycled Mass Weight (kg)",
|
|
30163
30180
|
title: "Recycled Mass Weight",
|
|
30164
30181
|
description: "Total weight of recycled materials in kilograms"
|
|
30165
|
-
}
|
|
30166
|
-
|
|
30167
|
-
}).meta({
|
|
30168
|
-
title: "Recycled Mass Weight Attribute",
|
|
30169
|
-
description: "Recycled mass weight attribute with numeric display"
|
|
30170
|
-
});
|
|
30182
|
+
}
|
|
30183
|
+
);
|
|
30171
30184
|
var RecycledIDAttributeCreditAmountSchema = CreditAmountAttributeSchema;
|
|
30172
30185
|
var RecycledIDAttributeCreditTypeSchema = CreditTypeAttributeSchema;
|
|
30173
30186
|
var RecycledIDAttributeSourceWasteTypeSchema = SourceWasteTypeAttributeSchema;
|
|
30174
30187
|
var RecycledIDAttributeSourceWeightSchema = SourceWeightAttributeSchema;
|
|
30175
30188
|
var RecycledIDAttributeOriginCitySchema = OriginCityAttributeSchema;
|
|
30176
|
-
var RecycledIDAttributeRecyclerSchema = RecyclerAttributeSchema;
|
|
30177
30189
|
var RecycledIDAttributeMassIDTokenIdSchema = MassIDTokenIdAttributeSchema;
|
|
30178
30190
|
var RecycledIDAttributeMassIDRecyclingDateSchema = MassIDRecyclingDateAttributeSchema;
|
|
30191
|
+
var RecycledIDAttributeCertificateIssuanceDateSchema = CertificateIssuanceDateAttributeSchema;
|
|
30179
30192
|
var RecycledIDAttributesSchema = zod.z.tuple([
|
|
30180
30193
|
RecycledIDAttributeMethodologySchema,
|
|
30181
30194
|
RecycledIDAttributeRecycledMassWeightSchema,
|
|
@@ -30184,9 +30197,9 @@ var RecycledIDAttributesSchema = zod.z.tuple([
|
|
|
30184
30197
|
RecycledIDAttributeSourceWasteTypeSchema,
|
|
30185
30198
|
RecycledIDAttributeSourceWeightSchema,
|
|
30186
30199
|
RecycledIDAttributeOriginCitySchema,
|
|
30187
|
-
RecycledIDAttributeRecyclerSchema,
|
|
30188
30200
|
RecycledIDAttributeMassIDTokenIdSchema,
|
|
30189
|
-
RecycledIDAttributeMassIDRecyclingDateSchema
|
|
30201
|
+
RecycledIDAttributeMassIDRecyclingDateSchema,
|
|
30202
|
+
RecycledIDAttributeCertificateIssuanceDateSchema
|
|
30190
30203
|
]).meta({
|
|
30191
30204
|
title: "RecycledID NFT Attribute Array",
|
|
30192
30205
|
description: "Schema for the fixed set of RecycledID NFT attributes, enforcing order and type for each trait"
|
|
@@ -30194,10 +30207,14 @@ var RecycledIDAttributesSchema = zod.z.tuple([
|
|
|
30194
30207
|
var RecycledIDSummarySchema = zod.z.strictObject({
|
|
30195
30208
|
recycled_mass_kg: WeightKgSchema.meta({
|
|
30196
30209
|
title: "Recycled Mass Weight",
|
|
30197
|
-
description: "Total weight of materials successfully recycled"
|
|
30210
|
+
description: "Total weight of materials successfully recycled in kilograms (kg)"
|
|
30198
30211
|
}),
|
|
30199
30212
|
credit_type: CreditTypeSchema,
|
|
30200
|
-
credit_amount: CreditAmountSchema
|
|
30213
|
+
credit_amount: CreditAmountSchema,
|
|
30214
|
+
issued_at: IsoDateTimeSchema.meta({
|
|
30215
|
+
title: "Issued At",
|
|
30216
|
+
description: "ISO 8601 timestamp when the certificate was issued"
|
|
30217
|
+
})
|
|
30201
30218
|
}).meta({
|
|
30202
30219
|
title: "RecycledID Summary",
|
|
30203
30220
|
description: "Summary information for the RecycledID certificate"
|
|
@@ -30207,7 +30224,7 @@ var RecycledIDDataSchema = zod.z.strictObject({
|
|
|
30207
30224
|
methodology: MethodologyReferenceSchema,
|
|
30208
30225
|
audit: AuditReferenceSchema,
|
|
30209
30226
|
mass_id: MassIDReferenceSchema,
|
|
30210
|
-
|
|
30227
|
+
waste_properties: WastePropertiesSchema,
|
|
30211
30228
|
origin_location: LocationSchema.meta({
|
|
30212
30229
|
title: "RecycledID Origin Location",
|
|
30213
30230
|
description: "Source waste origin location details"
|
|
@@ -30256,49 +30273,28 @@ var CreditPurchaseReceiptCreditAttributeSchema = NftAttributeSchema.safeExtend({
|
|
|
30256
30273
|
title: "Credit Attribute",
|
|
30257
30274
|
description: "Attribute representing purchased amount per credit token symbol"
|
|
30258
30275
|
});
|
|
30259
|
-
var CreditPurchaseReceiptTotalCreditsAttributeSchema =
|
|
30260
|
-
|
|
30261
|
-
|
|
30262
|
-
|
|
30263
|
-
|
|
30264
|
-
}),
|
|
30265
|
-
display_type: zod.z.literal("number")
|
|
30266
|
-
}).meta({
|
|
30267
|
-
title: "Total Credits Purchased Attribute",
|
|
30268
|
-
description: "Aggregate credits purchased attribute"
|
|
30276
|
+
var CreditPurchaseReceiptTotalCreditsAttributeSchema = createNumericAttributeSchema({
|
|
30277
|
+
traitType: "Total Credits Purchased",
|
|
30278
|
+
title: "Total Credits Purchased",
|
|
30279
|
+
description: "Total number of credits purchased across all tokens",
|
|
30280
|
+
valueSchema: CreditAmountSchema
|
|
30269
30281
|
});
|
|
30270
|
-
var CreditPurchaseReceiptTotalUsdcAttributeSchema =
|
|
30271
|
-
|
|
30272
|
-
|
|
30273
|
-
|
|
30274
|
-
|
|
30275
|
-
}),
|
|
30276
|
-
display_type: zod.z.literal("number")
|
|
30277
|
-
}).meta({
|
|
30278
|
-
title: "Total USDC Amount Attribute",
|
|
30279
|
-
description: "Aggregate USDC amount attribute"
|
|
30282
|
+
var CreditPurchaseReceiptTotalUsdcAttributeSchema = createNumericAttributeSchema({
|
|
30283
|
+
traitType: "Total USDC Amount",
|
|
30284
|
+
title: "Total USDC Amount",
|
|
30285
|
+
description: "Total USDC amount paid for the purchase",
|
|
30286
|
+
valueSchema: CreditAmountSchema
|
|
30280
30287
|
});
|
|
30281
|
-
var CreditPurchaseReceiptPurchaseDateAttributeSchema =
|
|
30282
|
-
|
|
30283
|
-
|
|
30284
|
-
|
|
30285
|
-
description: "Unix timestamp in milliseconds when the purchase was completed"
|
|
30286
|
-
}),
|
|
30287
|
-
display_type: zod.z.literal("date")
|
|
30288
|
-
}).meta({
|
|
30289
|
-
title: "Purchase Date Attribute",
|
|
30290
|
-
description: "Purchase date attribute using Unix timestamp in milliseconds"
|
|
30288
|
+
var CreditPurchaseReceiptPurchaseDateAttributeSchema = createDateAttributeSchema({
|
|
30289
|
+
traitType: "Purchase Date",
|
|
30290
|
+
title: "Purchase Date",
|
|
30291
|
+
description: "Unix timestamp in milliseconds when the purchase was completed"
|
|
30291
30292
|
});
|
|
30292
|
-
var CreditPurchaseReceiptCertificatesAttributeSchema =
|
|
30293
|
-
|
|
30294
|
-
|
|
30295
|
-
|
|
30296
|
-
|
|
30297
|
-
}),
|
|
30298
|
-
display_type: zod.z.literal("number")
|
|
30299
|
-
}).meta({
|
|
30300
|
-
title: "Certificates Purchased Attribute",
|
|
30301
|
-
description: "Attribute representing how many certificates were purchased"
|
|
30293
|
+
var CreditPurchaseReceiptCertificatesAttributeSchema = createNumericAttributeSchema({
|
|
30294
|
+
traitType: "Certificates Purchased",
|
|
30295
|
+
title: "Certificates Purchased",
|
|
30296
|
+
description: "Total number of certificates purchased",
|
|
30297
|
+
valueSchema: PositiveIntegerSchema
|
|
30302
30298
|
});
|
|
30303
30299
|
var CreditPurchaseReceiptReceiverAttributeSchema = NftAttributeSchema.omit({
|
|
30304
30300
|
display_type: true,
|
|
@@ -30800,16 +30796,11 @@ var CreditRetirementReceiptCreditAttributeSchema = NftAttributeSchema.safeExtend
|
|
|
30800
30796
|
title: "Credit Attribute",
|
|
30801
30797
|
description: "Attribute representing retired amount per credit token symbol"
|
|
30802
30798
|
});
|
|
30803
|
-
var CreditRetirementReceiptTotalCreditsAttributeSchema =
|
|
30804
|
-
|
|
30805
|
-
|
|
30806
|
-
|
|
30807
|
-
|
|
30808
|
-
}),
|
|
30809
|
-
display_type: zod.z.literal("number")
|
|
30810
|
-
}).meta({
|
|
30811
|
-
title: "Total Credits Retired Attribute",
|
|
30812
|
-
description: "Aggregate credits retired attribute"
|
|
30799
|
+
var CreditRetirementReceiptTotalCreditsAttributeSchema = createNumericAttributeSchema({
|
|
30800
|
+
traitType: "Total Credits Retired",
|
|
30801
|
+
title: "Total Credits Retired",
|
|
30802
|
+
description: "Total number of credits retired across all tokens",
|
|
30803
|
+
valueSchema: CreditAmountSchema
|
|
30813
30804
|
});
|
|
30814
30805
|
var CreditRetirementReceiptBeneficiaryAttributeSchema = NftAttributeSchema.safeExtend({
|
|
30815
30806
|
trait_type: zod.z.literal("Beneficiary"),
|
|
@@ -30833,27 +30824,16 @@ var CreditRetirementReceiptCreditHolderAttributeSchema = NftAttributeSchema.safe
|
|
|
30833
30824
|
title: "Credit Holder Attribute",
|
|
30834
30825
|
description: "Attribute containing the credit holder display name"
|
|
30835
30826
|
});
|
|
30836
|
-
var CreditRetirementReceiptRetirementDateAttributeSchema =
|
|
30837
|
-
|
|
30838
|
-
|
|
30839
|
-
|
|
30840
|
-
description: "Unix timestamp in milliseconds when the retirement was completed"
|
|
30841
|
-
}),
|
|
30842
|
-
display_type: zod.z.literal("date")
|
|
30843
|
-
}).meta({
|
|
30844
|
-
title: "Retirement Date Attribute",
|
|
30845
|
-
description: "Retirement date attribute using Unix timestamp in milliseconds"
|
|
30827
|
+
var CreditRetirementReceiptRetirementDateAttributeSchema = createDateAttributeSchema({
|
|
30828
|
+
traitType: "Retirement Date",
|
|
30829
|
+
title: "Retirement Date",
|
|
30830
|
+
description: "Unix timestamp in milliseconds when the retirement was completed"
|
|
30846
30831
|
});
|
|
30847
|
-
var CreditRetirementReceiptCertificatesAttributeSchema =
|
|
30848
|
-
|
|
30849
|
-
|
|
30850
|
-
|
|
30851
|
-
|
|
30852
|
-
}),
|
|
30853
|
-
display_type: zod.z.literal("number")
|
|
30854
|
-
}).meta({
|
|
30855
|
-
title: "Certificates Retired Attribute",
|
|
30856
|
-
description: "Attribute representing how many certificates were retired in total"
|
|
30832
|
+
var CreditRetirementReceiptCertificatesAttributeSchema = createNumericAttributeSchema({
|
|
30833
|
+
traitType: "Certificates Retired",
|
|
30834
|
+
title: "Certificates Retired",
|
|
30835
|
+
description: "Total number of certificates retired",
|
|
30836
|
+
valueSchema: PositiveIntegerSchema
|
|
30857
30837
|
});
|
|
30858
30838
|
var CreditRetirementReceiptCollectionAttributeSchema = NftAttributeSchema.safeExtend({
|
|
30859
30839
|
trait_type: CollectionNameSchema,
|
|
@@ -31497,6 +31477,7 @@ exports.BRAZIL_SUBDIVISION_CODES = BRAZIL_SUBDIVISION_CODES;
|
|
|
31497
31477
|
exports.BaseIpfsSchema = BaseIpfsSchema;
|
|
31498
31478
|
exports.BlockchainChainIdSchema = BlockchainChainIdSchema;
|
|
31499
31479
|
exports.BlockchainNetworkNameSchema = BlockchainNetworkNameSchema;
|
|
31480
|
+
exports.CertificateIssuanceDateAttributeSchema = CertificateIssuanceDateAttributeSchema;
|
|
31500
31481
|
exports.CitySchema = CitySchema;
|
|
31501
31482
|
exports.CollectionNameSchema = CollectionNameSchema;
|
|
31502
31483
|
exports.CollectionSchema = CollectionSchema;
|
|
@@ -31534,6 +31515,7 @@ exports.GasIDDataSchema = GasIDDataSchema;
|
|
|
31534
31515
|
exports.GasIDIpfsSchema = GasIDIpfsSchema;
|
|
31535
31516
|
exports.GasIDIpfsSchemaMeta = GasIDIpfsSchemaMeta;
|
|
31536
31517
|
exports.GasIDReferenceSchema = GasIDReferenceSchema;
|
|
31518
|
+
exports.GasTypeSchema = GasTypeSchema;
|
|
31537
31519
|
exports.HexColorSchema = HexColorSchema;
|
|
31538
31520
|
exports.IbamaWasteClassificationSchema = IbamaWasteClassificationSchema;
|
|
31539
31521
|
exports.IpfsCidSchema = IpfsCidSchema;
|
|
@@ -31584,7 +31566,6 @@ exports.RecycledIDAttributesSchema = RecycledIDAttributesSchema;
|
|
|
31584
31566
|
exports.RecycledIDDataSchema = RecycledIDDataSchema;
|
|
31585
31567
|
exports.RecycledIDIpfsSchema = RecycledIDIpfsSchema;
|
|
31586
31568
|
exports.RecycledIDIpfsSchemaMeta = RecycledIDIpfsSchemaMeta;
|
|
31587
|
-
exports.RecyclerAttributeSchema = RecyclerAttributeSchema;
|
|
31588
31569
|
exports.RewardAllocationSchema = RewardAllocationSchema;
|
|
31589
31570
|
exports.ScaleTypeSchema = ScaleTypeSchema;
|
|
31590
31571
|
exports.SchemaInfoSchema = SchemaInfoSchema;
|
|
@@ -31601,7 +31582,7 @@ exports.UnixTimestampSchema = UnixTimestampSchema;
|
|
|
31601
31582
|
exports.UuidSchema = UuidSchema;
|
|
31602
31583
|
exports.VehicleTypeSchema = VehicleTypeSchema;
|
|
31603
31584
|
exports.ViewerReferenceSchema = ViewerReferenceSchema;
|
|
31604
|
-
exports.
|
|
31585
|
+
exports.WastePropertiesSchema = WastePropertiesSchema;
|
|
31605
31586
|
exports.WasteSubtypeSchema = WasteSubtypeSchema;
|
|
31606
31587
|
exports.WasteTypeSchema = WasteTypeSchema;
|
|
31607
31588
|
exports.WeighingCaptureMethodSchema = WeighingCaptureMethodSchema;
|
|
@@ -31609,9 +31590,12 @@ exports.WeightKgSchema = WeightKgSchema;
|
|
|
31609
31590
|
exports.buildSchemaUrl = buildSchemaUrl;
|
|
31610
31591
|
exports.canonicalizeForHash = canonicalizeForHash;
|
|
31611
31592
|
exports.createAttributeMap = createAttributeMap;
|
|
31593
|
+
exports.createDateAttributeSchema = createDateAttributeSchema;
|
|
31594
|
+
exports.createNumericAttributeSchema = createNumericAttributeSchema;
|
|
31612
31595
|
exports.createReceiptCertificateSchema = createReceiptCertificateSchema;
|
|
31613
31596
|
exports.createReceiptCollectionSchema = createReceiptCollectionSchema;
|
|
31614
31597
|
exports.createReceiptCreditSchema = createReceiptCreditSchema;
|
|
31598
|
+
exports.createWeightAttributeSchema = createWeightAttributeSchema;
|
|
31615
31599
|
exports.getSchemaBaseUrl = getSchemaBaseUrl;
|
|
31616
31600
|
exports.getSchemaVersionOrDefault = getSchemaVersionOrDefault;
|
|
31617
31601
|
exports.hashCanonicalJson = hashCanonicalJson;
|