diff --git a/config.yaml b/config.yaml index 68cfadb..9581407 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -disallowAdditionalPropertiesIfNotPresent: true +disallowAdditionalPropertiesIfNotPresent: false library: asyncio packageName: lighter-sdk projectName: lighter-sdk diff --git a/lighter/__init__.py b/lighter/__init__.py index c6e4487..0195a09 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -44,6 +44,7 @@ from lighter.models.account_pn_l import AccountPnL from lighter.models.account_position import AccountPosition from lighter.models.account_stats import AccountStats +from lighter.models.account_trade_stats import AccountTradeStats from lighter.models.accounts import Accounts from lighter.models.api_key import ApiKey from lighter.models.block import Block @@ -64,7 +65,6 @@ from lighter.models.fee_bucket import FeeBucket from lighter.models.funding import Funding from lighter.models.fundings import Fundings -from lighter.models.is_whitelisted import IsWhitelisted from lighter.models.l1_provider_info import L1ProviderInfo from lighter.models.layer2_basic_info import Layer2BasicInfo from lighter.models.liquidation import Liquidation @@ -111,14 +111,11 @@ from lighter.models.req_get_public_pools import ReqGetPublicPools from lighter.models.req_get_range_with_cursor import ReqGetRangeWithCursor from lighter.models.req_get_range_with_index import ReqGetRangeWithIndex -from lighter.models.req_get_range_with_index_sortable import ( - ReqGetRangeWithIndexSortable, -) +from lighter.models.req_get_range_with_index_sortable import ReqGetRangeWithIndexSortable from lighter.models.req_get_recent_trades import ReqGetRecentTrades from lighter.models.req_get_trades import ReqGetTrades from lighter.models.req_get_tx import ReqGetTx from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory -from lighter.models.req_is_whitelisted import ReqIsWhitelisted from lighter.models.result_code import ResultCode from lighter.models.simple_order import SimpleOrder from lighter.models.status import Status @@ -132,7 +129,6 @@ from lighter.models.txs import Txs from lighter.models.validator_info import ValidatorInfo from lighter.models.withdraw_history import WithdrawHistory -from lighter.models.withdraw_history_cursor import WithdrawHistoryCursor from lighter.models.withdraw_history_item import WithdrawHistoryItem from lighter.models.zk_lighter_info import ZkLighterInfo diff --git a/lighter/api/account_api.py b/lighter/api/account_api.py index fac7c8e..aece5b2 100644 --- a/lighter/api/account_api.py +++ b/lighter/api/account_api.py @@ -24,7 +24,6 @@ from lighter.models.accounts import Accounts from lighter.models.detailed_accounts import DetailedAccounts from lighter.models.fee_bucket import FeeBucket -from lighter.models.is_whitelisted import IsWhitelisted from lighter.models.public_pools import PublicPools from lighter.models.sub_accounts import SubAccounts @@ -906,7 +905,7 @@ async def apikeys( ) -> AccountApiKeys: """apikeys - Get account api key + Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account. :param account_index: (required) :type account_index: int @@ -978,7 +977,7 @@ async def apikeys_with_http_info( ) -> ApiResponse[AccountApiKeys]: """apikeys - Get account api key + Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account. :param account_index: (required) :type account_index: int @@ -1050,7 +1049,7 @@ async def apikeys_without_preload_content( ) -> RESTResponseType: """apikeys - Get account api key + Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account. :param account_index: (required) :type account_index: int @@ -1429,269 +1428,6 @@ def _fee_bucket_serialize( - @validate_call - async def is_whitelisted( - self, - l1_address: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> IsWhitelisted: - """isWhitelisted - - Get is account whitelisted - - :param l1_address: (required) - :type l1_address: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._is_whitelisted_serialize( - l1_address=l1_address, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "IsWhitelisted", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - async def is_whitelisted_with_http_info( - self, - l1_address: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[IsWhitelisted]: - """isWhitelisted - - Get is account whitelisted - - :param l1_address: (required) - :type l1_address: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._is_whitelisted_serialize( - l1_address=l1_address, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "IsWhitelisted", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - async def is_whitelisted_without_preload_content( - self, - l1_address: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """isWhitelisted - - Get is account whitelisted - - :param l1_address: (required) - :type l1_address: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._is_whitelisted_serialize( - l1_address=l1_address, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "IsWhitelisted", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _is_whitelisted_serialize( - self, - l1_address, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if l1_address is not None: - - _query_params.append(('l1_address', l1_address)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/isWhitelisted', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - @validate_call async def pnl( self, diff --git a/lighter/api/info_api.py b/lighter/api/info_api.py index 2eb2e9e..ad75eb5 100644 --- a/lighter/api/info_api.py +++ b/lighter/api/info_api.py @@ -54,7 +54,7 @@ async def layer2_basic_info( ) -> Layer2BasicInfo: """layer2BasicInfo - Get zklighter general info, including contract address, and count of transactions and active users + Get zklighter general info, including transaction and block stats :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -118,7 +118,7 @@ async def layer2_basic_info_with_http_info( ) -> ApiResponse[Layer2BasicInfo]: """layer2BasicInfo - Get zklighter general info, including contract address, and count of transactions and active users + Get zklighter general info, including transaction and block stats :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -182,7 +182,7 @@ async def layer2_basic_info_without_preload_content( ) -> RESTResponseType: """layer2BasicInfo - Get zklighter general info, including contract address, and count of transactions and active users + Get zklighter general info, including transaction and block stats :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/lighter/api/order_api.py b/lighter/api/order_api.py index 9708aad..dc9579c 100644 --- a/lighter/api/order_api.py +++ b/lighter/api/order_api.py @@ -65,7 +65,7 @@ async def account_active_orders( ) -> Orders: """accountActiveOrders - Get account active orders + Get account active orders. `auth` can be generated using the SDK. :param account_index: (required) :type account_index: int @@ -141,7 +141,7 @@ async def account_active_orders_with_http_info( ) -> ApiResponse[Orders]: """accountActiveOrders - Get account active orders + Get account active orders. `auth` can be generated using the SDK. :param account_index: (required) :type account_index: int @@ -217,7 +217,7 @@ async def account_active_orders_without_preload_content( ) -> RESTResponseType: """accountActiveOrders - Get account active orders + Get account active orders. `auth` can be generated using the SDK. :param account_index: (required) :type account_index: int @@ -365,7 +365,7 @@ async def account_inactive_orders( ) -> Orders: """accountInactiveOrders - Get account active orders + Get account inactive orders :param account_index: (required) :type account_index: int @@ -453,7 +453,7 @@ async def account_inactive_orders_with_http_info( ) -> ApiResponse[Orders]: """accountInactiveOrders - Get account active orders + Get account inactive orders :param account_index: (required) :type account_index: int @@ -541,7 +541,7 @@ async def account_inactive_orders_without_preload_content( ) -> RESTResponseType: """accountInactiveOrders - Get account active orders + Get account inactive orders :param account_index: (required) :type account_index: int diff --git a/lighter/api/transaction_api.py b/lighter/api/transaction_api.py index a101d6a..3e0f526 100644 --- a/lighter/api/transaction_api.py +++ b/lighter/api/transaction_api.py @@ -46,10 +46,12 @@ def __init__(self, api_client=None) -> None: @validate_call - async def account_pending_txs( + async def account_txs( self, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], by: StrictStr, value: StrictStr, + index: Optional[StrictInt] = None, types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, @@ -64,14 +66,18 @@ async def account_pending_txs( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Txs: - """accountPendingTxs + """accountTxs - Get pending transactions of a specific account + Get transactions of a specific account + :param limit: (required) + :type limit: int :param by: (required) :type by: str :param value: (required) :type value: str + :param index: + :type index: int :param types: :type types: List[int] :param _request_timeout: timeout setting for this request. If one @@ -96,9 +102,11 @@ async def account_pending_txs( :return: Returns the result object. """ # noqa: E501 - _param = self._account_pending_txs_serialize( + _param = self._account_txs_serialize( + limit=limit, by=by, value=value, + index=index, types=types, _request_auth=_request_auth, _content_type=_content_type, @@ -122,10 +130,12 @@ async def account_pending_txs( @validate_call - async def account_pending_txs_with_http_info( + async def account_txs_with_http_info( self, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], by: StrictStr, value: StrictStr, + index: Optional[StrictInt] = None, types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, @@ -140,14 +150,18 @@ async def account_pending_txs_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Txs]: - """accountPendingTxs + """accountTxs - Get pending transactions of a specific account + Get transactions of a specific account + :param limit: (required) + :type limit: int :param by: (required) :type by: str :param value: (required) :type value: str + :param index: + :type index: int :param types: :type types: List[int] :param _request_timeout: timeout setting for this request. If one @@ -172,9 +186,11 @@ async def account_pending_txs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._account_pending_txs_serialize( + _param = self._account_txs_serialize( + limit=limit, by=by, value=value, + index=index, types=types, _request_auth=_request_auth, _content_type=_content_type, @@ -198,10 +214,12 @@ async def account_pending_txs_with_http_info( @validate_call - async def account_pending_txs_without_preload_content( + async def account_txs_without_preload_content( self, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], by: StrictStr, value: StrictStr, + index: Optional[StrictInt] = None, types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, @@ -216,14 +234,18 @@ async def account_pending_txs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """accountPendingTxs + """accountTxs - Get pending transactions of a specific account + Get transactions of a specific account + :param limit: (required) + :type limit: int :param by: (required) :type by: str :param value: (required) :type value: str + :param index: + :type index: int :param types: :type types: List[int] :param _request_timeout: timeout setting for this request. If one @@ -248,9 +270,11 @@ async def account_pending_txs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._account_pending_txs_serialize( + _param = self._account_txs_serialize( + limit=limit, by=by, value=value, + index=index, types=types, _request_auth=_request_auth, _content_type=_content_type, @@ -269,10 +293,12 @@ async def account_pending_txs_without_preload_content( return response_data.response - def _account_pending_txs_serialize( + def _account_txs_serialize( self, + limit, by, value, + index, types, _request_auth, _content_type, @@ -295,6 +321,14 @@ def _account_pending_txs_serialize( # process the path parameters # process the query parameters + if index is not None: + + _query_params.append(('index', index)) + + if limit is not None: + + _query_params.append(('limit', limit)) + if by is not None: _query_params.append(('by', by)) @@ -327,7 +361,7 @@ def _account_pending_txs_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/accountPendingTxs', + resource_path='/api/v1/accountTxs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -344,13 +378,10 @@ def _account_pending_txs_serialize( @validate_call - async def account_txs( + async def block_txs( self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], by: StrictStr, value: StrictStr, - index: Optional[StrictInt] = None, - types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -364,20 +395,14 @@ async def account_txs( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> Txs: - """accountTxs + """blockTxs - Get transactions of a specific account + Get transactions in a block - :param limit: (required) - :type limit: int :param by: (required) :type by: str :param value: (required) :type value: str - :param index: - :type index: int - :param types: - :type types: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -400,12 +425,9 @@ async def account_txs( :return: Returns the result object. """ # noqa: E501 - _param = self._account_txs_serialize( - limit=limit, + _param = self._block_txs_serialize( by=by, value=value, - index=index, - types=types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -428,13 +450,10 @@ async def account_txs( @validate_call - async def account_txs_with_http_info( + async def block_txs_with_http_info( self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], by: StrictStr, value: StrictStr, - index: Optional[StrictInt] = None, - types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -448,20 +467,14 @@ async def account_txs_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[Txs]: - """accountTxs + """blockTxs - Get transactions of a specific account + Get transactions in a block - :param limit: (required) - :type limit: int :param by: (required) :type by: str :param value: (required) :type value: str - :param index: - :type index: int - :param types: - :type types: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -484,12 +497,9 @@ async def account_txs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._account_txs_serialize( - limit=limit, + _param = self._block_txs_serialize( by=by, value=value, - index=index, - types=types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -512,13 +522,10 @@ async def account_txs_with_http_info( @validate_call - async def account_txs_without_preload_content( + async def block_txs_without_preload_content( self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], by: StrictStr, value: StrictStr, - index: Optional[StrictInt] = None, - types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -532,20 +539,14 @@ async def account_txs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """accountTxs + """blockTxs - Get transactions of a specific account + Get transactions in a block - :param limit: (required) - :type limit: int :param by: (required) :type by: str :param value: (required) :type value: str - :param index: - :type index: int - :param types: - :type types: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -568,12 +569,9 @@ async def account_txs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._account_txs_serialize( - limit=limit, + _param = self._block_txs_serialize( by=by, value=value, - index=index, - types=types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -591,13 +589,10 @@ async def account_txs_without_preload_content( return response_data.response - def _account_txs_serialize( + def _block_txs_serialize( self, - limit, by, value, - index, - types, _request_auth, _content_type, _headers, @@ -607,7 +602,6 @@ def _account_txs_serialize( _host = None _collection_formats: Dict[str, str] = { - 'types': 'csv', } _path_params: Dict[str, str] = {} @@ -619,14 +613,6 @@ def _account_txs_serialize( # process the path parameters # process the query parameters - if index is not None: - - _query_params.append(('index', index)) - - if limit is not None: - - _query_params.append(('limit', limit)) - if by is not None: _query_params.append(('by', by)) @@ -635,10 +621,6 @@ def _account_txs_serialize( _query_params.append(('value', value)) - if types is not None: - - _query_params.append(('types', types)) - # process the header parameters # process the form parameters # process the body parameter @@ -659,7 +641,7 @@ def _account_txs_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/accountTxs', + resource_path='/api/v1/blockTxs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -676,10 +658,11 @@ def _account_txs_serialize( @validate_call - async def block_txs( + async def deposit_history( self, - by: StrictStr, - value: StrictStr, + l1_address: StrictStr, + cursor: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -692,15 +675,17 @@ async def block_txs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Txs: - """blockTxs + ) -> DepositHistory: + """deposit_history - Get transactions in a block + Get deposit history - :param by: (required) - :type by: str - :param value: (required) - :type value: str + :param l1_address: (required) + :type l1_address: str + :param cursor: + :type cursor: str + :param filter: + :type filter: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -723,9 +708,10 @@ async def block_txs( :return: Returns the result object. """ # noqa: E501 - _param = self._block_txs_serialize( - by=by, - value=value, + _param = self._deposit_history_serialize( + l1_address=l1_address, + cursor=cursor, + filter=filter, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -733,7 +719,7 @@ async def block_txs( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Txs", + '200': "DepositHistory", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -748,10 +734,11 @@ async def block_txs( @validate_call - async def block_txs_with_http_info( + async def deposit_history_with_http_info( self, - by: StrictStr, - value: StrictStr, + l1_address: StrictStr, + cursor: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -764,15 +751,17 @@ async def block_txs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Txs]: - """blockTxs + ) -> ApiResponse[DepositHistory]: + """deposit_history - Get transactions in a block + Get deposit history - :param by: (required) - :type by: str - :param value: (required) - :type value: str + :param l1_address: (required) + :type l1_address: str + :param cursor: + :type cursor: str + :param filter: + :type filter: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -795,9 +784,10 @@ async def block_txs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._block_txs_serialize( - by=by, - value=value, + _param = self._deposit_history_serialize( + l1_address=l1_address, + cursor=cursor, + filter=filter, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -805,7 +795,7 @@ async def block_txs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Txs", + '200': "DepositHistory", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -820,10 +810,11 @@ async def block_txs_with_http_info( @validate_call - async def block_txs_without_preload_content( + async def deposit_history_without_preload_content( self, - by: StrictStr, - value: StrictStr, + l1_address: StrictStr, + cursor: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -837,14 +828,16 @@ async def block_txs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """blockTxs + """deposit_history - Get transactions in a block + Get deposit history - :param by: (required) - :type by: str - :param value: (required) - :type value: str + :param l1_address: (required) + :type l1_address: str + :param cursor: + :type cursor: str + :param filter: + :type filter: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -867,9 +860,10 @@ async def block_txs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._block_txs_serialize( - by=by, - value=value, + _param = self._deposit_history_serialize( + l1_address=l1_address, + cursor=cursor, + filter=filter, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -877,7 +871,7 @@ async def block_txs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Txs", + '200': "DepositHistory", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -887,10 +881,11 @@ async def block_txs_without_preload_content( return response_data.response - def _block_txs_serialize( + def _deposit_history_serialize( self, - by, - value, + l1_address, + cursor, + filter, _request_auth, _content_type, _headers, @@ -911,13 +906,17 @@ def _block_txs_serialize( # process the path parameters # process the query parameters - if by is not None: + if l1_address is not None: - _query_params.append(('by', by)) + _query_params.append(('l1_address', l1_address)) - if value is not None: + if cursor is not None: - _query_params.append(('value', value)) + _query_params.append(('cursor', cursor)) + + if filter is not None: + + _query_params.append(('filter', filter)) # process the header parameters # process the form parameters @@ -939,7 +938,7 @@ def _block_txs_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/blockTxs', + resource_path='/api/v1/deposit/history', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -956,11 +955,10 @@ def _block_txs_serialize( @validate_call - async def deposit_history( + async def next_nonce( self, - l1_address: StrictStr, - cursor: Optional[StrictStr] = None, - filter: Optional[StrictStr] = None, + account_index: StrictInt, + api_key_index: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -973,378 +971,10 @@ async def deposit_history( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DepositHistory: - """deposit_history + ) -> NextNonce: + """nextNonce - Get deposit history - - :param l1_address: (required) - :type l1_address: str - :param cursor: - :type cursor: str - :param filter: - :type filter: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deposit_history_serialize( - l1_address=l1_address, - cursor=cursor, - filter=filter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DepositHistory", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - async def deposit_history_with_http_info( - self, - l1_address: StrictStr, - cursor: Optional[StrictStr] = None, - filter: Optional[StrictStr] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DepositHistory]: - """deposit_history - - Get deposit history - - :param l1_address: (required) - :type l1_address: str - :param cursor: - :type cursor: str - :param filter: - :type filter: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deposit_history_serialize( - l1_address=l1_address, - cursor=cursor, - filter=filter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DepositHistory", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - async def deposit_history_without_preload_content( - self, - l1_address: StrictStr, - cursor: Optional[StrictStr] = None, - filter: Optional[StrictStr] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """deposit_history - - Get deposit history - - :param l1_address: (required) - :type l1_address: str - :param cursor: - :type cursor: str - :param filter: - :type filter: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deposit_history_serialize( - l1_address=l1_address, - cursor=cursor, - filter=filter, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DepositHistory", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _deposit_history_serialize( - self, - l1_address, - cursor, - filter, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if l1_address is not None: - - _query_params.append(('l1_address', l1_address)) - - if cursor is not None: - - _query_params.append(('cursor', cursor)) - - if filter is not None: - - _query_params.append(('filter', filter)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/deposit/history', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - async def next_nonce( - self, - account_index: StrictInt, - api_key_index: StrictInt, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NextNonce: - """nextNonce - - Get next nonce for a specific account - - :param account_index: (required) - :type account_index: int - :param api_key_index: (required) - :type api_key_index: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._next_nonce_serialize( - account_index=account_index, - api_key_index=api_key_index, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "NextNonce", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - async def next_nonce_with_http_info( - self, - account_index: StrictInt, - api_key_index: StrictInt, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NextNonce]: - """nextNonce - - Get next nonce for a specific account + Get next nonce for a specific account and api key :param account_index: (required) :type account_index: int @@ -1393,11 +1023,11 @@ async def next_nonce_with_http_info( return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, - ) + ).data @validate_call - async def next_nonce_without_preload_content( + async def next_nonce_with_http_info( self, account_index: StrictInt, api_key_index: StrictInt, @@ -1413,10 +1043,10 @@ async def next_nonce_without_preload_content( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: + ) -> ApiResponse[NextNonce]: """nextNonce - Get next nonce for a specific account + Get next nonce for a specific account and api key :param account_index: (required) :type account_index: int @@ -1461,214 +1091,6 @@ async def next_nonce_without_preload_content( *_param, _request_timeout=_request_timeout ) - return response_data.response - - - def _next_nonce_serialize( - self, - account_index, - api_key_index, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if account_index is not None: - - _query_params.append(('account_index', account_index)) - - if api_key_index is not None: - - _query_params.append(('api_key_index', api_key_index)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/nextNonce', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - async def pending_txs( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - index: Optional[StrictInt] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Txs: - """pendingTxs - - Get pending transactions - - :param limit: (required) - :type limit: int - :param index: - :type index: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._pending_txs_serialize( - limit=limit, - index=index, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Txs", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - async def pending_txs_with_http_info( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - index: Optional[StrictInt] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Txs]: - """pendingTxs - - Get pending transactions - - :param limit: (required) - :type limit: int - :param index: - :type index: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._pending_txs_serialize( - limit=limit, - index=index, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Txs", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) await response_data.read() return self.api_client.response_deserialize( response_data=response_data, @@ -1677,10 +1099,10 @@ async def pending_txs_with_http_info( @validate_call - async def pending_txs_without_preload_content( + async def next_nonce_without_preload_content( self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - index: Optional[StrictInt] = None, + account_index: StrictInt, + api_key_index: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1694,14 +1116,14 @@ async def pending_txs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """pendingTxs + """nextNonce - Get pending transactions + Get next nonce for a specific account and api key - :param limit: (required) - :type limit: int - :param index: - :type index: int + :param account_index: (required) + :type account_index: int + :param api_key_index: (required) + :type api_key_index: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1724,9 +1146,9 @@ async def pending_txs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._pending_txs_serialize( - limit=limit, - index=index, + _param = self._next_nonce_serialize( + account_index=account_index, + api_key_index=api_key_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1734,7 +1156,7 @@ async def pending_txs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Txs", + '200': "NextNonce", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1744,10 +1166,10 @@ async def pending_txs_without_preload_content( return response_data.response - def _pending_txs_serialize( + def _next_nonce_serialize( self, - limit, - index, + account_index, + api_key_index, _request_auth, _content_type, _headers, @@ -1768,13 +1190,13 @@ def _pending_txs_serialize( # process the path parameters # process the query parameters - if index is not None: + if account_index is not None: - _query_params.append(('index', index)) + _query_params.append(('account_index', account_index)) - if limit is not None: + if api_key_index is not None: - _query_params.append(('limit', limit)) + _query_params.append(('api_key_index', api_key_index)) # process the header parameters # process the form parameters @@ -1796,7 +1218,7 @@ def _pending_txs_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/pendingTxs', + resource_path='/api/v1/nextNonce', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index ad741d3..1a5bc23 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -21,6 +21,7 @@ from lighter.models.account_pn_l import AccountPnL from lighter.models.account_position import AccountPosition from lighter.models.account_stats import AccountStats +from lighter.models.account_trade_stats import AccountTradeStats from lighter.models.accounts import Accounts from lighter.models.api_key import ApiKey from lighter.models.block import Block @@ -41,7 +42,6 @@ from lighter.models.fee_bucket import FeeBucket from lighter.models.funding import Funding from lighter.models.fundings import Fundings -from lighter.models.is_whitelisted import IsWhitelisted from lighter.models.l1_provider_info import L1ProviderInfo from lighter.models.layer2_basic_info import Layer2BasicInfo from lighter.models.liquidation import Liquidation @@ -93,7 +93,6 @@ from lighter.models.req_get_trades import ReqGetTrades from lighter.models.req_get_tx import ReqGetTx from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory -from lighter.models.req_is_whitelisted import ReqIsWhitelisted from lighter.models.result_code import ResultCode from lighter.models.simple_order import SimpleOrder from lighter.models.status import Status @@ -107,6 +106,5 @@ from lighter.models.txs import Txs from lighter.models.validator_info import ValidatorInfo from lighter.models.withdraw_history import WithdrawHistory -from lighter.models.withdraw_history_cursor import WithdrawHistoryCursor from lighter.models.withdraw_history_item import WithdrawHistoryItem from lighter.models.zk_lighter_info import ZkLighterInfo diff --git a/lighter/models/account.py b/lighter/models/account.py index 83729cf..93247c0 100644 --- a/lighter/models/account.py +++ b/lighter/models/account.py @@ -36,6 +36,7 @@ class Account(BaseModel): pending_order_count: StrictInt status: StrictInt collateral: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral"] model_config = ConfigDict( @@ -68,8 +69,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -77,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -88,11 +96,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Account) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), @@ -105,6 +108,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "status": obj.get("status"), "collateral": obj.get("collateral") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/account_api_keys.py b/lighter/models/account_api_keys.py index aa3c240..da1e42c 100644 --- a/lighter/models/account_api_keys.py +++ b/lighter/models/account_api_keys.py @@ -30,6 +30,7 @@ class AccountApiKeys(BaseModel): code: StrictInt message: Optional[StrictStr] = None api_keys: List[ApiKey] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "api_keys"] model_config = ConfigDict( @@ -62,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -78,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['api_keys'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -89,16 +97,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in AccountApiKeys) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "api_keys": [ApiKey.from_dict(_item) for _item in obj["api_keys"]] if obj.get("api_keys") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/account_market_stats.py b/lighter/models/account_market_stats.py index 27e5b2a..ea24c4b 100644 --- a/lighter/models/account_market_stats.py +++ b/lighter/models/account_market_stats.py @@ -30,7 +30,11 @@ class AccountMarketStats(BaseModel): daily_trades_count: StrictInt daily_base_token_volume: Union[StrictFloat, StrictInt] daily_quote_token_volume: Union[StrictFloat, StrictInt] - __properties: ClassVar[List[str]] = ["market_id", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume"] + total_trades_count: StrictInt + total_base_token_volume: Union[StrictFloat, StrictInt] + total_quote_token_volume: Union[StrictFloat, StrictInt] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["market_id", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "total_trades_count", "total_base_token_volume", "total_quote_token_volume"] model_config = ConfigDict( populate_by_name=True, @@ -62,8 +66,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +77,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -82,17 +93,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in AccountMarketStats) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id"), "daily_trades_count": obj.get("daily_trades_count"), "daily_base_token_volume": obj.get("daily_base_token_volume"), - "daily_quote_token_volume": obj.get("daily_quote_token_volume") + "daily_quote_token_volume": obj.get("daily_quote_token_volume"), + "total_trades_count": obj.get("total_trades_count"), + "total_base_token_volume": obj.get("total_base_token_volume"), + "total_quote_token_volume": obj.get("total_quote_token_volume") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/account_metadata.py b/lighter/models/account_metadata.py index 8a3f5d0..1b68877 100644 --- a/lighter/models/account_metadata.py +++ b/lighter/models/account_metadata.py @@ -28,6 +28,7 @@ class AccountMetadata(BaseModel): """ # noqa: E501 name: StrictStr description: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["name", "description"] model_config = ConfigDict( @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -80,15 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in AccountMetadata) in the input: " + _key) - _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/account_pn_l.py b/lighter/models/account_pn_l.py index 20d4016..9196cf0 100644 --- a/lighter/models/account_pn_l.py +++ b/lighter/models/account_pn_l.py @@ -31,6 +31,7 @@ class AccountPnL(BaseModel): message: Optional[StrictStr] = None resolution: StrictStr pnl: List[PnLEntry] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "resolution", "pnl"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['pnl'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in AccountPnL) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "resolution": obj.get("resolution"), "pnl": [PnLEntry.from_dict(_item) for _item in obj["pnl"]] if obj.get("pnl") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/account_position.py b/lighter/models/account_position.py index 1344b93..3bc6b28 100644 --- a/lighter/models/account_position.py +++ b/lighter/models/account_position.py @@ -37,6 +37,7 @@ class AccountPosition(BaseModel): position_value: StrictStr unrealized_pnl: StrictStr realized_pnl: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id", "symbol", "initial_margin_fraction", "open_order_count", "pending_order_count", "sign", "position", "avg_entry_price", "position_value", "unrealized_pnl", "realized_pnl"] model_config = ConfigDict( @@ -69,8 +70,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -78,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -89,11 +97,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in AccountPosition) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id"), "symbol": obj.get("symbol"), @@ -107,6 +110,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "unrealized_pnl": obj.get("unrealized_pnl"), "realized_pnl": obj.get("realized_pnl") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/account_stats.py b/lighter/models/account_stats.py index 8e36ecb..85e14c2 100644 --- a/lighter/models/account_stats.py +++ b/lighter/models/account_stats.py @@ -32,6 +32,7 @@ class AccountStats(BaseModel): available_balance: StrictStr margin_usage: StrictStr buying_power: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["collateral", "portfolio_value", "leverage", "available_balance", "margin_usage", "buying_power"] model_config = ConfigDict( @@ -64,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -73,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -84,11 +92,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in AccountStats) in the input: " + _key) - _obj = cls.model_validate({ "collateral": obj.get("collateral"), "portfolio_value": obj.get("portfolio_value"), @@ -97,6 +100,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "margin_usage": obj.get("margin_usage"), "buying_power": obj.get("buying_power") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_is_whitelisted.py b/lighter/models/account_trade_stats.py similarity index 61% rename from lighter/models/req_is_whitelisted.py rename to lighter/models/account_trade_stats.py index 85f0e36..9ea3bdb 100644 --- a/lighter/models/req_is_whitelisted.py +++ b/lighter/models/account_trade_stats.py @@ -17,17 +17,21 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self -class ReqIsWhitelisted(BaseModel): +class AccountTradeStats(BaseModel): """ - ReqIsWhitelisted + AccountTradeStats """ # noqa: E501 - l1_address: StrictStr - __properties: ClassVar[List[str]] = ["l1_address"] + total_trades_count: StrictInt + total_volume: Union[StrictFloat, StrictInt] + daily_trades_count: StrictInt + daily_volume: Union[StrictFloat, StrictInt] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total_trades_count", "total_volume", "daily_trades_count", "daily_volume"] model_config = ConfigDict( populate_by_name=True, @@ -47,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqIsWhitelisted from a JSON string""" + """Create an instance of AccountTradeStats from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -59,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -68,25 +74,33 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqIsWhitelisted from a dict""" + """Create an instance of AccountTradeStats from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input + _obj = cls.model_validate({ + "total_trades_count": obj.get("total_trades_count"), + "total_volume": obj.get("total_volume"), + "daily_trades_count": obj.get("daily_trades_count"), + "daily_volume": obj.get("daily_volume") + }) + # store additional fields in additional_properties for _key in obj.keys(): if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqIsWhitelisted) in the input: " + _key) + _obj.additional_properties[_key] = obj.get(_key) - _obj = cls.model_validate({ - "l1_address": obj.get("l1_address") - }) return _obj diff --git a/lighter/models/accounts.py b/lighter/models/accounts.py index d9e84da..c3b2e2c 100644 --- a/lighter/models/accounts.py +++ b/lighter/models/accounts.py @@ -31,6 +31,7 @@ class Accounts(BaseModel): message: Optional[StrictStr] = None total: StrictInt accounts: List[Account] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "total", "accounts"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['accounts'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Accounts) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "total": obj.get("total"), "accounts": [Account.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/api_key.py b/lighter/models/api_key.py index b127519..f02af99 100644 --- a/lighter/models/api_key.py +++ b/lighter/models/api_key.py @@ -30,6 +30,7 @@ class ApiKey(BaseModel): api_key_index: StrictInt nonce: StrictInt public_key: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["account_index", "api_key_index", "nonce", "public_key"] model_config = ConfigDict( @@ -62,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -82,17 +90,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ApiKey) in the input: " + _key) - _obj = cls.model_validate({ "account_index": obj.get("account_index"), "api_key_index": obj.get("api_key_index"), "nonce": obj.get("nonce"), "public_key": obj.get("public_key") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/block.py b/lighter/models/block.py index 148e6c9..7e550d7 100644 --- a/lighter/models/block.py +++ b/lighter/models/block.py @@ -40,6 +40,7 @@ class Block(BaseModel): txs: List[Tx] status: StrictInt size: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["commitment", "height", "state_root", "priority_operations", "on_chain_l2_operations", "pending_on_chain_operations_pub_data", "committed_tx_hash", "committed_at", "verified_tx_hash", "verified_at", "txs", "status", "size"] model_config = ConfigDict( @@ -72,8 +73,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -88,6 +91,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['txs'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -99,11 +107,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Block) in the input: " + _key) - _obj = cls.model_validate({ "commitment": obj.get("commitment"), "height": obj.get("height"), @@ -119,6 +122,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "status": obj.get("status"), "size": obj.get("size") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/blocks.py b/lighter/models/blocks.py index e3fab9d..2591f16 100644 --- a/lighter/models/blocks.py +++ b/lighter/models/blocks.py @@ -31,6 +31,7 @@ class Blocks(BaseModel): message: Optional[StrictStr] = None total: StrictInt blocks: List[Block] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "total", "blocks"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['blocks'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Blocks) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "total": obj.get("total"), "blocks": [Block.from_dict(_item) for _item in obj["blocks"]] if obj.get("blocks") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/bridge_supported_network.py b/lighter/models/bridge_supported_network.py index a3b414a..4e3533a 100644 --- a/lighter/models/bridge_supported_network.py +++ b/lighter/models/bridge_supported_network.py @@ -29,6 +29,7 @@ class BridgeSupportedNetwork(BaseModel): name: StrictStr chain_id: StrictStr explorer: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["name", "chain_id", "explorer"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,16 +89,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in BridgeSupportedNetwork) in the input: " + _key) - _obj = cls.model_validate({ "name": obj.get("name"), "chain_id": obj.get("chain_id"), "explorer": obj.get("explorer") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/candlestick.py b/lighter/models/candlestick.py index 335428e..ea9d42e 100644 --- a/lighter/models/candlestick.py +++ b/lighter/models/candlestick.py @@ -34,6 +34,7 @@ class Candlestick(BaseModel): volume0: Union[StrictFloat, StrictInt] volume1: Union[StrictFloat, StrictInt] last_trade_id: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["timestamp", "open", "high", "low", "close", "volume0", "volume1", "last_trade_id"] model_config = ConfigDict( @@ -66,8 +67,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -75,6 +78,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -86,11 +94,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Candlestick) in the input: " + _key) - _obj = cls.model_validate({ "timestamp": obj.get("timestamp"), "open": obj.get("open"), @@ -101,6 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "volume1": obj.get("volume1"), "last_trade_id": obj.get("last_trade_id") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/candlesticks.py b/lighter/models/candlesticks.py index c159dc8..a8184f9 100644 --- a/lighter/models/candlesticks.py +++ b/lighter/models/candlesticks.py @@ -31,6 +31,7 @@ class Candlesticks(BaseModel): message: Optional[StrictStr] = None resolution: StrictStr candlesticks: List[Candlestick] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "resolution", "candlesticks"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['candlesticks'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Candlesticks) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "resolution": obj.get("resolution"), "candlesticks": [Candlestick.from_dict(_item) for _item in obj["candlesticks"]] if obj.get("candlesticks") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/contract_address.py b/lighter/models/contract_address.py index 50a0c23..768652e 100644 --- a/lighter/models/contract_address.py +++ b/lighter/models/contract_address.py @@ -28,6 +28,7 @@ class ContractAddress(BaseModel): """ # noqa: E501 name: StrictStr address: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["name", "address"] model_config = ConfigDict( @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -80,15 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ContractAddress) in the input: " + _key) - _obj = cls.model_validate({ "name": obj.get("name"), "address": obj.get("address") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/current_height.py b/lighter/models/current_height.py index 1b27fd6..5aa2b8f 100644 --- a/lighter/models/current_height.py +++ b/lighter/models/current_height.py @@ -29,6 +29,7 @@ class CurrentHeight(BaseModel): code: StrictInt message: Optional[StrictStr] = None height: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "height"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,16 +89,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in CurrentHeight) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "height": obj.get("height") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/cursor.py b/lighter/models/cursor.py index c9dd178..a1ca1ef 100644 --- a/lighter/models/cursor.py +++ b/lighter/models/cursor.py @@ -27,6 +27,7 @@ class Cursor(BaseModel): Cursor """ # noqa: E501 next_cursor: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["next_cursor"] model_config = ConfigDict( @@ -59,8 +60,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -68,6 +71,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -79,14 +87,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Cursor) in the input: " + _key) - _obj = cls.model_validate({ "next_cursor": obj.get("next_cursor") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/deposit_history.py b/lighter/models/deposit_history.py index a109603..2b2e238 100644 --- a/lighter/models/deposit_history.py +++ b/lighter/models/deposit_history.py @@ -31,6 +31,7 @@ class DepositHistory(BaseModel): message: Optional[StrictStr] = None deposits: List[DepositHistoryItem] cursor: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "deposits", "cursor"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['deposits'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in DepositHistory) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "deposits": [DepositHistoryItem.from_dict(_item) for _item in obj["deposits"]] if obj.get("deposits") is not None else None, "cursor": obj.get("cursor") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/deposit_history_item.py b/lighter/models/deposit_history_item.py index b97ee30..c7a1894 100644 --- a/lighter/models/deposit_history_item.py +++ b/lighter/models/deposit_history_item.py @@ -30,13 +30,15 @@ class DepositHistoryItem(BaseModel): amount: StrictStr timestamp: StrictInt status: StrictStr - __properties: ClassVar[List[str]] = ["id", "amount", "timestamp", "status"] + l1_tx_hash: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "amount", "timestamp", "status", "l1_tx_hash"] @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(['failed', 'pending', 'completed']): - raise ValueError("must be one of enum values ('failed', 'pending', 'completed')") + if value not in set(['failed', 'pending', 'completed', 'claimable']): + raise ValueError("must be one of enum values ('failed', 'pending', 'completed', 'claimable')") return value model_config = ConfigDict( @@ -69,8 +71,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -78,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -89,17 +98,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in DepositHistoryItem) in the input: " + _key) - _obj = cls.model_validate({ "id": obj.get("id"), "amount": obj.get("amount"), "timestamp": obj.get("timestamp"), - "status": obj.get("status") + "status": obj.get("status"), + "l1_tx_hash": obj.get("l1_tx_hash") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/detailed_account.py b/lighter/models/detailed_account.py index ebd441a..b74113c 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -47,6 +47,7 @@ class DetailedAccount(BaseModel): market_stats: List[AccountMarketStats] pool_info: PublicPoolInfo shares: List[PublicPoolShare] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral", "name", "description", "positions", "total_asset_value", "market_stats", "pool_info", "shares"] model_config = ConfigDict( @@ -79,8 +80,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -112,6 +115,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['shares'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -123,11 +131,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in DetailedAccount) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), @@ -147,6 +150,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "pool_info": PublicPoolInfo.from_dict(obj["pool_info"]) if obj.get("pool_info") is not None else None, "shares": [PublicPoolShare.from_dict(_item) for _item in obj["shares"]] if obj.get("shares") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/detailed_accounts.py b/lighter/models/detailed_accounts.py index 28f8f67..50f61e1 100644 --- a/lighter/models/detailed_accounts.py +++ b/lighter/models/detailed_accounts.py @@ -31,6 +31,7 @@ class DetailedAccounts(BaseModel): message: Optional[StrictStr] = None total: StrictInt accounts: List[DetailedAccount] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "total", "accounts"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['accounts'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in DetailedAccounts) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "total": obj.get("total"), "accounts": [DetailedAccount.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/detailed_candlestick.py b/lighter/models/detailed_candlestick.py index b91586d..36a84ca 100644 --- a/lighter/models/detailed_candlestick.py +++ b/lighter/models/detailed_candlestick.py @@ -35,6 +35,7 @@ class DetailedCandlestick(BaseModel): volume1: Union[StrictFloat, StrictInt] last_trade_id: StrictInt trade_count: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["timestamp", "open", "high", "low", "close", "volume0", "volume1", "last_trade_id", "trade_count"] model_config = ConfigDict( @@ -67,8 +68,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -76,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,11 +95,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in DetailedCandlestick) in the input: " + _key) - _obj = cls.model_validate({ "timestamp": obj.get("timestamp"), "open": obj.get("open"), @@ -103,6 +106,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "last_trade_id": obj.get("last_trade_id"), "trade_count": obj.get("trade_count") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/enriched_tx.py b/lighter/models/enriched_tx.py index 887a94a..08567b2 100644 --- a/lighter/models/enriched_tx.py +++ b/lighter/models/enriched_tx.py @@ -46,6 +46,7 @@ class EnrichedTx(BaseModel): parent_hash: StrictStr committed_at: StrictInt verified_at: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "hash", "type", "info", "event_info", "status", "transaction_index", "l1_address", "account_index", "nonce", "expire_at", "block_height", "queued_at", "executed_at", "sequence_index", "parent_hash", "committed_at", "verified_at"] model_config = ConfigDict( @@ -78,8 +79,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -87,6 +90,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -98,11 +106,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in EnrichedTx) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), @@ -124,6 +127,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "committed_at": obj.get("committed_at"), "verified_at": obj.get("verified_at") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/exchange_stats.py b/lighter/models/exchange_stats.py index 903da86..fa276ce 100644 --- a/lighter/models/exchange_stats.py +++ b/lighter/models/exchange_stats.py @@ -33,6 +33,7 @@ class ExchangeStats(BaseModel): order_book_stats: List[OrderBookStats] daily_usd_volume: Union[StrictFloat, StrictInt] daily_trades_count: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "total", "order_book_stats", "daily_usd_volume", "daily_trades_count"] model_config = ConfigDict( @@ -65,8 +66,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -81,6 +84,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['order_book_stats'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -92,11 +100,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ExchangeStats) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), @@ -105,6 +108,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "daily_usd_volume": obj.get("daily_usd_volume"), "daily_trades_count": obj.get("daily_trades_count") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/fee_bucket.py b/lighter/models/fee_bucket.py index ed91f48..3bde87d 100644 --- a/lighter/models/fee_bucket.py +++ b/lighter/models/fee_bucket.py @@ -29,6 +29,7 @@ class FeeBucket(BaseModel): vip_tier: StrictInt taker_fee: StrictInt maker_fee: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["vip_tier", "taker_fee", "maker_fee"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,16 +89,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in FeeBucket) in the input: " + _key) - _obj = cls.model_validate({ "vip_tier": obj.get("vip_tier"), "taker_fee": obj.get("taker_fee"), "maker_fee": obj.get("maker_fee") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/funding.py b/lighter/models/funding.py index 1b30d0b..727be7d 100644 --- a/lighter/models/funding.py +++ b/lighter/models/funding.py @@ -30,6 +30,7 @@ class Funding(BaseModel): value: StrictStr rate: StrictStr direction: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["timestamp", "value", "rate", "direction"] model_config = ConfigDict( @@ -62,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -82,17 +90,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Funding) in the input: " + _key) - _obj = cls.model_validate({ "timestamp": obj.get("timestamp"), "value": obj.get("value"), "rate": obj.get("rate"), "direction": obj.get("direction") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/fundings.py b/lighter/models/fundings.py index 6faaf96..0ace19a 100644 --- a/lighter/models/fundings.py +++ b/lighter/models/fundings.py @@ -31,6 +31,7 @@ class Fundings(BaseModel): message: Optional[StrictStr] = None resolution: StrictStr fundings: List[Funding] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "resolution", "fundings"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['fundings'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Fundings) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "resolution": obj.get("resolution"), "fundings": [Funding.from_dict(_item) for _item in obj["fundings"]] if obj.get("fundings") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/is_whitelisted.py b/lighter/models/is_whitelisted.py deleted file mode 100644 index a7b909d..0000000 --- a/lighter/models/is_whitelisted.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class IsWhitelisted(BaseModel): - """ - IsWhitelisted - """ # noqa: E501 - code: StrictInt - message: Optional[StrictStr] = None - whitelisted: StrictBool - deposit_amount_left: StrictStr - __properties: ClassVar[List[str]] = ["code", "message", "whitelisted", "deposit_amount_left"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IsWhitelisted from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IsWhitelisted from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in IsWhitelisted) in the input: " + _key) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "whitelisted": obj.get("whitelisted"), - "deposit_amount_left": obj.get("deposit_amount_left") - }) - return _obj - - diff --git a/lighter/models/l1_provider_info.py b/lighter/models/l1_provider_info.py index 8777deb..9620bfb 100644 --- a/lighter/models/l1_provider_info.py +++ b/lighter/models/l1_provider_info.py @@ -30,6 +30,7 @@ class L1ProviderInfo(BaseModel): network_id: StrictInt = Field(alias="networkId") latest_block_number: StrictInt = Field(alias="latestBlockNumber") network_rpc: StrictStr = Field(alias="NetworkRpc") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["chainId", "networkId", "latestBlockNumber", "NetworkRpc"] model_config = ConfigDict( @@ -62,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -82,17 +90,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in L1ProviderInfo) in the input: " + _key) - _obj = cls.model_validate({ "chainId": obj.get("chainId"), "networkId": obj.get("networkId"), "latestBlockNumber": obj.get("latestBlockNumber"), "NetworkRpc": obj.get("NetworkRpc") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/layer2_basic_info.py b/lighter/models/layer2_basic_info.py index 6e40da0..c16ca62 100644 --- a/lighter/models/layer2_basic_info.py +++ b/lighter/models/layer2_basic_info.py @@ -31,6 +31,7 @@ class Layer2BasicInfo(BaseModel): block_committed: StrictInt block_verified: StrictInt total_transaction_count: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "block_committed", "block_verified", "total_transaction_count"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,11 +91,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Layer2BasicInfo) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), @@ -95,6 +98,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "block_verified": obj.get("block_verified"), "total_transaction_count": obj.get("total_transaction_count") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/liquidation.py b/lighter/models/liquidation.py index 22c9021..96ed5e2 100644 --- a/lighter/models/liquidation.py +++ b/lighter/models/liquidation.py @@ -31,6 +31,7 @@ class Liquidation(BaseModel): liquidation_type: StrictInt portfolio_value: StrictStr margin_requirement: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["liquidation_id", "account_index", "liquidation_type", "portfolio_value", "margin_requirement"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,11 +91,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Liquidation) in the input: " + _key) - _obj = cls.model_validate({ "liquidation_id": obj.get("liquidation_id"), "account_index": obj.get("account_index"), @@ -95,6 +98,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "portfolio_value": obj.get("portfolio_value"), "margin_requirement": obj.get("margin_requirement") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/market_info.py b/lighter/models/market_info.py index fd6a46c..c836971 100644 --- a/lighter/models/market_info.py +++ b/lighter/models/market_info.py @@ -39,6 +39,7 @@ class MarketInfo(BaseModel): daily_price_low: Union[StrictFloat, StrictInt] daily_price_high: Union[StrictFloat, StrictInt] daily_price_change: Union[StrictFloat, StrictInt] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id", "index_price", "mark_price", "open_interest", "last_trade_price", "current_funding_rate", "funding_rate", "funding_timestamp", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change"] model_config = ConfigDict( @@ -71,8 +72,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -80,6 +83,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -91,11 +99,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in MarketInfo) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id"), "index_price": obj.get("index_price"), @@ -111,6 +114,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "daily_price_high": obj.get("daily_price_high"), "daily_price_change": obj.get("daily_price_change") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/next_nonce.py b/lighter/models/next_nonce.py index 9a849c8..94ab734 100644 --- a/lighter/models/next_nonce.py +++ b/lighter/models/next_nonce.py @@ -29,6 +29,7 @@ class NextNonce(BaseModel): code: StrictInt message: Optional[StrictStr] = None nonce: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "nonce"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,16 +89,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in NextNonce) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "nonce": obj.get("nonce") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/order.py b/lighter/models/order.py index bd45ad7..0b8e187 100644 --- a/lighter/models/order.py +++ b/lighter/models/order.py @@ -50,6 +50,7 @@ class Order(BaseModel): parent_order_index: StrictInt block_height: StrictInt timestamp: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["order_index", "client_order_index", "market_index", "owner_account_index", "initial_base_amount", "price", "nonce", "remaining_base_amount", "is_ask", "base_size", "base_price", "filled_base_amount", "filled_quote_amount", "side", "type", "time_in_force", "reduce_only", "trigger_price", "order_expiry", "status", "trigger_time", "parent_order_index", "block_height", "timestamp"] @field_validator('type') @@ -103,8 +104,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -112,6 +115,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -123,11 +131,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Order) in the input: " + _key) - _obj = cls.model_validate({ "order_index": obj.get("order_index"), "client_order_index": obj.get("client_order_index"), @@ -154,6 +157,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "block_height": obj.get("block_height"), "timestamp": obj.get("timestamp") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/order_book.py b/lighter/models/order_book.py index 849ff5f..40793ef 100644 --- a/lighter/models/order_book.py +++ b/lighter/models/order_book.py @@ -37,6 +37,7 @@ class OrderBook(BaseModel): supported_size_decimals: StrictInt supported_price_decimals: StrictInt supported_quote_decimals: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["symbol", "market_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals"] @field_validator('status') @@ -76,8 +77,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -85,6 +88,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -96,11 +104,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in OrderBook) in the input: " + _key) - _obj = cls.model_validate({ "symbol": obj.get("symbol"), "market_id": obj.get("market_id"), @@ -114,6 +117,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "supported_price_decimals": obj.get("supported_price_decimals"), "supported_quote_decimals": obj.get("supported_quote_decimals") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/order_book_depth.py b/lighter/models/order_book_depth.py index d61583c..214d798 100644 --- a/lighter/models/order_book_depth.py +++ b/lighter/models/order_book_depth.py @@ -32,6 +32,7 @@ class OrderBookDepth(BaseModel): asks: List[PriceLevel] bids: List[PriceLevel] offset: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "asks", "bids", "offset"] model_config = ConfigDict( @@ -64,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -87,6 +90,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['bids'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -98,11 +106,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in OrderBookDepth) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), @@ -110,6 +113,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "bids": [PriceLevel.from_dict(_item) for _item in obj["bids"]] if obj.get("bids") is not None else None, "offset": obj.get("offset") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/order_book_detail.py b/lighter/models/order_book_detail.py index 9a6ae85..0149ee5 100644 --- a/lighter/models/order_book_detail.py +++ b/lighter/models/order_book_detail.py @@ -53,6 +53,7 @@ class OrderBookDetail(BaseModel): daily_price_change: Union[StrictFloat, StrictInt] open_interest: Union[StrictFloat, StrictInt] daily_chart: Dict[str, Union[StrictFloat, StrictInt]] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["symbol", "market_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "size_decimals", "price_decimals", "quote_multiplier", "default_initial_margin_fraction", "min_initial_margin_fraction", "maintenance_margin_fraction", "closeout_margin_fraction", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change", "open_interest", "daily_chart"] @field_validator('status') @@ -92,8 +93,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -101,6 +104,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -112,11 +120,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in OrderBookDetail) in the input: " + _key) - _obj = cls.model_validate({ "symbol": obj.get("symbol"), "market_id": obj.get("market_id"), @@ -146,6 +149,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "open_interest": obj.get("open_interest"), "daily_chart": obj.get("daily_chart") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/order_book_details.py b/lighter/models/order_book_details.py index 34d7d3c..a67276f 100644 --- a/lighter/models/order_book_details.py +++ b/lighter/models/order_book_details.py @@ -30,6 +30,7 @@ class OrderBookDetails(BaseModel): code: StrictInt message: Optional[StrictStr] = None order_book_details: List[OrderBookDetail] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "order_book_details"] model_config = ConfigDict( @@ -62,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -78,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['order_book_details'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -89,16 +97,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in OrderBookDetails) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "order_book_details": [OrderBookDetail.from_dict(_item) for _item in obj["order_book_details"]] if obj.get("order_book_details") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/order_book_orders.py b/lighter/models/order_book_orders.py index 0ba0feb..549d79c 100644 --- a/lighter/models/order_book_orders.py +++ b/lighter/models/order_book_orders.py @@ -33,6 +33,7 @@ class OrderBookOrders(BaseModel): asks: List[SimpleOrder] total_bids: StrictInt bids: List[SimpleOrder] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "total_asks", "asks", "total_bids", "bids"] model_config = ConfigDict( @@ -65,8 +66,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -88,6 +91,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['bids'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -99,11 +107,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in OrderBookOrders) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), @@ -112,6 +115,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total_bids": obj.get("total_bids"), "bids": [SimpleOrder.from_dict(_item) for _item in obj["bids"]] if obj.get("bids") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/order_book_stats.py b/lighter/models/order_book_stats.py index 7c48946..5f09676 100644 --- a/lighter/models/order_book_stats.py +++ b/lighter/models/order_book_stats.py @@ -32,6 +32,7 @@ class OrderBookStats(BaseModel): daily_base_token_volume: Union[StrictFloat, StrictInt] daily_quote_token_volume: Union[StrictFloat, StrictInt] daily_price_change: Union[StrictFloat, StrictInt] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["symbol", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_change"] model_config = ConfigDict( @@ -64,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -73,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -84,11 +92,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in OrderBookStats) in the input: " + _key) - _obj = cls.model_validate({ "symbol": obj.get("symbol"), "last_trade_price": obj.get("last_trade_price"), @@ -97,6 +100,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "daily_quote_token_volume": obj.get("daily_quote_token_volume"), "daily_price_change": obj.get("daily_price_change") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/order_books.py b/lighter/models/order_books.py index a096b2a..f7cc8e8 100644 --- a/lighter/models/order_books.py +++ b/lighter/models/order_books.py @@ -30,6 +30,7 @@ class OrderBooks(BaseModel): code: StrictInt message: Optional[StrictStr] = None order_books: List[OrderBook] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "order_books"] model_config = ConfigDict( @@ -62,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -78,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['order_books'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -89,16 +97,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in OrderBooks) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "order_books": [OrderBook.from_dict(_item) for _item in obj["order_books"]] if obj.get("order_books") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/orders.py b/lighter/models/orders.py index 824f825..b494259 100644 --- a/lighter/models/orders.py +++ b/lighter/models/orders.py @@ -31,6 +31,7 @@ class Orders(BaseModel): message: Optional[StrictStr] = None next_cursor: Optional[StrictStr] = None orders: List[Order] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "next_cursor", "orders"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['orders'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Orders) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "next_cursor": obj.get("next_cursor"), "orders": [Order.from_dict(_item) for _item in obj["orders"]] if obj.get("orders") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/pn_l_entry.py b/lighter/models/pn_l_entry.py index a222d45..1a8e292 100644 --- a/lighter/models/pn_l_entry.py +++ b/lighter/models/pn_l_entry.py @@ -28,6 +28,7 @@ class PnLEntry(BaseModel): """ # noqa: E501 timestamp: StrictInt value: Union[StrictFloat, StrictInt] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["timestamp", "value"] model_config = ConfigDict( @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -80,15 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in PnLEntry) in the input: " + _key) - _obj = cls.model_validate({ "timestamp": obj.get("timestamp"), "value": obj.get("value") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/position_funding.py b/lighter/models/position_funding.py index 414291c..1fee27f 100644 --- a/lighter/models/position_funding.py +++ b/lighter/models/position_funding.py @@ -33,6 +33,7 @@ class PositionFunding(BaseModel): rate: StrictStr position_size: StrictStr position_side: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["timestamp", "market_id", "funding_id", "change", "rate", "position_size", "position_side"] @field_validator('position_side') @@ -72,8 +73,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -81,6 +84,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -92,11 +100,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in PositionFunding) in the input: " + _key) - _obj = cls.model_validate({ "timestamp": obj.get("timestamp"), "market_id": obj.get("market_id"), @@ -106,6 +109,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "position_size": obj.get("position_size"), "position_side": obj.get("position_side") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/price_level.py b/lighter/models/price_level.py index 9addcb6..dc5b081 100644 --- a/lighter/models/price_level.py +++ b/lighter/models/price_level.py @@ -28,6 +28,7 @@ class PriceLevel(BaseModel): """ # noqa: E501 price: StrictStr size: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["price", "size"] model_config = ConfigDict( @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -80,15 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in PriceLevel) in the input: " + _key) - _obj = cls.model_validate({ "price": obj.get("price"), "size": obj.get("size") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/public_pool.py b/lighter/models/public_pool.py index 9476485..210aee3 100644 --- a/lighter/models/public_pool.py +++ b/lighter/models/public_pool.py @@ -43,6 +43,7 @@ class PublicPool(BaseModel): total_asset_value: StrictStr pool_info: PublicPoolInfo account_share: PublicPoolShare + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral", "name", "description", "total_asset_value", "pool_info", "account_share"] model_config = ConfigDict( @@ -75,8 +76,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -90,6 +93,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of account_share if self.account_share: _dict['account_share'] = self.account_share.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -101,11 +109,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in PublicPool) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), @@ -123,6 +126,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "pool_info": PublicPoolInfo.from_dict(obj["pool_info"]) if obj.get("pool_info") is not None else None, "account_share": PublicPoolShare.from_dict(obj["account_share"]) if obj.get("account_share") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/public_pool_info.py b/lighter/models/public_pool_info.py index f04da09..b327707 100644 --- a/lighter/models/public_pool_info.py +++ b/lighter/models/public_pool_info.py @@ -31,6 +31,7 @@ class PublicPoolInfo(BaseModel): min_operator_share_rate: StrictStr total_shares: StrictInt operator_shares: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["status", "operator_fee", "min_operator_share_rate", "total_shares", "operator_shares"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,11 +91,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in PublicPoolInfo) in the input: " + _key) - _obj = cls.model_validate({ "status": obj.get("status"), "operator_fee": obj.get("operator_fee"), @@ -95,6 +98,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total_shares": obj.get("total_shares"), "operator_shares": obj.get("operator_shares") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/public_pool_share.py b/lighter/models/public_pool_share.py index 1714f40..0261075 100644 --- a/lighter/models/public_pool_share.py +++ b/lighter/models/public_pool_share.py @@ -29,6 +29,7 @@ class PublicPoolShare(BaseModel): public_pool_index: StrictInt shares_amount: StrictInt entry_usdc: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["public_pool_index", "shares_amount", "entry_usdc"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,16 +89,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in PublicPoolShare) in the input: " + _key) - _obj = cls.model_validate({ "public_pool_index": obj.get("public_pool_index"), "shares_amount": obj.get("shares_amount"), "entry_usdc": obj.get("entry_usdc") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/public_pools.py b/lighter/models/public_pools.py index 41aa69d..1ad4092 100644 --- a/lighter/models/public_pools.py +++ b/lighter/models/public_pools.py @@ -31,6 +31,7 @@ class PublicPools(BaseModel): message: Optional[StrictStr] = None total: StrictInt public_pools: List[PublicPool] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "total", "public_pools"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['public_pools'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in PublicPools) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "total": obj.get("total"), "public_pools": [PublicPool.from_dict(_item) for _item in obj["public_pools"]] if obj.get("public_pools") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_account.py b/lighter/models/req_get_account.py index 663e1c7..c6108e6 100644 --- a/lighter/models/req_get_account.py +++ b/lighter/models/req_get_account.py @@ -28,6 +28,7 @@ class ReqGetAccount(BaseModel): """ # noqa: E501 by: StrictStr value: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["by", "value"] @field_validator('by') @@ -67,8 +68,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -76,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,15 +95,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetAccount) in the input: " + _key) - _obj = cls.model_validate({ "by": obj.get("by"), "value": obj.get("value") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_account_active_orders.py b/lighter/models/req_get_account_active_orders.py index cf0a2a8..d1193bb 100644 --- a/lighter/models/req_get_account_active_orders.py +++ b/lighter/models/req_get_account_active_orders.py @@ -29,6 +29,7 @@ class ReqGetAccountActiveOrders(BaseModel): account_index: StrictInt market_id: StrictInt auth: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["account_index", "market_id", "auth"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,16 +89,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetAccountActiveOrders) in the input: " + _key) - _obj = cls.model_validate({ "account_index": obj.get("account_index"), "market_id": obj.get("market_id"), "auth": obj.get("auth") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_account_api_keys.py b/lighter/models/req_get_account_api_keys.py index ed35cdd..a9c462e 100644 --- a/lighter/models/req_get_account_api_keys.py +++ b/lighter/models/req_get_account_api_keys.py @@ -28,6 +28,7 @@ class ReqGetAccountApiKeys(BaseModel): """ # noqa: E501 account_index: StrictInt api_key_index: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["account_index", "api_key_index"] model_config = ConfigDict( @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -80,15 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetAccountApiKeys) in the input: " + _key) - _obj = cls.model_validate({ "account_index": obj.get("account_index"), "api_key_index": obj.get("api_key_index") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_account_by_l1_address.py b/lighter/models/req_get_account_by_l1_address.py index 3a6527c..a0b86eb 100644 --- a/lighter/models/req_get_account_by_l1_address.py +++ b/lighter/models/req_get_account_by_l1_address.py @@ -27,6 +27,7 @@ class ReqGetAccountByL1Address(BaseModel): ReqGetAccountByL1Address """ # noqa: E501 l1_address: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["l1_address"] model_config = ConfigDict( @@ -59,8 +60,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -68,6 +71,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -79,14 +87,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetAccountByL1Address) in the input: " + _key) - _obj = cls.model_validate({ "l1_address": obj.get("l1_address") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_account_inactive_orders.py b/lighter/models/req_get_account_inactive_orders.py index 14756d6..4577704 100644 --- a/lighter/models/req_get_account_inactive_orders.py +++ b/lighter/models/req_get_account_inactive_orders.py @@ -33,6 +33,7 @@ class ReqGetAccountInactiveOrders(BaseModel): between_timestamps: Optional[StrictStr] = None cursor: Optional[StrictStr] = None limit: Annotated[int, Field(le=100, strict=True, ge=1)] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["account_index", "market_id", "ask_filter", "between_timestamps", "cursor", "limit"] model_config = ConfigDict( @@ -65,8 +66,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -74,6 +77,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,11 +93,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetAccountInactiveOrders) in the input: " + _key) - _obj = cls.model_validate({ "account_index": obj.get("account_index"), "market_id": obj.get("market_id"), @@ -98,6 +101,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "cursor": obj.get("cursor"), "limit": obj.get("limit") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_account_orders.py b/lighter/models/req_get_account_orders.py index c91563f..82052d2 100644 --- a/lighter/models/req_get_account_orders.py +++ b/lighter/models/req_get_account_orders.py @@ -31,6 +31,7 @@ class ReqGetAccountOrders(BaseModel): market_id: StrictInt cursor: Optional[StrictStr] = None limit: Annotated[int, Field(le=100, strict=True, ge=1)] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["account_index", "market_id", "cursor", "limit"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,17 +91,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetAccountOrders) in the input: " + _key) - _obj = cls.model_validate({ "account_index": obj.get("account_index"), "market_id": obj.get("market_id"), "cursor": obj.get("cursor"), "limit": obj.get("limit") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_account_pending_txs.py b/lighter/models/req_get_account_pending_txs.py index f416877..9f0f878 100644 --- a/lighter/models/req_get_account_pending_txs.py +++ b/lighter/models/req_get_account_pending_txs.py @@ -29,6 +29,7 @@ class ReqGetAccountPendingTxs(BaseModel): by: Optional[StrictStr] = None value: Optional[StrictStr] = None types: Optional[List[StrictInt]] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["by", "value", "types"] @field_validator('by') @@ -71,8 +72,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -80,6 +83,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -91,16 +99,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetAccountPendingTxs) in the input: " + _key) - _obj = cls.model_validate({ "by": obj.get("by"), "value": obj.get("value"), "types": obj.get("types") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_account_pn_l.py b/lighter/models/req_get_account_pn_l.py index 018430a..c4e5b8f 100644 --- a/lighter/models/req_get_account_pn_l.py +++ b/lighter/models/req_get_account_pn_l.py @@ -33,6 +33,7 @@ class ReqGetAccountPnL(BaseModel): end_timestamp: StrictInt count_back: StrictInt ignore_transfers: Optional[StrictBool] = False + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["by", "value", "resolution", "start_timestamp", "end_timestamp", "count_back", "ignore_transfers"] @field_validator('by') @@ -79,8 +80,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -88,6 +91,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -99,11 +107,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetAccountPnL) in the input: " + _key) - _obj = cls.model_validate({ "by": obj.get("by"), "value": obj.get("value"), @@ -113,6 +116,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "count_back": obj.get("count_back"), "ignore_transfers": obj.get("ignore_transfers") if obj.get("ignore_transfers") is not None else False }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_account_txs.py b/lighter/models/req_get_account_txs.py index 1a210b8..c83d7ae 100644 --- a/lighter/models/req_get_account_txs.py +++ b/lighter/models/req_get_account_txs.py @@ -32,6 +32,7 @@ class ReqGetAccountTxs(BaseModel): by: Optional[StrictStr] = None value: Optional[StrictStr] = None types: Optional[List[StrictInt]] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["index", "limit", "by", "value", "types"] @field_validator('by') @@ -74,8 +75,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -83,6 +86,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -94,11 +102,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetAccountTxs) in the input: " + _key) - _obj = cls.model_validate({ "index": obj.get("index"), "limit": obj.get("limit"), @@ -106,6 +109,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "value": obj.get("value"), "types": obj.get("types") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_block.py b/lighter/models/req_get_block.py index e756e27..574e2c7 100644 --- a/lighter/models/req_get_block.py +++ b/lighter/models/req_get_block.py @@ -28,6 +28,7 @@ class ReqGetBlock(BaseModel): """ # noqa: E501 by: StrictStr value: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["by", "value"] @field_validator('by') @@ -67,8 +68,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -76,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,15 +95,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetBlock) in the input: " + _key) - _obj = cls.model_validate({ "by": obj.get("by"), "value": obj.get("value") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_block_txs.py b/lighter/models/req_get_block_txs.py index a94d542..b040c5e 100644 --- a/lighter/models/req_get_block_txs.py +++ b/lighter/models/req_get_block_txs.py @@ -28,6 +28,7 @@ class ReqGetBlockTxs(BaseModel): """ # noqa: E501 by: StrictStr value: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["by", "value"] @field_validator('by') @@ -67,8 +68,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -76,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,15 +95,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetBlockTxs) in the input: " + _key) - _obj = cls.model_validate({ "by": obj.get("by"), "value": obj.get("value") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_by_account.py b/lighter/models/req_get_by_account.py index b91a7bb..9e52c14 100644 --- a/lighter/models/req_get_by_account.py +++ b/lighter/models/req_get_by_account.py @@ -28,6 +28,7 @@ class ReqGetByAccount(BaseModel): """ # noqa: E501 by: StrictStr value: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["by", "value"] @field_validator('by') @@ -67,8 +68,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -76,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,15 +95,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetByAccount) in the input: " + _key) - _obj = cls.model_validate({ "by": obj.get("by"), "value": obj.get("value") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_candlesticks.py b/lighter/models/req_get_candlesticks.py index a3b62dc..2b8861b 100644 --- a/lighter/models/req_get_candlesticks.py +++ b/lighter/models/req_get_candlesticks.py @@ -32,6 +32,7 @@ class ReqGetCandlesticks(BaseModel): end_timestamp: StrictInt count_back: StrictInt set_timestamp_to_end: Optional[StrictBool] = False + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id", "resolution", "start_timestamp", "end_timestamp", "count_back", "set_timestamp_to_end"] @field_validator('resolution') @@ -71,8 +72,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -80,6 +83,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -91,11 +99,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetCandlesticks) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id"), "resolution": obj.get("resolution"), @@ -104,6 +107,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "count_back": obj.get("count_back"), "set_timestamp_to_end": obj.get("set_timestamp_to_end") if obj.get("set_timestamp_to_end") is not None else False }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_deposit_history.py b/lighter/models/req_get_deposit_history.py index ff18dd9..1511f92 100644 --- a/lighter/models/req_get_deposit_history.py +++ b/lighter/models/req_get_deposit_history.py @@ -29,6 +29,7 @@ class ReqGetDepositHistory(BaseModel): l1_address: StrictStr cursor: Optional[StrictStr] = None filter: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["l1_address", "cursor", "filter"] @field_validator('filter') @@ -71,8 +72,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -80,6 +83,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -91,16 +99,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetDepositHistory) in the input: " + _key) - _obj = cls.model_validate({ "l1_address": obj.get("l1_address"), "cursor": obj.get("cursor"), "filter": obj.get("filter") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_fee_bucket.py b/lighter/models/req_get_fee_bucket.py index 697fb30..17bb262 100644 --- a/lighter/models/req_get_fee_bucket.py +++ b/lighter/models/req_get_fee_bucket.py @@ -27,6 +27,7 @@ class ReqGetFeeBucket(BaseModel): ReqGetFeeBucket """ # noqa: E501 account_index: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["account_index"] model_config = ConfigDict( @@ -59,8 +60,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -68,6 +71,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -79,14 +87,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetFeeBucket) in the input: " + _key) - _obj = cls.model_validate({ "account_index": obj.get("account_index") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_fundings.py b/lighter/models/req_get_fundings.py index 99cbc61..af9a20a 100644 --- a/lighter/models/req_get_fundings.py +++ b/lighter/models/req_get_fundings.py @@ -31,6 +31,7 @@ class ReqGetFundings(BaseModel): start_timestamp: StrictInt end_timestamp: StrictInt count_back: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id", "resolution", "start_timestamp", "end_timestamp", "count_back"] @field_validator('resolution') @@ -70,8 +71,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,11 +98,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetFundings) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id"), "resolution": obj.get("resolution"), @@ -102,6 +105,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "end_timestamp": obj.get("end_timestamp"), "count_back": obj.get("count_back") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_l1_tx.py b/lighter/models/req_get_l1_tx.py index ad42661..dda8501 100644 --- a/lighter/models/req_get_l1_tx.py +++ b/lighter/models/req_get_l1_tx.py @@ -27,6 +27,7 @@ class ReqGetL1Tx(BaseModel): ReqGetL1Tx """ # noqa: E501 hash: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["hash"] model_config = ConfigDict( @@ -59,8 +60,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -68,6 +71,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -79,14 +87,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetL1Tx) in the input: " + _key) - _obj = cls.model_validate({ "hash": obj.get("hash") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_latest_deposit.py b/lighter/models/req_get_latest_deposit.py index cda6fd1..6ce2506 100644 --- a/lighter/models/req_get_latest_deposit.py +++ b/lighter/models/req_get_latest_deposit.py @@ -27,6 +27,7 @@ class ReqGetLatestDeposit(BaseModel): ReqGetLatestDeposit """ # noqa: E501 l1_address: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["l1_address"] model_config = ConfigDict( @@ -59,8 +60,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -68,6 +71,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -79,14 +87,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetLatestDeposit) in the input: " + _key) - _obj = cls.model_validate({ "l1_address": obj.get("l1_address") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_next_nonce.py b/lighter/models/req_get_next_nonce.py index 261b466..90920a0 100644 --- a/lighter/models/req_get_next_nonce.py +++ b/lighter/models/req_get_next_nonce.py @@ -28,6 +28,7 @@ class ReqGetNextNonce(BaseModel): """ # noqa: E501 account_index: StrictInt api_key_index: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["account_index", "api_key_index"] model_config = ConfigDict( @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -80,15 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetNextNonce) in the input: " + _key) - _obj = cls.model_validate({ "account_index": obj.get("account_index"), "api_key_index": obj.get("api_key_index") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_order_book_details.py b/lighter/models/req_get_order_book_details.py index 8b3af21..e38a012 100644 --- a/lighter/models/req_get_order_book_details.py +++ b/lighter/models/req_get_order_book_details.py @@ -27,6 +27,7 @@ class ReqGetOrderBookDetails(BaseModel): ReqGetOrderBookDetails """ # noqa: E501 market_id: Optional[StrictInt] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id"] model_config = ConfigDict( @@ -59,8 +60,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -68,6 +71,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -79,14 +87,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetOrderBookDetails) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_order_book_orders.py b/lighter/models/req_get_order_book_orders.py index 7db2f7c..52c008f 100644 --- a/lighter/models/req_get_order_book_orders.py +++ b/lighter/models/req_get_order_book_orders.py @@ -29,6 +29,7 @@ class ReqGetOrderBookOrders(BaseModel): """ # noqa: E501 market_id: StrictInt limit: Annotated[int, Field(le=100, strict=True, ge=1)] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id", "limit"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,15 +89,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetOrderBookOrders) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id"), "limit": obj.get("limit") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_order_books.py b/lighter/models/req_get_order_books.py index b118d44..9608c4b 100644 --- a/lighter/models/req_get_order_books.py +++ b/lighter/models/req_get_order_books.py @@ -27,6 +27,7 @@ class ReqGetOrderBooks(BaseModel): ReqGetOrderBooks """ # noqa: E501 market_id: Optional[StrictInt] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id"] model_config = ConfigDict( @@ -59,8 +60,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -68,6 +71,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -79,14 +87,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetOrderBooks) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_public_pools.py b/lighter/models/req_get_public_pools.py index f1278f7..cac0b25 100644 --- a/lighter/models/req_get_public_pools.py +++ b/lighter/models/req_get_public_pools.py @@ -31,6 +31,7 @@ class ReqGetPublicPools(BaseModel): index: StrictInt limit: Annotated[int, Field(le=100, strict=True, ge=1)] account_index: Optional[StrictInt] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["filter", "index", "limit", "account_index"] @field_validator('filter') @@ -73,8 +74,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -82,6 +85,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -93,17 +101,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetPublicPools) in the input: " + _key) - _obj = cls.model_validate({ "filter": obj.get("filter"), "index": obj.get("index"), "limit": obj.get("limit"), "account_index": obj.get("account_index") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_range_with_cursor.py b/lighter/models/req_get_range_with_cursor.py index 1831d55..dc7821e 100644 --- a/lighter/models/req_get_range_with_cursor.py +++ b/lighter/models/req_get_range_with_cursor.py @@ -29,6 +29,7 @@ class ReqGetRangeWithCursor(BaseModel): """ # noqa: E501 cursor: Optional[StrictStr] = None limit: Annotated[int, Field(le=100, strict=True, ge=1)] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["cursor", "limit"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,15 +89,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetRangeWithCursor) in the input: " + _key) - _obj = cls.model_validate({ "cursor": obj.get("cursor"), "limit": obj.get("limit") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_range_with_index.py b/lighter/models/req_get_range_with_index.py index 88993a9..e589449 100644 --- a/lighter/models/req_get_range_with_index.py +++ b/lighter/models/req_get_range_with_index.py @@ -29,6 +29,7 @@ class ReqGetRangeWithIndex(BaseModel): """ # noqa: E501 index: Optional[StrictInt] = None limit: Annotated[int, Field(le=100, strict=True, ge=1)] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["index", "limit"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,15 +89,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetRangeWithIndex) in the input: " + _key) - _obj = cls.model_validate({ "index": obj.get("index"), "limit": obj.get("limit") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_range_with_index_sortable.py b/lighter/models/req_get_range_with_index_sortable.py index 4c04397..d22bbb2 100644 --- a/lighter/models/req_get_range_with_index_sortable.py +++ b/lighter/models/req_get_range_with_index_sortable.py @@ -30,6 +30,7 @@ class ReqGetRangeWithIndexSortable(BaseModel): index: Optional[StrictInt] = None limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None sort: Optional[StrictStr] = 'asc' + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["index", "limit", "sort"] @field_validator('sort') @@ -72,8 +73,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -81,6 +84,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -92,16 +100,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetRangeWithIndexSortable) in the input: " + _key) - _obj = cls.model_validate({ "index": obj.get("index"), "limit": obj.get("limit"), "sort": obj.get("sort") if obj.get("sort") is not None else 'asc' }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_recent_trades.py b/lighter/models/req_get_recent_trades.py index 8773505..96dba79 100644 --- a/lighter/models/req_get_recent_trades.py +++ b/lighter/models/req_get_recent_trades.py @@ -29,6 +29,7 @@ class ReqGetRecentTrades(BaseModel): """ # noqa: E501 market_id: StrictInt limit: Annotated[int, Field(le=100, strict=True, ge=1)] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id", "limit"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,15 +89,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetRecentTrades) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id"), "limit": obj.get("limit") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_trades.py b/lighter/models/req_get_trades.py index e3aed03..16f5ed8 100644 --- a/lighter/models/req_get_trades.py +++ b/lighter/models/req_get_trades.py @@ -36,6 +36,7 @@ class ReqGetTrades(BaseModel): var_from: Optional[StrictInt] = Field(default=-1, alias="from") ask_filter: Optional[StrictInt] = None limit: Annotated[int, Field(le=100, strict=True, ge=1)] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_id", "account_index", "order_index", "sort_by", "sort_dir", "cursor", "from", "ask_filter", "limit"] @field_validator('sort_by') @@ -85,8 +86,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -94,6 +97,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -105,11 +113,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetTrades) in the input: " + _key) - _obj = cls.model_validate({ "market_id": obj.get("market_id"), "account_index": obj.get("account_index") if obj.get("account_index") is not None else -1, @@ -121,6 +124,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "ask_filter": obj.get("ask_filter"), "limit": obj.get("limit") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_tx.py b/lighter/models/req_get_tx.py index 7a1d10f..275c4ff 100644 --- a/lighter/models/req_get_tx.py +++ b/lighter/models/req_get_tx.py @@ -28,6 +28,7 @@ class ReqGetTx(BaseModel): """ # noqa: E501 by: StrictStr value: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["by", "value"] @field_validator('by') @@ -67,8 +68,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -76,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,15 +95,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetTx) in the input: " + _key) - _obj = cls.model_validate({ "by": obj.get("by"), "value": obj.get("value") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/req_get_withdraw_history.py b/lighter/models/req_get_withdraw_history.py index c98d10d..38ca57c 100644 --- a/lighter/models/req_get_withdraw_history.py +++ b/lighter/models/req_get_withdraw_history.py @@ -29,6 +29,7 @@ class ReqGetWithdrawHistory(BaseModel): account_index: StrictInt cursor: Optional[StrictStr] = None filter: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["account_index", "cursor", "filter"] @field_validator('filter') @@ -71,8 +72,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -80,6 +83,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -91,16 +99,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ReqGetWithdrawHistory) in the input: " + _key) - _obj = cls.model_validate({ "account_index": obj.get("account_index"), "cursor": obj.get("cursor"), "filter": obj.get("filter") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/result_code.py b/lighter/models/result_code.py index 2669c4a..a29a276 100644 --- a/lighter/models/result_code.py +++ b/lighter/models/result_code.py @@ -28,6 +28,7 @@ class ResultCode(BaseModel): """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message"] model_config = ConfigDict( @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -80,15 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ResultCode) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/simple_order.py b/lighter/models/simple_order.py index eed21f9..d5cd8b5 100644 --- a/lighter/models/simple_order.py +++ b/lighter/models/simple_order.py @@ -32,6 +32,7 @@ class SimpleOrder(BaseModel): remaining_base_amount: StrictStr price: StrictStr order_expiry: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["order_index", "owner_account_index", "initial_base_amount", "remaining_base_amount", "price", "order_expiry"] model_config = ConfigDict( @@ -64,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -73,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -84,11 +92,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in SimpleOrder) in the input: " + _key) - _obj = cls.model_validate({ "order_index": obj.get("order_index"), "owner_account_index": obj.get("owner_account_index"), @@ -97,6 +100,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "price": obj.get("price"), "order_expiry": obj.get("order_expiry") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/status.py b/lighter/models/status.py index fbce131..2db4004 100644 --- a/lighter/models/status.py +++ b/lighter/models/status.py @@ -28,6 +28,7 @@ class Status(BaseModel): """ # noqa: E501 status: StrictInt network_id: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["status", "network_id"] model_config = ConfigDict( @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -80,15 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Status) in the input: " + _key) - _obj = cls.model_validate({ "status": obj.get("status"), "network_id": obj.get("network_id") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/sub_accounts.py b/lighter/models/sub_accounts.py index 35f5a56..76f4c0c 100644 --- a/lighter/models/sub_accounts.py +++ b/lighter/models/sub_accounts.py @@ -31,6 +31,7 @@ class SubAccounts(BaseModel): message: Optional[StrictStr] = None l1_address: StrictStr sub_accounts: List[Account] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "l1_address", "sub_accounts"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['sub_accounts'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in SubAccounts) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "l1_address": obj.get("l1_address"), "sub_accounts": [Account.from_dict(_item) for _item in obj["sub_accounts"]] if obj.get("sub_accounts") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/ticker.py b/lighter/models/ticker.py index a101fc3..96a5cd4 100644 --- a/lighter/models/ticker.py +++ b/lighter/models/ticker.py @@ -30,6 +30,7 @@ class Ticker(BaseModel): s: StrictStr a: PriceLevel b: PriceLevel + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["s", "a", "b"] model_config = ConfigDict( @@ -62,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -77,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of b if self.b: _dict['b'] = self.b.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -88,16 +96,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Ticker) in the input: " + _key) - _obj = cls.model_validate({ "s": obj.get("s"), "a": PriceLevel.from_dict(obj["a"]) if obj.get("a") is not None else None, "b": PriceLevel.from_dict(obj["b"]) if obj.get("b") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/trade.py b/lighter/models/trade.py index b1ebaa6..3d0c336 100644 --- a/lighter/models/trade.py +++ b/lighter/models/trade.py @@ -40,6 +40,7 @@ class Trade(BaseModel): is_maker_ask: StrictBool block_height: StrictInt timestamp: StrictInt + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["trade_id", "tx_hash", "type", "market_id", "size", "price", "usd_amount", "ask_id", "bid_id", "ask_account_id", "bid_account_id", "is_maker_ask", "block_height", "timestamp"] @field_validator('type') @@ -79,8 +80,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -88,6 +91,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -99,11 +107,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Trade) in the input: " + _key) - _obj = cls.model_validate({ "trade_id": obj.get("trade_id"), "tx_hash": obj.get("tx_hash"), @@ -120,6 +123,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "block_height": obj.get("block_height"), "timestamp": obj.get("timestamp") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/trades.py b/lighter/models/trades.py index 1a2637c..ea2097a 100644 --- a/lighter/models/trades.py +++ b/lighter/models/trades.py @@ -31,6 +31,7 @@ class Trades(BaseModel): message: Optional[StrictStr] = None next_cursor: Optional[StrictStr] = None trades: List[Trade] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "next_cursor", "trades"] model_config = ConfigDict( @@ -63,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['trades'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Trades) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "next_cursor": obj.get("next_cursor"), "trades": [Trade.from_dict(_item) for _item in obj["trades"]] if obj.get("trades") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/tx.py b/lighter/models/tx.py index 78f1c1a..1b78ad1 100644 --- a/lighter/models/tx.py +++ b/lighter/models/tx.py @@ -42,6 +42,7 @@ class Tx(BaseModel): executed_at: StrictInt sequence_index: StrictInt parent_hash: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["hash", "type", "info", "event_info", "status", "transaction_index", "l1_address", "account_index", "nonce", "expire_at", "block_height", "queued_at", "executed_at", "sequence_index", "parent_hash"] model_config = ConfigDict( @@ -74,8 +75,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -83,6 +86,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -94,11 +102,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Tx) in the input: " + _key) - _obj = cls.model_validate({ "hash": obj.get("hash"), "type": obj.get("type"), @@ -116,6 +119,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sequence_index": obj.get("sequence_index"), "parent_hash": obj.get("parent_hash") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/tx_hash.py b/lighter/models/tx_hash.py index 89e1401..86cb1ed 100644 --- a/lighter/models/tx_hash.py +++ b/lighter/models/tx_hash.py @@ -29,6 +29,7 @@ class TxHash(BaseModel): code: StrictInt message: Optional[StrictStr] = None tx_hash: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "tx_hash"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,16 +89,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in TxHash) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "tx_hash": obj.get("tx_hash") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/tx_hashes.py b/lighter/models/tx_hashes.py index 06892fd..807aa59 100644 --- a/lighter/models/tx_hashes.py +++ b/lighter/models/tx_hashes.py @@ -29,6 +29,7 @@ class TxHashes(BaseModel): code: StrictInt message: Optional[StrictStr] = None tx_hash: List[StrictStr] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "tx_hash"] model_config = ConfigDict( @@ -61,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,16 +89,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in TxHashes) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "tx_hash": obj.get("tx_hash") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/txs.py b/lighter/models/txs.py index bb660e5..8beafb5 100644 --- a/lighter/models/txs.py +++ b/lighter/models/txs.py @@ -30,6 +30,7 @@ class Txs(BaseModel): code: StrictInt message: Optional[StrictStr] = None txs: List[Tx] + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "txs"] model_config = ConfigDict( @@ -62,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -78,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['txs'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -89,16 +97,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Txs) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "txs": [Tx.from_dict(_item) for _item in obj["txs"]] if obj.get("txs") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/validator_info.py b/lighter/models/validator_info.py index fe2effd..ca08bdf 100644 --- a/lighter/models/validator_info.py +++ b/lighter/models/validator_info.py @@ -28,6 +28,7 @@ class ValidatorInfo(BaseModel): """ # noqa: E501 address: StrictStr is_active: StrictBool + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["address", "is_active"] model_config = ConfigDict( @@ -60,8 +61,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +72,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -80,15 +88,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ValidatorInfo) in the input: " + _key) - _obj = cls.model_validate({ "address": obj.get("address"), "is_active": obj.get("is_active") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/withdraw_history.py b/lighter/models/withdraw_history.py index 1b27b48..cdcb8c1 100644 --- a/lighter/models/withdraw_history.py +++ b/lighter/models/withdraw_history.py @@ -19,7 +19,6 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from lighter.models.withdraw_history_cursor import WithdrawHistoryCursor from lighter.models.withdraw_history_item import WithdrawHistoryItem from typing import Optional, Set from typing_extensions import Self @@ -31,7 +30,8 @@ class WithdrawHistory(BaseModel): code: StrictInt message: Optional[StrictStr] = None withdraws: List[WithdrawHistoryItem] - cursor: WithdrawHistoryCursor + cursor: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "withdraws", "cursor"] model_config = ConfigDict( @@ -64,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -80,9 +82,11 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['withdraws'] = _items - # override the default output from pydantic by calling `to_dict()` of cursor - if self.cursor: - _dict['cursor'] = self.cursor.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -94,17 +98,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in WithdrawHistory) in the input: " + _key) - _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), "withdraws": [WithdrawHistoryItem.from_dict(_item) for _item in obj["withdraws"]] if obj.get("withdraws") is not None else None, - "cursor": WithdrawHistoryCursor.from_dict(obj["cursor"]) if obj.get("cursor") is not None else None + "cursor": obj.get("cursor") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/withdraw_history_cursor.py b/lighter/models/withdraw_history_cursor.py deleted file mode 100644 index 4a9dace..0000000 --- a/lighter/models/withdraw_history_cursor.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class WithdrawHistoryCursor(BaseModel): - """ - WithdrawHistoryCursor - """ # noqa: E501 - secure_id: StrictStr - fast_id: StrictStr - __properties: ClassVar[List[str]] = ["secure_id", "fast_id"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WithdrawHistoryCursor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WithdrawHistoryCursor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in WithdrawHistoryCursor) in the input: " + _key) - - _obj = cls.model_validate({ - "secure_id": obj.get("secure_id"), - "fast_id": obj.get("fast_id") - }) - return _obj - - diff --git a/lighter/models/withdraw_history_item.py b/lighter/models/withdraw_history_item.py index eac94c4..fdc9a82 100644 --- a/lighter/models/withdraw_history_item.py +++ b/lighter/models/withdraw_history_item.py @@ -31,7 +31,9 @@ class WithdrawHistoryItem(BaseModel): timestamp: StrictInt status: StrictStr type: StrictStr - __properties: ClassVar[List[str]] = ["id", "amount", "timestamp", "status", "type"] + l1_tx_hash: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "amount", "timestamp", "status", "type", "l1_tx_hash"] @field_validator('status') def status_validate_enum(cls, value): @@ -77,8 +79,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -86,6 +90,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -97,18 +106,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in WithdrawHistoryItem) in the input: " + _key) - _obj = cls.model_validate({ "id": obj.get("id"), "amount": obj.get("amount"), "timestamp": obj.get("timestamp"), "status": obj.get("status"), - "type": obj.get("type") + "type": obj.get("type"), + "l1_tx_hash": obj.get("l1_tx_hash") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/models/zk_lighter_info.py b/lighter/models/zk_lighter_info.py index 3c6fe8d..81fcb14 100644 --- a/lighter/models/zk_lighter_info.py +++ b/lighter/models/zk_lighter_info.py @@ -27,6 +27,7 @@ class ZkLighterInfo(BaseModel): ZkLighterInfo """ # noqa: E501 contract_address: StrictStr + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["contract_address"] model_config = ConfigDict( @@ -59,8 +60,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -68,6 +71,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -79,14 +87,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in ZkLighterInfo) in the input: " + _key) - _obj = cls.model_validate({ "contract_address": obj.get("contract_address") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/lighter/signers/signer-amd64.so b/lighter/signers/signer-amd64.so index c2149ed..b98128e 100644 Binary files a/lighter/signers/signer-amd64.so and b/lighter/signers/signer-amd64.so differ diff --git a/lighter/signers/signer-arm64.dylib b/lighter/signers/signer-arm64.dylib index 34fd78a..d0176fa 100644 Binary files a/lighter/signers/signer-arm64.dylib and b/lighter/signers/signer-arm64.dylib differ diff --git a/test/test_is_whitelisted.py b/test/test_is_whitelisted.py deleted file mode 100644 index 1314083..0000000 --- a/test/test_is_whitelisted.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.is_whitelisted import IsWhitelisted - -class TestIsWhitelisted(unittest.TestCase): - """IsWhitelisted unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> IsWhitelisted: - """Test IsWhitelisted - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `IsWhitelisted` - """ - model = IsWhitelisted() - if include_optional: - return IsWhitelisted( - code = 200, - message = '', - whitelisted = True, - deposit_amount_left = '' - ) - else: - return IsWhitelisted( - code = 200, - whitelisted = True, - deposit_amount_left = '', - ) - """ - - def testIsWhitelisted(self): - """Test IsWhitelisted""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_is_whitelisted.py b/test/test_req_is_whitelisted.py deleted file mode 100644 index c8913c2..0000000 --- a/test/test_req_is_whitelisted.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_is_whitelisted import ReqIsWhitelisted - -class TestReqIsWhitelisted(unittest.TestCase): - """ReqIsWhitelisted unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqIsWhitelisted: - """Test ReqIsWhitelisted - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqIsWhitelisted` - """ - model = ReqIsWhitelisted() - if include_optional: - return ReqIsWhitelisted( - l1_address = '' - ) - else: - return ReqIsWhitelisted( - l1_address = '', - ) - """ - - def testReqIsWhitelisted(self): - """Test ReqIsWhitelisted""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_withdraw_history_cursor.py b/test/test_withdraw_history_cursor.py deleted file mode 100644 index d157af7..0000000 --- a/test/test_withdraw_history_cursor.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.withdraw_history_cursor import WithdrawHistoryCursor - -class TestWithdrawHistoryCursor(unittest.TestCase): - """WithdrawHistoryCursor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> WithdrawHistoryCursor: - """Test WithdrawHistoryCursor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `WithdrawHistoryCursor` - """ - model = WithdrawHistoryCursor() - if include_optional: - return WithdrawHistoryCursor( - secure_id = '1', - fast_id = '1' - ) - else: - return WithdrawHistoryCursor( - secure_id = '1', - fast_id = '1', - ) - """ - - def testWithdrawHistoryCursor(self): - """Test WithdrawHistoryCursor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main()