From 2afef4137c12f38bcbbbaf3d868db6a419d59647 Mon Sep 17 00:00:00 2001 From: lavrric Date: Thu, 26 Feb 2026 19:02:25 +0200 Subject: [PATCH] update-v1.0.4 --- .openapi-generator/FILES | 72 + docs/Account.md | 1 + docs/AccountApi.md | 220 +++ docs/AccountLimits.md | 4 + docs/AccountMetadata.md | 1 + docs/AccountPosition.md | 1 + docs/AccountStats.md | 1 + docs/DetailedAccount.md | 3 + docs/ExchangeMetric.md | 30 + docs/ExecuteStat.md | 30 + docs/InfoApi.md | 66 + docs/LeaseEntry.md | 36 + docs/LeaseOptionEntry.md | 30 + docs/MarketConfig.md | 2 + docs/OrderApi.md | 160 +- docs/PendingUnlock.md | 31 + docs/PerpsOrderBookDetail.md | 1 + docs/PnLEntry.md | 4 + docs/PositionFunding.md | 1 + docs/PublicPoolInfo.md | 1 + docs/PublicPoolMetadata.md | 3 + docs/PublicPoolShare.md | 4 +- docs/PushNotifDeliveryResult.md | 31 + docs/PushnotifApi.md | 312 ++++ docs/Referral.md | 31 + docs/ReferralApi.md | 84 + docs/ReqExportData.md | 5 + docs/ReqGetExchangeMetrics.md | 32 + docs/ReqGetExecuteStats.md | 29 + docs/ReqGetLeases.md | 32 + docs/ReqGetPushNotifSettings.md | 31 + docs/ReqGetTransferHistory.md | 1 + docs/ReqGetUserReferrals.md | 31 + docs/RespGetExchangeMetrics.md | 31 + docs/RespGetExecuteStats.md | 30 + docs/RespGetLeaseOptions.md | 32 + docs/RespGetLeases.md | 32 + docs/RespGetPushNotifSettings.md | 32 + docs/SlippageResult.md | 33 + docs/SpotAvgEntryPrice.md | 32 + docs/Strategy.md | 29 + docs/SystemConfig.md | 35 + docs/Trade.md | 2 + docs/TransactionApi.md | 6 +- docs/UserReferrals.md | 32 + lighter/__init__.py | 24 + lighter/api/__init__.py | 2 + lighter/api/account_api.py | 890 +++++++++ lighter/api/info_api.py | 244 +++ lighter/api/order_api.py | 658 +++++++ lighter/api/pushnotif_api.py | 1299 +++++++++++++ lighter/api/referral_api.py | 347 ++++ lighter/api/transaction_api.py | 17 + lighter/models/__init__.py | 22 + lighter/models/account.py | 6 +- lighter/models/account_limits.py | 12 +- lighter/models/account_metadata.py | 6 +- lighter/models/account_position.py | 6 +- lighter/models/account_stats.py | 6 +- lighter/models/detailed_account.py | 18 +- lighter/models/exchange_metric.py | 102 ++ lighter/models/execute_stat.py | 110 ++ lighter/models/lease_entry.py | 121 ++ lighter/models/lease_option_entry.py | 102 ++ lighter/models/market_config.py | 8 +- lighter/models/pending_unlock.py | 104 ++ lighter/models/perps_order_book_detail.py | 6 +- lighter/models/pn_l_entry.py | 12 +- lighter/models/position_funding.py | 6 +- lighter/models/public_pool_info.py | 14 +- lighter/models/public_pool_metadata.py | 18 +- lighter/models/public_pool_share.py | 12 +- lighter/models/push_notif_delivery_result.py | 104 ++ lighter/models/referral.py | 104 ++ lighter/models/req_export_data.py | 45 +- lighter/models/req_get_exchange_metrics.py | 130 ++ lighter/models/req_get_execute_stats.py | 107 ++ lighter/models/req_get_leases.py | 106 ++ .../models/req_get_public_pools_metadata.py | 4 +- lighter/models/req_get_push_notif_settings.py | 104 ++ lighter/models/req_get_transfer_history.py | 6 +- lighter/models/req_get_user_referrals.py | 104 ++ lighter/models/resp_get_exchange_metrics.py | 112 ++ lighter/models/resp_get_execute_stats.py | 117 ++ lighter/models/resp_get_lease_options.py | 114 ++ lighter/models/resp_get_leases.py | 114 ++ .../models/resp_get_push_notif_settings.py | 106 ++ lighter/models/slippage_result.py | 108 ++ lighter/models/spot_avg_entry_price.py | 106 ++ lighter/models/strategy.py | 100 + lighter/models/system_config.py | 112 ++ lighter/models/trade.py | 8 +- lighter/models/transfer_history_item.py | 4 +- lighter/models/user_referrals.py | 114 ++ openapi.json | 1629 ++++++++++++++++- pyproject.toml | 2 +- setup.py | 2 +- 97 files changed, 9260 insertions(+), 121 deletions(-) create mode 100644 docs/ExchangeMetric.md create mode 100644 docs/ExecuteStat.md create mode 100644 docs/LeaseEntry.md create mode 100644 docs/LeaseOptionEntry.md create mode 100644 docs/PendingUnlock.md create mode 100644 docs/PushNotifDeliveryResult.md create mode 100644 docs/PushnotifApi.md create mode 100644 docs/Referral.md create mode 100644 docs/ReferralApi.md create mode 100644 docs/ReqGetExchangeMetrics.md create mode 100644 docs/ReqGetExecuteStats.md create mode 100644 docs/ReqGetLeases.md create mode 100644 docs/ReqGetPushNotifSettings.md create mode 100644 docs/ReqGetUserReferrals.md create mode 100644 docs/RespGetExchangeMetrics.md create mode 100644 docs/RespGetExecuteStats.md create mode 100644 docs/RespGetLeaseOptions.md create mode 100644 docs/RespGetLeases.md create mode 100644 docs/RespGetPushNotifSettings.md create mode 100644 docs/SlippageResult.md create mode 100644 docs/SpotAvgEntryPrice.md create mode 100644 docs/Strategy.md create mode 100644 docs/SystemConfig.md create mode 100644 docs/UserReferrals.md create mode 100644 lighter/api/pushnotif_api.py create mode 100644 lighter/api/referral_api.py create mode 100644 lighter/models/exchange_metric.py create mode 100644 lighter/models/execute_stat.py create mode 100644 lighter/models/lease_entry.py create mode 100644 lighter/models/lease_option_entry.py create mode 100644 lighter/models/pending_unlock.py create mode 100644 lighter/models/push_notif_delivery_result.py create mode 100644 lighter/models/referral.py create mode 100644 lighter/models/req_get_exchange_metrics.py create mode 100644 lighter/models/req_get_execute_stats.py create mode 100644 lighter/models/req_get_leases.py create mode 100644 lighter/models/req_get_push_notif_settings.py create mode 100644 lighter/models/req_get_user_referrals.py create mode 100644 lighter/models/resp_get_exchange_metrics.py create mode 100644 lighter/models/resp_get_execute_stats.py create mode 100644 lighter/models/resp_get_lease_options.py create mode 100644 lighter/models/resp_get_leases.py create mode 100644 lighter/models/resp_get_push_notif_settings.py create mode 100644 lighter/models/slippage_result.py create mode 100644 lighter/models/spot_avg_entry_price.py create mode 100644 lighter/models/strategy.py create mode 100644 lighter/models/system_config.py create mode 100644 lighter/models/user_referrals.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ce3ea80..e3640d9 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -34,7 +34,9 @@ docs/DetailedAccount.md docs/DetailedAccounts.md docs/DetailedCandlestick.md docs/EnrichedTx.md +docs/ExchangeMetric.md docs/ExchangeStats.md +docs/ExecuteStat.md docs/ExportData.md docs/Funding.md docs/FundingApi.md @@ -44,6 +46,8 @@ docs/Fundings.md docs/InfoApi.md docs/L1Metadata.md docs/L1ProviderInfo.md +docs/LeaseEntry.md +docs/LeaseOptionEntry.md docs/LiqTrade.md docs/Liquidation.md docs/LiquidationInfo.md @@ -61,6 +65,7 @@ docs/OrderBookOrders.md docs/OrderBookStats.md docs/OrderBooks.md docs/Orders.md +docs/PendingUnlock.md docs/PerpsMarketStats.md docs/PerpsOrderBookDetail.md docs/PnLEntry.md @@ -70,6 +75,10 @@ docs/PriceLevel.md docs/PublicPoolInfo.md docs/PublicPoolMetadata.md docs/PublicPoolShare.md +docs/PushNotifDeliveryResult.md +docs/PushnotifApi.md +docs/Referral.md +docs/ReferralApi.md docs/ReqDoFaucet.md docs/ReqExportData.md docs/ReqGetAccount.md @@ -89,11 +98,14 @@ docs/ReqGetBridgesByL1Addr.md docs/ReqGetByAccount.md docs/ReqGetCandles.md docs/ReqGetDepositHistory.md +docs/ReqGetExchangeMetrics.md +docs/ReqGetExecuteStats.md docs/ReqGetFastWithdrawInfo.md docs/ReqGetFundings.md docs/ReqGetL1Metadata.md docs/ReqGetL1Tx.md docs/ReqGetLatestDeposit.md +docs/ReqGetLeases.md docs/ReqGetLiquidationInfos.md docs/ReqGetNextNonce.md docs/ReqGetOrderBookDetails.md @@ -101,6 +113,7 @@ docs/ReqGetOrderBookOrders.md docs/ReqGetOrderBooks.md docs/ReqGetPositionFunding.md docs/ReqGetPublicPoolsMetadata.md +docs/ReqGetPushNotifSettings.md docs/ReqGetRangeWithCursor.md docs/ReqGetRangeWithIndex.md docs/ReqGetRangeWithIndexSortable.md @@ -109,13 +122,19 @@ docs/ReqGetTrades.md docs/ReqGetTransferFeeInfo.md docs/ReqGetTransferHistory.md docs/ReqGetTx.md +docs/ReqGetUserReferrals.md docs/ReqGetWithdrawHistory.md docs/RespChangeAccountTier.md docs/RespGetApiTokens.md docs/RespGetBridgesByL1Addr.md +docs/RespGetExchangeMetrics.md +docs/RespGetExecuteStats.md docs/RespGetFastBridgeInfo.md docs/RespGetFastwithdrawalInfo.md docs/RespGetIsNextBridgeFast.md +docs/RespGetLeaseOptions.md +docs/RespGetLeases.md +docs/RespGetPushNotifSettings.md docs/RespPostApiToken.md docs/RespPublicPoolsMetadata.md docs/RespRevokeApiToken.md @@ -128,10 +147,14 @@ docs/RiskParameters.md docs/RootApi.md docs/SharePrice.md docs/SimpleOrder.md +docs/SlippageResult.md +docs/SpotAvgEntryPrice.md docs/SpotMarketStats.md docs/SpotOrderBookDetail.md docs/Status.md +docs/Strategy.md docs/SubAccounts.md +docs/SystemConfig.md docs/Ticker.md docs/Trade.md docs/Trades.md @@ -141,6 +164,7 @@ docs/TransferHistory.md docs/TransferHistoryItem.md docs/TxHash.md docs/TxHashes.md +docs/UserReferrals.md docs/ValidatorInfo.md docs/WithdrawHistory.md docs/WithdrawHistoryItem.md @@ -156,6 +180,8 @@ lighter/api/funding_api.py lighter/api/info_api.py lighter/api/notification_api.py lighter/api/order_api.py +lighter/api/pushnotif_api.py +lighter/api/referral_api.py lighter/api/root_api.py lighter/api/transaction_api.py lighter/api_client.py @@ -195,7 +221,9 @@ lighter/models/detailed_account.py lighter/models/detailed_accounts.py lighter/models/detailed_candlestick.py lighter/models/enriched_tx.py +lighter/models/exchange_metric.py lighter/models/exchange_stats.py +lighter/models/execute_stat.py lighter/models/export_data.py lighter/models/funding.py lighter/models/funding_rate.py @@ -203,6 +231,8 @@ lighter/models/funding_rates.py lighter/models/fundings.py lighter/models/l1_metadata.py lighter/models/l1_provider_info.py +lighter/models/lease_entry.py +lighter/models/lease_option_entry.py lighter/models/liq_trade.py lighter/models/liquidation.py lighter/models/liquidation_info.py @@ -218,6 +248,7 @@ lighter/models/order_book_orders.py lighter/models/order_book_stats.py lighter/models/order_books.py lighter/models/orders.py +lighter/models/pending_unlock.py lighter/models/perps_market_stats.py lighter/models/perps_order_book_detail.py lighter/models/pn_l_entry.py @@ -227,6 +258,8 @@ 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/push_notif_delivery_result.py +lighter/models/referral.py lighter/models/req_do_faucet.py lighter/models/req_export_data.py lighter/models/req_get_account.py @@ -246,11 +279,14 @@ lighter/models/req_get_bridges_by_l1_addr.py lighter/models/req_get_by_account.py lighter/models/req_get_candles.py lighter/models/req_get_deposit_history.py +lighter/models/req_get_exchange_metrics.py +lighter/models/req_get_execute_stats.py lighter/models/req_get_fast_withdraw_info.py lighter/models/req_get_fundings.py lighter/models/req_get_l1_metadata.py lighter/models/req_get_l1_tx.py lighter/models/req_get_latest_deposit.py +lighter/models/req_get_leases.py lighter/models/req_get_liquidation_infos.py lighter/models/req_get_next_nonce.py lighter/models/req_get_order_book_details.py @@ -258,6 +294,7 @@ lighter/models/req_get_order_book_orders.py lighter/models/req_get_order_books.py lighter/models/req_get_position_funding.py lighter/models/req_get_public_pools_metadata.py +lighter/models/req_get_push_notif_settings.py 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 @@ -266,13 +303,19 @@ 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_user_referrals.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_exchange_metrics.py +lighter/models/resp_get_execute_stats.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_get_lease_options.py +lighter/models/resp_get_leases.py +lighter/models/resp_get_push_notif_settings.py lighter/models/resp_post_api_token.py lighter/models/resp_public_pools_metadata.py lighter/models/resp_revoke_api_token.py @@ -284,10 +327,14 @@ lighter/models/risk_info.py lighter/models/risk_parameters.py lighter/models/share_price.py lighter/models/simple_order.py +lighter/models/slippage_result.py +lighter/models/spot_avg_entry_price.py lighter/models/spot_market_stats.py lighter/models/spot_order_book_detail.py lighter/models/status.py +lighter/models/strategy.py lighter/models/sub_accounts.py +lighter/models/system_config.py lighter/models/ticker.py lighter/models/trade.py lighter/models/trades.py @@ -296,6 +343,7 @@ lighter/models/transfer_history.py lighter/models/transfer_history_item.py lighter/models/tx_hash.py lighter/models/tx_hashes.py +lighter/models/user_referrals.py lighter/models/validator_info.py lighter/models/withdraw_history.py lighter/models/withdraw_history_item.py @@ -305,4 +353,28 @@ lighter/rest.py setup.cfg test-requirements.txt test/__init__.py +test/test_exchange_metric.py +test/test_execute_stat.py +test/test_lease_entry.py +test/test_lease_option_entry.py +test/test_pending_unlock.py +test/test_push_notif_delivery_result.py +test/test_pushnotif_api.py +test/test_referral.py +test/test_referral_api.py +test/test_req_get_exchange_metrics.py +test/test_req_get_execute_stats.py +test/test_req_get_leases.py +test/test_req_get_push_notif_settings.py +test/test_req_get_user_referrals.py +test/test_resp_get_exchange_metrics.py +test/test_resp_get_execute_stats.py +test/test_resp_get_lease_options.py +test/test_resp_get_leases.py +test/test_resp_get_push_notif_settings.py +test/test_slippage_result.py +test/test_spot_avg_entry_price.py +test/test_strategy.py +test/test_system_config.py +test/test_user_referrals.py tox.ini diff --git a/docs/Account.md b/docs/Account.md index 6937475..75cdc2e 100644 --- a/docs/Account.md +++ b/docs/Account.md @@ -18,6 +18,7 @@ Name | Type | Description | Notes **status** | **int** | | **collateral** | **str** | | **transaction_time** | **int** | | +**account_trading_mode** | **int** | | ## Example diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 50fb542..1cc23b8 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -12,7 +12,10 @@ Method | HTTP request | Description [**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 +[**lease_options**](AccountApi.md#lease_options) | **GET** /api/v1/leaseOptions | leaseOptions +[**leases**](AccountApi.md#leases) | **GET** /api/v1/leases | leases [**liquidations**](AccountApi.md#liquidations) | **GET** /api/v1/liquidations | liquidations +[**lit_lease**](AccountApi.md#lit_lease) | **POST** /api/v1/litLease | litLease [**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 @@ -599,6 +602,148 @@ 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) +# **lease_options** +> RespGetLeaseOptions lease_options() + +leaseOptions + +Get lease options + +### Example + + +```python +import lighter +from lighter.models.resp_get_lease_options import RespGetLeaseOptions +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) + + try: + # leaseOptions + api_response = await api_instance.lease_options() + print("The response of AccountApi->lease_options:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->lease_options: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**RespGetLeaseOptions**](RespGetLeaseOptions.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) + +# **leases** +> RespGetLeases leases(account_index, authorization=authorization, auth=auth, cursor=cursor, limit=limit) + +leases + +Get leases + +### Example + + +```python +import lighter +from lighter.models.resp_get_leases import RespGetLeases +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) + auth = 'auth_example' # str | made optional to support header auth clients (optional) + cursor = 'cursor_example' # str | (optional) + limit = 20 # int | (optional) (default to 20) + + try: + # leases + api_response = await api_instance.leases(account_index, authorization=authorization, auth=auth, cursor=cursor, limit=limit) + print("The response of AccountApi->leases:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->leases: %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] + **cursor** | **str**| | [optional] + **limit** | **int**| | [optional] [default to 20] + +### Return type + +[**RespGetLeases**](RespGetLeases.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) + # **liquidations** > LiquidationInfos liquidations(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, cursor=cursor) @@ -678,6 +823,81 @@ 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) +# **lit_lease** +> TxHash lit_lease(tx_info, lease_amount, duration_days, authorization=authorization) + +litLease + +Submit LIT lease transfer + +### Example + + +```python +import lighter +from lighter.models.tx_hash import TxHash +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) + tx_info = 'tx_info_example' # str | + lease_amount = 'lease_amount_example' # str | + duration_days = 56 # int | + authorization = 'authorization_example' # str | (optional) + + try: + # litLease + api_response = await api_instance.lit_lease(tx_info, lease_amount, duration_days, authorization=authorization) + print("The response of AccountApi->lit_lease:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->lit_lease: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tx_info** | **str**| | + **lease_amount** | **str**| | + **duration_days** | **int**| | + **authorization** | **str**| | [optional] + +### Return type + +[**TxHash**](TxHash.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) + # **pnl** > AccountPnL pnl(by, value, resolution, start_timestamp, end_timestamp, count_back, authorization=authorization, auth=auth, ignore_transfers=ignore_transfers) diff --git a/docs/AccountLimits.md b/docs/AccountLimits.md index f19b1a0..3a4d90d 100644 --- a/docs/AccountLimits.md +++ b/docs/AccountLimits.md @@ -11,6 +11,10 @@ Name | Type | Description | Notes **max_llp_amount** | **str** | | **user_tier** | **str** | | **can_create_public_pool** | **bool** | | +**current_maker_fee_tick** | **int** | | +**current_taker_fee_tick** | **int** | | +**leased_lit** | **str** | | +**effective_lit_stakes** | **str** | | ## Example diff --git a/docs/AccountMetadata.md b/docs/AccountMetadata.md index 35089cf..5b134b8 100644 --- a/docs/AccountMetadata.md +++ b/docs/AccountMetadata.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **description** | **str** | | **can_invite** | **bool** | Remove After FE uses L1 meta endpoint | **referral_points_percentage** | **str** | Remove After FE uses L1 meta endpoint | +**created_at** | **int** | | ## Example diff --git a/docs/AccountPosition.md b/docs/AccountPosition.md index 93f2825..d807c28 100644 --- a/docs/AccountPosition.md +++ b/docs/AccountPosition.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **total_funding_paid_out** | **str** | | [optional] **margin_mode** | **int** | | **allocated_margin** | **str** | | +**total_discount** | **str** | | ## Example diff --git a/docs/AccountStats.md b/docs/AccountStats.md index 89aaab6..89f38ed 100644 --- a/docs/AccountStats.md +++ b/docs/AccountStats.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **available_balance** | **str** | | **margin_usage** | **str** | | **buying_power** | **str** | | +**account_trading_mode** | **int** | | **cross_stats** | [**AccountMarginStats**](AccountMarginStats.md) | | **total_stats** | [**AccountMarginStats**](AccountMarginStats.md) | | diff --git a/docs/DetailedAccount.md b/docs/DetailedAccount.md index 13a7b81..dea48d9 100644 --- a/docs/DetailedAccount.md +++ b/docs/DetailedAccount.md @@ -18,17 +18,20 @@ Name | Type | Description | Notes **status** | **int** | | **collateral** | **str** | | **transaction_time** | **int** | | +**account_trading_mode** | **int** | | **account_index** | **int** | | **name** | **str** | | **description** | **str** | | **can_invite** | **bool** | Remove After FE uses L1 meta endpoint | **referral_points_percentage** | **str** | Remove After FE uses L1 meta endpoint | +**created_at** | **int** | | **positions** | [**List[AccountPosition]**](AccountPosition.md) | | **assets** | [**List[AccountAsset]**](AccountAsset.md) | | **total_asset_value** | **str** | | **cross_asset_value** | **str** | | **pool_info** | [**PublicPoolInfo**](PublicPoolInfo.md) | | **shares** | [**List[PublicPoolShare]**](PublicPoolShare.md) | | +**pending_unlocks** | [**List[PendingUnlock]**](PendingUnlock.md) | | ## Example diff --git a/docs/ExchangeMetric.md b/docs/ExchangeMetric.md new file mode 100644 index 0000000..4c97233 --- /dev/null +++ b/docs/ExchangeMetric.md @@ -0,0 +1,30 @@ +# ExchangeMetric + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | | +**data** | **float** | | + +## Example + +```python +from lighter.models.exchange_metric import ExchangeMetric + +# TODO update the JSON string below +json = "{}" +# create an instance of ExchangeMetric from a JSON string +exchange_metric_instance = ExchangeMetric.from_json(json) +# print the JSON string representation of the object +print(ExchangeMetric.to_json()) + +# convert the object into a dict +exchange_metric_dict = exchange_metric_instance.to_dict() +# create an instance of ExchangeMetric from a dict +exchange_metric_from_dict = ExchangeMetric.from_dict(exchange_metric_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/ExecuteStat.md b/docs/ExecuteStat.md new file mode 100644 index 0000000..7351713 --- /dev/null +++ b/docs/ExecuteStat.md @@ -0,0 +1,30 @@ +# ExecuteStat + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **int** | | +**slippage** | [**List[SlippageResult]**](SlippageResult.md) | | + +## Example + +```python +from lighter.models.execute_stat import ExecuteStat + +# TODO update the JSON string below +json = "{}" +# create an instance of ExecuteStat from a JSON string +execute_stat_instance = ExecuteStat.from_json(json) +# print the JSON string representation of the object +print(ExecuteStat.to_json()) + +# convert the object into a dict +execute_stat_dict = execute_stat_instance.to_dict() +# create an instance of ExecuteStat from a dict +execute_stat_from_dict = ExecuteStat.from_dict(execute_stat_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/InfoApi.md b/docs/InfoApi.md index ce3c263..dd63e2d 100644 --- a/docs/InfoApi.md +++ b/docs/InfoApi.md @@ -4,10 +4,76 @@ All URIs are relative to *https://mainnet.zklighter.elliot.ai* Method | HTTP request | Description ------------- | ------------- | ------------- +[**system_config**](InfoApi.md#system_config) | **GET** /api/v1/systemConfig | systemConfig [**transfer_fee_info**](InfoApi.md#transfer_fee_info) | **GET** /api/v1/transferFeeInfo | transferFeeInfo [**withdrawal_delay**](InfoApi.md#withdrawal_delay) | **GET** /api/v1/withdrawalDelay | withdrawalDelay +# **system_config** +> SystemConfig system_config() + +systemConfig + +Get system configuration including pool indexes and lockup/cooldown periods + +### Example + + +```python +import lighter +from lighter.models.system_config import SystemConfig +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.InfoApi(api_client) + + try: + # systemConfig + api_response = await api_instance.system_config() + print("The response of InfoApi->system_config:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InfoApi->system_config: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**SystemConfig**](SystemConfig.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) + # **transfer_fee_info** > TransferFeeInfo transfer_fee_info(account_index, authorization=authorization, auth=auth, to_account_index=to_account_index) diff --git a/docs/LeaseEntry.md b/docs/LeaseEntry.md new file mode 100644 index 0000000..5c85cec --- /dev/null +++ b/docs/LeaseEntry.md @@ -0,0 +1,36 @@ +# LeaseEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**master_account_index** | **int** | | +**lease_amount** | **int** | | +**fee_amount** | **int** | | +**start** | **int** | | +**end** | **int** | | +**status** | **str** | | +**error** | **str** | | + +## Example + +```python +from lighter.models.lease_entry import LeaseEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of LeaseEntry from a JSON string +lease_entry_instance = LeaseEntry.from_json(json) +# print the JSON string representation of the object +print(LeaseEntry.to_json()) + +# convert the object into a dict +lease_entry_dict = lease_entry_instance.to_dict() +# create an instance of LeaseEntry from a dict +lease_entry_from_dict = LeaseEntry.from_dict(lease_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/LeaseOptionEntry.md b/docs/LeaseOptionEntry.md new file mode 100644 index 0000000..15af9a2 --- /dev/null +++ b/docs/LeaseOptionEntry.md @@ -0,0 +1,30 @@ +# LeaseOptionEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**duration_days** | **int** | | +**annual_rate** | **float** | | + +## Example + +```python +from lighter.models.lease_option_entry import LeaseOptionEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of LeaseOptionEntry from a JSON string +lease_option_entry_instance = LeaseOptionEntry.from_json(json) +# print the JSON string representation of the object +print(LeaseOptionEntry.to_json()) + +# convert the object into a dict +lease_option_entry_dict = lease_option_entry_instance.to_dict() +# create an instance of LeaseOptionEntry from a dict +lease_option_entry_from_dict = LeaseOptionEntry.from_dict(lease_option_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/MarketConfig.md b/docs/MarketConfig.md index 1a94e25..8417308 100644 --- a/docs/MarketConfig.md +++ b/docs/MarketConfig.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **liquidation_mode** | **int** | | **force_reduce_only** | **bool** | | **trading_hours** | **str** | | +**funding_fee_discounts_enabled** | **bool** | | +**hidden** | **bool** | | ## Example diff --git a/docs/OrderApi.md b/docs/OrderApi.md index 34c7cc8..77fe83b 100644 --- a/docs/OrderApi.md +++ b/docs/OrderApi.md @@ -7,7 +7,9 @@ Method | HTTP request | Description [**account_active_orders**](OrderApi.md#account_active_orders) | **GET** /api/v1/accountActiveOrders | accountActiveOrders [**account_inactive_orders**](OrderApi.md#account_inactive_orders) | **GET** /api/v1/accountInactiveOrders | accountInactiveOrders [**asset_details**](OrderApi.md#asset_details) | **GET** /api/v1/assetDetails | assetDetails +[**exchange_metrics**](OrderApi.md#exchange_metrics) | **GET** /api/v1/exchangeMetrics | exchangeMetrics [**exchange_stats**](OrderApi.md#exchange_stats) | **GET** /api/v1/exchangeStats | exchangeStats +[**execute_stats**](OrderApi.md#execute_stats) | **GET** /api/v1/executeStats | executeStats [**export**](OrderApi.md#export) | **GET** /api/v1/export | export [**order_book_details**](OrderApi.md#order_book_details) | **GET** /api/v1/orderBookDetails | orderBookDetails [**order_book_orders**](OrderApi.md#order_book_orders) | **GET** /api/v1/orderBookOrders | orderBookOrders @@ -243,6 +245,81 @@ 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) +# **exchange_metrics** +> RespGetExchangeMetrics exchange_metrics(period, kind, filter=filter, value=value) + +exchangeMetrics + +Get exchange metrics + +### Example + + +```python +import lighter +from lighter.models.resp_get_exchange_metrics import RespGetExchangeMetrics +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.OrderApi(api_client) + period = 'period_example' # str | + kind = 'kind_example' # str | + filter = 'filter_example' # str | (optional) + value = 'value_example' # str | (optional) + + try: + # exchangeMetrics + api_response = await api_instance.exchange_metrics(period, kind, filter=filter, value=value) + print("The response of OrderApi->exchange_metrics:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrderApi->exchange_metrics: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **period** | **str**| | + **kind** | **str**| | + **filter** | **str**| | [optional] + **value** | **str**| | [optional] + +### Return type + +[**RespGetExchangeMetrics**](RespGetExchangeMetrics.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) + # **exchange_stats** > ExchangeStats exchange_stats() @@ -308,8 +385,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) +# **execute_stats** +> RespGetExecuteStats execute_stats(period) + +executeStats + +Get execute stats + +### Example + + +```python +import lighter +from lighter.models.resp_get_execute_stats import RespGetExecuteStats +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.OrderApi(api_client) + period = 'period_example' # str | + + try: + # executeStats + api_response = await api_instance.execute_stats(period) + print("The response of OrderApi->execute_stats:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrderApi->execute_stats: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **period** | **str**| | + +### Return type + +[**RespGetExecuteStats**](RespGetExecuteStats.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) + # **export** -> ExportData export(type, authorization=authorization, auth=auth, account_index=account_index, market_id=market_id) +> ExportData export(type, authorization=authorization, auth=auth, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, end_timestamp=end_timestamp, side=side, role=role, trade_type=trade_type) export @@ -340,10 +486,15 @@ async with lighter.ApiClient(configuration) as api_client: 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) + start_timestamp = 56 # int | (optional) + end_timestamp = 56 # int | (optional) + side = all # str | (optional) (default to all) + role = all # str | (optional) (default to all) + trade_type = all # str | (optional) (default to all) try: # export - api_response = await api_instance.export(type, authorization=authorization, auth=auth, account_index=account_index, market_id=market_id) + api_response = await api_instance.export(type, authorization=authorization, auth=auth, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, end_timestamp=end_timestamp, side=side, role=role, trade_type=trade_type) print("The response of OrderApi->export:\n") pprint(api_response) except Exception as e: @@ -362,6 +513,11 @@ Name | Type | Description | Notes **auth** | **str**| made optional to support header auth clients | [optional] **account_index** | **int**| | [optional] [default to -1] **market_id** | **int**| | [optional] [default to 255] + **start_timestamp** | **int**| | [optional] + **end_timestamp** | **int**| | [optional] + **side** | **str**| | [optional] [default to all] + **role** | **str**| | [optional] [default to all] + **trade_type** | **str**| | [optional] [default to all] ### Return type diff --git a/docs/PendingUnlock.md b/docs/PendingUnlock.md new file mode 100644 index 0000000..23aaadb --- /dev/null +++ b/docs/PendingUnlock.md @@ -0,0 +1,31 @@ +# PendingUnlock + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unlock_timestamp** | **int** | | +**asset_index** | **int** | | +**amount** | **str** | | + +## Example + +```python +from lighter.models.pending_unlock import PendingUnlock + +# TODO update the JSON string below +json = "{}" +# create an instance of PendingUnlock from a JSON string +pending_unlock_instance = PendingUnlock.from_json(json) +# print the JSON string representation of the object +print(PendingUnlock.to_json()) + +# convert the object into a dict +pending_unlock_dict = pending_unlock_instance.to_dict() +# create an instance of PendingUnlock from a dict +pending_unlock_from_dict = PendingUnlock.from_dict(pending_unlock_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/PerpsOrderBookDetail.md b/docs/PerpsOrderBookDetail.md index ad69ae3..ba0ed8d 100644 --- a/docs/PerpsOrderBookDetail.md +++ b/docs/PerpsOrderBookDetail.md @@ -37,6 +37,7 @@ Name | Type | Description | Notes **open_interest** | **float** | | **daily_chart** | **Dict[str, float]** | | **market_config** | [**MarketConfig**](MarketConfig.md) | | +**strategy_index** | **int** | | ## Example diff --git a/docs/PnLEntry.md b/docs/PnLEntry.md index 6032475..3c9019d 100644 --- a/docs/PnLEntry.md +++ b/docs/PnLEntry.md @@ -15,7 +15,11 @@ Name | Type | Description | Notes **pool_pnl** | **float** | | **pool_inflow** | **float** | | **pool_outflow** | **float** | | +**staking_pnl** | **float** | | +**staking_inflow** | **float** | | +**staking_outflow** | **float** | | **pool_total_shares** | **float** | | +**staked_lit** | **float** | | ## Example diff --git a/docs/PositionFunding.md b/docs/PositionFunding.md index 3911db4..1a2f584 100644 --- a/docs/PositionFunding.md +++ b/docs/PositionFunding.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **rate** | **str** | | **position_size** | **str** | | **position_side** | **str** | | +**discount** | **str** | | ## Example diff --git a/docs/PublicPoolInfo.md b/docs/PublicPoolInfo.md index da382c3..5ab4114 100644 --- a/docs/PublicPoolInfo.md +++ b/docs/PublicPoolInfo.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **sharpe_ratio** | **float** | | **daily_returns** | [**List[DailyReturn]**](DailyReturn.md) | | **share_prices** | [**List[SharePrice]**](SharePrice.md) | | +**strategies** | [**List[Strategy]**](Strategy.md) | | ## Example diff --git a/docs/PublicPoolMetadata.md b/docs/PublicPoolMetadata.md index 453108f..e5c0f61 100644 --- a/docs/PublicPoolMetadata.md +++ b/docs/PublicPoolMetadata.md @@ -18,8 +18,11 @@ Name | Type | Description | Notes **status** | **int** | | **operator_fee** | **str** | | **total_asset_value** | **str** | | +**total_spot_value** | **str** | | +**total_perps_value** | **str** | | **total_shares** | **int** | | **account_share** | [**PublicPoolShare**](PublicPoolShare.md) | | [optional] +**assets** | [**List[AccountAsset]**](AccountAsset.md) | | ## Example diff --git a/docs/PublicPoolShare.md b/docs/PublicPoolShare.md index 64a3f0f..15d62d5 100644 --- a/docs/PublicPoolShare.md +++ b/docs/PublicPoolShare.md @@ -7,7 +7,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **public_pool_index** | **int** | | **shares_amount** | **int** | | -**entry_usdc** | **str** | | +**entry_usdc** | **str** | For public pools and insurance fund | +**principal_amount** | **str** | | +**entry_timestamp** | **int** | | ## Example diff --git a/docs/PushNotifDeliveryResult.md b/docs/PushNotifDeliveryResult.md new file mode 100644 index 0000000..66d82f3 --- /dev/null +++ b/docs/PushNotifDeliveryResult.md @@ -0,0 +1,31 @@ +# PushNotifDeliveryResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expo_token** | **str** | | +**status** | **str** | | +**error** | **str** | | + +## Example + +```python +from lighter.models.push_notif_delivery_result import PushNotifDeliveryResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PushNotifDeliveryResult from a JSON string +push_notif_delivery_result_instance = PushNotifDeliveryResult.from_json(json) +# print the JSON string representation of the object +print(PushNotifDeliveryResult.to_json()) + +# convert the object into a dict +push_notif_delivery_result_dict = push_notif_delivery_result_instance.to_dict() +# create an instance of PushNotifDeliveryResult from a dict +push_notif_delivery_result_from_dict = PushNotifDeliveryResult.from_dict(push_notif_delivery_result_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/PushnotifApi.md b/docs/PushnotifApi.md new file mode 100644 index 0000000..74b6aa2 --- /dev/null +++ b/docs/PushnotifApi.md @@ -0,0 +1,312 @@ +# lighter.PushnotifApi + +All URIs are relative to *https://mainnet.zklighter.elliot.ai* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_pushnotif_settings**](PushnotifApi.md#get_pushnotif_settings) | **GET** /api/v1/pushnotif/settings | get_pushnotif_settings +[**post_pushnotif_settings**](PushnotifApi.md#post_pushnotif_settings) | **POST** /api/v1/pushnotif/settings | post_pushnotif_settings +[**pushnotif_register**](PushnotifApi.md#pushnotif_register) | **POST** /api/v1/pushnotif/register | pushnotif_register +[**pushnotif_unregister**](PushnotifApi.md#pushnotif_unregister) | **POST** /api/v1/pushnotif/unregister | pushnotif_unregister + + +# **get_pushnotif_settings** +> RespGetPushNotifSettings get_pushnotif_settings(account_index, expo_token, authorization=authorization, auth=auth) + +get_pushnotif_settings + +Get push notification settings + +### Example + + +```python +import lighter +from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings +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.PushnotifApi(api_client) + account_index = 56 # int | + expo_token = 'expo_token_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: + # get_pushnotif_settings + api_response = await api_instance.get_pushnotif_settings(account_index, expo_token, authorization=authorization, auth=auth) + print("The response of PushnotifApi->get_pushnotif_settings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PushnotifApi->get_pushnotif_settings: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **expo_token** | **str**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + +### Return type + +[**RespGetPushNotifSettings**](RespGetPushNotifSettings.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) + +# **post_pushnotif_settings** +> ResultCode post_pushnotif_settings(account_index, expo_token, enabled, auth=auth) + +post_pushnotif_settings + +Update push notification settings + +### 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.PushnotifApi(api_client) + account_index = 56 # int | + expo_token = 'expo_token_example' # str | + enabled = True # bool | + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # post_pushnotif_settings + api_response = await api_instance.post_pushnotif_settings(account_index, expo_token, enabled, auth=auth) + print("The response of PushnotifApi->post_pushnotif_settings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PushnotifApi->post_pushnotif_settings: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **expo_token** | **str**| | + **enabled** | **bool**| | + **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) + +# **pushnotif_register** +> ResultCode pushnotif_register(account_index, expo_token, platform, auth=auth, app_version=app_version) + +pushnotif_register + +Register device for push notifications + +### 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.PushnotifApi(api_client) + account_index = 56 # int | + expo_token = 'expo_token_example' # str | + platform = 'platform_example' # str | + auth = 'auth_example' # str | made optional to support header auth clients (optional) + app_version = 'app_version_example' # str | (optional) + + try: + # pushnotif_register + api_response = await api_instance.pushnotif_register(account_index, expo_token, platform, auth=auth, app_version=app_version) + print("The response of PushnotifApi->pushnotif_register:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PushnotifApi->pushnotif_register: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **expo_token** | **str**| | + **platform** | **str**| | + **auth** | **str**| made optional to support header auth clients | [optional] + **app_version** | **str**| | [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) + +# **pushnotif_unregister** +> ResultCode pushnotif_unregister(account_index, expo_token, auth=auth) + +pushnotif_unregister + +Unregister device from push notifications + +### 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.PushnotifApi(api_client) + account_index = 56 # int | + expo_token = 'expo_token_example' # str | + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # pushnotif_unregister + api_response = await api_instance.pushnotif_unregister(account_index, expo_token, auth=auth) + print("The response of PushnotifApi->pushnotif_unregister:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PushnotifApi->pushnotif_unregister: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **expo_token** | **str**| | + **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) + diff --git a/docs/Referral.md b/docs/Referral.md new file mode 100644 index 0000000..a835f02 --- /dev/null +++ b/docs/Referral.md @@ -0,0 +1,31 @@ +# Referral + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**l1_address** | **str** | | +**referral_code** | **str** | | +**used_at** | **int** | | + +## Example + +```python +from lighter.models.referral import Referral + +# TODO update the JSON string below +json = "{}" +# create an instance of Referral from a JSON string +referral_instance = Referral.from_json(json) +# print the JSON string representation of the object +print(Referral.to_json()) + +# convert the object into a dict +referral_dict = referral_instance.to_dict() +# create an instance of Referral from a dict +referral_from_dict = Referral.from_dict(referral_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 new file mode 100644 index 0000000..7195a2f --- /dev/null +++ b/docs/ReferralApi.md @@ -0,0 +1,84 @@ +# lighter.ReferralApi + +All URIs are relative to *https://mainnet.zklighter.elliot.ai* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**referral_user_referrals**](ReferralApi.md#referral_user_referrals) | **GET** /api/v1/referral/userReferrals | referral_userReferrals + + +# **referral_user_referrals** +> UserReferrals referral_user_referrals(l1_address, authorization=authorization, auth=auth, cursor=cursor) + +referral_userReferrals + +Get user referrals + +### Example + + +```python +import lighter +from lighter.models.user_referrals import UserReferrals +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) + l1_address = 'l1_address_example' # str | + authorization = 'authorization_example' # str | (optional) + auth = 'auth_example' # str | (optional) + cursor = 'cursor_example' # str | (optional) + + try: + # referral_userReferrals + api_response = await api_instance.referral_user_referrals(l1_address, authorization=authorization, auth=auth, cursor=cursor) + print("The response of ReferralApi->referral_user_referrals:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReferralApi->referral_user_referrals: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **l1_address** | **str**| | + **authorization** | **str**| | [optional] + **auth** | **str**| | [optional] + **cursor** | **str**| | [optional] + +### Return type + +[**UserReferrals**](UserReferrals.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/ReqExportData.md b/docs/ReqExportData.md index 0038c48..8ecd9d4 100644 --- a/docs/ReqExportData.md +++ b/docs/ReqExportData.md @@ -9,6 +9,11 @@ Name | Type | Description | Notes **account_index** | **int** | | [optional] [default to -1] **market_id** | **int** | | [optional] **type** | **str** | | +**start_timestamp** | **int** | | [optional] +**end_timestamp** | **int** | | [optional] +**side** | **str** | | [optional] [default to 'all'] +**role** | **str** | | [optional] [default to 'all'] +**trade_type** | **str** | | [optional] [default to 'all'] ## Example diff --git a/docs/ReqGetExchangeMetrics.md b/docs/ReqGetExchangeMetrics.md new file mode 100644 index 0000000..d9a63c4 --- /dev/null +++ b/docs/ReqGetExchangeMetrics.md @@ -0,0 +1,32 @@ +# ReqGetExchangeMetrics + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period** | **str** | | +**kind** | **str** | | +**filter** | **str** | | [optional] +**value** | **str** | | [optional] + +## Example + +```python +from lighter.models.req_get_exchange_metrics import ReqGetExchangeMetrics + +# TODO update the JSON string below +json = "{}" +# create an instance of ReqGetExchangeMetrics from a JSON string +req_get_exchange_metrics_instance = ReqGetExchangeMetrics.from_json(json) +# print the JSON string representation of the object +print(ReqGetExchangeMetrics.to_json()) + +# convert the object into a dict +req_get_exchange_metrics_dict = req_get_exchange_metrics_instance.to_dict() +# create an instance of ReqGetExchangeMetrics from a dict +req_get_exchange_metrics_from_dict = ReqGetExchangeMetrics.from_dict(req_get_exchange_metrics_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/ReqGetExecuteStats.md b/docs/ReqGetExecuteStats.md new file mode 100644 index 0000000..3678a12 --- /dev/null +++ b/docs/ReqGetExecuteStats.md @@ -0,0 +1,29 @@ +# ReqGetExecuteStats + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period** | **str** | | + +## Example + +```python +from lighter.models.req_get_execute_stats import ReqGetExecuteStats + +# TODO update the JSON string below +json = "{}" +# create an instance of ReqGetExecuteStats from a JSON string +req_get_execute_stats_instance = ReqGetExecuteStats.from_json(json) +# print the JSON string representation of the object +print(ReqGetExecuteStats.to_json()) + +# convert the object into a dict +req_get_execute_stats_dict = req_get_execute_stats_instance.to_dict() +# create an instance of ReqGetExecuteStats from a dict +req_get_execute_stats_from_dict = ReqGetExecuteStats.from_dict(req_get_execute_stats_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/ReqGetLeases.md b/docs/ReqGetLeases.md new file mode 100644 index 0000000..013a7f9 --- /dev/null +++ b/docs/ReqGetLeases.md @@ -0,0 +1,32 @@ +# ReqGetLeases + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth** | **str** | made optional to support header auth clients | [optional] +**account_index** | **int** | | +**cursor** | **str** | | [optional] +**limit** | **int** | | [optional] [default to 20] + +## Example + +```python +from lighter.models.req_get_leases import ReqGetLeases + +# TODO update the JSON string below +json = "{}" +# create an instance of ReqGetLeases from a JSON string +req_get_leases_instance = ReqGetLeases.from_json(json) +# print the JSON string representation of the object +print(ReqGetLeases.to_json()) + +# convert the object into a dict +req_get_leases_dict = req_get_leases_instance.to_dict() +# create an instance of ReqGetLeases from a dict +req_get_leases_from_dict = ReqGetLeases.from_dict(req_get_leases_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/ReqGetPushNotifSettings.md b/docs/ReqGetPushNotifSettings.md new file mode 100644 index 0000000..72d08dd --- /dev/null +++ b/docs/ReqGetPushNotifSettings.md @@ -0,0 +1,31 @@ +# ReqGetPushNotifSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth** | **str** | made optional to support header auth clients | [optional] +**account_index** | **int** | | +**expo_token** | **str** | | + +## Example + +```python +from lighter.models.req_get_push_notif_settings import ReqGetPushNotifSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of ReqGetPushNotifSettings from a JSON string +req_get_push_notif_settings_instance = ReqGetPushNotifSettings.from_json(json) +# print the JSON string representation of the object +print(ReqGetPushNotifSettings.to_json()) + +# convert the object into a dict +req_get_push_notif_settings_dict = req_get_push_notif_settings_instance.to_dict() +# create an instance of ReqGetPushNotifSettings from a dict +req_get_push_notif_settings_from_dict = ReqGetPushNotifSettings.from_dict(req_get_push_notif_settings_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/ReqGetTransferHistory.md b/docs/ReqGetTransferHistory.md index 8db4675..181e5c9 100644 --- a/docs/ReqGetTransferHistory.md +++ b/docs/ReqGetTransferHistory.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **auth** | **str** | made optional to support header auth clients | [optional] **account_index** | **int** | | **cursor** | **str** | | [optional] +**type** | **List[str]** | | [optional] ## Example diff --git a/docs/ReqGetUserReferrals.md b/docs/ReqGetUserReferrals.md new file mode 100644 index 0000000..45cb2bf --- /dev/null +++ b/docs/ReqGetUserReferrals.md @@ -0,0 +1,31 @@ +# ReqGetUserReferrals + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth** | **str** | | [optional] +**l1_address** | **str** | | +**cursor** | **str** | | [optional] + +## Example + +```python +from lighter.models.req_get_user_referrals import ReqGetUserReferrals + +# TODO update the JSON string below +json = "{}" +# create an instance of ReqGetUserReferrals from a JSON string +req_get_user_referrals_instance = ReqGetUserReferrals.from_json(json) +# print the JSON string representation of the object +print(ReqGetUserReferrals.to_json()) + +# convert the object into a dict +req_get_user_referrals_dict = req_get_user_referrals_instance.to_dict() +# create an instance of ReqGetUserReferrals from a dict +req_get_user_referrals_from_dict = ReqGetUserReferrals.from_dict(req_get_user_referrals_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/RespGetExchangeMetrics.md b/docs/RespGetExchangeMetrics.md new file mode 100644 index 0000000..eea639f --- /dev/null +++ b/docs/RespGetExchangeMetrics.md @@ -0,0 +1,31 @@ +# RespGetExchangeMetrics + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**metrics** | [**List[ExchangeMetric]**](ExchangeMetric.md) | | + +## Example + +```python +from lighter.models.resp_get_exchange_metrics import RespGetExchangeMetrics + +# TODO update the JSON string below +json = "{}" +# create an instance of RespGetExchangeMetrics from a JSON string +resp_get_exchange_metrics_instance = RespGetExchangeMetrics.from_json(json) +# print the JSON string representation of the object +print(RespGetExchangeMetrics.to_json()) + +# convert the object into a dict +resp_get_exchange_metrics_dict = resp_get_exchange_metrics_instance.to_dict() +# create an instance of RespGetExchangeMetrics from a dict +resp_get_exchange_metrics_from_dict = RespGetExchangeMetrics.from_dict(resp_get_exchange_metrics_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/RespGetExecuteStats.md b/docs/RespGetExecuteStats.md new file mode 100644 index 0000000..a150c00 --- /dev/null +++ b/docs/RespGetExecuteStats.md @@ -0,0 +1,30 @@ +# RespGetExecuteStats + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period** | **str** | | +**result** | [**List[ExecuteStat]**](ExecuteStat.md) | | + +## Example + +```python +from lighter.models.resp_get_execute_stats import RespGetExecuteStats + +# TODO update the JSON string below +json = "{}" +# create an instance of RespGetExecuteStats from a JSON string +resp_get_execute_stats_instance = RespGetExecuteStats.from_json(json) +# print the JSON string representation of the object +print(RespGetExecuteStats.to_json()) + +# convert the object into a dict +resp_get_execute_stats_dict = resp_get_execute_stats_instance.to_dict() +# create an instance of RespGetExecuteStats from a dict +resp_get_execute_stats_from_dict = RespGetExecuteStats.from_dict(resp_get_execute_stats_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/RespGetLeaseOptions.md b/docs/RespGetLeaseOptions.md new file mode 100644 index 0000000..8a85584 --- /dev/null +++ b/docs/RespGetLeaseOptions.md @@ -0,0 +1,32 @@ +# RespGetLeaseOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**options** | [**List[LeaseOptionEntry]**](LeaseOptionEntry.md) | | +**lit_incentives_account_index** | **int** | | + +## Example + +```python +from lighter.models.resp_get_lease_options import RespGetLeaseOptions + +# TODO update the JSON string below +json = "{}" +# create an instance of RespGetLeaseOptions from a JSON string +resp_get_lease_options_instance = RespGetLeaseOptions.from_json(json) +# print the JSON string representation of the object +print(RespGetLeaseOptions.to_json()) + +# convert the object into a dict +resp_get_lease_options_dict = resp_get_lease_options_instance.to_dict() +# create an instance of RespGetLeaseOptions from a dict +resp_get_lease_options_from_dict = RespGetLeaseOptions.from_dict(resp_get_lease_options_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/RespGetLeases.md b/docs/RespGetLeases.md new file mode 100644 index 0000000..b1c16e9 --- /dev/null +++ b/docs/RespGetLeases.md @@ -0,0 +1,32 @@ +# RespGetLeases + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**leases** | [**List[LeaseEntry]**](LeaseEntry.md) | | +**next_cursor** | **str** | | [optional] + +## Example + +```python +from lighter.models.resp_get_leases import RespGetLeases + +# TODO update the JSON string below +json = "{}" +# create an instance of RespGetLeases from a JSON string +resp_get_leases_instance = RespGetLeases.from_json(json) +# print the JSON string representation of the object +print(RespGetLeases.to_json()) + +# convert the object into a dict +resp_get_leases_dict = resp_get_leases_instance.to_dict() +# create an instance of RespGetLeases from a dict +resp_get_leases_from_dict = RespGetLeases.from_dict(resp_get_leases_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/RespGetPushNotifSettings.md b/docs/RespGetPushNotifSettings.md new file mode 100644 index 0000000..ece0eb8 --- /dev/null +++ b/docs/RespGetPushNotifSettings.md @@ -0,0 +1,32 @@ +# RespGetPushNotifSettings + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**account_index** | **int** | | +**enabled** | **bool** | | + +## Example + +```python +from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings + +# TODO update the JSON string below +json = "{}" +# create an instance of RespGetPushNotifSettings from a JSON string +resp_get_push_notif_settings_instance = RespGetPushNotifSettings.from_json(json) +# print the JSON string representation of the object +print(RespGetPushNotifSettings.to_json()) + +# convert the object into a dict +resp_get_push_notif_settings_dict = resp_get_push_notif_settings_instance.to_dict() +# create an instance of RespGetPushNotifSettings from a dict +resp_get_push_notif_settings_from_dict = RespGetPushNotifSettings.from_dict(resp_get_push_notif_settings_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/SlippageResult.md b/docs/SlippageResult.md new file mode 100644 index 0000000..26b2b50 --- /dev/null +++ b/docs/SlippageResult.md @@ -0,0 +1,33 @@ +# SlippageResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exchange** | **str** | | +**market** | **str** | | +**size_usd** | **int** | | +**avg_slippage** | **float** | | +**data_count** | **int** | | + +## Example + +```python +from lighter.models.slippage_result import SlippageResult + +# TODO update the JSON string below +json = "{}" +# create an instance of SlippageResult from a JSON string +slippage_result_instance = SlippageResult.from_json(json) +# print the JSON string representation of the object +print(SlippageResult.to_json()) + +# convert the object into a dict +slippage_result_dict = slippage_result_instance.to_dict() +# create an instance of SlippageResult from a dict +slippage_result_from_dict = SlippageResult.from_dict(slippage_result_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/SpotAvgEntryPrice.md b/docs/SpotAvgEntryPrice.md new file mode 100644 index 0000000..db9830c --- /dev/null +++ b/docs/SpotAvgEntryPrice.md @@ -0,0 +1,32 @@ +# SpotAvgEntryPrice + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset_id** | **int** | | +**avg_entry_price** | **str** | | +**asset_size** | **str** | | +**last_trade_id** | **int** | | + +## Example + +```python +from lighter.models.spot_avg_entry_price import SpotAvgEntryPrice + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotAvgEntryPrice from a JSON string +spot_avg_entry_price_instance = SpotAvgEntryPrice.from_json(json) +# print the JSON string representation of the object +print(SpotAvgEntryPrice.to_json()) + +# convert the object into a dict +spot_avg_entry_price_dict = spot_avg_entry_price_instance.to_dict() +# create an instance of SpotAvgEntryPrice from a dict +spot_avg_entry_price_from_dict = SpotAvgEntryPrice.from_dict(spot_avg_entry_price_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/Strategy.md b/docs/Strategy.md new file mode 100644 index 0000000..5d06fdd --- /dev/null +++ b/docs/Strategy.md @@ -0,0 +1,29 @@ +# Strategy + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**collateral** | **str** | | + +## Example + +```python +from lighter.models.strategy import Strategy + +# TODO update the JSON string below +json = "{}" +# create an instance of Strategy from a JSON string +strategy_instance = Strategy.from_json(json) +# print the JSON string representation of the object +print(Strategy.to_json()) + +# convert the object into a dict +strategy_dict = strategy_instance.to_dict() +# create an instance of Strategy from a dict +strategy_from_dict = Strategy.from_dict(strategy_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/SystemConfig.md b/docs/SystemConfig.md new file mode 100644 index 0000000..8c7bf53 --- /dev/null +++ b/docs/SystemConfig.md @@ -0,0 +1,35 @@ +# SystemConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**liquidity_pool_index** | **int** | | +**staking_pool_index** | **int** | | +**funding_fee_rebate_account_index** | **int** | | +**liquidity_pool_cooldown_period** | **int** | | +**staking_pool_lockup_period** | **int** | | + +## Example + +```python +from lighter.models.system_config import SystemConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of SystemConfig from a JSON string +system_config_instance = SystemConfig.from_json(json) +# print the JSON string representation of the object +print(SystemConfig.to_json()) + +# convert the object into a dict +system_config_dict = system_config_instance.to_dict() +# create an instance of SystemConfig from a dict +system_config_from_dict = SystemConfig.from_dict(system_config_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/Trade.md b/docs/Trade.md index 43a5191..e49bd76 100644 --- a/docs/Trade.md +++ b/docs/Trade.md @@ -32,6 +32,8 @@ Name | Type | Description | Notes **maker_initial_margin_fraction_before** | **int** | | **maker_position_sign_changed** | **bool** | | **transaction_time** | **int** | | +**ask_account_pnl** | **str** | | +**bid_account_pnl** | **str** | | ## Example diff --git a/docs/TransactionApi.md b/docs/TransactionApi.md index 54ab1b3..1f6a691 100644 --- a/docs/TransactionApi.md +++ b/docs/TransactionApi.md @@ -309,7 +309,7 @@ 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) # **transfer_history** -> TransferHistory transfer_history(account_index, authorization=authorization, auth=auth, cursor=cursor) +> TransferHistory transfer_history(account_index, authorization=authorization, auth=auth, cursor=cursor, type=type) transfer_history @@ -339,10 +339,11 @@ async with lighter.ApiClient(configuration) as api_client: authorization = 'authorization_example' # str | make required after integ is done (optional) auth = 'auth_example' # str | made optional to support header auth clients (optional) cursor = 'cursor_example' # str | (optional) + type = 'type_example' # str | (optional) try: # transfer_history - api_response = await api_instance.transfer_history(account_index, authorization=authorization, auth=auth, cursor=cursor) + api_response = await api_instance.transfer_history(account_index, authorization=authorization, auth=auth, cursor=cursor, type=type) print("The response of TransactionApi->transfer_history:\n") pprint(api_response) except Exception as e: @@ -360,6 +361,7 @@ Name | Type | Description | Notes **authorization** | **str**| make required after integ is done | [optional] **auth** | **str**| made optional to support header auth clients | [optional] **cursor** | **str**| | [optional] + **type** | **str**| | [optional] ### Return type diff --git a/docs/UserReferrals.md b/docs/UserReferrals.md new file mode 100644 index 0000000..ccb0f1b --- /dev/null +++ b/docs/UserReferrals.md @@ -0,0 +1,32 @@ +# UserReferrals + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**cursor** | **str** | | +**referrals** | [**List[Referral]**](Referral.md) | | + +## Example + +```python +from lighter.models.user_referrals import UserReferrals + +# TODO update the JSON string below +json = "{}" +# create an instance of UserReferrals from a JSON string +user_referrals_instance = UserReferrals.from_json(json) +# print the JSON string representation of the object +print(UserReferrals.to_json()) + +# convert the object into a dict +user_referrals_dict = user_referrals_instance.to_dict() +# create an instance of UserReferrals from a dict +user_referrals_from_dict = UserReferrals.from_dict(user_referrals_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/lighter/__init__.py b/lighter/__init__.py index 06f063c..d4a9ac4 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -25,6 +25,8 @@ from lighter.api.info_api import InfoApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi +from lighter.api.pushnotif_api import PushnotifApi +from lighter.api.referral_api import ReferralApi from lighter.api.root_api import RootApi from lighter.api.transaction_api import TransactionApi @@ -72,7 +74,9 @@ from lighter.models.detailed_accounts import DetailedAccounts from lighter.models.detailed_candlestick import DetailedCandlestick from lighter.models.enriched_tx import EnrichedTx +from lighter.models.exchange_metric import ExchangeMetric from lighter.models.exchange_stats import ExchangeStats +from lighter.models.execute_stat import ExecuteStat from lighter.models.export_data import ExportData from lighter.models.funding import Funding from lighter.models.funding_rate import FundingRate @@ -80,6 +84,8 @@ from lighter.models.fundings import Fundings from lighter.models.l1_metadata import L1Metadata from lighter.models.l1_provider_info import L1ProviderInfo +from lighter.models.lease_entry import LeaseEntry +from lighter.models.lease_option_entry import LeaseOptionEntry from lighter.models.liq_trade import LiqTrade from lighter.models.liquidation import Liquidation from lighter.models.liquidation_info import LiquidationInfo @@ -95,6 +101,7 @@ from lighter.models.order_book_stats import OrderBookStats from lighter.models.order_books import OrderBooks from lighter.models.orders import Orders +from lighter.models.pending_unlock import PendingUnlock from lighter.models.perps_market_stats import PerpsMarketStats from lighter.models.perps_order_book_detail import PerpsOrderBookDetail from lighter.models.pn_l_entry import PnLEntry @@ -104,6 +111,8 @@ 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.push_notif_delivery_result import PushNotifDeliveryResult +from lighter.models.referral import Referral from lighter.models.req_do_faucet import ReqDoFaucet from lighter.models.req_export_data import ReqExportData from lighter.models.req_get_account import ReqGetAccount @@ -123,11 +132,14 @@ from lighter.models.req_get_by_account import ReqGetByAccount from lighter.models.req_get_candles import ReqGetCandles from lighter.models.req_get_deposit_history import ReqGetDepositHistory +from lighter.models.req_get_exchange_metrics import ReqGetExchangeMetrics +from lighter.models.req_get_execute_stats import ReqGetExecuteStats from lighter.models.req_get_fast_withdraw_info import ReqGetFastWithdrawInfo from lighter.models.req_get_fundings import ReqGetFundings from lighter.models.req_get_l1_metadata import ReqGetL1Metadata from lighter.models.req_get_l1_tx import ReqGetL1Tx from lighter.models.req_get_latest_deposit import ReqGetLatestDeposit +from lighter.models.req_get_leases import ReqGetLeases from lighter.models.req_get_liquidation_infos import ReqGetLiquidationInfos from lighter.models.req_get_next_nonce import ReqGetNextNonce from lighter.models.req_get_order_book_details import ReqGetOrderBookDetails @@ -135,6 +147,7 @@ from lighter.models.req_get_order_books import ReqGetOrderBooks from lighter.models.req_get_position_funding import ReqGetPositionFunding from lighter.models.req_get_public_pools_metadata import ReqGetPublicPoolsMetadata +from lighter.models.req_get_push_notif_settings import ReqGetPushNotifSettings from lighter.models.req_get_range_with_cursor import ReqGetRangeWithCursor from lighter.models.req_get_range_with_index import ReqGetRangeWithIndex from lighter.models.req_get_range_with_index_sortable import ReqGetRangeWithIndexSortable @@ -143,13 +156,19 @@ 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_user_referrals import ReqGetUserReferrals 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_exchange_metrics import RespGetExchangeMetrics +from lighter.models.resp_get_execute_stats import RespGetExecuteStats 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_get_lease_options import RespGetLeaseOptions +from lighter.models.resp_get_leases import RespGetLeases +from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings 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 @@ -161,10 +180,14 @@ from lighter.models.risk_parameters import RiskParameters from lighter.models.share_price import SharePrice from lighter.models.simple_order import SimpleOrder +from lighter.models.slippage_result import SlippageResult +from lighter.models.spot_avg_entry_price import SpotAvgEntryPrice from lighter.models.spot_market_stats import SpotMarketStats from lighter.models.spot_order_book_detail import SpotOrderBookDetail from lighter.models.status import Status +from lighter.models.strategy import Strategy from lighter.models.sub_accounts import SubAccounts +from lighter.models.system_config import SystemConfig from lighter.models.ticker import Ticker from lighter.models.trade import Trade from lighter.models.trades import Trades @@ -173,6 +196,7 @@ from lighter.models.transfer_history_item import TransferHistoryItem from lighter.models.tx_hash import TxHash from lighter.models.tx_hashes import TxHashes +from lighter.models.user_referrals import UserReferrals 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 6e2b365..112ca77 100644 --- a/lighter/api/__init__.py +++ b/lighter/api/__init__.py @@ -9,6 +9,8 @@ from lighter.api.info_api import InfoApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi +from lighter.api.pushnotif_api import PushnotifApi +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 2a689ff..4981fa5 100644 --- a/lighter/api/account_api.py +++ b/lighter/api/account_api.py @@ -29,11 +29,14 @@ 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_get_lease_options import RespGetLeaseOptions +from lighter.models.resp_get_leases import RespGetLeases 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.models.tx_hash import TxHash from lighter.api_client import ApiClient, RequestSerialized from lighter.api_response import ApiResponse @@ -2355,6 +2358,577 @@ def _l1_metadata_serialize( + async def lease_options( + 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, + ) -> RespGetLeaseOptions: + """leaseOptions + + Get lease options + + :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._lease_options_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetLeaseOptions", + '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 lease_options_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[RespGetLeaseOptions]: + """leaseOptions + + Get lease options + + :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._lease_options_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetLeaseOptions", + '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 lease_options_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: + """leaseOptions + + Get lease options + + :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._lease_options_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetLeaseOptions", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _lease_options_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/leaseOptions', + 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 leases( + 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, + cursor: Optional[StrictStr] = None, + limit: 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, + ) -> RespGetLeases: + """leases + + Get leases + + :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 cursor: + :type cursor: str + :param limit: + :type limit: 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._leases_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetLeases", + '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 leases_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, + cursor: Optional[StrictStr] = None, + limit: 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[RespGetLeases]: + """leases + + Get leases + + :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 cursor: + :type cursor: str + :param limit: + :type limit: 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._leases_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetLeases", + '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 leases_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, + cursor: Optional[StrictStr] = None, + limit: 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: + """leases + + Get leases + + :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 cursor: + :type cursor: str + :param limit: + :type limit: 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._leases_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetLeases", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _leases_serialize( + self, + account_index, + authorization, + auth, + cursor, + limit, + _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)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + 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/leases', + 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 liquidations( self, account_index: StrictInt, @@ -2700,6 +3274,322 @@ def _liquidations_serialize( + async def lit_lease( + self, + tx_info: StrictStr, + lease_amount: StrictStr, + duration_days: 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, + ) -> TxHash: + """litLease + + Submit LIT lease transfer + + :param tx_info: (required) + :type tx_info: str + :param lease_amount: (required) + :type lease_amount: str + :param duration_days: (required) + :type duration_days: 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._lit_lease_serialize( + tx_info=tx_info, + lease_amount=lease_amount, + duration_days=duration_days, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TxHash", + '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 lit_lease_with_http_info( + self, + tx_info: StrictStr, + lease_amount: StrictStr, + duration_days: 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[TxHash]: + """litLease + + Submit LIT lease transfer + + :param tx_info: (required) + :type tx_info: str + :param lease_amount: (required) + :type lease_amount: str + :param duration_days: (required) + :type duration_days: 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._lit_lease_serialize( + tx_info=tx_info, + lease_amount=lease_amount, + duration_days=duration_days, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TxHash", + '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 lit_lease_without_preload_content( + self, + tx_info: StrictStr, + lease_amount: StrictStr, + duration_days: 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: + """litLease + + Submit LIT lease transfer + + :param tx_info: (required) + :type tx_info: str + :param lease_amount: (required) + :type lease_amount: str + :param duration_days: (required) + :type duration_days: 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._lit_lease_serialize( + tx_info=tx_info, + lease_amount=lease_amount, + duration_days=duration_days, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TxHash", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _lit_lease_serialize( + self, + tx_info, + lease_amount, + duration_days, + 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 tx_info is not None: + _form_params.append(('tx_info', tx_info)) + if lease_amount is not None: + _form_params.append(('lease_amount', lease_amount)) + if duration_days is not None: + _form_params.append(('duration_days', duration_days)) + # 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/litLease', + 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 pnl( self, by: StrictStr, diff --git a/lighter/api/info_api.py b/lighter/api/info_api.py index 0c30f3c..e2d501c 100644 --- a/lighter/api/info_api.py +++ b/lighter/api/info_api.py @@ -20,6 +20,7 @@ from typing import Optional from typing_extensions import Annotated from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay +from lighter.models.system_config import SystemConfig from lighter.models.transfer_fee_info import TransferFeeInfo from lighter.api_client import ApiClient, RequestSerialized @@ -40,6 +41,249 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + async def system_config( + 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, + ) -> SystemConfig: + """systemConfig + + Get system configuration including pool indexes and lockup/cooldown periods + + :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._system_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SystemConfig", + '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 system_config_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[SystemConfig]: + """systemConfig + + Get system configuration including pool indexes and lockup/cooldown periods + + :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._system_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SystemConfig", + '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 system_config_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: + """systemConfig + + Get system configuration including pool indexes and lockup/cooldown periods + + :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._system_config_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SystemConfig", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _system_config_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/systemConfig', + 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 transfer_fee_info( self, account_index: StrictInt, diff --git a/lighter/api/order_api.py b/lighter/api/order_api.py index 5ad21b2..45358f6 100644 --- a/lighter/api/order_api.py +++ b/lighter/api/order_api.py @@ -26,6 +26,8 @@ from lighter.models.order_book_orders import OrderBookOrders from lighter.models.order_books import OrderBooks from lighter.models.orders import Orders +from lighter.models.resp_get_exchange_metrics import RespGetExchangeMetrics +from lighter.models.resp_get_execute_stats import RespGetExecuteStats from lighter.models.trades import Trades from lighter.api_client import ApiClient, RequestSerialized @@ -996,6 +998,317 @@ def _asset_details_serialize( + async def exchange_metrics( + self, + period: StrictStr, + kind: StrictStr, + filter: Optional[StrictStr] = None, + value: 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, + ) -> RespGetExchangeMetrics: + """exchangeMetrics + + Get exchange metrics + + :param period: (required) + :type period: str + :param kind: (required) + :type kind: str + :param filter: + :type filter: str + :param value: + :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._exchange_metrics_serialize( + period=period, + kind=kind, + filter=filter, + value=value, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetExchangeMetrics", + '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 exchange_metrics_with_http_info( + self, + period: StrictStr, + kind: StrictStr, + filter: Optional[StrictStr] = None, + value: 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[RespGetExchangeMetrics]: + """exchangeMetrics + + Get exchange metrics + + :param period: (required) + :type period: str + :param kind: (required) + :type kind: str + :param filter: + :type filter: str + :param value: + :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._exchange_metrics_serialize( + period=period, + kind=kind, + filter=filter, + value=value, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetExchangeMetrics", + '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 exchange_metrics_without_preload_content( + self, + period: StrictStr, + kind: StrictStr, + filter: Optional[StrictStr] = None, + value: 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: + """exchangeMetrics + + Get exchange metrics + + :param period: (required) + :type period: str + :param kind: (required) + :type kind: str + :param filter: + :type filter: str + :param value: + :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._exchange_metrics_serialize( + period=period, + kind=kind, + filter=filter, + value=value, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetExchangeMetrics", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _exchange_metrics_serialize( + self, + period, + kind, + filter, + 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 period is not None: + + _query_params.append(('period', period)) + + if kind is not None: + + _query_params.append(('kind', kind)) + + if filter is not None: + + _query_params.append(('filter', filter)) + + 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/exchangeMetrics', + 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 exchange_stats( self, _request_timeout: Union[ @@ -1239,6 +1552,266 @@ def _exchange_stats_serialize( + async def execute_stats( + self, + period: 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, + ) -> RespGetExecuteStats: + """executeStats + + Get execute stats + + :param period: (required) + :type period: 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._execute_stats_serialize( + period=period, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetExecuteStats", + '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 execute_stats_with_http_info( + self, + period: 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[RespGetExecuteStats]: + """executeStats + + Get execute stats + + :param period: (required) + :type period: 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._execute_stats_serialize( + period=period, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetExecuteStats", + '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 execute_stats_without_preload_content( + self, + period: 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: + """executeStats + + Get execute stats + + :param period: (required) + :type period: 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._execute_stats_serialize( + period=period, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetExecuteStats", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _execute_stats_serialize( + self, + period, + _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 period is not None: + + _query_params.append(('period', period)) + + # 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/executeStats', + 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 export( self, type: StrictStr, @@ -1246,6 +1819,11 @@ async def export( auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, account_index: Optional[StrictInt] = None, market_id: Optional[StrictInt] = None, + start_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None, + end_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None, + side: Optional[StrictStr] = None, + role: Optional[StrictStr] = None, + trade_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1273,6 +1851,16 @@ async def export( :type account_index: int :param market_id: :type market_id: int + :param start_timestamp: + :type start_timestamp: int + :param end_timestamp: + :type end_timestamp: int + :param side: + :type side: str + :param role: + :type role: str + :param trade_type: + :type trade_type: 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 @@ -1301,6 +1889,11 @@ async def export( auth=auth, account_index=account_index, market_id=market_id, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + side=side, + role=role, + trade_type=trade_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1329,6 +1922,11 @@ async def export_with_http_info( auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, account_index: Optional[StrictInt] = None, market_id: Optional[StrictInt] = None, + start_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None, + end_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None, + side: Optional[StrictStr] = None, + role: Optional[StrictStr] = None, + trade_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1356,6 +1954,16 @@ async def export_with_http_info( :type account_index: int :param market_id: :type market_id: int + :param start_timestamp: + :type start_timestamp: int + :param end_timestamp: + :type end_timestamp: int + :param side: + :type side: str + :param role: + :type role: str + :param trade_type: + :type trade_type: 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 @@ -1384,6 +1992,11 @@ async def export_with_http_info( auth=auth, account_index=account_index, market_id=market_id, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + side=side, + role=role, + trade_type=trade_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1412,6 +2025,11 @@ async def export_without_preload_content( auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, account_index: Optional[StrictInt] = None, market_id: Optional[StrictInt] = None, + start_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None, + end_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None, + side: Optional[StrictStr] = None, + role: Optional[StrictStr] = None, + trade_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1439,6 +2057,16 @@ async def export_without_preload_content( :type account_index: int :param market_id: :type market_id: int + :param start_timestamp: + :type start_timestamp: int + :param end_timestamp: + :type end_timestamp: int + :param side: + :type side: str + :param role: + :type role: str + :param trade_type: + :type trade_type: 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 @@ -1467,6 +2095,11 @@ async def export_without_preload_content( auth=auth, account_index=account_index, market_id=market_id, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + side=side, + role=role, + trade_type=trade_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1491,6 +2124,11 @@ def _export_serialize( auth, account_index, market_id, + start_timestamp, + end_timestamp, + side, + role, + trade_type, _request_auth, _content_type, _headers, @@ -1531,6 +2169,26 @@ def _export_serialize( _query_params.append(('type', type)) + if start_timestamp is not None: + + _query_params.append(('start_timestamp', start_timestamp)) + + if end_timestamp is not None: + + _query_params.append(('end_timestamp', end_timestamp)) + + if side is not None: + + _query_params.append(('side', side)) + + if role is not None: + + _query_params.append(('role', role)) + + if trade_type is not None: + + _query_params.append(('trade_type', trade_type)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/lighter/api/pushnotif_api.py b/lighter/api/pushnotif_api.py new file mode 100644 index 0000000..3c0f4fd --- /dev/null +++ b/lighter/api/pushnotif_api.py @@ -0,0 +1,1299 @@ +# 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, StrictBool, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings +from lighter.models.result_code import ResultCode + +from lighter.api_client import ApiClient, RequestSerialized +from lighter.api_response import ApiResponse +from lighter.rest import RESTResponseType + + +class PushnotifApi: + """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 get_pushnotif_settings( + self, + account_index: StrictInt, + expo_token: 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, + ) -> RespGetPushNotifSettings: + """get_pushnotif_settings + + Get push notification settings + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: 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._get_pushnotif_settings_serialize( + account_index=account_index, + expo_token=expo_token, + 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': "RespGetPushNotifSettings", + '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 get_pushnotif_settings_with_http_info( + self, + account_index: StrictInt, + expo_token: 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[RespGetPushNotifSettings]: + """get_pushnotif_settings + + Get push notification settings + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: 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._get_pushnotif_settings_serialize( + account_index=account_index, + expo_token=expo_token, + 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': "RespGetPushNotifSettings", + '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 get_pushnotif_settings_without_preload_content( + self, + account_index: StrictInt, + expo_token: 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: + """get_pushnotif_settings + + Get push notification settings + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: 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._get_pushnotif_settings_serialize( + account_index=account_index, + expo_token=expo_token, + 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': "RespGetPushNotifSettings", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_pushnotif_settings_serialize( + self, + account_index, + expo_token, + 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)) + + if expo_token is not None: + + _query_params.append(('expo_token', expo_token)) + + # 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/pushnotif/settings', + 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 post_pushnotif_settings( + self, + account_index: StrictInt, + expo_token: StrictStr, + enabled: StrictBool, + 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: + """post_pushnotif_settings + + Update push notification settings + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: str + :param enabled: (required) + :type enabled: bool + :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._post_pushnotif_settings_serialize( + account_index=account_index, + expo_token=expo_token, + enabled=enabled, + 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 post_pushnotif_settings_with_http_info( + self, + account_index: StrictInt, + expo_token: StrictStr, + enabled: StrictBool, + 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]: + """post_pushnotif_settings + + Update push notification settings + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: str + :param enabled: (required) + :type enabled: bool + :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._post_pushnotif_settings_serialize( + account_index=account_index, + expo_token=expo_token, + enabled=enabled, + 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 post_pushnotif_settings_without_preload_content( + self, + account_index: StrictInt, + expo_token: StrictStr, + enabled: StrictBool, + 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: + """post_pushnotif_settings + + Update push notification settings + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: str + :param enabled: (required) + :type enabled: bool + :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._post_pushnotif_settings_serialize( + account_index=account_index, + expo_token=expo_token, + enabled=enabled, + 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 _post_pushnotif_settings_serialize( + self, + account_index, + expo_token, + enabled, + 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 + # 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 expo_token is not None: + _form_params.append(('expo_token', expo_token)) + if enabled is not None: + _form_params.append(('enabled', enabled)) + # 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/pushnotif/settings', + 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 pushnotif_register( + self, + account_index: StrictInt, + expo_token: StrictStr, + platform: StrictStr, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + app_version: 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, + ) -> ResultCode: + """pushnotif_register + + Register device for push notifications + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: str + :param platform: (required) + :type platform: str + :param auth: made optional to support header auth clients + :type auth: str + :param app_version: + :type app_version: 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._pushnotif_register_serialize( + account_index=account_index, + expo_token=expo_token, + platform=platform, + auth=auth, + app_version=app_version, + _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 pushnotif_register_with_http_info( + self, + account_index: StrictInt, + expo_token: StrictStr, + platform: StrictStr, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + app_version: 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[ResultCode]: + """pushnotif_register + + Register device for push notifications + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: str + :param platform: (required) + :type platform: str + :param auth: made optional to support header auth clients + :type auth: str + :param app_version: + :type app_version: 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._pushnotif_register_serialize( + account_index=account_index, + expo_token=expo_token, + platform=platform, + auth=auth, + app_version=app_version, + _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 pushnotif_register_without_preload_content( + self, + account_index: StrictInt, + expo_token: StrictStr, + platform: StrictStr, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + app_version: 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: + """pushnotif_register + + Register device for push notifications + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: str + :param platform: (required) + :type platform: str + :param auth: made optional to support header auth clients + :type auth: str + :param app_version: + :type app_version: 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._pushnotif_register_serialize( + account_index=account_index, + expo_token=expo_token, + platform=platform, + auth=auth, + app_version=app_version, + _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 _pushnotif_register_serialize( + self, + account_index, + expo_token, + platform, + auth, + app_version, + _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 + if auth is not None: + _form_params.append(('auth', auth)) + if account_index is not None: + _form_params.append(('account_index', account_index)) + if expo_token is not None: + _form_params.append(('expo_token', expo_token)) + if platform is not None: + _form_params.append(('platform', platform)) + if app_version is not None: + _form_params.append(('app_version', app_version)) + # 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/pushnotif/register', + 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 pushnotif_unregister( + self, + account_index: StrictInt, + expo_token: StrictStr, + 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: + """pushnotif_unregister + + Unregister device from push notifications + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: 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._pushnotif_unregister_serialize( + account_index=account_index, + expo_token=expo_token, + 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 pushnotif_unregister_with_http_info( + self, + account_index: StrictInt, + expo_token: StrictStr, + 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]: + """pushnotif_unregister + + Unregister device from push notifications + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: 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._pushnotif_unregister_serialize( + account_index=account_index, + expo_token=expo_token, + 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 pushnotif_unregister_without_preload_content( + self, + account_index: StrictInt, + expo_token: StrictStr, + 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: + """pushnotif_unregister + + Unregister device from push notifications + + :param account_index: (required) + :type account_index: int + :param expo_token: (required) + :type expo_token: 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._pushnotif_unregister_serialize( + account_index=account_index, + expo_token=expo_token, + 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 _pushnotif_unregister_serialize( + self, + account_index, + expo_token, + 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 + # 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 expo_token is not None: + _form_params.append(('expo_token', expo_token)) + # 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/pushnotif/unregister', + 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/referral_api.py b/lighter/api/referral_api.py new file mode 100644 index 0000000..353ed4c --- /dev/null +++ b/lighter/api/referral_api.py @@ -0,0 +1,347 @@ +# 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 StrictStr +from typing import Optional +from lighter.models.user_referrals import UserReferrals + +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_user_referrals( + self, + l1_address: StrictStr, + authorization: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, + cursor: 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, + ) -> UserReferrals: + """referral_userReferrals + + Get user referrals + + :param l1_address: (required) + :type l1_address: str + :param authorization: + :type authorization: str + :param auth: + :type auth: str + :param cursor: + :type cursor: 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_user_referrals_serialize( + l1_address=l1_address, + authorization=authorization, + auth=auth, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserReferrals", + '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_user_referrals_with_http_info( + self, + l1_address: StrictStr, + authorization: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, + cursor: 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[UserReferrals]: + """referral_userReferrals + + Get user referrals + + :param l1_address: (required) + :type l1_address: str + :param authorization: + :type authorization: str + :param auth: + :type auth: str + :param cursor: + :type cursor: 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_user_referrals_serialize( + l1_address=l1_address, + authorization=authorization, + auth=auth, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserReferrals", + '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_user_referrals_without_preload_content( + self, + l1_address: StrictStr, + authorization: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, + cursor: 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: + """referral_userReferrals + + Get user referrals + + :param l1_address: (required) + :type l1_address: str + :param authorization: + :type authorization: str + :param auth: + :type auth: str + :param cursor: + :type cursor: 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_user_referrals_serialize( + l1_address=l1_address, + authorization=authorization, + auth=auth, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserReferrals", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _referral_user_referrals_serialize( + self, + l1_address, + authorization, + auth, + cursor, + _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 l1_address is not None: + + _query_params.append(('l1_address', l1_address)) + + 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 + + + # 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/userReferrals', + 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/transaction_api.py b/lighter/api/transaction_api.py index 240f3c8..fb5df75 100644 --- a/lighter/api/transaction_api.py +++ b/lighter/api/transaction_api.py @@ -1260,6 +1260,7 @@ async def transfer_history( 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, cursor: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1285,6 +1286,8 @@ async def transfer_history( :type auth: str :param cursor: :type cursor: str + :param type: + :type type: 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 @@ -1312,6 +1315,7 @@ async def transfer_history( authorization=authorization, auth=auth, cursor=cursor, + type=type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1339,6 +1343,7 @@ async def transfer_history_with_http_info( 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, cursor: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1364,6 +1369,8 @@ async def transfer_history_with_http_info( :type auth: str :param cursor: :type cursor: str + :param type: + :type type: 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 @@ -1391,6 +1398,7 @@ async def transfer_history_with_http_info( authorization=authorization, auth=auth, cursor=cursor, + type=type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1418,6 +1426,7 @@ async def transfer_history_without_preload_content( 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, cursor: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1443,6 +1452,8 @@ async def transfer_history_without_preload_content( :type auth: str :param cursor: :type cursor: str + :param type: + :type type: 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 @@ -1470,6 +1481,7 @@ async def transfer_history_without_preload_content( authorization=authorization, auth=auth, cursor=cursor, + type=type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1493,6 +1505,7 @@ def _transfer_history_serialize( authorization, auth, cursor, + type, _request_auth, _content_type, _headers, @@ -1529,6 +1542,10 @@ def _transfer_history_serialize( _query_params.append(('cursor', cursor)) + if type is not None: + + _query_params.append(('type', type)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index f54774b..1783c97 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -46,7 +46,9 @@ from lighter.models.detailed_accounts import DetailedAccounts from lighter.models.detailed_candlestick import DetailedCandlestick from lighter.models.enriched_tx import EnrichedTx +from lighter.models.exchange_metric import ExchangeMetric from lighter.models.exchange_stats import ExchangeStats +from lighter.models.execute_stat import ExecuteStat from lighter.models.export_data import ExportData from lighter.models.funding import Funding from lighter.models.funding_rate import FundingRate @@ -54,6 +56,8 @@ from lighter.models.fundings import Fundings from lighter.models.l1_metadata import L1Metadata from lighter.models.l1_provider_info import L1ProviderInfo +from lighter.models.lease_entry import LeaseEntry +from lighter.models.lease_option_entry import LeaseOptionEntry from lighter.models.liq_trade import LiqTrade from lighter.models.liquidation import Liquidation from lighter.models.liquidation_info import LiquidationInfo @@ -69,6 +73,7 @@ from lighter.models.order_book_stats import OrderBookStats from lighter.models.order_books import OrderBooks from lighter.models.orders import Orders +from lighter.models.pending_unlock import PendingUnlock from lighter.models.perps_market_stats import PerpsMarketStats from lighter.models.perps_order_book_detail import PerpsOrderBookDetail from lighter.models.pn_l_entry import PnLEntry @@ -78,6 +83,8 @@ 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.push_notif_delivery_result import PushNotifDeliveryResult +from lighter.models.referral import Referral from lighter.models.req_do_faucet import ReqDoFaucet from lighter.models.req_export_data import ReqExportData from lighter.models.req_get_account import ReqGetAccount @@ -97,11 +104,14 @@ from lighter.models.req_get_by_account import ReqGetByAccount from lighter.models.req_get_candles import ReqGetCandles from lighter.models.req_get_deposit_history import ReqGetDepositHistory +from lighter.models.req_get_exchange_metrics import ReqGetExchangeMetrics +from lighter.models.req_get_execute_stats import ReqGetExecuteStats from lighter.models.req_get_fast_withdraw_info import ReqGetFastWithdrawInfo from lighter.models.req_get_fundings import ReqGetFundings from lighter.models.req_get_l1_metadata import ReqGetL1Metadata from lighter.models.req_get_l1_tx import ReqGetL1Tx from lighter.models.req_get_latest_deposit import ReqGetLatestDeposit +from lighter.models.req_get_leases import ReqGetLeases from lighter.models.req_get_liquidation_infos import ReqGetLiquidationInfos from lighter.models.req_get_next_nonce import ReqGetNextNonce from lighter.models.req_get_order_book_details import ReqGetOrderBookDetails @@ -109,6 +119,7 @@ from lighter.models.req_get_order_books import ReqGetOrderBooks from lighter.models.req_get_position_funding import ReqGetPositionFunding from lighter.models.req_get_public_pools_metadata import ReqGetPublicPoolsMetadata +from lighter.models.req_get_push_notif_settings import ReqGetPushNotifSettings from lighter.models.req_get_range_with_cursor import ReqGetRangeWithCursor from lighter.models.req_get_range_with_index import ReqGetRangeWithIndex from lighter.models.req_get_range_with_index_sortable import ReqGetRangeWithIndexSortable @@ -117,13 +128,19 @@ 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_user_referrals import ReqGetUserReferrals 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_exchange_metrics import RespGetExchangeMetrics +from lighter.models.resp_get_execute_stats import RespGetExecuteStats 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_get_lease_options import RespGetLeaseOptions +from lighter.models.resp_get_leases import RespGetLeases +from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings 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 @@ -135,10 +152,14 @@ from lighter.models.risk_parameters import RiskParameters from lighter.models.share_price import SharePrice from lighter.models.simple_order import SimpleOrder +from lighter.models.slippage_result import SlippageResult +from lighter.models.spot_avg_entry_price import SpotAvgEntryPrice from lighter.models.spot_market_stats import SpotMarketStats from lighter.models.spot_order_book_detail import SpotOrderBookDetail from lighter.models.status import Status +from lighter.models.strategy import Strategy from lighter.models.sub_accounts import SubAccounts +from lighter.models.system_config import SystemConfig from lighter.models.ticker import Ticker from lighter.models.trade import Trade from lighter.models.trades import Trades @@ -147,6 +168,7 @@ from lighter.models.transfer_history_item import TransferHistoryItem from lighter.models.tx_hash import TxHash from lighter.models.tx_hashes import TxHashes +from lighter.models.user_referrals import UserReferrals 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/models/account.py b/lighter/models/account.py index d349e6f..78d42db 100644 --- a/lighter/models/account.py +++ b/lighter/models/account.py @@ -39,8 +39,9 @@ class Account(BaseModel): status: StrictInt collateral: StrictStr transaction_time: StrictInt + account_trading_mode: StrictInt additional_properties: Dict[str, Any] = {} - __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"] + __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_trading_mode"] model_config = ConfigDict( populate_by_name=True, @@ -112,7 +113,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "available_balance": obj.get("available_balance"), "status": obj.get("status"), "collateral": obj.get("collateral"), - "transaction_time": obj.get("transaction_time") + "transaction_time": obj.get("transaction_time"), + "account_trading_mode": obj.get("account_trading_mode") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_limits.py b/lighter/models/account_limits.py index 47598f5..6f5162c 100644 --- a/lighter/models/account_limits.py +++ b/lighter/models/account_limits.py @@ -32,8 +32,12 @@ class AccountLimits(BaseModel): max_llp_amount: StrictStr user_tier: StrictStr can_create_public_pool: StrictBool + current_maker_fee_tick: StrictInt + current_taker_fee_tick: StrictInt + leased_lit: StrictStr + effective_lit_stakes: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "max_llp_percentage", "max_llp_amount", "user_tier", "can_create_public_pool"] + __properties: ClassVar[List[str]] = ["code", "message", "max_llp_percentage", "max_llp_amount", "user_tier", "can_create_public_pool", "current_maker_fee_tick", "current_taker_fee_tick", "leased_lit", "effective_lit_stakes"] model_config = ConfigDict( populate_by_name=True, @@ -98,7 +102,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "max_llp_percentage": obj.get("max_llp_percentage"), "max_llp_amount": obj.get("max_llp_amount"), "user_tier": obj.get("user_tier"), - "can_create_public_pool": obj.get("can_create_public_pool") + "can_create_public_pool": obj.get("can_create_public_pool"), + "current_maker_fee_tick": obj.get("current_maker_fee_tick"), + "current_taker_fee_tick": obj.get("current_taker_fee_tick"), + "leased_lit": obj.get("leased_lit"), + "effective_lit_stakes": obj.get("effective_lit_stakes") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_metadata.py b/lighter/models/account_metadata.py index ee08b50..13a33b4 100644 --- a/lighter/models/account_metadata.py +++ b/lighter/models/account_metadata.py @@ -31,8 +31,9 @@ class AccountMetadata(BaseModel): description: StrictStr can_invite: StrictBool = Field(description=" Remove After FE uses L1 meta endpoint") referral_points_percentage: StrictStr = Field(description=" Remove After FE uses L1 meta endpoint") + created_at: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "name", "description", "can_invite", "referral_points_percentage"] + __properties: ClassVar[List[str]] = ["account_index", "name", "description", "can_invite", "referral_points_percentage", "created_at"] model_config = ConfigDict( populate_by_name=True, @@ -96,7 +97,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "description": obj.get("description"), "can_invite": obj.get("can_invite"), - "referral_points_percentage": obj.get("referral_points_percentage") + "referral_points_percentage": obj.get("referral_points_percentage"), + "created_at": obj.get("created_at") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_position.py b/lighter/models/account_position.py index 50021b6..1881645 100644 --- a/lighter/models/account_position.py +++ b/lighter/models/account_position.py @@ -42,8 +42,9 @@ class AccountPosition(BaseModel): total_funding_paid_out: Optional[StrictStr] = None margin_mode: StrictInt allocated_margin: StrictStr + total_discount: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "symbol", "initial_margin_fraction", "open_order_count", "pending_order_count", "position_tied_order_count", "sign", "position", "avg_entry_price", "position_value", "unrealized_pnl", "realized_pnl", "liquidation_price", "total_funding_paid_out", "margin_mode", "allocated_margin"] + __properties: ClassVar[List[str]] = ["market_id", "symbol", "initial_margin_fraction", "open_order_count", "pending_order_count", "position_tied_order_count", "sign", "position", "avg_entry_price", "position_value", "unrealized_pnl", "realized_pnl", "liquidation_price", "total_funding_paid_out", "margin_mode", "allocated_margin", "total_discount"] model_config = ConfigDict( populate_by_name=True, @@ -118,7 +119,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "liquidation_price": obj.get("liquidation_price"), "total_funding_paid_out": obj.get("total_funding_paid_out"), "margin_mode": obj.get("margin_mode"), - "allocated_margin": obj.get("allocated_margin") + "allocated_margin": obj.get("allocated_margin"), + "total_discount": obj.get("total_discount") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_stats.py b/lighter/models/account_stats.py index 6587f78..1dbc3a5 100644 --- a/lighter/models/account_stats.py +++ b/lighter/models/account_stats.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 lighter.models.account_margin_stats import AccountMarginStats from typing import Optional, Set @@ -33,10 +33,11 @@ class AccountStats(BaseModel): available_balance: StrictStr margin_usage: StrictStr buying_power: StrictStr + account_trading_mode: StrictInt cross_stats: AccountMarginStats total_stats: AccountMarginStats additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["collateral", "portfolio_value", "leverage", "available_balance", "margin_usage", "buying_power", "cross_stats", "total_stats"] + __properties: ClassVar[List[str]] = ["collateral", "portfolio_value", "leverage", "available_balance", "margin_usage", "buying_power", "account_trading_mode", "cross_stats", "total_stats"] model_config = ConfigDict( populate_by_name=True, @@ -108,6 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "available_balance": obj.get("available_balance"), "margin_usage": obj.get("margin_usage"), "buying_power": obj.get("buying_power"), + "account_trading_mode": obj.get("account_trading_mode"), "cross_stats": AccountMarginStats.from_dict(obj["cross_stats"]) if obj.get("cross_stats") is not None else None, "total_stats": AccountMarginStats.from_dict(obj["total_stats"]) if obj.get("total_stats") is not None else None }) diff --git a/lighter/models/detailed_account.py b/lighter/models/detailed_account.py index cbeff8a..12b730e 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from lighter.models.account_asset import AccountAsset from lighter.models.account_position import AccountPosition +from lighter.models.pending_unlock import PendingUnlock from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_share import PublicPoolShare from typing import Optional, Set @@ -43,19 +44,22 @@ class DetailedAccount(BaseModel): status: StrictInt collateral: StrictStr transaction_time: StrictInt + account_trading_mode: StrictInt account_index: StrictInt name: StrictStr description: StrictStr can_invite: StrictBool = Field(description=" Remove After FE uses L1 meta endpoint") referral_points_percentage: StrictStr = Field(description=" Remove After FE uses L1 meta endpoint") + created_at: StrictInt positions: List[AccountPosition] assets: List[AccountAsset] total_asset_value: StrictStr cross_asset_value: StrictStr pool_info: PublicPoolInfo shares: List[PublicPoolShare] + pending_unlocks: List[PendingUnlock] additional_properties: Dict[str, Any] = {} - __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"] + __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_trading_mode", "account_index", "name", "description", "can_invite", "referral_points_percentage", "created_at", "positions", "assets", "total_asset_value", "cross_asset_value", "pool_info", "shares", "pending_unlocks"] model_config = ConfigDict( populate_by_name=True, @@ -122,6 +126,13 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['shares'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in pending_unlocks (list) + _items = [] + if self.pending_unlocks: + for _item in self.pending_unlocks: + if _item: + _items.append(_item.to_dict()) + _dict['pending_unlocks'] = _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(): @@ -152,17 +163,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "status": obj.get("status"), "collateral": obj.get("collateral"), "transaction_time": obj.get("transaction_time"), + "account_trading_mode": obj.get("account_trading_mode"), "account_index": obj.get("account_index"), "name": obj.get("name"), "description": obj.get("description"), "can_invite": obj.get("can_invite"), "referral_points_percentage": obj.get("referral_points_percentage"), + "created_at": obj.get("created_at"), "positions": [AccountPosition.from_dict(_item) for _item in obj["positions"]] if obj.get("positions") is not None else None, "assets": [AccountAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None, "total_asset_value": obj.get("total_asset_value"), "cross_asset_value": obj.get("cross_asset_value"), "pool_info": PublicPoolInfo.from_dict(obj["pool_info"]) if obj.get("pool_info") is not None else None, - "shares": [PublicPoolShare.from_dict(_item) for _item in obj["shares"]] if obj.get("shares") is not None else None + "shares": [PublicPoolShare.from_dict(_item) for _item in obj["shares"]] if obj.get("shares") is not None else None, + "pending_unlocks": [PendingUnlock.from_dict(_item) for _item in obj["pending_unlocks"]] if obj.get("pending_unlocks") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/exchange_metric.py b/lighter/models/exchange_metric.py new file mode 100644 index 0000000..03817b5 --- /dev/null +++ b/lighter/models/exchange_metric.py @@ -0,0 +1,102 @@ +# 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 ExchangeMetric(BaseModel): + """ + ExchangeMetric + """ # noqa: E501 + timestamp: StrictInt + data: Union[StrictFloat, StrictInt] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["timestamp", "data"] + + 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 ExchangeMetric 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 ExchangeMetric from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "timestamp": obj.get("timestamp"), + "data": obj.get("data") + }) + # 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/execute_stat.py b/lighter/models/execute_stat.py new file mode 100644 index 0000000..71ef908 --- /dev/null +++ b/lighter/models/execute_stat.py @@ -0,0 +1,110 @@ +# 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 +from typing import Any, ClassVar, Dict, List +from lighter.models.slippage_result import SlippageResult +from typing import Optional, Set +from typing_extensions import Self + +class ExecuteStat(BaseModel): + """ + ExecuteStat + """ # noqa: E501 + timestamp: StrictInt + slippage: List[SlippageResult] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["timestamp", "slippage"] + + 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 ExecuteStat 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 slippage (list) + _items = [] + if self.slippage: + for _item in self.slippage: + if _item: + _items.append(_item.to_dict()) + _dict['slippage'] = _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 ExecuteStat from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "timestamp": obj.get("timestamp"), + "slippage": [SlippageResult.from_dict(_item) for _item in obj["slippage"]] if obj.get("slippage") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/lease_entry.py b/lighter/models/lease_entry.py new file mode 100644 index 0000000..e5a2ed5 --- /dev/null +++ b/lighter/models/lease_entry.py @@ -0,0 +1,121 @@ +# 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, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class LeaseEntry(BaseModel): + """ + LeaseEntry + """ # noqa: E501 + id: StrictInt + master_account_index: StrictInt + lease_amount: StrictInt + fee_amount: StrictInt + start: StrictInt + end: StrictInt + status: StrictStr + error: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "master_account_index", "lease_amount", "fee_amount", "start", "end", "status", "error"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['waiting_fee', 'leased', 'expired', 'canceled']): + raise ValueError("must be one of enum values ('waiting_fee', 'leased', 'expired', 'canceled')") + return value + + 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 LeaseEntry 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 LeaseEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "id": obj.get("id"), + "master_account_index": obj.get("master_account_index"), + "lease_amount": obj.get("lease_amount"), + "fee_amount": obj.get("fee_amount"), + "start": obj.get("start"), + "end": obj.get("end"), + "status": obj.get("status"), + "error": obj.get("error") + }) + # 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/lease_option_entry.py b/lighter/models/lease_option_entry.py new file mode 100644 index 0000000..4b481c7 --- /dev/null +++ b/lighter/models/lease_option_entry.py @@ -0,0 +1,102 @@ +# 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 LeaseOptionEntry(BaseModel): + """ + LeaseOptionEntry + """ # noqa: E501 + duration_days: StrictInt + annual_rate: Union[StrictFloat, StrictInt] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["duration_days", "annual_rate"] + + 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 LeaseOptionEntry 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 LeaseOptionEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "duration_days": obj.get("duration_days"), + "annual_rate": obj.get("annual_rate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/market_config.py b/lighter/models/market_config.py index d898dde..168ca30 100644 --- a/lighter/models/market_config.py +++ b/lighter/models/market_config.py @@ -31,8 +31,10 @@ class MarketConfig(BaseModel): liquidation_mode: StrictInt force_reduce_only: StrictBool trading_hours: StrictStr + funding_fee_discounts_enabled: StrictBool + hidden: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_margin_mode", "insurance_fund_account_index", "liquidation_mode", "force_reduce_only", "trading_hours"] + __properties: ClassVar[List[str]] = ["market_margin_mode", "insurance_fund_account_index", "liquidation_mode", "force_reduce_only", "trading_hours", "funding_fee_discounts_enabled", "hidden"] model_config = ConfigDict( populate_by_name=True, @@ -96,7 +98,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "insurance_fund_account_index": obj.get("insurance_fund_account_index"), "liquidation_mode": obj.get("liquidation_mode"), "force_reduce_only": obj.get("force_reduce_only"), - "trading_hours": obj.get("trading_hours") + "trading_hours": obj.get("trading_hours"), + "funding_fee_discounts_enabled": obj.get("funding_fee_discounts_enabled"), + "hidden": obj.get("hidden") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/pending_unlock.py b/lighter/models/pending_unlock.py new file mode 100644 index 0000000..f432c73 --- /dev/null +++ b/lighter/models/pending_unlock.py @@ -0,0 +1,104 @@ +# 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 typing import Optional, Set +from typing_extensions import Self + +class PendingUnlock(BaseModel): + """ + PendingUnlock + """ # noqa: E501 + unlock_timestamp: StrictInt + asset_index: StrictInt + amount: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["unlock_timestamp", "asset_index", "amount"] + + 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 PendingUnlock 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 PendingUnlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "unlock_timestamp": obj.get("unlock_timestamp"), + "asset_index": obj.get("asset_index"), + "amount": obj.get("amount") + }) + # 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/perps_order_book_detail.py b/lighter/models/perps_order_book_detail.py index 46f1c77..7dc4b62 100644 --- a/lighter/models/perps_order_book_detail.py +++ b/lighter/models/perps_order_book_detail.py @@ -59,8 +59,9 @@ class PerpsOrderBookDetail(BaseModel): open_interest: Union[StrictFloat, StrictInt] daily_chart: Dict[str, Union[StrictFloat, StrictInt]] market_config: MarketConfig + strategy_index: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "market_id", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "order_quote_limit", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "size_decimals", "price_decimals", "quote_multiplier", "default_initial_margin_fraction", "min_initial_margin_fraction", "maintenance_margin_fraction", "closeout_margin_fraction", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change", "open_interest", "daily_chart", "market_config"] + __properties: ClassVar[List[str]] = ["symbol", "market_id", "market_type", "base_asset_id", "quote_asset_id", "status", "taker_fee", "maker_fee", "liquidation_fee", "min_base_amount", "min_quote_amount", "order_quote_limit", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "size_decimals", "price_decimals", "quote_multiplier", "default_initial_margin_fraction", "min_initial_margin_fraction", "maintenance_margin_fraction", "closeout_margin_fraction", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change", "open_interest", "daily_chart", "market_config", "strategy_index"] @field_validator('market_type') def market_type_validate_enum(cls, value): @@ -168,7 +169,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "daily_price_change": obj.get("daily_price_change"), "open_interest": obj.get("open_interest"), "daily_chart": obj.get("daily_chart"), - "market_config": MarketConfig.from_dict(obj["market_config"]) if obj.get("market_config") is not None else None + "market_config": MarketConfig.from_dict(obj["market_config"]) if obj.get("market_config") is not None else None, + "strategy_index": obj.get("strategy_index") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/pn_l_entry.py b/lighter/models/pn_l_entry.py index 1b09378..b360dcb 100644 --- a/lighter/models/pn_l_entry.py +++ b/lighter/models/pn_l_entry.py @@ -36,9 +36,13 @@ class PnLEntry(BaseModel): pool_pnl: Union[StrictFloat, StrictInt] pool_inflow: Union[StrictFloat, StrictInt] pool_outflow: Union[StrictFloat, StrictInt] + staking_pnl: Union[StrictFloat, StrictInt] + staking_inflow: Union[StrictFloat, StrictInt] + staking_outflow: Union[StrictFloat, StrictInt] pool_total_shares: Union[StrictFloat, StrictInt] + staked_lit: Union[StrictFloat, StrictInt] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["timestamp", "trade_pnl", "trade_spot_pnl", "inflow", "outflow", "spot_outflow", "spot_inflow", "pool_pnl", "pool_inflow", "pool_outflow", "pool_total_shares"] + __properties: ClassVar[List[str]] = ["timestamp", "trade_pnl", "trade_spot_pnl", "inflow", "outflow", "spot_outflow", "spot_inflow", "pool_pnl", "pool_inflow", "pool_outflow", "staking_pnl", "staking_inflow", "staking_outflow", "pool_total_shares", "staked_lit"] model_config = ConfigDict( populate_by_name=True, @@ -108,7 +112,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "pool_pnl": obj.get("pool_pnl"), "pool_inflow": obj.get("pool_inflow"), "pool_outflow": obj.get("pool_outflow"), - "pool_total_shares": obj.get("pool_total_shares") + "staking_pnl": obj.get("staking_pnl"), + "staking_inflow": obj.get("staking_inflow"), + "staking_outflow": obj.get("staking_outflow"), + "pool_total_shares": obj.get("pool_total_shares"), + "staked_lit": obj.get("staked_lit") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/position_funding.py b/lighter/models/position_funding.py index 7fe8093..5eeb65b 100644 --- a/lighter/models/position_funding.py +++ b/lighter/models/position_funding.py @@ -33,8 +33,9 @@ class PositionFunding(BaseModel): rate: StrictStr position_size: StrictStr position_side: StrictStr + discount: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["timestamp", "market_id", "funding_id", "change", "rate", "position_size", "position_side"] + __properties: ClassVar[List[str]] = ["timestamp", "market_id", "funding_id", "change", "rate", "position_size", "position_side", "discount"] @field_validator('position_side') def position_side_validate_enum(cls, value): @@ -107,7 +108,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "change": obj.get("change"), "rate": obj.get("rate"), "position_size": obj.get("position_size"), - "position_side": obj.get("position_side") + "position_side": obj.get("position_side"), + "discount": obj.get("discount") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/public_pool_info.py b/lighter/models/public_pool_info.py index d0c1a0b..3e528fd 100644 --- a/lighter/models/public_pool_info.py +++ b/lighter/models/public_pool_info.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Union from lighter.models.daily_return import DailyReturn from lighter.models.share_price import SharePrice +from lighter.models.strategy import Strategy from typing import Optional, Set from typing_extensions import Self @@ -37,8 +38,9 @@ class PublicPoolInfo(BaseModel): sharpe_ratio: Union[StrictFloat, StrictInt] daily_returns: List[DailyReturn] share_prices: List[SharePrice] + strategies: List[Strategy] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "operator_fee", "min_operator_share_rate", "total_shares", "operator_shares", "annual_percentage_yield", "sharpe_ratio", "daily_returns", "share_prices"] + __properties: ClassVar[List[str]] = ["status", "operator_fee", "min_operator_share_rate", "total_shares", "operator_shares", "annual_percentage_yield", "sharpe_ratio", "daily_returns", "share_prices", "strategies"] model_config = ConfigDict( populate_by_name=True, @@ -95,6 +97,13 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['share_prices'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in strategies (list) + _items = [] + if self.strategies: + for _item in self.strategies: + if _item: + _items.append(_item.to_dict()) + _dict['strategies'] = _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(): @@ -120,7 +129,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "annual_percentage_yield": obj.get("annual_percentage_yield"), "sharpe_ratio": obj.get("sharpe_ratio"), "daily_returns": [DailyReturn.from_dict(_item) for _item in obj["daily_returns"]] if obj.get("daily_returns") is not None else None, - "share_prices": [SharePrice.from_dict(_item) for _item in obj["share_prices"]] if obj.get("share_prices") is not None else None + "share_prices": [SharePrice.from_dict(_item) for _item in obj["share_prices"]] if obj.get("share_prices") is not None else None, + "strategies": [Strategy.from_dict(_item) for _item in obj["strategies"]] if obj.get("strategies") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/public_pool_metadata.py b/lighter/models/public_pool_metadata.py index a489118..3c61207 100644 --- a/lighter/models/public_pool_metadata.py +++ b/lighter/models/public_pool_metadata.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union +from lighter.models.account_asset import AccountAsset from lighter.models.public_pool_share import PublicPoolShare from typing import Optional, Set from typing_extensions import Self @@ -40,10 +41,13 @@ class PublicPoolMetadata(BaseModel): status: StrictInt operator_fee: StrictStr total_asset_value: StrictStr + total_spot_value: StrictStr + total_perps_value: StrictStr total_shares: StrictInt account_share: Optional[PublicPoolShare] = None + assets: List[AccountAsset] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_index", "created_at", "master_account_index", "account_type", "name", "l1_address", "annual_percentage_yield", "sharpe_ratio", "status", "operator_fee", "total_asset_value", "total_shares", "account_share"] + __properties: ClassVar[List[str]] = ["code", "message", "account_index", "created_at", "master_account_index", "account_type", "name", "l1_address", "annual_percentage_yield", "sharpe_ratio", "status", "operator_fee", "total_asset_value", "total_spot_value", "total_perps_value", "total_shares", "account_share", "assets"] model_config = ConfigDict( populate_by_name=True, @@ -89,6 +93,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of account_share if self.account_share: _dict['account_share'] = self.account_share.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in assets (list) + _items = [] + if self.assets: + for _item in self.assets: + if _item: + _items.append(_item.to_dict()) + _dict['assets'] = _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(): @@ -119,8 +130,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "status": obj.get("status"), "operator_fee": obj.get("operator_fee"), "total_asset_value": obj.get("total_asset_value"), + "total_spot_value": obj.get("total_spot_value"), + "total_perps_value": obj.get("total_perps_value"), "total_shares": obj.get("total_shares"), - "account_share": PublicPoolShare.from_dict(obj["account_share"]) if obj.get("account_share") is not None else None + "account_share": PublicPoolShare.from_dict(obj["account_share"]) if obj.get("account_share") is not None else None, + "assets": [AccountAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/public_pool_share.py b/lighter/models/public_pool_share.py index 6e9b6b4..90e7203 100644 --- a/lighter/models/public_pool_share.py +++ b/lighter/models/public_pool_share.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 from typing import Optional, Set from typing_extensions import Self @@ -28,9 +28,11 @@ class PublicPoolShare(BaseModel): """ # noqa: E501 public_pool_index: StrictInt shares_amount: StrictInt - entry_usdc: StrictStr + entry_usdc: StrictStr = Field(description=" For public pools and insurance fund") + principal_amount: StrictStr + entry_timestamp: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["public_pool_index", "shares_amount", "entry_usdc"] + __properties: ClassVar[List[str]] = ["public_pool_index", "shares_amount", "entry_usdc", "principal_amount", "entry_timestamp"] model_config = ConfigDict( populate_by_name=True, @@ -92,7 +94,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "public_pool_index": obj.get("public_pool_index"), "shares_amount": obj.get("shares_amount"), - "entry_usdc": obj.get("entry_usdc") + "entry_usdc": obj.get("entry_usdc"), + "principal_amount": obj.get("principal_amount"), + "entry_timestamp": obj.get("entry_timestamp") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/push_notif_delivery_result.py b/lighter/models/push_notif_delivery_result.py new file mode 100644 index 0000000..5d757b0 --- /dev/null +++ b/lighter/models/push_notif_delivery_result.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class PushNotifDeliveryResult(BaseModel): + """ + PushNotifDeliveryResult + """ # noqa: E501 + expo_token: StrictStr + status: StrictStr + error: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["expo_token", "status", "error"] + + 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 PushNotifDeliveryResult 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 PushNotifDeliveryResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "expo_token": obj.get("expo_token"), + "status": obj.get("status"), + "error": obj.get("error") + }) + # 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/referral.py b/lighter/models/referral.py new file mode 100644 index 0000000..9d4393c --- /dev/null +++ b/lighter/models/referral.py @@ -0,0 +1,104 @@ +# 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 typing import Optional, Set +from typing_extensions import Self + +class Referral(BaseModel): + """ + Referral + """ # noqa: E501 + l1_address: StrictStr + referral_code: StrictStr + used_at: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["l1_address", "referral_code", "used_at"] + + 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 Referral 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 Referral from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "l1_address": obj.get("l1_address"), + "referral_code": obj.get("referral_code"), + "used_at": obj.get("used_at") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/req_export_data.py b/lighter/models/req_export_data.py index 96233de..f800a93 100644 --- a/lighter/models/req_export_data.py +++ b/lighter/models/req_export_data.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -30,8 +31,13 @@ class ReqExportData(BaseModel): account_index: Optional[StrictInt] = -1 market_id: Optional[StrictInt] = None type: StrictStr + start_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None + end_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None + side: Optional[StrictStr] = 'all' + role: Optional[StrictStr] = 'all' + trade_type: Optional[StrictStr] = 'all' additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "market_id", "type"] + __properties: ClassVar[List[str]] = ["auth", "account_index", "market_id", "type", "start_timestamp", "end_timestamp", "side", "role", "trade_type"] @field_validator('type') def type_validate_enum(cls, value): @@ -40,6 +46,36 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('funding', 'trade')") return value + @field_validator('side') + def side_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['all', 'long', 'short']): + raise ValueError("must be one of enum values ('all', 'long', 'short')") + return value + + @field_validator('role') + def role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['all', 'maker', 'taker']): + raise ValueError("must be one of enum values ('all', 'maker', 'taker')") + return value + + @field_validator('trade_type') + def trade_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['all', 'trade', 'liquidation', 'deleverage', 'market-settlement']): + raise ValueError("must be one of enum values ('all', 'trade', 'liquidation', 'deleverage', 'market-settlement')") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -101,7 +137,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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"), - "type": obj.get("type") + "type": obj.get("type"), + "start_timestamp": obj.get("start_timestamp"), + "end_timestamp": obj.get("end_timestamp"), + "side": obj.get("side") if obj.get("side") is not None else 'all', + "role": obj.get("role") if obj.get("role") is not None else 'all', + "trade_type": obj.get("trade_type") if obj.get("trade_type") is not None else 'all' }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_get_exchange_metrics.py b/lighter/models/req_get_exchange_metrics.py new file mode 100644 index 0000000..6089da1 --- /dev/null +++ b/lighter/models/req_get_exchange_metrics.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReqGetExchangeMetrics(BaseModel): + """ + ReqGetExchangeMetrics + """ # noqa: E501 + period: StrictStr + kind: StrictStr + filter: Optional[StrictStr] = None + value: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["period", "kind", "filter", "value"] + + @field_validator('period') + def period_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['h', 'd', 'w', 'm', 'q', 'y', 'all']): + raise ValueError("must be one of enum values ('h', 'd', 'w', 'm', 'q', 'y', 'all')") + return value + + @field_validator('kind') + def kind_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['volume', 'maker_fee', 'taker_fee', 'liquidation_fee', 'trade_count', 'liquidation_count', 'liquidation_volume', 'inflow', 'outflow', 'transfer_fee', 'withdraw_fee', 'open_interest', 'account_count', 'active_account_count', 'tps']): + raise ValueError("must be one of enum values ('volume', 'maker_fee', 'taker_fee', 'liquidation_fee', 'trade_count', 'liquidation_count', 'liquidation_volume', 'inflow', 'outflow', 'transfer_fee', 'withdraw_fee', 'open_interest', 'account_count', 'active_account_count', 'tps')") + return value + + @field_validator('filter') + def filter_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['byMarket']): + raise ValueError("must be one of enum values ('byMarket')") + return value + + 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 ReqGetExchangeMetrics 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 ReqGetExchangeMetrics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "period": obj.get("period"), + "kind": obj.get("kind"), + "filter": obj.get("filter"), + "value": obj.get("value") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/req_get_execute_stats.py b/lighter/models/req_get_execute_stats.py new file mode 100644 index 0000000..266d02a --- /dev/null +++ b/lighter/models/req_get_execute_stats.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ReqGetExecuteStats(BaseModel): + """ + ReqGetExecuteStats + """ # noqa: E501 + period: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["period"] + + @field_validator('period') + def period_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['d', 'w', 'm', 'q', 'y', 'all']): + raise ValueError("must be one of enum values ('d', 'w', 'm', 'q', 'y', 'all')") + return value + + 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 ReqGetExecuteStats 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 ReqGetExecuteStats from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "period": obj.get("period") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/req_get_leases.py b/lighter/models/req_get_leases.py new file mode 100644 index 0000000..37c02d0 --- /dev/null +++ b/lighter/models/req_get_leases.py @@ -0,0 +1,106 @@ +# 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReqGetLeases(BaseModel): + """ + ReqGetLeases + """ # noqa: E501 + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") + account_index: StrictInt + cursor: Optional[StrictStr] = None + limit: Optional[StrictInt] = 20 + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["auth", "account_index", "cursor", "limit"] + + 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 ReqGetLeases 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 ReqGetLeases from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "auth": obj.get("auth"), + "account_index": obj.get("account_index"), + "cursor": obj.get("cursor"), + "limit": obj.get("limit") if obj.get("limit") is not None else 20 + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/req_get_public_pools_metadata.py b/lighter/models/req_get_public_pools_metadata.py index 9415178..4c05fa4 100644 --- a/lighter/models/req_get_public_pools_metadata.py +++ b/lighter/models/req_get_public_pools_metadata.py @@ -41,8 +41,8 @@ def filter_validate_enum(cls, value): if value is None: return value - if value not in set(['all', 'user', 'protocol', 'account_index']): - raise ValueError("must be one of enum values ('all', 'user', 'protocol', 'account_index')") + if value not in set(['all', 'user', 'protocol', 'account_index', 'stake']): + raise ValueError("must be one of enum values ('all', 'user', 'protocol', 'account_index', 'stake')") return value model_config = ConfigDict( diff --git a/lighter/models/req_get_push_notif_settings.py b/lighter/models/req_get_push_notif_settings.py new file mode 100644 index 0000000..3795d7d --- /dev/null +++ b/lighter/models/req_get_push_notif_settings.py @@ -0,0 +1,104 @@ +# 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReqGetPushNotifSettings(BaseModel): + """ + ReqGetPushNotifSettings + """ # noqa: E501 + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") + account_index: StrictInt + expo_token: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["auth", "account_index", "expo_token"] + + 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 ReqGetPushNotifSettings 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 ReqGetPushNotifSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "auth": obj.get("auth"), + "account_index": obj.get("account_index"), + "expo_token": obj.get("expo_token") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/req_get_transfer_history.py b/lighter/models/req_get_transfer_history.py index 906242f..d128bd4 100644 --- a/lighter/models/req_get_transfer_history.py +++ b/lighter/models/req_get_transfer_history.py @@ -29,8 +29,9 @@ class ReqGetTransferHistory(BaseModel): auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") account_index: StrictInt cursor: Optional[StrictStr] = None + type: Optional[List[StrictStr]] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "cursor"] + __properties: ClassVar[List[str]] = ["auth", "account_index", "cursor", "type"] model_config = ConfigDict( populate_by_name=True, @@ -92,7 +93,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "auth": obj.get("auth"), "account_index": obj.get("account_index"), - "cursor": obj.get("cursor") + "cursor": obj.get("cursor"), + "type": obj.get("type") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_get_user_referrals.py b/lighter/models/req_get_user_referrals.py new file mode 100644 index 0000000..4149ffd --- /dev/null +++ b/lighter/models/req_get_user_referrals.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReqGetUserReferrals(BaseModel): + """ + ReqGetUserReferrals + """ # noqa: E501 + auth: Optional[StrictStr] = None + l1_address: StrictStr + cursor: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["auth", "l1_address", "cursor"] + + 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 ReqGetUserReferrals 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 ReqGetUserReferrals from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "auth": obj.get("auth"), + "l1_address": obj.get("l1_address"), + "cursor": obj.get("cursor") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_get_exchange_metrics.py b/lighter/models/resp_get_exchange_metrics.py new file mode 100644 index 0000000..dd65001 --- /dev/null +++ b/lighter/models/resp_get_exchange_metrics.py @@ -0,0 +1,112 @@ +# 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, Optional +from lighter.models.exchange_metric import ExchangeMetric +from typing import Optional, Set +from typing_extensions import Self + +class RespGetExchangeMetrics(BaseModel): + """ + RespGetExchangeMetrics + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + metrics: List[ExchangeMetric] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "metrics"] + + 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 RespGetExchangeMetrics 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 metrics (list) + _items = [] + if self.metrics: + for _item in self.metrics: + if _item: + _items.append(_item.to_dict()) + _dict['metrics'] = _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 RespGetExchangeMetrics 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"), + "metrics": [ExchangeMetric.from_dict(_item) for _item in obj["metrics"]] if obj.get("metrics") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_get_execute_stats.py b/lighter/models/resp_get_execute_stats.py new file mode 100644 index 0000000..8b36038 --- /dev/null +++ b/lighter/models/resp_get_execute_stats.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from lighter.models.execute_stat import ExecuteStat +from typing import Optional, Set +from typing_extensions import Self + +class RespGetExecuteStats(BaseModel): + """ + RespGetExecuteStats + """ # noqa: E501 + period: StrictStr + result: List[ExecuteStat] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["period", "result"] + + @field_validator('period') + def period_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['d', 'w', 'm', 'q', 'y', 'all']): + raise ValueError("must be one of enum values ('d', 'w', 'm', 'q', 'y', 'all')") + return value + + 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 RespGetExecuteStats 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 result (list) + _items = [] + if self.result: + for _item in self.result: + if _item: + _items.append(_item.to_dict()) + _dict['result'] = _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 RespGetExecuteStats from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "period": obj.get("period"), + "result": [ExecuteStat.from_dict(_item) for _item in obj["result"]] if obj.get("result") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_get_lease_options.py b/lighter/models/resp_get_lease_options.py new file mode 100644 index 0000000..cc153ca --- /dev/null +++ b/lighter/models/resp_get_lease_options.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.lease_option_entry import LeaseOptionEntry +from typing import Optional, Set +from typing_extensions import Self + +class RespGetLeaseOptions(BaseModel): + """ + RespGetLeaseOptions + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + options: List[LeaseOptionEntry] + lit_incentives_account_index: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "options", "lit_incentives_account_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 RespGetLeaseOptions 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 options (list) + _items = [] + if self.options: + for _item in self.options: + if _item: + _items.append(_item.to_dict()) + _dict['options'] = _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 RespGetLeaseOptions 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"), + "options": [LeaseOptionEntry.from_dict(_item) for _item in obj["options"]] if obj.get("options") is not None else None, + "lit_incentives_account_index": obj.get("lit_incentives_account_index") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_get_leases.py b/lighter/models/resp_get_leases.py new file mode 100644 index 0000000..bfd03db --- /dev/null +++ b/lighter/models/resp_get_leases.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.lease_entry import LeaseEntry +from typing import Optional, Set +from typing_extensions import Self + +class RespGetLeases(BaseModel): + """ + RespGetLeases + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + leases: List[LeaseEntry] + next_cursor: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "leases", "next_cursor"] + + 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 RespGetLeases 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 leases (list) + _items = [] + if self.leases: + for _item in self.leases: + if _item: + _items.append(_item.to_dict()) + _dict['leases'] = _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 RespGetLeases 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"), + "leases": [LeaseEntry.from_dict(_item) for _item in obj["leases"]] if obj.get("leases") is not None else None, + "next_cursor": obj.get("next_cursor") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_get_push_notif_settings.py b/lighter/models/resp_get_push_notif_settings.py new file mode 100644 index 0000000..c839303 --- /dev/null +++ b/lighter/models/resp_get_push_notif_settings.py @@ -0,0 +1,106 @@ +# 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 RespGetPushNotifSettings(BaseModel): + """ + RespGetPushNotifSettings + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + account_index: StrictInt + enabled: StrictBool + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "account_index", "enabled"] + + 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 RespGetPushNotifSettings 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 RespGetPushNotifSettings 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"), + "account_index": obj.get("account_index"), + "enabled": obj.get("enabled") + }) + # 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/slippage_result.py b/lighter/models/slippage_result.py new file mode 100644 index 0000000..3840821 --- /dev/null +++ b/lighter/models/slippage_result.py @@ -0,0 +1,108 @@ +# 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, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class SlippageResult(BaseModel): + """ + SlippageResult + """ # noqa: E501 + exchange: StrictStr + market: StrictStr + size_usd: StrictInt + avg_slippage: Union[StrictFloat, StrictInt] + data_count: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["exchange", "market", "size_usd", "avg_slippage", "data_count"] + + 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 SlippageResult 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 SlippageResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "exchange": obj.get("exchange"), + "market": obj.get("market"), + "size_usd": obj.get("size_usd"), + "avg_slippage": obj.get("avg_slippage"), + "data_count": obj.get("data_count") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/spot_avg_entry_price.py b/lighter/models/spot_avg_entry_price.py new file mode 100644 index 0000000..3139afd --- /dev/null +++ b/lighter/models/spot_avg_entry_price.py @@ -0,0 +1,106 @@ +# 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 typing import Optional, Set +from typing_extensions import Self + +class SpotAvgEntryPrice(BaseModel): + """ + SpotAvgEntryPrice + """ # noqa: E501 + asset_id: StrictInt + avg_entry_price: StrictStr + asset_size: StrictStr + last_trade_id: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["asset_id", "avg_entry_price", "asset_size", "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 SpotAvgEntryPrice 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 SpotAvgEntryPrice from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "asset_id": obj.get("asset_id"), + "avg_entry_price": obj.get("avg_entry_price"), + "asset_size": obj.get("asset_size"), + "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/strategy.py b/lighter/models/strategy.py new file mode 100644 index 0000000..914cbfc --- /dev/null +++ b/lighter/models/strategy.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class Strategy(BaseModel): + """ + Strategy + """ # noqa: E501 + collateral: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["collateral"] + + 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 Strategy 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 Strategy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "collateral": obj.get("collateral") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/system_config.py b/lighter/models/system_config.py new file mode 100644 index 0000000..da288a6 --- /dev/null +++ b/lighter/models/system_config.py @@ -0,0 +1,112 @@ +# 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SystemConfig(BaseModel): + """ + SystemConfig + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + liquidity_pool_index: StrictInt + staking_pool_index: StrictInt + funding_fee_rebate_account_index: StrictInt + liquidity_pool_cooldown_period: StrictInt + staking_pool_lockup_period: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "liquidity_pool_index", "staking_pool_index", "funding_fee_rebate_account_index", "liquidity_pool_cooldown_period", "staking_pool_lockup_period"] + + 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 SystemConfig 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 SystemConfig 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"), + "liquidity_pool_index": obj.get("liquidity_pool_index"), + "staking_pool_index": obj.get("staking_pool_index"), + "funding_fee_rebate_account_index": obj.get("funding_fee_rebate_account_index"), + "liquidity_pool_cooldown_period": obj.get("liquidity_pool_cooldown_period"), + "staking_pool_lockup_period": obj.get("staking_pool_lockup_period") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/trade.py b/lighter/models/trade.py index be9c2ee..b9000c5 100644 --- a/lighter/models/trade.py +++ b/lighter/models/trade.py @@ -53,8 +53,10 @@ class Trade(BaseModel): maker_initial_margin_fraction_before: StrictInt maker_position_sign_changed: StrictBool transaction_time: StrictInt + ask_account_pnl: StrictStr + bid_account_pnl: StrictStr 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", "transaction_time"] + __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", "ask_account_pnl", "bid_account_pnl"] @field_validator('type') def type_validate_enum(cls, value): @@ -147,7 +149,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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"), - "transaction_time": obj.get("transaction_time") + "transaction_time": obj.get("transaction_time"), + "ask_account_pnl": obj.get("ask_account_pnl"), + "bid_account_pnl": obj.get("bid_account_pnl") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/transfer_history_item.py b/lighter/models/transfer_history_item.py index 717fa5c..0f5aa82 100644 --- a/lighter/models/transfer_history_item.py +++ b/lighter/models/transfer_history_item.py @@ -45,8 +45,8 @@ class TransferHistoryItem(BaseModel): @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['L2TransferInflow', 'L2TransferOutflow', 'L2BurnSharesInflow', 'L2BurnSharesOutflow', 'L2MintSharesInflow', 'L2MintSharesOutflow', 'L2SelfTransfer']): - raise ValueError("must be one of enum values ('L2TransferInflow', 'L2TransferOutflow', 'L2BurnSharesInflow', 'L2BurnSharesOutflow', 'L2MintSharesInflow', 'L2MintSharesOutflow', 'L2SelfTransfer')") + if value not in set(['L2TransferInflow', 'L2TransferOutflow', 'L2BurnSharesInflow', 'L2BurnSharesOutflow', 'L2MintSharesInflow', 'L2MintSharesOutflow', 'L2SelfTransfer', 'L2StakeAssetInflow', 'L2StakeAssetOutflow', 'L2UnstakeAssetInflow', 'L2UnstakeAssetOutflow', 'L2ForceBurnSharesInflow', 'L2ForceBurnSharesOutflow']): + raise ValueError("must be one of enum values ('L2TransferInflow', 'L2TransferOutflow', 'L2BurnSharesInflow', 'L2BurnSharesOutflow', 'L2MintSharesInflow', 'L2MintSharesOutflow', 'L2SelfTransfer', 'L2StakeAssetInflow', 'L2StakeAssetOutflow', 'L2UnstakeAssetInflow', 'L2UnstakeAssetOutflow', 'L2ForceBurnSharesInflow', 'L2ForceBurnSharesOutflow')") return value @field_validator('from_route') diff --git a/lighter/models/user_referrals.py b/lighter/models/user_referrals.py new file mode 100644 index 0000000..b1b113c --- /dev/null +++ b/lighter/models/user_referrals.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.referral import Referral +from typing import Optional, Set +from typing_extensions import Self + +class UserReferrals(BaseModel): + """ + UserReferrals + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + cursor: StrictStr + referrals: List[Referral] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "cursor", "referrals"] + + 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 UserReferrals 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 referrals (list) + _items = [] + if self.referrals: + for _item in self.referrals: + if _item: + _items.append(_item.to_dict()) + _dict['referrals'] = _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 UserReferrals 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"), + "cursor": obj.get("cursor"), + "referrals": [Referral.from_dict(_item) for _item in obj["referrals"]] if obj.get("referrals") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/openapi.json b/openapi.json index d42774f..6ef9dfd 100644 --- a/openapi.json +++ b/openapi.json @@ -748,6 +748,88 @@ "description": "Get deposit history" } }, + "/api/v1/exchangeMetrics": { + "get": { + "summary": "exchangeMetrics", + "operationId": "exchangeMetrics", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespGetExchangeMetrics" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "period", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "h", + "d", + "w", + "m", + "q", + "y", + "all" + ] + }, + { + "name": "kind", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "volume", + "maker_fee", + "taker_fee", + "liquidation_fee", + "trade_count", + "liquidation_count", + "liquidation_volume", + "inflow", + "outflow", + "transfer_fee", + "withdraw_fee", + "open_interest", + "account_count", + "active_account_count", + "tps" + ] + }, + { + "name": "filter", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "byMarket" + ] + }, + { + "name": "value", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "order" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Get exchange metrics" + } + }, "/api/v1/exchangeStats": { "get": { "summary": "exchangeStats", @@ -772,6 +854,49 @@ "description": "Get exchange stats" } }, + "/api/v1/executeStats": { + "get": { + "summary": "executeStats", + "operationId": "executeStats", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespGetExecuteStats" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "period", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "d", + "w", + "m", + "q", + "y", + "all" + ] + } + ], + "tags": [ + "order" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Get execute stats" + } + }, "/api/v1/export": { "get": { "summary": "export", @@ -830,6 +955,62 @@ "funding", "trade" ] + }, + { + "name": "start_timestamp", + "in": "query", + "required": false, + "type": "integer", + "format": "int64", + "minimum": 1735689600000, + "maximum": 1830297600000 + }, + { + "name": "end_timestamp", + "in": "query", + "required": false, + "type": "integer", + "format": "int64", + "minimum": 1735689600000, + "maximum": 1830297600000 + }, + { + "name": "side", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "all", + "long", + "short" + ], + "default": "all" + }, + { + "name": "role", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "all", + "maker", + "taker" + ], + "default": "all" + }, + { + "name": "trade_type", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "all", + "trade", + "liquidation", + "deleverage", + "market-settlement" + ], + "default": "all" } ], "tags": [ @@ -1146,6 +1327,94 @@ "description": "Get L1 metadata" } }, + "/api/v1/leaseOptions": { + "get": { + "summary": "leaseOptions", + "operationId": "leaseOptions", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespGetLeaseOptions" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "tags": [ + "account" + ], + "description": "Get lease options" + } + }, + "/api/v1/leases": { + "get": { + "summary": "leases", + "operationId": "leases", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespGetLeases" + } + }, + "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": "cursor", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "required": false, + "type": "integer", + "format": "int64", + "default": "20" + } + ], + "tags": [ + "account" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Get leases" + } + }, "/api/v1/liquidations": { "get": { "summary": "liquidations", @@ -1219,6 +1488,49 @@ "description": "Get liquidation infos" } }, + "/api/v1/litLease": { + "post": { + "summary": "litLease", + "operationId": "litLease", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/TxHash" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReqLITLease" + } + } + ], + "tags": [ + "account" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Submit LIT lease transfer" + } + }, "/api/v1/nextNonce": { "get": { "summary": "nextNonce", @@ -1647,7 +1959,251 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/RespPublicPoolsMetadata" + "$ref": "#/definitions/RespPublicPoolsMetadata" + } + }, + "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": "filter", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "all", + "user", + "protocol", + "account_index", + "stake" + ] + }, + { + "name": "index", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + }, + { + "name": "account_index", + "in": "query", + "required": false, + "type": "integer", + "format": "int64" + } + ], + "tags": [ + "account" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Get public pools metadata" + } + }, + "/api/v1/pushnotif/register": { + "post": { + "summary": "pushnotif_register", + "operationId": "pushnotif_register", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ResultCode" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReqRegisterPushNotifToken" + } + } + ], + "tags": [ + "pushnotif" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Register device for push notifications" + } + }, + "/api/v1/pushnotif/settings": { + "get": { + "summary": "get_pushnotif_settings", + "operationId": "get_pushnotif_settings", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespGetPushNotifSettings" + } + }, + "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": "expo_token", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": [ + "pushnotif" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Get push notification settings" + }, + "post": { + "summary": "post_pushnotif_settings", + "operationId": "post_pushnotif_settings", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ResultCode" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReqUpdatePushNotifSettings" + } + } + ], + "tags": [ + "pushnotif" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Update push notification settings" + } + }, + "/api/v1/pushnotif/unregister": { + "post": { + "summary": "pushnotif_unregister", + "operationId": "pushnotif_unregister", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ResultCode" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReqUnregisterPushNotifToken" + } + } + ], + "tags": [ + "pushnotif" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Unregister device from push notifications" + } + }, + "/api/v1/recentTrades": { + "get": { + "summary": "recentTrades", + "operationId": "recentTrades", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/Trades" } }, "400": { @@ -1659,37 +2215,11 @@ }, "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": "filter", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "all", - "user", - "protocol", - "account_index" - ] - }, - { - "name": "index", + "name": "market_id", "in": "query", "required": true, "type": "integer", - "format": "int64" + "format": "int16" }, { "name": "limit", @@ -1699,33 +2229,26 @@ "format": "int64", "minimum": 1, "maximum": 100 - }, - { - "name": "account_index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" } ], "tags": [ - "account" + "order" ], "consumes": [ "multipart/form-data" ], - "description": "Get public pools metadata" + "description": "Get recent trades" } }, - "/api/v1/recentTrades": { + "/api/v1/referral/userReferrals": { "get": { - "summary": "recentTrades", - "operationId": "recentTrades", + "summary": "referral_userReferrals", + "operationId": "referral_userReferrals", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/Trades" + "$ref": "#/definitions/UserReferrals" } }, "400": { @@ -1737,29 +2260,37 @@ }, "parameters": [ { - "name": "market_id", + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, + { + "name": "auth", "in": "query", - "required": true, - "type": "integer", - "format": "int16" + "required": false, + "type": "string" }, { - "name": "limit", + "name": "l1_address", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 + "type": "string" + }, + { + "name": "cursor", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "order" + "referral" ], "consumes": [ "multipart/form-data" ], - "description": "Get recent trades" + "description": "Get user referrals" } }, "/api/v1/sendTx": { @@ -1836,6 +2367,30 @@ "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/systemConfig": { + "get": { + "summary": "systemConfig", + "operationId": "systemConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/SystemConfig" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "tags": [ + "info" + ], + "description": "Get system configuration including pool indexes and lockup/cooldown periods" + } + }, "/api/v1/tokens": { "get": { "summary": "tokens", @@ -2162,6 +2717,20 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "type", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "all", + "L2Transfer", + "L2MintShares", + "L2BurnShares", + "L2StakeAssets", + "L2UnstakeAssets" + ] } ], "tags": [ @@ -2490,6 +3059,11 @@ "type": "integer", "format": "int64", "example": "1257894000000000" + }, + "account_trading_mode": { + "type": "integer", + "format": "uint8", + "example": "1" } }, "title": "Account", @@ -2505,7 +3079,8 @@ "available_balance", "status", "collateral", - "transaction_time" + "transaction_time", + "account_trading_mode" ] }, "AccountApiKeys": { @@ -2589,6 +3164,22 @@ "type": "boolean", "format": "boolean", "example": "true" + }, + "current_maker_fee_tick": { + "type": "integer", + "format": "int32", + "example": "0" + }, + "current_taker_fee_tick": { + "type": "integer", + "format": "int32", + "example": "0" + }, + "leased_lit": { + "type": "string" + }, + "effective_lit_stakes": { + "type": "string" } }, "title": "AccountLimits", @@ -2597,7 +3188,11 @@ "max_llp_percentage", "max_llp_amount", "user_tier", - "can_create_public_pool" + "can_create_public_pool", + "current_maker_fee_tick", + "current_taker_fee_tick", + "leased_lit", + "effective_lit_stakes" ] }, "AccountMarginStats": { @@ -2745,6 +3340,10 @@ "referral_points_percentage": { "type": "string", "description": " Remove After FE uses L1 meta endpoint" + }, + "created_at": { + "type": "integer", + "format": "int64" } }, "title": "AccountMetadata", @@ -2753,7 +3352,8 @@ "name", "description", "can_invite", - "referral_points_percentage" + "referral_points_percentage", + "created_at" ] }, "AccountMetadatas": { @@ -2881,6 +3481,10 @@ "allocated_margin": { "type": "string", "example": "46342" + }, + "total_discount": { + "type": "string", + "example": "34.2" } }, "title": "AccountPosition", @@ -2899,7 +3503,8 @@ "realized_pnl", "liquidation_price", "margin_mode", - "allocated_margin" + "allocated_margin", + "total_discount" ] }, "AccountStats": { @@ -2929,6 +3534,11 @@ "type": "string", "example": "199955" }, + "account_trading_mode": { + "type": "integer", + "format": "uint8", + "example": "1" + }, "cross_stats": { "$ref": "#/definitions/AccountMarginStats" }, @@ -2944,6 +3554,7 @@ "available_balance", "margin_usage", "buying_power", + "account_trading_mode", "cross_stats", "total_stats" ] @@ -3647,6 +4258,11 @@ "format": "int64", "example": "1257894000000000" }, + "account_trading_mode": { + "type": "integer", + "format": "uint8", + "example": "1" + }, "account_index": { "type": "integer", "format": "int64" @@ -3666,6 +4282,10 @@ "type": "string", "description": " Remove After FE uses L1 meta endpoint" }, + "created_at": { + "type": "integer", + "format": "int64" + }, "positions": { "type": "array", "items": { @@ -3694,6 +4314,12 @@ "items": { "$ref": "#/definitions/PublicPoolShare" } + }, + "pending_unlocks": { + "type": "array", + "items": { + "$ref": "#/definitions/PendingUnlock" + } } }, "title": "DetailedAccount", @@ -3710,17 +4336,20 @@ "status", "collateral", "transaction_time", + "account_trading_mode", "account_index", "name", "description", "can_invite", "referral_points_percentage", + "created_at", "positions", "assets", "total_asset_value", "cross_asset_value", "pool_info", - "shares" + "shares", + "pending_unlocks" ] }, "DetailedAccounts": { @@ -3967,6 +4596,26 @@ "verified_at" ] }, + "ExchangeMetric": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "data": { + "type": "number", + "format": "double", + "example": "93566.25" + } + }, + "title": "ExchangeMetric", + "required": [ + "timestamp", + "data" + ] + }, "ExchangeStats": { "type": "object", "properties": { @@ -4010,6 +4659,27 @@ "daily_trades_count" ] }, + "ExecuteStat": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "slippage": { + "type": "array", + "items": { + "$ref": "#/definitions/SlippageResult" + } + } + }, + "title": "ExecuteStat", + "required": [ + "timestamp", + "slippage" + ] + }, "ExportData": { "type": "object", "properties": { @@ -4192,6 +4862,76 @@ "latestBlockNumber" ] }, + "LeaseEntry": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "master_account_index": { + "type": "integer", + "format": "int64" + }, + "lease_amount": { + "type": "integer", + "format": "int64" + }, + "fee_amount": { + "type": "integer", + "format": "int64" + }, + "start": { + "type": "integer", + "format": "int64" + }, + "end": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string", + "enum": [ + "waiting_fee", + "leased", + "expired", + "canceled" + ] + }, + "error": { + "type": "string" + } + }, + "title": "LeaseEntry", + "required": [ + "id", + "master_account_index", + "lease_amount", + "fee_amount", + "start", + "end", + "status", + "error" + ] + }, + "LeaseOptionEntry": { + "type": "object", + "properties": { + "duration_days": { + "type": "integer", + "format": "int32" + }, + "annual_rate": { + "type": "number", + "format": "double" + } + }, + "title": "LeaseOptionEntry", + "required": [ + "duration_days", + "annual_rate" + ] + }, "LiqTrade": { "type": "object", "properties": { @@ -4339,6 +5079,14 @@ }, "trading_hours": { "type": "string" + }, + "funding_fee_discounts_enabled": { + "type": "boolean", + "format": "boolean" + }, + "hidden": { + "type": "boolean", + "format": "boolean" } }, "title": "MarketConfig", @@ -4347,7 +5095,9 @@ "insurance_fund_account_index", "liquidation_mode", "force_reduce_only", - "trading_hours" + "trading_hours", + "funding_fee_discounts_enabled", + "hidden" ] }, "NextNonce": { @@ -4948,17 +5698,42 @@ "next_cursor": { "type": "string" }, - "orders": { - "type": "array", - "items": { - "$ref": "#/definitions/Order" - } + "orders": { + "type": "array", + "items": { + "$ref": "#/definitions/Order" + } + } + }, + "title": "Orders", + "required": [ + "code", + "orders" + ] + }, + "PendingUnlock": { + "type": "object", + "properties": { + "unlock_timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "asset_index": { + "type": "integer", + "format": "int16", + "example": "1" + }, + "amount": { + "type": "string", + "example": "1" } }, - "title": "Orders", + "title": "PendingUnlock", "required": [ - "code", - "orders" + "unlock_timestamp", + "asset_index", + "amount" ] }, "PerpsMarketStats": { @@ -5223,6 +5998,10 @@ }, "market_config": { "$ref": "#/definitions/MarketConfig" + }, + "strategy_index": { + "type": "integer", + "format": "uint8" } }, "title": "PerpsOrderBookDetail", @@ -5258,7 +6037,8 @@ "daily_price_change", "open_interest", "daily_chart", - "market_config" + "market_config", + "strategy_index" ] }, "PnLEntry": { @@ -5314,10 +6094,30 @@ "format": "double", "example": "12.0" }, + "staking_pnl": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "staking_inflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "staking_outflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, "pool_total_shares": { "type": "number", "format": "double", "example": "12.0" + }, + "staked_lit": { + "type": "number", + "format": "double", + "example": "12.0" } }, "title": "PnLEntry", @@ -5332,7 +6132,11 @@ "pool_pnl", "pool_inflow", "pool_outflow", - "pool_total_shares" + "staking_pnl", + "staking_inflow", + "staking_outflow", + "pool_total_shares", + "staked_lit" ] }, "PositionFunding": { @@ -5372,6 +6176,10 @@ "long", "short" ] + }, + "discount": { + "type": "string", + "example": "1" } }, "title": "PositionFunding", @@ -5382,7 +6190,8 @@ "change", "rate", "position_size", - "position_side" + "position_side", + "discount" ] }, "PositionFundings": { @@ -5477,6 +6286,12 @@ "items": { "$ref": "#/definitions/SharePrice" } + }, + "strategies": { + "type": "array", + "items": { + "$ref": "#/definitions/Strategy" + } } }, "title": "PublicPoolInfo", @@ -5489,7 +6304,8 @@ "annual_percentage_yield", "sharpe_ratio", "daily_returns", - "share_prices" + "share_prices", + "strategies" ] }, "PublicPoolMetadata": { @@ -5552,6 +6368,14 @@ "type": "string", "example": "19995" }, + "total_spot_value": { + "type": "string", + "example": "19995" + }, + "total_perps_value": { + "type": "string", + "example": "19995" + }, "total_shares": { "type": "integer", "format": "int64", @@ -5559,6 +6383,12 @@ }, "account_share": { "$ref": "#/definitions/PublicPoolShare" + }, + "assets": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountAsset" + } } }, "title": "PublicPoolMetadata", @@ -5575,7 +6405,10 @@ "status", "operator_fee", "total_asset_value", - "total_shares" + "total_spot_value", + "total_perps_value", + "total_shares", + "assets" ] }, "PublicPoolShare": { @@ -5592,15 +6425,68 @@ "example": "3000" }, "entry_usdc": { + "type": "string", + "example": "3000", + "description": " For public pools and insurance fund" + }, + "principal_amount": { "type": "string", "example": "3000" + }, + "entry_timestamp": { + "type": "integer", + "format": "int64", + "example": "3600000" } }, "title": "PublicPoolShare", "required": [ "public_pool_index", "shares_amount", - "entry_usdc" + "entry_usdc", + "principal_amount", + "entry_timestamp" + ] + }, + "PushNotifDeliveryResult": { + "type": "object", + "properties": { + "expo_token": { + "type": "string" + }, + "status": { + "type": "string" + }, + "error": { + "type": "string" + } + }, + "title": "PushNotifDeliveryResult", + "required": [ + "expo_token", + "status", + "error" + ] + }, + "Referral": { + "type": "object", + "properties": { + "l1_address": { + "type": "string" + }, + "referral_code": { + "type": "string" + }, + "used_at": { + "type": "integer", + "format": "int64" + } + }, + "title": "Referral", + "required": [ + "l1_address", + "referral_code", + "used_at" ] }, "ReqAckNotif": { @@ -5687,6 +6573,47 @@ "funding", "trade" ] + }, + "start_timestamp": { + "type": "integer", + "format": "int64", + "maximum": 1830297600000, + "minimum": 1735689600000 + }, + "end_timestamp": { + "type": "integer", + "format": "int64", + "maximum": 1830297600000, + "minimum": 1735689600000 + }, + "side": { + "type": "string", + "enum": [ + "all", + "long", + "short" + ], + "default": "all" + }, + "role": { + "type": "string", + "enum": [ + "all", + "maker", + "taker" + ], + "default": "all" + }, + "trade_type": { + "type": "string", + "enum": [ + "all", + "trade", + "liquidation", + "deleverage", + "market-settlement" + ], + "default": "all" } }, "title": "ReqExportData", @@ -6136,10 +7063,81 @@ "l1_address" ] }, + "ReqGetExchangeMetrics": { + "type": "object", + "properties": { + "period": { + "type": "string", + "enum": [ + "h", + "d", + "w", + "m", + "q", + "y", + "all" + ] + }, + "kind": { + "type": "string", + "enum": [ + "volume", + "maker_fee", + "taker_fee", + "liquidation_fee", + "trade_count", + "liquidation_count", + "liquidation_volume", + "inflow", + "outflow", + "transfer_fee", + "withdraw_fee", + "open_interest", + "account_count", + "active_account_count", + "tps" + ] + }, + "filter": { + "type": "string", + "enum": [ + "byMarket" + ] + }, + "value": { + "type": "string" + } + }, + "title": "ReqGetExchangeMetrics", + "required": [ + "period", + "kind" + ] + }, "ReqGetExchangeStats": { "type": "object", "title": "ReqGetExchangeStats" }, + "ReqGetExecuteStats": { + "type": "object", + "properties": { + "period": { + "type": "string", + "enum": [ + "d", + "w", + "m", + "q", + "y", + "all" + ] + } + }, + "title": "ReqGetExecuteStats", + "required": [ + "period" + ] + }, "ReqGetFastWithdrawInfo": { "type": "object", "properties": { @@ -6243,6 +7241,31 @@ "l1_address" ] }, + "ReqGetLeases": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "format": "int64", + "default": "20" + } + }, + "title": "ReqGetLeases", + "required": [ + "account_index" + ] + }, "ReqGetLiquidationInfos": { "type": "object", "properties": { @@ -6407,7 +7430,8 @@ "all", "user", "protocol", - "account_index" + "account_index", + "stake" ] }, "index": { @@ -6431,6 +7455,27 @@ "limit" ] }, + "ReqGetPushNotifSettings": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expo_token": { + "type": "string" + } + }, + "title": "ReqGetPushNotifSettings", + "required": [ + "account_index", + "expo_token" + ] + }, "ReqGetRangeWithCursor": { "type": "object", "properties": { @@ -6634,6 +7679,20 @@ }, "cursor": { "type": "string" + }, + "type": { + "type": "array", + "items": { + "type": "string" + }, + "enum": [ + "all", + "L2Transfer", + "L2MintShares", + "L2BurnShares", + "L2StakeAssets", + "L2UnstakeAssets" + ] } }, "title": "ReqGetTransferHistory", @@ -6661,6 +7720,24 @@ "value" ] }, + "ReqGetUserReferrals": { + "type": "object", + "properties": { + "auth": { + "type": "string" + }, + "l1_address": { + "type": "string" + }, + "cursor": { + "type": "string" + } + }, + "title": "ReqGetUserReferrals", + "required": [ + "l1_address" + ] + }, "ReqGetWithdrawHistory": { "type": "object", "properties": { @@ -6689,6 +7766,27 @@ "account_index" ] }, + "ReqLITLease": { + "type": "object", + "properties": { + "tx_info": { + "type": "string" + }, + "lease_amount": { + "type": "string" + }, + "duration_days": { + "type": "integer", + "format": "int32" + } + }, + "title": "ReqLITLease", + "required": [ + "tx_info", + "lease_amount", + "duration_days" + ] + }, "ReqPostApiToken": { "type": "object", "properties": { @@ -6721,6 +7819,38 @@ "sub_account_access" ] }, + "ReqRegisterPushNotifToken": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expo_token": { + "type": "string" + }, + "platform": { + "type": "string", + "enum": [ + "ios", + "android" + ] + }, + "app_version": { + "type": "string" + } + }, + "title": "ReqRegisterPushNotifToken", + "required": [ + "account_index", + "expo_token", + "platform" + ] + }, "ReqRevokeApiToken": { "type": "object", "properties": { @@ -6777,6 +7907,53 @@ "tx_infos" ] }, + "ReqUnregisterPushNotifToken": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expo_token": { + "type": "string" + } + }, + "title": "ReqUnregisterPushNotifToken", + "required": [ + "account_index", + "expo_token" + ] + }, + "ReqUpdatePushNotifSettings": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expo_token": { + "type": "string" + }, + "enabled": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "ReqUpdatePushNotifSettings", + "required": [ + "account_index", + "expo_token", + "enabled" + ] + }, "RespChangeAccountTier": { "type": "object", "properties": { @@ -6842,6 +8019,57 @@ "bridges" ] }, + "RespGetExchangeMetrics": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/definitions/ExchangeMetric" + } + } + }, + "title": "RespGetExchangeMetrics", + "required": [ + "code", + "metrics" + ] + }, + "RespGetExecuteStats": { + "type": "object", + "properties": { + "period": { + "type": "string", + "enum": [ + "d", + "w", + "m", + "q", + "y", + "all" + ] + }, + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/ExecuteStat" + } + } + }, + "title": "RespGetExecuteStats", + "required": [ + "period", + "result" + ] + }, "RespGetFastBridgeInfo": { "type": "object", "properties": { @@ -6915,6 +8143,89 @@ "is_next_bridge_fast" ] }, + "RespGetLeaseOptions": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/LeaseOptionEntry" + } + }, + "lit_incentives_account_index": { + "type": "integer", + "format": "int64" + } + }, + "title": "RespGetLeaseOptions", + "required": [ + "code", + "options", + "lit_incentives_account_index" + ] + }, + "RespGetLeases": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "leases": { + "type": "array", + "items": { + "$ref": "#/definitions/LeaseEntry" + } + }, + "next_cursor": { + "type": "string" + } + }, + "title": "RespGetLeases", + "required": [ + "code", + "leases" + ] + }, + "RespGetPushNotifSettings": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "enabled": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "RespGetPushNotifSettings", + "required": [ + "code", + "account_index", + "enabled" + ] + }, "RespPostApiToken": { "type": "object", "properties": { @@ -7243,6 +8554,68 @@ "transaction_time" ] }, + "SlippageResult": { + "type": "object", + "properties": { + "exchange": { + "type": "string", + "example": "lighter" + }, + "market": { + "type": "string", + "example": "ETH" + }, + "size_usd": { + "type": "integer", + "format": "int64", + "example": "1000" + }, + "avg_slippage": { + "type": "number", + "format": "double", + "example": "0.5" + }, + "data_count": { + "type": "integer", + "format": "int64", + "example": "100" + } + }, + "title": "SlippageResult", + "required": [ + "exchange", + "market", + "size_usd", + "avg_slippage", + "data_count" + ] + }, + "SpotAvgEntryPrice": { + "type": "object", + "properties": { + "asset_id": { + "type": "integer", + "format": "int16" + }, + "avg_entry_price": { + "type": "string" + }, + "asset_size": { + "type": "string" + }, + "last_trade_id": { + "type": "integer", + "format": "int64" + } + }, + "title": "SpotAvgEntryPrice", + "required": [ + "asset_id", + "avg_entry_price", + "asset_size", + "last_trade_id" + ] + }, "SpotMarketStats": { "type": "object", "properties": { @@ -7493,6 +8866,19 @@ "timestamp" ] }, + "Strategy": { + "type": "object", + "properties": { + "collateral": { + "type": "string", + "example": "199955" + } + }, + "title": "Strategy", + "required": [ + "collateral" + ] + }, "SubAccounts": { "type": "object", "properties": { @@ -7523,6 +8909,53 @@ "sub_accounts" ] }, + "SystemConfig": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "liquidity_pool_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "staking_pool_index": { + "type": "integer", + "format": "int64", + "example": "2" + }, + "funding_fee_rebate_account_index": { + "type": "integer", + "format": "int64", + "example": "2" + }, + "liquidity_pool_cooldown_period": { + "type": "integer", + "format": "int64", + "example": "86400" + }, + "staking_pool_lockup_period": { + "type": "integer", + "format": "int64", + "example": "604800" + } + }, + "title": "SystemConfig", + "required": [ + "code", + "liquidity_pool_index", + "staking_pool_index", + "funding_fee_rebate_account_index", + "liquidity_pool_cooldown_period", + "staking_pool_lockup_period" + ] + }, "Ticker": { "type": "object", "properties": { @@ -7678,6 +9111,14 @@ "type": "integer", "format": "int64", "example": "1257894000000000" + }, + "ask_account_pnl": { + "type": "string", + "example": "1967" + }, + "bid_account_pnl": { + "type": "string", + "example": "1967" } }, "title": "Trade", @@ -7708,7 +9149,9 @@ "maker_entry_quote_before", "maker_initial_margin_fraction_before", "maker_position_sign_changed", - "transaction_time" + "transaction_time", + "ask_account_pnl", + "bid_account_pnl" ] }, "Trades": { @@ -7821,7 +9264,13 @@ "L2BurnSharesOutflow", "L2MintSharesInflow", "L2MintSharesOutflow", - "L2SelfTransfer" + "L2SelfTransfer", + "L2StakeAssetInflow", + "L2StakeAssetOutflow", + "L2UnstakeAssetInflow", + "L2UnstakeAssetOutflow", + "L2ForceBurnSharesInflow", + "L2ForceBurnSharesOutflow" ] }, "from_l1_address": { @@ -7924,6 +9373,34 @@ "tx_hash" ] }, + "UserReferrals": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "cursor": { + "type": "string" + }, + "referrals": { + "type": "array", + "items": { + "$ref": "#/definitions/Referral" + } + } + }, + "title": "UserReferrals", + "required": [ + "code", + "cursor", + "referrals" + ] + }, "ValidatorInfo": { "type": "object", "properties": { diff --git a/pyproject.toml b/pyproject.toml index 065285b..d76dd6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "lighter-sdk" -version = "1.0.3" +version = "1.0.4" description = "Python client for Lighter" authors = ["elliot"] license = "NoLicense" diff --git a/setup.py b/setup.py index 2965670..469cc03 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.3" +VERSION = "1.0.4" PYTHON_REQUIRES = ">=3.7" REQUIRES = [ "urllib3 >= 1.25.3, < 2.1.0",