keeper

package
v28.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StoreKeyContracts    = []byte("contracts")
	StoreKeyContractUses = []byte("contract-uses")
)

Functions

func NewMsgServerImpl

func NewMsgServerImpl(k Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the x/cw-hooks MsgServer interface.

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) types.QueryServer

Types

type Keeper

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

Keeper of this module maintains collections of feeshares for contracts registered to receive transaction fees.

func NewKeeper

NewKeeper creates new instances of the fees Keeper

func (Keeper) CanContractCoverFee

func (k Keeper) CanContractCoverFee(fpc *types.FeePayContract, fee uint64) bool

Check if a fee pay contract has a balance greater than or equal to the fee

func (Keeper) ExportGenesis

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

ExportGenesis export module state

func (Keeper) FundContract

func (k Keeper) FundContract(ctx context.Context, fpc *types.FeePayContract, senderAddr sdk.AccAddress, coins sdk.Coins) error

Fund an existing fee pay contract

func (Keeper) GetAllContracts

func (k Keeper) GetAllContracts(ctx context.Context) []types.FeePayContract

GetAllContracts returns all the registered FeePay contracts.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/feeshare module's authority.

func (Keeper) GetContract

func (k Keeper) GetContract(ctx context.Context, contractAddress string) (*types.FeePayContract, error)

Get a contract from KV store

func (Keeper) GetContractUses

func (k Keeper) GetContractUses(ctx context.Context, fpc *types.FeePayContract, walletAddress string) (uint64, error)

Get the number of times a wallet has interacted with a fee pay contract (err only if contract not registered)

func (Keeper) GetContracts

Get all registered fee pay contracts

func (Keeper) GetParams

func (k Keeper) GetParams(ctx context.Context) (p types.Params)

GetParams returns the current x/feepay module parameters.

func (Keeper) HasWalletExceededUsageLimit

func (k Keeper) HasWalletExceededUsageLimit(ctx context.Context, fpc *types.FeePayContract, walletAddress string) bool

Check if a wallet exceeded usage limit (defaults to true if contract not registered)

func (Keeper) IncrementContractUses

func (k Keeper) IncrementContractUses(ctx context.Context, fpc *types.FeePayContract, walletAddress string, increment uint64) error

Set the number of times a wallet has interacted with a fee pay contract

func (Keeper) InitGenesis

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

InitGenesis import module genesis

func (Keeper) IsContractManager

func (k Keeper) IsContractManager(senderAddress string, contractInfo *wasmtypes.ContractInfo) (bool, error)

Check if the sender is the designated contract manager for the FeePay contract. If an admin is present, they are considered the manager. If there is no admin, the contract creator is considered the manager.

func (Keeper) IsContractRegistered

func (k Keeper) IsContractRegistered(ctx context.Context, contractAddr string) bool

Check if a contract is registered as a fee pay contract

func (Keeper) IsWalletEligible

func (k Keeper) IsWalletEligible(ctx context.Context, fpc *types.FeePayContract, walletAddress string) (bool, error)

Check if a wallet is eligible to interact with a contract

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) RegisterContract

func (k Keeper) RegisterContract(ctx context.Context, rfp *types.MsgRegisterFeePayContract) error

Register the contract in the module store

func (Keeper) SetContractBalance

func (k Keeper) SetContractBalance(ctx context.Context, fpc *types.FeePayContract, newBalance uint64)

Set the contract balance in the KV store

func (Keeper) SetFeePayContract

func (k Keeper) SetFeePayContract(ctx context.Context, feepay types.FeePayContract)

Set a contract in the KV Store

func (Keeper) SetParams

func (k Keeper) SetParams(ctx context.Context, p types.Params) error

SetParams sets the x/feepay module parameters.

func (Keeper) UnregisterContract

func (k Keeper) UnregisterContract(ctx context.Context, rfp *types.MsgUnregisterFeePayContract) error

Unregister contract (loop through usage store & remove all usage entries for contract)

func (Keeper) UpdateContractWalletLimit

func (k Keeper) UpdateContractWalletLimit(ctx context.Context, fpc *types.FeePayContract, senderAddress string, walletLimit uint64) error

Update the wallet limit of an existing fee pay contract

Jump to

Keyboard shortcuts

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