pub async fn get_transaction_receipts(
        &mut self,
        hashes: &[H256],
    ) -> DalResult<Vec<ExtendedTransactionReceipt>> {
        let hash_bytes: Vec<_> = hashes.iter().map(H256::as_bytes).collect();

        let st_receipts: Vec<StorageTransactionReceipt> = sqlx::query_as!(
            StorageTransactionReceipt,
            r#"
            SELECT
                transactions.hash AS tx_hash,
                transactions.index_in_block,
                transactions.l1_batch_tx_index,
                transactions.miniblock_number AS "block_number!",
                transactions.error,
                transactions.effective_gas_price,
                transactions.initiator_address,
                transactions.data -> 'to' AS "transfer_to?",
                transactions.data -> 'contractAddress' AS "execute_contract_address?",
                transactions.data -> 'calldata' AS "calldata",
                transactions.tx_format AS "tx_format?",
                transactions.refunded_gas,
                transactions.gas_limit,
                transactions.nonce,
                miniblocks.hash AS "block_hash",
                miniblocks.l1_batch_number AS "l1_batch_number?",
                miniblocks.timestamp AS "block_timestamp?"
            FROM
                transactions
            JOIN miniblocks ON miniblocks.number = transactions.miniblock_number
            WHERE
                transactions.hash = ANY($1)
                AND transactions.data != '{}'::jsonb
            "#,
            // ^ Filter out transactions with pruned data, which would lead to potentially incomplete / bogus
            // transaction info.
            &hash_bytes as &[&[u8]],
        )
        .instrument("get_transaction_receipts")
        .with_arg("hashes.len", &hashes.len())
        .fetch_all(self.storage)
        .await?;

        let block_timestamps: Vec<Option<i64>> =
            st_receipts.iter().map(|x| x.block_timestamp).collect();

        let mut receipts: Vec<ExtendedTransactionReceipt> =
            st_receipts.into_iter().map(Into::into).collect();

        let mut logs = self
            .storage
            .events_dal()
            .get_logs_by_tx_hashes(hashes)
            .await?;

        let mut l2_to_l1_logs = self
            .storage
            .events_dal()
            .get_l2_to_l1_logs_by_hashes(hashes)
            .await?;

        for (receipt, block_timestamp) in receipts.iter_mut().zip(block_timestamps.into_iter()) {
            let receipt = &mut receipt.inner;
            let logs_for_tx = logs.remove(&receipt.transaction_hash);

            if let Some(logs) = logs_for_tx {
                let iter = logs.iter().flat_map(|log| {
                    log.topics
                        .iter()
                        .map(|topic| BloomInput::Raw(topic.as_bytes()))
                        .chain(once(BloomInput::Raw(log.address.as_bytes())))
                });
                receipt.logs_bloom = build_bloom(iter);
                receipt.logs = logs
                    .into_iter()
                    .map(|mut log| {
                        log.block_hash = Some(receipt.block_hash);
                        log.l1_batch_number = receipt.l1_batch_number;
                        log.block_timestamp = block_timestamp.map(|t| (t as u64).into());
                        log
                    })
                    .collect();
            }

            let l2_to_l1_logs_for_tx = l2_to_l1_logs.remove(&receipt.transaction_hash);
            if let Some(l2_to_l1_logs) = l2_to_l1_logs_for_tx {
                receipt.l2_to_l1_logs = l2_to_l1_logs
                    .into_iter()
                    .map(|mut log| {
                        log.block_hash = Some(receipt.block_hash);
                        log.l1_batch_number = receipt.l1_batch_number;
                        log
                    })
                    .collect();
            }
        }

        Ok(receipts)
    }
Returns receipts by transactions hashes. Hashes are expected to be unique.

# Important!

The returned receipts do not have `contract_address` set; this field needs to be filled separately.
core/lib/dal/src/transactions_web3_dal.rs