Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockchain ¶
type ConcurrentAllPriceData ¶
type ConcurrentAllPriceData struct {
// contains filtered or unexported fields
}
func NewConcurrentAllPriceData ¶
func NewConcurrentAllPriceData() *ConcurrentAllPriceData
func (*ConcurrentAllPriceData) GetData ¶
func (self *ConcurrentAllPriceData) GetData() map[common.TokenPairID]common.OnePrice
func (*ConcurrentAllPriceData) SetOnePrice ¶
func (self *ConcurrentAllPriceData) SetOnePrice( exchange common.ExchangeID, pair common.TokenPairID, d common.ExchangePrice)
type Exchange ¶
type Exchange interface { ID() common.ExchangeID Name() string TokenPairs() []common.TokenPair FetchPriceData(timepoint uint64) (map[common.TokenPairID]common.ExchangePrice, error) FetchEBalanceData(timepoint uint64) (common.EBalanceEntry, error) FetchOrderData(timepoint uint64) (common.OrderEntry, error) OrderStatus(id common.ActivityID, timepoint uint64) (string, error) DepositStatus(id common.ActivityID, timepoint uint64) (string, error) WithdrawStatus(id common.ActivityID, timepoint uint64) (string, error) }
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
func NewFetcher ¶
func NewFetcher( storage Storage, runner FetcherRunner, address ethereum.Address) *Fetcher
func (*Fetcher) AddExchange ¶
func (*Fetcher) SetBlockchain ¶
func (self *Fetcher) SetBlockchain(blockchain Blockchain)
type FetcherRunner ¶
type FetcherRunner interface { GetExchangeTicker() <-chan time.Time GetBlockchainTicker() <-chan time.Time // Start must be non-blocking and must only return after runner // gets to ready state before GetExchangeTicker() and // GetBlockchainTicker() get called Start() error // Stop should only be invoked when the runner is already running Stop() error }
Runner to trigger fetcher
type Storage ¶
type Storage interface { StorePrice(data map[common.TokenPairID]common.OnePrice, timepoint uint64) error StoreBalance(data map[string]common.BalanceEntry, timepoint uint64) error StoreEBalance(data map[common.ExchangeID]common.EBalanceEntry, timepoint uint64) error StoreRate(data common.AllRateEntry, timepoint uint64) error GetPendingActivities() ([]common.ActivityRecord, error) UpdateActivityStatus(action string, id common.ActivityID, destination string, status string) error }
type TickerRunner ¶
type TickerRunner struct {
// contains filtered or unexported fields
}
func NewTickerRunner ¶
func NewTickerRunner(eduration, bduration time.Duration) *TickerRunner
func (*TickerRunner) GetBlockchainTicker ¶
func (self *TickerRunner) GetBlockchainTicker() <-chan time.Time
func (*TickerRunner) GetExchangeTicker ¶
func (self *TickerRunner) GetExchangeTicker() <-chan time.Time
func (*TickerRunner) Start ¶
func (self *TickerRunner) Start() error
func (*TickerRunner) Stop ¶
func (self *TickerRunner) Stop() error
type TimestampRunner ¶
type TimestampRunner struct {
// contains filtered or unexported fields
}
func NewTimestampRunner ¶
func NewTimestampRunner(timestamps []uint64, bduration time.Duration) *TimestampRunner
func (*TimestampRunner) GetBlockchainTicker ¶
func (self *TimestampRunner) GetBlockchainTicker() <-chan time.Time
func (*TimestampRunner) GetExchangeTicker ¶
func (self *TimestampRunner) GetExchangeTicker() <-chan time.Time
func (*TimestampRunner) Start ¶
func (self *TimestampRunner) Start() error
func (*TimestampRunner) Stop ¶
func (self *TimestampRunner) Stop() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.