testmempoolaccept

Indicates if a raw transaction (serialized, hex-encoded) would be accepted by mempool based on the results of the acceptance tests run by mempool.

This determines whether the transaction deviates from the agreement or the guidelines.

Example Request and Result for testmempoolaccept method

In this section, we provide an illustrative example of a request made to retrieve details contents using the testmempoolaccept method. Additionally, we present the resulting response containing information about the result of mempool acceptance tests.

Parameters

FieldTypeDescription

rawtxs*

array<string>

An array of hex strings of raw transactions.

maxfeerate

numeric/string

Reject transactions whose fee rate is higher than the specified value, expressed in BTC/kB

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!

Provides information regarding the mempool acceptance tests.

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

Request Body

NameTypeDescription

jsonrpc*

string

1.0

id*

string

bwarelabs

method*

string

testmempoolaccept

params*

string

["0200000001e114ded2868c57821e336374c948158cebf18daaf5c7bc756b199d118d6e229d0000000000ffffffff010000000000000000066a040001020300000000"]

{
    "result": [
        {
            "txid": "3565de6b39602582e922f142b8cd3cf6c212b33915c166f228e6635a10f87753",
            "wtxid": "3565de6b39602582e922f142b8cd3cf6c212b33915c166f228e6635a10f87753",
            "allowed": false,
            "reject-reason": "missing-inputs"
        }
    ],
    "error": null,
    "id": "curltest"
}

Curl Request example

curl --location 'https://bitcoin-mainnet.blastapi.io/<project-id>' \
--header 'content-type: application/json;' \
--data '{
    "jsonrpc": "1.0",
    "id": "bwarelabs",
    "method": "testmempoolaccept",
    "params": [
        [
            "0200000001e114ded2868c57821e336374c948158cebf18daaf5c7bc756b199d118d6e229d0000000000ffffffff010000000000000000066a040001020300000000"
        ]
    ]
}'

Last updated