@reyaxyz/api-v2-sdk 0.301.3 → 0.301.4

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 (35) hide show
  1. package/dist/rest/apis/MarketDataApi.js +1 -1
  2. package/dist/rest/apis/MarketDataApi.js.map +1 -1
  3. package/dist/rest/apis/OrderEntryApi.js +1 -1
  4. package/dist/rest/apis/OrderEntryApi.js.map +1 -1
  5. package/dist/rest/apis/ReferenceDataApi.js +1 -1
  6. package/dist/rest/apis/ReferenceDataApi.js.map +1 -1
  7. package/dist/rest/apis/SpecsApi.js +1 -1
  8. package/dist/rest/apis/SpecsApi.js.map +1 -1
  9. package/dist/rest/apis/WalletDataApi.js +1 -1
  10. package/dist/rest/apis/WalletDataApi.js.map +1 -1
  11. package/dist/rest/models/index.js +5 -152
  12. package/dist/rest/models/index.js.map +1 -1
  13. package/dist/rest/runtime.js +1 -1
  14. package/dist/rest/runtime.js.map +1 -1
  15. package/dist/types/rest/apis/MarketDataApi.d.ts +1 -1
  16. package/dist/types/rest/apis/OrderEntryApi.d.ts +1 -1
  17. package/dist/types/rest/apis/ReferenceDataApi.d.ts +1 -1
  18. package/dist/types/rest/apis/SpecsApi.d.ts +1 -1
  19. package/dist/types/rest/apis/WalletDataApi.d.ts +1 -1
  20. package/dist/types/rest/models/index.d.ts +128 -397
  21. package/dist/types/rest/models/index.d.ts.map +1 -1
  22. package/dist/types/rest/runtime.d.ts +1 -1
  23. package/dist/types/websocket/types.d.ts +53 -51
  24. package/dist/types/websocket/types.d.ts.map +1 -1
  25. package/dist/websocket/types.js +4 -47
  26. package/dist/websocket/types.js.map +1 -1
  27. package/package.json +2 -2
  28. package/rest/apis/MarketDataApi.ts +1 -1
  29. package/rest/apis/OrderEntryApi.ts +1 -1
  30. package/rest/apis/ReferenceDataApi.ts +1 -1
  31. package/rest/apis/SpecsApi.ts +1 -1
  32. package/rest/apis/WalletDataApi.ts +1 -1
  33. package/rest/models/index.ts +128 -439
  34. package/rest/runtime.ts +1 -1
  35. package/websocket/types.ts +63 -77
package/rest/runtime.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Reya DEX Trading API v2
5
5
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
6
  *
7
- * The version of the OpenAPI document: 2.0.3
7
+ * The version of the OpenAPI document: 2.0.4
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1,36 +1,38 @@
1
1
  /**
2
2
  * WebSocket Types for Reya DEX Trading API v2
3
3
  *
4
- * Generated from AsyncAPI specification using AsyncAPI Modelina.
4
+ * Generated from AsyncAPI specification using AsyncAPI CLI + Modelina.
5
5
  * These types can be used to implement WebSocket clients.
6
6
  *
7
7
  * AsyncAPI Spec: specs/asyncapi-trading-v2.yaml
8
- * Generated: $(date)
9
8
  */
10
9
 
11
10
  // WebSocket connection servers
12
11
  export const WebSocketServers = {
13
12
  production: 'wss://ws.reya.xyz',
14
- staging: 'wss://ws-staging.reya.xyz'
13
+ staging: 'wss://ws-staging.reya.xyz',
14
+ test: 'wss://websocket-testnet.reya.xyz'
15
15
  } as const;
16
16
 
17
- // Generated types from AsyncAPI spec
17
+ export type ChannelDataMessageType = "channel_data";
18
18
 
