Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/babel_binance_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class Binance {
spot.market.dispose();
futuresUsd.dispose();
margin.dispose();
testnetSpot.dispose();
testnetFutures.dispose();
// Note: TestnetSpot and TestnetFuturesUsd don't have dispose methods
// as they are composed of sub-classes that handle their own cleanup
}
}

Expand Down
1 change: 0 additions & 1 deletion lib/src/binance_base.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:convert';
import 'dart:io';
import 'dart:async';
import 'package:http/http.dart' as http;
import 'package:crypto/crypto.dart';
Expand Down
2 changes: 0 additions & 2 deletions lib/src/rate_limiting/rate_limiter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class RateLimiter {

// Order count tracking
int _orderCountToday = 0;
DateTime _orderCountResetTime = DateTime.now();

RateLimiter({
RateLimitConfig? config,
Expand Down Expand Up @@ -126,7 +125,6 @@ class RateLimiter {
/// Reset daily order count
void _resetDailyOrderCount() {
_orderCountToday = 0;
_orderCountResetTime = DateTime.now();
}

/// Get current rate limit status
Expand Down
8 changes: 0 additions & 8 deletions lib/src/rate_limiting/token_bucket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,3 @@ class TokenBucket {
_lastRefill = DateTime.now();
}
}

extension on double {
double clamp(num min, num max) {
if (this < min) return min.toDouble();
if (this > max) return max.toDouble();
return this;
}
}
3 changes: 3 additions & 0 deletions lib/src/websocket/websocket_stream.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class BinanceWebSocketStream {
return DateTime.now().difference(_connectedAt!);
}

/// Last time a pong was received (for connection health monitoring)
DateTime? get lastPongTime => _lastPongReceived;

/// Connect to WebSocket
Future<void> connect() async {
if (_isDisposed) throw StateError('Stream is disposed');
Expand Down