metaplex

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Uninitialized = iota
	EditionV1
	MasterEditionV1
	ReservationListV1
	MetadataV1
	ReservationListV2
	MasterEditionV2
	EditionMarker
)

Variables

View Source
var METADATA_REPLACE = regexp.MustCompile("\u0000")
View Source
var PROGRAM_ID = solana.MustPublicKeyFromBase58("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s")

Functions

func Clean

func Clean(str string) string

func DeriveMetadataPublicKey

func DeriveMetadataPublicKey(programID, mint solana.PublicKey) (solana.PublicKey, error)

Types

type AccountListable

type AccountListable interface {
	ListAccounts() []*solana.AccountMeta
}

type CreateMetadataAccount added in v0.5.1

type CreateMetadataAccount struct {
	Instruction InstType
	Data        Data
	IsMutable   bool

	Accounts *CreateMetadataAccountAccounts `borsh_skip:"true"`
}

func (CreateMetadataAccount) ListAccounts added in v0.5.1

func (i CreateMetadataAccount) ListAccounts() []*solana.AccountMeta

type CreateMetadataAccountAccounts added in v0.5.1

type CreateMetadataAccountAccounts struct {
	Metadata        *solana.AccountMeta
	Mint            *solana.AccountMeta
	MintAuthority   *solana.AccountMeta
	Payer           *solana.AccountMeta
	UpdateAuthority *solana.AccountMeta
	SystemProgram   *solana.AccountMeta
	RentProgram     *solana.AccountMeta
}

/ Create Metadata object. / 0. `[writable]` Metadata key (pda of ['metadata', program id, mint id]) / 1. `[]` Mint of token asset / 2. `[signer]` Mint authority / 3. `[signer]` payer / 4. `[]` update authority info / 5. `[]` System program / 6. `[]` Rent info

type Creator

type Creator struct {
	Address  solana.PublicKey
	Verified bool
	// In percentages, NOT basis points ;) Watch out!
	Share int8
}

type Data

type Data struct {
	Name                 string
	Symbol               string
	URI                  string
	SellerFeeBasisPoints uint16
	Creators             *[]Creator `bin:"optional"`
}

type InstType

type InstType uint8
const (
	CreateMetadataAccountInst InstType = iota
	UpdateMetadataAccountInst
)

type Instruction

type Instruction struct {
	Impl interface{}
	// contains filtered or unexported fields
}

func NewCreateMetadataAccountInstruction added in v0.5.1

func NewCreateMetadataAccountInstruction(
	programID solana.PublicKey,
	data Data,
	isMutable bool,
	metadata,
	mint,
	mintAuthority,
	payer,
	updateAuthority solana.PublicKey,
) *Instruction

func NewInstruction

func NewInstruction(programId solana.PublicKey, impl interface{}) *Instruction

func NewUpdateMetadataAccountInstruction added in v0.5.1

func NewUpdateMetadataAccountInstruction(
	programID solana.PublicKey,
	data *Data,
	updateAuthority *solana.PublicKey,
	primarySaleHappened *bool,
	metadata solana.PublicKey,
	updateAuthorityKey solana.PublicKey,
) *Instruction

func (*Instruction) Accounts

func (i *Instruction) Accounts() (out []*solana.AccountMeta)

func (*Instruction) Data

func (i *Instruction) Data() ([]byte, error)

func (*Instruction) ProgramID

func (i *Instruction) ProgramID() solana.PublicKey

type Key

type Key borsh.Enum

type Metadata

type Metadata struct {
	Key                 Key
	UpdateAuthority     solana.PublicKey
	Mint                solana.PublicKey
	Data                Data
	PrimarySaleHappened bool
	IsMutable           bool
}

func (*Metadata) Decode

func (m *Metadata) Decode(in []byte) error

type UpdateMetadataAccount added in v0.5.1

type UpdateMetadataAccount struct {
	Instruction         InstType
	Data                *Data
	UpdateAuthority     *solana.PublicKey
	PrimarySaleHappened *bool

	Accounts *UpdateMetadataAccountAccounts `borsh_skip:"true"`
}

func (UpdateMetadataAccount) ListAccounts added in v0.5.1

func (i UpdateMetadataAccount) ListAccounts() []*solana.AccountMeta

type UpdateMetadataAccountAccounts added in v0.5.1

type UpdateMetadataAccountAccounts struct {
	Metadata           *solana.AccountMeta
	UpdateAuthorityKey *solana.AccountMeta
}

/ Update a Metadata / 0. `[writable]` Metadata account / 1. `[signer]` Update authority key

Jump to

Keyboard shortcuts

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