zklighter-perps 1.0.4 → 1.0.6

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 (89) hide show
  1. package/apis/AccountApi.ts +12 -0
  2. package/apis/BlockApi.ts +6 -0
  3. package/apis/CandlestickApi.ts +4 -0
  4. package/apis/InfoApi.ts +8 -0
  5. package/apis/OrderApi.ts +18 -0
  6. package/apis/RelayerApi.ts +2 -0
  7. package/apis/RootApi.ts +2 -0
  8. package/apis/TransactionApi.ts +26 -34
  9. package/apis/WsApi.ts +4 -0
  10. package/models/AccountMarketStats.ts +12 -18
  11. package/models/AccountPnL.ts +5 -7
  12. package/models/AccountPosition.ts +22 -33
  13. package/models/AccountStats.ts +10 -15
  14. package/models/Block.ts +27 -40
  15. package/models/Blocks.ts +5 -7
  16. package/models/Candlestick.ts +14 -21
  17. package/models/Candlesticks.ts +5 -7
  18. package/models/ContractAddress.ts +4 -6
  19. package/models/CurrentHeight.ts +2 -3
  20. package/models/DetailedAccount.ts +8 -11
  21. package/models/DetailedAccounts.ts +5 -7
  22. package/models/EnrichedTx.ts +6 -9
  23. package/models/ExchangeStats.ts +9 -13
  24. package/models/Funding.ts +8 -12
  25. package/models/Fundings.ts +5 -7
  26. package/models/L1ProviderInfo.ts +8 -12
  27. package/models/Layer1BasicInfo.ts +17 -24
  28. package/models/Layer2BasicInfo.ts +6 -9
  29. package/models/MainAccount.ts +6 -9
  30. package/models/MainAccounts.ts +5 -7
  31. package/models/MarketInfo.ts +22 -33
  32. package/models/MarketSig.ts +8 -12
  33. package/models/NextNonce.ts +2 -3
  34. package/models/Order.ts +32 -48
  35. package/models/OrderBook.ts +20 -30
  36. package/models/OrderBookDepth.ts +8 -11
  37. package/models/OrderBookDetail.ts +36 -54
  38. package/models/OrderBookDetails.ts +3 -4
  39. package/models/OrderBookOrders.ts +10 -14
  40. package/models/OrderBookStats.ts +12 -18
  41. package/models/OrderBooks.ts +3 -4
  42. package/models/Orders.ts +3 -4
  43. package/models/Permission.ts +2 -3
  44. package/models/PnLEntry.ts +4 -6
  45. package/models/PriceLevel.ts +4 -6
  46. package/models/ReqDoFaucet.ts +2 -3
  47. package/models/ReqGetAccount.ts +4 -6
  48. package/models/ReqGetAccountActiveOrders.ts +6 -9
  49. package/models/ReqGetAccountByL1Address.ts +2 -3
  50. package/models/ReqGetAccountInactiveOrders.ts +8 -12
  51. package/models/ReqGetAccountOrders.ts +6 -9
  52. package/models/ReqGetAccountPnL.ts +12 -18
  53. package/models/ReqGetBlock.ts +4 -6
  54. package/models/ReqGetBlockTxs.ts +4 -6
  55. package/models/ReqGetByAccount.ts +4 -6
  56. package/models/ReqGetCandlesticks.ts +10 -15
  57. package/models/ReqGetFundings.ts +10 -15
  58. package/models/ReqGetL1Tx.ts +2 -3
  59. package/models/ReqGetMarketSig.ts +6 -9
  60. package/models/ReqGetNextNonce.ts +4 -6
  61. package/models/ReqGetOrderBookDetails.ts +2 -3
  62. package/models/ReqGetOrderBookOrders.ts +4 -6
  63. package/models/ReqGetOrderBooks.ts +2 -3
  64. package/models/ReqGetPermission.ts +6 -9
  65. package/models/ReqGetRangeWithCursor.ts +2 -3
  66. package/models/ReqGetRangeWithIndex.ts +2 -3
  67. package/models/ReqGetRecentTrades.ts +4 -6
  68. package/models/ReqGetRollbacks.ts +6 -9
  69. package/models/ReqGetSubAccount.ts +6 -9
  70. package/models/ReqGetTrades.ts +8 -12
  71. package/models/ReqGetTx.ts +4 -6
  72. package/models/ReqSearch.ts +2 -3
  73. package/models/ResultCode.ts +2 -3
  74. package/models/Rollback.ts +8 -12
  75. package/models/Rollbacks.ts +5 -7
  76. package/models/Search.ts +2 -3
  77. package/models/SignBody.ts +2 -3
  78. package/models/SimpleOrder.ts +12 -18
  79. package/models/Status.ts +4 -6
  80. package/models/SubAccount.ts +16 -24
  81. package/models/SubAccounts.ts +9 -13
  82. package/models/Trade.ts +24 -36
  83. package/models/Trades.ts +3 -4
  84. package/models/Tx.ts +28 -42
  85. package/models/TxHash.ts +2 -3
  86. package/models/Txs.ts +3 -4
  87. package/models/ValidatorInfo.ts +4 -6
  88. package/openapi.json +192 -610
  89. package/package.json +1 -1
