Documentation
¶
Index ¶
- Variables
- func NewMsgServerImpl(k Keeper) types.MsgServer
- func NewQueryServerImpl(k Keeper) types.QueryServer
- type Keeper
- func (k Keeper) CanContractCoverFee(fpc *types.FeePayContract, fee uint64) bool
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FundContract(ctx context.Context, fpc *types.FeePayContract, senderAddr sdk.AccAddress, ...) error
- func (k Keeper) GetAllContracts(ctx context.Context) []types.FeePayContract
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetContract(ctx context.Context, contractAddress string) (*types.FeePayContract, error)
- func (k Keeper) GetContractUses(ctx context.Context, fpc *types.FeePayContract, walletAddress string) (uint64, error)
- func (k Keeper) GetContracts(ctx context.Context, pag *query.PageRequest) (*types.QueryFeePayContractsResponse, error)
- func (k Keeper) GetParams(ctx context.Context) (p types.Params)
- func (k Keeper) HasWalletExceededUsageLimit(ctx context.Context, fpc *types.FeePayContract, walletAddress string) bool
- func (k Keeper) IncrementContractUses(ctx context.Context, fpc *types.FeePayContract, walletAddress string, ...) error
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) IsContractManager(senderAddress string, contractInfo *wasmtypes.ContractInfo) (bool, error)
- func (k Keeper) IsContractRegistered(ctx context.Context, contractAddr string) bool
- func (k Keeper) IsWalletEligible(ctx context.Context, fpc *types.FeePayContract, walletAddress string) (bool, error)
- func (k Keeper) Logger(ctx context.Context) log.Logger
- func (k Keeper) RegisterContract(ctx context.Context, rfp *types.MsgRegisterFeePayContract) error
- func (k Keeper) SetContractBalance(ctx context.Context, fpc *types.FeePayContract, newBalance uint64)
- func (k Keeper) SetFeePayContract(ctx context.Context, feepay types.FeePayContract)
- func (k Keeper) SetParams(ctx context.Context, p types.Params) error
- func (k Keeper) UnregisterContract(ctx context.Context, rfp *types.MsgUnregisterFeePayContract) error
- func (k Keeper) UpdateContractWalletLimit(ctx context.Context, fpc *types.FeePayContract, senderAddress string, ...) error
Constants ¶
This section is empty.
Variables ¶
var ( StoreKeyContracts = []byte("contracts") StoreKeyContractUses = []byte("contract-uses") )
Functions ¶
func NewMsgServerImpl ¶
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 ¶
func NewKeeper( cdc codec.BinaryCodec, ss storetypes.KVStoreService, bk bankkeeper.Keeper, wk wasmkeeper.Keeper, ak authkeeper.AccountKeeper, bondDenom string, authority string, ) Keeper
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 ¶
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 ¶
func (k Keeper) GetContracts(ctx context.Context, pag *query.PageRequest) (*types.QueryFeePayContractsResponse, error)
Get all registered fee pay contracts
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 ¶
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) RegisterContract ¶
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) 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