Documentation ¶
Index ¶
- Variables
- func DeriveCollectionAuthorityRecord(mint, authority common.PublicKey) (common.PublicKey, error)
- func DeriveEditionMarkerPubkey(mint common.PublicKey, edition uint64) (common.PublicKey, error)
- func DeriveEditionPubkey(mint common.PublicKey) (common.PublicKey, error)
- func DeriveTokenMetadataPubkey(mint common.PublicKey) (common.PublicKey, error)
- func DeriveUseAuthorityRecord(mint, authority common.PublicKey) (common.PublicKey, error)
- type Collection
- type Creator
- type Edition
- type EditionData
- type EditionKey
- type Key
- type Metadata
- type TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) Build() (meta common.PublicKey, instruction types.Instruction, err error)
- func (b *TokenMetadataInstructionBuilder) IsMutable(isMutable bool) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetCollection(collection common.PublicKey) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetCollectionBase58(collection string) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetCreator(creator common.PublicKey, share uint8) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetCreatorBase58(creator string, share uint8) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetData(data token_metadata.DataV2) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetMetadata(metadata common.PublicKey) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetMetadataBase58(metadata string) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetMint(mint common.PublicKey) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetMintAuthority(mintAuthority common.PublicKey) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetMintAuthorityBase58(mintAuthority string) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetMintBase58(mint string) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetName(name string) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetPayer(payer common.PublicKey) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetPayerBase58(payer string) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetSellerFeeBasisPoints(sellerFeeBasisPoints uint16) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetSymbol(symbol string) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetUpdateAuthority(updateAuthority common.PublicKey) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetUpdateAuthorityBase58(updateAuthority string) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetUri(uri string) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) SetUses(method TokenUseMethod, remaining, total uint64) *TokenMetadataInstructionBuilder
- func (b *TokenMetadataInstructionBuilder) UpdateAuthorityIsSigner(updateAuthorityIsSigner bool) *TokenMetadataInstructionBuilder
- type TokenStandard
- type TokenUseMethod
- type Uses
Constants ¶
This section is empty.
Variables ¶
var PubNil = common.PublicKey{}
PubNil is a nil public key
Functions ¶
func DeriveCollectionAuthorityRecord ¶
DeriveCollectionAuthorityRecord returns the collection authority record public key.
func DeriveEditionMarkerPubkey ¶
DeriveEditionMarkerPubkey returns the edition marker public key.
func DeriveEditionPubkey ¶
DeriveEditionPubkey returns the edition public key.
func DeriveTokenMetadataPubkey ¶
DeriveTokenMetadataPubkey returns the token metadata program public key.
Types ¶
type Collection ¶
type Edition ¶
type Edition struct { Type string `json:"type,omitempty"` Supply uint64 `json:"supply,omitempty"` MaxSupply uint64 `json:"max_supply,omitempty"` Edition uint64 `json:"edition,omitempty"` }
func DeserializeEdition ¶
DeserializeEdition deserializes the edition.
func DeserializeMasterEdition ¶
DeserializeMasterEdition deserializes the master edition data.
type EditionData ¶
type EditionData struct { Key token_metadata.Key Parent common.PublicKey Edition uint64 }
type EditionKey ¶
type EditionKey struct {
Key token_metadata.Key
}
type Key ¶
type Key string
Token metadata edition key
const ( KeyUndefined Key = "undefined" KeyMasterEdition Key = "master_edition" KeyPrintedEdition Key = "edition" KeyReservationList Key = "reservation_list" KeyMetadata Key = "metadata" KeyEditionMarker Key = "edition_marker" KeyUseAuthorityRecord Key = "use_authority_record" KeyCollectionAuthorityRecord Key = "collection_authority_record" )
Predefined token editions
type Metadata ¶
type Metadata struct { UpdateAuthority string `json:"update_authority"` Mint string `json:"mint"` PrimarySaleHappened bool `json:"primary_sale_happened,omitempty"` IsMutable bool `json:"is_mutable"` EditionNonce *uint8 `json:"edition_nonce,omitempty"` TokenStandard string `json:"token_standard"` Collection *Collection `json:"collection,omitempty"` Uses *Uses `json:"uses,omitempty"` Edition *Edition `json:"edition,omitempty"` MetadataUri string `json:"metadata_uri,omitempty"` SellerFeeBasisPoints uint16 `json:"seller_fee_basis_points,omitempty"` Creators []Creator `json:"creators,omitempty"` Data *metadata.Metadata `json:"data,omitempty"` }
Metadata represents the metadata of a token.
func DeserializeMetadata ¶
DeserializeMetadata deserializes the metadata.
type TokenMetadataInstructionBuilder ¶
type TokenMetadataInstructionBuilder struct {
// contains filtered or unexported fields
}
TokenMetadataInstructionBuilder is a builder for token metadata instructions
func NewTokenMetadataInstructionBuilder ¶
func NewTokenMetadataInstructionBuilder() *TokenMetadataInstructionBuilder
NewTokenMetadataInstructionBuilder creates a new TokenMetadataInstructionBuilder
func (*TokenMetadataInstructionBuilder) Build ¶
func (b *TokenMetadataInstructionBuilder) Build() (meta common.PublicKey, instruction types.Instruction, err error)
Build builds the instruction
func (*TokenMetadataInstructionBuilder) IsMutable ¶
func (b *TokenMetadataInstructionBuilder) IsMutable(isMutable bool) *TokenMetadataInstructionBuilder
IsMutable sets the is mutable
func (*TokenMetadataInstructionBuilder) SetCollection ¶
func (b *TokenMetadataInstructionBuilder) SetCollection(collection common.PublicKey) *TokenMetadataInstructionBuilder
SetCollection sets the on-chain collection This is used to group tokens together. Collection should be verified by the owner of the collection.
func (*TokenMetadataInstructionBuilder) SetCollectionBase58 ¶
func (b *TokenMetadataInstructionBuilder) SetCollectionBase58(collection string) *TokenMetadataInstructionBuilder
SetCollectionBase58 sets the on-chain collection public key encoded in base58
func (*TokenMetadataInstructionBuilder) SetCreator ¶
func (b *TokenMetadataInstructionBuilder) SetCreator(creator common.PublicKey, share uint8) *TokenMetadataInstructionBuilder
SetCreator sets
func (*TokenMetadataInstructionBuilder) SetCreatorBase58 ¶
func (b *TokenMetadataInstructionBuilder) SetCreatorBase58(creator string, share uint8) *TokenMetadataInstructionBuilder
SetCreatorBase58 sets the creator public key encoded in base58
func (*TokenMetadataInstructionBuilder) SetData ¶
func (b *TokenMetadataInstructionBuilder) SetData(data token_metadata.DataV2) *TokenMetadataInstructionBuilder
SetData sets the data
func (*TokenMetadataInstructionBuilder) SetMetadata ¶
func (b *TokenMetadataInstructionBuilder) SetMetadata(metadata common.PublicKey) *TokenMetadataInstructionBuilder
SetMetadata sets the metadata public key
func (*TokenMetadataInstructionBuilder) SetMetadataBase58 ¶
func (b *TokenMetadataInstructionBuilder) SetMetadataBase58(metadata string) *TokenMetadataInstructionBuilder
SetMetadataBase58 sets the metadata public key from base58 string
func (*TokenMetadataInstructionBuilder) SetMint ¶
func (b *TokenMetadataInstructionBuilder) SetMint(mint common.PublicKey) *TokenMetadataInstructionBuilder
SetMint sets the mint public key
func (*TokenMetadataInstructionBuilder) SetMintAuthority ¶
func (b *TokenMetadataInstructionBuilder) SetMintAuthority(mintAuthority common.PublicKey) *TokenMetadataInstructionBuilder
SetMintAuthority sets the mint authority public key
func (*TokenMetadataInstructionBuilder) SetMintAuthorityBase58 ¶
func (b *TokenMetadataInstructionBuilder) SetMintAuthorityBase58(mintAuthority string) *TokenMetadataInstructionBuilder
SetMintAuthorityBase58 sets the mint authority public key from base58 string
func (*TokenMetadataInstructionBuilder) SetMintBase58 ¶
func (b *TokenMetadataInstructionBuilder) SetMintBase58(mint string) *TokenMetadataInstructionBuilder
SetMintBase58 sets the mint public key from base58 string
func (*TokenMetadataInstructionBuilder) SetName ¶
func (b *TokenMetadataInstructionBuilder) SetName(name string) *TokenMetadataInstructionBuilder
SetName sets the name
func (*TokenMetadataInstructionBuilder) SetPayer ¶
func (b *TokenMetadataInstructionBuilder) SetPayer(payer common.PublicKey) *TokenMetadataInstructionBuilder
SetPayer sets the payer public key
func (*TokenMetadataInstructionBuilder) SetPayerBase58 ¶
func (b *TokenMetadataInstructionBuilder) SetPayerBase58(payer string) *TokenMetadataInstructionBuilder
SetPayerBase58 sets the payer public key from base58 string
func (*TokenMetadataInstructionBuilder) SetSellerFeeBasisPoints ¶
func (b *TokenMetadataInstructionBuilder) SetSellerFeeBasisPoints(sellerFeeBasisPoints uint16) *TokenMetadataInstructionBuilder
SetSellerFeeBasisPoints sets the seller fee basis points
func (*TokenMetadataInstructionBuilder) SetSymbol ¶
func (b *TokenMetadataInstructionBuilder) SetSymbol(symbol string) *TokenMetadataInstructionBuilder
SetSymbol sets the symbol
func (*TokenMetadataInstructionBuilder) SetUpdateAuthority ¶
func (b *TokenMetadataInstructionBuilder) SetUpdateAuthority(updateAuthority common.PublicKey) *TokenMetadataInstructionBuilder
SetUpdateAuthority sets the update authority public key
func (*TokenMetadataInstructionBuilder) SetUpdateAuthorityBase58 ¶
func (b *TokenMetadataInstructionBuilder) SetUpdateAuthorityBase58(updateAuthority string) *TokenMetadataInstructionBuilder
SetUpdateAuthorityBase58 sets the update authority public key from base58 string
func (*TokenMetadataInstructionBuilder) SetUri ¶
func (b *TokenMetadataInstructionBuilder) SetUri(uri string) *TokenMetadataInstructionBuilder
SetUri sets the uri
func (*TokenMetadataInstructionBuilder) SetUses ¶
func (b *TokenMetadataInstructionBuilder) SetUses(method TokenUseMethod, remaining, total uint64) *TokenMetadataInstructionBuilder
SetUses provides a way to set the number of times a token can be used. This is useful for NFTs that can be used multiple times. For example, a ticket NFT that can be used once.
func (*TokenMetadataInstructionBuilder) UpdateAuthorityIsSigner ¶
func (b *TokenMetadataInstructionBuilder) UpdateAuthorityIsSigner(updateAuthorityIsSigner bool) *TokenMetadataInstructionBuilder
UpdateAuthorityIsSigner sets the update authority is signer
type TokenStandard ¶
type TokenStandard string
TokenStandard represents the standard of a token.
const ( TokenStandardUndefined TokenStandard = "undefined" TokenStandardNonFungible TokenStandard = "non_fungible" TokenStandardNonFungibleEdition TokenStandard = "non_fungible_edition" TokenStandardFungibleAsset TokenStandard = "fungible_asset" TokenStandardFungible TokenStandard = "fungible" TokenStandardProgrammableNonFungible TokenStandard = "programmable_non_fungible" )
Token standards enum
func CastToTokenStandard ¶
func CastToTokenStandard(s token_metadata.TokenStandard) TokenStandard
CastToTokenStandard casts token_metadata.TokenStandard to TokenStandard.
func (TokenStandard) String ¶
func (s TokenStandard) String() string
String returns the string representation of the token standard.
func (TokenStandard) ToSystemTokenStandard ¶
func (s TokenStandard) ToSystemTokenStandard() token_metadata.TokenStandard
ToSystemTokenStandard returns the system token standard.
func (TokenStandard) Valid ¶
func (s TokenStandard) Valid() bool
Valid returns true if the token standard is valid.
type TokenUseMethod ¶
type TokenUseMethod string
TokenUseMethod represents the use method of a token.
const ( TokenUseMethodUnknown TokenUseMethod = "unknown" TokenUseMethodBurn TokenUseMethod = "burn" TokenUseMethodSingle TokenUseMethod = "single" TokenUseMethodMulti TokenUseMethod = "multiple" )
TokenUseMethod enum.
func CastMetadataUseMethod ¶
func CastMetadataUseMethod(m token_metadata.UseMethod) TokenUseMethod
CastMetadataUseMethod converts the token_metadata.UseMethod to TokenUseMethod.
func (TokenUseMethod) String ¶
func (m TokenUseMethod) String() string
String returns the string representation of the token use method.
func (TokenUseMethod) ToMetadataUseMethod ¶
func (m TokenUseMethod) ToMetadataUseMethod() token_metadata.UseMethod
ToMetadataUseMethod converts the token use method to token_metadata.UseMethod.
func (TokenUseMethod) Valid ¶
func (m TokenUseMethod) Valid() bool
Valid returns true if the token use method is valid.