Skip to content

Transactions Query Language

zyuhel edited this page Dec 4, 2018 · 20 revisions

Query language used to filter transactions for get transactions command.

Transaction queries consist of multiple pairs of keys and values, with , as separator.

All parameters are joined with "OR" by default. To join with "AND" specify AND: in front of key-value pair.

Available parameters

  • blockId: Block id of transaction (String)

Example:

blockId=7917597195203393333

Will show transactions from block 7917597195203393333

  • senderId: Sender address (String)

Example:

senderId=U15423595369615486571

Will show transactions sent from address U15423595369615486571

  • recipientId: Recipient address (String)

Example:

recipientId=U18322695495053155871

Will show transactions sent to address U18322695495053155871

  • inId: Recipient or sender address (String)

Example:

inId=U15423595369615486571

Will show transactions from or to address U15423595369615486571

  • type: Transaction type (Number)

Example:

type=0

Will show transactions with type 0 only (token transfers transactions).

If type is not set, query will choose all types of transactions. You can learn more about ADAMANT transaction types in APIs.

Available options

  • limit: Limit of transactions count returned in response. Default is 20. (Number)
  • offset: Offset to returned transactions list. Default is 0. (Number)
  • orderBy: Name of field to order by. After column name you must specify desc or asc to choose order type. (String)

See list of available fields.

Example:

orderBy=timestamp:desc

Complex query examples

get transactions "inId=U15423595369615486571,type=0,limit=1,orderBy=timestamp:desc"

Will get 1 last token transfer transaction where address U15423595369615486571 is recipient or sender.

get transactions "blockId=7917597195203393333,and:recipientId=U18322695495053155871,orderBy=timestamp:asc"

Will get all transactions from block 7917597195203393333 where address U18322695495053155871 is recipient.

get transactions "recipientId=U18322695495053155871,orderBy=timestamp:desc,limit=100"

Will get last 100 transactions where recipient address is U18322695495053155871.

Clone this wiki locally