zklighter-perps 1.0.7 → 1.0.8

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 (90) hide show
  1. package/.openapi-generator/FILES +1 -0
  2. package/apis/BlockApi.ts +3 -0
  3. package/apis/CandlestickApi.ts +3 -0
  4. package/apis/InfoApi.ts +3 -0
  5. package/apis/OrderApi.ts +3 -0
  6. package/apis/RelayerApi.ts +3 -0
  7. package/apis/RootApi.ts +3 -0
  8. package/apis/TransactionApi.ts +110 -6
  9. package/models/AccountMarketStats.ts +18 -12
  10. package/models/AccountPnL.ts +7 -5
  11. package/models/AccountPosition.ts +33 -22
  12. package/models/AccountStats.ts +15 -10
  13. package/models/Block.ts +40 -27
  14. package/models/Blocks.ts +7 -5
  15. package/models/Candlestick.ts +21 -14
  16. package/models/Candlesticks.ts +7 -5
  17. package/models/ContractAddress.ts +6 -4
  18. package/models/CurrentHeight.ts +3 -2
  19. package/models/DetailedAccount.ts +11 -8
  20. package/models/DetailedAccounts.ts +7 -5
  21. package/models/EnrichedTx.ts +9 -6
  22. package/models/ExchangeStats.ts +13 -9
  23. package/models/Funding.ts +12 -8
  24. package/models/Fundings.ts +7 -5
  25. package/models/L1ProviderInfo.ts +12 -8
  26. package/models/Layer1BasicInfo.ts +24 -17
  27. package/models/Layer2BasicInfo.ts +9 -6
  28. package/models/MainAccount.ts +9 -6
  29. package/models/MainAccounts.ts +7 -5
  30. package/models/MarketInfo.ts +33 -22
  31. package/models/MarketSig.ts +12 -8
  32. package/models/NextNonce.ts +3 -2
  33. package/models/Order.ts +48 -32
  34. package/models/OrderBook.ts +30 -20
  35. package/models/OrderBookDepth.ts +11 -8
  36. package/models/OrderBookDetail.ts +54 -36
  37. package/models/OrderBookDetails.ts +4 -3
  38. package/models/OrderBookOrders.ts +14 -10
  39. package/models/OrderBookStats.ts +18 -12
  40. package/models/OrderBooks.ts +4 -3
  41. package/models/Orders.ts +4 -3
  42. package/models/Permission.ts +3 -2
  43. package/models/PnLEntry.ts +6 -4
  44. package/models/PriceLevel.ts +6 -4
  45. package/models/ReqDoFaucet.ts +3 -2
  46. package/models/ReqGetAccount.ts +6 -4
  47. package/models/ReqGetAccountActiveOrders.ts +9 -6
  48. package/models/ReqGetAccountByL1Address.ts +3 -2
  49. package/models/ReqGetAccountInactiveOrders.ts +12 -8
  50. package/models/ReqGetAccountOrders.ts +9 -6
  51. package/models/ReqGetAccountPnL.ts +18 -12
  52. package/models/ReqGetBlock.ts +6 -4
  53. package/models/ReqGetBlockTxs.ts +6 -4
  54. package/models/ReqGetByAccount.ts +6 -4
  55. package/models/ReqGetCandlesticks.ts +15 -10
  56. package/models/ReqGetFundings.ts +15 -10
  57. package/models/ReqGetL1Tx.ts +3 -2
  58. package/models/ReqGetMarketSig.ts +9 -6
  59. package/models/ReqGetNextNonce.ts +6 -4
  60. package/models/ReqGetOrderBookDetails.ts +3 -2
  61. package/models/ReqGetOrderBookOrders.ts +6 -4
  62. package/models/ReqGetOrderBooks.ts +3 -2
  63. package/models/ReqGetPermission.ts +9 -6
  64. package/models/ReqGetRangeWithCursor.ts +3 -2
  65. package/models/ReqGetRangeWithIndex.ts +3 -2
  66. package/models/ReqGetRecentTrades.ts +6 -4
  67. package/models/ReqGetRollbacks.ts +9 -6
  68. package/models/ReqGetSubAccount.ts +9 -6
  69. package/models/ReqGetTrades.ts +12 -8
  70. package/models/ReqGetTx.ts +6 -4
  71. package/models/ReqSearch.ts +3 -2
  72. package/models/ResultCode.ts +3 -2
  73. package/models/Rollback.ts +12 -8
  74. package/models/Rollbacks.ts +7 -5
  75. package/models/Search.ts +3 -2
  76. package/models/SignBody.ts +3 -2
  77. package/models/SimpleOrder.ts +18 -12
  78. package/models/Status.ts +6 -4
  79. package/models/SubAccount.ts +24 -16
  80. package/models/SubAccounts.ts +13 -9
  81. package/models/Trade.ts +36 -24
  82. package/models/Trades.ts +4 -3
  83. package/models/Tx.ts +42 -28
  84. package/models/TxHash.ts +3 -2
  85. package/models/TxHashes.ts +77 -0
  86. package/models/Txs.ts +4 -3
  87. package/models/ValidatorInfo.ts +6 -4
  88. package/models/index.ts +1 -0
  89. package/openapi.json +828 -80
  90. package/package.json +1 -1
