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
@@ -36,14 +36,13 @@ export interface CurrentHeight {
36
36
  * @type {number}
37
37
  * @memberof CurrentHeight
38
38
  */
39
- height: number;
39
+ height?: number;
40
40
  }
41
41
 
42
42
  /**
43
43
  * Check if a given object implements the CurrentHeight interface.
44
44
  */
45
45
  export function instanceOfCurrentHeight(value: object): value is CurrentHeight {
46
- if (!('height' in value) || value['height'] === undefined) return false;
47
46
  return true;
48
47
  }
49
48
 
@@ -59,7 +58,7 @@ export function CurrentHeightFromJSONTyped(json: any, ignoreDiscriminator: boole
59
58
 
60
59
  'code': json['code'] == null ? undefined : json['code'],
61
60
  'message': json['message'] == null ? undefined : json['message'],
62
- 'height': json['height'],
61
+ 'height': json['height'] == null ? undefined : json['height'],
63
62
  };
64
63
  }
65
64
 
@@ -97,28 +97,25 @@ export interface DetailedAccount {
97
97
  * @type {Array<AccountPosition>}
98
98
  * @memberof DetailedAccount
99
99
  */
100
- positions: Array<AccountPosition>;
100
+ positions?: Array<AccountPosition>;
101
101
  /**
102
102
  *
103
103
  * @type {string}
104
104
  * @memberof DetailedAccount
105
105
  */
106
- totalAssetValue: string;
106
+ totalAssetValue?: string;
107
107
  /**
108
108
  *
109
109
  * @type {Array<AccountMarketStats>}
110
110
  * @memberof DetailedAccount
111
111
  */
112
- marketStats: Array<AccountMarketStats>;
112
+ marketStats?: Array<AccountMarketStats>;
113
113
  }
114
114
 
115
115
  /**
116
116
  * Check if a given object implements the DetailedAccount interface.
117
117
  */
118
118
  export function instanceOfDetailedAccount(value: object): value is DetailedAccount {
119
- if (!('positions' in value) || value['positions'] === undefined) return false;
120
- if (!('totalAssetValue' in value) || value['totalAssetValue'] === undefined) return false;
121
- if (!('marketStats' in value) || value['marketStats'] === undefined) return false;
122
119
  return true;
123
120
  }
124
121
 
@@ -142,9 +139,9 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
142
139
  'status': json['status'] == null ? undefined : json['status'],
143
140
  'collateral': json['collateral'] == null ? undefined : json['collateral'],
144
141
  'collateralType': json['collateral_type'] == null ? undefined : json['collateral_type'],
145
- 'positions': ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
146
- 'totalAssetValue': json['total_asset_value'],
147
- 'marketStats': ((json['market_stats'] as Array<any>).map(AccountMarketStatsFromJSON)),
142
+ 'positions': json['positions'] == null ? undefined : ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
143
+ 'totalAssetValue': json['total_asset_value'] == null ? undefined : json['total_asset_value'],
144
+ 'marketStats': json['market_stats'] == null ? undefined : ((json['market_stats'] as Array<any>).map(AccountMarketStatsFromJSON)),
148
145
  };
149
146
  }
150
147
 
@@ -164,9 +161,9 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
164
161
  'status': value['status'],
165
162
  'collateral': value['collateral'],
166
163
  'collateral_type': value['collateralType'],
167
- 'positions': ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
164
+ 'positions': value['positions'] == null ? undefined : ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
168
165
  'total_asset_value': value['totalAssetValue'],
169
- 'market_stats': ((value['marketStats'] as Array<any>).map(AccountMarketStatsToJSON)),
166
+ 'market_stats': value['marketStats'] == null ? undefined : ((value['marketStats'] as Array<any>).map(AccountMarketStatsToJSON)),
170
167
  };
171
168
  }
172
169
 
@@ -43,21 +43,19 @@ export interface DetailedAccounts {
43
43
  * @type {number}
44
44
  * @memberof DetailedAccounts
45
45
  */
46
- total: number;
46
+ total?: number;
47
47
  /**
48
48
  *
49
49
  * @type {Array<DetailedAccount>}
50
50
  * @memberof DetailedAccounts
51
51
  */
52
- accounts: Array<DetailedAccount>;
52
+ accounts?: Array<DetailedAccount>;
53
53
  }
