Skip to content

Commit

Permalink
split to include with commitment
Browse files Browse the repository at this point in the history
  • Loading branch information
anthontaylor committed Aug 16, 2022
1 parent ee75373 commit 8d89be4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
10 changes: 10 additions & 0 deletions client/src/nonblocking/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5019,6 +5019,16 @@ impl RpcClient {
pub async fn get_token_largest_accounts(
&self,
mint: &Pubkey,
) -> ClientResult<Vec<RpcTokenAccountBalance>> {
Ok(self
.get_token_largest_accounts_with_commitment(mint, self.commitment())
.await?
.value)
}

pub async fn get_token_largest_accounts_with_commitment(
&self,
mint: &Pubkey,
commitment_config: CommitmentConfig,
) -> RpcResult<Vec<RpcTokenAccountBalance>> {
self.send(
Expand Down
14 changes: 12 additions & 2 deletions client/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3904,11 +3904,21 @@ impl RpcClient {
pub fn get_token_largest_accounts(
&self,
mint: &Pubkey,
) -> ClientResult<Vec<RpcTokenAccountBalance>> {
self.invoke(
(self.rpc_client.as_ref())
.get_token_largest_accounts(mint),
)
}

pub fn get_token_largest_accounts_with_commitment(
&self,
mint: &Pubkey,
commitment_config: CommitmentConfig,
) -> RpcResult<Vec<RpcTokenAccountBalance>> {
self.invoke(
self.rpc_client
.get_token_largest_accounts(mint, commitment_config),
(self.rpc_client.as_ref())
.get_token_largest_accounts_with_commitment(mint, commitment_config),
)
}

Expand Down

0 comments on commit 8d89be4

Please sign in to comment.