kalshi-python-sync 3.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kalshi_python_sync/__init__.py +272 -0
- kalshi_python_sync/api/__init__.py +19 -0
- kalshi_python_sync/api/api_keys_api.py +1098 -0
- kalshi_python_sync/api/communications_api.py +3216 -0
- kalshi_python_sync/api/events_api.py +1941 -0
- kalshi_python_sync/api/exchange_api.py +1263 -0
- kalshi_python_sync/api/fcm_api.py +792 -0
- kalshi_python_sync/api/incentive_programs_api.py +346 -0
- kalshi_python_sync/api/live_data_api.py +564 -0
- kalshi_python_sync/api/market_api.py +2568 -0
- kalshi_python_sync/api/milestone_api.py +689 -0
- kalshi_python_sync/api/multivariate_api.py +1486 -0
- kalshi_python_sync/api/order_groups_api.py +1375 -0
- kalshi_python_sync/api/orders_api.py +2913 -0
- kalshi_python_sync/api/portfolio_api.py +1572 -0
- kalshi_python_sync/api/search_api.py +516 -0
- kalshi_python_sync/api/structured_targets_api.py +605 -0
- kalshi_python_sync/api_client.py +830 -0
- kalshi_python_sync/api_response.py +21 -0
- kalshi_python_sync/auth.py +89 -0
- kalshi_python_sync/configuration.py +626 -0
- kalshi_python_sync/exceptions.py +216 -0
- kalshi_python_sync/models/__init__.py +136 -0
- kalshi_python_sync/models/accept_quote_request.py +94 -0
- kalshi_python_sync/models/amend_order_request.py +120 -0
- kalshi_python_sync/models/amend_order_response.py +96 -0
- kalshi_python_sync/models/announcement.py +108 -0
- kalshi_python_sync/models/api_key.py +89 -0
- kalshi_python_sync/models/associated_event.py +105 -0
- kalshi_python_sync/models/batch_cancel_orders_individual_response.py +111 -0
- kalshi_python_sync/models/batch_cancel_orders_request.py +87 -0
- kalshi_python_sync/models/batch_cancel_orders_response.py +95 -0
- kalshi_python_sync/models/batch_create_orders_individual_response.py +114 -0
- kalshi_python_sync/models/batch_create_orders_request.py +95 -0
- kalshi_python_sync/models/batch_create_orders_response.py +95 -0
- kalshi_python_sync/models/batch_get_market_candlesticks_response.py +95 -0
- kalshi_python_sync/models/bid_ask_distribution.py +101 -0
- kalshi_python_sync/models/cancel_order_response.py +93 -0
- kalshi_python_sync/models/create_api_key_request.py +89 -0
- kalshi_python_sync/models/create_api_key_response.py +87 -0
- kalshi_python_sync/models/create_market_in_multivariate_event_collection_request.py +95 -0
- kalshi_python_sync/models/create_market_in_multivariate_event_collection_response.py +89 -0
- kalshi_python_sync/models/create_order_group_request.py +88 -0
- kalshi_python_sync/models/create_order_group_response.py +87 -0
- kalshi_python_sync/models/create_order_request.py +159 -0
- kalshi_python_sync/models/create_order_response.py +91 -0
- kalshi_python_sync/models/create_quote_request.py +93 -0
- kalshi_python_sync/models/create_quote_response.py +87 -0
- kalshi_python_sync/models/create_rfq_request.py +97 -0
- kalshi_python_sync/models/create_rfq_response.py +87 -0
- kalshi_python_sync/models/daily_schedule.py +89 -0
- kalshi_python_sync/models/decrease_order_request.py +90 -0
- kalshi_python_sync/models/decrease_order_response.py +91 -0
- kalshi_python_sync/models/error_response.py +93 -0
- kalshi_python_sync/models/event_data.py +133 -0
- kalshi_python_sync/models/event_position.py +105 -0
- kalshi_python_sync/models/exchange_status.py +97 -0
- kalshi_python_sync/models/fill.py +134 -0
- kalshi_python_sync/models/forecast_percentiles_point.py +101 -0
- kalshi_python_sync/models/generate_api_key_request.py +87 -0
- kalshi_python_sync/models/generate_api_key_response.py +89 -0
- kalshi_python_sync/models/get_api_keys_response.py +95 -0
- kalshi_python_sync/models/get_balance_response.py +91 -0
- kalshi_python_sync/models/get_communications_id_response.py +87 -0
- kalshi_python_sync/models/get_event_candlesticks_response.py +104 -0
- kalshi_python_sync/models/get_event_forecast_percentiles_history_response.py +95 -0
- kalshi_python_sync/models/get_event_metadata_response.py +123 -0
- kalshi_python_sync/models/get_event_response.py +101 -0
- kalshi_python_sync/models/get_events_response.py +107 -0
- kalshi_python_sync/models/get_exchange_announcements_response.py +95 -0
- kalshi_python_sync/models/get_exchange_schedule_response.py +91 -0
- kalshi_python_sync/models/get_fills_response.py +97 -0
- kalshi_python_sync/models/get_filters_by_sports_response.py +102 -0
- kalshi_python_sync/models/get_incentive_programs_response.py +97 -0
- kalshi_python_sync/models/get_live_data_response.py +91 -0
- kalshi_python_sync/models/get_live_datas_response.py +95 -0
- kalshi_python_sync/models/get_market_candlesticks_response.py +97 -0
- kalshi_python_sync/models/get_market_orderbook_response.py +91 -0
- kalshi_python_sync/models/get_market_response.py +91 -0
- kalshi_python_sync/models/get_markets_response.py +97 -0
- kalshi_python_sync/models/get_milestone_response.py +91 -0
- kalshi_python_sync/models/get_milestones_response.py +97 -0
- kalshi_python_sync/models/get_multivariate_event_collection_lookup_history_response.py +95 -0
- kalshi_python_sync/models/get_multivariate_event_collection_response.py +91 -0
- kalshi_python_sync/models/get_multivariate_event_collections_response.py +97 -0
- kalshi_python_sync/models/get_multivariate_events_response.py +97 -0
- kalshi_python_sync/models/get_order_group_response.py +89 -0
- kalshi_python_sync/models/get_order_groups_response.py +95 -0
- kalshi_python_sync/models/get_order_queue_position_response.py +87 -0
- kalshi_python_sync/models/get_order_queue_positions_response.py +95 -0
- kalshi_python_sync/models/get_order_response.py +91 -0
- kalshi_python_sync/models/get_orders_response.py +97 -0
- kalshi_python_sync/models/get_portfolio_resting_order_total_value_response.py +87 -0
- kalshi_python_sync/models/get_positions_response.py +107 -0
- kalshi_python_sync/models/get_quote_response.py +91 -0
- kalshi_python_sync/models/get_quotes_response.py +97 -0
- kalshi_python_sync/models/get_rfq_response.py +91 -0
- kalshi_python_sync/models/get_rfqs_response.py +97 -0
- kalshi_python_sync/models/get_series_fee_changes_response.py +95 -0
- kalshi_python_sync/models/get_series_list_response.py +95 -0
- kalshi_python_sync/models/get_series_response.py +91 -0
- kalshi_python_sync/models/get_settlements_response.py +97 -0
- kalshi_python_sync/models/get_structured_target_response.py +91 -0
- kalshi_python_sync/models/get_structured_targets_response.py +97 -0
- kalshi_python_sync/models/get_tags_for_series_categories_response.py +87 -0
- kalshi_python_sync/models/get_trades_response.py +97 -0
- kalshi_python_sync/models/get_user_data_timestamp_response.py +88 -0
- kalshi_python_sync/models/incentive_program.py +121 -0
- kalshi_python_sync/models/live_data.py +91 -0
- kalshi_python_sync/models/lookup_point.py +102 -0
- kalshi_python_sync/models/lookup_tickers_for_market_in_multivariate_event_collection_request.py +95 -0
- kalshi_python_sync/models/lookup_tickers_for_market_in_multivariate_event_collection_response.py +89 -0
- kalshi_python_sync/models/maintenance_window.py +90 -0
- kalshi_python_sync/models/market.py +307 -0
- kalshi_python_sync/models/market_candlestick.py +108 -0
- kalshi_python_sync/models/market_candlesticks_response.py +97 -0
- kalshi_python_sync/models/market_metadata.py +91 -0
- kalshi_python_sync/models/market_position.py +110 -0
- kalshi_python_sync/models/milestone.py +120 -0
- kalshi_python_sync/models/multivariate_event_collection.py +122 -0
- kalshi_python_sync/models/mve_selected_leg.py +91 -0
- kalshi_python_sync/models/order.py +189 -0
- kalshi_python_sync/models/order_group.py +89 -0
- kalshi_python_sync/models/order_queue_position.py +91 -0
- kalshi_python_sync/models/order_status.py +38 -0
- kalshi_python_sync/models/orderbook.py +94 -0
- kalshi_python_sync/models/percentile_point.py +93 -0
- kalshi_python_sync/models/price_distribution.py +157 -0
- kalshi_python_sync/models/price_range.py +91 -0
- kalshi_python_sync/models/quote.py +153 -0
- kalshi_python_sync/models/rfq.py +129 -0
- kalshi_python_sync/models/schedule.py +105 -0
- kalshi_python_sync/models/scope_list.py +87 -0
- kalshi_python_sync/models/self_trade_prevention_type.py +37 -0
- kalshi_python_sync/models/series.py +129 -0
- kalshi_python_sync/models/series_fee_change.py +103 -0
- kalshi_python_sync/models/settlement.py +118 -0
- kalshi_python_sync/models/settlement_source.py +89 -0
- kalshi_python_sync/models/sport_filter_details.py +102 -0
- kalshi_python_sync/models/structured_target.py +98 -0
- kalshi_python_sync/models/ticker_pair.py +98 -0
- kalshi_python_sync/models/trade.py +113 -0
- kalshi_python_sync/models/weekly_schedule.py +154 -0
- kalshi_python_sync/py.typed +0 -0
- kalshi_python_sync/rest.py +258 -0
- kalshi_python_sync-3.0.0.dist-info/METADATA +77 -0
- kalshi_python_sync-3.0.0.dist-info/RECORD +149 -0
- kalshi_python_sync-3.0.0.dist-info/WHEEL +5 -0
- kalshi_python_sync-3.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,2568 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Kalshi Trade API Manual Endpoints
|
|
5
|
+
|
|
6
|
+
Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
import warnings
|
|
14
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt, StrictBool
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
from typing_extensions import Annotated
|
|
17
|
+
|
|
18
|
+
from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
19
|
+
from typing import Optional
|
|
20
|
+
from typing_extensions import Annotated
|
|
21
|
+
from kalshi_python_sync.models.batch_get_market_candlesticks_response import BatchGetMarketCandlesticksResponse
|
|
22
|
+
from kalshi_python_sync.models.get_market_candlesticks_response import GetMarketCandlesticksResponse
|
|
23
|
+
from kalshi_python_sync.models.get_market_orderbook_response import GetMarketOrderbookResponse
|
|
24
|
+
from kalshi_python_sync.models.get_market_response import GetMarketResponse
|
|
25
|
+
from kalshi_python_sync.models.get_markets_response import GetMarketsResponse
|
|
26
|
+
from kalshi_python_sync.models.get_series_list_response import GetSeriesListResponse
|
|
27
|
+
from kalshi_python_sync.models.get_series_response import GetSeriesResponse
|
|
28
|
+
from kalshi_python_sync.models.get_trades_response import GetTradesResponse
|
|
29
|
+
|
|
30
|
+
from kalshi_python_sync.api_client import ApiClient, RequestSerialized
|
|
31
|
+
from kalshi_python_sync.api_response import ApiResponse
|
|
32
|
+
from kalshi_python_sync.rest import RESTResponseType
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class MarketApi:
|
|
36
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
37
|
+
Ref: https://openapi-generator.tech
|
|
38
|
+
|
|
39
|
+
Do not edit the class manually.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
def __init__(self, api_client=None) -> None:
|
|
43
|
+
if api_client is None:
|
|
44
|
+
api_client = ApiClient.get_default()
|
|
45
|
+
self.api_client = api_client
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@validate_call
|
|
49
|
+
def batch_get_market_candlesticks(
|
|
50
|
+
self,
|
|
51
|
+
market_tickers: Any,
|
|
52
|
+
start_ts: Any,
|
|
53
|
+
end_ts: Any,
|
|
54
|
+
period_interval: Any,
|
|
55
|
+
include_latest_before_start: Any = None,
|
|
56
|
+
) -> BatchGetMarketCandlesticksResponse:
|
|
57
|
+
"""Batch Get Market Candlesticks
|
|
58
|
+
|
|
59
|
+
Endpoint for retrieving candlestick data for multiple markets. - Accepts up to 100 market tickers per request - Returns up to 10,000 candlesticks total across all markets - Returns candlesticks grouped by market_id - Optionally includes a synthetic initial candlestick for price continuity (see `include_latest_before_start` parameter)
|
|
60
|
+
|
|
61
|
+
:param market_tickers: Comma-separated list of market tickers (maximum 100) (required)
|
|
62
|
+
:type market_tickers: str
|
|
63
|
+
:param start_ts: Start timestamp in Unix seconds (required)
|
|
64
|
+
:type start_ts: int
|
|
65
|
+
:param end_ts: End timestamp in Unix seconds (required)
|
|
66
|
+
:type end_ts: int
|
|
67
|
+
:param period_interval: Candlestick period interval in minutes (required)
|
|
68
|
+
:type period_interval: int
|
|
69
|
+
:param include_latest_before_start: If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by: 1. Finding the most recent real candlestick before start_ts 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts) 3. Setting all OHLC prices to null, and `previous_price` to the close price from the real candlestick
|
|
70
|
+
:type include_latest_before_start: bool
|
|
71
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
72
|
+
number provided, it will be total request
|
|
73
|
+
timeout. It can also be a pair (tuple) of
|
|
74
|
+
(connection, read) timeouts.
|
|
75
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
76
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
77
|
+
request; this effectively ignores the
|
|
78
|
+
authentication in the spec for a single request.
|
|
79
|
+
:type _request_auth: dict, optional
|
|
80
|
+
:param _content_type: force content-type for the request.
|
|
81
|
+
:type _content_type: str, Optional
|
|
82
|
+
:param _headers: set to override the headers for a single
|
|
83
|
+
request; this effectively ignores the headers
|
|
84
|
+
in the spec for a single request.
|
|
85
|
+
:type _headers: dict, optional
|
|
86
|
+
:param _host_index: set to override the host_index for a single
|
|
87
|
+
request; this effectively ignores the host_index
|
|
88
|
+
in the spec for a single request.
|
|
89
|
+
:type _host_index: int, optional
|
|
90
|
+
:return: Returns the result object.
|
|
91
|
+
""" # noqa: E501
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
_param = self._batch_get_market_candlesticks_serialize(
|
|
95
|
+
market_tickers=market_tickers,
|
|
96
|
+
start_ts=start_ts,
|
|
97
|
+
end_ts=end_ts,
|
|
98
|
+
period_interval=period_interval,
|
|
99
|
+
include_latest_before_start=include_latest_before_start,
|
|
100
|
+
_request_auth=None,
|
|
101
|
+
_content_type=None,
|
|
102
|
+
_headers=None,
|
|
103
|
+
_host_index=0
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
107
|
+
'200': "BatchGetMarketCandlesticksResponse",
|
|
108
|
+
'400': None,
|
|
109
|
+
'401': None,
|
|
110
|
+
'500': None,
|
|
111
|
+
}
|
|
112
|
+
response_data = self.api_client.call_api(
|
|
113
|
+
*_param,
|
|
114
|
+
_request_timeout=None,
|
|
115
|
+
)
|
|
116
|
+
response_data.read()
|
|
117
|
+
return self.api_client.response_deserialize(
|
|
118
|
+
response_data=response_data,
|
|
119
|
+
response_types_map=_response_types_map,
|
|
120
|
+
).data
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@validate_call
|
|
124
|
+
def batch_get_market_candlesticks_with_http_info(
|
|
125
|
+
self,
|
|
126
|
+
market_tickers: Annotated[StrictStr, Field(description="Comma-separated list of market tickers (maximum 100)")],
|
|
127
|
+
start_ts: Annotated[StrictInt, Field(description="Start timestamp in Unix seconds")],
|
|
128
|
+
end_ts: Annotated[StrictInt, Field(description="End timestamp in Unix seconds")],
|
|
129
|
+
period_interval: Annotated[int, Field(strict=True, ge=1, description="Candlestick period interval in minutes")],
|
|
130
|
+
include_latest_before_start: Annotated[Optional[StrictBool], Field(description="If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by: 1. Finding the most recent real candlestick before start_ts 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts) 3. Setting all OHLC prices to null, and `previous_price` to the close price from the real candlestick ")] = None,
|
|
131
|
+
_request_timeout: Union[
|
|
132
|
+
None,
|
|
133
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
134
|
+
Tuple[
|
|
135
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
136
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
137
|
+
]
|
|
138
|
+
] = None,
|
|
139
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
140
|
+
_content_type: Optional[StrictStr] = None,
|
|
141
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
142
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
143
|
+
) -> ApiResponse[BatchGetMarketCandlesticksResponse]:
|
|
144
|
+
"""Batch Get Market Candlesticks
|
|
145
|
+
|
|
146
|
+
Endpoint for retrieving candlestick data for multiple markets. - Accepts up to 100 market tickers per request - Returns up to 10,000 candlesticks total across all markets - Returns candlesticks grouped by market_id - Optionally includes a synthetic initial candlestick for price continuity (see `include_latest_before_start` parameter)
|
|
147
|
+
|
|
148
|
+
:param market_tickers: Comma-separated list of market tickers (maximum 100) (required)
|
|
149
|
+
:type market_tickers: str
|
|
150
|
+
:param start_ts: Start timestamp in Unix seconds (required)
|
|
151
|
+
:type start_ts: int
|
|
152
|
+
:param end_ts: End timestamp in Unix seconds (required)
|
|
153
|
+
:type end_ts: int
|
|
154
|
+
:param period_interval: Candlestick period interval in minutes (required)
|
|
155
|
+
:type period_interval: int
|
|
156
|
+
:param include_latest_before_start: If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by: 1. Finding the most recent real candlestick before start_ts 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts) 3. Setting all OHLC prices to null, and `previous_price` to the close price from the real candlestick
|
|
157
|
+
:type include_latest_before_start: bool
|
|
158
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
159
|
+
number provided, it will be total request
|
|
160
|
+
timeout. It can also be a pair (tuple) of
|
|
161
|
+
(connection, read) timeouts.
|
|
162
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
163
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
164
|
+
request; this effectively ignores the
|
|
165
|
+
authentication in the spec for a single request.
|
|
166
|
+
:type _request_auth: dict, optional
|
|
167
|
+
:param _content_type: force content-type for the request.
|
|
168
|
+
:type _content_type: str, Optional
|
|
169
|
+
:param _headers: set to override the headers for a single
|
|
170
|
+
request; this effectively ignores the headers
|
|
171
|
+
in the spec for a single request.
|
|
172
|
+
:type _headers: dict, optional
|
|
173
|
+
:param _host_index: set to override the host_index for a single
|
|
174
|
+
request; this effectively ignores the host_index
|
|
175
|
+
in the spec for a single request.
|
|
176
|
+
:type _host_index: int, optional
|
|
177
|
+
:return: Returns the result object.
|
|
178
|
+
""" # noqa: E501
|
|
179
|
+
|
|
180
|
+
_param = self._batch_get_market_candlesticks_serialize(
|
|
181
|
+
market_tickers=market_tickers,
|
|
182
|
+
start_ts=start_ts,
|
|
183
|
+
end_ts=end_ts,
|
|
184
|
+
period_interval=period_interval,
|
|
185
|
+
include_latest_before_start=include_latest_before_start,
|
|
186
|
+
_request_auth=_request_auth,
|
|
187
|
+
_content_type=_content_type,
|
|
188
|
+
_headers=_headers,
|
|
189
|
+
_host_index=_host_index
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
193
|
+
'200': "BatchGetMarketCandlesticksResponse",
|
|
194
|
+
'400': None,
|
|
195
|
+
'401': None,
|
|
196
|
+
'500': None,
|
|
197
|
+
}
|
|
198
|
+
response_data = self.api_client.call_api(
|
|
199
|
+
*_param,
|
|
200
|
+
_request_timeout=_request_timeout
|
|
201
|
+
)
|
|
202
|
+
response_data.read()
|
|
203
|
+
return self.api_client.response_deserialize(
|
|
204
|
+
response_data=response_data,
|
|
205
|
+
response_types_map=_response_types_map,
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
@validate_call
|
|
210
|
+
def batch_get_market_candlesticks_without_preload_content(
|
|
211
|
+
self,
|
|
212
|
+
market_tickers: Annotated[StrictStr, Field(description="Comma-separated list of market tickers (maximum 100)")],
|
|
213
|
+
start_ts: Annotated[StrictInt, Field(description="Start timestamp in Unix seconds")],
|
|
214
|
+
end_ts: Annotated[StrictInt, Field(description="End timestamp in Unix seconds")],
|
|
215
|
+
period_interval: Annotated[int, Field(strict=True, ge=1, description="Candlestick period interval in minutes")],
|
|
216
|
+
include_latest_before_start: Annotated[Optional[StrictBool], Field(description="If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by: 1. Finding the most recent real candlestick before start_ts 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts) 3. Setting all OHLC prices to null, and `previous_price` to the close price from the real candlestick ")] = None,
|
|
217
|
+
_request_timeout: Union[
|
|
218
|
+
None,
|
|
219
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
220
|
+
Tuple[
|
|
221
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
222
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
223
|
+
]
|
|
224
|
+
] = None,
|
|
225
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
226
|
+
_content_type: Optional[StrictStr] = None,
|
|
227
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
228
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
229
|
+
) -> RESTResponseType:
|
|
230
|
+
"""Batch Get Market Candlesticks
|
|
231
|
+
|
|
232
|
+
Endpoint for retrieving candlestick data for multiple markets. - Accepts up to 100 market tickers per request - Returns up to 10,000 candlesticks total across all markets - Returns candlesticks grouped by market_id - Optionally includes a synthetic initial candlestick for price continuity (see `include_latest_before_start` parameter)
|
|
233
|
+
|
|
234
|
+
:param market_tickers: Comma-separated list of market tickers (maximum 100) (required)
|
|
235
|
+
:type market_tickers: str
|
|
236
|
+
:param start_ts: Start timestamp in Unix seconds (required)
|
|
237
|
+
:type start_ts: int
|
|
238
|
+
:param end_ts: End timestamp in Unix seconds (required)
|
|
239
|
+
:type end_ts: int
|
|
240
|
+
:param period_interval: Candlestick period interval in minutes (required)
|
|
241
|
+
:type period_interval: int
|
|
242
|
+
:param include_latest_before_start: If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by: 1. Finding the most recent real candlestick before start_ts 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts) 3. Setting all OHLC prices to null, and `previous_price` to the close price from the real candlestick
|
|
243
|
+
:type include_latest_before_start: bool
|
|
244
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
245
|
+
number provided, it will be total request
|
|
246
|
+
timeout. It can also be a pair (tuple) of
|
|
247
|
+
(connection, read) timeouts.
|
|
248
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
249
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
250
|
+
request; this effectively ignores the
|
|
251
|
+
authentication in the spec for a single request.
|
|
252
|
+
:type _request_auth: dict, optional
|
|
253
|
+
:param _content_type: force content-type for the request.
|
|
254
|
+
:type _content_type: str, Optional
|
|
255
|
+
:param _headers: set to override the headers for a single
|
|
256
|
+
request; this effectively ignores the headers
|
|
257
|
+
in the spec for a single request.
|
|
258
|
+
:type _headers: dict, optional
|
|
259
|
+
:param _host_index: set to override the host_index for a single
|
|
260
|
+
request; this effectively ignores the host_index
|
|
261
|
+
in the spec for a single request.
|
|
262
|
+
:type _host_index: int, optional
|
|
263
|
+
:return: Returns the result object.
|
|
264
|
+
""" # noqa: E501
|
|
265
|
+
|
|
266
|
+
_param = self._batch_get_market_candlesticks_serialize(
|
|
267
|
+
market_tickers=market_tickers,
|
|
268
|
+
start_ts=start_ts,
|
|
269
|
+
end_ts=end_ts,
|
|
270
|
+
period_interval=period_interval,
|
|
271
|
+
include_latest_before_start=include_latest_before_start,
|
|
272
|
+
_request_auth=_request_auth,
|
|
273
|
+
_content_type=_content_type,
|
|
274
|
+
_headers=_headers,
|
|
275
|
+
_host_index=_host_index
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
279
|
+
'200': "BatchGetMarketCandlesticksResponse",
|
|
280
|
+
'400': None,
|
|
281
|
+
'401': None,
|
|
282
|
+
'500': None,
|
|
283
|
+
}
|
|
284
|
+
response_data = self.api_client.call_api(
|
|
285
|
+
*_param,
|
|
286
|
+
_request_timeout=_request_timeout
|
|
287
|
+
)
|
|
288
|
+
return response_data.response
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
def _batch_get_market_candlesticks_serialize(
|
|
292
|
+
self,
|
|
293
|
+
market_tickers,
|
|
294
|
+
start_ts,
|
|
295
|
+
end_ts,
|
|
296
|
+
period_interval,
|
|
297
|
+
include_latest_before_start,
|
|
298
|
+
_request_auth,
|
|
299
|
+
_content_type,
|
|
300
|
+
_headers,
|
|
301
|
+
_host_index,
|
|
302
|
+
) -> RequestSerialized:
|
|
303
|
+
|
|
304
|
+
_host = None
|
|
305
|
+
|
|
306
|
+
_collection_formats: Dict[str, str] = {
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
_path_params: Dict[str, str] = {}
|
|
310
|
+
_query_params: List[Tuple[str, str]] = []
|
|
311
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
312
|
+
_form_params: List[Tuple[str, str]] = []
|
|
313
|
+
_files: Dict[
|
|
314
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
315
|
+
] = {}
|
|
316
|
+
_body_params: Optional[bytes] = None
|
|
317
|
+
|
|
318
|
+
# process the path parameters
|
|
319
|
+
# process the query parameters
|
|
320
|
+
if market_tickers is not None:
|
|
321
|
+
|
|
322
|
+
_query_params.append(('market_tickers', market_tickers))
|
|
323
|
+
|
|
324
|
+
if start_ts is not None:
|
|
325
|
+
|
|
326
|
+
_query_params.append(('start_ts', start_ts))
|
|
327
|
+
|
|
328
|
+
if end_ts is not None:
|
|
329
|
+
|
|
330
|
+
_query_params.append(('end_ts', end_ts))
|
|
331
|
+
|
|
332
|
+
if period_interval is not None:
|
|
333
|
+
|
|
334
|
+
_query_params.append(('period_interval', period_interval))
|
|
335
|
+
|
|
336
|
+
if include_latest_before_start is not None:
|
|
337
|
+
|
|
338
|
+
_query_params.append(('include_latest_before_start', include_latest_before_start))
|
|
339
|
+
|
|
340
|
+
# process the header parameters
|
|
341
|
+
# process the form parameters
|
|
342
|
+
# process the body parameter
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
# set the HTTP header `Accept`
|
|
346
|
+
if 'Accept' not in _header_params:
|
|
347
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
348
|
+
[
|
|
349
|
+
'application/json'
|
|
350
|
+
]
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
# authentication setting
|
|
355
|
+
_auth_settings: List[str] = [
|
|
356
|
+
]
|
|
357
|
+
|
|
358
|
+
return self.api_client.param_serialize(
|
|
359
|
+
method='GET',
|
|
360
|
+
resource_path='/markets/candlesticks',
|
|
361
|
+
path_params=_path_params,
|
|
362
|
+
query_params=_query_params,
|
|
363
|
+
header_params=_header_params,
|
|
364
|
+
body=_body_params,
|
|
365
|
+
post_params=_form_params,
|
|
366
|
+
files=_files,
|
|
367
|
+
auth_settings=_auth_settings,
|
|
368
|
+
collection_formats=_collection_formats,
|
|
369
|
+
_host=_host,
|
|
370
|
+
_request_auth=_request_auth
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
@validate_call
|
|
377
|
+
def get_market(
|
|
378
|
+
self,
|
|
379
|
+
ticker: StrictStr,
|
|
380
|
+
) -> GetMarketResponse:
|
|
381
|
+
"""Get Market
|
|
382
|
+
|
|
383
|
+
Endpoint for getting data about a specific market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules.
|
|
384
|
+
|
|
385
|
+
:param ticker: Market ticker (required)
|
|
386
|
+
:type ticker: str
|
|
387
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
388
|
+
number provided, it will be total request
|
|
389
|
+
timeout. It can also be a pair (tuple) of
|
|
390
|
+
(connection, read) timeouts.
|
|
391
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
392
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
393
|
+
request; this effectively ignores the
|
|
394
|
+
authentication in the spec for a single request.
|
|
395
|
+
:type _request_auth: dict, optional
|
|
396
|
+
:param _content_type: force content-type for the request.
|
|
397
|
+
:type _content_type: str, Optional
|
|
398
|
+
:param _headers: set to override the headers for a single
|
|
399
|
+
request; this effectively ignores the headers
|
|
400
|
+
in the spec for a single request.
|
|
401
|
+
:type _headers: dict, optional
|
|
402
|
+
:param _host_index: set to override the host_index for a single
|
|
403
|
+
request; this effectively ignores the host_index
|
|
404
|
+
in the spec for a single request.
|
|
405
|
+
:type _host_index: int, optional
|
|
406
|
+
:return: Returns the result object.
|
|
407
|
+
""" # noqa: E501
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
_param = self._get_market_serialize(
|
|
411
|
+
ticker=ticker,
|
|
412
|
+
_request_auth=None,
|
|
413
|
+
_content_type=None,
|
|
414
|
+
_headers=None,
|
|
415
|
+
_host_index=0
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
419
|
+
'200': "GetMarketResponse",
|
|
420
|
+
'401': None,
|
|
421
|
+
'404': None,
|
|
422
|
+
'500': None,
|
|
423
|
+
}
|
|
424
|
+
response_data = self.api_client.call_api(
|
|
425
|
+
*_param,
|
|
426
|
+
_request_timeout=None,
|
|
427
|
+
)
|
|
428
|
+
response_data.read()
|
|
429
|
+
return self.api_client.response_deserialize(
|
|
430
|
+
response_data=response_data,
|
|
431
|
+
response_types_map=_response_types_map,
|
|
432
|
+
).data
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
@validate_call
|
|
436
|
+
def get_market_with_http_info(
|
|
437
|
+
self,
|
|
438
|
+
ticker: Annotated[StrictStr, Field(description="Market ticker")],
|
|
439
|
+
_request_timeout: Union[
|
|
440
|
+
None,
|
|
441
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
442
|
+
Tuple[
|
|
443
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
444
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
445
|
+
]
|
|
446
|
+
] = None,
|
|
447
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
448
|
+
_content_type: Optional[StrictStr] = None,
|
|
449
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
450
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
451
|
+
) -> ApiResponse[GetMarketResponse]:
|
|
452
|
+
"""Get Market
|
|
453
|
+
|
|
454
|
+
Endpoint for getting data about a specific market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules.
|
|
455
|
+
|
|
456
|
+
:param ticker: Market ticker (required)
|
|
457
|
+
:type ticker: str
|
|
458
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
459
|
+
number provided, it will be total request
|
|
460
|
+
timeout. It can also be a pair (tuple) of
|
|
461
|
+
(connection, read) timeouts.
|
|
462
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
463
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
464
|
+
request; this effectively ignores the
|
|
465
|
+
authentication in the spec for a single request.
|
|
466
|
+
:type _request_auth: dict, optional
|
|
467
|
+
:param _content_type: force content-type for the request.
|
|
468
|
+
:type _content_type: str, Optional
|
|
469
|
+
:param _headers: set to override the headers for a single
|
|
470
|
+
request; this effectively ignores the headers
|
|
471
|
+
in the spec for a single request.
|
|
472
|
+
:type _headers: dict, optional
|
|
473
|
+
:param _host_index: set to override the host_index for a single
|
|
474
|
+
request; this effectively ignores the host_index
|
|
475
|
+
in the spec for a single request.
|
|
476
|
+
:type _host_index: int, optional
|
|
477
|
+
:return: Returns the result object.
|
|
478
|
+
""" # noqa: E501
|
|
479
|
+
|
|
480
|
+
_param = self._get_market_serialize(
|
|
481
|
+
ticker=ticker,
|
|
482
|
+
_request_auth=_request_auth,
|
|
483
|
+
_content_type=_content_type,
|
|
484
|
+
_headers=_headers,
|
|
485
|
+
_host_index=_host_index
|
|
486
|
+
)
|
|
487
|
+
|
|
488
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
489
|
+
'200': "GetMarketResponse",
|
|
490
|
+
'401': None,
|
|
491
|
+
'404': None,
|
|
492
|
+
'500': None,
|
|
493
|
+
}
|
|
494
|
+
response_data = self.api_client.call_api(
|
|
495
|
+
*_param,
|
|
496
|
+
_request_timeout=_request_timeout
|
|
497
|
+
)
|
|
498
|
+
response_data.read()
|
|
499
|
+
return self.api_client.response_deserialize(
|
|
500
|
+
response_data=response_data,
|
|
501
|
+
response_types_map=_response_types_map,
|
|
502
|
+
)
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
@validate_call
|
|
506
|
+
def get_market_without_preload_content(
|
|
507
|
+
self,
|
|
508
|
+
ticker: Annotated[StrictStr, Field(description="Market ticker")],
|
|
509
|
+
_request_timeout: Union[
|
|
510
|
+
None,
|
|
511
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
512
|
+
Tuple[
|
|
513
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
514
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
515
|
+
]
|
|
516
|
+
] = None,
|
|
517
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
518
|
+
_content_type: Optional[StrictStr] = None,
|
|
519
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
520
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
521
|
+
) -> RESTResponseType:
|
|
522
|
+
"""Get Market
|
|
523
|
+
|
|
524
|
+
Endpoint for getting data about a specific market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules.
|
|
525
|
+
|
|
526
|
+
:param ticker: Market ticker (required)
|
|
527
|
+
:type ticker: str
|
|
528
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
529
|
+
number provided, it will be total request
|
|
530
|
+
timeout. It can also be a pair (tuple) of
|
|
531
|
+
(connection, read) timeouts.
|
|
532
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
533
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
534
|
+
request; this effectively ignores the
|
|
535
|
+
authentication in the spec for a single request.
|
|
536
|
+
:type _request_auth: dict, optional
|
|
537
|
+
:param _content_type: force content-type for the request.
|
|
538
|
+
:type _content_type: str, Optional
|
|
539
|
+
:param _headers: set to override the headers for a single
|
|
540
|
+
request; this effectively ignores the headers
|
|
541
|
+
in the spec for a single request.
|
|
542
|
+
:type _headers: dict, optional
|
|
543
|
+
:param _host_index: set to override the host_index for a single
|
|
544
|
+
request; this effectively ignores the host_index
|
|
545
|
+
in the spec for a single request.
|
|
546
|
+
:type _host_index: int, optional
|
|
547
|
+
:return: Returns the result object.
|
|
548
|
+
""" # noqa: E501
|
|
549
|
+
|
|
550
|
+
_param = self._get_market_serialize(
|
|
551
|
+
ticker=ticker,
|
|
552
|
+
_request_auth=_request_auth,
|
|
553
|
+
_content_type=_content_type,
|
|
554
|
+
_headers=_headers,
|
|
555
|
+
_host_index=_host_index
|
|
556
|
+
)
|
|
557
|
+
|
|
558
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
559
|
+
'200': "GetMarketResponse",
|
|
560
|
+
'401': None,
|
|
561
|
+
'404': None,
|
|
562
|
+
'500': None,
|
|
563
|
+
}
|
|
564
|
+
response_data = self.api_client.call_api(
|
|
565
|
+
*_param,
|
|
566
|
+
_request_timeout=_request_timeout
|
|
567
|
+
)
|
|
568
|
+
return response_data.response
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
def _get_market_serialize(
|
|
572
|
+
self,
|
|
573
|
+
ticker,
|
|
574
|
+
_request_auth,
|
|
575
|
+
_content_type,
|
|
576
|
+
_headers,
|
|
577
|
+
_host_index,
|
|
578
|
+
) -> RequestSerialized:
|
|
579
|
+
|
|
580
|
+
_host = None
|
|
581
|
+
|
|
582
|
+
_collection_formats: Dict[str, str] = {
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
_path_params: Dict[str, str] = {}
|
|
586
|
+
_query_params: List[Tuple[str, str]] = []
|
|
587
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
588
|
+
_form_params: List[Tuple[str, str]] = []
|
|
589
|
+
_files: Dict[
|
|
590
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
591
|
+
] = {}
|
|
592
|
+
_body_params: Optional[bytes] = None
|
|
593
|
+
|
|
594
|
+
# process the path parameters
|
|
595
|
+
if ticker is not None:
|
|
596
|
+
_path_params['ticker'] = ticker
|
|
597
|
+
# process the query parameters
|
|
598
|
+
# process the header parameters
|
|
599
|
+
# process the form parameters
|
|
600
|
+
# process the body parameter
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
# set the HTTP header `Accept`
|
|
604
|
+
if 'Accept' not in _header_params:
|
|
605
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
606
|
+
[
|
|
607
|
+
'application/json'
|
|
608
|
+
]
|
|
609
|
+
)
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
# authentication setting
|
|
613
|
+
_auth_settings: List[str] = [
|
|
614
|
+
]
|
|
615
|
+
|
|
616
|
+
return self.api_client.param_serialize(
|
|
617
|
+
method='GET',
|
|
618
|
+
resource_path='/markets/{ticker}',
|
|
619
|
+
path_params=_path_params,
|
|
620
|
+
query_params=_query_params,
|
|
621
|
+
header_params=_header_params,
|
|
622
|
+
body=_body_params,
|
|
623
|
+
post_params=_form_params,
|
|
624
|
+
files=_files,
|
|
625
|
+
auth_settings=_auth_settings,
|
|
626
|
+
collection_formats=_collection_formats,
|
|
627
|
+
_host=_host,
|
|
628
|
+
_request_auth=_request_auth
|
|
629
|
+
)
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
@validate_call
|
|
635
|
+
def get_market_candlesticks(
|
|
636
|
+
self,
|
|
637
|
+
series_ticker: StrictStr,
|
|
638
|
+
ticker: StrictStr,
|
|
639
|
+
start_ts: Any,
|
|
640
|
+
end_ts: Any,
|
|
641
|
+
period_interval: Any,
|
|
642
|
+
) -> GetMarketCandlesticksResponse:
|
|
643
|
+
"""Get Market Candlesticks
|
|
644
|
+
|
|
645
|
+
Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).
|
|
646
|
+
|
|
647
|
+
:param series_ticker: Series ticker - the series that contains the target market (required)
|
|
648
|
+
:type series_ticker: str
|
|
649
|
+
:param ticker: Market ticker - unique identifier for the specific market (required)
|
|
650
|
+
:type ticker: str
|
|
651
|
+
:param start_ts: Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time. (required)
|
|
652
|
+
:type start_ts: int
|
|
653
|
+
:param end_ts: End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time. (required)
|
|
654
|
+
:type end_ts: int
|
|
655
|
+
:param period_interval: Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day). (required)
|
|
656
|
+
:type period_interval: int
|
|
657
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
658
|
+
number provided, it will be total request
|
|
659
|
+
timeout. It can also be a pair (tuple) of
|
|
660
|
+
(connection, read) timeouts.
|
|
661
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
662
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
663
|
+
request; this effectively ignores the
|
|
664
|
+
authentication in the spec for a single request.
|
|
665
|
+
:type _request_auth: dict, optional
|
|
666
|
+
:param _content_type: force content-type for the request.
|
|
667
|
+
:type _content_type: str, Optional
|
|
668
|
+
:param _headers: set to override the headers for a single
|
|
669
|
+
request; this effectively ignores the headers
|
|
670
|
+
in the spec for a single request.
|
|
671
|
+
:type _headers: dict, optional
|
|
672
|
+
:param _host_index: set to override the host_index for a single
|
|
673
|
+
request; this effectively ignores the host_index
|
|
674
|
+
in the spec for a single request.
|
|
675
|
+
:type _host_index: int, optional
|
|
676
|
+
:return: Returns the result object.
|
|
677
|
+
""" # noqa: E501
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
_param = self._get_market_candlesticks_serialize(
|
|
681
|
+
series_ticker=series_ticker,
|
|
682
|
+
ticker=ticker,
|
|
683
|
+
start_ts=start_ts,
|
|
684
|
+
end_ts=end_ts,
|
|
685
|
+
period_interval=period_interval,
|
|
686
|
+
_request_auth=None,
|
|
687
|
+
_content_type=None,
|
|
688
|
+
_headers=None,
|
|
689
|
+
_host_index=0
|
|
690
|
+
)
|
|
691
|
+
|
|
692
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
693
|
+
'200': "GetMarketCandlesticksResponse",
|
|
694
|
+
'400': None,
|
|
695
|
+
'404': None,
|
|
696
|
+
'500': None,
|
|
697
|
+
}
|
|
698
|
+
response_data = self.api_client.call_api(
|
|
699
|
+
*_param,
|
|
700
|
+
_request_timeout=None,
|
|
701
|
+
)
|
|
702
|
+
response_data.read()
|
|
703
|
+
return self.api_client.response_deserialize(
|
|
704
|
+
response_data=response_data,
|
|
705
|
+
response_types_map=_response_types_map,
|
|
706
|
+
).data
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
@validate_call
|
|
710
|
+
def get_market_candlesticks_with_http_info(
|
|
711
|
+
self,
|
|
712
|
+
series_ticker: Annotated[StrictStr, Field(description="Series ticker - the series that contains the target market")],
|
|
713
|
+
ticker: Annotated[StrictStr, Field(description="Market ticker - unique identifier for the specific market")],
|
|
714
|
+
start_ts: Annotated[StrictInt, Field(description="Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.")],
|
|
715
|
+
end_ts: Annotated[StrictInt, Field(description="End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.")],
|
|
716
|
+
period_interval: Annotated[StrictInt, Field(description="Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day).")],
|
|
717
|
+
_request_timeout: Union[
|
|
718
|
+
None,
|
|
719
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
720
|
+
Tuple[
|
|
721
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
722
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
723
|
+
]
|
|
724
|
+
] = None,
|
|
725
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
726
|
+
_content_type: Optional[StrictStr] = None,
|
|
727
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
728
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
729
|
+
) -> ApiResponse[GetMarketCandlesticksResponse]:
|
|
730
|
+
"""Get Market Candlesticks
|
|
731
|
+
|
|
732
|
+
Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).
|
|
733
|
+
|
|
734
|
+
:param series_ticker: Series ticker - the series that contains the target market (required)
|
|
735
|
+
:type series_ticker: str
|
|
736
|
+
:param ticker: Market ticker - unique identifier for the specific market (required)
|
|
737
|
+
:type ticker: str
|
|
738
|
+
:param start_ts: Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time. (required)
|
|
739
|
+
:type start_ts: int
|
|
740
|
+
:param end_ts: End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time. (required)
|
|
741
|
+
:type end_ts: int
|
|
742
|
+
:param period_interval: Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day). (required)
|
|
743
|
+
:type period_interval: int
|
|
744
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
745
|
+
number provided, it will be total request
|
|
746
|
+
timeout. It can also be a pair (tuple) of
|
|
747
|
+
(connection, read) timeouts.
|
|
748
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
749
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
750
|
+
request; this effectively ignores the
|
|
751
|
+
authentication in the spec for a single request.
|
|
752
|
+
:type _request_auth: dict, optional
|
|
753
|
+
:param _content_type: force content-type for the request.
|
|
754
|
+
:type _content_type: str, Optional
|
|
755
|
+
:param _headers: set to override the headers for a single
|
|
756
|
+
request; this effectively ignores the headers
|
|
757
|
+
in the spec for a single request.
|
|
758
|
+
:type _headers: dict, optional
|
|
759
|
+
:param _host_index: set to override the host_index for a single
|
|
760
|
+
request; this effectively ignores the host_index
|
|
761
|
+
in the spec for a single request.
|
|
762
|
+
:type _host_index: int, optional
|
|
763
|
+
:return: Returns the result object.
|
|
764
|
+
""" # noqa: E501
|
|
765
|
+
|
|
766
|
+
_param = self._get_market_candlesticks_serialize(
|
|
767
|
+
series_ticker=series_ticker,
|
|
768
|
+
ticker=ticker,
|
|
769
|
+
start_ts=start_ts,
|
|
770
|
+
end_ts=end_ts,
|
|
771
|
+
period_interval=period_interval,
|
|
772
|
+
_request_auth=_request_auth,
|
|
773
|
+
_content_type=_content_type,
|
|
774
|
+
_headers=_headers,
|
|
775
|
+
_host_index=_host_index
|
|
776
|
+
)
|
|
777
|
+
|
|
778
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
779
|
+
'200': "GetMarketCandlesticksResponse",
|
|
780
|
+
'400': None,
|
|
781
|
+
'404': None,
|
|
782
|
+
'500': None,
|
|
783
|
+
}
|
|
784
|
+
response_data = self.api_client.call_api(
|
|
785
|
+
*_param,
|
|
786
|
+
_request_timeout=_request_timeout
|
|
787
|
+
)
|
|
788
|
+
response_data.read()
|
|
789
|
+
return self.api_client.response_deserialize(
|
|
790
|
+
response_data=response_data,
|
|
791
|
+
response_types_map=_response_types_map,
|
|
792
|
+
)
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
@validate_call
|
|
796
|
+
def get_market_candlesticks_without_preload_content(
|
|
797
|
+
self,
|
|
798
|
+
series_ticker: Annotated[StrictStr, Field(description="Series ticker - the series that contains the target market")],
|
|
799
|
+
ticker: Annotated[StrictStr, Field(description="Market ticker - unique identifier for the specific market")],
|
|
800
|
+
start_ts: Annotated[StrictInt, Field(description="Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.")],
|
|
801
|
+
end_ts: Annotated[StrictInt, Field(description="End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.")],
|
|
802
|
+
period_interval: Annotated[StrictInt, Field(description="Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day).")],
|
|
803
|
+
_request_timeout: Union[
|
|
804
|
+
None,
|
|
805
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
806
|
+
Tuple[
|
|
807
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
808
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
809
|
+
]
|
|
810
|
+
] = None,
|
|
811
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
812
|
+
_content_type: Optional[StrictStr] = None,
|
|
813
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
814
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
815
|
+
) -> RESTResponseType:
|
|
816
|
+
"""Get Market Candlesticks
|
|
817
|
+
|
|
818
|
+
Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).
|
|
819
|
+
|
|
820
|
+
:param series_ticker: Series ticker - the series that contains the target market (required)
|
|
821
|
+
:type series_ticker: str
|
|
822
|
+
:param ticker: Market ticker - unique identifier for the specific market (required)
|
|
823
|
+
:type ticker: str
|
|
824
|
+
:param start_ts: Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time. (required)
|
|
825
|
+
:type start_ts: int
|
|
826
|
+
:param end_ts: End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time. (required)
|
|
827
|
+
:type end_ts: int
|
|
828
|
+
:param period_interval: Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day). (required)
|
|
829
|
+
:type period_interval: int
|
|
830
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
831
|
+
number provided, it will be total request
|
|
832
|
+
timeout. It can also be a pair (tuple) of
|
|
833
|
+
(connection, read) timeouts.
|
|
834
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
835
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
836
|
+
request; this effectively ignores the
|
|
837
|
+
authentication in the spec for a single request.
|
|
838
|
+
:type _request_auth: dict, optional
|
|
839
|
+
:param _content_type: force content-type for the request.
|
|
840
|
+
:type _content_type: str, Optional
|
|
841
|
+
:param _headers: set to override the headers for a single
|
|
842
|
+
request; this effectively ignores the headers
|
|
843
|
+
in the spec for a single request.
|
|
844
|
+
:type _headers: dict, optional
|
|
845
|
+
:param _host_index: set to override the host_index for a single
|
|
846
|
+
request; this effectively ignores the host_index
|
|
847
|
+
in the spec for a single request.
|
|
848
|
+
:type _host_index: int, optional
|
|
849
|
+
:return: Returns the result object.
|
|
850
|
+
""" # noqa: E501
|
|
851
|
+
|
|
852
|
+
_param = self._get_market_candlesticks_serialize(
|
|
853
|
+
series_ticker=series_ticker,
|
|
854
|
+
ticker=ticker,
|
|
855
|
+
start_ts=start_ts,
|
|
856
|
+
end_ts=end_ts,
|
|
857
|
+
period_interval=period_interval,
|
|
858
|
+
_request_auth=_request_auth,
|
|
859
|
+
_content_type=_content_type,
|
|
860
|
+
_headers=_headers,
|
|
861
|
+
_host_index=_host_index
|
|
862
|
+
)
|
|
863
|
+
|
|
864
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
865
|
+
'200': "GetMarketCandlesticksResponse",
|
|
866
|
+
'400': None,
|
|
867
|
+
'404': None,
|
|
868
|
+
'500': None,
|
|
869
|
+
}
|
|
870
|
+
response_data = self.api_client.call_api(
|
|
871
|
+
*_param,
|
|
872
|
+
_request_timeout=_request_timeout
|
|
873
|
+
)
|
|
874
|
+
return response_data.response
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
def _get_market_candlesticks_serialize(
|
|
878
|
+
self,
|
|
879
|
+
series_ticker,
|
|
880
|
+
ticker,
|
|
881
|
+
start_ts,
|
|
882
|
+
end_ts,
|
|
883
|
+
period_interval,
|
|
884
|
+
_request_auth,
|
|
885
|
+
_content_type,
|
|
886
|
+
_headers,
|
|
887
|
+
_host_index,
|
|
888
|
+
) -> RequestSerialized:
|
|
889
|
+
|
|
890
|
+
_host = None
|
|
891
|
+
|
|
892
|
+
_collection_formats: Dict[str, str] = {
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
_path_params: Dict[str, str] = {}
|
|
896
|
+
_query_params: List[Tuple[str, str]] = []
|
|
897
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
898
|
+
_form_params: List[Tuple[str, str]] = []
|
|
899
|
+
_files: Dict[
|
|
900
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
901
|
+
] = {}
|
|
902
|
+
_body_params: Optional[bytes] = None
|
|
903
|
+
|
|
904
|
+
# process the path parameters
|
|
905
|
+
if series_ticker is not None:
|
|
906
|
+
_path_params['series_ticker'] = series_ticker
|
|
907
|
+
if ticker is not None:
|
|
908
|
+
_path_params['ticker'] = ticker
|
|
909
|
+
# process the query parameters
|
|
910
|
+
if start_ts is not None:
|
|
911
|
+
|
|
912
|
+
_query_params.append(('start_ts', start_ts))
|
|
913
|
+
|
|
914
|
+
if end_ts is not None:
|
|
915
|
+
|
|
916
|
+
_query_params.append(('end_ts', end_ts))
|
|
917
|
+
|
|
918
|
+
if period_interval is not None:
|
|
919
|
+
|
|
920
|
+
_query_params.append(('period_interval', period_interval))
|
|
921
|
+
|
|
922
|
+
# process the header parameters
|
|
923
|
+
# process the form parameters
|
|
924
|
+
# process the body parameter
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
# set the HTTP header `Accept`
|
|
928
|
+
if 'Accept' not in _header_params:
|
|
929
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
930
|
+
[
|
|
931
|
+
'application/json'
|
|
932
|
+
]
|
|
933
|
+
)
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
# authentication setting
|
|
937
|
+
_auth_settings: List[str] = [
|
|
938
|
+
]
|
|
939
|
+
|
|
940
|
+
return self.api_client.param_serialize(
|
|
941
|
+
method='GET',
|
|
942
|
+
resource_path='/series/{series_ticker}/markets/{ticker}/candlesticks',
|
|
943
|
+
path_params=_path_params,
|
|
944
|
+
query_params=_query_params,
|
|
945
|
+
header_params=_header_params,
|
|
946
|
+
body=_body_params,
|
|
947
|
+
post_params=_form_params,
|
|
948
|
+
files=_files,
|
|
949
|
+
auth_settings=_auth_settings,
|
|
950
|
+
collection_formats=_collection_formats,
|
|
951
|
+
_host=_host,
|
|
952
|
+
_request_auth=_request_auth
|
|
953
|
+
)
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
@validate_call
|
|
959
|
+
def get_market_orderbook(
|
|
960
|
+
self,
|
|
961
|
+
ticker: StrictStr,
|
|
962
|
+
depth: Any = None,
|
|
963
|
+
) -> GetMarketOrderbookResponse:
|
|
964
|
+
"""Get Market Orderbook
|
|
965
|
+
|
|
966
|
+
Endpoint for getting the current order book for a specific market. The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes. Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices.
|
|
967
|
+
|
|
968
|
+
:param ticker: Market ticker (required)
|
|
969
|
+
:type ticker: str
|
|
970
|
+
:param depth: Depth of the orderbook to retrieve (0 or negative means all levels, 1-100 for specific depth)
|
|
971
|
+
:type depth: int
|
|
972
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
973
|
+
number provided, it will be total request
|
|
974
|
+
timeout. It can also be a pair (tuple) of
|
|
975
|
+
(connection, read) timeouts.
|
|
976
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
977
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
978
|
+
request; this effectively ignores the
|
|
979
|
+
authentication in the spec for a single request.
|
|
980
|
+
:type _request_auth: dict, optional
|
|
981
|
+
:param _content_type: force content-type for the request.
|
|
982
|
+
:type _content_type: str, Optional
|
|
983
|
+
:param _headers: set to override the headers for a single
|
|
984
|
+
request; this effectively ignores the headers
|
|
985
|
+
in the spec for a single request.
|
|
986
|
+
:type _headers: dict, optional
|
|
987
|
+
:param _host_index: set to override the host_index for a single
|
|
988
|
+
request; this effectively ignores the host_index
|
|
989
|
+
in the spec for a single request.
|
|
990
|
+
:type _host_index: int, optional
|
|
991
|
+
:return: Returns the result object.
|
|
992
|
+
""" # noqa: E501
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
_param = self._get_market_orderbook_serialize(
|
|
996
|
+
ticker=ticker,
|
|
997
|
+
depth=depth,
|
|
998
|
+
_request_auth=None,
|
|
999
|
+
_content_type=None,
|
|
1000
|
+
_headers=None,
|
|
1001
|
+
_host_index=0
|
|
1002
|
+
)
|
|
1003
|
+
|
|
1004
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1005
|
+
'200': "GetMarketOrderbookResponse",
|
|
1006
|
+
'401': "ErrorResponse",
|
|
1007
|
+
'404': "ErrorResponse",
|
|
1008
|
+
'500': "ErrorResponse",
|
|
1009
|
+
}
|
|
1010
|
+
response_data = self.api_client.call_api(
|
|
1011
|
+
*_param,
|
|
1012
|
+
_request_timeout=None,
|
|
1013
|
+
)
|
|
1014
|
+
response_data.read()
|
|
1015
|
+
return self.api_client.response_deserialize(
|
|
1016
|
+
response_data=response_data,
|
|
1017
|
+
response_types_map=_response_types_map,
|
|
1018
|
+
).data
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
@validate_call
|
|
1022
|
+
def get_market_orderbook_with_http_info(
|
|
1023
|
+
self,
|
|
1024
|
+
ticker: Annotated[StrictStr, Field(description="Market ticker")],
|
|
1025
|
+
depth: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=0)]], Field(description="Depth of the orderbook to retrieve (0 or negative means all levels, 1-100 for specific depth)")] = None,
|
|
1026
|
+
_request_timeout: Union[
|
|
1027
|
+
None,
|
|
1028
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1029
|
+
Tuple[
|
|
1030
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1031
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1032
|
+
]
|
|
1033
|
+
] = None,
|
|
1034
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1035
|
+
_content_type: Optional[StrictStr] = None,
|
|
1036
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1037
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1038
|
+
) -> ApiResponse[GetMarketOrderbookResponse]:
|
|
1039
|
+
"""Get Market Orderbook
|
|
1040
|
+
|
|
1041
|
+
Endpoint for getting the current order book for a specific market. The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes. Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices.
|
|
1042
|
+
|
|
1043
|
+
:param ticker: Market ticker (required)
|
|
1044
|
+
:type ticker: str
|
|
1045
|
+
:param depth: Depth of the orderbook to retrieve (0 or negative means all levels, 1-100 for specific depth)
|
|
1046
|
+
:type depth: int
|
|
1047
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1048
|
+
number provided, it will be total request
|
|
1049
|
+
timeout. It can also be a pair (tuple) of
|
|
1050
|
+
(connection, read) timeouts.
|
|
1051
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1052
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1053
|
+
request; this effectively ignores the
|
|
1054
|
+
authentication in the spec for a single request.
|
|
1055
|
+
:type _request_auth: dict, optional
|
|
1056
|
+
:param _content_type: force content-type for the request.
|
|
1057
|
+
:type _content_type: str, Optional
|
|
1058
|
+
:param _headers: set to override the headers for a single
|
|
1059
|
+
request; this effectively ignores the headers
|
|
1060
|
+
in the spec for a single request.
|
|
1061
|
+
:type _headers: dict, optional
|
|
1062
|
+
:param _host_index: set to override the host_index for a single
|
|
1063
|
+
request; this effectively ignores the host_index
|
|
1064
|
+
in the spec for a single request.
|
|
1065
|
+
:type _host_index: int, optional
|
|
1066
|
+
:return: Returns the result object.
|
|
1067
|
+
""" # noqa: E501
|
|
1068
|
+
|
|
1069
|
+
_param = self._get_market_orderbook_serialize(
|
|
1070
|
+
ticker=ticker,
|
|
1071
|
+
depth=depth,
|
|
1072
|
+
_request_auth=_request_auth,
|
|
1073
|
+
_content_type=_content_type,
|
|
1074
|
+
_headers=_headers,
|
|
1075
|
+
_host_index=_host_index
|
|
1076
|
+
)
|
|
1077
|
+
|
|
1078
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1079
|
+
'200': "GetMarketOrderbookResponse",
|
|
1080
|
+
'401': "ErrorResponse",
|
|
1081
|
+
'404': "ErrorResponse",
|
|
1082
|
+
'500': "ErrorResponse",
|
|
1083
|
+
}
|
|
1084
|
+
response_data = self.api_client.call_api(
|
|
1085
|
+
*_param,
|
|
1086
|
+
_request_timeout=_request_timeout
|
|
1087
|
+
)
|
|
1088
|
+
response_data.read()
|
|
1089
|
+
return self.api_client.response_deserialize(
|
|
1090
|
+
response_data=response_data,
|
|
1091
|
+
response_types_map=_response_types_map,
|
|
1092
|
+
)
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
@validate_call
|
|
1096
|
+
def get_market_orderbook_without_preload_content(
|
|
1097
|
+
self,
|
|
1098
|
+
ticker: Annotated[StrictStr, Field(description="Market ticker")],
|
|
1099
|
+
depth: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=0)]], Field(description="Depth of the orderbook to retrieve (0 or negative means all levels, 1-100 for specific depth)")] = None,
|
|
1100
|
+
_request_timeout: Union[
|
|
1101
|
+
None,
|
|
1102
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1103
|
+
Tuple[
|
|
1104
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1105
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1106
|
+
]
|
|
1107
|
+
] = None,
|
|
1108
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1109
|
+
_content_type: Optional[StrictStr] = None,
|
|
1110
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1111
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1112
|
+
) -> RESTResponseType:
|
|
1113
|
+
"""Get Market Orderbook
|
|
1114
|
+
|
|
1115
|
+
Endpoint for getting the current order book for a specific market. The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes. Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices.
|
|
1116
|
+
|
|
1117
|
+
:param ticker: Market ticker (required)
|
|
1118
|
+
:type ticker: str
|
|
1119
|
+
:param depth: Depth of the orderbook to retrieve (0 or negative means all levels, 1-100 for specific depth)
|
|
1120
|
+
:type depth: int
|
|
1121
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1122
|
+
number provided, it will be total request
|
|
1123
|
+
timeout. It can also be a pair (tuple) of
|
|
1124
|
+
(connection, read) timeouts.
|
|
1125
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1126
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1127
|
+
request; this effectively ignores the
|
|
1128
|
+
authentication in the spec for a single request.
|
|
1129
|
+
:type _request_auth: dict, optional
|
|
1130
|
+
:param _content_type: force content-type for the request.
|
|
1131
|
+
:type _content_type: str, Optional
|
|
1132
|
+
:param _headers: set to override the headers for a single
|
|
1133
|
+
request; this effectively ignores the headers
|
|
1134
|
+
in the spec for a single request.
|
|
1135
|
+
:type _headers: dict, optional
|
|
1136
|
+
:param _host_index: set to override the host_index for a single
|
|
1137
|
+
request; this effectively ignores the host_index
|
|
1138
|
+
in the spec for a single request.
|
|
1139
|
+
:type _host_index: int, optional
|
|
1140
|
+
:return: Returns the result object.
|
|
1141
|
+
""" # noqa: E501
|
|
1142
|
+
|
|
1143
|
+
_param = self._get_market_orderbook_serialize(
|
|
1144
|
+
ticker=ticker,
|
|
1145
|
+
depth=depth,
|
|
1146
|
+
_request_auth=_request_auth,
|
|
1147
|
+
_content_type=_content_type,
|
|
1148
|
+
_headers=_headers,
|
|
1149
|
+
_host_index=_host_index
|
|
1150
|
+
)
|
|
1151
|
+
|
|
1152
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1153
|
+
'200': "GetMarketOrderbookResponse",
|
|
1154
|
+
'401': "ErrorResponse",
|
|
1155
|
+
'404': "ErrorResponse",
|
|
1156
|
+
'500': "ErrorResponse",
|
|
1157
|
+
}
|
|
1158
|
+
response_data = self.api_client.call_api(
|
|
1159
|
+
*_param,
|
|
1160
|
+
_request_timeout=_request_timeout
|
|
1161
|
+
)
|
|
1162
|
+
return response_data.response
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
def _get_market_orderbook_serialize(
|
|
1166
|
+
self,
|
|
1167
|
+
ticker,
|
|
1168
|
+
depth,
|
|
1169
|
+
_request_auth,
|
|
1170
|
+
_content_type,
|
|
1171
|
+
_headers,
|
|
1172
|
+
_host_index,
|
|
1173
|
+
) -> RequestSerialized:
|
|
1174
|
+
|
|
1175
|
+
_host = None
|
|
1176
|
+
|
|
1177
|
+
_collection_formats: Dict[str, str] = {
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
_path_params: Dict[str, str] = {}
|
|
1181
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1182
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1183
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1184
|
+
_files: Dict[
|
|
1185
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1186
|
+
] = {}
|
|
1187
|
+
_body_params: Optional[bytes] = None
|
|
1188
|
+
|
|
1189
|
+
# process the path parameters
|
|
1190
|
+
if ticker is not None:
|
|
1191
|
+
_path_params['ticker'] = ticker
|
|
1192
|
+
# process the query parameters
|
|
1193
|
+
if depth is not None:
|
|
1194
|
+
|
|
1195
|
+
_query_params.append(('depth', depth))
|
|
1196
|
+
|
|
1197
|
+
# process the header parameters
|
|
1198
|
+
# process the form parameters
|
|
1199
|
+
# process the body parameter
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
# set the HTTP header `Accept`
|
|
1203
|
+
if 'Accept' not in _header_params:
|
|
1204
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1205
|
+
[
|
|
1206
|
+
'application/json'
|
|
1207
|
+
]
|
|
1208
|
+
)
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
# authentication setting
|
|
1212
|
+
_auth_settings: List[str] = [
|
|
1213
|
+
'kalshiAccessSignature',
|
|
1214
|
+
'kalshiAccessKey',
|
|
1215
|
+
'kalshiAccessTimestamp'
|
|
1216
|
+
]
|
|
1217
|
+
|
|
1218
|
+
return self.api_client.param_serialize(
|
|
1219
|
+
method='GET',
|
|
1220
|
+
resource_path='/markets/{ticker}/orderbook',
|
|
1221
|
+
path_params=_path_params,
|
|
1222
|
+
query_params=_query_params,
|
|
1223
|
+
header_params=_header_params,
|
|
1224
|
+
body=_body_params,
|
|
1225
|
+
post_params=_form_params,
|
|
1226
|
+
files=_files,
|
|
1227
|
+
auth_settings=_auth_settings,
|
|
1228
|
+
collection_formats=_collection_formats,
|
|
1229
|
+
_host=_host,
|
|
1230
|
+
_request_auth=_request_auth
|
|
1231
|
+
)
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
@validate_call
|
|
1237
|
+
def get_markets(
|
|
1238
|
+
self,
|
|
1239
|
+
limit: Any = None,
|
|
1240
|
+
cursor: Any = None,
|
|
1241
|
+
event_ticker: Any = None,
|
|
1242
|
+
series_ticker: Any = None,
|
|
1243
|
+
min_created_ts: Any = None,
|
|
1244
|
+
max_created_ts: Any = None,
|
|
1245
|
+
max_close_ts: Any = None,
|
|
1246
|
+
min_close_ts: Any = None,
|
|
1247
|
+
min_settled_ts: Any = None,
|
|
1248
|
+
max_settled_ts: Any = None,
|
|
1249
|
+
status: Any = None,
|
|
1250
|
+
tickers: Any = None,
|
|
1251
|
+
mve_filter: Any = None,
|
|
1252
|
+
) -> GetMarketsResponse:
|
|
1253
|
+
"""Get Markets
|
|
1254
|
+
|
|
1255
|
+
Filter by market status. Possible values: `unopened`, `open`, `closed`, `settled`. Leave empty to return markets with any status. - Only one `status` filter may be supplied at a time. - Timestamp filters will be mutually exclusive from other timestamp filters and certain status filters. | Compatible Timestamp Filters | Additional Status Filters| |------------------------------|--------------------------| | min_created_ts, max_created_ts | `unopened`, `open`, *empty* | | min_close_ts, max_close_ts | `closed`, *empty* | | min_settled_ts, max_settled_ts | `settled`, *empty* |
|
|
1256
|
+
|
|
1257
|
+
:param limit: Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
1258
|
+
:type limit: int
|
|
1259
|
+
:param cursor: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
|
|
1260
|
+
:type cursor: str
|
|
1261
|
+
:param event_ticker: Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).
|
|
1262
|
+
:type event_ticker: str
|
|
1263
|
+
:param series_ticker: Filter by series ticker
|
|
1264
|
+
:type series_ticker: str
|
|
1265
|
+
:param min_created_ts: Filter items that created after this Unix timestamp
|
|
1266
|
+
:type min_created_ts: int
|
|
1267
|
+
:param max_created_ts: Filter items that created before this Unix timestamp
|
|
1268
|
+
:type max_created_ts: int
|
|
1269
|
+
:param max_close_ts: Filter items that close before this Unix timestamp
|
|
1270
|
+
:type max_close_ts: int
|
|
1271
|
+
:param min_close_ts: Filter items that close after this Unix timestamp
|
|
1272
|
+
:type min_close_ts: int
|
|
1273
|
+
:param min_settled_ts: Filter items that settled after this Unix timestamp
|
|
1274
|
+
:type min_settled_ts: int
|
|
1275
|
+
:param max_settled_ts: Filter items that settled before this Unix timestamp
|
|
1276
|
+
:type max_settled_ts: int
|
|
1277
|
+
:param status: Filter by market status. Possible values are 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any status.
|
|
1278
|
+
:type status: str
|
|
1279
|
+
:param tickers: Filter by specific market tickers. Comma-separated list of market tickers to retrieve.
|
|
1280
|
+
:type tickers: str
|
|
1281
|
+
:param mve_filter: Filter by multivariate events (combos). 'only' returns only multivariate events, 'exclude' excludes multivariate events.
|
|
1282
|
+
:type mve_filter: str
|
|
1283
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1284
|
+
number provided, it will be total request
|
|
1285
|
+
timeout. It can also be a pair (tuple) of
|
|
1286
|
+
(connection, read) timeouts.
|
|
1287
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1288
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1289
|
+
request; this effectively ignores the
|
|
1290
|
+
authentication in the spec for a single request.
|
|
1291
|
+
:type _request_auth: dict, optional
|
|
1292
|
+
:param _content_type: force content-type for the request.
|
|
1293
|
+
:type _content_type: str, Optional
|
|
1294
|
+
:param _headers: set to override the headers for a single
|
|
1295
|
+
request; this effectively ignores the headers
|
|
1296
|
+
in the spec for a single request.
|
|
1297
|
+
:type _headers: dict, optional
|
|
1298
|
+
:param _host_index: set to override the host_index for a single
|
|
1299
|
+
request; this effectively ignores the host_index
|
|
1300
|
+
in the spec for a single request.
|
|
1301
|
+
:type _host_index: int, optional
|
|
1302
|
+
:return: Returns the result object.
|
|
1303
|
+
""" # noqa: E501
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
_param = self._get_markets_serialize(
|
|
1307
|
+
limit=limit,
|
|
1308
|
+
cursor=cursor,
|
|
1309
|
+
event_ticker=event_ticker,
|
|
1310
|
+
series_ticker=series_ticker,
|
|
1311
|
+
min_created_ts=min_created_ts,
|
|
1312
|
+
max_created_ts=max_created_ts,
|
|
1313
|
+
max_close_ts=max_close_ts,
|
|
1314
|
+
min_close_ts=min_close_ts,
|
|
1315
|
+
min_settled_ts=min_settled_ts,
|
|
1316
|
+
max_settled_ts=max_settled_ts,
|
|
1317
|
+
status=status,
|
|
1318
|
+
tickers=tickers,
|
|
1319
|
+
mve_filter=mve_filter,
|
|
1320
|
+
_request_auth=None,
|
|
1321
|
+
_content_type=None,
|
|
1322
|
+
_headers=None,
|
|
1323
|
+
_host_index=0
|
|
1324
|
+
)
|
|
1325
|
+
|
|
1326
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1327
|
+
'200': "GetMarketsResponse",
|
|
1328
|
+
'400': None,
|
|
1329
|
+
'401': None,
|
|
1330
|
+
'500': None,
|
|
1331
|
+
}
|
|
1332
|
+
response_data = self.api_client.call_api(
|
|
1333
|
+
*_param,
|
|
1334
|
+
_request_timeout=None,
|
|
1335
|
+
)
|
|
1336
|
+
response_data.read()
|
|
1337
|
+
return self.api_client.response_deserialize(
|
|
1338
|
+
response_data=response_data,
|
|
1339
|
+
response_types_map=_response_types_map,
|
|
1340
|
+
).data
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
@validate_call
|
|
1344
|
+
def get_markets_with_http_info(
|
|
1345
|
+
self,
|
|
1346
|
+
limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 1000.")] = None,
|
|
1347
|
+
cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
|
|
1348
|
+
event_ticker: Annotated[Optional[StrictStr], Field(description="Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).")] = None,
|
|
1349
|
+
series_ticker: Annotated[Optional[StrictStr], Field(description="Filter by series ticker")] = None,
|
|
1350
|
+
min_created_ts: Annotated[Optional[StrictInt], Field(description="Filter items that created after this Unix timestamp")] = None,
|
|
1351
|
+
max_created_ts: Annotated[Optional[StrictInt], Field(description="Filter items that created before this Unix timestamp")] = None,
|
|
1352
|
+
max_close_ts: Annotated[Optional[StrictInt], Field(description="Filter items that close before this Unix timestamp")] = None,
|
|
1353
|
+
min_close_ts: Annotated[Optional[StrictInt], Field(description="Filter items that close after this Unix timestamp")] = None,
|
|
1354
|
+
min_settled_ts: Annotated[Optional[StrictInt], Field(description="Filter items that settled after this Unix timestamp")] = None,
|
|
1355
|
+
max_settled_ts: Annotated[Optional[StrictInt], Field(description="Filter items that settled before this Unix timestamp")] = None,
|
|
1356
|
+
status: Annotated[Optional[StrictStr], Field(description="Filter by market status. Possible values are 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any status.")] = None,
|
|
1357
|
+
tickers: Annotated[Optional[StrictStr], Field(description="Filter by specific market tickers. Comma-separated list of market tickers to retrieve.")] = None,
|
|
1358
|
+
mve_filter: Annotated[Optional[StrictStr], Field(description="Filter by multivariate events (combos). 'only' returns only multivariate events, 'exclude' excludes multivariate events.")] = None,
|
|
1359
|
+
_request_timeout: Union[
|
|
1360
|
+
None,
|
|
1361
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1362
|
+
Tuple[
|
|
1363
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1364
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1365
|
+
]
|
|
1366
|
+
] = None,
|
|
1367
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1368
|
+
_content_type: Optional[StrictStr] = None,
|
|
1369
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1370
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1371
|
+
) -> ApiResponse[GetMarketsResponse]:
|
|
1372
|
+
"""Get Markets
|
|
1373
|
+
|
|
1374
|
+
Filter by market status. Possible values: `unopened`, `open`, `closed`, `settled`. Leave empty to return markets with any status. - Only one `status` filter may be supplied at a time. - Timestamp filters will be mutually exclusive from other timestamp filters and certain status filters. | Compatible Timestamp Filters | Additional Status Filters| |------------------------------|--------------------------| | min_created_ts, max_created_ts | `unopened`, `open`, *empty* | | min_close_ts, max_close_ts | `closed`, *empty* | | min_settled_ts, max_settled_ts | `settled`, *empty* |
|
|
1375
|
+
|
|
1376
|
+
:param limit: Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
1377
|
+
:type limit: int
|
|
1378
|
+
:param cursor: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
|
|
1379
|
+
:type cursor: str
|
|
1380
|
+
:param event_ticker: Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).
|
|
1381
|
+
:type event_ticker: str
|
|
1382
|
+
:param series_ticker: Filter by series ticker
|
|
1383
|
+
:type series_ticker: str
|
|
1384
|
+
:param min_created_ts: Filter items that created after this Unix timestamp
|
|
1385
|
+
:type min_created_ts: int
|
|
1386
|
+
:param max_created_ts: Filter items that created before this Unix timestamp
|
|
1387
|
+
:type max_created_ts: int
|
|
1388
|
+
:param max_close_ts: Filter items that close before this Unix timestamp
|
|
1389
|
+
:type max_close_ts: int
|
|
1390
|
+
:param min_close_ts: Filter items that close after this Unix timestamp
|
|
1391
|
+
:type min_close_ts: int
|
|
1392
|
+
:param min_settled_ts: Filter items that settled after this Unix timestamp
|
|
1393
|
+
:type min_settled_ts: int
|
|
1394
|
+
:param max_settled_ts: Filter items that settled before this Unix timestamp
|
|
1395
|
+
:type max_settled_ts: int
|
|
1396
|
+
:param status: Filter by market status. Possible values are 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any status.
|
|
1397
|
+
:type status: str
|
|
1398
|
+
:param tickers: Filter by specific market tickers. Comma-separated list of market tickers to retrieve.
|
|
1399
|
+
:type tickers: str
|
|
1400
|
+
:param mve_filter: Filter by multivariate events (combos). 'only' returns only multivariate events, 'exclude' excludes multivariate events.
|
|
1401
|
+
:type mve_filter: str
|
|
1402
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1403
|
+
number provided, it will be total request
|
|
1404
|
+
timeout. It can also be a pair (tuple) of
|
|
1405
|
+
(connection, read) timeouts.
|
|
1406
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1407
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1408
|
+
request; this effectively ignores the
|
|
1409
|
+
authentication in the spec for a single request.
|
|
1410
|
+
:type _request_auth: dict, optional
|
|
1411
|
+
:param _content_type: force content-type for the request.
|
|
1412
|
+
:type _content_type: str, Optional
|
|
1413
|
+
:param _headers: set to override the headers for a single
|
|
1414
|
+
request; this effectively ignores the headers
|
|
1415
|
+
in the spec for a single request.
|
|
1416
|
+
:type _headers: dict, optional
|
|
1417
|
+
:param _host_index: set to override the host_index for a single
|
|
1418
|
+
request; this effectively ignores the host_index
|
|
1419
|
+
in the spec for a single request.
|
|
1420
|
+
:type _host_index: int, optional
|
|
1421
|
+
:return: Returns the result object.
|
|
1422
|
+
""" # noqa: E501
|
|
1423
|
+
|
|
1424
|
+
_param = self._get_markets_serialize(
|
|
1425
|
+
limit=limit,
|
|
1426
|
+
cursor=cursor,
|
|
1427
|
+
event_ticker=event_ticker,
|
|
1428
|
+
series_ticker=series_ticker,
|
|
1429
|
+
min_created_ts=min_created_ts,
|
|
1430
|
+
max_created_ts=max_created_ts,
|
|
1431
|
+
max_close_ts=max_close_ts,
|
|
1432
|
+
min_close_ts=min_close_ts,
|
|
1433
|
+
min_settled_ts=min_settled_ts,
|
|
1434
|
+
max_settled_ts=max_settled_ts,
|
|
1435
|
+
status=status,
|
|
1436
|
+
tickers=tickers,
|
|
1437
|
+
mve_filter=mve_filter,
|
|
1438
|
+
_request_auth=_request_auth,
|
|
1439
|
+
_content_type=_content_type,
|
|
1440
|
+
_headers=_headers,
|
|
1441
|
+
_host_index=_host_index
|
|
1442
|
+
)
|
|
1443
|
+
|
|
1444
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1445
|
+
'200': "GetMarketsResponse",
|
|
1446
|
+
'400': None,
|
|
1447
|
+
'401': None,
|
|
1448
|
+
'500': None,
|
|
1449
|
+
}
|
|
1450
|
+
response_data = self.api_client.call_api(
|
|
1451
|
+
*_param,
|
|
1452
|
+
_request_timeout=_request_timeout
|
|
1453
|
+
)
|
|
1454
|
+
response_data.read()
|
|
1455
|
+
return self.api_client.response_deserialize(
|
|
1456
|
+
response_data=response_data,
|
|
1457
|
+
response_types_map=_response_types_map,
|
|
1458
|
+
)
|
|
1459
|
+
|
|
1460
|
+
|
|
1461
|
+
@validate_call
|
|
1462
|
+
def get_markets_without_preload_content(
|
|
1463
|
+
self,
|
|
1464
|
+
limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 1000.")] = None,
|
|
1465
|
+
cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
|
|
1466
|
+
event_ticker: Annotated[Optional[StrictStr], Field(description="Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).")] = None,
|
|
1467
|
+
series_ticker: Annotated[Optional[StrictStr], Field(description="Filter by series ticker")] = None,
|
|
1468
|
+
min_created_ts: Annotated[Optional[StrictInt], Field(description="Filter items that created after this Unix timestamp")] = None,
|
|
1469
|
+
max_created_ts: Annotated[Optional[StrictInt], Field(description="Filter items that created before this Unix timestamp")] = None,
|
|
1470
|
+
max_close_ts: Annotated[Optional[StrictInt], Field(description="Filter items that close before this Unix timestamp")] = None,
|
|
1471
|
+
min_close_ts: Annotated[Optional[StrictInt], Field(description="Filter items that close after this Unix timestamp")] = None,
|
|
1472
|
+
min_settled_ts: Annotated[Optional[StrictInt], Field(description="Filter items that settled after this Unix timestamp")] = None,
|
|
1473
|
+
max_settled_ts: Annotated[Optional[StrictInt], Field(description="Filter items that settled before this Unix timestamp")] = None,
|
|
1474
|
+
status: Annotated[Optional[StrictStr], Field(description="Filter by market status. Possible values are 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any status.")] = None,
|
|
1475
|
+
tickers: Annotated[Optional[StrictStr], Field(description="Filter by specific market tickers. Comma-separated list of market tickers to retrieve.")] = None,
|
|
1476
|
+
mve_filter: Annotated[Optional[StrictStr], Field(description="Filter by multivariate events (combos). 'only' returns only multivariate events, 'exclude' excludes multivariate events.")] = None,
|
|
1477
|
+
_request_timeout: Union[
|
|
1478
|
+
None,
|
|
1479
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1480
|
+
Tuple[
|
|
1481
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1482
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1483
|
+
]
|
|
1484
|
+
] = None,
|
|
1485
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1486
|
+
_content_type: Optional[StrictStr] = None,
|
|
1487
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1488
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1489
|
+
) -> RESTResponseType:
|
|
1490
|
+
"""Get Markets
|
|
1491
|
+
|
|
1492
|
+
Filter by market status. Possible values: `unopened`, `open`, `closed`, `settled`. Leave empty to return markets with any status. - Only one `status` filter may be supplied at a time. - Timestamp filters will be mutually exclusive from other timestamp filters and certain status filters. | Compatible Timestamp Filters | Additional Status Filters| |------------------------------|--------------------------| | min_created_ts, max_created_ts | `unopened`, `open`, *empty* | | min_close_ts, max_close_ts | `closed`, *empty* | | min_settled_ts, max_settled_ts | `settled`, *empty* |
|
|
1493
|
+
|
|
1494
|
+
:param limit: Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
1495
|
+
:type limit: int
|
|
1496
|
+
:param cursor: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
|
|
1497
|
+
:type cursor: str
|
|
1498
|
+
:param event_ticker: Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).
|
|
1499
|
+
:type event_ticker: str
|
|
1500
|
+
:param series_ticker: Filter by series ticker
|
|
1501
|
+
:type series_ticker: str
|
|
1502
|
+
:param min_created_ts: Filter items that created after this Unix timestamp
|
|
1503
|
+
:type min_created_ts: int
|
|
1504
|
+
:param max_created_ts: Filter items that created before this Unix timestamp
|
|
1505
|
+
:type max_created_ts: int
|
|
1506
|
+
:param max_close_ts: Filter items that close before this Unix timestamp
|
|
1507
|
+
:type max_close_ts: int
|
|
1508
|
+
:param min_close_ts: Filter items that close after this Unix timestamp
|
|
1509
|
+
:type min_close_ts: int
|
|
1510
|
+
:param min_settled_ts: Filter items that settled after this Unix timestamp
|
|
1511
|
+
:type min_settled_ts: int
|
|
1512
|
+
:param max_settled_ts: Filter items that settled before this Unix timestamp
|
|
1513
|
+
:type max_settled_ts: int
|
|
1514
|
+
:param status: Filter by market status. Possible values are 'unopened', 'open', 'closed', 'settled'. Leave empty to return markets with any status.
|
|
1515
|
+
:type status: str
|
|
1516
|
+
:param tickers: Filter by specific market tickers. Comma-separated list of market tickers to retrieve.
|
|
1517
|
+
:type tickers: str
|
|
1518
|
+
:param mve_filter: Filter by multivariate events (combos). 'only' returns only multivariate events, 'exclude' excludes multivariate events.
|
|
1519
|
+
:type mve_filter: str
|
|
1520
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1521
|
+
number provided, it will be total request
|
|
1522
|
+
timeout. It can also be a pair (tuple) of
|
|
1523
|
+
(connection, read) timeouts.
|
|
1524
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1525
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1526
|
+
request; this effectively ignores the
|
|
1527
|
+
authentication in the spec for a single request.
|
|
1528
|
+
:type _request_auth: dict, optional
|
|
1529
|
+
:param _content_type: force content-type for the request.
|
|
1530
|
+
:type _content_type: str, Optional
|
|
1531
|
+
:param _headers: set to override the headers for a single
|
|
1532
|
+
request; this effectively ignores the headers
|
|
1533
|
+
in the spec for a single request.
|
|
1534
|
+
:type _headers: dict, optional
|
|
1535
|
+
:param _host_index: set to override the host_index for a single
|
|
1536
|
+
request; this effectively ignores the host_index
|
|
1537
|
+
in the spec for a single request.
|
|
1538
|
+
:type _host_index: int, optional
|
|
1539
|
+
:return: Returns the result object.
|
|
1540
|
+
""" # noqa: E501
|
|
1541
|
+
|
|
1542
|
+
_param = self._get_markets_serialize(
|
|
1543
|
+
limit=limit,
|
|
1544
|
+
cursor=cursor,
|
|
1545
|
+
event_ticker=event_ticker,
|
|
1546
|
+
series_ticker=series_ticker,
|
|
1547
|
+
min_created_ts=min_created_ts,
|
|
1548
|
+
max_created_ts=max_created_ts,
|
|
1549
|
+
max_close_ts=max_close_ts,
|
|
1550
|
+
min_close_ts=min_close_ts,
|
|
1551
|
+
min_settled_ts=min_settled_ts,
|
|
1552
|
+
max_settled_ts=max_settled_ts,
|
|
1553
|
+
status=status,
|
|
1554
|
+
tickers=tickers,
|
|
1555
|
+
mve_filter=mve_filter,
|
|
1556
|
+
_request_auth=_request_auth,
|
|
1557
|
+
_content_type=_content_type,
|
|
1558
|
+
_headers=_headers,
|
|
1559
|
+
_host_index=_host_index
|
|
1560
|
+
)
|
|
1561
|
+
|
|
1562
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1563
|
+
'200': "GetMarketsResponse",
|
|
1564
|
+
'400': None,
|
|
1565
|
+
'401': None,
|
|
1566
|
+
'500': None,
|
|
1567
|
+
}
|
|
1568
|
+
response_data = self.api_client.call_api(
|
|
1569
|
+
*_param,
|
|
1570
|
+
_request_timeout=_request_timeout
|
|
1571
|
+
)
|
|
1572
|
+
return response_data.response
|
|
1573
|
+
|
|
1574
|
+
|
|
1575
|
+
def _get_markets_serialize(
|
|
1576
|
+
self,
|
|
1577
|
+
limit,
|
|
1578
|
+
cursor,
|
|
1579
|
+
event_ticker,
|
|
1580
|
+
series_ticker,
|
|
1581
|
+
min_created_ts,
|
|
1582
|
+
max_created_ts,
|
|
1583
|
+
max_close_ts,
|
|
1584
|
+
min_close_ts,
|
|
1585
|
+
min_settled_ts,
|
|
1586
|
+
max_settled_ts,
|
|
1587
|
+
status,
|
|
1588
|
+
tickers,
|
|
1589
|
+
mve_filter,
|
|
1590
|
+
_request_auth,
|
|
1591
|
+
_content_type,
|
|
1592
|
+
_headers,
|
|
1593
|
+
_host_index,
|
|
1594
|
+
) -> RequestSerialized:
|
|
1595
|
+
|
|
1596
|
+
_host = None
|
|
1597
|
+
|
|
1598
|
+
_collection_formats: Dict[str, str] = {
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
_path_params: Dict[str, str] = {}
|
|
1602
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1603
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1604
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1605
|
+
_files: Dict[
|
|
1606
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1607
|
+
] = {}
|
|
1608
|
+
_body_params: Optional[bytes] = None
|
|
1609
|
+
|
|
1610
|
+
# process the path parameters
|
|
1611
|
+
# process the query parameters
|
|
1612
|
+
if limit is not None:
|
|
1613
|
+
|
|
1614
|
+
_query_params.append(('limit', limit))
|
|
1615
|
+
|
|
1616
|
+
if cursor is not None:
|
|
1617
|
+
|
|
1618
|
+
_query_params.append(('cursor', cursor))
|
|
1619
|
+
|
|
1620
|
+
if event_ticker is not None:
|
|
1621
|
+
|
|
1622
|
+
_query_params.append(('event_ticker', event_ticker))
|
|
1623
|
+
|
|
1624
|
+
if series_ticker is not None:
|
|
1625
|
+
|
|
1626
|
+
_query_params.append(('series_ticker', series_ticker))
|
|
1627
|
+
|
|
1628
|
+
if min_created_ts is not None:
|
|
1629
|
+
|
|
1630
|
+
_query_params.append(('min_created_ts', min_created_ts))
|
|
1631
|
+
|
|
1632
|
+
if max_created_ts is not None:
|
|
1633
|
+
|
|
1634
|
+
_query_params.append(('max_created_ts', max_created_ts))
|
|
1635
|
+
|
|
1636
|
+
if max_close_ts is not None:
|
|
1637
|
+
|
|
1638
|
+
_query_params.append(('max_close_ts', max_close_ts))
|
|
1639
|
+
|
|
1640
|
+
if min_close_ts is not None:
|
|
1641
|
+
|
|
1642
|
+
_query_params.append(('min_close_ts', min_close_ts))
|
|
1643
|
+
|
|
1644
|
+
if min_settled_ts is not None:
|
|
1645
|
+
|
|
1646
|
+
_query_params.append(('min_settled_ts', min_settled_ts))
|
|
1647
|
+
|
|
1648
|
+
if max_settled_ts is not None:
|
|
1649
|
+
|
|
1650
|
+
_query_params.append(('max_settled_ts', max_settled_ts))
|
|
1651
|
+
|
|
1652
|
+
if status is not None:
|
|
1653
|
+
|
|
1654
|
+
_query_params.append(('status', status))
|
|
1655
|
+
|
|
1656
|
+
if tickers is not None:
|
|
1657
|
+
|
|
1658
|
+
_query_params.append(('tickers', tickers))
|
|
1659
|
+
|
|
1660
|
+
if mve_filter is not None:
|
|
1661
|
+
|
|
1662
|
+
_query_params.append(('mve_filter', mve_filter))
|
|
1663
|
+
|
|
1664
|
+
# process the header parameters
|
|
1665
|
+
# process the form parameters
|
|
1666
|
+
# process the body parameter
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
# set the HTTP header `Accept`
|
|
1670
|
+
if 'Accept' not in _header_params:
|
|
1671
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1672
|
+
[
|
|
1673
|
+
'application/json'
|
|
1674
|
+
]
|
|
1675
|
+
)
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
# authentication setting
|
|
1679
|
+
_auth_settings: List[str] = [
|
|
1680
|
+
]
|
|
1681
|
+
|
|
1682
|
+
return self.api_client.param_serialize(
|
|
1683
|
+
method='GET',
|
|
1684
|
+
resource_path='/markets',
|
|
1685
|
+
path_params=_path_params,
|
|
1686
|
+
query_params=_query_params,
|
|
1687
|
+
header_params=_header_params,
|
|
1688
|
+
body=_body_params,
|
|
1689
|
+
post_params=_form_params,
|
|
1690
|
+
files=_files,
|
|
1691
|
+
auth_settings=_auth_settings,
|
|
1692
|
+
collection_formats=_collection_formats,
|
|
1693
|
+
_host=_host,
|
|
1694
|
+
_request_auth=_request_auth
|
|
1695
|
+
)
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
|
|
1699
|
+
|
|
1700
|
+
@validate_call
|
|
1701
|
+
def get_series(
|
|
1702
|
+
self,
|
|
1703
|
+
series_ticker: StrictStr,
|
|
1704
|
+
) -> GetSeriesResponse:
|
|
1705
|
+
"""Get Series
|
|
1706
|
+
|
|
1707
|
+
Endpoint for getting data about a specific series by its ticker. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). Series define the structure, settlement sources, and metadata that will be applied to each recurring event instance within that series.
|
|
1708
|
+
|
|
1709
|
+
:param series_ticker: The ticker of the series to retrieve (required)
|
|
1710
|
+
:type series_ticker: str
|
|
1711
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1712
|
+
number provided, it will be total request
|
|
1713
|
+
timeout. It can also be a pair (tuple) of
|
|
1714
|
+
(connection, read) timeouts.
|
|
1715
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1716
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1717
|
+
request; this effectively ignores the
|
|
1718
|
+
authentication in the spec for a single request.
|
|
1719
|
+
:type _request_auth: dict, optional
|
|
1720
|
+
:param _content_type: force content-type for the request.
|
|
1721
|
+
:type _content_type: str, Optional
|
|
1722
|
+
:param _headers: set to override the headers for a single
|
|
1723
|
+
request; this effectively ignores the headers
|
|
1724
|
+
in the spec for a single request.
|
|
1725
|
+
:type _headers: dict, optional
|
|
1726
|
+
:param _host_index: set to override the host_index for a single
|
|
1727
|
+
request; this effectively ignores the host_index
|
|
1728
|
+
in the spec for a single request.
|
|
1729
|
+
:type _host_index: int, optional
|
|
1730
|
+
:return: Returns the result object.
|
|
1731
|
+
""" # noqa: E501
|
|
1732
|
+
|
|
1733
|
+
|
|
1734
|
+
_param = self._get_series_serialize(
|
|
1735
|
+
series_ticker=series_ticker,
|
|
1736
|
+
_request_auth=None,
|
|
1737
|
+
_content_type=None,
|
|
1738
|
+
_headers=None,
|
|
1739
|
+
_host_index=0
|
|
1740
|
+
)
|
|
1741
|
+
|
|
1742
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1743
|
+
'200': "GetSeriesResponse",
|
|
1744
|
+
'400': "ErrorResponse",
|
|
1745
|
+
'500': "ErrorResponse",
|
|
1746
|
+
}
|
|
1747
|
+
response_data = self.api_client.call_api(
|
|
1748
|
+
*_param,
|
|
1749
|
+
_request_timeout=None,
|
|
1750
|
+
)
|
|
1751
|
+
response_data.read()
|
|
1752
|
+
return self.api_client.response_deserialize(
|
|
1753
|
+
response_data=response_data,
|
|
1754
|
+
response_types_map=_response_types_map,
|
|
1755
|
+
).data
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
@validate_call
|
|
1759
|
+
def get_series_with_http_info(
|
|
1760
|
+
self,
|
|
1761
|
+
series_ticker: Annotated[StrictStr, Field(description="The ticker of the series to retrieve")],
|
|
1762
|
+
_request_timeout: Union[
|
|
1763
|
+
None,
|
|
1764
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1765
|
+
Tuple[
|
|
1766
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1767
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1768
|
+
]
|
|
1769
|
+
] = None,
|
|
1770
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1771
|
+
_content_type: Optional[StrictStr] = None,
|
|
1772
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1773
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1774
|
+
) -> ApiResponse[GetSeriesResponse]:
|
|
1775
|
+
"""Get Series
|
|
1776
|
+
|
|
1777
|
+
Endpoint for getting data about a specific series by its ticker. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). Series define the structure, settlement sources, and metadata that will be applied to each recurring event instance within that series.
|
|
1778
|
+
|
|
1779
|
+
:param series_ticker: The ticker of the series to retrieve (required)
|
|
1780
|
+
:type series_ticker: str
|
|
1781
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1782
|
+
number provided, it will be total request
|
|
1783
|
+
timeout. It can also be a pair (tuple) of
|
|
1784
|
+
(connection, read) timeouts.
|
|
1785
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1786
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1787
|
+
request; this effectively ignores the
|
|
1788
|
+
authentication in the spec for a single request.
|
|
1789
|
+
:type _request_auth: dict, optional
|
|
1790
|
+
:param _content_type: force content-type for the request.
|
|
1791
|
+
:type _content_type: str, Optional
|
|
1792
|
+
:param _headers: set to override the headers for a single
|
|
1793
|
+
request; this effectively ignores the headers
|
|
1794
|
+
in the spec for a single request.
|
|
1795
|
+
:type _headers: dict, optional
|
|
1796
|
+
:param _host_index: set to override the host_index for a single
|
|
1797
|
+
request; this effectively ignores the host_index
|
|
1798
|
+
in the spec for a single request.
|
|
1799
|
+
:type _host_index: int, optional
|
|
1800
|
+
:return: Returns the result object.
|
|
1801
|
+
""" # noqa: E501
|
|
1802
|
+
|
|
1803
|
+
_param = self._get_series_serialize(
|
|
1804
|
+
series_ticker=series_ticker,
|
|
1805
|
+
_request_auth=_request_auth,
|
|
1806
|
+
_content_type=_content_type,
|
|
1807
|
+
_headers=_headers,
|
|
1808
|
+
_host_index=_host_index
|
|
1809
|
+
)
|
|
1810
|
+
|
|
1811
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1812
|
+
'200': "GetSeriesResponse",
|
|
1813
|
+
'400': "ErrorResponse",
|
|
1814
|
+
'500': "ErrorResponse",
|
|
1815
|
+
}
|
|
1816
|
+
response_data = self.api_client.call_api(
|
|
1817
|
+
*_param,
|
|
1818
|
+
_request_timeout=_request_timeout
|
|
1819
|
+
)
|
|
1820
|
+
response_data.read()
|
|
1821
|
+
return self.api_client.response_deserialize(
|
|
1822
|
+
response_data=response_data,
|
|
1823
|
+
response_types_map=_response_types_map,
|
|
1824
|
+
)
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
@validate_call
|
|
1828
|
+
def get_series_without_preload_content(
|
|
1829
|
+
self,
|
|
1830
|
+
series_ticker: Annotated[StrictStr, Field(description="The ticker of the series to retrieve")],
|
|
1831
|
+
_request_timeout: Union[
|
|
1832
|
+
None,
|
|
1833
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1834
|
+
Tuple[
|
|
1835
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1836
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1837
|
+
]
|
|
1838
|
+
] = None,
|
|
1839
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1840
|
+
_content_type: Optional[StrictStr] = None,
|
|
1841
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1842
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1843
|
+
) -> RESTResponseType:
|
|
1844
|
+
"""Get Series
|
|
1845
|
+
|
|
1846
|
+
Endpoint for getting data about a specific series by its ticker. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). Series define the structure, settlement sources, and metadata that will be applied to each recurring event instance within that series.
|
|
1847
|
+
|
|
1848
|
+
:param series_ticker: The ticker of the series to retrieve (required)
|
|
1849
|
+
:type series_ticker: str
|
|
1850
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1851
|
+
number provided, it will be total request
|
|
1852
|
+
timeout. It can also be a pair (tuple) of
|
|
1853
|
+
(connection, read) timeouts.
|
|
1854
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1855
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1856
|
+
request; this effectively ignores the
|
|
1857
|
+
authentication in the spec for a single request.
|
|
1858
|
+
:type _request_auth: dict, optional
|
|
1859
|
+
:param _content_type: force content-type for the request.
|
|
1860
|
+
:type _content_type: str, Optional
|
|
1861
|
+
:param _headers: set to override the headers for a single
|
|
1862
|
+
request; this effectively ignores the headers
|
|
1863
|
+
in the spec for a single request.
|
|
1864
|
+
:type _headers: dict, optional
|
|
1865
|
+
:param _host_index: set to override the host_index for a single
|
|
1866
|
+
request; this effectively ignores the host_index
|
|
1867
|
+
in the spec for a single request.
|
|
1868
|
+
:type _host_index: int, optional
|
|
1869
|
+
:return: Returns the result object.
|
|
1870
|
+
""" # noqa: E501
|
|
1871
|
+
|
|
1872
|
+
_param = self._get_series_serialize(
|
|
1873
|
+
series_ticker=series_ticker,
|
|
1874
|
+
_request_auth=_request_auth,
|
|
1875
|
+
_content_type=_content_type,
|
|
1876
|
+
_headers=_headers,
|
|
1877
|
+
_host_index=_host_index
|
|
1878
|
+
)
|
|
1879
|
+
|
|
1880
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1881
|
+
'200': "GetSeriesResponse",
|
|
1882
|
+
'400': "ErrorResponse",
|
|
1883
|
+
'500': "ErrorResponse",
|
|
1884
|
+
}
|
|
1885
|
+
response_data = self.api_client.call_api(
|
|
1886
|
+
*_param,
|
|
1887
|
+
_request_timeout=_request_timeout
|
|
1888
|
+
)
|
|
1889
|
+
return response_data.response
|
|
1890
|
+
|
|
1891
|
+
|
|
1892
|
+
def _get_series_serialize(
|
|
1893
|
+
self,
|
|
1894
|
+
series_ticker,
|
|
1895
|
+
_request_auth,
|
|
1896
|
+
_content_type,
|
|
1897
|
+
_headers,
|
|
1898
|
+
_host_index,
|
|
1899
|
+
) -> RequestSerialized:
|
|
1900
|
+
|
|
1901
|
+
_host = None
|
|
1902
|
+
|
|
1903
|
+
_collection_formats: Dict[str, str] = {
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
_path_params: Dict[str, str] = {}
|
|
1907
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1908
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1909
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1910
|
+
_files: Dict[
|
|
1911
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1912
|
+
] = {}
|
|
1913
|
+
_body_params: Optional[bytes] = None
|
|
1914
|
+
|
|
1915
|
+
# process the path parameters
|
|
1916
|
+
if series_ticker is not None:
|
|
1917
|
+
_path_params['series_ticker'] = series_ticker
|
|
1918
|
+
# process the query parameters
|
|
1919
|
+
# process the header parameters
|
|
1920
|
+
# process the form parameters
|
|
1921
|
+
# process the body parameter
|
|
1922
|
+
|
|
1923
|
+
|
|
1924
|
+
# set the HTTP header `Accept`
|
|
1925
|
+
if 'Accept' not in _header_params:
|
|
1926
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1927
|
+
[
|
|
1928
|
+
'application/json'
|
|
1929
|
+
]
|
|
1930
|
+
)
|
|
1931
|
+
|
|
1932
|
+
|
|
1933
|
+
# authentication setting
|
|
1934
|
+
_auth_settings: List[str] = [
|
|
1935
|
+
]
|
|
1936
|
+
|
|
1937
|
+
return self.api_client.param_serialize(
|
|
1938
|
+
method='GET',
|
|
1939
|
+
resource_path='/series/{series_ticker}',
|
|
1940
|
+
path_params=_path_params,
|
|
1941
|
+
query_params=_query_params,
|
|
1942
|
+
header_params=_header_params,
|
|
1943
|
+
body=_body_params,
|
|
1944
|
+
post_params=_form_params,
|
|
1945
|
+
files=_files,
|
|
1946
|
+
auth_settings=_auth_settings,
|
|
1947
|
+
collection_formats=_collection_formats,
|
|
1948
|
+
_host=_host,
|
|
1949
|
+
_request_auth=_request_auth
|
|
1950
|
+
)
|
|
1951
|
+
|
|
1952
|
+
|
|
1953
|
+
|
|
1954
|
+
|
|
1955
|
+
@validate_call
|
|
1956
|
+
def get_series_list(
|
|
1957
|
+
self,
|
|
1958
|
+
category: Any = None,
|
|
1959
|
+
tags: Any = None,
|
|
1960
|
+
include_product_metadata: Any = None,
|
|
1961
|
+
) -> GetSeriesListResponse:
|
|
1962
|
+
"""Get Series List
|
|
1963
|
+
|
|
1964
|
+
Endpoint for getting data about multiple series with specified filters. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). This endpoint allows you to browse and discover available series templates by category.
|
|
1965
|
+
|
|
1966
|
+
:param category:
|
|
1967
|
+
:type category: str
|
|
1968
|
+
:param tags:
|
|
1969
|
+
:type tags: str
|
|
1970
|
+
:param include_product_metadata:
|
|
1971
|
+
:type include_product_metadata: bool
|
|
1972
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1973
|
+
number provided, it will be total request
|
|
1974
|
+
timeout. It can also be a pair (tuple) of
|
|
1975
|
+
(connection, read) timeouts.
|
|
1976
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1977
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1978
|
+
request; this effectively ignores the
|
|
1979
|
+
authentication in the spec for a single request.
|
|
1980
|
+
:type _request_auth: dict, optional
|
|
1981
|
+
:param _content_type: force content-type for the request.
|
|
1982
|
+
:type _content_type: str, Optional
|
|
1983
|
+
:param _headers: set to override the headers for a single
|
|
1984
|
+
request; this effectively ignores the headers
|
|
1985
|
+
in the spec for a single request.
|
|
1986
|
+
:type _headers: dict, optional
|
|
1987
|
+
:param _host_index: set to override the host_index for a single
|
|
1988
|
+
request; this effectively ignores the host_index
|
|
1989
|
+
in the spec for a single request.
|
|
1990
|
+
:type _host_index: int, optional
|
|
1991
|
+
:return: Returns the result object.
|
|
1992
|
+
""" # noqa: E501
|
|
1993
|
+
|
|
1994
|
+
|
|
1995
|
+
_param = self._get_series_list_serialize(
|
|
1996
|
+
category=category,
|
|
1997
|
+
tags=tags,
|
|
1998
|
+
include_product_metadata=include_product_metadata,
|
|
1999
|
+
_request_auth=None,
|
|
2000
|
+
_content_type=None,
|
|
2001
|
+
_headers=None,
|
|
2002
|
+
_host_index=0
|
|
2003
|
+
)
|
|
2004
|
+
|
|
2005
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2006
|
+
'200': "GetSeriesListResponse",
|
|
2007
|
+
'400': "ErrorResponse",
|
|
2008
|
+
'500': "ErrorResponse",
|
|
2009
|
+
}
|
|
2010
|
+
response_data = self.api_client.call_api(
|
|
2011
|
+
*_param,
|
|
2012
|
+
_request_timeout=None,
|
|
2013
|
+
)
|
|
2014
|
+
response_data.read()
|
|
2015
|
+
return self.api_client.response_deserialize(
|
|
2016
|
+
response_data=response_data,
|
|
2017
|
+
response_types_map=_response_types_map,
|
|
2018
|
+
).data
|
|
2019
|
+
|
|
2020
|
+
|
|
2021
|
+
@validate_call
|
|
2022
|
+
def get_series_list_with_http_info(
|
|
2023
|
+
self,
|
|
2024
|
+
category: Optional[StrictStr] = None,
|
|
2025
|
+
tags: Optional[StrictStr] = None,
|
|
2026
|
+
include_product_metadata: Optional[StrictBool] = None,
|
|
2027
|
+
_request_timeout: Union[
|
|
2028
|
+
None,
|
|
2029
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2030
|
+
Tuple[
|
|
2031
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2032
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2033
|
+
]
|
|
2034
|
+
] = None,
|
|
2035
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2036
|
+
_content_type: Optional[StrictStr] = None,
|
|
2037
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2038
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2039
|
+
) -> ApiResponse[GetSeriesListResponse]:
|
|
2040
|
+
"""Get Series List
|
|
2041
|
+
|
|
2042
|
+
Endpoint for getting data about multiple series with specified filters. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). This endpoint allows you to browse and discover available series templates by category.
|
|
2043
|
+
|
|
2044
|
+
:param category:
|
|
2045
|
+
:type category: str
|
|
2046
|
+
:param tags:
|
|
2047
|
+
:type tags: str
|
|
2048
|
+
:param include_product_metadata:
|
|
2049
|
+
:type include_product_metadata: bool
|
|
2050
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2051
|
+
number provided, it will be total request
|
|
2052
|
+
timeout. It can also be a pair (tuple) of
|
|
2053
|
+
(connection, read) timeouts.
|
|
2054
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2055
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2056
|
+
request; this effectively ignores the
|
|
2057
|
+
authentication in the spec for a single request.
|
|
2058
|
+
:type _request_auth: dict, optional
|
|
2059
|
+
:param _content_type: force content-type for the request.
|
|
2060
|
+
:type _content_type: str, Optional
|
|
2061
|
+
:param _headers: set to override the headers for a single
|
|
2062
|
+
request; this effectively ignores the headers
|
|
2063
|
+
in the spec for a single request.
|
|
2064
|
+
:type _headers: dict, optional
|
|
2065
|
+
:param _host_index: set to override the host_index for a single
|
|
2066
|
+
request; this effectively ignores the host_index
|
|
2067
|
+
in the spec for a single request.
|
|
2068
|
+
:type _host_index: int, optional
|
|
2069
|
+
:return: Returns the result object.
|
|
2070
|
+
""" # noqa: E501
|
|
2071
|
+
|
|
2072
|
+
_param = self._get_series_list_serialize(
|
|
2073
|
+
category=category,
|
|
2074
|
+
tags=tags,
|
|
2075
|
+
include_product_metadata=include_product_metadata,
|
|
2076
|
+
_request_auth=_request_auth,
|
|
2077
|
+
_content_type=_content_type,
|
|
2078
|
+
_headers=_headers,
|
|
2079
|
+
_host_index=_host_index
|
|
2080
|
+
)
|
|
2081
|
+
|
|
2082
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2083
|
+
'200': "GetSeriesListResponse",
|
|
2084
|
+
'400': "ErrorResponse",
|
|
2085
|
+
'500': "ErrorResponse",
|
|
2086
|
+
}
|
|
2087
|
+
response_data = self.api_client.call_api(
|
|
2088
|
+
*_param,
|
|
2089
|
+
_request_timeout=_request_timeout
|
|
2090
|
+
)
|
|
2091
|
+
response_data.read()
|
|
2092
|
+
return self.api_client.response_deserialize(
|
|
2093
|
+
response_data=response_data,
|
|
2094
|
+
response_types_map=_response_types_map,
|
|
2095
|
+
)
|
|
2096
|
+
|
|
2097
|
+
|
|
2098
|
+
@validate_call
|
|
2099
|
+
def get_series_list_without_preload_content(
|
|
2100
|
+
self,
|
|
2101
|
+
category: Optional[StrictStr] = None,
|
|
2102
|
+
tags: Optional[StrictStr] = None,
|
|
2103
|
+
include_product_metadata: Optional[StrictBool] = None,
|
|
2104
|
+
_request_timeout: Union[
|
|
2105
|
+
None,
|
|
2106
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2107
|
+
Tuple[
|
|
2108
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2109
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2110
|
+
]
|
|
2111
|
+
] = None,
|
|
2112
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2113
|
+
_content_type: Optional[StrictStr] = None,
|
|
2114
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2115
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2116
|
+
) -> RESTResponseType:
|
|
2117
|
+
"""Get Series List
|
|
2118
|
+
|
|
2119
|
+
Endpoint for getting data about multiple series with specified filters. A series represents a template for recurring events that follow the same format and rules (e.g., \"Monthly Jobs Report\", \"Weekly Initial Jobless Claims\", \"Daily Weather in NYC\"). This endpoint allows you to browse and discover available series templates by category.
|
|
2120
|
+
|
|
2121
|
+
:param category:
|
|
2122
|
+
:type category: str
|
|
2123
|
+
:param tags:
|
|
2124
|
+
:type tags: str
|
|
2125
|
+
:param include_product_metadata:
|
|
2126
|
+
:type include_product_metadata: bool
|
|
2127
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2128
|
+
number provided, it will be total request
|
|
2129
|
+
timeout. It can also be a pair (tuple) of
|
|
2130
|
+
(connection, read) timeouts.
|
|
2131
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2132
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2133
|
+
request; this effectively ignores the
|
|
2134
|
+
authentication in the spec for a single request.
|
|
2135
|
+
:type _request_auth: dict, optional
|
|
2136
|
+
:param _content_type: force content-type for the request.
|
|
2137
|
+
:type _content_type: str, Optional
|
|
2138
|
+
:param _headers: set to override the headers for a single
|
|
2139
|
+
request; this effectively ignores the headers
|
|
2140
|
+
in the spec for a single request.
|
|
2141
|
+
:type _headers: dict, optional
|
|
2142
|
+
:param _host_index: set to override the host_index for a single
|
|
2143
|
+
request; this effectively ignores the host_index
|
|
2144
|
+
in the spec for a single request.
|
|
2145
|
+
:type _host_index: int, optional
|
|
2146
|
+
:return: Returns the result object.
|
|
2147
|
+
""" # noqa: E501
|
|
2148
|
+
|
|
2149
|
+
_param = self._get_series_list_serialize(
|
|
2150
|
+
category=category,
|
|
2151
|
+
tags=tags,
|
|
2152
|
+
include_product_metadata=include_product_metadata,
|
|
2153
|
+
_request_auth=_request_auth,
|
|
2154
|
+
_content_type=_content_type,
|
|
2155
|
+
_headers=_headers,
|
|
2156
|
+
_host_index=_host_index
|
|
2157
|
+
)
|
|
2158
|
+
|
|
2159
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2160
|
+
'200': "GetSeriesListResponse",
|
|
2161
|
+
'400': "ErrorResponse",
|
|
2162
|
+
'500': "ErrorResponse",
|
|
2163
|
+
}
|
|
2164
|
+
response_data = self.api_client.call_api(
|
|
2165
|
+
*_param,
|
|
2166
|
+
_request_timeout=_request_timeout
|
|
2167
|
+
)
|
|
2168
|
+
return response_data.response
|
|
2169
|
+
|
|
2170
|
+
|
|
2171
|
+
def _get_series_list_serialize(
|
|
2172
|
+
self,
|
|
2173
|
+
category,
|
|
2174
|
+
tags,
|
|
2175
|
+
include_product_metadata,
|
|
2176
|
+
_request_auth,
|
|
2177
|
+
_content_type,
|
|
2178
|
+
_headers,
|
|
2179
|
+
_host_index,
|
|
2180
|
+
) -> RequestSerialized:
|
|
2181
|
+
|
|
2182
|
+
_host = None
|
|
2183
|
+
|
|
2184
|
+
_collection_formats: Dict[str, str] = {
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
_path_params: Dict[str, str] = {}
|
|
2188
|
+
_query_params: List[Tuple[str, str]] = []
|
|
2189
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
2190
|
+
_form_params: List[Tuple[str, str]] = []
|
|
2191
|
+
_files: Dict[
|
|
2192
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
2193
|
+
] = {}
|
|
2194
|
+
_body_params: Optional[bytes] = None
|
|
2195
|
+
|
|
2196
|
+
# process the path parameters
|
|
2197
|
+
# process the query parameters
|
|
2198
|
+
if category is not None:
|
|
2199
|
+
|
|
2200
|
+
_query_params.append(('category', category))
|
|
2201
|
+
|
|
2202
|
+
if tags is not None:
|
|
2203
|
+
|
|
2204
|
+
_query_params.append(('tags', tags))
|
|
2205
|
+
|
|
2206
|
+
if include_product_metadata is not None:
|
|
2207
|
+
|
|
2208
|
+
_query_params.append(('include_product_metadata', include_product_metadata))
|
|
2209
|
+
|
|
2210
|
+
# process the header parameters
|
|
2211
|
+
# process the form parameters
|
|
2212
|
+
# process the body parameter
|
|
2213
|
+
|
|
2214
|
+
|
|
2215
|
+
# set the HTTP header `Accept`
|
|
2216
|
+
if 'Accept' not in _header_params:
|
|
2217
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
2218
|
+
[
|
|
2219
|
+
'application/json'
|
|
2220
|
+
]
|
|
2221
|
+
)
|
|
2222
|
+
|
|
2223
|
+
|
|
2224
|
+
# authentication setting
|
|
2225
|
+
_auth_settings: List[str] = [
|
|
2226
|
+
]
|
|
2227
|
+
|
|
2228
|
+
return self.api_client.param_serialize(
|
|
2229
|
+
method='GET',
|
|
2230
|
+
resource_path='/series',
|
|
2231
|
+
path_params=_path_params,
|
|
2232
|
+
query_params=_query_params,
|
|
2233
|
+
header_params=_header_params,
|
|
2234
|
+
body=_body_params,
|
|
2235
|
+
post_params=_form_params,
|
|
2236
|
+
files=_files,
|
|
2237
|
+
auth_settings=_auth_settings,
|
|
2238
|
+
collection_formats=_collection_formats,
|
|
2239
|
+
_host=_host,
|
|
2240
|
+
_request_auth=_request_auth
|
|
2241
|
+
)
|
|
2242
|
+
|
|
2243
|
+
|
|
2244
|
+
|
|
2245
|
+
|
|
2246
|
+
@validate_call
|
|
2247
|
+
def get_trades(
|
|
2248
|
+
self,
|
|
2249
|
+
limit: Any = None,
|
|
2250
|
+
cursor: Any = None,
|
|
2251
|
+
ticker: Any = None,
|
|
2252
|
+
min_ts: Any = None,
|
|
2253
|
+
max_ts: Any = None,
|
|
2254
|
+
) -> GetTradesResponse:
|
|
2255
|
+
"""Get Trades
|
|
2256
|
+
|
|
2257
|
+
Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
|
|
2258
|
+
|
|
2259
|
+
:param limit: Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
2260
|
+
:type limit: int
|
|
2261
|
+
:param cursor: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
|
|
2262
|
+
:type cursor: str
|
|
2263
|
+
:param ticker: Filter by market ticker
|
|
2264
|
+
:type ticker: str
|
|
2265
|
+
:param min_ts: Filter items after this Unix timestamp
|
|
2266
|
+
:type min_ts: int
|
|
2267
|
+
:param max_ts: Filter items before this Unix timestamp
|
|
2268
|
+
:type max_ts: int
|
|
2269
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2270
|
+
number provided, it will be total request
|
|
2271
|
+
timeout. It can also be a pair (tuple) of
|
|
2272
|
+
(connection, read) timeouts.
|
|
2273
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2274
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2275
|
+
request; this effectively ignores the
|
|
2276
|
+
authentication in the spec for a single request.
|
|
2277
|
+
:type _request_auth: dict, optional
|
|
2278
|
+
:param _content_type: force content-type for the request.
|
|
2279
|
+
:type _content_type: str, Optional
|
|
2280
|
+
:param _headers: set to override the headers for a single
|
|
2281
|
+
request; this effectively ignores the headers
|
|
2282
|
+
in the spec for a single request.
|
|
2283
|
+
:type _headers: dict, optional
|
|
2284
|
+
:param _host_index: set to override the host_index for a single
|
|
2285
|
+
request; this effectively ignores the host_index
|
|
2286
|
+
in the spec for a single request.
|
|
2287
|
+
:type _host_index: int, optional
|
|
2288
|
+
:return: Returns the result object.
|
|
2289
|
+
""" # noqa: E501
|
|
2290
|
+
|
|
2291
|
+
|
|
2292
|
+
_param = self._get_trades_serialize(
|
|
2293
|
+
limit=limit,
|
|
2294
|
+
cursor=cursor,
|
|
2295
|
+
ticker=ticker,
|
|
2296
|
+
min_ts=min_ts,
|
|
2297
|
+
max_ts=max_ts,
|
|
2298
|
+
_request_auth=None,
|
|
2299
|
+
_content_type=None,
|
|
2300
|
+
_headers=None,
|
|
2301
|
+
_host_index=0
|
|
2302
|
+
)
|
|
2303
|
+
|
|
2304
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2305
|
+
'200': "GetTradesResponse",
|
|
2306
|
+
'400': None,
|
|
2307
|
+
'500': None,
|
|
2308
|
+
}
|
|
2309
|
+
response_data = self.api_client.call_api(
|
|
2310
|
+
*_param,
|
|
2311
|
+
_request_timeout=None,
|
|
2312
|
+
)
|
|
2313
|
+
response_data.read()
|
|
2314
|
+
return self.api_client.response_deserialize(
|
|
2315
|
+
response_data=response_data,
|
|
2316
|
+
response_types_map=_response_types_map,
|
|
2317
|
+
).data
|
|
2318
|
+
|
|
2319
|
+
|
|
2320
|
+
@validate_call
|
|
2321
|
+
def get_trades_with_http_info(
|
|
2322
|
+
self,
|
|
2323
|
+
limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 1000.")] = None,
|
|
2324
|
+
cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
|
|
2325
|
+
ticker: Annotated[Optional[StrictStr], Field(description="Filter by market ticker")] = None,
|
|
2326
|
+
min_ts: Annotated[Optional[StrictInt], Field(description="Filter items after this Unix timestamp")] = None,
|
|
2327
|
+
max_ts: Annotated[Optional[StrictInt], Field(description="Filter items before this Unix timestamp")] = None,
|
|
2328
|
+
_request_timeout: Union[
|
|
2329
|
+
None,
|
|
2330
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2331
|
+
Tuple[
|
|
2332
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2333
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2334
|
+
]
|
|
2335
|
+
] = None,
|
|
2336
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2337
|
+
_content_type: Optional[StrictStr] = None,
|
|
2338
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2339
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2340
|
+
) -> ApiResponse[GetTradesResponse]:
|
|
2341
|
+
"""Get Trades
|
|
2342
|
+
|
|
2343
|
+
Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
|
|
2344
|
+
|
|
2345
|
+
:param limit: Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
2346
|
+
:type limit: int
|
|
2347
|
+
:param cursor: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
|
|
2348
|
+
:type cursor: str
|
|
2349
|
+
:param ticker: Filter by market ticker
|
|
2350
|
+
:type ticker: str
|
|
2351
|
+
:param min_ts: Filter items after this Unix timestamp
|
|
2352
|
+
:type min_ts: int
|
|
2353
|
+
:param max_ts: Filter items before this Unix timestamp
|
|
2354
|
+
:type max_ts: int
|
|
2355
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2356
|
+
number provided, it will be total request
|
|
2357
|
+
timeout. It can also be a pair (tuple) of
|
|
2358
|
+
(connection, read) timeouts.
|
|
2359
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2360
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2361
|
+
request; this effectively ignores the
|
|
2362
|
+
authentication in the spec for a single request.
|
|
2363
|
+
:type _request_auth: dict, optional
|
|
2364
|
+
:param _content_type: force content-type for the request.
|
|
2365
|
+
:type _content_type: str, Optional
|
|
2366
|
+
:param _headers: set to override the headers for a single
|
|
2367
|
+
request; this effectively ignores the headers
|
|
2368
|
+
in the spec for a single request.
|
|
2369
|
+
:type _headers: dict, optional
|
|
2370
|
+
:param _host_index: set to override the host_index for a single
|
|
2371
|
+
request; this effectively ignores the host_index
|
|
2372
|
+
in the spec for a single request.
|
|
2373
|
+
:type _host_index: int, optional
|
|
2374
|
+
:return: Returns the result object.
|
|
2375
|
+
""" # noqa: E501
|
|
2376
|
+
|
|
2377
|
+
_param = self._get_trades_serialize(
|
|
2378
|
+
limit=limit,
|
|
2379
|
+
cursor=cursor,
|
|
2380
|
+
ticker=ticker,
|
|
2381
|
+
min_ts=min_ts,
|
|
2382
|
+
max_ts=max_ts,
|
|
2383
|
+
_request_auth=_request_auth,
|
|
2384
|
+
_content_type=_content_type,
|
|
2385
|
+
_headers=_headers,
|
|
2386
|
+
_host_index=_host_index
|
|
2387
|
+
)
|
|
2388
|
+
|
|
2389
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2390
|
+
'200': "GetTradesResponse",
|
|
2391
|
+
'400': None,
|
|
2392
|
+
'500': None,
|
|
2393
|
+
}
|
|
2394
|
+
response_data = self.api_client.call_api(
|
|
2395
|
+
*_param,
|
|
2396
|
+
_request_timeout=_request_timeout
|
|
2397
|
+
)
|
|
2398
|
+
response_data.read()
|
|
2399
|
+
return self.api_client.response_deserialize(
|
|
2400
|
+
response_data=response_data,
|
|
2401
|
+
response_types_map=_response_types_map,
|
|
2402
|
+
)
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
@validate_call
|
|
2406
|
+
def get_trades_without_preload_content(
|
|
2407
|
+
self,
|
|
2408
|
+
limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 1000.")] = None,
|
|
2409
|
+
cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
|
|
2410
|
+
ticker: Annotated[Optional[StrictStr], Field(description="Filter by market ticker")] = None,
|
|
2411
|
+
min_ts: Annotated[Optional[StrictInt], Field(description="Filter items after this Unix timestamp")] = None,
|
|
2412
|
+
max_ts: Annotated[Optional[StrictInt], Field(description="Filter items before this Unix timestamp")] = None,
|
|
2413
|
+
_request_timeout: Union[
|
|
2414
|
+
None,
|
|
2415
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2416
|
+
Tuple[
|
|
2417
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2418
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2419
|
+
]
|
|
2420
|
+
] = None,
|
|
2421
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2422
|
+
_content_type: Optional[StrictStr] = None,
|
|
2423
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2424
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2425
|
+
) -> RESTResponseType:
|
|
2426
|
+
"""Get Trades
|
|
2427
|
+
|
|
2428
|
+
Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
|
|
2429
|
+
|
|
2430
|
+
:param limit: Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
2431
|
+
:type limit: int
|
|
2432
|
+
:param cursor: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
|
|
2433
|
+
:type cursor: str
|
|
2434
|
+
:param ticker: Filter by market ticker
|
|
2435
|
+
:type ticker: str
|
|
2436
|
+
:param min_ts: Filter items after this Unix timestamp
|
|
2437
|
+
:type min_ts: int
|
|
2438
|
+
:param max_ts: Filter items before this Unix timestamp
|
|
2439
|
+
:type max_ts: int
|
|
2440
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2441
|
+
number provided, it will be total request
|
|
2442
|
+
timeout. It can also be a pair (tuple) of
|
|
2443
|
+
(connection, read) timeouts.
|
|
2444
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2445
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2446
|
+
request; this effectively ignores the
|
|
2447
|
+
authentication in the spec for a single request.
|
|
2448
|
+
:type _request_auth: dict, optional
|
|
2449
|
+
:param _content_type: force content-type for the request.
|
|
2450
|
+
:type _content_type: str, Optional
|
|
2451
|
+
:param _headers: set to override the headers for a single
|
|
2452
|
+
request; this effectively ignores the headers
|
|
2453
|
+
in the spec for a single request.
|
|
2454
|
+
:type _headers: dict, optional
|
|
2455
|
+
:param _host_index: set to override the host_index for a single
|
|
2456
|
+
request; this effectively ignores the host_index
|
|
2457
|
+
in the spec for a single request.
|
|
2458
|
+
:type _host_index: int, optional
|
|
2459
|
+
:return: Returns the result object.
|
|
2460
|
+
""" # noqa: E501
|
|
2461
|
+
|
|
2462
|
+
_param = self._get_trades_serialize(
|
|
2463
|
+
limit=limit,
|
|
2464
|
+
cursor=cursor,
|
|
2465
|
+
ticker=ticker,
|
|
2466
|
+
min_ts=min_ts,
|
|
2467
|
+
max_ts=max_ts,
|
|
2468
|
+
_request_auth=_request_auth,
|
|
2469
|
+
_content_type=_content_type,
|
|
2470
|
+
_headers=_headers,
|
|
2471
|
+
_host_index=_host_index
|
|
2472
|
+
)
|
|
2473
|
+
|
|
2474
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2475
|
+
'200': "GetTradesResponse",
|
|
2476
|
+
'400': None,
|
|
2477
|
+
'500': None,
|
|
2478
|
+
}
|
|
2479
|
+
response_data = self.api_client.call_api(
|
|
2480
|
+
*_param,
|
|
2481
|
+
_request_timeout=_request_timeout
|
|
2482
|
+
)
|
|
2483
|
+
return response_data.response
|
|
2484
|
+
|
|
2485
|
+
|
|
2486
|
+
def _get_trades_serialize(
|
|
2487
|
+
self,
|
|
2488
|
+
limit,
|
|
2489
|
+
cursor,
|
|
2490
|
+
ticker,
|
|
2491
|
+
min_ts,
|
|
2492
|
+
max_ts,
|
|
2493
|
+
_request_auth,
|
|
2494
|
+
_content_type,
|
|
2495
|
+
_headers,
|
|
2496
|
+
_host_index,
|
|
2497
|
+
) -> RequestSerialized:
|
|
2498
|
+
|
|
2499
|
+
_host = None
|
|
2500
|
+
|
|
2501
|
+
_collection_formats: Dict[str, str] = {
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
_path_params: Dict[str, str] = {}
|
|
2505
|
+
_query_params: List[Tuple[str, str]] = []
|
|
2506
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
2507
|
+
_form_params: List[Tuple[str, str]] = []
|
|
2508
|
+
_files: Dict[
|
|
2509
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
2510
|
+
] = {}
|
|
2511
|
+
_body_params: Optional[bytes] = None
|
|
2512
|
+
|
|
2513
|
+
# process the path parameters
|
|
2514
|
+
# process the query parameters
|
|
2515
|
+
if limit is not None:
|
|
2516
|
+
|
|
2517
|
+
_query_params.append(('limit', limit))
|
|
2518
|
+
|
|
2519
|
+
if cursor is not None:
|
|
2520
|
+
|
|
2521
|
+
_query_params.append(('cursor', cursor))
|
|
2522
|
+
|
|
2523
|
+
if ticker is not None:
|
|
2524
|
+
|
|
2525
|
+
_query_params.append(('ticker', ticker))
|
|
2526
|
+
|
|
2527
|
+
if min_ts is not None:
|
|
2528
|
+
|
|
2529
|
+
_query_params.append(('min_ts', min_ts))
|
|
2530
|
+
|
|
2531
|
+
if max_ts is not None:
|
|
2532
|
+
|
|
2533
|
+
_query_params.append(('max_ts', max_ts))
|
|
2534
|
+
|
|
2535
|
+
# process the header parameters
|
|
2536
|
+
# process the form parameters
|
|
2537
|
+
# process the body parameter
|
|
2538
|
+
|
|
2539
|
+
|
|
2540
|
+
# set the HTTP header `Accept`
|
|
2541
|
+
if 'Accept' not in _header_params:
|
|
2542
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
2543
|
+
[
|
|
2544
|
+
'application/json'
|
|
2545
|
+
]
|
|
2546
|
+
)
|
|
2547
|
+
|
|
2548
|
+
|
|
2549
|
+
# authentication setting
|
|
2550
|
+
_auth_settings: List[str] = [
|
|
2551
|
+
]
|
|
2552
|
+
|
|
2553
|
+
return self.api_client.param_serialize(
|
|
2554
|
+
method='GET',
|
|
2555
|
+
resource_path='/markets/trades',
|
|
2556
|
+
path_params=_path_params,
|
|
2557
|
+
query_params=_query_params,
|
|
2558
|
+
header_params=_header_params,
|
|
2559
|
+
body=_body_params,
|
|
2560
|
+
post_params=_form_params,
|
|
2561
|
+
files=_files,
|
|
2562
|
+
auth_settings=_auth_settings,
|
|
2563
|
+
collection_formats=_collection_formats,
|
|
2564
|
+
_host=_host,
|
|
2565
|
+
_request_auth=_request_auth
|
|
2566
|
+
)
|
|
2567
|
+
|
|
2568
|
+
|