Skip to content

Transactions Query Language

Aleksei Lebedev edited this page Nov 4, 2020 · 20 revisions

Query language used to filter transactions for get transactions command.

Note: 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. See Complex query examples.

Available parameters for Transaction Filter

blockId

Block id of transaction (String).

Example:

blockId=7917597195203393333

Will show transactions in block 7917597195203393333.

fromHeight

Starting height of transaction (integer).

Example:

fromHeight=1000

Will show transactions starting from block with height 1000.

toHeight

Finishing height of transaction (integer).

Example:

toHeight=2000

Will show transactions ending at block with height 2000.

minAmount

Transactions with amount not less than specified. Integer value of 1/10^8 tokens (1 ADM = 100000000).

Example:

minAmount=5000000

Will show transactions with minimum transferred amount of 0.5 ADM.

Example:

minAmount=1

Will show all token transfer transactions (including both direct transfers, and In-Chat transfers).

maxAmount

Transactions with amount not more than specified. Integer value of 1/10^8 tokens (1 ADM = 100000000).

Example:

maxAmount=5000000

Will show transactions with maximum transferred amount of 0.5 ADM.

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=8

Will show transactions with type 8 only (messages and In-Chat ADM transfers transactions).

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

Available parameters for Blocks Filter

blockId

Block id of transaction (String).

Example:

blockId=7917597195203393333

Will show transactions from block 7917597195203393333.

generatorPublicKey

PublicKey of block generator (delegate).

Example:

generatorPublicKey=150d638714f65845b50f1ff58f3da2c2baa3a1dc8bf59a9884c10da5a8e951c6

Will return blocks forged by delegate with publicKey "150d638714f65845b50f1ff58f3da2c2baa3a1dc8bf59a9884c10da5a8e951c6".

height

Height of block (integer).

Example:

height=100

Will show block with height 100.

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,and:minAmount=1,orderBy=timestamp:desc"

Will get all token transfer transactions (including both direct transfers, and In-Chat transfers) where address U15423595369615486571 is recipient or sender.

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

Will get 1 last token transfer transaction where address U15423595369615486571 is recipient or sender. Note: In-Chat token transfer transactions will not be considered, as they are type=8.

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.