Protocol request body where

Simple filter

Example:

// single condition
{
  "where": { "address": "0x4e871c17fbcadbb84180109c6cf52e85293e98f2" }
}
// multiple conditions
{
  "where": {
    "address": "0x4e871c17fbcadbb84180109c6cf52e85293e98f2",
    "contract": "0x21aee37fcdf5011553be1f7e14909d9a2c9cad56js"
  }
}

comparison operators

You can use comparison operators like $gt, $lte for value comparison.

Example:

{
  "where": {
    "expiry": { "$gt": 1657712138 }
  }
}

Full list of comparison operators (See Comparison Operators):

$eq
$gt
$get
$in
$lt
$lte
$ne
$nin

Logical operators

You can use logical operators like $and, $not, $nor, $or for combine query criteria.

Example:

{
  "where": {
    "$or": [
      { "state": { "$in": [2, 3] } },
      {
        "$and": [
          "state": { "$in": [4, 5] },
          "exerciseProfit": { "$lte": "0" }
        ]
      }
    ]
  }
}

Last updated