getmempoolentry - Dash
Example code for the getmempoolentry JSON-RPC method. Complete guide on how to use the getmempoolentry JSON-RPC method in the GetBlock Web3 documentation.
This method returns mempool data for a single transaction that is currently in the mempool, including its fees, size, and ancestor and descendant counts.
Parameters
txid
string
Yes
The transaction id, which must be in the mempool
Request
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getmempoolentry",
"params": ["10b54fd708ab2e5703979b4ba27ca0339882abc2062e77fbe51e625203a49642"],
"id": "getblock.io"
}'const axios = require('axios');
const { data } = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0', method: 'getmempoolentry',
params: ['10b54fd708ab2e5703979b4ba27ca0339882abc2062e77fbe51e625203a49642'], id: 'getblock.io'
});
console.log(data.result.fees);import requests
response = requests.post(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'method': 'getmempoolentry',
'params': ["10b54fd708ab2e5703979b4ba27ca0339882abc2062e77fbe51e625203a49642"],
'id': 'getblock.io'
}
)
print(response.json()['result'])Response
{
"error": null,
"id": "getblock.io",
"result": {
"size": 226,
"time": 1617180599,
"height": 684634,
"descendantcount": 1,
"descendantsize": 226,
"ancestorcount": 1,
"ancestorsize": 226,
"fees": {
"base": 2.26e-06,
"modified": 2.26e-06,
"ancestor": 2.26e-06,
"descendant": 2.26e-06
}
}
}Response Parameters
error
null|object
Error object when the call fails, otherwise null
id
string
Request identifier matching the request
result
object
Mempool entry object for the transaction
Result Object
size
numeric
Transaction size in bytes
time
numeric
Time the transaction entered the mempool
ancestorcount
numeric
Number of in-mempool ancestor transactions
descendantcount
numeric
Number of in-mempool descendant transactions
fees
object
Base, modified, ancestor, and descendant fees in BCH
Use Cases
Fee Bumping: Read ancestor fees before deciding on a child-pays-for-parent spend
Confirmation Estimates: Assess a transaction's position by its fee rate
Chain Limits: Check ancestor and descendant counts against mempool limits
Stuck Transactions: Diagnose why a low-fee transaction remains unconfirmed
Error Handling
-8
Invalid parameter
txid is not a valid 64-character hex string
-5
Transaction not found
No transaction with the given id is available; a txindex may be required
-32603
Internal error
Node failed to read the transaction
Last updated
Was this helpful?