getPendingWithdrawRequestsBatch
Read every pending-withdrawal page for each distinct subaccount. Empty or sparse pages do not stop pagination: each user’s last observed request ID bounds the scan. A failed page rejects the complete read, so callers never receive a partial list as a successful result.
import { getPendingWithdrawRequestsBatch } from "@symmio/trading-core";
import { arbitrum } from "viem/chains";
const pending = await getPendingWithdrawRequestsBatch(config, {
users: subAccounts,
chainId: arbitrum.id,
pageSize: 200n,
});Parameters
usersreadonly Address[]requiredSubaccounts to scan. Duplicate and case-equivalent addresses are read once. An empty list returns [] without RPC
reads.
pageSizebigintdefault 200nNumber of request IDs per page, from 1n to 200n inclusive.
chainIdnumberoptionalChain override. Omit to use the SDK config’s default chain.
Returns
readonly PendingWithdrawRequestsForUser[]userAddressLowercase subaccount address. Groups are sorted by normalized address.
requestsreadonly WithdrawRequest[]All active requests found through the last ID observed at the beginning of this user’s scan, including an empty array when none exist. See the single-range read for the request fields. Requests created after the last-ID read are included by a later refresh.
Pages for all users are fetched concurrently, with at most 6 RPC reads in flight at once across the whole batch, so a long scan does not trip an RPC rate limit. The page size bounds each RPC’s ID range. After the first failed read, no new read starts and the batch rejects with that error.
Query options
import { getPendingWithdrawRequestsBatchQueryOptions } from "@symmio/trading-core";
import { arbitrum } from "viem/chains";
const options = getPendingWithdrawRequestsBatchQueryOptions(config, {
users: subAccounts,
chainId: arbitrum.id,
});getPendingWithdrawRequestsBatchQueryOptions and
getPendingWithdrawRequestsBatchQueryKey preserve the deployment’s config scope
and normalize user ordering, case and duplicates. Empty users disable automatic
query execution. Action, result, data, options and key types are exported from
the package root.
Related
usePendingWithdrawRequestsBatch— React query hook.getPendingWithdrawRequests— read one ID range.