alt

package
v1.9.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InstructionCreateLookupTable uint32 = iota
	InstructionFreezeLookupTable
	InstructionExtendLookupTable
	InstructionDeactivateLookupTable
	InstructionCloseLookupTable
)
View Source
const (
	LOOKUP_TABLE_MAX_ADDRESSES = 256
	LOOKUP_TABLE_META_SIZE     = 56
)

Variables

This section is empty.

Functions

func CloseLookupTable

func CloseLookupTable(
	tableAddr, authorityAddr, recipientAddr solana.PublicKey,
) solana.Instruction

Returns an instruction that closes an address lookup table account. The account will be deallocated and the lamports will be drained to the recipient address.

func CreateLookupTable

func CreateLookupTable(
	authority, payer solana.PublicKey,
	recentSlot uint64,
) (solana.Instruction, solana.PublicKey, error)

Constructs an instruction to create a table account and returns the instruction and the table account's derived address.

func DeactivateLookupTable

func DeactivateLookupTable(
	tableAddr, authorityAddr solana.PublicKey,
) solana.Instruction

Constructs an instruction that deactivates an address lookup table so that it cannot be extended again and will be unusable and eligible for closure after a short amount of time.

func ExtendLookupTable

func ExtendLookupTable(
	tableAddr, authorityAddr solana.PublicKey,
	payerAddr *solana.PublicKey,
	addresses solana.PublicKeySlice,
) solana.Instruction

Constructs an instruction which extends an address lookup table account with new addresses.

func FreezeLookupTable

func FreezeLookupTable(
	tableAddr, authorityAddr solana.PublicKey,
) solana.Instruction

Constructs an instruction that freezes an address lookup table so that it can never be closed or extended again. Empty lookup tables cannot be frozen.

Types

type LookupTableAccount

type LookupTableAccount struct {
	ProgramState ProgramStateType
	Meta         LookupTableMeta
	Addresses    solana.PublicKeySlice
}

func DeserializeLookupTable

func DeserializeLookupTable(data []byte) (*LookupTableAccount, error)

func (*LookupTableAccount) IsActive

func (ac *LookupTableAccount) IsActive() bool

type LookupTableMeta

type LookupTableMeta struct {
	// Lookup tables cannot be closed until the deactivation slot is
	// no longer "recent" (not accessible in the `SlotHashes` sysvar).
	DeactivationSlot uint64
	//The slot that the table was last extended. Address tables may
	//only be used to lookup addresses that were extended before
	//the current bank's slot.
	LastExtendedSlot uint64
	//The start index where the table was last extended from during
	//the `last_extended_slot`.
	LastExtendedSlotStartIndex uint8
	//Authority address which must sign for each modification.
	Authority *solana.PublicKey
	// contains filtered or unexported fields
}

type ProgramStateType

type ProgramStateType uint32
const (
	ProgramStateUninitialized ProgramStateType = iota
	ProgramStateLookupTable
)

Jump to

Keyboard shortcuts

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