dex

package
v2.6.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: GPL-3.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmountBytesToString

func AmountBytesToString(amt []byte) string

func GetConsensusReader

func GetConsensusReader(vite *vite.Vite) *util.VMConsensusReader

func TokenBytesToString

func TokenBytesToString(token []byte) string

Types

type DividendPoolInfo

type DividendPoolInfo struct {
	Amount         string           `json:"amount"`
	QuoteTokenType int32            `json:"quoteTokenType"`
	TokenInfo      *RpcDexTokenInfo `json:"tokenInfo,omitempty"`
}

type Funds

type Funds struct {
	Funds []*SimpleFund `json:"funds"`
}

type NewRpcMarketInfo

type NewRpcMarketInfo struct {
	MarketId             int32  `json:"marketId"`
	MarketSymbol         string `json:"marketSymbol"`
	TradeToken           string `json:"tradeToken"`
	QuoteToken           string `json:"quoteToken"`
	QuoteTokenType       int32  `json:"quoteTokenType"`
	TradeTokenDecimals   int32  `json:"tradeTokenDecimals,omitempty"`
	QuoteTokenDecimals   int32  `json:"quoteTokenDecimals"`
	TakerOperatorFeeRate int32  `json:"takerOperatorFeeRate"`
	MakerOperatorFeeRate int32  `json:"makerOperatorFeeRate"`
	AllowMining          bool   `json:"allowMining"`
	Valid                bool   `json:"valid"`
	Owner                string `json:"owner"`
	Creator              string `json:"creator"`
	Stopped              bool   `json:"stopped"`
	Timestamp            int64  `json:"timestamp"`
}

func MarketInfoToNewRpc

func MarketInfoToNewRpc(mkInfo *dex.MarketInfo) *NewRpcMarketInfo

type NewRpcVxMineInfo

type NewRpcVxMineInfo struct {
	HistoryMinedSum string           `json:"historyMinedSum"`
	Total           string           `json:"total"`
	FeeMineTotal    string           `json:"feeMineTotal"`
	FeeMineDetail   map[int32]string `json:"feeMineDetail"`
	StakingMine     string           `json:"stakingMine"`
	MakerMine       string           `json:"makerMine"`
}

type OrdersRes

type OrdersRes struct {
	Orders []*RpcOrder `json:"orders,omitempty"`
	Size   int         `json:"size"`
}

type RpcDexFeesByPeriod

type RpcDexFeesByPeriod struct {
	FeesForDividend []*RpcFeesForDividend `json:"feesForDividend"`
	FeesForMine     []*RpcFeesForMine     `json:"feesForMine"`
	LastValidPeriod uint64                `json:"lastValidPeriod"`
	FinishDividend  bool                  `json:"finishDividend"`
	FinishMine      bool                  `json:"finishMine"`
}

func DexFeesByPeriodToRpc

func DexFeesByPeriodToRpc(dexFeesByPeriod *dex.DexFeesByPeriod) *RpcDexFeesByPeriod

type RpcDexTokenInfo

type RpcDexTokenInfo struct {
	TokenSymbol    string            `json:"tokenSymbol"`
	Decimals       int32             `json:"decimals"`
	TokenId        types.TokenTypeId `json:"tokenId"`
	Index          int32             `json:"index"`
	Owner          types.Address     `json:"owner"`
	QuoteTokenType int32             `json:"quoteTokenType"`
}

func TokenInfoToRpc

func TokenInfoToRpc(tinfo *dex.TokenInfo, tti types.TokenTypeId) *RpcDexTokenInfo

type RpcFeeAccount

type RpcFeeAccount struct {
	QuoteTokenType    int32  `json:"quoteTokenType"`
	BaseAmount        string `json:"baseAmount"`
	InviteBonusAmount string `json:"inviteBonusAmount"`
}

type RpcFeesByPeriod

type RpcFeesByPeriod struct {
	UserFees []*RpcFeeAccount `json:"userFees"`
	Period   uint64           `json:"period"`
}

type RpcFeesForDividend

type RpcFeesForDividend struct {
	Token              string `json:"token"`
	DividendPoolAmount string `json:"dividendPoolAmount"`
}

type RpcFeesForMine

type RpcFeesForMine struct {
	QuoteTokenType    int32  `json:"quoteTokenType"`
	BaseAmount        string `json:"baseAmount"`
	InviteBonusAmount string `json:"inviteBonusAmount"`
}

type RpcMarketInfo

type RpcMarketInfo struct {
	MarketId           int32  `json:"marketId"`
	MarketSymbol       string `json:"marketSymbol"`
	TradeToken         string `json:"tradeToken"`
	QuoteToken         string `json:"quoteToken"`
	QuoteTokenType     int32  `json:"quoteTokenType"`
	TradeTokenDecimals int32  `json:"tradeTokenDecimals,omitempty"`
	QuoteTokenDecimals int32  `json:"quoteTokenDecimals"`
	TakerBrokerFeeRate int32  `json:"takerBrokerFeeRate"`
	MakerBrokerFeeRate int32  `json:"makerBrokerFeeRate"`
	AllowMine          bool   `json:"allowMine"`
	Valid              bool   `json:"valid"`
	Owner              string `json:"owner"`
	Creator            string `json:"creator"`
	Stopped            bool   `json:"stopped"`
	Timestamp          int64  `json:"timestamp"`
}

