From 353d1ece51737eff12e4f4c7e636842032d0c1f0 Mon Sep 17 00:00:00 2001 From: LordGhostX Date: Fri, 17 May 2024 16:25:18 +0100 Subject: [PATCH] add supported API versions --- docs/docs/json-rpc.md | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/docs/docs/json-rpc.md b/docs/docs/json-rpc.md index 465a5b15fb..51bb4b89da 100644 --- a/docs/docs/json-rpc.md +++ b/docs/docs/json-rpc.md @@ -194,3 +194,57 @@ async fn main() { + +## Supported Starknet API versions + +Juno supports the following Starknet API versions: + +- **v0.7.0**: Accessible via endpoints `/v0_7`, `/rpc/v0_7`, or the default `/` +- **v0.6.0**: Accessible via endpoints `/v0_6` or `/rpc/v0_6` + +To use a specific API version, specify the version endpoint in your RPC calls: + + + + +```bash +curl --location 'http://localhost:6060' \ +--header 'Content-Type: application/json' \ +--data '{ + "jsonrpc": "2.0", + "method": "starknet_chainId", + "params": [], + "id": 1 +}' +``` + + + + +```bash +curl --location 'http://localhost:6060/v0_7' \ +--header 'Content-Type: application/json' \ +--data '{ + "jsonrpc": "2.0", + "method": "starknet_chainId", + "params": [], + "id": 1 +}' +``` + + + + +```bash +curl --location 'http://localhost:6060/v0_6' \ +--header 'Content-Type: application/json' \ +--data '{ + "jsonrpc": "2.0", + "method": "starknet_chainId", + "params": [], + "id": 1 +}' +``` + + +