keeper

package
v3.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServer

func NewMsgServer(k *Keeper) types.MsgServer

func NewQueryServer

func NewQueryServer(k *Keeper) types.QueryServer

Types

type Keeper

type Keeper struct {
	Schema        collections.Schema
	Assets        collections.Map[string, types.Asset]                 // denom => types.Asset
	TickerIndexes collections.KeySet[collections.Pair[string, string]] // ticker + denom => nil
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.Codec,
	storeService corestoretypes.KVStoreService,
	authority string,
) *Keeper

func (*Keeper) ExportGenesis

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

ExportGenesis returns the GenesisState associated with the given context

func (*Keeper) GetAsset

func (k *Keeper) GetAsset(ctx context.Context, denom string) (types.Asset, error)

GetAsset retrieves an asset from the store. If the asset does not exist, a collections.ErrNotFound error is returned.

func (*Keeper) GetAuthority

func (k *Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (*Keeper) InitGenesis

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

InitGenesis initializes the state from a GenesisState

func (*Keeper) Logger

func (k *Keeper) Logger(ctx context.Context) log.Logger

Logger returns a module-specific logger.

func (*Keeper) RemoveAsset

func (k *Keeper) RemoveAsset(ctx context.Context, denom string) error

RemoveAsset removes the asset having the given denom from the store. If the asset does not exist, a collections.ErrNotFound error is returned.

func (*Keeper) SetAsset

func (k *Keeper) SetAsset(ctx context.Context, asset types.Asset) error

SetAsset stores an asset in the store

Jump to

Keyboard shortcuts

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