# getOpenOrders

Provides the orders of the user that are not completed or canceled:

```typescript
import { Nectar, KLineInterval } from "@wasd3rplay/nectar-sdk";

const nectar = new Nectar();
const trades = await nectar.getOpenOrders({
    symbol: "ETH_ETH:USDT_ETH",
    page: 1
});
```

### Properties

* `symbol` (optional)
  * The market symbol
  * The symbol expression is a combination of `base_ticker`, a colon (':'), and `quote_ticker`.
  * If this value is not provided, it will retrieve the current open user orders for all markets.
* `page` (default: 1)
  * The page number to retrieve, which should be greater than or equal to 1
  * Each page has 20 items

### Result

The result of this method is a list of user's open orders:

e.g.

```json
{
  previous: "<url>" | null,
  next: "<url>" | null,
  count: 10,
  results: [
    {
      id: 'lprgev7xpz3xdjn6',
      time: 1689565830,
      order_type: 0,
      price: '1000000000',
      symbol: 'ETH_ETH:USDT_ETH',
      base_ticker: 'ETH_ETH',
      quote_ticker: 'USDT_ETH',
      base_ticker_display: 'ETH',
      quote_ticker_display: 'USDT',
      request_amount: '1000000000000000',
      traded_amount: '1000000000000000',
      status: 2,
      tx_list: [
        {
          status: 4
          time: 1689565843
          txhash: '0xe4bef80805788337a93d207f57c78b3374d3b6d2dbdd6b92d8e0c5161a279e5b'
        },
        ...
      ]
    },
    ...
  ]
}
```

* `previous`
  * The URL to retrieve the previous page
  * If this value is null, it indicates that there is no previous page to query.
* `next`
  * The staring point of the history item as a timestamp
  * If this value is null, it indicates that there is no next page to query.
* `count`
  * The total number of orders
* `results`
  * The list of open orders in the current page
  * `id`
    * The order ID
  * `time`
    * The creation timestamp of the order
  * `order_type`
    * The order type of the order
  * `price`
    * The amount for buying or selling, expressed in the quote token
  * `symbol`
    * The market symbol
    * The symbol expression is a combination of `base_ticker`, a colon (':'), and `quote_ticker`.
  * `base_ticker`
    * The base token of the market to buy or sell
    * The ticker expression is a combination of token symbol, an underscore('\_'), and the blockchain (network) symbol. So, the above example shows that the base token is the token with the symbol `ETH` provided by Ethereum (`ETH`) network.
  * `base_ticker_display`
    * How to display the base token in the UI
  * `quote_ticker`
    * The quote token of the market used to buy or sell the base token as the currency
    * The ticker expression is a combination of token symbol, an underscore('\_'), and the blockchain (network) symbol. So, the above example shows that the quote token is the token with the symbol `USDT` provided by Ethereum (`ETH`) network.
  * `quote_ticker_display`
    * How to display the quote token in the UI
  * `request_amount`
    * The desired quantity of the base token for buying or selling
  * `traded_amount`
    * The traded quantity of the base token
  * `status`
    * The order status
  * `tx_list`
    * The list of blockchain transactions
    * `status`
      * The transaction status
    * `time`
      * The transaction creation timestamp
    * `txhash`
      * The transaction hash
      * This value can be used to verify the actual transaction on each blockchain network's block explorer website.

#### Order Status

```
CREATED = 0
CANCELLED = 1
COMPLETED = 2
PARTIAL_FILLED = 3
PROCESSING = 4
```

#### Transaction Status

```
CREATED = 0
SENT = 1
EXECUTED = 2
FAILED = 3
CONFIRMED = 4
CANCELLED = 5
```
