Documentation ¶
Index ¶
- Constants
- Variables
- func AddrLiquidityKeyPrefix(addr sdk.CUAddress) []byte
- func AddrLiquidityKeyPrefixWithDexID(addr sdk.CUAddress, dexID uint32) []byte
- func AddrMaskKey(addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func DecodeLiquidityKey(key []byte) (uint32, sdk.Symbol, sdk.Symbol)
- func DexKey(dexID uint32) []byte
- func GetOrderIDFromUnfinishedOrderKey(key []byte) string
- func GetSymbolFromRepurchaseFundKey(key []byte) string
- func GlobalMaskKey(dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func LiquidityKey(addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func OrderKey(orderID string) []byte
- func RefererKey(addr sdk.CUAddress) []byte
- func RegisterCodec(cdc *codec.Codec)
- func RepurchaseFundKey(symbol string) []byte
- func TotalShareKey(dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func TradingPairKey(dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func TradingPairKeyPrefixWithDexID(dexID uint32) []byte
- func UnfinishedOrderKey(order *Order) []byte
- func UnfinishedOrderKeyPrefixWithAddr(addr sdk.CUAddress) []byte
- func UnfinishedOrderKeyPrefixWithPair(addr sdk.CUAddress, dexID uint32, baseSymbol, quoteSymbol sdk.Symbol) []byte
- type AddrLiquidity
- type DepthBook
- type Dex
- type Earning
- type EventLiquidity
- type EventOrderStatusChanged
- type EventSwap
- type EventSwaps
- type FeeRate
- type MiningPlan
- type MiningWeight
- type MsgAddLiquidity
- type MsgCancelLimitSwap
- type MsgClaimEarning
- type MsgCreateDex
- type MsgCreateTradingPair
- type MsgEditDex
- type MsgEditTradingPair
- type MsgLimitSwap
- type MsgRemoveLiquidity
- type MsgSwapExactIn
- type MsgSwapExactOut
- type Order
- type OrderByCreatedTime
- type Params
- type QueryAddrLiquidityParams
- type QueryAllTradingPairParams
- type QueryDexParams
- type QueryOrderParams
- type QueryOrderbookParams
- type QueryTradingPairParams
- type QueryUnclaimedEarningParams
- type QueryUnfinishedOrderParams
- type ReceiptKeeper
- type ResOrder
- type ResTradingPair
- type SupplyKeeper
- type TokenKeeper
- type TradingPair
- type TransferKeeper
Constants ¶
View Source
const ( EventTypeCreateDex = "create_dex" EventTypeEditDex = "edit_dex" EventTypeCreateTradingPair = "create_trading_pair" EventTypeEditTradingPair = "edit_trading_pair" EventTypeAddLiquidity = "add_liquidity" EventTypeRemoveLiquidity = "remove_liquidity" EventTypeSwap = "swap" EventTypeCancelOrders = "cancel_orders" EventTypeExpireOrders = "expire_orders" EventTypeWithdrawEarning = "withdraw_earning" EventTypeMining = "mining" EventTypeRepurchase = "repurchase" AttributeKeyDexID = "dex_id" AttributeKeyTokenA = "token_a" AttributeKeyTokenB = "token_b" AttributeKeyLiquidity = "liquidity" AttributeKeySwapResult = "swap" AttributeKeyBurned = "burned" AttributeKeyOrders = "orders" AttributeKeyAmount = "amount" AttributeKeyAddress = "address" )
View Source
const ( // ModuleName is the name of this module ModuleName = "openswap" // RouterKey is used to route governance proposals RouterKey = ModuleName // StoreKey is the prefix under which we store this module's data StoreKey = ModuleName // QuerierKey is used to handle abci_query requests QuerierKey = ModuleName // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName )
View Source
const ( TypeMsgCreateDex = "createdex" TypeMsgEditDex = "editdex" TypeMsgCreateTradingPair = "createtradingpair" TypeMsgEditTradingPair = "edittradingpair" TypeMsgAddLiquidity = "addliquidity" TypeMsgRemoveLiquidity = "removeliquidity" TypeMsgSwapExactIn = "swapexactin" TypeMsgSwapExactOut = "swapexactout" TypeMsgLimitSwap = "limitswap" TypeMsgCancelLimitSwap = "cancellimitswap" TypeMsgClaimEarning = "withdrawearning" )
View Source
const ( OrderStatusNew = 0x00 OrderStatusPartiallyFilled = 0x01 OrderStatusFilled = 0x02 OrderStatusCanceled = 0x03 OrderStatusExpired = 0x04 )
View Source
const ( OrderSideBuy = 0x0 OrderSideSell = 0x1 )
View Source
const ( QueryDex = "dex" QueryAllDex = "all-dex" QueryTradingPair = "trading_pair" QueryAllTradingPair = "all_trading_pair" QueryAddrLiquidity = "addr_liquidity" QueryOrderbook = "orderbook" QueryOrder = "order" QueryUnfinishedOrder = "unfinished_order" QueryUnclaimedEarnings = "unclaimed_earnings" QueryRepurchaseFunds = "repurchase_funds" QueryParameters = "parameters" )
query endpoints supported by the upgrade Querier
Variables ¶
View Source
var ( DexKeyPrefix = []byte{0x00} DexIDKey = []byte{0x01} TradingPairKeyPrefix = []byte{0x02} LiquidityKeyPrefix = []byte{0x03} OrderKeyPrefix = []byte{0x04} UnfinishedOrderKeyPrefix = []byte{0x05} WaitToInsertMatchingKey = []byte{0x06} WaitToRemoveFromMatchingKey = []byte{0x07} RefererKeyPrefix = []byte{0x08} GlobalMaskKeyPrefix = []byte{0x0a} AddrMaskKeyPrefix = []byte{0x0b} RepurchaseFundKeyPrefix = []byte{0x0c} )
View Source
var ( DefaultMinimumLiquidity = sdk.NewInt(1000) DefaultLimitSwapMatchingGas = sdk.NewUint(50000) DefaultMaxFeeRate = sdk.NewDecWithPrec(1, 1) // 0.1 DefaultLpRewardRate = sdk.NewDecWithPrec(25, 4) // 0.0025 DefaultRefererTransactionBonusRate = sdk.NewDecWithPrec(1, 4) // 0.0001 DefaultRepurchaseRate = sdk.NewDecWithPrec(4, 4) // 0.0004 DefaultRefererMiningBonusRate = sdk.NewDecWithPrec(1, 1) // 0.1 DefaultRepurchaseDuration = int64(1000) DefaultMiningWeights = []*MiningWeight{NewMiningWeight(0, "hbc", "test", sdk.OneInt())} DefaultMiningPlans = []*MiningPlan{ NewMiningPlan(1, sdk.NewInt(3000000000)), NewMiningPlan(650001, sdk.NewInt(1500000000)), NewMiningPlan(1000001, sdk.NewInt(750000000)), NewMiningPlan(1700001, sdk.NewInt(375000000)), NewMiningPlan(3500001, sdk.NewInt(300000000)), } )
View Source
var ( KeyMinimumLiquidity = []byte("MinimumLiquidity") KeyLimitSwapMatchingGas = []byte("LimitSwapMatchingGas") KeyMaxFeeRate = []byte("MaxFeeRate") KeyLpRewardRate = []byte("LpRewardRate") KeyRepurchaseRate = []byte("RepurchaseRate") KeyRefererTransactionBonusRate = []byte("RefererTransactionBonusRate") KeyRefererMiningBonusRate = []byte("RefererMiningBonusRate") KeyRepurchaseDuration = []byte("RepurchaseDuration") KeyMiningWeights = []byte("MiningWeights") KeyMiningPlans = []byte("MiningPlans") )
View Source
var (
ModuleCUAddress = sdk.CUAddress(crypto.AddressHash([]byte(ModuleName)))
)
View Source
var ModuleCdc = codec.New()
Functions ¶
func AddrLiquidityKeyPrefix ¶
func AddrLiquidityKeyPrefixWithDexID ¶ added in v0.9.3
func AddrMaskKey ¶
func DecodeLiquidityKey ¶ added in v0.9.3
func GetSymbolFromRepurchaseFundKey ¶ added in v0.9.3
func LiquidityKey ¶
func RefererKey ¶
func RepurchaseFundKey ¶ added in v0.9.3
func TradingPairKeyPrefixWithDexID ¶ added in v0.9.3
func UnfinishedOrderKey ¶
func UnfinishedOrderKeyPrefixWithAddr ¶ added in v0.9.3
Types ¶
type AddrLiquidity ¶
type AddrLiquidity struct { *TradingPair `json:"trading_pair"` Liquidity sdk.Int `json:"liquidity"` }
func NewAddrLiquidity ¶
func NewAddrLiquidity(pair *TradingPair, liquidity sdk.Int) *AddrLiquidity
type DepthBook ¶
type Dex ¶ added in v0.9.3
type Earning ¶
type EventLiquidity ¶
type EventLiquidity struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` TokenAAmount sdk.Int `json:"token_a_amount"` TokenBAmount sdk.Int `json:"token_b_amount"` ChangedTokenAAmount sdk.Int `json:"changed_a_amount"` ChangedTokenBAmount sdk.Int `json:"changed_b_amount"` }
func NewEventLiquidity ¶
func (*EventLiquidity) String ¶
func (e *EventLiquidity) String() string
type EventOrderStatusChanged ¶
type EventOrderStatusChanged struct {
OrderIDs []string `json:"order_ids"`
}
func NewEventOrderStatusChanged ¶
func NewEventOrderStatusChanged(orderIDs []string) *EventOrderStatusChanged
func (*EventOrderStatusChanged) String ¶
func (e *EventOrderStatusChanged) String() string
type EventSwap ¶
type EventSwap struct { From sdk.CUAddress `json:"from"` OrderID string `json:"order_id"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` TokenAAmount sdk.Int `json:"token_a_amount"` TokenBAmount sdk.Int `json:"token_b_amount"` TokenIn sdk.Symbol `json:"token_in"` AmountIn sdk.Int `json:"amount_in"` AmountOut sdk.Int `json:"amount_out"` }
type EventSwaps ¶
type EventSwaps []*EventSwap
func (*EventSwaps) String ¶
func (e *EventSwaps) String() string
type FeeRate ¶ added in v0.9.3
type FeeRate struct { LPRewardRate sdk.Dec `json:"lp_reward_rate"` RepurchaseRate sdk.Dec `json:"repurchase_rate"` RefererRewardRate sdk.Dec `json:"referer_reward_rate"` }
func NewFeeRate ¶ added in v0.9.3
func (*FeeRate) TotalFeeRate ¶ added in v0.9.3
type MiningPlan ¶
type MiningPlan struct { StartHeight uint64 `json:"start_height"` MiningPerBlock sdk.Int `json:"mining_per_block"` }
func NewMiningPlan ¶
func NewMiningPlan(startHeight uint64, miningPerBlock sdk.Int) *MiningPlan
type MiningWeight ¶
type MiningWeight struct { DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` Weight sdk.Int `json:"weight"` }
func NewMiningWeight ¶
type MsgAddLiquidity ¶
type MsgAddLiquidity struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` MaxTokenAAmount sdk.Int `json:"max_token_a_amount"` MaxTokenBAmount sdk.Int `json:"max_token_b_amount"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgAddLiquidity ¶
func (MsgAddLiquidity) GetSignBytes ¶
func (msg MsgAddLiquidity) GetSignBytes() []byte
func (MsgAddLiquidity) GetSigners ¶
func (msg MsgAddLiquidity) GetSigners() []sdk.CUAddress
func (MsgAddLiquidity) Route ¶
func (msg MsgAddLiquidity) Route() string
func (MsgAddLiquidity) Type ¶
func (msg MsgAddLiquidity) Type() string
func (MsgAddLiquidity) ValidateBasic ¶
func (msg MsgAddLiquidity) ValidateBasic() sdk.Error
type MsgCancelLimitSwap ¶
type MsgCancelLimitSwap struct { From sdk.CUAddress `json:"from"` OrderIDs []string `json:"order_ids"` }
func NewMsgCancelLimitSwap ¶
func NewMsgCancelLimitSwap(from sdk.CUAddress, orderIDs []string) MsgCancelLimitSwap
func (MsgCancelLimitSwap) GetSignBytes ¶
func (msg MsgCancelLimitSwap) GetSignBytes() []byte
func (MsgCancelLimitSwap) GetSigners ¶
func (msg MsgCancelLimitSwap) GetSigners() []sdk.CUAddress
func (MsgCancelLimitSwap) Route ¶
func (msg MsgCancelLimitSwap) Route() string
func (MsgCancelLimitSwap) Type ¶
func (msg MsgCancelLimitSwap) Type() string
func (MsgCancelLimitSwap) ValidateBasic ¶
func (msg MsgCancelLimitSwap) ValidateBasic() sdk.Error
type MsgClaimEarning ¶
type MsgClaimEarning struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` }
func NewMsgClaimEarning ¶
func (MsgClaimEarning) GetSignBytes ¶
func (msg MsgClaimEarning) GetSignBytes() []byte
func (MsgClaimEarning) GetSigners ¶
func (msg MsgClaimEarning) GetSigners() []sdk.CUAddress
func (MsgClaimEarning) Route ¶
func (msg MsgClaimEarning) Route() string
func (MsgClaimEarning) Type ¶
func (msg MsgClaimEarning) Type() string
func (MsgClaimEarning) ValidateBasic ¶
func (msg MsgClaimEarning) ValidateBasic() sdk.Error
type MsgCreateDex ¶ added in v0.9.3
type MsgCreateDex struct { From sdk.CUAddress `json:"from"` Name string `json:"name"` IncomeReceiver sdk.CUAddress `json:"income_receiver"` }
func NewMsgCreateDex ¶ added in v0.9.3
func (MsgCreateDex) GetSignBytes ¶ added in v0.9.3
func (msg MsgCreateDex) GetSignBytes() []byte
func (MsgCreateDex) GetSigners ¶ added in v0.9.3
func (msg MsgCreateDex) GetSigners() []sdk.CUAddress
func (MsgCreateDex) Route ¶ added in v0.9.3
func (msg MsgCreateDex) Route() string
func (MsgCreateDex) Type ¶ added in v0.9.3
func (msg MsgCreateDex) Type() string
func (MsgCreateDex) ValidateBasic ¶ added in v0.9.3
func (msg MsgCreateDex) ValidateBasic() sdk.Error
type MsgCreateTradingPair ¶ added in v0.9.3
type MsgCreateTradingPair struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` IsPublic bool `json:"is_public"` LPRewardRate sdk.Dec `json:"lp_reward_rate"` RefererRewardRate sdk.Dec `json:"referer_reward_rate"` }
func NewMsgCreateTradingPair ¶ added in v0.9.3
func (MsgCreateTradingPair) GetSignBytes ¶ added in v0.9.3
func (msg MsgCreateTradingPair) GetSignBytes() []byte
func (MsgCreateTradingPair) GetSigners ¶ added in v0.9.3
func (msg MsgCreateTradingPair) GetSigners() []sdk.CUAddress
func (MsgCreateTradingPair) Route ¶ added in v0.9.3
func (msg MsgCreateTradingPair) Route() string
func (MsgCreateTradingPair) Type ¶ added in v0.9.3
func (msg MsgCreateTradingPair) Type() string
func (MsgCreateTradingPair) ValidateBasic ¶ added in v0.9.3
func (msg MsgCreateTradingPair) ValidateBasic() sdk.Error
type MsgEditDex ¶ added in v0.9.3
type MsgEditDex struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` Name string `json:"name"` IncomeReceiver *sdk.CUAddress `json:"income_receiver,omitempty"` }
func NewMsgEditDex ¶ added in v0.9.3
func (MsgEditDex) GetSignBytes ¶ added in v0.9.3
func (msg MsgEditDex) GetSignBytes() []byte
func (MsgEditDex) GetSigners ¶ added in v0.9.3
func (msg MsgEditDex) GetSigners() []sdk.CUAddress
func (MsgEditDex) Route ¶ added in v0.9.3
func (msg MsgEditDex) Route() string
func (MsgEditDex) Type ¶ added in v0.9.3
func (msg MsgEditDex) Type() string
func (MsgEditDex) ValidateBasic ¶ added in v0.9.3
func (msg MsgEditDex) ValidateBasic() sdk.Error
type MsgEditTradingPair ¶ added in v0.9.3
type MsgEditTradingPair struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` IsPublic *bool `json:"is_public,omitempty"` LPRewardRate *sdk.Dec `json:"lp_reward_rate,omitempty"` RefererRewardRate *sdk.Dec `json:"referer_reward_rate,omitempty"` }
func NewMsgEditTradingPair ¶ added in v0.9.3
func (MsgEditTradingPair) GetSignBytes ¶ added in v0.9.3
func (msg MsgEditTradingPair) GetSignBytes() []byte
func (MsgEditTradingPair) GetSigners ¶ added in v0.9.3
func (msg MsgEditTradingPair) GetSigners() []sdk.CUAddress
func (MsgEditTradingPair) Route ¶ added in v0.9.3
func (msg MsgEditTradingPair) Route() string
func (MsgEditTradingPair) Type ¶ added in v0.9.3
func (msg MsgEditTradingPair) Type() string
func (MsgEditTradingPair) ValidateBasic ¶ added in v0.9.3
func (msg MsgEditTradingPair) ValidateBasic() sdk.Error
type MsgLimitSwap ¶
type MsgLimitSwap struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` OrderID string `json:"order_id"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` AmountIn sdk.Int `json:"amount_in"` Price sdk.Dec `json:"price"` BaseSymbol sdk.Symbol `json:"base_symbol"` QuoteSymbol sdk.Symbol `json:"quote_symbol"` Side int `json:"side"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgLimitSwap ¶
func (MsgLimitSwap) GetSignBytes ¶
func (msg MsgLimitSwap) GetSignBytes() []byte
func (MsgLimitSwap) GetSigners ¶
func (msg MsgLimitSwap) GetSigners() []sdk.CUAddress
func (MsgLimitSwap) Route ¶
func (msg MsgLimitSwap) Route() string
func (MsgLimitSwap) Type ¶
func (msg MsgLimitSwap) Type() string
func (MsgLimitSwap) ValidateBasic ¶
func (msg MsgLimitSwap) ValidateBasic() sdk.Error
type MsgRemoveLiquidity ¶
type MsgRemoveLiquidity struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` Liquidity sdk.Int `json:"liquidity"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgRemoveLiquidity ¶
func (MsgRemoveLiquidity) GetSignBytes ¶
func (msg MsgRemoveLiquidity) GetSignBytes() []byte
func (MsgRemoveLiquidity) GetSigners ¶
func (msg MsgRemoveLiquidity) GetSigners() []sdk.CUAddress
func (MsgRemoveLiquidity) Route ¶
func (msg MsgRemoveLiquidity) Route() string
func (MsgRemoveLiquidity) Type ¶
func (msg MsgRemoveLiquidity) Type() string
func (MsgRemoveLiquidity) ValidateBasic ¶
func (msg MsgRemoveLiquidity) ValidateBasic() sdk.Error
type MsgSwapExactIn ¶
type MsgSwapExactIn struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` AmountIn sdk.Int `json:"amount_in"` MinAmountOut sdk.Int `json:"min_amount_out"` SwapPath []sdk.Symbol `json:"swap_path"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgSwapExactIn ¶
func (MsgSwapExactIn) GetSignBytes ¶
func (msg MsgSwapExactIn) GetSignBytes() []byte
func (MsgSwapExactIn) GetSigners ¶
func (msg MsgSwapExactIn) GetSigners() []sdk.CUAddress
func (MsgSwapExactIn) Route ¶
func (msg MsgSwapExactIn) Route() string
func (MsgSwapExactIn) Type ¶
func (msg MsgSwapExactIn) Type() string
func (MsgSwapExactIn) ValidateBasic ¶
func (msg MsgSwapExactIn) ValidateBasic() sdk.Error
type MsgSwapExactOut ¶
type MsgSwapExactOut struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` MaxAmountIn sdk.Int `json:"max_amount_in"` AmountOut sdk.Int `json:"amount_out"` SwapPath []sdk.Symbol `json:"swap_path"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgSwapExactOut ¶
func (MsgSwapExactOut) GetSignBytes ¶
func (msg MsgSwapExactOut) GetSignBytes() []byte
func (MsgSwapExactOut) GetSigners ¶
func (msg MsgSwapExactOut) GetSigners() []sdk.CUAddress
func (MsgSwapExactOut) Route ¶
func (msg MsgSwapExactOut) Route() string
func (MsgSwapExactOut) Type ¶
func (msg MsgSwapExactOut) Type() string
func (MsgSwapExactOut) ValidateBasic ¶
func (msg MsgSwapExactOut) ValidateBasic() sdk.Error
type Order ¶
type Order struct { OrderID string `json:"order_id"` DexID uint32 `json:"dex_id"` From sdk.CUAddress `json:"from"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` CreatedTime int64 `json:"created_time"` ExpiredTime int64 `json:"expired_time"` FinishedTime int64 `json:"finished_time"` Status byte `json:"status"` Side byte `json:"side"` BaseSymbol sdk.Symbol `json:"base_symbol"` QuoteSymbol sdk.Symbol `json:"quote_symbol"` Price sdk.Dec `json:"price"` AmountIn sdk.Int `json:"amount_int"` LockedFund sdk.Int `json:"locked_fund"` FeeRate *FeeRate `json:"fee_rate"` }
func (*Order) IsFinished ¶
func (*Order) RemainQuantity ¶
type OrderByCreatedTime ¶
type OrderByCreatedTime []*Order
func (OrderByCreatedTime) Len ¶
func (o OrderByCreatedTime) Len() int
func (OrderByCreatedTime) Less ¶
func (o OrderByCreatedTime) Less(i, j int) bool
func (OrderByCreatedTime) Swap ¶
func (o OrderByCreatedTime) Swap(i, j int)
type Params ¶
type Params struct { MinimumLiquidity sdk.Int `json:"minimum_liquidity"` LimitSwapMatchingGas sdk.Uint `json:"limit_swap_matching_gas"` MaxFeeRate sdk.Dec `json:"max_fee_rate"` LpRewardRate sdk.Dec `json:"lp_reward_rate"` RepurchaseRate sdk.Dec `json:"repurchase_rate"` RefererTransactionBonusRate sdk.Dec `json:"referer_transaction_bonus_rate"` RefererMiningBonusRate sdk.Dec `json:"referer_mining_bonus_rate"` RepurchaseDuration int64 `json:"repurchase_duration"` MiningWeights []*MiningWeight `json:"mining_weights"` MiningPlans []*MiningPlan `json:"mining_plans"` }
Params defines the high level settings for staking
func MustUnmarshalParams ¶
unmarshal the current staking params value from store key or panic
func NewParams ¶
func NewParams(minLiquidity sdk.Int, limitSwapMatchingGas sdk.Uint, maxFeeRate, lpRewardRate, repurchaseRate, refererTransactionBonusRate, refererMiningBonusRate sdk.Dec, repurchaseDuration int64, miningWeights []*MiningWeight, miningPlans []*MiningPlan) Params
NewParams creates a new Params instance
func UnmarshalParams ¶
unmarshal the current staking params value from store key
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type QueryAddrLiquidityParams ¶
func NewQueryAddrLiquidityParams ¶
func NewQueryAddrLiquidityParams(addr sdk.CUAddress, dexID *uint32) QueryAddrLiquidityParams
type QueryAllTradingPairParams ¶ added in v0.9.3
type QueryAllTradingPairParams struct {
DexID *uint32
}
func NewQueryAllTradingPairParams ¶ added in v0.9.3
func NewQueryAllTradingPairParams(dexID *uint32) QueryAllTradingPairParams
type QueryDexParams ¶ added in v0.9.3
type QueryDexParams struct {
DexID uint32
}
func NewQueryDexParams ¶ added in v0.9.3
func NewQueryDexParams(dexID uint32) QueryDexParams
type QueryOrderParams ¶
type QueryOrderParams struct {
OrderID string
}
func NewQueryOrderParams ¶
func NewQueryOrderParams(orderID string) QueryOrderParams
type QueryOrderbookParams ¶
type QueryOrderbookParams struct { DexID uint32 BaseSymbol sdk.Symbol QuoteSymbol sdk.Symbol Merge bool }
func NewQueryOrderbookParams ¶
func NewQueryOrderbookParams(dexID uint32, baseSymbol, quoteSymbol sdk.Symbol, merge bool) QueryOrderbookParams
type QueryTradingPairParams ¶
func NewQueryTradingPairParams ¶
func NewQueryTradingPairParams(dexID uint32, tokenA, tokenB sdk.Symbol) QueryTradingPairParams
type QueryUnclaimedEarningParams ¶
func NewQueryUnclaimedEarningParams ¶
func NewQueryUnclaimedEarningParams(addr sdk.CUAddress) QueryUnclaimedEarningParams
type QueryUnfinishedOrderParams ¶
type QueryUnfinishedOrderParams struct { Addr sdk.CUAddress DexID uint32 BaseSymbol sdk.Symbol QuoteSymbol sdk.Symbol }
type ReceiptKeeper ¶
type ResOrder ¶
type ResOrder struct { OrderID string `json:"order_id"` From sdk.CUAddress `json:"from"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` CreatedTime int64 `json:"created_time"` ExpiredTime int64 `json:"expired_time"` FinishedTime int64 `json:"finished_time"` Status byte `json:"status"` Side byte `json:"side"` BaseSymbol sdk.Symbol `json:"base_symbol"` QuoteSymbol sdk.Symbol `json:"quote_symbol"` Price sdk.Dec `json:"price"` AmountIn sdk.Int `json:"amount_int"` LockedFund sdk.Int `json:"locked_fund"` RemainQuantity sdk.Int `json:"remain_quantity"` }
func NewResOrder ¶
func NewResOrders ¶
type ResTradingPair ¶
type ResTradingPair struct { DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` TokenAAmount sdk.Int `json:"token_a_amount"` TokenBAmount sdk.Int `json:"token_b_amount"` TotalLiquidity sdk.Int `json:"total_liquidity"` IsPublic bool `json:"is_public"` LPRewardRate sdk.Dec `json:"lp_reward_rate"` RefererRewardRate sdk.Dec `json:"referer_reward_rate"` }
func NewResTradingPair ¶
func NewResTradingPair(pair *TradingPair) *ResTradingPair
func NewResTradingPairs ¶
func NewResTradingPairs(pairs []*TradingPair) []*ResTradingPair
type SupplyKeeper ¶
type SupplyKeeper interface { SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error) MintCoins(ctx sdk.Context, name string, amt sdk.Coins) sdk.Error BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Error GetSupply(ctx sdk.Context) (supply supplyI.SupplyI) }
SupplyKeeper defines the expected supply keeper
type TokenKeeper ¶
type TradingPair ¶
type TradingPair struct { DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` TokenAAmount sdk.Int `json:"token_a_amount"` TokenBAmount sdk.Int `json:"token_b_amount"` TotalLiquidity sdk.Int `json:"total_liquidity"` IsPublic bool `json:"is_public"` LPRewardRate sdk.Dec `json:"lp_reward_rate"` RefererRewardRate sdk.Dec `json:"referer_reward_rate"` }
func NewCustomTradingPair ¶ added in v0.9.3
func NewDefaultTradingPair ¶ added in v0.9.3
func NewDefaultTradingPair(tokenA, tokenB sdk.Symbol, initialLiquidity sdk.Int) *TradingPair
func (*TradingPair) Price ¶
func (t *TradingPair) Price() sdk.Dec
func (*TradingPair) Validate ¶
func (t *TradingPair) Validate() error
type TransferKeeper ¶
type TransferKeeper interface { GetAllBalance(ctx sdk.Context, addr sdk.CUAddress) sdk.Coins AddCoins(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error) AddCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error) SubCoins(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error) SubCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error) SubCoinHold(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error) LockCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) ([]sdk.Flow, sdk.Error) UnlockCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) ([]sdk.Flow, sdk.Error) }
Click to show internal directories.
Click to hide internal directories.