Unified Pending Transaction
This event is triggered when:
- A new transaction enters the mempool (
unified_pending_tx). - A previously-seen mempool transaction is no longer pending. For example, it was replaced, dropped, or expired from the mempool without being mined (
unified_pending_tx_removed). - A customer has a rule with the
addressvariable type and the variable contains the address of the transaction as its value. Only the sender and recipient of the transaction are matched.
Supported Protocols
bitcoin/mainnetbitcoin/testnetbitcoin/testnet4
Schema
{
"data": {
"block_number": null,
"block_hash": "string",
"tx_id": "string",
"tx_hash": "string",
"timestamp": "integer",
"status": "string",
"transfers": ["array"],
"fee": {}
}
}| Field | Type | Description |
|---|---|---|
block_number | integer | Always null for pending transactions, since the transaction has not yet been mined into a block. |
block_hash | string | Always an empty string for pending transactions. |
timestamp | integer | Always 0 for pending transactions, since there is no block timestamp yet. |
tx_id | string | (Required) The transaction identifier, such as the transaction hash or other unique identifier. |
tx_hash | string | The transaction hash. This only applies to protocols where transactions have both an ID and a hash that might not always be the same value. |
status | string | (Required) pending for unified_pending_tx, or pending_removed for unified_pending_tx_removed. |
transfers | array of transfers | An array of transfers that took place during the transaction. See the Transfer Schema in Unified Confirmed Transaction. |
fee | object | The fee paid for this transaction, in the native Transfer shape. |
unified_pending_tx and unified_pending_tx_removed share the same schema. status is the only field that distinguishes the two — check it to know whether the transaction just entered the mempool or was just removed from it.
InfoBitcoin transactions have both a
txidand a witness hash;tx_idmaps totxidandtx_hashmaps tohash. Each input (vin) and output (vout) becomes an entry intransfers, tagged withevent_nameofvinorvout, matched againstdata.vin[].prevout.scriptPubKey.addresses[]anddata.vout[].scriptPubKey.addresses[].
Examples
Bitcoin
Bitcoin transactions have both a txid and a witness hash; tx_id maps to txid and tx_hash maps to hash. Each input (vin) and output (vout) becomes an entry in transfers, tagged with event_name of vin or vout, matched against data.vin[].prevout.scriptPubKey.addresses[] and data.vout[].scriptPubKey.addresses[].
{
"protocol": "bitcoin",
"network": "mainnet",
"event_type": "unified_pending_tx",
"chain_id": "bip122:000000000019d6689c085ae165831e93",
"data": {
"block_number": null,
"block_hash": "",
"tx_id": "77d80eb55bc1e99db7617c5b508452306e7049a54e7ec398a25a293339077763",
"tx_hash": "8dc10b4e32f1d0900e8786cd81875190533c2dc4310a360116409e26a700f19e",
"timestamp": 0,
"status": "pending",
"transfers": [
{
"asset": "native",
"from": "bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h",
"value": 22349655,
"event_name": "vin"
},
{
"asset": "native",
"from": "bc1qu3aazsa92k2ws4mu5yzym0gwvdxvdqjmznmjgz",
"value": 582900,
"event_name": "vout"
},
{
"asset": "native",
"from": "bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h",
"value": 4215594,
"event_name": "vout"
}
],
"fee": {
"asset": "native",
"value": 27850
}
}
}👋 Need Help?
Contact us through email or our support page for any issues, bugs, or assistance you may need.
Updated about 2 hours ago
