Documentation ¶
Index ¶
- Constants
- Variables
- func AccumulateAmountFromMap(amountMap map[int32]*big.Int) *big.Int
- func AddBigInt(a []byte, b []byte) []byte
- func AddBrokerFeeDividendEvent(db vm_db.VmDb, address types.Address, ...)
- func AddErrEvent(db vm_db.VmDb, err error)
- func AddFeeDividendEvent(db vm_db.VmDb, address types.Address, feeToken types.TokenTypeId, ...)
- func AddInviteRelationEvent(db vm_db.VmDb, inviter, invitee types.Address, inviteCode uint32)
- func AddMarketEvent(db vm_db.VmDb, marketInfo *MarketInfo)
- func AddMinedVxForInviteeFeeEvent(db vm_db.VmDb, address types.Address, quoteTokenType int32, feeAmount []byte, ...)
- func AddMinedVxForOperationEvent(db vm_db.VmDb, bizType int32, address types.Address, amount *big.Int)
- func AddMinedVxForPledgeEvent(db vm_db.VmDb, address types.Address, pledgeAmt, minedAmt *big.Int)
- func AddMinedVxForTradeFeeEvent(db vm_db.VmDb, address types.Address, quoteTokenType int32, feeAmount []byte, ...)
- func AddPeriodWithBizEvent(db vm_db.VmDb, periodId uint64, bizType uint8)
- func AddSettleMakerMinedVxEvent(db vm_db.VmDb, periodId uint64, page int32, finish bool)
- func AddToPendingNewMarkets(db vm_db.VmDb, tradeToken, quoteToken types.TokenTypeId)
- func AddToPendingSetQuotes(db vm_db.VmDb, token types.TokenTypeId, quoteType uint8)
- func AddToPendingTransferTokenOwners(db vm_db.VmDb, token types.TokenTypeId, origin, new types.Address)
- func AddTokenEvent(db vm_db.VmDb, tokenInfo *TokenInfo)
- func AdjustAmountForDecimalsDiff(amount []byte, decimalsDiff int32) *big.Int
- func AdjustForDecimalsDiff(sourceAmountF *big.Float, decimalsDiff int32) *big.Float
- func BatchSaveUserFund(db vm_db.VmDb, address types.Address, funds map[types.TokenTypeId]*big.Int) error
- func BitwiseNotBytes(bytes []byte)
- func BytesToPrice(priceBytes []byte) string
- func BytesToUint32(bytes []byte) uint32
- func BytesToUint64(bytes []byte) uint64
- func CalculateAmountForRate(amount []byte, rate int32) []byte
- func CalculateFeeAndExecutedFee(order *Order, amount []byte, feeRate, brokerFeeRate int32) (incBaseFee, executedBaseFee, incBrokerFee, executedBrokerFee []byte)
- func CalculateRawAmount(quantity []byte, price []byte, decimalsDiff int32) []byte
- func CalculateRawAmountF(quantity []byte, price []byte, decimalsDiff int32) *big.Float
- func CardinalRateToString(rawRate int32) string
- func CheckAndLockFundForNewOrder(dexFund *UserFund, order *Order, marketInfo *MarketInfo) (err error)
- func CheckMarketParam(marketParam *ParamDexFundNewMarket) (err error)
- func CheckSettleActions(actions *dexproto.SettleActions) error
- func CheckUserPledgesForVxCanBeDelete(pledgesForVx *PledgesForVx) bool
- func CheckUserVxFundsCanBeDelete(vxFunds *VxFunds) bool
- func CmpForBigInt(a []byte, b []byte) int
- func CmpToBigZero(a []byte) int
- func ComposeOrderId(db vm_db.VmDb, marketId int32, side bool, price string) (idBytes []byte)
- func DeComposeOrderId(idBytes []byte) (marketId int32, side bool, price []byte, timestamp int64, err error)
- func DeleteBrokerFeeSumByKey(db vm_db.VmDb, key []byte)
- func DeleteLastSettledMakerMinedVxPage(db vm_db.VmDb)
- func DeleteMakerProxyAmountByPeriodId(db vm_db.VmDb, periodId uint64)
- func DeleteMarketInfo(db vm_db.VmDb, tradeToken, quoteToken types.TokenTypeId)
- func DeletePendingNewMarkets(db vm_db.VmDb)
- func DeletePendingSetQuotes(db vm_db.VmDb)
- func DeletePendingTransferTokenOwners(db vm_db.VmDb)
- func DeletePledgeForVip(db vm_db.VmDb, address types.Address)
- func DeletePledgeForVx(db vm_db.VmDb, address types.Address)
- func DeletePledgesForVx(db vm_db.VmDb, address types.Address)
- func DeleteUserFees(db vm_db.VmDb, address []byte)
- func DeleteVxFunds(db vm_db.VmDb, address []byte)
- func DepositUserAccount(db vm_db.VmDb, address types.Address, token types.TokenTypeId, amount *big.Int) (updatedAcc *dexproto.Account)
- func DivideByProportion(totalReferAmt, partReferAmt, dividedReferAmt, toDivideTotalAmt, ... *big.Int) (proportionAmt *big.Int, finished bool)
- func DoCancelPledge(db vm_db.VmDb, address types.Address, pledgeType uint8, amount *big.Int) ([]*ledger.AccountBlock, error)
- func DoDivideBrokerFees(db vm_db.VmDb, periodId uint64) error
- func DoDivideFees(db vm_db.VmDb, periodId uint64) error
- func DoMineVxForFee(db vm_db.VmDb, reader util.ConsensusReader, periodId uint64, ...) (*big.Int, error)
- func DoMineVxForMakerMineAndMaintainer(db vm_db.VmDb, periodId uint64, reader util.ConsensusReader, ...) error
- func DoMineVxForPledge(db vm_db.VmDb, reader util.ConsensusReader, periodId uint64, ...) (*big.Int, error)
- func DoSettleFund(db vm_db.VmDb, reader util.ConsensusReader, action *dexproto.UserFundSettle, ...) error
- func FilterPendingNewMarkets(db vm_db.VmDb, tradeToken types.TokenTypeId) (quoteTokens [][]byte, err error)
- func FilterPendingSetQuotes(db vm_db.VmDb, token types.TokenTypeId) (action *dexproto.SetQuoteAction, err error)
- func FilterPendingTransferTokenOwners(db vm_db.VmDb, token types.TokenTypeId) (action *dexproto.TransferTokenOwnerAction, err error)
- func GetAbs(v int32) (int32, int32)
- func GetAccountByTokeIdFromFund(dexFund *UserFund, token types.TokenTypeId) (account *dexproto.Account, exists bool)
- func GetBrokerFeeSumKeyByPeriodIdAndAddress(periodId uint64, address []byte) []byte
- func GetCodeByInviter(db vm_db.VmDb, address types.Address) uint32
- func GetCurrentBrokerFeeSumKey(db vm_db.VmDb, reader util.ConsensusReader, broker []byte) []byte
- func GetCurrentPeriodId(db vm_db.VmDb, reader util.ConsensusReader) uint64
- func GetFeeSumCurrentKey(db vm_db.VmDb, reader util.ConsensusReader) []byte
- func GetFeeSumKeyByPeriodId(periodId uint64) []byte
- func GetFeeSumLastPeriodIdForRoll(db vm_db.VmDb) uint64
- func GetFirstMinedVxPeriodId(db vm_db.VmDb) uint64
- func GetInviterByCode(db vm_db.VmDb, inviteCode uint32) (*types.Address, error)
- func GetInviterByInvitee(db vm_db.VmDb, invitee types.Address) (*types.Address, error)
- func GetLastJobPeriodIdByBizType(db vm_db.VmDb, bizType uint8) uint64
- func GetLastJobPeriodIdKey(bizType uint8) []byte
- func GetLastSettledMakerMinedVxPage(db vm_db.VmDb) int32
- func GetLastSettledMakerMinedVxPeriod(db vm_db.VmDb) uint64
- func GetMaintainer(db vm_db.VmDb) *types.Address
- func GetMakerMineProxy(db vm_db.VmDb) *types.Address
- func GetMakerProxyAmountByPeriodId(db vm_db.VmDb, periodId uint64) *big.Int
- func GetMarkerProxyAmountByPeriodIdKey(periodId uint64) []byte
- func GetMarketInfoKey(tradeToken, quoteToken types.TokenTypeId) []byte
- func GetMarketInfoKeyById(marketId int32) []byte
- func GetMineThreshold(db vm_db.VmDb, quoteTokenType int32) *big.Int
- func GetMineThresholdKey(quoteTokenType uint8) []byte
- func GetNotDividedFeeSumsByPeriodId(db vm_db.VmDb, periodId uint64) map[uint64]*FeeSumByPeriod
- func GetOwner(db vm_db.VmDb) (*types.Address, error)
- func GetPeriodIdByTimestamp(reader util.ConsensusReader, timestamp int64) uint64
- func GetPledgeForVipKey(address types.Address) []byte
- func GetPledgeForVx(db vm_db.VmDb, address types.Address) *big.Int
- func GetPledgeForVxKey(address types.Address) []byte
- func GetPledgesForVxKey(address types.Address) []byte
- func GetTimer(db vm_db.VmDb) *types.Address
- func GetTimerTimestamp(db vm_db.VmDb) int64
- func GetTimestampInt64(db vm_db.VmDb) int64
- func GetTokenInfoKey(token types.TokenTypeId) []byte
- func GetTradeThreshold(db vm_db.VmDb, quoteTokenType int32) *big.Int
- func GetTradeThresholdKey(quoteTokenType uint8) []byte
- func GetTradeTimestamp(db vm_db.VmDb) int64
- func GetTrigger(db vm_db.VmDb) *types.Address
- func GetUserFeesKey(address []byte) []byte
- func GetUserFundKey(address types.Address) []byte
- func GetVxAmountToMine(db vm_db.VmDb, periodId uint64, vxPool *big.Int, rate string) (amount, vxAmtLeaved *big.Int, success bool)
- func GetVxAmountsForEqualItems(db vm_db.VmDb, periodId uint64, vxPool *big.Int, rateSum string, ...) (amountForItems map[int32]*big.Int, vxAmtLeaved *big.Int, success bool)
- func GetVxFundsKey(address []byte) []byte
- func GetVxMinePool(db vm_db.VmDb) *big.Int
- func GetVxToMineByPeriodId(db vm_db.VmDb, periodId uint64) *big.Int
- func HandlePledgeAction(db vm_db.VmDb, pledgeType uint8, actionType uint8, address types.Address, ...) ([]*ledger.AccountBlock, error)
- func IsDust(order *Order, quantity []byte, decimalsDiff int32) bool
- func IsMakerMineProxy(db vm_db.VmDb, addr types.Address) bool
- func IsOperationValidWithMask(operationCode, mask uint8) bool
- func IsOwner(db vm_db.VmDb, address types.Address) bool
- func IsValidFeeForMine(userFee *dexproto.UserFeeAccount, mineThreshold *big.Int) bool
- func IsValidPledgeAmountBytesForVx(amount []byte) bool
- func IsValidPledgeAmountForVx(amount *big.Int) bool
- func IsValidVxAmountBytesForDividend(amount []byte) bool
- func IsValidVxAmountForDividend(amount *big.Int) bool
- func IsViteXStopped(db vm_db.VmDb) bool
- func MarkFeeSumAsFeeDivided(db vm_db.VmDb, feeSum *FeeSumByPeriod, periodId uint64)
- func MarkFeeSumAsMinedVxDivided(db vm_db.VmDb, feeSum *FeeSumByPeriod, periodId uint64)
- func MatchPledgeForVxByPeriod(pledgesForVx *PledgesForVx, periodId uint64, checkDelete bool) (bool, []byte, bool, bool)
- func MatchVxFundsByPeriod(vxFunds *VxFunds, periodId uint64, checkDelete bool) (bool, []byte, bool, bool)
- func MaxTotalFeeRate(order Order) int32
- func MinBigInt(a []byte, b []byte) []byte
- func NegativeAmount(amount []byte) *big.Int
- func NewAndSaveMarketId(db vm_db.VmDb) (newId int32)
- func NewAndSaveOrderSerialNo(db vm_db.VmDb, timestamp int64) (newSerialNo int32)
- func NewInviteCode(db vm_db.VmDb, hash types.Hash) uint32
- func NormalizeToQuoteTokenTypeAmount(amount []byte, tokenDecimals, quoteTokenType int32) []byte
- func OnCancelPledgeForVxSuccess(db vm_db.VmDb, reader util.ConsensusReader, address types.Address, ...)
- func OnDepositVx(db vm_db.VmDb, reader util.ConsensusReader, address types.Address, ...)
- func OnNewMarketGetTokenInfoFailed(db vm_db.VmDb, tradeTokenId types.TokenTypeId) (err error)
- func OnNewMarketGetTokenInfoSuccess(db vm_db.VmDb, reader util.ConsensusReader, tradeTokenId types.TokenTypeId, ...) (appendBlocks []*ledger.AccountBlock, err error)
- func OnNewMarketPending(db vm_db.VmDb, param *ParamDexFundNewMarket, marketInfo *MarketInfo) []byte
- func OnNewMarketValid(db vm_db.VmDb, reader util.ConsensusReader, marketInfo *MarketInfo, ...) (block []*ledger.AccountBlock, err error)
- func OnPledgeForVxSuccess(db vm_db.VmDb, reader util.ConsensusReader, address types.Address, ...)
- func OnSetQuoteGetTokenInfoFailed(db vm_db.VmDb, tokenId types.TokenTypeId) (err error)
- func OnSetQuoteGetTokenInfoSuccess(db vm_db.VmDb, tokenInfoRes *ParamDexFundGetTokenInfoCallback) error
- func OnSetQuoteTokenPending(db vm_db.VmDb, token types.TokenTypeId, quoteTokenType uint8) []byte
- func OnSettleVx(db vm_db.VmDb, reader util.ConsensusReader, address []byte, ...)
- func OnTransferOwnerGetTokenInfoFailed(db vm_db.VmDb, tradeTokenId types.TokenTypeId) (err error)
- func OnTransferOwnerGetTokenInfoSuccess(db vm_db.VmDb, tokenInfoRes *ParamDexFundGetTokenInfoCallback) error
- func OnTransferTokenOwnerPending(db vm_db.VmDb, token types.TokenTypeId, origin, new types.Address) []byte
- func OnWithdrawVx(db vm_db.VmDb, reader util.ConsensusReader, address types.Address, ...)
- func PreCheckOrderParam(orderParam *ParamDexFundNewOrder) error
- func PriceToBytes(price string) []byte
- func RenderFeeRate(address types.Address, order *Order, marketInfo *MarketInfo, db vm_db.VmDb)
- func RenderMarketInfo(db vm_db.VmDb, marketInfo *MarketInfo, ...) error
- func RoundAmount(amountF *big.Float) *big.Int
- func SaveCodeByInviter(db vm_db.VmDb, address types.Address, inviteCode uint32)
- func SaveCurrentBrokerFeeSum(db vm_db.VmDb, reader util.ConsensusReader, broker []byte, ...)
- func SaveCurrentFeeSum(db vm_db.VmDb, reader util.ConsensusReader, feeSum *FeeSumByPeriod)
- func SaveFeeSumLastPeriodIdForRoll(db vm_db.VmDb, periodId uint64)
- func SaveFeeSumWithPeriodId(db vm_db.VmDb, feeSum *FeeSumByPeriod, periodId uint64)
- func SaveFirstMinedVxPeriodId(db vm_db.VmDb, periodId uint64)
- func SaveInviterByCode(db vm_db.VmDb, address types.Address, inviteCode uint32)
- func SaveInviterByInvitee(db vm_db.VmDb, invitee, inviter types.Address)
- func SaveLastJobPeriodIdByBizType(db vm_db.VmDb, periodId uint64, bizType uint8)
- func SaveLastSettledMakerMinedVxPage(db vm_db.VmDb, pageId int32)
- func SaveLastSettledMakerMinedVxPeriod(db vm_db.VmDb, periodId uint64)
- func SaveMaintainer(db vm_db.VmDb, addr types.Address)
- func SaveMakerMineProxy(db vm_db.VmDb, addr types.Address)
- func SaveMakerProxyAmountByPeriodId(db vm_db.VmDb, periodId uint64, amount *big.Int)
- func SaveMarketInfo(db vm_db.VmDb, marketInfo *MarketInfo, ...)
- func SaveMarketInfoById(db vm_db.VmDb, marketInfo *MarketInfo)
- func SaveMineThreshold(db vm_db.VmDb, quoteTokenType uint8, amount *big.Int)
- func SavePendingNewMarkets(db vm_db.VmDb, pendingNewMarkets *PendingNewMarkets)
- func SavePendingSetQuotes(db vm_db.VmDb, pendingSetQuotes *PendingSetQuotes)
- func SavePendingTransferTokenOwners(db vm_db.VmDb, pendings *PendingTransferTokenOwners)
- func SavePledgeForVip(db vm_db.VmDb, address types.Address, pledgeVip *PledgeVip)
- func SavePledgeForVx(db vm_db.VmDb, address types.Address, amount *big.Int)
- func SavePledgesForVx(db vm_db.VmDb, address types.Address, ps *PledgesForVx)
- func SavePledgesForVxSum(db vm_db.VmDb, ps *PledgesForVx)
- func SaveTokenInfo(db vm_db.VmDb, token types.TokenTypeId, tokenInfo *TokenInfo)
- func SaveTradeThreshold(db vm_db.VmDb, quoteTokenType uint8, amount *big.Int)
- func SaveUserFees(db vm_db.VmDb, address []byte, userFees *UserFees)
- func SaveUserFund(db vm_db.VmDb, address types.Address, dexFund *UserFund)
- func SaveViteXStopped(db vm_db.VmDb, isStopViteX bool)
- func SaveVxFunds(db vm_db.VmDb, address []byte, vxFunds *VxFunds)
- func SaveVxMinePool(db vm_db.VmDb, amount *big.Int)
- func SaveVxSumFunds(db vm_db.VmDb, vxSumFunds *VxFunds)
- func SetFeeRate(baseRate int32)
- func SetOwner(db vm_db.VmDb, address types.Address)
- func SetTimerAddress(db vm_db.VmDb, address types.Address)
- func SetTimerTimestamp(db vm_db.VmDb, timestamp int64, reader util.ConsensusReader) error
- func SetTradeTimestamp(db vm_db.VmDb, timestamp int64)
- func SetTriggerAddress(db vm_db.VmDb, address types.Address)
- func SettleBrokerFeeSum(db vm_db.VmDb, reader util.ConsensusReader, ...)
- func SettleFees(db vm_db.VmDb, reader util.ConsensusReader, allowMine bool, feeToken []byte, ...)
- func SettleFeesWithTokenId(db vm_db.VmDb, reader util.ConsensusReader, allowMine bool, ...)
- func SubBigInt(a []byte, b []byte) *big.Int
- func SubBigIntAbs(a []byte, b []byte) []byte
- func SubUserFund(db vm_db.VmDb, address types.Address, tokenId []byte, amount *big.Int) (updatedAcc *dexproto.Account, err error)
- func TruncateUserFeesToPeriod(userFees *UserFees, periodId uint64) (truncated bool)
- func TryUpdateTimestamp(db vm_db.VmDb, timestamp int64, preHash types.Hash)
- func Uint32ToBytes(value uint32) []byte
- func Uint64ToBytes(value uint64) []byte
- func ValidBrokerFeeRate(feeRate int32) bool
- func ValidPrice(price string) bool
- func ValidTimerAddress(db vm_db.VmDb, address types.Address) bool
- func ValidTriggerAddress(db vm_db.VmDb, address types.Address) bool
- type Account
- type AmountWithToken
- type AmountWithTokenSorter
- type BrokerFeeDividendEvent
- type BrokerFeeSumByPeriod
- type DexEvent
- type ErrEvent
- type FeeDividendEvent
- type FeeSumByPeriod
- type FundSettleSorter
- type FundVerifyItem
- type FundVerifyRes
- type InviteRelationEvent
- type MarketEvent
- type MarketInfo
- func CleanExpireOrders(db vm_db.VmDb, orderIds []byte) (map[types.Address]map[bool]*dexproto.FundSettle, *MarketInfo, error)
- func GetMarketInfo(db vm_db.VmDb, tradeToken, quoteToken types.TokenTypeId) (marketInfo *MarketInfo, ok bool)
- func GetMarketInfoById(db vm_db.VmDb, marketId int32) (marketInfo *MarketInfo, ok bool)
- func GetMarketInfoByTokens(db vm_db.VmDb, tradeTokenData, quoteTokenData []byte) (marketInfo *MarketInfo, ok bool)
- func RenderOrder(order *Order, param *ParamDexFundNewOrder, db vm_db.VmDb, ...) (*MarketInfo, error)
- type Matcher
- func (mc *Matcher) CancelOrderById(order *Order)
- func (mc *Matcher) GetFees() map[types.Address]*proto.UserFeeSettle
- func (mc *Matcher) GetFundSettles() map[types.Address]map[bool]*proto.FundSettle
- func (mc *Matcher) GetOrderById(orderId []byte) (*Order, error)
- func (mc *Matcher) GetOrdersFromMarket(side bool, begin, end int) ([]*Order, int, error)
- func (mc *Matcher) MatchOrder(taker *Order, preHash types.Hash) (err error)
- type MinedVxForInviteeFeeEvent
- type MinedVxForOperationEvent
- type MinedVxForPledgeEvent
- type MinedVxForTradeFeeEvent
- type NewOrderEvent
- type Order
- type OrderIdSerialNo
- type OrderTx
- type OrderUpdateEvent
- type ParamDexCancelOrder
- type ParamDexFundCancelPledge
- type ParamDexFundGetTokenInfoCallback
- type ParamDexFundMarketOwnerConfig
- type ParamDexFundNewMarket
- type ParamDexFundNewOrder
- type ParamDexFundNotifyTime
- type ParamDexFundOwnerConfig
- type ParamDexFundOwnerConfigTrade
- type ParamDexFundPledge
- type ParamDexFundPledgeCallBack
- type ParamDexFundPledgeForVip
- type ParamDexFundPledgeForVx
- type ParamDexFundTransferTokenOwner
- type ParamDexFundWithDraw
- type ParamDexPeriodJob
- type ParamDexSerializedData
- type PendingNewMarkets
- type PendingSetQuotes
- type PendingTransferTokenOwners
- type PeriodWithBizEvent
- type PledgeVip
- type PledgesForVx
- type QuoteTokenTypeInfo
- type SerializableDex
- type SettleMakerMinedVxEvent
- type TokenEvent
- type TokenInfo
- type TransactionEvent
- type UserFeeSettleSorter
- type UserFees
- type UserFund
- type UserFundSettleSorter
- type VxFunds
Constants ¶
View Source
const ( PledgeForVx = iota + 1 PledgeForVip )
View Source
const ( Pledge = iota + 1 CancelPledge )
View Source
const ( OwnerConfigOwner = 1 OwnerConfigTimer = 2 OwnerConfigTrigger = 4 OwnerConfigStopViteX = 8 OwnerConfigMakerMineProxy = 16 OwnerConfigMaintainer = 32 )
MethodNameDexFundOwnerConfig
View Source
const ( OwnerConfigMineMarket = 1 OwnerConfigNewQuoteToken = 2 OwnerConfigTradeThreshold = 4 OwnerConfigMineThreshold = 8 )
MethodNameDexFundOwnerConfigTrade
View Source
const ( MarketOwnerTransferOwner = 1 MarketOwnerConfigTakerRate = 2 MarketOwnerConfigMakerRate = 4 MarketOwnerStopMarket = 8 )
View Source
const ( ViteTokenType = iota + 1 EthTokenType BtcTokenType UsdTokenType )
View Source
const ( MineForMaker = iota + 1 MineForMaintainer )
View Source
const ( FeeDividendJob = iota + 1 BrokerFeeDividendJob MineVxForFeeJob MineVxForPledgeJob MineVxForMakerAndMaintainerJob )
View Source
const ( GetTokenForNewMarket = iota + 1 GetTokenForSetQuote GetTokenForTransferOwner )
View Source
const ( Pending = iota PartialExecuted FullyExecuted Cancelled NewFailed )
View Source
const ( Limited = iota Market )
View Source
const CleanExpireOrdersMaxCount = 200
View Source
const OrderIdBytesLength = 22
View Source
const PriceBytesLength = 10
Variables ¶
View Source
var ( InvalidInputParamErr = errors.New("invalid input param") InvalidOrderIdErr = errors.New("invalid order id") InvalidOrderTypeErr = errors.New("invalid order type") InvalidOrderPriceErr = errors.New("invalid order price format") InvalidOrderQuantityErr = errors.New("invalid order quantity") OrderNotExistsErr = errors.New("order not exists") OrderAmountTooSmallErr = errors.New("order amount too small") ViteXStoppedErr = errors.New("viteX stopped") TradeMarketExistsErr = errors.New("trade market already exists") TradeMarketNotExistsErr = errors.New("trade market not exists") TradeMarketStoppedErr = errors.New("trade market stopped") ComposeOrderIdFailErr = errors.New("compose order id fail") DeComposeOrderIdFailErr = errors.New("decompose order id fail") TradeMarketInvalidQuoteTokenErr = errors.New("invalid quote token") TradeMarketInvalidTokenPairErr = errors.New("invalid token pair") TradeMarketAllowMineErr = errors.New("token pair already allow mine") TradeMarketNotAllowMineErr = errors.New("token pair already not allow mine") CancelOrderOwnerInvalidErr = errors.New("order to cancel not own to initiator") CancelOrderInvalidStatusErr = errors.New("order status is invalid to cancel") OnlyOwnerAllowErr = errors.New("only owner allow") ExceedFundAvailableErr = errors.New("exceed fund available") ExceedFundLockedErr = errors.New("try release locked amount exceed locked") InvalidPledgeAmountErr = errors.New("invalid pledge amount") InvalidPledgeActionTypeErr = errors.New("invalid pledge action type") ExceedPledgeAvailableErr = errors.New("exceed pledge available") PledgeAmountLeavedNotValidErr = errors.New("pledge amount leaved not valid") PledgeForVipExistsErr = errors.New("pledge for vip exists") PledgeForVipNotExistsErr = errors.New("pledge for vip not exists") InvalidSourceAddressErr = errors.New("invalid source address") InvalidAmountForPledgeCallbackErr = errors.New("invalid amouznt for pledge callback") InvalidTokenErr = errors.New("invalid token") PendingNewMarketInnerConflictErr = errors.New("pending new market inner conflict") GetTokenInfoCallbackInnerConflictErr = errors.New("get token info callback inner conflict") InvalidTimestampFromTimerErr = errors.New("invalid timestamp from timer") InvalidBrokerFeeRateErr = errors.New("invalid broker fee rate") NoFeeSumFoundForValidPeriodErr = errors.New("no fee sum found for valid period") NotSetTimestampErr = errors.New("not set timestamp") IterateVmDbFailedErr = errors.New("iterate vm db failed") NotSetMaintainerErr = errors.New("not set maintainer") NotSetMineProxyErr = errors.New("not set mine proxy") InvalidInviterFeeAmountErr = errors.New("invalid inviter fee amount") AlreadyIsInviterErr = errors.New("already is inviter") InvalidInviteCodeErr = errors.New("invalid invite code") NotBindInviterErr = errors.New("not bind invite code") AlreadyBindInviterErr = errors.New("already bind inviter") NewInviteCodeFailErr = errors.New("new invite code fail") AlreadyQuoteType = errors.New("already quote type") InvalidQuoteTokenTypeErr = errors.New("invalid quote token type") FundOwnerNotConfigErr = errors.New("fund owner not config") MultiMarketsInOneActionErr = errors.New("multi markets one action") InternalErr = errors.New("internal error") )
View Source
var ( VxFundKeyPrefix = []byte("vxF:") // vxFund:types.Address VxTokenId, _ = types.HexToTokenTypeId("tti_564954455820434f494e69b5") VxMinedAmtFirstPeriod = new(big.Int).Mul(new(big.Int).Exp(helper.Big10, new(big.Int).SetUint64(uint64(13)), nil), big.NewInt(47703236213)) // 477032.36213 VxDividendThreshold = new(big.Int).Mul(commonTokenPow, big.NewInt(10)) NewMarketFeeAmount = new(big.Int).Mul(commonTokenPow, big.NewInt(10000)) NewMarketFeeMineAmount = new(big.Int).Mul(commonTokenPow, big.NewInt(1000)) NewMarketFeeDonateAmount = new(big.Int).Mul(commonTokenPow, big.NewInt(4000)) NewMarketFeeBurnAmount = new(big.Int).Mul(commonTokenPow, big.NewInt(5000)) NewInviterFeeAmount = new(big.Int).Mul(commonTokenPow, big.NewInt(1000)) PledgeForVxMinAmount = new(big.Int).Mul(commonTokenPow, big.NewInt(134)) PledgeForVipAmount = new(big.Int).Mul(commonTokenPow, big.NewInt(10000)) PledgeForVxThreshold = new(big.Int).Mul(commonTokenPow, big.NewInt(134)) RateSumForFeeMine = "0.6" // 15% * 4 RateForPledgeMine = "0.2" // 20% RateSumForMakerAndMaintainerMine = "0.2" // 10% + 10% ViteTokenDecimals int32 = 18 QuoteTokenTypeInfos = map[int32]*QuoteTokenTypeInfo{ ViteTokenType: &QuoteTokenTypeInfo{Decimals: 18, DefaultTradeThreshold: viteMinAmount, DefaultMineThreshold: viteMineThreshold}, EthTokenType: &QuoteTokenTypeInfo{Decimals: 18, DefaultTradeThreshold: ethMinAmount, DefaultMineThreshold: ethMineThreshold}, BtcTokenType: &QuoteTokenTypeInfo{Decimals: 8, DefaultTradeThreshold: bitcoinMinAmount, DefaultMineThreshold: bitcoinMineThreshold}, UsdTokenType: &QuoteTokenTypeInfo{Decimals: 6, DefaultTradeThreshold: usdMinAmount, DefaultMineThreshold: usdMineThreshold}, } )
Functions ¶
func AddBrokerFeeDividendEvent ¶
func AddFeeDividendEvent ¶
func AddInviteRelationEvent ¶
func AddMarketEvent ¶
func AddMarketEvent(db vm_db.VmDb, marketInfo *MarketInfo)
func AddMinedVxForInviteeFeeEvent ¶
func AddMinedVxForOperationEvent ¶
func AddMinedVxForPledgeEvent ¶
func AddMinedVxForTradeFeeEvent ¶
func AddPeriodWithBizEvent ¶
func AddSettleMakerMinedVxEvent ¶
func AddToPendingNewMarkets ¶
func AddToPendingNewMarkets(db vm_db.VmDb, tradeToken, quoteToken types.TokenTypeId)
func AddToPendingSetQuotes ¶
func AddToPendingSetQuotes(db vm_db.VmDb, token types.TokenTypeId, quoteType uint8)
func AddToPendingTransferTokenOwners ¶
func AdjustAmountForDecimalsDiff ¶
func AdjustForDecimalsDiff ¶
func BatchSaveUserFund ¶
func CalculateFeeAndExecutedFee ¶
func CalculateRawAmount ¶
func CalculateRawAmountF ¶
func CheckAndLockFundForNewOrder ¶
func CheckAndLockFundForNewOrder(dexFund *UserFund, order *Order, marketInfo *MarketInfo) (err error)
func CheckMarketParam ¶
func CheckMarketParam(marketParam *ParamDexFundNewMarket) (err error)
func CheckSettleActions ¶
func CheckSettleActions(actions *dexproto.SettleActions) error
func CheckUserPledgesForVxCanBeDelete ¶
func CheckUserPledgesForVxCanBeDelete(pledgesForVx *PledgesForVx) bool
func ComposeOrderId ¶
MarketId[0..2]Side[3]Price[4..13]timestamp[14..18]serialNo[19..21] = 22
func DeComposeOrderId ¶
func DeleteMakerProxyAmountByPeriodId ¶
func DeleteMarketInfo ¶
func DeleteMarketInfo(db vm_db.VmDb, tradeToken, quoteToken types.TokenTypeId)
func DepositUserAccount ¶
func DivideByProportion ¶
func DoCancelPledge ¶
func DoDivideFees ¶
Note: allow dividend from specify periodId, former periods will be divided at that period
func DoMineVxForFee ¶
func DoMineVxForFee(db vm_db.VmDb, reader util.ConsensusReader, periodId uint64, amtForMarkets map[int32]*big.Int) (*big.Int, error)
Note: allow mine from specify periodId, former periods will be ignore
func DoMineVxForMakerMineAndMaintainer ¶
func DoMineVxForPledge ¶
func DoSettleFund ¶
func DoSettleFund(db vm_db.VmDb, reader util.ConsensusReader, action *dexproto.UserFundSettle, marketInfo *MarketInfo) error
func FilterPendingNewMarkets ¶
func FilterPendingNewMarkets(db vm_db.VmDb, tradeToken types.TokenTypeId) (quoteTokens [][]byte, err error)
handle case on duplicate callback for getTokenInfo
func FilterPendingSetQuotes ¶
func FilterPendingSetQuotes(db vm_db.VmDb, token types.TokenTypeId) (action *dexproto.SetQuoteAction, err error)
handle case on duplicate callback for getTokenInfo
func FilterPendingTransferTokenOwners ¶
func FilterPendingTransferTokenOwners(db vm_db.VmDb, token types.TokenTypeId) (action *dexproto.TransferTokenOwnerAction, err error)
handle case on duplicate callback for getTokenInfo
func GetAccountByTokeIdFromFund ¶
func GetBrokerFeeSumKeyByPeriodIdAndAddress ¶
func GetCurrentBrokerFeeSumKey ¶
func GetCurrentPeriodId ¶
func GetCurrentPeriodId(db vm_db.VmDb, reader util.ConsensusReader) uint64
func GetFeeSumCurrentKey ¶
func GetFeeSumCurrentKey(db vm_db.VmDb, reader util.ConsensusReader) []byte
func GetInviterByCode ¶
func GetInviterByInvitee ¶
func GetLastJobPeriodIdByBizType ¶
func GetMakerProxyAmountByPeriodId ¶
func GetMarkerProxyAmountByPeriodIdKey ¶
func GetMarketInfoKey ¶
func GetMarketInfoKey(tradeToken, quoteToken types.TokenTypeId) []byte
func GetNotDividedFeeSumsByPeriodId ¶
func GetNotDividedFeeSumsByPeriodId(db vm_db.VmDb, periodId uint64) map[uint64]*FeeSumByPeriod
get all feeSums that not divided yet
func GetPeriodIdByTimestamp ¶
func GetPeriodIdByTimestamp(reader util.ConsensusReader, timestamp int64) uint64
func GetTokenInfoKey ¶
func GetTokenInfoKey(token types.TokenTypeId) []byte
func GetVxAmountToMine ¶
func GetVxAmountsForEqualItems ¶
func HandlePledgeAction ¶
func IsDust ¶
leave quantity is too small for calculate precision
func IsValidFeeForMine ¶
func IsValidFeeForMine(userFee *dexproto.UserFeeAccount, mineThreshold *big.Int) bool
func MarkFeeSumAsFeeDivided ¶
func MarkFeeSumAsFeeDivided(db vm_db.VmDb, feeSum *FeeSumByPeriod, periodId uint64)
fee sum used both by fee dividend and mined vx dividend
func MarkFeeSumAsMinedVxDivided ¶
func MarkFeeSumAsMinedVxDivided(db vm_db.VmDb, feeSum *FeeSumByPeriod, periodId uint64)
func MatchPledgeForVxByPeriod ¶
func MatchVxFundsByPeriod ¶
func NewAndSaveOrderSerialNo ¶
func NormalizeToQuoteTokenTypeAmount ¶
func OnCancelPledgeForVxSuccess ¶
func OnDepositVx ¶
func OnNewMarketGetTokenInfoFailed ¶
func OnNewMarketGetTokenInfoFailed(db vm_db.VmDb, tradeTokenId types.TokenTypeId) (err error)
func OnNewMarketGetTokenInfoSuccess ¶
func OnNewMarketGetTokenInfoSuccess(db vm_db.VmDb, reader util.ConsensusReader, tradeTokenId types.TokenTypeId, tokenInfoRes *ParamDexFundGetTokenInfoCallback) (appendBlocks []*ledger.AccountBlock, err error)
func OnNewMarketPending ¶
func OnNewMarketPending(db vm_db.VmDb, param *ParamDexFundNewMarket, marketInfo *MarketInfo) []byte
func OnNewMarketValid ¶
func OnNewMarketValid(db vm_db.VmDb, reader util.ConsensusReader, marketInfo *MarketInfo, tradeToken, quoteToken types.TokenTypeId, address *types.Address) (block []*ledger.AccountBlock, err error)
func OnPledgeForVxSuccess ¶
func OnSetQuoteGetTokenInfoFailed ¶
func OnSetQuoteGetTokenInfoFailed(db vm_db.VmDb, tokenId types.TokenTypeId) (err error)
func OnSetQuoteGetTokenInfoSuccess ¶
func OnSetQuoteGetTokenInfoSuccess(db vm_db.VmDb, tokenInfoRes *ParamDexFundGetTokenInfoCallback) error
func OnSetQuoteTokenPending ¶
func OnSettleVx ¶
func OnSettleVx(db vm_db.VmDb, reader util.ConsensusReader, address []byte, fundSettle *dexproto.FundSettle, updatedVxAccount *dexproto.Account)
func OnTransferOwnerGetTokenInfoFailed ¶
func OnTransferOwnerGetTokenInfoFailed(db vm_db.VmDb, tradeTokenId types.TokenTypeId) (err error)
func OnTransferOwnerGetTokenInfoSuccess ¶
func OnTransferOwnerGetTokenInfoSuccess(db vm_db.VmDb, tokenInfoRes *ParamDexFundGetTokenInfoCallback) error
func OnTransferTokenOwnerPending ¶
func OnWithdrawVx ¶
func PreCheckOrderParam ¶
func PreCheckOrderParam(orderParam *ParamDexFundNewOrder) error
func RenderFeeRate ¶
func RenderMarketInfo ¶
func RenderMarketInfo(db vm_db.VmDb, marketInfo *MarketInfo, tradeToken, quoteToken types.TokenTypeId, tradeTokenInfo *TokenInfo, creator *types.Address) error
func SaveCodeByInviter ¶
func SaveCurrentBrokerFeeSum ¶
func SaveCurrentBrokerFeeSum(db vm_db.VmDb, reader util.ConsensusReader, broker []byte, brokerFeeSum *BrokerFeeSumByPeriod)
func SaveCurrentFeeSum ¶
func SaveCurrentFeeSum(db vm_db.VmDb, reader util.ConsensusReader, feeSum *FeeSumByPeriod)
func SaveFeeSumLastPeriodIdForRoll ¶
func SaveFeeSumWithPeriodId ¶
func SaveFeeSumWithPeriodId(db vm_db.VmDb, feeSum *FeeSumByPeriod, periodId uint64)
func SaveInviterByCode ¶
func SaveInviterByInvitee ¶
func SaveLastJobPeriodIdByBizType ¶
func SaveLastSettledMakerMinedVxPage ¶
func SaveLastSettledMakerMinedVxPeriod ¶
func SaveMakerProxyAmountByPeriodId ¶
func SaveMarketInfo ¶
func SaveMarketInfo(db vm_db.VmDb, marketInfo *MarketInfo, tradeToken, quoteToken types.TokenTypeId)
func SaveMarketInfoById ¶
func SaveMarketInfoById(db vm_db.VmDb, marketInfo *MarketInfo)
func SaveMineThreshold ¶
func SavePendingNewMarkets ¶
func SavePendingNewMarkets(db vm_db.VmDb, pendingNewMarkets *PendingNewMarkets)
func SavePendingSetQuotes ¶
func SavePendingSetQuotes(db vm_db.VmDb, pendingSetQuotes *PendingSetQuotes)
func SavePendingTransferTokenOwners ¶
func SavePendingTransferTokenOwners(db vm_db.VmDb, pendings *PendingTransferTokenOwners)
func SavePledgeForVip ¶
func SavePledgesForVx ¶
func SavePledgesForVx(db vm_db.VmDb, address types.Address, ps *PledgesForVx)
func SavePledgesForVxSum ¶
func SavePledgesForVxSum(db vm_db.VmDb, ps *PledgesForVx)
func SaveTokenInfo ¶
func SaveTokenInfo(db vm_db.VmDb, token types.TokenTypeId, tokenInfo *TokenInfo)
func SaveTradeThreshold ¶
func SetTimerTimestamp ¶
func SettleBrokerFeeSum ¶
func SettleBrokerFeeSum(db vm_db.VmDb, reader util.ConsensusReader, feeActions []*dexproto.UserFeeSettle, marketInfo *MarketInfo)
func SettleFees ¶
func SettleFeesWithTokenId ¶
func SubUserFund ¶
func TruncateUserFeesToPeriod ¶
func TryUpdateTimestamp ¶
Types ¶
type Account ¶
type AmountWithToken ¶
type AmountWithToken struct { Token types.TokenTypeId Amount *big.Int Deleted bool }
func MapToAmountWithTokens ¶
func MapToAmountWithTokens(mp map[types.TokenTypeId]*big.Int) []*AmountWithToken
type AmountWithTokenSorter ¶
type AmountWithTokenSorter []*AmountWithToken
func (AmountWithTokenSorter) Len ¶
func (st AmountWithTokenSorter) Len() int
func (AmountWithTokenSorter) Less ¶
func (st AmountWithTokenSorter) Less(i, j int) bool
func (AmountWithTokenSorter) Swap ¶
func (st AmountWithTokenSorter) Swap(i, j int)
type BrokerFeeDividendEvent ¶
type BrokerFeeDividendEvent struct {
dexproto.BrokerFeeDividend
}
func (BrokerFeeDividendEvent) FromBytes ¶
func (bfd BrokerFeeDividendEvent) FromBytes(data []byte) interface{}
func (BrokerFeeDividendEvent) GetTopicId ¶
func (bfd BrokerFeeDividendEvent) GetTopicId() types.Hash
type BrokerFeeSumByPeriod ¶
type BrokerFeeSumByPeriod struct {
dexproto.BrokerFeeSumByPeriod
}
func GetBrokerFeeSumByPeriodId ¶
func GetCurrentBrokerFeeSum ¶
func GetCurrentBrokerFeeSum(db vm_db.VmDb, reader util.ConsensusReader, broker []byte) (*BrokerFeeSumByPeriod, bool)
func (*BrokerFeeSumByPeriod) DeSerialize ¶
func (bfs *BrokerFeeSumByPeriod) DeSerialize(data []byte) (err error)
func (*BrokerFeeSumByPeriod) Serialize ¶
func (bfs *BrokerFeeSumByPeriod) Serialize() (data []byte, err error)
type DexEvent ¶
type ErrEvent ¶
type ErrEvent struct {
// contains filtered or unexported fields
}
type FeeDividendEvent ¶
type FeeDividendEvent struct {
dexproto.FeeDividendForVxHolder
}
func (FeeDividendEvent) FromBytes ¶
func (fde FeeDividendEvent) FromBytes(data []byte) interface{}
func (FeeDividendEvent) GetTopicId ¶
func (fde FeeDividendEvent) GetTopicId() types.Hash
type FeeSumByPeriod ¶
type FeeSumByPeriod struct {
dexproto.FeeSumByPeriod
}
func GetCurrentFeeSum ¶
func GetCurrentFeeSum(db vm_db.VmDb, reader util.ConsensusReader) (*FeeSumByPeriod, bool)
func GetFeeSumByPeriodId ¶
func GetFeeSumByPeriodId(db vm_db.VmDb, periodId uint64) (*FeeSumByPeriod, bool)
func RollAndGentNewFeeSumByPeriod ¶
func RollAndGentNewFeeSumByPeriod(db vm_db.VmDb, periodId uint64) (rolledFeeSumByPeriod *FeeSumByPeriod)
func (*FeeSumByPeriod) DeSerialize ¶
func (df *FeeSumByPeriod) DeSerialize(feeSumData []byte) (err error)
func (*FeeSumByPeriod) Serialize ¶
func (df *FeeSumByPeriod) Serialize() (data []byte, err error)
type FundSettleSorter ¶
type FundSettleSorter []*dexproto.FundSettle
func (FundSettleSorter) Len ¶
func (st FundSettleSorter) Len() int
func (FundSettleSorter) Less ¶
func (st FundSettleSorter) Less(i, j int) bool
func (FundSettleSorter) Swap ¶
func (st FundSettleSorter) Swap(i, j int)
type FundVerifyItem ¶
type FundVerifyRes ¶
type FundVerifyRes struct { UserCount int `json:"userCount"` BalanceMatched bool `json:"balanceMatched"` VerifyItems map[types.TokenTypeId]*FundVerifyItem `json:"balances"` }
func VerifyDexFundBalance ¶
func VerifyDexFundBalance(db vm_db.VmDb, reader *util.VMConsensusReader) *FundVerifyRes
type InviteRelationEvent ¶
type InviteRelationEvent struct {
dexproto.InviteRelation
}
func (InviteRelationEvent) FromBytes ¶
func (ir InviteRelationEvent) FromBytes(data []byte) interface{}
func (InviteRelationEvent) GetTopicId ¶
func (ir InviteRelationEvent) GetTopicId() types.Hash
type MarketEvent ¶
type MarketEvent struct {
dexproto.MarketInfo
}
func (MarketEvent) FromBytes ¶
func (me MarketEvent) FromBytes(data []byte) interface{}
func (MarketEvent) GetTopicId ¶
func (me MarketEvent) GetTopicId() types.Hash
type MarketInfo ¶
type MarketInfo struct {
dexproto.MarketInfo
}
func CleanExpireOrders ¶
func CleanExpireOrders(db vm_db.VmDb, orderIds []byte) (map[types.Address]map[bool]*dexproto.FundSettle, *MarketInfo, error)
func GetMarketInfo ¶
func GetMarketInfo(db vm_db.VmDb, tradeToken, quoteToken types.TokenTypeId) (marketInfo *MarketInfo, ok bool)
func GetMarketInfoById ¶
func GetMarketInfoById(db vm_db.VmDb, marketId int32) (marketInfo *MarketInfo, ok bool)
func GetMarketInfoByTokens ¶
func GetMarketInfoByTokens(db vm_db.VmDb, tradeTokenData, quoteTokenData []byte) (marketInfo *MarketInfo, ok bool)
func RenderOrder ¶
func RenderOrder(order *Order, param *ParamDexFundNewOrder, db vm_db.VmDb, address types.Address) (*MarketInfo, error)
func (*MarketInfo) DeSerialize ¶
func (mi *MarketInfo) DeSerialize(data []byte) error
func (*MarketInfo) Serialize ¶
func (mi *MarketInfo) Serialize() (data []byte, err error)
type Matcher ¶
type Matcher struct { MarketInfo *MarketInfo // contains filtered or unexported fields }
func NewMatcherWithMarketInfo ¶
func NewMatcherWithMarketInfo(db vm_db.VmDb, marketInfo *MarketInfo) (mc *Matcher)
func (*Matcher) GetFundSettles ¶
func (*Matcher) GetOrdersFromMarket ¶
type MinedVxForInviteeFeeEvent ¶
type MinedVxForInviteeFeeEvent struct {
dexproto.MinedVxForFee
}
func (MinedVxForInviteeFeeEvent) FromBytes ¶
func (mif MinedVxForInviteeFeeEvent) FromBytes(data []byte) interface{}
func (MinedVxForInviteeFeeEvent) GetTopicId ¶
func (mif MinedVxForInviteeFeeEvent) GetTopicId() types.Hash
type MinedVxForOperationEvent ¶
type MinedVxForOperationEvent struct {
dexproto.MinedVxForOperation
}
func (MinedVxForOperationEvent) FromBytes ¶
func (mo MinedVxForOperationEvent) FromBytes(data []byte) interface{}
func (MinedVxForOperationEvent) GetTopicId ¶
func (mo MinedVxForOperationEvent) GetTopicId() types.Hash
type MinedVxForPledgeEvent ¶
type MinedVxForPledgeEvent struct {
dexproto.MinedVxForPledge
}
func (MinedVxForPledgeEvent) FromBytes ¶
func (mp MinedVxForPledgeEvent) FromBytes(data []byte) interface{}
func (MinedVxForPledgeEvent) GetTopicId ¶
func (mp MinedVxForPledgeEvent) GetTopicId() types.Hash
type MinedVxForTradeFeeEvent ¶
type MinedVxForTradeFeeEvent struct {
dexproto.MinedVxForFee
}
func (MinedVxForTradeFeeEvent) FromBytes ¶
func (mtf MinedVxForTradeFeeEvent) FromBytes(data []byte) interface{}
func (MinedVxForTradeFeeEvent) GetTopicId ¶
func (mtf MinedVxForTradeFeeEvent) GetTopicId() types.Hash
type NewOrderEvent ¶
type NewOrderEvent struct {
dexproto.NewOrderInfo
}
func (NewOrderEvent) FromBytes ¶
func (od NewOrderEvent) FromBytes(data []byte) interface{}
func (NewOrderEvent) GetTopicId ¶
func (od NewOrderEvent) GetTopicId() types.Hash
type OrderIdSerialNo ¶
type OrderIdSerialNo struct {
dexproto.OrderIdSerialNo
}
func (*OrderIdSerialNo) DeSerialize ¶
func (osn *OrderIdSerialNo) DeSerialize(data []byte) error
func (*OrderIdSerialNo) Serialize ¶
func (osn *OrderIdSerialNo) Serialize() (data []byte, err error)
type OrderTx ¶
type OrderTx struct { proto.Transaction // contains filtered or unexported fields }
type OrderUpdateEvent ¶
type OrderUpdateEvent struct {
dexproto.OrderUpdateInfo
}
func (OrderUpdateEvent) FromBytes ¶
func (od OrderUpdateEvent) FromBytes(data []byte) interface{}
func (OrderUpdateEvent) GetTopicId ¶
func (od OrderUpdateEvent) GetTopicId() types.Hash
type ParamDexFundCancelPledge ¶
type ParamDexFundGetTokenInfoCallback ¶
type ParamDexFundMarketOwnerConfig ¶
type ParamDexFundMarketOwnerConfig struct { OperationCode uint8 // 1 owner, 2 takerRate, 4 makerRate, 8 stopMarket TradeToken types.TokenTypeId QuoteToken types.TokenTypeId Owner types.Address TakerFeeRate int32 MakerFeeRate int32 StopMarket bool }
type ParamDexFundNewMarket ¶
type ParamDexFundNewMarket struct { TradeToken types.TokenTypeId QuoteToken types.TokenTypeId }
type ParamDexFundNewOrder ¶
type ParamDexFundNewOrder struct { TradeToken types.TokenTypeId QuoteToken types.TokenTypeId Side bool OrderType uint8 Price string Quantity *big.Int }
type ParamDexFundOwnerConfig ¶
type ParamDexFundOwnerConfigTrade ¶
type ParamDexFundOwnerConfigTrade struct { OperationCode uint8 TradeToken types.TokenTypeId // 1 mineMarket QuoteToken types.TokenTypeId // 1 mineMarket AllowMine bool // 1 mineMarket NewQuoteToken types.TokenTypeId // 2 new quote token QuoteTokenType uint8 // 2 new quote token TokenType4TradeThr uint8 // 4 maintainer TradeThreshold *big.Int // 4 maintainer TokenType4MineThr uint8 // 8 maintainer MineThreshold *big.Int // 8 maintainer }
type ParamDexFundPledge ¶
type ParamDexFundPledgeCallBack ¶
type ParamDexFundPledgeForVip ¶
type ParamDexFundPledgeForVip struct {
ActionType uint8 // 1: pledge 2: cancel pledge
}
type ParamDexFundPledgeForVx ¶
type ParamDexFundTransferTokenOwner ¶
type ParamDexFundTransferTokenOwner struct { Token types.TokenTypeId Owner types.Address }
type ParamDexFundWithDraw ¶
type ParamDexFundWithDraw struct { Token types.TokenTypeId Amount *big.Int }
type PendingNewMarkets ¶
type PendingNewMarkets struct {
dexproto.PendingNewMarkets
}
func GetPendingNewMarkets ¶
func GetPendingNewMarkets(db vm_db.VmDb) (pendingNewMarkets *PendingNewMarkets, ok bool)
func (*PendingNewMarkets) DeSerialize ¶
func (pnm *PendingNewMarkets) DeSerialize(data []byte) error
func (*PendingNewMarkets) Serialize ¶
func (pnm *PendingNewMarkets) Serialize() (data []byte, err error)
type PendingSetQuotes ¶
type PendingSetQuotes struct {
dexproto.PendingSetQuotes
}
func GetPendingSetQuotes ¶
func GetPendingSetQuotes(db vm_db.VmDb) (pendingSetQuotes *PendingSetQuotes, ok bool)
func (*PendingSetQuotes) DeSerialize ¶
func (psq *PendingSetQuotes) DeSerialize(data []byte) error
func (*PendingSetQuotes) Serialize ¶
func (psq *PendingSetQuotes) Serialize() (data []byte, err error)
type PendingTransferTokenOwners ¶
type PendingTransferTokenOwners struct {
dexproto.PendingTransferTokenOwners
}
func GetPendingTransferTokenOwners ¶
func GetPendingTransferTokenOwners(db vm_db.VmDb) (pendings *PendingTransferTokenOwners, ok bool)
func (*PendingTransferTokenOwners) DeSerialize ¶
func (psq *PendingTransferTokenOwners) DeSerialize(data []byte) error
func (*PendingTransferTokenOwners) Serialize ¶
func (psq *PendingTransferTokenOwners) Serialize() (data []byte, err error)
type PeriodWithBizEvent ¶
type PeriodWithBizEvent struct {
dexproto.PeriodWithBiz
}
func (PeriodWithBizEvent) FromBytes ¶
func (pb PeriodWithBizEvent) FromBytes(data []byte) interface{}
func (PeriodWithBizEvent) GetTopicId ¶
func (pb PeriodWithBizEvent) GetTopicId() types.Hash
type PledgesForVx ¶
type PledgesForVx struct {
dexproto.PledgesForVx
}
func GetPledgesForVx ¶
func GetPledgesForVxSum ¶
func GetPledgesForVxSum(db vm_db.VmDb) (pledgesForVx *PledgesForVx, ok bool)
func (*PledgesForVx) DeSerialize ¶
func (psv *PledgesForVx) DeSerialize(data []byte) error
func (*PledgesForVx) Serialize ¶
func (psv *PledgesForVx) Serialize() (data []byte, err error)
type QuoteTokenTypeInfo ¶
type SerializableDex ¶
type SettleMakerMinedVxEvent ¶
type SettleMakerMinedVxEvent struct {
dexproto.SettleMakerMinedVx
}
func (SettleMakerMinedVxEvent) FromBytes ¶
func (smmv SettleMakerMinedVxEvent) FromBytes(data []byte) interface{}
func (SettleMakerMinedVxEvent) GetTopicId ¶
func (smmv SettleMakerMinedVxEvent) GetTopicId() types.Hash
type TokenEvent ¶
func (TokenEvent) FromBytes ¶
func (te TokenEvent) FromBytes(data []byte) interface{}
func (TokenEvent) GetTopicId ¶
func (te TokenEvent) GetTopicId() types.Hash
type TransactionEvent ¶
type TransactionEvent struct {
dexproto.Transaction
}
func (TransactionEvent) FromBytes ¶
func (tx TransactionEvent) FromBytes(data []byte) interface{}
func (TransactionEvent) GetTopicId ¶
func (tx TransactionEvent) GetTopicId() types.Hash
type UserFeeSettleSorter ¶
type UserFeeSettleSorter []*dexproto.UserFeeSettle
func (UserFeeSettleSorter) Len ¶
func (st UserFeeSettleSorter) Len() int
func (UserFeeSettleSorter) Less ¶
func (st UserFeeSettleSorter) Less(i, j int) bool
func (UserFeeSettleSorter) Swap ¶
func (st UserFeeSettleSorter) Swap(i, j int)
type UserFees ¶
type UserFundSettleSorter ¶
type UserFundSettleSorter []*dexproto.UserFundSettle
func (UserFundSettleSorter) Len ¶
func (st UserFundSettleSorter) Len() int
func (UserFundSettleSorter) Less ¶
func (st UserFundSettleSorter) Less(i, j int) bool
func (UserFundSettleSorter) Swap ¶
func (st UserFundSettleSorter) Swap(i, j int)
type VxFunds ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.