Skip to Content
Symmio Trading-SDK — the SDK surface for builders on HyperEVM
CoreTP/SLgetQuoteTpSl

getQuoteTpSl

Read the raw TP/SL rows for one quote from the handler.

Hits GET /api/v5/?quote_id=<id> and returns the full row list (every state). Framework layers (@symmio/trading-react) fold and filter these into UI-facing snapshots — core keeps the raw shape so consumers can apply their own selection rules.

import { getQuoteTpSl } from "@symmio/trading-core"; const rows = await getQuoteTpSl(config, { quoteId: 42n, });

Parameters

quoteIdbigintrequired

On-chain quote id. A negative hedger tempQuoteId is also accepted, so a pre-chain quote’s TP/SL can be read the moment the hedger accepts an instant open.

chainIdnumberoptional

Target chain id. Defaults to the config’s defaultChainId.

Returns

Every conditional-order row for the quote, in every state. See QuoteTpSlRow for the field list.

Throws

  • SymmError when the chain has no tpsl config.
  • SymmApiError when the HTTP request fails.

Query options

import { getQuoteTpSlQueryOptions } from "@symmio/trading-core"; import { useQuery } from "@tanstack/react-query"; useQuery(getQuoteTpSlQueryOptions(config, { quoteId: 42n }));

getQuoteTpSlQueryOptions is disabled until quoteId is a real id (present and non-zero); it accepts negative ids so a pre-chain quote can be read without waiting for on-chain reconciliation. GetQuoteTpSlOptions requires quoteId. The getQuoteTpSlQueryKey builder stringifies quoteId for cache matching.

Last updated on