-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #804 from hirosystems/feat/add-platform-get-chainh…
…ook-status feat: add get platform chainhook status
- Loading branch information
Showing
2 changed files
with
173 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
"pages": [ | ||
"list", | ||
"get", | ||
"status", | ||
"create", | ||
"update", | ||
"delete" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
--- | ||
title: Get a chainhook status | ||
description: Retrieve the status of a specific chainhook through the Hiro Platform. | ||
toc: false | ||
--- | ||
|
||
import { | ||
API, | ||
APIExample, | ||
APIInfo, | ||
APIPlayground, | ||
ExampleResponse, | ||
Property, | ||
Request, | ||
Requests, | ||
Response, | ||
Responses, | ||
ResponseTypes, | ||
Root, | ||
TypeScriptResponse | ||
} from 'fumadocs-openapi/ui'; | ||
|
||
<Root baseUrl="https://api.platform.hiro.so"> | ||
|
||
<API> | ||
|
||
<APIInfo method={"GET"} route={"/v1/ext/{apiKey}/chainhooks/{chainhookUuid}/status"}> | ||
|
||
## Retrieve a chainhook status | ||
|
||
### Path Parameters | ||
|
||
<Property name={"apiKey"} type={"string"} required={true} deprecated={false}> | ||
|
||
Hiro API key | ||
|
||
<span>Pattern: `"0941f307fd270ace19a5bfed67fbd3bc"`</span> | ||
|
||
</Property> | ||
|
||
<Property name={"chainhookUuid"} type={"string"} required={true} deprecated={false}> | ||
|
||
Chainhook UUID | ||
|
||
<span>Pattern: `"aa3626dc-2090-49cd-8f1e-8f9994393aed"`</span> | ||
|
||
</Property> | ||
|
||
| Status code | Description | | ||
| :----------- | :----------- | | ||
| `200` | Successfully retrieved chainhook status | | ||
| `404` | Chainhook not found | | ||
|
||
<APIPlayground authorization={undefined} method={"GET"} route={"/v1/ext/{apiKey}/chainhooks/{chainhookUuid}/status"} path={[{"name":"apiKey","type":"string","defaultValue":"","isRequired":true},{"name":"chainhookUuid","type":"string","defaultValue":"","isRequired":true}]} query={[]} header={[]} body={undefined} schemas={{}}> | ||
|
||
</APIPlayground> | ||
|
||
</APIInfo> | ||
|
||
<APIExample> | ||
|
||
<Requests items={["cURL","JavaScript"]}> | ||
|
||
<Request value={"cURL"}> | ||
|
||
```bash | ||
curl -X GET "https://api.platform.hiro.so/v1/ext/{apiKey}/chainhooks/{chainhookUuid}/status" | ||
``` | ||
|
||
</Request> | ||
|
||
<Request value={"JavaScript"}> | ||
|
||
```js | ||
fetch("https://api.platform.hiro.so/v1/ext/{apiKey}/chainhooks/{chainhookUuid}/status", { | ||
method: "GET" | ||
}); | ||
``` | ||
|
||
</Request> | ||
|
||
</Requests> | ||
|
||
<Responses items={["200","404"]}> | ||
|
||
<Response value={"200"}> | ||
|
||
<ResponseTypes> | ||
|
||
<ExampleResponse> | ||
|
||
```json | ||
{ | ||
"status": { | ||
"info": { | ||
"expired_at_block_height": 162515, | ||
"last_evaluated_block_height": 162515, | ||
"last_occurrence": 1724075618, | ||
"number_of_blocks_evaluated": 4, | ||
"number_of_times_triggered": 3 | ||
}, | ||
"type": "confirmed_expiration" | ||
}, | ||
"enabled": false | ||
} | ||
``` | ||
|
||
</ExampleResponse> | ||
|
||
<TypeScriptResponse> | ||
|
||
```ts | ||
export interface Response { | ||
status: { | ||
info: { | ||
expired_at_block_height: number; | ||
last_evaluated_block_height: number; | ||
last_occurrence: number; | ||
number_of_blocks_evaluated: number; | ||
number_of_times_triggered: number; | ||
}; | ||
type: string; | ||
}; | ||
enabled: boolean; | ||
} | ||
``` | ||
|
||
</TypeScriptResponse> | ||
|
||
</ResponseTypes> | ||
|
||
</Response> | ||
|
||
<Response value={"404"}> | ||
|
||
<ResponseTypes> | ||
|
||
<ExampleResponse> | ||
|
||
```json | ||
{ | ||
"status": "string", | ||
"message": "string", | ||
"error": null | ||
} | ||
``` | ||
|
||
</ExampleResponse> | ||
|
||
<TypeScriptResponse> | ||
|
||
```ts | ||
export interface Response { | ||
status: string; | ||
message?: string; | ||
error?: unknown; | ||
} | ||
``` | ||
|
||
</TypeScriptResponse> | ||
|
||
</ResponseTypes> | ||
|
||
</Response> | ||
|
||
</Responses> | ||
|
||
</APIExample> | ||
|
||
</API> | ||
|
||
</Root> |