Skip to content

Commit

Permalink
Merge pull request #804 from hirosystems/feat/add-platform-get-chainh…
Browse files Browse the repository at this point in the history
…ook-status

feat: add get platform chainhook status
  • Loading branch information
ryanwaits authored Dec 4, 2024
2 parents 645fcb0 + 5cb2608 commit 5d9c668
Show file tree
Hide file tree
Showing 2 changed files with 173 additions and 0 deletions.
1 change: 1 addition & 0 deletions content/docs/stacks/platform-api/chainhooks/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"pages": [
"list",
"get",
"status",
"create",
"update",
"delete"
Expand Down
172 changes: 172 additions & 0 deletions content/docs/stacks/platform-api/chainhooks/status.mdx
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>

0 comments on commit 5d9c668

Please sign in to comment.