Documentation ¶
Index ¶
- Constants
- Variables
- func AllInvariants(k Keeper) sdk.Invariant
- func GetAuctionBidsIndexPrefix(auctionID string) []byte
- func GetAuctionIndexKey(id string) []byte
- func GetBidIndexKey(auctionID string, bidder string) []byte
- func GetBidderToAuctionsIndexKey(bidder string, auctionID string) []byte
- func GetOwnerToAuctionsIndexKey(owner string, auctionID string) []byte
- func ModuleAccountInvariant(k Keeper) sdk.Invariant
- func NewMsgServer(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type AuctionClientKeeper
- type Keeper
- func (k Keeper) CommitBid(ctx sdk.Context, msg types.MsgCommitBid) (*types.Bid, 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 string) *types.Auction
- func (k Keeper) GetAuctionModuleBalances(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetBid(ctx sdk.Context, id string, bidder string) types.Bid
- func (k Keeper) GetBids(ctx sdk.Context, id string) []*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 string) bool
- func (k Keeper) HasBid(ctx sdk.Context, id string, 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) QueryAuctionsByBidder(ctx sdk.Context, bidderAddress string) []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)
- type Querier
- func (q Querier) Auctions(c context.Context, req *types.AuctionsRequest) (*types.AuctionsResponse, error)
- func (q Querier) AuctionsByBidder(c context.Context, req *types.AuctionsByBidderRequest) (*types.AuctionsByBidderResponse, error)
- func (q Querier) AuctionsByOwner(c context.Context, req *types.AuctionsByOwnerRequest) (*types.AuctionsByOwnerResponse, error)
- func (q Querier) Balance(c context.Context, req *types.BalanceRequest) (*types.BalanceResponse, error)
- func (q Querier) GetAuction(c context.Context, req *types.AuctionRequest) (*types.AuctionResponse, error)
- func (q Querier) GetBid(c context.Context, req *types.BidRequest) (*types.BidResponse, error)
- func (q Querier) GetBids(c context.Context, req *types.BidsRequest) (*types.BidsResponse, error)
- func (q Querier) QueryParams(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Constants ¶
const CompletedAuctionDeleteTimeout = 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 PrefixBidderToAuctionsIndex = []byte{0x03}
PrefixBidderToAuctionsIndex is the prefix for the Bidder -> [Auction] 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 GetAuctionIndexKey ¶
Generates Auction Id -> Auction index key.
func GetBidIndexKey ¶
func GetOwnerToAuctionsIndexKey ¶
Generates Owner -> Auctions index key.
func ModuleAccountInvariant ¶
ModuleAccountInvariant checks that the 'auction' module account balance is non-negative.
func NewMsgServer ¶
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 string) bool GetAuction(ctx sdk.Context, id string) 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, storeKey storetypes.StoreKey, cdc codec.BinaryCodec, ps 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) QueryAuctionsByBidder ¶
QueryAuctionsByBidder - query auctions by bidder
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)
type Querier ¶
type Querier struct {
Keeper
}
func (Querier) Auctions ¶
func (q Querier) Auctions(c context.Context, req *types.AuctionsRequest) (*types.AuctionsResponse, error)
Auctions queries all auctions
func (Querier) AuctionsByBidder ¶
func (q Querier) AuctionsByBidder(c context.Context, req *types.AuctionsByBidderRequest) (*types.AuctionsByBidderResponse, error)
AuctionsByBidder queries auctions by bidder
func (Querier) AuctionsByOwner ¶
func (q Querier) AuctionsByOwner(c context.Context, req *types.AuctionsByOwnerRequest) (*types.AuctionsByOwnerResponse, error)
AuctionsByOwner queries auctions by owner
func (Querier) Balance ¶
func (q Querier) Balance(c context.Context, req *types.BalanceRequest) (*types.BalanceResponse, error)
Balance queries the auction module account balance
func (Querier) GetAuction ¶
func (q Querier) GetAuction(c context.Context, req *types.AuctionRequest) (*types.AuctionResponse, error)
GetAuction queries an auction
func (Querier) GetBid ¶
func (q Querier) GetBid(c context.Context, req *types.BidRequest) (*types.BidResponse, error)
GetBid queries and auction bid
func (Querier) GetBids ¶
func (q Querier) GetBids(c context.Context, req *types.BidsRequest) (*types.BidsResponse, error)
GetBids queries all auction bids
func (Querier) QueryParams ¶
func (q Querier) QueryParams(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
QueryParams implements the params query command