keeper

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const IbcDenomPrefix = "ibc/"

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all supply invariants

func SupplyInvariant

func SupplyInvariant(k Keeper) sdk.Invariant

SupplyInvariant checks that the total amount of NFTs on collections matches the total amount owned by addresses

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	distrKeeper types.DistributionKeeper,
	authority string,
) Keeper

func (Keeper) Authorize

func (k Keeper) Authorize(
	ctx sdk.Context,
	denomID,
	onftID string,
	owner sdk.AccAddress,
) error

func (Keeper) AuthorizeDenomCreator

func (k Keeper) AuthorizeDenomCreator(ctx sdk.Context, id string, creator sdk.AccAddress) error

func (Keeper) BurnONFT

func (k Keeper) BurnONFT(
	ctx sdk.Context,
	denomID,
	onftID string,
	owner sdk.AccAddress,
) error

func (Keeper) Collection

func (Keeper) DeleteDenomFromStore added in v2.1.0

func (k Keeper) DeleteDenomFromStore(ctx sdk.Context, denomId string)

func (Keeper) Denom

func (Keeper) Denoms

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the onft module's authority.

func (Keeper) GetBalance

func (k Keeper) GetBalance(ctx sdk.Context, id string, owner sdk.AccAddress) (supply uint64)

GetBalance returns the amount of NFTs owned in a class by an account

func (Keeper) GetCollection

func (k Keeper) GetCollection(ctx sdk.Context, denomID string) (types.Collection, error)

func (Keeper) GetCollections

func (k Keeper) GetCollections(ctx sdk.Context) (collections []types.Collection, err error)

func (Keeper) GetDenomCreationFee

func (k Keeper) GetDenomCreationFee(ctx sdk.Context) sdk.Coin

GetDenomCreationFee returns the current denom creation fee coins list and amounts.

func (Keeper) GetDenomInfo

func (k Keeper) GetDenomInfo(ctx sdk.Context, denomID string) (*types.Denom, error)

func (Keeper) GetDenoms

func (k Keeper) GetDenoms(ctx sdk.Context) (denoms []types.Denom, err error)

func (Keeper) GetONFT

func (k Keeper) GetONFT(ctx sdk.Context, denomID, onftID string) (nft exported.ONFTI, err error)

func (Keeper) GetONFTModuleAccount

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

GetONFTModuleAccount returns oNFT ModuleAccount

func (Keeper) GetONFTs

func (k Keeper) GetONFTs(ctx sdk.Context, denomID string) (onfts []exported.ONFTI, err error)

func (Keeper) GetOwnerONFTs

func (k Keeper) GetOwnerONFTs(ctx sdk.Context, denomID string, owner sdk.AccAddress) (onfts []exported.ONFTI, err error)

func (Keeper) GetParams

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

GetParams gets the parameters for the onft module.

func (Keeper) GetTotalSupply

func (k Keeper) GetTotalSupply(ctx sdk.Context, denomID string) uint64

func (Keeper) HasDenom

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

func (Keeper) HasONFT

func (k Keeper) HasONFT(ctx sdk.Context, denomID, onftID string) bool

func (Keeper) HasPermissionToMint

func (k Keeper) HasPermissionToMint(ctx sdk.Context, denomID string, sender sdk.AccAddress) bool

func (Keeper) IBCDenom

func (Keeper) IBCDenomONFT

func (Keeper) IBCDenomSupply

func (Keeper) Logger

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

func (Keeper) MintONFT

func (k Keeper) MintONFT(
	ctx sdk.Context,
	denomID,
	nftID,
	name,
	description,
	mediaURI,
	uriHash,
	previewURI,
	nftData string,
	createdAt time.Time,
	transferable,
	extensible,
	nsfw bool,
	royaltyShare sdk.Dec,
	receiver sdk.AccAddress,
) error

func (Keeper) NFTkeeper

func (k Keeper) NFTkeeper() nftkeeper.Keeper

NFTkeeper returns a cosmos-sdk nftkeeper.Keeper.

func (Keeper) ONFT

func (Keeper) OwnerIBCDenomONFTs

func (Keeper) OwnerONFTs

func (Keeper) Params

Params queries params of oNFT module

func (Keeper) PurgeDenom added in v2.1.0

func (k Keeper) PurgeDenom(
	ctx sdk.Context,
	denomID string,
	sender sdk.AccAddress,
) error

PurgeDenom deletes the denom if no nfts in it

func (Keeper) SaveDenom

func (k Keeper) SaveDenom(
	ctx sdk.Context,
	id,
	symbol,
	name,
	schema string,
	creator sdk.AccAddress,
	description,
	previewUri string,
	uri,
	uriHash,
	data string,
	royaltyReceivers []*types.WeightedAddress,
) error

SaveDenom saves a denom

func (Keeper) SetCollection

func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection) error

func (Keeper) SetParams

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

SetParams sets the parameters for the onft module.

func (Keeper) Supply

func (Keeper) TransferDenomOwner

func (k Keeper) TransferDenomOwner(
	ctx sdk.Context,
	denomID string,
	srcOwner,
	dstOwner sdk.AccAddress,
) error

TransferDenomOwner transfers the ownership to new address

func (Keeper) TransferOwnership

func (k Keeper) TransferOwnership(ctx sdk.Context, denomID, onftID string, srcOwner, dstOwner sdk.AccAddress) error

func (Keeper) UpdateDenom

func (k Keeper) UpdateDenom(ctx sdk.Context, msg *types.MsgUpdateDenom) 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) Migrate1to2

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

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

migrates onft store to x/nft

Jump to

Keyboard shortcuts

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