Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marketplace V2 Expiring Orders #329

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions contracts/stargaze-marketplace-v2/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ pub enum ContractError {
#[error("{0}")]
MarketplaceStdError(#[from] MarketplaceStdError),

#[error("No match found")]
#[error("NoMatchFound")]
NoMatchFound,

#[error("InvalidInput: {0}")]
InvalidInput(String),

#[error("InsufficientFunds")]
InsufficientFunds,
#[error("InsufficientFunds: {0}")]
InsufficientFunds(String),

#[error("InternalError: {0}")]
InternalError(String),
Expand Down
17 changes: 17 additions & 0 deletions contracts/stargaze-marketplace-v2/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,23 @@ impl<'a> From<ListingFeeEvent<'a>> for Event {
}
}

pub struct MinExpiryRewardEvent<'a> {
pub ty: &'a str,
pub denom: &'a str,
pub amount: &'a Option<Uint128>,
}

impl<'a> From<MinExpiryRewardEvent<'a>> for Event {
fn from(mre: MinExpiryRewardEvent) -> Self {
let mut event = Event::new(mre.ty.to_string());
event = event.add_attribute("denom", mre.denom.to_string());
if let Some(amount) = mre.amount {
event = event.add_attribute("reward", amount.to_string());
}
event
}
}

pub struct AskEvent<'a> {
pub ty: &'a str,
pub ask: &'a Ask,
Expand Down
Loading