keeper

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 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 module MsgServer interface.

Types

type Keeper

type Keeper struct {

	// state management
	Params       collections.Item[types.Params]
	ChainConfigs collections.Map[string, types.ChainConfig]
	TokenConfigs *collections.IndexedMap[string, types.TokenConfig, TokenConfigIndexes]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService storetypes.KVStoreService,
	logger log.Logger,
	authority string,
	evmKeeper types.EVMKeeper,
) Keeper

NewKeeper creates a new Keeper instance

func (Keeper) AddChainConfig

func (k Keeper) AddChainConfig(ctx context.Context, chainConfig *types.ChainConfig) error

addChainConfig is for adding a new chain configuration

func (Keeper) AddTokenConfig

func (k Keeper) AddTokenConfig(ctx context.Context, tokenConfig *types.TokenConfig) error

AddTokenConfig adds a new token configuration to the uregistry.

func (*Keeper) ExportGenesis

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

ExportGenesis exports the module's state to a genesis state.

func (Keeper) FixReservedBytecode added in v0.0.16

func (k Keeper) FixReservedBytecode(ctx context.Context) error

func (Keeper) GetChainConfig

func (k Keeper) GetChainConfig(ctx context.Context, chain string) (types.ChainConfig, error)

func (Keeper) GetTokenConfig

func (k Keeper) GetTokenConfig(ctx context.Context, chain, address string) (types.TokenConfig, error)

func (Keeper) GetTokenConfigByPRC20 added in v0.0.13

func (k Keeper) GetTokenConfigByPRC20(
	ctx context.Context,
	chain string,
	prc20Addr string,
) (types.TokenConfig, error)

GetTokenConfigByPRC20 looks up a token config by PRC20 address via the PRC20Index (O(1)). Returns ErrNotFound if the registered chain doesn't match.

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error

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

func (Keeper) IsChainInboundEnabled

func (k Keeper) IsChainInboundEnabled(ctx context.Context, chain string) (bool, error)

IsChainInboundEnabled checks if inbound is enabled for a given chain

func (Keeper) IsChainOutboundEnabled

func (k Keeper) IsChainOutboundEnabled(ctx context.Context, chain string) (bool, error)

IsChainOutboundEnabled checks if outbound is enabled for a given chain

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

func (Keeper) RebuildPRC20Index added in v0.0.40

func (k Keeper) RebuildPRC20Index(ctx context.Context) error

RebuildPRC20Index repopulates the PRC20 secondary index from the primary TokenConfigs map. Pre-upgrade nodes wrote token rows before the PRC20Index existed, so on upgrade the primary store is full while the index is empty. The upgrade migration calls this to backfill it: re-Setting each row re-runs the index function. It is idempotent (Set removes the stale index ref before writing the new one) and a no-op on already-indexed or empty state.

func (Keeper) RemoveTokenConfig

func (k Keeper) RemoveTokenConfig(ctx context.Context, chain, tokenAddress string) error

RemoveTokenConfig removes an existing token configuration in the uregistry.

func (Keeper) ReserveUGPC added in v0.0.14

func (k Keeper) ReserveUGPC(ctx context.Context) error

func (Keeper) SchemaBuilder

func (k Keeper) SchemaBuilder() *collections.SchemaBuilder

func (Keeper) UpdateChainConfig

func (k Keeper) UpdateChainConfig(ctx context.Context, chainConfig *types.ChainConfig) error

UpdateChainConfig updates the configuration for a specific chain.

func (Keeper) UpdateParams

func (k Keeper) UpdateParams(ctx context.Context, params types.Params) error

updateParams is for updating params collections of the module

func (Keeper) UpdateTokenConfig

func (k Keeper) UpdateTokenConfig(ctx context.Context, tokenConfig *types.TokenConfig) error

UpdateTokenConfig updates an existing token configuration in the uregistry.

type Querier

type Querier struct {
	Keeper
}

func NewQuerier

func NewQuerier(keeper Keeper) Querier

func (Querier) AllChainConfigs

AllChainConfigs implements types.QueryServer with pagination.

func (Querier) AllTokenConfigs

AllTokenConfigs implements types.QueryServer with pagination.

func (Querier) ChainConfig

ChainConfig implements types.QueryServer.

func (Querier) Params

func (Querier) TokenConfig

TokenConfig implements types.QueryServer.

func (Querier) TokenConfigsByChain

TokenConfigsByChain implements types.QueryServer with pagination + key-prefix filter. Storage key is "<chain>:<address>", so we filter at the key level.

type TokenConfigIndexes added in v0.0.40

type TokenConfigIndexes struct {
	PRC20Index *indexes.Multi[string, string, types.TokenConfig]
}

TokenConfigIndexes: PRC20Index maps canonical (EIP-55) PRC20 contract address → token storage key for O(1) GetTokenConfigByPRC20. Rows without NativeRepresentation index under the empty-string sentinel which is never queried. Framework auto-maintains on every Set/Remove.

func (TokenConfigIndexes) IndexesList added in v0.0.40

Jump to

Keyboard shortcuts

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