Documentation
¶
Overview ¶
Package vote provides typed instruction builders for the Solana Vote program.
Index ¶
- Variables
- func NewAuthorize(vote, authority, newAuthority solana.PublicKey, authType VoteAuthorize) solana.Instruction
- func NewAuthorizeChecked(vote, authority, newAuthority solana.PublicKey, authType VoteAuthorize) solana.Instruction
- func NewInitializeAccount(vote, nodePubkey, authorizedVoter, authorizedWithdrawer solana.PublicKey, ...) solana.Instruction
- func NewUpdateCommission(vote, withdrawAuthority solana.PublicKey, commission uint8) solana.Instruction
- func NewUpdateValidatorIdentity(vote, newIdentity, withdrawAuthority solana.PublicKey) solana.Instruction
- func NewWithdraw(vote, withdrawAuthority, recipient solana.PublicKey, lamports uint64) solana.Instruction
- type VoteAuthorize
Constants ¶
This section is empty.
Variables ¶
var ProgramID = solana.MustPublicKey("Vote11111111111111111111111111111111111111h")
ProgramID is the canonical address of the Solana Vote program.
Functions ¶
func NewAuthorize ¶
func NewAuthorize(vote, authority, newAuthority solana.PublicKey, authType VoteAuthorize) solana.Instruction
NewAuthorize builds a Vote.Authorize instruction that changes the voter or withdrawer authority on a vote account. The current authority (matching authType) must sign the transaction.
func NewAuthorizeChecked ¶
func NewAuthorizeChecked(vote, authority, newAuthority solana.PublicKey, authType VoteAuthorize) solana.Instruction
NewAuthorizeChecked builds a Vote.AuthorizeChecked instruction (tag 6), the checked variant of Authorize that additionally requires the new authority to sign the transaction.
func NewInitializeAccount ¶
func NewInitializeAccount(vote, nodePubkey, authorizedVoter, authorizedWithdrawer solana.PublicKey, commission uint8) solana.Instruction
NewInitializeAccount builds a Vote.InitializeAccount instruction that creates and initialises a new vote account. nodePubkey must sign the transaction; it is the validator identity that will cast votes.
func NewUpdateCommission ¶
func NewUpdateCommission(vote, withdrawAuthority solana.PublicKey, commission uint8) solana.Instruction
NewUpdateCommission builds a Vote.UpdateCommission instruction that sets the validator's commission rate (0–100). The withdrawer authority must sign the transaction.
func NewUpdateValidatorIdentity ¶
func NewUpdateValidatorIdentity(vote, newIdentity, withdrawAuthority solana.PublicKey) solana.Instruction
NewUpdateValidatorIdentity builds a Vote.UpdateValidatorIdentity instruction that changes the validator identity on a vote account. Both the vote account's withdrawer authority and the new identity account must sign the transaction.
func NewWithdraw ¶
func NewWithdraw(vote, withdrawAuthority, recipient solana.PublicKey, lamports uint64) solana.Instruction
NewWithdraw builds a Vote.Withdraw instruction that moves lamports from the vote account to a recipient. The withdrawer authority must sign the transaction.
Types ¶
type VoteAuthorize ¶
type VoteAuthorize uint32
VoteAuthorize identifies which authority field Authorize changes.
const ( VoteAuthorizeVoter VoteAuthorize = 0 // Authorized voter VoteAuthorizeWithdrawer VoteAuthorize = 1 // Authorized withdrawer )