submitTransaction

Cosmos RPC

Overview

The submitTransaction method allows you to submit a signed transaction to the Cosmos network for processing. This is essential for pushing transactions to the blockchain, enabling transfers, smart contract interactions, and other blockchain activities.

Parameters

NameTypeRequiredDescription
networkIdentifierobjectYesIdentifies the Cosmos blockchain and network details.
blockchainstring (from networkIdentifier)YesThe blockchain identifier, typically "Cosmos".
networkstring (from networkIdentifier)YesThe network name on which the transaction is taking place.
subNetworkIdentifierobject (from networkIdentifier)NoOptional sub-network identifier object.
networkstring (from subNetworkIdentifier)YesThe name of the sub-network within Cosmos.
metadataobject (from subNetworkIdentifier)NoMetadata associated with the sub-network.
signedTransactionstringYesThe signed transaction data in hexadecimal format.

Returns

The method returns a response from the Cosmos network that typically includes the transaction hash, indicating successful submission.

FieldDescription
transactionHashThe hash of the transaction as accepted by the network.

Example Result

{
  "transactionHash": "CBA1234ABCD5678EFGH91011IJ"
}

Request Example

curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos-mainnet/construction/submit' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {API_KEY}' \
--data-raw '{
    "networkIdentifier": {
        "blockchain": "cosmos",
        "network": "mainnet"
    },
    "signedTransaction": "7f2b...f123"
}'
// yarn add @tatumio/tatum

import { TatumSDK, Cosmos, Network } from "@tatumio/tatum";

const cosmos = await TatumSDK.init<Cosmos>({ network: Network.COSMOS_MAINNET });

const submitResponse = await tatum.rpc.submitTransaction({
  networkIdentifier: {
    blockchain: "cosmos",
    network: "mainnet",
  },
  signedTransaction: "7f2b...f123"
});

console.log('Transaction Response:', submitResponse);

await tatum.destroy(); // Destroy Tatum SDK - needed for stopping background jobs