common

package
v1.18.68 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	SystemProgramID                    = PublicKeyFromString("11111111111111111111111111111111")
	SolMint                            = PublicKeyFromString("So11111111111111111111111111111111111111112")
	WrappedSol                         = SolMint
	ConfigProgramID                    = PublicKeyFromString("Config1111111111111111111111111111111111111")
	StakeProgramID                     = PublicKeyFromString("Stake11111111111111111111111111111111111111")
	VoteProgramID                      = PublicKeyFromString("Vote111111111111111111111111111111111111111")
	BPFLoaderDeprecatedProgramID       = PublicKeyFromString("BPFLoader1111111111111111111111111111111111")
	BPFLoaderProgramID                 = PublicKeyFromString("BPFLoader2111111111111111111111111111111111")
	BPFLoaderUpgradeableProgramID      = PublicKeyFromString("BPFLoaderUpgradeab1e11111111111111111111111")
	Secp256k1ProgramID                 = PublicKeyFromString("KeccakSecp256k11111111111111111111111111111")
	FeatureProgramID                   = PublicKeyFromString("Feature111111111111111111111111111111111111")
	TokenProgramID                     = PublicKeyFromString("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
	TokenSwapProgramID                 = PublicKeyFromString("SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8")
	TokenSwapFeeOwner                  = PublicKeyFromString("HfoTxFR1Tm6kGmWgYWD6J7YHVy1UwqSULUGVLXkJqaKN")
	TokenLendingProgramID              = PublicKeyFromString("LendZqTs8gn5CTSJU1jWKhKuVpjJGom45nnwPb2AMTi")
	MemoProgramID                      = PublicKeyFromString("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr")
	SPLAssociatedTokenAccountProgramID = PublicKeyFromString("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL")
	SPLNameServiceProgramID            = PublicKeyFromString("namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX")
	MetaplexTokenMetaProgramID         = PublicKeyFromString("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s")
	ComputeBudgetProgramID             = PublicKeyFromString("ComputeBudget111111111111111111111111111111")
)
View Source
var (
	SysVarClockPubkey            = PublicKeyFromString("SysvarC1ock11111111111111111111111111111111")
	SysVarRecentBlockhashsPubkey = PublicKeyFromString("SysvarRecentB1ockHashes11111111111111111111")
	SysVarRentPubkey             = PublicKeyFromString("SysvarRent111111111111111111111111111111111")
	SysVarRewardsPubkey          = PublicKeyFromString("SysvarRewards111111111111111111111111111111")
	SysVarStakeHistoryPubkey     = PublicKeyFromString("SysvarStakeHistory1111111111111111111111111")
	SysVarInstructionsPubkey     = PublicKeyFromString("Sysvar1nstructions1111111111111111111111111")
	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, int, error)

func FindProgramAddress

func FindProgramAddress(seed [][]byte, programID PublicKey) (PublicKey, int, 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

Jump to

Keyboard shortcuts

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