For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

TAC — Information, Transactions, ABCI, Cosmos REST methods (2/2)

API reference for TAC. All methods ->

Part 2 of 2: 1 · 2

Information​

consensus_state​

Retrieves consensus state.

Not safe to call from inside the ABCI application during a block execution.

Parameters​


None.

Returns​

Consensus state results.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "consensus_state",
"params": [],
"id": 1
}'

Response example​

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"round_state": {
"height/round/step": "2130789/0/1",
"start_time": "2025-01-31T10:00:45.687676388Z",
"proposal_block_hash": "",
"locked_block_hash": "",
"valid_block_hash": "",
"height_vote_set": [
{
"round": 0,
"prevotes": [
"nil-Vote",
"nil-Vote",
"nil-Vote",
"nil-Vote"
],
"prevotes_bit_array": "BA{4:____} 0/40066000000000400 = 0.00",
"precommits": [
"nil-Vote",
"nil-Vote",
"nil-Vote",
"nil-Vote"
],
"precommits_bit_array": "BA{4:____} 0/40066000000000400 = 0.00"
}
],
"proposer": {
"address": "0469070A1C182AF11A1939F098C5C2C666116561",
"index": 2
}
}
}
}

consensus_params​

Retrieves consensus parameters.

Parameters​


  • height (integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be returned.

Returns​

Consensus parameters results.

Request parameters​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "consensus_params",
"params": ["1"],
"id": 1
}'

Response example​

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"block_height": "1",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "20000000"
},
"evidence": {
"max_age_num_blocks": "100000",
"max_age_duration": "172800000000000",
"max_bytes": "1048576"
},
"validator": {
"pub_key_types": [
"ed25519"
]
},
"version": {
"app": "0"
},
"abci": {
"vote_extensions_enable_height": "0"
}
}
}
}

unconfirmed_txs​

Retrieves the list of unconfirmed transactions.

Parameters​


  • limit (integer; default: 30; max: 100): the maximum number of unconfirmed transactions to return.

Returns​

The list of unconfirmed transactions.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "unconfirmed_txs",
"params": ["1"],
"id": 1
}'

Response example​

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"n_txs": "0",
"total": "0",
"total_bytes": "0",
"txs": []
}
}

num_unconfirmed_txs​

Retrieves data on unconfirmed transactions.

Parameters​


None.

Returns​

The status of unconfirmed transactions.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "num_unconfirmed_txs",
"params": [],
"id": 1
}'

Response example​

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"n_txs": "0",
"total": "0",
"total_bytes": "0",
"txs": null
}
}

Searches for transactions with their results.

Parameters​


  • query (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r()"'=>< are not allowed). operation can be =, <, <=, >, >=, CONTAINS. An operand can be a string (escaped with single quotes), number, date, or time.
  • prove (boolean; default: false): adds proofs of the transactions inclusion in the block.
  • page (integer; default: 1): a page number (1-based).
  • per_page (integer; default: 30, max: 100): a number of entries per page.
  • order_by (string; default: asc): the order in which transactions are sorted (asc or desc), by height & index. If empty, default sorting still applies.
  • match_events (boolean; default: false): match attributes in query within events, in addition to the height and txhash.

Returns​

The list of unconfirmed transactions.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "tx_search",
"params": {
"query": "tx.height=13225811",
"prove": true,
"page": "1",
"per_page": "5",
"order_by": "desc"
},
"id": 1
}'

Response example​

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"txs": [],
"total_count": "0"
}
}

Searches for blocks by BeginBlock and EndBlock events.

Parameters​


  • query (string; required): query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r()"'=>< are not allowed). operation can be =, <, <=, >, >=, CONTAINS. An operand can be a string (escaped with single quotes), number, date, or time.
  • page (integer; default: 1): a page number (1-based).
  • per_page (integer; default: 30, max: 100): a number of entries per page.
  • order_by (string; default: asc): the order in which transactions are sorted (asc or desc), by height & index. If empty, default sorting still applies.
  • match_events (boolean; default: false): match attributes in query within events, in addition to the height.

Returns​

The list of paginated blocks matching the search criteria.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "block_search",
"params": {
"query": "block.height=13225811",
"page": "1",
"per_page": "10",
"order_by": "desc"
},
"id": 1
}'

Response example​

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blocks": [],
"total_count": "0"
}
}

tx​

Retrieves a transaction by hash.

Parameters​


  • hash (string; required): a hash of a transaction to retrieve.
  • prove (boolean; default: false): adds proofs of the transaction's inclusion in the block.

Returns​

