Documentation ¶
Index ¶
- func NewQuerier(keeper Keeper) sdk.Querier
- type Keeper
- func (k Keeper) CloseAuction(ctx sdk.Context, auctionID uint64) sdk.Error
- func (k Keeper) CloseExpiredAuctions(ctx sdk.Context) sdk.Error
- func (k Keeper) DeleteAuction(ctx sdk.Context, auctionID uint64)
- func (k Keeper) GetAuction(ctx sdk.Context, auctionID uint64) (types.Auction, bool)
- func (k Keeper) GetNextAuctionID(ctx sdk.Context) (uint64, sdk.Error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) IncrementNextAuctionID(ctx sdk.Context) sdk.Error
- func (k Keeper) InsertIntoByTimeIndex(ctx sdk.Context, endTime time.Time, auctionID uint64)
- func (k Keeper) IterateAuctions(ctx sdk.Context, cb func(auction types.Auction) (stop bool))
- func (k Keeper) IterateAuctionsByTime(ctx sdk.Context, inclusiveCutoffTime time.Time, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) PayoutCollateralAuction(ctx sdk.Context, a types.CollateralAuction) sdk.Error
- func (k Keeper) PayoutDebtAuction(ctx sdk.Context, a types.DebtAuction) sdk.Error
- func (k Keeper) PayoutSurplusAuction(ctx sdk.Context, a types.SurplusAuction) sdk.Error
- func (k Keeper) PlaceBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, newAmount sdk.Coin) sdk.Error
- func (k Keeper) PlaceBidDebt(ctx sdk.Context, a types.DebtAuction, bidder sdk.AccAddress, lot sdk.Coin) (types.DebtAuction, sdk.Error)
- func (k Keeper) PlaceBidSurplus(ctx sdk.Context, a types.SurplusAuction, bidder sdk.AccAddress, bid sdk.Coin) (types.SurplusAuction, sdk.Error)
- func (k Keeper) PlaceForwardBidCollateral(ctx sdk.Context, a types.CollateralAuction, bidder sdk.AccAddress, ...) (types.CollateralAuction, sdk.Error)
- func (k Keeper) PlaceReverseBidCollateral(ctx sdk.Context, a types.CollateralAuction, bidder sdk.AccAddress, ...) (types.CollateralAuction, sdk.Error)
- func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auction)
- func (k Keeper) SetNextAuctionID(ctx sdk.Context, id uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) StartCollateralAuction(ctx sdk.Context, seller string, lot sdk.Coin, maxBid sdk.Coin, ...) (uint64, sdk.Error)
- func (k Keeper) StartDebtAuction(ctx sdk.Context, buyer string, bid sdk.Coin, initialLot sdk.Coin, ...) (uint64, sdk.Error)
- func (k Keeper) StartSurplusAuction(ctx sdk.Context, seller string, lot sdk.Coin, bidDenom string) (uint64, sdk.Error)
- func (k Keeper) StoreNewAuction(ctx sdk.Context, auction types.Auction) (uint64, sdk.Error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
NewQuerier is the module level router for state queries
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, supplyKeeper types.SupplyKeeper, paramstore subspace.Subspace) Keeper
NewKeeper returns a new auction keeper.
func (Keeper) CloseAuction ¶
CloseAuction closes an auction and distributes funds to the highest bidder.
func (Keeper) CloseExpiredAuctions ¶
CloseExpiredAuctions finds all auctions that are past (or at) their ending times and closes them, paying out to the highest bidder.
func (Keeper) DeleteAuction ¶
DeleteAuction removes an auction from the store, and any indexes.
func (Keeper) GetAuction ¶
GetAuction gets an auction from the store.
func (Keeper) GetNextAuctionID ¶
GetNextAuctionID reads the next available global ID from store
func (Keeper) IncrementNextAuctionID ¶
IncrementNextAuctionID increments the next auction ID in the store by 1.
func (Keeper) InsertIntoByTimeIndex ¶
InsertIntoByTimeIndex adds an auction ID and end time into the byTime index.
func (Keeper) IterateAuctions ¶
IterateAuctions provides an iterator over all stored auctions. For each auction, cb will be called. If cb returns true, the iterator will close and stop.
func (Keeper) IterateAuctionsByTime ¶
func (k Keeper) IterateAuctionsByTime(ctx sdk.Context, inclusiveCutoffTime time.Time, cb func(auctionID uint64) (stop bool))
IterateAuctionByTime provides an iterator over auctions ordered by auction.EndTime. For each auction cb will be callled. If cb returns true the iterator will close and stop.
func (Keeper) PayoutCollateralAuction ¶
PayoutCollateralAuction pays out the proceeds for a collateral auction.
func (Keeper) PayoutDebtAuction ¶
PayoutDebtAuction pays out the proceeds for a debt auction, first minting the coins.
func (Keeper) PayoutSurplusAuction ¶
PayoutSurplusAuction pays out the proceeds for a surplus auction.
func (Keeper) PlaceBid ¶
func (k Keeper) PlaceBid(ctx sdk.Context, auctionID uint64, bidder sdk.AccAddress, newAmount sdk.Coin) sdk.Error
PlaceBid places a bid on any auction.
func (Keeper) PlaceBidDebt ¶
func (k Keeper) PlaceBidDebt(ctx sdk.Context, a types.DebtAuction, bidder sdk.AccAddress, lot sdk.Coin) (types.DebtAuction, sdk.Error)
PlaceBidDebt places a reverse bid on a debt auction, moving coins and returning the updated auction.
func (Keeper) PlaceBidSurplus ¶
func (k Keeper) PlaceBidSurplus(ctx sdk.Context, a types.SurplusAuction, bidder sdk.AccAddress, bid sdk.Coin) (types.SurplusAuction, sdk.Error)
PlaceBidSurplus places a forward bid on a surplus auction, moving coins and returning the updated auction.
func (Keeper) PlaceForwardBidCollateral ¶
func (k Keeper) PlaceForwardBidCollateral(ctx sdk.Context, a types.CollateralAuction, bidder sdk.AccAddress, bid sdk.Coin) (types.CollateralAuction, sdk.Error)
PlaceForwardBidCollateral places a forward bid on a collateral auction, moving coins and returning the updated auction.
func (Keeper) PlaceReverseBidCollateral ¶
func (k Keeper) PlaceReverseBidCollateral(ctx sdk.Context, a types.CollateralAuction, bidder sdk.AccAddress, lot sdk.Coin) (types.CollateralAuction, sdk.Error)
PlaceReverseBidCollateral places a reverse bid on a collateral auction, moving coins and returning the updated auction.
func (Keeper) SetAuction ¶
SetAuction puts the auction into the store, and updates any indexes.
func (Keeper) SetNextAuctionID ¶
SetNextAuctionID stores an ID to be used for the next created auction
func (Keeper) StartCollateralAuction ¶
func (k Keeper) StartCollateralAuction(ctx sdk.Context, seller string, lot sdk.Coin, maxBid sdk.Coin, lotReturnAddrs []sdk.AccAddress, lotReturnWeights []sdk.Int, debt sdk.Coin) (uint64, sdk.Error)
StartCollateralAuction starts a new collateral (2-phase) auction.
func (Keeper) StartDebtAuction ¶
func (k Keeper) StartDebtAuction(ctx sdk.Context, buyer string, bid sdk.Coin, initialLot sdk.Coin, debt sdk.Coin) (uint64, sdk.Error)
StartDebtAuction starts a new debt (reverse) auction.