Skip to content

Commit

Permalink
Add ProgrammableConfig to token metadata struct. (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
omarkilani authored Aug 2, 2023
1 parent 2bc7efe commit 093a419
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions program/metaplex/token_metadata/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type Metadata struct {
Collection *Collection
Uses *Uses
CollectionDetails *CollectionDetails
ProgrammableConfig *ProgrammableConfig
}

type TokenStandard borsh.Enum
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions program/metaplex/tokenmeta/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type Metadata struct {
Collection *Collection
Uses *Uses
CollectionDetails *CollectionDetails
ProgrammableConfig *ProgrammableConfig
}

type TokenStandard borsh.Enum
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 093a419

Please sign in to comment.