keeper

package
v7.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState

ExportGenesis returns the module's exported genesis.

func HandleSetTokenPricesProposal

func HandleSetTokenPricesProposal(ctx sdk.Context, k Keeper, p types.SetTokenPricesProposal) error

HandleSetTokenPricesProposal is a handler for executing a passed community token price update proposal

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, gs types.GenesisState)

InitGenesis initializes the module's state from a provided genesis state.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Keeper of the auction store

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace,
	bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, fundingModuleAccounts map[string]bool, proceedsModuleAccounts map[string]bool,
) Keeper

NewKeeper creates a new auction Keeper instance

func (Keeper) BeginAuction

func (k Keeper) BeginAuction(ctx sdk.Context,
	startingTokensForSale sdk.Coin,
	initialPriceDecreaseRate sdk.Dec,
	priceDecreaseBlockInterval uint64,
	fundingModuleAccount string,
	proceedsModuleAccount string) error

BeginAuction starts a new auction for a single denomination

func (Keeper) BeginBlocker

func (k Keeper) BeginBlocker(ctx sdk.Context)

BeginBlocker is called at the beginning of every block

func (Keeper) EndBlocker

func (k Keeper) EndBlocker(ctx sdk.Context)

EndBlocker is called at the end of every block

func (Keeper) FinishAuction

func (k Keeper) FinishAuction(ctx sdk.Context, auction *types.Auction) error

FinishAuction completes an auction by sending relevant funds to destination addresses and updates state

func (Keeper) GetActiveAuctionByID

func (k Keeper) GetActiveAuctionByID(ctx sdk.Context, id uint32) (types.Auction, bool)

GetActiveAuctionByID returns a specific active auction

func (Keeper) GetActiveAuctions

func (k Keeper) GetActiveAuctions(ctx sdk.Context) []*types.Auction

GetActiveAuctions returns all active auctions

func (Keeper) GetAuctionAccount

func (k Keeper) GetAuctionAccount(ctx sdk.Context) authtypes.ModuleAccountI

Get the auction module account

func (Keeper) GetBid

func (k Keeper) GetBid(ctx sdk.Context, auctionID uint32, bidID uint64) (types.Bid, bool)

GetBid returns a specified bid by its id (if it has not been pruned)

func (Keeper) GetBids

func (k Keeper) GetBids(ctx sdk.Context) []*types.Bid

GetBids returns all stored bids (that have not been pruned)

func (Keeper) GetBidsByAuctionID

func (k Keeper) GetBidsByAuctionID(ctx sdk.Context, auctionID uint32) []*types.Bid

GetBidsByAuctionID returns all stored bids for an auction id (that have not been pruned)

func (Keeper) GetEndedAuctionByID

func (k Keeper) GetEndedAuctionByID(ctx sdk.Context, id uint32) (types.Auction, bool)

GetEndedAuctionByID returns a specific active auction

func (Keeper) GetEndedAuctions

func (k Keeper) GetEndedAuctions(ctx sdk.Context) []*types.Auction

GetEndedAuctions returns all inactive auctions (that have not been pruned)

func (Keeper) GetLastAuctionID

func (k Keeper) GetLastAuctionID(ctx sdk.Context) uint32

GetLastAuctionID gets the last auction id

func (Keeper) GetLastBidID

func (k Keeper) GetLastBidID(ctx sdk.Context) uint64

GetLastBidID gets the last bid id

func (Keeper) GetParamSet

func (k Keeper) GetParamSet(ctx sdk.Context) types.Params

GetParamSet returns the vote period from the parameters

func (Keeper) GetTokenPrice

func (k Keeper) GetTokenPrice(ctx sdk.Context, denom string) (types.TokenPrice, bool)

GetTokenPrice returns the stored token price

func (Keeper) GetTokenPrices

func (k Keeper) GetTokenPrices(ctx sdk.Context) []*types.TokenPrice

GetTokenPrices returns all stored token prices

func (Keeper) IterateAuctions

func (k Keeper) IterateAuctions(ctx sdk.Context, auctionTypePrefix []byte, handler func(auctionID uint32, auction types.Auction) (stop bool))

IterateAuctions iterates over all auctions in the store for a given prefix auctionTypePrefix for specifying whether we are iterating over active or ended auctions

func (Keeper) IterateBids

func (k Keeper) IterateBids(ctx sdk.Context, handler func(auctionID uint32, bidID uint64, bid types.Bid) (stop bool))

IterateBids iterates over all bids in the store

func (Keeper) IterateBidsByAuction

func (k Keeper) IterateBidsByAuction(ctx sdk.Context, auctionID uint32, handler func(auctionID uint32, bidID uint64, bid types.Bid) (stop bool))

IterateBidsByAuction iterates over all bids in the store for a given auction

func (Keeper) IterateTokenPrices

func (k Keeper) IterateTokenPrices(ctx sdk.Context, handler func(denom string, tokenPrice types.TokenPrice) (stop bool))

IterateTokenPrices iterates over all token prices in the store

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) QueryActiveAuction

QueryActiveAuction implements QueryServer

func (Keeper) QueryActiveAuctions

QueryActiveAuctions implements QueryServer

func (Keeper) QueryBid

func (k Keeper) QueryBid(c context.Context, request *types.QueryBidRequest) (*types.QueryBidResponse, error)

QueryBid implements QueryServer

func (Keeper) QueryBidsByAuction

QueryBidsByAuction implements QueryServer

func (Keeper) QueryEndedAuction

QueryEndedAuction implements QueryServer

func (Keeper) QueryEndedAuctions

QueryEndedAuctions implements QueryServer

func (Keeper) QueryParams

QueryParams implements QueryServer

func (Keeper) QueryTokenPrice

QueryTokenPrice implements QueryServer

func (Keeper) QueryTokenPrices

QueryTokenPrices implements QueryServer

func (Keeper) SubmitBid

SubmitBid implements types.MsgServer

Jump to

Keyboard shortcuts

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