TxDecode
curl --request POST \
--url https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode \
--header 'Content-Type: application/json' \
--data '
{
"tx_bytes": "aSDinaTvuI8gbWludGxpZnk="
}
'import requests
url = "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode"
payload = { "tx_bytes": "aSDinaTvuI8gbWludGxpZnk=" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({tx_bytes: 'aSDinaTvuI8gbWludGxpZnk='})
};
fetch('https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode', 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/decode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tx_bytes' => 'aSDinaTvuI8gbWludGxpZnk='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode"
payload := strings.NewReader("{\n \"tx_bytes\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode")
.header("Content-Type", "application/json")
.body("{\n \"tx_bytes\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"tx_bytes\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}"
response = http.request(request)
puts response.read_body{
"tx": {
"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="
]
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}tx
TxDecode
gRPC: cosmos.tx.v1beta1.Service/TxDecode (reference)
TxDecode decodes the transaction.
POST
/
cosmos
/
tx
/
v1beta1
/
decode
TxDecode
curl --request POST \
--url https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode \
--header 'Content-Type: application/json' \
--data '
{
"tx_bytes": "aSDinaTvuI8gbWludGxpZnk="
}
'import requests
url = "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode"
payload = { "tx_bytes": "aSDinaTvuI8gbWludGxpZnk=" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({tx_bytes: 'aSDinaTvuI8gbWludGxpZnk='})
};
fetch('https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode', 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/decode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tx_bytes' => 'aSDinaTvuI8gbWludGxpZnk='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode"
payload := strings.NewReader("{\n \"tx_bytes\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode")
.header("Content-Type", "application/json")
.body("{\n \"tx_bytes\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cosmos-rest.publicnode.com/cosmos/tx/v1beta1/decode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"tx_bytes\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}"
response = http.request(request)
puts response.read_body{
"tx": {
"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="
]
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Body
application/json
TxDecodeRequest is the request type for the Service.TxDecode RPC method.
TxDecodeRequest is the request type for the Service.TxDecode RPC method.
tx_bytes is the raw transaction.
Response
A successful response.
TxDecodeResponse is the response type for the Service.TxDecode method.
tx is the decoded transaction.
Show child attributes
Show child attributes
Was this page helpful?