From 6c1cdb57c61cfa1d64e7e8cc25f09aef1397603a Mon Sep 17 00:00:00 2001 From: Callum McIntyre Date: Tue, 16 May 2023 23:02:24 +0100 Subject: [PATCH] [docs] add error response for getBlockTime RPC call (#31653) Co-authored-by: Callum McIntyre --- docs/src/api/methods/_getBlockTime.mdx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/src/api/methods/_getBlockTime.mdx b/docs/src/api/methods/_getBlockTime.mdx index 50ef1de6fb4699..7fc991b5b8690e 100644 --- a/docs/src/api/methods/_getBlockTime.mdx +++ b/docs/src/api/methods/_getBlockTime.mdx @@ -34,7 +34,6 @@ in a set of recent blocks recorded on the ledger. ### Result: - `` - estimated production time, as Unix timestamp (seconds since the Unix epoch) -- `` - timestamp is not available for this block @@ -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", @@ -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 +} +``` +