system

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NonceAccountSize = 80
)

Variables

View Source
var (
	ErrInvalidAccountSize    = errors.New("invalid nonce account size")
	ErrInvalidAccountVersion = errors.New("invalid nonce account version")
)
View Source
var ProgramKey [32]byte
View Source
var RecentBlockhashesSysVar ed25519.PublicKey

RecentBlockhashesSysVar points to the system variable "Recent Blockhashes"

Source: https://github.com/solana-labs/solana/blob/f02a78d8fff2dd7297dc6ce6eb5a68a3002f5359/sdk/src/sysvar/recent_blockhashes.rs#L12-L15

View Source
var RentSysVar ed25519.PublicKey

RentSysVar points to the system variable "Rent"

Source: https://github.com/solana-labs/solana/blob/f02a78d8fff2dd7297dc6ce6eb5a68a3002f5359/sdk/src/sysvar/rent.rs#L11

View Source
var SystemAccount ed25519.PublicKey

https://explorer.solana.com/address/11111111111111111111111111111111

Functions

func AuthorizeNonce

func AuthorizeNonce(nonce ed25519.PublicKey) solana.Instruction

AuthorizeNonce returns an instruction to change the entity authorized to execute nonce instructions on the account

The `Pubkey` parameter identifies the entity to authorize

func DecompileInitializeNonce

func DecompileInitializeNonce()

func DecompileWithdrawNonce

func DecompileWithdrawNonce()

func InitializeNonce

func InitializeNonce(nonce, auth ed25519.PublicKey) solana.Instruction

InitializeNonce returns an instruction to change the state of an Uninitalized nonce account to Initialized, setting the nonce value

The `Pubkey` parameter specifies the entity authorized to execute nonce instruction on the account

No signatures are required to execute this instruction, enabling derived nonce account addresses

Reference: https://github.com/solana-labs/solana/blob/f02a78d8fff2dd7297dc6ce6eb5a68a3002f5359/sdk/src/system_instruction.rs#L146

func WithdrawNonce

func WithdrawNonce(nonce, auth, receipient ed25519.PublicKey, lamports uint64) solana.Instruction

WithdrawNonce returns an instruction to withdraw funds from a nonce account

The `uint64` parameter is the lamports to withdraw, which must leave the account balance above the rent exempt reserve or at zero.

Reference: https://github.com/solana-labs/solana/blob/f02a78d8fff2dd7297dc6ce6eb5a68a3002f5359/sdk/src/system_instruction.rs#L131

Types

type DecompiledAdvanceNonce

type DecompiledAdvanceNonce struct {
	Nonce     ed25519.PublicKey
	Authority ed25519.PublicKey
}

func DecompileAdvanceNonce

func DecompileAdvanceNonce(m solana.Message, index int) (*DecompiledAdvanceNonce, error)

type DecompiledCreateAccount

type DecompiledCreateAccount struct {
	Funder  ed25519.PublicKey
	Address ed25519.PublicKey

	Lamports uint64
	Size     uint64
	Owner    ed25519.PublicKey
}

func DecompileCreateAccount

func DecompileCreateAccount(m solana.Message, index int) (*DecompiledCreateAccount, error)

type DecompiledWithdrawNonce

type DecompiledWithdrawNonce struct {
	Nonce     ed25519.PublicKey
	Auth      ed25519.PublicKey
	Recipient ed25519.PublicKey
	Amount    uint64
}

type FeeCalculator

type FeeCalculator struct {
	LamportsPerSignature uint64
}

type NonceAccount

type NonceAccount struct {
	Version       uint32
	State         uint32
	Authority     ed25519.PublicKey
	Blockhash     ed25519.PublicKey
	FeeCalculator FeeCalculator
}

https://github.com/solana-labs/solana/blob/da00b39f4f92fb16417bd2d8bd218a04a34527b8/sdk/program/src/nonce/state/current.rs#L8

func (NonceAccount) Marshal

func (obj NonceAccount) Marshal() []byte

func (*NonceAccount) Unmarshal

func (obj *NonceAccount) Unmarshal(data []byte) error

type NonceVersion

type NonceVersion uint32
const (
	NonceVersion0 NonceVersion = iota
	NonceVersion1
)

Jump to

Keyboard shortcuts

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