Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- type Keeper
- func (k Keeper) AddBurnCoin(ctx sdk.Context, coin sdk.Coin)
- func (k Keeper) AddToken(ctx sdk.Context, token types.Token) error
- func (k Keeper) BurnToken(ctx sdk.Context, symbol string, amount uint64, owner sdk.AccAddress) error
- func (k Keeper) DeductIssueTokenFee(ctx sdk.Context, owner sdk.AccAddress, symbol string) error
- func (k Keeper) DeductMintTokenFee(ctx sdk.Context, owner sdk.AccAddress, symbol string) error
- func (k Keeper) EditToken(ctx sdk.Context, symbol string, name string, maxSupply uint64, ...) error
- func (k Keeper) Fees(c context.Context, req *types.QueryFeesRequest) (*types.QueryFeesResponse, error)
- func (k Keeper) GetAllBurnCoin(ctx sdk.Context) []sdk.Coin
- func (k Keeper) GetBurnCoin(ctx sdk.Context, minUint string) (sdk.Coin, error)
- func (k Keeper) GetOwner(ctx sdk.Context, denom string) (sdk.AccAddress, error)
- func (k Keeper) GetParamSet(ctx sdk.Context) types.Params
- func (k Keeper) GetToken(ctx sdk.Context, denom string) (types.TokenI, error)
- func (k Keeper) GetTokenIssueFee(ctx sdk.Context, symbol string) (sdk.Coin, error)
- func (k Keeper) GetTokenMintFee(ctx sdk.Context, symbol string) (sdk.Coin, error)
- func (k Keeper) GetTokens(ctx sdk.Context, owner sdk.AccAddress) (tokens []types.TokenI)
- func (k Keeper) HasSymbol(ctx sdk.Context, symbol string) bool
- func (k Keeper) HasToken(ctx sdk.Context, denom string) bool
- func (k Keeper) IssueToken(ctx sdk.Context, symbol string, name string, minUnit string, scale uint32, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MintToken(ctx sdk.Context, symbol string, amount uint64, recipient sdk.AccAddress, ...) error
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) SetParamSet(ctx sdk.Context, params types.Params)
- func (k Keeper) SwapFeeToken(ctx sdk.Context, feePaid sdk.Coin, sender sdk.AccAddress, ...) (sdk.Coin, error)
- func (k Keeper) Token(c context.Context, req *types.QueryTokenRequest) (*types.QueryTokenResponse, error)
- func (k Keeper) Tokens(c context.Context, req *types.QueryTokensRequest) (*types.QueryTokensResponse, error)
- func (k Keeper) TotalBurn(c context.Context, req *types.QueryTotalBurnRequest) (*types.QueryTotalBurnResponse, error)
- func (k Keeper) TransferTokenOwner(ctx sdk.Context, symbol string, srcOwner sdk.AccAddress, ...) error
- func (k Keeper) WithSwapRegistry(registry types.SwapRegistry) Keeper
- type ValidateTokenFeeDecorator
Constants ¶
const ( FeeFactorBase = 3 FeeFactorExp = 4 )
fee factor formula: (ln(len({name}))/ln{base})^{exp}
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the token MsgServer interface for the provided Keeper.
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, key storetypes.StoreKey, paramSpace paramstypes.Subspace, bankKeeper types.BankKeeper, blockedAddrs map[string]bool, feeCollectorName string, ) Keeper
func (Keeper) AddBurnCoin ¶
AddBurnCoin saves the total amount of the burned tokens
func (Keeper) BurnToken ¶
func (k Keeper) BurnToken( ctx sdk.Context, symbol string, amount uint64, owner sdk.AccAddress, ) error
BurnToken burns the specified amount of token
func (Keeper) DeductIssueTokenFee ¶
DeductIssueTokenFee performs fee handling for issuing token
func (Keeper) DeductMintTokenFee ¶
DeductMintTokenFee performs fee handling for minting token
func (Keeper) EditToken ¶
func (k Keeper) EditToken( ctx sdk.Context, symbol string, name string, maxSupply uint64, mintable types.Bool, owner sdk.AccAddress, ) error
EditToken edits the specified token
func (Keeper) Fees ¶
func (k Keeper) Fees(c context.Context, req *types.QueryFeesRequest) (*types.QueryFeesResponse, error)
func (Keeper) GetAllBurnCoin ¶
GetAllBurnCoin returns the total amount of all the burned tokens
func (Keeper) GetBurnCoin ¶
GetBurnCoin returns the total amount of the burned tokens
func (Keeper) GetParamSet ¶
GetParamSet returns token params from the global param store
func (Keeper) GetTokenIssueFee ¶
GetTokenIssueFee returns the token issuance fee
func (Keeper) GetTokenMintFee ¶
GetTokenMintFee returns the token minting fee
func (Keeper) IssueToken ¶
func (k Keeper) IssueToken( ctx sdk.Context, symbol string, name string, minUnit string, scale uint32, initialSupply uint64, maxSupply uint64, mintable bool, owner sdk.AccAddress, ) error
IssueToken issues a new token
func (Keeper) MintToken ¶
func (k Keeper) MintToken( ctx sdk.Context, symbol string, amount uint64, recipient sdk.AccAddress, owner sdk.AccAddress, ) error
MintToken mints the specified amount of token to the specified recipient NOTE: empty owner means that the external caller is responsible to manage the token authority
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params return the all the parameter in tonken module
func (Keeper) SetParamSet ¶
SetParamSet sets token params to the global param store
func (Keeper) SwapFeeToken ¶
func (k Keeper) SwapFeeToken( ctx sdk.Context, feePaid sdk.Coin, sender sdk.AccAddress, recipient sdk.AccAddress, ) (sdk.Coin, error)
SwapFeeToken swap the fee token
func (Keeper) Token ¶
func (k Keeper) Token(c context.Context, req *types.QueryTokenRequest) (*types.QueryTokenResponse, error)
func (Keeper) Tokens ¶
func (k Keeper) Tokens(c context.Context, req *types.QueryTokensRequest) (*types.QueryTokensResponse, error)
func (Keeper) TotalBurn ¶
func (k Keeper) TotalBurn(c context.Context, req *types.QueryTotalBurnRequest) (*types.QueryTotalBurnResponse, error)
TotalBurn return the all burn coin
func (Keeper) TransferTokenOwner ¶
func (k Keeper) TransferTokenOwner( ctx sdk.Context, symbol string, srcOwner sdk.AccAddress, dstOwner sdk.AccAddress, ) error
TransferTokenOwner transfers the owner of the specified token to a new one
func (Keeper) WithSwapRegistry ¶
func (k Keeper) WithSwapRegistry(registry types.SwapRegistry) Keeper
type ValidateTokenFeeDecorator ¶
type ValidateTokenFeeDecorator struct {
// contains filtered or unexported fields
}
func NewValidateTokenFeeDecorator ¶
func NewValidateTokenFeeDecorator(k Keeper, bk types.BankKeeper) ValidateTokenFeeDecorator
func (ValidateTokenFeeDecorator) AnteHandle ¶
func (dtf ValidateTokenFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error)
AnteHandle returns an AnteHandler that checks if the balance of the fee payer is sufficient for token related fee