feat: add getStakeActivation (#12274)

* feat: add getStakeActivation

* chore: add rollup watch

* feat: use string literal for stake activation state

* fix: remove optional chaining due to issue with esdoc

* chore: remove optional_chaining

* feat: add live test for getStakeActivation

* feat: extend _buildArgs to support additional options, simplify unit test
This commit is contained in:
Bartosz Lipinski
2020-09-17 01:50:13 -05:00
committed by GitHub
parent 8d6af087a2
commit 63db4759f8
4 changed files with 212 additions and 1 deletions

View File

@ -178,6 +178,12 @@ declare module '@solana/web3.js' {
space: number,
};
declare export type StakeActivationData = {
state: 'active' | 'inactive' | 'activating' | 'deactivating',
active: number,
inactive: number,
};
declare export type ParsedMessageAccount = {
pubkey: PublicKey,
signer: boolean,
@ -328,6 +334,11 @@ declare module '@solana/web3.js' {
): Promise<
RpcResponseAndContext<AccountInfo<Buffer | ParsedAccountData> | null>,
>;
getStakeActivation(
publicKey: PublicKey,
commitment?: Commitment,
epoch?: number,
): Promise<StakeActivationData>;
getProgramAccounts(
programId: PublicKey,
commitment: ?Commitment,