Documentation ¶
Index ¶
- func NewDevGasStore(storeKey storetypes.StoreKey, cdc sdkcodec.BinaryCodec) collections.IndexedMap[string, devgastypes.FeeShare, DevGasIndexes]
- type DevGasIndexes
- type Keeper
- func (k Keeper) CancelFeeShare(goCtx context.Context, msg *types.MsgCancelFeeShare) (*types.MsgCancelFeeShareResponse, error)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetContractAdminOrCreatorAddress(ctx sdk.Context, contract sdk.AccAddress, deployer string) (sdk.AccAddress, error)
- func (k Keeper) GetFeeShare(ctx sdk.Context, contract sdk.Address) (devGas types.FeeShare, isFound bool)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.ModuleParams)
- func (k Keeper) IsFeeShareRegistered(ctx sdk.Context, contract sdk.Address) (isRegistered bool)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RegisterFeeShare(goCtx context.Context, msg *types.MsgRegisterFeeShare) (*types.MsgRegisterFeeShareResponse, error)
- func (k Keeper) SetFeeShare(ctx sdk.Context, feeshare types.FeeShare)
- func (k Keeper) UpdateFeeShare(goCtx context.Context, msg *types.MsgUpdateFeeShare) (*types.MsgUpdateFeeShareResponse, error)
- func (k Keeper) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (resp *types.MsgUpdateParamsResponse, err error)
- type Querier
- func (q Querier) FeeShare(goCtx context.Context, req *types.QueryFeeShareRequest) (*types.QueryFeeShareResponse, error)
- func (q Querier) FeeShares(goCtx context.Context, req *types.QueryFeeSharesRequest) (*types.QueryFeeSharesResponse, error)
- func (q Querier) FeeSharesByWithdrawer(goCtx context.Context, req *types.QueryFeeSharesByWithdrawerRequest) (*types.QueryFeeSharesByWithdrawerResponse, error)
- func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDevGasStore ¶
func NewDevGasStore( storeKey storetypes.StoreKey, cdc sdkcodec.BinaryCodec, ) collections.IndexedMap[string, devgastypes.FeeShare, DevGasIndexes]
Types ¶
type DevGasIndexes ¶
type DevGasIndexes struct { // Deployer MultiIndex: // - indexing key (IK): deployer address // - primary key (PK): contract address // - value (V): Dev gas struct Deployer collections.MultiIndex[string, string, devgastypes.FeeShare] // Withdrawer MultiIndex: // - indexing key (IK): withdrawer address // - primary key (PK): contract address // - value (V): Dev gas struct Withdrawer collections.MultiIndex[string, string, devgastypes.FeeShare] }
func (DevGasIndexes) IndexerList ¶
func (idxs DevGasIndexes) IndexerList() []collections.Indexer[string, devgastypes.FeeShare]
type Keeper ¶
type Keeper struct { // DevGasStore: IndexedMap // - primary key (PK): Contract address. The contract is the primary key // because there's exactly one deployer and withdrawer. // - value (V): FeeShare value saved into state. // - indexers (I): Indexed by deployer and withdrawer DevGasStore collections.IndexedMap[string, devgastypes.FeeShare, DevGasIndexes] ModuleParams collections.Item[devgastypes.ModuleParams] // contains filtered or unexported fields }
Keeper of this module maintains collections of feeshares for contracts registered to receive Nibiru Chain gas fees.
func NewKeeper ¶
func NewKeeper( storeKey storetypes.StoreKey, cdc codec.BinaryCodec, bk devgastypes.BankKeeper, wk wasmkeeper.Keeper, ak devgastypes.AccountKeeper, feeCollector string, authority string, ) Keeper
NewKeeper creates new instances of the fees Keeper
func (Keeper) CancelFeeShare ¶
func (k Keeper) CancelFeeShare( goCtx context.Context, msg *types.MsgCancelFeeShare, ) (*types.MsgCancelFeeShareResponse, error)
CancelFeeShare deletes the FeeShare for a given contract
func (Keeper) GetAuthority ¶
GetAuthority returns the x/feeshare module's authority.
func (Keeper) GetContractAdminOrCreatorAddress ¶
func (k Keeper) GetContractAdminOrCreatorAddress( ctx sdk.Context, contract sdk.AccAddress, deployer string, ) (sdk.AccAddress, error)
GetContractAdminOrCreatorAddress ensures the deployer is the contract's admin OR creator if no admin is set for all msg_server feeshare functions.
func (Keeper) GetFeeShare ¶
func (k Keeper) GetFeeShare( ctx sdk.Context, contract sdk.Address, ) (devGas types.FeeShare, isFound bool)
GetFeeShare returns the FeeShare for a registered contract
func (Keeper) GetParams ¶
func (k Keeper) GetParams(ctx sdk.Context) (params types.ModuleParams)
GetParams returns the total set of fees parameters.
func (Keeper) IsFeeShareRegistered ¶
IsFeeShareRegistered checks if a contract was registered for receiving transaction fees
func (Keeper) RegisterFeeShare ¶
func (k Keeper) RegisterFeeShare( goCtx context.Context, msg *types.MsgRegisterFeeShare, ) (*types.MsgRegisterFeeShareResponse, error)
RegisterFeeShare registers a contract to receive transaction fees
func (Keeper) SetFeeShare ¶
SetFeeShare stores the FeeShare for a registered contract, then iterates over every registered Indexer and instructs them to create the relationship between the primary key PK and the object v.
func (Keeper) UpdateFeeShare ¶
func (k Keeper) UpdateFeeShare( goCtx context.Context, msg *types.MsgUpdateFeeShare, ) (*types.MsgUpdateFeeShareResponse, error)
UpdateFeeShare updates the withdraw address of a given FeeShare. If the given withdraw address is empty or the same as the deployer address, the withdraw address is removed.
func (Keeper) UpdateParams ¶
func (k Keeper) UpdateParams( goCtx context.Context, req *types.MsgUpdateParams, ) (resp *types.MsgUpdateParamsResponse, err error)
type Querier ¶
type Querier struct {
Keeper
}
Querier defines a wrapper around the x/FeeShare keeper providing gRPC method handlers.
func NewQuerier ¶
func (Querier) FeeShare ¶
func (q Querier) FeeShare( goCtx context.Context, req *types.QueryFeeShareRequest, ) (*types.QueryFeeShareResponse, error)
FeeShare returns the FeeShare that has been registered for fee distribution for a given contract
func (Querier) FeeShares ¶
func (q Querier) FeeShares( goCtx context.Context, req *types.QueryFeeSharesRequest, ) (*types.QueryFeeSharesResponse, error)
TODO FeeSharesAll returns all FeeShares that have been registered for fee distribution
func (Querier) FeeSharesByWithdrawer ¶
func (q Querier) FeeSharesByWithdrawer( goCtx context.Context, req *types.QueryFeeSharesByWithdrawerRequest, ) (*types.QueryFeeSharesByWithdrawerResponse, error)
FeeSharesByWithdrawer returns all fees for a given withdraw address
func (Querier) Params ¶
func (q Querier) Params( c context.Context, _ *types.QueryParamsRequest, ) (*types.QueryParamsResponse, error)
Params returns the fees module params