@@ -24,49 +24,43 @@ 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;
70
64
  return true;
71
65
  }
72
66
 
@@ -80,12 +74,12 @@ export function AccountMarketStatsFromJSONTyped(json: any, ignoreDiscriminator:
80
74
  }
81
75
  return {
82
76
 
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'],
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'],
89
83
  };
90
84
  }
91
85
 
@@ -43,21 +43,19 @@ 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;
61
59
  return true;
62
60
  }
63
61
 
@@ -73,8 +71,8 @@ export function AccountPnLFromJSONTyped(json: any, ignoreDiscriminator: boolean)
73
71
 
74
72
  'code': json['code'] == null ? undefined : json['code'],
75
73
  'message': json['message'] == null ? undefined : json['message'],
76
- 'resolution': json['resolution'],
77
- 'pnl': ((json['pnl'] as Array<any>).map(PnLEntryFromJSON)),
74
+ 'resolution': json['resolution'] == null ? undefined : json['resolution'],
75
+ 'pnl': json['pnl'] == null ? undefined : ((json['pnl'] as Array<any>).map(PnLEntryFromJSON)),
78
76
  };
79
77
  }
80
78
 
@@ -87,7 +85,7 @@ export function AccountPnLToJSON(value?: AccountPnL | null): any {
87
85
  'code': value['code'],
88
86
  'message': value['message'],
89
87
  'resolution': value['resolution'],
90
- 'pnl': ((value['pnl'] as Array<any>).map(PnLEntryToJSON)),
88
+ 'pnl': value['pnl'] == null ? undefined : ((value['pnl'] as Array<any>).map(PnLEntryToJSON)),
91
89
  };
92
90
  }
93
91
 
@@ -24,84 +24,73 @@ 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;
105
94
  return true;
106
95
  }
107
96
 
@@ -115,17 +104,17 @@ export function AccountPositionFromJSONTyped(json: any, ignoreDiscriminator: boo
115
104
  }
116
105
  return {
117
106
 
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'],
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'],
129
118
  };
130
119
  }
131
120
 
@@ -24,42 +24,37 @@ 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;
63
58
  return true;
64
59
  }
65
60
 
@@ -73,11 +68,11 @@ export function AccountStatsFromJSONTyped(json: any, ignoreDiscriminator: boolea
73
68
  }
74
69
  return {
75
70
 
76
- 'portfolioValue': json['portfolio_value'],
77
- 'leverage': json['leverage'],
78
- 'freeCollateral': json['free_collateral'],
79
- 'marginUsage': json['margin_usage'],
80
- 'buyingPower': json['buying_power'],
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'],
81
76
  };
82
77
  }
83
78
 
package/models/Block.ts CHANGED
@@ -31,98 +31,85 @@ export interface Block {
31
31
  * @type {string}
32
32
  * @memberof Block
33
33
  */
34
- commitment: string;
34
+ commitment?: string;
35
35
  /**
36
36
  *
37
37
  * @type {number}
38
38
  * @memberof Block
39
39
  */
40
- height: number;
40
+ height?: number;
41
41
  /**
42
42
  *
43
43
  * @type {string}
44
44
  * @memberof Block
45
45
  */
46
- stateRoot: string;
46
+ stateRoot?: string;
47
47
  /**
48
48
  *
49
49
  * @type {number}
50
50
  * @memberof Block
51
51
  */
52
- priorityOperations: number;
52
+ priorityOperations?: number;
53
53
  /**
54
54
  *
55
55
  * @type {number}
56
56
  * @memberof Block
57
57
  */
58
- onChainL2Operations: number;
58
+ onChainL2Operations?: number;
59
59
  /**
60
60
  *
61
61
  * @type {string}
62
62
  * @memberof Block
63
63
  */
64
- pendingOnChainOperationsPubData: string;
64
+ pendingOnChainOperationsPubData?: string;
65
65
  /**
66
66
  *
67
67
  * @type {string}
68
68
  * @memberof Block
69
69
  */
70
- committedTxHash: string;
70
+ committedTxHash?: string;
71
71
  /**
72
72
  *
73
73
  * @type {number}
74
74
  * @memberof Block
75
75
  */
76
- committedAt: number;
76
+ committedAt?: number;
77
77
  /**
78
78
  *
79
79
  * @type {string}
80
80
  * @memberof Block
81
81
  */
82
- verifiedTxHash: string;
82
+ verifiedTxHash?: string;
83
83
  /**
84
84
  *
85
85
  * @type {number}
86
86
  * @memberof Block
87
87
  */
88
- verifiedAt: number;
88
+ verifiedAt?: number;
89
89
  /**
90
90
  *
91
91
  * @type {Array<Tx>}
92
92
  * @memberof Block
93
93
  */
94
- txs: Array<Tx>;
94
+ txs?: Array<Tx>;
95
95
  /**
96
96
  *
97
97
  * @type {number}
98
98
  * @memberof Block
99
99
  */
100
- status: number;
100
+ status?: number;
101
101
  /**
102
102
  *
103
103
  * @type {number}
104
104
  * @memberof Block
105
105
  */
106
- size: number;
106
+ size?: number;
107
107
  }