54
54
 
55
55
  /**
56
56
  * Check if a given object implements the DetailedAccounts interface.
57
57
  */
58
58
  export function instanceOfDetailedAccounts(value: object): value is DetailedAccounts {
59
- if (!('total' in value) || value['total'] === undefined) return false;
60
- if (!('accounts' in value) || value['accounts'] === undefined) return false;
61
59
  return true;
62
60
  }
63
61
 
@@ -73,8 +71,8 @@ export function DetailedAccountsFromJSONTyped(json: any, ignoreDiscriminator: bo
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
- 'accounts': ((json['accounts'] as Array<any>).map(DetailedAccountFromJSON)),
74
+ 'total': json['total'] == null ? undefined : json['total'],
75
+ 'accounts': json['accounts'] == null ? undefined : ((json['accounts'] as Array<any>).map(DetailedAccountFromJSON)),
78
76
  };
79
77
  }
80
78
 
@@ -87,7 +85,7 @@ export function DetailedAccountsToJSON(value?: DetailedAccounts | null): any {
87
85
  'code': value['code'],
88
86
  'message': value['message'],
89
87
  'total': value['total'],
90
- 'accounts': ((value['accounts'] as Array<any>).map(DetailedAccountToJSON)),
88
+ 'accounts': value['accounts'] == null ? undefined : ((value['accounts'] as Array<any>).map(DetailedAccountToJSON)),
91
89
  };
92
90
  }
93
91
 
@@ -120,28 +120,25 @@ export interface EnrichedTx {
120
120
  * @type {number}
121
121
  * @memberof EnrichedTx
122
122
  */
123
- committedAt: number;
123
+ committedAt?: number;
124
124
  /**
125
125
  *
126
126
  * @type {number}
127
127
  * @memberof EnrichedTx
128
128
  */
129
- verifiedAt: number;
129
+ verifiedAt?: number;
130
130
  /**
131
131
  *
132
132
  * @type {number}
133
133
  * @memberof EnrichedTx
134
134
  */
135
- executedAt: number;
135
+ executedAt?: number;
136
136
  }
137
137
 
138
138
  /**
139
139
  * Check if a given object implements the EnrichedTx interface.
140
140
  */
141
141
  export function instanceOfEnrichedTx(value: object): value is EnrichedTx {
142
- if (!('committedAt' in value) || value['committedAt'] === undefined) return false;
143
- if (!('verifiedAt' in value) || value['verifiedAt'] === undefined) return false;
144
- if (!('executedAt' in value) || value['executedAt'] === undefined) return false;
145
142
  return true;
146
143
  }
147
144
 
@@ -171,9 +168,9 @@ export function EnrichedTxFromJSONTyped(json: any, ignoreDiscriminator: boolean)
171
168
  'createdAt': json['created_at'] == null ? undefined : json['created_at'],
172
169
  'verifyAt': json['verify_at'] == null ? undefined : json['verify_at'],
173
170
  'sequenceIndex': json['sequence_index'] == null ? undefined : json['sequence_index'],
174
- 'committedAt': json['committed_at'],
175
- 'verifiedAt': json['verified_at'],
176
- 'executedAt': json['executed_at'],
171
+ 'committedAt': json['committed_at'] == null ? undefined : json['committed_at'],
172
+ 'verifiedAt': json['verified_at'] == null ? undefined : json['verified_at'],
173
+ 'executedAt': json['executed_at'] == null ? undefined : json['executed_at'],
177
174
  };
178
175
  }
179
176
 
@@ -43,35 +43,31 @@ export interface ExchangeStats {
43
43
  * @type {number}
44
44
  * @memberof ExchangeStats
45
45
  */
46
- total: number;
46
+ total?: number;
47
47
  /**
48
48
  *
49
49
  * @type {Array<OrderBookStats>}
50
50
  * @memberof ExchangeStats
51
51
  */
52
- orderBookStats: Array<OrderBookStats>;
52
+ orderBookStats?: Array<OrderBookStats>;
53
53
  /**
54
54
  *
55
55
  * @type {number}
56
56
  * @memberof ExchangeStats
57
57
  */
58
- dailyUsdVolume: number;
58
+ dailyUsdVolume?: number;
59
59
  /**
60
60
  *
61
61
  * @type {number}
62
62
  * @memberof ExchangeStats
63
63
  */
64
- dailyTradesCount: number;
64
+ dailyTradesCount?: number;
65
65
  }