Transaction info.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "tx",
"params": ["ys4oH8G8i3TFkq51/8w/ntGD6YcJda1LVNEwh0cjxQ0=", true],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "4B6D8FEA3786BFC6152EAEA791C4DAF00C41E93DAD56A7230B565179CD29CAA1",
"height": "12345",
"index": 2,
"tx_result": {
"code": 0,
"log": "Success",
"events": [
{
"type": "transfer",
"attributes": [
{ "key": "sender", "value": "0g1xyz..." },
{ "key": "recipient", "value": "0g1abc..." },
{ "key": "amount", "value": "10000u0g" }
]
}
]
},
"tx": "BASE64_ENCODED_TX", // The transaction itself in Base64 format
"proof": {
"root_hash": "0xABC123...",
"data": "BASE64_ENCODED_PROOF",
"proof": { /* Detailed proof structure */ }
}
}
}

Transactions​

broadcast_tx_sync​

Returns with the response from CheckTx. Does not wait for DeliverTx result.

If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen:

  1. A malicious node drops or pretends it has committed your tx.
  2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322).

Please refer to Tendermint docs for formatting/encoding rules.

Parameters​


  • tx (string; required): the signed transaction, encoded as Base64.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "broadcast_tx_sync",
"params": ["<BASE64_ENCODED_TRANSACTION>"],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"code": 0,
"data": "",
"log": "transaction successfully broadcasted",
"hash": "0xABC123..." // The transaction hash
}
}

broadcast_tx_async​

Returns right away, with no response. Does not wait for CheckTx nor DeliverTx results.

If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen:

  1. A malicious node drops or pretends it has committed your tx.
  2. A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322).
  3. A node is offline.

Please refer to CometBFT docs for formatting/encoding rules.

Parameters​


  • tx (string; required): the Base64-encoded signed transaction.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "broadcast_tx_async",
"params": ["<BASE64_ENCODED_TRANSACTION>"],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"code": 0,
"data": "",
"log": "",
"hash": "0xABC123..." // Transaction hash
}
}

broadcast_tx_commit​

Returns with the responses from CheckTx and DeliverTx.

warning

Use only for testing and development. In production, use BroadcastTxSync or BroadcastTxAsync. You can subscribe for the transaction result using JSON-RPC via a websocket (see CometBFT docs).

tip

CONTRACT: only returns error if mempool.CheckTx() errs or if we timeout waiting for tx to commit. If CheckTx or DeliverTx fails, no error will be returned, but the result will contain a non-OK ABCI code. Please refer to CometBFT docs for formatting/encoding rules.

Parameters​


  • tx (string; required): the Base64-encoded signed transaction.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "broadcast_tx_commit",
"params": ["<BASE64_ENCODED_TRANSACTION>"],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"check_tx": {
"code": 0,
"data": "",
"log": "Transaction checked successfully"
},
"deliver_tx": {
"code": 0,
"data": "",
"log": "Transaction delivered successfully",
"events": [
{
"type": "transfer",
"attributes": [
{ "key": "sender", "value": "0g1xyz..." },
{ "key": "recipient", "value": "0g1abc..." },
{ "key": "amount", "value": "10000u0g" }
]
}
]
},
"hash": "0xABC123...",
"height": "12345"
}
}

check_tx​

Checks the transaction without executing it.

The transaction won't be added to the mempool.

Please refer to CometBFT docs for formatting/encoding rules.

Parameters​


  • tx (string; required): the Base64-encoded signed transaction.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "check_tx",
"params": ["<BASE64_ENCODED_TRANSACTION>"],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"code": 0,
"data": "",
"log": "Transaction is valid",
"events": [
{
"type": "transfer",
"attributes": [
{ "key": "sender", "value": "0g1xyz..." },
{ "key": "recipient", "value": "0g1abc..." },
{ "key": "amount", "value": "10000u0g" }
]
}
]
}
}

ABCI​

abci_info​

Retrieves application info.

Parameters​


None.

Returns​

Application info.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "abci_info",
"params": [],
"id": 1
}'

Response example​

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"response": {
"data": "TacChainApp",
"version": "0.0.2",
"last_block_height": "2130968",
"last_block_app_hash": "X9pYsyApqs0iou6EgXqqfRrRbHRY9o3i7lbfUr/3DfI="
}
}
}

abci_query​

Queries the application for particular information.

Parameters​


  • path (string; required): a path to the data ("/a/b/c").
  • data (string; required): the hex-encoded data.
  • height (integer; default: 0): the height (0 means latest).
  • prove (boolean; default: false): adds proofs of the transactions inclusion in the block.

Returns​

Particular info according to the query submitted.

Request example​

curl -X POST https://rpc.ankr.com/tac_turin_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "abci_query",
"params": ["a/b/c", "the_data", "1", true],
"id": 1
}'

