common

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 6 Imported by: 66

Documentation

Index

Constants

View Source
const (
	PublicKeyLength = 32
	MaxSeedLength   = 32
	MaxSeed         = 16
)

Variables

View Source
var (
	SystemProgramID                    = PublicKeyFromString("11111111111111111111111111111111")
	ConfigProgramID                    = PublicKeyFromString("Config1111111111111111111111111111111111111")
	StakeProgramID                     = PublicKeyFromString("Stake11111111111111111111111111111111111111")
	VoteProgramID                      = PublicKeyFromString("Vote111111111111111111111111111111111111111")
	BPFLoaderProgramID                 = PublicKeyFromString("BPFLoader1111111111111111111111111111111111")
	Secp256k1ProgramID                 = PublicKeyFromString("KeccakSecp256k11111111111111111111111111111")
	TokenProgramID                     = PublicKeyFromString("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
	MemoProgramID                      = PublicKeyFromString("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr")
	SPLAssociatedTokenAccountProgramID = PublicKeyFromString("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL")
	SPLNameServiceProgramID            = PublicKeyFromString("namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX")
	MetaplexTokenMetaProgramID         = PublicKeyFromString("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s")
	ComputeBudgetProgramID             = PublicKeyFromString("ComputeBudget111111111111111111111111111111")
	AddressLookupTableProgramID        = PublicKeyFromString("AddressLookupTab1e1111111111111111111111111")
	Token2022ProgramID                 = PublicKeyFromString("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb")
	BPFLoaderUpgradeableProgramID      = PublicKeyFromString("BPFLoaderUpgradeab1e11111111111111111111111")
)
View Source
var (
	SysVarPubkey                 = PublicKeyFromString("Sysvar1111111111111111111111111111111111111")
	SysVarClockPubkey            = PublicKeyFromString("SysvarC1ock11111111111111111111111111111111")
	SysVarRecentBlockhashsPubkey = PublicKeyFromString("SysvarRecentB1ockHashes11111111111111111111")
	SysVarRentPubkey             = PublicKeyFromString("SysvarRent111111111111111111111111111111111")
	SysVarRewardsPubkey          = PublicKeyFromString("SysvarRewards111111111111111111111111111111")
	SysVarStakeHistoryPubkey     = PublicKeyFromString("SysvarStakeHistory1111111111111111111111111")
	SysVarInstructionsPubkey     = PublicKeyFromString("Sysvar1nstructions1111111111111111111111111")
	SysVarSlotHashesPubkey       = PublicKeyFromString("SysvarS1otHashes111111111111111111111111111")
	StakeConfigPubkey            = PublicKeyFromString("StakeConfig11111111111111111111111111111111")
)

Functions

func IsOnCurve

func IsOnCurve(p PublicKey) bool

Types

type PublicKey

type PublicKey [PublicKeyLength]byte

func CreateProgramAddress

func CreateProgramAddress(seeds [][]byte, programId PublicKey) (PublicKey, error)

func CreateWithSeed

func CreateWithSeed(from PublicKey, seed string, programID PublicKey) PublicKey

func FindAssociatedTokenAddress

func FindAssociatedTokenAddress(walletAddress, tokenMintAddress PublicKey) (PublicKey, uint8, error)

func FindProgramAddress

func FindProgramAddress(seed [][]byte, programID PublicKey) (PublicKey, uint8, error)

func PublicKeyFromBytes

func PublicKeyFromBytes(b []byte) PublicKey

func PublicKeyFromString

func PublicKeyFromString(s string) PublicKey

func (PublicKey) Bytes

func (p PublicKey) Bytes() []byte

func (PublicKey) MarshalJSON

func (p PublicKey) MarshalJSON() ([]byte, error)

func (PublicKey) String

func (p PublicKey) String() string

func (PublicKey) ToBase58

func (p PublicKey) ToBase58() string

func (*PublicKey) UnmarshalJSON added in v1.27.0

func (p *PublicKey) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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