pricing

package
v0.0.0-...-80a2a92 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryCosmicBonds = "cosmic-bonds"
	QueryCosmicBond  = "cosmic-bond"
)
View Source
const ModuleName = "pricing"
View Source
const (
	PowerFunction = "power_function"
)
View Source
const RouterKey = ModuleName
View Source
const StoreKey = "pricing"

Variables

View Source
var ModuleCdc = codec.New()

Functions

func InitGenesis

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

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

NewHandler returns a handler for "nameservice" type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type AppModule

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

func NewAppModule

func NewAppModule(k Keeper, bankKeeper bank.Keeper) AppModule

func (AppModule) BeginBlock

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

func (AppModule) EndBlock

func (AppModule) ExportGenesis

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

func (AppModule) InitGenesis

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

func (AppModule) Name

func (AppModule) Name() string

func (AppModule) NewHandler

func (am AppModule) NewHandler() types.Handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() types.Querier

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants

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

func (AppModule) Route

func (am AppModule) Route() string

type AppModuleBasic

type AppModuleBasic struct{}

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

func (AppModuleBasic) RegisterCodec

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

func (AppModuleBasic) ValidateGenesis

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

type CosmicBond

type CosmicBond struct {
	Moniker        string         `json:"moniker"`
	Creator        sdk.AccAddress `json:"creator"`
	ReserveToken   string         `json:"reserve_token"`
	ReserveAddress sdk.AccAddress `json:"reserve_address"`
	MaxSupply      sdk.Coin       `json:"max_supply"`
	CurrentSupply  sdk.Coin       `json:"current_supply"`
	FunctionType   string         `json:"function_type"`
	M              string         `json:"m"`
	N              string         `json:"n"`
	AllowSells     string         `json:"allow_sells"`
}

func NewCosmicBond

func NewCosmicBond(moniker string) CosmicBond

func (CosmicBond) GetCurrentPrice

func (c CosmicBond) GetCurrentPrice() sdk.Int

func (CosmicBond) GetPriceForSupply

func (c CosmicBond) GetPriceForSupply(supply sdk.Int) sdk.Int

func (CosmicBond) GetReserveAvailableAfterDecreaseInSupply

func (c CosmicBond) GetReserveAvailableAfterDecreaseInSupply(decrease sdk.Int) sdk.Int

func (CosmicBond) GetReserveNecessaryForIncreaseInSupply

func (c CosmicBond) GetReserveNecessaryForIncreaseInSupply(increase sdk.Int) sdk.Int

func (CosmicBond) GetReserveNecessaryForSupply

func (c CosmicBond) GetReserveNecessaryForSupply(supply sdk.Int) sdk.Int

func (CosmicBond) String

func (c CosmicBond) String() string

type GenesisState