@@ -88,6 +88,7 @@ models/Trade.ts
88
88
  models/Trades.ts
89
89
  models/Tx.ts
90
90
  models/TxHash.ts
91
+ models/TxHashes.ts
91
92
  models/Txs.ts
92
93
  models/ValidatorInfo.ts
93
94
  models/index.ts
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,9 +15,12 @@
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';
@@ -17,8 +17,10 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  EnrichedTx,
19
19
  NextNonce,
20
+ ResultCode,
20
21
  SignBody,
21
22
  TxHash,
23
+ TxHashes,
22
24
  Txs,
23
25
  } from '../models/index';
24
26
  import {
@@ -26,10 +28,14 @@ import {
26
28
  EnrichedTxToJSON,
27
29
  NextNonceFromJSON,
28
30
  NextNonceToJSON,
31
+ ResultCodeFromJSON,
32
+ ResultCodeToJSON,
29
33
  SignBodyFromJSON,
30
34
  SignBodyToJSON,
31
35
  TxHashFromJSON,
32
36
  TxHashToJSON,
37
+ TxHashesFromJSON,
38
+ TxHashesToJSON,
33
39
  TxsFromJSON,
34
40
  TxsToJSON,
35
41
  } from '../models/index';
@@ -54,8 +60,8 @@ export interface GetBlockTxsRequest {
54
60
  }
55
61
 
56
62
  export interface GetL2SignatureBodyRequest {
57
- txType?: number;
58
- txInfo?: string;
63
+ txType: number;
64
+ txInfo: string;
59
65
  }
60
66
 
61
67
  export interface GetNextNonceRequest {
@@ -83,8 +89,13 @@ export interface GetTxsRequest {
83
89
  }
84
90
 
85
91
  export interface SendTxRequest {
86
- txType?: number;
87
- txInfo?: string;
92
+ txType: number;
93
+ txInfo: string;
94
+ }
95
+
96
+ export interface SendTxBatchRequest {
97
+ txTypes: string;
98
+ txInfos: string;
88
99
  }
89
100
 
90
101
  /**
@@ -270,6 +281,20 @@ export class TransactionApi extends runtime.BaseAPI {
270
281
  * GetL2SignatureBody
271
282
  */
272
283
  async getL2SignatureBodyRaw(requestParameters: GetL2SignatureBodyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SignBody>> {
284
+ if (requestParameters['txType'] == null) {
285
+ throw new runtime.RequiredError(
286
+ 'txType',
287
+ 'Required parameter "txType" was null or undefined when calling getL2SignatureBody().'
288
+ );
289
+ }
290
+
291
+ if (requestParameters['txInfo'] == null) {
292
+ throw new runtime.RequiredError(
293
+ 'txInfo',
294
+ 'Required parameter "txInfo" was null or undefined when calling getL2SignatureBody().'
295
+ );
296
+ }
297
+
273
298
  const queryParameters: any = {};
274
299
 
275
300
  const headerParameters: runtime.HTTPHeaders = {};
@@ -311,7 +336,7 @@ export class TransactionApi extends runtime.BaseAPI {
311
336
  * Get transaction signature body
312
337
  * GetL2SignatureBody
313
338
  */
314
- async getL2SignatureBody(requestParameters: GetL2SignatureBodyRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SignBody> {
339
+ async getL2SignatureBody(requestParameters: GetL2SignatureBodyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SignBody> {
315
340
  const response = await this.getL2SignatureBodyRaw(requestParameters, initOverrides);
316
341
  return await response.value();
317
342
  }
@@ -546,6 +571,20 @@ export class TransactionApi extends runtime.BaseAPI {
546
571
  * SendTx
547
572
  */
548
573
  async sendTxRaw(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TxHash>> {
574
+ if (requestParameters['txType'] == null) {
575
+ throw new runtime.RequiredError(
576
+ 'txType',
577
+ 'Required parameter "txType" was null or undefined when calling sendTx().'
578
+ );
579
+ }
580
+
581
+ if (requestParameters['txInfo'] == null) {
582
+ throw new runtime.RequiredError(
583
+ 'txInfo',
584
+ 'Required parameter "txInfo" was null or undefined when calling sendTx().'
585
+ );
586
+ }
587
+
549
588
  const queryParameters: any = {};
550
589
 
551
590
  const headerParameters: runtime.HTTPHeaders = {};
@@ -587,11 +626,76 @@ export class TransactionApi extends runtime.BaseAPI {
587
626
  * Send raw transaction
588
627
  * SendTx
589
628
  */
590
- async sendTx(requestParameters: SendTxRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TxHash> {
629
+ async sendTx(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TxHash> {
591
630
  const response = await this.sendTxRaw(requestParameters, initOverrides);
592
631
  return await response.value();
593
632
  }
594
633
 
634
+ /**
635
+ * Send multiple raw transactions
636
+ * SendTxBatch
637
+ */
638
+ async sendTxBatchRaw(requestParameters: SendTxBatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TxHashes>> {
639
+ if (requestParameters['txTypes'] == null) {
640
+ throw new runtime.RequiredError(
641
+ 'txTypes',
642
+ 'Required parameter "txTypes" was null or undefined when calling sendTxBatch().'
643
+ );
644
+ }
645
+
646
+ if (requestParameters['txInfos'] == null) {
647
+ throw new runtime.RequiredError(
648
+ 'txInfos',
649
+ 'Required parameter "txInfos" was null or undefined when calling sendTxBatch().'
650
+ );
651
+ }
652
+
653
+ const queryParameters: any = {};
654
+
655
+ const headerParameters: runtime.HTTPHeaders = {};
656
+
657
+ const consumes: runtime.Consume[] = [
658
+ { contentType: 'multipart/form-data' },
659
+ ];
660
+ // @ts-ignore: canConsumeForm may be unused
661
+ const canConsumeForm = runtime.canConsumeForm(consumes);
662
+
663
+ let formParams: { append(param: string, value: any): any };
664
+ let useForm = false;
665
+ if (useForm) {
666
+ formParams = new FormData();
667
+ } else {
668
+ formParams = new URLSearchParams();
669
+ }
670
+
671
+ if (requestParameters['txTypes'] != null) {
672
+ formParams.append('tx_types', requestParameters['txTypes'] as any);
673
+ }
674
+
675
+ if (requestParameters['txInfos'] != null) {
676
+ formParams.append('tx_infos', requestParameters['txInfos'] as any);
677
+ }
678
+
679
+ const response = await this.request({
680
+ path: `/api/v1/sendTxBatch`,
681
+ method: 'POST',
682
+ headers: headerParameters,
683
+ query: queryParameters,
684
+ body: formParams,
685
+ }, initOverrides);
686
+
687
+ return new runtime.JSONApiResponse(response, (jsonValue) => TxHashesFromJSON(jsonValue));
688
+ }
689
+
690
+ /**
691
+ * Send multiple raw transactions
692
+ * SendTxBatch
693
+ */
694
+ async sendTxBatch(requestParameters: SendTxBatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TxHashes> {
695
+ const response = await this.sendTxBatchRaw(requestParameters, initOverrides);
696
+ return await response.value();
697
+ }
698
+
595
699
  }
596
700
 
597
701
  /**
@@ -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