keeper

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the token MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	key sdk.StoreKey,

	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	nftKeeper types.NftKeeper,
	distrKeeper types.DistributionKeeper,
	paramSpace paramstypes.Subspace,
) Keeper

func (Keeper) AddListing

func (k Keeper) AddListing(ctx sdk.Context, listing types.Listing) error

AddListing adds a listing in the store and set owner to listing and updates the count

func (Keeper) Auction

func (Keeper) AuctionByNftId

func (Keeper) Auctions

func (Keeper) AuctionsByOwner

func (Keeper) Bid

func (Keeper) Bids

func (Keeper) Buy

func (k Keeper) Buy(ctx sdk.Context, listing types.Listing, buyer sdk.AccAddress) error

func (Keeper) CancelAuctionListing

func (k Keeper) CancelAuctionListing(ctx sdk.Context, auction types.AuctionListing) error

func (Keeper) CreateAuctionListing

func (k Keeper) CreateAuctionListing(ctx sdk.Context, auction types.AuctionListing) error

CreateAuctionListing creates a auction in the store and set owner to auction and updates the next auction number

func (Keeper) DeleteListing

func (k Keeper) DeleteListing(ctx sdk.Context, listing types.Listing)

func (Keeper) DistributeCommission

func (k Keeper) DistributeCommission(ctx sdk.Context, marketplaceCoin sdk.Coin) error

func (Keeper) GetAllAuctionListings

func (k Keeper) GetAllAuctionListings(ctx sdk.Context) (list []types.AuctionListing)

GetAllAuctionListings returns all auction listings

func (Keeper) GetAllBids

func (k Keeper) GetAllBids(ctx sdk.Context) (list []types.Bid)

GetAllBids returns all bids

func (Keeper) GetAllListings

func (k Keeper) GetAllListings(ctx sdk.Context) (list []types.Listing)

GetAllListings returns all listings

func (Keeper) GetAuctionListing

func (k Keeper) GetAuctionListing(ctx sdk.Context, id uint64) (val types.AuctionListing, found bool)

GetAuctionListing returns a auction listing by its id

func (Keeper) GetAuctionListingIdByNftId

func (k Keeper) GetAuctionListingIdByNftId(ctx sdk.Context, nftId string) (val uint64, found bool)

GetListing returns a listing from its nft id

func (Keeper) GetAuctionListingsByOwner

func (k Keeper) GetAuctionListingsByOwner(ctx sdk.Context, owner sdk.AccAddress) (auctionListings []types.AuctionListing)

GetAuctionListingsByOwner returns all auction listings of specific owner

func (Keeper) GetBid

func (k Keeper) GetBid(ctx sdk.Context, id uint64) (val types.Bid, found bool)

GetBid returns a bid of an auction listing by its id

func (Keeper) GetBidCloseDuration

func (k Keeper) GetBidCloseDuration(ctx sdk.Context) (duration time.Duration)

GetBidCloseDuration returns the closing duration for bid for auctions.

func (Keeper) GetBidsByBidder

func (k Keeper) GetBidsByBidder(ctx sdk.Context, bidder sdk.AccAddress) (bids []types.Bid)

GetBidsByBidder returns all bids of specific bidder

func (Keeper) GetListing

func (k Keeper) GetListing(ctx sdk.Context, id string) (val types.Listing, found bool)

GetListing returns a listing from its id

func (Keeper) GetListingCount

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

GetListingCount get the total number of listings

func (Keeper) GetListingIdByNftId

func (k Keeper) GetListingIdByNftId(ctx sdk.Context, nftId string) (val string, found bool)

GetListing returns a listing from its nft id

func (Keeper) GetListingsByOwner

func (k Keeper) GetListingsByOwner(ctx sdk.Context, owner sdk.AccAddress) (listings []types.Listing)

GetListingsByOwner returns all listings of specific owner

func (Keeper) GetMarketplaceAccount

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

GetMarketplaceAccount returns marketplace ModuleAccount

func (Keeper) GetMarketplaceDistributionParams

func (k Keeper) GetMarketplaceDistributionParams(ctx sdk.Context) (distParams types.Distribution)

GetMarketplaceDistributionParams returns the current distribution of marketplace commission.

func (Keeper) GetMaxAuctionDuration

func (k Keeper) GetMaxAuctionDuration(ctx sdk.Context) (duration time.Duration)

GetMaxAuctionDuration returns the maximum duration for auctions.

func (Keeper) GetNewBidPrice

func (k Keeper) GetNewBidPrice(denom string, amount sdk.Coin, increment sdk.Dec) sdk.Coin

func (Keeper) GetNextAuctionNumber

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

GetNextAuctionNumber get the next auction number

func (Keeper) GetParams

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

GetParams gets the parameters for the marketplace module.

func (Keeper) GetProportions

func (k Keeper) GetProportions(totalCoin sdk.Coin, ratio sdk.Dec) sdk.Coin

func (Keeper) GetSaleCommission

func (k Keeper) GetSaleCommission(ctx sdk.Context) (percent sdk.Dec)

GetSaleCommission returns the current sale commission of marketplace.

func (Keeper) HasAuctionListing

