keeper

package
v0.0.2-0...-13a971e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

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, supplyKeeper types.SupplyKeeper, storeKey sdk.StoreKey, paramstore subspace.Subspace) Keeper

NewKeeper returns a new auction keeper.

func (Keeper) CloseAuction

func (k Keeper) CloseAuction(ctx sdk.Context, auctionID types.ID) sdk.Error

CloseAuction closes an auction and distributes funds to the seller and highest bidder. TODO because this is called by the end blocker, it has to be valid for the duration of the EndTime block. Should maybe move this to a begin blocker?

func (Keeper) DecodeAuction

func (k Keeper) DecodeAuction(ctx sdk.Context, auctionBytes []byte) types.Auction

func (Keeper) DeleteAuction

func (k Keeper) DeleteAuction(ctx sdk.Context, auctionID types.ID)

DeleteAuction removes an auction from the store without any validation

func (Keeper) GetAuction

func (k Keeper) GetAuction(ctx sdk.Context, auctionID types.ID) (types.Auction, bool)

getAuction gets an auction from the store by auctionID

func (Keeper) GetAuctionIterator

func (k Keeper) GetAuctionIterator(ctx sdk.Context) sdk.Iterator

GetAuctionIterator returns an iterator over all auctions in the store

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.AuctionParams)

GetParams gets the auth module's parameters.

func (Keeper) GetQueueIterator

func (k Keeper) GetQueueIterator(ctx sdk.Context, endTime types.EndTime) sdk.Iterator

Returns an iterator for all the auctions in the queue that expire by endTime

func (Keeper) InsertIntoQueue

func (k Keeper) InsertIntoQueue(ctx sdk.Context, endTime types.EndTime, auctionID types.ID)

Inserts a AuctionID into the queue at endTime

func (Keeper) PlaceBid

func (k Keeper) PlaceBid(ctx sdk.Context, auctionID types.ID, bidder sdk.AccAddress, bid sdk.Coin, lot sdk.Coin) sdk.Error

PlaceBid places a bid on any auction.

func (Keeper) SetAuction

func (k Keeper) SetAuction(ctx sdk.Context, auction types.Auction)

SetAuction puts the auction into the database and adds it to the queue it overwrites any pre-existing auction with same ID

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.AuctionParams)

SetParams sets the auth module's parameters.

func (Keeper) StartForwardAuction

func (k Keeper) StartForwardAuction(ctx sdk.Context, seller sdk.AccAddress, lot sdk.Coin, initialBid sdk.Coin) (types.ID, sdk.Error)

StartForwardAuction starts a normal auction. Known as flap in maker.

func (Keeper) StartForwardReverseAuction

func (k Keeper) StartForwardReverseAuction(ctx sdk.Context, seller sdk.AccAddress, lot sdk.Coin, maxBid sdk.Coin, otherPerson sdk.AccAddress) (types.ID, sdk.Error)

StartForwardReverseAuction starts an auction where bidders bid up to a maxBid, then switch to bidding down on price. Known as flip in maker.

func (Keeper) StartReverseAuction

func (k Keeper) StartReverseAuction(ctx sdk.Context, buyer sdk.AccAddress, bid sdk.Coin, initialLot sdk.Coin) (types.ID, sdk.Error)

StartReverseAuction starts an auction where sellers compete by offering decreasing prices. Known as flop in maker.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL