Documentation ¶
Index ¶
- Constants
- func MarshalHashListToStr(hashlist []common.Hash) string
- func UnmarshalStrToHashList(str string) []common.Hash
- type Block
- type CancelEvent
- type CheckPoint
- type CutOffEvent
- type CutOffPairEvent
- type FillEvent
- type Order
- type OrderPendingTransaction
- type OrderView
- type PageResult
- type 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
- type TicketReceiver
- type TransactionEntity
- type TransactionView
- type Trend
- type WhiteList
Constants ¶
const (
TrendUpdateType = "last_trend__proof_time"
)
Variables ¶
This section is empty.
Functions ¶
func MarshalHashListToStr ¶
func UnmarshalStrToHashList ¶
Types ¶
type Block ¶
type Block struct { ID int `gorm:"column:id;primary_key"` BlockNumber int64 `gorm:"column:block_number;type:bigint"` BlockHash string `gorm:"column:block_hash;type:varchar(82)"` ParentHash string `gorm:"column:parent_hash;type:varchar(82)"` CreateTime int64 `gorm:"column:create_time"` Fork bool `gorm:"column:fork;"` }
func (*Block) ConvertDown ¶
convert types/block to dao/block
type CancelEvent ¶
type CancelEvent struct { ID int `gorm:"column:id;primary_key;"` Protocol string `gorm:"column:contract_address;type:varchar(42)"` DelegateAddress string `gorm:"column:delegate_address;type:varchar(42)"` OrderHash string `gorm:"column:order_hash;type:varchar(82)"` TxHash string `gorm:"column:tx_hash;type:varchar(82)"` BlockNumber int64 `gorm:"column:block_number"` CreateTime int64 `gorm:"column:create_time"` AmountCancelled string `gorm:"column:amount_cancelled;type:varchar(40)"` LogIndex int64 `gorm:"column:log_index"` Status uint8 `gorm:"column:status"` Fork bool `gorm:"column:fork"` }
func (*CancelEvent) ConvertDown ¶
func (e *CancelEvent) ConvertDown(src *types.OrderCancelledEvent) error
convert chainClient/orderCancelledEvent to dao/CancelEvent
func (*CancelEvent) ConvertUp ¶
func (e *CancelEvent) ConvertUp(dst *types.OrderCancelledEvent) error
convert dao/cancelEvent to types/cancelEvent
type CheckPoint ¶
type CheckPoint struct { ID int `gorm:"column:id;primary_key;"` BusinessType string `gorm:"column:business_type;type:varchar(42);unique_index"` CheckPoint int64 `gorm:"column:check_point;type:bigint"` CreateTime int64 `gorm:"column:create_time;type:bigint"` ModifyTime int64 `gorm:"column:modify_time;type:bigint"` }
common check point table
type CutOffEvent ¶
type CutOffEvent struct { ID int `gorm:"column:id;primary_key;"` Protocol string `gorm:"column:contract_address;type:varchar(42)"` DelegateAddress string `gorm:"column:delegate_address;type:varchar(42)"` Owner string `gorm:"column:owner;type:varchar(42)"` TxHash string `gorm:"column:tx_hash;type:varchar(82)"` OrderHashList string `gorm:"column:order_hash_list;type:text"` BlockNumber int64 `gorm:"column:block_number"` Cutoff int64 `gorm:"column:cutoff"` LogIndex int64 `gorm:"column:log_index"` Status uint8 `gorm:"column:status"` Fork bool `gorm:"column:fork"` CreateTime int64 `gorm:"column:create_time"` }
todo(fuk): rename table
func (*CutOffEvent) ConvertDown ¶
func (e *CutOffEvent) ConvertDown(src *types.CutoffEvent) error
convert types/cutoffEvent to dao/CancelEvent
func (*CutOffEvent) ConvertUp ¶
func (e *CutOffEvent) ConvertUp(dst *types.CutoffEvent) error
convert dao/cutoffEvent to types/cutoffEvent
type CutOffPairEvent ¶
type CutOffPairEvent struct { ID int `gorm:"column:id;primary_key;"` Protocol string `gorm:"column:contract_address;type:varchar(42)"` DelegateAddress string `gorm:"column:delegate_address;type:varchar(42)"` Owner string `gorm:"column:owner;type:varchar(42)"` Token1 string `gorm:"column:token1;type:varchar(42)"` Token2 string `gorm:"column:token2;type:varchar(42)"` TxHash string `gorm:"column:tx_hash;type:varchar(82)"` OrderHashList string `gorm:"column:order_hash_list;type:text"` BlockNumber int64 `gorm:"column:block_number"` LogIndex int64 `gorm:"column:log_index"` Cutoff int64 `gorm:"column:cutoff"` CreateTime int64 `gorm:"column:create_time"` Status uint8 `gorm:"column:status"` Fork bool `gorm:"column:fork"` }
func (*CutOffPairEvent) ConvertDown ¶
func (e *CutOffPairEvent) ConvertDown(src *types.CutoffPairEvent) error
convert types/cutoffPairEvent to dao/cutoffPairEvent
func (*CutOffPairEvent) ConvertUp ¶
func (e *CutOffPairEvent) ConvertUp(dst *types.CutoffPairEvent) error
convert dao/cutoffPairEvent to types/cutoffPairEvent
type FillEvent ¶
type FillEvent struct { ID int `gorm:"column:id;primary_key;" json:"id"` Protocol string `gorm:"column:contract_address;type:varchar(42)" json:"protocol"` DelegateAddress string `gorm:"column:delegate_address;type:varchar(42)" json:"delegateAddress"` Owner string `gorm:"column:owner;type:varchar(42)" json:"owner"` RingIndex int64 `gorm:"column:ring_index;" json:"ringIndex"` BlockNumber int64 `gorm:"column:block_number" json:"blockNumber"` CreateTime int64 `gorm:"column:create_time" json:"createTime"` RingHash string `gorm:"column:ring_hash;varchar(82)" json:"ringHash"` FillIndex int64 `gorm:"column:fill_index" json:"fillIndex"` TxHash string `gorm:"column:tx_hash;type:varchar(82)" json:"txHash"` PreOrderHash string `gorm:"column:pre_order_hash;varchar(82)" json:"preOrderHash"` NextOrderHash string `gorm:"column:next_order_hash;varchar(82)" json:"nextOrderHash"` OrderHash string `gorm:"column:order_hash;type:varchar(82)" json:"orderHash"` AmountS string `gorm:"column:amount_s;type:varchar(40)" json:"amountS"` AmountB string `gorm:"column:amount_b;type:varchar(40)" json:"amountB"` TokenS string `gorm:"column:token_s;type:varchar(42)" json:"tokenS"` TokenB string `gorm:"column:token_b;type:varchar(42)" json:"tokenB"` LrcReward string `gorm:"column:lrc_reward;type:varchar(40)" json:"lrcReward"` LrcFee string `gorm:"column:lrc_fee;type:varchar(40)" json:"lrcFee"` SplitS string `gorm:"column:split_s;type:varchar(40)" json:"splitS"` SplitB string `gorm:"column:split_b;type:varchar(40)" json:"splitB"` Market string `gorm:"column:market;type:varchar(42)" json:"market"` LogIndex int64 `gorm:"column:log_index"` Fork bool `gorm:"column:fork"` Side string `gorm:"column:side" json:"side"` OrderType string `gorm:"column:order_type" json:"orderType"` }
func (*FillEvent) ConvertDown ¶
func (f *FillEvent) ConvertDown(src *types.OrderFilledEvent) error
convert chainclient/orderFilledEvent to dao/fill
type Order ¶
type Order struct { ID int `gorm:"column:id;primary_key;"` Protocol string `gorm:"column:protocol;type:varchar(42)"` DelegateAddress string `gorm:"column:delegate_address;type:varchar(42)"` Owner string `gorm:"column:owner;type:varchar(42)"` AuthAddress string `gorm:"column:auth_address;type:varchar(42)"` PrivateKey string `gorm:"column:priv_key;type:varchar(128)"` WalletAddress string `gorm:"column:wallet_address;type:varchar(42)"` OrderHash string `gorm:"column:order_hash;type:varchar(82)"` TokenS string `gorm:"column:token_s;type:varchar(42)"` TokenB string `gorm:"column:token_b;type:varchar(42)"` AmountS string `gorm:"column:amount_s;type:varchar(40)"` AmountB string `gorm:"column:amount_b;type:varchar(40)"` CreateTime int64 `gorm:"column:create_time;type:bigint"` ValidSince int64 `gorm:"column:valid_since;type:bigint"` ValidUntil int64 `gorm:"column:valid_until;type:bigint"` LrcFee string `gorm:"column:lrc_fee;type:varchar(40)"` BuyNoMoreThanAmountB bool `gorm:"column:buy_nomore_than_amountb"` MarginSplitPercentage uint8 `gorm:"column:margin_split_percentage;type:tinyint(4)"` V uint8 `gorm:"column:v;type:tinyint(4)"` R string `gorm:"column:r;type:varchar(66)"` S string `gorm:"column:s;type:varchar(66)"` PowNonce uint64 `gorm:"column:pow_nonce;type:bigint"` Price float64 `gorm:"column:price;type:decimal(28,16);"` UpdatedBlock int64 `gorm:"column:updated_block;type:bigint"` DealtAmountS string `gorm:"column:dealt_amount_s;type:varchar(40)"` DealtAmountB string `gorm:"column:dealt_amount_b;type:varchar(40)"` CancelledAmountS string `gorm:"column:cancelled_amount_s;type:varchar(40)"` CancelledAmountB string `gorm:"column:cancelled_amount_b;type:varchar(40)"` SplitAmountS string `gorm:"column:split_amount_s;type:varchar(40)"` SplitAmountB string `gorm:"column:split_amount_b;type:varchar(40)"` Status uint8 `gorm:"column:status;type:tinyint(4)"` MinerBlockMark int64 `gorm:"column:miner_block_mark;type:bigint"` BroadcastTime int `gorm:"column:broadcast_time;type:bigint"` Market string `gorm:"column:market;type:varchar(40)"` Side string `gorm:"column:side;type:varchar(40)"` OrderType string `gorm:"column:order_type;type:varchar(40)"` }
func (*Order) ConvertDown ¶
func (o *Order) ConvertDown(state *types.OrderState) error
convert types/orderState to dao/order
type OrderPendingTransaction ¶
type OrderPendingTransaction struct { ID int `gorm:"column:id;primary_key;"` Owner string `gorm:"column:owner;type:varchar(42)"` OrderHash string `gorm:"column:order_hash;type:varchar(82)"` OrderStatus uint8 `gorm:"column:order_status;type:tinyint(4)"` TxHash string `gorm:"column:tx_hash;type:varchar(82)"` Nonce int64 `gorm:"column:nonce;type:bigint"` }
func (*OrderPendingTransaction) ConvertDown ¶
func (tx *OrderPendingTransaction) ConvertDown(src *omtyp.OrderTx) error
convert types/orderTxRecord to dao/ordertx
type OrderView ¶
type OrderView struct { ID int `gorm:"column:id;primary_key;"` OrderId int `gorm:"column:order_id"` Protocol string `gorm:"column:protocol;type:varchar(42)"` DelegateAddress string `gorm:"column:delegate_address;type:varchar(42)"` Owner string `gorm:"column:owner;type:varchar(42)"` OrderHash string `gorm:"column:order_hash;type:varchar(82)"` TokenS string `gorm:"column:token_s;type:varchar(42)"` TokenB string `gorm:"column:token_b;type:varchar(42)"` CreateTime int64 `gorm:"column:create_time;type:bigint"` Price float64 `gorm:"column:price;type:decimal(28,16);"` Status uint8 `gorm:"column:status;type:tinyint(4)"` BroadcastTime int `gorm:"column:broadcast_time;type:bigint"` Market string `gorm:"column:market;type:varchar(40)"` Side string `gorm:"column:side;type:varchar(40)"` OrderType string `gorm:"column:order_type;type:varchar(40)"` }
type PageResult ¶
type RdsService ¶
type RdsService struct {
libdao.RdsServiceImpl
}
func NewDb ¶
func NewDb(options *libdao.MysqlOptions) *RdsService
func (*RdsService) DelDuplicateTxEntity ¶
func (s *RdsService) DelDuplicateTxEntity(txhash string, logindex, nonce int64) error
func (*RdsService) DelPendingOrderTx ¶
func (*RdsService) DelPendingTxEntity ¶
func (s *RdsService) DelPendingTxEntity(hash string) error
根据hash&status删除pending tx
func (*RdsService) DelPendingTxView ¶
func (s *RdsService) DelPendingTxView(hash string) error
根据hash删除pending tx
func (*RdsService) FillsPageQuery ¶
func (s *RdsService) FillsPageQuery(query map[string]interface{}, pageIndex, pageSize int) (res PageResult, err error)
func (*RdsService) FindBlockByHash ¶
func (s *RdsService) FindBlockByHash(blockhash common.Hash) (*Block, error)
func (*RdsService) FindFillEvent ¶
func (s *RdsService) FindFillEvent(txhash string, FillIndex int64) (*FillEvent, error)
func (*RdsService) FindFillsByRingHash ¶
func (s *RdsService) FindFillsByRingHash(ringHash common.Hash) ([]FillEvent, error)
func (*RdsService) FindLatestBlock ¶
func (s *RdsService) FindLatestBlock() (*Block, error)
func (*RdsService) FindPendingOrderTx ¶
func (s *RdsService) FindPendingOrderTx(txhash, orderhash common.Hash) (*OrderPendingTransaction, error)
func (*RdsService) FindPendingTxEntity ¶
func (s *RdsService) FindPendingTxEntity(hash string) (TransactionEntity, error)
根据hash查询pending tx
func (*RdsService) FindRingMined ¶
func (s *RdsService) FindRingMined(txhash string) (*RingMinedEvent, error)
func (*RdsService) FindTxEntity ¶
func (s *RdsService) FindTxEntity(txhash string, logIndex int64) (TransactionEntity, error)
根据hash&logIndex查找唯一tx
func (*RdsService) FindWhiteListUserByAddress ¶
func (s *RdsService) FindWhiteListUserByAddress(address common.Address) (*WhiteList, error)
func (*RdsService) FlexCancelOrderByHash ¶
func (s *RdsService) FlexCancelOrderByHash(owner common.Address, orderhash common.Hash, validStatus []types.OrderStatus, status types.OrderStatus) int64
func (*RdsService) FlexCancelOrderByMarket ¶
func (s *RdsService) FlexCancelOrderByMarket(owner common.Address, cutoff int64, market string, validStatus []types.OrderStatus, status types.OrderStatus) int64
func (*RdsService) FlexCancelOrderByOwner ¶
func (s *RdsService) FlexCancelOrderByOwner(owner common.Address, validStatus []types.OrderStatus, status types.OrderStatus) int64
func (*RdsService) FlexCancelOrderByTime ¶
func (s *RdsService) FlexCancelOrderByTime(owner common.Address, cutoff int64, validStatus []types.OrderStatus, status types.OrderStatus) int64
func (*RdsService) GetCancelEvent ¶
func (s *RdsService) GetCancelEvent(txhash common.Hash) (CancelEvent, error)
func (*RdsService) GetCancelForkEvents ¶
func (s *RdsService) GetCancelForkEvents(from, to int64) ([]CancelEvent, error)
func (*RdsService) GetCutoffEvent ¶
func (s *RdsService) GetCutoffEvent(txhash common.Hash) (CutOffEvent, error)
func (*RdsService) GetCutoffForkEvents ¶
func (s *RdsService) GetCutoffForkEvents(from, to int64) ([]CutOffEvent, error)
func (*RdsService) GetCutoffOrders ¶
func (s *RdsService) GetCutoffOrders(owner common.Address, cutoffTime *big.Int, validStatus []types.OrderStatus) ([]Order, error)
func (*RdsService) GetCutoffPairEvent ¶
func (s *RdsService) GetCutoffPairEvent(txhash common.Hash) (CutOffPairEvent, error)
func (*RdsService) GetCutoffPairForkEvents ¶
func (s *RdsService) GetCutoffPairForkEvents(from, to int64) ([]CutOffPairEvent, error)
func (*RdsService) GetCutoffPairOrders ¶
func (s *RdsService) GetCutoffPairOrders(owner, token1, token2 common.Address, cutoffTime *big.Int, validStatus []types.OrderStatus) ([]Order, error)
func (*RdsService) GetFillForkEvents ¶
func (s *RdsService) GetFillForkEvents(from, to int64) ([]FillEvent, error)
func (*RdsService) GetFrozenAmount ¶
func (*RdsService) GetFrozenLrcFee ¶
func (s *RdsService) GetFrozenLrcFee(owner common.Address, statusSet []types.OrderStatus) ([]Order, error)
func (*RdsService) GetLatestFills ¶
func (s *RdsService) GetLatestFills(query map[string]interface{}, limit int) (res []FillEvent, err error)
func (*RdsService) GetLatestOrders ¶
func (s *RdsService) GetLatestOrders(query map[string]interface{}, length int) ([]Order, error)
func (*RdsService) GetMaxNonce ¶
func (*RdsService) GetMaxSuccessNonce ¶
func (*RdsService) GetOrderBook ¶
func (*RdsService) GetOrderByHash ¶
func (s *RdsService) GetOrderByHash(orderhash common.Hash) (*Order, error)
func (*RdsService) GetOrdersByHash ¶
func (s *RdsService) GetOrdersByHash(orderhashs []string) (map[string]Order, error)
func (*RdsService) GetOrdersForMiner ¶
func (s *RdsService) GetOrdersForMiner(protocol, tokenS, tokenB string, length int, validStatus []types.OrderStatus, reservedTime, startBlockNumber, endBlockNumber int64) ([]*Order, error)
func (*RdsService) GetPendingOrderTxSortedByNonce ¶
func (s *RdsService) GetPendingOrderTxSortedByNonce(owner common.Address, orderhash common.Hash) ([]OrderPendingTransaction, error)
func (*RdsService) GetPendingOrderTxs ¶
func (s *RdsService) GetPendingOrderTxs(owner common.Address) ([]OrderPendingTransaction, error)
func (*RdsService) GetPendingTxEntity ¶
func (s *RdsService) GetPendingTxEntity(from string, nonce int64) ([]TransactionEntity, error)
根据交易发起者from地址及nonce获取pending tx
func (*RdsService) GetPendingTxViewByOwner ¶
func (s *RdsService) GetPendingTxViewByOwner(owner string) ([]TransactionView, error)
func (*RdsService) GetRingminedMethods ¶
func (s *RdsService) GetRingminedMethods(lastId int, limit int) ([]RingMinedEvent, error)
func (*RdsService) GetTxEntity ¶
func (s *RdsService) GetTxEntity(hashlist []string) ([]TransactionEntity, error)
func (*RdsService) GetTxViewByOwner ¶
func (s *RdsService) GetTxViewByOwner(owner string, symbol string, status types.TxStatus, typ txtyp.TxType, limit, offset int) ([]TransactionView, error)
func (*RdsService) GetTxViewByOwnerAndHashs ¶
func (s *RdsService) GetTxViewByOwnerAndHashs(owner string, hashs []string) ([]TransactionView, error)
////////// read related
func (*RdsService) GetTxViewCountByOwner ¶
func (*RdsService) GetWhiteList ¶
func (s *RdsService) GetWhiteList() ([]WhiteList, error)
func (*RdsService) IsOrderOwner ¶
func (s *RdsService) IsOrderOwner(owner common.Address) bool
func (*RdsService) MarkMinerOrders ¶
func (s *RdsService) MarkMinerOrders(filterOrderhashs []string, blockNumber int64) error
func (*RdsService) OrderPageQuery ¶
func (s *RdsService) OrderPageQuery(query map[string]interface{}, statusList []int, pageIndex, pageSize int) (PageResult, error)
func (*RdsService) QueryCheckPointByType ¶
func (s *RdsService) QueryCheckPointByType(businessType string) (point CheckPoint, err error)
func (*RdsService) QueryRecentFills ¶
func (*RdsService) QueryTicketByAddress ¶
func (s *RdsService) QueryTicketByAddress(address string) (ticket TicketReceiver, err error)
func (*RdsService) RingMinedPageQuery ¶
func (s *RdsService) RingMinedPageQuery(query map[string]interface{}, pageIndex, pageSize int) (res PageResult, err error)
func (*RdsService) RollBackCancel ¶
func (s *RdsService) RollBackCancel(from, to int64) error
func (*RdsService) RollBackCutoff ¶
func (s *RdsService) RollBackCutoff(from, to int64) error
func (*RdsService) RollBackCutoffPair ¶
func (s *RdsService) RollBackCutoffPair(from, to int64) error
func (*RdsService) RollBackFill ¶
func (s *RdsService) RollBackFill(from, to int64) error
func (*RdsService) RollBackRingMined ¶
func (s *RdsService) RollBackRingMined(from, to int64) error
func (*RdsService) RollBackTxEntity ¶
func (s *RdsService) RollBackTxEntity(from, to int64) error
func (*RdsService) RollBackTxView ¶
func (s *RdsService) RollBackTxView(from, to int64) error
func (*RdsService) SaveBlock ¶
func (s *RdsService) SaveBlock(latest *Block) error
func (*RdsService) SetCutOffOrders ¶
func (*RdsService) SetForkBlock ¶
func (s *RdsService) SetForkBlock(from, to int64) error
func (*RdsService) SetPendingTxEntityFailed ¶
func (s *RdsService) SetPendingTxEntityFailed(hashlist []string) error
func (*RdsService) SetPendingTxViewFailed ¶
func (s *RdsService) SetPendingTxViewFailed(hashlist []string) error
更新交易发起者相同nonce下tx为failed
func (*RdsService) TicketCount ¶
func (s *RdsService) TicketCount() (count int, err error)
func (*RdsService) TrendQueryByInterval ¶
func (s *RdsService) TrendQueryByInterval(intervals, market string, start, end int64) (trends []Trend, err error)
func (*RdsService) TrendQueryByTime ¶
func (s *RdsService) TrendQueryByTime(intervals, market string, start, end int64) (trends []Trend, err error)
func (*RdsService) TrendQueryForProof ¶
func (s *RdsService) TrendQueryForProof(mkt, interval string, start int64) (trends []Trend, err error)
func (*RdsService) TrendQueryLatest ¶
func (s *RdsService) TrendQueryLatest(query Trend, pageIndex, pageSize int) (trends []Trend, err error)
func (*RdsService) UpdateBroadcastTimeByHash ¶
func (s *RdsService) UpdateBroadcastTimeByHash(hash string, bt int) error
func (*RdsService) UpdateOrderStatus ¶
func (s *RdsService) UpdateOrderStatus(orderhash common.Hash, status types.OrderStatus) error
func (*RdsService) UpdateOrderWhileCancel ¶
func (s *RdsService) UpdateOrderWhileCancel(hash common.Hash, status types.OrderStatus, cancelledAmountS, cancelledAmountB, blockNumber *big.Int) error
func (*RdsService) UpdateOrderWhileFill ¶
func (s *RdsService) UpdateOrderWhileFill(hash common.Hash, status types.OrderStatus, dealtAmountS, dealtAmountB, splitAmountS, splitAmountB, blockNumber *big.Int) error
func (*RdsService) UpdateOrderWhileRollbackCutoff ¶
func (s *RdsService) UpdateOrderWhileRollbackCutoff(orderhash common.Hash, status types.OrderStatus, blockNumber *big.Int) error
type RingMinedEvent ¶
type RingMinedEvent struct { ID int `gorm:"column:id;primary_key" json:"id"` Protocol string `gorm:"column:contract_address;type:varchar(42)" json:"protocol"` DelegateAddress string `gorm:"column:delegate_address;type:varchar(42)" json:"delegateAddress"` RingIndex string `gorm:"column:ring_index;type:varchar(40)" json:"ringIndex"` RingHash string `gorm:"column:ring_hash;type:varchar(82)" json:"ringHash"` TxHash string `gorm:"column:tx_hash;type:varchar(82)" json:"txHash"` OrderHashList string `gorm:"column:order_hash_list;type:text"` Miner string `gorm:"column:miner;type:varchar(42);" json:"miner"` FeeRecipient string `gorm:"column:fee_recipient;type:varchar(42)" json:"feeRecipient"` IsRinghashReserved bool `gorm:"column:is_ring_hash_reserved;" json:"isRinghashReserved"` BlockNumber int64 `gorm:"column:block_number;type:bigint" json:"blockNumber"` TotalLrcFee string `gorm:"column:total_lrc_fee;type:varchar(40)" json:"totalLrcFee"` TradeAmount int `gorm:"column:trade_amount" json:"tradeAmount"` Time int64 `gorm:"column:time;type:bigint" json:"timestamp"` Status uint8 `gorm:"column:status;type:tinyint(4)"` Fork bool `gorm:"column:fork"` GasLimit string `gorm:"column:gas_limit;type:varchar(50)"` GasUsed string `gorm:"column:gas_used;type:varchar(50)"` GasPrice string `gorm:"column:gas_price;type:varchar(50)"` Err string `gorm:"column:err;type:text" json:"err"` }
todo(fuk): delete field isRinghashReserved
func (*RingMinedEvent) ConvertDown ¶
func (r *RingMinedEvent) ConvertDown(event *types.RingMinedEvent) error
func (*RingMinedEvent) ConvertUp ¶
func (r *RingMinedEvent) ConvertUp(event *types.RingMinedEvent) error
func (*RingMinedEvent) FromSubmitRingMethod ¶
func (r *RingMinedEvent) FromSubmitRingMethod(event *types.SubmitRingMethodEvent) error
func (*RingMinedEvent) GetOrderHashList ¶
func (r *RingMinedEvent) GetOrderHashList() []common.Hash
type TicketReceiver ¶
type TicketReceiver struct { ID int `gorm:"column:id;primary_key;" json:"id"` Name string `gorm:"column:name;type:varchar(42)" json:"name"` Email string `gorm:"column:email;type:varchar(128)" json:"email"` Phone string `gorm:"column:phone;type:varchar(128)" json:"phone"` Address string `gorm:"column:address;type:varchar(128);unique_index" json:"address"` }
type TransactionEntity ¶
type TransactionEntity struct { ID int `gorm:"column:id;primary_key;" json:"id"` Protocol string `gorm:"column:protocol;type:varchar(42)" json:"protocol"` From string `gorm:"column:tx_from;type:varchar(42)" json:"from"` To string `gorm:"column:tx_to;type:varchar(42)" json:"to"` BlockNumber int64 `gorm:"column:block_number" json:"block_number"` TxHash string `gorm:"column:tx_hash;type:varchar(82)" json:"tx_hash"` LogIndex int64 `gorm:"column:tx_log_index" json:"log_index"` Value string `gorm:"column:amount;type:varchar(64)" json:"value"` Content string `gorm:"column:content;type:text" json:"content"` Status uint8 `gorm:"column:status" json:"status"` GasLimit string `gorm:"column:gas_limit;type:varchar(40)" json:"gas_limit"` GasUsed string `gorm:"column:gas_used;type:varchar(40)" json:"gas_used"` GasPrice string `gorm:"column:gas_price;type:varchar(40)" json:"gas_price"` Nonce int64 `gorm:"column:nonce" json:"nonce"` BlockTime int64 `gorm:"column:block_time" json:"block_time"` Fork bool `gorm:"column:fork" json:"fork"` }
txhash&logIndex unique, fork should be marked and never used it again
func (*TransactionEntity) ConvertDown ¶
func (tx *TransactionEntity) ConvertDown(src *txtyp.TransactionEntity) error
convert to txmanager/types/transactionEntity to dao/transactionEntity todo(fuk): judge nil fields
func (*TransactionEntity) ConvertUp ¶
func (tx *TransactionEntity) ConvertUp(dst *txtyp.TransactionEntity) error
convert dao/transactionEntity to txmanager/types/transactionEntity
type TransactionView ¶
type TransactionView struct { ID int `gorm:"column:id;primary_key;"` Symbol string `gorm:"column:symbol;type:varchar(20)"` Owner string `gorm:"column:owner;type:varchar(42)"` TxHash string `gorm:"column:tx_hash;type:varchar(82)"` BlockNumber int64 `gorm:"column:block_number"` LogIndex int64 `gorm:"column:tx_log_index"` Amount string `gorm:"column:amount;type:varchar(40)"` Nonce int64 `gorm:"column:nonce"` Type uint8 `gorm:"column:tx_type"` Status uint8 `gorm:"column:status"` CreateTime int64 `gorm:"column:create_time"` UpdateTime int64 `gorm:"column:update_time"` Fork bool `gorm:"column:fork"` }
func (*TransactionView) ConvertDown ¶
func (tx *TransactionView) ConvertDown(src *txtyp.TransactionView) error
convert types/transaction to dao/transaction todo(fuk): judge nil fields
func (*TransactionView) ConvertUp ¶
func (tx *TransactionView) ConvertUp(dst *txtyp.TransactionView) error
convert dao/transaction to types/transaction
type Trend ¶
type Trend struct { ID int `gorm:"column:id;primary_key;"` Market string `gorm:"column:market;type:varchar(42);unique_index:market_intervals_start"` Intervals string `gorm:"column:intervals;type:varchar(42);unique_index:market_intervals_start"` Vol float64 `gorm:"column:vol;type:float"` Amount float64 `gorm:"column:amount;type:float"` CreateTime int64 `gorm:"column:create_time;type:bigint"` UpdateTime int64 `gorm:"column:update_time;type:bigint"` Open float64 `gorm:"column:open;type:float"` Close float64 `gorm:"column:close;type:float"` High float64 `gorm:"column:high;type:float"` Low float64 `gorm:"column:low;type:float"` Start int64 `gorm:"column:start;type:bigint;unique_index:market_intervals_start"` End int64 `gorm:"column:end;type:bigint"` }
order amountS 上限1e30
type WhiteList ¶
type WhiteList struct { ID int `gorm:"column:id;primary_key;"` Owner string `gorm:"column:owner;varchar(42);unique_index"` CreateTime int64 `gorm:"column:create_time"` IsDeleted bool `gorm:"column:is_deleted"` }
func (*WhiteList) ConvertDown ¶
func (w *WhiteList) ConvertDown(src *types.WhiteListUser) error