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
virtualAccountAddressrequiredPartyA (the VA address) that owns the quote.
subAccountAddressrequiredSubAccount that owns the VA.
quoteIdnumber | nullrequiredOn-chain quote id (or tempQuoteId); null for a pre-chain order with no id yet.
symbolIdnumberrequiredSolver market id.
positionType0 | 1requiredQuote direction — 0 = long, 1 = short.
affiliateAddressrequiredAffiliate bound to the order.
The TP leg, or null to skip TP.
The SL leg, or null to skip SL.
saltstringoptionalOverride for the auto-generated salt.
Returns
The message body (pre-signature) with sendQuote: null. Pass to signTpSlRequest.
Related
buildConditionalOrderLeg— builds each leg.TpSlConditionalOrderMessage— the return shape.setQuoteTpSl— the full create/edit action.
Last updated on