@binance/derivatives-trading-options 12.0.0 → 13.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -143,6 +143,21 @@ The REST API provides detailed error types to help you handle issues effectively
143
143
 
144
144
  See the [Error Handling example](./docs/rest-api/error-handling.md) for detailed usage.
145
145
 
146
+ #### Testnet
147
+
148
+ For testing purposes, `/eapi/*` endpoints can be used in the [Futures Testnet](https://testnet.binancefuture.com/). Update the `basePath` in your configuration:
149
+
150
+ ```typescript
151
+ import { DerivativesTradingOptions, DERIVATIVES_TRADING_OPTIONS_REST_API_TESTNET_URL } from '@binance/derivatives-trading-options';
152
+
153
+ const configurationRestAPI = {
154
+ apiKey: 'your-api-key',
155
+ apiSecret: 'your-api-secret',
156
+ basePath: DERIVATIVES_TRADING_OPTIONS_REST_API_TESTNET_URL,
157
+ };
158
+ const client = new DerivativesTradingOptions({ configurationRestAPI });
159
+ ```
160
+
146
161
  If `basePath` is not provided, it defaults to `https://eapi.binance.com`.
147
162
 
148
163
  ### Websocket Streams
@@ -260,6 +275,19 @@ client.websocketStreams
260
275
  .catch((err) => console.error(err));
261
276
  ```
262
277
 
278
+ #### Testnet
279
+
280
+ Websocket Streams also support a testnet environment for development and testing. Update the `wsURL` in your configuration:
281
+
282
+ ```typescript
283
+ import { DerivativesTradingOptions, DERIVATIVES_TRADING_OPTIONS_WS_STREAMS_TESTNET_URL } from '@binance/derivatives-trading-options';
284
+
285
+ const configurationWebsocketStreams = {
286
+ wsURL: DERIVATIVES_TRADING_OPTIONS_WS_STREAMS_TESTNET_URL,
287
+ };
288
+ const client = new DerivativesTradingOptions({ configurationWebsocketStreams });
289
+ ```
290
+
263
291
  If `wsURL` is not provided, it defaults to `wss://nbstream.binance.com/eoptions`.
264
292
 
265
293
  ### Automatic Connection Renewal