zklighter-perps 1.0.3 → 1.0.5

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 (87) hide show
  1. package/apis/BlockApi.ts +3 -0
  2. package/apis/CandlestickApi.ts +3 -0
  3. package/apis/InfoApi.ts +3 -0
  4. package/apis/OrderApi.ts +3 -0
  5. package/apis/RelayerApi.ts +3 -0
  6. package/apis/RootApi.ts +69 -0
  7. package/apis/TransactionApi.ts +37 -6
  8. package/models/AccountMarketStats.ts +18 -12
  9. package/models/AccountPnL.ts +7 -5
  10. package/models/AccountPosition.ts +33 -22
  11. package/models/AccountStats.ts +15 -10
  12. package/models/Block.ts +40 -27
  13. package/models/Blocks.ts +7 -5
  14. package/models/Candlestick.ts +21 -14
  15. package/models/Candlesticks.ts +7 -5
  16. package/models/ContractAddress.ts +6 -4
  17. package/models/CurrentHeight.ts +3 -2
  18. package/models/DetailedAccount.ts +11 -8
  19. package/models/DetailedAccounts.ts +7 -5
  20. package/models/EnrichedTx.ts +9 -6
  21. package/models/ExchangeStats.ts +13 -9
  22. package/models/Funding.ts +12 -8
  23. package/models/Fundings.ts +7 -5
  24. package/models/L1ProviderInfo.ts +12 -8
  25. package/models/Layer1BasicInfo.ts +24 -17
  26. package/models/Layer2BasicInfo.ts +9 -6
  27. package/models/MainAccount.ts +9 -6
  28. package/models/MainAccounts.ts +7 -5
  29. package/models/MarketInfo.ts +33 -22
  30. package/models/MarketSig.ts +12 -8
  31. package/models/NextNonce.ts +3 -2
  32. package/models/Order.ts +48 -32
  33. package/models/OrderBook.ts +30 -20
  34. package/models/OrderBookDepth.ts +11 -8
  35. package/models/OrderBookDetail.ts +54 -36
  36. package/models/OrderBookDetails.ts +4 -3
  37. package/models/OrderBookOrders.ts +14 -10
  38. package/models/OrderBookStats.ts +18 -12
  39. package/models/OrderBooks.ts +4 -3
  40. package/models/Orders.ts +4 -3
  41. package/models/Permission.ts +3 -2
  42. package/models/PnLEntry.ts +6 -4
  43. package/models/PriceLevel.ts +6 -4
  44. package/models/ReqDoFaucet.ts +3 -2
  45. package/models/ReqGetAccount.ts +6 -4
  46. package/models/ReqGetAccountActiveOrders.ts +9 -6
  47. package/models/ReqGetAccountByL1Address.ts +3 -2
  48. package/models/ReqGetAccountInactiveOrders.ts +12 -8
  49. package/models/ReqGetAccountOrders.ts +9 -6
  50. package/models/ReqGetAccountPnL.ts +18 -12
  51. package/models/ReqGetBlock.ts +6 -4
  52. package/models/ReqGetBlockTxs.ts +6 -4
  53. package/models/ReqGetByAccount.ts +6 -4
  54. package/models/ReqGetCandlesticks.ts +15 -10
  55. package/models/ReqGetFundings.ts +15 -10
  56. package/models/ReqGetL1Tx.ts +3 -2
  57. package/models/ReqGetMarketSig.ts +9 -6
  58. package/models/ReqGetNextNonce.ts +6 -4
  59. package/models/ReqGetOrderBookDetails.ts +3 -2
  60. package/models/ReqGetOrderBookOrders.ts +6 -4
  61. package/models/ReqGetOrderBooks.ts +3 -2
  62. package/models/ReqGetPermission.ts +9 -6
  63. package/models/ReqGetRangeWithCursor.ts +3 -2
  64. package/models/ReqGetRangeWithIndex.ts +3 -2
  65. package/models/ReqGetRecentTrades.ts +6 -4
  66. package/models/ReqGetRollbacks.ts +9 -6
  67. package/models/ReqGetSubAccount.ts +9 -6
  68. package/models/ReqGetTrades.ts +12 -8
  69. package/models/ReqGetTx.ts +6 -4
  70. package/models/ReqSearch.ts +3 -2
  71. package/models/ResultCode.ts +3 -2
  72. package/models/Rollback.ts +12 -8
  73. package/models/Rollbacks.ts +7 -5
  74. package/models/Search.ts +3 -2
  75. package/models/SignBody.ts +3 -2
  76. package/models/SimpleOrder.ts +18 -12
  77. package/models/Status.ts +6 -4
  78. package/models/SubAccount.ts +24 -16
  79. package/models/SubAccounts.ts +13 -9
  80. package/models/Trade.ts +36 -24
  81. package/models/Trades.ts +4 -3
  82. package/models/Tx.ts +42 -28
  83. package/models/TxHash.ts +3 -2
  84. package/models/Txs.ts +4 -3
  85. package/models/ValidatorInfo.ts +6 -4
  86. package/openapi.json +818 -80
  87. package/package.json +1 -1
