Documentation ¶
Index ¶
- Constants
- Variables
- func AdvanceNonce(nonce, authority ed25519.PublicKey) solana.Instruction
- func AuthorizeNonce(nonce ed25519.PublicKey) solana.Instruction
- func CreateAccount(funder, address, owner ed25519.PublicKey, lamports, size uint64) solana.Instruction
- func DecompileInitializeNonce()
- func DecompileWithdrawNonce()
- func GetNonceValueFromAccount(info solana.AccountInfo) (val solana.Blockhash, err error)
- func InitializeNonce(nonce, auth ed25519.PublicKey) solana.Instruction
- func WithdrawNonce(nonce, auth, receipient ed25519.PublicKey, lamports uint64) solana.Instruction
- type DecompiledAdvanceNonce
- type DecompiledCreateAccount
- type DecompiledWithdrawNonce
- type FeeCalculator
- type NonceAccount
- type NonceVersion
Constants ¶
const (
NonceAccountSize = 80
)
Variables ¶
var ( ErrInvalidAccountSize = errors.New("invalid nonce account size") ErrInvalidAccountVersion = errors.New("invalid nonce account version") )
var ProgramKey [32]byte
var RecentBlockhashesSysVar ed25519.PublicKey
RecentBlockhashesSysVar points to the system variable "Recent Blockhashes"
var RentSysVar ed25519.PublicKey
RentSysVar points to the system variable "Rent"
var SystemAccount ed25519.PublicKey
https://explorer.solana.com/address/11111111111111111111111111111111
Functions ¶
func AdvanceNonce ¶
func AdvanceNonce(nonce, authority ed25519.PublicKey) solana.Instruction
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 CreateAccount ¶
func CreateAccount(funder, address, owner ed25519.PublicKey, lamports, size uint64) solana.Instruction
func DecompileInitializeNonce ¶
func DecompileInitializeNonce()
func DecompileWithdrawNonce ¶
func DecompileWithdrawNonce()
func GetNonceValueFromAccount ¶
func GetNonceValueFromAccount(info solana.AccountInfo) (val solana.Blockhash, err error)
GetNonceValueFromAccount returns the nonce value of a nonce account.
Layout references: https://github.com/solana-labs/solana/blob/d7b9aca87b0327266cde4f0116113a4203642130/web3.js/src/nonce-account.js#L16-L22 https://github.com/solana-labs/solana/blob/a4956844bdd081e7b90508066c579f29be306ce7/sdk/program/src/nonce/state/current.rs#L26
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
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.
Types ¶
type DecompiledAdvanceNonce ¶
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 FeeCalculator ¶
type FeeCalculator struct {
LamportsPerSignature uint64
}
type NonceAccount ¶
type NonceAccount struct { Version uint32 State uint32 Authority ed25519.PublicKey Blockhash ed25519.PublicKey FeeCalculator FeeCalculator }
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 )