Documentation
¶
Index ¶
- Constants
- Variables
- func AllInvariants(k Keeper) sdk.Invariant
- func GetAuction(store sdk.KVStore, codec *amino.Codec, id types.ID) *types.Auction
- func GetAuctionBidsIndexPrefix(auctionID types.ID) []byte
- func GetAuctionIndexKey(id types.ID) []byte
- func GetBidIndexKey(auctionID types.ID, bidder string) []byte
- func GetBids(store sdk.KVStore, codec *amino.Codec, id types.ID) []*types.Bid
- func GetOwnerToAuctionsIndexKey(owner string, auctionID types.ID) []byte
- func ModuleAccountInvariant(k Keeper) sdk.Invariant
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type AuctionClientKeeper
- type Keeper
- func (k Keeper) CommitBid(ctx sdk.Context, msg types.MsgCommitBid) (*types.Auction, error)
- func (k Keeper) CreateAuction(ctx sdk.Context, msg types.MsgCreateAuction) (*types.Auction, error)
- func (k Keeper) DeleteAuction(ctx sdk.Context, auction types.Auction)
- func (k Keeper) DeleteBid(ctx sdk.Context, bid types.Bid)
- func (k Keeper) EndBlockerProcessAuctions(ctx sdk.Context)
- func (k Keeper) GetAuction(ctx sdk.Context, id types.ID) *types.Auction
- func (k Keeper) GetAuctionModuleBalances(ctx sdk.Context) map[string]sdk.Coins
- func (k Keeper) GetBid(ctx sdk.Context, id types.ID, bidder string) types.Bid
- func (k Keeper) GetBids(ctx sdk.Context, id types.ID) []*types.Bid
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetUsageKeepers() []types.AuctionUsageKeeper
- func (k Keeper) HasAuction(ctx sdk.Context, id types.ID) bool
- func (k Keeper) HasBid(ctx sdk.Context, id types.ID, bidder string) bool
- func (k Keeper) ListAuctions(ctx sdk.Context) []types.Auction
- func (k Keeper) MatchAuctions(ctx sdk.Context, matchFn func(*types.Auction) bool) []*types.Auction
- func (k Keeper) QueryAuctionsByOwner(ctx sdk.Context, ownerAddress string) []types.Auction
- func (k Keeper) RevealBid(ctx sdk.Context, msg types.MsgRevealBid) (*types.Auction, error)
- func (k Keeper) SaveAuction(ctx sdk.Context, auction types.Auction)
- func (k Keeper) SaveBid(ctx sdk.Context, bid types.Bid)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k *Keeper) SetUsageKeepers(usageKeepers []types.AuctionUsageKeeper)
Constants ¶
const ( QueryListAuctions = "list" QueryGetAuction = "get" QueryGetBid = "get-bid" QueryGetBids = "get-bids" QueryByOwner = "query-by-owner" QueryParameters = "parameters" QueryBalance = "balance" )
query endpoints supported by the auction Querier
const CompletedAuctionDeleteTimeout time.Duration = time.Hour * 24
CompletedAuctionDeleteTimeout => Completed auctions are deleted after this timeout (after reveals end time).
Variables ¶
var PrefixAuctionBidsIndex = []byte{0x02}
PrefixAuctionBidsIndex is the prefix for the (auction, bidder) -> Bid index in the KVStore.
var PrefixIDToAuctionIndex = []byte{0x00}
PrefixIDToAuctionIndex is the prefix for ID -> Auction index in the KVStore. Note: This is the primary index in the system. Note: Golang doesn't support const arrays.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the auctions module.
func GetAuction ¶
func GetAuctionIndexKey ¶
Generates Auction ID -> Auction index key.
func GetOwnerToAuctionsIndexKey ¶
Generates Owner -> Auctions index key.
func ModuleAccountInvariant ¶
ModuleAccountInvariant checks that the 'auction' module account balance is non-negative.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all auction module invariants.
Types ¶
type AuctionClientKeeper ¶
type AuctionClientKeeper interface { HasAuction(ctx sdk.Context, id types.ID) bool GetAuction(ctx sdk.Context, id types.ID) types.Auction MatchAuctions(ctx sdk.Context, matchFn func(*types.Auction) bool) []*types.Auction }
AuctionClientKeeper is the subset of functionality exposed to other modules.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper(accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, supplyKeeper supply.Keeper, storeKey sdk.StoreKey, cdc *codec.Codec, paramstore params.Subspace) Keeper
NewKeeper creates new instances of the auction Keeper
func (Keeper) CreateAuction ¶
CreateAuction creates a new auction.
func (Keeper) DeleteAuction ¶
DeleteAuction - deletes the auction.
func (Keeper) EndBlockerProcessAuctions ¶
func (Keeper) GetAuction ¶
GetAuction - gets a record from the store.
func (Keeper) GetAuctionModuleBalances ¶
GetAuctionModuleBalances gets the auction module account(s) balances.
func (Keeper) GetUsageKeepers ¶
func (k Keeper) GetUsageKeepers() []types.AuctionUsageKeeper
func (Keeper) HasAuction ¶
HasAuction - checks if a auction by the given ID exists.
func (Keeper) ListAuctions ¶
ListAuctions - get all auctions.
func (Keeper) MatchAuctions ¶
MatchAuctions - get all matching auctions.
func (Keeper) QueryAuctionsByOwner ¶
QueryAuctionsByOwner - query auctions by owner.
func (Keeper) SaveAuction ¶
SaveAuction - saves a auction to the store.
func (*Keeper) SetUsageKeepers ¶
func (k *Keeper) SetUsageKeepers(usageKeepers []types.AuctionUsageKeeper)