We provide access to the Cardano blockchain with the Rosetta API:
Rosetta is an open-source specification and set of tools for blockchain integration. Rosetta’s goal is to make blockchain integration simpler, faster, and more reliable than using a native integration.
More info about Rosetta API: https://www.rosetta-api.org/docs/getting_started.html
Cardano offers a slightly modified version of the Rosetta API spec with their cardano-rosetta implementation.
All the changes they made are documented here: cardano-rosetta/docs/rosetta-custom-definitions.md
Making requests
You can choose between 3 blockchains: mainnet, pre-prod and preview
Endpoint | Network |
---|---|
rpc.chain49.com/cardano/ | Mainnet |
rpc.chain49.com/cardano-preprod/ | Pre-Prod (Testnet) |
rpc.chain49.com/cardano-preview/ | Preview (Testnet) |
In addition to specifying the blockchain in the URL, you also have to specify the blockchain again within the request body as shown in the examples below. These values have to be the same, otherwise the request will fail.
C49_API_KEY=INSERT_YOUR_KEY_HERE
# Mainnet
curl -X POST 'https://rpc.chain49.com/cardano/network/status' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: '$C49_API_KEY \
-d '{
"network_identifier": {
"blockchain": "cardano",
"network": "mainnet"
},
"metadata": {}
}'
# Preview
curl -X POST 'https://rpc.chain49.com/cardano-preview/network/status' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: '$C49_API_KEY \
-d '{
"network_identifier": {
"blockchain": "cardano",
"network": "preview"
},
"metadata": {}
}'
Error responses
Rosetta API does not rely on HTTP status codes and instead always returns a 500 status code for any kind of error. This does not mean that there was actually an internal server error. More info about error responses in the Rosetta spec can be found here: https://www.rosetta-api.org/docs/models/Error.html#properties