metaplex

package
v0.0.0-...-33cbf18 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Uninitialized = iota
	EditionV1
	MasterEditionV1
	ReservationListV1
	MetadataV1
	ReservationListV2
	MasterEditionV2
	EditionMarker
)
View Source
const (
	Burn = iota
	Multiple
	Single
)
View Source
const (
	NonFungible = iota
	FungibleAsset
	Fungible
	NonFungibleEdition
)

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 DeriveMetadataEditionCreationMarkPublicKey

func DeriveMetadataEditionCreationMarkPublicKey(programID, mint solana.PublicKey, editionNumber string) (solana.PublicKey, error)

func DeriveMetadataEditionPublicKey

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

func DeriveMetadataPublicKey

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

Types

type AccountListable

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

type Collection

type Collection struct {
	Verified bool             `json:"verified"`
	Key      solana.PublicKey `json:"key"`
}

type CreateMasterEditionV3Account

type CreateMasterEditionV3Account struct {
	Instruction InstType
	MaxSupply   *uint64

	Accounts *CreateMetadataMasterEditionV3Accounts `borsh_skip:"true"`
}

func (CreateMasterEditionV3Account) ListAccounts

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

type CreateMetadataAccount

type CreateMetadataAccount struct {
	Instruction InstType
	Data        Data
	IsMutable   bool

	Accounts *CreateMetadataAccountAccounts `borsh_skip:"true"`
}

func (CreateMetadataAccount) ListAccounts

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

type CreateMetadataAccountAccounts

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 CreateMetadataAccountV2Accounts

type CreateMetadataAccountV2Accounts 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 CreateMetadataMasterEditionV3Accounts

type CreateMetadataMasterEditionV3Accounts struct {
	Edition         *solana.AccountMeta
	Mint            *solana.AccountMeta
	UpdateAuthority *solana.AccountMeta
	MintAuthority   *solana.AccountMeta
	Payer           *solana.AccountMeta
	Metadata        *solana.AccountMeta
	TokenProgram    *solana.AccountMeta
	SystemProgram   *solana.AccountMeta
	RentProgram     *solana.AccountMeta
}

/ Register a Metadata as a Master Edition V2, which means Edition V2s can be minted. / Henceforth, no further tokens will be mintable from this primary mint. Will throw an error if more than one / token exists, and will throw an error if less than one token exists in this primary mint. / 0. `[writable]` Unallocated edition V2 account with address as pda of ['metadata', program id, mint, 'edition'] / 1. `[writable]` Metadata mint / 2. `[signer]` Update authority / 3. `[signer]` Mint authority on the metadata's mint - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY / 4. `[signer]` payer / 5. [writable] Metadata account / 6. `[]` Token program / 7. `[]` System program / 8. `[]` Rent info

type CreateMetadataV2Account

type CreateMetadataV2Account struct {
	Instruction InstType
	Data        DataV2
	IsMutable   bool

	Accounts *CreateMetadataAccountV2Accounts `borsh_skip:"true"`
}

func (CreateMetadataV2Account) ListAccounts

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

type Creator

type Creator struct {
	Address  solana.PublicKey `json:"address"`
	Verified bool             `json:"verified"`
	// In percentages, NOT basis points ;) Watch out!
	Share int8 `json:"share"`
}

type Data

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

type DataV2

type DataV2 struct {
	Name                 string      `json:"name"`
	Symbol               string      `json:"symbol"`
	URI                  string      `json:"uri"`
	SellerFeeBasisPoints uint16      `json:"seller_fee_basis_points"`
	Creators             *[]Creator  `bin:"optional" json:"creators"`
	Collection           *Collection `bin:"optional"  json:"collection"`
	Uses                 *Uses       `bin:"optional"  json:"uses"`
}

type InstType

type InstType uint8
const (
	CreateMetadataAccountV1Inst InstType = iota
	UpdateMetadataAccountV1Inst
	DeprecatedCreateMasterEditionInst
	DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInst
	UpdatePrimarySaleHappenedViaTokenInst
	DeprecatedSetReservationListInst
	DeprecatedCreateReservationListInst
	SignMetadataInst
	DeprecatedMintPrintingTokensViaTokenInst
	DeprecatedMintPrintingTokensInst
	CreateMasterEditionInst
	MintNewEditionFromMasterEditionViaTokenInst
	ConvertMasterEditionV1ToV2Inst
	MintNewEditionFromMasterEditionViaVaultProxyInst
	PuffMetadataInst
	UpdateMetadataAccountV2Inst
	CreateMetadataAccountV2Inst
	CreateMasterEditionV3Inst
	VerifyCollectionInst
	UtilizeInst
	ApproveUseAuthorityInst
	RevokeUseAuthorityInst
	UnverifyCollectionInst
	ApproveCollectionAuthorityInst
	RevokeCollectionAuthorityInst
)

type Instruction

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

