unconfirmed_txs - Cosmos

Example code for the unconfirmed_txs JSON-RPC method. Complete guide on how to use unconfirmed_txs JSON-RPC in GetBlock Web3 documentation.

Returns transactions currently in the mempool. By default returns up to 30 — use limit to adjust. Useful for mempool monitoring and MEV analytics where allowed.

Parameters

Parameter
Type
Required
Description

limit

integer

No

Maximum transactions to return (default: 30)

Request Example

# JSON-RPC over HTTP POST (canonical)
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/unconfirmed_txs' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "unconfirmed_txs",
    "params": {
        "limit": 30
    },
    "id": "getblock.io"
}'

# URI over HTTP GET (alternate, for simple methods)
curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/unconfirmed_txs?limit=30'

Response Example

Response Parameters

Field
Type
Description

result.n_txs

string

Number of transactions returned

result.total

string

Total transactions in the mempool

result.total_bytes

string

Total mempool size in bytes

result.txs

array of string

Base64-encoded transaction bytes

Use Cases

  • Mempool monitoring dashboards

  • Validator-side fee market analysis

  • Pending-transaction surveillance

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?