Sample cardano-rosetta queries
Network
This endpoint returns a list of network identifiers that the Rosetta server supports.
curl -X POST http://localhost:8080/network/list \
-H "Content-Type: application/json" \
-d '{"metadata": {}}'
This endpoint returns the version information and allowed network-specific types for a NetworkIdentifier. Any NetworkIdentifier returned by /network/list should be accessible here.
curl -X POST http://localhost:8080/network/options \
-H "Content-Type: application/json" \
-d '{ "network_identifier": {
"blockchain": "cardano",
"network": "testnet" },
"metadata": {}}'
This endpoint returns the current status of the network requested. Any NetworkIdentifier returned by /network/list should be accessible here.
curl -X POST http://localhost:8080/network/status \
-H "Content-Type: application/json" \
-d '{ "network_identifier": {
"blockchain": "cardano", "network": "testnet" },
"metadata": {} }'
Account
Account endpoints are used to fetch the state of an account (identified by a network-specific identifier).
Get an array of all AccountBalances for an AccountIdentifier and the BlockIdentifier at which the balance lookup was performed.
curl -X POST http://localhost:8080/account/balance \
-H "Content-Type: application/json" \
-d '{ "network_identifier": {
"blockchain": "cardano", "network": "mainnet" },
"metadata": {},
"account_identifier": { "address": "DdzFFzCqrhsqKd92VGNM9Ts1Ms62J2FaSRmf8t1bQa1VugDmcUJzeU8TRFnGDDUR6f1m9VaJJG1GfnzxVjKGBbBAVGT9sPBseREYzP3E" },
"metadata": {},
"block_identifier": {"index": "5264122","hash": "b5426334221805b3c161ec07b02722728ced7b5c38a9cc60962e819620ecbf9a" },"currencies": {"symbol": "ada", "decimals": 8 }}' | jq
Block
Block endpoints are used to access any data stored in a block. It is critical that these Endpoints can be used to fetch all balance-changing operations in a block.
curl -X POST http://localhost:8080/block \
-H "Content-Type: application/json" \
-d '{ "network_identifier": {
"blockchain": "cardano",
"network": "mainnet" },
"metadata": {},
"block_identifier": {
"index": "5264122" }}'
Get a transaction in a block by its Transaction Identifier.
curl -X POST http://localhost:8080/block/transaction \
-H "Content-Type: application/json" \
-d '{ "network_identifier": {
"blockchain": "cardano", "network": "mainnet" },
"metadata": {},
"block_identifier": { "index": "5264122", "hash": "b5426334221805b3c161ec07b02722728ced7b5c38a9cc60962e819620ecbf9a" },
"transaction_identifier": { "hash": "2d3d33d26c87d3e8ef0bc6cb25be3fb34f4db43bf23d7c624955a82cd8815772"}}'