feat: add getTokenLargestAccounts method

This commit is contained in:
Justin Starry
2020-08-11 17:28:07 +08:00
committed by Justin Starry
parent 177c9c3aec
commit e1dc05fae0
4 changed files with 104 additions and 2 deletions

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

@ -215,6 +215,13 @@ declare module '@solana/web3.js' {
amount: string;
};
export type TokenAccountBalancePair = {
address: PublicKey;
amount: string;
decimals: number;
uiAmount: number;
};
export type AccountChangeCallback = (
accountInfo: AccountInfo<Buffer>,
context: Context,
@ -343,6 +350,10 @@ declare module '@solana/web3.js' {
getLargestAccounts(
config?: GetLargestAccountsConfig,
): Promise<RpcResponseAndContext<Array<AccountBalancePair>>>;
getTokenLargestAccounts(
mintAddress: PublicKey,
commitment?: Commitment,
): Promise<RpcResponseAndContext<Array<TokenAccountBalancePair>>>;
getClusterNodes(): Promise<Array<ContactInfo>>;
getConfirmedBlock(slot: number): Promise<ConfirmedBlock>;
getConfirmedTransaction(