From 093a419c4d625dc6710736dc97da03e5231a2c24 Mon Sep 17 00:00:00 2001 From: Omar Kilani Date: Tue, 1 Aug 2023 21:05:26 -0700 Subject: [PATCH] Add `ProgrammableConfig` to token metadata struct. (#137) C.f. https://github.com/metaplex-foundation/mpl-token-metadata/blob/main/programs/token-metadata/program/src/state/metadata.rs#L372 --- program/metaplex/token_metadata/state.go | 10 ++++++++++ program/metaplex/tokenmeta/state.go | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/program/metaplex/token_metadata/state.go b/program/metaplex/token_metadata/state.go index 7eef8ff7..c1f1aea4 100644 --- a/program/metaplex/token_metadata/state.go +++ b/program/metaplex/token_metadata/state.go @@ -71,6 +71,7 @@ type Metadata struct { Collection *Collection Uses *Uses CollectionDetails *CollectionDetails + ProgrammableConfig *ProgrammableConfig } type TokenStandard borsh.Enum @@ -111,6 +112,15 @@ type CollectionDetailsV1 struct { Size uint64 } +type ProgrammableConfig struct { + Enum borsh.Enum `borsh_enum:"true"` + V1 ProgrammableConfigV1 +} + +type ProgrammableConfigV1 struct { + RuleSet *common.PublicKey +} + func MetadataDeserialize(data []byte) (Metadata, error) { var metadata Metadata err := borsh.Deserialize(&metadata, data) diff --git a/program/metaplex/tokenmeta/state.go b/program/metaplex/tokenmeta/state.go index d6c114de..d4a5bcda 100644 --- a/program/metaplex/tokenmeta/state.go +++ b/program/metaplex/tokenmeta/state.go @@ -71,6 +71,7 @@ type Metadata struct { Collection *Collection Uses *Uses CollectionDetails *CollectionDetails + ProgrammableConfig *ProgrammableConfig } type TokenStandard borsh.Enum @@ -111,6 +112,15 @@ type CollectionDetailsV1 struct { Size uint64 } +type ProgrammableConfig struct { + Enum borsh.Enum `borsh_enum:"true"` + V1 ProgrammableConfigV1 +} + +type ProgrammableConfigV1 struct { + RuleSet *common.PublicKey +} + func MetadataDeserialize(data []byte) (Metadata, error) { var metadata Metadata err := borsh.Deserialize(&metadata, data)