Skip to content

Commit b396798

Browse files
committed
add /v3/sortitions to openapi.yaml
1 parent 77c1036 commit b396798

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[
2+
{
3+
"burn_block_hash": "0x046f54cd1924a5d80fc3b8186d0334b7521acae90f9e136e2bee680c720d0e83",
4+
"burn_block_height": 231,
5+
"burn_header_timestamp": 1726797570,
6+
"sortition_id": "0x8a5116b7b4306dc4f6db290d1adfff9e1347f3e921bb793fc4c33e2ff05056e2",
7+
"parent_sortition_id": "0xdaf479110cf859e58c56b6ae941f8a14e7c7992c57027183dfbda4a4b820897c",
8+
"consensus_hash": "0x8d2c51db737597a93191f49bcdc9c7bb44b90892",
9+
"was_sortition": true,
10+
"miner_pk_hash160": "0x6bc51b33e9f3626944eb879147e18111581f8f9b",
11+
"stacks_parent_ch": "0x697357c72da55b759b1d6b721676c92c69f0b490",
12+
"last_sortition_ch": "0x697357c72da55b759b1d6b721676c92c69f0b490",
13+
"committed_block_hash": "0xeea47d6d639c565027110e192e308fb11656183d5c077bcd718d830652800183"
14+
}
15+
]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[
2+
{
3+
"burn_block_hash": "0x046f54cd1924a5d80fc3b8186d0334b7521acae90f9e136e2bee680c720d0e83",
4+
"burn_block_height": 231,
5+
"burn_header_timestamp": 1726797570,
6+
"sortition_id": "0x8a5116b7b4306dc4f6db290d1adfff9e1347f3e921bb793fc4c33e2ff05056e2",
7+
"parent_sortition_id": "0xdaf479110cf859e58c56b6ae941f8a14e7c7992c57027183dfbda4a4b820897c",
8+
"consensus_hash": "0x8d2c51db737597a93191f49bcdc9c7bb44b90892",
9+
"was_sortition": true,
10+
"miner_pk_hash160": "0x6bc51b33e9f3626944eb879147e18111581f8f9b",
11+
"stacks_parent_ch": "0x697357c72da55b759b1d6b721676c92c69f0b490",
12+
"last_sortition_ch": "0x697357c72da55b759b1d6b721676c92c69f0b490",
13+
"committed_block_hash": "0xeea47d6d639c565027110e192e308fb11656183d5c077bcd718d830652800183"
14+
},
15+
{
16+
"burn_block_hash": "0x496ff02cb63a4850d0bdee5fab69284b6eb0392b4538e1c462f82362c5becfa4",
17+
"burn_block_height": 230,
18+
"burn_header_timestamp": 1726797570,
19+
"sortition_id": "0xdaf479110cf859e58c56b6ae941f8a14e7c7992c57027183dfbda4a4b820897c",
20+
"parent_sortition_id": "0xf9058692055cbd879d7f71e566e44b905a887b2b182407ed596b5d6499ceae2a",
21+
"consensus_hash": "0x697357c72da55b759b1d6b721676c92c69f0b490",
22+
"was_sortition": true,
23+
"miner_pk_hash160": "0x6bc51b33e9f3626944eb879147e18111581f8f9b",
24+
"stacks_parent_ch": "0xf7d1bd7d9d5c5a5c368402b6ef9510bd014d70f7",
25+
"last_sortition_ch": "0xf7d1bd7d9d5c5a5c368402b6ef9510bd014d70f7",
26+
"committed_block_hash": "0x36ee5f7f7271de1c1d4cd830e36320b51e01605547621267ae6e9b4e9b10f95e"
27+
}
28+
]

docs/rpc/openapi.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,3 +675,43 @@ paths:
675675
schema:
676676
type: string
677677

678+
/v3/sortitions/{lookup_kind}/{lookup}:
679+
get:
680+
summary: Fetch information about evaluated burnchain blocks (i.e., sortitions).
681+
tags:
682+
- Blocks
683+
operationId: get_sortitions
684+
description:
685+
Fetch sortition information about a burnchain block. If the `lookup_kind` and `lookup` parameters are empty, it will return information about the latest burn block.
686+
responses:
687+
"200":
688+
description: Information for the given reward cycle
689+
content:
690+
application/json:
691+
example:
692+
$ref: ./api/core-node/get_sortitions.example.json
693+
"200":
694+
description: Sortition information about the latest burn block with a winning miner, and the previous such burn block.
695+
content:
696+
application/json:
697+
example:
698+
$ref: ./api/core-node/get_sortitions_latest_and_prior.example.json
699+
parameters:
700+
- name: lookup_kind
701+
in: path
702+
description: |-
703+
The style of lookup that should be performed. If not given, the most recent burn block processed will be returned.
704+
Otherwise, the `lookup_kind` should be one of the following strings:
705+
* `consensus` - find the burn block using the consensus hash supplied in the `lookup` field.
706+
* `burn_height` - find the burn block using the burn block height supplied in the `lookup` field.
707+
* `burn` - find the burn block using the burn block hash supplied in the `lookup` field.
708+
* `latest_and_last` - return information about the latest burn block with a winning miner *and* the previous such burn block
709+
required: false
710+
schema:
711+
type: string
712+
- name: lookup
713+
in: path
714+
description: The value to use for the lookup if `lookup_kind` is `consensus`, `burn_height`, or `burn`
715+
required: false
716+
schema:
717+
type: string

0 commit comments

Comments
 (0)