diff --git a/crates/orderbook/src/events/order_placed.rs b/crates/orderbook/src/events/order_placed.rs index b1a87c6e..c6c022dc 100644 --- a/crates/orderbook/src/events/order_placed.rs +++ b/crates/orderbook/src/events/order_placed.rs @@ -40,6 +40,14 @@ abigen!( { "name": "Erc721ToErc20", "type": "()" + }, + { + "name": "Erc20ToErc1155", + "type": "()" + }, + { + "name": "Erc1155ToErc20", + "type": "()" } ] }, @@ -198,3 +206,25 @@ impl TryFrom for OrderPlaced { } } } + +impl From<&RouteType> for crate::RouteType { + fn from(value: &RouteType) -> Self { + match value { + RouteType::Erc20ToErc721 => crate::RouteType::Erc20ToErc721, + RouteType::Erc721ToErc20 => crate::RouteType::Erc721ToErc20, + RouteType::Erc20ToErc1155 => crate::RouteType::Erc20ToErc1155, + RouteType::Erc1155ToErc20 => crate::RouteType::Erc1155ToErc20, + } + } +} + +impl From<&OrderType> for crate::OrderType { + fn from(value: &OrderType) -> Self { + match value { + OrderType::Listing => crate::OrderType::Listing, + OrderType::Auction => crate::OrderType::Auction, + OrderType::Offer => crate::OrderType::Offer, + OrderType::CollectionOffer => crate::OrderType::CollectionOffer, + } + } +} diff --git a/crates/orderbook/src/lib.rs b/crates/orderbook/src/lib.rs index e140f9fb..3f9667b2 100644 --- a/crates/orderbook/src/lib.rs +++ b/crates/orderbook/src/lib.rs @@ -43,3 +43,29 @@ impl From for Event { } } } + +pub enum RouteType { + Erc20ToErc721, + Erc721ToErc20, + Erc20ToErc1155, + Erc1155ToErc20, +} + +pub enum OrderType { + Listing, + Auction, + Offer, + CollectionOffer, +} + +pub mod error { + use starknet::core::types::Felt; + + pub const CANCELLED_USER: Felt = Felt::from_hex_unchecked("0x43414e43454c4c45445f55534552"); + pub const CANCELLED_BY_NEW_ORDER: Felt = + Felt::from_hex_unchecked("0x43414e43454c4c45445f4e45575f4f52444552"); + pub const CANCELLED_ASSET_FAULT: Felt = + Felt::from_hex_unchecked("0x43414e43454c4c45445f41535345545f4641554c54"); + pub const CANCELLED_OWNERSHIP: Felt = + Felt::from_hex_unchecked("0x43414e43454c4c45445f4f574e455253484950"); +}