package/apis/BlockApi.ts CHANGED
@@ -17,12 +17,15 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  Blocks,
19
19
  CurrentHeight,
20
+ ResultCode,
20
21
  } from '../models/index';
21
22
  import {
22
23
  BlocksFromJSON,
23
24
  BlocksToJSON,
24
25
  CurrentHeightFromJSON,
25
26
  CurrentHeightToJSON,
27
+ ResultCodeFromJSON,
28
+ ResultCodeToJSON,
26
29
  } from '../models/index';
27
30
 
28
31
  export interface GetBlockRequest {
@@ -17,12 +17,15 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  Candlesticks,
19
19
  Fundings,
20
+ ResultCode,
20
21
  } from '../models/index';
21
22
  import {
22
23
  CandlesticksFromJSON,
23
24
  CandlesticksToJSON,
24
25
  FundingsFromJSON,
25
26
  FundingsToJSON,
27
+ ResultCodeFromJSON,
28
+ ResultCodeToJSON,
26
29
  } from '../models/index';
27
30
 
28
31
  export interface GetCandlesticksRequest {
package/apis/InfoApi.ts CHANGED
@@ -17,6 +17,7 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  Layer1BasicInfo,
19
19
  Layer2BasicInfo,
20
+ ResultCode,
20
21
  Rollbacks,
21
22
  Search,
22
23
  } from '../models/index';
