Versions in this module Expand all Collapse all v1 v1.5.0 Jun 21, 2018 Changes in this version + const TrendUpdateType + func MarshalHashListToStr(hashlist []common.Hash) string + func UnmarshalStrToHashList(str string) []common.Hash + type Block struct + BlockHash string + BlockNumber int64 + CreateTime int64 + Fork bool + ID int + ParentHash string + func (b *Block) ConvertDown(src *types.Block) error + func (b *Block) ConvertUp(dst *types.Block) error + type CancelEvent struct + AmountCancelled string + BlockNumber int64 + CreateTime int64 + DelegateAddress string + Fork bool + ID int + LogIndex int64 + OrderHash string + Protocol string + Status uint8 + TxHash string + func (e *CancelEvent) ConvertDown(src *types.OrderCancelledEvent) error + func (e *CancelEvent) ConvertUp(dst *types.OrderCancelledEvent) error + type CheckPoint struct + BusinessType string + CheckPoint int64 + CreateTime int64 + ID int + ModifyTime int64 + type CutOffEvent struct + BlockNumber int64 + CreateTime int64 + Cutoff int64 + DelegateAddress string + Fork bool + ID int + LogIndex int64 + OrderHashList string + Owner string + Protocol string + Status uint8 + TxHash string + func (e *CutOffEvent) ConvertDown(src *types.CutoffEvent) error + func (e *CutOffEvent) ConvertUp(dst *types.CutoffEvent) error + type CutOffPairEvent struct + BlockNumber int64 + CreateTime int64 + Cutoff int64 + DelegateAddress string + Fork bool + ID int + LogIndex int64 + OrderHashList string + Owner string + Protocol string + Status uint8 + Token1 string + Token2 string + TxHash string + func (e *CutOffPairEvent) ConvertDown(src *types.CutoffPairEvent) error + func (e *CutOffPairEvent) ConvertUp(dst *types.CutoffPairEvent) error + type FillEvent struct + AmountB string + AmountS string + BlockNumber int64 + CreateTime int64 + DelegateAddress string + FillIndex int64 + Fork bool + ID int + LogIndex int64 + LrcFee string + LrcReward string + Market string + NextOrderHash string + OrderHash string + OrderType string + Owner string + PreOrderHash string + Protocol string + RingHash string + RingIndex int64 + Side string + SplitB string + SplitS string + TokenB string + TokenS string + TxHash string + func (f *FillEvent) ConvertDown(src *types.OrderFilledEvent) error + func (f *FillEvent) ConvertUp(dst *types.OrderFilledEvent) error + type Order struct + AmountB string + AmountS string + AuthAddress string + BroadcastTime int + BuyNoMoreThanAmountB bool + CancelledAmountB string + CancelledAmountS string + CreateTime int64 + DealtAmountB string + DealtAmountS string + DelegateAddress string + ID int + LrcFee string + MarginSplitPercentage uint8 + Market string + MinerBlockMark int64 + OrderHash string + OrderType string + Owner string + PowNonce uint64 + Price float64 + PrivateKey string + Protocol string + R string + S string + Side string + SplitAmountB string + SplitAmountS string + Status uint8 + TokenB string + TokenS string + UpdatedBlock int64 + V uint8 + ValidSince int64 + ValidUntil int64 + WalletAddress string + func (o *Order) ConvertDown(state *types.OrderState) error + func (o *Order) ConvertUp(state *types.OrderState) error + type OrderPendingTransaction struct + ID int + Nonce int64 + OrderHash string + OrderStatus uint8 + Owner string + TxHash string + func (tx *OrderPendingTransaction) ConvertDown(src *omtyp.OrderTx) error + func (tx *OrderPendingTransaction) ConvertUp(dst *omtyp.OrderTx) error + type OrderView struct + BroadcastTime int + CreateTime int64 + DelegateAddress string + ID int + Market string + OrderHash string + OrderId int + OrderType string + Owner string + Price float64 + Protocol string + Side string + Status uint8 + TokenB string + TokenS string + type PageResult struct + Data []interface{} + PageIndex int + PageSize int + Total int + type RdsService struct + func NewDb(options *libdao.MysqlOptions) *RdsService + func (s *RdsService) DelDuplicateTxEntity(txhash string, logindex, nonce int64) error + func (s *RdsService) DelPendingOrderTx(owner common.Address, orderhash common.Hash, txhashlist []common.Hash) int64 + func (s *RdsService) DelPendingTxEntity(hash string) error + func (s *RdsService) DelPendingTxView(hash string) error + func (s *RdsService) FillsPageQuery(query map[string]interface{}, pageIndex, pageSize int) (res PageResult, err error) + func (s *RdsService) FindBlockByHash(blockhash common.Hash) (*Block, error) + func (s *RdsService) FindFillEvent(txhash string, FillIndex int64) (*FillEvent, error) + func (s *RdsService) FindFillsByRingHash(ringHash common.Hash) ([]FillEvent, error) + func (s *RdsService) FindLatestBlock() (*Block, error) + func (s *RdsService) FindPendingOrderTx(txhash, orderhash common.Hash) (*OrderPendingTransaction, error) + func (s *RdsService) FindPendingTxEntity(hash string) (TransactionEntity, error) + func (s *RdsService) FindRingMined(txhash string) (*RingMinedEvent, error) + func (s *RdsService) FindTxEntity(txhash string, logIndex int64) (TransactionEntity, error) + func (s *RdsService) FindWhiteListUserByAddress(address common.Address) (*WhiteList, error) + func (s *RdsService) FlexCancelOrderByHash(owner common.Address, orderhash common.Hash, validStatus []types.OrderStatus, ...) int64 + func (s *RdsService) FlexCancelOrderByMarket(owner common.Address, cutoff int64, market string, ...) int64 + func (s *RdsService) FlexCancelOrderByOwner(owner common.Address, validStatus []types.OrderStatus, ...) int64 + func (s *RdsService) FlexCancelOrderByTime(owner common.Address, cutoff int64, validStatus []types.OrderStatus, ...) int64 + func (s *RdsService) GetCancelEvent(txhash common.Hash) (CancelEvent, error) + func (s *RdsService) GetCancelForkEvents(from, to int64) ([]CancelEvent, error) + func (s *RdsService) GetCutoffEvent(txhash common.Hash) (CutOffEvent, error) + func (s *RdsService) GetCutoffForkEvents(from, to int64) ([]CutOffEvent, error) + func (s *RdsService) GetCutoffOrders(owner common.Address, cutoffTime *big.Int, validStatus []types.OrderStatus) ([]Order, error) + func (s *RdsService) GetCutoffPairEvent(txhash common.Hash) (CutOffPairEvent, error) + func (s *RdsService) GetCutoffPairForkEvents(from, to int64) ([]CutOffPairEvent, error) + func (s *RdsService) GetCutoffPairOrders(owner, token1, token2 common.Address, cutoffTime *big.Int, ...) ([]Order, error) + func (s *RdsService) GetFillForkEvents(from, to int64) ([]FillEvent, error) + func (s *RdsService) GetFrozenAmount(owner common.Address, token common.Address, statusSet []types.OrderStatus, ...) ([]Order, error) + func (s *RdsService) GetFrozenLrcFee(owner common.Address, statusSet []types.OrderStatus) ([]Order, error) + func (s *RdsService) GetLatestFills(query map[string]interface{}, limit int) (res []FillEvent, err error) + func (s *RdsService) GetLatestOrders(query map[string]interface{}, length int) ([]Order, error) + func (s *RdsService) GetMaxNonce(owner common.Address) (*big.Int, error) + func (s *RdsService) GetMaxSuccessNonce(owner common.Address) (*big.Int, error) + func (s *RdsService) GetOrderBook(delegate, tokenS, tokenB common.Address, length int) ([]Order, error) + func (s *RdsService) GetOrderByHash(orderhash common.Hash) (*Order, error) + func (s *RdsService) GetOrdersByHash(orderhashs []string) (map[string]Order, error) + func (s *RdsService) GetOrdersForMiner(protocol, tokenS, tokenB string, length int, validStatus []types.OrderStatus, ...) ([]*Order, error) + func (s *RdsService) GetPendingOrderTxSortedByNonce(owner common.Address, orderhash common.Hash) ([]OrderPendingTransaction, error) + func (s *RdsService) GetPendingOrderTxs(owner common.Address) ([]OrderPendingTransaction, error) + func (s *RdsService) GetPendingTxEntity(from string, nonce int64) ([]TransactionEntity, error) + func (s *RdsService) GetPendingTxViewByOwner(owner string) ([]TransactionView, error) + func (s *RdsService) GetRingminedMethods(lastId int, limit int) ([]RingMinedEvent, error) + func (s *RdsService) GetTxEntity(hashlist []string) ([]TransactionEntity, error) + func (s *RdsService) GetTxViewByOwner(owner string, symbol string, status types.TxStatus, typ txtyp.TxType, ...) ([]TransactionView, error) + func (s *RdsService) GetTxViewByOwnerAndHashs(owner string, hashs []string) ([]TransactionView, error) + func (s *RdsService) GetTxViewCountByOwner(owner string, symbol string, status types.TxStatus, typ txtyp.TxType) (int, error) + func (s *RdsService) GetWhiteList() ([]WhiteList, error) + func (s *RdsService) IsMiner(miner common.Address) bool + func (s *RdsService) IsOrderOwner(owner common.Address) bool + func (s *RdsService) MarkMinerOrders(filterOrderhashs []string, blockNumber int64) error + func (s *RdsService) OrderPageQuery(query map[string]interface{}, statusList []int, pageIndex, pageSize int) (PageResult, error) + func (s *RdsService) QueryCheckPointByType(businessType string) (point CheckPoint, err error) + func (s *RdsService) QueryRecentFills(market, owner string, start int64, end int64) (fills []FillEvent, err error) + func (s *RdsService) QueryTicketByAddress(address string) (ticket TicketReceiver, err error) + func (s *RdsService) RingMinedPageQuery(query map[string]interface{}, pageIndex, pageSize int) (res PageResult, err error) + func (s *RdsService) RollBackCancel(from, to int64) error + func (s *RdsService) RollBackCutoff(from, to int64) error + func (s *RdsService) RollBackCutoffPair(from, to int64) error + func (s *RdsService) RollBackFill(from, to int64) error + func (s *RdsService) RollBackRingMined(from, to int64) error + func (s *RdsService) RollBackTxEntity(from, to int64) error + func (s *RdsService) RollBackTxView(from, to int64) error + func (s *RdsService) SaveBlock(latest *Block) error + func (s *RdsService) SetCutOffOrders(orderHashList []common.Hash, blockNumber *big.Int) error + func (s *RdsService) SetForkBlock(from, to int64) error + func (s *RdsService) SetPendingTxEntityFailed(hashlist []string) error + func (s *RdsService) SetPendingTxViewFailed(hashlist []string) error + func (s *RdsService) TicketCount() (count int, err error) + func (s *RdsService) TrendQueryByInterval(intervals, market string, start, end int64) (trends []Trend, err error) + func (s *RdsService) TrendQueryByTime(intervals, market string, start, end int64) (trends []Trend, err error) + func (s *RdsService) TrendQueryForProof(mkt, interval string, start int64) (trends []Trend, err error) + func (s *RdsService) TrendQueryLatest(query Trend, pageIndex, pageSize int) (trends []Trend, err error) + func (s *RdsService) UpdateBroadcastTimeByHash(hash string, bt int) error + func (s *RdsService) UpdateOrderStatus(orderhash common.Hash, status types.OrderStatus) error + func (s *RdsService) UpdateOrderWhileCancel(hash common.Hash, status types.OrderStatus, ...) error + func (s *RdsService) UpdateOrderWhileFill(hash common.Hash, status types.OrderStatus, ...) error + func (s *RdsService) UpdateOrderWhileRollbackCutoff(orderhash common.Hash, status types.OrderStatus, blockNumber *big.Int) error + type RingMinedEvent struct + BlockNumber int64 + DelegateAddress string + Err string + FeeRecipient string + Fork bool + GasLimit string + GasPrice string + GasUsed string + ID int + IsRinghashReserved bool + Miner string + OrderHashList string + Protocol string + RingHash string + RingIndex string + Status uint8 + Time int64 + TotalLrcFee string + TradeAmount int + TxHash string + func (r *RingMinedEvent) ConvertDown(event *types.RingMinedEvent) error + func (r *RingMinedEvent) ConvertUp(event *types.RingMinedEvent) error + func (r *RingMinedEvent) FromSubmitRingMethod(event *types.SubmitRingMethodEvent) error + func (r *RingMinedEvent) GetOrderHashList() []common.Hash + type TicketReceiver struct + Address string + Email string + ID int + Name string + Phone string + type TransactionEntity struct + BlockNumber int64 + BlockTime int64 + Content string + Fork bool + From string + GasLimit string + GasPrice string + GasUsed string + ID int + LogIndex int64 + Nonce int64 + Protocol string + Status uint8 + To string + TxHash string + Value string + func (tx *TransactionEntity) ConvertDown(src *txtyp.TransactionEntity) error + func (tx *TransactionEntity) ConvertUp(dst *txtyp.TransactionEntity) error + type TransactionView struct + Amount string + BlockNumber int64 + CreateTime int64 + Fork bool + ID int + LogIndex int64 + Nonce int64 + Owner string + Status uint8 + Symbol string + TxHash string + Type uint8 + UpdateTime int64 + func (tx *TransactionView) ConvertDown(src *txtyp.TransactionView) error + func (tx *TransactionView) ConvertUp(dst *txtyp.TransactionView) error + type Trend struct + Amount float64 + Close float64 + CreateTime int64 + End int64 + High float64 + ID int + Intervals string + Low float64 + Market string + Open float64 + Start int64 + UpdateTime int64 + Vol float64 + type WhiteList struct + CreateTime int64 + ID int + IsDeleted bool + Owner string + func (w *WhiteList) ConvertDown(src *types.WhiteListUser) error + func (w *WhiteList) ConvertUp(dst *types.WhiteListUser) error