func (k Keeper) HasAuctionListing(ctx sdk.Context, id uint64) bool

func (Keeper) HasBid

func (k Keeper) HasBid(ctx sdk.Context, id uint64) bool

func (Keeper) HasListing

func (k Keeper) HasListing(ctx sdk.Context, id string) bool

func (Keeper) IterateActiveAuctions

func (k Keeper) IterateActiveAuctions(ctx sdk.Context, fn func(index int, item types.AuctionListing) (stop bool))

func (Keeper) IterateInactiveAuctions

func (k Keeper) IterateInactiveAuctions(ctx sdk.Context, fn func(index int, item types.AuctionListing) (stop bool))

func (Keeper) Listing

func (Keeper) ListingByNftId

func (Keeper) Listings

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) Params

Params queries params of marketplace module

func (Keeper) PlaceBid

func (k Keeper) PlaceBid(ctx sdk.Context, auction types.AuctionListing, newBid types.Bid) error

func (Keeper) RemoveAuctionListing

func (k Keeper) RemoveAuctionListing(ctx sdk.Context, id uint64)

RemoveAuctionListing removes a auction listing from the store

func (Keeper) RemoveBid

func (k Keeper) RemoveBid(ctx sdk.Context, id uint64)

RemoveBid removes a bid of an auction listing from the store

func (Keeper) RemoveListing

func (k Keeper) RemoveListing(ctx sdk.Context, id string)

RemoveListing removes a listing from the store

func (Keeper) SetActiveAuction

func (k Keeper) SetActiveAuction(ctx sdk.Context, auctionId uint64)

func (Keeper) SetAuctionListing

func (k Keeper) SetAuctionListing(ctx sdk.Context, auctionListing types.AuctionListing)

SetAuctionListing set a specific auction listing in the store

func (Keeper) SetAuctionListingWithNFTID

func (k Keeper) SetAuctionListingWithNFTID(ctx sdk.Context, nftId string, id uint64)

func (Keeper) SetAuctionListingWithOwner

func (k Keeper) SetAuctionListingWithOwner(ctx sdk.Context, owner sdk.AccAddress, id uint64)

func (Keeper) SetAuctionListingWithPriceDenom

func (k Keeper) SetAuctionListingWithPriceDenom(ctx sdk.Context, priceDenom string, id uint64)

func (Keeper) SetBid

func (k Keeper) SetBid(ctx sdk.Context, bid types.Bid)

SetBid set a specific bid for an auction listing in the store

func (Keeper) SetInactiveAuction

func (k Keeper) SetInactiveAuction(ctx sdk.Context, auctionId uint64)

func (Keeper) SetListing

func (k Keeper) SetListing(ctx sdk.Context, listing types.Listing)

SetListing set a specific listing in the store

func (Keeper) SetListingCount

func (k Keeper) SetListingCount(ctx sdk.Context, count uint64)

SetListingCount set the total number of listings

func (Keeper) SetNextAuctionNumber

func (k Keeper) SetNextAuctionNumber(ctx sdk.Context, number uint64)

SetNextAuctionNumber set the next auction number

func (Keeper) SetParams

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

SetParams sets the parameters for the marketplace module.

func (Keeper) SetWithNFTID

func (k Keeper) SetWithNFTID(ctx sdk.Context, nftId, id string)

func (Keeper) SetWithOwner

func (k Keeper) SetWithOwner(ctx sdk.Context, owner sdk.AccAddress, id string)

func (Keeper) SetWithPriceDenom

func (k Keeper) SetWithPriceDenom(ctx sdk.Context, priceDenom, id string)

func (Keeper) UnsetActiveAuction

func (k Keeper) UnsetActiveAuction(ctx sdk.Context, auctionId uint64)

func (Keeper) UnsetAuctionListingWithNFTID

func (k Keeper) UnsetAuctionListingWithNFTID(ctx sdk.Context, nftId string)

func (Keeper) UnsetAuctionListingWithOwner

func (k Keeper) UnsetAuctionListingWithOwner(ctx sdk.Context, owner sdk.AccAddress, id uint64)

func (Keeper) UnsetAuctionListingWithPriceDenom

func (k Keeper) UnsetAuctionListingWithPriceDenom(ctx sdk.Context, priceDenom string, id uint64)

func (Keeper) UnsetInactiveAuction

func (k Keeper) UnsetInactiveAuction(ctx sdk.Context, auctionId uint64)

func (Keeper) UnsetWithNFTID

func (k Keeper) UnsetWithNFTID(ctx sdk.Context, nftId string)

func (Keeper) UnsetWithOwner

func (k Keeper) UnsetWithOwner(ctx sdk.Context, owner sdk.AccAddress, id string)

func (Keeper) UnsetWithPriceDenom

func (k Keeper) UnsetWithPriceDenom(ctx sdk.Context, priceDenom, id string)

func (Keeper) UpdateAuctionStatusesAndProcessBids

func (k Keeper) UpdateAuctionStatusesAndProcessBids(ctx sdk.Context) error

UpdateAuctionStatusesAndProcessBids update all auction listings status

Jump to

Keyboard shortcuts

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