@@ -25,6 +26,8 @@ import {
25
26
  Layer1BasicInfoToJSON,
26
27
  Layer2BasicInfoFromJSON,
27
28
  Layer2BasicInfoToJSON,
29
+ ResultCodeFromJSON,
30
+ ResultCodeToJSON,
28
31
  RollbacksFromJSON,
29
32
  RollbacksToJSON,
30
33
  SearchFromJSON,
package/apis/OrderApi.ts CHANGED
@@ -20,6 +20,7 @@ import type {
20
20
  OrderBookOrders,
21
21
  OrderBooks,
22
22
  Orders,
23
+ ResultCode,
23
24
  Trades,
24
25
  } from '../models/index';
25
26
  import {
@@ -33,6 +34,8 @@ import {
33
34
  OrderBooksToJSON,
34
35
  OrdersFromJSON,
35
36
  OrdersToJSON,
37
+ ResultCodeFromJSON,
38
+ ResultCodeToJSON,
36
39
  TradesFromJSON,
37
40
  TradesToJSON,
38
41
  } from '../models/index';
@@ -16,10 +16,13 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  MarketSig,
19
+ ResultCode,
19
20
  } from '../models/index';
20
21
  import {
21
22
  MarketSigFromJSON,
22
23
  MarketSigToJSON,
24
+ ResultCodeFromJSON,
25
+ ResultCodeToJSON,
23
26
  } from '../models/index';
24
27
 
25
28
  export interface GetMarketSigRequest {
package/apis/RootApi.ts CHANGED
@@ -15,13 +15,22 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ ResultCode,
18
19
  Status,
19
20
  } from '../models/index';
20
21
  import {
22
+ ResultCodeFromJSON,
23
+ ResultCodeToJSON,
21
24
  StatusFromJSON,
22
25
  StatusToJSON,
23
26
  } from '../models/index';
24
27
 
28
+ export interface SendFeedbackRequest {
29
+ content: string;
30
+ name?: string;
31
+ email?: string;
32
+ }
33
+
25
34
  /**
26
35
  *
27
36
  */
@@ -53,4 +62,64 @@ export class RootApi extends runtime.BaseAPI {
53
62
  return await response.value();
54
63
  }
55
64
 
65
+ /**
66
+ * Send feedback
67
+ */
68
+ async sendFeedbackRaw(requestParameters: SendFeedbackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
69
+ if (requestParameters['content'] == null) {
70
+ throw new runtime.RequiredError(
71
+ 'content',
72
+ 'Required parameter "content" was null or undefined when calling sendFeedback().'
73
+ );
74
+ }
75
+
76
+ const queryParameters: any = {};
77
+
78
+ const headerParameters: runtime.HTTPHeaders = {};
79
+
80
+ const consumes: runtime.Consume[] = [
81
+ { contentType: 'multipart/form-data' },
82
+ ];
83
+ // @ts-ignore: canConsumeForm may be unused
84
+ const canConsumeForm = runtime.canConsumeForm(consumes);
85
+
86
+ let formParams: { append(param: string, value: any): any };
87
+ let useForm = false;
88
+ if (useForm) {
89
+ formParams = new FormData();
90
+ } else {
91
+ formParams = new URLSearchParams();
92
+ }
93
+
94
+ if (requestParameters['name'] != null) {
95
+ formParams.append('name', requestParameters['name'] as any);
96
+ }
97
+
98
+ if (requestParameters['email'] != null) {
99
+ formParams.append('email', requestParameters['email'] as any);
100
+ }
101
+
102
+ if (requestParameters['content'] != null) {
103
+ formParams.append('content', requestParameters['content'] as any);
104
+ }
105
+
106
+ const response = await this.request({
107
+ path: `/api/v1/feedback`,
108
+ method: 'POST',
109
+ headers: headerParameters,
110
+ query: queryParameters,
111
+ body: formParams,
112
+ }, initOverrides);
113
+
114
+ return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
115
+ }
116
+
117
+ /**
118
+ * Send feedback
119
+ */
120
+ async sendFeedback(requestParameters: SendFeedbackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
121
+ const response = await this.sendFeedbackRaw(requestParameters, initOverrides);
122
+ return await response.value();
123
+ }
124
+
56
125
  }
@@ -17,6 +17,7 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  EnrichedTx,
19
19
  NextNonce,
20
+ ResultCode,
20
21
  SignBody,
21
22
  TxHash,
22
23
  Txs,
