getTpSlConfig
Fetch the handler’s /configs/ rules — the constraints a TP/SL request must satisfy. The wire fields (MinPriceDistancePercent, MinProfitStopLossSpreadPercent) are camel-cased on the SDK boundary.
import { getTpSlConfig } from "@symmio/trading-core";
const config = await getTpSlConfig(sdkConfig);
// { minPriceDistancePercent, minProfitStopLossSpreadPercent }Parameters
chainIdnumberoptionalTarget chain id. Defaults to the config’s defaultChainId.
Returns
The handler rules. Feed this into validateTpSl before submitting.
Throws
SymmErrorwhen the chain has notpslconfig.SymmApiErrorwhen the HTTP request fails.
Query options
import { getTpSlConfigQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getTpSlConfigQueryOptions(config));getTpSlConfigQueryOptions takes no required inputs; chainId is optional. getTpSlConfigQueryKey builds the matching cache key.
Related
TpSlConfig— the return shape.validateTpSl— consumes these rules.useTpSlConfig— React binding.
Last updated on