dex

package
v2.10.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: GPL-3.0 Imports: 8 Imported by: 2

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 CancelStake

type CancelStake struct {
	Amount           string `json:"amount"`
	ExpirationTime   int64  `json:"expirationTime"`
	ExpirationPeriod uint64 `json:"expirationPeriod"`
}

type CancelStakeList

type CancelStakeList struct {
	CancellingAmount string         `json:"cancellingAmount"`
	Count            int            `json:"count"`
	Cancels          []*CancelStake `json:"cancels"`
}

func CancelStakeListToRpc

func CancelStakeListToRpc(cancelStakes *dex.CancelStakes, pageIndex int, pageSize int, chain chain.Chain) *CancelStakeList

type DelegateStakeInfo

type DelegateStakeInfo struct {
	StakeType int    `json:"stakeType"`
	Address   string `json:"address"`
	Principal string `json:"principal"`
	Amount    string `json:"amount"`
	Status    int    `json:"status"`
}

func DelegateStakeInfoToRpc

func DelegateStakeInfoToRpc(info *dex.DelegateStakeInfo) *DelegateStakeInfo

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"`
	StableMarket         bool   `json:"stableMarket"`
}

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 PlaceOrderInfo

type PlaceOrderInfo struct {
	Available      string `json:"available"`      // account available, side == true tradeToken, side == false quoteToken
	MinTradeAmount string `json:"minTradeAmount"` // min trade amount by quoteToken
	FeeRate        int32  `json:"feeRate"`        // max(takerFeeRateSum, makerFeeRateSum)
	Side           bool   `json:"side"`
	IsVIP          bool   `json:"isVIP"`
	IsSVIP         bool   `json:"isSVIP"`
	IsInvited      bool   `json:"isInvited"`
}

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"`
	NotRoll            bool   `json:"notRoll"`
}

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"`
}

type StakeInfo

type StakeInfo struct {
	Amount           string `json:"stakeAmount"`
	Beneficiary      string `json:"beneficiary"`
	ExpirationHeight string `json:"expirationHeight"`
	ExpirationTime   int64  `json:"expirationTime"`
	IsDelegated      bool   `json:"isDelegated"`
	DelegateAddress  string `json:"delegateAddress"`
	StakeAddress     string `json:"stakeAddress"`
	Bid              uint8  `json:"bid"`
	Id               string `json:"id,omitempty"`
	Principal        string `json:"principal,omitempty"`
}

type StakeInfoList

type StakeInfoList struct {
	StakeAmount string       `json:"totalStakeAmount"`
	Count       int          `json:"totalStakeCount"`
	StakeList   []*StakeInfo `json:"stakeList"`
}

type VIPStakingRpc

type VIPStakingRpc struct {
	Amount           string `json:"stakeAmount"`
	ExpirationHeight string `json:"expirationHeight"`
	ExpirationTime   int64  `json:"expirationTime"`
	Id               string `json:"id,omitempty"`
}

type VxUnlock

type VxUnlock struct {
	Amount           string `json:"amount"`
	ExpirationTime   int64  `json:"expirationTime"`
	ExpirationPeriod uint64 `json:"expirationPeriod"`
}

type VxUnlockList

type VxUnlockList struct {
	UnlockingAmount string      `json:"unlockingAmount"`
	Count           int         `json:"count"`
	Unlocks         []*VxUnlock `json:"unlocks"`
}

func UnlockListToRpc

func UnlockListToRpc(unlocks *dex.VxUnlocks, pageIndex int, pageSize int, chain chain.Chain) *VxUnlockList

Jump to

Keyboard shortcuts

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