@@ -26,6 +27,8 @@ import {
26
27
  EnrichedTxToJSON,
27
28
  NextNonceFromJSON,
28
29
  NextNonceToJSON,
30
+ ResultCodeFromJSON,
31
+ ResultCodeToJSON,
29
32
  SignBodyFromJSON,
30
33
  SignBodyToJSON,
31
34
  TxHashFromJSON,
@@ -54,8 +57,8 @@ export interface GetBlockTxsRequest {
54
57
  }
55
58
 
56
59
  export interface GetL2SignatureBodyRequest {
57
- txType?: number;
58
- txInfo?: string;
60
+ txType: number;
61
+ txInfo: string;
59
62
  }
60
63
 
61
64
  export interface GetNextNonceRequest {
@@ -83,8 +86,8 @@ export interface GetTxsRequest {
83
86
  }
84
87
 
85
88
  export interface SendTxRequest {
86
- txType?: number;
87
- txInfo?: string;
89
+ txType: number;
90
+ txInfo: string;
88
91
  }
89
92
 
90
93
  /**
@@ -263,6 +266,20 @@ export class TransactionApi extends runtime.BaseAPI {
263
266
  * Get transaction signature body
264
267
  */
265
268
  async getL2SignatureBodyRaw(requestParameters: GetL2SignatureBodyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SignBody>> {
269
+ if (requestParameters['txType'] == null) {
270
+ throw new runtime.RequiredError(
271
+ 'txType',
272
+ 'Required parameter "txType" was null or undefined when calling getL2SignatureBody().'
273
+ );
274
+ }
275
+
276
+ if (requestParameters['txInfo'] == null) {
277
+ throw new runtime.RequiredError(
278
+ 'txInfo',
279
+ 'Required parameter "txInfo" was null or undefined when calling getL2SignatureBody().'
280
+ );
281
+ }
282
+
266
283
  const queryParameters: any = {};
267
284
 
268
285
  const headerParameters: runtime.HTTPHeaders = {};
@@ -303,7 +320,7 @@ export class TransactionApi extends runtime.BaseAPI {
303
320
  /**
304
321
  * Get transaction signature body
305
322
  */
306
- async getL2SignatureBody(requestParameters: GetL2SignatureBodyRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SignBody> {
323
+ async getL2SignatureBody(requestParameters: GetL2SignatureBodyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SignBody> {
307
324
  const response = await this.getL2SignatureBodyRaw(requestParameters, initOverrides);
308
325
  return await response.value();
309
326
  }
@@ -527,6 +544,20 @@ export class TransactionApi extends runtime.BaseAPI {
527
544
  * Send raw transaction
528
545
  */
529
546
  async sendTxRaw(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TxHash>> {
547
+ if (requestParameters['txType'] == null) {
548
+ throw new runtime.RequiredError(
549
+ 'txType',
550
+ 'Required parameter "txType" was null or undefined when calling sendTx().'
551
+ );
552
+ }
553
+
554
+ if (requestParameters['txInfo'] == null) {
555
+ throw new runtime.RequiredError(
556
+ 'txInfo',
557
+ 'Required parameter "txInfo" was null or undefined when calling sendTx().'
558
+ );
559
+ }
560
+
530
561
  const queryParameters: any = {};
531
562
 
532
563
  const headerParameters: runtime.HTTPHeaders = {};
@@ -567,7 +598,7 @@ export class TransactionApi extends runtime.BaseAPI {
567
598
  /**
568
599
  * Send raw transaction
569
600
  */
570
- async sendTx(requestParameters: SendTxRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TxHash> {
601
+ async sendTx(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TxHash> {
571
602
  const response = await this.sendTxRaw(requestParameters, initOverrides);
572
603
  return await response.value();
573
604
  }
@@ -24,43 +24,49 @@ export interface AccountMarketStats {
24
24
  * @type {number}
25
25
  * @memberof AccountMarketStats
26
26
  */
27
- marketId?: number;
27
+ marketId: number;
28
28
  /**
29
29
  *
30
30
  * @type {number}
31
31
  * @memberof AccountMarketStats
32
32
  */
33
- dailyTradesCount?: number;
33
+ dailyTradesCount: number;
34
34
  /**
35
35
  *
36
36
  * @type {number}
37
37
  * @memberof AccountMarketStats
38
38
  */
39
- dailyBaseTokenVolume?: number;
39
+ dailyBaseTokenVolume: number;
40
40
  /**
41
41
  *
42
42
  * @type {number}
43
43
  * @memberof AccountMarketStats
44
44
  */
45
- dailyQuoteTokenVolume?: number;
45
+ dailyQuoteTokenVolume: number;
46
46
  /**
47
47
  *
48
48
  * @type {number}
49
49
  * @memberof AccountMarketStats
50
50
  */
51
- openPositionBase?: number;
51
+ openPositionBase: number;
52
52
  /**
53
53
  *
54
54
  * @type {number}
55
55
  * @memberof AccountMarketStats
56
56
  */
57
- openPositionQuote?: number;
57
+ openPositionQuote: number;
58
58
  }
59
59
 
60
60
  /**
61
61
  * Check if a given object implements the AccountMarketStats interface.
62
62
  */
63
63
  export function instanceOfAccountMarketStats(value: object): value is AccountMarketStats {
64
+ if (!('marketId' in value) || value['marketId'] === undefined) return false;
65
+ if (!('dailyTradesCount' in value) || value['dailyTradesCount'] === undefined) return false;
66
+ if (!('dailyBaseTokenVolume' in value) || value['dailyBaseTokenVolume'] === undefined) return false;
67
+ if (!('dailyQuoteTokenVolume' in value) || value['dailyQuoteTokenVolume'] === undefined) return false;
68
+ if (!('openPositionBase' in value) || value['openPositionBase'] === undefined) return false;
69
+ if (!('openPositionQuote' in value) || value['openPositionQuote'] === undefined) return false;
64
70
  return true;
65
71
  }
66
72
 
@@ -74,12 +80,12 @@ export function AccountMarketStatsFromJSONTyped(json: any, ignoreDiscriminator:
74
80
  }
75
81
  return {
76
82
 
77
- 'marketId': json['market_id'] == null ? undefined : json['market_id'],
78
- 'dailyTradesCount': json['daily_trades_count'] == null ? undefined : json['daily_trades_count'],
79
- 'dailyBaseTokenVolume': json['daily_base_token_volume'] == null ? undefined : json['daily_base_token_volume'],
80
- 'dailyQuoteTokenVolume': json['daily_quote_token_volume'] == null ? undefined : json['daily_quote_token_volume'],
81
- 'openPositionBase': json['open_position_base'] == null ? undefined : json['open_position_base'],
82
- 'openPositionQuote': json['open_position_quote'] == null ? undefined : json['open_position_quote'],
83
+ 'marketId': json['market_id'],
84
+ 'dailyTradesCount': json['daily_trades_count'],
85
+ 'dailyBaseTokenVolume': json['daily_base_token_volume'],
86
+ 'dailyQuoteTokenVolume': json['daily_quote_token_volume'],
87
+ 'openPositionBase': json['open_position_base'],
88
+ 'openPositionQuote': json['open_position_quote'],
83
89
  };
84
90
  }
85
91
 
@@ -43,19 +43,21 @@ export interface AccountPnL {
43
43
  * @type {string}
44
44
  * @memberof AccountPnL
45
45
  */
46
- resolution?: string;
46
+ resolution: string;
47
47
  /**
48
48
  *
49
49
  * @type {Array<PnLEntry>}
50
50
  * @memberof AccountPnL
51
51
  */
52
- pnl?: Array<PnLEntry>;
52
+ pnl: Array<PnLEntry>;
53
53
  }
54
54
 
55
55
  /**
56
56
  * Check if a given object implements the AccountPnL interface.
57
57
  */
58
58
  export function instanceOfAccountPnL(value: object): value is AccountPnL {
59
+ if (!('resolution' in value) || value['resolution'] === undefined) return false;
60
+ if (!('pnl' in value) || value['pnl'] === undefined) return false;
59
61
  return true;
60
62
  }
61
63
 
@@ -71,8 +73,8 @@ export function AccountPnLFromJSONTyped(json: any, ignoreDiscriminator: boolean)
71
73
 
72
74
  'code': json['code'] == null ? undefined : json['code'],
73
75
  'message': json['message'] == null ? undefined : json['message'],
74
- 'resolution': json['resolution'] == null ? undefined : json['resolution'],
75
- 'pnl': json['pnl'] == null ? undefined : ((json['pnl'] as Array<any>).map(PnLEntryFromJSON)),
76
+ 'resolution': json['resolution'],
77
+ 'pnl': ((json['pnl'] as Array<any>).map(PnLEntryFromJSON)),
76
78
  };
77
79
  }
78
80
 
@@ -85,7 +87,7 @@ export function AccountPnLToJSON(value?: AccountPnL | null): any {
85
87
  'code': value['code'],
86
88
  'message': value['message'],
87
89
  'resolution': value['resolution'],
88
- 'pnl': value['pnl'] == null ? undefined : ((value['pnl'] as Array<any>).map(PnLEntryToJSON)),
90
+ 'pnl': ((value['pnl'] as Array<any>).map(PnLEntryToJSON)),
89
91
  };
90
92
  }
91
93
 
@@ -24,73 +24,84 @@ export interface AccountPosition {
24
24
  * @type {number}
25
25
  * @memberof AccountPosition
26
26
  */
27
- marketId?: number;
27
+ marketId: number;
28
28
  /**
29
29
  *
30
30
  * @type {string}
31
31
  * @memberof AccountPosition
32
32
  */
33
- name?: string;
33
+ name: string;
34
34
  /**
35
35
  *
36
36
  * @type {string}
37
37
  * @memberof AccountPosition
38
38
  */
39
- symbol?: string;
39
+ symbol: string;
40
40
  /**
41
41
  *
42
42
  * @type {number}
43
43
  * @memberof AccountPosition
44
44
  */
45
- sign?: number;
45
+ sign: number;
46
46
  /**
47
47
  *
48
48
  * @type {string}
49
49
  * @memberof AccountPosition
50
50
  */
51
- position?: string;
51
+ position: string;
52
52
  /**
53
53
  *
54
54
  * @type {string}
55
55
  * @memberof AccountPosition
56
56
  */
57
- askOrderSize?: string;
57
+ askOrderSize: string;
58
58
  /**
59
59
  *
60
60
  * @type {string}
61
61
  * @memberof AccountPosition
62
62
  */
63
- bidOrderSize?: string;
63
+ bidOrderSize: string;
64
64
  /**
65
65
  *
66
66
  * @type {string}
67
67
  * @memberof AccountPosition
68
68
  */
69
- avgEntryPrice?: string;
69
+ avgEntryPrice: string;
70
70
  /**
71
71
  *
72
72
  * @type {string}
73
73
  * @memberof AccountPosition
74
74
  */
75
- positionValue?: string;
75
+ positionValue: string;
76
76
  /**
77
77
  *
78
78
  * @type {string}
79
79
  * @memberof AccountPosition
80
80
  */
81
- unrealizedPnl?: string;
81
+ unrealizedPnl: string;
82
82
  /**
83
83
  *
84
84
  * @type {string}
85
85
  * @memberof AccountPosition
86
86
  */
87
- realizedPnl?: string;
87
+ realizedPnl: string;
88
88
  }
89
89
 
90
90
  /**
91
91
  * Check if a given object implements the AccountPosition interface.
92
92
  */
93
93
  export function instanceOfAccountPosition(value: object): value is AccountPosition {
94
+ if (!('marketId' in value) || value['marketId'] === undefined) return false;
95
+ if (!('name' in value) || value['name'] === undefined) return false;
96
+ if (!('symbol' in value) || value['symbol'] === undefined) return false;
97
+ if (!('sign' in value) || value['sign'] === undefined) return false;
98
+ if (!('position' in value) || value['position'] === undefined) return false;
99
+ if (!('askOrderSize' in value) || value['askOrderSize'] === undefined) return false;
100
+ if (!('bidOrderSize' in value) || value['bidOrderSize'] === undefined) return false;
101
+ if (!('avgEntryPrice' in value) || value['avgEntryPrice'] === undefined) return false;
102
+ if (!('positionValue' in value) || value['positionValue'] === undefined) return false;
103
+ if (!('unrealizedPnl' in value) || value['unrealizedPnl'] === undefined) return false;
104
+ if (!('realizedPnl' in value) || value['realizedPnl'] === undefined) return false;
94
105
  return true;
95
106
  }
96
107
 
@@ -104,17 +115,17 @@ export function AccountPositionFromJSONTyped(json: any, ignoreDiscriminator: boo
104
115
  }
105
116
  return {
106
117
 
107
- 'marketId': json['market_id'] == null ? undefined : json['market_id'],
108
- 'name': json['name'] == null ? undefined : json['name'],
109
- 'symbol': json['symbol'] == null ? undefined : json['symbol'],
110
- 'sign': json['sign'] == null ? undefined : json['sign'],
111
- 'position': json['position'] == null ? undefined : json['position'],
112
- 'askOrderSize': json['ask_order_size'] == null ? undefined : json['ask_order_size'],
113
- 'bidOrderSize': json['bid_order_size'] == null ? undefined : json['bid_order_size'],
114
- 'avgEntryPrice': json['avg_entry_price'] == null ? undefined : json['avg_entry_price'],
115
- 'positionValue': json['position_value'] == null ? undefined : json['position_value'],
116
- 'unrealizedPnl': json['unrealized_pnl'] == null ? undefined : json['unrealized_pnl'],
117
- 'realizedPnl': json['realized_pnl'] == null ? undefined : json['realized_pnl'],
118
+ 'marketId': json['market_id'],
119
+ 'name': json['name'],
120
+ 'symbol': json['symbol'],
121
+ 'sign': json['sign'],
122
+ 'position': json['position'],
123
+ 'askOrderSize': json['ask_order_size'],
124
+ 'bidOrderSize': json['bid_order_size'],
125
+ 'avgEntryPrice': json['avg_entry_price'],
126
+ 'positionValue': json['position_value'],
127
+ 'unrealizedPnl': json['unrealized_pnl'],
128
+ 'realizedPnl': json['realized_pnl'],
118
129
  };
119
130
  }
120
131
 
@@ -24,37 +24,42 @@ export interface AccountStats {
24
24
  * @type {string}
25
25
  * @memberof AccountStats
26
26
  */
27
- portfolioValue?: string;
27
+ portfolioValue: string;
28
28
  /**
29
29
  *
30
30
  * @type {string}
31
31
  * @memberof AccountStats
32
32
  */
33
- leverage?: string;
33
+ leverage: string;
34
34
  /**
35
35
  *
36
36
  * @type {string}
37
37
  * @memberof AccountStats
38
38
  */
39
- freeCollateral?: string;
39
+ freeCollateral: string;
40
40
  /**
41
41
  *
42
42
  * @type {string}
43
43
  * @memberof AccountStats
44
44
  */
45
- marginUsage?: string;
45
+ marginUsage: string;
46
46
  /**
47
47
  *
48
48
  * @type {string}
49
49
  * @memberof AccountStats
50
50
  */
51
- buyingPower?: string;
51
+ buyingPower: string;
52
52
  }
53
53
 
54
54
  /**
55
55
  * Check if a given object implements the AccountStats interface.
56
56
  */
57
57
  export function instanceOfAccountStats(value: object): value is AccountStats {
58
+ if (!('portfolioValue' in value) || value['portfolioValue'] === undefined) return false;
59
+ if (!('leverage' in value) || value['leverage'] === undefined) return false;
60
+ if (!('freeCollateral' in value) || value['freeCollateral'] === undefined) return false;
61
+ if (!('marginUsage' in value) || value['marginUsage'] === undefined) return false;
62
+ if (!('buyingPower' in value) || value['buyingPower'] === undefined) return false;
58
63
  return true;
59
64
  }
60
65
 
@@ -68,11 +73,11 @@ export function AccountStatsFromJSONTyped(json: any, ignoreDiscriminator: boolea
68
73
  }
69
74
  return {
70
75
 
71
- 'portfolioValue': json['portfolio_value'] == null ? undefined : json['portfolio_value'],
72
- 'leverage': json['leverage'] == null ? undefined : json['leverage'],
73
- 'freeCollateral': json['free_collateral'] == null ? undefined : json['free_collateral'],
74
- 'marginUsage': json['margin_usage'] == null ? undefined : json['margin_usage'],
75
- 'buyingPower': json['buying_power'] == null ? undefined : json['buying_power'],
76
+ 'portfolioValue': json['portfolio_value'],
77
+ 'leverage': json['leverage'],
78
+ 'freeCollateral': json['free_collateral'],
79
+ 'marginUsage': json['margin_usage'],
80
+ 'buyingPower': json['buying_power'],
76
81
  };
77
82
  }
78
83