getTpSlSigningSpec
Fetch the handler’s EIP-712 signing spec for the POST endpoint (create / edit). The spec drives the domain, types, and primaryType that setQuoteTpSl signs against, so the SDK never hardcodes the schema — it always matches the deployed handler.
The spec is server-published and stable per deployment; cache it indefinitely (the React layer uses staleTime: Infinity). Called internally by setQuoteTpSl; exposed for advanced consumers that sign their own messages.
import { getTpSlSigningSpec } from "@symmio/trading-core";
const spec = await getTpSlSigningSpec(config);
// { domain, types, primaryType }Parameters
chainIdnumberoptionalTarget chain id. Defaults to the config’s defaultChainId.
Returns
The EIP-712 typed-data domain + schema. Pass to signTpSlRequest.
Throws
SymmErrorwhen the chain has notpslconfig.SymmApiErrorwhen the HTTP request fails.
Query options
import { getTpSlSigningSpecQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getTpSlSigningSpecQueryOptions(config));getTpSlSigningSpecQueryOptions takes no required inputs — cache forever. getTpSlSigningSpecQueryKey builds the matching cache key.
Related
getTpSlDeleteSigningSpec— the spec for the DELETE endpoint.TpSlSigningSpec— the return shape.useTpSlSigningSpec— React binding.
Last updated on