108
108
 
109
109
  /**
110
110
  * Check if a given object implements the Block interface.
111
111
  */
112
112
  export function instanceOfBlock(value: object): value is Block {
113
- if (!('commitment' in value) || value['commitment'] === undefined) return false;
114
- if (!('height' in value) || value['height'] === undefined) return false;
115
- if (!('stateRoot' in value) || value['stateRoot'] === undefined) return false;
116
- if (!('priorityOperations' in value) || value['priorityOperations'] === undefined) return false;
117
- if (!('onChainL2Operations' in value) || value['onChainL2Operations'] === undefined) return false;
118
- if (!('pendingOnChainOperationsPubData' in value) || value['pendingOnChainOperationsPubData'] === undefined) return false;
119
- if (!('committedTxHash' in value) || value['committedTxHash'] === undefined) return false;
120
- if (!('committedAt' in value) || value['committedAt'] === undefined) return false;
121
- if (!('verifiedTxHash' in value) || value['verifiedTxHash'] === undefined) return false;
122
- if (!('verifiedAt' in value) || value['verifiedAt'] === undefined) return false;
123
- if (!('txs' in value) || value['txs'] === undefined) return false;
124
- if (!('status' in value) || value['status'] === undefined) return false;
125
- if (!('size' in value) || value['size'] === undefined) return false;
126
113
  return true;
127
114
  }
128
115
 
@@ -136,19 +123,19 @@ export function BlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): Blo
136
123
  }
137
124
  return {
138
125
 
139
- 'commitment': json['commitment'],
140
- 'height': json['height'],
141
- 'stateRoot': json['state_root'],
142
- 'priorityOperations': json['priority_operations'],
143
- 'onChainL2Operations': json['on_chain_l2_operations'],
144
- 'pendingOnChainOperationsPubData': json['pending_on_chain_operations_pub_data'],
145
- 'committedTxHash': json['committed_tx_hash'],
146
- 'committedAt': json['committed_at'],
147
- 'verifiedTxHash': json['verified_tx_hash'],
148
- 'verifiedAt': json['verified_at'],
149
- 'txs': ((json['txs'] as Array<any>).map(TxFromJSON)),
150
- 'status': json['status'],
151
- 'size': json['size'],
126
+ 'commitment': json['commitment'] == null ? undefined : json['commitment'],
127
+ 'height': json['height'] == null ? undefined : json['height'],
128
+ 'stateRoot': json['state_root'] == null ? undefined : json['state_root'],
129
+ 'priorityOperations': json['priority_operations'] == null ? undefined : json['priority_operations'],
130
+ 'onChainL2Operations': json['on_chain_l2_operations'] == null ? undefined : json['on_chain_l2_operations'],
131
+ 'pendingOnChainOperationsPubData': json['pending_on_chain_operations_pub_data'] == null ? undefined : json['pending_on_chain_operations_pub_data'],
132
+ 'committedTxHash': json['committed_tx_hash'] == null ? undefined : json['committed_tx_hash'],
133
+ 'committedAt': json['committed_at'] == null ? undefined : json['committed_at'],
134
+ 'verifiedTxHash': json['verified_tx_hash'] == null ? undefined : json['verified_tx_hash'],
135
+ 'verifiedAt': json['verified_at'] == null ? undefined : json['verified_at'],
136
+ 'txs': json['txs'] == null ? undefined : ((json['txs'] as Array<any>).map(TxFromJSON)),
137
+ 'status': json['status'] == null ? undefined : json['status'],
138
+ 'size': json['size'] == null ? undefined : json['size'],
152
139
  };
