pub async fn get_next_nonce(
        &mut self,
        from_address: Address,
        is_gateway: bool,
    ) -> sqlx::Result<Option<u64>> {
        // First query nonce where `from_addr` is set.
        let row = sqlx::query!(
            r#"
            SELECT
                nonce
            FROM
                eth_txs
            WHERE
                from_addr = $1
                AND is_gateway = $2
            ORDER BY
                id DESC
            LIMIT
                1
            "#,
            from_address.as_bytes(),
            is_gateway,
        )
        .fetch_optional(self.storage.conn())
        .await?;

        Ok(row.map(|a| a.nonce as u64 + 1))
    }
Returns the next nonce for the operator account
core/lib/dal/src/eth_sender_dal.rs