StreamTransactionsRequest
StreamTransactionsRequest subscribes to transaction confirmations.
Filter expressions support the following params:
-
params.min_slot (uint64): Minimum slot for filtering transactions Example: transaction.slot >= params.min_slot
-
params.max_slot (uint64): Maximum slot for filtering transactions Example: transaction.slot <= params.max_slot
-
params.slot (uint64): Specific slot for exact match filtering Example: transaction.slot == params.slot
-
params.min_fee (uint64): Minimum fee for filtering transactions Example: transaction.header.fee >= params.min_fee
-
params.fee_payer (bytes|Pubkey): Fee payer pubkey for filtering Example: transaction.header.fee_payer_pubkey.value == params.fee_payer
-
params.signature (bytes|Signature): Transaction signature for filtering Example: transaction.signature.value == params.signature
Available transaction fields (thru.core.v1.Transaction): transaction.signature, transaction.signature.value (bytes), transaction.slot (uint64), transaction.block_offset (uint32), transaction.header, transaction.header.version (uint32), transaction.header.fee (uint64), transaction.header.fee_payer_pubkey, transaction.header.fee_payer_pubkey.value (bytes), transaction.execution_result, transaction.execution_result.user_error_code (uint32), transaction.execution_result.vm_error (int32)
Available consensus_status field: consensus_status (int32) - Current consensus status of the transaction Values: CONSENSUS_STATUS_UNSPECIFIED = 0, CONSENSUS_STATUS_OBSERVED = 1, CONSENSUS_STATUS_INCLUDED = 2
Filter expression examples:
-
Filter by minimum slot: Expression: “has(transaction.slot) && transaction.slot >= params.min_slot” Params: {“min_slot”: 1000}
-
Filter by slot range: Expression: “has(transaction.slot) && transaction.slot >= params.min_slot && transaction.slot <= params.max_slot” Params: {“min_slot”: 1000, “max_slot”: 2000}
-
Filter by specific slot: Expression: “has(transaction.slot) && transaction.slot == params.slot” Params: {“slot”: 12345}
-
Filter by minimum fee: Expression: “has(transaction.header) && transaction.header.fee >= params.min_fee” Params: {“min_fee”: 5000}
-
Filter by fee payer: Expression: “has(transaction.header.fee_payer_pubkey) && transaction.header.fee_payer_pubkey.value == params.fee_payer” Params: {“fee_payer”: <32-byte pubkey>}
-
Filter by transaction signature: Expression: “has(transaction.signature) && transaction.signature.value == params.signature” Params: {“signature”: <64-byte signature>}
-
Filter by header version: Expression: “has(transaction.header) && transaction.header.version >= uint(0)”
-
Filter by successful execution: Expression: “has(transaction.execution_result) && transaction.execution_result.vm_error == int(0)”
-
Filter by user error code: Expression: “has(transaction.execution_result) && transaction.execution_result.user_error_code == uint(0)”
-
Filter by consensus status: Expression: “consensus_status >= int(2)” Note: Use >= int(2) for CONSENSUS_STATUS_INCLUDED and above
-
Check for execution result presence: Expression: “has(transaction.execution_result)”
-
Filter by transaction with header and slot: Expression: “has(transaction.slot) && transaction.slot >= uint(0) && has(transaction.header)”
-
Combined filters (slot, fee, and status): Expression: “has(transaction.slot) && transaction.slot >= params.min_slot && has(transaction.header) && transaction.header.fee >= params.min_fee && consensus_status >= int(2)” Params: {“min_slot”: 1000, “min_fee”: 5000}
-
Filter successful transactions with minimum fee: Expression: “has(transaction.execution_result) && transaction.execution_result.vm_error == int(0) && has(transaction.header) && transaction.header.fee >= params.min_fee” Params: {“min_fee”: 10000}
Note: The min_consensus field in the request provides built-in consensus filtering without requiring a CEL expression. Use it in combination with filter expressions for more complex filtering logic.
Package: thru.services.v1
Fields
Section titled “Fields”| Field | Type | # | Description |
|---|---|---|---|
filter | thru.common.v1.Filter | 1 · optional | |
min_consensus | thru.common.v1.ConsensusStatus | 2 · optional |