Documentation ¶
Index ¶
- Constants
- Variables
- func SetProgramID(pubkey solana.PublicKey)
- type Authorize
- type InitializeAccount
- type Instruction
- func (inst *Instruction) Accounts() (out []*solana.AccountMeta)
- func (inst *Instruction) Data() ([]byte, error)
- func (inst *Instruction) EncodeToTree(parent treeout.Branches)
- func (inst Instruction) MarshalWithEncoder(encoder *bin.Encoder) error
- func (inst *Instruction) ProgramID() solana.PublicKey
- func (inst *Instruction) TextEncode(encoder *text.Encoder, option *text.Option) error
- func (inst *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) error
- type Vote
- type Withdraw
- func (inst *Withdraw) EncodeToTree(parent treeout.Branches)
- func (inst *Withdraw) MarshalWithEncoder(encoder *bin.Encoder) error
- func (inst *Withdraw) SetLamports(lamports uint64) *Withdraw
- func (inst *Withdraw) SetRecipientAccount(recipientAccount solana.PublicKey) *Withdraw
- func (inst *Withdraw) SetVoteAccount(voteAccount solana.PublicKey) *Withdraw
- func (inst *Withdraw) SetWithdrawAuthorityAccount(withdrawAccount solana.PublicKey) *Withdraw
- func (v *Withdraw) UnmarshalWithDecoder(dec *bin.Decoder) error
- func (inst *Withdraw) Validate() error
Constants ¶
View Source
const ProgramName = "Vote"
Variables ¶
View Source
var InstructionImplDef = bin.NewVariantDefinition( bin.Uint32TypeIDEncoding, []bin.VariantType{ { "InitializeAccount", (*InitializeAccount)(nil), }, { "Authorize", (*Authorize)(nil), }, { "Vote", (*Vote)(nil), }, { "Withdraw", (*Withdraw)(nil), }, }, )
View Source
var ProgramID solana.PublicKey = solana.VoteProgramID
Functions ¶
func SetProgramID ¶
func SetProgramID(pubkey solana.PublicKey)
Types ¶
type Authorize ¶
type Authorize struct { // [0] = [WRITE] VoteAccount // ··········· Unitialized vote account // // [1] = [] SysVarClock // ··········· Clock sysvar // // [2] = [SIGNER] Authority // ··········· Vote or withdraw authority solana.AccountMetaSlice `bin:"-" borsh_skip:"true"` }
type InitializeAccount ¶
type InitializeAccount struct { // [0] = [WRITE] VoteAccount // ··········· Vote account to vote with // // [1] = [] SysVarSlotHashes // ··········· Slot hashes sysvar // // [2] = [] SysVarClock // ··········· Clock sysvar // // [3] = [SIGNER] VoteAuthority // ··········· New validator identity (node_pubkey) solana.AccountMetaSlice `bin:"-" borsh_skip:"true"` }
type Instruction ¶
type Instruction struct {
bin.BaseVariant
}
func DecodeInstruction ¶
func DecodeInstruction(accounts []*solana.AccountMeta, data []byte) (*Instruction, error)
func (*Instruction) Accounts ¶
func (inst *Instruction) Accounts() (out []*solana.AccountMeta)
func (*Instruction) Data ¶
func (inst *Instruction) Data() ([]byte, error)
func (*Instruction) EncodeToTree ¶
func (inst *Instruction) EncodeToTree(parent treeout.Branches)
func (Instruction) MarshalWithEncoder ¶
func (inst Instruction) MarshalWithEncoder(encoder *bin.Encoder) error
func (*Instruction) ProgramID ¶
func (inst *Instruction) ProgramID() solana.PublicKey
func (*Instruction) TextEncode ¶
func (*Instruction) UnmarshalWithDecoder ¶
func (inst *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) error
type Vote ¶
type Vote struct { Slots []uint64 Hash solana.Hash Timestamp *int64 // [0] = [WRITE] VoteAccount // ··········· Vote account to vote with // // [1] = [] SysVarSlotHashes // ··········· Slot hashes sysvar // // [2] = [] SysVarClock // ··········· Clock sysvar // // [3] = [SIGNER] VoteAuthority // ··········· Vote authority solana.AccountMetaSlice `bin:"-" borsh_skip:"true"` }
func (*Vote) EncodeToTree ¶
type Withdraw ¶
type Withdraw struct { // Number of lamports to withdraw from the vote account Lamports *uint64 // [0] = [WRITE] VoteAccount // ··········· Vote account to withdraw from // // [1] = [WRITE] ToAccount // ··········· Account to receive the funds // // [2] = [WRITE SIGNER] AuthorizedWithdrawerPubkey // ··········· Account authorized to do the witdraw // solana.AccountMetaSlice `bin:"-" borsh_skip:"true"` }
func NewWithdrawInstruction ¶
func NewWithdrawInstruction( lamports uint64, voteAccount solana.PublicKey, recipientAccount solana.PublicKey, withdrawAuthAccount solana.PublicKey, ) *Withdraw
NewWithdrawInstruction declares a new Withdraw instruction with the provided parameters and accounts.
func NewWithdrawInstructionBuilder ¶
func NewWithdrawInstructionBuilder() *Withdraw
NewWithdrawInstructionBuilder creates a new `Withdraw` instruction builder.
func (*Withdraw) EncodeToTree ¶
func (*Withdraw) MarshalWithEncoder ¶
func (*Withdraw) SetLamports ¶
Number of lamports to transfer to the recipient account
func (*Withdraw) SetRecipientAccount ¶
Recipient account
func (*Withdraw) SetVoteAccount ¶
Vote account
func (*Withdraw) SetWithdrawAuthorityAccount ¶
Withdraw authority account
func (*Withdraw) UnmarshalWithDecoder ¶
Click to show internal directories.
Click to hide internal directories.