@carrot-foundation/schemas 0.1.60 → 0.1.61
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 +153 -203
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +175 -132
- package/dist/index.d.ts +175 -132
- package/dist/index.js +147 -201
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/ipfs/collection/collection.example.json +4 -5
- package/schemas/ipfs/collection/collection.schema.json +2 -12
- package/schemas/ipfs/credit/credit.example.json +4 -5
- package/schemas/ipfs/credit/credit.schema.json +2 -12
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.example.json +5 -5
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json +120 -120
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.example.json +6 -5
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.schema.json +119 -109
- package/schemas/ipfs/gas-id/gas-id.example.json +7 -6
- package/schemas/ipfs/gas-id/gas-id.schema.json +41 -31
- package/schemas/ipfs/mass-id/mass-id.example.json +5 -5
- package/schemas/ipfs/mass-id/mass-id.schema.json +12 -12
- package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +18 -8
- package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +131 -43
- package/schemas/ipfs/methodology/methodology.example.json +5 -6
- package/schemas/ipfs/methodology/methodology.schema.json +2 -12
- package/schemas/ipfs/recycled-id/recycled-id.example.json +7 -6
- package/schemas/ipfs/recycled-id/recycled-id.schema.json +41 -31
- package/schemas/schema-hashes.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -28434,10 +28434,6 @@ var BaseIpfsSchema = zod.z.strictObject({
|
|
|
28434
28434
|
}),
|
|
28435
28435
|
external_id: ExternalIdSchema,
|
|
28436
28436
|
external_url: ExternalUrlSchema,
|
|
28437
|
-
full_content_hash: Sha256HashSchema.meta({
|
|
28438
|
-
title: "Full Content Hash",
|
|
28439
|
-
description: "SHA-256 hash of the original JSON content including private data before schema validation"
|
|
28440
|
-
}),
|
|
28441
28437
|
content_hash: Sha256HashSchema.meta({
|
|
28442
28438
|
title: "Content Hash",
|
|
28443
28439
|
description: "SHA-256 hash of RFC 8785 canonicalized JSON after schema validation"
|
|
@@ -28552,6 +28548,10 @@ var NftIpfsSchema = BaseIpfsSchema.safeExtend({
|
|
|
28552
28548
|
description: "Type/category of this NFT schema"
|
|
28553
28549
|
})
|
|
28554
28550
|
}),
|
|
28551
|
+
full_content_hash: Sha256HashSchema.meta({
|
|
28552
|
+
title: "Full Content Hash",
|
|
28553
|
+
description: "SHA-256 hash of the original JSON content including private data before schema validation"
|
|
28554
|
+
}),
|
|
28555
28555
|
viewer_reference: ViewerReferenceSchema,
|
|
28556
28556
|
environment: RecordEnvironmentSchema,
|
|
28557
28557
|
blockchain: BlockchainReferenceSchema,
|
|
@@ -29107,48 +29107,55 @@ var AuditReferenceSchema = zod.z.strictObject({
|
|
|
29107
29107
|
title: "Audit Reference",
|
|
29108
29108
|
description: "Reference to an audit record"
|
|
29109
29109
|
});
|
|
29110
|
-
var
|
|
29111
|
-
external_id: ExternalIdSchema
|
|
29112
|
-
|
|
29113
|
-
|
|
29114
|
-
|
|
29115
|
-
token_id: TokenIdSchema.meta({
|
|
29116
|
-
title: "GasID Token ID",
|
|
29117
|
-
description: "NFT token ID of the GasID"
|
|
29118
|
-
}),
|
|
29119
|
-
external_url: ExternalUrlSchema.meta({
|
|
29120
|
-
title: "GasID External URL",
|
|
29121
|
-
description: "URL to view the GasID on Carrot Explorer"
|
|
29122
|
-
}),
|
|
29123
|
-
ipfs_uri: IpfsUriSchema.meta({
|
|
29124
|
-
title: "GasID IPFS URI",
|
|
29125
|
-
description: "IPFS URI of the GasID record"
|
|
29126
|
-
})
|
|
29110
|
+
var TokenReferenceBaseSchema = zod.z.strictObject({
|
|
29111
|
+
external_id: ExternalIdSchema,
|
|
29112
|
+
external_url: ExternalUrlSchema,
|
|
29113
|
+
ipfs_uri: IpfsUriSchema,
|
|
29114
|
+
smart_contract_address: SmartContractAddressSchema
|
|
29127
29115
|
}).meta({
|
|
29128
|
-
title: "
|
|
29129
|
-
description: "
|
|
29116
|
+
title: "Token Reference",
|
|
29117
|
+
description: "Base schema for all token references"
|
|
29130
29118
|
});
|
|
29131
|
-
var
|
|
29132
|
-
|
|
29133
|
-
title: "MassID External ID",
|
|
29134
|
-
description: "Unique identifier for the MassID"
|
|
29135
|
-
}),
|
|
29136
|
-
token_id: TokenIdSchema.meta({
|
|
29137
|
-
title: "MassID Token ID",
|
|
29138
|
-
description: "NFT token ID of the MassID"
|
|
29139
|
-
}),
|
|
29140
|
-
external_url: ExternalUrlSchema.meta({
|
|
29141
|
-
title: "MassID External URL",
|
|
29142
|
-
description: "URL to view the MassID on Carrot Explorer"
|
|
29143
|
-
}),
|
|
29144
|
-
ipfs_uri: IpfsUriSchema.meta({
|
|
29145
|
-
title: "MassID IPFS URI",
|
|
29146
|
-
description: "IPFS URI of the MassID record"
|
|
29147
|
-
})
|
|
29119
|
+
var NftTokenReferenceBaseSchema = TokenReferenceBaseSchema.safeExtend({
|
|
29120
|
+
token_id: TokenIdSchema
|
|
29148
29121
|
}).meta({
|
|
29122
|
+
title: "NFT Token Reference",
|
|
29123
|
+
description: "Base schema for NFT token references"
|
|
29124
|
+
});
|
|
29125
|
+
|
|
29126
|
+
// src/shared/schemas/references/mass-id-reference.schema.ts
|
|
29127
|
+
var MassIDReferenceSchema = NftTokenReferenceBaseSchema.meta({
|
|
29149
29128
|
title: "MassID Reference",
|
|
29150
29129
|
description: "Reference to a MassID record"
|
|
29151
29130
|
});
|
|
29131
|
+
|
|
29132
|
+
// src/shared/schemas/references/certificate-reference.schema.ts
|
|
29133
|
+
var CertificateReferenceBaseSchema = NftTokenReferenceBaseSchema.safeExtend({
|
|
29134
|
+
type: CertificateTypeSchema,
|
|
29135
|
+
total_amount: CreditAmountSchema.meta({
|
|
29136
|
+
title: "Certificate Total Amount",
|
|
29137
|
+
description: "Total credits available in this certificate"
|
|
29138
|
+
}),
|
|
29139
|
+
mass_id: MassIDReferenceSchema
|
|
29140
|
+
}).meta({
|
|
29141
|
+
title: "Certificate Reference Base",
|
|
29142
|
+
description: "Base schema for certificate references"
|
|
29143
|
+
});
|
|
29144
|
+
|
|
29145
|
+
// src/shared/schemas/references/credit-reference.schema.ts
|
|
29146
|
+
var CreditReferenceSchema = TokenReferenceBaseSchema.safeExtend({
|
|
29147
|
+
slug: CreditTokenSlugSchema,
|
|
29148
|
+
symbol: CreditTokenSymbolSchema
|
|
29149
|
+
}).meta({
|
|
29150
|
+
title: "Credit Reference",
|
|
29151
|
+
description: "Reference to an ERC20 credit token"
|
|
29152
|
+
});
|
|
29153
|
+
|
|
29154
|
+
// src/shared/schemas/references/gas-id-reference.schema.ts
|
|
29155
|
+
var GasIDReferenceSchema = NftTokenReferenceBaseSchema.meta({
|
|
29156
|
+
title: "GasID Reference",
|
|
29157
|
+
description: "Reference to a GasID record"
|
|
29158
|
+
});
|
|
29152
29159
|
var MethodologyReferenceSchema = zod.z.strictObject({
|
|
29153
29160
|
external_id: ExternalIdSchema.meta({
|
|
29154
29161
|
title: "Methodology External ID",
|
|
@@ -29172,6 +29179,22 @@ var MethodologyReferenceSchema = zod.z.strictObject({
|
|
|
29172
29179
|
description: "Reference to a methodology record"
|
|
29173
29180
|
});
|
|
29174
29181
|
|
|
29182
|
+
// src/shared/schemas/references/receipt-reference.schema.ts
|
|
29183
|
+
var CreditPurchaseReceiptReferenceSchema = NftTokenReferenceBaseSchema.meta({
|
|
29184
|
+
title: "Credit Purchase Receipt Reference",
|
|
29185
|
+
description: "Reference to the credit purchase receipt when retirement occurs during purchase"
|
|
29186
|
+
});
|
|
29187
|
+
var CreditRetirementReceiptReferenceSchema = NftTokenReferenceBaseSchema.meta({
|
|
29188
|
+
title: "Credit Retirement Receipt Reference",
|
|
29189
|
+
description: "Reference to the retirement receipt NFT"
|
|
29190
|
+
});
|
|
29191
|
+
|
|
29192
|
+
// src/shared/schemas/references/recycled-id-reference.schema.ts
|
|
29193
|
+
var RecycledIDReferenceSchema = NftTokenReferenceBaseSchema.meta({
|
|
29194
|
+
title: "RecycledID Reference",
|
|
29195
|
+
description: "Reference to a RecycledID record"
|
|
29196
|
+
});
|
|
29197
|
+
|
|
29175
29198
|
// src/shared/schemas/audit.schema.ts
|
|
29176
29199
|
var AuditRuleDefinitionSchema = zod.z.strictObject({
|
|
29177
29200
|
id: UuidSchema.meta({
|
|
@@ -29306,6 +29329,16 @@ var AuditRuleExecutionResultSchema = zod.z.strictObject({
|
|
|
29306
29329
|
title: "Rule Execution Result",
|
|
29307
29330
|
description: "Result of the rule execution"
|
|
29308
29331
|
}),
|
|
29332
|
+
execution_message: NonEmptyStringSchema.max(2e3).optional().meta({
|
|
29333
|
+
title: "Execution Message",
|
|
29334
|
+
description: "Human-readable message explaining the rule execution result, including details about what was validated or calculated",
|
|
29335
|
+
examples: [
|
|
29336
|
+
"No other MassIDs with the same attributes were found.",
|
|
29337
|
+
"The MassID is not linked to a valid MassID Certificate",
|
|
29338
|
+
'The time between the "Drop-off" and "Recycled" events is 90 days, within the valid range (60-180 days).',
|
|
29339
|
+
"The prevented emissions were calculated as 419.93 kg CO\u2082e using the formula (1 - 0.029) x 0.067 x 6454.8 = 419.93"
|
|
29340
|
+
]
|
|
29341
|
+
}),
|
|
29309
29342
|
rule_processor_checksum: NonEmptyStringSchema.max(200).meta({
|
|
29310
29343
|
title: "Rule Processor Checksum",
|
|
29311
29344
|
description: "Checksum for rule processor integrity verification"
|
|
@@ -29560,12 +29593,6 @@ var ReceiptIdentitySchema = zod.z.strictObject({
|
|
|
29560
29593
|
title: "Identity",
|
|
29561
29594
|
description: "Participant identity information"
|
|
29562
29595
|
});
|
|
29563
|
-
var MassIDReferenceWithContractSchema = MassIDReferenceSchema.safeExtend({
|
|
29564
|
-
smart_contract_address: SmartContractAddressSchema
|
|
29565
|
-
}).meta({
|
|
29566
|
-
title: "MassID Reference with Smart Contract",
|
|
29567
|
-
description: "Reference to a MassID record with smart contract address"
|
|
29568
|
-
});
|
|
29569
29596
|
function createReceiptCollectionSchema(params) {
|
|
29570
29597
|
const { meta } = params;
|
|
29571
29598
|
return zod.z.strictObject({
|
|
@@ -29585,26 +29612,6 @@ function createReceiptCollectionSchema(params) {
|
|
|
29585
29612
|
})
|
|
29586
29613
|
}).meta(meta);
|
|
29587
29614
|
}
|
|
29588
|
-
function createReceiptCreditSchema(params) {
|
|
29589
|
-
const { meta } = params;
|
|
29590
|
-
return zod.z.strictObject({
|
|
29591
|
-
slug: CreditTokenSlugSchema,
|
|
29592
|
-
symbol: CreditTokenSymbolSchema,
|
|
29593
|
-
external_id: ExternalIdSchema.meta({
|
|
29594
|
-
title: "Credit External ID",
|
|
29595
|
-
description: "External identifier for the credit"
|
|
29596
|
-
}),
|
|
29597
|
-
external_url: ExternalUrlSchema.meta({
|
|
29598
|
-
title: "Credit External URL",
|
|
29599
|
-
description: "External URL for the credit"
|
|
29600
|
-
}),
|
|
29601
|
-
ipfs_uri: IpfsUriSchema.meta({
|
|
29602
|
-
title: "Credit IPFS URI",
|
|
29603
|
-
description: "IPFS URI for the credit details"
|
|
29604
|
-
}),
|
|
29605
|
-
smart_contract_address: SmartContractAddressSchema
|
|
29606
|
-
}).meta(meta);
|
|
29607
|
-
}
|
|
29608
29615
|
var CertificateCollectionItemPurchaseSchema = zod.z.strictObject({
|
|
29609
29616
|
slug: CollectionSlugSchema.meta({
|
|
29610
29617
|
title: "Collection Slug",
|
|
@@ -29632,37 +29639,6 @@ var CertificateCollectionItemRetirementSchema = zod.z.strictObject({
|
|
|
29632
29639
|
title: "Certificate Collection Item (Retirement)",
|
|
29633
29640
|
description: "Collection reference with retired amount for a certificate in a retirement receipt"
|
|
29634
29641
|
});
|
|
29635
|
-
var certificateBaseShape = {
|
|
29636
|
-
token_id: TokenIdSchema.meta({
|
|
29637
|
-
title: "Certificate Token ID",
|
|
29638
|
-
description: "Token ID of the certificate"
|
|
29639
|
-
}),
|
|
29640
|
-
type: CertificateTypeSchema,
|
|
29641
|
-
external_id: ExternalIdSchema.meta({
|
|
29642
|
-
title: "Certificate External ID",
|
|
29643
|
-
description: "External identifier for the certificate"
|
|
29644
|
-
}),
|
|
29645
|
-
external_url: ExternalUrlSchema.meta({
|
|
29646
|
-
title: "Certificate External URL",
|
|
29647
|
-
description: "External URL for the certificate"
|
|
29648
|
-
}),
|
|
29649
|
-
ipfs_uri: IpfsUriSchema.meta({
|
|
29650
|
-
title: "Certificate IPFS URI",
|
|
29651
|
-
description: "IPFS URI for the certificate metadata"
|
|
29652
|
-
}),
|
|
29653
|
-
smart_contract_address: SmartContractAddressSchema,
|
|
29654
|
-
total_amount: CreditAmountSchema.meta({
|
|
29655
|
-
title: "Certificate Total Amount",
|
|
29656
|
-
description: "Total credits available in this certificate"
|
|
29657
|
-
}),
|
|
29658
|
-
mass_id: MassIDReferenceWithContractSchema
|
|
29659
|
-
};
|
|
29660
|
-
function createReceiptCertificateSchema(params) {
|
|
29661
|
-
return zod.z.strictObject({
|
|
29662
|
-
...certificateBaseShape,
|
|
29663
|
-
...params.additionalShape
|
|
29664
|
-
}).meta(params.meta);
|
|
29665
|
-
}
|
|
29666
29642
|
function getSchemaBaseUrl() {
|
|
29667
29643
|
return `https://raw.githubusercontent.com/carrot-foundation/schemas/refs/tags/${getSchemaVersionOrDefault()}/schemas/ipfs`;
|
|
29668
29644
|
}
|
|
@@ -29671,7 +29647,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
29671
29647
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
29672
29648
|
}
|
|
29673
29649
|
function getSchemaVersionOrDefault() {
|
|
29674
|
-
return "0.1.
|
|
29650
|
+
return "0.1.61";
|
|
29675
29651
|
}
|
|
29676
29652
|
|
|
29677
29653
|
// src/shared/schema-validation.ts
|
|
@@ -31210,30 +31186,25 @@ var CreditPurchaseReceiptCollectionSchema = createReceiptCollectionSchema({
|
|
|
31210
31186
|
description: "Collection included in the purchase"
|
|
31211
31187
|
}
|
|
31212
31188
|
});
|
|
31213
|
-
var CreditPurchaseReceiptCreditSchema =
|
|
31214
|
-
|
|
31215
|
-
|
|
31216
|
-
description: "Credit token included in the purchase"
|
|
31217
|
-
}
|
|
31189
|
+
var CreditPurchaseReceiptCreditSchema = CreditReferenceSchema.meta({
|
|
31190
|
+
title: "Credit",
|
|
31191
|
+
description: "Credit token included in the purchase"
|
|
31218
31192
|
});
|
|
31219
|
-
var CreditPurchaseReceiptCertificateSchema =
|
|
31220
|
-
|
|
31221
|
-
|
|
31222
|
-
|
|
31223
|
-
|
|
31224
|
-
|
|
31225
|
-
|
|
31226
|
-
|
|
31227
|
-
|
|
31228
|
-
|
|
31229
|
-
|
|
31230
|
-
|
|
31231
|
-
|
|
31232
|
-
|
|
31233
|
-
|
|
31234
|
-
title: "Certificate",
|
|
31235
|
-
description: "Certificate associated with the purchase"
|
|
31236
|
-
}
|
|
31193
|
+
var CreditPurchaseReceiptCertificateSchema = CertificateReferenceBaseSchema.safeExtend({
|
|
31194
|
+
credit_slug: CreditTokenSlugSchema.meta({
|
|
31195
|
+
description: "Slug of the credit type for this certificate"
|
|
31196
|
+
}),
|
|
31197
|
+
collections: uniqueBy(
|
|
31198
|
+
CertificateCollectionItemPurchaseSchema,
|
|
31199
|
+
(item) => item.slug,
|
|
31200
|
+
"Collection slugs within certificate collections must be unique"
|
|
31201
|
+
).min(1).meta({
|
|
31202
|
+
title: "Certificate Collections",
|
|
31203
|
+
description: "Collections associated with this certificate, each with purchased and retired amounts"
|
|
31204
|
+
})
|
|
31205
|
+
}).meta({
|
|
31206
|
+
title: "Certificate",
|
|
31207
|
+
description: "Certificate associated with the purchase"
|
|
31237
31208
|
});
|
|
31238
31209
|
var CreditPurchaseReceiptParticipantRewardSchema = zod.z.strictObject({
|
|
31239
31210
|
participant_id_hash: ParticipantIdHashSchema,
|
|
@@ -31252,28 +31223,7 @@ var CreditPurchaseReceiptParticipantRewardSchema = zod.z.strictObject({
|
|
|
31252
31223
|
title: "Participant Reward",
|
|
31253
31224
|
description: "Reward distribution for a participant"
|
|
31254
31225
|
});
|
|
31255
|
-
var CreditPurchaseReceiptRetirementReceiptSchema =
|
|
31256
|
-
token_id: TokenIdSchema.meta({
|
|
31257
|
-
title: "Retirement Receipt Token ID",
|
|
31258
|
-
description: "Token ID of the retirement receipt NFT"
|
|
31259
|
-
}),
|
|
31260
|
-
external_id: ExternalIdSchema.meta({
|
|
31261
|
-
title: "Retirement Receipt External ID",
|
|
31262
|
-
description: "External identifier for the retirement receipt"
|
|
31263
|
-
}),
|
|
31264
|
-
external_url: ExternalUrlSchema.meta({
|
|
31265
|
-
title: "Retirement Receipt External URL",
|
|
31266
|
-
description: "External URL for the retirement receipt"
|
|
31267
|
-
}),
|
|
31268
|
-
ipfs_uri: IpfsUriSchema.meta({
|
|
31269
|
-
title: "Retirement Receipt IPFS URI",
|
|
31270
|
-
description: "IPFS URI for the retirement receipt metadata"
|
|
31271
|
-
}),
|
|
31272
|
-
smart_contract_address: SmartContractAddressSchema
|
|
31273
|
-
}).meta({
|
|
31274
|
-
title: "Retirement Receipt Reference",
|
|
31275
|
-
description: "Reference to the retirement receipt NFT"
|
|
31276
|
-
});
|
|
31226
|
+
var CreditPurchaseReceiptRetirementReceiptSchema = CreditRetirementReceiptReferenceSchema;
|
|
31277
31227
|
var CreditPurchaseReceiptDataSchema = zod.z.strictObject({
|
|
31278
31228
|
summary: CreditPurchaseReceiptSummarySchema,
|
|
31279
31229
|
buyer: CreditPurchaseReceiptBuyerSchema,
|
|
@@ -31698,11 +31648,9 @@ var CreditRetirementReceiptCollectionSchema = createReceiptCollectionSchema({
|
|
|
31698
31648
|
description: "Collection included in the retirement"
|
|
31699
31649
|
}
|
|
31700
31650
|
});
|
|
31701
|
-
var CreditRetirementReceiptCreditSchema =
|
|
31702
|
-
|
|
31703
|
-
|
|
31704
|
-
description: "Credit token retired in this receipt"
|
|
31705
|
-
}
|
|
31651
|
+
var CreditRetirementReceiptCreditSchema = CreditReferenceSchema.meta({
|
|
31652
|
+
title: "Credit",
|
|
31653
|
+
description: "Credit token retired in this receipt"
|
|
31706
31654
|
});
|
|
31707
31655
|
var CreditRetirementReceiptCertificateCreditSchema = zod.z.strictObject({
|
|
31708
31656
|
credit_symbol: CreditTokenSymbolSchema.meta({
|
|
@@ -31727,54 +31675,27 @@ var CreditRetirementReceiptCertificateCreditSchema = zod.z.strictObject({
|
|
|
31727
31675
|
title: "Certificate Credit Retirement",
|
|
31728
31676
|
description: "Credit retirement breakdown for a certificate"
|
|
31729
31677
|
});
|
|
31730
|
-
var
|
|
31731
|
-
|
|
31732
|
-
|
|
31733
|
-
|
|
31734
|
-
|
|
31735
|
-
|
|
31736
|
-
title: "
|
|
31737
|
-
description: "
|
|
31738
|
-
}),
|
|
31739
|
-
external_url: ExternalUrlSchema.meta({
|
|
31740
|
-
title: "Purchase Receipt External URL",
|
|
31741
|
-
description: "External URL for the purchase receipt"
|
|
31742
|
-
}),
|
|
31743
|
-
ipfs_uri: IpfsUriSchema.meta({
|
|
31744
|
-
title: "Purchase Receipt IPFS URI",
|
|
31745
|
-
description: "IPFS URI for the purchase receipt metadata"
|
|
31678
|
+
var CreditRetirementReceiptCertificateSchema = CertificateReferenceBaseSchema.safeExtend({
|
|
31679
|
+
collections: uniqueBy(
|
|
31680
|
+
CertificateCollectionItemRetirementSchema,
|
|
31681
|
+
(item) => item.slug,
|
|
31682
|
+
"Collection slugs within certificate collections must be unique"
|
|
31683
|
+
).min(1).meta({
|
|
31684
|
+
title: "Certificate Collections",
|
|
31685
|
+
description: "Collections associated with this certificate, each with retired amounts"
|
|
31746
31686
|
}),
|
|
31747
|
-
|
|
31687
|
+
credits_retired: uniqueBy(
|
|
31688
|
+
CreditRetirementReceiptCertificateCreditSchema,
|
|
31689
|
+
(credit) => credit.credit_symbol,
|
|
31690
|
+
"Credit symbols within credits_retired must be unique"
|
|
31691
|
+
).min(1).meta({
|
|
31692
|
+
title: "Credits Retired",
|
|
31693
|
+
description: "Breakdown of credits retired from this certificate by symbol"
|
|
31694
|
+
})
|
|
31748
31695
|
}).meta({
|
|
31749
|
-
title: "
|
|
31750
|
-
description: "
|
|
31696
|
+
title: "Certificate",
|
|
31697
|
+
description: "Certificate associated with the retirement"
|
|
31751
31698
|
});
|
|
31752
|
-
var CreditRetirementReceiptCertificateSchema = createReceiptCertificateSchema(
|
|
31753
|
-
{
|
|
31754
|
-
additionalShape: {
|
|
31755
|
-
collections: uniqueBy(
|
|
31756
|
-
CertificateCollectionItemRetirementSchema,
|
|
31757
|
-
(item) => item.slug,
|
|
31758
|
-
"Collection slugs within certificate collections must be unique"
|
|
31759
|
-
).min(1).meta({
|
|
31760
|
-
title: "Certificate Collections",
|
|
31761
|
-
description: "Collections associated with this certificate, each with retired amounts"
|
|
31762
|
-
}),
|
|
31763
|
-
credits_retired: uniqueBy(
|
|
31764
|
-
CreditRetirementReceiptCertificateCreditSchema,
|
|
31765
|
-
(credit) => credit.credit_symbol,
|
|
31766
|
-
"Credit symbols within credits_retired must be unique"
|
|
31767
|
-
).min(1).meta({
|
|
31768
|
-
title: "Credits Retired",
|
|
31769
|
-
description: "Breakdown of credits retired from this certificate by symbol"
|
|
31770
|
-
})
|
|
31771
|
-
},
|
|
31772
|
-
meta: {
|
|
31773
|
-
title: "Certificate",
|
|
31774
|
-
description: "Certificate associated with the retirement"
|
|
31775
|
-
}
|
|
31776
|
-
}
|
|
31777
|
-
);
|
|
31778
31699
|
var CreditRetirementReceiptDataSchema = zod.z.strictObject({
|
|
31779
31700
|
summary: CreditRetirementReceiptSummarySchema,
|
|
31780
31701
|
beneficiary: CreditRetirementReceiptBeneficiarySchema,
|
|
@@ -31924,9 +31845,6 @@ var CreditRetirementReceiptDataSchema = zod.z.strictObject({
|
|
|
31924
31845
|
title: "Credit Retirement Receipt Data",
|
|
31925
31846
|
description: "Complete data structure for a credit retirement receipt"
|
|
31926
31847
|
});
|
|
31927
|
-
var CreditRetirementReceiptIpfsSchemaBase = NftIpfsSchema.omit({
|
|
31928
|
-
full_content_hash: true
|
|
31929
|
-
});
|
|
31930
31848
|
var CreditRetirementReceiptIpfsSchemaMeta = {
|
|
31931
31849
|
title: "CreditRetirementReceipt NFT IPFS Record",
|
|
31932
31850
|
description: "Complete CreditRetirementReceipt NFT IPFS record including attributes and credit retirement data",
|
|
@@ -31935,8 +31853,8 @@ var CreditRetirementReceiptIpfsSchemaMeta = {
|
|
|
31935
31853
|
),
|
|
31936
31854
|
version: getSchemaVersionOrDefault()
|
|
31937
31855
|
};
|
|
31938
|
-
var CreditRetirementReceiptIpfsSchema =
|
|
31939
|
-
schema:
|
|
31856
|
+
var CreditRetirementReceiptIpfsSchema = NftIpfsSchema.safeExtend({
|
|
31857
|
+
schema: NftIpfsSchema.shape.schema.safeExtend({
|
|
31940
31858
|
type: zod.z.literal("CreditRetirementReceipt").meta({
|
|
31941
31859
|
title: "CreditRetirementReceipt Schema Type",
|
|
31942
31860
|
description: "Schema type identifier for this record"
|
|
@@ -32235,12 +32153,40 @@ var MassIDAuditSummarySchema = zod.z.strictObject({
|
|
|
32235
32153
|
var MassIDAuditDataSchema = zod.z.strictObject({
|
|
32236
32154
|
methodology: MethodologyReferenceSchema,
|
|
32237
32155
|
mass_id: MassIDReferenceSchema,
|
|
32238
|
-
gas_id: GasIDReferenceSchema,
|
|
32156
|
+
gas_id: GasIDReferenceSchema.optional(),
|
|
32157
|
+
recycled_id: RecycledIDReferenceSchema.optional(),
|
|
32239
32158
|
audit_summary: MassIDAuditSummarySchema,
|
|
32240
32159
|
rule_execution_results: AuditRuleExecutionResultsSchema
|
|
32160
|
+
}).superRefine((data, ctx) => {
|
|
32161
|
+
const hasGasId = !!data.gas_id;
|
|
32162
|
+
const hasRecycledId = !!data.recycled_id;
|
|
32163
|
+
if (!hasGasId && !hasRecycledId) {
|
|
32164
|
+
ctx.addIssue({
|
|
32165
|
+
code: "custom",
|
|
32166
|
+
path: ["gas_id"],
|
|
32167
|
+
message: "Either gas_id or recycled_id must be provided"
|
|
32168
|
+
});
|
|
32169
|
+
ctx.addIssue({
|
|
32170
|
+
code: "custom",
|
|
32171
|
+
path: ["recycled_id"],
|
|
32172
|
+
message: "Either gas_id or recycled_id must be provided"
|
|
32173
|
+
});
|
|
32174
|
+
}
|
|
32175
|
+
if (hasGasId && hasRecycledId) {
|
|
32176
|
+
ctx.addIssue({
|
|
32177
|
+
code: "custom",
|
|
32178
|
+
path: ["gas_id"],
|
|
32179
|
+
message: "gas_id and recycled_id are mutually exclusive"
|
|
32180
|
+
});
|
|
32181
|
+
ctx.addIssue({
|
|
32182
|
+
code: "custom",
|
|
32183
|
+
path: ["recycled_id"],
|
|
32184
|
+
message: "gas_id and recycled_id are mutually exclusive"
|
|
32185
|
+
});
|
|
32186
|
+
}
|
|
32241
32187
|
}).meta({
|
|
32242
32188
|
title: "MassID Audit Data",
|
|
32243
|
-
description: "Complete data structure for MassID Audit records"
|
|
32189
|
+
description: "Complete data structure for MassID Audit records. Must include exactly one of gas_id or recycled_id."
|
|
32244
32190
|
});
|
|
32245
32191
|
|
|
32246
32192
|
// src/mass-id-audit/mass-id-audit.schema.ts
|
|
@@ -32279,6 +32225,7 @@ exports.BlockchainNetworkNameSchema = BlockchainNetworkNameSchema;
|
|
|
32279
32225
|
exports.CertificateCollectionItemPurchaseSchema = CertificateCollectionItemPurchaseSchema;
|
|
32280
32226
|
exports.CertificateCollectionItemRetirementSchema = CertificateCollectionItemRetirementSchema;
|
|
32281
32227
|
exports.CertificateIssuanceDateAttributeSchema = CertificateIssuanceDateAttributeSchema;
|
|
32228
|
+
exports.CertificateReferenceBaseSchema = CertificateReferenceBaseSchema;
|
|
32282
32229
|
exports.CertificateTypeSchema = CertificateTypeSchema;
|
|
32283
32230
|
exports.CitySchema = CitySchema;
|
|
32284
32231
|
exports.CollectionNameSchema = CollectionNameSchema;
|
|
@@ -32294,13 +32241,16 @@ exports.CreditPurchaseReceiptDataSchema = CreditPurchaseReceiptDataSchema;
|
|
|
32294
32241
|
exports.CreditPurchaseReceiptIpfsSchema = CreditPurchaseReceiptIpfsSchema;
|
|
32295
32242
|
exports.CreditPurchaseReceiptIpfsSchemaMeta = CreditPurchaseReceiptIpfsSchemaMeta;
|
|
32296
32243
|
exports.CreditPurchaseReceiptNameSchema = CreditPurchaseReceiptNameSchema;
|
|
32244
|
+
exports.CreditPurchaseReceiptReferenceSchema = CreditPurchaseReceiptReferenceSchema;
|
|
32297
32245
|
exports.CreditPurchaseReceiptShortNameSchema = CreditPurchaseReceiptShortNameSchema;
|
|
32298
32246
|
exports.CreditPurchaseReceiptSummarySchema = CreditPurchaseReceiptSummarySchema;
|
|
32247
|
+
exports.CreditReferenceSchema = CreditReferenceSchema;
|
|
32299
32248
|
exports.CreditRetirementReceiptAttributesSchema = CreditRetirementReceiptAttributesSchema;
|
|
32300
32249
|
exports.CreditRetirementReceiptDataSchema = CreditRetirementReceiptDataSchema;
|
|
32301
32250
|
exports.CreditRetirementReceiptIpfsSchema = CreditRetirementReceiptIpfsSchema;
|
|
32302
32251
|
exports.CreditRetirementReceiptIpfsSchemaMeta = CreditRetirementReceiptIpfsSchemaMeta;
|
|
32303
32252
|
exports.CreditRetirementReceiptNameSchema = CreditRetirementReceiptNameSchema;
|
|
32253
|
+
exports.CreditRetirementReceiptReferenceSchema = CreditRetirementReceiptReferenceSchema;
|
|
32304
32254
|
exports.CreditRetirementReceiptShortNameSchema = CreditRetirementReceiptShortNameSchema;
|
|
32305
32255
|
exports.CreditRetirementReceiptSummarySchema = CreditRetirementReceiptSummarySchema;
|
|
32306
32256
|
exports.CreditSchema = CreditSchema;
|
|
@@ -32347,7 +32297,6 @@ exports.MassIDIpfsSchemaMeta = MassIDIpfsSchemaMeta;
|
|
|
32347
32297
|
exports.MassIDNameSchema = MassIDNameSchema;
|
|
32348
32298
|
exports.MassIDRecyclingDateAttributeSchema = MassIDRecyclingDateAttributeSchema;
|
|
32349
32299
|
exports.MassIDReferenceSchema = MassIDReferenceSchema;
|
|
32350
|
-
exports.MassIDReferenceWithContractSchema = MassIDReferenceWithContractSchema;
|
|
32351
32300
|
exports.MassIDShortNameSchema = MassIDShortNameSchema;
|
|
32352
32301
|
exports.MassIDTokenIdAttributeSchema = MassIDTokenIdAttributeSchema;
|
|
32353
32302
|
exports.MethodologyAttributeSchema = MethodologyAttributeSchema;
|
|
@@ -32360,6 +32309,7 @@ exports.MethodologyShortNameSchema = MethodologyShortNameSchema;
|
|
|
32360
32309
|
exports.MethodologySlugSchema = MethodologySlugSchema;
|
|
32361
32310
|
exports.NftAttributeSchema = NftAttributeSchema;
|
|
32362
32311
|
exports.NftIpfsSchema = NftIpfsSchema;
|
|
32312
|
+
exports.NftTokenReferenceBaseSchema = NftTokenReferenceBaseSchema;
|
|
32363
32313
|
exports.NonEmptyStringSchema = NonEmptyStringSchema;
|
|
32364
32314
|
exports.NonNegativeFloatSchema = NonNegativeFloatSchema;
|
|
32365
32315
|
exports.NonNegativeIntegerSchema = NonNegativeIntegerSchema;
|
|
@@ -32378,6 +32328,7 @@ exports.RecycledIDDataSchema = RecycledIDDataSchema;
|
|
|
32378
32328
|
exports.RecycledIDIpfsSchema = RecycledIDIpfsSchema;
|
|
32379
32329
|
exports.RecycledIDIpfsSchemaMeta = RecycledIDIpfsSchemaMeta;
|
|
32380
32330
|
exports.RecycledIDNameSchema = RecycledIDNameSchema;
|
|
32331
|
+
exports.RecycledIDReferenceSchema = RecycledIDReferenceSchema;
|
|
32381
32332
|
exports.RecycledIDShortNameSchema = RecycledIDShortNameSchema;
|
|
32382
32333
|
exports.RewardAllocationSchema = RewardAllocationSchema;
|
|
32383
32334
|
exports.RewardDiscountSchema = RewardDiscountSchema;
|
|
@@ -32393,6 +32344,7 @@ exports.SourceWasteTypeAttributeSchema = SourceWasteTypeAttributeSchema;
|
|
|
32393
32344
|
exports.SourceWeightAttributeSchema = SourceWeightAttributeSchema;
|
|
32394
32345
|
exports.StringifiedTokenIdSchema = StringifiedTokenIdSchema;
|
|
32395
32346
|
exports.TokenIdSchema = TokenIdSchema;
|
|
32347
|
+
exports.TokenReferenceBaseSchema = TokenReferenceBaseSchema;
|
|
32396
32348
|
exports.UnixTimestampSchema = UnixTimestampSchema;
|
|
32397
32349
|
exports.UsdcAmountSchema = UsdcAmountSchema;
|
|
32398
32350
|
exports.UuidSchema = UuidSchema;
|
|
@@ -32417,9 +32369,7 @@ exports.createMassIDNameSchema = createMassIDNameSchema;
|
|
|
32417
32369
|
exports.createMassIDShortNameSchema = createMassIDShortNameSchema;
|
|
32418
32370
|
exports.createNumericAttributeSchema = createNumericAttributeSchema;
|
|
32419
32371
|
exports.createOrderedAttributesSchema = createOrderedAttributesSchema;
|
|
32420
|
-
exports.createReceiptCertificateSchema = createReceiptCertificateSchema;
|
|
32421
32372
|
exports.createReceiptCollectionSchema = createReceiptCollectionSchema;
|
|
32422
|
-
exports.createReceiptCreditSchema = createReceiptCreditSchema;
|
|
32423
32373
|
exports.createRecycledIDNameSchema = createRecycledIDNameSchema;
|
|
32424
32374
|
exports.createRecycledIDShortNameSchema = createRecycledIDShortNameSchema;
|
|
32425
32375
|
exports.createWeightAttributeSchema = createWeightAttributeSchema;
|