66
66
 
67
67
  /**
68
68
  * Check if a given object implements the ExchangeStats interface.
69
69
  */
70
70
  export function instanceOfExchangeStats(value: object): value is ExchangeStats {
71
- if (!('total' in value) || value['total'] === undefined) return false;
72
- if (!('orderBookStats' in value) || value['orderBookStats'] === undefined) return false;
73
- if (!('dailyUsdVolume' in value) || value['dailyUsdVolume'] === undefined) return false;
74
- if (!('dailyTradesCount' in value) || value['dailyTradesCount'] === undefined) return false;
75
71
  return true;
76
72
  }
77
73
 
@@ -87,10 +83,10 @@ export function ExchangeStatsFromJSONTyped(json: any, ignoreDiscriminator: boole
87
83
 
88
84
  'code': json['code'] == null ? undefined : json['code'],
89
85
  'message': json['message'] == null ? undefined : json['message'],
90
- 'total': json['total'],
91
- 'orderBookStats': ((json['order_book_stats'] as Array<any>).map(OrderBookStatsFromJSON)),
92
- 'dailyUsdVolume': json['daily_usd_volume'],
93
- 'dailyTradesCount': json['daily_trades_count'],
86
+ 'total': json['total'] == null ? undefined : json['total'],
87
+ 'orderBookStats': json['order_book_stats'] == null ? undefined : ((json['order_book_stats'] as Array<any>).map(OrderBookStatsFromJSON)),
88
+ 'dailyUsdVolume': json['daily_usd_volume'] == null ? undefined : json['daily_usd_volume'],
89
+ 'dailyTradesCount': json['daily_trades_count'] == null ? undefined : json['daily_trades_count'],
94
90
  };
95
91
  }
96
92
 
@@ -103,7 +99,7 @@ export function ExchangeStatsToJSON(value?: ExchangeStats | null): any {
103
99
  'code': value['code'],
104
100
  'message': value['message'],
105
101
  'total': value['total'],
106
- 'order_book_stats': ((value['orderBookStats'] as Array<any>).map(OrderBookStatsToJSON)),
102
+ 'order_book_stats': value['orderBookStats'] == null ? undefined : ((value['orderBookStats'] as Array<any>).map(OrderBookStatsToJSON)),
107
103
  'daily_usd_volume': value['dailyUsdVolume'],
108
104
  'daily_trades_count': value['dailyTradesCount'],
109
105
  };
package/models/Funding.ts CHANGED
@@ -24,35 +24,31 @@ export interface Funding {
24
24
  * @type {number}
25
25
  * @memberof Funding
26
26
  */
27
- timestamp: number;
27
+ timestamp?: number;
28
28
  /**
29
29
  *
30
30
  * @type {string}
31
31
  * @memberof Funding
32
32
  */
33
- value: string;
33
+ value?: string;
34
34
  /**
35
35
  *
36
36
  * @type {string}
37
37
  * @memberof Funding
38
38
  */
39
- rate: string;
39
+ rate?: string;
40
40
  /**
41
41
  *
42
42
  * @type {string}
43
43
  * @memberof Funding
44
44
  */
45
- direction: string;
45
+ direction?: string;
46
46
  }
47
47
 
48
48
  /**
49
49
  * Check if a given object implements the Funding interface.
50
50
  */
51
51
  export function instanceOfFunding(value: object): value is Funding {
52
- if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
53
- if (!('value' in value) || value['value'] === undefined) return false;
54
- if (!('rate' in value) || value['rate'] === undefined) return false;
55
- if (!('direction' in value) || value['direction'] === undefined) return false;
56
52
  return true;
57
53
  }
58
54
 
