diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 071d41f..ce3ea80 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -15,19 +15,17 @@ docs/Announcement.md docs/AnnouncementApi.md docs/Announcements.md docs/ApiKey.md +docs/ApiToken.md docs/Asset.md docs/AssetDetails.md -docs/Block.md -docs/BlockApi.md -docs/Blocks.md +docs/Auth.md docs/Bridge.md docs/BridgeApi.md docs/BridgeSupportedNetwork.md -docs/Candlestick.md +docs/Candle.md +docs/Candles.md docs/CandlestickApi.md -docs/Candlesticks.md docs/ContractAddress.md -docs/CurrentHeight.md docs/Cursor.md docs/DailyReturn.md docs/DepositHistory.md @@ -57,6 +55,7 @@ docs/Order.md docs/OrderApi.md docs/OrderBook.md docs/OrderBookDepth.md +docs/OrderBookDepthWithBeginNonce.md docs/OrderBookDetails.md docs/OrderBookOrders.md docs/OrderBookStats.md @@ -71,9 +70,7 @@ docs/PriceLevel.md docs/PublicPoolInfo.md docs/PublicPoolMetadata.md docs/PublicPoolShare.md -docs/ReferralApi.md -docs/ReferralPointEntry.md -docs/ReferralPoints.md +docs/ReqDoFaucet.md docs/ReqExportData.md docs/ReqGetAccount.md docs/ReqGetAccountActiveOrders.md @@ -84,12 +81,13 @@ docs/ReqGetAccountLimits.md docs/ReqGetAccountMetadata.md docs/ReqGetAccountPnL.md docs/ReqGetAccountTxs.md +docs/ReqGetApiTokens.md docs/ReqGetAssetDetails.md docs/ReqGetBlock.md docs/ReqGetBlockTxs.md docs/ReqGetBridgesByL1Addr.md docs/ReqGetByAccount.md -docs/ReqGetCandlesticks.md +docs/ReqGetCandles.md docs/ReqGetDepositHistory.md docs/ReqGetFastWithdrawInfo.md docs/ReqGetFundings.md @@ -107,21 +105,22 @@ docs/ReqGetRangeWithCursor.md docs/ReqGetRangeWithIndex.md docs/ReqGetRangeWithIndexSortable.md docs/ReqGetRecentTrades.md -docs/ReqGetReferralPoints.md docs/ReqGetTrades.md docs/ReqGetTransferFeeInfo.md docs/ReqGetTransferHistory.md docs/ReqGetTx.md docs/ReqGetWithdrawHistory.md docs/RespChangeAccountTier.md +docs/RespGetApiTokens.md docs/RespGetBridgesByL1Addr.md docs/RespGetFastBridgeInfo.md +docs/RespGetFastwithdrawalInfo.md docs/RespGetIsNextBridgeFast.md +docs/RespPostApiToken.md docs/RespPublicPoolsMetadata.md +docs/RespRevokeApiToken.md docs/RespSendTx.md docs/RespSendTxBatch.md -docs/RespUpdateKickback.md -docs/RespUpdateReferralCode.md docs/RespWithdrawalDelay.md docs/ResultCode.md docs/RiskInfo.md @@ -140,10 +139,8 @@ docs/TransactionApi.md docs/TransferFeeInfo.md docs/TransferHistory.md docs/TransferHistoryItem.md -docs/Tx.md docs/TxHash.md docs/TxHashes.md -docs/Txs.md docs/ValidatorInfo.md docs/WithdrawHistory.md docs/WithdrawHistoryItem.md @@ -153,14 +150,12 @@ lighter/__init__.py lighter/api/__init__.py lighter/api/account_api.py lighter/api/announcement_api.py -lighter/api/block_api.py lighter/api/bridge_api.py lighter/api/candlestick_api.py lighter/api/funding_api.py lighter/api/info_api.py lighter/api/notification_api.py lighter/api/order_api.py -lighter/api/referral_api.py lighter/api/root_api.py lighter/api/transaction_api.py lighter/api_client.py @@ -183,16 +178,15 @@ lighter/models/account_trade_stats.py lighter/models/announcement.py lighter/models/announcements.py lighter/models/api_key.py +lighter/models/api_token.py lighter/models/asset.py lighter/models/asset_details.py -lighter/models/block.py -lighter/models/blocks.py +lighter/models/auth.py lighter/models/bridge.py lighter/models/bridge_supported_network.py -lighter/models/candlestick.py -lighter/models/candlesticks.py +lighter/models/candle.py +lighter/models/candles.py lighter/models/contract_address.py -lighter/models/current_height.py lighter/models/cursor.py lighter/models/daily_return.py lighter/models/deposit_history.py @@ -218,6 +212,7 @@ lighter/models/next_nonce.py lighter/models/order.py lighter/models/order_book.py lighter/models/order_book_depth.py +lighter/models/order_book_depth_with_begin_nonce.py lighter/models/order_book_details.py lighter/models/order_book_orders.py lighter/models/order_book_stats.py @@ -232,8 +227,7 @@ lighter/models/price_level.py lighter/models/public_pool_info.py lighter/models/public_pool_metadata.py lighter/models/public_pool_share.py -lighter/models/referral_point_entry.py -lighter/models/referral_points.py +lighter/models/req_do_faucet.py lighter/models/req_export_data.py lighter/models/req_get_account.py lighter/models/req_get_account_active_orders.py @@ -244,12 +238,13 @@ lighter/models/req_get_account_limits.py lighter/models/req_get_account_metadata.py lighter/models/req_get_account_pn_l.py lighter/models/req_get_account_txs.py +lighter/models/req_get_api_tokens.py lighter/models/req_get_asset_details.py lighter/models/req_get_block.py lighter/models/req_get_block_txs.py lighter/models/req_get_bridges_by_l1_addr.py lighter/models/req_get_by_account.py -lighter/models/req_get_candlesticks.py +lighter/models/req_get_candles.py lighter/models/req_get_deposit_history.py lighter/models/req_get_fast_withdraw_info.py lighter/models/req_get_fundings.py @@ -267,21 +262,22 @@ lighter/models/req_get_range_with_cursor.py lighter/models/req_get_range_with_index.py lighter/models/req_get_range_with_index_sortable.py lighter/models/req_get_recent_trades.py -lighter/models/req_get_referral_points.py lighter/models/req_get_trades.py lighter/models/req_get_transfer_fee_info.py lighter/models/req_get_transfer_history.py lighter/models/req_get_tx.py lighter/models/req_get_withdraw_history.py lighter/models/resp_change_account_tier.py +lighter/models/resp_get_api_tokens.py lighter/models/resp_get_bridges_by_l1_addr.py lighter/models/resp_get_fast_bridge_info.py +lighter/models/resp_get_fastwithdrawal_info.py lighter/models/resp_get_is_next_bridge_fast.py +lighter/models/resp_post_api_token.py lighter/models/resp_public_pools_metadata.py +lighter/models/resp_revoke_api_token.py lighter/models/resp_send_tx.py lighter/models/resp_send_tx_batch.py -lighter/models/resp_update_kickback.py -lighter/models/resp_update_referral_code.py lighter/models/resp_withdrawal_delay.py lighter/models/result_code.py lighter/models/risk_info.py @@ -298,10 +294,8 @@ lighter/models/trades.py lighter/models/transfer_fee_info.py lighter/models/transfer_history.py lighter/models/transfer_history_item.py -lighter/models/tx.py lighter/models/tx_hash.py lighter/models/tx_hashes.py -lighter/models/txs.py lighter/models/validator_info.py lighter/models/withdraw_history.py lighter/models/withdraw_history_item.py @@ -311,19 +305,4 @@ lighter/rest.py setup.cfg test-requirements.txt test/__init__.py -test/test_account_asset.py -test/test_asset.py -test/test_asset_details.py -test/test_bridge.py -test/test_market_config.py -test/test_perps_market_stats.py -test/test_perps_order_book_detail.py -test/test_req_get_asset_details.py -test/test_req_get_bridges_by_l1_addr.py -test/test_resp_get_bridges_by_l1_addr.py -test/test_resp_get_is_next_bridge_fast.py -test/test_resp_update_kickback.py -test/test_resp_update_referral_code.py -test/test_spot_market_stats.py -test/test_spot_order_book_detail.py tox.ini diff --git a/README.md b/README.md index 59a2b3f..ef57fd3 100644 --- a/README.md +++ b/README.md @@ -74,11 +74,6 @@ Class | Method | HTTP request | Description *AccountApi* | [**accounts_by_l1_address**](docs/AccountApi.md#accounts_by_l1_address) | **GET** /api/v1/accountsByL1Address | accountsByL1Address *AccountApi* | [**apikeys**](docs/AccountApi.md#apikeys) | **GET** /api/v1/apikeys | apikeys *AccountApi* | [**pnl**](docs/AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl -*AccountApi* | [**public_pools**](docs/AccountApi.md#public_pools) | **GET** /api/v1/publicPools | publicPools -*BlockApi* | [**block**](docs/BlockApi.md#block) | **GET** /api/v1/block | block -*BlockApi* | [**blocks**](docs/BlockApi.md#blocks) | **GET** /api/v1/blocks | blocks -*BlockApi* | [**current_height**](docs/BlockApi.md#current_height) | **GET** /api/v1/currentHeight | currentHeight -*CandlestickApi* | [**candlesticks**](docs/CandlestickApi.md#candlesticks) | **GET** /api/v1/candlesticks | candlesticks *CandlestickApi* | [**fundings**](docs/CandlestickApi.md#fundings) | **GET** /api/v1/fundings | fundings *OrderApi* | [**account_inactive_orders**](docs/OrderApi.md#account_inactive_orders) | **GET** /api/v1/accountInactiveOrders | accountInactiveOrders *OrderApi* | [**exchange_stats**](docs/OrderApi.md#exchange_stats) | **GET** /api/v1/exchangeStats | exchangeStats @@ -89,13 +84,10 @@ Class | Method | HTTP request | Description *OrderApi* | [**trades**](docs/OrderApi.md#trades) | **GET** /api/v1/trades | trades *RootApi* | [**info**](docs/RootApi.md#info) | **GET** /info | info *RootApi* | [**status**](docs/RootApi.md#status) | **GET** / | status -*TransactionApi* | [**account_txs**](docs/TransactionApi.md#account_txs) | **GET** /api/v1/accountTxs | accountTxs -*TransactionApi* | [**block_txs**](docs/TransactionApi.md#block_txs) | **GET** /api/v1/blockTxs | blockTxs *TransactionApi* | [**deposit_history**](docs/TransactionApi.md#deposit_history) | **GET** /api/v1/deposit/history | deposit_history *TransactionApi* | [**next_nonce**](docs/TransactionApi.md#next_nonce) | **GET** /api/v1/nextNonce | nextNonce *TransactionApi* | [**send_tx**](docs/TransactionApi.md#send_tx) | **POST** /api/v1/sendTx | sendTx *TransactionApi* | [**send_tx_batch**](docs/TransactionApi.md#send_tx_batch) | **POST** /api/v1/sendTxBatch | sendTxBatch -*TransactionApi* | [**tx**](docs/TransactionApi.md#tx) | **GET** /api/v1/tx | tx *TransactionApi* | [**tx_from_l1_tx_hash**](docs/TransactionApi.md#tx_from_l1_tx_hash) | **GET** /api/v1/txFromL1TxHash | txFromL1TxHash *TransactionApi* | [**txs**](docs/TransactionApi.md#txs) | **GET** /api/v1/txs | txs *TransactionApi* | [**withdraw_history**](docs/TransactionApi.md#withdraw_history) | **GET** /api/v1/withdraw/history | withdraw_history @@ -111,13 +103,8 @@ Class | Method | HTTP request | Description - [AccountPosition](docs/AccountPosition.md) - [AccountStats](docs/AccountStats.md) - [ApiKey](docs/ApiKey.md) - - [Block](docs/Block.md) - - [Blocks](docs/Blocks.md) - [BridgeSupportedNetwork](docs/BridgeSupportedNetwork.md) - - [Candlestick](docs/Candlestick.md) - - [Candlesticks](docs/Candlesticks.md) - [ContractAddress](docs/ContractAddress.md) - - [CurrentHeight](docs/CurrentHeight.md) - [Cursor](docs/Cursor.md) - [DepositHistory](docs/DepositHistory.md) - [DepositHistoryItem](docs/DepositHistoryItem.md) @@ -181,10 +168,8 @@ Class | Method | HTTP request | Description - [Ticker](docs/Ticker.md) - [Trade](docs/Trade.md) - [Trades](docs/Trades.md) - - [Tx](docs/Tx.md) - [TxHash](docs/TxHash.md) - [TxHashes](docs/TxHashes.md) - - [Txs](docs/Txs.md) - [ValidatorInfo](docs/ValidatorInfo.md) - [WithdrawHistory](docs/WithdrawHistory.md) - [WithdrawHistoryItem](docs/WithdrawHistoryItem.md) diff --git a/docs/Account.md b/docs/Account.md index 68a4b51..6937475 100644 --- a/docs/Account.md +++ b/docs/Account.md @@ -12,10 +12,12 @@ Name | Type | Description | Notes **l1_address** | **str** | | **cancel_all_time** | **int** | | **total_order_count** | **int** | | +**total_isolated_order_count** | **int** | | **pending_order_count** | **int** | | **available_balance** | **str** | | **status** | **int** | | **collateral** | **str** | | +**transaction_time** | **int** | | ## Example diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 77df45d..50fb542 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -10,11 +10,15 @@ Method | HTTP request | Description [**accounts_by_l1_address**](AccountApi.md#accounts_by_l1_address) | **GET** /api/v1/accountsByL1Address | accountsByL1Address [**apikeys**](AccountApi.md#apikeys) | **GET** /api/v1/apikeys | apikeys [**change_account_tier**](AccountApi.md#change_account_tier) | **POST** /api/v1/changeAccountTier | changeAccountTier +[**faucet**](AccountApi.md#faucet) | **GET** /api/v1/faucet | faucet [**l1_metadata**](AccountApi.md#l1_metadata) | **GET** /api/v1/l1Metadata | l1Metadata [**liquidations**](AccountApi.md#liquidations) | **GET** /api/v1/liquidations | liquidations [**pnl**](AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl [**position_funding**](AccountApi.md#position_funding) | **GET** /api/v1/positionFunding | positionFunding [**public_pools_metadata**](AccountApi.md#public_pools_metadata) | **GET** /api/v1/publicPoolsMetadata | publicPoolsMetadata +[**tokens**](AccountApi.md#tokens) | **GET** /api/v1/tokens | tokens +[**tokens_create**](AccountApi.md#tokens_create) | **POST** /api/v1/tokens/create | tokens_create +[**tokens_revoke**](AccountApi.md#tokens_revoke) | **POST** /api/v1/tokens/revoke | tokens_revoke # **account** @@ -451,6 +455,77 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **faucet** +> ResultCode faucet(l1_address, do_l1_transfer) + +faucet + +Request funds from faucet + +### Example + + +```python +import lighter +from lighter.models.result_code import ResultCode +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.AccountApi(api_client) + l1_address = 'l1_address_example' # str | + do_l1_transfer = False # bool | (default to False) + + try: + # faucet + api_response = await api_instance.faucet(l1_address, do_l1_transfer) + print("The response of AccountApi->faucet:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->faucet: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **l1_address** | **str**| | + **do_l1_transfer** | **bool**| | [default to False] + +### Return type + +[**ResultCode**](ResultCode.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **l1_metadata** > L1Metadata l1_metadata(l1_address, authorization=authorization, auth=auth) @@ -636,8 +711,8 @@ async with lighter.ApiClient(configuration) as api_client: start_timestamp = 56 # int | end_timestamp = 56 # int | count_back = 56 # int | - authorization = 'authorization_example' # str | (optional) - auth = 'auth_example' # str | (optional) + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) ignore_transfers = False # bool | (optional) (default to False) try: @@ -662,8 +737,8 @@ Name | Type | Description | Notes **start_timestamp** | **int**| | **end_timestamp** | **int**| | **count_back** | **int**| | - **authorization** | **str**| | [optional] - **auth** | **str**| | [optional] + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] **ignore_transfers** | **bool**| | [optional] [default to False] ### Return type @@ -717,8 +792,8 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.AccountApi(api_client) account_index = 56 # int | limit = 56 # int | - authorization = 'authorization_example' # str | (optional) - auth = 'auth_example' # str | (optional) + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) market_id = 255 # int | (optional) (default to 255) cursor = 'cursor_example' # str | (optional) side = all # str | (optional) (default to all) @@ -741,8 +816,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_index** | **int**| | **limit** | **int**| | - **authorization** | **str**| | [optional] - **auth** | **str**| | [optional] + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] **market_id** | **int**| | [optional] [default to 255] **cursor** | **str**| | [optional] **side** | **str**| | [optional] [default to all] @@ -798,8 +873,8 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.AccountApi(api_client) index = 56 # int | limit = 56 # int | - authorization = 'authorization_example' # str | (optional) - auth = 'auth_example' # str | (optional) + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) filter = 'filter_example' # str | (optional) account_index = 56 # int | (optional) @@ -821,8 +896,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **index** | **int**| | **limit** | **int**| | - **authorization** | **str**| | [optional] - **auth** | **str**| | [optional] + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] **filter** | **str**| | [optional] **account_index** | **int**| | [optional] @@ -848,3 +923,226 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **tokens** +> RespGetApiTokens tokens(account_index, authorization=authorization) + +tokens + +Get api tokens of an account + +### Example + + +```python +import lighter +from lighter.models.resp_get_api_tokens import RespGetApiTokens +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.AccountApi(api_client) + account_index = 56 # int | + authorization = 'authorization_example' # str | make required after integ is done (optional) + + try: + # tokens + api_response = await api_instance.tokens(account_index, authorization=authorization) + print("The response of AccountApi->tokens:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->tokens: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **authorization** | **str**| make required after integ is done | [optional] + +### Return type + +[**RespGetApiTokens**](RespGetApiTokens.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tokens_create** +> RespPostApiToken tokens_create(name, account_index, expiry, sub_account_access, authorization=authorization, scopes=scopes) + +tokens_create + +Create api token + +### Example + + +```python +import lighter +from lighter.models.resp_post_api_token import RespPostApiToken +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.AccountApi(api_client) + name = 'name_example' # str | + account_index = 56 # int | + expiry = 56 # int | + sub_account_access = True # bool | + authorization = 'authorization_example' # str | (optional) + scopes = 'read.*' # str | (optional) (default to 'read.*') + + try: + # tokens_create + api_response = await api_instance.tokens_create(name, account_index, expiry, sub_account_access, authorization=authorization, scopes=scopes) + print("The response of AccountApi->tokens_create:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->tokens_create: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| | + **account_index** | **int**| | + **expiry** | **int**| | + **sub_account_access** | **bool**| | + **authorization** | **str**| | [optional] + **scopes** | **str**| | [optional] [default to 'read.*'] + +### Return type + +[**RespPostApiToken**](RespPostApiToken.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **tokens_revoke** +> RespRevokeApiToken tokens_revoke(token_id, account_index, authorization=authorization) + +tokens_revoke + +Revoke api token + +### Example + + +```python +import lighter +from lighter.models.resp_revoke_api_token import RespRevokeApiToken +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.AccountApi(api_client) + token_id = 56 # int | + account_index = 56 # int | + authorization = 'authorization_example' # str | (optional) + + try: + # tokens_revoke + api_response = await api_instance.tokens_revoke(token_id, account_index, authorization=authorization) + print("The response of AccountApi->tokens_revoke:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->tokens_revoke: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **token_id** | **int**| | + **account_index** | **int**| | + **authorization** | **str**| | [optional] + +### Return type + +[**RespRevokeApiToken**](RespRevokeApiToken.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ApiKey.md b/docs/ApiKey.md index 76850fa..242aad1 100644 --- a/docs/ApiKey.md +++ b/docs/ApiKey.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **api_key_index** | **int** | | **nonce** | **int** | | **public_key** | **str** | | +**transaction_time** | **int** | | ## Example diff --git a/docs/ApiToken.md b/docs/ApiToken.md new file mode 100644 index 0000000..6222603 --- /dev/null +++ b/docs/ApiToken.md @@ -0,0 +1,36 @@ +# ApiToken + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token_id** | **int** | | +**api_token** | **str** | | +**name** | **str** | | +**account_index** | **int** | | +**expiry** | **int** | | +**sub_account_access** | **bool** | | +**revoked** | **bool** | | +**scopes** | **str** | | + +## Example + +```python +from lighter.models.api_token import ApiToken + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiToken from a JSON string +api_token_instance = ApiToken.from_json(json) +# print the JSON string representation of the object +print(ApiToken.to_json()) + +# convert the object into a dict +api_token_dict = api_token_instance.to_dict() +# create an instance of ApiToken from a dict +api_token_from_dict = ApiToken.from_dict(api_token_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Txs.md b/docs/Auth.md similarity index 54% rename from docs/Txs.md rename to docs/Auth.md index 634d6c6..e8c4a9c 100644 --- a/docs/Txs.md +++ b/docs/Auth.md @@ -1,30 +1,28 @@ -# Txs +# Auth ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **int** | | -**message** | **str** | | [optional] -**txs** | [**List[Tx]**](Tx.md) | | +**auth** | **str** | made optional to support header auth clients | ## Example ```python -from lighter.models.txs import Txs +from lighter.models.auth import Auth # TODO update the JSON string below json = "{}" -# create an instance of Txs from a JSON string -txs_instance = Txs.from_json(json) +# create an instance of Auth from a JSON string +auth_instance = Auth.from_json(json) # print the JSON string representation of the object -print(Txs.to_json()) +print(Auth.to_json()) # convert the object into a dict -txs_dict = txs_instance.to_dict() -# create an instance of Txs from a dict -txs_from_dict = Txs.from_dict(txs_dict) +auth_dict = auth_instance.to_dict() +# create an instance of Auth from a dict +auth_from_dict = Auth.from_dict(auth_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Block.md b/docs/Block.md deleted file mode 100644 index 78ad751..0000000 --- a/docs/Block.md +++ /dev/null @@ -1,41 +0,0 @@ -# Block - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**commitment** | **str** | | -**height** | **int** | | -**state_root** | **str** | | -**priority_operations** | **int** | | -**on_chain_l2_operations** | **int** | | -**pending_on_chain_operations_pub_data** | **str** | | -**committed_tx_hash** | **str** | | -**committed_at** | **int** | | -**verified_tx_hash** | **str** | | -**verified_at** | **int** | | -**txs** | [**List[Tx]**](Tx.md) | | -**status** | **int** | | -**size** | **int** | | - -## Example - -```python -from lighter.models.block import Block - -# TODO update the JSON string below -json = "{}" -# create an instance of Block from a JSON string -block_instance = Block.from_json(json) -# print the JSON string representation of the object -print(Block.to_json()) - -# convert the object into a dict -block_dict = block_instance.to_dict() -# create an instance of Block from a dict -block_from_dict = Block.from_dict(block_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/BlockApi.md b/docs/BlockApi.md deleted file mode 100644 index 6d02f71..0000000 --- a/docs/BlockApi.md +++ /dev/null @@ -1,220 +0,0 @@ -# lighter.BlockApi - -All URIs are relative to *https://mainnet.zklighter.elliot.ai* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**block**](BlockApi.md#block) | **GET** /api/v1/block | block -[**blocks**](BlockApi.md#blocks) | **GET** /api/v1/blocks | blocks -[**current_height**](BlockApi.md#current_height) | **GET** /api/v1/currentHeight | currentHeight - - -# **block** -> Blocks block(by, value) - -block - -Get block by its height or commitment - -### Example - - -```python -import lighter -from lighter.models.blocks import Blocks -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.BlockApi(api_client) - by = 'by_example' # str | - value = 'value_example' # str | - - try: - # block - api_response = await api_instance.block(by, value) - print("The response of BlockApi->block:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BlockApi->block: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **by** | **str**| | - **value** | **str**| | - -### Return type - -[**Blocks**](Blocks.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **blocks** -> Blocks blocks(limit, index=index, sort=sort) - -blocks - -Get blocks - -### Example - - -```python -import lighter -from lighter.models.blocks import Blocks -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.BlockApi(api_client) - limit = 56 # int | - index = 56 # int | (optional) - sort = asc # str | (optional) (default to asc) - - try: - # blocks - api_response = await api_instance.blocks(limit, index=index, sort=sort) - print("The response of BlockApi->blocks:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BlockApi->blocks: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **int**| | - **index** | **int**| | [optional] - **sort** | **str**| | [optional] [default to asc] - -### Return type - -[**Blocks**](Blocks.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **current_height** -> CurrentHeight current_height() - -currentHeight - -Get current height - -### Example - - -```python -import lighter -from lighter.models.current_height import CurrentHeight -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.BlockApi(api_client) - - try: - # currentHeight - api_response = await api_instance.current_height() - print("The response of BlockApi->current_height:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BlockApi->current_height: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**CurrentHeight**](CurrentHeight.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/BridgeApi.md b/docs/BridgeApi.md index 29092ef..ecad9cc 100644 --- a/docs/BridgeApi.md +++ b/docs/BridgeApi.md @@ -7,6 +7,8 @@ Method | HTTP request | Description [**bridges**](BridgeApi.md#bridges) | **GET** /api/v1/bridges | bridges [**bridges_is_next_bridge_fast**](BridgeApi.md#bridges_is_next_bridge_fast) | **GET** /api/v1/bridges/isNextBridgeFast | bridges_isNextBridgeFast [**fastbridge_info**](BridgeApi.md#fastbridge_info) | **GET** /api/v1/fastbridge/info | fastbridge_info +[**fastwithdraw**](BridgeApi.md#fastwithdraw) | **POST** /api/v1/fastwithdraw | fastwithdraw +[**fastwithdraw_info**](BridgeApi.md#fastwithdraw_info) | **GET** /api/v1/fastwithdraw/info | fastwithdraw_info # **bridges** @@ -212,3 +214,151 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **fastwithdraw** +> ResultCode fastwithdraw(tx_info, to_address, authorization=authorization, auth=auth) + +fastwithdraw + +Fast withdraw + +### Example + + +```python +import lighter +from lighter.models.result_code import ResultCode +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.BridgeApi(api_client) + tx_info = 'tx_info_example' # str | + to_address = 'to_address_example' # str | + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # fastwithdraw + api_response = await api_instance.fastwithdraw(tx_info, to_address, authorization=authorization, auth=auth) + print("The response of BridgeApi->fastwithdraw:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BridgeApi->fastwithdraw: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tx_info** | **str**| | + **to_address** | **str**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + +### Return type + +[**ResultCode**](ResultCode.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fastwithdraw_info** +> RespGetFastwithdrawalInfo fastwithdraw_info(account_index, authorization=authorization, auth=auth) + +fastwithdraw_info + +Get fast withdraw info + +### Example + + +```python +import lighter +from lighter.models.resp_get_fastwithdrawal_info import RespGetFastwithdrawalInfo +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.BridgeApi(api_client) + account_index = 56 # int | + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # fastwithdraw_info + api_response = await api_instance.fastwithdraw_info(account_index, authorization=authorization, auth=auth) + print("The response of BridgeApi->fastwithdraw_info:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BridgeApi->fastwithdraw_info: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + +### Return type + +[**RespGetFastwithdrawalInfo**](RespGetFastwithdrawalInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Candle.md b/docs/Candle.md new file mode 100644 index 0000000..6742064 --- /dev/null +++ b/docs/Candle.md @@ -0,0 +1,40 @@ +# Candle + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **int** | timestamp | +**o** | **float** | open | +**h** | **float** | high | +**l** | **float** | low | +**c** | **float** | close | +**o** | **float** | open_raw | +**h** | **float** | high_raw | +**l** | **float** | low_raw | +**c** | **float** | close_raw | +**v** | **float** | volume0 | +**v** | **float** | volume1 | +**i** | **int** | last_trade_id | + +## Example + +```python +from lighter.models.candle import Candle + +# TODO update the JSON string below +json = "{}" +# create an instance of Candle from a JSON string +candle_instance = Candle.from_json(json) +# print the JSON string representation of the object +print(Candle.to_json()) + +# convert the object into a dict +candle_dict = candle_instance.to_dict() +# create an instance of Candle from a dict +candle_from_dict = Candle.from_dict(candle_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Blocks.md b/docs/Candles.md similarity index 56% rename from docs/Blocks.md rename to docs/Candles.md index 09ea46c..3467403 100644 --- a/docs/Blocks.md +++ b/docs/Candles.md @@ -1,4 +1,4 @@ -# Blocks +# Candles ## Properties @@ -7,25 +7,25 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **int** | | **message** | **str** | | [optional] -**total** | **int** | | -**blocks** | [**List[Block]**](Block.md) | | +**r** | **str** | resolution | +**c** | [**List[Candle]**](Candle.md) | candles | ## Example ```python -from lighter.models.blocks import Blocks +from lighter.models.candles import Candles # TODO update the JSON string below json = "{}" -# create an instance of Blocks from a JSON string -blocks_instance = Blocks.from_json(json) +# create an instance of Candles from a JSON string +candles_instance = Candles.from_json(json) # print the JSON string representation of the object -print(Blocks.to_json()) +print(Candles.to_json()) # convert the object into a dict -blocks_dict = blocks_instance.to_dict() -# create an instance of Blocks from a dict -blocks_from_dict = Blocks.from_dict(blocks_dict) +candles_dict = candles_instance.to_dict() +# create an instance of Candles from a dict +candles_from_dict = Candles.from_dict(candles_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Candlestick.md b/docs/Candlestick.md deleted file mode 100644 index c7f48e8..0000000 --- a/docs/Candlestick.md +++ /dev/null @@ -1,40 +0,0 @@ -# Candlestick - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**timestamp** | **int** | | -**open** | **float** | | -**high** | **float** | | -**low** | **float** | | -**close** | **float** | | -**open_raw** | **float** | | -**high_raw** | **float** | | -**low_raw** | **float** | | -**close_raw** | **float** | | -**volume0** | **float** | | -**volume1** | **float** | | -**last_trade_id** | **int** | | - -## Example - -```python -from lighter.models.candlestick import Candlestick - -# TODO update the JSON string below -json = "{}" -# create an instance of Candlestick from a JSON string -candlestick_instance = Candlestick.from_json(json) -# print the JSON string representation of the object -print(Candlestick.to_json()) - -# convert the object into a dict -candlestick_dict = candlestick_instance.to_dict() -# create an instance of Candlestick from a dict -candlestick_from_dict = Candlestick.from_dict(candlestick_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CandlestickApi.md b/docs/CandlestickApi.md index 1515e24..7975c88 100644 --- a/docs/CandlestickApi.md +++ b/docs/CandlestickApi.md @@ -4,23 +4,23 @@ All URIs are relative to *https://mainnet.zklighter.elliot.ai* Method | HTTP request | Description ------------- | ------------- | ------------- -[**candlesticks**](CandlestickApi.md#candlesticks) | **GET** /api/v1/candlesticks | candlesticks +[**candles**](CandlestickApi.md#candles) | **GET** /api/v1/candles | candles [**fundings**](CandlestickApi.md#fundings) | **GET** /api/v1/fundings | fundings -# **candlesticks** -> Candlesticks candlesticks(market_id, resolution, start_timestamp, end_timestamp, count_back, set_timestamp_to_end=set_timestamp_to_end) +# **candles** +> Candles candles(market_id, resolution, start_timestamp, end_timestamp, count_back, set_timestamp_to_end=set_timestamp_to_end) -candlesticks +candles -Get candlesticks +Get candles (optimized with shortened fields and smaller response size) ### Example ```python import lighter -from lighter.models.candlesticks import Candlesticks +from lighter.models.candles import Candles from lighter.rest import ApiException from pprint import pprint @@ -43,12 +43,12 @@ async with lighter.ApiClient(configuration) as api_client: set_timestamp_to_end = False # bool | (optional) (default to False) try: - # candlesticks - api_response = await api_instance.candlesticks(market_id, resolution, start_timestamp, end_timestamp, count_back, set_timestamp_to_end=set_timestamp_to_end) - print("The response of CandlestickApi->candlesticks:\n") + # candles + api_response = await api_instance.candles(market_id, resolution, start_timestamp, end_timestamp, count_back, set_timestamp_to_end=set_timestamp_to_end) + print("The response of CandlestickApi->candles:\n") pprint(api_response) except Exception as e: - print("Exception when calling CandlestickApi->candlesticks: %s\n" % e) + print("Exception when calling CandlestickApi->candles: %s\n" % e) ``` @@ -67,7 +67,7 @@ Name | Type | Description | Notes ### Return type -[**Candlesticks**](Candlesticks.md) +[**Candles**](Candles.md) ### Authorization diff --git a/docs/Candlesticks.md b/docs/Candlesticks.md deleted file mode 100644 index 8c24630..0000000 --- a/docs/Candlesticks.md +++ /dev/null @@ -1,32 +0,0 @@ -# Candlesticks - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | -**message** | **str** | | [optional] -**resolution** | **str** | | -**candlesticks** | [**List[Candlestick]**](Candlestick.md) | | - -## Example - -```python -from lighter.models.candlesticks import Candlesticks - -# TODO update the JSON string below -json = "{}" -# create an instance of Candlesticks from a JSON string -candlesticks_instance = Candlesticks.from_json(json) -# print the JSON string representation of the object -print(Candlesticks.to_json()) - -# convert the object into a dict -candlesticks_dict = candlesticks_instance.to_dict() -# create an instance of Candlesticks from a dict -candlesticks_from_dict = Candlesticks.from_dict(candlesticks_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DetailedAccount.md b/docs/DetailedAccount.md index d96f4b6..13a7b81 100644 --- a/docs/DetailedAccount.md +++ b/docs/DetailedAccount.md @@ -12,10 +12,12 @@ Name | Type | Description | Notes **l1_address** | **str** | | **cancel_all_time** | **int** | | **total_order_count** | **int** | | +**total_isolated_order_count** | **int** | | **pending_order_count** | **int** | | **available_balance** | **str** | | **status** | **int** | | **collateral** | **str** | | +**transaction_time** | **int** | | **account_index** | **int** | | **name** | **str** | | **description** | **str** | | diff --git a/docs/EnrichedTx.md b/docs/EnrichedTx.md index e9b0a32..61b5214 100644 --- a/docs/EnrichedTx.md +++ b/docs/EnrichedTx.md @@ -23,6 +23,7 @@ Name | Type | Description | Notes **sequence_index** | **int** | | **parent_hash** | **str** | | **api_key_index** | **int** | | +**transaction_time** | **int** | | **committed_at** | **int** | | **verified_at** | **int** | | diff --git a/docs/InfoApi.md b/docs/InfoApi.md index 1078327..ce3c263 100644 --- a/docs/InfoApi.md +++ b/docs/InfoApi.md @@ -36,8 +36,8 @@ async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.InfoApi(api_client) account_index = 56 # int | - authorization = 'authorization_example' # str | (optional) - auth = 'auth_example' # str | (optional) + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) to_account_index = -1 # int | (optional) (default to -1) try: @@ -57,8 +57,8 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_index** | **int**| | - **authorization** | **str**| | [optional] - **auth** | **str**| | [optional] + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] **to_account_index** | **int**| | [optional] [default to -1] ### Return type diff --git a/docs/LiqTrade.md b/docs/LiqTrade.md index d9761c4..06f0a8e 100644 --- a/docs/LiqTrade.md +++ b/docs/LiqTrade.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **size** | **str** | | **taker_fee** | **str** | | **maker_fee** | **str** | | +**transaction_time** | **int** | | ## Example diff --git a/docs/Order.md b/docs/Order.md index c1eac6d..d0e7216 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -38,6 +38,7 @@ Name | Type | Description | Notes **timestamp** | **int** | | **created_at** | **int** | | **updated_at** | **int** | | +**transaction_time** | **int** | | ## Example diff --git a/docs/OrderApi.md b/docs/OrderApi.md index 46d6379..34c7cc8 100644 --- a/docs/OrderApi.md +++ b/docs/OrderApi.md @@ -336,8 +336,8 @@ async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.OrderApi(api_client) type = 'type_example' # str | - authorization = 'authorization_example' # str | (optional) - auth = 'auth_example' # str | (optional) + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) account_index = -1 # int | (optional) (default to -1) market_id = 255 # int | (optional) (default to 255) @@ -358,8 +358,8 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **type** | **str**| | - **authorization** | **str**| | [optional] - **auth** | **str**| | [optional] + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] **account_index** | **int**| | [optional] [default to -1] **market_id** | **int**| | [optional] [default to 255] @@ -698,8 +698,8 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.OrderApi(api_client) sort_by = 'sort_by_example' # str | limit = 56 # int | - authorization = 'authorization_example' # str | (optional) - auth = 'auth_example' # str | (optional) + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) market_id = 255 # int | (optional) (default to 255) account_index = -1 # int | (optional) (default to -1) order_index = 56 # int | (optional) @@ -729,8 +729,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **sort_by** | **str**| | **limit** | **int**| | - **authorization** | **str**| | [optional] - **auth** | **str**| | [optional] + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] **market_id** | **int**| | [optional] [default to 255] **account_index** | **int**| | [optional] [default to -1] **order_index** | **int**| | [optional] diff --git a/docs/OrderBookDepthWithBeginNonce.md b/docs/OrderBookDepthWithBeginNonce.md new file mode 100644 index 0000000..7a5d7a1 --- /dev/null +++ b/docs/OrderBookDepthWithBeginNonce.md @@ -0,0 +1,33 @@ +# OrderBookDepthWithBeginNonce + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asks** | [**List[PriceLevel]**](PriceLevel.md) | | +**bids** | [**List[PriceLevel]**](PriceLevel.md) | | +**offset** | **int** | | +**nonce** | **int** | | +**begin_nonce** | **int** | | + +## Example + +```python +from lighter.models.order_book_depth_with_begin_nonce import OrderBookDepthWithBeginNonce + +# TODO update the JSON string below +json = "{}" +# create an instance of OrderBookDepthWithBeginNonce from a JSON string +order_book_depth_with_begin_nonce_instance = OrderBookDepthWithBeginNonce.from_json(json) +# print the JSON string representation of the object +print(OrderBookDepthWithBeginNonce.to_json()) + +# convert the object into a dict +order_book_depth_with_begin_nonce_dict = order_book_depth_with_begin_nonce_instance.to_dict() +# create an instance of OrderBookDepthWithBeginNonce from a dict +order_book_depth_with_begin_nonce_from_dict = OrderBookDepthWithBeginNonce.from_dict(order_book_depth_with_begin_nonce_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReferralApi.md b/docs/ReferralApi.md deleted file mode 100644 index 77c7db1..0000000 --- a/docs/ReferralApi.md +++ /dev/null @@ -1,234 +0,0 @@ -# lighter.ReferralApi - -All URIs are relative to *https://mainnet.zklighter.elliot.ai* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**referral_kickback_update**](ReferralApi.md#referral_kickback_update) | **POST** /api/v1/referral/kickback/update | referral_kickback_update -[**referral_points**](ReferralApi.md#referral_points) | **GET** /api/v1/referral/points | referral_points -[**referral_update**](ReferralApi.md#referral_update) | **POST** /api/v1/referral/update | referral_update - - -# **referral_kickback_update** -> RespUpdateKickback referral_kickback_update(account_index, kickback_percentage, authorization=authorization, auth=auth) - -referral_kickback_update - -Update kickback percentage for referral rewards - -### Example - - -```python -import lighter -from lighter.models.resp_update_kickback import RespUpdateKickback -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.ReferralApi(api_client) - account_index = 56 # int | - kickback_percentage = 3.4 # float | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) - - try: - # referral_kickback_update - api_response = await api_instance.referral_kickback_update(account_index, kickback_percentage, authorization=authorization, auth=auth) - print("The response of ReferralApi->referral_kickback_update:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ReferralApi->referral_kickback_update: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **account_index** | **int**| | - **kickback_percentage** | **float**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - -### Return type - -[**RespUpdateKickback**](RespUpdateKickback.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **referral_points** -> ReferralPoints referral_points(account_index, authorization=authorization, auth=auth) - -referral_points - -Get referral points - -### Example - - -```python -import lighter -from lighter.models.referral_points import ReferralPoints -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.ReferralApi(api_client) - account_index = 56 # int | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) - - try: - # referral_points - api_response = await api_instance.referral_points(account_index, authorization=authorization, auth=auth) - print("The response of ReferralApi->referral_points:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ReferralApi->referral_points: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **account_index** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - -### Return type - -[**ReferralPoints**](ReferralPoints.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **referral_update** -> RespUpdateReferralCode referral_update(account_index, new_referral_code, authorization=authorization, auth=auth) - -referral_update - -Update referral code (allowed once per account) - -### Example - - -```python -import lighter -from lighter.models.resp_update_referral_code import RespUpdateReferralCode -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.ReferralApi(api_client) - account_index = 56 # int | - new_referral_code = 'new_referral_code_example' # str | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) - - try: - # referral_update - api_response = await api_instance.referral_update(account_index, new_referral_code, authorization=authorization, auth=auth) - print("The response of ReferralApi->referral_update:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ReferralApi->referral_update: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **account_index** | **int**| | - **new_referral_code** | **str**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - -### Return type - -[**RespUpdateReferralCode**](RespUpdateReferralCode.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/ReferralPointEntry.md b/docs/ReferralPointEntry.md deleted file mode 100644 index 359a2eb..0000000 --- a/docs/ReferralPointEntry.md +++ /dev/null @@ -1,34 +0,0 @@ -# ReferralPointEntry - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**l1_address** | **str** | | -**total_points** | **float** | | -**week_points** | **float** | | -**total_reward_points** | **float** | | -**week_reward_points** | **float** | | -**reward_point_multiplier** | **str** | | - -## Example - -```python -from lighter.models.referral_point_entry import ReferralPointEntry - -# TODO update the JSON string below -json = "{}" -# create an instance of ReferralPointEntry from a JSON string -referral_point_entry_instance = ReferralPointEntry.from_json(json) -# print the JSON string representation of the object -print(ReferralPointEntry.to_json()) - -# convert the object into a dict -referral_point_entry_dict = referral_point_entry_instance.to_dict() -# create an instance of ReferralPointEntry from a dict -referral_point_entry_from_dict = ReferralPointEntry.from_dict(referral_point_entry_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReferralPoints.md b/docs/ReferralPoints.md deleted file mode 100644 index 4235fa6..0000000 --- a/docs/ReferralPoints.md +++ /dev/null @@ -1,34 +0,0 @@ -# ReferralPoints - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**referrals** | [**List[ReferralPointEntry]**](ReferralPointEntry.md) | | -**user_total_points** | **float** | | -**user_last_week_points** | **float** | | -**user_total_referral_reward_points** | **float** | | -**user_last_week_referral_reward_points** | **float** | | -**reward_point_multiplier** | **str** | | - -## Example - -```python -from lighter.models.referral_points import ReferralPoints - -# TODO update the JSON string below -json = "{}" -# create an instance of ReferralPoints from a JSON string -referral_points_instance = ReferralPoints.from_json(json) -# print the JSON string representation of the object -print(ReferralPoints.to_json()) - -# convert the object into a dict -referral_points_dict = referral_points_instance.to_dict() -# create an instance of ReferralPoints from a dict -referral_points_from_dict = ReferralPoints.from_dict(referral_points_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqDoFaucet.md b/docs/ReqDoFaucet.md new file mode 100644 index 0000000..75bdd3b --- /dev/null +++ b/docs/ReqDoFaucet.md @@ -0,0 +1,30 @@ +# ReqDoFaucet + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**l1_address** | **str** | | +**do_l1_transfer** | **bool** | | [default to False] + +## Example + +```python +from lighter.models.req_do_faucet import ReqDoFaucet + +# TODO update the JSON string below +json = "{}" +# create an instance of ReqDoFaucet from a JSON string +req_do_faucet_instance = ReqDoFaucet.from_json(json) +# print the JSON string representation of the object +print(ReqDoFaucet.to_json()) + +# convert the object into a dict +req_do_faucet_dict = req_do_faucet_instance.to_dict() +# create an instance of ReqDoFaucet from a dict +req_do_faucet_from_dict = ReqDoFaucet.from_dict(req_do_faucet_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReqExportData.md b/docs/ReqExportData.md index 0222e94..0038c48 100644 --- a/docs/ReqExportData.md +++ b/docs/ReqExportData.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth** | **str** | | [optional] +**auth** | **str** | made optional to support header auth clients | [optional] **account_index** | **int** | | [optional] [default to -1] **market_id** | **int** | | [optional] **type** | **str** | | diff --git a/docs/ReqGetAccountActiveOrders.md b/docs/ReqGetAccountActiveOrders.md index d596417..9900779 100644 --- a/docs/ReqGetAccountActiveOrders.md +++ b/docs/ReqGetAccountActiveOrders.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**auth** | **str** | made optional to support header auth clients | [optional] **account_index** | **int** | | **market_id** | **int** | | -**auth** | **str** | made optional to support header auth clients | [optional] ## Example diff --git a/docs/ReqGetAccountPnL.md b/docs/ReqGetAccountPnL.md index 4f5f48d..77233f8 100644 --- a/docs/ReqGetAccountPnL.md +++ b/docs/ReqGetAccountPnL.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth** | **str** | | [optional] +**auth** | **str** | made optional to support header auth clients | [optional] **by** | **str** | | **value** | **str** | | **resolution** | **str** | | diff --git a/docs/ReqGetAccountTxs.md b/docs/ReqGetAccountTxs.md index dbf8ffb..0072602 100644 --- a/docs/ReqGetAccountTxs.md +++ b/docs/ReqGetAccountTxs.md @@ -9,8 +9,8 @@ Name | Type | Description | Notes **limit** | **int** | | [optional] **by** | **str** | | [optional] **value** | **str** | | [optional] +**auth** | **str** | made optional to support header auth clients | [optional] **types** | **List[int]** | | [optional] -**auth** | **str** | | [optional] ## Example diff --git a/docs/ReqGetApiTokens.md b/docs/ReqGetApiTokens.md new file mode 100644 index 0000000..7dc459b --- /dev/null +++ b/docs/ReqGetApiTokens.md @@ -0,0 +1,29 @@ +# ReqGetApiTokens + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_index** | **int** | | + +## Example + +```python +from lighter.models.req_get_api_tokens import ReqGetApiTokens + +# TODO update the JSON string below +json = "{}" +# create an instance of ReqGetApiTokens from a JSON string +req_get_api_tokens_instance = ReqGetApiTokens.from_json(json) +# print the JSON string representation of the object +print(ReqGetApiTokens.to_json()) + +# convert the object into a dict +req_get_api_tokens_dict = req_get_api_tokens_instance.to_dict() +# create an instance of ReqGetApiTokens from a dict +req_get_api_tokens_from_dict = ReqGetApiTokens.from_dict(req_get_api_tokens_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReqGetCandlesticks.md b/docs/ReqGetCandles.md similarity index 59% rename from docs/ReqGetCandlesticks.md rename to docs/ReqGetCandles.md index f6a322f..830834d 100644 --- a/docs/ReqGetCandlesticks.md +++ b/docs/ReqGetCandles.md @@ -1,4 +1,4 @@ -# ReqGetCandlesticks +# ReqGetCandles ## Properties @@ -15,19 +15,19 @@ Name | Type | Description | Notes ## Example ```python -from lighter.models.req_get_candlesticks import ReqGetCandlesticks +from lighter.models.req_get_candles import ReqGetCandles # TODO update the JSON string below json = "{}" -# create an instance of ReqGetCandlesticks from a JSON string -req_get_candlesticks_instance = ReqGetCandlesticks.from_json(json) +# create an instance of ReqGetCandles from a JSON string +req_get_candles_instance = ReqGetCandles.from_json(json) # print the JSON string representation of the object -print(ReqGetCandlesticks.to_json()) +print(ReqGetCandles.to_json()) # convert the object into a dict -req_get_candlesticks_dict = req_get_candlesticks_instance.to_dict() -# create an instance of ReqGetCandlesticks from a dict -req_get_candlesticks_from_dict = ReqGetCandlesticks.from_dict(req_get_candlesticks_dict) +req_get_candles_dict = req_get_candles_instance.to_dict() +# create an instance of ReqGetCandles from a dict +req_get_candles_from_dict = ReqGetCandles.from_dict(req_get_candles_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ReqGetDepositHistory.md b/docs/ReqGetDepositHistory.md index d0f0cc1..37fccdc 100644 --- a/docs/ReqGetDepositHistory.md +++ b/docs/ReqGetDepositHistory.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**account_index** | **int** | | **auth** | **str** | made optional to support header auth clients | [optional] +**account_index** | **int** | | **l1_address** | **str** | | **cursor** | **str** | | [optional] **filter** | **str** | | [optional] diff --git a/docs/ReqGetFastWithdrawInfo.md b/docs/ReqGetFastWithdrawInfo.md index 99a79ec..ce0a224 100644 --- a/docs/ReqGetFastWithdrawInfo.md +++ b/docs/ReqGetFastWithdrawInfo.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**account_index** | **int** | | **auth** | **str** | made optional to support header auth clients | [optional] +**account_index** | **int** | | ## Example diff --git a/docs/ReqGetPositionFunding.md b/docs/ReqGetPositionFunding.md index 83399b2..af72ef1 100644 --- a/docs/ReqGetPositionFunding.md +++ b/docs/ReqGetPositionFunding.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth** | **str** | | [optional] +**auth** | **str** | made optional to support header auth clients | [optional] **account_index** | **int** | | **market_id** | **int** | | [optional] **cursor** | **str** | | [optional] diff --git a/docs/ReqGetPublicPoolsMetadata.md b/docs/ReqGetPublicPoolsMetadata.md index e62dbf5..b1cc952 100644 --- a/docs/ReqGetPublicPoolsMetadata.md +++ b/docs/ReqGetPublicPoolsMetadata.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth** | **str** | | [optional] +**auth** | **str** | made optional to support header auth clients | [optional] **filter** | **str** | | [optional] **index** | **int** | | **limit** | **int** | | diff --git a/docs/ReqGetReferralPoints.md b/docs/ReqGetReferralPoints.md deleted file mode 100644 index 609ae7b..0000000 --- a/docs/ReqGetReferralPoints.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetReferralPoints - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | - -## Example - -```python -from lighter.models.req_get_referral_points import ReqGetReferralPoints - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetReferralPoints from a JSON string -req_get_referral_points_instance = ReqGetReferralPoints.from_json(json) -# print the JSON string representation of the object -print(ReqGetReferralPoints.to_json()) - -# convert the object into a dict -req_get_referral_points_dict = req_get_referral_points_instance.to_dict() -# create an instance of ReqGetReferralPoints from a dict -req_get_referral_points_from_dict = ReqGetReferralPoints.from_dict(req_get_referral_points_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetTrades.md b/docs/ReqGetTrades.md index 2d11282..6ec8aad 100644 --- a/docs/ReqGetTrades.md +++ b/docs/ReqGetTrades.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth** | **str** | | [optional] +**auth** | **str** | made optional to support header auth clients | [optional] **market_id** | **int** | | [optional] **account_index** | **int** | | [optional] [default to -1] **order_index** | **int** | | [optional] diff --git a/docs/ReqGetTransferFeeInfo.md b/docs/ReqGetTransferFeeInfo.md index 84824f7..4715488 100644 --- a/docs/ReqGetTransferFeeInfo.md +++ b/docs/ReqGetTransferFeeInfo.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth** | **str** | | [optional] +**auth** | **str** | made optional to support header auth clients | [optional] **account_index** | **int** | | **to_account_index** | **int** | | [optional] [default to -1] diff --git a/docs/ReqGetTransferHistory.md b/docs/ReqGetTransferHistory.md index cb548fa..8db4675 100644 --- a/docs/ReqGetTransferHistory.md +++ b/docs/ReqGetTransferHistory.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**account_index** | **int** | | **auth** | **str** | made optional to support header auth clients | [optional] +**account_index** | **int** | | **cursor** | **str** | | [optional] ## Example diff --git a/docs/ReqGetWithdrawHistory.md b/docs/ReqGetWithdrawHistory.md index a8297ba..65c6485 100644 --- a/docs/ReqGetWithdrawHistory.md +++ b/docs/ReqGetWithdrawHistory.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**account_index** | **int** | | **auth** | **str** | made optional to support header auth clients | [optional] +**account_index** | **int** | | **cursor** | **str** | | [optional] **filter** | **str** | | [optional] diff --git a/docs/CurrentHeight.md b/docs/RespGetApiTokens.md similarity index 50% rename from docs/CurrentHeight.md rename to docs/RespGetApiTokens.md index f790bae..d05063f 100644 --- a/docs/CurrentHeight.md +++ b/docs/RespGetApiTokens.md @@ -1,4 +1,4 @@ -# CurrentHeight +# RespGetApiTokens ## Properties @@ -7,24 +7,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **int** | | **message** | **str** | | [optional] -**height** | **int** | | +**api_tokens** | [**List[ApiToken]**](ApiToken.md) | | ## Example ```python -from lighter.models.current_height import CurrentHeight +from lighter.models.resp_get_api_tokens import RespGetApiTokens # TODO update the JSON string below json = "{}" -# create an instance of CurrentHeight from a JSON string -current_height_instance = CurrentHeight.from_json(json) +# create an instance of RespGetApiTokens from a JSON string +resp_get_api_tokens_instance = RespGetApiTokens.from_json(json) # print the JSON string representation of the object -print(CurrentHeight.to_json()) +print(RespGetApiTokens.to_json()) # convert the object into a dict -current_height_dict = current_height_instance.to_dict() -# create an instance of CurrentHeight from a dict -current_height_from_dict = CurrentHeight.from_dict(current_height_dict) +resp_get_api_tokens_dict = resp_get_api_tokens_instance.to_dict() +# create an instance of RespGetApiTokens from a dict +resp_get_api_tokens_from_dict = RespGetApiTokens.from_dict(resp_get_api_tokens_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RespGetFastwithdrawalInfo.md b/docs/RespGetFastwithdrawalInfo.md new file mode 100644 index 0000000..91b1919 --- /dev/null +++ b/docs/RespGetFastwithdrawalInfo.md @@ -0,0 +1,33 @@ +# RespGetFastwithdrawalInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**to_account_index** | **int** | | +**withdraw_limit** | **str** | | +**max_withdrawal_amount** | **str** | | + +## Example + +```python +from lighter.models.resp_get_fastwithdrawal_info import RespGetFastwithdrawalInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of RespGetFastwithdrawalInfo from a JSON string +resp_get_fastwithdrawal_info_instance = RespGetFastwithdrawalInfo.from_json(json) +# print the JSON string representation of the object +print(RespGetFastwithdrawalInfo.to_json()) + +# convert the object into a dict +resp_get_fastwithdrawal_info_dict = resp_get_fastwithdrawal_info_instance.to_dict() +# create an instance of RespGetFastwithdrawalInfo from a dict +resp_get_fastwithdrawal_info_from_dict = RespGetFastwithdrawalInfo.from_dict(resp_get_fastwithdrawal_info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RespPostApiToken.md b/docs/RespPostApiToken.md new file mode 100644 index 0000000..baf886f --- /dev/null +++ b/docs/RespPostApiToken.md @@ -0,0 +1,38 @@ +# RespPostApiToken + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**token_id** | **int** | | +**api_token** | **str** | | +**name** | **str** | | +**account_index** | **int** | | +**expiry** | **int** | | +**sub_account_access** | **bool** | | +**revoked** | **bool** | | +**scopes** | **str** | | + +## Example + +```python +from lighter.models.resp_post_api_token import RespPostApiToken + +# TODO update the JSON string below +json = "{}" +# create an instance of RespPostApiToken from a JSON string +resp_post_api_token_instance = RespPostApiToken.from_json(json) +# print the JSON string representation of the object +print(RespPostApiToken.to_json()) + +# convert the object into a dict +resp_post_api_token_dict = resp_post_api_token_instance.to_dict() +# create an instance of RespPostApiToken from a dict +resp_post_api_token_from_dict = RespPostApiToken.from_dict(resp_post_api_token_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RespRevokeApiToken.md b/docs/RespRevokeApiToken.md new file mode 100644 index 0000000..0359746 --- /dev/null +++ b/docs/RespRevokeApiToken.md @@ -0,0 +1,32 @@ +# RespRevokeApiToken + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**token_id** | **int** | | +**revoked** | **bool** | | + +## Example + +```python +from lighter.models.resp_revoke_api_token import RespRevokeApiToken + +# TODO update the JSON string below +json = "{}" +# create an instance of RespRevokeApiToken from a JSON string +resp_revoke_api_token_instance = RespRevokeApiToken.from_json(json) +# print the JSON string representation of the object +print(RespRevokeApiToken.to_json()) + +# convert the object into a dict +resp_revoke_api_token_dict = resp_revoke_api_token_instance.to_dict() +# create an instance of RespRevokeApiToken from a dict +resp_revoke_api_token_from_dict = RespRevokeApiToken.from_dict(resp_revoke_api_token_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RespUpdateKickback.md b/docs/RespUpdateKickback.md deleted file mode 100644 index db81414..0000000 --- a/docs/RespUpdateKickback.md +++ /dev/null @@ -1,31 +0,0 @@ -# RespUpdateKickback - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | -**message** | **str** | | [optional] -**success** | **bool** | | - -## Example - -```python -from lighter.models.resp_update_kickback import RespUpdateKickback - -# TODO update the JSON string below -json = "{}" -# create an instance of RespUpdateKickback from a JSON string -resp_update_kickback_instance = RespUpdateKickback.from_json(json) -# print the JSON string representation of the object -print(RespUpdateKickback.to_json()) - -# convert the object into a dict -resp_update_kickback_dict = resp_update_kickback_instance.to_dict() -# create an instance of RespUpdateKickback from a dict -resp_update_kickback_from_dict = RespUpdateKickback.from_dict(resp_update_kickback_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RespUpdateReferralCode.md b/docs/RespUpdateReferralCode.md deleted file mode 100644 index 0579638..0000000 --- a/docs/RespUpdateReferralCode.md +++ /dev/null @@ -1,31 +0,0 @@ -# RespUpdateReferralCode - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | -**message** | **str** | | [optional] -**success** | **bool** | | - -## Example - -```python -from lighter.models.resp_update_referral_code import RespUpdateReferralCode - -# TODO update the JSON string below -json = "{}" -# create an instance of RespUpdateReferralCode from a JSON string -resp_update_referral_code_instance = RespUpdateReferralCode.from_json(json) -# print the JSON string representation of the object -print(RespUpdateReferralCode.to_json()) - -# convert the object into a dict -resp_update_referral_code_dict = resp_update_referral_code_instance.to_dict() -# create an instance of RespUpdateReferralCode from a dict -resp_update_referral_code_from_dict = RespUpdateReferralCode.from_dict(resp_update_referral_code_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SimpleOrder.md b/docs/SimpleOrder.md index c32315e..8ab2be2 100644 --- a/docs/SimpleOrder.md +++ b/docs/SimpleOrder.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **remaining_base_amount** | **str** | | **price** | **str** | | **order_expiry** | **int** | | +**transaction_time** | **int** | | ## Example diff --git a/docs/Trade.md b/docs/Trade.md index 2e00927..43a5191 100644 --- a/docs/Trade.md +++ b/docs/Trade.md @@ -31,6 +31,7 @@ Name | Type | Description | Notes **maker_entry_quote_before** | **str** | | **maker_initial_margin_fraction_before** | **int** | | **maker_position_sign_changed** | **bool** | | +**transaction_time** | **int** | | ## Example diff --git a/docs/TransactionApi.md b/docs/TransactionApi.md index 01b0ec1..54ab1b3 100644 --- a/docs/TransactionApi.md +++ b/docs/TransactionApi.md @@ -4,8 +4,6 @@ All URIs are relative to *https://mainnet.zklighter.elliot.ai* Method | HTTP request | Description ------------- | ------------- | ------------- -[**account_txs**](TransactionApi.md#account_txs) | **GET** /api/v1/accountTxs | accountTxs -[**block_txs**](TransactionApi.md#block_txs) | **GET** /api/v1/blockTxs | blockTxs [**deposit_history**](TransactionApi.md#deposit_history) | **GET** /api/v1/deposit/history | deposit_history [**next_nonce**](TransactionApi.md#next_nonce) | **GET** /api/v1/nextNonce | nextNonce [**send_tx**](TransactionApi.md#send_tx) | **POST** /api/v1/sendTx | sendTx @@ -13,162 +11,9 @@ Method | HTTP request | Description [**transfer_history**](TransactionApi.md#transfer_history) | **GET** /api/v1/transfer/history | transfer_history [**tx**](TransactionApi.md#tx) | **GET** /api/v1/tx | tx [**tx_from_l1_tx_hash**](TransactionApi.md#tx_from_l1_tx_hash) | **GET** /api/v1/txFromL1TxHash | txFromL1TxHash -[**txs**](TransactionApi.md#txs) | **GET** /api/v1/txs | txs [**withdraw_history**](TransactionApi.md#withdraw_history) | **GET** /api/v1/withdraw/history | withdraw_history -# **account_txs** -> Txs account_txs(limit, by, value, authorization=authorization, index=index, types=types, auth=auth) - -accountTxs - -Get transactions of a specific account - -### Example - - -```python -import lighter -from lighter.models.txs import Txs -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.TransactionApi(api_client) - limit = 56 # int | - by = 'by_example' # str | - value = 'value_example' # str | - authorization = 'authorization_example' # str | (optional) - index = 56 # int | (optional) - types = [56] # List[int] | (optional) - auth = 'auth_example' # str | (optional) - - try: - # accountTxs - api_response = await api_instance.account_txs(limit, by, value, authorization=authorization, index=index, types=types, auth=auth) - print("The response of TransactionApi->account_txs:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling TransactionApi->account_txs: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **int**| | - **by** | **str**| | - **value** | **str**| | - **authorization** | **str**| | [optional] - **index** | **int**| | [optional] - **types** | [**List[int]**](int.md)| | [optional] - **auth** | **str**| | [optional] - -### Return type - -[**Txs**](Txs.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **block_txs** -> Txs block_txs(by, value) - -blockTxs - -Get transactions in a block - -### Example - - -```python -import lighter -from lighter.models.txs import Txs -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.TransactionApi(api_client) - by = 'by_example' # str | - value = 'value_example' # str | - - try: - # blockTxs - api_response = await api_instance.block_txs(by, value) - print("The response of TransactionApi->block_txs:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling TransactionApi->block_txs: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **by** | **str**| | - **value** | **str**| | - -### Return type - -[**Txs**](Txs.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **deposit_history** > DepositHistory deposit_history(account_index, l1_address, authorization=authorization, auth=auth, cursor=cursor, filter=filter) @@ -678,77 +523,6 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **txs** -> Txs txs(limit, index=index) - -txs - -Get transactions which are already packed into blocks - -### Example - - -```python -import lighter -from lighter.models.txs import Txs -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.TransactionApi(api_client) - limit = 56 # int | - index = 56 # int | (optional) - - try: - # txs - api_response = await api_instance.txs(limit, index=index) - print("The response of TransactionApi->txs:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling TransactionApi->txs: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **int**| | - **index** | **int**| | [optional] - -### Return type - -[**Txs**](Txs.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - # **withdraw_history** > WithdrawHistory withdraw_history(account_index, authorization=authorization, auth=auth, cursor=cursor, filter=filter) diff --git a/docs/TransferHistoryItem.md b/docs/TransferHistoryItem.md index b3984ce..56b71aa 100644 --- a/docs/TransferHistoryItem.md +++ b/docs/TransferHistoryItem.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **id** | **str** | | **asset_id** | **int** | | **amount** | **str** | | +**fee** | **str** | | **timestamp** | **int** | | **type** | **str** | | **from_l1_address** | **str** | | diff --git a/docs/Tx.md b/docs/Tx.md deleted file mode 100644 index 193c21e..0000000 --- a/docs/Tx.md +++ /dev/null @@ -1,44 +0,0 @@ -# Tx - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hash** | **str** | | -**type** | **int** | | -**info** | **str** | | -**event_info** | **str** | | -**status** | **int** | | -**transaction_index** | **int** | | -**l1_address** | **str** | | -**account_index** | **int** | | -**nonce** | **int** | | -**expire_at** | **int** | | -**block_height** | **int** | | -**queued_at** | **int** | | -**executed_at** | **int** | | -**sequence_index** | **int** | | -**parent_hash** | **str** | | -**api_key_index** | **int** | | - -## Example - -```python -from lighter.models.tx import Tx - -# TODO update the JSON string below -json = "{}" -# create an instance of Tx from a JSON string -tx_instance = Tx.from_json(json) -# print the JSON string representation of the object -print(Tx.to_json()) - -# convert the object into a dict -tx_dict = tx_instance.to_dict() -# create an instance of Tx from a dict -tx_from_dict = Tx.from_dict(tx_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/examples/get_info.py b/examples/get_info.py index fd44dd2..057f81e 100644 --- a/examples/get_info.py +++ b/examples/get_info.py @@ -21,23 +21,15 @@ async def account_apis(client: lighter.ApiClient): await print_api(account_instance.account, by="l1_address", value=L1_ADDRESS) await print_api(account_instance.account, by="index", value=str(ACCOUNT_INDEX)) await print_api(account_instance.accounts_by_l1_address, l1_address=L1_ADDRESS) - await print_api(account_instance.apikeys, account_index=ACCOUNT_INDEX, api_key_index=1) - await print_api(account_instance.public_pools, filter="all", limit=1, index=0) + await print_api(account_instance.apikeys, account_index=ACCOUNT_INDEX, api_key_index=3) -async def block_apis(client: lighter.ApiClient): - logging.info("BLOCK APIS") - block_instance = lighter.BlockApi(client) - await print_api(block_instance.block, by="height", value="1") - await print_api(block_instance.blocks, index=0, limit=2, sort="asc") - await print_api(block_instance.current_height) - async def candlestick_apis(client: lighter.ApiClient): logging.info("CANDLESTICK APIS") candlestick_instance = lighter.CandlestickApi(client) await print_api( - candlestick_instance.candlesticks, + candlestick_instance.candles, market_id=0, resolution="1h", start_timestamp=int(datetime.datetime.now().timestamp() - 60 * 60 * 24), @@ -66,15 +58,7 @@ async def order_apis(client: lighter.ApiClient): async def transaction_apis(client: lighter.ApiClient): logging.info("TRANSACTION APIS") transaction_instance = lighter.TransactionApi(client) - await print_api(transaction_instance.block_txs, by="block_height", value="1") - await print_api( - transaction_instance.next_nonce, - account_index=int(ACCOUNT_INDEX), - api_key_index=0, - ) - # use with a valid sequence index - # await print_api(transaction_instance.tx, by="sequence_index", value="5") - await print_api(transaction_instance.txs, index=0, limit=2) + # .... async def funding_apis(client: lighter.ApiClient): logging.info("FUNDING APIS") @@ -84,7 +68,6 @@ async def funding_apis(client: lighter.ApiClient): async def main(): client = lighter.ApiClient(configuration=lighter.Configuration(host="https://testnet.zklighter.elliot.ai")) await account_apis(client) - await block_apis(client) await candlestick_apis(client) await order_apis(client) await transaction_apis(client) diff --git a/examples/spot_self_transfer_perp_spot.py b/examples/spot_self_transfer_perp_spot.py index b0962fe..2df6268 100644 --- a/examples/spot_self_transfer_perp_spot.py +++ b/examples/spot_self_transfer_perp_spot.py @@ -1,9 +1,6 @@ import asyncio from utils import default_example_setup -ETH_PRIVATE_KEY = "1234567812345678123456781234567812345678123456781234567812345678" - - async def main(): client, api_client, _ = default_example_setup() @@ -13,8 +10,7 @@ async def main(): return # You can find more notes on transfers in the README.md file, under `Transfer Notes` - transfer_tx, response, err = await client.transfer( - ETH_PRIVATE_KEY, + transfer_tx, response, err = await client.transfer_same_master_account( to_account_index=client.account_index, asset_id=client.ASSET_ID_USDC, amount=1.234567, # decimals are added by sdk diff --git a/examples/spot_self_transfer_spot_perp.py b/examples/spot_self_transfer_spot_perp.py index 52c9afe..cfdc158 100644 --- a/examples/spot_self_transfer_spot_perp.py +++ b/examples/spot_self_transfer_spot_perp.py @@ -1,7 +1,6 @@ import asyncio from utils import default_example_setup -ETH_PRIVATE_KEY = "1234567812345678123456781234567812345678123456781234567812345678" async def main(): @@ -13,8 +12,7 @@ async def main(): return # You can find more notes on transfers in the README.md file, under `Transfer Notes` - transfer_tx, response, err = await client.transfer( - ETH_PRIVATE_KEY, + transfer_tx, response, err = await client.transfer_same_master_account( to_account_index=client.account_index, asset_id=client.ASSET_ID_USDC, amount=1.234567, # decimals are added by sdk @@ -30,5 +28,8 @@ async def main(): lev_tx, response, err = await client.update_leverage(4, client.CROSS_MARGIN_MODE, 3) print(lev_tx, response, err) + await client.close() + await api_client.close() + if __name__ == "__main__": asyncio.run(main()) \ No newline at end of file diff --git a/examples/sub_account_transfer_eth.py b/examples/sub_account_transfer_eth.py index 5fb8cb0..b5d088a 100644 --- a/examples/sub_account_transfer_eth.py +++ b/examples/sub_account_transfer_eth.py @@ -1,8 +1,7 @@ import asyncio from utils import default_example_setup -ETH_PRIVATE_KEY = "1234567812345678123456781234567812345678123456781234567812345678" -TO_ACCOUNT_INDEX = 281474976710649 +TO_ACCOUNT_INDEX = 281474976710648 async def main(): client, api_client, _ = default_example_setup() @@ -13,8 +12,7 @@ async def main(): return # You can find more notes on transfers in the README.md file, under `Transfer Notes` - transfer_tx, response, err = await client.transfer( - ETH_PRIVATE_KEY, + transfer_tx, response, err = await client.transfer_same_master_account( to_account_index=TO_ACCOUNT_INDEX, asset_id=client.ASSET_ID_ETH, amount=0.4, # decimals are added by sdk diff --git a/examples/sub_account_transfer_usdc.py b/examples/sub_account_transfer_usdc.py index d253be5..6ed8032 100644 --- a/examples/sub_account_transfer_usdc.py +++ b/examples/sub_account_transfer_usdc.py @@ -1,8 +1,7 @@ import asyncio from utils import default_example_setup -ETH_PRIVATE_KEY = "1234567812345678123456781234567812345678123456781234567812345678" -TO_ACCOUNT_INDEX = 281474976710649 +TO_ACCOUNT_INDEX = 281474976710648 async def main(): client, api_client, _ = default_example_setup() @@ -13,8 +12,7 @@ async def main(): return # You can find more notes on transfers in the README.md file, under `Transfer Notes` - transfer_tx, response, err = await client.transfer( - ETH_PRIVATE_KEY, + transfer_tx, response, err = await client.transfer_same_master_account( to_account_index=TO_ACCOUNT_INDEX, asset_id=client.ASSET_ID_USDC, amount=100, # decimals are added by sdk @@ -26,6 +24,8 @@ async def main(): if err is not None: raise Exception(f"error transferring {err}") print(transfer_tx, response) + await client.close() + await api_client.close() if __name__ == "__main__": diff --git a/examples/transfer_same_master_account.py b/examples/transfer_same_master_account.py new file mode 100644 index 0000000..e3474a9 --- /dev/null +++ b/examples/transfer_same_master_account.py @@ -0,0 +1,37 @@ +import asyncio +import lighter +from utils import default_example_setup + +TO_ACCOUNT_INDEX = 281474976710648 # same master account + + +async def main(): + client, api_client, _ = default_example_setup() + info_api = lighter.InfoApi(api_client) + + auth_token, err = client.create_auth_token_with_expiry() + if err: + raise Exception(f"Auth token failed: {err}") + + fee_info = await info_api.transfer_fee_info(client.account_index, authorization=auth_token, auth=auth_token, to_account_index=TO_ACCOUNT_INDEX) + + # You can find more notes on transfers in the README.md file, under `Transfer Notes` + transfer_tx, response, err = await client.transfer_same_master_account( + to_account_index=TO_ACCOUNT_INDEX, + asset_id=client.ASSET_ID_USDC, + route_from=client.ROUTE_PERP, + route_to=client.ROUTE_PERP, + amount=5, # decimals are added by sdk + fee=fee_info.transfer_fee_usdc, + memo="0x" + "00" * 32, + ) + if err is not None: + raise Exception(f"error transferring {err}") + + print(transfer_tx, response) + await client.close() + await api_client.close() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/lighter/__init__.py b/lighter/__init__.py index afcc0a9..06f063c 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -19,14 +19,12 @@ # import apis into sdk package from lighter.api.account_api import AccountApi from lighter.api.announcement_api import AnnouncementApi -from lighter.api.block_api import BlockApi from lighter.api.bridge_api import BridgeApi from lighter.api.candlestick_api import CandlestickApi from lighter.api.funding_api import FundingApi from lighter.api.info_api import InfoApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi -from lighter.api.referral_api import ReferralApi from lighter.api.root_api import RootApi from lighter.api.transaction_api import TransactionApi @@ -57,16 +55,15 @@ from lighter.models.announcement import Announcement from lighter.models.announcements import Announcements from lighter.models.api_key import ApiKey +from lighter.models.api_token import ApiToken from lighter.models.asset import Asset from lighter.models.asset_details import AssetDetails -from lighter.models.block import Block -from lighter.models.blocks import Blocks +from lighter.models.auth import Auth from lighter.models.bridge import Bridge from lighter.models.bridge_supported_network import BridgeSupportedNetwork -from lighter.models.candlestick import Candlestick -from lighter.models.candlesticks import Candlesticks +from lighter.models.candle import Candle +from lighter.models.candles import Candles from lighter.models.contract_address import ContractAddress -from lighter.models.current_height import CurrentHeight from lighter.models.cursor import Cursor from lighter.models.daily_return import DailyReturn from lighter.models.deposit_history import DepositHistory @@ -92,6 +89,7 @@ from lighter.models.order import Order from lighter.models.order_book import OrderBook from lighter.models.order_book_depth import OrderBookDepth +from lighter.models.order_book_depth_with_begin_nonce import OrderBookDepthWithBeginNonce from lighter.models.order_book_details import OrderBookDetails from lighter.models.order_book_orders import OrderBookOrders from lighter.models.order_book_stats import OrderBookStats @@ -106,8 +104,7 @@ from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_metadata import PublicPoolMetadata from lighter.models.public_pool_share import PublicPoolShare -from lighter.models.referral_point_entry import ReferralPointEntry -from lighter.models.referral_points import ReferralPoints +from lighter.models.req_do_faucet import ReqDoFaucet from lighter.models.req_export_data import ReqExportData from lighter.models.req_get_account import ReqGetAccount from lighter.models.req_get_account_active_orders import ReqGetAccountActiveOrders @@ -118,12 +115,13 @@ from lighter.models.req_get_account_metadata import ReqGetAccountMetadata from lighter.models.req_get_account_pn_l import ReqGetAccountPnL from lighter.models.req_get_account_txs import ReqGetAccountTxs +from lighter.models.req_get_api_tokens import ReqGetApiTokens from lighter.models.req_get_asset_details import ReqGetAssetDetails from lighter.models.req_get_block import ReqGetBlock from lighter.models.req_get_block_txs import ReqGetBlockTxs from lighter.models.req_get_bridges_by_l1_addr import ReqGetBridgesByL1Addr from lighter.models.req_get_by_account import ReqGetByAccount -from lighter.models.req_get_candlesticks import ReqGetCandlesticks +from lighter.models.req_get_candles import ReqGetCandles from lighter.models.req_get_deposit_history import ReqGetDepositHistory from lighter.models.req_get_fast_withdraw_info import ReqGetFastWithdrawInfo from lighter.models.req_get_fundings import ReqGetFundings @@ -141,21 +139,22 @@ 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_recent_trades import ReqGetRecentTrades -from lighter.models.req_get_referral_points import ReqGetReferralPoints from lighter.models.req_get_trades import ReqGetTrades from lighter.models.req_get_transfer_fee_info import ReqGetTransferFeeInfo from lighter.models.req_get_transfer_history import ReqGetTransferHistory from lighter.models.req_get_tx import ReqGetTx from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory from lighter.models.resp_change_account_tier import RespChangeAccountTier +from lighter.models.resp_get_api_tokens import RespGetApiTokens from lighter.models.resp_get_bridges_by_l1_addr import RespGetBridgesByL1Addr from lighter.models.resp_get_fast_bridge_info import RespGetFastBridgeInfo +from lighter.models.resp_get_fastwithdrawal_info import RespGetFastwithdrawalInfo from lighter.models.resp_get_is_next_bridge_fast import RespGetIsNextBridgeFast +from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata +from lighter.models.resp_revoke_api_token import RespRevokeApiToken from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch -from lighter.models.resp_update_kickback import RespUpdateKickback -from lighter.models.resp_update_referral_code import RespUpdateReferralCode from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode from lighter.models.risk_info import RiskInfo @@ -172,10 +171,8 @@ from lighter.models.transfer_fee_info import TransferFeeInfo from lighter.models.transfer_history import TransferHistory from lighter.models.transfer_history_item import TransferHistoryItem -from lighter.models.tx import Tx from lighter.models.tx_hash import TxHash from lighter.models.tx_hashes import TxHashes -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_item import WithdrawHistoryItem diff --git a/lighter/api/__init__.py b/lighter/api/__init__.py index a238373..6e2b365 100644 --- a/lighter/api/__init__.py +++ b/lighter/api/__init__.py @@ -3,14 +3,12 @@ # import apis into api package from lighter.api.account_api import AccountApi from lighter.api.announcement_api import AnnouncementApi -from lighter.api.block_api import BlockApi from lighter.api.bridge_api import BridgeApi from lighter.api.candlestick_api import CandlestickApi from lighter.api.funding_api import FundingApi from lighter.api.info_api import InfoApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi -from lighter.api.referral_api import ReferralApi from lighter.api.root_api import RootApi from lighter.api.transaction_api import TransactionApi diff --git a/lighter/api/account_api.py b/lighter/api/account_api.py index 688ac0f..2a689ff 100644 --- a/lighter/api/account_api.py +++ b/lighter/api/account_api.py @@ -28,7 +28,11 @@ from lighter.models.liquidation_infos import LiquidationInfos from lighter.models.position_fundings import PositionFundings from lighter.models.resp_change_account_tier import RespChangeAccountTier +from lighter.models.resp_get_api_tokens import RespGetApiTokens +from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata +from lighter.models.resp_revoke_api_token import RespRevokeApiToken +from lighter.models.result_code import ResultCode from lighter.models.sub_accounts import SubAccounts from lighter.api_client import ApiClient, RequestSerialized @@ -49,7 +53,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call async def account( self, by: StrictStr, @@ -121,7 +124,6 @@ async def account( ).data - @validate_call async def account_with_http_info( self, by: StrictStr, @@ -193,7 +195,6 @@ async def account_with_http_info( ) - @validate_call async def account_without_preload_content( self, by: StrictStr, @@ -329,7 +330,6 @@ def _account_serialize( - @validate_call async def account_limits( self, account_index: StrictInt, @@ -405,7 +405,6 @@ async def account_limits( ).data - @validate_call async def account_limits_with_http_info( self, account_index: StrictInt, @@ -481,7 +480,6 @@ async def account_limits_with_http_info( ) - @validate_call async def account_limits_without_preload_content( self, account_index: StrictInt, @@ -582,13 +580,15 @@ def _account_limits_serialize( _query_params.append(('account_index', account_index)) + if authorization is not None: + + _query_params.append(('authorization', authorization)) + if auth is not None: _query_params.append(('auth', auth)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -624,7 +624,6 @@ def _account_limits_serialize( - @validate_call async def account_metadata( self, by: StrictStr, @@ -704,7 +703,6 @@ async def account_metadata( ).data - @validate_call async def account_metadata_with_http_info( self, by: StrictStr, @@ -784,7 +782,6 @@ async def account_metadata_with_http_info( ) - @validate_call async def account_metadata_without_preload_content( self, by: StrictStr, @@ -936,7 +933,6 @@ def _account_metadata_serialize( - @validate_call async def accounts_by_l1_address( self, l1_address: StrictStr, @@ -1004,7 +1000,6 @@ async def accounts_by_l1_address( ).data - @validate_call async def accounts_by_l1_address_with_http_info( self, l1_address: StrictStr, @@ -1072,7 +1067,6 @@ async def accounts_by_l1_address_with_http_info( ) - @validate_call async def accounts_by_l1_address_without_preload_content( self, l1_address: StrictStr, @@ -1199,7 +1193,6 @@ def _accounts_by_l1_address_serialize( - @validate_call async def apikeys( self, account_index: StrictInt, @@ -1271,7 +1264,6 @@ async def apikeys( ).data - @validate_call async def apikeys_with_http_info( self, account_index: StrictInt, @@ -1343,7 +1335,6 @@ async def apikeys_with_http_info( ) - @validate_call async def apikeys_without_preload_content( self, account_index: StrictInt, @@ -1479,7 +1470,6 @@ def _apikeys_serialize( - @validate_call async def change_account_tier( self, account_index: StrictInt, @@ -1559,7 +1549,6 @@ async def change_account_tier( ).data - @validate_call async def change_account_tier_with_http_info( self, account_index: StrictInt, @@ -1639,7 +1628,6 @@ async def change_account_tier_with_http_info( ) - @validate_call async def change_account_tier_without_preload_content( self, account_index: StrictInt, @@ -1798,7 +1786,283 @@ def _change_account_tier_serialize( - @validate_call + async def faucet( + self, + l1_address: StrictStr, + do_l1_transfer: StrictBool, + _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, + ) -> ResultCode: + """faucet + + Request funds from faucet + + :param l1_address: (required) + :type l1_address: str + :param do_l1_transfer: (required) + :type do_l1_transfer: bool + :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._faucet_serialize( + l1_address=l1_address, + do_l1_transfer=do_l1_transfer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultCode", + '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 + + + async def faucet_with_http_info( + self, + l1_address: StrictStr, + do_l1_transfer: StrictBool, + _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[ResultCode]: + """faucet + + Request funds from faucet + + :param l1_address: (required) + :type l1_address: str + :param do_l1_transfer: (required) + :type do_l1_transfer: bool + :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._faucet_serialize( + l1_address=l1_address, + do_l1_transfer=do_l1_transfer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultCode", + '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, + ) + + + async def faucet_without_preload_content( + self, + l1_address: StrictStr, + do_l1_transfer: StrictBool, + _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: + """faucet + + Request funds from faucet + + :param l1_address: (required) + :type l1_address: str + :param do_l1_transfer: (required) + :type do_l1_transfer: bool + :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._faucet_serialize( + l1_address=l1_address, + do_l1_transfer=do_l1_transfer, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _faucet_serialize( + self, + l1_address, + do_l1_transfer, + _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 do_l1_transfer is not None: + + _query_params.append(('do_l1_transfer', do_l1_transfer)) + + # 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/faucet', + 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 + ) + + + + async def l1_metadata( self, l1_address: StrictStr, @@ -1874,7 +2138,6 @@ async def l1_metadata( ).data - @validate_call async def l1_metadata_with_http_info( self, l1_address: StrictStr, @@ -1950,7 +2213,6 @@ async def l1_metadata_with_http_info( ) - @validate_call async def l1_metadata_without_preload_content( self, l1_address: StrictStr, @@ -2093,7 +2355,6 @@ def _l1_metadata_serialize( - @validate_call async def liquidations( self, account_index: StrictInt, @@ -2181,7 +2442,6 @@ async def liquidations( ).data - @validate_call async def liquidations_with_http_info( self, account_index: StrictInt, @@ -2269,7 +2529,6 @@ async def liquidations_with_http_info( ) - @validate_call async def liquidations_without_preload_content( self, account_index: StrictInt, @@ -2381,6 +2640,10 @@ def _liquidations_serialize( # process the path parameters # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + if auth is not None: _query_params.append(('auth', auth)) @@ -2402,8 +2665,6 @@ def _liquidations_serialize( _query_params.append(('limit', limit)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -2439,7 +2700,6 @@ def _liquidations_serialize( - @validate_call async def pnl( self, by: StrictStr, @@ -2448,9 +2708,9 @@ async def pnl( start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, - ignore_transfers: Optional[StrictBool] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + ignore_transfers: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2480,9 +2740,9 @@ async def pnl( :type end_timestamp: int :param count_back: (required) :type count_back: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param ignore_transfers: :type ignore_transfers: bool @@ -2539,7 +2799,6 @@ async def pnl( ).data - @validate_call async def pnl_with_http_info( self, by: StrictStr, @@ -2548,8 +2807,8 @@ async def pnl_with_http_info( start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, ignore_transfers: Optional[StrictBool] = None, _request_timeout: Union[ None, @@ -2580,9 +2839,9 @@ async def pnl_with_http_info( :type end_timestamp: int :param count_back: (required) :type count_back: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param ignore_transfers: :type ignore_transfers: bool @@ -2639,7 +2898,6 @@ async def pnl_with_http_info( ) - @validate_call async def pnl_without_preload_content( self, by: StrictStr, @@ -2648,8 +2906,8 @@ async def pnl_without_preload_content( start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, ignore_transfers: Optional[StrictBool] = None, _request_timeout: Union[ None, @@ -2680,9 +2938,9 @@ async def pnl_without_preload_content( :type end_timestamp: int :param count_back: (required) :type count_back: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param ignore_transfers: :type ignore_transfers: bool @@ -2766,6 +3024,10 @@ def _pnl_serialize( # process the path parameters # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + if auth is not None: _query_params.append(('auth', auth)) @@ -2799,8 +3061,6 @@ def _pnl_serialize( _query_params.append(('ignore_transfers', ignore_transfers)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -2836,13 +3096,12 @@ def _pnl_serialize( - @validate_call async def position_funding( self, account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, market_id: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, side: Optional[StrictStr] = None, @@ -2867,9 +3126,9 @@ async def position_funding( :type account_index: int :param limit: (required) :type limit: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param market_id: :type market_id: int @@ -2928,13 +3187,12 @@ async def position_funding( ).data - @validate_call async def position_funding_with_http_info( self, account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, market_id: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, side: Optional[StrictStr] = None, @@ -2959,9 +3217,9 @@ async def position_funding_with_http_info( :type account_index: int :param limit: (required) :type limit: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param market_id: :type market_id: int @@ -3020,13 +3278,12 @@ async def position_funding_with_http_info( ) - @validate_call async def position_funding_without_preload_content( self, account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, market_id: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, side: Optional[StrictStr] = None, @@ -3051,9 +3308,9 @@ async def position_funding_without_preload_content( :type account_index: int :param limit: (required) :type limit: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param market_id: :type market_id: int @@ -3137,6 +3394,10 @@ def _position_funding_serialize( # process the path parameters # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + if auth is not None: _query_params.append(('auth', auth)) @@ -3162,8 +3423,6 @@ def _position_funding_serialize( _query_params.append(('side', side)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -3198,13 +3457,13 @@ def _position_funding_serialize( - @validate_call + async def public_pools_metadata( self, index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, filter: Optional[StrictStr] = None, account_index: Optional[StrictInt] = None, _request_timeout: Union[ @@ -3228,9 +3487,9 @@ async def public_pools_metadata( :type index: int :param limit: (required) :type limit: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param filter: :type filter: str @@ -3286,13 +3545,12 @@ async def public_pools_metadata( ).data - @validate_call async def public_pools_metadata_with_http_info( self, index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, filter: Optional[StrictStr] = None, account_index: Optional[StrictInt] = None, _request_timeout: Union[ @@ -3316,9 +3574,9 @@ async def public_pools_metadata_with_http_info( :type index: int :param limit: (required) :type limit: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param filter: :type filter: str @@ -3374,13 +3632,12 @@ async def public_pools_metadata_with_http_info( ) - @validate_call async def public_pools_metadata_without_preload_content( self, index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, filter: Optional[StrictStr] = None, account_index: Optional[StrictInt] = None, _request_timeout: Union[ @@ -3404,9 +3661,9 @@ async def public_pools_metadata_without_preload_content( :type index: int :param limit: (required) :type limit: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param filter: :type filter: str @@ -3486,6 +3743,10 @@ def _public_pools_metadata_serialize( # process the path parameters # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + if auth is not None: _query_params.append(('auth', auth)) @@ -3507,8 +3768,6 @@ def _public_pools_metadata_serialize( _query_params.append(('account_index', account_index)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -3542,3 +3801,925 @@ def _public_pools_metadata_serialize( ) + + + async def tokens( + self, + account_index: StrictInt, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = 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, + ) -> RespGetApiTokens: + """tokens + + Get api tokens of an account + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: 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._tokens_serialize( + account_index=account_index, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetApiTokens", + '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 + + + async def tokens_with_http_info( + self, + account_index: StrictInt, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = 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[RespGetApiTokens]: + """tokens + + Get api tokens of an account + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: 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._tokens_serialize( + account_index=account_index, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetApiTokens", + '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, + ) + + + async def tokens_without_preload_content( + self, + account_index: StrictInt, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = 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: + """tokens + + Get api tokens of an account + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: 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._tokens_serialize( + account_index=account_index, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetApiTokens", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tokens_serialize( + self, + account_index, + authorization, + _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)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # 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/tokens', + 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 + ) + + + + + async def tokens_create( + self, + name: StrictStr, + account_index: StrictInt, + expiry: StrictInt, + sub_account_access: StrictBool, + authorization: Optional[StrictStr] = None, + scopes: 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, + ) -> RespPostApiToken: + """tokens_create + + Create api token + + :param name: (required) + :type name: str + :param account_index: (required) + :type account_index: int + :param expiry: (required) + :type expiry: int + :param sub_account_access: (required) + :type sub_account_access: bool + :param authorization: + :type authorization: str + :param scopes: + :type scopes: 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._tokens_create_serialize( + name=name, + account_index=account_index, + expiry=expiry, + sub_account_access=sub_account_access, + authorization=authorization, + scopes=scopes, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespPostApiToken", + '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 + + + async def tokens_create_with_http_info( + self, + name: StrictStr, + account_index: StrictInt, + expiry: StrictInt, + sub_account_access: StrictBool, + authorization: Optional[StrictStr] = None, + scopes: 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[RespPostApiToken]: + """tokens_create + + Create api token + + :param name: (required) + :type name: str + :param account_index: (required) + :type account_index: int + :param expiry: (required) + :type expiry: int + :param sub_account_access: (required) + :type sub_account_access: bool + :param authorization: + :type authorization: str + :param scopes: + :type scopes: 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._tokens_create_serialize( + name=name, + account_index=account_index, + expiry=expiry, + sub_account_access=sub_account_access, + authorization=authorization, + scopes=scopes, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespPostApiToken", + '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, + ) + + + async def tokens_create_without_preload_content( + self, + name: StrictStr, + account_index: StrictInt, + expiry: StrictInt, + sub_account_access: StrictBool, + authorization: Optional[StrictStr] = None, + scopes: 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: + """tokens_create + + Create api token + + :param name: (required) + :type name: str + :param account_index: (required) + :type account_index: int + :param expiry: (required) + :type expiry: int + :param sub_account_access: (required) + :type sub_account_access: bool + :param authorization: + :type authorization: str + :param scopes: + :type scopes: 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._tokens_create_serialize( + name=name, + account_index=account_index, + expiry=expiry, + sub_account_access=sub_account_access, + authorization=authorization, + scopes=scopes, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespPostApiToken", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tokens_create_serialize( + self, + name, + account_index, + expiry, + sub_account_access, + authorization, + scopes, + _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 + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + if name is not None: + _form_params.append(('name', name)) + if account_index is not None: + _form_params.append(('account_index', account_index)) + if expiry is not None: + _form_params.append(('expiry', expiry)) + if sub_account_access is not None: + _form_params.append(('sub_account_access', sub_account_access)) + if scopes is not None: + _form_params.append(('scopes', scopes)) + # 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' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/tokens/create', + 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 + ) + + + + + async def tokens_revoke( + self, + token_id: StrictInt, + account_index: StrictInt, + authorization: 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, + ) -> RespRevokeApiToken: + """tokens_revoke + + Revoke api token + + :param token_id: (required) + :type token_id: int + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: 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._tokens_revoke_serialize( + token_id=token_id, + account_index=account_index, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespRevokeApiToken", + '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 + + + async def tokens_revoke_with_http_info( + self, + token_id: StrictInt, + account_index: StrictInt, + authorization: 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[RespRevokeApiToken]: + """tokens_revoke + + Revoke api token + + :param token_id: (required) + :type token_id: int + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: 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._tokens_revoke_serialize( + token_id=token_id, + account_index=account_index, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespRevokeApiToken", + '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, + ) + + + async def tokens_revoke_without_preload_content( + self, + token_id: StrictInt, + account_index: StrictInt, + authorization: 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: + """tokens_revoke + + Revoke api token + + :param token_id: (required) + :type token_id: int + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: 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._tokens_revoke_serialize( + token_id=token_id, + account_index=account_index, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespRevokeApiToken", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tokens_revoke_serialize( + self, + token_id, + account_index, + authorization, + _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 + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + if token_id is not None: + _form_params.append(('token_id', token_id)) + if account_index is not None: + _form_params.append(('account_index', account_index)) + # 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' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/tokens/revoke', + 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 + ) + + diff --git a/lighter/api/announcement_api.py b/lighter/api/announcement_api.py index 7eaa982..2f62113 100644 --- a/lighter/api/announcement_api.py +++ b/lighter/api/announcement_api.py @@ -36,7 +36,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call async def announcement( self, _request_timeout: Union[ @@ -100,7 +99,6 @@ async def announcement( ).data - @validate_call async def announcement_with_http_info( self, _request_timeout: Union[ @@ -164,7 +162,6 @@ async def announcement_with_http_info( ) - @validate_call async def announcement_without_preload_content( self, _request_timeout: Union[ diff --git a/lighter/api/block_api.py b/lighter/api/block_api.py deleted file mode 100644 index e09888a..0000000 --- a/lighter/api/block_api.py +++ /dev/null @@ -1,863 +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 warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import Optional -from typing_extensions import Annotated -from lighter.models.blocks import Blocks -from lighter.models.current_height import CurrentHeight - -from lighter.api_client import ApiClient, RequestSerialized -from lighter.api_response import ApiResponse -from lighter.rest import RESTResponseType - - -class BlockApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - async def block( - self, - by: StrictStr, - value: 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, - ) -> Blocks: - """block - - Get block by its height or commitment - - :param by: (required) - :type by: str - :param value: (required) - :type value: 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._block_serialize( - by=by, - value=value, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Blocks", - '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 block_with_http_info( - self, - by: StrictStr, - value: 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[Blocks]: - """block - - Get block by its height or commitment - - :param by: (required) - :type by: str - :param value: (required) - :type value: 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._block_serialize( - by=by, - value=value, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Blocks", - '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 block_without_preload_content( - self, - by: StrictStr, - value: 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: - """block - - Get block by its height or commitment - - :param by: (required) - :type by: str - :param value: (required) - :type value: 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._block_serialize( - by=by, - value=value, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Blocks", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _block_serialize( - self, - by, - value, - _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 by is not None: - - _query_params.append(('by', by)) - - if value is not None: - - _query_params.append(('value', value)) - - # 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/block', - 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 blocks( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - index: Optional[StrictInt] = None, - sort: 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, - ) -> Blocks: - """blocks - - Get blocks - - :param limit: (required) - :type limit: int - :param index: - :type index: int - :param sort: - :type sort: 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._blocks_serialize( - limit=limit, - index=index, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Blocks", - '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 blocks_with_http_info( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - index: Optional[StrictInt] = None, - sort: 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[Blocks]: - """blocks - - Get blocks - - :param limit: (required) - :type limit: int - :param index: - :type index: int - :param sort: - :type sort: 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._blocks_serialize( - limit=limit, - index=index, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Blocks", - '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 blocks_without_preload_content( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - index: Optional[StrictInt] = None, - sort: 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: - """blocks - - Get blocks - - :param limit: (required) - :type limit: int - :param index: - :type index: int - :param sort: - :type sort: 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._blocks_serialize( - limit=limit, - index=index, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Blocks", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _blocks_serialize( - self, - limit, - index, - sort, - _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 index is not None: - - _query_params.append(('index', index)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # 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/blocks', - 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 current_height( - self, - _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, - ) -> CurrentHeight: - """currentHeight - - Get current height - - :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._current_height_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CurrentHeight", - '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 current_height_with_http_info( - self, - _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[CurrentHeight]: - """currentHeight - - Get current height - - :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._current_height_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CurrentHeight", - '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 current_height_without_preload_content( - self, - _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: - """currentHeight - - Get current height - - :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._current_height_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "CurrentHeight", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _current_height_serialize( - self, - _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 - # 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/currentHeight', - 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 - ) - - diff --git a/lighter/api/bridge_api.py b/lighter/api/bridge_api.py index 73e739f..6f1fb9b 100644 --- a/lighter/api/bridge_api.py +++ b/lighter/api/bridge_api.py @@ -16,10 +16,14 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr +from pydantic import Field, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated from lighter.models.resp_get_bridges_by_l1_addr import RespGetBridgesByL1Addr from lighter.models.resp_get_fast_bridge_info import RespGetFastBridgeInfo +from lighter.models.resp_get_fastwithdrawal_info import RespGetFastwithdrawalInfo from lighter.models.resp_get_is_next_bridge_fast import RespGetIsNextBridgeFast +from lighter.models.result_code import ResultCode from lighter.api_client import ApiClient, RequestSerialized from lighter.api_response import ApiResponse @@ -622,7 +626,6 @@ async def fastbridge_info( ).data - @validate_call async def fastbridge_info_with_http_info( self, _request_timeout: Union[ @@ -686,7 +689,6 @@ async def fastbridge_info_with_http_info( ) - @validate_call async def fastbridge_info_without_preload_content( self, _request_timeout: Union[ @@ -802,3 +804,613 @@ def _fastbridge_info_serialize( ) + + + async def fastwithdraw( + self, + tx_info: StrictStr, + to_address: StrictStr, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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, + ) -> ResultCode: + """fastwithdraw + + Fast withdraw + + :param tx_info: (required) + :type tx_info: str + :param to_address: (required) + :type to_address: str + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: 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._fastwithdraw_serialize( + tx_info=tx_info, + to_address=to_address, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultCode", + '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 + + + async def fastwithdraw_with_http_info( + self, + tx_info: StrictStr, + to_address: StrictStr, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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[ResultCode]: + """fastwithdraw + + Fast withdraw + + :param tx_info: (required) + :type tx_info: str + :param to_address: (required) + :type to_address: str + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: 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._fastwithdraw_serialize( + tx_info=tx_info, + to_address=to_address, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultCode", + '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, + ) + + + async def fastwithdraw_without_preload_content( + self, + tx_info: StrictStr, + to_address: StrictStr, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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: + """fastwithdraw + + Fast withdraw + + :param tx_info: (required) + :type tx_info: str + :param to_address: (required) + :type to_address: str + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: 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._fastwithdraw_serialize( + tx_info=tx_info, + to_address=to_address, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fastwithdraw_serialize( + self, + tx_info, + to_address, + authorization, + auth, + _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 + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + if tx_info is not None: + _form_params.append(('tx_info', tx_info)) + if to_address is not None: + _form_params.append(('to_address', to_address)) + if auth is not None: + _form_params.append(('auth', auth)) + # 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' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/fastwithdraw', + 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 + ) + + + + + async def fastwithdraw_info( + self, + account_index: StrictInt, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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, + ) -> RespGetFastwithdrawalInfo: + """fastwithdraw_info + + Get fast withdraw info + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: 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._fastwithdraw_info_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetFastwithdrawalInfo", + '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 + + + async def fastwithdraw_info_with_http_info( + self, + account_index: StrictInt, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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[RespGetFastwithdrawalInfo]: + """fastwithdraw_info + + Get fast withdraw info + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: 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._fastwithdraw_info_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetFastwithdrawalInfo", + '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, + ) + + + async def fastwithdraw_info_without_preload_content( + self, + account_index: StrictInt, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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: + """fastwithdraw_info + + Get fast withdraw info + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: 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._fastwithdraw_info_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetFastwithdrawalInfo", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fastwithdraw_info_serialize( + self, + account_index, + authorization, + auth, + _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 authorization is not None: + + _query_params.append(('authorization', authorization)) + + if auth is not None: + + _query_params.append(('auth', auth)) + + if account_index is not None: + + _query_params.append(('account_index', account_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/fastwithdraw/info', + 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 + ) + + diff --git a/lighter/api/candlestick_api.py b/lighter/api/candlestick_api.py index c964c30..2486ab1 100644 --- a/lighter/api/candlestick_api.py +++ b/lighter/api/candlestick_api.py @@ -19,7 +19,7 @@ from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Optional from typing_extensions import Annotated -from lighter.models.candlesticks import Candlesticks +from lighter.models.candles import Candles from lighter.models.fundings import Fundings from lighter.api_client import ApiClient, RequestSerialized @@ -40,8 +40,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call - async def candlesticks( + async def candles( self, market_id: StrictInt, resolution: StrictStr, @@ -61,10 +60,10 @@ async def candlesticks( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Candlesticks: - """candlesticks + ) -> Candles: + """candles - Get candlesticks + Get candles (optimized with shortened fields and smaller response size) :param market_id: (required) :type market_id: int @@ -100,7 +99,7 @@ async def candlesticks( :return: Returns the result object. """ # noqa: E501 - _param = self._candlesticks_serialize( + _param = self._candles_serialize( market_id=market_id, resolution=resolution, start_timestamp=start_timestamp, @@ -114,7 +113,7 @@ async def candlesticks( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Candlesticks", + '200': "Candles", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -128,8 +127,7 @@ async def candlesticks( ).data - @validate_call - async def candlesticks_with_http_info( + async def candles_with_http_info( self, market_id: StrictInt, resolution: StrictStr, @@ -149,10 +147,10 @@ async def candlesticks_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[Candlesticks]: - """candlesticks + ) -> ApiResponse[Candles]: + """candles - Get candlesticks + Get candles (optimized with shortened fields and smaller response size) :param market_id: (required) :type market_id: int @@ -188,7 +186,7 @@ async def candlesticks_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._candlesticks_serialize( + _param = self._candles_serialize( market_id=market_id, resolution=resolution, start_timestamp=start_timestamp, @@ -202,7 +200,7 @@ async def candlesticks_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Candlesticks", + '200': "Candles", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -216,8 +214,7 @@ async def candlesticks_with_http_info( ) - @validate_call - async def candlesticks_without_preload_content( + async def candles_without_preload_content( self, market_id: StrictInt, resolution: StrictStr, @@ -238,9 +235,9 @@ async def candlesticks_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """candlesticks + """candles - Get candlesticks + Get candles (optimized with shortened fields and smaller response size) :param market_id: (required) :type market_id: int @@ -276,7 +273,7 @@ async def candlesticks_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._candlesticks_serialize( + _param = self._candles_serialize( market_id=market_id, resolution=resolution, start_timestamp=start_timestamp, @@ -290,7 +287,7 @@ async def candlesticks_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Candlesticks", + '200': "Candles", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -300,7 +297,7 @@ async def candlesticks_without_preload_content( return response_data.response - def _candlesticks_serialize( + def _candles_serialize( self, market_id, resolution, @@ -372,7 +369,7 @@ def _candlesticks_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/candlesticks', + resource_path='/api/v1/candles', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -388,7 +385,6 @@ def _candlesticks_serialize( - @validate_call async def fundings( self, market_id: StrictInt, @@ -472,7 +468,6 @@ async def fundings( ).data - @validate_call async def fundings_with_http_info( self, market_id: StrictInt, @@ -556,7 +551,6 @@ async def fundings_with_http_info( ) - @validate_call async def fundings_without_preload_content( self, market_id: StrictInt, diff --git a/lighter/api/funding_api.py b/lighter/api/funding_api.py index 5bcc028..9095e82 100644 --- a/lighter/api/funding_api.py +++ b/lighter/api/funding_api.py @@ -36,7 +36,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call async def funding_rates( self, _request_timeout: Union[ @@ -100,7 +99,6 @@ async def funding_rates( ).data - @validate_call async def funding_rates_with_http_info( self, _request_timeout: Union[ @@ -164,7 +162,6 @@ async def funding_rates_with_http_info( ) - @validate_call async def funding_rates_without_preload_content( self, _request_timeout: Union[ diff --git a/lighter/api/info_api.py b/lighter/api/info_api.py index 9e2591a..0c30f3c 100644 --- a/lighter/api/info_api.py +++ b/lighter/api/info_api.py @@ -16,8 +16,9 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictInt, StrictStr +from pydantic import Field, StrictInt, StrictStr from typing import Optional +from typing_extensions import Annotated from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.transfer_fee_info import TransferFeeInfo @@ -39,12 +40,11 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call async def transfer_fee_info( self, account_index: StrictInt, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, to_account_index: Optional[StrictInt] = None, _request_timeout: Union[ None, @@ -65,9 +65,9 @@ async def transfer_fee_info( :param account_index: (required) :type account_index: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param to_account_index: :type to_account_index: int @@ -119,12 +119,11 @@ async def transfer_fee_info( ).data - @validate_call async def transfer_fee_info_with_http_info( self, account_index: StrictInt, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, to_account_index: Optional[StrictInt] = None, _request_timeout: Union[ None, @@ -145,9 +144,9 @@ async def transfer_fee_info_with_http_info( :param account_index: (required) :type account_index: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param to_account_index: :type to_account_index: int @@ -199,12 +198,11 @@ async def transfer_fee_info_with_http_info( ) - @validate_call async def transfer_fee_info_without_preload_content( self, account_index: StrictInt, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, to_account_index: Optional[StrictInt] = None, _request_timeout: Union[ None, @@ -225,9 +223,9 @@ async def transfer_fee_info_without_preload_content( :param account_index: (required) :type account_index: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param to_account_index: :type to_account_index: int @@ -301,6 +299,10 @@ def _transfer_fee_info_serialize( # process the path parameters # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + if auth is not None: _query_params.append(('auth', auth)) @@ -314,8 +316,6 @@ def _transfer_fee_info_serialize( _query_params.append(('to_account_index', to_account_index)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -351,7 +351,6 @@ def _transfer_fee_info_serialize( - @validate_call async def withdrawal_delay( self, _request_timeout: Union[ @@ -415,7 +414,6 @@ async def withdrawal_delay( ).data - @validate_call async def withdrawal_delay_with_http_info( self, _request_timeout: Union[ @@ -479,7 +477,6 @@ async def withdrawal_delay_with_http_info( ) - @validate_call async def withdrawal_delay_without_preload_content( self, _request_timeout: Union[ diff --git a/lighter/api/notification_api.py b/lighter/api/notification_api.py index a3c2477..f514353 100644 --- a/lighter/api/notification_api.py +++ b/lighter/api/notification_api.py @@ -39,7 +39,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call async def notification_ack( self, notif_id: StrictStr, @@ -119,7 +118,6 @@ async def notification_ack( ).data - @validate_call async def notification_ack_with_http_info( self, notif_id: StrictStr, @@ -199,7 +197,6 @@ async def notification_ack_with_http_info( ) - @validate_call async def notification_ack_without_preload_content( self, notif_id: StrictStr, diff --git a/lighter/api/order_api.py b/lighter/api/order_api.py index 76154ef..5ad21b2 100644 --- a/lighter/api/order_api.py +++ b/lighter/api/order_api.py @@ -125,7 +125,6 @@ async def account_active_orders( ).data - @validate_call async def account_active_orders_with_http_info( self, account_index: StrictInt, @@ -205,7 +204,6 @@ async def account_active_orders_with_http_info( ) - @validate_call async def account_active_orders_without_preload_content( self, account_index: StrictInt, @@ -307,6 +305,14 @@ def _account_active_orders_serialize( # process the path parameters # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + + if auth is not None: + + _query_params.append(('auth', auth)) + if account_index is not None: _query_params.append(('account_index', account_index)) @@ -315,13 +321,7 @@ def _account_active_orders_serialize( _query_params.append(('market_id', market_id)) - if auth is not None: - - _query_params.append(('auth', auth)) - # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -357,7 +357,6 @@ def _account_active_orders_serialize( - @validate_call async def account_inactive_orders( self, account_index: StrictInt, @@ -453,7 +452,6 @@ async def account_inactive_orders( ).data - @validate_call async def account_inactive_orders_with_http_info( self, account_index: StrictInt, @@ -549,7 +547,6 @@ async def account_inactive_orders_with_http_info( ) - @validate_call async def account_inactive_orders_without_preload_content( self, account_index: StrictInt, @@ -671,6 +668,10 @@ def _account_inactive_orders_serialize( # process the path parameters # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + if auth is not None: _query_params.append(('auth', auth)) @@ -700,8 +701,6 @@ def _account_inactive_orders_serialize( _query_params.append(('limit', limit)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -737,7 +736,6 @@ def _account_inactive_orders_serialize( - @validate_call async def asset_details( self, asset_id: Optional[StrictInt] = None, @@ -998,7 +996,6 @@ def _asset_details_serialize( - @validate_call async def exchange_stats( self, _request_timeout: Union[ @@ -1062,7 +1059,6 @@ async def exchange_stats( ).data - @validate_call async def exchange_stats_with_http_info( self, _request_timeout: Union[ @@ -1126,7 +1122,6 @@ async def exchange_stats_with_http_info( ) - @validate_call async def exchange_stats_without_preload_content( self, _request_timeout: Union[ @@ -1244,12 +1239,11 @@ def _exchange_stats_serialize( - @validate_call async def export( self, type: StrictStr, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, account_index: Optional[StrictInt] = None, market_id: Optional[StrictInt] = None, _request_timeout: Union[ @@ -1271,9 +1265,9 @@ async def export( :param type: (required) :type type: str - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param account_index: :type account_index: int @@ -1328,12 +1322,11 @@ async def export( ).data - @validate_call async def export_with_http_info( self, type: StrictStr, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, account_index: Optional[StrictInt] = None, market_id: Optional[StrictInt] = None, _request_timeout: Union[ @@ -1355,9 +1348,9 @@ async def export_with_http_info( :param type: (required) :type type: str - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param account_index: :type account_index: int @@ -1412,12 +1405,11 @@ async def export_with_http_info( ) - @validate_call async def export_without_preload_content( self, type: StrictStr, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, account_index: Optional[StrictInt] = None, market_id: Optional[StrictInt] = None, _request_timeout: Union[ @@ -1439,9 +1431,9 @@ async def export_without_preload_content( :param type: (required) :type type: str - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param account_index: :type account_index: int @@ -1519,6 +1511,10 @@ def _export_serialize( # process the path parameters # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + if auth is not None: _query_params.append(('auth', auth)) @@ -1536,8 +1532,6 @@ def _export_serialize( _query_params.append(('type', type)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -1573,7 +1567,6 @@ def _export_serialize( - @validate_call async def order_book_details( self, market_id: Optional[StrictInt] = None, @@ -1645,7 +1638,6 @@ async def order_book_details( ).data - @validate_call async def order_book_details_with_http_info( self, market_id: Optional[StrictInt] = None, @@ -1717,7 +1709,6 @@ async def order_book_details_with_http_info( ) - @validate_call async def order_book_details_without_preload_content( self, market_id: Optional[StrictInt] = None, @@ -1853,7 +1844,6 @@ def _order_book_details_serialize( - @validate_call async def order_book_orders( self, market_id: StrictInt, @@ -1925,7 +1915,6 @@ async def order_book_orders( ).data - @validate_call async def order_book_orders_with_http_info( self, market_id: StrictInt, @@ -1997,7 +1986,6 @@ async def order_book_orders_with_http_info( ) - @validate_call async def order_book_orders_without_preload_content( self, market_id: StrictInt, @@ -2133,7 +2121,6 @@ def _order_book_orders_serialize( - @validate_call async def order_books( self, market_id: Optional[StrictInt] = None, @@ -2205,7 +2192,6 @@ async def order_books( ).data - @validate_call async def order_books_with_http_info( self, market_id: Optional[StrictInt] = None, @@ -2277,7 +2263,6 @@ async def order_books_with_http_info( ) - @validate_call async def order_books_without_preload_content( self, market_id: Optional[StrictInt] = None, @@ -2413,7 +2398,6 @@ def _order_books_serialize( - @validate_call async def recent_trades( self, market_id: StrictInt, @@ -2485,7 +2469,6 @@ async def recent_trades( ).data - @validate_call async def recent_trades_with_http_info( self, market_id: StrictInt, @@ -2557,7 +2540,6 @@ async def recent_trades_with_http_info( ) - @validate_call async def recent_trades_without_preload_content( self, market_id: StrictInt, @@ -2693,13 +2675,12 @@ def _recent_trades_serialize( - @validate_call async def trades( self, sort_by: StrictStr, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, market_id: Optional[StrictInt] = None, account_index: Optional[StrictInt] = None, order_index: Optional[StrictInt] = None, @@ -2731,9 +2712,9 @@ async def trades( :type sort_by: str :param limit: (required) :type limit: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param market_id: :type market_id: int @@ -2813,13 +2794,12 @@ async def trades( ).data - @validate_call async def trades_with_http_info( self, sort_by: StrictStr, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, market_id: Optional[StrictInt] = None, account_index: Optional[StrictInt] = None, order_index: Optional[StrictInt] = None, @@ -2851,9 +2831,9 @@ async def trades_with_http_info( :type sort_by: str :param limit: (required) :type limit: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param market_id: :type market_id: int @@ -2933,13 +2913,12 @@ async def trades_with_http_info( ) - @validate_call async def trades_without_preload_content( self, sort_by: StrictStr, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, market_id: Optional[StrictInt] = None, account_index: Optional[StrictInt] = None, order_index: Optional[StrictInt] = None, @@ -2971,9 +2950,9 @@ async def trades_without_preload_content( :type sort_by: str :param limit: (required) :type limit: int - :param authorization: + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str :param market_id: :type market_id: int @@ -3085,6 +3064,10 @@ def _trades_serialize( # process the path parameters # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + if auth is not None: _query_params.append(('auth', auth)) @@ -3138,8 +3121,6 @@ def _trades_serialize( _query_params.append(('aggregate', aggregate)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter diff --git a/lighter/api/referral_api.py b/lighter/api/referral_api.py deleted file mode 100644 index 7425d71..0000000 --- a/lighter/api/referral_api.py +++ /dev/null @@ -1,965 +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 warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import Field, StrictInt, StrictStr -from typing import Optional, Union -from typing_extensions import Annotated -from lighter.models.referral_points import ReferralPoints -from lighter.models.resp_update_kickback import RespUpdateKickback -from lighter.models.resp_update_referral_code import RespUpdateReferralCode - -from lighter.api_client import ApiClient, RequestSerialized -from lighter.api_response import ApiResponse -from lighter.rest import RESTResponseType - - -class ReferralApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - async def referral_kickback_update( - self, - account_index: StrictInt, - kickback_percentage: Union[Annotated[float, Field(le=1E+2, strict=True)], Annotated[int, Field(le=100, strict=True)]], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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, - ) -> RespUpdateKickback: - """referral_kickback_update - - Update kickback percentage for referral rewards - - :param account_index: (required) - :type account_index: int - :param kickback_percentage: (required) - :type kickback_percentage: float - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: 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._referral_kickback_update_serialize( - account_index=account_index, - kickback_percentage=kickback_percentage, - authorization=authorization, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RespUpdateKickback", - '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 - - - async def referral_kickback_update_with_http_info( - self, - account_index: StrictInt, - kickback_percentage: Union[Annotated[float, Field(le=1E+2, strict=True)], Annotated[int, Field(le=100, strict=True)]], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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[RespUpdateKickback]: - """referral_kickback_update - - Update kickback percentage for referral rewards - - :param account_index: (required) - :type account_index: int - :param kickback_percentage: (required) - :type kickback_percentage: float - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: 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._referral_kickback_update_serialize( - account_index=account_index, - kickback_percentage=kickback_percentage, - authorization=authorization, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RespUpdateKickback", - '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, - ) - - - async def referral_kickback_update_without_preload_content( - self, - account_index: StrictInt, - kickback_percentage: Union[Annotated[float, Field(le=1E+2, strict=True)], Annotated[int, Field(le=100, strict=True)]], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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: - """referral_kickback_update - - Update kickback percentage for referral rewards - - :param account_index: (required) - :type account_index: int - :param kickback_percentage: (required) - :type kickback_percentage: float - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: 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._referral_kickback_update_serialize( - account_index=account_index, - kickback_percentage=kickback_percentage, - authorization=authorization, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RespUpdateKickback", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _referral_kickback_update_serialize( - self, - account_index, - kickback_percentage, - authorization, - auth, - _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 - # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization - # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) - if account_index is not None: - _form_params.append(('account_index', account_index)) - if kickback_percentage is not None: - _form_params.append(('kickback_percentage', kickback_percentage)) - # 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' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'multipart/form-data' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/referral/kickback/update', - 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 - ) - - - - - async def referral_points( - self, - account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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, - ) -> ReferralPoints: - """referral_points - - Get referral points - - :param account_index: (required) - :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: 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._referral_points_serialize( - account_index=account_index, - authorization=authorization, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ReferralPoints", - '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 - - - async def referral_points_with_http_info( - self, - account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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[ReferralPoints]: - """referral_points - - Get referral points - - :param account_index: (required) - :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: 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._referral_points_serialize( - account_index=account_index, - authorization=authorization, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ReferralPoints", - '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, - ) - - - async def referral_points_without_preload_content( - self, - account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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: - """referral_points - - Get referral points - - :param account_index: (required) - :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: 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._referral_points_serialize( - account_index=account_index, - authorization=authorization, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ReferralPoints", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _referral_points_serialize( - self, - account_index, - authorization, - auth, - _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 auth is not None: - - _query_params.append(('auth', auth)) - - if account_index is not None: - - _query_params.append(('account_index', account_index)) - - # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization - # 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/referral/points', - 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 - ) - - - - - async def referral_update( - self, - account_index: StrictInt, - new_referral_code: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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, - ) -> RespUpdateReferralCode: - """referral_update - - Update referral code (allowed once per account) - - :param account_index: (required) - :type account_index: int - :param new_referral_code: (required) - :type new_referral_code: str - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: 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._referral_update_serialize( - account_index=account_index, - new_referral_code=new_referral_code, - authorization=authorization, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RespUpdateReferralCode", - '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 - - - async def referral_update_with_http_info( - self, - account_index: StrictInt, - new_referral_code: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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[RespUpdateReferralCode]: - """referral_update - - Update referral code (allowed once per account) - - :param account_index: (required) - :type account_index: int - :param new_referral_code: (required) - :type new_referral_code: str - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: 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._referral_update_serialize( - account_index=account_index, - new_referral_code=new_referral_code, - authorization=authorization, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RespUpdateReferralCode", - '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, - ) - - - async def referral_update_without_preload_content( - self, - account_index: StrictInt, - new_referral_code: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = 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: - """referral_update - - Update referral code (allowed once per account) - - :param account_index: (required) - :type account_index: int - :param new_referral_code: (required) - :type new_referral_code: str - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: 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._referral_update_serialize( - account_index=account_index, - new_referral_code=new_referral_code, - authorization=authorization, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "RespUpdateReferralCode", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _referral_update_serialize( - self, - account_index, - new_referral_code, - authorization, - auth, - _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 - # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization - # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) - if account_index is not None: - _form_params.append(('account_index', account_index)) - if new_referral_code is not None: - _form_params.append(('new_referral_code', new_referral_code)) - # 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' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'multipart/form-data' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/referral/update', - 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 - ) - - diff --git a/lighter/api/root_api.py b/lighter/api/root_api.py index f009fdc..82d9cb0 100644 --- a/lighter/api/root_api.py +++ b/lighter/api/root_api.py @@ -37,7 +37,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call async def info( self, _request_timeout: Union[ @@ -101,7 +100,6 @@ async def info( ).data - @validate_call async def info_with_http_info( self, _request_timeout: Union[ @@ -165,7 +163,6 @@ async def info_with_http_info( ) - @validate_call async def info_without_preload_content( self, _request_timeout: Union[ @@ -283,7 +280,6 @@ def _info_serialize( - @validate_call async def status( self, _request_timeout: Union[ @@ -347,7 +343,6 @@ async def status( ).data - @validate_call async def status_with_http_info( self, _request_timeout: Union[ @@ -411,7 +406,6 @@ async def status_with_http_info( ) - @validate_call async def status_without_preload_content( self, _request_timeout: Union[ diff --git a/lighter/api/transaction_api.py b/lighter/api/transaction_api.py index 5129ab0..240f3c8 100644 --- a/lighter/api/transaction_api.py +++ b/lighter/api/transaction_api.py @@ -17,7 +17,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import List, Optional +from typing import Optional from typing_extensions import Annotated from lighter.models.deposit_history import DepositHistory from lighter.models.enriched_tx import EnrichedTx @@ -25,7 +25,6 @@ from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch from lighter.models.transfer_history import TransferHistory -from lighter.models.txs import Txs from lighter.models.withdraw_history import WithdrawHistory from lighter.api_client import ApiClient, RequestSerialized @@ -46,651 +45,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call - async def account_txs( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - by: StrictStr, - value: StrictStr, - authorization: Optional[StrictStr] = None, - index: Optional[StrictInt] = None, - types: Optional[List[StrictInt]] = None, - auth: 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, - ) -> Txs: - """accountTxs - - 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 authorization: - :type authorization: str - :param index: - :type index: int - :param types: - :type types: List[int] - :param auth: - :type auth: 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._account_txs_serialize( - limit=limit, - by=by, - value=value, - authorization=authorization, - index=index, - types=types, - auth=auth, - _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 account_txs_with_http_info( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - by: StrictStr, - value: StrictStr, - authorization: Optional[StrictStr] = None, - index: Optional[StrictInt] = None, - types: Optional[List[StrictInt]] = None, - auth: 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[Txs]: - """accountTxs - - 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 authorization: - :type authorization: str - :param index: - :type index: int - :param types: - :type types: List[int] - :param auth: - :type auth: 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._account_txs_serialize( - limit=limit, - by=by, - value=value, - authorization=authorization, - index=index, - types=types, - auth=auth, - _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, - ) - - - @validate_call - async def account_txs_without_preload_content( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - by: StrictStr, - value: StrictStr, - authorization: Optional[StrictStr] = None, - index: Optional[StrictInt] = None, - types: Optional[List[StrictInt]] = None, - auth: 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: - """accountTxs - - 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 authorization: - :type authorization: str - :param index: - :type index: int - :param types: - :type types: List[int] - :param auth: - :type auth: 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._account_txs_serialize( - limit=limit, - by=by, - value=value, - authorization=authorization, - index=index, - types=types, - auth=auth, - _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 - ) - return response_data.response - - - def _account_txs_serialize( - self, - limit, - by, - value, - authorization, - index, - types, - auth, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - 'types': 'csv', - } - - _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 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)) - - if value is not None: - - _query_params.append(('value', value)) - - if types is not None: - - _query_params.append(('types', types)) - - if auth is not None: - - _query_params.append(('auth', auth)) - - # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization - # 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/accountTxs', - 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 block_txs( - self, - by: StrictStr, - value: 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, - ) -> Txs: - """blockTxs - - Get transactions in a block - - :param by: (required) - :type by: str - :param value: (required) - :type value: 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._block_txs_serialize( - by=by, - value=value, - _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 block_txs_with_http_info( - self, - by: StrictStr, - value: 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[Txs]: - """blockTxs - - Get transactions in a block - - :param by: (required) - :type by: str - :param value: (required) - :type value: 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._block_txs_serialize( - by=by, - value=value, - _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, - ) - - - @validate_call - async def block_txs_without_preload_content( - self, - by: StrictStr, - value: 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: - """blockTxs - - Get transactions in a block - - :param by: (required) - :type by: str - :param value: (required) - :type value: 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._block_txs_serialize( - by=by, - value=value, - _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 - ) - return response_data.response - - - def _block_txs_serialize( - self, - by, - value, - _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 by is not None: - - _query_params.append(('by', by)) - - if value is not None: - - _query_params.append(('value', value)) - - # 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/blockTxs', - 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 deposit_history( self, account_index: StrictInt, @@ -778,7 +132,6 @@ async def deposit_history( ).data - @validate_call async def deposit_history_with_http_info( self, account_index: StrictInt, @@ -866,7 +219,6 @@ async def deposit_history_with_http_info( ) - @validate_call async def deposit_history_without_preload_content( self, account_index: StrictInt, @@ -978,14 +330,18 @@ def _deposit_history_serialize( # process the path parameters # process the query parameters - if account_index is not None: + if authorization is not None: - _query_params.append(('account_index', account_index)) + _query_params.append(('authorization', authorization)) if auth is not None: _query_params.append(('auth', auth)) + if account_index is not None: + + _query_params.append(('account_index', account_index)) + if l1_address is not None: _query_params.append(('l1_address', l1_address)) @@ -999,8 +355,6 @@ def _deposit_history_serialize( _query_params.append(('filter', filter)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -1036,7 +390,6 @@ def _deposit_history_serialize( - @validate_call async def next_nonce( self, account_index: StrictInt, @@ -1108,7 +461,6 @@ async def next_nonce( ).data - @validate_call async def next_nonce_with_http_info( self, account_index: StrictInt, @@ -1180,7 +532,6 @@ async def next_nonce_with_http_info( ) - @validate_call async def next_nonce_without_preload_content( self, account_index: StrictInt, @@ -1316,7 +667,6 @@ def _next_nonce_serialize( - @validate_call async def send_tx( self, tx_type: StrictInt, @@ -1392,7 +742,6 @@ async def send_tx( ).data - @validate_call async def send_tx_with_http_info( self, tx_type: StrictInt, @@ -1468,7 +817,6 @@ async def send_tx_with_http_info( ) - @validate_call async def send_tx_without_preload_content( self, tx_type: StrictInt, @@ -1620,7 +968,6 @@ def _send_tx_serialize( - @validate_call async def send_tx_batch( self, tx_types: StrictStr, @@ -1692,7 +1039,6 @@ async def send_tx_batch( ).data - @validate_call async def send_tx_batch_with_http_info( self, tx_types: StrictStr, @@ -1764,7 +1110,6 @@ async def send_tx_batch_with_http_info( ) - @validate_call async def send_tx_batch_without_preload_content( self, tx_types: StrictStr, @@ -1909,7 +1254,6 @@ def _send_tx_batch_serialize( - @validate_call async def transfer_history( self, account_index: StrictInt, @@ -1989,7 +1333,6 @@ async def transfer_history( ).data - @validate_call async def transfer_history_with_http_info( self, account_index: StrictInt, @@ -2069,7 +1412,6 @@ async def transfer_history_with_http_info( ) - @validate_call async def transfer_history_without_preload_content( self, account_index: StrictInt, @@ -2171,21 +1513,23 @@ def _transfer_history_serialize( # process the path parameters # process the query parameters - if account_index is not None: + if authorization is not None: - _query_params.append(('account_index', account_index)) + _query_params.append(('authorization', authorization)) if auth is not None: _query_params.append(('auth', auth)) + if account_index is not None: + + _query_params.append(('account_index', account_index)) + if cursor is not None: _query_params.append(('cursor', cursor)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -2221,7 +1565,6 @@ def _transfer_history_serialize( - @validate_call async def tx( self, by: StrictStr, @@ -2293,7 +1636,6 @@ async def tx( ).data - @validate_call async def tx_with_http_info( self, by: StrictStr, @@ -2365,7 +1707,6 @@ async def tx_with_http_info( ) - @validate_call async def tx_without_preload_content( self, by: StrictStr, @@ -2501,7 +1842,6 @@ def _tx_serialize( - @validate_call async def tx_from_l1_tx_hash( self, hash: StrictStr, @@ -2569,7 +1909,6 @@ async def tx_from_l1_tx_hash( ).data - @validate_call async def tx_from_l1_tx_hash_with_http_info( self, hash: StrictStr, @@ -2637,7 +1976,6 @@ async def tx_from_l1_tx_hash_with_http_info( ) - @validate_call async def tx_from_l1_tx_hash_without_preload_content( self, hash: StrictStr, @@ -2764,287 +2102,6 @@ def _tx_from_l1_tx_hash_serialize( - @validate_call - async def 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: - """txs - - Get transactions which are already packed into blocks - - :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._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 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]: - """txs - - Get transactions which are already packed into blocks - - :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._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, - ) - - - @validate_call - async def txs_without_preload_content( - 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, - ) -> RESTResponseType: - """txs - - Get transactions which are already packed into blocks - - :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._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 - ) - return response_data.response - - - def _txs_serialize( - self, - limit, - 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 index is not None: - - _query_params.append(('index', index)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - # 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/txs', - 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 withdraw_history( self, account_index: StrictInt, @@ -3128,7 +2185,6 @@ async def withdraw_history( ).data - @validate_call async def withdraw_history_with_http_info( self, account_index: StrictInt, @@ -3212,7 +2268,6 @@ async def withdraw_history_with_http_info( ) - @validate_call async def withdraw_history_without_preload_content( self, account_index: StrictInt, @@ -3319,14 +2374,18 @@ def _withdraw_history_serialize( # process the path parameters # process the query parameters - if account_index is not None: + if authorization is not None: - _query_params.append(('account_index', account_index)) + _query_params.append(('authorization', authorization)) if auth is not None: _query_params.append(('auth', auth)) + if account_index is not None: + + _query_params.append(('account_index', account_index)) + if cursor is not None: _query_params.append(('cursor', cursor)) @@ -3336,8 +2395,6 @@ def _withdraw_history_serialize( _query_params.append(('filter', filter)) # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters # process the body parameter diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index 3123460..f54774b 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -29,16 +29,15 @@ from lighter.models.announcement import Announcement from lighter.models.announcements import Announcements from lighter.models.api_key import ApiKey +from lighter.models.api_token import ApiToken from lighter.models.asset import Asset from lighter.models.asset_details import AssetDetails -from lighter.models.block import Block -from lighter.models.blocks import Blocks +from lighter.models.auth import Auth from lighter.models.bridge import Bridge from lighter.models.bridge_supported_network import BridgeSupportedNetwork -from lighter.models.candlestick import Candlestick -from lighter.models.candlesticks import Candlesticks +from lighter.models.candle import Candle +from lighter.models.candles import Candles from lighter.models.contract_address import ContractAddress -from lighter.models.current_height import CurrentHeight from lighter.models.cursor import Cursor from lighter.models.daily_return import DailyReturn from lighter.models.deposit_history import DepositHistory @@ -64,6 +63,7 @@ from lighter.models.order import Order from lighter.models.order_book import OrderBook from lighter.models.order_book_depth import OrderBookDepth +from lighter.models.order_book_depth_with_begin_nonce import OrderBookDepthWithBeginNonce from lighter.models.order_book_details import OrderBookDetails from lighter.models.order_book_orders import OrderBookOrders from lighter.models.order_book_stats import OrderBookStats @@ -78,8 +78,7 @@ from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_metadata import PublicPoolMetadata from lighter.models.public_pool_share import PublicPoolShare -from lighter.models.referral_point_entry import ReferralPointEntry -from lighter.models.referral_points import ReferralPoints +from lighter.models.req_do_faucet import ReqDoFaucet from lighter.models.req_export_data import ReqExportData from lighter.models.req_get_account import ReqGetAccount from lighter.models.req_get_account_active_orders import ReqGetAccountActiveOrders @@ -90,12 +89,13 @@ from lighter.models.req_get_account_metadata import ReqGetAccountMetadata from lighter.models.req_get_account_pn_l import ReqGetAccountPnL from lighter.models.req_get_account_txs import ReqGetAccountTxs +from lighter.models.req_get_api_tokens import ReqGetApiTokens from lighter.models.req_get_asset_details import ReqGetAssetDetails from lighter.models.req_get_block import ReqGetBlock from lighter.models.req_get_block_txs import ReqGetBlockTxs from lighter.models.req_get_bridges_by_l1_addr import ReqGetBridgesByL1Addr from lighter.models.req_get_by_account import ReqGetByAccount -from lighter.models.req_get_candlesticks import ReqGetCandlesticks +from lighter.models.req_get_candles import ReqGetCandles from lighter.models.req_get_deposit_history import ReqGetDepositHistory from lighter.models.req_get_fast_withdraw_info import ReqGetFastWithdrawInfo from lighter.models.req_get_fundings import ReqGetFundings @@ -113,21 +113,22 @@ 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_recent_trades import ReqGetRecentTrades -from lighter.models.req_get_referral_points import ReqGetReferralPoints from lighter.models.req_get_trades import ReqGetTrades from lighter.models.req_get_transfer_fee_info import ReqGetTransferFeeInfo from lighter.models.req_get_transfer_history import ReqGetTransferHistory from lighter.models.req_get_tx import ReqGetTx from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory from lighter.models.resp_change_account_tier import RespChangeAccountTier +from lighter.models.resp_get_api_tokens import RespGetApiTokens from lighter.models.resp_get_bridges_by_l1_addr import RespGetBridgesByL1Addr from lighter.models.resp_get_fast_bridge_info import RespGetFastBridgeInfo +from lighter.models.resp_get_fastwithdrawal_info import RespGetFastwithdrawalInfo from lighter.models.resp_get_is_next_bridge_fast import RespGetIsNextBridgeFast +from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata +from lighter.models.resp_revoke_api_token import RespRevokeApiToken from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch -from lighter.models.resp_update_kickback import RespUpdateKickback -from lighter.models.resp_update_referral_code import RespUpdateReferralCode from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode from lighter.models.risk_info import RiskInfo @@ -144,13 +145,11 @@ from lighter.models.transfer_fee_info import TransferFeeInfo from lighter.models.transfer_history import TransferHistory from lighter.models.transfer_history_item import TransferHistoryItem -from lighter.models.tx import Tx from lighter.models.tx_hash import TxHash from lighter.models.tx_hashes import TxHashes -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_item import WithdrawHistoryItem from lighter.models.zk_lighter_info import ZkLighterInfo -from lighter.models.ws_account_assets import WSAccountAssets \ No newline at end of file +from lighter.models.ws_account_assets import WSAccountAssets diff --git a/lighter/models/account.py b/lighter/models/account.py index 82958bf..d349e6f 100644 --- a/lighter/models/account.py +++ b/lighter/models/account.py @@ -33,12 +33,14 @@ class Account(BaseModel): l1_address: StrictStr cancel_all_time: StrictInt total_order_count: StrictInt + total_isolated_order_count: StrictInt pending_order_count: StrictInt - available_balance: Optional[StrictStr] + available_balance: StrictStr status: StrictInt collateral: StrictStr + transaction_time: StrictInt 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", "available_balance", "status", "collateral"] + __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "available_balance", "status", "collateral", "transaction_time"] model_config = ConfigDict( populate_by_name=True, @@ -97,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "account_type": obj.get("account_type"), @@ -105,10 +107,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "l1_address": obj.get("l1_address"), "cancel_all_time": obj.get("cancel_all_time"), "total_order_count": obj.get("total_order_count"), + "total_isolated_order_count": obj.get("total_isolated_order_count"), "pending_order_count": obj.get("pending_order_count"), "available_balance": obj.get("available_balance"), "status": obj.get("status"), - "collateral": obj.get("collateral") + "collateral": obj.get("collateral"), + "transaction_time": obj.get("transaction_time") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_api_keys.py b/lighter/models/account_api_keys.py index da1e42c..78d7dbd 100644 --- a/lighter/models/account_api_keys.py +++ b/lighter/models/account_api_keys.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "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 diff --git a/lighter/models/account_asset.py b/lighter/models/account_asset.py index a5a8c7b..c6ca30a 100644 --- a/lighter/models/account_asset.py +++ b/lighter/models/account_asset.py @@ -90,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "symbol": obj.get("symbol"), "asset_id": obj.get("asset_id"), "balance": obj.get("balance"), diff --git a/lighter/models/account_limits.py b/lighter/models/account_limits.py index a6bdc2a..47598f5 100644 --- a/lighter/models/account_limits.py +++ b/lighter/models/account_limits.py @@ -92,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "max_llp_percentage": obj.get("max_llp_percentage"), diff --git a/lighter/models/account_margin_stats.py b/lighter/models/account_margin_stats.py index bad64a8..03e5dea 100644 --- a/lighter/models/account_margin_stats.py +++ b/lighter/models/account_margin_stats.py @@ -92,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "collateral": obj.get("collateral"), "portfolio_value": obj.get("portfolio_value"), "leverage": obj.get("leverage"), diff --git a/lighter/models/account_market_stats.py b/lighter/models/account_market_stats.py index efa1731..7065b2d 100644 --- a/lighter/models/account_market_stats.py +++ b/lighter/models/account_market_stats.py @@ -99,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "daily_trades_count": obj.get("daily_trades_count"), "daily_base_token_volume": obj.get("daily_base_token_volume"), diff --git a/lighter/models/account_metadata.py b/lighter/models/account_metadata.py index ddd09e6..ee08b50 100644 --- a/lighter/models/account_metadata.py +++ b/lighter/models/account_metadata.py @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "account_index": obj.get("account_index"), "name": obj.get("name"), "description": obj.get("description"), diff --git a/lighter/models/account_metadatas.py b/lighter/models/account_metadatas.py index 3d41085..b77d80a 100644 --- a/lighter/models/account_metadatas.py +++ b/lighter/models/account_metadatas.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "account_metadatas": [AccountMetadata.from_dict(_item) for _item in obj["account_metadatas"]] if obj.get("account_metadatas") is not None else None diff --git a/lighter/models/account_pn_l.py b/lighter/models/account_pn_l.py index 9196cf0..55ec511 100644 --- a/lighter/models/account_pn_l.py +++ b/lighter/models/account_pn_l.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "resolution": obj.get("resolution"), diff --git a/lighter/models/account_position.py b/lighter/models/account_position.py index 9942715..50021b6 100644 --- a/lighter/models/account_position.py +++ b/lighter/models/account_position.py @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "symbol": obj.get("symbol"), "initial_margin_fraction": obj.get("initial_margin_fraction"), diff --git a/lighter/models/account_stats.py b/lighter/models/account_stats.py index 9fac368..6587f78 100644 --- a/lighter/models/account_stats.py +++ b/lighter/models/account_stats.py @@ -30,7 +30,7 @@ class AccountStats(BaseModel): collateral: StrictStr portfolio_value: StrictStr leverage: StrictStr - available_balance: Optional[StrictStr] + available_balance: StrictStr margin_usage: StrictStr buying_power: StrictStr cross_stats: AccountMarginStats @@ -101,7 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "collateral": obj.get("collateral"), "portfolio_value": obj.get("portfolio_value"), "leverage": obj.get("leverage"), diff --git a/lighter/models/account_trade_stats.py b/lighter/models/account_trade_stats.py index a266610..2a783fc 100644 --- a/lighter/models/account_trade_stats.py +++ b/lighter/models/account_trade_stats.py @@ -94,7 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "daily_trades_count": obj.get("daily_trades_count"), "daily_volume": obj.get("daily_volume"), "weekly_trades_count": obj.get("weekly_trades_count"), diff --git a/lighter/models/announcement.py b/lighter/models/announcement.py index 27ab271..a721cf3 100644 --- a/lighter/models/announcement.py +++ b/lighter/models/announcement.py @@ -90,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "title": obj.get("title"), "content": obj.get("content"), "created_at": obj.get("created_at"), diff --git a/lighter/models/announcements.py b/lighter/models/announcements.py index d89894f..4eb8081 100644 --- a/lighter/models/announcements.py +++ b/lighter/models/announcements.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "announcements": [Announcement.from_dict(_item) for _item in obj["announcements"]] if obj.get("announcements") is not None else None diff --git a/lighter/models/api_key.py b/lighter/models/api_key.py index f02af99..96e9d91 100644 --- a/lighter/models/api_key.py +++ b/lighter/models/api_key.py @@ -30,8 +30,9 @@ class ApiKey(BaseModel): api_key_index: StrictInt nonce: StrictInt public_key: StrictStr + transaction_time: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "api_key_index", "nonce", "public_key"] + __properties: ClassVar[List[str]] = ["account_index", "api_key_index", "nonce", "public_key", "transaction_time"] model_config = ConfigDict( populate_by_name=True, @@ -90,11 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "account_index": obj.get("account_index"), "api_key_index": obj.get("api_key_index"), "nonce": obj.get("nonce"), - "public_key": obj.get("public_key") + "public_key": obj.get("public_key"), + "transaction_time": obj.get("transaction_time") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/api_token.py b/lighter/models/api_token.py new file mode 100644 index 0000000..c61cff1 --- /dev/null +++ b/lighter/models/api_token.py @@ -0,0 +1,114 @@ +# 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 +from typing import Optional, Set +from typing_extensions import Self + +class ApiToken(BaseModel): + """ + ApiToken + """ # noqa: E501 + token_id: StrictInt + api_token: StrictStr + name: StrictStr + account_index: StrictInt + expiry: StrictInt + sub_account_access: StrictBool + revoked: StrictBool + scopes: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["token_id", "api_token", "name", "account_index", "expiry", "sub_account_access", "revoked", "scopes"] + + 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 ApiToken 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + 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 ApiToken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "token_id": obj.get("token_id"), + "api_token": obj.get("api_token"), + "name": obj.get("name"), + "account_index": obj.get("account_index"), + "expiry": obj.get("expiry"), + "sub_account_access": obj.get("sub_account_access"), + "revoked": obj.get("revoked"), + "scopes": obj.get("scopes") + }) + # 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/asset.py b/lighter/models/asset.py index ec3b522..462bac2 100644 --- a/lighter/models/asset.py +++ b/lighter/models/asset.py @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "asset_id": obj.get("asset_id"), "symbol": obj.get("symbol"), "l1_decimals": obj.get("l1_decimals"), diff --git a/lighter/models/asset_details.py b/lighter/models/asset_details.py index 6437910..7935030 100644 --- a/lighter/models/asset_details.py +++ b/lighter/models/asset_details.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "asset_details": [Asset.from_dict(_item) for _item in obj["asset_details"]] if obj.get("asset_details") is not None else None diff --git a/lighter/models/current_height.py b/lighter/models/auth.py similarity index 81% rename from lighter/models/current_height.py rename to lighter/models/auth.py index 5aa2b8f..7f590f7 100644 --- a/lighter/models/current_height.py +++ b/lighter/models/auth.py @@ -17,20 +17,18 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class CurrentHeight(BaseModel): +class Auth(BaseModel): """ - CurrentHeight + Auth """ # noqa: E501 - code: StrictInt - message: Optional[StrictStr] = None - height: StrictInt + auth: StrictStr = Field(description=" made optional to support header auth clients") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "height"] + __properties: ClassVar[List[str]] = ["auth"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CurrentHeight from a JSON string""" + """Create an instance of Auth from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,17 +80,15 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CurrentHeight from a dict""" + """Create an instance of Auth from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "height": obj.get("height") + _obj = cls.model_construct(**{ + "auth": obj.get("auth") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/block.py b/lighter/models/block.py deleted file mode 100644 index 7e550d7..0000000 --- a/lighter/models/block.py +++ /dev/null @@ -1,132 +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, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from lighter.models.tx import Tx -from typing import Optional, Set -from typing_extensions import Self - -class Block(BaseModel): - """ - Block - """ # noqa: E501 - commitment: StrictStr - height: StrictInt - state_root: StrictStr - priority_operations: StrictInt - on_chain_l2_operations: StrictInt - pending_on_chain_operations_pub_data: StrictStr - committed_tx_hash: StrictStr - committed_at: StrictInt - verified_tx_hash: StrictStr - verified_at: StrictInt - 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( - 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 Block 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in txs (list) - _items = [] - if self.txs: - for _item in self.txs: - 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 - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Block from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "commitment": obj.get("commitment"), - "height": obj.get("height"), - "state_root": obj.get("state_root"), - "priority_operations": obj.get("priority_operations"), - "on_chain_l2_operations": obj.get("on_chain_l2_operations"), - "pending_on_chain_operations_pub_data": obj.get("pending_on_chain_operations_pub_data"), - "committed_tx_hash": obj.get("committed_tx_hash"), - "committed_at": obj.get("committed_at"), - "verified_tx_hash": obj.get("verified_tx_hash"), - "verified_at": obj.get("verified_at"), - "txs": [Tx.from_dict(_item) for _item in obj["txs"]] if obj.get("txs") is not None else None, - "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/bridge.py b/lighter/models/bridge.py index 23bc14d..2b4f5f6 100644 --- a/lighter/models/bridge.py +++ b/lighter/models/bridge.py @@ -115,7 +115,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "id": obj.get("id"), "version": obj.get("version"), "source": obj.get("source"), diff --git a/lighter/models/bridge_supported_network.py b/lighter/models/bridge_supported_network.py index 4e3533a..158afc6 100644 --- a/lighter/models/bridge_supported_network.py +++ b/lighter/models/bridge_supported_network.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "name": obj.get("name"), "chain_id": obj.get("chain_id"), "explorer": obj.get("explorer") diff --git a/lighter/models/referral_point_entry.py b/lighter/models/candle.py similarity index 62% rename from lighter/models/referral_point_entry.py rename to lighter/models/candle.py index 5524e71..f1f0d13 100644 --- a/lighter/models/referral_point_entry.py +++ b/lighter/models/candle.py @@ -17,23 +17,29 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self -class ReferralPointEntry(BaseModel): +class Candle(BaseModel): """ - ReferralPointEntry + Candle """ # noqa: E501 - l1_address: StrictStr - total_points: Union[StrictFloat, StrictInt] - week_points: Union[StrictFloat, StrictInt] - total_reward_points: Union[StrictFloat, StrictInt] - week_reward_points: Union[StrictFloat, StrictInt] - reward_point_multiplier: StrictStr + t: StrictInt = Field(description=" timestamp") + o: Union[StrictFloat, StrictInt] = Field(description=" open") + h: Union[StrictFloat, StrictInt] = Field(description=" high") + l: Union[StrictFloat, StrictInt] = Field(description=" low") + c: Union[StrictFloat, StrictInt] = Field(description=" close") + o: Union[StrictFloat, StrictInt] = Field(description=" open_raw", alias="O") + h: Union[StrictFloat, StrictInt] = Field(description=" high_raw", alias="H") + l: Union[StrictFloat, StrictInt] = Field(description=" low_raw", alias="L") + c: Union[StrictFloat, StrictInt] = Field(description=" close_raw", alias="C") + v: Union[StrictFloat, StrictInt] = Field(description=" volume0") + v: Union[StrictFloat, StrictInt] = Field(description=" volume1", alias="V") + i: StrictInt = Field(description=" last_trade_id") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address", "total_points", "week_points", "total_reward_points", "week_reward_points", "reward_point_multiplier"] + __properties: ClassVar[List[str]] = ["t", "o", "h", "l", "c", "O", "H", "L", "C", "v", "V", "i"] model_config = ConfigDict( populate_by_name=True, @@ -53,7 +59,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReferralPointEntry from a JSON string""" + """Create an instance of Candle from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -85,20 +91,26 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReferralPointEntry from a dict""" + """Create an instance of Candle from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "l1_address": obj.get("l1_address"), - "total_points": obj.get("total_points"), - "week_points": obj.get("week_points"), - "total_reward_points": obj.get("total_reward_points"), - "week_reward_points": obj.get("week_reward_points"), - "reward_point_multiplier": obj.get("reward_point_multiplier") + _obj = cls.model_construct(**{ + "t": obj.get("t"), + "o": obj.get("o"), + "h": obj.get("h"), + "l": obj.get("l"), + "c": obj.get("c"), + "O": obj.get("O"), + "H": obj.get("H"), + "L": obj.get("L"), + "C": obj.get("C"), + "v": obj.get("v"), + "V": obj.get("V"), + "i": obj.get("i") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/candlesticks.py b/lighter/models/candles.py similarity index 78% rename from lighter/models/candlesticks.py rename to lighter/models/candles.py index a8184f9..53a41de 100644 --- a/lighter/models/candlesticks.py +++ b/lighter/models/candles.py @@ -17,22 +17,22 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from lighter.models.candlestick import Candlestick +from lighter.models.candle import Candle from typing import Optional, Set from typing_extensions import Self -class Candlesticks(BaseModel): +class Candles(BaseModel): """ - Candlesticks + Candles """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - resolution: StrictStr - candlesticks: List[Candlestick] + r: StrictStr = Field(description=" resolution") + c: List[Candle] = Field(description=" candles") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "resolution", "candlesticks"] + __properties: ClassVar[List[str]] = ["code", "message", "r", "c"] model_config = ConfigDict( populate_by_name=True, @@ -52,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Candlesticks from a JSON string""" + """Create an instance of Candles from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,13 +75,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in candlesticks (list) + # override the default output from pydantic by calling `to_dict()` of each item in c (list) _items = [] - if self.candlesticks: - for _item in self.candlesticks: + if self.c: + for _item in self.c: if _item: _items.append(_item.to_dict()) - _dict['candlesticks'] = _items + _dict['c'] = _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(): @@ -91,18 +91,18 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Candlesticks from a dict""" + """Create an instance of Candles from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "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 + "r": obj.get("r"), + "c": [Candle.from_dict(_item) for _item in obj["c"]] if obj.get("c") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/candlestick.py b/lighter/models/candlestick.py deleted file mode 100644 index b1722af..0000000 --- a/lighter/models/candlestick.py +++ /dev/null @@ -1,122 +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, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class Candlestick(BaseModel): - """ - Candlestick - """ # noqa: E501 - timestamp: StrictInt - open: Union[StrictFloat, StrictInt] - high: Union[StrictFloat, StrictInt] - low: Union[StrictFloat, StrictInt] - close: Union[StrictFloat, StrictInt] - open_raw: Union[StrictFloat, StrictInt] - high_raw: Union[StrictFloat, StrictInt] - low_raw: Union[StrictFloat, StrictInt] - close_raw: Union[StrictFloat, StrictInt] - 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", "open_raw", "high_raw", "low_raw", "close_raw", "volume0", "volume1", "last_trade_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 Candlestick 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - 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 Candlestick from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "open": obj.get("open"), - "high": obj.get("high"), - "low": obj.get("low"), - "close": obj.get("close"), - "open_raw": obj.get("open_raw"), - "high_raw": obj.get("high_raw"), - "low_raw": obj.get("low_raw"), - "close_raw": obj.get("close_raw"), - "volume0": obj.get("volume0"), - "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/contract_address.py b/lighter/models/contract_address.py index 768652e..662540a 100644 --- a/lighter/models/contract_address.py +++ b/lighter/models/contract_address.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "name": obj.get("name"), "address": obj.get("address") }) diff --git a/lighter/models/cursor.py b/lighter/models/cursor.py index a1ca1ef..4468d46 100644 --- a/lighter/models/cursor.py +++ b/lighter/models/cursor.py @@ -87,7 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "next_cursor": obj.get("next_cursor") }) # store additional fields in additional_properties diff --git a/lighter/models/daily_return.py b/lighter/models/daily_return.py index 0453381..af99736 100644 --- a/lighter/models/daily_return.py +++ b/lighter/models/daily_return.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "timestamp": obj.get("timestamp"), "daily_return": obj.get("daily_return") }) diff --git a/lighter/models/deposit_history.py b/lighter/models/deposit_history.py index 2b2e238..b0a68ab 100644 --- a/lighter/models/deposit_history.py +++ b/lighter/models/deposit_history.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "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, diff --git a/lighter/models/deposit_history_item.py b/lighter/models/deposit_history_item.py index 41fb0da..49f6186 100644 --- a/lighter/models/deposit_history_item.py +++ b/lighter/models/deposit_history_item.py @@ -99,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "id": obj.get("id"), "asset_id": obj.get("asset_id"), "amount": obj.get("amount"), diff --git a/lighter/models/detailed_account.py b/lighter/models/detailed_account.py index e0c4b07..cbeff8a 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -37,10 +37,12 @@ class DetailedAccount(BaseModel): l1_address: StrictStr cancel_all_time: StrictInt total_order_count: StrictInt + total_isolated_order_count: StrictInt pending_order_count: StrictInt - available_balance: Optional[StrictStr] + available_balance: StrictStr status: StrictInt collateral: StrictStr + transaction_time: StrictInt account_index: StrictInt name: StrictStr description: StrictStr @@ -50,10 +52,10 @@ class DetailedAccount(BaseModel): assets: List[AccountAsset] total_asset_value: StrictStr cross_asset_value: StrictStr - pool_info: Optional[PublicPoolInfo] + 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", "available_balance", "status", "collateral", "account_index", "name", "description", "can_invite", "referral_points_percentage", "positions", "assets", "total_asset_value", "cross_asset_value", "pool_info", "shares"] + __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "available_balance", "status", "collateral", "transaction_time", "account_index", "name", "description", "can_invite", "referral_points_percentage", "positions", "assets", "total_asset_value", "cross_asset_value", "pool_info", "shares"] model_config = ConfigDict( populate_by_name=True, @@ -136,7 +138,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "account_type": obj.get("account_type"), @@ -144,10 +146,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "l1_address": obj.get("l1_address"), "cancel_all_time": obj.get("cancel_all_time"), "total_order_count": obj.get("total_order_count"), + "total_isolated_order_count": obj.get("total_isolated_order_count"), "pending_order_count": obj.get("pending_order_count"), "available_balance": obj.get("available_balance"), "status": obj.get("status"), "collateral": obj.get("collateral"), + "transaction_time": obj.get("transaction_time"), "account_index": obj.get("account_index"), "name": obj.get("name"), "description": obj.get("description"), diff --git a/lighter/models/detailed_accounts.py b/lighter/models/detailed_accounts.py index 50f61e1..5fde717 100644 --- a/lighter/models/detailed_accounts.py +++ b/lighter/models/detailed_accounts.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "total": obj.get("total"), diff --git a/lighter/models/detailed_candlestick.py b/lighter/models/detailed_candlestick.py index 1a1460d..4ff5987 100644 --- a/lighter/models/detailed_candlestick.py +++ b/lighter/models/detailed_candlestick.py @@ -99,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "timestamp": obj.get("timestamp"), "open": obj.get("open"), "high": obj.get("high"), diff --git a/lighter/models/enriched_tx.py b/lighter/models/enriched_tx.py index caa40af..7956354 100644 --- a/lighter/models/enriched_tx.py +++ b/lighter/models/enriched_tx.py @@ -45,10 +45,11 @@ class EnrichedTx(BaseModel): sequence_index: StrictInt parent_hash: StrictStr api_key_index: StrictInt + transaction_time: StrictInt 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", "api_key_index", "committed_at", "verified_at"] + __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", "api_key_index", "transaction_time", "committed_at", "verified_at"] model_config = ConfigDict( populate_by_name=True, @@ -107,7 +108,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "hash": obj.get("hash"), @@ -126,6 +127,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "sequence_index": obj.get("sequence_index"), "parent_hash": obj.get("parent_hash"), "api_key_index": obj.get("api_key_index"), + "transaction_time": obj.get("transaction_time"), "committed_at": obj.get("committed_at"), "verified_at": obj.get("verified_at") }) diff --git a/lighter/models/exchange_stats.py b/lighter/models/exchange_stats.py index fa276ce..f3e6fc5 100644 --- a/lighter/models/exchange_stats.py +++ b/lighter/models/exchange_stats.py @@ -100,7 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "total": obj.get("total"), diff --git a/lighter/models/export_data.py b/lighter/models/export_data.py index 4e712d8..f16b03e 100644 --- a/lighter/models/export_data.py +++ b/lighter/models/export_data.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "data_url": obj.get("data_url") diff --git a/lighter/models/funding.py b/lighter/models/funding.py index 727be7d..99e0204 100644 --- a/lighter/models/funding.py +++ b/lighter/models/funding.py @@ -90,7 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "timestamp": obj.get("timestamp"), "value": obj.get("value"), "rate": obj.get("rate"), diff --git a/lighter/models/funding_rate.py b/lighter/models/funding_rate.py index ff591b1..7b8129a 100644 --- a/lighter/models/funding_rate.py +++ b/lighter/models/funding_rate.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "exchange": obj.get("exchange"), "symbol": obj.get("symbol"), diff --git a/lighter/models/funding_rates.py b/lighter/models/funding_rates.py index 90e062b..73d4e95 100644 --- a/lighter/models/funding_rates.py +++ b/lighter/models/funding_rates.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "funding_rates": [FundingRate.from_dict(_item) for _item in obj["funding_rates"]] if obj.get("funding_rates") is not None else None diff --git a/lighter/models/fundings.py b/lighter/models/fundings.py index 0ace19a..3aaa32c 100644 --- a/lighter/models/fundings.py +++ b/lighter/models/fundings.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "resolution": obj.get("resolution"), diff --git a/lighter/models/l1_metadata.py b/lighter/models/l1_metadata.py index 19f653b..736c0c2 100644 --- a/lighter/models/l1_metadata.py +++ b/lighter/models/l1_metadata.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "l1_address": obj.get("l1_address"), "can_invite": obj.get("can_invite"), "referral_points_percentage": obj.get("referral_points_percentage") diff --git a/lighter/models/l1_provider_info.py b/lighter/models/l1_provider_info.py index 41e5a3b..55d9ee5 100644 --- a/lighter/models/l1_provider_info.py +++ b/lighter/models/l1_provider_info.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "chainId": obj.get("chainId"), "networkId": obj.get("networkId"), "latestBlockNumber": obj.get("latestBlockNumber") diff --git a/lighter/models/liq_trade.py b/lighter/models/liq_trade.py index 276042e..5d00ace 100644 --- a/lighter/models/liq_trade.py +++ b/lighter/models/liq_trade.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -30,8 +30,9 @@ class LiqTrade(BaseModel): size: StrictStr taker_fee: StrictStr maker_fee: StrictStr + transaction_time: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["price", "size", "taker_fee", "maker_fee"] + __properties: ClassVar[List[str]] = ["price", "size", "taker_fee", "maker_fee", "transaction_time"] model_config = ConfigDict( populate_by_name=True, @@ -90,11 +91,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "price": obj.get("price"), "size": obj.get("size"), "taker_fee": obj.get("taker_fee"), - "maker_fee": obj.get("maker_fee") + "maker_fee": obj.get("maker_fee"), + "transaction_time": obj.get("transaction_time") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/liquidation.py b/lighter/models/liquidation.py index aa012a4..e8fc2a2 100644 --- a/lighter/models/liquidation.py +++ b/lighter/models/liquidation.py @@ -107,7 +107,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "id": obj.get("id"), "market_id": obj.get("market_id"), "type": obj.get("type"), diff --git a/lighter/models/liquidation_info.py b/lighter/models/liquidation_info.py index 91519d1..ad0a781 100644 --- a/lighter/models/liquidation_info.py +++ b/lighter/models/liquidation_info.py @@ -105,7 +105,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "positions": [AccountPosition.from_dict(_item) for _item in obj["positions"]] if obj.get("positions") is not None else None, "risk_info_before": RiskInfo.from_dict(obj["risk_info_before"]) if obj.get("risk_info_before") is not None else None, "risk_info_after": RiskInfo.from_dict(obj["risk_info_after"]) if obj.get("risk_info_after") is not None else None, diff --git a/lighter/models/liquidation_infos.py b/lighter/models/liquidation_infos.py index 9d633d7..9e5b6b2 100644 --- a/lighter/models/liquidation_infos.py +++ b/lighter/models/liquidation_infos.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "liquidations": [Liquidation.from_dict(_item) for _item in obj["liquidations"]] if obj.get("liquidations") is not None else None, diff --git a/lighter/models/market_config.py b/lighter/models/market_config.py index c5f9ddb..d898dde 100644 --- a/lighter/models/market_config.py +++ b/lighter/models/market_config.py @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_margin_mode": obj.get("market_margin_mode"), "insurance_fund_account_index": obj.get("insurance_fund_account_index"), "liquidation_mode": obj.get("liquidation_mode"), diff --git a/lighter/models/next_nonce.py b/lighter/models/next_nonce.py index 94ab734..5d698f1 100644 --- a/lighter/models/next_nonce.py +++ b/lighter/models/next_nonce.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "nonce": obj.get("nonce") diff --git a/lighter/models/order.py b/lighter/models/order.py index a0db5d2..42c370a 100644 --- a/lighter/models/order.py +++ b/lighter/models/order.py @@ -59,8 +59,9 @@ class Order(BaseModel): timestamp: StrictInt created_at: StrictInt updated_at: StrictInt + transaction_time: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["order_index", "client_order_index", "order_id", "client_order_id", "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_status", "trigger_time", "parent_order_index", "parent_order_id", "to_trigger_order_id_0", "to_trigger_order_id_1", "to_cancel_order_id_0", "block_height", "timestamp", "created_at", "updated_at"] + __properties: ClassVar[List[str]] = ["order_index", "client_order_index", "order_id", "client_order_id", "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_status", "trigger_time", "parent_order_index", "parent_order_id", "to_trigger_order_id_0", "to_trigger_order_id_1", "to_cancel_order_id_0", "block_height", "timestamp", "created_at", "updated_at", "transaction_time"] @field_validator('type') def type_validate_enum(cls, value): @@ -147,7 +148,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "order_index": obj.get("order_index"), "client_order_index": obj.get("client_order_index"), "order_id": obj.get("order_id"), @@ -180,7 +181,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "block_height": obj.get("block_height"), "timestamp": obj.get("timestamp"), "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at") + "updated_at": obj.get("updated_at"), + "transaction_time": obj.get("transaction_time") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/order_book.py b/lighter/models/order_book.py index 0c39960..c269137 100644 --- a/lighter/models/order_book.py +++ b/lighter/models/order_book.py @@ -115,7 +115,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "symbol": obj.get("symbol"), "market_id": obj.get("market_id"), "market_type": obj.get("market_type"), diff --git a/lighter/models/order_book_depth.py b/lighter/models/order_book_depth.py index 68d7534..485558a 100644 --- a/lighter/models/order_book_depth.py +++ b/lighter/models/order_book_depth.py @@ -107,7 +107,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "asks": [PriceLevel.from_dict(_item) for _item in obj["asks"]] if obj.get("asks") is not None else None, diff --git a/lighter/models/referral_points.py b/lighter/models/order_book_depth_with_begin_nonce.py similarity index 62% rename from lighter/models/referral_points.py rename to lighter/models/order_book_depth_with_begin_nonce.py index e6f4900..641ab10 100644 --- a/lighter/models/referral_points.py +++ b/lighter/models/order_book_depth_with_begin_nonce.py @@ -17,24 +17,23 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Union -from lighter.models.referral_point_entry import ReferralPointEntry +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from lighter.models.price_level import PriceLevel from typing import Optional, Set from typing_extensions import Self -class ReferralPoints(BaseModel): +class OrderBookDepthWithBeginNonce(BaseModel): """ - ReferralPoints + OrderBookDepthWithBeginNonce """ # noqa: E501 - referrals: List[ReferralPointEntry] - user_total_points: Union[StrictFloat, StrictInt] - user_last_week_points: Union[StrictFloat, StrictInt] - user_total_referral_reward_points: Union[StrictFloat, StrictInt] - user_last_week_referral_reward_points: Union[StrictFloat, StrictInt] - reward_point_multiplier: StrictStr + asks: List[PriceLevel] + bids: List[PriceLevel] + offset: StrictInt + nonce: StrictInt + begin_nonce: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["referrals", "user_total_points", "user_last_week_points", "user_total_referral_reward_points", "user_last_week_referral_reward_points", "reward_point_multiplier"] + __properties: ClassVar[List[str]] = ["asks", "bids", "offset", "nonce", "begin_nonce"] model_config = ConfigDict( populate_by_name=True, @@ -54,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReferralPoints from a JSON string""" + """Create an instance of OrderBookDepthWithBeginNonce from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,13 +76,20 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in referrals (list) + # override the default output from pydantic by calling `to_dict()` of each item in asks (list) _items = [] - if self.referrals: - for _item in self.referrals: + if self.asks: + for _item in self.asks: if _item: _items.append(_item.to_dict()) - _dict['referrals'] = _items + _dict['asks'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in bids (list) + _items = [] + if self.bids: + for _item in self.bids: + 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(): @@ -93,20 +99,19 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReferralPoints from a dict""" + """Create an instance of OrderBookDepthWithBeginNonce from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "referrals": [ReferralPointEntry.from_dict(_item) for _item in obj["referrals"]] if obj.get("referrals") is not None else None, - "user_total_points": obj.get("user_total_points"), - "user_last_week_points": obj.get("user_last_week_points"), - "user_total_referral_reward_points": obj.get("user_total_referral_reward_points"), - "user_last_week_referral_reward_points": obj.get("user_last_week_referral_reward_points"), - "reward_point_multiplier": obj.get("reward_point_multiplier") + _obj = cls.model_construct(**{ + "asks": [PriceLevel.from_dict(_item) for _item in obj["asks"]] if obj.get("asks") is not None else None, + "bids": [PriceLevel.from_dict(_item) for _item in obj["bids"]] if obj.get("bids") is not None else None, + "offset": obj.get("offset"), + "nonce": obj.get("nonce"), + "begin_nonce": obj.get("begin_nonce") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/order_book_details.py b/lighter/models/order_book_details.py index b2f5091..6daf960 100644 --- a/lighter/models/order_book_details.py +++ b/lighter/models/order_book_details.py @@ -106,7 +106,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "order_book_details": [PerpsOrderBookDetail.from_dict(_item) for _item in obj["order_book_details"]] if obj.get("order_book_details") is not None else None, diff --git a/lighter/models/order_book_orders.py b/lighter/models/order_book_orders.py index 549d79c..1e69164 100644 --- a/lighter/models/order_book_orders.py +++ b/lighter/models/order_book_orders.py @@ -107,7 +107,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "total_asks": obj.get("total_asks"), diff --git a/lighter/models/order_book_stats.py b/lighter/models/order_book_stats.py index 5f09676..8719552 100644 --- a/lighter/models/order_book_stats.py +++ b/lighter/models/order_book_stats.py @@ -92,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "symbol": obj.get("symbol"), "last_trade_price": obj.get("last_trade_price"), "daily_trades_count": obj.get("daily_trades_count"), diff --git a/lighter/models/order_books.py b/lighter/models/order_books.py index f7cc8e8..f94a315 100644 --- a/lighter/models/order_books.py +++ b/lighter/models/order_books.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "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 diff --git a/lighter/models/orders.py b/lighter/models/orders.py index b494259..788b2c5 100644 --- a/lighter/models/orders.py +++ b/lighter/models/orders.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "next_cursor": obj.get("next_cursor"), diff --git a/lighter/models/perps_market_stats.py b/lighter/models/perps_market_stats.py index e810dc5..d28434f 100644 --- a/lighter/models/perps_market_stats.py +++ b/lighter/models/perps_market_stats.py @@ -103,7 +103,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "symbol": obj.get("symbol"), "market_id": obj.get("market_id"), "index_price": obj.get("index_price"), diff --git a/lighter/models/perps_order_book_detail.py b/lighter/models/perps_order_book_detail.py index 2ec0269..46f1c77 100644 --- a/lighter/models/perps_order_book_detail.py +++ b/lighter/models/perps_order_book_detail.py @@ -136,7 +136,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "symbol": obj.get("symbol"), "market_id": obj.get("market_id"), "market_type": obj.get("market_type"), diff --git a/lighter/models/pn_l_entry.py b/lighter/models/pn_l_entry.py index bff1f17..1b09378 100644 --- a/lighter/models/pn_l_entry.py +++ b/lighter/models/pn_l_entry.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "timestamp": obj.get("timestamp"), "trade_pnl": obj.get("trade_pnl"), "trade_spot_pnl": obj.get("trade_spot_pnl"), diff --git a/lighter/models/position_funding.py b/lighter/models/position_funding.py index 1fee27f..7fe8093 100644 --- a/lighter/models/position_funding.py +++ b/lighter/models/position_funding.py @@ -100,7 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "timestamp": obj.get("timestamp"), "market_id": obj.get("market_id"), "funding_id": obj.get("funding_id"), diff --git a/lighter/models/position_fundings.py b/lighter/models/position_fundings.py index fcd8677..c5b603e 100644 --- a/lighter/models/position_fundings.py +++ b/lighter/models/position_fundings.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "position_fundings": [PositionFunding.from_dict(_item) for _item in obj["position_fundings"]] if obj.get("position_fundings") is not None else None, diff --git a/lighter/models/price_level.py b/lighter/models/price_level.py index dc5b081..188551a 100644 --- a/lighter/models/price_level.py +++ b/lighter/models/price_level.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "price": obj.get("price"), "size": obj.get("size") }) diff --git a/lighter/models/public_pool_info.py b/lighter/models/public_pool_info.py index ea35eba..d0c1a0b 100644 --- a/lighter/models/public_pool_info.py +++ b/lighter/models/public_pool_info.py @@ -111,7 +111,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "status": obj.get("status"), "operator_fee": obj.get("operator_fee"), "min_operator_share_rate": obj.get("min_operator_share_rate"), diff --git a/lighter/models/public_pool_metadata.py b/lighter/models/public_pool_metadata.py index f4ec073..a489118 100644 --- a/lighter/models/public_pool_metadata.py +++ b/lighter/models/public_pool_metadata.py @@ -105,7 +105,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "account_index": obj.get("account_index"), diff --git a/lighter/models/public_pool_share.py b/lighter/models/public_pool_share.py index 0261075..6e9b6b4 100644 --- a/lighter/models/public_pool_share.py +++ b/lighter/models/public_pool_share.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "public_pool_index": obj.get("public_pool_index"), "shares_amount": obj.get("shares_amount"), "entry_usdc": obj.get("entry_usdc") diff --git a/lighter/models/resp_update_referral_code.py b/lighter/models/req_do_faucet.py similarity index 79% rename from lighter/models/resp_update_referral_code.py rename to lighter/models/req_do_faucet.py index c1f215f..16281b1 100644 --- a/lighter/models/resp_update_referral_code.py +++ b/lighter/models/req_do_faucet.py @@ -17,20 +17,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class RespUpdateReferralCode(BaseModel): +class ReqDoFaucet(BaseModel): """ - RespUpdateReferralCode + ReqDoFaucet """ # noqa: E501 - code: StrictInt - message: Optional[StrictStr] = None - success: StrictBool + l1_address: StrictStr + do_l1_transfer: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "success"] + __properties: ClassVar[List[str]] = ["l1_address", "do_l1_transfer"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RespUpdateReferralCode from a JSON string""" + """Create an instance of ReqDoFaucet from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,17 +81,16 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RespUpdateReferralCode from a dict""" + """Create an instance of ReqDoFaucet from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "success": obj.get("success") + _obj = cls.model_construct(**{ + "l1_address": obj.get("l1_address"), + "do_l1_transfer": obj.get("do_l1_transfer") if obj.get("do_l1_transfer") is not None else False }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_export_data.py b/lighter/models/req_export_data.py index d82b64e..96233de 100644 --- a/lighter/models/req_export_data.py +++ b/lighter/models/req_export_data.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -26,7 +26,7 @@ class ReqExportData(BaseModel): """ ReqExportData """ # noqa: E501 - auth: Optional[StrictStr] = None + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") account_index: Optional[StrictInt] = -1 market_id: Optional[StrictInt] = None type: StrictStr @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "auth": obj.get("auth"), "account_index": obj.get("account_index") if obj.get("account_index") is not None else -1, "market_id": obj.get("market_id"), diff --git a/lighter/models/req_get_account.py b/lighter/models/req_get_account.py index c6108e6..bc688c1 100644 --- a/lighter/models/req_get_account.py +++ b/lighter/models/req_get_account.py @@ -95,7 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "by": obj.get("by"), "value": obj.get("value") }) diff --git a/lighter/models/req_get_account_active_orders.py b/lighter/models/req_get_account_active_orders.py index bf3daff..7e976cd 100644 --- a/lighter/models/req_get_account_active_orders.py +++ b/lighter/models/req_get_account_active_orders.py @@ -26,11 +26,11 @@ class ReqGetAccountActiveOrders(BaseModel): """ ReqGetAccountActiveOrders """ # noqa: E501 + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") account_index: StrictInt market_id: StrictInt - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "market_id", "auth"] + __properties: ClassVar[List[str]] = ["auth", "account_index", "market_id"] model_config = ConfigDict( populate_by_name=True, @@ -89,10 +89,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ + "auth": obj.get("auth"), "account_index": obj.get("account_index"), - "market_id": obj.get("market_id"), - "auth": obj.get("auth") + "market_id": obj.get("market_id") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_get_account_api_keys.py b/lighter/models/req_get_account_api_keys.py index 2a395ad..ce423e3 100644 --- a/lighter/models/req_get_account_api_keys.py +++ b/lighter/models/req_get_account_api_keys.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "account_index": obj.get("account_index"), "api_key_index": obj.get("api_key_index") }) diff --git a/lighter/models/req_get_account_by_l1_address.py b/lighter/models/req_get_account_by_l1_address.py index a0b86eb..d5bda53 100644 --- a/lighter/models/req_get_account_by_l1_address.py +++ b/lighter/models/req_get_account_by_l1_address.py @@ -87,7 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "l1_address": obj.get("l1_address") }) # store additional fields in additional_properties diff --git a/lighter/models/req_get_account_inactive_orders.py b/lighter/models/req_get_account_inactive_orders.py index 9ea9b18..6ab3288 100644 --- a/lighter/models/req_get_account_inactive_orders.py +++ b/lighter/models/req_get_account_inactive_orders.py @@ -94,7 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "auth": obj.get("auth"), "account_index": obj.get("account_index"), "market_id": obj.get("market_id"), diff --git a/lighter/models/req_get_account_limits.py b/lighter/models/req_get_account_limits.py index 206f876..eb483ac 100644 --- a/lighter/models/req_get_account_limits.py +++ b/lighter/models/req_get_account_limits.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "account_index": obj.get("account_index"), "auth": obj.get("auth") }) diff --git a/lighter/models/req_get_account_metadata.py b/lighter/models/req_get_account_metadata.py index 4403e9d..b20a60d 100644 --- a/lighter/models/req_get_account_metadata.py +++ b/lighter/models/req_get_account_metadata.py @@ -96,7 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "by": obj.get("by"), "value": obj.get("value"), "auth": obj.get("auth") diff --git a/lighter/models/req_get_account_pn_l.py b/lighter/models/req_get_account_pn_l.py index 034022c..ed47aa4 100644 --- a/lighter/models/req_get_account_pn_l.py +++ b/lighter/models/req_get_account_pn_l.py @@ -27,7 +27,7 @@ class ReqGetAccountPnL(BaseModel): """ ReqGetAccountPnL """ # noqa: E501 - auth: Optional[StrictStr] = None + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") by: StrictStr value: StrictStr resolution: StrictStr @@ -109,7 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "auth": obj.get("auth"), "by": obj.get("by"), "value": obj.get("value"), diff --git a/lighter/models/req_get_account_txs.py b/lighter/models/req_get_account_txs.py index 6c785f6..e9fa53f 100644 --- a/lighter/models/req_get_account_txs.py +++ b/lighter/models/req_get_account_txs.py @@ -31,10 +31,10 @@ class ReqGetAccountTxs(BaseModel): limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None by: Optional[StrictStr] = None value: Optional[StrictStr] = None + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") types: Optional[List[StrictInt]] = None - auth: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["index", "limit", "by", "value", "types", "auth"] + __properties: ClassVar[List[str]] = ["index", "limit", "by", "value", "auth", "types"] @field_validator('by') def by_validate_enum(cls, value): @@ -103,13 +103,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "index": obj.get("index"), "limit": obj.get("limit"), "by": obj.get("by"), "value": obj.get("value"), - "types": obj.get("types"), - "auth": obj.get("auth") + "auth": obj.get("auth"), + "types": obj.get("types") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_get_referral_points.py b/lighter/models/req_get_api_tokens.py similarity index 82% rename from lighter/models/req_get_referral_points.py rename to lighter/models/req_get_api_tokens.py index 19192ec..e0de034 100644 --- a/lighter/models/req_get_referral_points.py +++ b/lighter/models/req_get_api_tokens.py @@ -17,19 +17,18 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class ReqGetReferralPoints(BaseModel): +class ReqGetApiTokens(BaseModel): """ - ReqGetReferralPoints + ReqGetApiTokens """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") account_index: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index"] + __properties: ClassVar[List[str]] = ["account_index"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetReferralPoints from a JSON string""" + """Create an instance of ReqGetApiTokens from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,15 +80,14 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetReferralPoints from a dict""" + """Create an instance of ReqGetApiTokens from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "auth": obj.get("auth"), + _obj = cls.model_construct(**{ "account_index": obj.get("account_index") }) # store additional fields in additional_properties diff --git a/lighter/models/req_get_asset_details.py b/lighter/models/req_get_asset_details.py index 9f4b7ef..93dae58 100644 --- a/lighter/models/req_get_asset_details.py +++ b/lighter/models/req_get_asset_details.py @@ -87,7 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "asset_id": obj.get("asset_id") }) # store additional fields in additional_properties diff --git a/lighter/models/req_get_block.py b/lighter/models/req_get_block.py index 574e2c7..d0fe811 100644 --- a/lighter/models/req_get_block.py +++ b/lighter/models/req_get_block.py @@ -95,7 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "by": obj.get("by"), "value": obj.get("value") }) diff --git a/lighter/models/req_get_block_txs.py b/lighter/models/req_get_block_txs.py index b040c5e..6a3aa66 100644 --- a/lighter/models/req_get_block_txs.py +++ b/lighter/models/req_get_block_txs.py @@ -95,7 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "by": obj.get("by"), "value": obj.get("value") }) diff --git a/lighter/models/req_get_bridges_by_l1_addr.py b/lighter/models/req_get_bridges_by_l1_addr.py index 6b3d0dc..6ba63fe 100644 --- a/lighter/models/req_get_bridges_by_l1_addr.py +++ b/lighter/models/req_get_bridges_by_l1_addr.py @@ -87,7 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "l1_address": obj.get("l1_address") }) # store additional fields in additional_properties diff --git a/lighter/models/req_get_by_account.py b/lighter/models/req_get_by_account.py index 9e52c14..85557cf 100644 --- a/lighter/models/req_get_by_account.py +++ b/lighter/models/req_get_by_account.py @@ -95,7 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "by": obj.get("by"), "value": obj.get("value") }) diff --git a/lighter/models/req_get_candlesticks.py b/lighter/models/req_get_candles.py similarity index 94% rename from lighter/models/req_get_candlesticks.py rename to lighter/models/req_get_candles.py index 33aecbe..8814c7e 100644 --- a/lighter/models/req_get_candlesticks.py +++ b/lighter/models/req_get_candles.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class ReqGetCandlesticks(BaseModel): +class ReqGetCandles(BaseModel): """ - ReqGetCandlesticks + ReqGetCandles """ # noqa: E501 market_id: StrictInt resolution: StrictStr @@ -61,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetCandlesticks from a JSON string""" + """Create an instance of ReqGetCandles from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -93,14 +93,14 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetCandlesticks from a dict""" + """Create an instance of ReqGetCandles from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "resolution": obj.get("resolution"), "start_timestamp": obj.get("start_timestamp"), diff --git a/lighter/models/req_get_deposit_history.py b/lighter/models/req_get_deposit_history.py index b51846c..c090e2f 100644 --- a/lighter/models/req_get_deposit_history.py +++ b/lighter/models/req_get_deposit_history.py @@ -26,13 +26,13 @@ class ReqGetDepositHistory(BaseModel): """ ReqGetDepositHistory """ # noqa: E501 - account_index: StrictInt auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") + account_index: StrictInt l1_address: StrictStr cursor: Optional[StrictStr] = None filter: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "auth", "l1_address", "cursor", "filter"] + __properties: ClassVar[List[str]] = ["auth", "account_index", "l1_address", "cursor", "filter"] @field_validator('filter') def filter_validate_enum(cls, value): @@ -101,9 +101,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), + _obj = cls.model_construct(**{ "auth": obj.get("auth"), + "account_index": obj.get("account_index"), "l1_address": obj.get("l1_address"), "cursor": obj.get("cursor"), "filter": obj.get("filter") diff --git a/lighter/models/req_get_fast_withdraw_info.py b/lighter/models/req_get_fast_withdraw_info.py index bced0a8..401af0a 100644 --- a/lighter/models/req_get_fast_withdraw_info.py +++ b/lighter/models/req_get_fast_withdraw_info.py @@ -26,10 +26,10 @@ class ReqGetFastWithdrawInfo(BaseModel): """ ReqGetFastWithdrawInfo """ # noqa: E501 - account_index: StrictInt auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") + account_index: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "auth"] + __properties: ClassVar[List[str]] = ["auth", "account_index"] model_config = ConfigDict( populate_by_name=True, @@ -88,9 +88,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), - "auth": obj.get("auth") + _obj = cls.model_construct(**{ + "auth": obj.get("auth"), + "account_index": obj.get("account_index") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_get_fundings.py b/lighter/models/req_get_fundings.py index d2fe9a5..d879d47 100644 --- a/lighter/models/req_get_fundings.py +++ b/lighter/models/req_get_fundings.py @@ -99,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "resolution": obj.get("resolution"), "start_timestamp": obj.get("start_timestamp"), diff --git a/lighter/models/req_get_l1_metadata.py b/lighter/models/req_get_l1_metadata.py index 0ce494a..5ee9d19 100644 --- a/lighter/models/req_get_l1_metadata.py +++ b/lighter/models/req_get_l1_metadata.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "auth": obj.get("auth"), "l1_address": obj.get("l1_address") }) diff --git a/lighter/models/req_get_l1_tx.py b/lighter/models/req_get_l1_tx.py index dda8501..02f7f87 100644 --- a/lighter/models/req_get_l1_tx.py +++ b/lighter/models/req_get_l1_tx.py @@ -87,7 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "hash": obj.get("hash") }) # store additional fields in additional_properties diff --git a/lighter/models/req_get_latest_deposit.py b/lighter/models/req_get_latest_deposit.py index 6ce2506..7bd652d 100644 --- a/lighter/models/req_get_latest_deposit.py +++ b/lighter/models/req_get_latest_deposit.py @@ -87,7 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "l1_address": obj.get("l1_address") }) # store additional fields in additional_properties diff --git a/lighter/models/req_get_liquidation_infos.py b/lighter/models/req_get_liquidation_infos.py index 16701b7..aa7f818 100644 --- a/lighter/models/req_get_liquidation_infos.py +++ b/lighter/models/req_get_liquidation_infos.py @@ -92,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "auth": obj.get("auth"), "account_index": obj.get("account_index"), "market_id": obj.get("market_id"), diff --git a/lighter/models/req_get_next_nonce.py b/lighter/models/req_get_next_nonce.py index 90920a0..1ae8fbc 100644 --- a/lighter/models/req_get_next_nonce.py +++ b/lighter/models/req_get_next_nonce.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "account_index": obj.get("account_index"), "api_key_index": obj.get("api_key_index") }) diff --git a/lighter/models/req_get_order_book_details.py b/lighter/models/req_get_order_book_details.py index a172c1f..50dd1d0 100644 --- a/lighter/models/req_get_order_book_details.py +++ b/lighter/models/req_get_order_book_details.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "filter": obj.get("filter") if obj.get("filter") is not None else 'all' }) diff --git a/lighter/models/req_get_order_book_orders.py b/lighter/models/req_get_order_book_orders.py index 19c6a71..4e72111 100644 --- a/lighter/models/req_get_order_book_orders.py +++ b/lighter/models/req_get_order_book_orders.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "limit": obj.get("limit") }) diff --git a/lighter/models/req_get_order_books.py b/lighter/models/req_get_order_books.py index d7cd179..be80217 100644 --- a/lighter/models/req_get_order_books.py +++ b/lighter/models/req_get_order_books.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "filter": obj.get("filter") if obj.get("filter") is not None else 'all' }) diff --git a/lighter/models/req_get_position_funding.py b/lighter/models/req_get_position_funding.py index 04d07f8..08ab0d9 100644 --- a/lighter/models/req_get_position_funding.py +++ b/lighter/models/req_get_position_funding.py @@ -27,7 +27,7 @@ class ReqGetPositionFunding(BaseModel): """ ReqGetPositionFunding """ # noqa: E501 - auth: Optional[StrictStr] = None + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") account_index: StrictInt market_id: Optional[StrictInt] = None cursor: Optional[StrictStr] = None @@ -103,7 +103,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "auth": obj.get("auth"), "account_index": obj.get("account_index"), "market_id": obj.get("market_id"), diff --git a/lighter/models/req_get_public_pools_metadata.py b/lighter/models/req_get_public_pools_metadata.py index ccb7397..9415178 100644 --- a/lighter/models/req_get_public_pools_metadata.py +++ b/lighter/models/req_get_public_pools_metadata.py @@ -27,7 +27,7 @@ class ReqGetPublicPoolsMetadata(BaseModel): """ ReqGetPublicPoolsMetadata """ # noqa: E501 - auth: Optional[StrictStr] = None + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") filter: Optional[StrictStr] = None index: StrictInt limit: Annotated[int, Field(le=100, strict=True, ge=1)] @@ -102,7 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "auth": obj.get("auth"), "filter": obj.get("filter"), "index": obj.get("index"), diff --git a/lighter/models/req_get_range_with_cursor.py b/lighter/models/req_get_range_with_cursor.py index dc7821e..e7ea2e5 100644 --- a/lighter/models/req_get_range_with_cursor.py +++ b/lighter/models/req_get_range_with_cursor.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "cursor": obj.get("cursor"), "limit": obj.get("limit") }) diff --git a/lighter/models/req_get_range_with_index.py b/lighter/models/req_get_range_with_index.py index e589449..4e5f7f9 100644 --- a/lighter/models/req_get_range_with_index.py +++ b/lighter/models/req_get_range_with_index.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "index": obj.get("index"), "limit": obj.get("limit") }) diff --git a/lighter/models/req_get_range_with_index_sortable.py b/lighter/models/req_get_range_with_index_sortable.py index d22bbb2..920b5bb 100644 --- a/lighter/models/req_get_range_with_index_sortable.py +++ b/lighter/models/req_get_range_with_index_sortable.py @@ -100,7 +100,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "index": obj.get("index"), "limit": obj.get("limit"), "sort": obj.get("sort") if obj.get("sort") is not None else 'asc' diff --git a/lighter/models/req_get_recent_trades.py b/lighter/models/req_get_recent_trades.py index 96dba79..f2f32ba 100644 --- a/lighter/models/req_get_recent_trades.py +++ b/lighter/models/req_get_recent_trades.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "limit": obj.get("limit") }) diff --git a/lighter/models/req_get_trades.py b/lighter/models/req_get_trades.py index 60a8b90..acc205c 100644 --- a/lighter/models/req_get_trades.py +++ b/lighter/models/req_get_trades.py @@ -27,7 +27,7 @@ class ReqGetTrades(BaseModel): """ ReqGetTrades """ # noqa: E501 - auth: Optional[StrictStr] = None + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") market_id: Optional[StrictInt] = None account_index: Optional[StrictInt] = -1 order_index: Optional[StrictInt] = None @@ -137,7 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "auth": obj.get("auth"), "market_id": obj.get("market_id"), "account_index": obj.get("account_index") if obj.get("account_index") is not None else -1, diff --git a/lighter/models/req_get_transfer_fee_info.py b/lighter/models/req_get_transfer_fee_info.py index 1d053be..1636b55 100644 --- a/lighter/models/req_get_transfer_fee_info.py +++ b/lighter/models/req_get_transfer_fee_info.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -26,7 +26,7 @@ class ReqGetTransferFeeInfo(BaseModel): """ ReqGetTransferFeeInfo """ # noqa: E501 - auth: Optional[StrictStr] = None + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") account_index: StrictInt to_account_index: Optional[StrictInt] = -1 additional_properties: Dict[str, Any] = {} @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "auth": obj.get("auth"), "account_index": obj.get("account_index"), "to_account_index": obj.get("to_account_index") if obj.get("to_account_index") is not None else -1 diff --git a/lighter/models/req_get_transfer_history.py b/lighter/models/req_get_transfer_history.py index b6b75ba..906242f 100644 --- a/lighter/models/req_get_transfer_history.py +++ b/lighter/models/req_get_transfer_history.py @@ -26,11 +26,11 @@ class ReqGetTransferHistory(BaseModel): """ ReqGetTransferHistory """ # noqa: E501 - account_index: StrictInt auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") + account_index: StrictInt cursor: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "auth", "cursor"] + __properties: ClassVar[List[str]] = ["auth", "account_index", "cursor"] model_config = ConfigDict( populate_by_name=True, @@ -89,9 +89,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), + _obj = cls.model_construct(**{ "auth": obj.get("auth"), + "account_index": obj.get("account_index"), "cursor": obj.get("cursor") }) # store additional fields in additional_properties diff --git a/lighter/models/req_get_tx.py b/lighter/models/req_get_tx.py index 275c4ff..70706fd 100644 --- a/lighter/models/req_get_tx.py +++ b/lighter/models/req_get_tx.py @@ -95,7 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "by": obj.get("by"), "value": obj.get("value") }) diff --git a/lighter/models/req_get_withdraw_history.py b/lighter/models/req_get_withdraw_history.py index ecd05c7..fc2f730 100644 --- a/lighter/models/req_get_withdraw_history.py +++ b/lighter/models/req_get_withdraw_history.py @@ -26,12 +26,12 @@ class ReqGetWithdrawHistory(BaseModel): """ ReqGetWithdrawHistory """ # noqa: E501 - account_index: StrictInt auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") + account_index: StrictInt cursor: Optional[StrictStr] = None filter: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "auth", "cursor", "filter"] + __properties: ClassVar[List[str]] = ["auth", "account_index", "cursor", "filter"] @field_validator('filter') def filter_validate_enum(cls, value): @@ -100,9 +100,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), + _obj = cls.model_construct(**{ "auth": obj.get("auth"), + "account_index": obj.get("account_index"), "cursor": obj.get("cursor"), "filter": obj.get("filter") }) diff --git a/lighter/models/resp_change_account_tier.py b/lighter/models/resp_change_account_tier.py index 35b6c15..9e9b797 100644 --- a/lighter/models/resp_change_account_tier.py +++ b/lighter/models/resp_change_account_tier.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message") }) diff --git a/lighter/models/blocks.py b/lighter/models/resp_get_api_tokens.py similarity index 81% rename from lighter/models/blocks.py rename to lighter/models/resp_get_api_tokens.py index 2591f16..7cb52b7 100644 --- a/lighter/models/blocks.py +++ b/lighter/models/resp_get_api_tokens.py @@ -19,20 +19,19 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from lighter.models.block import Block +from lighter.models.api_token import ApiToken from typing import Optional, Set from typing_extensions import Self -class Blocks(BaseModel): +class RespGetApiTokens(BaseModel): """ - Blocks + RespGetApiTokens """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - total: StrictInt - blocks: List[Block] + api_tokens: List[ApiToken] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "total", "blocks"] + __properties: ClassVar[List[str]] = ["code", "message", "api_tokens"] model_config = ConfigDict( populate_by_name=True, @@ -52,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Blocks from a JSON string""" + """Create an instance of RespGetApiTokens from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,13 +74,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in blocks (list) + # override the default output from pydantic by calling `to_dict()` of each item in api_tokens (list) _items = [] - if self.blocks: - for _item in self.blocks: + if self.api_tokens: + for _item in self.api_tokens: if _item: _items.append(_item.to_dict()) - _dict['blocks'] = _items + _dict['api_tokens'] = _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(): @@ -91,18 +90,17 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Blocks from a dict""" + """Create an instance of RespGetApiTokens from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "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 + "api_tokens": [ApiToken.from_dict(_item) for _item in obj["api_tokens"]] if obj.get("api_tokens") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/resp_get_bridges_by_l1_addr.py b/lighter/models/resp_get_bridges_by_l1_addr.py index 8d8961f..923f331 100644 --- a/lighter/models/resp_get_bridges_by_l1_addr.py +++ b/lighter/models/resp_get_bridges_by_l1_addr.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "bridges": [Bridge.from_dict(_item) for _item in obj["bridges"]] if obj.get("bridges") is not None else None diff --git a/lighter/models/resp_get_fast_bridge_info.py b/lighter/models/resp_get_fast_bridge_info.py index baf3922..8e38c73 100644 --- a/lighter/models/resp_get_fast_bridge_info.py +++ b/lighter/models/resp_get_fast_bridge_info.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "fast_bridge_limit": obj.get("fast_bridge_limit") diff --git a/lighter/models/txs.py b/lighter/models/resp_get_fastwithdrawal_info.py similarity index 80% rename from lighter/models/txs.py rename to lighter/models/resp_get_fastwithdrawal_info.py index 8beafb5..38ece6c 100644 --- a/lighter/models/txs.py +++ b/lighter/models/resp_get_fastwithdrawal_info.py @@ -19,19 +19,20 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from lighter.models.tx import Tx from typing import Optional, Set from typing_extensions import Self -class Txs(BaseModel): +class RespGetFastwithdrawalInfo(BaseModel): """ - Txs + RespGetFastwithdrawalInfo """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - txs: List[Tx] + to_account_index: StrictInt + withdraw_limit: StrictStr + max_withdrawal_amount: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "txs"] + __properties: ClassVar[List[str]] = ["code", "message", "to_account_index", "withdraw_limit", "max_withdrawal_amount"] model_config = ConfigDict( populate_by_name=True, @@ -51,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Txs from a JSON string""" + """Create an instance of RespGetFastwithdrawalInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,13 +75,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in txs (list) - _items = [] - if self.txs: - for _item in self.txs: - 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(): @@ -90,17 +84,19 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Txs from a dict""" + """Create an instance of RespGetFastwithdrawalInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "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 + "to_account_index": obj.get("to_account_index"), + "withdraw_limit": obj.get("withdraw_limit"), + "max_withdrawal_amount": obj.get("max_withdrawal_amount") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/resp_get_is_next_bridge_fast.py b/lighter/models/resp_get_is_next_bridge_fast.py index 31496a5..8245973 100644 --- a/lighter/models/resp_get_is_next_bridge_fast.py +++ b/lighter/models/resp_get_is_next_bridge_fast.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "is_next_bridge_fast": obj.get("is_next_bridge_fast") diff --git a/lighter/models/resp_post_api_token.py b/lighter/models/resp_post_api_token.py new file mode 100644 index 0000000..b8b3ee2 --- /dev/null +++ b/lighter/models/resp_post_api_token.py @@ -0,0 +1,118 @@ +# 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 RespPostApiToken(BaseModel): + """ + RespPostApiToken + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + token_id: StrictInt + api_token: StrictStr + name: StrictStr + account_index: StrictInt + expiry: StrictInt + sub_account_access: StrictBool + revoked: StrictBool + scopes: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "token_id", "api_token", "name", "account_index", "expiry", "sub_account_access", "revoked", "scopes"] + + 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 RespPostApiToken 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. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + 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 RespPostApiToken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "token_id": obj.get("token_id"), + "api_token": obj.get("api_token"), + "name": obj.get("name"), + "account_index": obj.get("account_index"), + "expiry": obj.get("expiry"), + "sub_account_access": obj.get("sub_account_access"), + "revoked": obj.get("revoked"), + "scopes": obj.get("scopes") + }) + # 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/resp_public_pools_metadata.py b/lighter/models/resp_public_pools_metadata.py index 0719da8..f3406e7 100644 --- a/lighter/models/resp_public_pools_metadata.py +++ b/lighter/models/resp_public_pools_metadata.py @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "public_pools": [PublicPoolMetadata.from_dict(_item) for _item in obj["public_pools"]] if obj.get("public_pools") is not None else None diff --git a/lighter/models/resp_update_kickback.py b/lighter/models/resp_revoke_api_token.py similarity index 86% rename from lighter/models/resp_update_kickback.py rename to lighter/models/resp_revoke_api_token.py index 308cb5c..91359b4 100644 --- a/lighter/models/resp_update_kickback.py +++ b/lighter/models/resp_revoke_api_token.py @@ -22,15 +22,16 @@ from typing import Optional, Set from typing_extensions import Self -class RespUpdateKickback(BaseModel): +class RespRevokeApiToken(BaseModel): """ - RespUpdateKickback + RespRevokeApiToken """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - success: StrictBool + token_id: StrictInt + revoked: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "success"] + __properties: ClassVar[List[str]] = ["code", "message", "token_id", "revoked"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RespUpdateKickback from a JSON string""" + """Create an instance of RespRevokeApiToken from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,17 +83,18 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RespUpdateKickback from a dict""" + """Create an instance of RespRevokeApiToken from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), - "success": obj.get("success") + "token_id": obj.get("token_id"), + "revoked": obj.get("revoked") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/resp_send_tx.py b/lighter/models/resp_send_tx.py index 7a52c88..5bbdaa8 100644 --- a/lighter/models/resp_send_tx.py +++ b/lighter/models/resp_send_tx.py @@ -30,7 +30,7 @@ class RespSendTx(BaseModel): message: Optional[StrictStr] = None tx_hash: StrictStr predicted_execution_time_ms: StrictInt - volume_quota_remaining: Optional[StrictInt] = None + volume_quota_remaining: StrictInt additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "tx_hash", "predicted_execution_time_ms", "volume_quota_remaining"] @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "tx_hash": obj.get("tx_hash"), diff --git a/lighter/models/resp_send_tx_batch.py b/lighter/models/resp_send_tx_batch.py index 33b3d3d..0e408a2 100644 --- a/lighter/models/resp_send_tx_batch.py +++ b/lighter/models/resp_send_tx_batch.py @@ -30,7 +30,7 @@ class RespSendTxBatch(BaseModel): message: Optional[StrictStr] = None tx_hash: List[StrictStr] predicted_execution_time_ms: StrictInt - volume_quota_remaining: Optional[StrictInt] = None + volume_quota_remaining: StrictInt additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "tx_hash", "predicted_execution_time_ms", "volume_quota_remaining"] @@ -91,7 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "tx_hash": obj.get("tx_hash"), diff --git a/lighter/models/resp_withdrawal_delay.py b/lighter/models/resp_withdrawal_delay.py index 3add899..dac6ebf 100644 --- a/lighter/models/resp_withdrawal_delay.py +++ b/lighter/models/resp_withdrawal_delay.py @@ -87,7 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "seconds": obj.get("seconds") }) # store additional fields in additional_properties diff --git a/lighter/models/result_code.py b/lighter/models/result_code.py index a29a276..6e8eb96 100644 --- a/lighter/models/result_code.py +++ b/lighter/models/result_code.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message") }) diff --git a/lighter/models/risk_info.py b/lighter/models/risk_info.py index 93d571e..d0a5d2b 100644 --- a/lighter/models/risk_info.py +++ b/lighter/models/risk_info.py @@ -99,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "cross_risk_parameters": RiskParameters.from_dict(obj["cross_risk_parameters"]) if obj.get("cross_risk_parameters") is not None else None, "isolated_risk_parameters": [RiskParameters.from_dict(_item) for _item in obj["isolated_risk_parameters"]] if obj.get("isolated_risk_parameters") is not None else None }) diff --git a/lighter/models/risk_parameters.py b/lighter/models/risk_parameters.py index 2084032..2d0463c 100644 --- a/lighter/models/risk_parameters.py +++ b/lighter/models/risk_parameters.py @@ -92,7 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "market_id": obj.get("market_id"), "collateral": obj.get("collateral"), "total_account_value": obj.get("total_account_value"), diff --git a/lighter/models/share_price.py b/lighter/models/share_price.py index 6f347b4..923acec 100644 --- a/lighter/models/share_price.py +++ b/lighter/models/share_price.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "timestamp": obj.get("timestamp"), "share_price": obj.get("share_price") }) diff --git a/lighter/models/simple_order.py b/lighter/models/simple_order.py index a10be5d..b11a3a2 100644 --- a/lighter/models/simple_order.py +++ b/lighter/models/simple_order.py @@ -33,8 +33,9 @@ class SimpleOrder(BaseModel): remaining_base_amount: StrictStr price: StrictStr order_expiry: StrictInt + transaction_time: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["order_index", "order_id", "owner_account_index", "initial_base_amount", "remaining_base_amount", "price", "order_expiry"] + __properties: ClassVar[List[str]] = ["order_index", "order_id", "owner_account_index", "initial_base_amount", "remaining_base_amount", "price", "order_expiry", "transaction_time"] model_config = ConfigDict( populate_by_name=True, @@ -93,14 +94,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "order_index": obj.get("order_index"), "order_id": obj.get("order_id"), "owner_account_index": obj.get("owner_account_index"), "initial_base_amount": obj.get("initial_base_amount"), "remaining_base_amount": obj.get("remaining_base_amount"), "price": obj.get("price"), - "order_expiry": obj.get("order_expiry") + "order_expiry": obj.get("order_expiry"), + "transaction_time": obj.get("transaction_time") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/spot_market_stats.py b/lighter/models/spot_market_stats.py index c060462..60e7945 100644 --- a/lighter/models/spot_market_stats.py +++ b/lighter/models/spot_market_stats.py @@ -96,7 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "symbol": obj.get("symbol"), "market_id": obj.get("market_id"), "index_price": obj.get("index_price"), diff --git a/lighter/models/spot_order_book_detail.py b/lighter/models/spot_order_book_detail.py index 70cd0d8..b606737 100644 --- a/lighter/models/spot_order_book_detail.py +++ b/lighter/models/spot_order_book_detail.py @@ -125,7 +125,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "symbol": obj.get("symbol"), "market_id": obj.get("market_id"), "market_type": obj.get("market_type"), diff --git a/lighter/models/status.py b/lighter/models/status.py index d2026f0..5c85974 100644 --- a/lighter/models/status.py +++ b/lighter/models/status.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "status": obj.get("status"), "network_id": obj.get("network_id"), "timestamp": obj.get("timestamp") diff --git a/lighter/models/sub_accounts.py b/lighter/models/sub_accounts.py index 76f4c0c..c51a05c 100644 --- a/lighter/models/sub_accounts.py +++ b/lighter/models/sub_accounts.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "l1_address": obj.get("l1_address"), diff --git a/lighter/models/ticker.py b/lighter/models/ticker.py index 96a5cd4..7c262c2 100644 --- a/lighter/models/ticker.py +++ b/lighter/models/ticker.py @@ -96,7 +96,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "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 diff --git a/lighter/models/trade.py b/lighter/models/trade.py index a8c1de4..be9c2ee 100644 --- a/lighter/models/trade.py +++ b/lighter/models/trade.py @@ -42,18 +42,19 @@ class Trade(BaseModel): is_maker_ask: StrictBool block_height: StrictInt timestamp: StrictInt - taker_fee: Optional[StrictInt] + taker_fee: StrictInt taker_position_size_before: StrictStr taker_entry_quote_before: StrictStr - taker_initial_margin_fraction_before: Optional[StrictInt] - taker_position_sign_changed: Optional[StrictBool] - maker_fee: Optional[StrictInt] + taker_initial_margin_fraction_before: StrictInt + taker_position_sign_changed: StrictBool + maker_fee: StrictInt maker_position_size_before: StrictStr maker_entry_quote_before: StrictStr - maker_initial_margin_fraction_before: Optional[StrictInt] - maker_position_sign_changed: Optional[StrictBool] + maker_initial_margin_fraction_before: StrictInt + maker_position_sign_changed: StrictBool + transaction_time: 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_client_id", "bid_client_id", "ask_account_id", "bid_account_id", "is_maker_ask", "block_height", "timestamp", "taker_fee", "taker_position_size_before", "taker_entry_quote_before", "taker_initial_margin_fraction_before", "taker_position_sign_changed", "maker_fee", "maker_position_size_before", "maker_entry_quote_before", "maker_initial_margin_fraction_before", "maker_position_sign_changed"] + __properties: ClassVar[List[str]] = ["trade_id", "tx_hash", "type", "market_id", "size", "price", "usd_amount", "ask_id", "bid_id", "ask_client_id", "bid_client_id", "ask_account_id", "bid_account_id", "is_maker_ask", "block_height", "timestamp", "taker_fee", "taker_position_size_before", "taker_entry_quote_before", "taker_initial_margin_fraction_before", "taker_position_sign_changed", "maker_fee", "maker_position_size_before", "maker_entry_quote_before", "maker_initial_margin_fraction_before", "maker_position_sign_changed", "transaction_time"] @field_validator('type') def type_validate_enum(cls, value): @@ -119,7 +120,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "trade_id": obj.get("trade_id"), "tx_hash": obj.get("tx_hash"), "type": obj.get("type"), @@ -145,7 +146,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "maker_position_size_before": obj.get("maker_position_size_before"), "maker_entry_quote_before": obj.get("maker_entry_quote_before"), "maker_initial_margin_fraction_before": obj.get("maker_initial_margin_fraction_before"), - "maker_position_sign_changed": obj.get("maker_position_sign_changed") + "maker_position_sign_changed": obj.get("maker_position_sign_changed"), + "transaction_time": obj.get("transaction_time") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/trades.py b/lighter/models/trades.py index ea2097a..9d1bd0e 100644 --- a/lighter/models/trades.py +++ b/lighter/models/trades.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "next_cursor": obj.get("next_cursor"), diff --git a/lighter/models/transfer_fee_info.py b/lighter/models/transfer_fee_info.py index b4ee332..27d8ab8 100644 --- a/lighter/models/transfer_fee_info.py +++ b/lighter/models/transfer_fee_info.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "transfer_fee_usdc": obj.get("transfer_fee_usdc") diff --git a/lighter/models/transfer_history.py b/lighter/models/transfer_history.py index 9c415e6..3f5d1b7 100644 --- a/lighter/models/transfer_history.py +++ b/lighter/models/transfer_history.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "transfers": [TransferHistoryItem.from_dict(_item) for _item in obj["transfers"]] if obj.get("transfers") is not None else None, diff --git a/lighter/models/transfer_history_item.py b/lighter/models/transfer_history_item.py index 5edf41c..717fa5c 100644 --- a/lighter/models/transfer_history_item.py +++ b/lighter/models/transfer_history_item.py @@ -29,6 +29,7 @@ class TransferHistoryItem(BaseModel): id: StrictStr asset_id: StrictInt amount: StrictStr + fee: StrictStr timestamp: StrictInt type: StrictStr from_l1_address: StrictStr @@ -39,7 +40,7 @@ class TransferHistoryItem(BaseModel): to_route: StrictStr tx_hash: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "asset_id", "amount", "timestamp", "type", "from_l1_address", "to_l1_address", "from_account_index", "to_account_index", "from_route", "to_route", "tx_hash"] + __properties: ClassVar[List[str]] = ["id", "asset_id", "amount", "fee", "timestamp", "type", "from_l1_address", "to_l1_address", "from_account_index", "to_account_index", "from_route", "to_route", "tx_hash"] @field_validator('type') def type_validate_enum(cls, value): @@ -119,10 +120,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "id": obj.get("id"), "asset_id": obj.get("asset_id"), "amount": obj.get("amount"), + "fee": obj.get("fee"), "timestamp": obj.get("timestamp"), "type": obj.get("type"), "from_l1_address": obj.get("from_l1_address"), diff --git a/lighter/models/tx.py b/lighter/models/tx.py deleted file mode 100644 index be33ff6..0000000 --- a/lighter/models/tx.py +++ /dev/null @@ -1,131 +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, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class Tx(BaseModel): - """ - Tx - """ # noqa: E501 - hash: StrictStr - type: Annotated[int, Field(le=64, strict=True, ge=1)] - info: StrictStr - event_info: StrictStr - status: StrictInt - transaction_index: StrictInt - l1_address: StrictStr - account_index: StrictInt - nonce: StrictInt - expire_at: StrictInt - block_height: StrictInt - queued_at: StrictInt - executed_at: StrictInt - sequence_index: StrictInt - parent_hash: StrictStr - api_key_index: StrictInt - 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", "api_key_index"] - - 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 Tx 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. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - 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 Tx from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "hash": obj.get("hash"), - "type": obj.get("type"), - "info": obj.get("info"), - "event_info": obj.get("event_info"), - "status": obj.get("status"), - "transaction_index": obj.get("transaction_index"), - "l1_address": obj.get("l1_address"), - "account_index": obj.get("account_index"), - "nonce": obj.get("nonce"), - "expire_at": obj.get("expire_at"), - "block_height": obj.get("block_height"), - "queued_at": obj.get("queued_at"), - "executed_at": obj.get("executed_at"), - "sequence_index": obj.get("sequence_index"), - "parent_hash": obj.get("parent_hash"), - "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/tx_hash.py b/lighter/models/tx_hash.py index 86cb1ed..06cfc5e 100644 --- a/lighter/models/tx_hash.py +++ b/lighter/models/tx_hash.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "tx_hash": obj.get("tx_hash") diff --git a/lighter/models/tx_hashes.py b/lighter/models/tx_hashes.py index 807aa59..a313f12 100644 --- a/lighter/models/tx_hashes.py +++ b/lighter/models/tx_hashes.py @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), "tx_hash": obj.get("tx_hash") diff --git a/lighter/models/validator_info.py b/lighter/models/validator_info.py index ca08bdf..7af526e 100644 --- a/lighter/models/validator_info.py +++ b/lighter/models/validator_info.py @@ -88,7 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "address": obj.get("address"), "is_active": obj.get("is_active") }) diff --git a/lighter/models/withdraw_history.py b/lighter/models/withdraw_history.py index cdcb8c1..a25230c 100644 --- a/lighter/models/withdraw_history.py +++ b/lighter/models/withdraw_history.py @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "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, diff --git a/lighter/models/withdraw_history_item.py b/lighter/models/withdraw_history_item.py index abb5596..9812939 100644 --- a/lighter/models/withdraw_history_item.py +++ b/lighter/models/withdraw_history_item.py @@ -107,7 +107,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "id": obj.get("id"), "asset_id": obj.get("asset_id"), "amount": obj.get("amount"), diff --git a/lighter/models/zk_lighter_info.py b/lighter/models/zk_lighter_info.py index 81fcb14..e3bbace 100644 --- a/lighter/models/zk_lighter_info.py +++ b/lighter/models/zk_lighter_info.py @@ -87,7 +87,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({ + _obj = cls.model_construct(**{ "contract_address": obj.get("contract_address") }) # store additional fields in additional_properties diff --git a/lighter/signer_client.py b/lighter/signer_client.py index c1bb252..b86b763 100644 --- a/lighter/signer_client.py +++ b/lighter/signer_client.py @@ -212,8 +212,14 @@ class SignerClient: DEFAULT_NONCE = -1 DEFAULT_API_KEY_INDEX = 255 - USDC_TICKER_SCALE = 1e6 ETH_TICKER_SCALE = 1e8 + USDC_TICKER_SCALE = 1e6 + LIT_TICKER_SCALE = 1e8 + LINK_TICKER_SCALE = 1e8 + UNI_TICKER_SCALE = 1e8 + AAVE_TICKER_SCALE = 1e8 + SKY_TICKER_SCALE = 1e8 + LDO_TICKER_SCALE = 1e8 ORDER_TYPE_LIMIT = 0 ORDER_TYPE_MARKET = 1 @@ -250,8 +256,25 @@ class SignerClient: ROUTE_PERP = 0 ROUTE_SPOT = 1 - ASSET_ID_USDC = 3 ASSET_ID_ETH = 1 + ASSET_ID_LIT = 2 + ASSET_ID_USDC = 3 + ASSET_ID_LINK = 5 + ASSET_ID_UNI = 6 + ASSET_ID_AAVE = 7 + ASSET_ID_SKY = 8 + ASSET_ID_LDO = 9 + + ASSET_TO_TICKER_SCALE = { + ASSET_ID_ETH: ETH_TICKER_SCALE, + ASSET_ID_LIT: LIT_TICKER_SCALE, + ASSET_ID_USDC: USDC_TICKER_SCALE, + ASSET_ID_LINK: LINK_TICKER_SCALE, + ASSET_ID_UNI: UNI_TICKER_SCALE, + ASSET_ID_AAVE: AAVE_TICKER_SCALE, + ASSET_ID_SKY: SKY_TICKER_SCALE, + ASSET_ID_LDO: LDO_TICKER_SCALE, + } def __init__( self, @@ -466,6 +489,9 @@ def sign_modify_order(self, market_index: int, order_index: int, base_amount: in def sign_transfer(self, eth_private_key: str, to_account_index: int, asset_id: int, route_from: int, route_to: int, usdc_amount: int, fee: int, memo: str, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX) -> Union[Tuple[str, str, str, None], Tuple[None, None, None, str]]: return self.__decode_and_sign_tx_info(eth_private_key, self.signer.SignTransfer(to_account_index, asset_id, route_from, route_to, usdc_amount, fee, ctypes.c_char_p(memo.encode("utf-8")), nonce, api_key_index, self.account_index)) + def sign_transfer_same_master_account(self, to_account_index: int, asset_id: int, route_from: int, route_to: int, usdc_amount: int, fee: int, memo: str, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX) -> Union[Tuple[str, str, str, None], Tuple[None, None, None, str]]: + return self.__decode_tx_info(self.signer.SignTransfer(to_account_index, asset_id, route_from, route_to, usdc_amount, fee, ctypes.c_char_p(memo.encode("utf-8")), nonce, api_key_index, self.account_index)) + def sign_create_public_pool(self, operator_fee: int, initial_total_shares: int, min_operator_share_rate: int, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX) -> Union[Tuple[str, str, str, None], Tuple[None, None, None, str]]: return self.__decode_tx_info(self.signer.SignCreatePublicPool(operator_fee, initial_total_shares, min_operator_share_rate, nonce, api_key_index, self.account_index)) @@ -743,10 +769,8 @@ async def create_sl_limit_order(self, market_index, client_order_index, base_amo @process_api_key_and_nonce async def withdraw(self, asset_id: int, route_type: int, amount: float, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX) -> Union[Tuple[Withdraw, RespSendTx, None], Tuple[None, None, str]]: - if asset_id == self.ASSET_ID_USDC: - amount = int(amount * self.USDC_TICKER_SCALE) - elif asset_id == self.ASSET_ID_ETH: - amount = int(amount * self.ETH_TICKER_SCALE) + if asset_id in self.ASSET_TO_TICKER_SCALE: + amount = int(amount * self.ASSET_TO_TICKER_SCALE[asset_id]) else: raise ValueError(f"Unsupported asset id: {asset_id}") @@ -796,10 +820,8 @@ async def modify_order( @process_api_key_and_nonce async def transfer(self, eth_private_key: str, to_account_index: int, asset_id: int, route_from: int, route_to: int, amount: float, fee: int, memo: str, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX): - if asset_id == self.ASSET_ID_USDC: - amount = int(amount * self.USDC_TICKER_SCALE) - elif asset_id == self.ASSET_ID_ETH: - amount = int(amount * self.ETH_TICKER_SCALE) + if asset_id in self.ASSET_TO_TICKER_SCALE: + amount = int(amount * self.ASSET_TO_TICKER_SCALE[asset_id]) else: raise ValueError(f"Unsupported asset id: {asset_id}") @@ -812,6 +834,22 @@ async def transfer(self, eth_private_key: str, to_account_index: int, asset_id: logging.debug(f"Transfer Send. TxResponse: {api_response}") return tx_info, api_response, None + @process_api_key_and_nonce + async def transfer_same_master_account(self, to_account_index: int, asset_id: int, route_from: int, route_to: int, amount: float, fee: int, memo: str, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX): + if asset_id in self.ASSET_TO_TICKER_SCALE: + amount = int(amount * self.ASSET_TO_TICKER_SCALE[asset_id]) + else: + raise ValueError(f"Unsupported asset id: {asset_id}") + + tx_type, tx_info, tx_hash, error = self.sign_transfer_same_master_account(to_account_index, asset_id, route_from, route_to, amount, fee, memo, nonce, api_key_index) + if error is not None: + return None, None, error + + logging.debug(f"Transfer TxHash: {tx_hash} TxInfo: {tx_info}") + api_response = await self.send_tx(tx_type=tx_type, tx_info=tx_info) + logging.debug(f"Transfer Send. TxResponse: {api_response}") + return tx_info, api_response, None + @process_api_key_and_nonce async def create_public_pool( self, operator_fee, initial_total_shares, min_operator_share_rate, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX diff --git a/openapi.json b/openapi.json index a30275b..d42774f 100644 --- a/openapi.json +++ b/openapi.json @@ -106,7 +106,14 @@ { "name": "authorization", "description": " make required after integ is done", - "in": "header", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "auth", + "description": " made optional to support header auth clients", + "in": "query", "required": false, "type": "string" }, @@ -123,13 +130,6 @@ "required": true, "type": "integer", "format": "int16" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -163,7 +163,7 @@ { "name": "authorization", "description": " make required after integ is done", - "in": "header", + "in": "query", "required": false, "type": "string" }, @@ -247,13 +247,6 @@ } }, "parameters": [ - { - "name": "authorization", - "description": " make required after integ is done", - "in": "header", - "required": false, - "type": "string" - }, { "name": "account_index", "in": "query", @@ -261,6 +254,13 @@ "type": "integer", "format": "int64" }, + { + "name": "authorization", + "description": " make required after integ is done", + "in": "query", + "required": false, + "type": "string" + }, { "name": "auth", "description": " made optional to support header auth clients", @@ -335,88 +335,6 @@ "description": "Get account metadatas" } }, - "/api/v1/accountTxs": { - "get": { - "summary": "accountTxs", - "operationId": "accountTxs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Txs" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "authorization", - "in": "header", - "required": false, - "type": "string" - }, - { - "name": "index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "limit", - "in": "query", - "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 - }, - { - "name": "by", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "account_index" - ] - }, - { - "name": "value", - "in": "query", - "required": true, - "type": "string" - }, - { - "name": "types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "uint8" - } - }, - { - "name": "auth", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get transactions of a specific account" - } - }, "/api/v1/accountsByL1Address": { "get": { "summary": "accountsByL1Address", @@ -557,152 +475,6 @@ "description": "Get asset details" } }, - "/api/v1/block": { - "get": { - "summary": "block", - "operationId": "block", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Blocks" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "by", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "commitment", - "height" - ] - }, - { - "name": "value", - "in": "query", - "required": true, - "type": "string" - } - ], - "tags": [ - "block" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get block by its height or commitment" - } - }, - "/api/v1/blockTxs": { - "get": { - "summary": "blockTxs", - "operationId": "blockTxs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Txs" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "by", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "block_height", - "block_commitment" - ] - }, - { - "name": "value", - "in": "query", - "required": true, - "type": "string" - } - ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get transactions in a block" - } - }, - "/api/v1/blocks": { - "get": { - "summary": "blocks", - "operationId": "blocks", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Blocks" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "limit", - "in": "query", - "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 - }, - { - "name": "sort", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - } - ], - "tags": [ - "block" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get blocks" - } - }, "/api/v1/bridges": { "get": { "summary": "bridges", @@ -773,15 +545,15 @@ "description": "Get if next bridge is fast" } }, - "/api/v1/candlesticks": { + "/api/v1/candles": { "get": { - "summary": "candlesticks", - "operationId": "candlesticks", + "summary": "candles", + "operationId": "candles", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/Candlesticks" + "$ref": "#/definitions/Candles" } }, "400": { @@ -856,7 +628,7 @@ "consumes": [ "multipart/form-data" ], - "description": "Get candlesticks" + "description": "Get candles (optimized with shortened fields and smaller response size)" } }, "/api/v1/changeAccountTier": { @@ -903,15 +675,88 @@ "description": "Change account tier" } }, - "/api/v1/currentHeight": { + "/api/v1/deposit/history": { + "get": { + "summary": "deposit_history", + "operationId": "deposit_history", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/DepositHistory" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "authorization", + "description": " make required after integ is done", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "auth", + "description": " made optional to support header auth clients", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "account_index", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "l1_address", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "cursor", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "filter", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "all", + "pending", + "claimable" + ] + } + ], + "tags": [ + "transaction" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Get deposit history" + } + }, + "/api/v1/exchangeStats": { "get": { - "summary": "currentHeight", - "operationId": "currentHeight", + "summary": "exchangeStats", + "operationId": "exchangeStats", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/CurrentHeight" + "$ref": "#/definitions/ExchangeStats" } }, "400": { @@ -922,20 +767,20 @@ } }, "tags": [ - "block" + "order" ], - "description": "Get current height" + "description": "Get exchange stats" } }, - "/api/v1/deposit/history": { + "/api/v1/export": { "get": { - "summary": "deposit_history", - "operationId": "deposit_history", + "summary": "export", + "operationId": "export", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/DepositHistory" + "$ref": "#/definitions/ExportData" } }, "400": { @@ -949,17 +794,10 @@ { "name": "authorization", "description": " make required after integ is done", - "in": "header", + "in": "query", "required": false, "type": "string" }, - { - "name": "account_index", - "in": "query", - "required": true, - "type": "integer", - "format": "int64" - }, { "name": "auth", "description": " made optional to support header auth clients", @@ -968,47 +806,74 @@ "type": "string" }, { - "name": "l1_address", + "name": "account_index", "in": "query", - "required": true, - "type": "string" + "required": false, + "type": "integer", + "format": "int64", + "default": "-1" }, { - "name": "cursor", + "name": "market_id", "in": "query", "required": false, - "type": "string" + "type": "integer", + "format": "int16", + "default": "255" }, { - "name": "filter", + "name": "type", "in": "query", - "required": false, + "required": true, "type": "string", "enum": [ - "all", - "pending", - "claimable" + "funding", + "trade" ] } ], "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" + "order" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Export data" + } + }, + "/api/v1/fastbridge/info": { + "get": { + "summary": "fastbridge_info", + "operationId": "fastbridge_info", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespGetFastBridgeInfo" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "tags": [ + "bridge" ], - "description": "Get deposit history" + "description": "Get fast bridge info" } }, - "/api/v1/exchangeStats": { - "get": { - "summary": "exchangeStats", - "operationId": "exchangeStats", + "/api/v1/fastwithdraw": { + "post": { + "summary": "fastwithdraw", + "operationId": "fastwithdraw", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ExchangeStats" + "$ref": "#/definitions/ResultCode" } }, "400": { @@ -1018,21 +883,41 @@ } } }, + "parameters": [ + { + "name": "authorization", + "description": " make required after integ is done", + "in": "header", + "required": false, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReqFastwithdraw" + } + } + ], "tags": [ - "order" + "bridge" ], - "description": "Get exchange stats" + "consumes": [ + "multipart/form-data" + ], + "description": "Fast withdraw" } }, - "/api/v1/export": { + "/api/v1/fastwithdraw/info": { "get": { - "summary": "export", - "operationId": "export", + "summary": "fastwithdraw_info", + "operationId": "fastwithdraw_info", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ExportData" + "$ref": "#/definitions/RespGetFastwithdrawalInfo" } }, "400": { @@ -1045,12 +930,14 @@ "parameters": [ { "name": "authorization", - "in": "header", + "description": " make required after integ is done", + "in": "query", "required": false, "type": "string" }, { "name": "auth", + "description": " made optional to support header auth clients", "in": "query", "required": false, "type": "string" @@ -1058,48 +945,29 @@ { "name": "account_index", "in": "query", - "required": false, - "type": "integer", - "format": "int64", - "default": "-1" - }, - { - "name": "market_id", - "in": "query", - "required": false, - "type": "integer", - "format": "int16", - "default": "255" - }, - { - "name": "type", - "in": "query", "required": true, - "type": "string", - "enum": [ - "funding", - "trade" - ] + "type": "integer", + "format": "int64" } ], "tags": [ - "order" + "bridge" ], "consumes": [ "multipart/form-data" ], - "description": "Export data" + "description": "Get fast withdraw info" } }, - "/api/v1/fastbridge/info": { + "/api/v1/faucet": { "get": { - "summary": "fastbridge_info", - "operationId": "fastbridge_info", + "summary": "faucet", + "operationId": "faucet", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RespGetFastBridgeInfo" + "$ref": "#/definitions/ResultCode" } }, "400": { @@ -1109,10 +977,29 @@ } } }, + "parameters": [ + { + "name": "l1_address", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "do_l1_transfer", + "in": "query", + "required": true, + "type": "boolean", + "format": "boolean", + "default": "false" + } + ], "tags": [ - "bridge" + "account" ], - "description": "Get fast bridge info" + "consumes": [ + "multipart/form-data" + ], + "description": "Request funds from faucet" } }, "/api/v1/funding-rates": { @@ -1281,7 +1168,7 @@ { "name": "authorization", "description": " make required after integ is done", - "in": "header", + "in": "query", "required": false, "type": "string" }, @@ -1583,12 +1470,14 @@ "parameters": [ { "name": "authorization", - "in": "header", + "description": " make required after integ is done", + "in": "query", "required": false, "type": "string" }, { "name": "auth", + "description": " made optional to support header auth clients", "in": "query", "required": false, "type": "string" @@ -1686,12 +1575,14 @@ "parameters": [ { "name": "authorization", - "in": "header", + "description": " make required after integ is done", + "in": "query", "required": false, "type": "string" }, { "name": "auth", + "description": " made optional to support header auth clients", "in": "query", "required": false, "type": "string" @@ -1769,12 +1660,14 @@ "parameters": [ { "name": "authorization", - "in": "header", + "description": " make required after integ is done", + "in": "query", "required": false, "type": "string" }, { "name": "auth", + "description": " made optional to support header auth clients", "in": "query", "required": false, "type": "string" @@ -1869,15 +1762,15 @@ "description": "Get recent trades" } }, - "/api/v1/referral/kickback/update": { + "/api/v1/sendTx": { "post": { - "summary": "referral_kickback_update", - "operationId": "referral_kickback_update", + "summary": "sendTx", + "operationId": "sendTx", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RespUpdateKickback" + "$ref": "#/definitions/RespSendTx" } }, "400": { @@ -1888,40 +1781,33 @@ } }, "parameters": [ - { - "name": "authorization", - "description": " make required after integ is done", - "in": "header", - "required": false, - "type": "string" - }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ReqUpdateKickback" + "$ref": "#/definitions/ReqSendTx" } } ], "tags": [ - "referral" + "transaction" ], "consumes": [ "multipart/form-data" ], - "description": "Update kickback percentage for referral rewards" + "description": "You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)" } }, - "/api/v1/referral/points": { - "get": { - "summary": "referral_points", - "operationId": "referral_points", + "/api/v1/sendTxBatch": { + "post": { + "summary": "sendTxBatch", + "operationId": "sendTxBatch", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/ReferralPoints" + "$ref": "#/definitions/RespSendTxBatch" } }, "400": { @@ -1933,45 +1819,32 @@ }, "parameters": [ { - "name": "authorization", - "description": " make required after integ is done", - "in": "header", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "account_index", - "in": "query", + "name": "body", + "in": "body", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "$ref": "#/definitions/ReqSendTxBatch" + } } ], "tags": [ - "referral" + "transaction" ], "consumes": [ "multipart/form-data" ], - "description": "Get referral points" + "description": "You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)" } }, - "/api/v1/referral/update": { - "post": { - "summary": "referral_update", - "operationId": "referral_update", + "/api/v1/tokens": { + "get": { + "summary": "tokens", + "operationId": "tokens", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RespUpdateReferralCode" + "$ref": "#/definitions/RespGetApiTokens" } }, "400": { @@ -1990,32 +1863,31 @@ "type": "string" }, { - "name": "body", - "in": "body", + "name": "account_index", + "in": "query", "required": true, - "schema": { - "$ref": "#/definitions/ReqUpdateReferralCode" - } + "type": "integer", + "format": "int64" } ], "tags": [ - "referral" + "account" ], "consumes": [ "multipart/form-data" ], - "description": "Update referral code (allowed once per account)" + "description": "Get api tokens of an account" } }, - "/api/v1/sendTx": { + "/api/v1/tokens/create": { "post": { - "summary": "sendTx", - "operationId": "sendTx", + "summary": "tokens_create", + "operationId": "tokens_create", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RespSendTx" + "$ref": "#/definitions/RespPostApiToken" } }, "400": { @@ -2026,33 +1898,39 @@ } }, "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ReqSendTx" + "$ref": "#/definitions/ReqPostApiToken" } } ], "tags": [ - "transaction" + "account" ], "consumes": [ "multipart/form-data" ], - "description": "You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)" + "description": "Create api token" } }, - "/api/v1/sendTxBatch": { + "/api/v1/tokens/revoke": { "post": { - "summary": "sendTxBatch", - "operationId": "sendTxBatch", + "summary": "tokens_revoke", + "operationId": "tokens_revoke", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RespSendTxBatch" + "$ref": "#/definitions/RespRevokeApiToken" } }, "400": { @@ -2063,22 +1941,28 @@ } }, "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ReqSendTxBatch" + "$ref": "#/definitions/ReqRevokeApiToken" } } ], "tags": [ - "transaction" + "account" ], "consumes": [ "multipart/form-data" ], - "description": "You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)" + "description": "Revoke api token" } }, "/api/v1/trades": { @@ -2102,12 +1986,14 @@ "parameters": [ { "name": "authorization", - "in": "header", + "description": " make required after integ is done", + "in": "query", "required": false, "type": "string" }, { "name": "auth", + "description": " made optional to support header auth clients", "in": "query", "required": false, "type": "string" @@ -2253,17 +2139,10 @@ { "name": "authorization", "description": " make required after integ is done", - "in": "header", + "in": "query", "required": false, "type": "string" }, - { - "name": "account_index", - "in": "query", - "required": true, - "type": "integer", - "format": "int64" - }, { "name": "auth", "description": " made optional to support header auth clients", @@ -2271,6 +2150,13 @@ "required": false, "type": "string" }, + { + "name": "account_index", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, { "name": "cursor", "in": "query", @@ -2308,12 +2194,14 @@ "parameters": [ { "name": "authorization", - "in": "header", + "description": " make required after integ is done", + "in": "query", "required": false, "type": "string" }, { "name": "auth", + "description": " made optional to support header auth clients", "in": "query", "required": false, "type": "string" @@ -2369,46 +2257,11 @@ "type": "string", "enum": [ "hash", - "sequence_index" - ] - }, - { - "name": "value", - "in": "query", - "required": true, - "type": "string" - } - ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get transaction by hash or sequence index" - } - }, - "/api/v1/txFromL1TxHash": { - "get": { - "summary": "txFromL1TxHash", - "operationId": "txFromL1TxHash", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/EnrichedTx" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ + "sequence_index" + ] + }, { - "name": "hash", + "name": "value", "in": "query", "required": true, "type": "string" @@ -2420,18 +2273,18 @@ "consumes": [ "multipart/form-data" ], - "description": "Get L1 transaction by L1 transaction hash" + "description": "Get transaction by hash or sequence index" } }, - "/api/v1/txs": { + "/api/v1/txFromL1TxHash": { "get": { - "summary": "txs", - "operationId": "txs", + "summary": "txFromL1TxHash", + "operationId": "txFromL1TxHash", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/Txs" + "$ref": "#/definitions/EnrichedTx" } }, "400": { @@ -2443,20 +2296,10 @@ }, "parameters": [ { - "name": "index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "limit", + "name": "hash", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 + "type": "string" } ], "tags": [ @@ -2465,7 +2308,7 @@ "consumes": [ "multipart/form-data" ], - "description": "Get transactions which are already packed into blocks" + "description": "Get L1 transaction by L1 transaction hash" } }, "/api/v1/withdraw/history": { @@ -2490,17 +2333,10 @@ { "name": "authorization", "description": " make required after integ is done", - "in": "header", + "in": "query", "required": false, "type": "string" }, - { - "name": "account_index", - "in": "query", - "required": true, - "type": "integer", - "format": "int64" - }, { "name": "auth", "description": " made optional to support header auth clients", @@ -2508,6 +2344,13 @@ "required": false, "type": "string" }, + { + "name": "account_index", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, { "name": "cursor", "in": "query", @@ -2620,6 +2463,11 @@ "format": "int64", "example": "100" }, + "total_isolated_order_count": { + "type": "integer", + "format": "int64", + "example": "100" + }, "pending_order_count": { "type": "integer", "format": "int64", @@ -2637,6 +2485,11 @@ "collateral": { "type": "string", "example": "46342" + }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1257894000000000" } }, "title": "Account", @@ -2647,10 +2500,12 @@ "l1_address", "cancel_all_time", "total_order_count", + "total_isolated_order_count", "pending_order_count", "available_balance", "status", - "collateral" + "collateral", + "transaction_time" ] }, "AccountApiKeys": { @@ -3219,6 +3074,11 @@ }, "public_key": { "type": "string" + }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1257894000000000" } }, "title": "ApiKey", @@ -3226,7 +3086,53 @@ "account_index", "api_key_index", "nonce", - "public_key" + "public_key", + "transaction_time" + ] + }, + "ApiToken": { + "type": "object", + "properties": { + "token_id": { + "type": "integer", + "format": "int64" + }, + "api_token": { + "type": "string" + }, + "name": { + "type": "string" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expiry": { + "type": "integer", + "format": "int64" + }, + "sub_account_access": { + "type": "boolean", + "format": "boolean" + }, + "revoked": { + "type": "boolean", + "format": "boolean" + }, + "scopes": { + "type": "string" + } + }, + "title": "ApiToken", + "required": [ + "token_id", + "api_token", + "name", + "account_index", + "expiry", + "sub_account_access", + "revoked", + "scopes" ] }, "Asset": { @@ -3313,103 +3219,17 @@ "asset_details" ] }, - "Block": { - "type": "object", - "properties": { - "commitment": { - "type": "string" - }, - "height": { - "type": "integer", - "format": "int64" - }, - "state_root": { - "type": "string" - }, - "priority_operations": { - "type": "integer", - "format": "int32" - }, - "on_chain_l2_operations": { - "type": "integer", - "format": "int32" - }, - "pending_on_chain_operations_pub_data": { - "type": "string" - }, - "committed_tx_hash": { - "type": "string" - }, - "committed_at": { - "type": "integer", - "format": "int64" - }, - "verified_tx_hash": { - "type": "string" - }, - "verified_at": { - "type": "integer", - "format": "int64" - }, - "txs": { - "type": "array", - "items": { - "$ref": "#/definitions/Tx" - } - }, - "status": { - "type": "integer", - "format": "int64" - }, - "size": { - "type": "integer", - "format": "uin16" - } - }, - "title": "Block", - "required": [ - "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" - ] - }, - "Blocks": { + "Auth": { "type": "object", "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "total": { - "type": "integer", - "format": "int64" - }, - "blocks": { - "type": "array", - "items": { - "$ref": "#/definitions/Block" - } + "auth": { + "type": "string", + "description": " made optional to support header auth clients" } }, - "title": "Blocks", + "title": "Auth", "required": [ - "code", - "total", - "blocks" + "auth" ] }, "Bridge": { @@ -3522,87 +3342,99 @@ "explorer" ] }, - "Candlestick": { + "Candle": { "type": "object", "properties": { - "timestamp": { + "t": { "type": "integer", "format": "int64", - "example": "1640995200" + "example": "1640995200", + "description": " timestamp" }, - "open": { + "o": { "type": "number", "format": "double", - "example": "3024.66" + "example": "3024.66", + "description": " open" }, - "high": { + "h": { "type": "number", "format": "double", - "example": "3034.66" + "example": "3034.66", + "description": " high" }, - "low": { + "l": { "type": "number", "format": "double", - "example": "3014.66" + "example": "3014.66", + "description": " low" }, - "close": { + "c": { "type": "number", "format": "double", - "example": "3024.66" + "example": "3024.66", + "description": " close" }, - "open_raw": { + "O": { "type": "number", "format": "double", - "example": "3024.66" + "example": "3024.66", + "description": " open_raw" }, - "high_raw": { + "H": { "type": "number", "format": "double", - "example": "3034.66" + "example": "3034.66", + "description": " high_raw" }, - "low_raw": { + "L": { "type": "number", "format": "double", - "example": "3014.66" + "example": "3014.66", + "description": " low_raw" }, - "close_raw": { + "C": { "type": "number", "format": "double", - "example": "3024.66" + "example": "3024.66", + "description": " close_raw" }, - "volume0": { + "v": { "type": "number", "format": "double", - "example": "235.25" + "example": "235.25", + "description": " volume0" }, - "volume1": { + "V": { "type": "number", "format": "double", - "example": "93566.25" + "example": "93566.25", + "description": " volume1" }, - "last_trade_id": { + "i": { "type": "integer", "format": "int64", - "example": "1" + "example": "1", + "description": " last_trade_id" } }, - "title": "Candlestick", + "title": "Candle", "required": [ - "timestamp", - "open", - "high", - "low", - "close", - "open_raw", - "high_raw", - "low_raw", - "close_raw", - "volume0", - "volume1", - "last_trade_id" + "t", + "o", + "h", + "l", + "c", + "O", + "H", + "L", + "C", + "v", + "V", + "i" ] }, - "Candlesticks": { + "Candles": { "type": "object", "properties": { "code": { @@ -3613,22 +3445,24 @@ "message": { "type": "string" }, - "resolution": { + "r": { "type": "string", - "example": "15m" + "example": "15m", + "description": " resolution" }, - "candlesticks": { + "c": { "type": "array", "items": { - "$ref": "#/definitions/Candlestick" - } + "$ref": "#/definitions/Candle" + }, + "description": " candles" } }, - "title": "Candlesticks", + "title": "Candles", "required": [ "code", - "resolution", - "candlesticks" + "r", + "c" ] }, "ContractAddress": { @@ -3649,28 +3483,6 @@ "address" ] }, - "CurrentHeight": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "height": { - "type": "integer", - "format": "int64" - } - }, - "title": "CurrentHeight", - "required": [ - "code", - "height" - ] - }, "Cursor": { "type": "object", "properties": { @@ -3807,6 +3619,11 @@ "format": "int64", "example": "100" }, + "total_isolated_order_count": { + "type": "integer", + "format": "int64", + "example": "100" + }, "pending_order_count": { "type": "integer", "format": "int64", @@ -3825,6 +3642,11 @@ "type": "string", "example": "46342" }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1257894000000000" + }, "account_index": { "type": "integer", "format": "int64" @@ -3882,10 +3704,12 @@ "l1_address", "cancel_all_time", "total_order_count", + "total_isolated_order_count", "pending_order_count", "available_balance", "status", "collateral", + "transaction_time", "account_index", "name", "description", @@ -4103,6 +3927,11 @@ "format": "uint8", "example": "0" }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1257894000000000" + }, "committed_at": { "type": "integer", "format": "int64", @@ -4133,6 +3962,7 @@ "sequence_index", "parent_hash", "api_key_index", + "transaction_time", "committed_at", "verified_at" ] @@ -4376,6 +4206,10 @@ }, "maker_fee": { "type": "string" + }, + "transaction_time": { + "type": "integer", + "format": "int64" } }, "title": "LiqTrade", @@ -4383,7 +4217,8 @@ "price", "size", "taker_fee", - "maker_fee" + "maker_fee", + "transaction_time" ] }, "Liquidation": { @@ -4733,6 +4568,11 @@ "type": "integer", "format": "int64", "example": "1640995200" + }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1257894000000000" } }, "title": "Order", @@ -4769,7 +4609,8 @@ "block_height", "timestamp", "created_at", - "updated_at" + "updated_at", + "transaction_time" ] }, "OrderBook": { @@ -4903,13 +4744,53 @@ "example": "0" } }, - "title": "OrderBookDepth", + "title": "OrderBookDepth", + "required": [ + "code", + "asks", + "bids", + "offset", + "nonce" + ] + }, + "OrderBookDepthWithBeginNonce": { + "type": "object", + "properties": { + "asks": { + "type": "array", + "items": { + "$ref": "#/definitions/PriceLevel" + } + }, + "bids": { + "type": "array", + "items": { + "$ref": "#/definitions/PriceLevel" + } + }, + "offset": { + "type": "integer", + "format": "int64", + "example": "0" + }, + "nonce": { + "type": "integer", + "format": "int64", + "example": "0" + }, + "begin_nonce": { + "type": "integer", + "format": "int64", + "example": "0" + } + }, + "title": "OrderBookDepthWithBeginNonce", "required": [ - "code", "asks", "bids", "offset", - "nonce" + "nonce", + "begin_nonce" ] }, "OrderBookDetails": { @@ -5722,91 +5603,6 @@ "entry_usdc" ] }, - "ReferralPointEntry": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - }, - "total_points": { - "type": "number", - "format": "float", - "example": "1000.01" - }, - "week_points": { - "type": "number", - "format": "float", - "example": "1000.01" - }, - "total_reward_points": { - "type": "number", - "format": "float", - "example": "200" - }, - "week_reward_points": { - "type": "number", - "format": "float", - "example": "200" - }, - "reward_point_multiplier": { - "type": "string", - "example": "0.1" - } - }, - "title": "ReferralPointEntry", - "required": [ - "l1_address", - "total_points", - "week_points", - "total_reward_points", - "week_reward_points", - "reward_point_multiplier" - ] - }, - "ReferralPoints": { - "type": "object", - "properties": { - "referrals": { - "type": "array", - "items": { - "$ref": "#/definitions/ReferralPointEntry" - } - }, - "user_total_points": { - "type": "number", - "format": "float", - "example": "1000" - }, - "user_last_week_points": { - "type": "number", - "format": "float", - "example": "1000" - }, - "user_total_referral_reward_points": { - "type": "number", - "format": "float", - "example": "1000" - }, - "user_last_week_referral_reward_points": { - "type": "number", - "format": "float", - "example": "1000" - }, - "reward_point_multiplier": { - "type": "string", - "example": "0.1" - } - }, - "title": "ReferralPoints", - "required": [ - "referrals", - "user_total_points", - "user_last_week_points", - "user_total_referral_reward_points", - "user_last_week_referral_reward_points", - "reward_point_multiplier" - ] - }, "ReqAckNotif": { "type": "object", "properties": { @@ -5850,11 +5646,30 @@ "new_tier" ] }, + "ReqDoFaucet": { + "type": "object", + "properties": { + "l1_address": { + "type": "string" + }, + "do_l1_transfer": { + "type": "boolean", + "format": "boolean", + "default": "false" + } + }, + "title": "ReqDoFaucet", + "required": [ + "l1_address", + "do_l1_transfer" + ] + }, "ReqExportData": { "type": "object", "properties": { "auth": { - "type": "string" + "type": "string", + "description": " made optional to support header auth clients" }, "account_index": { "type": "integer", @@ -5879,6 +5694,26 @@ "type" ] }, + "ReqFastwithdraw": { + "type": "object", + "properties": { + "tx_info": { + "type": "string" + }, + "to_address": { + "type": "string" + }, + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + } + }, + "title": "ReqFastwithdraw", + "required": [ + "tx_info", + "to_address" + ] + }, "ReqGetAccount": { "type": "object", "properties": { @@ -5902,6 +5737,10 @@ "ReqGetAccountActiveOrders": { "type": "object", "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, "account_index": { "type": "integer", "format": "int64" @@ -5909,10 +5748,6 @@ "market_id": { "type": "integer", "format": "int16" - }, - "auth": { - "type": "string", - "description": " made optional to support header auth clients" } }, "title": "ReqGetAccountActiveOrders", @@ -6035,7 +5870,8 @@ "type": "object", "properties": { "auth": { - "type": "string" + "type": "string", + "description": " made optional to support header auth clients" }, "by": { "type": "string", @@ -6109,19 +5945,33 @@ "value": { "type": "string" }, + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, "types": { "type": "array", "items": { "type": "integer", "format": "uint8" } - }, - "auth": { - "type": "string" } }, "title": "ReqGetAccountTxs" }, + "ReqGetApiTokens": { + "type": "object", + "properties": { + "account_index": { + "type": "integer", + "format": "int64" + } + }, + "title": "ReqGetApiTokens", + "required": [ + "account_index" + ] + }, "ReqGetAssetDetails": { "type": "object", "properties": { @@ -6204,7 +6054,7 @@ "value" ] }, - "ReqGetCandlesticks": { + "ReqGetCandles": { "type": "object", "properties": { "market_id": { @@ -6245,7 +6095,7 @@ "default": "false" } }, - "title": "ReqGetCandlesticks", + "title": "ReqGetCandles", "required": [ "market_id", "resolution", @@ -6257,14 +6107,14 @@ "ReqGetDepositHistory": { "type": "object", "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, "auth": { "type": "string", "description": " made optional to support header auth clients" }, + "account_index": { + "type": "integer", + "format": "int64" + }, "l1_address": { "type": "string" }, @@ -6293,13 +6143,13 @@ "ReqGetFastWithdrawInfo": { "type": "object", "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, "auth": { "type": "string", "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" } }, "title": "ReqGetFastWithdrawInfo", @@ -6345,6 +6195,14 @@ "count_back" ] }, + "ReqGetGeckoContracts": { + "type": "object", + "title": "ReqGetGeckoContracts" + }, + "ReqGetGeckoTickers": { + "type": "object", + "title": "ReqGetGeckoTickers" + }, "ReqGetL1Metadata": { "type": "object", "properties": { @@ -6499,7 +6357,8 @@ "type": "object", "properties": { "auth": { - "type": "string" + "type": "string", + "description": " made optional to support header auth clients" }, "account_index": { "type": "integer", @@ -6539,7 +6398,8 @@ "type": "object", "properties": { "auth": { - "type": "string" + "type": "string", + "description": " made optional to support header auth clients" }, "filter": { "type": "string", @@ -6652,29 +6512,13 @@ "limit" ] }, - "ReqGetReferralPoints": { + "ReqGetTrades": { "type": "object", "properties": { "auth": { "type": "string", "description": " made optional to support header auth clients" }, - "account_index": { - "type": "integer", - "format": "int64" - } - }, - "title": "ReqGetReferralPoints", - "required": [ - "account_index" - ] - }, - "ReqGetTrades": { - "type": "object", - "properties": { - "auth": { - "type": "string" - }, "market_id": { "type": "integer", "format": "int16", @@ -6759,7 +6603,8 @@ "type": "object", "properties": { "auth": { - "type": "string" + "type": "string", + "description": " made optional to support header auth clients" }, "account_index": { "type": "integer", @@ -6779,14 +6624,14 @@ "ReqGetTransferHistory": { "type": "object", "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, "auth": { "type": "string", "description": " made optional to support header auth clients" }, + "account_index": { + "type": "integer", + "format": "int64" + }, "cursor": { "type": "string" } @@ -6819,14 +6664,14 @@ "ReqGetWithdrawHistory": { "type": "object", "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, "auth": { "type": "string", "description": " made optional to support header auth clients" }, + "account_index": { + "type": "integer", + "format": "int64" + }, "cursor": { "type": "string" }, @@ -6844,6 +6689,56 @@ "account_index" ] }, + "ReqPostApiToken": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expiry": { + "type": "integer", + "format": "int64" + }, + "sub_account_access": { + "type": "boolean", + "format": "boolean" + }, + "scopes": { + "type": "string", + "example": "read.*", + "default": "read.*" + } + }, + "title": "ReqPostApiToken", + "required": [ + "name", + "account_index", + "expiry", + "sub_account_access" + ] + }, + "ReqRevokeApiToken": { + "type": "object", + "properties": { + "token_id": { + "type": "integer", + "format": "int64" + }, + "account_index": { + "type": "integer", + "format": "int64" + } + }, + "title": "ReqRevokeApiToken", + "required": [ + "token_id", + "account_index" + ] + }, "ReqSendTx": { "type": "object", "properties": { @@ -6882,51 +6777,24 @@ "tx_infos" ] }, - "ReqUpdateKickback": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "kickback_percentage": { - "type": "number", - "format": "double", - "maximum": 100 - } - }, - "title": "ReqUpdateKickback", - "required": [ - "account_index", - "kickback_percentage" - ] - }, - "ReqUpdateReferralCode": { + "RespChangeAccountTier": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { + "code": { "type": "integer", - "format": "int64" + "format": "int32", + "example": "200" }, - "new_referral_code": { + "message": { "type": "string" } }, - "title": "ReqUpdateReferralCode", + "title": "RespChangeAccountTier", "required": [ - "account_index", - "new_referral_code" + "code" ] }, - "RespChangeAccountTier": { + "RespGetApiTokens": { "type": "object", "properties": { "code": { @@ -6936,11 +6804,18 @@ }, "message": { "type": "string" + }, + "api_tokens": { + "type": "array", + "items": { + "$ref": "#/definitions/ApiToken" + } } }, - "title": "RespChangeAccountTier", + "title": "RespGetApiTokens", "required": [ - "code" + "code", + "api_tokens" ] }, "RespGetBridgesByL1Addr": { @@ -6988,6 +6863,36 @@ "fast_bridge_limit" ] }, + "RespGetFastwithdrawalInfo": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "to_account_index": { + "type": "integer", + "format": "int64" + }, + "withdraw_limit": { + "type": "string" + }, + "max_withdrawal_amount": { + "type": "string" + } + }, + "title": "RespGetFastwithdrawalInfo", + "required": [ + "code", + "to_account_index", + "withdraw_limit", + "max_withdrawal_amount" + ] + }, "RespGetIsNextBridgeFast": { "type": "object", "properties": { @@ -7010,6 +6915,60 @@ "is_next_bridge_fast" ] }, + "RespPostApiToken": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "token_id": { + "type": "integer", + "format": "int64" + }, + "api_token": { + "type": "string" + }, + "name": { + "type": "string" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expiry": { + "type": "integer", + "format": "int64" + }, + "sub_account_access": { + "type": "boolean", + "format": "boolean" + }, + "revoked": { + "type": "boolean", + "format": "boolean" + }, + "scopes": { + "type": "string" + } + }, + "title": "RespPostApiToken", + "required": [ + "code", + "token_id", + "api_token", + "name", + "account_index", + "expiry", + "sub_account_access", + "revoked", + "scopes" + ] + }, "RespPublicPoolsMetadata": { "type": "object", "properties": { @@ -7034,6 +6993,33 @@ "public_pools" ] }, + "RespRevokeApiToken": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "token_id": { + "type": "integer", + "format": "int64" + }, + "revoked": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "RespRevokeApiToken", + "required": [ + "code", + "token_id", + "revoked" + ] + }, "RespSendTx": { "type": "object", "properties": { @@ -7102,52 +7088,6 @@ "volume_quota_remaining" ] }, - "RespUpdateKickback": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "success": { - "type": "boolean", - "format": "boolean", - "example": "true" - } - }, - "title": "RespUpdateKickback", - "required": [ - "code", - "success" - ] - }, - "RespUpdateReferralCode": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "success": { - "type": "boolean", - "format": "boolean", - "example": "true" - } - }, - "title": "RespUpdateReferralCode", - "required": [ - "code", - "success" - ] - }, "RespWithdrawalDelay": { "type": "object", "properties": { @@ -7284,6 +7224,11 @@ "type": "integer", "format": "int64", "example": "1640995200" + }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1257894000000000" } }, "title": "SimpleOrder", @@ -7294,7 +7239,8 @@ "initial_base_amount", "remaining_base_amount", "price", - "order_expiry" + "order_expiry", + "transaction_time" ] }, "SpotMarketStats": { @@ -7727,6 +7673,11 @@ "type": "boolean", "format": "boolean", "example": "true" + }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1257894000000000" } }, "title": "Trade", @@ -7756,7 +7707,8 @@ "maker_position_size_before", "maker_entry_quote_before", "maker_initial_margin_fraction_before", - "maker_position_sign_changed" + "maker_position_sign_changed", + "transaction_time" ] }, "Trades": { @@ -7851,6 +7803,10 @@ "type": "string", "example": "0.1" }, + "fee": { + "type": "string", + "example": "3" + }, "timestamp": { "type": "integer", "format": "int64", @@ -7910,6 +7866,7 @@ "id", "asset_id", "amount", + "fee", "timestamp", "type", "from_l1_address", @@ -7921,107 +7878,6 @@ "tx_hash" ] }, - "Tx": { - "type": "object", - "properties": { - "hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "type": { - "type": "integer", - "format": "uint8", - "example": "1", - "maximum": 64, - "minimum": 1 - }, - "info": { - "type": "string", - "example": "{}" - }, - "event_info": { - "type": "string", - "example": "{}" - }, - "status": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "transaction_index": { - "type": "integer", - "format": "int64", - "example": "8761" - }, - "l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "account_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "nonce": { - "type": "integer", - "format": "int64", - "example": "722" - }, - "expire_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "block_height": { - "type": "integer", - "format": "int64", - "example": "45434" - }, - "queued_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "executed_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "sequence_index": { - "type": "integer", - "format": "int64", - "example": "8761" - }, - "parent_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "api_key_index": { - "type": "integer", - "format": "uint8", - "example": "0" - } - }, - "title": "Tx", - "required": [ - "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", - "api_key_index" - ] - }, "TxHash": { "type": "object", "properties": { @@ -8068,30 +7924,6 @@ "tx_hash" ] }, - "Txs": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "txs": { - "type": "array", - "items": { - "$ref": "#/definitions/Tx" - } - } - }, - "title": "Txs", - "required": [ - "code", - "txs" - ] - }, "ValidatorInfo": { "type": "object", "properties": { @@ -8214,4 +8046,4 @@ "in": "header" } } -} +} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0cc6c5c..065285b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "lighter-sdk" -version = "1.0.2" +version = "1.0.3" description = "Python client for Lighter" authors = ["elliot"] license = "NoLicense" diff --git a/setup.py b/setup.py index 492d233..2965670 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "lighter-sdk" -VERSION = "1.0.2" +VERSION = "1.0.3" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0",