Skip to content

Commit

Permalink
[docs] add error response for getBlockTime RPC call (#31653)
Browse files Browse the repository at this point in the history
Co-authored-by: Callum McIntyre <[email protected]>
  • Loading branch information
mcintyre94 and mcintyre94 authored May 16, 2023
1 parent 7c6478d commit 6c1cdb5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/src/api/methods/_getBlockTime.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ in a set of recent blocks recorded on the ledger.
### Result:

- `<i64>` - estimated production time, as Unix timestamp (seconds since the Unix epoch)
- `<null>` - timestamp is not available for this block

</CodeParams>

Expand All @@ -54,6 +53,8 @@ curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '

### Response:

When a block time is available:

```json
{
"jsonrpc": "2.0",
Expand All @@ -62,6 +63,19 @@ curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
}
```

When a block time is not available:

```json
{
"jsonrpc": "2.0",
"error": {
"code": -32004,
"message": "Block not available for slot 150"
},
"id": 1
}
```

</CodeSnippets>
</DocSideBySide>
</DocBlock>

0 comments on commit 6c1cdb5

Please sign in to comment.