@@ -165,17 +165,15 @@ We currently provide hosted infrastructure at https://mainnet.aeternity.io/mdw/
165
165
## HTTP endpoints
166
166
167
167
```
168
- GET /tx/:hash - returns transaction by hash
169
- GET /txi/:index - returns transaction by index (0 .. last transaction index)
170
- GET /txs/count - returns total number of transactions (last transaction index + 1)
171
- GET /txs/count/:id - returns counts of transactions per transaction field for given id
172
- GET /txs/:scope_type/:range - returns transactions bounded by scope/range where query is in query string
173
- GET /txs/:direction - returns transactions from beginning (forward) or end (backward), query is in query string
174
-
175
- GET /v2/blocks/:hash - returns block by hash
176
- GET /v2/blocks/:kbi - returns key block by integer index
177
- GET /v2/blocks/:kbi/:mbi - returns micro block by integer indices
178
- GET /v2/blocks - returns generation blocks
168
+ GET /v2/txs/:hash_or_index - returns transaction by hash or index
169
+ GET /v2/txs/count - returns total number of transactions (last transaction index + 1)
170
+ GET /v2/txs/count/:id - returns counts of transactions per transaction field for given id
171
+ GET /v2/txs - returns transactions in any direction
172
+
173
+ GET /v2/blocks/:hash - returns block by hash
174
+ GET /v2/blocks/:kbi - returns key block by integer index
175
+ GET /v2/blocks/:kbi/:mbi - returns micro block by integer indices
176
+ GET /v2/blocks - returns generation blocks
179
177
180
178
GET /name/:id - returns name information by hash or plain name
181
179
GET /name/auction/:id - returns name information for auction, by hash or plain name
@@ -193,14 +191,9 @@ GET /names/active/:scope_type/:range - returns active names for continuation
193
191
GET /names - returns all names (active and expired) ordered by (optional) query parameters
194
192
GET /names/:scope_type/:range - returns all names for continuation link
195
193
196
- GET /oracle/ :id - returns oracle information by hash
194
+ GET /v2/oracles/ :id - returns oracle information by hash
197
195
198
- GET /oracles/inactive - returns expired oracles ordered by expiration height
199
- GET /oracles/inactive/gen/:range - returns expired oracles for continuation link
200
- GET /oracles/active - returns active oracles ordered by expiration height
201
- GET /oracles/active/gen/:range - returns active oracles for continuation link
202
- GET /oracles - returns all oracles from newest (active) to oldest (expired)
203
- GET /oracles/gen/:range - returns all oracles for continuation link
196
+ GET /v2/oracles - returns expired oracles ordered by expiration height, filtered by active/inactive state and scope
204
197
205
198
GET /aex9/by_name - returns AEX9 tokens, filtered by token name
206
199
GET /aex9/by_symbol - returns AEX9 tokens, filtered by token symbol
@@ -303,7 +296,7 @@ Type groups for the transactions listed above are:
303
296
304
297
` type ` parameter:
305
298
```
306
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? type=channel_create&limit=1" | jq '.'
299
+ $ curl -s "https://mainnet.aeternity.io/mdw/txs?direction=forward& type=channel_create&limit=1" | jq '.'
307
300
{
308
301
"data": [
309
302
{
@@ -340,7 +333,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward?type=channel_create&limi
340
333
341
334
` type_group ` parameter:
342
335
```
343
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? type_group=oracle&limit=1" | jq '.'
336
+ $ curl -s "https://mainnet.aeternity.io/mdw/txs?direction=forward& type_group=oracle&limit=1" | jq '.'
344
337
{
345
338
"data": [
346
339
{
@@ -395,7 +388,7 @@ With generic ids, it is possible to select also `create`/`register` transactions
395
388
###### Examples
396
389
397
390
```
398
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? contract=ct_2AfnEfCSZCTEkxL5Yoi4Yfq6fF7YapHRaFKDJK3THMXMBspp5z&limit=2" | jq '.'
391
+ $ curl -s "https://mainnet.aeternity.io/mdw/txs?direction=forward& contract=ct_2AfnEfCSZCTEkxL5Yoi4Yfq6fF7YapHRaFKDJK3THMXMBspp5z&limit=2" | jq '.'
399
392
{
400
393
"data": [
401
394
{
@@ -484,7 +477,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward?contract=ct_2AfnEfCSZCTE
484
477
```
485
478
486
479
```
487
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? oracle=ok_24jcHLTZQfsou7NvomRJ1hKEnjyNqbYSq2Az7DmyrAyUHPq8uR&limit=1" | jq '.'
480
+ $ curl -s "https://mainnet.aeternity.io/mdw/txs?direction=forward& oracle=ok_24jcHLTZQfsou7NvomRJ1hKEnjyNqbYSq2Az7DmyrAyUHPq8uR&limit=1" | jq '.'
488
481
{
489
482
"data": [
490
483
{
@@ -521,7 +514,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward?oracle=ok_24jcHLTZQfsou7
521
514
```
522
515
523
516
```
524
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? channel=ch_22usvXSjYaDPdhecyhub7tZnYpHeCEZdscEEyhb2M4rHb58RyD&limit=2" | jq '.'
517
+ $ curl -s "https://mainnet.aeternity.io/mdw/txs?direction=forward& channel=ch_22usvXSjYaDPdhecyhub7tZnYpHeCEZdscEEyhb2M4rHb58RyD&limit=2" | jq '.'
525
518
{
526
519
"data": [
527
520
{
@@ -654,7 +647,7 @@ For example, for a GAMetaTx with inner SpendTx, one might request with the follo
654
647
655
648
with provided transaction type (` name_transfer ` ):
656
649
```
657
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? name_transfer.recipient_id=ak_idkx6m3bgRr7WiKXuB8EBYBoRqVsaSc6qo4dsd23HKgj3qiCF&limit=1" | jq '.'
650
+ $ curl -s "https://mainnet.aeternity.io/mdw/txs?direction=forward& name_transfer.recipient_id=ak_idkx6m3bgRr7WiKXuB8EBYBoRqVsaSc6qo4dsd23HKgj3qiCF&limit=1" | jq '.'
658
651
{
659
652
"data": [
660
653
{
@@ -685,7 +678,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward?name_transfer.recipient_
685
678
686
679
freestanding field ` from_id ` , and via ` jq ` extracting only tx_index and transaction type:
687
680
```
688
- curl -s "https://mainnet.aeternity.io/mdw/txs/backward ?from_id=ak_ozzwBYeatmuN818LjDDDwRSiBSvrqt4WU7WvbGsZGVre72LTS&limit=5" | jq '.data | .[] | [.tx_index, .tx.type]'
681
+ curl -s "https://mainnet.aeternity.io/mdw/v2/txs ?from_id=ak_ozzwBYeatmuN818LjDDDwRSiBSvrqt4WU7WvbGsZGVre72LTS&limit=5" | jq '.data | .[] | [.tx_index, .tx.type]'
689
682
[
690
683
98535,
691
684
"ChannelForceProgressTx"
@@ -733,7 +726,7 @@ retrieve a new page of results.
733
726
734
727
getting the first transaction:
735
728
```
736
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? account=ak_E64bTuWTVj9Hu5EQSgyTGZp27diFKohTQWw3AYnmgVSWCnfnD&limit=1" | jq '.'
729
+ $ curl -s "https://mainnet.aeternity.io/mdw/v2/txs?direction=forward& account=ak_E64bTuWTVj9Hu5EQSgyTGZp27diFKohTQWw3AYnmgVSWCnfnD&limit=1" | jq '.'
737
730
{
738
731
"data": [
739
732
{
@@ -765,7 +758,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward?account=ak_E64bTuWTVj9Hu
765
758
766
759
getting the next transaction by prepending host (https://mainnet.aeternity.io/mdw ) to the continuation-URL from last request:
767
760
```
768
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? account=ak_E64bTuWTVj9Hu5EQSgyTGZp27diFKohTQWw3AYnmgVSWCnfnD&cursor=1779354&limit=1" | jq '.'
761
+ $ curl -s "https://mainnet.aeternity.io/mdw/v2/txs?direction=forward& account=ak_E64bTuWTVj9Hu5EQSgyTGZp27diFKohTQWw3AYnmgVSWCnfnD&cursor=1779354&limit=1" | jq '.'
769
762
{
770
763
"data": [
771
764
{
@@ -811,7 +804,7 @@ If `type` or `type_group` is provided, the transaction in the result set must be
811
804
812
805
transactions where each transaction contains both accounts, no matter at which field:
813
806
```
814
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/backward ?account=ak_24jcHLTZQfsou7NvomRJ1hKEnjyNqbYSq2Az7DmyrAyUHPq8uR&account=ak_zUQikTiUMNxfKwuAfQVMPkaxdPsXP8uAxnfn6TkZKZCtmRcUD&limit=1" | jq '.'
807
+ $ curl -s "https://mainnet.aeternity.io/mdw/v2/txs ?account=ak_24jcHLTZQfsou7NvomRJ1hKEnjyNqbYSq2Az7DmyrAyUHPq8uR&account=ak_zUQikTiUMNxfKwuAfQVMPkaxdPsXP8uAxnfn6TkZKZCtmRcUD&limit=1" | jq '.'
815
808
{
816
809
"data": [
817
810
{
@@ -844,7 +837,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/txs/backward?account=ak_24jcHLTZQfso
844
837
845
838
spend transactions between sender and recipient (transaction type = spend is deduced from the fields):
846
839
```
847
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? sender_id=ak_26dopN3U2zgfJG4Ao4J4ZvLTf5mqr7WAgLAq6WxjxuSapZhQg5&recipient_id=ak_r7wvMxmhnJ3cMp75D8DUnxNiAvXs8qcdfbJ1gUWfH8Ufrx2A2&limit=1" | jq '.'
840
+ $ curl -s "https://mainnet.aeternity.io/mdw/v2/txs?direction=forward& sender_id=ak_26dopN3U2zgfJG4Ao4J4ZvLTf5mqr7WAgLAq6WxjxuSapZhQg5&recipient_id=ak_r7wvMxmhnJ3cMp75D8DUnxNiAvXs8qcdfbJ1gUWfH8Ufrx2A2&limit=1" | jq '.'
848
841
{
849
842
"data": [
850
843
{
@@ -876,7 +869,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward?sender_id=ak_26dopN3U2zg
876
869
877
870
name related transactions for account:
878
871
```
879
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/forward? account=ak_E64bTuWTVj9Hu5EQSgyTGZp27diFKohTQWw3AYnmgVSWCnfnD&type_group=name" | jq '.'
872
+ $ curl -s "https://mainnet.aeternity.io/mdw/v2/txs?direction=forward& account=ak_E64bTuWTVj9Hu5EQSgyTGZp27diFKohTQWw3AYnmgVSWCnfnD&type_group=name" | jq '.'
880
873
{
881
874
"data": [
882
875
{
@@ -1184,14 +1177,14 @@ $ curl -s "https://mainnet.aeternity.io/mdw/txi/10000000" | jq '.'
1184
1177
#### All transactions
1185
1178
1186
1179
```
1187
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/count" | jq '.'
1180
+ $ curl -s "https://mainnet.aeternity.io/mdw/v2/ txs/count" | jq '.'
1188
1181
11921825
1189
1182
```
1190
1183
1191
1184
#### Transactions by type/field for ID
1192
1185
1193
1186
```
1194
- $ curl -s "https://mainnet.aeternity.io/mdw/txs/count/ak_24jcHLTZQfsou7NvomRJ1hKEnjyNqbYSq2Az7DmyrAyUHPq8uR" | jq '.'
1187
+ $ curl -s "https://mainnet.aeternity.io/mdw/v2/ txs/count/ak_24jcHLTZQfsou7NvomRJ1hKEnjyNqbYSq2Az7DmyrAyUHPq8uR" | jq '.'
1195
1188
{
1196
1189
"channel_create_tx": {
1197
1190
"responder_id": 74
@@ -3579,11 +3572,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/oracle/ok_R7cQfVN15F5ek1wBSYaMRjW2Xb
3579
3572
3580
3573
### Listing oracles
3581
3574
3582
- There are 3 paginable endpoints for listing oracles:
3583
-
3584
- - `/oracles` - for listing ALL oracles (`active` and `inactive`)
3585
- - `/oracles/inactive` - for listing `inactive` oracles (expired)
3586
- - `/oracles/active` - for listing `active` oracles
3575
+ There is only one paginable endpoints for listing oracles: `/v2/oracles` - for listing oracles, with filters that include the `scope` (e.g. `gen:100-200`) or state (`active` or `inactive`).
3587
3576
3588
3577
They are ordered by expiration height and support parameter `direction` (with options `forward` and `backward`).
3589
3578
@@ -3668,7 +3657,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/oracles?direction=forward&limit=1&ex
3668
3657
#### Inactive oracles
3669
3658
3670
3659
```
3671
- $ curl -s "https://mainnet.aeternity.io/mdw/oracles/inactive? limit=1 " | jq '.'
3660
+ $ curl -s "https://mainnet.aeternity.io/mdw/v2/oracles?state=inactive& limit=1 " | jq '.'
3672
3661
{
3673
3662
"data": [
3674
3663
{
@@ -3685,15 +3674,15 @@ $ curl -s "https://mainnet.aeternity.io/mdw/oracles/inactive?limit=1" | jq '.'
3685
3674
"register": 15198855
3686
3675
}
3687
3676
] ,
3688
- "next": "/oracles/inactive? cursor=507223-ok_26QSujxMBhg67YhbgvjQvsFfGdBrK9ddG4rENEGUq2EdsyfMTC&direction=backward&expand=false&limit=1",
3677
+ "next": "/v2/oracles?state=inactive& cursor=507223-ok_26QSujxMBhg67YhbgvjQvsFfGdBrK9ddG4rENEGUq2EdsyfMTC&direction=backward&expand=false&limit=1",
3689
3678
"prev": null
3690
3679
}
3691
3680
```
3692
3681
3693
3682
#### Active oracles
3694
3683
3695
3684
```
3696
- $ curl -s "https://mainnet.aeternity.io/mdw/oracles/active? limit=1&expand " | jq '.'
3685
+ $ curl -s "https://mainnet.aeternity.io/mdw/v2/oracles?state=active& limit=1&expand " | jq '.'
3697
3686
{
3698
3687
"data": [
3699
3688
{
@@ -3737,7 +3726,7 @@ $ curl -s "https://mainnet.aeternity.io/mdw/oracles/active?limit=1&expand" | jq
3737
3726
}
3738
3727
}
3739
3728
] ,
3740
- "next": "/oracles/active? cursor=1289003-ok_f9vDQvr1cFAQAesYA16vjvBX9TFeWUB4Gb7WJkwfYSkL1CpDx&direction=backward&expand=true&limit=1",
3729
+ "next": "/v2/oracles?state=active& cursor=1289003-ok_f9vDQvr1cFAQAesYA16vjvBX9TFeWUB4Gb7WJkwfYSkL1CpDx&direction=backward&expand=true&limit=1",
3741
3730
"prev": null
3742
3731
}
3743
3732
```
@@ -4264,6 +4253,7 @@ This is a list of the exceptions together with the changes that need to be done:
4264
4253
* `/names/auctions` - Can now be accessed via `/v2/names/auctions`
4265
4254
* `/names/auctions/:scope_type/:range` - Can now be accessed via `/v2/auctions?scope=gen:10-100` (or `?scope=txi:1000-2000`).
4266
4255
* `/names/search/:prefix` - The prefix is no longer part of the path, but a query parameter instead (`?prefix=...`).
4256
+ * `/oracles/:state/:scope_scope/:range`, `/oracles/:scope_scope/:range` - Can now all be accessed via `/v2/oracles?state=inactive&scope=gen:100-200`.
4267
4257
4268
4258
## Websocket interface
4269
4259
0 commit comments