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,718 @@
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 StrictBool, StrictInt, StrictStr, field_validator
20
+ from typing import Optional
21
+ from lighter.models.candlesticks import Candlesticks
22
+ from lighter.models.fundings import Fundings
23
+
24
+ from lighter.api_client import ApiClient, RequestSerialized
25
+ from lighter.api_response import ApiResponse
26
+ from lighter.rest import RESTResponseType
27
+
28
+
29
+ class CandlestickApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+
42
+ @validate_call
43
+ async def candlesticks(
44
+ self,
45
+ market_id: StrictInt,
46
+ resolution: StrictStr,
47
+ start_timestamp: StrictInt,
48
+ end_timestamp: StrictInt,
49
+ count_back: StrictInt,
50
+ set_timestamp_to_end: Optional[StrictBool] = None,
51
+ _request_timeout: Union[
52
+ None,
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Tuple[
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Annotated[StrictFloat, Field(gt=0)]
57
+ ]
58
+ ] = None,
59
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
60
+ _content_type: Optional[StrictStr] = None,
61
+ _headers: Optional[Dict[StrictStr, Any]] = None,
62
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
63
+ ) -> Candlesticks:
64
+ """candlesticks
65
+
66
+ Get candlesticks
67
+
68
+ :param market_id: (required)
69
+ :type market_id: int
70
+ :param resolution: (required)
71
+ :type resolution: str
72
+ :param start_timestamp: (required)
73
+ :type start_timestamp: int
74
+ :param end_timestamp: (required)
75
+ :type end_timestamp: int
76
+ :param count_back: (required)
77
+ :type count_back: int
78
+ :param set_timestamp_to_end:
79
+ :type set_timestamp_to_end: bool
80
+ :param _request_timeout: timeout setting for this request. If one
81
+ number provided, it will be total request
82
+ timeout. It can also be a pair (tuple) of
83
+ (connection, read) timeouts.
84
+ :type _request_timeout: int, tuple(int, int), optional
85
+ :param _request_auth: set to override the auth_settings for an a single
86
+ request; this effectively ignores the
87
+ authentication in the spec for a single request.
88
+ :type _request_auth: dict, optional
89
+ :param _content_type: force content-type for the request.
90
+ :type _content_type: str, Optional
91
+ :param _headers: set to override the headers for a single
92
+ request; this effectively ignores the headers
93
+ in the spec for a single request.
94
+ :type _headers: dict, optional
95
+ :param _host_index: set to override the host_index for a single
96
+ request; this effectively ignores the host_index
97
+ in the spec for a single request.
98
+ :type _host_index: int, optional
99
+ :return: Returns the result object.
100
+ """ # noqa: E501
101
+
102
+ _param = self._candlesticks_serialize(
103
+ market_id=market_id,
104
+ resolution=resolution,
105
+ start_timestamp=start_timestamp,
106
+ end_timestamp=end_timestamp,
107
+ count_back=count_back,
108
+ set_timestamp_to_end=set_timestamp_to_end,
109
+ _request_auth=_request_auth,
110
+ _content_type=_content_type,
111
+ _headers=_headers,
112
+ _host_index=_host_index
113
+ )
114
+
115
+ _response_types_map: Dict[str, Optional[str]] = {
116
+ '200': "Candlesticks",
117
+ '400': "ResultCode",
118
+ }
119
+ response_data = await self.api_client.call_api(
120
+ *_param,
121
+ _request_timeout=_request_timeout
122
+ )
123
+ await response_data.read()
124
+ return self.api_client.response_deserialize(
125
+ response_data=response_data,
126
+ response_types_map=_response_types_map,
127
+ ).data
128
+
129
+
130
+ @validate_call
131
+ async def candlesticks_with_http_info(
132
+ self,
133
+ market_id: StrictInt,
134
+ resolution: StrictStr,
135
+ start_timestamp: StrictInt,
136
+ end_timestamp: StrictInt,
137
+ count_back: StrictInt,
138
+ set_timestamp_to_end: Optional[StrictBool] = None,
139
+ _request_timeout: Union[
140
+ None,
141
+ Annotated[StrictFloat, Field(gt=0)],
142
+ Tuple[
143
+ Annotated[StrictFloat, Field(gt=0)],
144
+ Annotated[StrictFloat, Field(gt=0)]
145
+ ]
146
+ ] = None,
147
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
148
+ _content_type: Optional[StrictStr] = None,
149
+ _headers: Optional[Dict[StrictStr, Any]] = None,
150
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
151
+ ) -> ApiResponse[Candlesticks]:
152
+ """candlesticks
153
+
154
+ Get candlesticks
155
+
156
+ :param market_id: (required)
157
+ :type market_id: int
158
+ :param resolution: (required)
159
+ :type resolution: str
160
+ :param start_timestamp: (required)
161
+ :type start_timestamp: int
162
+ :param end_timestamp: (required)
163
+ :type end_timestamp: int
164
+ :param count_back: (required)
165
+ :type count_back: int
166
+ :param set_timestamp_to_end:
167
+ :type set_timestamp_to_end: bool
168
+ :param _request_timeout: timeout setting for this request. If one
169
+ number provided, it will be total request
170
+ timeout. It can also be a pair (tuple) of
171
+ (connection, read) timeouts.
172
+ :type _request_timeout: int, tuple(int, int), optional
173
+ :param _request_auth: set to override the auth_settings for an a single
174
+ request; this effectively ignores the
175
+ authentication in the spec for a single request.
176
+ :type _request_auth: dict, optional
177
+ :param _content_type: force content-type for the request.
178
+ :type _content_type: str, Optional
179
+ :param _headers: set to override the headers for a single
180
+ request; this effectively ignores the headers
181
+ in the spec for a single request.
182
+ :type _headers: dict, optional
183
+ :param _host_index: set to override the host_index for a single
184
+ request; this effectively ignores the host_index
185
+ in the spec for a single request.
186
+ :type _host_index: int, optional
187
+ :return: Returns the result object.
188
+ """ # noqa: E501
189
+
190
+ _param = self._candlesticks_serialize(
191
+ market_id=market_id,
192
+ resolution=resolution,
193
+ start_timestamp=start_timestamp,
194
+ end_timestamp=end_timestamp,
195
+ count_back=count_back,
196
+ set_timestamp_to_end=set_timestamp_to_end,
197
+ _request_auth=_request_auth,
198
+ _content_type=_content_type,
199
+ _headers=_headers,
200
+ _host_index=_host_index
201
+ )
202
+
203
+ _response_types_map: Dict[str, Optional[str]] = {
204
+ '200': "Candlesticks",
205
+ '400': "ResultCode",
206
+ }
207
+ response_data = await self.api_client.call_api(
208
+ *_param,
209
+ _request_timeout=_request_timeout
210
+ )
211
+ await response_data.read()
212
+ return self.api_client.response_deserialize(
213
+ response_data=response_data,
214
+ response_types_map=_response_types_map,
215
+ )
216
+
217
+
218
+ @validate_call
219
+ async def candlesticks_without_preload_content(
220
+ self,
221
+ market_id: StrictInt,
222
+ resolution: StrictStr,
223
+ start_timestamp: StrictInt,
224
+ end_timestamp: StrictInt,
225
+ count_back: StrictInt,
226
+ set_timestamp_to_end: Optional[StrictBool] = None,
227
+ _request_timeout: Union[
228
+ None,
229
+ Annotated[StrictFloat, Field(gt=0)],
230
+ Tuple[
231
+ Annotated[StrictFloat, Field(gt=0)],
232
+ Annotated[StrictFloat, Field(gt=0)]
233
+ ]
234
+ ] = None,
235
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
236
+ _content_type: Optional[StrictStr] = None,
237
+ _headers: Optional[Dict[StrictStr, Any]] = None,
238
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
239
+ ) -> RESTResponseType:
240
+ """candlesticks
241
+
242
+ Get candlesticks
243
+
244
+ :param market_id: (required)
245
+ :type market_id: int
246
+ :param resolution: (required)
247
+ :type resolution: str
248
+ :param start_timestamp: (required)
249
+ :type start_timestamp: int
250
+ :param end_timestamp: (required)
251
+ :type end_timestamp: int
252
+ :param count_back: (required)
253
+ :type count_back: int
254
+ :param set_timestamp_to_end:
255
+ :type set_timestamp_to_end: bool
256
+ :param _request_timeout: timeout setting for this request. If one
257
+ number provided, it will be total request
258
+ timeout. It can also be a pair (tuple) of
259
+ (connection, read) timeouts.
260
+ :type _request_timeout: int, tuple(int, int), optional
261
+ :param _request_auth: set to override the auth_settings for an a single
262
+ request; this effectively ignores the
263
+ authentication in the spec for a single request.
264
+ :type _request_auth: dict, optional
265
+ :param _content_type: force content-type for the request.
266
+ :type _content_type: str, Optional
267
+ :param _headers: set to override the headers for a single
268
+ request; this effectively ignores the headers
269
+ in the spec for a single request.
270
+ :type _headers: dict, optional
271
+ :param _host_index: set to override the host_index for a single
272
+ request; this effectively ignores the host_index
273
+ in the spec for a single request.
274
+ :type _host_index: int, optional
275
+ :return: Returns the result object.
276
+ """ # noqa: E501
277
+
278
+ _param = self._candlesticks_serialize(
279
+ market_id=market_id,
280
+ resolution=resolution,
281
+ start_timestamp=start_timestamp,
282
+ end_timestamp=end_timestamp,
283
+ count_back=count_back,
284
+ set_timestamp_to_end=set_timestamp_to_end,
285
+ _request_auth=_request_auth,
286
+ _content_type=_content_type,
287
+ _headers=_headers,
288
+ _host_index=_host_index
289
+ )
290
+
291
+ _response_types_map: Dict[str, Optional[str]] = {
292
+ '200': "Candlesticks",
293
+ '400': "ResultCode",
294
+ }
295
+ response_data = await self.api_client.call_api(
296
+ *_param,
297
+ _request_timeout=_request_timeout
298
+ )
299
+ return response_data.response
300
+
301
+
302
+ def _candlesticks_serialize(
303
+ self,
304
+ market_id,
305
+ resolution,
306
+ start_timestamp,
307
+ end_timestamp,
308
+ count_back,
309
+ set_timestamp_to_end,
310
+ _request_auth,
311
+ _content_type,
312
+ _headers,
313
+ _host_index,
314
+ ) -> RequestSerialized:
315
+
316
+ _host = None
317
+
318
+ _collection_formats: Dict[str, str] = {
319
+ }
320
+
321
+ _path_params: Dict[str, str] = {}
322
+ _query_params: List[Tuple[str, str]] = []
323
+ _header_params: Dict[str, Optional[str]] = _headers or {}
324
+ _form_params: List[Tuple[str, str]] = []
325
+ _files: Dict[str, Union[str, bytes]] = {}
326
+ _body_params: Optional[bytes] = None
327
+
328
+ # process the path parameters
329
+ # process the query parameters
330
+ if market_id is not None:
331
+
332
+ _query_params.append(('market_id', market_id))
333
+
334
+ if resolution is not None:
335
+
336
+ _query_params.append(('resolution', resolution))
337
+
338
+ if start_timestamp is not None:
339
+
340
+ _query_params.append(('start_timestamp', start_timestamp))
341
+
342
+ if end_timestamp is not None:
343
+
344
+ _query_params.append(('end_timestamp', end_timestamp))
345
+
346
+ if count_back is not None:
347
+
348
+ _query_params.append(('count_back', count_back))
349
+
350
+ if set_timestamp_to_end is not None:
351
+
352
+ _query_params.append(('set_timestamp_to_end', set_timestamp_to_end))
353
+
354
+ # process the header parameters
355
+ # process the form parameters
356
+ # process the body parameter
357
+
358
+
359
+ # set the HTTP header `Accept`
360
+ if 'Accept' not in _header_params:
361
+ _header_params['Accept'] = self.api_client.select_header_accept(
362
+ [
363
+ 'application/json'
364
+ ]
365
+ )
366
+
367
+
368
+ # authentication setting
369
+ _auth_settings: List[str] = [
370
+ ]
371
+
372
+ return self.api_client.param_serialize(
373
+ method='GET',
374
+ resource_path='/api/v1/candlesticks',
375
+ path_params=_path_params,
376
+ query_params=_query_params,
377
+ header_params=_header_params,
378
+ body=_body_params,
379
+ post_params=_form_params,
380
+ files=_files,
381
+ auth_settings=_auth_settings,
382
+ collection_formats=_collection_formats,
383
+ _host=_host,
384
+ _request_auth=_request_auth
385
+ )
386
+
387
+
388
+
389
+
390
+ @validate_call
391
+ async def fundings(
392
+ self,
393
+ market_id: StrictInt,
394
+ resolution: StrictStr,
395
+ start_timestamp: StrictInt,
396
+ end_timestamp: StrictInt,
397
+ count_back: StrictInt,
398
+ _request_timeout: Union[
399
+ None,
400
+ Annotated[StrictFloat, Field(gt=0)],
401
+ Tuple[
402
+ Annotated[StrictFloat, Field(gt=0)],
403
+ Annotated[StrictFloat, Field(gt=0)]
404
+ ]
405
+ ] = None,
406
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
407
+ _content_type: Optional[StrictStr] = None,
408
+ _headers: Optional[Dict[StrictStr, Any]] = None,
409
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
410
+ ) -> Fundings:
411
+ """fundings
412
+
413
+ Get fundings
414
+
415
+ :param market_id: (required)
416
+ :type market_id: int
417
+ :param resolution: (required)
418
+ :type resolution: str
419
+ :param start_timestamp: (required)
420
+ :type start_timestamp: int
421
+ :param end_timestamp: (required)
422
+ :type end_timestamp: int
423
+ :param count_back: (required)
424
+ :type count_back: int
425
+ :param _request_timeout: timeout setting for this request. If one
426
+ number provided, it will be total request
427
+ timeout. It can also be a pair (tuple) of
428
+ (connection, read) timeouts.
429
+ :type _request_timeout: int, tuple(int, int), optional
430
+ :param _request_auth: set to override the auth_settings for an a single
431
+ request; this effectively ignores the
432
+ authentication in the spec for a single request.
433
+ :type _request_auth: dict, optional
434
+ :param _content_type: force content-type for the request.
435
+ :type _content_type: str, Optional
436
+ :param _headers: set to override the headers for a single
437
+ request; this effectively ignores the headers
438
+ in the spec for a single request.
439
+ :type _headers: dict, optional
440
+ :param _host_index: set to override the host_index for a single
441
+ request; this effectively ignores the host_index
442
+ in the spec for a single request.
443
+ :type _host_index: int, optional
444
+ :return: Returns the result object.
445
+ """ # noqa: E501
446
+
447
+ _param = self._fundings_serialize(
448
+ market_id=market_id,
449
+ resolution=resolution,
450
+ start_timestamp=start_timestamp,
451
+ end_timestamp=end_timestamp,
452
+ count_back=count_back,
453
+ _request_auth=_request_auth,
454
+ _content_type=_content_type,
455
+ _headers=_headers,
456
+ _host_index=_host_index
457
+ )
458
+
459
+ _response_types_map: Dict[str, Optional[str]] = {
460
+ '200': "Fundings",
461
+ '400': "ResultCode",
462
+ }
463
+ response_data = await self.api_client.call_api(
464
+ *_param,
465
+ _request_timeout=_request_timeout
466
+ )
467
+ await response_data.read()
468
+ return self.api_client.response_deserialize(
469
+ response_data=response_data,
470
+ response_types_map=_response_types_map,
471
+ ).data
472
+
473
+
474
+ @validate_call
475
+ async def fundings_with_http_info(
476
+ self,
477
+ market_id: StrictInt,
478
+ resolution: StrictStr,
479
+ start_timestamp: StrictInt,
480
+ end_timestamp: StrictInt,
481
+ count_back: StrictInt,
482
+ _request_timeout: Union[
483
+ None,
484
+ Annotated[StrictFloat, Field(gt=0)],
485
+ Tuple[
486
+ Annotated[StrictFloat, Field(gt=0)],
487
+ Annotated[StrictFloat, Field(gt=0)]
488
+ ]
489
+ ] = None,
490
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
491
+ _content_type: Optional[StrictStr] = None,
492
+ _headers: Optional[Dict[StrictStr, Any]] = None,
493
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
494
+ ) -> ApiResponse[Fundings]:
495
+ """fundings
496
+
497
+ Get fundings
498
+
499
+ :param market_id: (required)
500
+ :type market_id: int
501
+ :param resolution: (required)
502
+ :type resolution: str
503
+ :param start_timestamp: (required)
504
+ :type start_timestamp: int
505
+ :param end_timestamp: (required)
506
+ :type end_timestamp: int
507
+ :param count_back: (required)
508
+ :type count_back: int
509
+ :param _request_timeout: timeout setting for this request. If one
510
+ number provided, it will be total request
511
+ timeout. It can also be a pair (tuple) of
512
+ (connection, read) timeouts.
513
+ :type _request_timeout: int, tuple(int, int), optional
514
+ :param _request_auth: set to override the auth_settings for an a single
515
+ request; this effectively ignores the
516
+ authentication in the spec for a single request.
517
+ :type _request_auth: dict, optional
518
+ :param _content_type: force content-type for the request.
519
+ :type _content_type: str, Optional
520
+ :param _headers: set to override the headers for a single
521
+ request; this effectively ignores the headers
522
+ in the spec for a single request.
523
+ :type _headers: dict, optional
524
+ :param _host_index: set to override the host_index for a single
525
+ request; this effectively ignores the host_index
526
+ in the spec for a single request.
527
+ :type _host_index: int, optional
528
+ :return: Returns the result object.
529
+ """ # noqa: E501
530
+
531
+ _param = self._fundings_serialize(
532
+ market_id=market_id,
533
+ resolution=resolution,
534
+ start_timestamp=start_timestamp,
535
+ end_timestamp=end_timestamp,
536
+ count_back=count_back,
537
+ _request_auth=_request_auth,
538
+ _content_type=_content_type,
539
+ _headers=_headers,
540
+ _host_index=_host_index
541
+ )
542
+
543
+ _response_types_map: Dict[str, Optional[str]] = {
544
+ '200': "Fundings",
545
+ '400': "ResultCode",
546
+ }
547
+ response_data = await self.api_client.call_api(
548
+ *_param,
549
+ _request_timeout=_request_timeout
550
+ )
551
+ await response_data.read()
552
+ return self.api_client.response_deserialize(
553
+ response_data=response_data,
554
+ response_types_map=_response_types_map,
555
+ )
556
+
557
+
558
+ @validate_call
559
+ async def fundings_without_preload_content(
560
+ self,
561
+ market_id: StrictInt,
562
+ resolution: StrictStr,
563
+ start_timestamp: StrictInt,
564
+ end_timestamp: StrictInt,
565
+ count_back: StrictInt,
566
+ _request_timeout: Union[
567
+ None,
568
+ Annotated[StrictFloat, Field(gt=0)],
569
+ Tuple[
570
+ Annotated[StrictFloat, Field(gt=0)],
571
+ Annotated[StrictFloat, Field(gt=0)]
572
+ ]
573
+ ] = None,
574
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
575
+ _content_type: Optional[StrictStr] = None,
576
+ _headers: Optional[Dict[StrictStr, Any]] = None,
577
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
578
+ ) -> RESTResponseType:
579
+ """fundings
580
+
581
+ Get fundings
582
+
583
+ :param market_id: (required)
584
+ :type market_id: int
585
+ :param resolution: (required)
586
+ :type resolution: str
587
+ :param start_timestamp: (required)
588
+ :type start_timestamp: int
589
+ :param end_timestamp: (required)
590
+ :type end_timestamp: int
591
+ :param count_back: (required)
592
+ :type count_back: int
593
+ :param _request_timeout: timeout setting for this request. If one
594
+ number provided, it will be total request
595
+ timeout. It can also be a pair (tuple) of
596
+ (connection, read) timeouts.
597
+ :type _request_timeout: int, tuple(int, int), optional
598
+ :param _request_auth: set to override the auth_settings for an a single
599
+ request; this effectively ignores the
600
+ authentication in the spec for a single request.
601
+ :type _request_auth: dict, optional
602
+ :param _content_type: force content-type for the request.
603
+ :type _content_type: str, Optional
604
+ :param _headers: set to override the headers for a single
605
+ request; this effectively ignores the headers
606
+ in the spec for a single request.
607
+ :type _headers: dict, optional
608
+ :param _host_index: set to override the host_index for a single
609
+ request; this effectively ignores the host_index
610
+ in the spec for a single request.
611
+ :type _host_index: int, optional
612
+ :return: Returns the result object.
613
+ """ # noqa: E501
614
+
615
+ _param = self._fundings_serialize(
616
+ market_id=market_id,
617
+ resolution=resolution,
618
+ start_timestamp=start_timestamp,
619
+ end_timestamp=end_timestamp,
620
+ count_back=count_back,
621
+ _request_auth=_request_auth,
622
+ _content_type=_content_type,
623
+ _headers=_headers,
624
+ _host_index=_host_index
625
+ )
626
+
627
+ _response_types_map: Dict[str, Optional[str]] = {
628
+ '200': "Fundings",
629
+ '400': "ResultCode",
630
+ }
631
+ response_data = await self.api_client.call_api(
632
+ *_param,
633
+ _request_timeout=_request_timeout
634
+ )
635
+ return response_data.response
636
+
637
+
638
+ def _fundings_serialize(
639
+ self,
640
+ market_id,
641
+ resolution,
642
+ start_timestamp,
643
+ end_timestamp,
644
+ count_back,
645
+ _request_auth,
646
+ _content_type,
647
+ _headers,
648
+ _host_index,
649
+ ) -> RequestSerialized:
650
+
651
+ _host = None
652
+
653
+ _collection_formats: Dict[str, str] = {
654
+ }
655
+
656
+ _path_params: Dict[str, str] = {}
657
+ _query_params: List[Tuple[str, str]] = []
658
+ _header_params: Dict[str, Optional[str]] = _headers or {}
659
+ _form_params: List[Tuple[str, str]] = []
660
+ _files: Dict[str, Union[str, bytes]] = {}
661
+ _body_params: Optional[bytes] = None
662
+
663
+ # process the path parameters
664
+ # process the query parameters
665
+ if market_id is not None:
666
+
667
+ _query_params.append(('market_id', market_id))
668
+
669
+ if resolution is not None:
670
+
671
+ _query_params.append(('resolution', resolution))
672
+
673
+ if start_timestamp is not None:
674
+
675
+ _query_params.append(('start_timestamp', start_timestamp))
676
+
677
+ if end_timestamp is not None:
678
+
679
+ _query_params.append(('end_timestamp', end_timestamp))
680
+
681
+ if count_back is not None:
682
+
683
+ _query_params.append(('count_back', count_back))
684
+
685
+ # process the header parameters
686
+ # process the form parameters
687
+ # process the body parameter
688
+
689
+
690
+ # set the HTTP header `Accept`
691
+ if 'Accept' not in _header_params:
692
+ _header_params['Accept'] = self.api_client.select_header_accept(
693
+ [
694
+ 'application/json'
695
+ ]
696
+ )
697
+
698
+
699
+ # authentication setting
700
+ _auth_settings: List[str] = [
701
+ ]
702
+
703
+ return self.api_client.param_serialize(
704
+ method='GET',
705
+ resource_path='/api/v1/fundings',
706
+ path_params=_path_params,
707
+ query_params=_query_params,
708
+ header_params=_header_params,
709
+ body=_body_params,
710
+ post_params=_form_params,
711
+ files=_files,
712
+ auth_settings=_auth_settings,
713
+ collection_formats=_collection_formats,
714
+ _host=_host,
715
+ _request_auth=_request_auth
716
+ )
717
+
718
+