const myAddress = address('1234..5678');
const myAccount: MaybeEncodedAccount<'1234..5678'> = await fetchEncodedAccount(rpc, myAddress);
// With custom configuration.
const myAccount: MaybeEncodedAccount<'1234..5678'> = await fetchEncodedAccount(rpc, myAddress, {
abortSignal: myAbortController.signal,
commitment: 'confirmed',
});
Fetches a MaybeEncodedAccount from the provided RPC client and address.
It uses the GetAccountInfoApi.getAccountInfo | getAccountInfo RPC method under the hood with base64 encoding and an additional configuration object can be provided to customize the behavior of the RPC call.