-
-
Notifications
You must be signed in to change notification settings - Fork 125
Transactions Query Language
To expand opportunities of getting transactions use parameters to filter results, and options.
Available filters (may be specific to endpoint):
- blockId
- fromHeight
- toHeight
- minAmount
- maxAmount
- senderId
- senderIds
- recipientId
- recipientIds
- senderPublicKey
- senderPublicKeys
- recipientPublicKey
- recipientPublicKeys
- inId
- type
- key
Filters available for endponts:
-
/api/transactions
:blockId
,fromHeight
,toHeight
,minAmount
,maxAmount
,senderId
,senderIds
,recipientId
,recipientIds
,senderPublicKey
,senderPublicKeys
,recipientPublicKey
,recipientPublicKeys
,inId
,type
,returnAsset
-
/api/chats/get
:fromHeight
,toHeight
,senderId
,recipientId
,inId
,type
-
/api/chatrooms
:type
-
/api/states/get
:fromHeight
,toHeight
,senderId
,key
,type
You can use limit
, offset
, orderBy
, returnAsset
and withoutDirectTransfers
options.
Filters and options can be joined: Combine filters and options.
Get transactions in specific block.
Example: http://endless.adamant.im/api/transactions?blockId=7917597195203393333
Get transactions starting from block with specific height.
Example: http://endless.adamant.im/api/transactions?fromHeight=10336065
Get transactions till block with specific height.
Example: http://endless.adamant.im/api/transactions?toHeight=11
Get transactions with amount not less than specified Integer value of 1/10^8 tokens (1 ADM = 100000000).
Example: http://endless.adamant.im/api/transactions?minAmount=1000000000000001
Get transactions with amount not more than specified Integer value of 1/10^8 tokens (1 ADM = 100000000).
Example: http://endless.adamant.im/api/transactions?maxAmount=50000000
Get transactions sent from specified ADAMANT address.
Example: https://endless.adamant.im/api/transactions?senderId=U15423595369615486571
Get transactions sent from specified ADAMANT addresses, separated by commas.
NOTE: Available for /api/transactions
endpoint only.
Example: https://debate.adamant.im/api/transactions?senderIds=U18132012621449491414,U15881344309699504778
Get transactions received by specified ADAMANT address.
Example: https://endless.adamant.im/api/transactions?recipientId=U15423595369615486571
Get transactions received by specified ADAMANT addresses, separated by commas.
NOTE: Available for /api/transactions
endpoint only.
Example: https://debate.adamant.im/api/transactions?recipientIds=U18132012621449491414,U15881344309699504778
Get transactions sent from or received to specified ADAMANT address.
Example: http://endless.adamant.im/api/transactions?inId=U100739400829575109
Parameter meaning depends on enpoint:
-
/api/transactions
: Get transactions of specified type. See Transaction Types. If type is not set, all types of transactions will be returned. -
/api/chats/get
and/api/chatrooms
: Get messages of specified type. See ADAMANT Message Types. If type is not set, all types of messages will be returned. -
/api/states/get
: Get KVS records of incremental or full re-write of previous values. Default is 0. See AIP 11: Behavior for KVS data.
Example: https://endless.adamant.im/api/transactions?type=8
Example: https://endless.adamant.im/api/chats/get?type=2
Example: https://endless.adamant.im/api/chatrooms/U17362714543155685887/U17819800352812315500?type=2
Refers to /api/states/get
endpoint.
Get transactions of specified KVS key. See AIP 3: Storing data in chain (KVS).
Example: https://endless.adamant.im/api/states/get?key=eth:address&senderId=U14236667426471084862&orderBy=timestamp:desc
Options can be combined.
Limits returned items count. Default is 100 for transactions and 25 for Chatrooms.
Example: https://endless.adamant.im/api/transactions?limit=2
Offset value for results, integer. Default is 0.
Example: https://endless.adamant.im/api/transactions?offset=100
Ordering request results by fieldname.
Example: https://endless.adamant.im/api/transactions?orderBy=timestamp:desc
Get transaction's asset
when set to 1
. Default is 0
.
NOTE: Available for /api/transactions
endpoint only. Endpoints /api/chats/get
, /api/chatrooms
and /api/states/get
always do return asset
field.
Example: https://endless.adamant.im/api/transactions/get?id=13920471299012339255&returnAsset=1
When set to true
, excludes type 0
transactions (direct token transfers) from results. Default is false
.
NOTE: Available for /api/chatrooms
endpoint only.
Example: https://endless.adamant.im/api/chatrooms/U2707535059340134112?withoutDirectTransfers=true
You can filter by single parameter, or by multiple parameters. Default condition and
or or
differs for endpoint:
-
/api/transactions
: default isor
; to setand
useand:
-
/api/chats/get
: default isand
-
/api/chatrooms
: default isand
-
/api/states/get
: default isand
Options always joined with and
condition.
Examples:
https://endless.adamant.im/api/transactions?fromHeight=1336065&blockId=7917597195203393333
Get transactions where height greater than 1336065 or blockId = 7917597195203393333.
https://endless.adamant.im/api/transactions?fromHeight=1336065&and:senderId=U15423595369615486571&limit=2&orderBy=timestamp:asc
Get transactions where height greater than 1336065 and senderId = U15423595369615486571, order by timestamp ascending and limit results by 2 transactions.
https://debate.adamant.im/api/transactions?senderIds=U18132012621449491414,U15881344309699504778&and:types=9,0&orderBy=timestamp:desc
Get type 9 or type 0 transactions where senderId = U18132012621449491414 or senderId = U15881344309699504778, order by timestamp ascending and limit results by 2 transactions.