token_metadata

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EDITION_MARKER_BIT_SIZE uint64 = 248

Variables

This section is empty.

Functions

func CreateMasterEdition

func CreateMasterEdition(param CreateMasterEditionParam) types.Instruction

func CreateMasterEditionV3

func CreateMasterEditionV3(param CreateMasterEditionParam) types.Instruction

func CreateMetadataAccount

func CreateMetadataAccount(param CreateMetadataAccountParam) types.Instruction

func CreateMetadataAccountV2

func CreateMetadataAccountV2(param CreateMetadataAccountV2Param) types.Instruction

func CreateMetadataAccountV3

func CreateMetadataAccountV3(param CreateMetadataAccountV3Param) types.Instruction

func CreateVerifyCollection

func CreateVerifyCollection(param VerifyCollectionParams) types.Instruction

func GetEditionMark

func GetEditionMark(mint common.PublicKey, edition uint64) (common.PublicKey, error)

func GetMasterEdition

func GetMasterEdition(mint common.PublicKey) (common.PublicKey, error)

func GetTokenMetaPubkey

func GetTokenMetaPubkey(mint common.PublicKey) (common.PublicKey, error)

func SignMetadata

func SignMetadata(param SignMetadataParam) types.Instruction

func UpdateMetadataAccount deprecated

func UpdateMetadataAccount(param UpdateMetadataAccountParam) types.Instruction

Deprecated: please use UpdateMetadataAccountV2

func UpdateMetadataAccountV2

func UpdateMetadataAccountV2(param UpdateMetadataAccountV2Param) types.Instruction

Types

type Collection

type Collection struct {
	Verified bool
	Key      common.PublicKey
}

type CollectionDetails

type CollectionDetails struct {
	Enum borsh.Enum `borsh_enum:"true"`
	V1   CollectionDetailsV1
}

type CollectionDetailsV1

type CollectionDetailsV1 struct {
	Size uint64
}

type CreateMasterEditionParam

type CreateMasterEditionParam struct {
	Edition         common.PublicKey
	Mint            common.PublicKey
	UpdateAuthority common.PublicKey
	MintAuthority   common.PublicKey
	Metadata        common.PublicKey
	Payer           common.PublicKey
	MaxSupply       *uint64
}

type CreateMasterEditionV3Param

type CreateMasterEditionV3Param struct {
	Edition         common.PublicKey
	Mint            common.PublicKey
	UpdateAuthority common.PublicKey
	MintAuthority   common.PublicKey
	Metadata        common.PublicKey
	Payer           common.PublicKey
	MaxSupply       *uint64
}

type CreateMetadataAccountParam

type CreateMetadataAccountParam struct {
	Metadata                common.PublicKey
	Mint                    common.PublicKey
	MintAuthority           common.PublicKey
	Payer                   common.PublicKey
	UpdateAuthority         common.PublicKey
	UpdateAuthorityIsSigner bool
	IsMutable               bool
	MintData                Data
}

type CreateMetadataAccountV2Param

type CreateMetadataAccountV2Param struct {
	Metadata                common.PublicKey
	Mint                    common.PublicKey
	MintAuthority           common.PublicKey
	Payer                   common.PublicKey
	UpdateAuthority         common.PublicKey
	UpdateAuthorityIsSigner bool
	IsMutable               bool
	Data                    DataV2
}

type CreateMetadataAccountV3Param

type CreateMetadataAccountV3Param struct {
	Metadata                common.PublicKey
	Mint                    common.PublicKey
	MintAuthority           common.PublicKey
	Payer                   common.PublicKey
	UpdateAuthority         common.PublicKey
	UpdateAuthorityIsSigner bool
	IsMutable               bool
	Data                    DataV2
	CollectionDetails       *CollectionDetails
}

type Creator

type Creator struct {
	Address  common.PublicKey
	Verified bool
	Share    uint8
}

type Data

type Data struct {
	Name                 string
	Symbol               string
	Uri                  string
	SellerFeeBasisPoints uint16
	Creators             *[]Creator
}

type DataV2

type DataV2 struct {
	Name                 string
	Symbol               string
	Uri                  string
	SellerFeeBasisPoints uint16
	Creators             *[]Creator
	Collection           *Collection
	Uses                 *Uses
}

type Instruction

