Closed KDVMan closed 2 months ago
func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) {
resp, err := t.UnderlyingTransport.RoundTrip(req)
if resp != nil && resp.Header != nil {
usedWeight, _ = strconv.Atoi(resp.Header.Get("X-Mbx-Used-Weight-1m"))
}
return resp, err
}
func NewBinance(apiKey, secretKey string) *Binance {
futures.WebsocketKeepalive = true
client := futures.NewClient(apiKey, secretKey)
c := http.Client{Transport: &transport{UnderlyingTransport: http.DefaultTransport}}
client.HTTPClient = &c
client.Debug = os.Getenv("debug") == "true"
b := Binance{
Client: client,
}```
Thanks)
Hello, please tell me how to get the limits that were spent during the request, for example NewExchangeInfoService Binance returns rateLimits in the header, so you need to get them somehow.
thank you in advance