updateStakePoolBalance static method

TransactionInstruction updateStakePoolBalance({
  1. required Pubkey stakePoolAddress,
  2. required Pubkey withdrawAuthority,
  3. required Pubkey validatorList,
  4. required Pubkey reserveStake,
  5. required Pubkey managerFeeAccount,
  6. required Pubkey poolMint,
})

Updates total pool balance based on balances in the reserve and validator list.

Keys:

  • [w] stakePoolAddress - Stake pool.
  • [] withdrawAuthority - Stake pool withdraw authority.
  • [w] validatorList - Validator stake list storage account.
  • [] reserveStake - Reserve stake account.
  • [w] managerFeeAccount - Account to receive pool fee tokens.
  • [w] poolMint - Pool mint account.

Implementation

static TransactionInstruction updateStakePoolBalance({
  required final Pubkey stakePoolAddress,
  required final Pubkey withdrawAuthority,
  required final Pubkey validatorList,
  required final Pubkey reserveStake,
  required final Pubkey managerFeeAccount,
  required final Pubkey poolMint,
}) {
  // 0. `[w]` Stake pool
  // 1. `[]` Stake pool withdraw authority
  // 2. `[w]` Validator stake list storage account
  // 3. `[]` Reserve stake account
  // 4. `[w]` Account to receive pool fee tokens
  // 5. `[w]` Pool mint account
  // 6. `[]` Pool token program
  final List<AccountMeta> keys = [
    AccountMeta.writable(stakePoolAddress),
    AccountMeta(withdrawAuthority),
    AccountMeta.writable(validatorList),
    AccountMeta(reserveStake),
    AccountMeta.writable(managerFeeAccount),
    AccountMeta.writable(poolMint),
    AccountMeta(TokenProgram.programId),
  ];

  return _instance.createTransactionIntruction(
    StakePoolInstruction.updateStakePoolBalance,
    keys: keys,
  );
}