Response example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"response": {
"code": 0,
"log": "",
"info": "",
"index": -1,
"key": "0x6b61766131387879377a...",
"value": "0x123456789abcdef", // Hex-encoded value
"proofOps": null,
"height": "12345",
"codespace": ""
}
}
}

Cosmos REST methods​

Query:

Service:

Auth methods​

/cosmos/auth/v1beta1/accounts/{address}​

Retrieves account details based on address.

Parameters​

  • address (string; required): an address to query for account details.

Returns​

Account details.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/auth/v1beta1/accounts/{address}

Response example​

{
"account": {
"type_url": "string",
"value": "string"
}
}

/cosmos/auth/v1beta1/params​

Retrieves all parameters.

Parameters​

None.

Returns​

Parameters.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/auth/v1beta1/params

Response example​

{
"params": {
"max_memo_characters": "string",
"tx_sig_limit": "string",
"tx_size_cost_per_byte": "string",
"sig_verify_cost_ed25519": "string",
"sig_verify_cost_secp256k1": "string"
}
}

Bank methods​

/cosmos/bank/v1beta1/balances/{address}​

Retrieves the balance of all coins for a single account.

Parameters​

  • address(string; required): an address to query balances for.
  • pagination.key (string, byte): value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.
  • pagination.offset (string, uint64): numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.
  • pagination.limit (string, uint64): total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.
  • pagination.count_total (boolean): set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used, it is ignored when key is set.

Returns​

Balance of all coins for a single account.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/bank/v1beta1/balances/{address}

Response example​

{
"balances": [
{
"denom": "string",
"amount": "string"
}
],
"pagination": {
"next_key": "string",
"total": "string"
}
}

/cosmos/bank/v1beta1/balances/{address}/{denom}​

Retrieves balance of a single coin for a single account.

Parameters​

  • address (string; required): an address to query balances for.
  • denom (string; required): a coin denom to query balances for.

Returns​

Balance of the specific coin for a single account.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/bank/v1beta1/balances/{address}/{denom}

Response example​

{
"balance": {
"denom": "string",
"amount": "string"
}
}

/cosmos/bank/v1beta1/params​

Retrieves the parameters of x/bank module.

Parameters​

None.

Returns​

Parameters of x/bank module.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/bank/v1beta1/params

Response example​

{
"params": {
"send_enabled": [
{
"denom": "string",
"enabled": true
}
],
"default_send_enabled": true
}
}

/cosmos/bank/v1beta1/supply​

Retrieves the total supply of all coins.

Parameters​

None.

Returns​

Supply of all coins.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/bank/v1beta1/supply

Response example​

{
"supply": [
{
"denom": "string",
"amount": "string"
}
]
}

Distribution methods​

/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards​

Retrieves the total rewards accrued by each validator.

Parameters​

  • delegator_address (string; required): a delegator address to query for.

Returns​

Rewards from each validator.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards

Response example​

{
"rewards": [
{
"validator_address": "string",
"reward": [
{
"denom": "string",
"amount": "string"
}
]
}
],
"total": [
{
"denom": "string",
"amount": "string"
}
]
}

/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}​

Retrieves the total rewards accrued by a delegation.

Parameters​

  • delegator_address (string; required): a delegator address to query for.
  • validator_address (string; required): a validator address to query for.

Returns​

Total rewards accrued by a delegation for a specific validator.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}

Response example​

{
"rewards": [
{
"denom": "string",
"amount": "string"
}
]
}

/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators​

Retrieves the validators of a delegator.

Parameters​

  • delegator_address (string; required): a delegator address to query for.

Returns​

Validators for a given delegator.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators

Response example​

{
"validators": [
"string"
]
}

/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address​

Retrieves withdraw address of a delegator.

Parameters​

  • delegator_address (string, required): a delegator address to query for.

Returns​

Withdraw address of delegator.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address

Response example​

{
"withdraw_address": "string"
}

/cosmos/distribution/v1beta1/params​

Retrieves params of the distribution module.

Parameters​

None.

Returns​

Params of the distribution module.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/params

Response example​

{
"params": {
"community_tax": "string",
"base_proposer_reward": "string",
"bonus_proposer_reward": "string",
"withdraw_addr_enabled": true
}
}

/cosmos/distribution/v1beta1/validators/{validator_address}/commission​

Retrieves accumulated commission for a validator.

Parameters​

  • validator_address (string; required): a validator address to query for.

Returns​

Total commission for a validator.

Request example​

curl https://rpc.ankr.com/http/tac_turin_cosmos/cosmos/distribution/v1beta1/validators/{validator_address}/commission

Response example​

{
"commission": {
"commission": [
{
"denom": "string",
"amount": "string"
}
]
}
}