153
140
  }
154
141
 
@@ -168,7 +155,7 @@ export function BlockToJSON(value?: Block | null): any {
168
155
  'committed_at': value['committedAt'],
169
156
  'verified_tx_hash': value['verifiedTxHash'],
170
157
  'verified_at': value['verifiedAt'],
171
- 'txs': ((value['txs'] as Array<any>).map(TxToJSON)),
158
+ 'txs': value['txs'] == null ? undefined : ((value['txs'] as Array<any>).map(TxToJSON)),
172
159
  'status': value['status'],
173
160
  'size': value['size'],
174
161
  };
package/models/Blocks.ts CHANGED
@@ -43,21 +43,19 @@ export interface Blocks {
43
43
  * @type {number}
44
44
  * @memberof Blocks
45
45
  */
46
- total: number;
46
+ total?: number;
47
47
  /**
48
48
  *
49
49
  * @type {Array<Block>}
50
50
  * @memberof Blocks
51
51
  */
52
- blocks: Array<Block>;
52
+ blocks?: Array<Block>;
53
53
  }
54
54
 
55
55
  /**
56
56
  * Check if a given object implements the Blocks interface.
57
57
  */
58
58
  export function instanceOfBlocks(value: object): value is Blocks {
59
- if (!('total' in value) || value['total'] === undefined) return false;
60
- if (!('blocks' in value) || value['blocks'] === undefined) return false;
61
59
  return true;
62
60
  }
63
61
 
@@ -73,8 +71,8 @@ export function BlocksFromJSONTyped(json: any, ignoreDiscriminator: boolean): Bl
73
71
 
74
72
  'code': json['code'] == null ? undefined : json['code'],
75
73
  'message': json['message'] == null ? undefined : json['message'],
76
- 'total': json['total'],
77
- 'blocks': ((json['blocks'] as Array<any>).map(BlockFromJSON)),
74
+ 'total': json['total'] == null ? undefined : json['total'],
75
+ 'blocks': json['blocks'] == null ? undefined : ((json['blocks'] as Array<any>).map(BlockFromJSON)),
78
76
  };
79
77
  }
80
78
 
@@ -87,7 +85,7 @@ export function BlocksToJSON(value?: Blocks | null): any {
87
85
  'code': value['code'],
88
86
  'message': value['message'],
89
87
  'total': value['total'],
90
- 'blocks': ((value['blocks'] as Array<any>).map(BlockToJSON)),
88
+ 'blocks': value['blocks'] == null ? undefined : ((value['blocks'] as Array<any>).map(BlockToJSON)),
91
89
  };
92
90
  }
93
91
 
@@ -24,56 +24,49 @@ export interface Candlestick {
24
24
  * @type {number}
25
25
  * @memberof Candlestick
26
26
  */
27
- timestamp: number;
27
+ timestamp?: number;
28
28
  /**
29
29
  *
30
30
  * @type {number}
31
31
  * @memberof Candlestick
32
32
  */
33
- open: number;
33
+ open?: number;
34
34
  /**
35
35
  *
36
36
  * @type {number}
37
37
  * @memberof Candlestick
38
38
  */
39
- high: number;
39
+ high?: number;
40
40
  /**
41
41
  *
42
42
  * @type {number}
43
43
  * @memberof Candlestick
44
44
  */
45
- low: number;
45
+ low?: number;
46
46
  /**
47
47
  *
48
48
  * @type {number}
49
49
  * @memberof Candlestick
50
50
  */
51
- close: number;
51
+ close?: number;
52
52
  /**
53
53
  *
54
54
  * @type {number}
55
55
  * @memberof Candlestick
56
56
  */
57
- volume0: number;
57
+ volume0?: number;
58
58
  /**
59
59
  *
60
60
  * @type {number}
61
61
  * @memberof Candlestick
62
62
  */
63
- volume1: number;
63
+ volume1?: number;
64
64
  }
65
65
 
66
66
  /**
67
67
  * Check if a given object implements the Candlestick interface.
68
68
  */
69
69
  export function instanceOfCandlestick(value: object): value is Candlestick {
70
- if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
71
- if (!('open' in value) || value['open'] === undefined) return false;
72
- if (!('high' in value) || value['high'] === undefined) return false;
73
- if (!('low' in value) || value['low'] === undefined) return false;
74
- if (!('close' in value) || value['close'] === undefined) return false;
75
- if (!('volume0' in value) || value['volume0'] === undefined) return false;
76
- if (!('volume1' in value) || value['volume1'] === undefined) return false;
77
70
  return true;
78
71
  }