type Instruction uint8
const (
	InstructionCreateMetadataAccount Instruction = iota
	InstructionUpdateMetadataAccount
	InstructionDeprecatedCreateMasterEdition
	InstructionDeprecatedMintNewEditionFromMasterEditionViaPrintingToken
	InstructionUpdatePrimarySaleHappenedViaToken
	InstructionDeprecatedSetReservationList
	InstructionDeprecatedCreateReservationList
	InstructionSignMetadata
	InstructionDeprecatedMintPrintingTokensViaToken
	InstructionDeprecatedMintPrintingTokens
	InstructionCreateMasterEdition
	InstructionMintNewEditionFromMasterEditionViaToken
	InstructionConvertMasterEditionV1ToV2
	InstructionMintNewEditionFromMasterEditionViaVaultProxy
	InstructionPuffMetadata
	InstructionUpdateMetadataAccountV2
	InstructionCreateMetadataAccountV2
	InstructionCreateMasterEditionV3
	InstructionVerifyCollection
	InstructionUtilize
	InstructionApproveUseAuthority
	InstructionRevokeUseAuthority
	InstructionUnverifyCollection
	InstructionApproveCollectionAuthority
	InstructionRevokeCollectionAuthority
	InstructionSetAndVerifyCollection
	InstructionFreezeDelegatedAccount
	InstructionThawDelegatedAccount
	InstructionRemoveCreatorVerification
	InstructionBurnNft
	InstructionVerifySizedCollectionItem
	InstructionUnverifySizedCollectionItem
	InstructionSetAndVerifySizedCollectionItem
	InstructionCreateMetadataAccountV3
	InstructionSetCollectionSize
	InstructionSetTokenStandard
	InstructionBubblegumSetCollectionSize
	InstructionBurnEditionNft
	InstructionCreateEscrowAccount
	InstructionCloseEscrowAccount
	InstructionTransferOutOfEscrow
	InstructionBurn
	InstructionCreate
	InstructionMint
	InstructionDelegate
	InstructionRevoke
	InstructionLock
	InstructionUnlock
	InstructionMigrate
	InstructionTransfer
	InstructionUpdate
	InstructionUse
	InstructionVerify
	InstructionUnverify
	InstructionCollect
)

type Key

type Key borsh.Enum
const (
	KeyUninitialized Key = iota
	KeyEditionV1
	KeyMasterEditionV1
	KeyReservationListV1
	KeyMetadataV1
	KeyReservationListV2
	KeyMasterEditionV2
	KeyEditionMarker
	KeyUseAuthorityRecord
	KeyCollectionAuthorityRecord
)

type MasterEditionV2

type MasterEditionV2 struct {
	Key       Key
	Supply    uint64
	MaxSupply *uint64
}

type Metadata

type Metadata struct {
	Key                 Key
	UpdateAuthority     common.PublicKey
	Mint                common.PublicKey
	Data                Data
	PrimarySaleHappened bool
	IsMutable           bool
	EditionNonce        *uint8
	TokenStandard       *TokenStandard
	Collection          *Collection
	Uses                *Uses
	CollectionDetails   *CollectionDetails
	ProgrammableConfig  *ProgrammableConfig
}

func MetadataDeserialize

func MetadataDeserialize(data []byte) (Metadata, error)

type MintNewEditionFromMasterEditionViaTokeParam

type MintNewEditionFromMasterEditionViaTokeParam struct {
	NewMetaData                common.PublicKey
	NewEdition                 common.PublicKey
	MasterEdition              common.PublicKey
	NewMint                    common.PublicKey
	EditionMark                common.PublicKey
	NewMintAuthority           common.PublicKey
	Payer                      common.PublicKey
	TokenAccountOwner          common.PublicKey
	TokenAccount               common.PublicKey
	NewMetadataUpdateAuthority common.PublicKey
	MasterMetadata             common.PublicKey
	Edition                    uint64
}

type ProgrammableConfig

type ProgrammableConfig struct {
	Enum borsh.Enum `borsh_enum:"true"`
	V1   ProgrammableConfigV1
}

type ProgrammableConfigV1

type ProgrammableConfigV1 struct {
	RuleSet *common.PublicKey
}

type SignMetadataParam

type SignMetadataParam struct {
	Metadata common.PublicKey
	Creator  common.PublicKey
}

type TokenStandard

type TokenStandard borsh.Enum
const (
	NonFungible TokenStandard = iota
	FungibleAsset
	Fungible
	NonFungibleEdition
	ProgrammableNonFungible
)

type UpdateMetadataAccountParam deprecated

type UpdateMetadataAccountParam struct {
	MetadataAccount     common.PublicKey
	UpdateAuthority     common.PublicKey
	Data                *Data
	NewUpdateAuthority  *common.PublicKey
	PrimarySaleHappened *bool
}

Deprecated: please use UpdateMetadataAccountV2

type UpdateMetadataAccountV2Param

type UpdateMetadataAccountV2Param struct {
	MetadataAccount     common.PublicKey
	UpdateAuthority     common.PublicKey
	Data                *DataV2
	NewUpdateAuthority  *common.PublicKey
	PrimarySaleHappened *bool
	IsMutable           *bool
}

type UseMethod

type UseMethod borsh.Enum
const (
	Burn UseMethod = iota
	Multiple
	Single
)

type Uses

type Uses struct {
	UseMethod UseMethod
	Remaining uint64
	Total     uint64
}

type VerifyCollectionParams

type VerifyCollectionParams struct {
	Metadata                       common.PublicKey
	CollectionUpdateAuthority      common.PublicKey
	Payer                          common.PublicKey
	CollectionMint                 common.PublicKey
	Collection                     common.PublicKey
	CollectionMasterEditionAccount common.PublicKey
	CollectionAuthorityRecord      *common.PublicKey
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL