Skip to content

Commit

Permalink
v1.14: [docs] add error response for getBlockTime RPC call (backport of
Browse files Browse the repository at this point in the history
#31653) (#31681)

[docs] add error response for getBlockTime RPC call (#31653)

Co-authored-by: Callum McIntyre <callum.mcintyre@solana.com>
(cherry picked from commit 6c1cdb5)

Co-authored-by: Callum McIntyre <mcintyre1994@gmail.com>
  • Loading branch information
mergify[bot] and mcintyre94 committed May 17, 2023
1 parent a210e05 commit e54bd6d
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 e54bd6d

Please sign in to comment.