@@ -66,10 +62,10 @@ export function FundingFromJSONTyped(json: any, ignoreDiscriminator: boolean): F
66
62
  }
67
63
  return {
68
64
 
69
- 'timestamp': json['timestamp'],
70
- 'value': json['value'],
71
- 'rate': json['rate'],
72
- 'direction': json['direction'],
65
+ 'timestamp': json['timestamp'] == null ? undefined : json['timestamp'],
66
+ 'value': json['value'] == null ? undefined : json['value'],
67
+ 'rate': json['rate'] == null ? undefined : json['rate'],
68
+ 'direction': json['direction'] == null ? undefined : json['direction'],
73
69
  };
74
70
  }
75
71
 
@@ -43,21 +43,19 @@ export interface Fundings {
43
43
  * @type {string}
44
44
  * @memberof Fundings
45
45
  */
46
- resolution: string;
46
+ resolution?: string;
47
47
  /**
48
48
  *
49
49
  * @type {Array<Funding>}
50
50
  * @memberof Fundings
51
51
  */
52
- fundings: Array<Funding>;
52
+ fundings?: Array<Funding>;
53
53
  }
54
54
 
55
55
  /**
56
56
  * Check if a given object implements the Fundings interface.
57
57
  */
58
58
  export function instanceOfFundings(value: object): value is Fundings {
59
- if (!('resolution' in value) || value['resolution'] === undefined) return false;
60
- if (!('fundings' in value) || value['fundings'] === undefined) return false;
61
59
  return true;
62
60
  }
63
61
 
@@ -73,8 +71,8 @@ export function FundingsFromJSONTyped(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
- 'fundings': ((json['fundings'] as Array<any>).map(FundingFromJSON)),
74
+ 'resolution': json['resolution'] == null ? undefined : json['resolution'],
75
+ 'fundings': json['fundings'] == null ? undefined : ((json['fundings'] as Array<any>).map(FundingFromJSON)),
78
76
  };
79
77
  }
80
78
 
@@ -87,7 +85,7 @@ export function FundingsToJSON(value?: Fundings | null): any {
87
85
  'code': value['code'],
88
86
  'message': value['message'],
89
87
  'resolution': value['resolution'],
90
- 'fundings': ((value['fundings'] as Array<any>).map(FundingToJSON)),
88
+ 'fundings': value['fundings'] == null ? undefined : ((value['fundings'] as Array<any>).map(FundingToJSON)),
91
89
  };
92
90
  }
93
91
 
@@ -24,35 +24,31 @@ export interface L1ProviderInfo {
24
24
  * @type {number}
25
25
  * @memberof L1ProviderInfo
26
26
  */
27
- chainId: number;
27
+ chainId?: number;
28
28
  /**
29
29
  *
30
30
  * @type {number}
31
31
  * @memberof L1ProviderInfo
32
32
  */
33
- networkId: number;
33
+ networkId?: number;
34
34
  /**
35
35
  *
36
36
  * @type {number}
37
37
  * @memberof L1ProviderInfo
38
38
  */
39
- latestBlockNumber: number;
39
+ latestBlockNumber?: number;
40
40
  /**
41
41
  *
42
42
  * @type {string}
43
43
  * @memberof L1ProviderInfo
44
44
  */
45
- networkRpc: string;
45
+ networkRpc?: string;
46
46
  }
47
47
 
48
48
  /**
49
49
  * Check if a given object implements the L1ProviderInfo interface.
50
50
  */
51
51
  export function instanceOfL1ProviderInfo(value: object): value is L1ProviderInfo {
52
- if (!('chainId' in value) || value['chainId'] === undefined) return false;
53
- if (!('networkId' in value) || value['networkId'] === undefined) return false;
54
- if (!('latestBlockNumber' in value) || value['latestBlockNumber'] === undefined) return false;
55
- if (!('networkRpc' in value) || value['networkRpc'] === undefined) return false;
56
52
  return true;
57
53
  }
58
54
 
@@ -66,10 +62,10 @@ export function L1ProviderInfoFromJSONTyped(json: any, ignoreDiscriminator: bool
66
62
  }
