@carrot-foundation/schemas 0.2.3 → 0.2.4
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 +108 -173
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +108 -173
- package/dist/index.js.map +1 -1
- package/package.json +20 -20
- package/schemas/ipfs/collection/collection.example.json +3 -3
- package/schemas/ipfs/collection/collection.schema.json +75 -75
- package/schemas/ipfs/credit/credit.example.json +3 -3
- package/schemas/ipfs/credit/credit.schema.json +82 -82
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.example.json +4 -4
- package/schemas/ipfs/credit-purchase-receipt/credit-purchase-receipt.schema.json +394 -386
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.example.json +4 -4
- package/schemas/ipfs/credit-retirement-receipt/credit-retirement-receipt.schema.json +430 -422
- package/schemas/ipfs/gas-id/gas-id.example.json +4 -4
- package/schemas/ipfs/gas-id/gas-id.schema.json +419 -411
- package/schemas/ipfs/mass-id/mass-id.example.json +4 -4
- package/schemas/ipfs/mass-id/mass-id.schema.json +498 -494
- package/schemas/ipfs/mass-id-audit/mass-id-audit.example.json +3 -3
- package/schemas/ipfs/mass-id-audit/mass-id-audit.schema.json +220 -212
- package/schemas/ipfs/methodology/methodology.example.json +3 -3
- package/schemas/ipfs/methodology/methodology.schema.json +121 -121
- package/schemas/ipfs/recycled-id/recycled-id.example.json +4 -4
- package/schemas/ipfs/recycled-id/recycled-id.schema.json +373 -365
- package/schemas/schema-hashes.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -28636,26 +28636,58 @@ var NftIpfsSchema = BaseIpfsSchema.safeExtend({
|
|
|
28636
28636
|
});
|
|
28637
28637
|
|
|
28638
28638
|
// src/shared/schemas/core/nft-name.schemas.ts
|
|
28639
|
-
|
|
28640
|
-
|
|
28641
|
-
|
|
28642
|
-
|
|
28639
|
+
function buildNameSchemas(config) {
|
|
28640
|
+
const {
|
|
28641
|
+
prefix,
|
|
28642
|
+
regexSuffix,
|
|
28643
|
+
formatHint,
|
|
28644
|
+
title,
|
|
28645
|
+
description,
|
|
28646
|
+
examples,
|
|
28647
|
+
maxLength = 100
|
|
28648
|
+
} = config;
|
|
28649
|
+
const meta = { title, description, examples };
|
|
28650
|
+
const schema = NonEmptyStringSchema.max(maxLength).regex(
|
|
28651
|
+
new RegExp(`^${prefix} #\\d+${regexSuffix}$`),
|
|
28652
|
+
`Name must match format: "${prefix} #[token_id] \u2022 ${formatHint}"`
|
|
28653
|
+
).meta(meta);
|
|
28654
|
+
const createSchema = (tokenId) => NonEmptyStringSchema.max(maxLength).regex(
|
|
28655
|
+
new RegExp(String.raw`^${prefix} #${tokenId}${regexSuffix}$`),
|
|
28656
|
+
`Name must match format: "${prefix} #${tokenId} \u2022 ${formatHint}"`
|
|
28657
|
+
).meta(meta);
|
|
28658
|
+
return { schema, createSchema };
|
|
28659
|
+
}
|
|
28660
|
+
function buildShortNameSchemas(config) {
|
|
28661
|
+
const { prefix, title, description, examples, maxLength = 50 } = config;
|
|
28662
|
+
const meta = { title, description, examples };
|
|
28663
|
+
const schema = NonEmptyStringSchema.max(maxLength).regex(
|
|
28664
|
+
new RegExp(`^${prefix} #\\d+$`),
|
|
28665
|
+
`Short name must match format: "${prefix} #[token_id]"`
|
|
28666
|
+
).meta(meta);
|
|
28667
|
+
const createSchema = (tokenId) => NonEmptyStringSchema.max(maxLength).refine(
|
|
28668
|
+
(val) => val === `${prefix} #${tokenId}`,
|
|
28669
|
+
`Short name must be exactly "${prefix} #${tokenId}"`
|
|
28670
|
+
).meta(meta);
|
|
28671
|
+
return { schema, createSchema };
|
|
28672
|
+
}
|
|
28673
|
+
var massIdName = buildNameSchemas({
|
|
28674
|
+
prefix: "MassID",
|
|
28675
|
+
regexSuffix: " \u2022 .+ \u2022 .+t",
|
|
28676
|
+
formatHint: "[waste_type] \u2022 [weight]t",
|
|
28643
28677
|
title: "MassID Name",
|
|
28644
28678
|
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
|
-
]
|
|
28679
|
+
examples: ["MassID #1034 \u2022 Organic \u2022 3.25t", "MassID #123 \u2022 Plastic \u2022 2.5t"]
|
|
28649
28680
|
});
|
|
28650
|
-
var
|
|
28681
|
+
var massIdShortName = buildShortNameSchemas({
|
|
28682
|
+
prefix: "MassID",
|
|
28651
28683
|
title: "MassID Short Name",
|
|
28652
28684
|
description: 'Compact name for UI summaries, tables, or tooltips. Format: "MassID #[token_id]"',
|
|
28653
28685
|
examples: ["MassID #1034", "MassID #123"]
|
|
28654
28686
|
});
|
|
28655
|
-
var
|
|
28656
|
-
|
|
28657
|
-
|
|
28658
|
-
|
|
28687
|
+
var gasIdName = buildNameSchemas({
|
|
28688
|
+
prefix: "GasID",
|
|
28689
|
+
regexSuffix: " \u2022 .+ \u2022 .+t CO\u2082e",
|
|
28690
|
+
formatHint: "[methodology] \u2022 [co2e]t CO\u2082e",
|
|
28659
28691
|
title: "GasID Name",
|
|
28660
28692
|
description: 'Full display name for this GasID NFT. Format: "GasID #[token_id] \u2022 [methodology] \u2022 [co2e]t CO\u2082e"',
|
|
28661
28693
|
examples: [
|
|
@@ -28663,15 +28695,16 @@ var GasIDNameSchema = NonEmptyStringSchema.max(100).regex(
|
|
|
28663
28695
|
"GasID #789 \u2022 BOLD Carbon (CH\u2084) \u2022 1.2t CO\u2082e"
|
|
28664
28696
|
]
|
|
28665
28697
|
});
|
|
28666
|
-
var
|
|
28698
|
+
var gasIdShortName = buildShortNameSchemas({
|
|
28699
|
+
prefix: "GasID",
|
|
28667
28700
|
title: "GasID Short Name",
|
|
28668
28701
|
description: 'Compact name for UI summaries, tables, or tooltips. Format: "GasID #[token_id]"',
|
|
28669
28702
|
examples: ["GasID #456", "GasID #789"]
|
|
28670
28703
|
});
|
|
28671
|
-
var
|
|
28672
|
-
|
|
28673
|
-
|
|
28674
|
-
|
|
28704
|
+
var recycledIdName = buildNameSchemas({
|
|
28705
|
+
prefix: "RecycledID",
|
|
28706
|
+
regexSuffix: " \u2022 .+ \u2022 .+t Recycled",
|
|
28707
|
+
formatHint: "[methodology] \u2022 [weight]t Recycled",
|
|
28675
28708
|
title: "RecycledID Name",
|
|
28676
28709
|
description: 'Full display name for this RecycledID NFT. Format: "RecycledID #[token_id] \u2022 [methodology] \u2022 [weight]t Recycled"',
|
|
28677
28710
|
examples: [
|
|
@@ -28679,18 +28712,16 @@ var RecycledIDNameSchema = NonEmptyStringSchema.max(100).regex(
|
|
|
28679
28712
|
"RecycledID #456 \u2022 BOLD Recycling \u2022 2.5t Recycled"
|
|
28680
28713
|
]
|
|
28681
28714
|
});
|
|
28682
|
-
var
|
|
28683
|
-
|
|
28684
|
-
'Short name must match format: "RecycledID #[token_id]"'
|
|
28685
|
-
).meta({
|
|
28715
|
+
var recycledIdShortName = buildShortNameSchemas({
|
|
28716
|
+
prefix: "RecycledID",
|
|
28686
28717
|
title: "RecycledID Short Name",
|
|
28687
28718
|
description: 'Compact name for UI summaries, tables, or tooltips. Format: "RecycledID #[token_id]"',
|
|
28688
28719
|
examples: ["RecycledID #789", "RecycledID #456"]
|
|
28689
28720
|
});
|
|
28690
|
-
var
|
|
28691
|
-
|
|
28692
|
-
|
|
28693
|
-
|
|
28721
|
+
var creditPurchaseReceiptName = buildNameSchemas({
|
|
28722
|
+
prefix: "Credit Purchase Receipt",
|
|
28723
|
+
regexSuffix: " \u2022 .+ Credits Purchased",
|
|
28724
|
+
formatHint: "[amount] Credits Purchased",
|
|
28694
28725
|
title: "Credit Purchase Receipt Name",
|
|
28695
28726
|
description: 'Full display name for this Credit Purchase Receipt NFT. Format: "Credit Purchase Receipt #[token_id] \u2022 [amount] Credits Purchased"',
|
|
28696
28727
|
examples: [
|
|
@@ -28698,18 +28729,16 @@ var CreditPurchaseReceiptNameSchema = NonEmptyStringSchema.max(100).regex(
|
|
|
28698
28729
|
"Credit Purchase Receipt #1200 \u2022 15.0 Credits Purchased"
|
|
28699
28730
|
]
|
|
28700
28731
|
});
|
|
28701
|
-
var
|
|
28702
|
-
|
|
28703
|
-
'Short name must match format: "Purchase Receipt #[token_id]"'
|
|
28704
|
-
).meta({
|
|
28732
|
+
var creditPurchaseReceiptShortName = buildShortNameSchemas({
|
|
28733
|
+
prefix: "Purchase Receipt",
|
|
28705
28734
|
title: "Credit Purchase Receipt Short Name",
|
|
28706
28735
|
description: 'Compact name for UI summaries, tables, or tooltips. Format: "Purchase Receipt #[token_id]"',
|
|
28707
28736
|
examples: ["Purchase Receipt #987", "Purchase Receipt #1200"]
|
|
28708
28737
|
});
|
|
28709
|
-
var
|
|
28710
|
-
|
|
28711
|
-
|
|
28712
|
-
|
|
28738
|
+
var creditRetirementReceiptName = buildNameSchemas({
|
|
28739
|
+
prefix: "Credit Retirement Receipt",
|
|
28740
|
+
regexSuffix: " \u2022 .+ Credits Retired",
|
|
28741
|
+
formatHint: "[amount] Credits Retired",
|
|
28713
28742
|
title: "Credit Retirement Receipt Name",
|
|
28714
28743
|
description: 'Full display name for this Credit Retirement Receipt NFT. Format: "Credit Retirement Receipt #[token_id] \u2022 [amount] Credits Retired"',
|
|
28715
28744
|
examples: [
|
|
@@ -28717,145 +28746,36 @@ var CreditRetirementReceiptNameSchema = NonEmptyStringSchema.max(100).regex(
|
|
|
28717
28746
|
"Credit Retirement Receipt #1200 \u2022 3.0 Credits Retired"
|
|
28718
28747
|
]
|
|
28719
28748
|
});
|
|
28720
|
-
var
|
|
28721
|
-
|
|
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({
|
|
28749
|
+
var creditRetirementReceiptShortName = buildShortNameSchemas({
|
|
28750
|
+
prefix: "Retirement Receipt",
|
|
28842
28751
|
title: "Credit Retirement Receipt Short Name",
|
|
28843
28752
|
description: 'Compact name for UI summaries, tables, or tooltips. Format: "Retirement Receipt #[token_id]"',
|
|
28844
28753
|
examples: ["Retirement Receipt #1245", "Retirement Receipt #1200"]
|
|
28845
28754
|
});
|
|
28755
|
+
var MassIDNameSchema = massIdName.schema;
|
|
28756
|
+
var MassIDShortNameSchema = massIdShortName.schema;
|
|
28757
|
+
var createMassIDNameSchema = massIdName.createSchema;
|
|
28758
|
+
var createMassIDShortNameSchema = massIdShortName.createSchema;
|
|
28759
|
+
var GasIDNameSchema = gasIdName.schema;
|
|
28760
|
+
var GasIDShortNameSchema = gasIdShortName.schema;
|
|
28761
|
+
var createGasIDNameSchema = gasIdName.createSchema;
|
|
28762
|
+
var createGasIDShortNameSchema = gasIdShortName.createSchema;
|
|
28763
|
+
var RecycledIDNameSchema = recycledIdName.schema;
|
|
28764
|
+
var RecycledIDShortNameSchema = recycledIdShortName.schema;
|
|
28765
|
+
var createRecycledIDNameSchema = recycledIdName.createSchema;
|
|
28766
|
+
var createRecycledIDShortNameSchema = recycledIdShortName.createSchema;
|
|
28767
|
+
var CreditPurchaseReceiptNameSchema = creditPurchaseReceiptName.schema;
|
|
28768
|
+
var CreditPurchaseReceiptShortNameSchema = creditPurchaseReceiptShortName.schema;
|
|
28769
|
+
var createCreditPurchaseReceiptNameSchema = creditPurchaseReceiptName.createSchema;
|
|
28770
|
+
var createCreditPurchaseReceiptShortNameSchema = creditPurchaseReceiptShortName.createSchema;
|
|
28771
|
+
var CreditRetirementReceiptNameSchema = creditRetirementReceiptName.schema;
|
|
28772
|
+
var CreditRetirementReceiptShortNameSchema = creditRetirementReceiptShortName.schema;
|
|
28773
|
+
var createCreditRetirementReceiptNameSchema = creditRetirementReceiptName.createSchema;
|
|
28774
|
+
var createCreditRetirementReceiptShortNameSchema = creditRetirementReceiptShortName.createSchema;
|
|
28846
28775
|
function getSchemaMetadata(schema) {
|
|
28847
|
-
|
|
28848
|
-
|
|
28849
|
-
|
|
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 {
|
|
28776
|
+
const meta = schema.meta();
|
|
28777
|
+
if (meta && typeof meta === "object") {
|
|
28778
|
+
return meta;
|
|
28859
28779
|
}
|
|
28860
28780
|
return void 0;
|
|
28861
28781
|
}
|
|
@@ -28883,7 +28803,7 @@ function extractTraitType(schema) {
|
|
|
28883
28803
|
if (meta?.title) {
|
|
28884
28804
|
const title = meta.title;
|
|
28885
28805
|
if (title.endsWith(" Attribute")) {
|
|
28886
|
-
const inferred = title.slice(0, -
|
|
28806
|
+
const inferred = title.slice(0, -" Attribute".length);
|
|
28887
28807
|
if (inferred.length > 3) {
|
|
28888
28808
|
return inferred;
|
|
28889
28809
|
}
|
|
@@ -29457,7 +29377,7 @@ var SummaryBaseSchema = zod.z.strictObject({
|
|
|
29457
29377
|
description: "Total number of certificates represented in the receipt"
|
|
29458
29378
|
})
|
|
29459
29379
|
});
|
|
29460
|
-
var CreditPurchaseReceiptSummarySchema = SummaryBaseSchema.
|
|
29380
|
+
var CreditPurchaseReceiptSummarySchema = SummaryBaseSchema.safeExtend({
|
|
29461
29381
|
total_amount_usdc: UsdcAmountSchema.meta({
|
|
29462
29382
|
title: "Total Amount (USDC)",
|
|
29463
29383
|
description: "Total amount paid in USDC for the purchase"
|
|
@@ -29474,7 +29394,7 @@ var CreditPurchaseReceiptSummarySchema = SummaryBaseSchema.extend({
|
|
|
29474
29394
|
title: "Credit Purchase Receipt Summary",
|
|
29475
29395
|
description: "Summary totals for the credit purchase including amounts and collections represented"
|
|
29476
29396
|
});
|
|
29477
|
-
var CreditRetirementReceiptSummarySchema = SummaryBaseSchema.
|
|
29397
|
+
var CreditRetirementReceiptSummarySchema = SummaryBaseSchema.safeExtend({
|
|
29478
29398
|
total_credits_retired: CreditAmountSchema.meta({
|
|
29479
29399
|
title: "Total Credits Retired",
|
|
29480
29400
|
description: "Total amount of credits retired"
|
|
@@ -29559,7 +29479,7 @@ function buildSchemaUrl(schemaPath) {
|
|
|
29559
29479
|
return `${getSchemaBaseUrl()}/${cleanPath}`;
|
|
29560
29480
|
}
|
|
29561
29481
|
function getSchemaVersionOrDefault() {
|
|
29562
|
-
return "0.2.
|
|
29482
|
+
return "0.2.4";
|
|
29563
29483
|
}
|
|
29564
29484
|
|
|
29565
29485
|
// src/shared/schema-validation.ts
|
|
@@ -30392,6 +30312,22 @@ var MassIDIpfsSchema = NftIpfsSchema.safeExtend({
|
|
|
30392
30312
|
path: ["short_name"],
|
|
30393
30313
|
message: `Short name token_id must match blockchain.token_id: ${record.blockchain.token_id}`
|
|
30394
30314
|
});
|
|
30315
|
+
const nameSchema = createMassIDNameSchema(record.blockchain.token_id);
|
|
30316
|
+
validateFormattedName({
|
|
30317
|
+
ctx,
|
|
30318
|
+
name: record.name,
|
|
30319
|
+
schema: nameSchema,
|
|
30320
|
+
path: ["name"]
|
|
30321
|
+
});
|
|
30322
|
+
const shortNameSchema = createMassIDShortNameSchema(
|
|
30323
|
+
record.blockchain.token_id
|
|
30324
|
+
);
|
|
30325
|
+
validateFormattedName({
|
|
30326
|
+
ctx,
|
|
30327
|
+
name: record.short_name,
|
|
30328
|
+
schema: shortNameSchema,
|
|
30329
|
+
path: ["short_name"]
|
|
30330
|
+
});
|
|
30395
30331
|
const { data, attributes } = record;
|
|
30396
30332
|
const attributeByTraitType = createAttributeMap(attributes);
|
|
30397
30333
|
validateAttributeValue({
|
|
@@ -32124,7 +32060,6 @@ var MassIDAuditSchema = BaseIpfsSchema.safeExtend({
|
|
|
32124
32060
|
}),
|
|
32125
32061
|
data: MassIDAuditDataSchema
|
|
32126
32062
|
}).meta(MassIDAuditSchemaMeta);
|
|
32127
|
-
/* v8 ignore file -- @preserve */
|
|
32128
32063
|
|
|
32129
32064
|
exports.ALLOWED_BLOCKCHAIN_NETWORKS = ALLOWED_BLOCKCHAIN_NETWORKS;
|
|
32130
32065
|
exports.AuditReferenceSchema = AuditReferenceSchema;
|