-
-
Notifications
You must be signed in to change notification settings - Fork 112
Transactions Query Language
To expand opportunities of interaction with transactions you may use available parametres (separately or all together at once) below.
This parameters and filters are available for such endponts as:
/api/transactions/api/blocks/api/chat/get/api/chatrooms
If you need get list of transactions from list of transactions filtered by only one parameter you can send GET request to endpoint with determining ? and parameter at end. The parameter must have valid form and should not be empty.
GET http://[node address][endpoint]?parameter={parameter value}
http://endless.adamant.im/api/transactions?fromHeight=10336065
{
"success": true,
"nodeTimestamp": 59010663,
"transactions": [{
"id": "11412430180785882609",
"height": 10336066,
"blockId": "14278911529166118529",
"type": 8,
"timestamp": 59009692,
"senderPublicKey": "aa8c981b599ac3a25500090cfac0422bc7577188d55d2dc6ca46705ca7e16601",
"senderId": "U16909039249616710117",
"recipientId": "U4849441878609670165",
"recipientPublicKey": "300e2ccd4bff6304cd5bc94824c0f0d8e8693592f8deaa2b2b599ebb15f0232a",
"amount": 0,
"fee": 100000,
"signature": "091e0b1cd2693ff7a87b4b80a4328a8ba16ad628705c4f652cec5ef0ec167c51e0c78bc4a4a8d2163c4972f201fccc971c87e7231e7f3bb895fd974cf135b000",
"signatures": [],
"confirmations": 193,
"asset": {}
}, {
"id": "3410236652915779193",
"height": 10336084,
"blockId": "13281718967217294073",
"type": 8,
"timestamp": 59009780,
"senderPublicKey": "300e2ccd4bff6304cd5bc94824c0f0d8e8693592f8deaa2b2b599ebb15f0232a",
"senderId": "U4849441878609670165",
"recipientId": "U16909039249616710117",
"recipientPublicKey": "aa8c981b599ac3a25500090cfac0422bc7577188d55d2dc6ca46705ca7e16601",
"amount": 0,
"fee": 100000,
"signature": "95a2af76e6c9b2c53c374d4c7f8a34e91ad25088a2e2c28b2ebad68cd4a54de4b92c25cd1e5db44879210249ee4f6724bd107befe5e969a08b5ca38b4f0e1105",
"signatures": [],
"confirmations": 175,
"asset": {}
}],
"count": "2"
}
If you need to get list of transactions filtered by any parameter from several you can use such case: send GET request to endpoint with determining ? and parameters joind by &. Parameters should not be empty and must have valid form.
NOTE
- for endpoints
/api/transactionsand/api/blocksparameters joined by & will be combinated by logicalor - for endpoints
/api/chat/getand/api/chatroomsparameters joined by & will be combinated by logicaland
GET http://[node address][endpoint]?parameter1={parameter1 value}¶meter2={parameter2 value}¶meter3={parameter3 value}...
http://endless.adamant.im/api/transactions?fromHeight=10336065&blockId=7917597195203393333
{
"success": true,
"nodeTimestamp": 59011159,
"transactions": [{
"id": "3410236652915779193",
"height": 10336084,
"blockId": "13281718967217294073",
"type": 8,
"timestamp": 59009780,
"senderPublicKey": "300e2ccd4bff6304cd5bc94824c0f0d8e8693592f8deaa2b2b599ebb15f0232a",
"senderId": "U4849441878609670165",
"recipientId": "U16909039249616710117",
"recipientPublicKey": "aa8c981b599ac3a25500090cfac0422bc7577188d55d2dc6ca46705ca7e16601",
"amount": 0,
"fee": 100000,
"signature": "95a2af76e6c9b2c53c374d4c7f8a34e91ad25088a2e2c28b2ebad68cd4a54de4b92c25cd1e5db44879210249ee4f6724bd107befe5e969a08b5ca38b4f0e1105",
"signatures": [],
"confirmations": 273,
"asset": {}
}, {
"id": "12810335978558620573",
"height": 6091604,
"blockId": "7917597195203393333",
"type": 0,
"timestamp": 37656340,
"senderPublicKey": "cdab95b082b9774bd975677c868261618c7ce7bea97d02e0f56d483e30c077b6",
"senderId": "U15423595369615486571",
"recipientId": "U18322695495053155871",
"recipientPublicKey": "51a0ade2c0184d0049130c06911bbf30dc79de715ba29b7496ab443cf49ea5d7",
"amount": 10000000,
"fee": 50000000,
"signature": "1f615528f133cfaeb865b50954b5dcaaaf66d6a2746c0945d506dedb4e9b7de01317c205f832002efe5b50a7e6d5503c5b83b0eb5279caa90aea4c0cd499a00f",
"signatures": [],
"confirmations": 4244753,
"asset": {}
}, {
"id": "11412430180785882609",
"height": 10336066,
"blockId": "14278911529166118529",
"type": 8,
"timestamp": 59009692,
"senderPublicKey": "aa8c981b599ac3a25500090cfac0422bc7577188d55d2dc6ca46705ca7e16601",
"senderId": "U16909039249616710117",
"recipientId": "U4849441878609670165",
"recipientPublicKey": "300e2ccd4bff6304cd5bc94824c0f0d8e8693592f8deaa2b2b599ebb15f0232a",
"amount": 0,
"fee": 100000,
"signature": "091e0b1cd2693ff7a87b4b80a4328a8ba16ad628705c4f652cec5ef0ec167c51e0c78bc4a4a8d2163c4972f201fccc971c87e7231e7f3bb895fd974cf135b000",
"signatures": [],
"confirmations": 291,
"asset": {}
}],
"count": "3"
}
If you need to get list of transactions filtered by all parameters from several at simultaneously you may use send previous request case but instead & point &and: construction to join parameters. Parameters should not be empty and must have valid form.
NOTE
- for endpoints
/api/transactionsand/api/blocksconstruction &and: works like logicaland - for endpoints
/api/chat/getand/api/chatroomsconstruction &and: works like logicalor
GET http://[node address][api/transactions]?parameter1={parameter1 value}&and:parameter2={parameter2 value}&and:parameter3={parameter3 value}...
http://endless.adamant.im/api/transactions?fromHeight=1336065&and:blockId=7917597195203393333
{
"success": true,
"nodeTimestamp": 59011592,
"transactions": [{
"id": "12810335978558620573",
"height": 6091604,
"blockId": "7917597195203393333",
"type": 0,
"timestamp": 37656340,
"senderPublicKey": "cdab95b082b9774bd975677c868261618c7ce7bea97d02e0f56d483e30c077b6",
"senderId": "U15423595369615486571",
"recipientId": "U18322695495053155871",
"recipientPublicKey": "51a0ade2c0184d0049130c06911bbf30dc79de715ba29b7496ab443cf49ea5d7",
"amount": 10000000,
"fee": 50000000,
"signature": "1f615528f133cfaeb865b50954b5dcaaaf66d6a2746c0945d506dedb4e9b7de01317c205f832002efe5b50a7e6d5503c5b83b0eb5279caa90aea4c0cd499a00f",
"signatures": [],
"confirmations": 4244841,
"asset": {}
}],
"count": "1"
}
Purpose: show all transactions in block
Type: String
Example
http://endless.adamant.im/api/transactions?blockId=7917597195203393333
Purpose: show transactions starting from block with height
Type: Integer
Example
http://endless.adamant.im/api/transactions?fromHeight=10336065
Purpose: show transactions ending at block with height
Type: Integer
Example
http://endless.adamant.im/api/transactions?toHeight=11
Purpose: show transactions with amount not less than specified
Type: Integer value of 1/10^8 tokens (1 ADM = 100000000).
Example
http://endless.adamant.im/api/transactions?minAmount=1000000000000001
Purpose: show transactions with amount not more than specified.
Type: Integer value of 1/10^8 tokens (1 ADM = 100000000).
Example
http://endless.adamant.im/api/transactions?maxAmount=50000000
Purpose: show transactions sent from specified address
Type: String.
Example
http://endless.adamant.im/api/transactions?senderId=U15423595369615486571
Purpose: show transactions sent to specified address
Type: String.
Example
http://endless.adamant.im/api/transactions?recipientId=U15423595369615486571
Purpose: show transactions sent to or from specified address
Type: String.
Example
http://endless.adamant.im/api/transactions?inId=U100739400829575109
Purpose: show transactions with specified type or
Type: Number.
NOTE If type is not set, query will choose all types of transactions. You can learn more about ADAMANT transaction types in API-10.
Example
http://endless.adamant.im/api/transactions?type=8
Purpose: show all transactions in block
Type: String
Example
http://endless.adamant.im/api/transactions?blockId=7917597195203393333
Purpose: returns blocks forged by delegate with pointed publicKey
Type: PublicKey of block generator
Example
http://endless.adamant.im/api/blocks?generatorPublicKey=150d638714f65845b50f1ff58f3da2c2baa3a1dc8bf59a9884c10da5a8e951c6
Purpose: show block with pointed height
Type: Integer
Example
http://endless.adamant.im/api/blocks?height=100
Purpose: show chats starting from block with height
Type: Integer
Example
http://endless.adamant.im/api/chats/get?fromHeight=10336065
Purpose: show chats ending at block with height
Type: Integer
Example
http://endless.adamant.im/api/chats/get?toHeight=11
Purpose: show chats sent from specified address
Type: String.
Example
http://endless.adamant.im/api/chats/get?senderId=U15423595369615486571
Purpose: show chats sent to specified address
Type: String.
Example
http://endless.adamant.im/api/chats/get?recipientId=U15423595369615486571
Purpose: show chats with specified type of message
Type: Number.
NOTE If type is not set, query will choose all types of messages. You can learn more about ADAMANT messages types here.
Example
http://endless.adamant.im/api/chats/get?type=8
Additionall request options
Purpose: Limit of transactions count returned in response. Default is 25.
Type: Number
Example
http://endless.adamant.im/api/transactions?limit=2
Purpose: Offset to returned transactions list. Default is 0.
Type: Number
Example
http://endless.adamant.im/api/blocks?Offset=1
Purpose: ordering transactions by specified parameter by desc or asc. Default is timestamp:desc
Type: String
NOTE Between parameters type and orderBy need to set ":" sign
Example
http://endless.adamant.im/api/transactions?orderBy=timestamp:desc
NOTE Available for /api/chatrooms and /api/chats/get endponts only
Purpose: returns transactions with type=8 if set withoutDirectTransfers=true. Default false
Type: String
Example
https://endless.adamant.im/api/chatrooms/U2707535059340134112?withoutDirectTransfers=true