signTpSlRequest
Sign a TP/SL message with the session-key wallet and produce the { typedData, signature, signer } body the handler expects. The handler’s signing spec drives domain / types / primaryType, so the SDK never hardcodes the EIP-712 schema — it always matches the deployed handler. null legs are padded with ZERO_LEG (via toSignableTpSlMessage) before signing, because EIP-712 can’t hash null structs.
Both setQuoteTpSl and deleteQuoteTpSl call this internally; use it directly only when signing your own messages.
import { signTpSlRequest } from "@symmio/trading-core";
const signed = await signTpSlRequest({
signingSpec,
message,
walletClient,
});
// { typedData, signature, signer }Parameters
The handler’s EIP-712 spec — drives domain, types, primaryType.
The message body to sign — a create/edit or a delete message.
walletClientSymmioWalletClientrequiredSession-key wallet client that performs signTypedData.
Returns
The signed request body — typed data, signature, and signer address — ready to POST/DELETE.
Related
TpSlSignedRequest— the return shape.toSignableTpSlMessage— the null-leg padding applied before hashing.getTpSlSigningSpec— source of thesigningSpec.