Client Initialization
L2 methods require the client to initialize with the signer, signatureType, user API credentials, and funder.- TypeScript
- Python
Order Creation and Management
createAndPostOrder()
A convenience method that creates, prompts signature, and posts an order in a single call. Use when you want to buy/sell at a specific price and can wait.Signature
Params
Response
createAndPostMarketOrder()
A convenience method that creates, prompts signature, and posts an order in a single call. Use when you want to buy/sell right now at whatever the market price is.Signature
Params
Response
postOrder()
Posts a pre-signed and created order to the CLOB.Signature
Params
Response
postOrders()
Posts multiple pre-signed and created orders in a single batch.Params
Response
cancelOrder()
Cancels a single open order.Signature
Response
cancelOrders()
Cancels multiple orders in a single batch.Signature
Params
Response
cancelAll()
Cancels all open orders.Signature
Response
cancelMarketOrders()
Cancels all open orders for a specific market.Signature
Parameters
Response
Order and Trade Queries
getOrder()
Get details for a specific order.Signature
Response
getOpenOrders()
Get all your open orders.Signature
Params
Response
getTrades()
Get your trade history (filled orders).Signature
Params
Response
getTradesPaginated()
Get trade history with pagination for large result sets.Signature
Params
Response
Balance and Allowances
getBalanceAllowance()
Get your balance and allowance for specific tokens.Signature
Params
Response
updateBalanceAllowance()
Updates the cached balance and allowance for specific tokens.Signature
Params
API Key Management (L2)
getApiKeys()
Get all API keys associated with your account.Signature
Response
deleteApiKey()
Deletes (revokes) the currently authenticated API key. TypeScript Signature:Notifications
getNotifications()
Retrieves all event notifications for the L2 authenticated user. Records are removed automatically after 48 hours or if manually removed via dropNotifications().Signature
Response
| Name | Value | Description |
|---|---|---|
| Order Cancellation | 1 | User’s order was canceled |
| Order Fill | 2 | User’s order was filled (maker or taker) |
| Market Resolved | 4 | Market was resolved |
dropNotifications()
Mark notifications as read/dismissed.Signature
Params