Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod block;
pub use block::{decode_txns, encode_txns, Alloy2718Coder, Coder, ZenithBlock, ZenithTransaction};

mod orders;
pub use orders::AggregateOrders;
pub use orders::{AggregateOrders, SignedOrder};

mod req;
pub use req::SignRequest;
Expand Down
3 changes: 3 additions & 0 deletions crates/types/src/orders/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
mod agg;
pub use agg::AggregateOrders;

mod signed;
pub use signed::SignedOrder;
20 changes: 20 additions & 0 deletions crates/types/src/orders/signed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use crate::bindings::HostOrders::{Output, Permit2Batch};
use serde::{Deserialize, Serialize};

/// A signed order.
/// TODO: Link to docs.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
pub struct SignedOrder {
/// The permit batch.
#[serde(flatten)]
pub permit: Permit2Batch,
/// The desired outputs.
pub outputs: Vec<Output>,
}

impl SignedOrder {
/// Creates a new signed order.
pub fn new(permit: Permit2Batch, outputs: Vec<Output>) -> Self {
Self { permit, outputs }
}
}