getmempoolancestors
Returns the in-mempool ancestors of an unconfirmed transaction. This method uses 80 credits from your daily balance.
Ancestors are the unconfirmed transactions that this transaction spends from, directly or indirectly. The method returns an error if the transaction isn't in the mempool.
Parameters
txid: (string) [required] - Transaction ID.verbose: (boolean) [optional] -falsereturns an array of transaction IDs.truereturns an object keyed by transaction ID, with the fields described ingetrawmempool. The default isfalse.
Returns
result: (array or object) - Ancestor transaction IDs, or an object of mempool entries when verbose is true.
Request
Replace the transaction ID with one currently in the mempool.
- curl
curl https://bitcoin-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getmempoolancestors", "params": ["5b1d0e9f4c3a2b8170e6d5c4b3a29180f7e6d5c4b3a291807f6e5d4c3b2a1908", false]}'
Response
- JSON
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"a4c7e2f1b0d9c8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3"
]
}