Skip to content

Commit fad05d6

Browse files
committed
update openapi specs
1 parent 2493ed1 commit fad05d6

10 files changed

+1563
-288
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"description": "Standard API error response",
4+
"title": "ApiError",
5+
"type": "object",
6+
"properties": {
7+
"error": {
8+
"type": "string",
9+
"description": "Error message describing what went wrong"
10+
}
11+
},
12+
"required": [
13+
"error"
14+
]
15+
}

docs/rpc/api/core-node/get-clarity-marf-value.schema.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"description": "Response of get Clarity MARF value request",
44
"title": "ClarityMARFValueResponse",
55
"type": "object",
6-
"required": ["data"],
6+
"required": [
7+
"data"
8+
],
79
"properties": {
810
"data": {
911
"type": "string",
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"description": "Single sortition information response",
4+
"title": "SingleSortitionResponse",
5+
"type": "array",
6+
"minItems": 1,
7+
"maxItems": 1,
8+
"items": {
9+
"$ref": "#/definitions/SortitionInfo"
10+
},
11+
"definitions": {
12+
"SortitionInfo": {
13+
"type": "object",
14+
"description": "Information about a burnchain sortition event",
15+
"properties": {
16+
"burn_block_hash": {
17+
"type": "string",
18+
"description": "The burnchain header hash of the block that triggered this event",
19+
"pattern": "^0x[0-9a-f]{64}$"
20+
},
21+
"burn_block_height": {
22+
"type": "integer",
23+
"description": "The burn height of the block that triggered this event",
24+
"minimum": 0
25+
},
26+
"burn_header_timestamp": {
27+
"type": "integer",
28+
"description": "The burn block time of the sortition (Unix timestamp)",
29+
"minimum": 0
30+
},
31+
"sortition_id": {
32+
"type": "string",
33+
"description": "This sortition ID of the block that triggered this event",
34+
"pattern": "^0x[0-9a-f]{64}$"
35+
},
36+
"parent_sortition_id": {
37+
"type": "string",
38+
"description": "The parent of this burn block's Sortition ID",
39+
"pattern": "^0x[0-9a-f]{64}$"
40+
},
41+
"consensus_hash": {
42+
"type": "string",
43+
"description": "The consensus hash of the block that triggered this event",
44+
"pattern": "^0x[0-9a-f]{40}$"
45+
},
46+
"was_sortition": {
47+
"type": "boolean",
48+
"description": "Boolean indicating whether or not there was a successful sortition"
49+
},
50+
"miner_pk_hash160": {
51+
"type": [
52+
"string",
53+
"null"
54+
],
55+
"description": "Hash160 of the mining key if available",
56+
"pattern": "^0x[0-9a-f]{40}$"
57+
},
58+
"stacks_parent_ch": {
59+
"type": [
60+
"string",
61+
"null"
62+
],
63+
"description": "Consensus hash of the parent tenure",
64+
"pattern": "^0x[0-9a-f]{40}$"
65+
},
66+
"last_sortition_ch": {
67+
"type": [
68+
"string",
69+
"null"
70+
],
71+
"description": "Consensus hash of the most recent sortition",
72+
"pattern": "^0x[0-9a-f]{40}$"
73+
},
74+
"committed_block_hash": {
75+
"type": [
76+
"string",
77+
"null"
78+
],
79+
"description": "The committed block hash",
80+
"pattern": "^0x[0-9a-f]{64}$"
81+
},
82+
"vrf_seed": {
83+
"type": [
84+
"string",
85+
"null"
86+
],
87+
"description": "VRF seed generated by this sortition",
88+
"pattern": "^0x[0-9a-f]{64}$"
89+
}
90+
},
91+
"required": [
92+
"burn_block_hash",
93+
"burn_block_height",
94+
"burn_header_timestamp",
95+
"sortition_id",
96+
"parent_sortition_id",
97+
"consensus_hash",
98+
"was_sortition"
99+
]
100+
}
101+
}
102+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"description": "Array of sortition information objects from the burnchain",
4+
"title": "SortitionsResponse",
5+
"type": "array",
6+
"minItems": 1,
7+
"maxItems": 2,
8+
"items": {
9+
"type": "object",
10+
"description": "Information about a burnchain sortition event",
11+
"properties": {
12+
"burn_block_hash": {
13+
"type": "string",
14+
"description": "The burnchain header hash of the block that triggered this event",
15+
"pattern": "^0x[0-9a-f]{64}$"
16+
},
17+
"burn_block_height": {
18+
"type": "integer",
19+
"description": "The burn height of the block that triggered this event",
20+
"minimum": 0
21+
},
22+
"burn_header_timestamp": {
23+
"type": "integer",
24+
"description": "The burn block time of the sortition (Unix timestamp)",
25+
"minimum": 0
26+
},
27+
"sortition_id": {
28+
"type": "string",
29+
"description": "This sortition ID of the block that triggered this event. This incorporates PoX forking information and the burn block hash to obtain an identifier that is unique across PoX forks and burnchain forks.",
30+
"pattern": "^0x[0-9a-f]{64}$"
31+
},
32+
"parent_sortition_id": {
33+
"type": "string",
34+
"description": "The parent of this burn block's Sortition ID",
35+
"pattern": "^0x[0-9a-f]{64}$"
36+
},
37+
"consensus_hash": {
38+
"type": "string",
39+
"description": "The consensus hash of the block that triggered this event. This incorporates PoX forking information and burn op information to obtain an identifier that is unique across PoX forks and burnchain forks.",
40+
"pattern": "^0x[0-9a-f]{40}$"
41+
},
42+
"was_sortition": {
43+
"type": "boolean",
44+
"description": "Boolean indicating whether or not there was a successful sortition (i.e. a winning block or miner was chosen). This will also be true if this sortition corresponds to a shadow block."
45+
},
46+
"miner_pk_hash160": {
47+
"type": [
48+
"string",
49+
"null"
50+
],
51+
"description": "If sortition occurred, and the miner's VRF key registration associated a nakamoto mining pubkey with their commit, this will contain the Hash160 of that mining key.",
52+
"pattern": "^0x[0-9a-f]{40}$"
53+
},
54+
"stacks_parent_ch": {
55+
"type": [
56+
"string",
57+
"null"
58+
],
59+
"description": "If sortition occurred, this will be the consensus hash of the burn block corresponding to the winning block commit's parent block ptr. In 3.x, this is the consensus hash of the tenure that this new burn block's miner will be building off of.",
60+
"pattern": "^0x[0-9a-f]{40}$"
61+
},
62+
"last_sortition_ch": {
63+
"type": [
64+
"string",
65+
"null"
66+
],
67+
"description": "If sortition occurred, this will be the consensus hash of the most recent sortition before this one.",
68+
"pattern": "^0x[0-9a-f]{40}$"
69+
},
70+
"committed_block_hash": {
71+
"type": [
72+
"string",
73+
"null"
74+
],
75+
"description": "In Stacks 2.x, this is the winning block. In Stacks 3.x, this is the first block of the parent tenure.",
76+
"pattern": "^0x[0-9a-f]{64}$"
77+
},
78+
"vrf_seed": {
79+
"type": [
80+
"string",
81+
"null"
82+
],
83+
"description": "This is the VRF seed generated by this sortition",
84+
"pattern": "^0x[0-9a-f]{64}$"
85+
}
86+
},
87+
"required": [
88+
"burn_block_hash",
89+
"burn_block_height",
90+
"burn_header_timestamp",
91+
"sortition_id",
92+
"parent_sortition_id",
93+
"consensus_hash",
94+
"was_sortition"
95+
]
96+
}
97+
}

0 commit comments

Comments
 (0)