Documentation ¶
Index ¶
- Constants
- Variables
- func Clean(str string) string
- func DeriveMetadataEditionCreationMarkPublicKey(programID, mint solana.PublicKey, editionNumber string) (solana.PublicKey, error)
- func DeriveMetadataEditionPublicKey(programID, mint solana.PublicKey) (solana.PublicKey, error)
- func DeriveMetadataPublicKey(programID, mint solana.PublicKey) (solana.PublicKey, error)
- type AccountListable
- type Collection
- type CreateMasterEditionV3Account
- type CreateMetadataAccount
- type CreateMetadataAccountAccounts
- type CreateMetadataAccountV2Accounts
- type CreateMetadataMasterEditionV3Accounts
- type CreateMetadataV2Account
- type Creator
- type Data
- type DataV2
- type InstType
- type Instruction
- func NewCreateMetadataAccountInstruction(programID solana.PublicKey, data Data, isMutable bool, ...) *Instruction
- func NewCreateMetadataAccountV2Instruction(programID solana.PublicKey, data DataV2, isMutable bool, ...) *Instruction
- func NewCreateMetadataMasterEditionV3Instruction(programID solana.PublicKey, maxSupply *uint64, ...) *Instruction
- func NewInstruction(programId solana.PublicKey, impl interface{}) *Instruction
- func NewMintNewEditionFromMasterEditionViaToken(programID solana.PublicKey, editionNum uint64, ...) *Instruction
- func NewUpdateMetadataAccountV1Instruction(programID solana.PublicKey, data *Data, updateAuthority *solana.PublicKey, ...) *Instruction
- func NewUpdateMetadataAccountV2Instruction(programID solana.PublicKey, data *DataV2, updateAuthority *solana.PublicKey, ...) *Instruction
- type Key
- type Metadata
- type MintNewEditionFromMasterEditionViaToken
- type MintNewEditionFromMasterEditionViaTokenAccounts
- type TokenStandard
- type UpdateMetadataAccountV1Accounts
- type UpdateMetadataAccountV2Accounts
- type UpdateMetadataV1Account
- type UpdateMetadataV2Account
- type UseMethod
- type Uses
Constants ¶
const ( Uninitialized = iota EditionV1 MasterEditionV1 ReservationListV1 MetadataV1 ReservationListV2 MasterEditionV2 EditionMarker )
const ( Burn = iota Multiple Single )
const ( NonFungible = iota FungibleAsset Fungible NonFungibleEdition )
Variables ¶
var METADATA_REPLACE = regexp.MustCompile("\u0000")
var PROGRAM_ID = solana.MustPublicKeyFromBase58("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s")
Functions ¶
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 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 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"` }
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