@@ -62,6 +62,13 @@ type ChainReader interface {
6262 SubscribeNewHead (ctx context.Context , ch chan <- * types.Header ) (Subscription , error )
6363}
6464
65+ // TransactionReceiptsQuery defines criteria for transaction receipts subscription.
66+ // If TransactionHashes is empty, receipts for all transactions included in new blocks will be delivered.
67+ // Otherwise, only receipts for the specified transactions will be delivered.
68+ type TransactionReceiptsQuery struct {
69+ TransactionHashes []common.Hash
70+ }
71+
6572// TransactionReader provides access to past transactions and their receipts.
6673// Implementations may impose arbitrary restrictions on the transactions and receipts that
6774// can be retrieved. Historic transactions may not be available.
@@ -81,6 +88,11 @@ type TransactionReader interface {
8188 // transaction may not be included in the current canonical chain even if a receipt
8289 // exists.
8390 TransactionReceipt (ctx context.Context , txHash common.Hash ) (* types.Receipt , error )
91+ // SubscribeTransactionReceipts subscribes to notifications about transaction receipts.
92+ // The receipts are delivered in batches when transactions are included in blocks.
93+ // If q is nil or has empty TransactionHashes, all receipts from new blocks will be delivered.
94+ // Otherwise, only receipts for the specified transaction hashes will be delivered.
95+ SubscribeTransactionReceipts (ctx context.Context , q * TransactionReceiptsQuery , ch chan <- []* types.Receipt ) (Subscription , error )
8496}
8597
8698// ChainStateReader wraps access to the state trie of the canonical blockchain. Note that
0 commit comments