Documentation ¶
Index ¶
- Constants
- func ErrInsufficientSwapCoins(codespace sdk.CodespaceType, rval sdk.Int) sdk.Error
- func ErrNoEffectivePrice(codespace sdk.CodespaceType, denom string) sdk.Error
- func ErrRecursiveSwap(codespace sdk.CodespaceType, denom string) sdk.Error
- func ErrUnknownDenomination(codespace sdk.CodespaceType, denom string) sdk.Error
- func NewHandler(k Keeper) sdk.Handler
- func RegisterCodec(cdc *codec.Codec)
- type Keeper
- type SwapHistory
- type SwapMsg
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = "market" CodeInsufficientSwap sdk.CodeType = 1 CodeUnknownDenom sdk.CodeType = 2 CodeNoEffectivePrice sdk.CodeType = 3 CodeRecursiveSwap sdk.CodeType = 4 )
market errors
const RouterKey = "market"
RouterKey is they name of the market module
const StoreKey = "market"
StoreKey is string representation of the store key for market
Variables ¶
This section is empty.
Functions ¶
func ErrInsufficientSwapCoins ¶
ErrInsufficientSwapCoins called when not enough coins are being requested for a swap
func ErrNoEffectivePrice ¶ added in v0.0.5
func ErrNoEffectivePrice(codespace sdk.CodespaceType, denom string) sdk.Error
ErrNoEffectivePrice called when a price for the asset is not registered with the oracle
func ErrRecursiveSwap ¶
func ErrRecursiveSwap(codespace sdk.CodespaceType, denom string) sdk.Error
ErrRecursiveSwap called when Ask and Offer coin denominatioins are equal
func ErrUnknownDenomination ¶
func ErrUnknownDenomination(codespace sdk.CodespaceType, denom string) sdk.Error
ErrUnknownDenomination called when the denom is not whitelisted by the oracle
func NewHandler ¶
NewHandler creates a new handler for all market type messages.
func RegisterCodec ¶ added in v0.0.5
Register concrete types on codec codec
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
nolint
type SwapHistory ¶ added in v0.0.5
type SwapHistory []SwapMsg
func (SwapHistory) String ¶ added in v0.0.5
func (swaps SwapHistory) String() (out string)
String implements fmt.Stringer interface
type SwapMsg ¶
type SwapMsg struct { Trader sdk.AccAddress // Address of the trader OfferCoin sdk.Coin // Coin being offered AskDenom string // Denom of the coin to swap to }
SwapMsg contains a swap request
func NewSwapMsg ¶
NewSwapMsg creates a SwapMsg instance
func (SwapMsg) GetSigners ¶
func (msg SwapMsg) GetSigners() []sdk.AccAddress
GetSigners Implements Msg
func (SwapMsg) ValidateBasic ¶
ValidateBasic Implements Msg