Skip to content

StreamTransactionsRequest

View as Markdown

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:

  1. Filter by minimum slot: Expression: “has(transaction.slot) && transaction.slot >= params.min_slot” Params: {“min_slot”: 1000}

  2. 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}

  3. Filter by specific slot: Expression: “has(transaction.slot) && transaction.slot == params.slot” Params: {“slot”: 12345}

  4. Filter by minimum fee: Expression: “has(transaction.header) && transaction.header.fee >= params.min_fee” Params: {“min_fee”: 5000}

  5. 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>}

  6. Filter by transaction signature: Expression: “has(transaction.signature) && transaction.signature.value == params.signature” Params: {“signature”: <64-byte signature>}

  7. Filter by header version: Expression: “has(transaction.header) && transaction.header.version >= uint(0)”

  8. Filter by successful execution: Expression: “has(transaction.execution_result) && transaction.execution_result.vm_error == int(0)”

  9. Filter by user error code: Expression: “has(transaction.execution_result) && transaction.execution_result.user_error_code == uint(0)”

  10. Filter by consensus status: Expression: “consensus_status >= int(2)” Note: Use >= int(2) for CONSENSUS_STATUS_INCLUDED and above

  11. Check for execution result presence: Expression: “has(transaction.execution_result)”

  12. Filter by transaction with header and slot: Expression: “has(transaction.slot) && transaction.slot >= uint(0) && has(transaction.header)”

  13. 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}

  14. 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

FieldType#Description
filterthru.common.v1.Filter1 · optional
min_consensusthru.common.v1.ConsensusStatus2 · optional