func MarketInfoToRpc

func MarketInfoToRpc(mkInfo *dex.MarketInfo) *RpcMarketInfo

type RpcMiningStakingByPeriod

type RpcMiningStakingByPeriod struct {
	Period uint64 `json:"period"`
	Amount string `json:"amount"`
}

type RpcMiningStakings

type RpcMiningStakings struct {
	Pledges []*RpcMiningStakingByPeriod `json:"Pledges"`
}

func MiningStakingsToRpc

func MiningStakingsToRpc(miningStakings *dex.MiningStakings) *RpcMiningStakings

type RpcOperatorFeeAccount

type RpcOperatorFeeAccount struct {
	Token      string                  `json:"token"`
	MarketFees []*RpcOperatorMarketFee `json:"marketFees"`
}

type RpcOperatorFeesByPeriod

type RpcOperatorFeesByPeriod struct {
	OperatorFees []*RpcOperatorFeeAccount `json:"operatorFees"`
}

func OperatorFeesByPeriodToRpc

func OperatorFeesByPeriodToRpc(operatorFees *dex.OperatorFeesByPeriod) *RpcOperatorFeesByPeriod

type RpcOperatorMarketFee

type RpcOperatorMarketFee struct {
	MarketId             int32  `json:"marketId"`
	TakerOperatorFeeRate int32  `json:"takerOperatorFeeRate"`
	MakerOperatorFeeRate int32  `json:"makerOperatorFeeRate"`
	Amount               string `json:"amount"`
}

type RpcOrder

type RpcOrder struct {
	Id                   string `json:"Id"`
	Address              string `json:"Address"`
	MarketId             int32  `json:"MarketId"`
	Side                 bool   `json:"Side"`
	Type                 int32  `json:"Type"`
	Price                string `json:"Price"`
	TakerFeeRate         int32  `json:"TakerFeeRate"`
	MakerFeeRate         int32  `json:"MakerFeeRate"`
	TakerOperatorFeeRate int32  `json:"TakerOperatorFeeRate"`
	MakerOperatorFeeRate int32  `json:"MakerOperatorFeeRate"`
	Quantity             string `json:"Quantity"`
	Amount               string `json:"Amount"`
	LockedBuyFee         string `json:"LockedBuyFee,omitempty"`
	Status               int32  `json:"Status"`
	CancelReason         int32  `json:"CancelReason,omitempty"`
	ExecutedQuantity     string `json:"ExecutedQuantity,omitempty"`
	ExecutedAmount       string `json:"ExecutedAmount,omitempty"`
	ExecutedBaseFee      string `json:"ExecutedBaseFee,omitempty"`
	ExecutedOperatorFee  string `json:"ExecutedOperatorFee,omitempty"`
	RefundToken          string `json:"RefundToken,omitempty"`
	RefundQuantity       string `json:"RefundQuantity,omitempty"`
	Timestamp            int64  `json:"Timestamp"`
	Agent                string `json:"Agent,omitempty"`
	SendHash             string `json:"SendHash,omitempty"`
}

func InnerGetOrderById

func InnerGetOrderById(db vm_db.VmDb, orderId []byte) (*RpcOrder, error)

func OrderToRpc

func OrderToRpc(order *dex.Order) *RpcOrder

func OrdersToRpc

func OrdersToRpc(orders []*dex.Order) []*RpcOrder

type RpcThresholdForTradeAndMine

type RpcThresholdForTradeAndMine struct {
	TradeThreshold string `json:"tradeThreshold"`
	MineThreshold  string `json:"mineThreshold"`
}

type RpcUserFees

type RpcUserFees struct {
	Fees []*RpcFeesByPeriod `json:"fees"`
}

func UserFeesToRpc

func UserFeesToRpc(userFees *dex.UserFees) *RpcUserFees

type RpcVxFundByPeriod

type RpcVxFundByPeriod struct {
	Amount string `json:"amount"`
	Period uint64 `json:"period"`
}

type RpcVxFunds

type RpcVxFunds struct {
	Funds []*RpcVxFundByPeriod `json:"funds"`
}

func VxFundsToRpc

func VxFundsToRpc(funds *dex.VxFunds) *RpcVxFunds

type RpcVxMineInfo

type RpcVxMineInfo struct {
	HistoryMinedSum string           `json:"historyMinedSum"`
	Total           string           `json:"total"`
	FeeMineTotal    string           `json:"feeMineTotal"`
	FeeMineDetail   map[int32]string `json:"feeMineDetail"`
	PledgeMine      string           `json:"pledgeMine"`
	MakerMine       string           `json:"makerMine"`
}

type SimpleAccountInfo

type SimpleAccountInfo struct {
	Token     string `json:"token"`
	Available string `json:"available"`
	Locked    string `json:"locked"`
}

type SimpleFund

type SimpleFund struct {
	Address  string               `json:"address"`
	Accounts []*SimpleAccountInfo `json:"accounts"`
}

Jump to

Keyboard shortcuts

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