InstantLayer
The InstantLayer contract manages delegated signer access for instant actions. SYMM Frontier exposes the delegation reads as separate APIs: one reads the raw expiry timestamp from delegations, and one reads the contract’s computed active status from isDelegationActive.
Contract reference: SYMMIO perps-core v0.8.5 docs .
Reads
getDelegationExpiry
Read the raw expiry timestamp stored in the delegations mapping.
import { getDelegationExpiry } from "@symmio/trading-core";
const expiryTimestamp = await getDelegationExpiry(config, {
account: "0xaccount...",
delegate: "0xdelegate...",
selector: "0x501e891f",
});Parameters
| Name | Type | Default | Notes |
|---|---|---|---|
account | Address | required | Account that owns the delegation. |
delegate | Address | required | Delegated signer being checked. |
selector | Hex | required | Function selector as bytes4, for example 0x... |
chainId | number? | config default | Optional chain override. |
Returns — bigint, the Unix timestamp in seconds.
getIsDelegationActive
Read whether the contract considers a delegation active.
import { getIsDelegationActive } from "@symmio/trading-core";
const isActive = await getIsDelegationActive(config, {
account: "0xaccount...",
delegate: "0xdelegate...",
selector: "0x501e891f",
});Parameters
| Name | Type | Default | Notes |
|---|---|---|---|
account | Address | required | Account that owns the delegation. |
delegate | Address | required | Delegated signer being checked. |
selector | Hex | required | Function selector as bytes4. |
chainId | number? | config default | Optional chain override. |
Returns — boolean.
Query Options
Use these when integrating with TanStack Query outside React:
import { getDelegationExpiryQueryOptions, getIsDelegationActiveQueryOptions } from "@symmio/trading-core";
const expiryOptions = getDelegationExpiryQueryOptions(config, {
account,
delegate,
selector,
});
const activeOptions = getIsDelegationActiveQueryOptions(config, {
account,
delegate,
selector,
});GetDelegationExpiryOptions and GetIsDelegationActiveOptions require account, delegate, and selector. The factories do not accept missing read inputs and do not validate them inside queryFn.
The query-key builders still accept partial inputs:
import { getDelegationExpiryQueryKey, getIsDelegationActiveQueryKey } from "@symmio/trading-core";
getDelegationExpiryQueryKey({ account, delegate });
getIsDelegationActiveQueryKey({ account, delegate });Partial keys are for cache matching and invalidation, not for calling the read query.
Write
grantDelegation
Grant a delegated signer access to one or more selectors until an expiry timestamp.
import { grantDelegation } from "@symmio/trading-core";
const hash = await grantDelegation(config, {
account: { addr: account, isPartyB: false },
delegatedSigner: delegate,
selectors: ["0x501e891f"],
expiryTimestamp: 1_766_000_000n,
});Parameters
| Name | Type | Notes |
|---|---|---|
account | InstantLayerAccount | Account identity passed to the contract. PartyA/user accounts use isPartyB: false. |
delegatedSigner | Address | Signer receiving delegated access. |
selectors | readonly Hex[] | Function selectors to delegate. |
expiryTimestamp | bigint | Unix timestamp in seconds. |
chainId | number? | Optional chain override. |
Returns — Hash.