@reyaxyz/api-sdk 0.143.1 → 0.144.0

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.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/clients/modules/isolated-order.simulation/index.js +14 -9
  3. package/dist/clients/modules/isolated-order.simulation/index.js.map +1 -1
  4. package/dist/clients/modules/isolated-order.simulation/types.js.map +1 -1
  5. package/dist/clients/modules/markets/index.js +14 -0
  6. package/dist/clients/modules/markets/index.js.map +1 -1
  7. package/dist/clients/modules/markets/types.js.map +1 -1
  8. package/dist/clients/modules/trade.simulation/index.js +21 -10
  9. package/dist/clients/modules/trade.simulation/index.js.map +1 -1
  10. package/dist/clients/modules/trade.simulation/types.js.map +1 -1
  11. package/dist/clients/modules/trade.simulation/utils.js +35 -0
  12. package/dist/clients/modules/trade.simulation/utils.js.map +1 -0
  13. package/dist/clients/socket-client.js +16 -0
  14. package/dist/clients/socket-client.js.map +1 -1
  15. package/dist/types/clients/modules/isolated-order.simulation/index.d.ts.map +1 -1
  16. package/dist/types/clients/modules/isolated-order.simulation/types.d.ts +2 -0
  17. package/dist/types/clients/modules/isolated-order.simulation/types.d.ts.map +1 -1
  18. package/dist/types/clients/modules/markets/index.d.ts +2 -1
  19. package/dist/types/clients/modules/markets/index.d.ts.map +1 -1
  20. package/dist/types/clients/modules/markets/types.d.ts +7 -0
  21. package/dist/types/clients/modules/markets/types.d.ts.map +1 -1
  22. package/dist/types/clients/modules/trade.simulation/index.d.ts.map +1 -1
  23. package/dist/types/clients/modules/trade.simulation/types.d.ts +9 -0
  24. package/dist/types/clients/modules/trade.simulation/types.d.ts.map +1 -1
  25. package/dist/types/clients/modules/trade.simulation/utils.d.ts +8 -0
  26. package/dist/types/clients/modules/trade.simulation/utils.d.ts.map +1 -0
  27. package/dist/types/clients/socket-client.d.ts +4 -1
  28. package/dist/types/clients/socket-client.d.ts.map +1 -1
  29. package/package.json +3 -3
  30. package/src/clients/modules/isolated-order.simulation/index.ts +19 -25
  31. package/src/clients/modules/isolated-order.simulation/types.ts +2 -0
  32. package/src/clients/modules/markets/index.ts +13 -0
  33. package/src/clients/modules/markets/types.ts +8 -0
  34. package/src/clients/modules/trade.simulation/index.ts +26 -30
  35. package/src/clients/modules/trade.simulation/types.ts +12 -2
  36. package/src/clients/modules/trade.simulation/utils.ts +52 -0
  37. package/src/clients/socket-client.ts +24 -0
@@ -20,6 +20,7 @@ export enum SocketChannels {
20
20
  PRICES = 'prices',
21
21
  FUNDING_RATES = 'funding-rates',
22
22
  MARKETS_UPDATES = 'markets-updates',
23
+ SPOT_CANDLES = 'spot-candles',
23
24
  }
24
25
 
25
26
  export enum IncomingMessageTypes {
@@ -260,6 +261,18 @@ export class SocketClient {
260
261
  this.subscribe(channel, params);
261
262
  }
262
263
 
264
+ subscribeToSpotCandles(
265
+ marketTicker: string,
266
+ resolution: CandlesResolution,
267
+ ): void {
268
+ const channel = SocketChannels.SPOT_CANDLES;
269
+ const params = {
270
+ id: `${marketTicker}/${resolution}`,
271
+ batched: true,
272
+ };
273
+ this.subscribe(channel, params);
274
+ }
275
+
263
276
  /**
264
277
  * @description Unsubscribe from candles channel
265
278
  * for a specific market and resolution.
@@ -272,6 +285,17 @@ export class SocketClient {
272
285
  this.unsubscribe(channel, params);
273
286
  }
274
287
 
288
+ unsubscribeFromSpotCandles(
289
+ market: string,
290
+ resolution: CandlesResolution,
291
+ ): void {
292
+ const channel = SocketChannels.SPOT_CANDLES;
293
+ const params = {
294
+ id: `${market}/${resolution}`,
295
+ };
296
+ this.unsubscribe(channel, params);
297
+ }
298
+
275
299
  /**
276
300
  * @description Subscribe to prices channel
277
301
  * for a specific assets pair.