binance: initialize the new futures client

This commit is contained in:
c9s 2023-03-26 00:19:31 +08:00
parent fc3e59b3ef
commit 8ddf248d50
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -88,6 +88,8 @@ type Exchange struct {
// client2 is a newer version of the binance api client implemented by ourselves.
client2 *binanceapi.RestClient
futuresClient2 *binanceapi.FuturesRestClient
}
var timeSetterOnce sync.Once
@ -111,13 +113,15 @@ func New(key, secret string) *Exchange {
}
client2 := binanceapi.NewClient(client.BaseURL)
futuresClient2 := binanceapi.NewFuturesRestClient(futuresClient.BaseURL)
ex := &Exchange{
key: key,
secret: secret,
client: client,
futuresClient: futuresClient,
client2: client2,
key: key,
secret: secret,
client: client,
futuresClient: futuresClient,
client2: client2,
futuresClient2: futuresClient2,
}
if len(key) > 0 && len(secret) > 0 {