Vote Program
solana.vote_program
Library to interface with the vote program.
withdraw_from_vote_account(params)
Generate an instruction that transfers lamports from a vote account to any other.
Example
from solders.pubkey import Pubkey from solders.keypair import Keypair from solana.models import WithdrawFromVoteAccountParams vote = Pubkey([0] * 31 + [1]) withdrawer = Keypair.from_seed(bytes([0]*32)) instruction = withdraw_from_vote_account( ... WithdrawFromVoteAccountParams( ... vote_account_from_pubkey=vote, ... to_pubkey=withdrawer.pubkey(), ... withdrawer=withdrawer.pubkey(), ... lamports=3_000_000_000, ... ) ... ) type(instruction)
Returns:
| Type | Description |
|---|---|
Instruction
|
The generated instruction. |
Source code in src/solana/vote_program.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |