matchflow

package
v0.0.0-...-f9b7526 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataToAddress

func DataToAddress(data string) string

DataToAddress convert a hex string returned in topics of log to conflux address

func Start

func Start(cfxURL string, matchURL string, assets []common.Asset, config *common.MatchflowConfig)

Start bootstraps auditor workers for MatchFlow

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

Account balance

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

func (m *DataManager) GetDeposits(fromEpoch, toEpoch *big.Int, client *conflux.Client) []*Deposit

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) GetTrades

func (m *DataManager) GetTrades(fromNonce *big.Int, toNonce *big.Int) []*Trade

GetTrades get trade with tx_nonce between fromNonce and toNonce

func (*DataManager) GetTransfers

func (m *DataManager) GetTransfers(fromNonce, toNonce *big.Int) []*Transfer

GetTransfers get transfer records between fromNonce and toNonce

func (*DataManager) GetWithdraws

func (m *DataManager) GetWithdraws(fromNonce *big.Int, toNonce *big.Int) []*Withdraw

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

Jump to

Keyboard shortcuts

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