Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
disallowAdditionalPropertiesIfNotPresent: true
disallowAdditionalPropertiesIfNotPresent: false
library: asyncio
packageName: lighter-sdk
projectName: lighter-sdk
8 changes: 2 additions & 6 deletions lighter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
270 changes: 3 additions & 267 deletions lighter/api/account_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions lighter/api/info_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading