keeper

package
v0.0.1-testnet.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

nolint

Index

Constants

View Source
const (
	FeeFactorBase = 3
	FeeFactorExp  = 4
)

fee factor formula: (ln(len({name}))/ln{base})^{exp}

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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 sdk.StoreKey,
	paramSpace paramstypes.Subspace,
	bankKeeper types.BankKeeper,
	blockedAddrs map[string]bool,
	feeCollectorName string,
) Keeper

func (Keeper) AddBurnCoin

func (k Keeper) AddBurnCoin(ctx sdk.Context, coin sdk.Coin)

AddBurnCoin saves the total amount of the burned tokens

func (Keeper) AddFanToken

func (k Keeper) AddFanToken(ctx sdk.Context, token types.FanToken) error

AddToken saves a new token

func (Keeper) BurnFanToken

func (k Keeper) BurnFanToken(
	ctx sdk.Context,
	denom string,
	amount sdk.Int,
	owner sdk.AccAddress,
) error

BurnToken burns the specified amount of fantoken

func (Keeper) DeductIssueFanTokenFee

func (k Keeper) DeductIssueFanTokenFee(ctx sdk.Context, owner sdk.AccAddress, issueFee sdk.Coin, symbol string) error

DeductIssueTokenFee performs fee handling for issuing token

func (Keeper) EditFanToken

func (k Keeper) EditFanToken(
	ctx sdk.Context,
	denom string,
	mintable bool,
	owner sdk.AccAddress,
) error

EditFanToken edits the specified fantoken

func (Keeper) GetAllBurnCoin

func (k Keeper) GetAllBurnCoin(ctx sdk.Context) []sdk.Coin

GetAllBurnCoin returns the total amount of all the burned tokens

func (Keeper) GetBurnCoin

func (k Keeper) GetBurnCoin(ctx sdk.Context, denom string) (sdk.Coin, error)

GetBurnCoin returns the total amount of the burned tokens

func (Keeper) GetFanToken

func (k Keeper) GetFanToken(ctx sdk.Context, denom string) (types.FanTokenI, error)

GetToken returns the token of the specified denom

func (Keeper) GetFanTokenIssueFee

func (k Keeper) GetFanTokenIssueFee(ctx sdk.Context, issueFee sdk.Coin, symbol string) sdk.Coin

GetTokenIssueFee returns the token issuance fee

func (Keeper) GetFanTokens

func (k Keeper) GetFanTokens(ctx sdk.Context, owner sdk.AccAddress) (tokens []types.FanTokenI)

GetTokens returns all existing tokens

func (Keeper) GetOwner

func (k Keeper) GetOwner(ctx sdk.Context, denom string) (sdk.AccAddress, error)

GetOwner returns the owner of the specified token

func (Keeper) GetParamSet

func (k Keeper) GetParamSet(ctx sdk.Context) types.Params

GetParamSet returns token params from the global param store

func (Keeper) HasFanToken

func (k Keeper) HasFanToken(ctx sdk.Context, denom string) bool

HasToken asserts a token exists

func (Keeper) IssueFanToken

func (k Keeper) IssueFanToken(
	ctx sdk.Context,
	symbol string,
	name string,
	maxSupply sdk.Int,
	description string,
	owner sdk.AccAddress,
	issueFee sdk.Coin,
) (denom string, err error)

IssueFanToken issues a new fantoken

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MintFanToken

func (k Keeper) MintFanToken(
	ctx sdk.Context,
	recipient sdk.AccAddress,
	denom string,
	amount sdk.Int,
	owner sdk.AccAddress,
) error

MintFanToken mints the specified amount of fantoken to the specified recipient

func (Keeper) Params

Params return the all the parameter in tonken module

func (Keeper) SetParamSet

func (k Keeper) SetParamSet(ctx sdk.Context, params types.Params)

SetParamSet sets token params to the global param store

func (Keeper) TotalBurn

TotalBurn return the all burn coin

func (Keeper) TransferFanTokenOwner

func (k Keeper) TransferFanTokenOwner(
	ctx sdk.Context,
	denom string,
	srcOwner sdk.AccAddress,
	dstOwner sdk.AccAddress,
) error

TransferFanTokenOwner transfers the owner of the specified fantoken to a new one

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL