Documentation ¶
Index ¶
- Constants
- func DetermineBips(recipient string, recipientBasisPoints string) (uint32, error)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Handler
- type Keeper
- func (k Keeper) AddMsgFee(ctx sdk.Context, msgTypeURL, recipient, basisPoints string, ...) error
- func (k Keeper) CalculateAdditionalFeesToBePaid(ctx sdk.Context, msgs ...sdk.Msg) (types.MsgFeesDistribution, error)
- func (k Keeper) CalculateTxFees(goCtx context.Context, request *types.CalculateTxFeesRequest) (*types.CalculateTxFeesResponse, error)
- func (k Keeper) ConvertDenomToHash(ctx sdk.Context, coin sdk.Coin) (sdk.Coin, error)
- func (k Keeper) DeductFeesDistributions(bankKeeper bankkeeper.Keeper, ctx sdk.Context, acc sdk.AccountI, ...) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetConversionFeeDenom(ctx sdk.Context) string
- func (k Keeper) GetFeeCollectorName() string
- func (k Keeper) GetFloorGasPrice(ctx sdk.Context) sdk.Coin
- func (k Keeper) GetMsgFee(ctx sdk.Context, msgType string) (*types.MsgFee, error)
- func (k Keeper) GetNhashPerUsdMil(ctx sdk.Context) uint64
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
- func (k Keeper) IterateMsgFees(ctx sdk.Context, handle func(msgFees types.MsgFee) (stop bool)) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) QueryAllMsgFees(c context.Context, req *types.QueryAllMsgFeesRequest) (*types.QueryAllMsgFeesResponse, error)
- func (k Keeper) RemoveMsgFee(ctx sdk.Context, msgType string) error
- func (k Keeper) SetMsgFee(ctx sdk.Context, msgFees types.MsgFee) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) UpdateConversionFeeDenomParam(ctx sdk.Context, conversionFeeDenom string)
- func (k Keeper) UpdateMsgFee(ctx sdk.Context, msgTypeURL, recipient, basisPoints string, ...) error
- func (k Keeper) UpdateNhashPerUsdMilParam(ctx sdk.Context, nhashPerUsdMil uint64)
Constants ¶
const StoreKey = types.ModuleName
Variables ¶
This section is empty.
Functions ¶
func DetermineBips ¶ added in v1.13.0
DetermineBips converts basis point string to uint32
func NewMsgServerImpl ¶ added in v1.11.0
NewMsgServerImpl returns an implementation of the msgfees MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the Additional fee store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, feeCollectorName string, defaultFeeDenom string, simulateFunc baseAppSimulateFunc, txDecoder sdk.TxDecoder, registry cdctypes.InterfaceRegistry, ) Keeper
NewKeeper returns a AdditionalFeeKeeper. It handles: CONTRACT: the parameter Subspace must have the param key table already initialized
func (Keeper) AddMsgFee ¶ added in v1.19.0
func (k Keeper) AddMsgFee(ctx sdk.Context, msgTypeURL, recipient, basisPoints string, additionalFee sdk.Coin) error
AddMsgFee adds a new msg fees
func (Keeper) CalculateAdditionalFeesToBePaid ¶ added in v1.13.0
func (k Keeper) CalculateAdditionalFeesToBePaid(ctx sdk.Context, msgs ...sdk.Msg) (types.MsgFeesDistribution, error)
CalculateAdditionalFeesToBePaid computes the additional fees to be paid for the provided messages.
func (Keeper) CalculateTxFees ¶
func (k Keeper) CalculateTxFees(goCtx context.Context, request *types.CalculateTxFeesRequest) (*types.CalculateTxFeesResponse, error)
func (Keeper) ConvertDenomToHash ¶ added in v1.11.0
ConvertDenomToHash converts usd coin to nhash coin using nhash per usd mil. Currently, usd is only supported with nhash to usd mil coming from params
func (Keeper) DeductFeesDistributions ¶ added in v1.11.0
func (k Keeper) DeductFeesDistributions(bankKeeper bankkeeper.Keeper, ctx sdk.Context, acc sdk.AccountI, remainingFees sdk.Coins, fees map[string]sdk.Coins) error
DeductFeesDistributions deducts fees from the given account. The fees map contains a key of bech32 addresses to distribute funds to. If the key in the map is an empty string, those will go to the fee collector. After all the accounts in fees map are paid out, the remainder of remainingFees will be swept to the fee collector account.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns a GenesisState for a given context.
func (Keeper) GetAuthority ¶ added in v1.17.0
GetAuthority is signer of the proposal
func (Keeper) GetConversionFeeDenom ¶ added in v1.13.0
GetConversionFeeDenom returns the conversion fee denom
func (Keeper) GetFeeCollectorName ¶
func (Keeper) GetFloorGasPrice ¶
GetFloorGasPrice returns the current minimum gas price in sdk.Coin used in calculations for charging additional fees
func (Keeper) GetMsgFee ¶
GetMsgFee returns a MsgFee for the msg type if it exists nil if it does not
func (Keeper) GetNhashPerUsdMil ¶ added in v1.11.0
GetNhashPerUsdMil returns the current nhash amount per usd mil.
Conversions:
- x nhash/usd-mil = 1,000,000/x usd/hash
- y usd/hash = 1,000,000/y nhash/usd-mil
Examples:
- 40,000,000 nhash/usd-mil = 1,000,000/40,000,000 usd/hash = $0.025/hash,
- $0.040/hash = 1,000,000/0.040 nhash/usd-mil = 25,000,000 nhash/usd-mil
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
InitGenesis new msgfees genesis
func (Keeper) IterateMsgFees ¶
func (k Keeper) IterateMsgFees(ctx sdk.Context, handle func(msgFees types.MsgFee) (stop bool)) error
IterateMsgFees iterates all msg fees with the given handler function.
func (Keeper) Params ¶
func (k Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) QueryAllMsgFees ¶
func (k Keeper) QueryAllMsgFees(c context.Context, req *types.QueryAllMsgFeesRequest) (*types.QueryAllMsgFeesResponse, error)
func (Keeper) RemoveMsgFee ¶
RemoveMsgFee removes MsgFee or returns an error if it does not exist
func (Keeper) UpdateConversionFeeDenomParam ¶ added in v1.19.0
UpdateConversionFeeDenomParam updates the conversion fee denom param