getmempoolancestors

Returns all in-mempool ancestors if txid is present in the mempool.

Example Request and Result for getmempoolancestors method

In this section, we provide an illustrative example of a request made to retrieve details contents using the getmempoolancestors method. Additionally, we present the resulting response containing information about the in-mempool ancestors.

Parameters

FieldTypeDescription

txid*

string

The transaction id (must be in mempool)

verbose

boolean

True for a json object, false for array of transaction ids

The example in this section uses a non-existing project id.

Make sure you replace it with your Bitcoin mainnet or Bitcoin Testnet endpoint when issuing the API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Returns all in-mempool ancestors for a transaction in the mempool.

POST https://bitcoin-mainnet.blastapi.io/<project-id>

Request Body

NameTypeDescription

jsonrpc*

string

1.0

id*

string

bwarelabs

method*

string

getmempoolancestors

params*

array<string>

["b86ae732473ff2c91c04073ec9cbef5e4ddaa701741e141e41345df72122b795", null]

{
    "result": [
        "60a5dfd11490c80d44fd60a2295c69c5d85d4e6c47bc9ed91a9b09df99137305",
        "05b0258feed8c72c0de94c248c55f619bc209ccc79e60e18408366c30253331a",
        "996d2328e003ccb113212272c3174b71744c4ed67a2f565324d9ea50e5ba261b",
        "5ff695dec6abe63c44da602a3cb85cc0ebcba8435ef9e6f46f78d158aa7dd324",
        ...
        ],
    "error": null,
    "id": "bwarelabs"
}

Curl Request example

curl --location 'https://bitcoin-mainnet.blastapi.io/<project-id>' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "1.0",
    "id": "bwarelabs",
    "method": "getmempoolancestors",
    "params": [
        "b86ae732473ff2c91c04073ec9cbef5e4ddaa701741e141e41345df72122b795",
        null
    ]
}'

Last updated