type GenesisState struct {
	CosmicBondRecords []CosmicBond `json:"cosmic_bonds"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func ExportGenesis

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

func NewGenesisState

func NewGenesisState(cosmicBondRecords []CosmicBond) GenesisState

type Keeper

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

func NewKeeper

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

func (Keeper) GetAllowSells

func (k Keeper) GetAllowSells(ctx sdk.Context, moniker string) string

func (Keeper) GetCosmicBond

func (k Keeper) GetCosmicBond(ctx sdk.Context, name string) CosmicBond

Gets the entire Whois metadata struct for a name

func (Keeper) GetCosmicBondIterator

func (k Keeper) GetCosmicBondIterator(ctx sdk.Context) sdk.Iterator

func (Keeper) GetCreator

func (k Keeper) GetCreator(ctx sdk.Context, moniker string) sdk.AccAddress

func (Keeper) GetCurrentSupply

func (k Keeper) GetCurrentSupply(ctx sdk.Context, moniker string) sdk.Coin

func (Keeper) GetFunctionType

func (k Keeper) GetFunctionType(ctx sdk.Context, moniker string) string

func (Keeper) GetM

func (k Keeper) GetM(ctx sdk.Context, moniker string) string

func (Keeper) GetMaxSupply

func (k Keeper) GetMaxSupply(ctx sdk.Context, moniker string) sdk.Coin

func (Keeper) GetN

func (k Keeper) GetN(ctx sdk.Context, moniker string) string

func (Keeper) GetReserveAddress

func (k Keeper) GetReserveAddress(ctx sdk.Context, moniker string) sdk.AccAddress

func (Keeper) GetReserveToken

func (k Keeper) GetReserveToken(ctx sdk.Context, moniker string) string

func (Keeper) SetAllowSells

func (k Keeper) SetAllowSells(ctx sdk.Context, moniker string, allowSells string)

func (Keeper) SetCosmicBond

func (k Keeper) SetCosmicBond(ctx sdk.Context, name string, cb CosmicBond)

func (Keeper) SetCreator

func (k Keeper) SetCreator(ctx sdk.Context, moniker string, creator sdk.AccAddress)

func (Keeper) SetCurrentSupply

func (k Keeper) SetCurrentSupply(ctx sdk.Context, moniker string, currentSupply sdk.Coin)

func (Keeper) SetFunctionType

func (k Keeper) SetFunctionType(ctx sdk.Context, moniker string, functionType string)

func (Keeper) SetM

func (k Keeper) SetM(ctx sdk.Context, moniker string, m string)

func (Keeper) SetMaxSupply

func (k Keeper) SetMaxSupply(ctx sdk.Context, moniker string, max_supply sdk.Coin)

func (Keeper) SetN

func (k Keeper) SetN(ctx sdk.Context, moniker string, n string)

func (Keeper) SetReserveAddress

func (k Keeper) SetReserveAddress(ctx sdk.Context, moniker string, reserveAddress sdk.AccAddress)

func (Keeper) SetReserveToken

func (k Keeper) SetReserveToken(ctx sdk.Context, moniker, reserveToken string)

type MsgBuy

type MsgBuy struct {
	Moniker  string
	Buyer    sdk.AccAddress
	Amount   sdk.Coin
	MaxPrice string
}

func NewMsgBuy

func NewMsgBuy(moniker string, accAddress sdk.AccAddress, amount sdk.Coin, maxPrice string) MsgBuy

func (MsgBuy) GetSignBytes

func (msg MsgBuy) GetSignBytes() []byte

func (MsgBuy) GetSigners

func (msg MsgBuy) GetSigners() []sdk.AccAddress

func (MsgBuy) Route

func (msg MsgBuy) Route() string

func (MsgBuy) Type

func (msg MsgBuy) Type() string

func (MsgBuy) ValidateBasic

func (msg MsgBuy) ValidateBasic() sdk.Error

type MsgCreateCosmicBond

type MsgCreateCosmicBond struct {
	Moniker        string
	Creator        sdk.AccAddress
	ReserveToken   string
	ReserveAddress sdk.AccAddress
	MaxSupply      sdk.Coin
	FunctionType   string
	M              string
	N              string
	AllowSell      string
}

func NewMsgCreateCosmicBond

func NewMsgCreateCosmicBond(moniker string, creator sdk.AccAddress, reserveToken string, reserveAddress sdk.AccAddress, maxSupply sdk.Coin, functionType, m, n, allowSell string) MsgCreateCosmicBond

func (MsgCreateCosmicBond) GetSignBytes

func (msg MsgCreateCosmicBond) GetSignBytes() []byte

func (MsgCreateCosmicBond) GetSigners

func (msg MsgCreateCosmicBond) GetSigners() []sdk.AccAddress

func (MsgCreateCosmicBond) Route

func (msg MsgCreateCosmicBond) Route() string

func (MsgCreateCosmicBond) Type

func (msg MsgCreateCosmicBond) Type() string

func (MsgCreateCosmicBond) ValidateBasic

func (msg MsgCreateCosmicBond) ValidateBasic() sdk.Error

type MsgSell

type MsgSell struct {
	Moniker string
	Seller  sdk.AccAddress
	Amount  sdk.Coin
}

func NewMsgSell

func NewMsgSell(moniker string, accAddress sdk.AccAddress, amount sdk.Coin) MsgSell

func (MsgSell) GetSignBytes

func (msg MsgSell) GetSignBytes() []byte

func (MsgSell) GetSigners

func (msg MsgSell) GetSigners() []sdk.AccAddress

func (MsgSell) Route

func (msg MsgSell) Route() string

func (MsgSell) Type

func (msg MsgSell) Type() string

func (MsgSell) ValidateBasic

func (msg MsgSell) ValidateBasic() sdk.Error

type QueryResCosmicBonds

type QueryResCosmicBonds []string

func (QueryResCosmicBonds) String

func (n QueryResCosmicBonds) String() string

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

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