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

11
web3.js/module.d.ts vendored
View File

@ -197,6 +197,12 @@ declare module '@solana/web3.js' {
space: number;
};
export type StakeActivationData = {
state: 'active' | 'inactive' | 'activating' | 'deactivating';
active: number;
inactive: number;
};
export type KeyedAccountInfo = {
accountId: PublicKey;
accountInfo: AccountInfo<Buffer>;
@ -314,6 +320,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,