func NewCreateMetadataAccountInstruction

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

func NewCreateMetadataAccountV2Instruction

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

func NewCreateMetadataMasterEditionV3Instruction

func NewCreateMetadataMasterEditionV3Instruction(
	programID solana.PublicKey,
	maxSupply *uint64,
	edition,
	mint,
	updateAuthority,
	mintAuthority,
	payer,
	metadata solana.PublicKey,
) *Instruction

func NewInstruction

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

func NewMintNewEditionFromMasterEditionViaToken

func NewMintNewEditionFromMasterEditionViaToken(
	programID solana.PublicKey,
	editionNum uint64,
	newMetadata,
	newEdition,
	masterRecordEdition,
	mint,
	edition,
	mintAuthority,
	payer,
	owner,
	tokenAccount,
	updateAuthority,
	masterRecordMetadata solana.PublicKey,
) *Instruction

func NewUpdateMetadataAccountV1Instruction

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

func NewUpdateMetadataAccountV2Instruction

func NewUpdateMetadataAccountV2Instruction(
	programID solana.PublicKey,
	data *DataV2,
	updateAuthority *solana.PublicKey,
	primarySaleHappened *bool,
	isMutable *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
	EditionNonce        *uint8         `bin:"optional"`
	TokenStandard       *TokenStandard `bin:"optional"`
	Collection          *Collection    `bin:"optional"`
	Uses                *Uses          `bin:"optional"`
}

func (*Metadata) Decode

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

type MintNewEditionFromMasterEditionViaToken

type MintNewEditionFromMasterEditionViaToken struct {
	Instruction InstType
	Edition     uint64

	Accounts *MintNewEditionFromMasterEditionViaTokenAccounts `borsh_skip:"true"`
}

func (MintNewEditionFromMasterEditionViaToken) ListAccounts

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

type MintNewEditionFromMasterEditionViaTokenAccounts

type MintNewEditionFromMasterEditionViaTokenAccounts struct {
	NewMetadata          *solana.AccountMeta
	NewEdition           *solana.AccountMeta
	MasterRecordEdition  *solana.AccountMeta
	Mint                 *solana.AccountMeta
	Edition              *solana.AccountMeta
	MintAuthority        *solana.AccountMeta
	Payer                *solana.AccountMeta
	Owner                *solana.AccountMeta
	TokenAccount         *solana.AccountMeta
	UpdateAuthority      *solana.AccountMeta
	MasterRecordMetadata *solana.AccountMeta
	TokenProgram         *solana.AccountMeta
	SystemProgram        *solana.AccountMeta
	RentProgram          *solana.AccountMeta
}

/ Given a token account containing the master edition token to prove authority, and a brand new non-metadata-ed mint with one token / make a new Metadata + Edition that is a child of the master edition denoted by this authority token. / 0. `[writable]` New Metadata key (pda of ['metadata', program id, mint id]) / 1. `[writable]` New Edition (pda of ['metadata', program id, mint id, 'edition']) / 2. `[writable]` Master Record Edition V2 (pda of ['metadata', program id, master metadata mint id, 'edition']) / 3. `[writable]` Mint of new token - THIS WILL TRANSFER AUTHORITY AWAY FROM THIS KEY / 4. `[writable]` Edition pda to mark creation - will be checked for pre-existence. (pda of ['metadata', program id, master metadata mint id, 'edition', edition_number]) / where edition_number is NOT the edition number you pass in args but actually edition_number = floor(edition/EDITION_MARKER_BIT_SIZE). / 5. `[signer]` Mint authority of new mint / 6. `[signer]` payer / 7. `[signer]` owner of token account containing master token (#8) / 8. `[]` token account containing token from master metadata mint / 9. `[]` Update authority info for new metadata / 10. `[]` Master record metadata account / 11. `[]` Token program / 12. `[]` System program / 13. `[]` Rent info

type TokenStandard

type TokenStandard borsh.Enum

type UpdateMetadataAccountV1Accounts

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

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

type UpdateMetadataAccountV2Accounts

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

type UpdateMetadataV1Account

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

	Accounts *UpdateMetadataAccountV1Accounts `borsh_skip:"true"`
}

func (UpdateMetadataV1Account) ListAccounts

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

type UpdateMetadataV2Account

type UpdateMetadataV2Account struct {
	Instruction         InstType
	Data                *DataV2
	UpdateAuthority     *solana.PublicKey
	PrimarySaleHappened *bool
	IsMutable           *bool

	Accounts *UpdateMetadataAccountV2Accounts `borsh_skip:"true"`
}

func (UpdateMetadataV2Account) ListAccounts

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

type UseMethod

type UseMethod borsh.Enum

type Uses

type Uses struct {
	UseMethod UseMethod `json:"use_method"`
	Remaining uint64    `json:"remaining"`
	Total     uint64    `json:"total"`
}

Jump to

Keyboard shortcuts

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