mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
split exchange interface into ExchangeMarketDataService, ExchangeTradingService
This commit is contained in:
parent
c788601856
commit
b7da47411e
|
@ -61,20 +61,17 @@ type Exchange interface {
|
|||
|
||||
PlatformFeeCurrency() string
|
||||
|
||||
NewStream() Stream
|
||||
// required implementation
|
||||
ExchangeMarketDataService
|
||||
|
||||
QueryMarkets(ctx context.Context) (MarketMap, error)
|
||||
ExchangeTradingService
|
||||
}
|
||||
|
||||
type ExchangeTradingService interface {
|
||||
QueryAccount(ctx context.Context) (*Account, error)
|
||||
|
||||
QueryAccountBalances(ctx context.Context) (BalanceMap, error)
|
||||
|
||||
QueryTicker(ctx context.Context, symbol string) (*Ticker, error)
|
||||
|
||||
QueryTickers(ctx context.Context, symbol ...string) (map[string]Ticker, error)
|
||||
|
||||
QueryKLines(ctx context.Context, symbol string, interval Interval, options KLineQueryOptions) ([]KLine, error)
|
||||
|
||||
QueryTrades(ctx context.Context, symbol string, options *TradeQueryOptions) ([]Trade, error)
|
||||
|
||||
SubmitOrders(ctx context.Context, orders ...SubmitOrder) (createdOrders OrderSlice, err error)
|
||||
|
@ -86,6 +83,18 @@ type Exchange interface {
|
|||
CancelOrders(ctx context.Context, orders ...Order) error
|
||||
}
|
||||
|
||||
type ExchangeMarketDataService interface {
|
||||
NewStream() Stream
|
||||
|
||||
QueryMarkets(ctx context.Context) (MarketMap, error)
|
||||
|
||||
QueryTicker(ctx context.Context, symbol string) (*Ticker, error)
|
||||
|
||||
QueryTickers(ctx context.Context, symbol ...string) (map[string]Ticker, error)
|
||||
|
||||
QueryKLines(ctx context.Context, symbol string, interval Interval, options KLineQueryOptions) ([]KLine, error)
|
||||
}
|
||||
|
||||
type ExchangeTransferService interface {
|
||||
QueryDepositHistory(ctx context.Context, asset string, since, until time.Time) (allDeposits []Deposit, err error)
|
||||
QueryWithdrawHistory(ctx context.Context, asset string, since, until time.Time) (allWithdraws []Withdraw, err error)
|
||||
|
|
Loading…
Reference in New Issue
Block a user