token

package
v0.0.0-...-25b3476 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName       = types.ModuleName
	RouterKey        = types.RouterKey
	StoreKey         = types.StoreKey
	QuerierRoute     = types.QuerierRoute
	QuerierKey       = types.QuerierRoute
	DefaultCodespace = types.DefaultCodespace

	QueryToken     = types.QueryToken
	QueryIBCTokens = types.QueryIBCTokens
)

Variables

View Source
var (
	ModuleCdc                        = types.ModuleCdc
	RegisterCodec                    = types.RegisterCodec
	AddTokenProposalHandler          = client.AddTokenProposalHandler
	TokenParamsChangeProposalHandler = client.TokenParamsChangeProposalHandler
	NewAddTokenProposal              = types.NewAddTokenProposal
	NewTokenParamsChangeProposal     = types.NewTokenParamsChangeProposal
)
View Source
var TestBaseTokens = map[sdk.Symbol]*sdk.BaseToken{
	sdk.NativeToken: {
		Name:        sdk.NativeToken,
		Symbol:      sdk.Symbol(sdk.NativeToken),
		Issuer:      "",
		Chain:       sdk.Symbol(sdk.NativeToken),
		SendEnabled: true,
		Decimals:    sdk.NativeTokenDecimal,
		TotalSupply: sdk.NewIntWithDecimal(21, 24),
		Weight:      types.DefaultNativeTokenWeight,
	},
	sdk.NativeUsdtToken: {
		Name:        sdk.NativeUsdtToken,
		Symbol:      sdk.Symbol(sdk.NativeUsdtToken),
		Issuer:      "",
		Chain:       sdk.Symbol(sdk.NativeToken),
		SendEnabled: true,
		Decimals:    sdk.NativeUsdtTokenDecimal,
		TotalSupply: sdk.NewIntWithDecimal(1, 16),
		Weight:      types.DefaultHrc10TokenWeight,
	},
}
View Source
var TestIBCTokens = map[sdk.Symbol]*sdk.IBCToken{
	// contains filtered or unexported fields
}
View Source
var TestTokenData map[sdk.Symbol]sdk.Token

Functions

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState) []abci.ValidatorUpdate

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

func NewTokenProposalHandler

func NewTokenProposalHandler(k Keeper) govtypes.Handler

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

app module

func NewAppModule

func NewAppModule(keeper Keeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

module begin-block

func (AppModule) EndBlock

module end-block

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

module export genesis

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

module init-genesis

func (AppModule) Name

func (AppModule) Name() string

module name

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

module handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

module querier

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

module querier route name

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

register invariants

func (AppModule) Route

func (AppModule) Route() string

module message route name

type AppModuleBasic

type AppModuleBasic struct{}

app module basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

default genesis state

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

module name

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

register module codec

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

module validate genesis

type GenesisState

type GenesisState struct {
	GenesisTokens []sdk.Token `json:"genesis_tokens"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState

func (GenesisState) Equal

func (g GenesisState) Equal(g2 GenesisState) bool

Checks whether 2 GenesisState structs are equivalent.

func (GenesisState) IsEmpty

func (g GenesisState) IsEmpty() bool

Returns if a GenesisState is empty or has data in it

func (GenesisState) String

func (g GenesisState) String() string

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(storeKey sdk.StoreKey, cdc *codec.Codec) Keeper

func (*Keeper) CreateToken

func (k *Keeper) CreateToken(ctx sdk.Context, tokenInfo sdk.Token) error

func (*Keeper) GetCollectFee

func (k *Keeper) GetCollectFee(ctx sdk.Context, symbol sdk.Symbol) sdk.Coin

func (*Keeper) GetIBCToken

func (k *Keeper) GetIBCToken(ctx sdk.Context, symbol sdk.Symbol) *sdk.IBCToken

func (*Keeper) GetIBCTokenList

func (k *Keeper) GetIBCTokenList(ctx sdk.Context) []*sdk.IBCToken

func (*Keeper) GetIBCTokenSymbols

func (k *Keeper) GetIBCTokenSymbols(ctx sdk.Context) []sdk.Symbol

func (*Keeper) GetSymbolIterator

func (k *Keeper) GetSymbolIterator(ctx sdk.Context) sdk.Iterator

func (*Keeper) GetToken

func (k *Keeper) GetToken(ctx sdk.Context, symbol sdk.Symbol) sdk.Token

func (*Keeper) GetWithDrawalFee

func (k *Keeper) GetWithDrawalFee(ctx sdk.Context, symbol sdk.Symbol) sdk.Coin

func (*Keeper) HasToken

func (k *Keeper) HasToken(ctx sdk.Context, symbol sdk.Symbol) bool

func (*Keeper) IsSubToken

func (k *Keeper) IsSubToken(ctx sdk.Context, symbol sdk.Symbol) bool

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (*Keeper) RawCollectFee

func (k *Keeper) RawCollectFee(ctx sdk.Context, token, chainToken *sdk.IBCToken) sdk.Int

func (*Keeper) SetEvidenceKeeper

func (k *Keeper) SetEvidenceKeeper(evidenceKeeper internal.EvidenceKeeper)

func (*Keeper) SetIBCTokenSymbols

func (k *Keeper) SetIBCTokenSymbols(ctx sdk.Context, symbols []sdk.Symbol)

func (*Keeper) SetStakingKeeper

func (k *Keeper) SetStakingKeeper(sk internal.StakingKeeper)

func (*Keeper) SetToken

func (k *Keeper) SetToken(ctx sdk.Context, tokenInfo sdk.Token)

Set entire TokenInfo

func (*Keeper) SynGasPrice

func (k *Keeper) SynGasPrice(ctx sdk.Context, fromAddr string, height uint64, tokensGasPrice []sdk.TokensGasPrice) ([]sdk.TokensGasPrice, sdk.Result)

type QueryTokenInfoParams

type QueryTokenInfoParams = types.QueryTokenInfoParams

type ResToken

type ResToken = types.ResToken

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

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