Versions in this module Expand all Collapse all v0 v0.11.1 Mar 16, 2021 v0.10.1 Mar 16, 2021 Changes in this version + const AttributeValueCategory + const CodeAddressIsRequire + const CodeBaseAmountNameBiggerThanQuoteAmountName + const CodeBaseNameEqualQuoteName + const CodeBaseTokensAmountBiggerThanMax + const CodeBlockTimeBigThanDeadline + const CodeBurnPoolTokenFailed + const CodeConvertQuoteTokenAmount + const CodeConvertSellTokenAmount + const CodeInsufficientPoolToken + const CodeInternalError + const CodeInvalidCoins + const CodeInvalidTokenPair + const CodeIsPoolTokenPairExist + const CodeIsSwapTokenPairExist + const CodeIsZeroValue + const CodeLessThan + const CodeMaxBaseAmount + const CodeMaxBaseAmountOrQuoteAmountIsNegative + const CodeMinBaseAmount + const CodeMinBoughtTokenAmount + const CodeMinLiquidityIsNegative + const CodeMinQuoteAmount + const CodeMintCoinsFailed + const CodeMintPoolTokenFailed + const CodeMsgDeadlineLessThanBlockTime + const CodeNonExistPoolToken + const CodeNonExistSwapTokenPair + const CodeNotAllowedOriginSymbol + const CodeQueryParamsAddressIsEmpty + const CodeQueryParamsBaseTokenIsEmpty + const CodeQueryParamsQuoteTokenAmountIsEmpty + const CodeQuoteAmount + const CodeSellAmountEqualBuyToken + const CodeSellAmountOrBuyTokenIsEmpty + const CodeSendCoinsFailed + const CodeSendCoinsFromAccountToModule + const CodeSendCoinsFromPoolToAccountFailed + const CodeSendCoinsToPoolFailed + const CodeSoldTokenAmount + const CodeSoldTokenAmountIsNegative + const CodeSwapUnknownMsgType + const CodeSwapUnknownQueryTypes + const CodeToken0NameEqualToken1Name + const CodeTokenNotExist + const CodeValidateDenom + const CodeValidateSwapAmountName + const DefaultCodespace + const DefaultParamspace + const GenerateTokenType + const ModuleName + const PoolTokenPrefix + const QuerierRoute + const QueryBuyAmount + const QueryParams + const QueryRedeemableAssets + const QuerySwapAddLiquidityQuote + const QuerySwapQuoteInfo + const QuerySwapTokenPair + const QuerySwapTokenPairs + const RouterKey + const StoreKey + const TestBasePooledToken + const TestBasePooledToken2 + const TestBasePooledToken3 + const TestQuotePooledToken + const TestSwapTokenPairName + const TypeMsgAddLiquidity + const TypeMsgTokenSwap + var KeyFeeRate = []byte("FeeRate") + var ModuleCdc *codec.Codec + var TokenPairPrefixKey = []byte + func CreateTestMsgs(addr sdk.AccAddress) []sdk.Msg + func ErrAddressIsRequire(msg string) sdk.EnvelopedErr + func ErrBaseAmountNameBiggerThanQuoteAmountName() sdk.EnvelopedErr + func ErrBaseNameEqualQuoteName() sdk.EnvelopedErr + func ErrBaseTokensAmountBiggerThanMax() sdk.EnvelopedErr + func ErrBlockTimeBigThanDeadline() sdk.EnvelopedErr + func ErrBurnPoolTokenFailed(err error) sdk.EnvelopedErr + func ErrCodeMinCoinsFailed(err error) sdk.EnvelopedErr + func ErrConvertQuoteTokenAmount(quoteTokenAmount string, err error) sdk.EnvelopedErr + func ErrConvertSellTokenAmount(sellTokenAmount string, err error) sdk.EnvelopedErr + func ErrInsufficientPoolToken() sdk.EnvelopedErr + func ErrInvalidCoins() sdk.EnvelopedErr + func ErrInvalidTokenPair(swapTokenPair string) sdk.EnvelopedErr + func ErrIsZeroValue(msg string) sdk.EnvelopedErr + func ErrLessThan(param1 string, param2 string) sdk.EnvelopedErr + func ErrMaxBaseAmount() sdk.EnvelopedErr + func ErrMaxBaseAmountOrQuoteAmountIsNegative() sdk.EnvelopedErr + func ErrMinBaseAmount() sdk.EnvelopedErr + func ErrMinBoughtTokenAmount() sdk.EnvelopedErr + func ErrMinLiquidityIsNegative() sdk.EnvelopedErr + func ErrMinQuoteAmount() sdk.EnvelopedErr + func ErrMintPoolTokenFailed(err error) sdk.EnvelopedErr + func ErrMsgDeadlineLessThanBlockTime() sdk.EnvelopedErr + func ErrNonExistPoolToken(token string) sdk.EnvelopedErr + func ErrNonExistSwapTokenPair(tokenPairName string) sdk.EnvelopedErr + func ErrNotAllowedOriginSymbol() sdk.EnvelopedErr + func ErrPoolTokenPairExist() sdk.EnvelopedErr + func ErrQueryParamsAddressIsEmpty() sdk.EnvelopedErr + func ErrQueryParamsBaseTokenIsEmpty() sdk.EnvelopedErr + func ErrQueryParamsQuoteTokenAmountIsEmpty() sdk.EnvelopedErr + func ErrQuoteAmount() sdk.EnvelopedErr + func ErrSellAmountEqualBuyToken() sdk.EnvelopedErr + func ErrSellAmountOrBuyTokenIsEmpty() sdk.EnvelopedErr + func ErrSendCoinsFailed(err error) sdk.EnvelopedErr + func ErrSendCoinsFromAccountToModule(err error) sdk.EnvelopedErr + func ErrSendCoinsFromPoolToAccountFailed(msg string) sdk.EnvelopedErr + func ErrSendCoinsToPoolFailed(msg string) sdk.EnvelopedErr + func ErrSoldTokenAmount() sdk.EnvelopedErr + func ErrSoldTokenAmountIsNegative() sdk.EnvelopedErr + func ErrSwapTokenPairExist() sdk.EnvelopedErr + func ErrSwapUnknownMsgType() sdk.EnvelopedErr + func ErrSwapUnknownQueryType() sdk.EnvelopedErr + func ErrToken0NameEqualToken1Name() sdk.EnvelopedErr + func ErrTokenNotExist() sdk.EnvelopedErr + func ErrValidateDenom(tokenName string) sdk.EnvelopedErr + func ErrValidateSwapAmountName() sdk.EnvelopedErr + func GetBaseQuoteTokenName(token0, token1 string) (string, string) + func GetPoolTokenName(token1, token2 string) string + func GetSwapTokenPairName(token0, token1 string) string + func GetTokenPairKey(key string) []byte + func InitPoolToken(poolTokenName string) token.Token + func IsPoolToken(symbol string) bool + func ParamKeyTable() params.KeyTable + func RegisterCodec(cdc *codec.Codec) + func SetTestTokens(ctx sdk.Context, tokenKeeper token.Keeper, supplyKeeper supply.Keeper, ...) error + func SplitPoolToken(symbol string) (token0, token1 string) + func ValidateBaseAndQuoteAmount(baseAmountName, quoteAmountName string) error + func ValidateSwapAmountName(amountName string) error + type BackendKeeper interface + OnSwapCreateExchange func(ctx sdk.Context, swapTokenPair SwapTokenPair) + OnSwapToken func(ctx sdk.Context, address sdk.AccAddress, swapTokenPair SwapTokenPair, ...) + type BankKeeper interface + SendCoins func(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + SubtractCoins func(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, error) + type MsgAddLiquidity struct + Deadline int64 + MaxBaseAmount sdk.SysCoin + MinLiquidity sdk.Dec + QuoteAmount sdk.SysCoin + Sender sdk.AccAddress + func NewMsgAddLiquidity(minLiquidity sdk.Dec, maxBaseAmount, quoteAmount sdk.SysCoin, deadline int64, ...) MsgAddLiquidity + func (msg MsgAddLiquidity) GetSignBytes() []byte + func (msg MsgAddLiquidity) GetSigners() []sdk.AccAddress + func (msg MsgAddLiquidity) GetSwapTokenPairName() string + func (msg MsgAddLiquidity) Route() string + func (msg MsgAddLiquidity) Type() string + func (msg MsgAddLiquidity) ValidateBasic() sdk.Error + type MsgCreateExchange struct + Sender sdk.AccAddress + Token0Name string + Token1Name string + func NewMsgCreateExchange(token0Name string, token1Name string, sender sdk.AccAddress) MsgCreateExchange + func (msg MsgCreateExchange) GetSignBytes() []byte + func (msg MsgCreateExchange) GetSigners() []sdk.AccAddress + func (msg MsgCreateExchange) GetSwapTokenPairName() string + func (msg MsgCreateExchange) Route() string + func (msg MsgCreateExchange) Type() string + func (msg MsgCreateExchange) ValidateBasic() sdk.Error + type MsgRemoveLiquidity struct + Deadline int64 + Liquidity sdk.Dec + MinBaseAmount sdk.SysCoin + MinQuoteAmount sdk.SysCoin + Sender sdk.AccAddress + func NewMsgRemoveLiquidity(liquidity sdk.Dec, minBaseAmount, minQuoteAmount sdk.SysCoin, deadline int64, ...) MsgRemoveLiquidity + func (msg MsgRemoveLiquidity) GetSignBytes() []byte + func (msg MsgRemoveLiquidity) GetSigners() []sdk.AccAddress + func (msg MsgRemoveLiquidity) GetSwapTokenPairName() string + func (msg MsgRemoveLiquidity) Route() string + func (msg MsgRemoveLiquidity) Type() string + func (msg MsgRemoveLiquidity) ValidateBasic() sdk.Error + type MsgTokenToToken struct + Deadline int64 + MinBoughtTokenAmount sdk.SysCoin + Recipient sdk.AccAddress + Sender sdk.AccAddress + SoldTokenAmount sdk.SysCoin + func NewMsgTokenToToken(soldTokenAmount, minBoughtTokenAmount sdk.SysCoin, deadline int64, ...) MsgTokenToToken + func (msg MsgTokenToToken) GetSignBytes() []byte + func (msg MsgTokenToToken) GetSigners() []sdk.AccAddress + func (msg MsgTokenToToken) GetSwapTokenPairName() string + func (msg MsgTokenToToken) Route() string + func (msg MsgTokenToToken) Type() string + func (msg MsgTokenToToken) ValidateBasic() sdk.Error + type ParamSubspace interface + Get func(ctx sdk.Context, key []byte, ptr interface{}) + GetParamSet func(ctx sdk.Context, ps params.ParamSet) + SetParamSet func(ctx sdk.Context, ps params.ParamSet) + WithKeyTable func(table params.KeyTable) params.Subspace + type Params struct + FeeRate sdk.Dec + func DefaultParams() Params + func NewParams(feeRate sdk.Dec) Params + func (p *Params) ParamSetPairs() params.ParamSetPairs + func (p Params) String() string + type QueryBuyAmountParams struct + SoldToken sdk.SysCoin + TokenToBuy string + type QuerySwapAddInfoParams struct + BaseToken string + QuoteTokenAmount string + func NewQuerySwapAddInfoParams(quoteTokenAmount string, baseToken string) QuerySwapAddInfoParams + type QuerySwapBuyInfoParams struct + BuyToken string + SellTokenAmount string + func NewQuerySwapBuyInfoParams(sellTokenAmount string, buyToken string) QuerySwapBuyInfoParams + type SupplyKeeper interface + BurnCoins func(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Error + GetSupplyByDenom func(ctx sdk.Context, denom string) sdk.Dec + MintCoins func(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Error + SendCoinsFromAccountToModule func(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, ...) sdk.Error + SendCoinsFromModuleToAccount func(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) sdk.Error + type SwapAddInfo struct + BaseTokenAmount sdk.Dec + Liquidity sdk.Dec + PoolShare sdk.Dec + type SwapBuyInfo struct + BuyAmount sdk.Dec + Fee string + Price sdk.Dec + PriceImpact sdk.Dec + Route string + type SwapTokenPair struct + BasePooledCoin sdk.SysCoin + PoolTokenName string + QuotePooledCoin sdk.SysCoin + func GetTestSwapTokenPair() SwapTokenPair + func NewSwapPair(token0, token1 string) SwapTokenPair + func NewSwapTokenPair(quotePooledCoin sdk.SysCoin, basePooledCoin sdk.SysCoin, poolTokenName string) *SwapTokenPair + func (s SwapTokenPair) String() string + func (s SwapTokenPair) TokenPairName() string + type TokenKeeper interface + GetCoins func(ctx sdk.Context, addr sdk.AccAddress) sdk.SysCoins + GetTokenInfo func(ctx sdk.Context, symbol string) token.Token + GetTokensInfo func(ctx sdk.Context) (tokens []token.Token) + NewToken func(ctx sdk.Context, token token.Token) + TokenExist func(ctx sdk.Context, symbol string) bool + UpdateToken func(ctx sdk.Context, token token.Token)