Home Reference Source
import {StakeProgram} from '@solana/web3'
public class | source

StakeProgram

Factory class for transactions to interact with the Stake program

Static Member Summary

Static Public Members
public static get

Public key that identifies the Stake program

public static get

Max space of a Stake account

Static Method Summary

Static Public Methods
public static

Generate a Transaction that authorizes a new PublicKey as Staker or Withdrawer on the Stake account.

public static

Generate a Transaction that authorizes a new PublicKey as Staker or Withdrawer on the Stake account.

public static

Generate a Transaction that creates a new Stake account

public static

Generate a Transaction that creates a new Stake account at an address generated with from, a seed, and the Stake programId

public static

Generate a Transaction that deactivates Stake tokens.

public static

Generate a Transaction that delegates Stake tokens to a validator Vote PublicKey.

public static

Generate an Initialize instruction to add to a Stake Create transaction

public static

Generate a Transaction that splits Stake tokens into another stake account

public static

Generate a Transaction that withdraws deactivated Stake tokens.

Static Public Members

public static get programId: PublicKey source

Public key that identifies the Stake program

public static get space: number source

Max space of a Stake account

This is generated from the solana-stake-program StakeState struct as std::mem::size_of::<StakeState>(): https://docs.rs/solana-stake-program/1.4.4/solana_stake_program/stake_state/enum.StakeState.html

Static Public Methods

public static authorize(params: AuthorizeStakeParams): Transaction source

Generate a Transaction that authorizes a new PublicKey as Staker or Withdrawer on the Stake account.

Params:

NameTypeAttributeDescription
params AuthorizeStakeParams

Return:

Transaction

public static authorizeWithSeed(params: AuthorizeWithSeedStakeParams): Transaction source

Generate a Transaction that authorizes a new PublicKey as Staker or Withdrawer on the Stake account.

Params:

NameTypeAttributeDescription
params AuthorizeWithSeedStakeParams

Return:

Transaction

public static createAccount(params: CreateStakeAccountParams): Transaction source

Generate a Transaction that creates a new Stake account

Params:

NameTypeAttributeDescription
params CreateStakeAccountParams

Return:

Transaction

public static createAccountWithSeed(params: CreateStakeAccountWithSeedParams): Transaction source

Generate a Transaction that creates a new Stake account at an address generated with from, a seed, and the Stake programId

Params:

NameTypeAttributeDescription
params CreateStakeAccountWithSeedParams

Return:

Transaction

public static deactivate(params: DeactivateStakeParams): Transaction source

Generate a Transaction that deactivates Stake tokens.

Params:

NameTypeAttributeDescription
params DeactivateStakeParams

Return:

Transaction

public static delegate(params: DelegateStakeParams): Transaction source

Generate a Transaction that delegates Stake tokens to a validator Vote PublicKey. This transaction can also be used to redelegate Stake to a new validator Vote PublicKey.

Params:

NameTypeAttributeDescription
params DelegateStakeParams

Return:

Transaction

public static initialize(params: InitializeStakeParams): TransactionInstruction source

Generate an Initialize instruction to add to a Stake Create transaction

Params:

NameTypeAttributeDescription
params InitializeStakeParams

public static split(params: SplitStakeParams): Transaction source

Generate a Transaction that splits Stake tokens into another stake account

Params:

NameTypeAttributeDescription
params SplitStakeParams

Return:

Transaction

public static withdraw(params: WithdrawStakeParams): Transaction source

Generate a Transaction that withdraws deactivated Stake tokens.

Params:

NameTypeAttributeDescription
params WithdrawStakeParams

Return:

Transaction