Skip to main content
All mutating operations (orders, cancellations, authorizations, withdrawals) follow the same create → sign → submit pattern:

1. Create

Call a create endpoint (createOrder, cancelOrder, createAuthorization, createWithdrawal) with your parameters. The backend returns an actions[] array, where each action contains:
  • action — The action type (e.g., placeOrder, updateLeverage, placeTriggerOrder)
  • description — Human-readable description
  • typedData — EIP-712 typed data to sign

2. Sign

Sign each typedData payload. Who signs depends on the signing mode:
  • USER mode: The user signs with their connected wallet
  • USER_AGENT mode: The SDK’s local agent signs automatically

3. Submit

Send the actions[] array to the submit endpoint (POST /order or POST /authorization). Each element is an object containing the action type, the original typedData, and the signature.
// Each signed action has this shape:
{ action: 'placeOrder', typedData: { ... }, signature: '0x...' }
A single create call can return multiple actions. For example, placing an order with TP/SL and a leverage change produces updateLeverage, placeOrder, and placeTriggerOrder actions — all must be signed and submitted together.