lighter-sdk 0.1.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. lighter/__init__.py +140 -0
  2. lighter/api/__init__.py +11 -0
  3. lighter/api/account_api.py +2371 -0
  4. lighter/api/block_api.py +863 -0
  5. lighter/api/candlestick_api.py +718 -0
  6. lighter/api/info_api.py +282 -0
  7. lighter/api/order_api.py +2734 -0
  8. lighter/api/root_api.py +529 -0
  9. lighter/api/transaction_api.py +3525 -0
  10. lighter/api_client.py +784 -0
  11. lighter/api_response.py +21 -0
  12. lighter/configuration.py +475 -0
  13. lighter/exceptions.py +199 -0
  14. lighter/models/__init__.py +112 -0
  15. lighter/models/account.py +110 -0
  16. lighter/models/account_api_keys.py +104 -0
  17. lighter/models/account_market_stats.py +98 -0
  18. lighter/models/account_metadata.py +94 -0
  19. lighter/models/account_pn_l.py +106 -0
  20. lighter/models/account_position.py +112 -0
  21. lighter/models/account_stats.py +102 -0
  22. lighter/models/accounts.py +106 -0
  23. lighter/models/api_key.py +98 -0
  24. lighter/models/block.py +124 -0
  25. lighter/models/blocks.py +106 -0
  26. lighter/models/bridge_supported_network.py +96 -0
  27. lighter/models/candlestick.py +106 -0
  28. lighter/models/candlesticks.py +106 -0
  29. lighter/models/contract_address.py +94 -0
  30. lighter/models/current_height.py +96 -0
  31. lighter/models/cursor.py +92 -0
  32. lighter/models/deposit_history.py +106 -0
  33. lighter/models/deposit_history_item.py +105 -0
  34. lighter/models/detailed_account.py +152 -0
  35. lighter/models/detailed_accounts.py +106 -0
  36. lighter/models/detailed_candlestick.py +108 -0
  37. lighter/models/enriched_tx.py +129 -0
  38. lighter/models/exchange_stats.py +110 -0
  39. lighter/models/fee_bucket.py +96 -0
  40. lighter/models/funding.py +98 -0
  41. lighter/models/fundings.py +106 -0
  42. lighter/models/is_whitelisted.py +98 -0
  43. lighter/models/l1_provider_info.py +98 -0
  44. lighter/models/layer2_basic_info.py +100 -0
  45. lighter/models/liquidation.py +100 -0
  46. lighter/models/market_info.py +116 -0
  47. lighter/models/next_nonce.py +96 -0
  48. lighter/models/order.py +159 -0
  49. lighter/models/order_book.py +119 -0
  50. lighter/models/order_book_depth.py +115 -0
  51. lighter/models/order_book_detail.py +151 -0
  52. lighter/models/order_book_details.py +104 -0
  53. lighter/models/order_book_orders.py +117 -0
  54. lighter/models/order_book_stats.py +102 -0
  55. lighter/models/order_books.py +104 -0
  56. lighter/models/orders.py +106 -0
  57. lighter/models/pn_l_entry.py +94 -0
  58. lighter/models/position_funding.py +111 -0
  59. lighter/models/price_level.py +94 -0
  60. lighter/models/public_pool.py +128 -0
  61. lighter/models/public_pool_info.py +100 -0
  62. lighter/models/public_pool_share.py +96 -0
  63. lighter/models/public_pools.py +106 -0
  64. lighter/models/req_get_account.py +101 -0
  65. lighter/models/req_get_account_active_orders.py +96 -0
  66. lighter/models/req_get_account_api_keys.py +94 -0
  67. lighter/models/req_get_account_by_l1_address.py +92 -0
  68. lighter/models/req_get_account_inactive_orders.py +103 -0
  69. lighter/models/req_get_account_orders.py +99 -0
  70. lighter/models/req_get_account_pending_txs.py +106 -0
  71. lighter/models/req_get_account_pn_l.py +118 -0
  72. lighter/models/req_get_account_txs.py +111 -0
  73. lighter/models/req_get_block.py +101 -0
  74. lighter/models/req_get_block_txs.py +101 -0
  75. lighter/models/req_get_by_account.py +101 -0
  76. lighter/models/req_get_candlesticks.py +109 -0
  77. lighter/models/req_get_deposit_history.py +106 -0
  78. lighter/models/req_get_fee_bucket.py +92 -0
  79. lighter/models/req_get_fundings.py +107 -0
  80. lighter/models/req_get_l1_tx.py +92 -0
  81. lighter/models/req_get_latest_deposit.py +92 -0
  82. lighter/models/req_get_next_nonce.py +94 -0
  83. lighter/models/req_get_order_book_details.py +92 -0
  84. lighter/models/req_get_order_book_orders.py +95 -0
  85. lighter/models/req_get_order_books.py +92 -0
  86. lighter/models/req_get_public_pools.py +109 -0
  87. lighter/models/req_get_range_with_cursor.py +95 -0
  88. lighter/models/req_get_range_with_index.py +95 -0
  89. lighter/models/req_get_range_with_index_sortable.py +107 -0
  90. lighter/models/req_get_recent_trades.py +95 -0
  91. lighter/models/req_get_trades.py +126 -0
  92. lighter/models/req_get_tx.py +101 -0
  93. lighter/models/req_get_withdraw_history.py +106 -0
  94. lighter/models/req_is_whitelisted.py +92 -0
  95. lighter/models/result_code.py +94 -0
  96. lighter/models/simple_order.py +102 -0
  97. lighter/models/status.py +94 -0
  98. lighter/models/sub_accounts.py +106 -0
  99. lighter/models/ticker.py +103 -0
  100. lighter/models/trade.py +125 -0
  101. lighter/models/trades.py +106 -0
  102. lighter/models/tx.py +121 -0
  103. lighter/models/tx_hash.py +96 -0
  104. lighter/models/tx_hashes.py +96 -0
  105. lighter/models/txs.py +104 -0
  106. lighter/models/validator_info.py +94 -0
  107. lighter/models/withdraw_history.py +110 -0
  108. lighter/models/withdraw_history_cursor.py +94 -0
  109. lighter/models/withdraw_history_item.py +114 -0
  110. lighter/models/zk_lighter_info.py +92 -0
  111. lighter/py.typed +0 -0
  112. lighter/rest.py +215 -0
  113. lighter/signer_client.py +440 -0
  114. lighter/signers/signer-amd64.so +0 -0
  115. lighter/signers/signer-arm64.dylib +0 -0
  116. lighter/transactions/__init__.py +3 -0
  117. lighter/transactions/cancel_order.py +27 -0
  118. lighter/transactions/create_order.py +33 -0
  119. lighter/transactions/withdraw.py +25 -0
  120. lighter/ws_client.py +160 -0
  121. lighter_sdk-0.1.0.dist-info/LICENSE +201 -0
  122. lighter_sdk-0.1.0.dist-info/METADATA +26 -0
  123. lighter_sdk-0.1.0.dist-info/RECORD +125 -0
  124. lighter_sdk-0.1.0.dist-info/WHEEL +5 -0
  125. lighter_sdk-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2371 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document:
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator
20
+ from typing import Optional
21
+ from typing_extensions import Annotated
22
+ from lighter.models.account_api_keys import AccountApiKeys
23
+ from lighter.models.account_pn_l import AccountPnL
24
+ from lighter.models.accounts import Accounts
25
+ from lighter.models.detailed_accounts import DetailedAccounts
26
+ from lighter.models.fee_bucket import FeeBucket
27
+ from lighter.models.is_whitelisted import IsWhitelisted
28
+ from lighter.models.public_pools import PublicPools
29
+ from lighter.models.sub_accounts import SubAccounts
30
+
31
+ from lighter.api_client import ApiClient, RequestSerialized
32
+ from lighter.api_response import ApiResponse
33
+ from lighter.rest import RESTResponseType
34
+
35
+
36
+ class AccountApi:
37
+ """NOTE: This class is auto generated by OpenAPI Generator
38
+ Ref: https://openapi-generator.tech
39
+
40
+ Do not edit the class manually.
41
+ """
42
+
43
+ def __init__(self, api_client=None) -> None:
44
+ if api_client is None:
45
+ api_client = ApiClient.get_default()
46
+ self.api_client = api_client
47
+
48
+
49
+ @validate_call
50
+ async def account(
51
+ self,
52
+ by: StrictStr,
53
+ value: StrictStr,
54
+ _request_timeout: Union[
55
+ None,
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Tuple[
58
+ Annotated[StrictFloat, Field(gt=0)],
59
+ Annotated[StrictFloat, Field(gt=0)]
60
+ ]
61
+ ] = None,
62
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
63
+ _content_type: Optional[StrictStr] = None,
64
+ _headers: Optional[Dict[StrictStr, Any]] = None,
65
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
66
+ ) -> DetailedAccounts:
67
+ """account
68
+
69
+ Get account by account's index. <br>More details about account index: [Account Index](https://apidocs.lighter.xyz/docs/account-index)<hr>**Response Description:**<br><br>1) **Status:** 1 is active 0 is inactive.<br>2) **Collateral:** The amount of collateral in the account.<hr>**Position Details Description:**<br>1) **OOC:** Open order count in that market.<br>2) **Sign:** 1 for Long, -1 for Short.<br>3) **Position:** The amount of position in that market.<br>4) **Avg Entry Price:** The average entry price of the position.<br>5) **Position Value:** The value of the position.<br>6) **Unrealized PnL:** The unrealized profit and loss of the position.<br>7) **Realized PnL:** The realized profit and loss of the position.
70
+
71
+ :param by: (required)
72
+ :type by: str
73
+ :param value: (required)
74
+ :type value: str
75
+ :param _request_timeout: timeout setting for this request. If one
76
+ number provided, it will be total request
77
+ timeout. It can also be a pair (tuple) of
78
+ (connection, read) timeouts.
79
+ :type _request_timeout: int, tuple(int, int), optional
80
+ :param _request_auth: set to override the auth_settings for an a single
81
+ request; this effectively ignores the
82
+ authentication in the spec for a single request.
83
+ :type _request_auth: dict, optional
84
+ :param _content_type: force content-type for the request.
85
+ :type _content_type: str, Optional
86
+ :param _headers: set to override the headers for a single
87
+ request; this effectively ignores the headers
88
+ in the spec for a single request.
89
+ :type _headers: dict, optional
90
+ :param _host_index: set to override the host_index for a single
91
+ request; this effectively ignores the host_index
92
+ in the spec for a single request.
93
+ :type _host_index: int, optional
94
+ :return: Returns the result object.
95
+ """ # noqa: E501
96
+
97
+ _param = self._account_serialize(
98
+ by=by,
99
+ value=value,
100
+ _request_auth=_request_auth,
101
+ _content_type=_content_type,
102
+ _headers=_headers,
103
+ _host_index=_host_index
104
+ )
105
+
106
+ _response_types_map: Dict[str, Optional[str]] = {
107
+ '200': "DetailedAccounts",
108
+ '400': "ResultCode",
109
+ }
110
+ response_data = await self.api_client.call_api(
111
+ *_param,
112
+ _request_timeout=_request_timeout
113
+ )
114
+ await response_data.read()
115
+ return self.api_client.response_deserialize(
116
+ response_data=response_data,
117
+ response_types_map=_response_types_map,
118
+ ).data
119
+
120
+
121
+ @validate_call
122
+ async def account_with_http_info(
123
+ self,
124
+ by: StrictStr,
125
+ value: StrictStr,
126
+ _request_timeout: Union[
127
+ None,
128
+ Annotated[StrictFloat, Field(gt=0)],
129
+ Tuple[
130
+ Annotated[StrictFloat, Field(gt=0)],
131
+ Annotated[StrictFloat, Field(gt=0)]
132
+ ]
133
+ ] = None,
134
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
135
+ _content_type: Optional[StrictStr] = None,
136
+ _headers: Optional[Dict[StrictStr, Any]] = None,
137
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
138
+ ) -> ApiResponse[DetailedAccounts]:
139
+ """account
140
+
141
+ Get account by account's index. <br>More details about account index: [Account Index](https://apidocs.lighter.xyz/docs/account-index)<hr>**Response Description:**<br><br>1) **Status:** 1 is active 0 is inactive.<br>2) **Collateral:** The amount of collateral in the account.<hr>**Position Details Description:**<br>1) **OOC:** Open order count in that market.<br>2) **Sign:** 1 for Long, -1 for Short.<br>3) **Position:** The amount of position in that market.<br>4) **Avg Entry Price:** The average entry price of the position.<br>5) **Position Value:** The value of the position.<br>6) **Unrealized PnL:** The unrealized profit and loss of the position.<br>7) **Realized PnL:** The realized profit and loss of the position.
142
+
143
+ :param by: (required)
144
+ :type by: str
145
+ :param value: (required)
146
+ :type value: str
147
+ :param _request_timeout: timeout setting for this request. If one
148
+ number provided, it will be total request
149
+ timeout. It can also be a pair (tuple) of
150
+ (connection, read) timeouts.
151
+ :type _request_timeout: int, tuple(int, int), optional
152
+ :param _request_auth: set to override the auth_settings for an a single
153
+ request; this effectively ignores the
154
+ authentication in the spec for a single request.
155
+ :type _request_auth: dict, optional
156
+ :param _content_type: force content-type for the request.
157
+ :type _content_type: str, Optional
158
+ :param _headers: set to override the headers for a single
159
+ request; this effectively ignores the headers
160
+ in the spec for a single request.
161
+ :type _headers: dict, optional
162
+ :param _host_index: set to override the host_index for a single
163
+ request; this effectively ignores the host_index
164
+ in the spec for a single request.
165
+ :type _host_index: int, optional
166
+ :return: Returns the result object.
167
+ """ # noqa: E501
168
+
169
+ _param = self._account_serialize(
170
+ by=by,
171
+ value=value,
172
+ _request_auth=_request_auth,
173
+ _content_type=_content_type,
174
+ _headers=_headers,
175
+ _host_index=_host_index
176
+ )
177
+
178
+ _response_types_map: Dict[str, Optional[str]] = {
179
+ '200': "DetailedAccounts",
180
+ '400': "ResultCode",
181
+ }
182
+ response_data = await self.api_client.call_api(
183
+ *_param,
184
+ _request_timeout=_request_timeout
185
+ )
186
+ await response_data.read()
187
+ return self.api_client.response_deserialize(
188
+ response_data=response_data,
189
+ response_types_map=_response_types_map,
190
+ )
191
+
192
+
193
+ @validate_call
194
+ async def account_without_preload_content(
195
+ self,
196
+ by: StrictStr,
197
+ value: StrictStr,
198
+ _request_timeout: Union[
199
+ None,
200
+ Annotated[StrictFloat, Field(gt=0)],
201
+ Tuple[
202
+ Annotated[StrictFloat, Field(gt=0)],
203
+ Annotated[StrictFloat, Field(gt=0)]
204
+ ]
205
+ ] = None,
206
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
207
+ _content_type: Optional[StrictStr] = None,
208
+ _headers: Optional[Dict[StrictStr, Any]] = None,
209
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
210
+ ) -> RESTResponseType:
211
+ """account
212
+
213
+ Get account by account's index. <br>More details about account index: [Account Index](https://apidocs.lighter.xyz/docs/account-index)<hr>**Response Description:**<br><br>1) **Status:** 1 is active 0 is inactive.<br>2) **Collateral:** The amount of collateral in the account.<hr>**Position Details Description:**<br>1) **OOC:** Open order count in that market.<br>2) **Sign:** 1 for Long, -1 for Short.<br>3) **Position:** The amount of position in that market.<br>4) **Avg Entry Price:** The average entry price of the position.<br>5) **Position Value:** The value of the position.<br>6) **Unrealized PnL:** The unrealized profit and loss of the position.<br>7) **Realized PnL:** The realized profit and loss of the position.
214
+
215
+ :param by: (required)
216
+ :type by: str
217
+ :param value: (required)
218
+ :type value: str
219
+ :param _request_timeout: timeout setting for this request. If one
220
+ number provided, it will be total request
221
+ timeout. It can also be a pair (tuple) of
222
+ (connection, read) timeouts.
223
+ :type _request_timeout: int, tuple(int, int), optional
224
+ :param _request_auth: set to override the auth_settings for an a single
225
+ request; this effectively ignores the
226
+ authentication in the spec for a single request.
227
+ :type _request_auth: dict, optional
228
+ :param _content_type: force content-type for the request.
229
+ :type _content_type: str, Optional
230
+ :param _headers: set to override the headers for a single
231
+ request; this effectively ignores the headers
232
+ in the spec for a single request.
233
+ :type _headers: dict, optional
234
+ :param _host_index: set to override the host_index for a single
235
+ request; this effectively ignores the host_index
236
+ in the spec for a single request.
237
+ :type _host_index: int, optional
238
+ :return: Returns the result object.
239
+ """ # noqa: E501
240
+
241
+ _param = self._account_serialize(
242
+ by=by,
243
+ value=value,
244
+ _request_auth=_request_auth,
245
+ _content_type=_content_type,
246
+ _headers=_headers,
247
+ _host_index=_host_index
248
+ )
249
+
250
+ _response_types_map: Dict[str, Optional[str]] = {
251
+ '200': "DetailedAccounts",
252
+ '400': "ResultCode",
253
+ }
254
+ response_data = await self.api_client.call_api(
255
+ *_param,
256
+ _request_timeout=_request_timeout
257
+ )
258
+ return response_data.response
259
+
260
+
261
+ def _account_serialize(
262
+ self,
263
+ by,
264
+ value,
265
+ _request_auth,
266
+ _content_type,
267
+ _headers,
268
+ _host_index,
269
+ ) -> RequestSerialized:
270
+
271
+ _host = None
272
+
273
+ _collection_formats: Dict[str, str] = {
274
+ }
275
+
276
+ _path_params: Dict[str, str] = {}
277
+ _query_params: List[Tuple[str, str]] = []
278
+ _header_params: Dict[str, Optional[str]] = _headers or {}
279
+ _form_params: List[Tuple[str, str]] = []
280
+ _files: Dict[str, Union[str, bytes]] = {}
281
+ _body_params: Optional[bytes] = None
282
+
283
+ # process the path parameters
284
+ # process the query parameters
285
+ if by is not None:
286
+
287
+ _query_params.append(('by', by))
288
+
289
+ if value is not None:
290
+
291
+ _query_params.append(('value', value))
292
+
293
+ # process the header parameters
294
+ # process the form parameters
295
+ # process the body parameter
296
+
297
+
298
+ # set the HTTP header `Accept`
299
+ if 'Accept' not in _header_params:
300
+ _header_params['Accept'] = self.api_client.select_header_accept(
301
+ [
302
+ 'application/json'
303
+ ]
304
+ )
305
+
306
+
307
+ # authentication setting
308
+ _auth_settings: List[str] = [
309
+ ]
310
+
311
+ return self.api_client.param_serialize(
312
+ method='GET',
313
+ resource_path='/api/v1/account',
314
+ path_params=_path_params,
315
+ query_params=_query_params,
316
+ header_params=_header_params,
317
+ body=_body_params,
318
+ post_params=_form_params,
319
+ files=_files,
320
+ auth_settings=_auth_settings,
321
+ collection_formats=_collection_formats,
322
+ _host=_host,
323
+ _request_auth=_request_auth
324
+ )
325
+
326
+
327
+
328
+
329
+ @validate_call
330
+ async def accounts(
331
+ self,
332
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
333
+ index: Optional[StrictInt] = None,
334
+ sort: Optional[StrictStr] = None,
335
+ _request_timeout: Union[
336
+ None,
337
+ Annotated[StrictFloat, Field(gt=0)],
338
+ Tuple[
339
+ Annotated[StrictFloat, Field(gt=0)],
340
+ Annotated[StrictFloat, Field(gt=0)]
341
+ ]
342
+ ] = None,
343
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
344
+ _content_type: Optional[StrictStr] = None,
345
+ _headers: Optional[Dict[StrictStr, Any]] = None,
346
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
347
+ ) -> Accounts:
348
+ """accounts
349
+
350
+ Get accounts returns accounts by account index
351
+
352
+ :param limit: (required)
353
+ :type limit: int
354
+ :param index:
355
+ :type index: int
356
+ :param sort:
357
+ :type sort: str
358
+ :param _request_timeout: timeout setting for this request. If one
359
+ number provided, it will be total request
360
+ timeout. It can also be a pair (tuple) of
361
+ (connection, read) timeouts.
362
+ :type _request_timeout: int, tuple(int, int), optional
363
+ :param _request_auth: set to override the auth_settings for an a single
364
+ request; this effectively ignores the
365
+ authentication in the spec for a single request.
366
+ :type _request_auth: dict, optional
367
+ :param _content_type: force content-type for the request.
368
+ :type _content_type: str, Optional
369
+ :param _headers: set to override the headers for a single
370
+ request; this effectively ignores the headers
371
+ in the spec for a single request.
372
+ :type _headers: dict, optional
373
+ :param _host_index: set to override the host_index for a single
374
+ request; this effectively ignores the host_index
375
+ in the spec for a single request.
376
+ :type _host_index: int, optional
377
+ :return: Returns the result object.
378
+ """ # noqa: E501
379
+
380
+ _param = self._accounts_serialize(
381
+ limit=limit,
382
+ index=index,
383
+ sort=sort,
384
+ _request_auth=_request_auth,
385
+ _content_type=_content_type,
386
+ _headers=_headers,
387
+ _host_index=_host_index
388
+ )
389
+
390
+ _response_types_map: Dict[str, Optional[str]] = {
391
+ '200': "Accounts",
392
+ '400': "ResultCode",
393
+ }
394
+ response_data = await self.api_client.call_api(
395
+ *_param,
396
+ _request_timeout=_request_timeout
397
+ )
398
+ await response_data.read()
399
+ return self.api_client.response_deserialize(
400
+ response_data=response_data,
401
+ response_types_map=_response_types_map,
402
+ ).data
403
+
404
+
405
+ @validate_call
406
+ async def accounts_with_http_info(
407
+ self,
408
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
409
+ index: Optional[StrictInt] = None,
410
+ sort: Optional[StrictStr] = None,
411
+ _request_timeout: Union[
412
+ None,
413
+ Annotated[StrictFloat, Field(gt=0)],
414
+ Tuple[
415
+ Annotated[StrictFloat, Field(gt=0)],
416
+ Annotated[StrictFloat, Field(gt=0)]
417
+ ]
418
+ ] = None,
419
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
420
+ _content_type: Optional[StrictStr] = None,
421
+ _headers: Optional[Dict[StrictStr, Any]] = None,
422
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
423
+ ) -> ApiResponse[Accounts]:
424
+ """accounts
425
+
426
+ Get accounts returns accounts by account index
427
+
428
+ :param limit: (required)
429
+ :type limit: int
430
+ :param index:
431
+ :type index: int
432
+ :param sort:
433
+ :type sort: str
434
+ :param _request_timeout: timeout setting for this request. If one
435
+ number provided, it will be total request
436
+ timeout. It can also be a pair (tuple) of
437
+ (connection, read) timeouts.
438
+ :type _request_timeout: int, tuple(int, int), optional
439
+ :param _request_auth: set to override the auth_settings for an a single
440
+ request; this effectively ignores the
441
+ authentication in the spec for a single request.
442
+ :type _request_auth: dict, optional
443
+ :param _content_type: force content-type for the request.
444
+ :type _content_type: str, Optional
445
+ :param _headers: set to override the headers for a single
446
+ request; this effectively ignores the headers
447
+ in the spec for a single request.
448
+ :type _headers: dict, optional
449
+ :param _host_index: set to override the host_index for a single
450
+ request; this effectively ignores the host_index
451
+ in the spec for a single request.
452
+ :type _host_index: int, optional
453
+ :return: Returns the result object.
454
+ """ # noqa: E501
455
+
456
+ _param = self._accounts_serialize(
457
+ limit=limit,
458
+ index=index,
459
+ sort=sort,
460
+ _request_auth=_request_auth,
461
+ _content_type=_content_type,
462
+ _headers=_headers,
463
+ _host_index=_host_index
464
+ )
465
+
466
+ _response_types_map: Dict[str, Optional[str]] = {
467
+ '200': "Accounts",
468
+ '400': "ResultCode",
469
+ }
470
+ response_data = await self.api_client.call_api(
471
+ *_param,
472
+ _request_timeout=_request_timeout
473
+ )
474
+ await response_data.read()
475
+ return self.api_client.response_deserialize(
476
+ response_data=response_data,
477
+ response_types_map=_response_types_map,
478
+ )
479
+
480
+
481
+ @validate_call
482
+ async def accounts_without_preload_content(
483
+ self,
484
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
485
+ index: Optional[StrictInt] = None,
486
+ sort: Optional[StrictStr] = None,
487
+ _request_timeout: Union[
488
+ None,
489
+ Annotated[StrictFloat, Field(gt=0)],
490
+ Tuple[
491
+ Annotated[StrictFloat, Field(gt=0)],
492
+ Annotated[StrictFloat, Field(gt=0)]
493
+ ]
494
+ ] = None,
495
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
496
+ _content_type: Optional[StrictStr] = None,
497
+ _headers: Optional[Dict[StrictStr, Any]] = None,
498
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
499
+ ) -> RESTResponseType:
500
+ """accounts
501
+
502
+ Get accounts returns accounts by account index
503
+
504
+ :param limit: (required)
505
+ :type limit: int
506
+ :param index:
507
+ :type index: int
508
+ :param sort:
509
+ :type sort: str
510
+ :param _request_timeout: timeout setting for this request. If one
511
+ number provided, it will be total request
512
+ timeout. It can also be a pair (tuple) of
513
+ (connection, read) timeouts.
514
+ :type _request_timeout: int, tuple(int, int), optional
515
+ :param _request_auth: set to override the auth_settings for an a single
516
+ request; this effectively ignores the
517
+ authentication in the spec for a single request.
518
+ :type _request_auth: dict, optional
519
+ :param _content_type: force content-type for the request.
520
+ :type _content_type: str, Optional
521
+ :param _headers: set to override the headers for a single
522
+ request; this effectively ignores the headers
523
+ in the spec for a single request.
524
+ :type _headers: dict, optional
525
+ :param _host_index: set to override the host_index for a single
526
+ request; this effectively ignores the host_index
527
+ in the spec for a single request.
528
+ :type _host_index: int, optional
529
+ :return: Returns the result object.
530
+ """ # noqa: E501
531
+
532
+ _param = self._accounts_serialize(
533
+ limit=limit,
534
+ index=index,
535
+ sort=sort,
536
+ _request_auth=_request_auth,
537
+ _content_type=_content_type,
538
+ _headers=_headers,
539
+ _host_index=_host_index
540
+ )
541
+
542
+ _response_types_map: Dict[str, Optional[str]] = {
543
+ '200': "Accounts",
544
+ '400': "ResultCode",
545
+ }
546
+ response_data = await self.api_client.call_api(
547
+ *_param,
548
+ _request_timeout=_request_timeout
549
+ )
550
+ return response_data.response
551
+
552
+
553
+ def _accounts_serialize(
554
+ self,
555
+ limit,
556
+ index,
557
+ sort,
558
+ _request_auth,
559
+ _content_type,
560
+ _headers,
561
+ _host_index,
562
+ ) -> RequestSerialized:
563
+
564
+ _host = None
565
+
566
+ _collection_formats: Dict[str, str] = {
567
+ }
568
+
569
+ _path_params: Dict[str, str] = {}
570
+ _query_params: List[Tuple[str, str]] = []
571
+ _header_params: Dict[str, Optional[str]] = _headers or {}
572
+ _form_params: List[Tuple[str, str]] = []
573
+ _files: Dict[str, Union[str, bytes]] = {}
574
+ _body_params: Optional[bytes] = None
575
+
576
+ # process the path parameters
577
+ # process the query parameters
578
+ if index is not None:
579
+
580
+ _query_params.append(('index', index))
581
+
582
+ if limit is not None:
583
+
584
+ _query_params.append(('limit', limit))
585
+
586
+ if sort is not None:
587
+
588
+ _query_params.append(('sort', sort))
589
+
590
+ # process the header parameters
591
+ # process the form parameters
592
+ # process the body parameter
593
+
594
+
595
+ # set the HTTP header `Accept`
596
+ if 'Accept' not in _header_params:
597
+ _header_params['Accept'] = self.api_client.select_header_accept(
598
+ [
599
+ 'application/json'
600
+ ]
601
+ )
602
+
603
+
604
+ # authentication setting
605
+ _auth_settings: List[str] = [
606
+ ]
607
+
608
+ return self.api_client.param_serialize(
609
+ method='GET',
610
+ resource_path='/api/v1/accounts',
611
+ path_params=_path_params,
612
+ query_params=_query_params,
613
+ header_params=_header_params,
614
+ body=_body_params,
615
+ post_params=_form_params,
616
+ files=_files,
617
+ auth_settings=_auth_settings,
618
+ collection_formats=_collection_formats,
619
+ _host=_host,
620
+ _request_auth=_request_auth
621
+ )
622
+
623
+
624
+
625
+
626
+ @validate_call
627
+ async def accounts_by_l1_address(
628
+ self,
629
+ l1_address: StrictStr,
630
+ _request_timeout: Union[
631
+ None,
632
+ Annotated[StrictFloat, Field(gt=0)],
633
+ Tuple[
634
+ Annotated[StrictFloat, Field(gt=0)],
635
+ Annotated[StrictFloat, Field(gt=0)]
636
+ ]
637
+ ] = None,
638
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
639
+ _content_type: Optional[StrictStr] = None,
640
+ _headers: Optional[Dict[StrictStr, Any]] = None,
641
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
642
+ ) -> SubAccounts:
643
+ """accountsByL1Address
644
+
645
+ Get accounts by l1_address returns all accounts associated with the given L1 address
646
+
647
+ :param l1_address: (required)
648
+ :type l1_address: str
649
+ :param _request_timeout: timeout setting for this request. If one
650
+ number provided, it will be total request
651
+ timeout. It can also be a pair (tuple) of
652
+ (connection, read) timeouts.
653
+ :type _request_timeout: int, tuple(int, int), optional
654
+ :param _request_auth: set to override the auth_settings for an a single
655
+ request; this effectively ignores the
656
+ authentication in the spec for a single request.
657
+ :type _request_auth: dict, optional
658
+ :param _content_type: force content-type for the request.
659
+ :type _content_type: str, Optional
660
+ :param _headers: set to override the headers for a single
661
+ request; this effectively ignores the headers
662
+ in the spec for a single request.
663
+ :type _headers: dict, optional
664
+ :param _host_index: set to override the host_index for a single
665
+ request; this effectively ignores the host_index
666
+ in the spec for a single request.
667
+ :type _host_index: int, optional
668
+ :return: Returns the result object.
669
+ """ # noqa: E501
670
+
671
+ _param = self._accounts_by_l1_address_serialize(
672
+ l1_address=l1_address,
673
+ _request_auth=_request_auth,
674
+ _content_type=_content_type,
675
+ _headers=_headers,
676
+ _host_index=_host_index
677
+ )
678
+
679
+ _response_types_map: Dict[str, Optional[str]] = {
680
+ '200': "SubAccounts",
681
+ '400': "ResultCode",
682
+ }
683
+ response_data = await self.api_client.call_api(
684
+ *_param,
685
+ _request_timeout=_request_timeout
686
+ )
687
+ await response_data.read()
688
+ return self.api_client.response_deserialize(
689
+ response_data=response_data,
690
+ response_types_map=_response_types_map,
691
+ ).data
692
+
693
+
694
+ @validate_call
695
+ async def accounts_by_l1_address_with_http_info(
696
+ self,
697
+ l1_address: StrictStr,
698
+ _request_timeout: Union[
699
+ None,
700
+ Annotated[StrictFloat, Field(gt=0)],
701
+ Tuple[
702
+ Annotated[StrictFloat, Field(gt=0)],
703
+ Annotated[StrictFloat, Field(gt=0)]
704
+ ]
705
+ ] = None,
706
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
707
+ _content_type: Optional[StrictStr] = None,
708
+ _headers: Optional[Dict[StrictStr, Any]] = None,
709
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
710
+ ) -> ApiResponse[SubAccounts]:
711
+ """accountsByL1Address
712
+
713
+ Get accounts by l1_address returns all accounts associated with the given L1 address
714
+
715
+ :param l1_address: (required)
716
+ :type l1_address: str
717
+ :param _request_timeout: timeout setting for this request. If one
718
+ number provided, it will be total request
719
+ timeout. It can also be a pair (tuple) of
720
+ (connection, read) timeouts.
721
+ :type _request_timeout: int, tuple(int, int), optional
722
+ :param _request_auth: set to override the auth_settings for an a single
723
+ request; this effectively ignores the
724
+ authentication in the spec for a single request.
725
+ :type _request_auth: dict, optional
726
+ :param _content_type: force content-type for the request.
727
+ :type _content_type: str, Optional
728
+ :param _headers: set to override the headers for a single
729
+ request; this effectively ignores the headers
730
+ in the spec for a single request.
731
+ :type _headers: dict, optional
732
+ :param _host_index: set to override the host_index for a single
733
+ request; this effectively ignores the host_index
734
+ in the spec for a single request.
735
+ :type _host_index: int, optional
736
+ :return: Returns the result object.
737
+ """ # noqa: E501
738
+
739
+ _param = self._accounts_by_l1_address_serialize(
740
+ l1_address=l1_address,
741
+ _request_auth=_request_auth,
742
+ _content_type=_content_type,
743
+ _headers=_headers,
744
+ _host_index=_host_index
745
+ )
746
+
747
+ _response_types_map: Dict[str, Optional[str]] = {
748
+ '200': "SubAccounts",
749
+ '400': "ResultCode",
750
+ }
751
+ response_data = await self.api_client.call_api(
752
+ *_param,
753
+ _request_timeout=_request_timeout
754
+ )
755
+ await response_data.read()
756
+ return self.api_client.response_deserialize(
757
+ response_data=response_data,
758
+ response_types_map=_response_types_map,
759
+ )
760
+
761
+
762
+ @validate_call
763
+ async def accounts_by_l1_address_without_preload_content(
764
+ self,
765
+ l1_address: StrictStr,
766
+ _request_timeout: Union[
767
+ None,
768
+ Annotated[StrictFloat, Field(gt=0)],
769
+ Tuple[
770
+ Annotated[StrictFloat, Field(gt=0)],
771
+ Annotated[StrictFloat, Field(gt=0)]
772
+ ]
773
+ ] = None,
774
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
775
+ _content_type: Optional[StrictStr] = None,
776
+ _headers: Optional[Dict[StrictStr, Any]] = None,
777
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
778
+ ) -> RESTResponseType:
779
+ """accountsByL1Address
780
+
781
+ Get accounts by l1_address returns all accounts associated with the given L1 address
782
+
783
+ :param l1_address: (required)
784
+ :type l1_address: str
785
+ :param _request_timeout: timeout setting for this request. If one
786
+ number provided, it will be total request
787
+ timeout. It can also be a pair (tuple) of
788
+ (connection, read) timeouts.
789
+ :type _request_timeout: int, tuple(int, int), optional
790
+ :param _request_auth: set to override the auth_settings for an a single
791
+ request; this effectively ignores the
792
+ authentication in the spec for a single request.
793
+ :type _request_auth: dict, optional
794
+ :param _content_type: force content-type for the request.
795
+ :type _content_type: str, Optional
796
+ :param _headers: set to override the headers for a single
797
+ request; this effectively ignores the headers
798
+ in the spec for a single request.
799
+ :type _headers: dict, optional
800
+ :param _host_index: set to override the host_index for a single
801
+ request; this effectively ignores the host_index
802
+ in the spec for a single request.
803
+ :type _host_index: int, optional
804
+ :return: Returns the result object.
805
+ """ # noqa: E501
806
+
807
+ _param = self._accounts_by_l1_address_serialize(
808
+ l1_address=l1_address,
809
+ _request_auth=_request_auth,
810
+ _content_type=_content_type,
811
+ _headers=_headers,
812
+ _host_index=_host_index
813
+ )
814
+
815
+ _response_types_map: Dict[str, Optional[str]] = {
816
+ '200': "SubAccounts",
817
+ '400': "ResultCode",
818
+ }
819
+ response_data = await self.api_client.call_api(
820
+ *_param,
821
+ _request_timeout=_request_timeout
822
+ )
823
+ return response_data.response
824
+
825
+
826
+ def _accounts_by_l1_address_serialize(
827
+ self,
828
+ l1_address,
829
+ _request_auth,
830
+ _content_type,
831
+ _headers,
832
+ _host_index,
833
+ ) -> RequestSerialized:
834
+
835
+ _host = None
836
+
837
+ _collection_formats: Dict[str, str] = {
838
+ }
839
+
840
+ _path_params: Dict[str, str] = {}
841
+ _query_params: List[Tuple[str, str]] = []
842
+ _header_params: Dict[str, Optional[str]] = _headers or {}
843
+ _form_params: List[Tuple[str, str]] = []
844
+ _files: Dict[str, Union[str, bytes]] = {}
845
+ _body_params: Optional[bytes] = None
846
+
847
+ # process the path parameters
848
+ # process the query parameters
849
+ if l1_address is not None:
850
+
851
+ _query_params.append(('l1_address', l1_address))
852
+
853
+ # process the header parameters
854
+ # process the form parameters
855
+ # process the body parameter
856
+
857
+
858
+ # set the HTTP header `Accept`
859
+ if 'Accept' not in _header_params:
860
+ _header_params['Accept'] = self.api_client.select_header_accept(
861
+ [
862
+ 'application/json'
863
+ ]
864
+ )
865
+
866
+
867
+ # authentication setting
868
+ _auth_settings: List[str] = [
869
+ ]
870
+
871
+ return self.api_client.param_serialize(
872
+ method='GET',
873
+ resource_path='/api/v1/accountsByL1Address',
874
+ path_params=_path_params,
875
+ query_params=_query_params,
876
+ header_params=_header_params,
877
+ body=_body_params,
878
+ post_params=_form_params,
879
+ files=_files,
880
+ auth_settings=_auth_settings,
881
+ collection_formats=_collection_formats,
882
+ _host=_host,
883
+ _request_auth=_request_auth
884
+ )
885
+
886
+
887
+
888
+
889
+ @validate_call
890
+ async def apikeys(
891
+ self,
892
+ account_index: StrictInt,
893
+ api_key_index: StrictInt,
894
+ _request_timeout: Union[
895
+ None,
896
+ Annotated[StrictFloat, Field(gt=0)],
897
+ Tuple[
898
+ Annotated[StrictFloat, Field(gt=0)],
899
+ Annotated[StrictFloat, Field(gt=0)]
900
+ ]
901
+ ] = None,
902
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
903
+ _content_type: Optional[StrictStr] = None,
904
+ _headers: Optional[Dict[StrictStr, Any]] = None,
905
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
906
+ ) -> AccountApiKeys:
907
+ """apikeys
908
+
909
+ Get account api key
910
+
911
+ :param account_index: (required)
912
+ :type account_index: int
913
+ :param api_key_index: (required)
914
+ :type api_key_index: int
915
+ :param _request_timeout: timeout setting for this request. If one
916
+ number provided, it will be total request
917
+ timeout. It can also be a pair (tuple) of
918
+ (connection, read) timeouts.
919
+ :type _request_timeout: int, tuple(int, int), optional
920
+ :param _request_auth: set to override the auth_settings for an a single
921
+ request; this effectively ignores the
922
+ authentication in the spec for a single request.
923
+ :type _request_auth: dict, optional
924
+ :param _content_type: force content-type for the request.
925
+ :type _content_type: str, Optional
926
+ :param _headers: set to override the headers for a single
927
+ request; this effectively ignores the headers
928
+ in the spec for a single request.
929
+ :type _headers: dict, optional
930
+ :param _host_index: set to override the host_index for a single
931
+ request; this effectively ignores the host_index
932
+ in the spec for a single request.
933
+ :type _host_index: int, optional
934
+ :return: Returns the result object.
935
+ """ # noqa: E501
936
+
937
+ _param = self._apikeys_serialize(
938
+ account_index=account_index,
939
+ api_key_index=api_key_index,
940
+ _request_auth=_request_auth,
941
+ _content_type=_content_type,
942
+ _headers=_headers,
943
+ _host_index=_host_index
944
+ )
945
+
946
+ _response_types_map: Dict[str, Optional[str]] = {
947
+ '200': "AccountApiKeys",
948
+ '400': "ResultCode",
949
+ }
950
+ response_data = await self.api_client.call_api(
951
+ *_param,
952
+ _request_timeout=_request_timeout
953
+ )
954
+ await response_data.read()
955
+ return self.api_client.response_deserialize(
956
+ response_data=response_data,
957
+ response_types_map=_response_types_map,
958
+ ).data
959
+
960
+
961
+ @validate_call
962
+ async def apikeys_with_http_info(
963
+ self,
964
+ account_index: StrictInt,
965
+ api_key_index: StrictInt,
966
+ _request_timeout: Union[
967
+ None,
968
+ Annotated[StrictFloat, Field(gt=0)],
969
+ Tuple[
970
+ Annotated[StrictFloat, Field(gt=0)],
971
+ Annotated[StrictFloat, Field(gt=0)]
972
+ ]
973
+ ] = None,
974
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
975
+ _content_type: Optional[StrictStr] = None,
976
+ _headers: Optional[Dict[StrictStr, Any]] = None,
977
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
978
+ ) -> ApiResponse[AccountApiKeys]:
979
+ """apikeys
980
+
981
+ Get account api key
982
+
983
+ :param account_index: (required)
984
+ :type account_index: int
985
+ :param api_key_index: (required)
986
+ :type api_key_index: int
987
+ :param _request_timeout: timeout setting for this request. If one
988
+ number provided, it will be total request
989
+ timeout. It can also be a pair (tuple) of
990
+ (connection, read) timeouts.
991
+ :type _request_timeout: int, tuple(int, int), optional
992
+ :param _request_auth: set to override the auth_settings for an a single
993
+ request; this effectively ignores the
994
+ authentication in the spec for a single request.
995
+ :type _request_auth: dict, optional
996
+ :param _content_type: force content-type for the request.
997
+ :type _content_type: str, Optional
998
+ :param _headers: set to override the headers for a single
999
+ request; this effectively ignores the headers
1000
+ in the spec for a single request.
1001
+ :type _headers: dict, optional
1002
+ :param _host_index: set to override the host_index for a single
1003
+ request; this effectively ignores the host_index
1004
+ in the spec for a single request.
1005
+ :type _host_index: int, optional
1006
+ :return: Returns the result object.
1007
+ """ # noqa: E501
1008
+
1009
+ _param = self._apikeys_serialize(
1010
+ account_index=account_index,
1011
+ api_key_index=api_key_index,
1012
+ _request_auth=_request_auth,
1013
+ _content_type=_content_type,
1014
+ _headers=_headers,
1015
+ _host_index=_host_index
1016
+ )
1017
+
1018
+ _response_types_map: Dict[str, Optional[str]] = {
1019
+ '200': "AccountApiKeys",
1020
+ '400': "ResultCode",
1021
+ }
1022
+ response_data = await self.api_client.call_api(
1023
+ *_param,
1024
+ _request_timeout=_request_timeout
1025
+ )
1026
+ await response_data.read()
1027
+ return self.api_client.response_deserialize(
1028
+ response_data=response_data,
1029
+ response_types_map=_response_types_map,
1030
+ )
1031
+
1032
+
1033
+ @validate_call
1034
+ async def apikeys_without_preload_content(
1035
+ self,
1036
+ account_index: StrictInt,
1037
+ api_key_index: StrictInt,
1038
+ _request_timeout: Union[
1039
+ None,
1040
+ Annotated[StrictFloat, Field(gt=0)],
1041
+ Tuple[
1042
+ Annotated[StrictFloat, Field(gt=0)],
1043
+ Annotated[StrictFloat, Field(gt=0)]
1044
+ ]
1045
+ ] = None,
1046
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1047
+ _content_type: Optional[StrictStr] = None,
1048
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1049
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1050
+ ) -> RESTResponseType:
1051
+ """apikeys
1052
+
1053
+ Get account api key
1054
+
1055
+ :param account_index: (required)
1056
+ :type account_index: int
1057
+ :param api_key_index: (required)
1058
+ :type api_key_index: int
1059
+ :param _request_timeout: timeout setting for this request. If one
1060
+ number provided, it will be total request
1061
+ timeout. It can also be a pair (tuple) of
1062
+ (connection, read) timeouts.
1063
+ :type _request_timeout: int, tuple(int, int), optional
1064
+ :param _request_auth: set to override the auth_settings for an a single
1065
+ request; this effectively ignores the
1066
+ authentication in the spec for a single request.
1067
+ :type _request_auth: dict, optional
1068
+ :param _content_type: force content-type for the request.
1069
+ :type _content_type: str, Optional
1070
+ :param _headers: set to override the headers for a single
1071
+ request; this effectively ignores the headers
1072
+ in the spec for a single request.
1073
+ :type _headers: dict, optional
1074
+ :param _host_index: set to override the host_index for a single
1075
+ request; this effectively ignores the host_index
1076
+ in the spec for a single request.
1077
+ :type _host_index: int, optional
1078
+ :return: Returns the result object.
1079
+ """ # noqa: E501
1080
+
1081
+ _param = self._apikeys_serialize(
1082
+ account_index=account_index,
1083
+ api_key_index=api_key_index,
1084
+ _request_auth=_request_auth,
1085
+ _content_type=_content_type,
1086
+ _headers=_headers,
1087
+ _host_index=_host_index
1088
+ )
1089
+
1090
+ _response_types_map: Dict[str, Optional[str]] = {
1091
+ '200': "AccountApiKeys",
1092
+ '400': "ResultCode",
1093
+ }
1094
+ response_data = await self.api_client.call_api(
1095
+ *_param,
1096
+ _request_timeout=_request_timeout
1097
+ )
1098
+ return response_data.response
1099
+
1100
+
1101
+ def _apikeys_serialize(
1102
+ self,
1103
+ account_index,
1104
+ api_key_index,
1105
+ _request_auth,
1106
+ _content_type,
1107
+ _headers,
1108
+ _host_index,
1109
+ ) -> RequestSerialized:
1110
+
1111
+ _host = None
1112
+
1113
+ _collection_formats: Dict[str, str] = {
1114
+ }
1115
+
1116
+ _path_params: Dict[str, str] = {}
1117
+ _query_params: List[Tuple[str, str]] = []
1118
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1119
+ _form_params: List[Tuple[str, str]] = []
1120
+ _files: Dict[str, Union[str, bytes]] = {}
1121
+ _body_params: Optional[bytes] = None
1122
+
1123
+ # process the path parameters
1124
+ # process the query parameters
1125
+ if account_index is not None:
1126
+
1127
+ _query_params.append(('account_index', account_index))
1128
+
1129
+ if api_key_index is not None:
1130
+
1131
+ _query_params.append(('api_key_index', api_key_index))
1132
+
1133
+ # process the header parameters
1134
+ # process the form parameters
1135
+ # process the body parameter
1136
+
1137
+
1138
+ # set the HTTP header `Accept`
1139
+ if 'Accept' not in _header_params:
1140
+ _header_params['Accept'] = self.api_client.select_header_accept(
1141
+ [
1142
+ 'application/json'
1143
+ ]
1144
+ )
1145
+
1146
+
1147
+ # authentication setting
1148
+ _auth_settings: List[str] = [
1149
+ ]
1150
+
1151
+ return self.api_client.param_serialize(
1152
+ method='GET',
1153
+ resource_path='/api/v1/apikeys',
1154
+ path_params=_path_params,
1155
+ query_params=_query_params,
1156
+ header_params=_header_params,
1157
+ body=_body_params,
1158
+ post_params=_form_params,
1159
+ files=_files,
1160
+ auth_settings=_auth_settings,
1161
+ collection_formats=_collection_formats,
1162
+ _host=_host,
1163
+ _request_auth=_request_auth
1164
+ )
1165
+
1166
+
1167
+
1168
+
1169
+ @validate_call
1170
+ async def fee_bucket(
1171
+ self,
1172
+ account_index: StrictInt,
1173
+ _request_timeout: Union[
1174
+ None,
1175
+ Annotated[StrictFloat, Field(gt=0)],
1176
+ Tuple[
1177
+ Annotated[StrictFloat, Field(gt=0)],
1178
+ Annotated[StrictFloat, Field(gt=0)]
1179
+ ]
1180
+ ] = None,
1181
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1182
+ _content_type: Optional[StrictStr] = None,
1183
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1184
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1185
+ ) -> FeeBucket:
1186
+ """feeBucket
1187
+
1188
+ Get account fee bucket
1189
+
1190
+ :param account_index: (required)
1191
+ :type account_index: int
1192
+ :param _request_timeout: timeout setting for this request. If one
1193
+ number provided, it will be total request
1194
+ timeout. It can also be a pair (tuple) of
1195
+ (connection, read) timeouts.
1196
+ :type _request_timeout: int, tuple(int, int), optional
1197
+ :param _request_auth: set to override the auth_settings for an a single
1198
+ request; this effectively ignores the
1199
+ authentication in the spec for a single request.
1200
+ :type _request_auth: dict, optional
1201
+ :param _content_type: force content-type for the request.
1202
+ :type _content_type: str, Optional
1203
+ :param _headers: set to override the headers for a single
1204
+ request; this effectively ignores the headers
1205
+ in the spec for a single request.
1206
+ :type _headers: dict, optional
1207
+ :param _host_index: set to override the host_index for a single
1208
+ request; this effectively ignores the host_index
1209
+ in the spec for a single request.
1210
+ :type _host_index: int, optional
1211
+ :return: Returns the result object.
1212
+ """ # noqa: E501
1213
+
1214
+ _param = self._fee_bucket_serialize(
1215
+ account_index=account_index,
1216
+ _request_auth=_request_auth,
1217
+ _content_type=_content_type,
1218
+ _headers=_headers,
1219
+ _host_index=_host_index
1220
+ )
1221
+
1222
+ _response_types_map: Dict[str, Optional[str]] = {
1223
+ '200': "FeeBucket",
1224
+ '400': "ResultCode",
1225
+ }
1226
+ response_data = await self.api_client.call_api(
1227
+ *_param,
1228
+ _request_timeout=_request_timeout
1229
+ )
1230
+ await response_data.read()
1231
+ return self.api_client.response_deserialize(
1232
+ response_data=response_data,
1233
+ response_types_map=_response_types_map,
1234
+ ).data
1235
+
1236
+
1237
+ @validate_call
1238
+ async def fee_bucket_with_http_info(
1239
+ self,
1240
+ account_index: StrictInt,
1241
+ _request_timeout: Union[
1242
+ None,
1243
+ Annotated[StrictFloat, Field(gt=0)],
1244
+ Tuple[
1245
+ Annotated[StrictFloat, Field(gt=0)],
1246
+ Annotated[StrictFloat, Field(gt=0)]
1247
+ ]
1248
+ ] = None,
1249
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1250
+ _content_type: Optional[StrictStr] = None,
1251
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1252
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1253
+ ) -> ApiResponse[FeeBucket]:
1254
+ """feeBucket
1255
+
1256
+ Get account fee bucket
1257
+
1258
+ :param account_index: (required)
1259
+ :type account_index: int
1260
+ :param _request_timeout: timeout setting for this request. If one
1261
+ number provided, it will be total request
1262
+ timeout. It can also be a pair (tuple) of
1263
+ (connection, read) timeouts.
1264
+ :type _request_timeout: int, tuple(int, int), optional
1265
+ :param _request_auth: set to override the auth_settings for an a single
1266
+ request; this effectively ignores the
1267
+ authentication in the spec for a single request.
1268
+ :type _request_auth: dict, optional
1269
+ :param _content_type: force content-type for the request.
1270
+ :type _content_type: str, Optional
1271
+ :param _headers: set to override the headers for a single
1272
+ request; this effectively ignores the headers
1273
+ in the spec for a single request.
1274
+ :type _headers: dict, optional
1275
+ :param _host_index: set to override the host_index for a single
1276
+ request; this effectively ignores the host_index
1277
+ in the spec for a single request.
1278
+ :type _host_index: int, optional
1279
+ :return: Returns the result object.
1280
+ """ # noqa: E501
1281
+
1282
+ _param = self._fee_bucket_serialize(
1283
+ account_index=account_index,
1284
+ _request_auth=_request_auth,
1285
+ _content_type=_content_type,
1286
+ _headers=_headers,
1287
+ _host_index=_host_index
1288
+ )
1289
+
1290
+ _response_types_map: Dict[str, Optional[str]] = {
1291
+ '200': "FeeBucket",
1292
+ '400': "ResultCode",
1293
+ }
1294
+ response_data = await self.api_client.call_api(
1295
+ *_param,
1296
+ _request_timeout=_request_timeout
1297
+ )
1298
+ await response_data.read()
1299
+ return self.api_client.response_deserialize(
1300
+ response_data=response_data,
1301
+ response_types_map=_response_types_map,
1302
+ )
1303
+
1304
+
1305
+ @validate_call
1306
+ async def fee_bucket_without_preload_content(
1307
+ self,
1308
+ account_index: StrictInt,
1309
+ _request_timeout: Union[
1310
+ None,
1311
+ Annotated[StrictFloat, Field(gt=0)],
1312
+ Tuple[
1313
+ Annotated[StrictFloat, Field(gt=0)],
1314
+ Annotated[StrictFloat, Field(gt=0)]
1315
+ ]
1316
+ ] = None,
1317
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1318
+ _content_type: Optional[StrictStr] = None,
1319
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1320
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1321
+ ) -> RESTResponseType:
1322
+ """feeBucket
1323
+
1324
+ Get account fee bucket
1325
+
1326
+ :param account_index: (required)
1327
+ :type account_index: int
1328
+ :param _request_timeout: timeout setting for this request. If one
1329
+ number provided, it will be total request
1330
+ timeout. It can also be a pair (tuple) of
1331
+ (connection, read) timeouts.
1332
+ :type _request_timeout: int, tuple(int, int), optional
1333
+ :param _request_auth: set to override the auth_settings for an a single
1334
+ request; this effectively ignores the
1335
+ authentication in the spec for a single request.
1336
+ :type _request_auth: dict, optional
1337
+ :param _content_type: force content-type for the request.
1338
+ :type _content_type: str, Optional
1339
+ :param _headers: set to override the headers for a single
1340
+ request; this effectively ignores the headers
1341
+ in the spec for a single request.
1342
+ :type _headers: dict, optional
1343
+ :param _host_index: set to override the host_index for a single
1344
+ request; this effectively ignores the host_index
1345
+ in the spec for a single request.
1346
+ :type _host_index: int, optional
1347
+ :return: Returns the result object.
1348
+ """ # noqa: E501
1349
+
1350
+ _param = self._fee_bucket_serialize(
1351
+ account_index=account_index,
1352
+ _request_auth=_request_auth,
1353
+ _content_type=_content_type,
1354
+ _headers=_headers,
1355
+ _host_index=_host_index
1356
+ )
1357
+
1358
+ _response_types_map: Dict[str, Optional[str]] = {
1359
+ '200': "FeeBucket",
1360
+ '400': "ResultCode",
1361
+ }
1362
+ response_data = await self.api_client.call_api(
1363
+ *_param,
1364
+ _request_timeout=_request_timeout
1365
+ )
1366
+ return response_data.response
1367
+
1368
+
1369
+ def _fee_bucket_serialize(
1370
+ self,
1371
+ account_index,
1372
+ _request_auth,
1373
+ _content_type,
1374
+ _headers,
1375
+ _host_index,
1376
+ ) -> RequestSerialized:
1377
+
1378
+ _host = None
1379
+
1380
+ _collection_formats: Dict[str, str] = {
1381
+ }
1382
+
1383
+ _path_params: Dict[str, str] = {}
1384
+ _query_params: List[Tuple[str, str]] = []
1385
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1386
+ _form_params: List[Tuple[str, str]] = []
1387
+ _files: Dict[str, Union[str, bytes]] = {}
1388
+ _body_params: Optional[bytes] = None
1389
+
1390
+ # process the path parameters
1391
+ # process the query parameters
1392
+ if account_index is not None:
1393
+
1394
+ _query_params.append(('account_index', account_index))
1395
+
1396
+ # process the header parameters
1397
+ # process the form parameters
1398
+ # process the body parameter
1399
+
1400
+
1401
+ # set the HTTP header `Accept`
1402
+ if 'Accept' not in _header_params:
1403
+ _header_params['Accept'] = self.api_client.select_header_accept(
1404
+ [
1405
+ 'application/json'
1406
+ ]
1407
+ )
1408
+
1409
+
1410
+ # authentication setting
1411
+ _auth_settings: List[str] = [
1412
+ ]
1413
+
1414
+ return self.api_client.param_serialize(
1415
+ method='GET',
1416
+ resource_path='/api/v1/feeBucket',
1417
+ path_params=_path_params,
1418
+ query_params=_query_params,
1419
+ header_params=_header_params,
1420
+ body=_body_params,
1421
+ post_params=_form_params,
1422
+ files=_files,
1423
+ auth_settings=_auth_settings,
1424
+ collection_formats=_collection_formats,
1425
+ _host=_host,
1426
+ _request_auth=_request_auth
1427
+ )
1428
+
1429
+
1430
+
1431
+
1432
+ @validate_call
1433
+ async def is_whitelisted(
1434
+ self,
1435
+ l1_address: StrictStr,
1436
+ _request_timeout: Union[
1437
+ None,
1438
+ Annotated[StrictFloat, Field(gt=0)],
1439
+ Tuple[
1440
+ Annotated[StrictFloat, Field(gt=0)],
1441
+ Annotated[StrictFloat, Field(gt=0)]
1442
+ ]
1443
+ ] = None,
1444
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1445
+ _content_type: Optional[StrictStr] = None,
1446
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1447
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1448
+ ) -> IsWhitelisted:
1449
+ """isWhitelisted
1450
+
1451
+ Get is account whitelisted
1452
+
1453
+ :param l1_address: (required)
1454
+ :type l1_address: str
1455
+ :param _request_timeout: timeout setting for this request. If one
1456
+ number provided, it will be total request
1457
+ timeout. It can also be a pair (tuple) of
1458
+ (connection, read) timeouts.
1459
+ :type _request_timeout: int, tuple(int, int), optional
1460
+ :param _request_auth: set to override the auth_settings for an a single
1461
+ request; this effectively ignores the
1462
+ authentication in the spec for a single request.
1463
+ :type _request_auth: dict, optional
1464
+ :param _content_type: force content-type for the request.
1465
+ :type _content_type: str, Optional
1466
+ :param _headers: set to override the headers for a single
1467
+ request; this effectively ignores the headers
1468
+ in the spec for a single request.
1469
+ :type _headers: dict, optional
1470
+ :param _host_index: set to override the host_index for a single
1471
+ request; this effectively ignores the host_index
1472
+ in the spec for a single request.
1473
+ :type _host_index: int, optional
1474
+ :return: Returns the result object.
1475
+ """ # noqa: E501
1476
+
1477
+ _param = self._is_whitelisted_serialize(
1478
+ l1_address=l1_address,
1479
+ _request_auth=_request_auth,
1480
+ _content_type=_content_type,
1481
+ _headers=_headers,
1482
+ _host_index=_host_index
1483
+ )
1484
+
1485
+ _response_types_map: Dict[str, Optional[str]] = {
1486
+ '200': "IsWhitelisted",
1487
+ '400': "ResultCode",
1488
+ }
1489
+ response_data = await self.api_client.call_api(
1490
+ *_param,
1491
+ _request_timeout=_request_timeout
1492
+ )
1493
+ await response_data.read()
1494
+ return self.api_client.response_deserialize(
1495
+ response_data=response_data,
1496
+ response_types_map=_response_types_map,
1497
+ ).data
1498
+
1499
+
1500
+ @validate_call
1501
+ async def is_whitelisted_with_http_info(
1502
+ self,
1503
+ l1_address: StrictStr,
1504
+ _request_timeout: Union[
1505
+ None,
1506
+ Annotated[StrictFloat, Field(gt=0)],
1507
+ Tuple[
1508
+ Annotated[StrictFloat, Field(gt=0)],
1509
+ Annotated[StrictFloat, Field(gt=0)]
1510
+ ]
1511
+ ] = None,
1512
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1513
+ _content_type: Optional[StrictStr] = None,
1514
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1515
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1516
+ ) -> ApiResponse[IsWhitelisted]:
1517
+ """isWhitelisted
1518
+
1519
+ Get is account whitelisted
1520
+
1521
+ :param l1_address: (required)
1522
+ :type l1_address: str
1523
+ :param _request_timeout: timeout setting for this request. If one
1524
+ number provided, it will be total request
1525
+ timeout. It can also be a pair (tuple) of
1526
+ (connection, read) timeouts.
1527
+ :type _request_timeout: int, tuple(int, int), optional
1528
+ :param _request_auth: set to override the auth_settings for an a single
1529
+ request; this effectively ignores the
1530
+ authentication in the spec for a single request.
1531
+ :type _request_auth: dict, optional
1532
+ :param _content_type: force content-type for the request.
1533
+ :type _content_type: str, Optional
1534
+ :param _headers: set to override the headers for a single
1535
+ request; this effectively ignores the headers
1536
+ in the spec for a single request.
1537
+ :type _headers: dict, optional
1538
+ :param _host_index: set to override the host_index for a single
1539
+ request; this effectively ignores the host_index
1540
+ in the spec for a single request.
1541
+ :type _host_index: int, optional
1542
+ :return: Returns the result object.
1543
+ """ # noqa: E501
1544
+
1545
+ _param = self._is_whitelisted_serialize(
1546
+ l1_address=l1_address,
1547
+ _request_auth=_request_auth,
1548
+ _content_type=_content_type,
1549
+ _headers=_headers,
1550
+ _host_index=_host_index
1551
+ )
1552
+
1553
+ _response_types_map: Dict[str, Optional[str]] = {
1554
+ '200': "IsWhitelisted",
1555
+ '400': "ResultCode",
1556
+ }
1557
+ response_data = await self.api_client.call_api(
1558
+ *_param,
1559
+ _request_timeout=_request_timeout
1560
+ )
1561
+ await response_data.read()
1562
+ return self.api_client.response_deserialize(
1563
+ response_data=response_data,
1564
+ response_types_map=_response_types_map,
1565
+ )
1566
+
1567
+
1568
+ @validate_call
1569
+ async def is_whitelisted_without_preload_content(
1570
+ self,
1571
+ l1_address: StrictStr,
1572
+ _request_timeout: Union[
1573
+ None,
1574
+ Annotated[StrictFloat, Field(gt=0)],
1575
+ Tuple[
1576
+ Annotated[StrictFloat, Field(gt=0)],
1577
+ Annotated[StrictFloat, Field(gt=0)]
1578
+ ]
1579
+ ] = None,
1580
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1581
+ _content_type: Optional[StrictStr] = None,
1582
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1583
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1584
+ ) -> RESTResponseType:
1585
+ """isWhitelisted
1586
+
1587
+ Get is account whitelisted
1588
+
1589
+ :param l1_address: (required)
1590
+ :type l1_address: str
1591
+ :param _request_timeout: timeout setting for this request. If one
1592
+ number provided, it will be total request
1593
+ timeout. It can also be a pair (tuple) of
1594
+ (connection, read) timeouts.
1595
+ :type _request_timeout: int, tuple(int, int), optional
1596
+ :param _request_auth: set to override the auth_settings for an a single
1597
+ request; this effectively ignores the
1598
+ authentication in the spec for a single request.
1599
+ :type _request_auth: dict, optional
1600
+ :param _content_type: force content-type for the request.
1601
+ :type _content_type: str, Optional
1602
+ :param _headers: set to override the headers for a single
1603
+ request; this effectively ignores the headers
1604
+ in the spec for a single request.
1605
+ :type _headers: dict, optional
1606
+ :param _host_index: set to override the host_index for a single
1607
+ request; this effectively ignores the host_index
1608
+ in the spec for a single request.
1609
+ :type _host_index: int, optional
1610
+ :return: Returns the result object.
1611
+ """ # noqa: E501
1612
+
1613
+ _param = self._is_whitelisted_serialize(
1614
+ l1_address=l1_address,
1615
+ _request_auth=_request_auth,
1616
+ _content_type=_content_type,
1617
+ _headers=_headers,
1618
+ _host_index=_host_index
1619
+ )
1620
+
1621
+ _response_types_map: Dict[str, Optional[str]] = {
1622
+ '200': "IsWhitelisted",
1623
+ '400': "ResultCode",
1624
+ }
1625
+ response_data = await self.api_client.call_api(
1626
+ *_param,
1627
+ _request_timeout=_request_timeout
1628
+ )
1629
+ return response_data.response
1630
+
1631
+
1632
+ def _is_whitelisted_serialize(
1633
+ self,
1634
+ l1_address,
1635
+ _request_auth,
1636
+ _content_type,
1637
+ _headers,
1638
+ _host_index,
1639
+ ) -> RequestSerialized:
1640
+
1641
+ _host = None
1642
+
1643
+ _collection_formats: Dict[str, str] = {
1644
+ }
1645
+
1646
+ _path_params: Dict[str, str] = {}
1647
+ _query_params: List[Tuple[str, str]] = []
1648
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1649
+ _form_params: List[Tuple[str, str]] = []
1650
+ _files: Dict[str, Union[str, bytes]] = {}
1651
+ _body_params: Optional[bytes] = None
1652
+
1653
+ # process the path parameters
1654
+ # process the query parameters
1655
+ if l1_address is not None:
1656
+
1657
+ _query_params.append(('l1_address', l1_address))
1658
+
1659
+ # process the header parameters
1660
+ # process the form parameters
1661
+ # process the body parameter
1662
+
1663
+
1664
+ # set the HTTP header `Accept`
1665
+ if 'Accept' not in _header_params:
1666
+ _header_params['Accept'] = self.api_client.select_header_accept(
1667
+ [
1668
+ 'application/json'
1669
+ ]
1670
+ )
1671
+
1672
+
1673
+ # authentication setting
1674
+ _auth_settings: List[str] = [
1675
+ ]
1676
+
1677
+ return self.api_client.param_serialize(
1678
+ method='GET',
1679
+ resource_path='/api/v1/isWhitelisted',
1680
+ path_params=_path_params,
1681
+ query_params=_query_params,
1682
+ header_params=_header_params,
1683
+ body=_body_params,
1684
+ post_params=_form_params,
1685
+ files=_files,
1686
+ auth_settings=_auth_settings,
1687
+ collection_formats=_collection_formats,
1688
+ _host=_host,
1689
+ _request_auth=_request_auth
1690
+ )
1691
+
1692
+
1693
+
1694
+
1695
+ @validate_call
1696
+ async def pnl(
1697
+ self,
1698
+ by: StrictStr,
1699
+ value: StrictStr,
1700
+ resolution: StrictStr,
1701
+ start_timestamp: StrictInt,
1702
+ end_timestamp: StrictInt,
1703
+ count_back: StrictInt,
1704
+ ignore_transfers: Optional[StrictBool] = None,
1705
+ _request_timeout: Union[
1706
+ None,
1707
+ Annotated[StrictFloat, Field(gt=0)],
1708
+ Tuple[
1709
+ Annotated[StrictFloat, Field(gt=0)],
1710
+ Annotated[StrictFloat, Field(gt=0)]
1711
+ ]
1712
+ ] = None,
1713
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1714
+ _content_type: Optional[StrictStr] = None,
1715
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1716
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1717
+ ) -> AccountPnL:
1718
+ """pnl
1719
+
1720
+ Get account PnL chart
1721
+
1722
+ :param by: (required)
1723
+ :type by: str
1724
+ :param value: (required)
1725
+ :type value: str
1726
+ :param resolution: (required)
1727
+ :type resolution: str
1728
+ :param start_timestamp: (required)
1729
+ :type start_timestamp: int
1730
+ :param end_timestamp: (required)
1731
+ :type end_timestamp: int
1732
+ :param count_back: (required)
1733
+ :type count_back: int
1734
+ :param ignore_transfers:
1735
+ :type ignore_transfers: bool
1736
+ :param _request_timeout: timeout setting for this request. If one
1737
+ number provided, it will be total request
1738
+ timeout. It can also be a pair (tuple) of
1739
+ (connection, read) timeouts.
1740
+ :type _request_timeout: int, tuple(int, int), optional
1741
+ :param _request_auth: set to override the auth_settings for an a single
1742
+ request; this effectively ignores the
1743
+ authentication in the spec for a single request.
1744
+ :type _request_auth: dict, optional
1745
+ :param _content_type: force content-type for the request.
1746
+ :type _content_type: str, Optional
1747
+ :param _headers: set to override the headers for a single
1748
+ request; this effectively ignores the headers
1749
+ in the spec for a single request.
1750
+ :type _headers: dict, optional
1751
+ :param _host_index: set to override the host_index for a single
1752
+ request; this effectively ignores the host_index
1753
+ in the spec for a single request.
1754
+ :type _host_index: int, optional
1755
+ :return: Returns the result object.
1756
+ """ # noqa: E501
1757
+
1758
+ _param = self._pnl_serialize(
1759
+ by=by,
1760
+ value=value,
1761
+ resolution=resolution,
1762
+ start_timestamp=start_timestamp,
1763
+ end_timestamp=end_timestamp,
1764
+ count_back=count_back,
1765
+ ignore_transfers=ignore_transfers,
1766
+ _request_auth=_request_auth,
1767
+ _content_type=_content_type,
1768
+ _headers=_headers,
1769
+ _host_index=_host_index
1770
+ )
1771
+
1772
+ _response_types_map: Dict[str, Optional[str]] = {
1773
+ '200': "AccountPnL",
1774
+ '400': "ResultCode",
1775
+ }
1776
+ response_data = await self.api_client.call_api(
1777
+ *_param,
1778
+ _request_timeout=_request_timeout
1779
+ )
1780
+ await response_data.read()
1781
+ return self.api_client.response_deserialize(
1782
+ response_data=response_data,
1783
+ response_types_map=_response_types_map,
1784
+ ).data
1785
+
1786
+
1787
+ @validate_call
1788
+ async def pnl_with_http_info(
1789
+ self,
1790
+ by: StrictStr,
1791
+ value: StrictStr,
1792
+ resolution: StrictStr,
1793
+ start_timestamp: StrictInt,
1794
+ end_timestamp: StrictInt,
1795
+ count_back: StrictInt,
1796
+ ignore_transfers: Optional[StrictBool] = None,
1797
+ _request_timeout: Union[
1798
+ None,
1799
+ Annotated[StrictFloat, Field(gt=0)],
1800
+ Tuple[
1801
+ Annotated[StrictFloat, Field(gt=0)],
1802
+ Annotated[StrictFloat, Field(gt=0)]
1803
+ ]
1804
+ ] = None,
1805
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1806
+ _content_type: Optional[StrictStr] = None,
1807
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1808
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1809
+ ) -> ApiResponse[AccountPnL]:
1810
+ """pnl
1811
+
1812
+ Get account PnL chart
1813
+
1814
+ :param by: (required)
1815
+ :type by: str
1816
+ :param value: (required)
1817
+ :type value: str
1818
+ :param resolution: (required)
1819
+ :type resolution: str
1820
+ :param start_timestamp: (required)
1821
+ :type start_timestamp: int
1822
+ :param end_timestamp: (required)
1823
+ :type end_timestamp: int
1824
+ :param count_back: (required)
1825
+ :type count_back: int
1826
+ :param ignore_transfers:
1827
+ :type ignore_transfers: bool
1828
+ :param _request_timeout: timeout setting for this request. If one
1829
+ number provided, it will be total request
1830
+ timeout. It can also be a pair (tuple) of
1831
+ (connection, read) timeouts.
1832
+ :type _request_timeout: int, tuple(int, int), optional
1833
+ :param _request_auth: set to override the auth_settings for an a single
1834
+ request; this effectively ignores the
1835
+ authentication in the spec for a single request.
1836
+ :type _request_auth: dict, optional
1837
+ :param _content_type: force content-type for the request.
1838
+ :type _content_type: str, Optional
1839
+ :param _headers: set to override the headers for a single
1840
+ request; this effectively ignores the headers
1841
+ in the spec for a single request.
1842
+ :type _headers: dict, optional
1843
+ :param _host_index: set to override the host_index for a single
1844
+ request; this effectively ignores the host_index
1845
+ in the spec for a single request.
1846
+ :type _host_index: int, optional
1847
+ :return: Returns the result object.
1848
+ """ # noqa: E501
1849
+
1850
+ _param = self._pnl_serialize(
1851
+ by=by,
1852
+ value=value,
1853
+ resolution=resolution,
1854
+ start_timestamp=start_timestamp,
1855
+ end_timestamp=end_timestamp,
1856
+ count_back=count_back,
1857
+ ignore_transfers=ignore_transfers,
1858
+ _request_auth=_request_auth,
1859
+ _content_type=_content_type,
1860
+ _headers=_headers,
1861
+ _host_index=_host_index
1862
+ )
1863
+
1864
+ _response_types_map: Dict[str, Optional[str]] = {
1865
+ '200': "AccountPnL",
1866
+ '400': "ResultCode",
1867
+ }
1868
+ response_data = await self.api_client.call_api(
1869
+ *_param,
1870
+ _request_timeout=_request_timeout
1871
+ )
1872
+ await response_data.read()
1873
+ return self.api_client.response_deserialize(
1874
+ response_data=response_data,
1875
+ response_types_map=_response_types_map,
1876
+ )
1877
+
1878
+
1879
+ @validate_call
1880
+ async def pnl_without_preload_content(
1881
+ self,
1882
+ by: StrictStr,
1883
+ value: StrictStr,
1884
+ resolution: StrictStr,
1885
+ start_timestamp: StrictInt,
1886
+ end_timestamp: StrictInt,
1887
+ count_back: StrictInt,
1888
+ ignore_transfers: Optional[StrictBool] = None,
1889
+ _request_timeout: Union[
1890
+ None,
1891
+ Annotated[StrictFloat, Field(gt=0)],
1892
+ Tuple[
1893
+ Annotated[StrictFloat, Field(gt=0)],
1894
+ Annotated[StrictFloat, Field(gt=0)]
1895
+ ]
1896
+ ] = None,
1897
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1898
+ _content_type: Optional[StrictStr] = None,
1899
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1900
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1901
+ ) -> RESTResponseType:
1902
+ """pnl
1903
+
1904
+ Get account PnL chart
1905
+
1906
+ :param by: (required)
1907
+ :type by: str
1908
+ :param value: (required)
1909
+ :type value: str
1910
+ :param resolution: (required)
1911
+ :type resolution: str
1912
+ :param start_timestamp: (required)
1913
+ :type start_timestamp: int
1914
+ :param end_timestamp: (required)
1915
+ :type end_timestamp: int
1916
+ :param count_back: (required)
1917
+ :type count_back: int
1918
+ :param ignore_transfers:
1919
+ :type ignore_transfers: bool
1920
+ :param _request_timeout: timeout setting for this request. If one
1921
+ number provided, it will be total request
1922
+ timeout. It can also be a pair (tuple) of
1923
+ (connection, read) timeouts.
1924
+ :type _request_timeout: int, tuple(int, int), optional
1925
+ :param _request_auth: set to override the auth_settings for an a single
1926
+ request; this effectively ignores the
1927
+ authentication in the spec for a single request.
1928
+ :type _request_auth: dict, optional
1929
+ :param _content_type: force content-type for the request.
1930
+ :type _content_type: str, Optional
1931
+ :param _headers: set to override the headers for a single
1932
+ request; this effectively ignores the headers
1933
+ in the spec for a single request.
1934
+ :type _headers: dict, optional
1935
+ :param _host_index: set to override the host_index for a single
1936
+ request; this effectively ignores the host_index
1937
+ in the spec for a single request.
1938
+ :type _host_index: int, optional
1939
+ :return: Returns the result object.
1940
+ """ # noqa: E501
1941
+
1942
+ _param = self._pnl_serialize(
1943
+ by=by,
1944
+ value=value,
1945
+ resolution=resolution,
1946
+ start_timestamp=start_timestamp,
1947
+ end_timestamp=end_timestamp,
1948
+ count_back=count_back,
1949
+ ignore_transfers=ignore_transfers,
1950
+ _request_auth=_request_auth,
1951
+ _content_type=_content_type,
1952
+ _headers=_headers,
1953
+ _host_index=_host_index
1954
+ )
1955
+
1956
+ _response_types_map: Dict[str, Optional[str]] = {
1957
+ '200': "AccountPnL",
1958
+ '400': "ResultCode",
1959
+ }
1960
+ response_data = await self.api_client.call_api(
1961
+ *_param,
1962
+ _request_timeout=_request_timeout
1963
+ )
1964
+ return response_data.response
1965
+
1966
+
1967
+ def _pnl_serialize(
1968
+ self,
1969
+ by,
1970
+ value,
1971
+ resolution,
1972
+ start_timestamp,
1973
+ end_timestamp,
1974
+ count_back,
1975
+ ignore_transfers,
1976
+ _request_auth,
1977
+ _content_type,
1978
+ _headers,
1979
+ _host_index,
1980
+ ) -> RequestSerialized:
1981
+
1982
+ _host = None
1983
+
1984
+ _collection_formats: Dict[str, str] = {
1985
+ }
1986
+
1987
+ _path_params: Dict[str, str] = {}
1988
+ _query_params: List[Tuple[str, str]] = []
1989
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1990
+ _form_params: List[Tuple[str, str]] = []
1991
+ _files: Dict[str, Union[str, bytes]] = {}
1992
+ _body_params: Optional[bytes] = None
1993
+
1994
+ # process the path parameters
1995
+ # process the query parameters
1996
+ if by is not None:
1997
+
1998
+ _query_params.append(('by', by))
1999
+
2000
+ if value is not None:
2001
+
2002
+ _query_params.append(('value', value))
2003
+
2004
+ if resolution is not None:
2005
+
2006
+ _query_params.append(('resolution', resolution))
2007
+
2008
+ if start_timestamp is not None:
2009
+
2010
+ _query_params.append(('start_timestamp', start_timestamp))
2011
+
2012
+ if end_timestamp is not None:
2013
+
2014
+ _query_params.append(('end_timestamp', end_timestamp))
2015
+
2016
+ if count_back is not None:
2017
+
2018
+ _query_params.append(('count_back', count_back))
2019
+
2020
+ if ignore_transfers is not None:
2021
+
2022
+ _query_params.append(('ignore_transfers', ignore_transfers))
2023
+
2024
+ # process the header parameters
2025
+ # process the form parameters
2026
+ # process the body parameter
2027
+
2028
+
2029
+ # set the HTTP header `Accept`
2030
+ if 'Accept' not in _header_params:
2031
+ _header_params['Accept'] = self.api_client.select_header_accept(
2032
+ [
2033
+ 'application/json'
2034
+ ]
2035
+ )
2036
+
2037
+
2038
+ # authentication setting
2039
+ _auth_settings: List[str] = [
2040
+ ]
2041
+
2042
+ return self.api_client.param_serialize(
2043
+ method='GET',
2044
+ resource_path='/api/v1/pnl',
2045
+ path_params=_path_params,
2046
+ query_params=_query_params,
2047
+ header_params=_header_params,
2048
+ body=_body_params,
2049
+ post_params=_form_params,
2050
+ files=_files,
2051
+ auth_settings=_auth_settings,
2052
+ collection_formats=_collection_formats,
2053
+ _host=_host,
2054
+ _request_auth=_request_auth
2055
+ )
2056
+
2057
+
2058
+
2059
+
2060
+ @validate_call
2061
+ async def public_pools(
2062
+ self,
2063
+ index: StrictInt,
2064
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
2065
+ filter: Optional[StrictStr] = None,
2066
+ account_index: Optional[StrictInt] = None,
2067
+ _request_timeout: Union[
2068
+ None,
2069
+ Annotated[StrictFloat, Field(gt=0)],
2070
+ Tuple[
2071
+ Annotated[StrictFloat, Field(gt=0)],
2072
+ Annotated[StrictFloat, Field(gt=0)]
2073
+ ]
2074
+ ] = None,
2075
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2076
+ _content_type: Optional[StrictStr] = None,
2077
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2078
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2079
+ ) -> PublicPools:
2080
+ """publicPools
2081
+
2082
+ Get public pools
2083
+
2084
+ :param index: (required)
2085
+ :type index: int
2086
+ :param limit: (required)
2087
+ :type limit: int
2088
+ :param filter:
2089
+ :type filter: str
2090
+ :param account_index:
2091
+ :type account_index: int
2092
+ :param _request_timeout: timeout setting for this request. If one
2093
+ number provided, it will be total request
2094
+ timeout. It can also be a pair (tuple) of
2095
+ (connection, read) timeouts.
2096
+ :type _request_timeout: int, tuple(int, int), optional
2097
+ :param _request_auth: set to override the auth_settings for an a single
2098
+ request; this effectively ignores the
2099
+ authentication in the spec for a single request.
2100
+ :type _request_auth: dict, optional
2101
+ :param _content_type: force content-type for the request.
2102
+ :type _content_type: str, Optional
2103
+ :param _headers: set to override the headers for a single
2104
+ request; this effectively ignores the headers
2105
+ in the spec for a single request.
2106
+ :type _headers: dict, optional
2107
+ :param _host_index: set to override the host_index for a single
2108
+ request; this effectively ignores the host_index
2109
+ in the spec for a single request.
2110
+ :type _host_index: int, optional
2111
+ :return: Returns the result object.
2112
+ """ # noqa: E501
2113
+
2114
+ _param = self._public_pools_serialize(
2115
+ index=index,
2116
+ limit=limit,
2117
+ filter=filter,
2118
+ account_index=account_index,
2119
+ _request_auth=_request_auth,
2120
+ _content_type=_content_type,
2121
+ _headers=_headers,
2122
+ _host_index=_host_index
2123
+ )
2124
+
2125
+ _response_types_map: Dict[str, Optional[str]] = {
2126
+ '200': "PublicPools",
2127
+ '400': "ResultCode",
2128
+ }
2129
+ response_data = await self.api_client.call_api(
2130
+ *_param,
2131
+ _request_timeout=_request_timeout
2132
+ )
2133
+ await response_data.read()
2134
+ return self.api_client.response_deserialize(
2135
+ response_data=response_data,
2136
+ response_types_map=_response_types_map,
2137
+ ).data
2138
+
2139
+
2140
+ @validate_call
2141
+ async def public_pools_with_http_info(
2142
+ self,
2143
+ index: StrictInt,
2144
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
2145
+ filter: Optional[StrictStr] = None,
2146
+ account_index: Optional[StrictInt] = None,
2147
+ _request_timeout: Union[
2148
+ None,
2149
+ Annotated[StrictFloat, Field(gt=0)],
2150
+ Tuple[
2151
+ Annotated[StrictFloat, Field(gt=0)],
2152
+ Annotated[StrictFloat, Field(gt=0)]
2153
+ ]
2154
+ ] = None,
2155
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2156
+ _content_type: Optional[StrictStr] = None,
2157
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2158
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2159
+ ) -> ApiResponse[PublicPools]:
2160
+ """publicPools
2161
+
2162
+ Get public pools
2163
+
2164
+ :param index: (required)
2165
+ :type index: int
2166
+ :param limit: (required)
2167
+ :type limit: int
2168
+ :param filter:
2169
+ :type filter: str
2170
+ :param account_index:
2171
+ :type account_index: int
2172
+ :param _request_timeout: timeout setting for this request. If one
2173
+ number provided, it will be total request
2174
+ timeout. It can also be a pair (tuple) of
2175
+ (connection, read) timeouts.
2176
+ :type _request_timeout: int, tuple(int, int), optional
2177
+ :param _request_auth: set to override the auth_settings for an a single
2178
+ request; this effectively ignores the
2179
+ authentication in the spec for a single request.
2180
+ :type _request_auth: dict, optional
2181
+ :param _content_type: force content-type for the request.
2182
+ :type _content_type: str, Optional
2183
+ :param _headers: set to override the headers for a single
2184
+ request; this effectively ignores the headers
2185
+ in the spec for a single request.
2186
+ :type _headers: dict, optional
2187
+ :param _host_index: set to override the host_index for a single
2188
+ request; this effectively ignores the host_index
2189
+ in the spec for a single request.
2190
+ :type _host_index: int, optional
2191
+ :return: Returns the result object.
2192
+ """ # noqa: E501
2193
+
2194
+ _param = self._public_pools_serialize(
2195
+ index=index,
2196
+ limit=limit,
2197
+ filter=filter,
2198
+ account_index=account_index,
2199
+ _request_auth=_request_auth,
2200
+ _content_type=_content_type,
2201
+ _headers=_headers,
2202
+ _host_index=_host_index
2203
+ )
2204
+
2205
+ _response_types_map: Dict[str, Optional[str]] = {
2206
+ '200': "PublicPools",
2207
+ '400': "ResultCode",
2208
+ }
2209
+ response_data = await self.api_client.call_api(
2210
+ *_param,
2211
+ _request_timeout=_request_timeout
2212
+ )
2213
+ await response_data.read()
2214
+ return self.api_client.response_deserialize(
2215
+ response_data=response_data,
2216
+ response_types_map=_response_types_map,
2217
+ )
2218
+
2219
+
2220
+ @validate_call
2221
+ async def public_pools_without_preload_content(
2222
+ self,
2223
+ index: StrictInt,
2224
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
2225
+ filter: Optional[StrictStr] = None,
2226
+ account_index: Optional[StrictInt] = None,
2227
+ _request_timeout: Union[
2228
+ None,
2229
+ Annotated[StrictFloat, Field(gt=0)],
2230
+ Tuple[
2231
+ Annotated[StrictFloat, Field(gt=0)],
2232
+ Annotated[StrictFloat, Field(gt=0)]
2233
+ ]
2234
+ ] = None,
2235
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2236
+ _content_type: Optional[StrictStr] = None,
2237
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2238
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2239
+ ) -> RESTResponseType:
2240
+ """publicPools
2241
+
2242
+ Get public pools
2243
+
2244
+ :param index: (required)
2245
+ :type index: int
2246
+ :param limit: (required)
2247
+ :type limit: int
2248
+ :param filter:
2249
+ :type filter: str
2250
+ :param account_index:
2251
+ :type account_index: int
2252
+ :param _request_timeout: timeout setting for this request. If one
2253
+ number provided, it will be total request
2254
+ timeout. It can also be a pair (tuple) of
2255
+ (connection, read) timeouts.
2256
+ :type _request_timeout: int, tuple(int, int), optional
2257
+ :param _request_auth: set to override the auth_settings for an a single
2258
+ request; this effectively ignores the
2259
+ authentication in the spec for a single request.
2260
+ :type _request_auth: dict, optional
2261
+ :param _content_type: force content-type for the request.
2262
+ :type _content_type: str, Optional
2263
+ :param _headers: set to override the headers for a single
2264
+ request; this effectively ignores the headers
2265
+ in the spec for a single request.
2266
+ :type _headers: dict, optional
2267
+ :param _host_index: set to override the host_index for a single
2268
+ request; this effectively ignores the host_index
2269
+ in the spec for a single request.
2270
+ :type _host_index: int, optional
2271
+ :return: Returns the result object.
2272
+ """ # noqa: E501
2273
+
2274
+ _param = self._public_pools_serialize(
2275
+ index=index,
2276
+ limit=limit,
2277
+ filter=filter,
2278
+ account_index=account_index,
2279
+ _request_auth=_request_auth,
2280
+ _content_type=_content_type,
2281
+ _headers=_headers,
2282
+ _host_index=_host_index
2283
+ )
2284
+
2285
+ _response_types_map: Dict[str, Optional[str]] = {
2286
+ '200': "PublicPools",
2287
+ '400': "ResultCode",
2288
+ }
2289
+ response_data = await self.api_client.call_api(
2290
+ *_param,
2291
+ _request_timeout=_request_timeout
2292
+ )
2293
+ return response_data.response
2294
+
2295
+
2296
+ def _public_pools_serialize(
2297
+ self,
2298
+ index,
2299
+ limit,
2300
+ filter,
2301
+ account_index,
2302
+ _request_auth,
2303
+ _content_type,
2304
+ _headers,
2305
+ _host_index,
2306
+ ) -> RequestSerialized:
2307
+
2308
+ _host = None
2309
+
2310
+ _collection_formats: Dict[str, str] = {
2311
+ }
2312
+
2313
+ _path_params: Dict[str, str] = {}
2314
+ _query_params: List[Tuple[str, str]] = []
2315
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2316
+ _form_params: List[Tuple[str, str]] = []
2317
+ _files: Dict[str, Union[str, bytes]] = {}
2318
+ _body_params: Optional[bytes] = None
2319
+
2320
+ # process the path parameters
2321
+ # process the query parameters
2322
+ if filter is not None:
2323
+
2324
+ _query_params.append(('filter', filter))
2325
+
2326
+ if index is not None:
2327
+
2328
+ _query_params.append(('index', index))
2329
+
2330
+ if limit is not None:
2331
+
2332
+ _query_params.append(('limit', limit))
2333
+
2334
+ if account_index is not None:
2335
+
2336
+ _query_params.append(('account_index', account_index))
2337
+
2338
+ # process the header parameters
2339
+ # process the form parameters
2340
+ # process the body parameter
2341
+
2342
+
2343
+ # set the HTTP header `Accept`
2344
+ if 'Accept' not in _header_params:
2345
+ _header_params['Accept'] = self.api_client.select_header_accept(
2346
+ [
2347
+ 'application/json'
2348
+ ]
2349
+ )
2350
+
2351
+
2352
+ # authentication setting
2353
+ _auth_settings: List[str] = [
2354
+ ]
2355
+
2356
+ return self.api_client.param_serialize(
2357
+ method='GET',
2358
+ resource_path='/api/v1/publicPools',
2359
+ path_params=_path_params,
2360
+ query_params=_query_params,
2361
+ header_params=_header_params,
2362
+ body=_body_params,
2363
+ post_params=_form_params,
2364
+ files=_files,
2365
+ auth_settings=_auth_settings,
2366
+ collection_formats=_collection_formats,
2367
+ _host=_host,
2368
+ _request_auth=_request_auth
2369
+ )
2370
+
2371
+