feat: add getLargestAccounts rpc api

This commit is contained in:
Justin Starry
2020-05-23 01:23:29 +08:00
committed by Michael Vines
parent 9c677c7d3d
commit 1b8fe71230
4 changed files with 128 additions and 0 deletions

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

@ -48,6 +48,13 @@ declare module '@solana/web3.js' {
export type Commitment = 'max' | 'recent' | 'root' | 'single';
export type LargestAccountsFilter = 'circulating' | 'nonCirculating';
export type GetLargestAccountsConfig = {
commitment?: Commitment;
filter?: LargestAccountsFilter;
};
export type SignatureStatusConfig = {
searchTransactionHistory: boolean;
};
@ -180,6 +187,11 @@ declare module '@solana/web3.js' {
nonCirculatingAccounts: Array<PublicKey>;
};
export type AccountBalancePair = {
address: PublicKey;
lamports: number;
};
export type VoteAccountStatus = {
current: Array<VoteAccountInfo>;
delinquent: Array<VoteAccountInfo>;
@ -208,6 +220,9 @@ declare module '@solana/web3.js' {
getBlockTime(slot: number): Promise<number | null>;
getMinimumLedgerSlot(): Promise<number>;
getSupply(commitment?: Commitment): Promise<RpcResponseAndContext<Supply>>;
getLargestAccounts(
config?: GetLargestAccountsConfig,
): Promise<RpcResponseAndContext<Array<AccountBalancePair>>>;
getClusterNodes(): Promise<Array<ContactInfo>>;
getConfirmedBlock(slot: number): Promise<ConfirmedBlock>;
getConfirmedTransaction(