use types.Exchange

This commit is contained in:
c9s 2020-10-12 07:38:38 +08:00
parent 8f129f0e0e
commit 64c9960882
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ type Account struct {
Balances map[string]types.Balance Balances map[string]types.Balance
} }
func LoadAccount(ctx context.Context, exchange *binance.Exchange) (*Account, error) { func LoadAccount(ctx context.Context, exchange types.Exchange) (*Account, error) {
balances, err := exchange.QueryAccountBalances(ctx) balances, err := exchange.QueryAccountBalances(ctx)
return &Account{ return &Account{
Balances: balances, Balances: balances,

View File

@ -90,7 +90,7 @@ type Trader struct {
// Context is trading Context // Context is trading Context
Context *Context Context *Context
Exchange *binance.Exchange Exchange types.Exchange
reportTimer *time.Timer reportTimer *time.Timer
@ -103,7 +103,7 @@ type Trader struct {
ExchangeSessions map[string]*ExchangeSession ExchangeSessions map[string]*ExchangeSession
} }
func New(db *sqlx.DB, exchange *binance.Exchange, symbol string) *Trader { func New(db *sqlx.DB, exchange types.Exchange, symbol string) *Trader {
tradeService := &service.TradeService{DB: db} tradeService := &service.TradeService{DB: db}
return &Trader{ return &Trader{
Symbol: symbol, Symbol: symbol,