67
63
  return {
68
64
 
69
- 'chainId': json['chainId'],
70
- 'networkId': json['networkId'],
71
- 'latestBlockNumber': json['latestBlockNumber'],
72
- 'networkRpc': json['NetworkRpc'],
65
+ 'chainId': json['chainId'] == null ? undefined : json['chainId'],
66
+ 'networkId': json['networkId'] == null ? undefined : json['networkId'],
67
+ 'latestBlockNumber': json['latestBlockNumber'] == null ? undefined : json['latestBlockNumber'],
68
+ 'networkRpc': json['NetworkRpc'] == null ? undefined : json['NetworkRpc'],
73
69
  };
74
70
  }
75
71
 
@@ -55,56 +55,49 @@ export interface Layer1BasicInfo {
55
55
  * @type {Array<L1ProviderInfo>}
56
56
  * @memberof Layer1BasicInfo
57
57
  */
58
- l1Providers: Array<L1ProviderInfo>;
58
+ l1Providers?: Array<L1ProviderInfo>;
59
59
  /**
60
60
  *
61
61
  * @type {boolean}
62
62
  * @memberof Layer1BasicInfo
63
63
  */
64
- l1ProvidersHealth: boolean;
64
+ l1ProvidersHealth?: boolean;
65
65
  /**
66
66
  *
67
67
  * @type {Array<ValidatorInfo>}
68
68
  * @memberof Layer1BasicInfo
69
69
  */
70
- validatorInfo: Array<ValidatorInfo>;
70
+ validatorInfo?: Array<ValidatorInfo>;
71
71
  /**
72
72
  *
73
73
  * @type {Array<ContractAddress>}
74
74
  * @memberof Layer1BasicInfo
75
75
  */
76
- contractAddresses: Array<ContractAddress>;
76
+ contractAddresses?: Array<ContractAddress>;
77
77
  /**
78
78
  *
79
79
  * @type {number}
80
80
  * @memberof Layer1BasicInfo
81
81
  */
82
- latestL1GenericBlock: number;
82
+ latestL1GenericBlock?: number;
83
83
  /**
84
84
  *
85
85
  * @type {number}
86
86
  * @memberof Layer1BasicInfo
87
87
  */
88
- latestL1GovernanceBlock: number;
88
+ latestL1GovernanceBlock?: number;
89
89
  /**
90
90
  *
91
91
  * @type {number}
92
92
  * @memberof Layer1BasicInfo
93
93
  */
94
- latestL1DesertBlock: number;
94
+ latestL1DesertBlock?: number;
95
95
  }
96
96
 
97
97
  /**
98
98
  * Check if a given object implements the Layer1BasicInfo interface.
99
99
  */
100
100
  export function instanceOfLayer1BasicInfo(value: object): value is Layer1BasicInfo {
101
- if (!('l1Providers' in value) || value['l1Providers'] === undefined) return false;
102
- if (!('l1ProvidersHealth' in value) || value['l1ProvidersHealth'] === undefined) return false;
103
- if (!('validatorInfo' in value) || value['validatorInfo'] === undefined) return false;
104
- if (!('contractAddresses' in value) || value['contractAddresses'] === undefined) return false;
105
- if (!('latestL1GenericBlock' in value) || value['latestL1GenericBlock'] === undefined) return false;
106
- if (!('latestL1GovernanceBlock' in value) || value['latestL1GovernanceBlock'] === undefined) return false;
107
- if (!('latestL1DesertBlock' in value) || value['latestL1DesertBlock'] === undefined) return false;
108
101
  return true;
109
102
  }
110
103
 
