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

toSignableTpSlMessage

EIP-712 can’t hash null struct fields. This replaces any null leg or sendQuote with a zero-value struct before hashing, so signTpSlRequest can produce a valid signature. The same padded shape is sent on the wire, so the handler can re-verify it. A null quoteId is padded to 0.

import { toSignableTpSlMessage } from "@symmio/trading-core"; const signable = toSignableTpSlMessage(message);

Parameters

messageRecord<string, unknown>required

A conditional-order or delete message body that may carry null legs / sendQuote / quoteId.

Returns

Record<string, unknown>

The same message with any null takeProfit / stopLoss replaced by ZERO_LEG, null sendQuote replaced by { ...ZERO_LEG, leverage: 0 }, and null quoteId replaced by 0.

ZERO_LEG

The padding uses the exported ZERO_LEG sentinel — an empty-value TpSlConditionalOrderLeg:

import { ZERO_LEG } from "@symmio/trading-core"; // { quantity: "0", price: "0", orderType: 0, conditionalPrice: "0", conditionalPriceType: "market" }
Last updated on