Documentation
¶
Index ¶
- func DataToAddress(data string) string
- func Start(cfxURL string, matchURL string, assets []common.Asset, ...)
- type Account
- type BalanceChange
- type DataManager
- func (m *DataManager) CleanCache()
- func (m *DataManager) GetCurrencyName(id uint64) string
- func (m *DataManager) GetDeposits(fromEpoch, toEpoch *big.Int, client *conflux.Client) []*Deposit
- func (m *DataManager) GetOrder(id uint64) *Order
- func (m *DataManager) GetProduct(id uint64) *Product
- func (m *DataManager) GetTrades(fromNonce *big.Int, toNonce *big.Int) []*Trade
- func (m *DataManager) GetTransfers(fromNonce, toNonce *big.Int) []*Transfer
- func (m *DataManager) GetWithdraws(fromNonce *big.Int, toNonce *big.Int) []*Withdraw
- func (m *DataManager) MustGetAccountID(userName string, currency string) uint64
- func (m *DataManager) MustGetAccountIDByUserID(userID uint64, currency string) uint64
- func (m *DataManager) MustGetUserByName(name string) *User
- type Deposit
- type Order
- type Product
- type Trade
- type TradeDetail
- type Transfer
- type User
- type Withdraw
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataToAddress ¶
DataToAddress convert a hex string returned in topics of log to conflux address
Types ¶
type BalanceChange ¶
type BalanceChange struct {
// contains filtered or unexported fields
}
BalanceChange user with `accountID` has `amount` change of balance
type DataManager ¶
type DataManager struct {
// contains filtered or unexported fields
}
DataManager access matchflow database
func NewDataManager ¶
func NewDataManager(dexDbUser, dbAddress, dbPass string, dexStartTime string) *DataManager
NewDataManager create new datamanager instance
func (*DataManager) CleanCache ¶
func (m *DataManager) CleanCache()
CleanCache clean the cache map if it size exceeds a constant
func (*DataManager) GetCurrencyName ¶
func (m *DataManager) GetCurrencyName(id uint64) string
GetCurrencyName get currency name by currency id
func (*DataManager) GetDeposits ¶
GetDeposits get deposit records between fromEpoch and toEpoch
func (*DataManager) GetOrder ¶
func (m *DataManager) GetOrder(id uint64) *Order
GetOrder get order by id
func (*DataManager) GetProduct ¶
func (m *DataManager) GetProduct(id uint64) *Product
GetProduct get product by id
func (*DataManager) GetTransfers ¶
func (m *DataManager) GetTransfers(fromNonce, toNonce *big.Int) []*Transfer
GetTransfers get transfer records between fromNonce and toNonce
func (*DataManager) GetWithdraws ¶
GetWithdraws get withdraw record with tx_nonce between fromNonce and toNonce
func (*DataManager) MustGetAccountID ¶
func (m *DataManager) MustGetAccountID(userName string, currency string) uint64
MustGetAccountID get user account id of specific currency by conflux address
func (*DataManager) MustGetAccountIDByUserID ¶
func (m *DataManager) MustGetAccountIDByUserID(userID uint64, currency string) uint64
MustGetAccountIDByUserID get user account id of specific currency by user id
func (*DataManager) MustGetUserByName ¶
func (m *DataManager) MustGetUserByName(name string) *User
MustGetUserByName get user by conflux address
type Deposit ¶
type Deposit struct {
// contains filtered or unexported fields
}
Deposit struct for t_deposit table
type Order ¶
type Order struct {
// contains filtered or unexported fields
}
Order struct for t_order table
type Product ¶
type Product struct {
// contains filtered or unexported fields
}
Product struct for t_product table
type Trade ¶
type Trade struct {
// contains filtered or unexported fields
}
Trade struct for t_trade table
type TradeDetail ¶
type TradeDetail struct {
// contains filtered or unexported fields
}
TradeDetail struct for transaction replay
type Transfer ¶
type Transfer struct {
// contains filtered or unexported fields
}
Transfer struct for t_transfer table
type User ¶
type User struct {
// contains filtered or unexported fields
}
User struct for t_user table
type Withdraw ¶
type Withdraw struct {
// contains filtered or unexported fields
}
Withdraw struct for t_withdraw table
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker auditor
func NewWorker ¶
func NewWorker(matchflowClient *common.Client, cfxClient *conflux.Client, assetsMap map[string]*common.Contract, config *common.MatchflowConfig) *Worker
NewWorker create a new worker
func (*Worker) Start ¶
func (w *Worker) Start(config *common.MatchflowConfig)
Start audit dex users' balance periodically