19
- export enum ExecutionType {
20
- ORDER_MATCH = "ORDER_MATCH",
21
- LIQUIDATION = "LIQUIDATION",
22
- ADL = "ADL",
19
+ export interface ErrorMessagePayload {
20
+ type: ErrorMessageType;
21
+ message: string;
22
+ channel?: string;
23
23
  }
24
24
 
25
+ export type ErrorMessageType = "error";
26
+
27
+ export type ExecutionType = "ORDER_MATCH" | "LIQUIDATION" | "ADL";
28
+
25
29
  export interface MarketPerpExecutionUpdatePayload {
26
- type: 'channel_data';
30
+ type: ChannelDataMessageType;
27
31
  timestamp: number;
28
32
  channel: string;
29
33
  data: PerpExecution[];
30
- additionalProperties?: Map<string, any>;
31
34
  }
32
35
 
33
-
34
36
  export interface MarketSummary {
35
37
  symbol: string;
36
38
  updatedAt: number;
@@ -50,19 +52,19 @@ export interface MarketSummary {
50
52
  }
51
53
 
52
54
  export interface MarketSummaryUpdatePayload {
53
- type: 'channel_data';
55
+ type: ChannelDataMessageType;
54
56
  timestamp: number;
55
57
  channel: string;
56
58
  data: MarketSummary;
57
- additionalProperties?: Map<string, any>;
58
59
  }
59
60
 
61
+ export type MarketsSummaryChannel = "/v2/markets/summary";
62
+
60
63
  export interface MarketsSummaryUpdatePayload {
61
- type: 'channel_data';
64
+ type: ChannelDataMessageType;
62
65
  timestamp: number;
63
- channel: '/v2/markets/summary';
66
+ channel: MarketsSummaryChannel;
64
67
  data: MarketSummary[];
65
- additionalProperties?: Map<string, any>;
66
68
  }
67
69
 
68
70
  export interface Order {
@@ -85,27 +87,15 @@ export interface Order {
85
87
  }
86
88
 
87
89
  export interface OrderChangeUpdatePayload {
88
- type: 'channel_data';
90
+ type: ChannelDataMessageType;
89
91
  timestamp: number;
90
92
  channel: string;
91
93
  data: Order[];
92
- additionalProperties?: Map<string, any>;
93
- }
94
-
95
-
96
- export enum OrderStatus {
97
- OPEN = "OPEN",
98
- FILLED = "FILLED",
99
- CANCELLED = "CANCELLED",
100
- REJECTED = "REJECTED",
101
94
  }
102
95
 
96
+ export type OrderStatus = "OPEN" | "FILLED" | "CANCELLED" | "REJECTED";
103
97
 
104
- export enum OrderType {
105
- LIMIT = "LIMIT",
106
- TP = "TP",
107
- SL = "SL",
108
- }
98
+ export type OrderType = "LIMIT" | "TP" | "SL";
109
99
 
110
100
  export interface PerpExecution {
111
101
  exchangeId: number;
@@ -121,18 +111,20 @@ export interface PerpExecution {
121
111
  additionalProperties?: Map<string, any>;
122
112
  }
123
113
 
124
-
125
- export interface PingMessage {
126
- type: 'ping';
114
+ export interface PingMessagePayload {
115
+ type: PingMessageType;
127
116
  timestamp?: number;
128
117
  }
129
118
 
119
+ export type PingMessageType = "ping";
130
120
 
131
- export interface PongMessage {
132
- type: 'pong';
121
+ export interface PongMessagePayload {
122
+ type: PongMessageType;
133
123
  timestamp?: number;
134
124
  }
135
125
 
126
+ export type PongMessageType = "pong";
127
+
136
128
  export interface Position {
137
129
  exchangeId: number;
138
130
  symbol: string;
@@ -146,14 +138,12 @@ export interface Position {
146
138
  }
147
139
 
148
140
  export interface PositionUpdatePayload {
149
- type: 'channel_data';
141
+ type: ChannelDataMessageType;
150
142
  timestamp: number;
151
143
  channel: string;
152
144
  data: Position[];
153
- additionalProperties?: Map<string, any>;
154
145
  }
155
146
 
156
-
157
147
  export interface Price {
158
148
  symbol: string;
159
149
  oraclePrice: string;
@@ -163,64 +153,60 @@ export interface Price {
163
153
  }
164
154
 
165
155
  export interface PriceUpdatePayload {
166
- type: 'channel_data';
156
+ type: ChannelDataMessageType;
167
157
  timestamp: number;
168
158
  channel: string;
169
159
  data: Price;
170
- additionalProperties?: Map<string, any>;
171
160
  }
172
161
 
162
+ export type PricesChannel = "/v2/prices";
163
+
173
164
  export interface PricesUpdatePayload {
174
- type: 'channel_data';
165
+ type: ChannelDataMessageType;
175
166
  timestamp: number;
176
- channel: '/v2/prices';
167
+ channel: PricesChannel;
177
168
  data: Price[];
178
- additionalProperties?: Map<string, any>;
179
169
  }
180
170
 
171
+ export type Side = "B" | "A";
181
172
 
182
- export enum Side {
183
- B = "B",
184
- A = "A",
173
+ export interface SubscribeMessagePayload {
174
+ type: SubscribeMessageType;
175
+ channel: string;
176
+ id?: string;
185
177
  }
186
178
 
179
+ export type SubscribeMessageType = "subscribe";
187
180
 
188
- export enum TimeInForce {
189
- IOC = "IOC",
190
- GTC = "GTC",
181
+ export interface SubscribedMessagePayload {
182
+ type: SubscribedMessageType;
183
+ channel: string;
184
+ contents?: Map<string, any>;
191
185
  }
192
186
 
193
- export interface WalletPerpExecutionUpdatePayload {
194
- type: 'channel_data';
195
- timestamp: number;
187
+ export type SubscribedMessageType = "subscribed";
188
+
189
+ export type TimeInForce = "IOC" | "GTC";
190
+
191
+ export interface UnsubscribeMessagePayload {
192
+ type: UnsubscribeMessageType;
196
193
  channel: string;
197
- data: PerpExecution[];
198
- additionalProperties?: Map<string, any>;
194
+ id?: string;
199
195
  }
200
196
 
197
+ export type UnsubscribeMessageType = "unsubscribe";
201
198
 
202
- // Union types for WebSocket messages
203
- export type UpdatePayload =
204
- | MarketsSummaryUpdatePayload
205
- | MarketSummaryUpdatePayload
206
- | PositionUpdatePayload
207
- | OrderChangeUpdatePayload
208
- | MarketPerpExecutionUpdatePayload
209
- | WalletPerpExecutionUpdatePayload
210
- | PricesUpdatePayload
211
- | PriceUpdatePayload;
212
-
213
- export type WebSocketMessage = UpdatePayload | PingMessage | PongMessage;
199
+ export interface UnsubscribedMessagePayload {
200
+ type: UnsubscribedMessageType;
201
+ channel: string;
202
+ }
214
203
 
215
- // Type guards for WebSocket messages
216
- export const isUpdatePayload = (message: WebSocketMessage): message is UpdatePayload => {
217
- return message.type === 'channel_data';
218
- };
204
+ export type UnsubscribedMessageType = "unsubscribed";
219
205
 
220
- export const isPingMessage = (message: WebSocketMessage): message is PingMessage => {
221
- return message.type === 'ping';
222
- };
206
+ export interface WalletPerpExecutionUpdatePayload {
207
+ type: ChannelDataMessageType;
208
+ timestamp: number;
209
+ channel: string;
210
+ data: PerpExecution[];
211
+ }
223
212
 
224
- export const isPongMessage = (message: WebSocketMessage): message is PongMessage => {
225
- return message.type === 'pong';
226
- };