keeper

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the module.

func ExportGenesis added in v0.0.8

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

ExportGenesis returns the module's exported genesis.

func InitGenesis added in v0.0.8

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

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

func RegisterInvariants

func RegisterInvariants(registry sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all the module's invariants.

func SupplyInvariant

func SupplyInvariant(k Keeper) sdk.Invariant

SupplyInvariant checks that the total amount of NFT tokens in the collections matches the total amount NFT tokens in the KVStore.

Types

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey store.StoreKey,
	ps paramtypes.Subspace,
	bk keeper.Keeper,
) *Keeper

NewKeeper creates new Keeper instance.

func (Keeper) BurnToken added in v0.0.8

func (Keeper) Collection added in v0.0.8

func (Keeper) Collections added in v0.0.8

func (Keeper) CollectionsByCreator added in v0.0.8

func (*Keeper) CreateToken added in v0.0.8

func (k *Keeper) CreateToken(ctx sdk.Context, collection types.Collection, token types.Token)

CreateToken writes the new NFT token to the KVStore.

func (*Keeper) GetCollection

func (k *Keeper) GetCollection(ctx sdk.Context, creator sdk.AccAddress, denom string) (collection types.Collection, found bool)

GetCollection returns the NFT collection.

func (*Keeper) GetCollections

func (k *Keeper) GetCollections(ctx sdk.Context) (collections []types.Collection)

GetCollections returns all the NFTs collections.

func (*Keeper) GetMinReserve added in v0.0.8

func (k *Keeper) GetMinReserve(ctx sdk.Context) sdkmath.Int

GetMinReserve returns minimum allowed reserve for each NFT sub-token.

func (*Keeper) GetParams added in v0.0.8

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

GetParams returns the total set of the module parameters.

func (*Keeper) GetSubToken

func (k *Keeper) GetSubToken(ctx sdk.Context, id string, index uint32) (subToken types.SubToken, found bool)

GetSubToken returns the NFT sub-token with specified ID.

func (*Keeper) GetSubTokens

func (k *Keeper) GetSubTokens(ctx sdk.Context, id string) (subTokens []types.SubToken)

GetSubTokens returns existing NFT sub-tokens from the NFT token with specified ID.

func (*Keeper) GetToken added in v0.0.8

func (k *Keeper) GetToken(ctx sdk.Context, id string) (token types.Token, found bool)

GetToken returns the NFT token with specified ID.

func (*Keeper) GetTokens added in v0.0.8

func (k *Keeper) GetTokens(ctx sdk.Context, creator sdk.AccAddress, denom string) (tokens []types.Token)

GetTokens returns all NFT tokens from the NFT collection with specified creator and denom.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MintToken added in v0.0.8

func (*Keeper) ReplaceSubTokenOwner added in v0.1.0

func (k *Keeper) ReplaceSubTokenOwner(ctx sdk.Context, id string, index uint32, newOwner string) error

ReplaceSubTokenOwner replaces sub token owner and make changes in indexes. need for legacy module, for common reason there is TransferSubTokens transaction newOwner must be valid bech32 address, subtoken.Owner MUST BE legacy address with prefix 'dx'

func (*Keeper) ReserveTokens

func (k *Keeper) ReserveTokens(ctx sdk.Context, amount sdk.Coins, address sdk.AccAddress) error

func (*Keeper) ReturnTokensTo

func (k *Keeper) ReturnTokensTo(ctx sdk.Context, amount sdk.Coins, address sdk.AccAddress) error

func (Keeper) SendToken added in v0.0.8

func (*Keeper) SetCollection

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

SetCollection writes the NFT collection to the KVStore.

func (*Keeper) SetParams added in v0.0.8

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

SetParams sets the module parameters to the param space.

func (*Keeper) SetSubToken

func (k *Keeper) SetSubToken(ctx sdk.Context, id string, subToken types.SubToken)

setSubToken writes the NFT sub-token to the KVStore.

func (Keeper) SubToken added in v0.0.8

func (Keeper) Token added in v0.0.8

func (Keeper) TransferSubTokens added in v0.0.8

func (k Keeper) TransferSubTokens(ctx sdk.Context, sender, recipient sdk.AccAddress, tokenID string, subTokenIDs []uint32) error

func (Keeper) UpdateReserve added in v0.0.8

func (Keeper) UpdateToken added in v0.0.8

Jump to

Keyboard shortcuts

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