    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 | programId: PublicKey Public key that identifies the Stake program |
public static get | space: number Max space of a Stake account |

## Static Method Summary

Static Public Methods
public static | authorize(stakeAccount: PublicKey, authorizedPubkey: PublicKey, newAuthorized: PublicKey, stakeAuthorizationType: StakeAuthorizationType): Transaction Generate a Transaction that authorizes a new PublicKey as Staker or Withdrawer on the Stake account. |
public static | createAccount(from: PublicKey, stakeAccount: PublicKey, authorized: Authorized, lockup: Lockup, lamports: number): Transaction Generate a Transaction that creates a new Stake account |
public static | createAccountWithSeed(from: PublicKey, stakeAccount: PublicKey, base: PublicKey, seed: string, authorized: Authorized, lockup: Lockup, lamports: number): Transaction Generate a Transaction that creates a new Stake account at an address generated with `from`, a seed, and the Stake programId |
public static | deactivate(stakeAccount: PublicKey, authorizedPubkey: PublicKey): Transaction Generate a Transaction that deactivates Stake tokens. |
public static | delegate(stakeAccount: PublicKey, authorizedPubkey: PublicKey, votePubkey: PublicKey): Transaction Generate a Transaction that delegates Stake tokens to a validator Vote PublicKey. |
public static | initialize(stakeAccount: PublicKey, authorized: Authorized, lockup: Lockup): TransactionInstruction Generate an Initialize instruction to add to a Stake Create transaction |
public static | split(stakeAccount: PublicKey, authorizedPubkey: PublicKey, lamports: number, splitStakePubkey: PublicKey): Transaction Generate a Transaction that splits Stake tokens into another stake account |
public static | withdraw(stakeAccount: PublicKey, withdrawerPubkey: PublicKey, to: PublicKey, lamports: number): Transaction 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

## Static Public Methods

### public static authorize(stakeAccount: PublicKey, authorizedPubkey: PublicKey, newAuthorized: PublicKey, stakeAuthorizationType: StakeAuthorizationType): Transaction source

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

#### Params:

Name | Type | Attribute | Description
stakeAccount | PublicKey |  |
authorizedPubkey | PublicKey |  |
newAuthorized | PublicKey |  |
stakeAuthorizationType | StakeAuthorizationType |  |

#### Return:

Transaction

### public static createAccount(from: PublicKey, stakeAccount: PublicKey, authorized: Authorized, lockup: Lockup, lamports: number): Transaction source

Generate a Transaction that creates a new Stake account

#### Params:

Name | Type | Attribute | Description
from | PublicKey |  |
stakeAccount | PublicKey |  |
authorized | Authorized |  |
lockup | Lockup |  |
lamports | number |  |

#### Return:

Transaction

### public static createAccountWithSeed(from: PublicKey, stakeAccount: PublicKey, base: PublicKey, seed: string, authorized: Authorized, lockup: Lockup, lamports: number): Transaction source

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

#### Params:

Name | Type | Attribute | Description
from | PublicKey |  |
stakeAccount | PublicKey |  |
base | PublicKey |  |
seed | string |  |
authorized | Authorized |  |
lockup | Lockup |  |
lamports | number |  |

#### Return:

Transaction

### public static deactivate(stakeAccount: PublicKey, authorizedPubkey: PublicKey): Transaction source

Generate a Transaction that deactivates Stake tokens.

#### Params:

Name | Type | Attribute | Description
stakeAccount | PublicKey |  |
authorizedPubkey | PublicKey |  |

#### Return:

Transaction

### public static delegate(stakeAccount: PublicKey, authorizedPubkey: PublicKey, votePubkey: PublicKey): 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:

Name | Type | Attribute | Description
stakeAccount | PublicKey |  |
authorizedPubkey | PublicKey |  |
votePubkey | PublicKey |  |

#### Return:

Transaction

### public static initialize(stakeAccount: PublicKey, authorized: Authorized, lockup: Lockup): TransactionInstruction source

Generate an Initialize instruction to add to a Stake Create transaction

#### Params:

Name | Type | Attribute | Description
stakeAccount | PublicKey |  |
authorized | Authorized |  |
lockup | Lockup |  |

#### Return:

TransactionInstruction

### public static split(stakeAccount: PublicKey, authorizedPubkey: PublicKey, lamports: number, splitStakePubkey: PublicKey): Transaction source

Generate a Transaction that splits Stake tokens into another stake account

#### Params:

Name | Type | Attribute | Description
stakeAccount | PublicKey |  |
authorizedPubkey | PublicKey |  |
lamports | number |  |
splitStakePubkey | PublicKey |  |

#### Return:

Transaction

### public static withdraw(stakeAccount: PublicKey, withdrawerPubkey: PublicKey, to: PublicKey, lamports: number): Transaction source

Generate a Transaction that withdraws deactivated Stake tokens.

#### Params:

Name | Type | Attribute | Description
stakeAccount | PublicKey |  |
withdrawerPubkey | PublicKey |  |
to | PublicKey |  |
lamports | number |  |

#### Return:

Transaction