From c1af97dd4a8a73421d3198e76ca4c0580c7383c0 Mon Sep 17 00:00:00 2001 From: Jkorf Date: Fri, 21 Aug 2026 10:21:54 +0200 Subject: [PATCH] Updated to version 12.5.0 --- .cursor/rules/cryptoexchange-net.mdc | 6 ++++- .github/copilot-instructions.md | 6 ++++- AGENTS.md | 5 +++++ CryptoExchange.Net/CryptoExchange.Net.csproj | 6 ++--- README.md | 23 ++++++++++++++++++++ llms.txt | 4 +++- 6 files changed, 44 insertions(+), 6 deletions(-) diff --git a/.cursor/rules/cryptoexchange-net.mdc b/.cursor/rules/cryptoexchange-net.mdc index b7e30c0c..21ed33eb 100644 --- a/.cursor/rules/cryptoexchange-net.mdc +++ b/.cursor/rules/cryptoexchange-net.mdc @@ -42,6 +42,10 @@ When implementing an exchange library, use `LibraryHelpers.IsStableCoin`, `IsCom In 12.4.0, use `SharedOrderQuantity`-valued `Volumes` on shared spot/futures tickers and klines, and `Quantities` on shared trades. The scalar `Volume`, `QuoteVolume`, and `Quantity` members are obsolete. +## WebSocket order commands + +In 12.5.0, `ISpotOrderManagementSocketClient` and `IFuturesOrderManagementSocketClient` optionally provide place/cancel order commands over WebSocket. Their methods return `QueryResult`, not `WebSocketResult`. Check whether the exchange implements the interface. + ## Result pattern REST methods return `HttpResult` and websocket subscription methods return `WebSocketResult`. Always check `.Success`. `.Exchange` property identifies which exchange responded — useful for logging. @@ -49,7 +53,7 @@ REST methods return `HttpResult` and websocket subscription methods return `W ## Available shared interfaces - REST tickers/symbols/orderbook/klines/trades, orders (spot/futures, regular/trigger/TP-SL), balances, positions, fees, deposits/withdrawals, transfers -- WebSocket tickers, book tickers, order book, trades, klines, user data +- WebSocket tickers, book tickers, order book, trades, klines, user data, and optional spot/futures order management Each exchange documents which it implements. Not every exchange supports every operation. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index e88f11a9..865eb987 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -34,6 +34,10 @@ CryptoExchange.Net 12.2.0 classifies the base and quote sides of `SharedSpotSymb CryptoExchange.Net 12.4.0 uses `SharedOrderQuantity` for market-data quantities. Prefer `Volumes` on `SharedSpotTicker`, `SharedFuturesTicker`, and `SharedKline`, and `Quantities` on `SharedTrade`; the scalar `Volume`, `QuoteVolume`, and `Quantity` members are obsolete. +## WebSocket order commands + +CryptoExchange.Net 12.5.0 adds optional `ISpotOrderManagementSocketClient` and `IFuturesOrderManagementSocketClient` interfaces for placing and canceling orders over WebSocket. These command methods return `QueryResult` rather than a subscription result. Check exchange support before relying on either interface. + ## Single-exchange code uses the exchange's own client For Binance-only code, use `BinanceRestClient` directly (see Binance.Net repo `AGENTS.md`). SharedApis is for portability — use it when you need that. @@ -45,7 +49,7 @@ REST methods return `HttpResult` and websocket subscription methods return `W ## Available shared interfaces REST: tickers, symbols, orderbook, klines, trades, orders (spot/futures, trigger, TP-SL), balances, positions, fees, deposits/withdrawals, transfers. -WebSocket: tickers, book tickers, orderbook, trades, klines, user data. +WebSocket: tickers, book tickers, orderbook, trades, klines, user data, and optional spot/futures order management. Each exchange library implements a subset. Check exchange docs for support matrix. diff --git a/AGENTS.md b/AGENTS.md index 75617917..97f49b78 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -89,6 +89,10 @@ For exchange-library implementations, `LibraryHelpers.IsStableCoin`, `IsCommodit Since CryptoExchange.Net 12.4.0, shared market-data models use `SharedOrderQuantity` so base-asset, quote-asset, and contract quantities remain explicit. Read `SharedSpotTicker.Volumes`, `SharedFuturesTicker.Volumes`, and `SharedKline.Volumes`; read `SharedTrade.Quantities`. The former scalar `Volume`, `QuoteVolume`, and `Quantity` members are obsolete. +## WebSocket Order Management + +Since CryptoExchange.Net 12.5.0, exchanges can implement `ISpotOrderManagementSocketClient` and `IFuturesOrderManagementSocketClient` to place and cancel orders over WebSocket. These are command interfaces, not subscription interfaces: `Place*OrderAsync` and `Cancel*OrderAsync` return `QueryResult`. Check exchange support before using them. + ## Available Shared Interfaces **REST:** @@ -102,6 +106,7 @@ Since CryptoExchange.Net 12.4.0, shared market-data models use `SharedOrderQuant - `ITickerSocketClient`, `IBookTickerSocketClient` - `IOrderBookSocketClient`, `ITradeSocketClient`, `IKlineSocketClient` - `IUserTradeSocketClient`, `ISpotOrderSocketClient`, `IFuturesOrderSocketClient`, `IPositionSocketClient`, `IBalanceSocketClient` +- Order commands: `ISpotOrderManagementSocketClient`, `IFuturesOrderManagementSocketClient` Each exchange documents which interfaces it implements (some exchanges don't support every operation). diff --git a/CryptoExchange.Net/CryptoExchange.Net.csproj b/CryptoExchange.Net/CryptoExchange.Net.csproj index deccea23..74ec33f4 100644 --- a/CryptoExchange.Net/CryptoExchange.Net.csproj +++ b/CryptoExchange.Net/CryptoExchange.Net.csproj @@ -6,9 +6,9 @@ CryptoExchange.Net JKorf CryptoExchange.Net is a base library which is used to implement different cryptocurrency (exchange) API's. It provides a standardized way of implementing different API's, which results in a very similar experience for users of the API implementations. - 12.4.0 - 12.4.0 - 12.4.0 + 12.5.0 + 12.5.0 + 12.5.0 false OKX;OKX.Net;Mexc;Mexc.Net;Kucoin;Kucoin.Net;Kraken;Kraken.Net;Huobi;Huobi.Net;CoinEx;CoinEx.Net;Bybit;Bybit.Net;Bitget;Bitget.Net;Bitfinex;Bitfinex.Net;Binance;Binance.Net;CryptoCurrency;CryptoCurrency Exchange;CryptoExchange.Net git diff --git a/README.md b/README.md index 33035ec3..73017f19 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,29 @@ Various: * PlatformInfo now required support environment names in the constructor ## Release notes +* Version 12.5.0 - 21 Aug 2026 + * Shared APIs + * Added ISpotOrderManagementSocketClient for placing/canceling Spot orders via Shared websocket implementation + * Added IFuturesOrderManagementSocketClient for placing/canceling Futures orders via Shared websocket implementation + * Added UpperFundingCap, LowerFundingCap to SharedFuturesSymbol model + * Added UpperPriceLimitPerecentage, LowerPriceLimitPercentage, MakerFeePercentage and TakerFeePercentage to SharedSpotSymbol model + * Added WithCalculatedQuantities(price, contractSize) to SharedQuantity to retrieve a copy with derived quantities + * Added Description property to Shared EndpointOptions classes + * Added additional check for symbol type to Shared Spot endpoints + * Added QuantityType property to SharedOrderBook + * Added auto calculated quote quantity where for SharedOrderQuantity where it makes sense + * Updated SharedId value to be nullable + * Updated quantity/volumes to SharedOrderQuantity model for SharedBookTicker, SharedOpenInterest, SharedPosition, SharedPositionHistory and SharedUserTrade + * Updated Shared client info string representation + * Added IQueryResult interface to QueryResult, moved OriginalData to the base class + * Added UsePublicConnectionForAuth property to SocketApiClient + * Added support for order polling where Shared order implementation doesn't support time filtering to UserDataTracker implementations + * Added ManualUpdateSubscription and UpdateSubscription additional constructor to allow producing websocket events without actual connection + * Updated logging unhandled websocket message + * Split UserClientProvider into base class with RestClient and derived class also containing SocketClient + * Removed unnecessary log from token manager + * Fixed incorrect check test output + * Version 12.4.0 - 28 Jul 2026 * Added AveragePrice property to SharedQuantity model * Added DebuggerDisplay attributes to Result objects diff --git a/llms.txt b/llms.txt index 92762378..ebdb6d4a 100644 --- a/llms.txt +++ b/llms.txt @@ -2,7 +2,7 @@ > Base C#/.NET library for cryptocurrency exchange API client implementations. Provides a standardized abstraction (REST, WebSocket, authentication, rate limiting, error handling, order book management, shared cross-exchange interfaces) that 28+ exchange-specific libraries are built on top of. -CryptoExchange.Net itself is not used directly — install one of the exchange-specific libraries (Binance.Net, Bybit.Net, OKX.Net, Kraken.Net, Coinbase.Net, etc.) or `CryptoClients.Net` to access all exchanges via a single bundle. The base library is what makes the entire ecosystem feel consistent: same `HttpResult` REST result pattern, same `WebSocketResult` websocket subscription pattern, same DI registration, same shared interfaces across all exchanges. Current version: 12.4.0. Targets netstandard2.0, netstandard2.1, net8.0, net9.0, net10.0. Native AOT supported. +CryptoExchange.Net itself is not used directly — install one of the exchange-specific libraries (Binance.Net, Bybit.Net, OKX.Net, Kraken.Net, Coinbase.Net, etc.) or `CryptoClients.Net` to access all exchanges via a single bundle. The base library is what makes the entire ecosystem feel consistent: same `HttpResult` REST result pattern, same `WebSocketResult` websocket subscription pattern, same DI registration, same shared interfaces across all exchanges. Current version: 12.5.0. Targets netstandard2.0, netstandard2.1, net8.0, net9.0, net10.0. Native AOT supported. The standout feature for cross-exchange code is `CryptoExchange.Net.SharedApis` — a set of interfaces (`ISpotTickerRestClient`, `ISpotOrderRestClient`, `IBalanceRestClient`, etc.) implemented by every exchange library. Same call signature works against any exchange. @@ -10,6 +10,8 @@ Version 12.2.0 adds typed asset metadata to shared symbol discovery. `SharedSpot Version 12.4.0 represents market-data quantities with `SharedOrderQuantity`: use `Volumes` on `SharedSpotTicker`, `SharedFuturesTicker`, and `SharedKline`, and `Quantities` on `SharedTrade`. The old scalar `Volume`, `QuoteVolume`, and `Quantity` members are obsolete. Exchange-library implementations must pass `SharedOrderQuantity` to these model constructors. +Version 12.5.0 adds optional shared WebSocket order commands through `ISpotOrderManagementSocketClient` and `IFuturesOrderManagementSocketClient`. Their place/cancel methods return `QueryResult`; they are commands rather than update subscriptions, and support is exchange-specific. + ## Documentation - [README](https://github.com/JKorf/CryptoExchange.Net/blob/master/README.md): Overview, full ecosystem table (28+ exchange libraries), installation per exchange, complete release notes