Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types2.MsgServer
- func NewQueryServerImpl(k Keeper) types2.QueryServer
- type Keeper
- func (k Keeper) CloseAuction(rctx context.Context, auctionID uint64) error
- func (k Keeper) CloseExpiredAuctions(rctx context.Context) error
- func (k Keeper) DeleteAuction(rctx context.Context, auctionID uint64)
- func (k Keeper) GetAllAuctions(ctx context.Context) (auctions []types2.Auction)
- func (k Keeper) GetAuction(rctx context.Context, auctionID uint64) (types2.Auction, bool)
- func (k Keeper) GetNextAuctionID(rctx context.Context) (uint64, error)
- func (k Keeper) GetParams(ctx context.Context) (params types.Params)
- func (k Keeper) IncrementNextAuctionID(ctx context.Context) error
- func (k Keeper) InsertIntoByTimeIndex(rctx context.Context, endTime time.Time, auctionID uint64)
- func (k Keeper) IterateAuctions(rctx context.Context, cb func(auction types2.Auction) (stop bool))
- func (k Keeper) IterateAuctionsByTime(rctx context.Context, inclusiveCutoffTime time.Time, ...)
- func (k Keeper) Logger(rctx context.Context) log.Logger
- func (k Keeper) MarshalAuction(auctionI types2.Auction) ([]byte, error)
- func (k Keeper) MustMarshalAuction(auction types2.Auction) []byte
- func (k Keeper) MustUnmarshalAuction(bz []byte) types2.Auction
- func (k Keeper) PayoutCollateralAuction(ctx context.Context, auction *types2.CollateralAuction) error
- func (k Keeper) PayoutDebtAuction(ctx context.Context, auction *types2.DebtAuction) error
- func (k Keeper) PayoutSurplusAuction(ctx context.Context, auction *types2.SurplusAuction) error
- func (k Keeper) PlaceBid(rctx context.Context, auctionID uint64, bidder sdk.AccAddress, ...) error
- func (k Keeper) PlaceBidDebt(rctx context.Context, auction *types2.DebtAuction, bidder sdk.AccAddress, ...) (*types2.DebtAuction, error)
- func (k Keeper) PlaceBidSurplus(rctx context.Context, auction *types2.SurplusAuction, bidder sdk.AccAddress, ...) (*types2.SurplusAuction, error)
- func (k Keeper) PlaceForwardBidCollateral(rctx context.Context, auction *types2.CollateralAuction, bidder sdk.AccAddress, ...) (*types2.CollateralAuction, error)
- func (k Keeper) PlaceReverseBidCollateral(rctx context.Context, auction *types2.CollateralAuction, bidder sdk.AccAddress, ...) (*types2.CollateralAuction, error)
- func (k Keeper) SetAuction(rctx context.Context, auction types2.Auction)
- func (k Keeper) SetNextAuctionID(rctx context.Context, id uint64)
- func (k Keeper) SetParams(ctx context.Context, params types.Params)
- func (k Keeper) StartCollateralAuction(rctx context.Context, seller string, lot, maxBid sdk.Coin, ...) (uint64, error)
- func (k Keeper) StartDebtAuction(rctx context.Context, buyer string, bid sdk.Coin, initialLot sdk.Coin, ...) (uint64, error)
- func (k Keeper) StartSurplusAuction(rctx context.Context, seller string, lot sdk.Coin, bidDenom string) (uint64, error)
- func (k Keeper) StoreNewAuction(ctx context.Context, auction types2.Auction) (uint64, error)
- func (k Keeper) UnmarshalAuction(bz []byte) (types2.Auction, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the auction MsgServer interface for the provided Keeper.
func NewQueryServerImpl ¶
func NewQueryServerImpl(k Keeper) types2.QueryServer
NewQueryServerImpl creates a new server for handling gRPC queries.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey, paramstore paramtypes.Subspace, bankKeeper types2.BankKeeper, accountKeeper types2.AccountKeeper, ) 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 iterates over all the auctions stored by until the current block timestamp and 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) GetAllAuctions ¶
GetAllAuctions returns all auctions from the store
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(rctx context.Context, inclusiveCutoffTime time.Time, cb func(auctionID uint64) (stop bool))
IterateAuctionsByTime provides an iterator over auctions ordered by auction.EndTime. For each auction cb will be called. If cb returns true the iterator will close and stop.
func (Keeper) MarshalAuction ¶
MarshalAuction protobuf serializes an Auction interface
func (Keeper) MustMarshalAuction ¶
MustMarshalAuction attempts to encode an Auction object and returns the raw encoded bytes. It panics on error.
func (Keeper) MustUnmarshalAuction ¶
MustUnmarshalAuction attempts to decode and return an Auction object from raw encoded bytes. It panics on error.
func (Keeper) PayoutCollateralAuction ¶
func (k Keeper) PayoutCollateralAuction(ctx context.Context, auction *types2.CollateralAuction) error
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(rctx context.Context, auctionID uint64, bidder sdk.AccAddress, newAmount sdk.Coin) error
PlaceBid places a bid on any auction.
func (Keeper) PlaceBidDebt ¶
func (k Keeper) PlaceBidDebt(rctx context.Context, auction *types2.DebtAuction, bidder sdk.AccAddress, lot sdk.Coin) (*types2.DebtAuction, error)
PlaceBidDebt places a reverse bid on a debt auction, moving coins and returning the updated auction.
func (Keeper) PlaceBidSurplus ¶
func (k Keeper) PlaceBidSurplus(rctx context.Context, auction *types2.SurplusAuction, bidder sdk.AccAddress, bid sdk.Coin) (*types2.SurplusAuction, error)
PlaceBidSurplus places a forward bid on a surplus auction, moving coins and returning the updated auction.
func (Keeper) PlaceForwardBidCollateral ¶
func (k Keeper) PlaceForwardBidCollateral(rctx context.Context, auction *types2.CollateralAuction, bidder sdk.AccAddress, bid sdk.Coin) (*types2.CollateralAuction, error)
PlaceForwardBidCollateral places a forward bid on a collateral auction, moving coins and returning the updated auction.
func (Keeper) PlaceReverseBidCollateral ¶
func (k Keeper) PlaceReverseBidCollateral(rctx context.Context, auction *types2.CollateralAuction, bidder sdk.AccAddress, lot sdk.Coin) (*types2.CollateralAuction, 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( rctx context.Context, seller string, lot, maxBid sdk.Coin, lotReturnAddrs []sdk.AccAddress, lotReturnWeights []sdkmath.Int, debt sdk.Coin, ) (uint64, error)
StartCollateralAuction starts a new collateral (2-phase) auction.
func (Keeper) StartDebtAuction ¶
func (k Keeper) StartDebtAuction(rctx context.Context, buyer string, bid sdk.Coin, initialLot sdk.Coin, debt sdk.Coin) (uint64, error)
StartDebtAuction starts a new debt (reverse) auction.
func (Keeper) StartSurplusAuction ¶
func (k Keeper) StartSurplusAuction(rctx context.Context, seller string, lot sdk.Coin, bidDenom string) (uint64, error)
StartSurplusAuction starts a new surplus (forward) auction.
func (Keeper) StoreNewAuction ¶
StoreNewAuction stores an auction, adding a new ID