Umi — API References - v1.3.0
    Preparing search index...

    Function fetchAllMixedAccounts

    • Fetches multiple accounts of potentially different types in a single RPC call and deserializes each one using its provided deserializer.

      This is useful when you need to fetch accounts of different types (possibly from different programs) in a single batch. Compared to calling rpc.getAccounts directly, the result is a typed tuple where each position is the deserialized type returned by its corresponding deserializer — there is no manual narrowing.

      The underlying RPC getMultipleAccounts call has a limit of 100 accounts per request. This helper does not perform client-side chunking itself, but the Umi bundle defaults (and the @metaplex-foundation/umi-rpc-chunk-get-accounts plugin) will transparently chunk requests over that limit; callers only need to apply their own chunking when they want explicit control over concurrency.

      All accounts must exist, otherwise an error is thrown. Use safeFetchAllMixedAccounts if some accounts may not exist.

      Type Parameters

      Parameters

      Returns Promise<DeserializedAccounts<T>>

      const [metadata, edition] = await fetchAllMixedAccounts(context, [
      { publicKey: metadataAddr, deserialize: deserializeMetadata },
      { publicKey: editionAddr, deserialize: deserializeEdition },
      ]);
      // metadata: Metadata, edition: Edition — fully typed!