types

package
v1.2.7-0...-4cd777e Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributeKeyRequester     = "requester"
	AttributeKeyAmount        = "amount"
	AttributeKeyExchangeDenom = "exchange_denom"
)
View Source
const (
	// ModuleName is the name of the module.
	ModuleName = "coinswap"
	// StoreKey to be used when creating the KVStore.
	StoreKey          = ModuleName
	DefaultParamspace = ModuleName
)
View Source
const (
	DefaultFromExchange = "geo"
	DefaultToExchange   = "odin"
)
View Source
const (
	QueryParams = "params"
	QueryRate   = "rate"
)

Query endpoints supported by the coinswap Querier.

View Source
const (
	EventTypeExchange = "exchange"
)
View Source
const RouterKey = ModuleName

RouterKey is the name of the coinswap module

Variables

View Source
var (
	ErrInvalidExchangeDenom   = sdkerrors.New(ModuleName, 111, "unsupported exchange denomination")
	ErrExchangeDenomMissmatch = sdkerrors.New(ModuleName, 112, "exchange denomination does not match the amount provided")
)
View Source
var (
	KeyRateMultiplier = []byte("RateMultiplier")
	KeyValidExchanges = []byte("ValidExchanges")
)

nolint

View Source
var (
	InitialRateStoreKey = []byte("InitialRateStore") // key initial rate store
)
View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module.

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamTable for coinswap module.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the module's concrete types on the codec.

Types

type DistrKeeper

type DistrKeeper interface {
	GetFeePool(ctx sdk.Context) (feePool distr.FeePool)
	SetFeePool(ctx sdk.Context, feePool distr.FeePool)
	FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error
}

type MsgExchange

type MsgExchange struct {
	From      types.Denom    `json:"from"`
	To        types.Denom    `json:"to"`
	Amount    sdk.Coin       `json:"amount"`    // amount of coins to change
	Requester sdk.AccAddress `json:"requester"` // address output coin is being sent to
}

func NewMsgExchange

func NewMsgExchange(from types.Denom, to types.Denom, amt sdk.Coin, requester sdk.AccAddress) MsgExchange

func (MsgExchange) GetSignBytes

func (msg MsgExchange) GetSignBytes() []byte

func (MsgExchange) GetSigners

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

func (MsgExchange) Route

func (msg MsgExchange) Route() string

Route returns the route of MsgExchange - "coinswap" (sdk.Msg interface).

func (MsgExchange) Type

func (msg MsgExchange) Type() string

Type returns the message type of MsgExchange (sdk.Msg interface).

func (MsgExchange) ValidateBasic

func (msg MsgExchange) ValidateBasic() error

ValidateBasic checks whether the given MsgExchange instance (sdk.Msg interface).

type OracleKeeper

type OracleKeeper interface {
	GetOraclePool(ctx sdk.Context) (oraclePool oracle.OraclePool)
	SetOraclePool(ctx sdk.Context, oraclePool oracle.OraclePool)
	WithdrawOraclePool(ctx sdk.Context, amount sdk.Coins, recipient sdk.AccAddress) error
	FundOraclePool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error
}

type Params

type Params struct {
	RateMultiplier sdk.Dec        `json:"rate_multiplier" yaml:"rate_multiplier"`
	ValidExchanges ValidExchanges `json:"valid_exchanges" yaml:"valid_exchanges"`
}

func DefaultParams

func DefaultParams() Params

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() params.ParamSetPairs

type QueryRateResult

type QueryRateResult struct {
	Rate        sdk.Dec `json:"rate"`
	InitialRate sdk.Dec `json:"initial_rate"`
}

type SupplyKeeper

type SupplyKeeper interface {
	GetSupply(ctx sdk.Context) (supply exported.SupplyI)
	GetModuleAccount(ctx sdk.Context, name string) supplyexported.ModuleAccountI
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
}

SupplyKeeper defines the expected supply Keeper.

type ValidExchanges

type ValidExchanges map[string][]string

func (ValidExchanges) Contains

func (v ValidExchanges) Contains(from types.Denom, to types.Denom) bool

Jump to

Keyboard shortcuts

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