fetchJsonParsedAccounts
Fetches an array of MaybeAccounts from a provided RPC client and an array of addresses.
It uses the getMultipleAccounts RPC method
under the hood with the jsonParsed encoding. It may also return a
MaybeEncodedAccount instead of the expected MaybeAccount if the RPC client does
not know how to parse some of the requested accounts. In any case, the array of expected data
types should be explicitly provided as the first type parameter.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
rpc | Rpc<GetMultipleAccountsApi> |
addresses | TWrappedAddresses |
config? | FetchAccountsConfig |
Returns
Promise<{ [P in string | number | symbol]: { address: Address<TAddresses[P]>; exists: false } | BaseAccount & { address: Address<TAddresses[P]>; data: TData[P & keyof TData] & { parsedAccountMeta?: { program: string; type?: (...) | (...) } } } & { exists: true } | BaseAccount & { address: Address<TAddresses[P]>; data: Uint8Array<ArrayBufferLike> } & { exists: true } } & { [P_1 in string | number | symbol]: { address: Address<TAddresses[P_1 & keyof TAddresses]>; exists: false } | BaseAccount & { address: Address<TAddresses[P_1 & keyof TAddresses]>; data: TData[P_1] & { parsedAccountMeta?: { program: string; type?: (...) | (...) } } } & { exists: true } | BaseAccount & { address: Address<TAddresses[P_1 & keyof TAddresses]>; data: Uint8Array<ArrayBufferLike> } & { exists: true } }>