79
72
 
@@ -87,13 +80,13 @@ export function CandlestickFromJSONTyped(json: any, ignoreDiscriminator: boolean
87
80
  }
88
81
  return {
89
82
 
90
- 'timestamp': json['timestamp'],
91
- 'open': json['open'],
92
- 'high': json['high'],
93
- 'low': json['low'],
94
- 'close': json['close'],
95
- 'volume0': json['volume0'],
96
- 'volume1': json['volume1'],
83
+ 'timestamp': json['timestamp'] == null ? undefined : json['timestamp'],
84
+ 'open': json['open'] == null ? undefined : json['open'],
85
+ 'high': json['high'] == null ? undefined : json['high'],
86
+ 'low': json['low'] == null ? undefined : json['low'],
87
+ 'close': json['close'] == null ? undefined : json['close'],
88
+ 'volume0': json['volume0'] == null ? undefined : json['volume0'],
89
+ 'volume1': json['volume1'] == null ? undefined : json['volume1'],
97
90
  };
98
91
  }
99
92
 
@@ -43,21 +43,19 @@ export interface Candlesticks {
43
43
  * @type {string}
44
44
  * @memberof Candlesticks
45
45
  */
46
- resolution: string;
46
+ resolution?: string;
47
47
  /**
48
48
  *
49
49
  * @type {Array<Candlestick>}
50
50
  * @memberof Candlesticks
51
51
  */
52
- candlesticks: Array<Candlestick>;
52
+ candlesticks?: Array<Candlestick>;
53
53
  }
54
54
 
55
55
  /**
56
56
  * Check if a given object implements the Candlesticks interface.
57
57
  */
58
58
  export function instanceOfCandlesticks(value: object): value is Candlesticks {
59
- if (!('resolution' in value) || value['resolution'] === undefined) return false;
60
- if (!('candlesticks' in value) || value['candlesticks'] === undefined) return false;
61
59
  return true;
62
60
  }
63
61
 
@@ -73,8 +71,8 @@ export function CandlesticksFromJSONTyped(json: any, ignoreDiscriminator: boolea
73
71
 
74
72
  'code': json['code'] == null ? undefined : json['code'],
75
73
  'message': json['message'] == null ? undefined : json['message'],
76
- 'resolution': json['resolution'],
77
- 'candlesticks': ((json['candlesticks'] as Array<any>).map(CandlestickFromJSON)),
74
+ 'resolution': json['resolution'] == null ? undefined : json['resolution'],
75
+ 'candlesticks': json['candlesticks'] == null ? undefined : ((json['candlesticks'] as Array<any>).map(CandlestickFromJSON)),
78
76
  };
79
77
  }
80
78
 
@@ -87,7 +85,7 @@ export function CandlesticksToJSON(value?: Candlesticks | null): any {
87
85
  'code': value['code'],
88
86
  'message': value['message'],
89
87
  'resolution': value['resolution'],
90
- 'candlesticks': ((value['candlesticks'] as Array<any>).map(CandlestickToJSON)),
88
+ 'candlesticks': value['candlesticks'] == null ? undefined : ((value['candlesticks'] as Array<any>).map(CandlestickToJSON)),
91
89
  };
92
90
  }
93
91
 
@@ -24,21 +24,19 @@ export interface ContractAddress {
24
24
  * @type {string}
25
25
  * @memberof ContractAddress
26
26
  */
27
- name: string;
27
+ name?: string;
28
28
  /**
29
29
  *
30
30
  * @type {string}
31
31
  * @memberof ContractAddress
32
32
  */
33
- address: string;
33
+ address?: string;
34
34
  }
35
35
 
36
36
  /**
37
37
  * Check if a given object implements the ContractAddress interface.
38
38
  */
39
39
  export function instanceOfContractAddress(value: object): value is ContractAddress {
40
- if (!('name' in value) || value['name'] === undefined) return false;
41
- if (!('address' in value) || value['address'] === undefined) return false;
42
40
  return true;
43
41
  }
44
42
 
@@ -52,8 +50,8 @@ export function ContractAddressFromJSONTyped(json: any, ignoreDiscriminator: boo
52
50
  }
53
51
  return {
54
52
 
55
- 'name': json['name'],
56
- 'address': json['address'],
53
+ 'name': json['name'] == null ? undefined : json['name'],
54
+ 'address': json['address'] == null ? undefined : json['address'],
57
55
  };
58
56
  }
59
57