Skip to main content

Module client

Module client 

Source
Available on crate feature client only.
Expand description

Async RPC client helpers for fetching and deserializing accounts.

Requires the client feature (adds a solana-client dependency).

use anchor_parser::client;
use my_program::accounts::MyAccount;

let account = client::fetch_account::<MyAccount>(&rpc_client, &address).await?;
let accounts = client::fetch_accounts::<MyAccount>(&rpc_client, &[addr1, addr2]).await?;

Functions§

fetch_account
Fetch and deserialize a single account from an async RPC client.
fetch_accounts
Fetch and deserialize multiple accounts of the same type.