curl --request GET \
--url https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}import requests
url = "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"txs": [
{
"body": {
"messages": [
{
"@type": "<string>"
}
],
"memo": "<string>",
"timeout_height": "<string>",
"unordered": true,
"timeout_timestamp": "2023-11-07T05:31:56Z",
"extension_options": [
{
"@type": "<string>"
}
],
"non_critical_extension_options": [
{
"@type": "<string>"
}
]
},
"auth_info": {
"signer_infos": [
{
"public_key": {
"@type": "<string>"
},
"mode_info": {
"single": {
"mode": "SIGN_MODE_UNSPECIFIED"
},
"multi": {
"bitarray": {
"extra_bits_stored": 123,
"elems": "aSDinaTvuI8gbWludGxpZnk="
},
"mode_infos": [
{}
]
}
},
"sequence": "<string>"
}
],
"fee": {
"amount": [
{
"denom": "<string>",
"amount": "<string>"
}
],
"gas_limit": "<string>",
"payer": "<string>",
"granter": "<string>"
},
"tip": {
"amount": [
{
"denom": "<string>",
"amount": "<string>"
}
],
"tipper": "<string>"
}
},
"signatures": [
"aSDinaTvuI8gbWludGxpZnk="
]
}
],
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"block": {
"header": {
"version": {
"block": "<string>",
"app": "<string>"
},
"chain_id": "<string>",
"height": "<string>",
"time": "2023-11-07T05:31:56Z",
"last_block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"last_commit_hash": "aSDinaTvuI8gbWludGxpZnk=",
"data_hash": "aSDinaTvuI8gbWludGxpZnk=",
"validators_hash": "aSDinaTvuI8gbWludGxpZnk=",
"next_validators_hash": "aSDinaTvuI8gbWludGxpZnk=",
"consensus_hash": "aSDinaTvuI8gbWludGxpZnk=",
"app_hash": "aSDinaTvuI8gbWludGxpZnk=",
"last_results_hash": "aSDinaTvuI8gbWludGxpZnk=",
"evidence_hash": "aSDinaTvuI8gbWludGxpZnk=",
"proposer_address": "aSDinaTvuI8gbWludGxpZnk="
},
"data": {
"txs": [
"aSDinaTvuI8gbWludGxpZnk="
]
},
"evidence": {
"evidence": [
{
"duplicate_vote_evidence": {
"vote_a": {
"type": "SIGNED_MSG_TYPE_UNKNOWN",
"height": "<string>",
"round": 123,
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"timestamp": "2023-11-07T05:31:56Z",
"validator_address": "aSDinaTvuI8gbWludGxpZnk=",
"validator_index": 123,
"signature": "aSDinaTvuI8gbWludGxpZnk=",
"extension": "aSDinaTvuI8gbWludGxpZnk=",
"extension_signature": "aSDinaTvuI8gbWludGxpZnk="
},
"vote_b": {
"type": "SIGNED_MSG_TYPE_UNKNOWN",
"height": "<string>",
"round": 123,
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"timestamp": "2023-11-07T05:31:56Z",
"validator_address": "aSDinaTvuI8gbWludGxpZnk=",
"validator_index": 123,
"signature": "aSDinaTvuI8gbWludGxpZnk=",
"extension": "aSDinaTvuI8gbWludGxpZnk=",
"extension_signature": "aSDinaTvuI8gbWludGxpZnk="
},
"total_voting_power": "<string>",
"validator_power": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"light_client_attack_evidence": {
"conflicting_block": {
"signed_header": {
"header": {
"version": {
"block": "<string>",
"app": "<string>"
},
"chain_id": "<string>",
"height": "<string>",
"time": "2023-11-07T05:31:56Z",
"last_block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"last_commit_hash": "aSDinaTvuI8gbWludGxpZnk=",
"data_hash": "aSDinaTvuI8gbWludGxpZnk=",
"validators_hash": "aSDinaTvuI8gbWludGxpZnk=",
"next_validators_hash": "aSDinaTvuI8gbWludGxpZnk=",
"consensus_hash": "aSDinaTvuI8gbWludGxpZnk=",
"app_hash": "aSDinaTvuI8gbWludGxpZnk=",
"last_results_hash": "aSDinaTvuI8gbWludGxpZnk=",
"evidence_hash": "aSDinaTvuI8gbWludGxpZnk=",
"proposer_address": "aSDinaTvuI8gbWludGxpZnk="
},
"commit": {
"height": "<string>",
"round": 123,
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"signatures": [
{
"block_id_flag": "BLOCK_ID_FLAG_UNKNOWN",
"validator_address": "aSDinaTvuI8gbWludGxpZnk=",
"timestamp": "2023-11-07T05:31:56Z",
"signature": "aSDinaTvuI8gbWludGxpZnk="
}
]
}
},
"validator_set": {
"validators": [
{
"address": "aSDinaTvuI8gbWludGxpZnk=",
"pub_key": {
"ed25519": "aSDinaTvuI8gbWludGxpZnk=",
"secp256k1": "aSDinaTvuI8gbWludGxpZnk="
},
"voting_power": "<string>",
"proposer_priority": "<string>"
}
],
"proposer": {
"address": "aSDinaTvuI8gbWludGxpZnk=",
"pub_key": {
"ed25519": "aSDinaTvuI8gbWludGxpZnk=",
"secp256k1": "aSDinaTvuI8gbWludGxpZnk="
},
"voting_power": "<string>",
"proposer_priority": "<string>"
},
"total_voting_power": "<string>"
}
},
"common_height": "<string>",
"byzantine_validators": [
{
"address": "aSDinaTvuI8gbWludGxpZnk=",
"pub_key": {
"ed25519": "aSDinaTvuI8gbWludGxpZnk=",
"secp256k1": "aSDinaTvuI8gbWludGxpZnk="
},
"voting_power": "<string>",
"proposer_priority": "<string>"
}
],
"total_voting_power": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}
]
},
"last_commit": {
"height": "<string>",
"round": 123,
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"signatures": [
{
"block_id_flag": "BLOCK_ID_FLAG_UNKNOWN",
"validator_address": "aSDinaTvuI8gbWludGxpZnk=",
"timestamp": "2023-11-07T05:31:56Z",
"signature": "aSDinaTvuI8gbWludGxpZnk="
}
]
}
},
"pagination": {
"next_key": "aSDinaTvuI8gbWludGxpZnk=",
"total": "<string>"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}GetBlockWithTxs
gRPC: cosmos.tx.v1beta1.Service/GetBlockWithTxs (reference)
GetBlockWithTxs fetches a block with decoded txs.
curl --request GET \
--url https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}import requests
url = "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/txs/block/{height}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"txs": [
{
"body": {
"messages": [
{
"@type": "<string>"
}
],
"memo": "<string>",
"timeout_height": "<string>",
"unordered": true,
"timeout_timestamp": "2023-11-07T05:31:56Z",
"extension_options": [
{
"@type": "<string>"
}
],
"non_critical_extension_options": [
{
"@type": "<string>"
}
]
},
"auth_info": {
"signer_infos": [
{
"public_key": {
"@type": "<string>"
},
"mode_info": {
"single": {
"mode": "SIGN_MODE_UNSPECIFIED"
},
"multi": {
"bitarray": {
"extra_bits_stored": 123,
"elems": "aSDinaTvuI8gbWludGxpZnk="
},
"mode_infos": [
{}
]
}
},
"sequence": "<string>"
}
],
"fee": {
"amount": [
{
"denom": "<string>",
"amount": "<string>"
}
],
"gas_limit": "<string>",
"payer": "<string>",
"granter": "<string>"
},
"tip": {
"amount": [
{
"denom": "<string>",
"amount": "<string>"
}
],
"tipper": "<string>"
}
},
"signatures": [
"aSDinaTvuI8gbWludGxpZnk="
]
}
],
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"block": {
"header": {
"version": {
"block": "<string>",
"app": "<string>"
},
"chain_id": "<string>",
"height": "<string>",
"time": "2023-11-07T05:31:56Z",
"last_block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"last_commit_hash": "aSDinaTvuI8gbWludGxpZnk=",
"data_hash": "aSDinaTvuI8gbWludGxpZnk=",
"validators_hash": "aSDinaTvuI8gbWludGxpZnk=",
"next_validators_hash": "aSDinaTvuI8gbWludGxpZnk=",
"consensus_hash": "aSDinaTvuI8gbWludGxpZnk=",
"app_hash": "aSDinaTvuI8gbWludGxpZnk=",
"last_results_hash": "aSDinaTvuI8gbWludGxpZnk=",
"evidence_hash": "aSDinaTvuI8gbWludGxpZnk=",
"proposer_address": "aSDinaTvuI8gbWludGxpZnk="
},
"data": {
"txs": [
"aSDinaTvuI8gbWludGxpZnk="
]
},
"evidence": {
"evidence": [
{
"duplicate_vote_evidence": {
"vote_a": {
"type": "SIGNED_MSG_TYPE_UNKNOWN",
"height": "<string>",
"round": 123,
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"timestamp": "2023-11-07T05:31:56Z",
"validator_address": "aSDinaTvuI8gbWludGxpZnk=",
"validator_index": 123,
"signature": "aSDinaTvuI8gbWludGxpZnk=",
"extension": "aSDinaTvuI8gbWludGxpZnk=",
"extension_signature": "aSDinaTvuI8gbWludGxpZnk="
},
"vote_b": {
"type": "SIGNED_MSG_TYPE_UNKNOWN",
"height": "<string>",
"round": 123,
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"timestamp": "2023-11-07T05:31:56Z",
"validator_address": "aSDinaTvuI8gbWludGxpZnk=",
"validator_index": 123,
"signature": "aSDinaTvuI8gbWludGxpZnk=",
"extension": "aSDinaTvuI8gbWludGxpZnk=",
"extension_signature": "aSDinaTvuI8gbWludGxpZnk="
},
"total_voting_power": "<string>",
"validator_power": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"light_client_attack_evidence": {
"conflicting_block": {
"signed_header": {
"header": {
"version": {
"block": "<string>",
"app": "<string>"
},
"chain_id": "<string>",
"height": "<string>",
"time": "2023-11-07T05:31:56Z",
"last_block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"last_commit_hash": "aSDinaTvuI8gbWludGxpZnk=",
"data_hash": "aSDinaTvuI8gbWludGxpZnk=",
"validators_hash": "aSDinaTvuI8gbWludGxpZnk=",
"next_validators_hash": "aSDinaTvuI8gbWludGxpZnk=",
"consensus_hash": "aSDinaTvuI8gbWludGxpZnk=",
"app_hash": "aSDinaTvuI8gbWludGxpZnk=",
"last_results_hash": "aSDinaTvuI8gbWludGxpZnk=",
"evidence_hash": "aSDinaTvuI8gbWludGxpZnk=",
"proposer_address": "aSDinaTvuI8gbWludGxpZnk="
},
"commit": {
"height": "<string>",
"round": 123,
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"signatures": [
{
"block_id_flag": "BLOCK_ID_FLAG_UNKNOWN",
"validator_address": "aSDinaTvuI8gbWludGxpZnk=",
"timestamp": "2023-11-07T05:31:56Z",
"signature": "aSDinaTvuI8gbWludGxpZnk="
}
]
}
},
"validator_set": {
"validators": [
{
"address": "aSDinaTvuI8gbWludGxpZnk=",
"pub_key": {
"ed25519": "aSDinaTvuI8gbWludGxpZnk=",
"secp256k1": "aSDinaTvuI8gbWludGxpZnk="
},
"voting_power": "<string>",
"proposer_priority": "<string>"
}
],
"proposer": {
"address": "aSDinaTvuI8gbWludGxpZnk=",
"pub_key": {
"ed25519": "aSDinaTvuI8gbWludGxpZnk=",
"secp256k1": "aSDinaTvuI8gbWludGxpZnk="
},
"voting_power": "<string>",
"proposer_priority": "<string>"
},
"total_voting_power": "<string>"
}
},
"common_height": "<string>",
"byzantine_validators": [
{
"address": "aSDinaTvuI8gbWludGxpZnk=",
"pub_key": {
"ed25519": "aSDinaTvuI8gbWludGxpZnk=",
"secp256k1": "aSDinaTvuI8gbWludGxpZnk="
},
"voting_power": "<string>",
"proposer_priority": "<string>"
}
],
"total_voting_power": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}
]
},
"last_commit": {
"height": "<string>",
"round": 123,
"block_id": {
"hash": "aSDinaTvuI8gbWludGxpZnk=",
"part_set_header": {
"total": 123,
"hash": "aSDinaTvuI8gbWludGxpZnk="
}
},
"signatures": [
{
"block_id_flag": "BLOCK_ID_FLAG_UNKNOWN",
"validator_address": "aSDinaTvuI8gbWludGxpZnk=",
"timestamp": "2023-11-07T05:31:56Z",
"signature": "aSDinaTvuI8gbWludGxpZnk="
}
]
}
},
"pagination": {
"next_key": "aSDinaTvuI8gbWludGxpZnk=",
"total": "<string>"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Path Parameters
height is the height of the block to query.
Query Parameters
key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.
offset is a 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.
limit is the 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.
count_total is 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.
reverse is set to true if results are to be returned in the descending order.
Response
A successful response.
GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method.
Was this page helpful?