alloy_zksync/network/unsigned_tx/
mod.rs

1use eip712::TxEip712;
2
3pub mod eip712;
4
5/// ZKsync transaction type.
6#[derive(Debug)]
7pub enum TypedTransaction {
8    /// Ethereum-native transaction type, e.g. legacy or EIP-1559.
9    Native(alloy::consensus::TypedTransaction),
10    /// ZKsync-specific EIP-712 transaction type.
11    Eip712(TxEip712),
12}
13
14impl From<crate::network::tx_envelope::TxEnvelope> for TypedTransaction {
15    fn from(value: crate::network::tx_envelope::TxEnvelope) -> Self {
16        match value {
17            crate::network::tx_envelope::TxEnvelope::Native(inner) => Self::Native(inner.into()),
18            super::tx_envelope::TxEnvelope::Eip712(signed) => Self::Eip712(signed.into_parts().0),
19        }
20    }
21}