getActiveDelegations
Read which of the probed (delegate, selector) pairs the Instant Layer currently enforces, in a single call.
import { getActiveDelegations, getSessionKeySelectors } from "@symmio/trading-core";
const selectors = getSessionKeySelectors(config, { chainId });
const active = await getActiveDelegations(config, {
delegator: { addr: subAccount, isPartyB: false },
delegates: [sessionKeyAddress],
selectors: [selectors],
});Prefer this over getIsDelegationActive when the account may be a
virtual account. This getter canonicalizes a VA to its parent sub-account exactly the way enforcement does. The
single-selector read hits the raw delegations mapping and reports false for a VA whose parent holds the grant.
A pending revocation still reads as active
A delegation stays in this result for the whole revocation cooldown after initiateRevokeDelegation — enforcement only stops at the ETA, and the grant is deleted later still. That is correct, because the key really can keep signing, but it means this read alone cannot tell “healthy” from “being revoked”. Pair it with getPendingRevocationEtas whenever you render delegation status to a user.
Parallel arrays
delegates and selectors are parallel: selectors[i] is the bytes4[] probed for delegates[i], so the two arrays must be the same length. One delegate means one nested array.
Parameters
delegatorInstantLayerAccountrequiredThe account the delegations are enforced under. May be a sub-account or a virtual account.
delegatesreadonly Address[]requiredDelegated signers to probe.
selectorsreadonly (readonly Hex[])[]requiredSelectors to probe per delegate, parallel to delegates.
chainIdnumberoptionalOptional chain override.
Returns
readonly ActiveDelegationInfo[]Only the delegations the contract reports as live. A delegate with nothing active is absent from the result rather
than present with an empty selectors.
accountInstantLayerAccountThe canonical account the delegation is enforced under.
delegatedSignerAddressThe signer holding the delegated authority.
selectorsreadonly Hex[]Those of the probed selectors that are actually delegated and live.
expiryTimestampbigintGrant expiry as a Unix timestamp in seconds.
Selectors granted in separate transactions expire at different times, and the contract reports only the soonest.
Render expiryTimestamp as “usable until”, never as a per-selector expiry.
Query options
import { getActiveDelegationsQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getActiveDelegationsQueryOptions(config, { delegator, delegates, selectors }));The React binding is useActiveDelegations; for the common “is my session key ready?” question, prefer useAreDelegationsActive, which answers it directly.