fetchEncodedAccounts function

Future<List<MaybeEncodedAccount>> fetchEncodedAccounts(
  1. Rpc rpc,
  2. List<Address> addresses, {
  3. FetchAccountConfig? config,
})

Fetches an array of MaybeEncodedAccounts from the provided RPC client and an array of addresses.

It uses the getMultipleAccounts RPC method under the hood with base64 encoding.

final [accountA, accountB] = await fetchEncodedAccounts(
  rpc,
  [addressA, addressB],
);

Implementation

Future<List<MaybeEncodedAccount>> fetchEncodedAccounts(
  Rpc rpc,
  List<Address> addresses, {
  FetchAccountConfig? config,
}) {
  return createSolanaAccountClient(
    rpc,
  ).fetchEncodedAccounts(addresses, config: config);
}