@@ -120,13 +113,13 @@ export function Layer1BasicInfoFromJSONTyped(json: any, ignoreDiscriminator: boo
120
113
 
121
114
  'code': json['code'] == null ? undefined : json['code'],
122
115
  'message': json['message'] == null ? undefined : json['message'],
123
- 'l1Providers': ((json['l1_providers'] as Array<any>).map(L1ProviderInfoFromJSON)),
124
- 'l1ProvidersHealth': json['l1_providers_health'],
125
- 'validatorInfo': ((json['validator_Info'] as Array<any>).map(ValidatorInfoFromJSON)),
126
- 'contractAddresses': ((json['contract_addresses'] as Array<any>).map(ContractAddressFromJSON)),
127
- 'latestL1GenericBlock': json['latest_l1_generic_block'],
128
- 'latestL1GovernanceBlock': json['latest_l1_governance_block'],
129
- 'latestL1DesertBlock': json['latest_l1_desert_block'],
116
+ 'l1Providers': json['l1_providers'] == null ? undefined : ((json['l1_providers'] as Array<any>).map(L1ProviderInfoFromJSON)),
117
+ 'l1ProvidersHealth': json['l1_providers_health'] == null ? undefined : json['l1_providers_health'],
118
+ 'validatorInfo': json['validator_Info'] == null ? undefined : ((json['validator_Info'] as Array<any>).map(ValidatorInfoFromJSON)),
119
+ 'contractAddresses': json['contract_addresses'] == null ? undefined : ((json['contract_addresses'] as Array<any>).map(ContractAddressFromJSON)),
120
+ 'latestL1GenericBlock': json['latest_l1_generic_block'] == null ? undefined : json['latest_l1_generic_block'],
121
+ 'latestL1GovernanceBlock': json['latest_l1_governance_block'] == null ? undefined : json['latest_l1_governance_block'],
122
+ 'latestL1DesertBlock': json['latest_l1_desert_block'] == null ? undefined : json['latest_l1_desert_block'],
130
123
  };
131
124
  }
132
125
 
@@ -138,10 +131,10 @@ export function Layer1BasicInfoToJSON(value?: Layer1BasicInfo | null): any {
138
131
 
139
132
  'code': value['code'],
140
133
  'message': value['message'],
141
- 'l1_providers': ((value['l1Providers'] as Array<any>).map(L1ProviderInfoToJSON)),
134
+ 'l1_providers': value['l1Providers'] == null ? undefined : ((value['l1Providers'] as Array<any>).map(L1ProviderInfoToJSON)),
142
135
  'l1_providers_health': value['l1ProvidersHealth'],
143
- 'validator_Info': ((value['validatorInfo'] as Array<any>).map(ValidatorInfoToJSON)),
144
- 'contract_addresses': ((value['contractAddresses'] as Array<any>).map(ContractAddressToJSON)),
136
+ 'validator_Info': value['validatorInfo'] == null ? undefined : ((value['validatorInfo'] as Array<any>).map(ValidatorInfoToJSON)),
137
+ 'contract_addresses': value['contractAddresses'] == null ? undefined : ((value['contractAddresses'] as Array<any>).map(ContractAddressToJSON)),
145
138
  'latest_l1_generic_block': value['latestL1GenericBlock'],
146
139
  'latest_l1_governance_block': value['latestL1GovernanceBlock'],
147
140
  'latest_l1_desert_block': value['latestL1DesertBlock'],
@@ -36,28 +36,25 @@ export interface Layer2BasicInfo {
36
36
  * @type {number}
37
37
  * @memberof Layer2BasicInfo
38
38
  */
39
- blockCommitted: number;
39
+ blockCommitted?: number;
40
40
  /**
41
41
  *
42
42
  * @type {number}
43
43
  * @memberof Layer2BasicInfo
44
44
  */
45
- blockVerified: number;
45
+ blockVerified?: number;
46
46
  /**
47
47
  *
48
48
  * @type {number}
49
49
  * @memberof Layer2BasicInfo
50
50
  */
51
- totalTransactionCount: number;
51
+ totalTransactionCount?: number;
52
52
  }
53
53
 
54
54
  /**
55
55
  * Check if a given object implements the Layer2BasicInfo interface.
56
56
  */
57
57
  export function instanceOfLayer2BasicInfo(value: object): value is Layer2BasicInfo {
58
- if (!('blockCommitted' in value) || value['blockCommitted'] === undefined) return false;
59
- if (!('blockVerified' in value) || value['blockVerified'] === undefined) return false;
60
- if (!('totalTransactionCount' in value) || value['totalTransactionCount'] === undefined) return false;
61
58
  return true;
62
59
  }
63
60
 
@@ -73,9 +70,9 @@ export function Layer2BasicInfoFromJSONTyped(json: any, ignoreDiscriminator: boo
73
70
 
74
71
  'code': json['code'] == null ? undefined : json['code'],
75
72
  'message': json['message'] == null ? undefined : json['message'],
76
- 'blockCommitted': json['block_committed'],
77
- 'blockVerified': json['block_verified'],
78
- 'totalTransactionCount': json['total_transaction_count'],
73
+ 'blockCommitted': json['block_committed'] == null ? undefined : json['block_committed'],
74
+ 'blockVerified': json['block_verified'] == null ? undefined : json['block_verified'],
75
+ 'totalTransactionCount': json['total_transaction_count'] == null ? undefined : json['total_transaction_count'],
79
76
  };
80
77
  }
