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

buildConditionalOrderMessage

Build a create/edit conditional-order EIP-712 message body (TpSlConditionalOrderMessage). The salt is generated automatically via generateTpSlSalt; pass salt to override. Legs are built with buildConditionalOrderLeg and passed as takeProfit / stopLoss (or null to skip a side). setQuoteTpSl uses this internally.

import { buildConditionalOrderMessage } from "@symmio/trading-core"; const message = buildConditionalOrderMessage({ virtualAccount, subAccount, quoteId: 42, symbolId: 7, positionType: 0, affiliate, takeProfit: tpLeg, stopLoss: null, });

Parameters

virtualAccountAddressrequired

PartyA (the VA address) that owns the quote.

subAccountAddressrequired

SubAccount that owns the VA.

quoteIdnumber | nullrequired

On-chain quote id (or tempQuoteId); null for a pre-chain order with no id yet.

symbolIdnumberrequired

Solver market id.

positionType0 | 1required

Quote direction — 0 = long, 1 = short.

affiliateAddressrequired

Affiliate bound to the order.

The TP leg, or null to skip TP.

The SL leg, or null to skip SL.

saltstringoptional

Override for the auto-generated salt.

Returns

The message body (pre-signature) with sendQuote: null. Pass to signTpSlRequest.

Last updated on