# hl_batchOpenOrders

Retrieves open orders for multiple user addresses in a single batch request.

## Parameters

- **users** (array (REQUIRED)): Array of user wallet addresses (0x-prefixed hex strings) to query for open orders. Maximum of 100 addresses per request.

## Returns

- **result** (object): Result payload containing successful and failed wallet queries
  - **successful_states** (array): Array of tuples containing wallet address and their open orders
    - **address** (string): User wallet address as a 0x-prefixed hex string
    - **orders** (array): Array of open order objects for this address
      - **coin** (string): Instrument symbol (e.g., HYPE, BTC, @294)
      - **side** (string): Order side: A for Ask (sell) or B for Bid (buy)
      - **limitPx** (string): Limit price as a stringified number
      - **sz** (string): Current order size/quantity as a stringified number
      - **oid** (integer): Order identifier
      - **timestamp** (integer): Order timestamp in milliseconds since Unix epoch
      - **origSz** (string): Original order size/quantity as a stringified number
  - **failed_wallets** (array): Array of wallet addresses that failed to be queried

## Code Examples

### CURL

```sh
curl {{url}} \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "hl_batchOpenOrders",
    "params": {
      "users": [
        "0xf9a9a403b039996082049394935f815523157330",
        "0xf882efb8687354909fc1931923f3b46cf7e24adc",
        "0xeb7154a073efae0adbe8c9472366c70dd8a5fba7"
      ]
    },
    "id": 1
  }'
```

### JAVASCRIPT

```js
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "hl_batchOpenOrders",
  "params": {
    "users": [
      "0xf9a9a403b039996082049394935f815523157330",
      "0xf882efb8687354909fc1931923f3b46cf7e24adc",
      "0xeb7154a073efae0adbe8c9472366c70dd8a5fba7"
    ]
  },
  "id": 1
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("{{url}}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

### PYTHON

```py
import requests
import json

url = "{{url}}"

payload = json.dumps({
  "jsonrpc": "2.0",
  "method": "hl_batchOpenOrders",
  "params": {
    "users": [
      "0xf9a9a403b039996082049394935f815523157330",
      "0xf882efb8687354909fc1931923f3b46cf7e24adc",
      "0xeb7154a073efae0adbe8c9472366c70dd8a5fba7"
    ]
  },
  "id": 1
})

headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

### RUBY

```rb
require "uri"
require "json"
require "net/http"

url = URI("{{url}}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "jsonrpc": "2.0",
  "method": "hl_batchOpenOrders",
  "params": {
    "users": [
      "0xf9a9a403b039996082049394935f815523157330",
      "0xf882efb8687354909fc1931923f3b46cf7e24adc",
      "0xeb7154a073efae0adbe8c9472366c70dd8a5fba7"
    ]
  },
  "id": 1
})

response = http.request(request)
puts response.read_body
```

