Add RpcClient::get_multiple_accounts_with_config()
This commit is contained in:
parent
f7a5c0301a
commit
ae43ca3bfb
|
@ -2965,11 +2965,25 @@ impl RpcClient {
|
||||||
&self,
|
&self,
|
||||||
pubkeys: &[Pubkey],
|
pubkeys: &[Pubkey],
|
||||||
commitment_config: CommitmentConfig,
|
commitment_config: CommitmentConfig,
|
||||||
|
) -> RpcResult<Vec<Option<Account>>> {
|
||||||
|
self.get_multiple_accounts_with_config(
|
||||||
|
pubkeys,
|
||||||
|
RpcAccountInfoConfig {
|
||||||
|
encoding: Some(UiAccountEncoding::Base64Zstd),
|
||||||
|
commitment: Some(self.maybe_map_commitment(commitment_config)?),
|
||||||
|
data_slice: None,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_multiple_accounts_with_config(
|
||||||
|
&self,
|
||||||
|
pubkeys: &[Pubkey],
|
||||||
|
config: RpcAccountInfoConfig,
|
||||||
) -> RpcResult<Vec<Option<Account>>> {
|
) -> RpcResult<Vec<Option<Account>>> {
|
||||||
let config = RpcAccountInfoConfig {
|
let config = RpcAccountInfoConfig {
|
||||||
encoding: Some(UiAccountEncoding::Base64Zstd),
|
commitment: config.commitment.or_else(|| Some(self.commitment())),
|
||||||
commitment: Some(self.maybe_map_commitment(commitment_config)?),
|
..config
|
||||||
data_slice: None,
|
|
||||||
};
|
};
|
||||||
let pubkeys: Vec<_> = pubkeys.iter().map(|pubkey| pubkey.to_string()).collect();
|
let pubkeys: Vec<_> = pubkeys.iter().map(|pubkey| pubkey.to_string()).collect();
|
||||||
let response = self.send(RpcRequest::GetMultipleAccounts, json!([pubkeys, config]))?;
|
let response = self.send(RpcRequest::GetMultipleAccounts, json!([pubkeys, config]))?;
|
||||||
|
|
Loading…
Reference in New Issue