keeper

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 22 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.

Types

type Keeper

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

func NewKeeper

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

	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	nftKeeper types.NftKeeper,
	distrKeeper types.DistributionKeeper,
	authority string,
) 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) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/marketplace module's authority.

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) error

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) TransferRoyalty

func (k Keeper) TransferRoyalty(
	ctx sdk.Context,
	nftRoyaltyShareCoin sdk.Coin,
	royaltyReceivers []*onfttypes.WeightedAddress,
	creator sdk.AccAddress,
) error

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

func (Keeper) ValidateSplitShareAddresses

func (k Keeper) ValidateSplitShareAddresses(splitShares []types.WeightedAddress) error

type Migrator

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

Migrator is a struct for handling in-place state migrations.

func NewMigrator

func NewMigrator(k Keeper, ss exported.Subspace) Migrator

func (Migrator) Migrate2to3

func (m Migrator) Migrate2to3(ctx sdk.Context) error

Migrate2to3 migrates the x/marketplace module state from the consensus version 2 to version 3. Specifically, it takes the parameters that are currently stored and managed by the x/params modules and stores them directly into the x/marketplace module state.

Jump to

Keyboard shortcuts

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