merkle_sdk_transactions/lib.rs
1mod builder;
2mod stream;
3pub use builder::{ChainId, ChainName, ConnectionBuilder};
4use ethers::types::{transaction::eip2718::TypedTransaction, Bytes, Signature};
5pub use stream::{Connection, Transactions, TxnStreamError};
6
7/// Wrapper struct for a `ethers-rs` transaction plus signature.
8#[derive(Debug)]
9pub struct Transaction {
10 /// The inner transaction.
11 pub inner: TypedTransaction,
12 /// Inner transaction signature.
13 pub signature: Signature,
14}
15
16impl Transaction {
17 /// Returns the RLP bytes representation of the transaction.
18 /// These [`Bytes`] represent a signed transaction that can be
19 /// relayed to the network.
20 pub fn rlp_signed(&self) -> Bytes {
21 self.inner.rlp_signed(&self.signature)
22 }
23}