81
78
 
@@ -36,28 +36,25 @@ export interface MainAccount {
36
36
  * @type {number}
37
37
  * @memberof MainAccount
38
38
  */
39
- index: number;
39
+ index?: number;
40
40
  /**
41
41
  *
42
42
  * @type {string}
43
43
  * @memberof MainAccount
44
44
  */
45
- l1Address: string;
45
+ l1Address?: string;
46
46
  /**
47
47
  *
48
48
  * @type {number}
49
49
  * @memberof MainAccount
50
50
  */
51
- status: number;
51
+ status?: number;
52
52
  }
53
53
 
54
54
  /**
55
55
  * Check if a given object implements the MainAccount interface.
56
56
  */
57
57
  export function instanceOfMainAccount(value: object): value is MainAccount {
58
- if (!('index' in value) || value['index'] === undefined) return false;
59
- if (!('l1Address' in value) || value['l1Address'] === undefined) return false;
60
- if (!('status' in value) || value['status'] === undefined) return false;
61
58
  return true;
62
59
  }
63
60
 
@@ -73,9 +70,9 @@ export function MainAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean
73
70
 
74
71
  'code': json['code'] == null ? undefined : json['code'],
75
72
  'message': json['message'] == null ? undefined : json['message'],
76
- 'index': json['index'],
77
- 'l1Address': json['l1_address'],
78
- 'status': json['status'],
73
+ 'index': json['index'] == null ? undefined : json['index'],
74
+ 'l1Address': json['l1_address'] == null ? undefined : json['l1_address'],
75
+ 'status': json['status'] == null ? undefined : json['status'],
79
76
  };
80
77
  }
81
78
 
@@ -43,21 +43,19 @@ export interface MainAccounts {
43
43
  * @type {number}
44
44
  * @memberof MainAccounts
45
45
  */
46
- total: number;
46
+ total?: number;
47
47
  /**
48
48
  *
49
49
  * @type {Array<MainAccount>}
50
50
  * @memberof MainAccounts
51
51
  */
52
- accounts: Array<MainAccount>;
52
+ accounts?: Array<MainAccount>;
53
53
  }
54
54
 
55
55
  /**
56
56
  * Check if a given object implements the MainAccounts interface.
57
57
  */
58
58
  export function instanceOfMainAccounts(value: object): value is MainAccounts {
59
- if (!('total' in value) || value['total'] === undefined) return false;
60
- if (!('accounts' in value) || value['accounts'] === undefined) return false;
61
59
  return true;
62
60
  }
63
61
 
@@ -73,8 +71,8 @@ export function MainAccountsFromJSONTyped(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
- 'total': json['total'],
77
- 'accounts': ((json['accounts'] as Array<any>).map(MainAccountFromJSON)),
74
+ 'total': json['total'] == null ? undefined : json['total'],
75
+ 'accounts': json['accounts'] == null ? undefined : ((json['accounts'] as Array<any>).map(MainAccountFromJSON)),
78
76
  };
79
77
  }
80
78
 
@@ -87,7 +85,7 @@ export function MainAccountsToJSON(value?: MainAccounts | null): any {
87
85
  'code': value['code'],
88
86
  'message': value['message'],
89
87
  'total': value['total'],
90
- 'accounts': ((value['accounts'] as Array<any>).map(MainAccountToJSON)),
88
+ 'accounts': value['accounts'] == null ? undefined : ((value['accounts'] as Array<any>).map(MainAccountToJSON)),
91
89
  };
92
90
  }
93
91