Documentation ¶
Index ¶
- Constants
- Variables
- func CreateProgramAddress(seeds [][]byte, program ed25519.PublicKey) (ed25519.PublicKey, error)
- func FindProgramAddress(seed [][]byte, programID ed25519.PublicKey) (ed25519.PublicKey, error)
- func IsOnCurve(b []byte) bool
- func PrivateKey(key string) ed25519.PrivateKey
- func PublicKey(key string) ed25519.PublicKey
- func PublicKeyFromPrivateKey(private ed25519.PrivateKey) ed25519.PublicKey
- func WriteUvarint(w io.ByteWriter, x uint16) error
- type CompactArray
- type Instruction
- type InstructionData
- type Keypair
- type Message
- type MessageHeader
- type MetadataInstruction
- type RecentBlockhash
- type Serializable
- type SerializablePrivateKey
- type SerializablePublicKey
- type SerializableUInt8
- type SystemInstruction
- type TokenAuthorityType
- type TokenInstruction
- type Transaction
Constants ¶
View Source
const PACKET_DATA_SIZE = 1280 - 40 - 8
View Source
const SizeOfMintAccount = 82
View Source
const SizeOfMultisigAccount = 355
Variables ¶
View Source
var ( SystemProgram = PublicKey("11111111111111111111111111111111") RentProgram = PublicKey("SysvarRent111111111111111111111111111111111") ConfigProgram = PublicKey("Config1111111111111111111111111111111111111") StakeProgram = PublicKey("Stake11111111111111111111111111111111111111") VoteProgram = PublicKey("Vote111111111111111111111111111111111111111") BPFLoaderProgram = PublicKey("BPFLoader1111111111111111111111111111111111") Secp256k1Program = PublicKey("KeccakSecp256k11111111111111111111111111111") TokenProgram = PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA") MemoProgram = PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr") SPLAssociatedTokenAccountProgram = PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL") SPLNameServiceProgram = PublicKey("namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX") MetaplexTokenMetaProgram = PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s") ComputeBudgetProgram = PublicKey("ComputeBudget111111111111111111111111111111") )
View Source
var NilPublicKey = PublicKey("11111111111111111111111111111111")
View Source
var PDAMarker = []byte("ProgramDerivedAddress")
Functions ¶
func CreateProgramAddress ¶ added in v0.2.4
func FindProgramAddress ¶ added in v0.2.4
func PrivateKey ¶
func PrivateKey(key string) ed25519.PrivateKey
func PublicKeyFromPrivateKey ¶
func PublicKeyFromPrivateKey(private ed25519.PrivateKey) ed25519.PublicKey
func WriteUvarint ¶
func WriteUvarint(w io.ByteWriter, x uint16) error
Types ¶
type CompactArray ¶
type CompactArray[T Serializable] struct { Length uint16 Items []T }
func NewCompactArray ¶
func NewCompactArray[T Serializable](Length uint16, Items ...T) *CompactArray[T]
type Instruction ¶
type Instruction struct { ProgramIDIndex SerializableUInt8 AccountAddressIndexes *CompactArray[SerializableUInt8] Data *CompactArray[*InstructionData] }
type InstructionData ¶
type InstructionData struct {
Data interface{}
}
type Keypair ¶
type Keypair struct { PublicKey ed25519.PublicKey PrivateKey ed25519.PrivateKey }
func NewKeypair ¶
func NewKeypair() *Keypair
func NewKeypairFromFile ¶
func NewKeypairFromSeed ¶
type Message ¶
type Message struct { Header MessageHeader AccountAddresses *CompactArray[SerializablePublicKey] RecentBlockhash RecentBlockhash Instructions *CompactArray[*Instruction] }
type MessageHeader ¶
type MessageHeader struct { NumberRequiredSignatures SerializableUInt8 NumberReadOnlySignedAccounts SerializableUInt8 NumberReadOnlyUnsignedAccounts SerializableUInt8 }
func NewMessageHeader ¶ added in v0.1.1
func NewMessageHeader(requiredSignatures, readOnlySigned, readOnlyUnsigned uint8) MessageHeader
type MetadataInstruction ¶ added in v0.2.1
type MetadataInstruction uint8
const ( CreateMetadataAccount MetadataInstruction = iota UpdateMetadataAccount DeprecatedCreateMasterEdition DeprecatedMintNewEditionFromMasterEditionViaPrintingToken UpdatePrimarySaleHappenedViaToken DeprecatedSetReservationList DeprecatedCreateReservationList SignMetadata DeprecatedMintPrintingTokensViaToken DeprecatedMintPrintingTokens CreateMasterEdition MintNewEditionFromMasterEditionViaToken ConvertMasterEditionV1ToV2 MintNewEditionFromMasterEditionViaVaultProxy PuffMetadata UpdateMetadataAccountV2 CreateMetadataAccountV2 CreateMasterEditionV3 VerifyCollection Utilize ApproveUseAuthority RevokeUseAuthority UnverifyCollection ApproveCollectionAuthority RevokeCollectionAuthority SetAndVerifyCollection FreezeDelegatedAccount ThawDelegatedAccount RemoveCreatorVerification )
type RecentBlockhash ¶
type RecentBlockhash SerializablePublicKey
func RecentBlockhashFromString ¶
func RecentBlockhashFromString(hash string) RecentBlockhash
type SerializablePrivateKey ¶
type SerializablePrivateKey ed25519.PrivateKey
type SerializablePublicKey ¶
type SerializableUInt8 ¶
type SerializableUInt8 uint8
type SystemInstruction ¶
type SystemInstruction uint32
const ( CreateAccount SystemInstruction = iota Assign SystemInstructionTransfer CreateAccountWithSeed AdvanceNonceAccount WithdrawNonceAccount InitializeNonceAccount AuthorizeNonceAccount Allocate AllocateWithSeed AssignWithSeed TransferWithSeed )
type TokenAuthorityType ¶ added in v0.2.6
type TokenAuthorityType uint8
const ( MintTokens TokenAuthorityType = iota FreezeAccount AccountOwner CloseAccount TransferFeeConfig WithheldWithdraw CloseMint )
type TokenInstruction ¶ added in v0.1.2
type TokenInstruction uint8
const ( InitializeMint TokenInstruction = iota InitializeAccount InitializeMultisig TokenInstructionTransfer Approve Revoke SetAuthority MintTo Burn TokenInstructionCloseAccount TokenInstructionFreezeAccount ThawAccount TransferChecked ApproveChecked MintToChecked BurnChecked InitializeAccount2 SyncNative InitializeAccount3 InitializeMultisig2 InitializeMint2 )
type Transaction ¶
type Transaction struct { Signatures *CompactArray[SerializablePrivateKey] Message Message }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.