跳到正文

database_api.list_limit_orders ​

Purpose ​

返回限价单(limit order)列表。参数:start:array;limit:int;order:string

  • start 取决于 order(见下文)
  • limit 最大 1000。
  • order 可取以下值:
    • by_price - 按价格排序
      • start 为两个值组成的数组:price、order_type
    • by_account - 按账户排序
      • start 为两个值组成的数组:account、order_id

| start (array) | limit (int) | order (string) | | |----------------------------|---------------|-| | [{"base": {"amount": "85405", "precision": 3, "nai": "@@000000021"}, "quote": {"amount": "17192", "precision": 3, "nai": "@@000000013"}}, 0] | 10 | "by_price" | 查询前 10 条请求,按价格排序 | | ["alice", 0] | 10 | "by_effective_date" | 查询前 10 条请求,按账户排序 |

另见:Paginated API Methods

Parameters ​

PARAMETERS
json
{
  "start": null,
  "limit": 0,
  "order": "by_name"
}

Example ​

Example 1 ​

BASH
bash
curl -s https://api.steemit.com \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "jsonrpc": "2.0",
    "method": "database_api.list_limit_orders",
    "params": {
      "start": [
        {
          "base": {
            "amount": "1000",
            "precision": 3,
            "nai": "@@000000021"
          },
          "quote": {
            "amount": "1",
            "precision": 3,
            "nai": "@@000000013"
          }
        },
        0
      ],
      "limit": 10,
      "order": "by_price"
    },
    "id": 1
  }'

Example 2 ​

BASH
bash
curl -s https://api.steemit.com \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "jsonrpc": "2.0",
    "method": "database_api.list_limit_orders",
    "params": {
      "start": [
        "alice",
        0
      ],
      "limit": 10,
      "order": "by_account"
    },
    "id": 1
  }'

Response ​

RESPONSE
json
{
  "orders": [
    {
      "id": 3155591,
      "created": "2018-12-05T06:34:21",
      "expiration": "2018-12-15T06:34:20",
      "seller": "teamsmooth-mm",
      "orderid": 2000,
      "for_sale": 197714,
      "sell_price": {
        "base": {
          "amount": "198513",
          "precision": 3,
          "nai": "@@000000021"
        },
        "quote": {
          "amount": "80000",
          "precision": 3,
          "nai": "@@000000013"
        }
      }
    }
  ]
}