Documentation ¶
Index ¶
- Variables
- type Keeper
- func (k Keeper) CanContractCoverFee(fpc *types.FeePayContract, fee uint64) bool
- func (k Keeper) FundContract(ctx sdk.Context, fpc *types.FeePayContract, senderAddr sdk.AccAddress, ...) error
- func (k Keeper) FundFeePayContract(goCtx context.Context, msg *types.MsgFundFeePayContract) (*types.MsgFundFeePayContractResponse, error)
- func (k Keeper) GetAllContracts(ctx sdk.Context) []types.FeePayContract
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetContract(ctx sdk.Context, contractAddress string) (*types.FeePayContract, error)
- func (k Keeper) GetContractUses(ctx sdk.Context, fpc *types.FeePayContract, walletAddress string) (uint64, error)
- func (k Keeper) GetContracts(ctx sdk.Context, pag *query.PageRequest) (*types.QueryFeePayContractsResponse, error)
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) HasWalletExceededUsageLimit(ctx sdk.Context, fpc *types.FeePayContract, walletAddress string) bool
- func (k Keeper) IncrementContractUses(ctx sdk.Context, fpc *types.FeePayContract, walletAddress string, ...) error
- func (k Keeper) IsContractManager(senderAddress string, contractInfo *wasmtypes.ContractInfo) (bool, error)
- func (k Keeper) IsContractRegistered(ctx sdk.Context, contractAddr string) bool
- func (k Keeper) IsWalletEligible(ctx sdk.Context, fpc *types.FeePayContract, walletAddress string) (bool, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RegisterContract(ctx sdk.Context, rfp *types.MsgRegisterFeePayContract) error
- func (k Keeper) RegisterFeePayContract(goCtx context.Context, msg *types.MsgRegisterFeePayContract) (*types.MsgRegisterFeePayContractResponse, error)
- func (k Keeper) SetContractBalance(ctx sdk.Context, fpc *types.FeePayContract, newBalance uint64)
- func (k Keeper) SetFeePayContract(ctx sdk.Context, feepay types.FeePayContract)
- func (k Keeper) SetParams(ctx sdk.Context, p types.Params) error
- func (k Keeper) UnregisterContract(ctx sdk.Context, rfp *types.MsgUnregisterFeePayContract) error
- func (k Keeper) UnregisterFeePayContract(goCtx context.Context, msg *types.MsgUnregisterFeePayContract) (*types.MsgUnregisterFeePayContractResponse, error)
- func (k Keeper) UpdateContractWalletLimit(ctx sdk.Context, fpc *types.FeePayContract, senderAddress string, ...) error
- func (k Keeper) UpdateFeePayContractWalletLimit(goCtx context.Context, msg *types.MsgUpdateFeePayContractWalletLimit) (*types.MsgUpdateFeePayContractWalletLimitResponse, error)
- func (k Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
- type Querier
- func (q Querier) FeePayContract(ctx context.Context, req *types.QueryFeePayContract) (*types.QueryFeePayContractResponse, error)
- func (q Querier) FeePayContractUses(ctx context.Context, req *types.QueryFeePayContractUses) (*types.QueryFeePayContractUsesResponse, error)
- func (q Querier) FeePayContracts(ctx context.Context, req *types.QueryFeePayContracts) (*types.QueryFeePayContractsResponse, error)
- func (q Querier) FeePayWalletIsEligible(ctx context.Context, req *types.QueryFeePayWalletIsEligible) (*types.QueryFeePayWalletIsEligibleResponse, error)
- func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
var ( StoreKeyContracts = []byte("contracts") StoreKeyContractUses = []byte("contract-uses") )
Functions ¶
This section is empty.
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( storeKey storetypes.StoreKey, cdc codec.BinaryCodec, bk bankkeeper.Keeper, wk wasmkeeper.Keeper, ak feesharetypes.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) FundContract ¶
func (k Keeper) FundContract(ctx sdk.Context, fpc *types.FeePayContract, senderAddr sdk.AccAddress, coins sdk.Coins) error
Fund an existing fee pay contract
func (Keeper) FundFeePayContract ¶
func (k Keeper) FundFeePayContract(goCtx context.Context, msg *types.MsgFundFeePayContract) (*types.MsgFundFeePayContractResponse, error)
FundFeePayContract funds a contract with the given amount of tokens.
func (Keeper) GetAllContracts ¶
func (k Keeper) GetAllContracts(ctx sdk.Context) []types.FeePayContract
GetAllContracts returns all the registered FeePay contracts.
func (Keeper) GetAuthority ¶
GetAuthority returns the x/feeshare module's authority.
func (Keeper) GetContract ¶
Get a contract from KV store
func (Keeper) GetContractUses ¶
func (k Keeper) GetContractUses(ctx sdk.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 sdk.Context, pag *query.PageRequest) (*types.QueryFeePayContractsResponse, error)
Get all registered fee pay contracts
func (Keeper) HasWalletExceededUsageLimit ¶
func (k Keeper) HasWalletExceededUsageLimit(ctx sdk.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 sdk.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) 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 sdk.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) RegisterFeePayContract ¶
func (k Keeper) RegisterFeePayContract(goCtx context.Context, msg *types.MsgRegisterFeePayContract) (*types.MsgRegisterFeePayContractResponse, error)
Register a new fee pay contract.
func (Keeper) SetContractBalance ¶
Set the contract balance in the KV store
func (Keeper) SetFeePayContract ¶
func (k Keeper) SetFeePayContract(ctx sdk.Context, feepay types.FeePayContract)
Set a contract in the KV Store
func (Keeper) UnregisterContract ¶
Unregister contract (loop through usage store & remove all usage entries for contract)
func (Keeper) UnregisterFeePayContract ¶
func (k Keeper) UnregisterFeePayContract(goCtx context.Context, msg *types.MsgUnregisterFeePayContract) (*types.MsgUnregisterFeePayContractResponse, error)
func (Keeper) UpdateContractWalletLimit ¶
func (k Keeper) UpdateContractWalletLimit(ctx sdk.Context, fpc *types.FeePayContract, senderAddress string, walletLimit uint64) error
Update the wallet limit of an existing fee pay contract
func (Keeper) UpdateFeePayContractWalletLimit ¶
func (k Keeper) UpdateFeePayContractWalletLimit(goCtx context.Context, msg *types.MsgUpdateFeePayContractWalletLimit) (*types.MsgUpdateFeePayContractWalletLimitResponse, error)
Update the wallet limit of a fee pay contract.
func (Keeper) UpdateParams ¶
func (k Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
UpdateParams updates the parameters of the module.
type Querier ¶
type Querier struct {
Keeper
}
Querier defines a wrapper around the x/feepay keeper providing gRPC method handlers.
func NewQuerier ¶
func (Querier) FeePayContract ¶
func (q Querier) FeePayContract(ctx context.Context, req *types.QueryFeePayContract) (*types.QueryFeePayContractResponse, error)
FeePayContract implements types.QueryServer.
func (Querier) FeePayContractUses ¶
func (q Querier) FeePayContractUses(ctx context.Context, req *types.QueryFeePayContractUses) (*types.QueryFeePayContractUsesResponse, error)
FeePayContractUses implements types.QueryServer.
func (Querier) FeePayContracts ¶
func (q Querier) FeePayContracts(ctx context.Context, req *types.QueryFeePayContracts) (*types.QueryFeePayContractsResponse, error)
FeePayContracts implements types.QueryServer.
func (Querier) FeePayWalletIsEligible ¶
func (q Querier) FeePayWalletIsEligible(ctx context.Context, req *types.QueryFeePayWalletIsEligible) (*types.QueryFeePayWalletIsEligibleResponse, error)
FeePayContractEligible implements types.QueryServer.
func (Querier) Params ¶
func (q Querier) Params( c context.Context, _ *types.QueryParamsRequest, ) (*types.QueryParamsResponse, error)
Params returns the feepay module params