common

package
v1.23.10 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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")
)
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

Jump to

Keyboard shortcuts

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