Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReserveCore ¶
type ReserveCore interface { // place order Trade( exchange common.Exchange, tradeType string, base common.Token, quote common.Token, rate float64, amount float64, timestamp uint64) (id common.ActivityID, done float64, remaining float64, finished bool, err error) Deposit( exchange common.Exchange, token common.Token, amount *big.Int, timestamp uint64) (common.ActivityID, error) Withdraw( exchange common.Exchange, token common.Token, amount *big.Int, timestamp uint64) (common.ActivityID, error) CancelOrder(id common.ActivityID, exchange common.Exchange) error // blockchain related action SetRates(sources []common.Token, dests []common.Token, rates []*big.Int, expiryBlocks []*big.Int) (common.ActivityID, error) }
type ReserveData ¶
type ReserveData interface { CurrentPriceVersion(timestamp uint64) (common.Version, error) GetAllPrices(timestamp uint64) (common.AllPriceResponse, error) GetOnePrice(id common.TokenPairID, timestamp uint64) (common.OnePriceResponse, error) CurrentBalanceVersion(timestamp uint64) (common.Version, error) GetAllBalances(timestamp uint64) (common.AllBalanceResponse, error) CurrentEBalanceVersion(timestamp uint64) (common.Version, error) GetAllEBalances(timestamp uint64) (common.AllEBalanceResponse, error) CurrentRateVersion(timestamp uint64) (common.Version, error) GetAllRates(timestamp uint64) (common.AllRateResponse, error) GetRecords() ([]common.ActivityRecord, error) GetPendingActivities() ([]common.ActivityRecord, error) Run() error Stop() error }
all of the functions must support concurrency
type TestReserveData ¶
type TestReserveData struct { }
func NewTestReserveData ¶
func NewTestReserveData() *TestReserveData
func (TestReserveData) CurrentPriceVersion ¶
func (self TestReserveData) CurrentPriceVersion() common.Version
func (TestReserveData) GetAllPrices ¶
func (self TestReserveData) GetAllPrices() (common.AllPriceResponse, error)
func (TestReserveData) GetOnePrice ¶
func (self TestReserveData) GetOnePrice(common.TokenPairID) (common.OnePriceResponse, error)
func (TestReserveData) Run ¶
func (self TestReserveData) Run() error
Click to show internal directories.
Click to hide internal directories.