Trait orml_traits::auction::AuctionHandler[][src]

pub trait AuctionHandler<AccountId, Balance, BlockNumber, AuctionId> {
    fn on_new_bid(
        now: BlockNumber,
        id: AuctionId,
        new_bid: (AccountId, Balance),
        last_bid: Option<(AccountId, Balance)>
    ) -> OnNewBidResult<BlockNumber>;
fn on_auction_ended(id: AuctionId, winner: Option<(AccountId, Balance)>); }

Hooks for auction to handle bids.

Required methods

fn on_new_bid(
    now: BlockNumber,
    id: AuctionId,
    new_bid: (AccountId, Balance),
    last_bid: Option<(AccountId, Balance)>
) -> OnNewBidResult<BlockNumber>
[src]

Called when new bid is received. The return value determines if the bid should be accepted and update auction end time. Implementation should reserve money from current winner and refund previous winner.

fn on_auction_ended(id: AuctionId, winner: Option<(AccountId, Balance)>)[src]

End an auction with winner

Loading content...

Implementors

Loading content...