diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index eac6bd74..722ca2d7 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -48,13 +48,21 @@ docs/InfoApi.md docs/L1Metadata.md docs/L1ProviderInfo.md docs/Layer1BasicInfo.md +docs/Leaderboard.md +docs/LeaderboardEntry.md docs/LeaseEntry.md docs/LeaseOptionEntry.md docs/LiqTrade.md docs/Liquidation.md docs/LiquidationInfo.md docs/LiquidationInfos.md +docs/LivePointsTotal.md +docs/LivepointsApi.md +docs/MarkPriceCandle.md +docs/MarkPriceCandles.md docs/MarketConfig.md +docs/MarketPriceChart.md +docs/MarketPriceCharts.md docs/NextNonce.md docs/NotificationApi.md docs/Order.md @@ -82,6 +90,8 @@ docs/ReferralApi.md docs/ReferralCode.md docs/ReferralPointEntry.md docs/ReferralPoints.md +docs/ReferralProgramKickback.md +docs/ReferralTotals.md docs/ReqSetAccountMetadata.md docs/RespChangeAccountTier.md docs/RespCreateRFQ.md @@ -117,6 +127,7 @@ docs/SlippageResult.md docs/SpotOrderBookDetail.md docs/Status.md docs/Strategy.md +docs/SubAccountMetadata.md docs/SubAccounts.md docs/SystemConfig.md docs/Token.md @@ -146,6 +157,7 @@ lighter/api/bridge_api.py lighter/api/candlestick_api.py lighter/api/funding_api.py lighter/api/info_api.py +lighter/api/livepoints_api.py lighter/api/notification_api.py lighter/api/order_api.py lighter/api/referral_api.py @@ -199,13 +211,20 @@ lighter/models/fundings.py lighter/models/l1_metadata.py lighter/models/l1_provider_info.py lighter/models/layer1_basic_info.py +lighter/models/leaderboard.py +lighter/models/leaderboard_entry.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 lighter/models/liquidation_infos.py +lighter/models/live_points_total.py +lighter/models/mark_price_candle.py +lighter/models/mark_price_candles.py lighter/models/market_config.py +lighter/models/market_price_chart.py +lighter/models/market_price_charts.py lighter/models/next_nonce.py lighter/models/order.py lighter/models/order_book.py @@ -227,6 +246,8 @@ lighter/models/referral.py lighter/models/referral_code.py lighter/models/referral_point_entry.py lighter/models/referral_points.py +lighter/models/referral_program_kickback.py +lighter/models/referral_totals.py lighter/models/req_set_account_metadata.py lighter/models/resp_change_account_tier.py lighter/models/resp_create_rfq.py @@ -264,6 +285,7 @@ lighter/models/slippage_result.py lighter/models/spot_order_book_detail.py lighter/models/status.py lighter/models/strategy.py +lighter/models/sub_account_metadata.py lighter/models/sub_accounts.py lighter/models/system_config.py lighter/models/token.py diff --git a/README.md b/README.md index 7adc2293..48444b3e 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,10 @@ if __name__ == "__main__": The [`examples/`](examples) directory contains end-to-end scripts for the common flows. A few starting points: -- [Read public REST endpoints](examples/market-data/get_info.py) -- [Stream order books and account state over websocket](examples/websocket/ws.py) -- [Create / modify / cancel an order over HTTP](examples/orders/create_modify_cancel_order_http.py) -- [Create / modify / cancel an order over websocket](examples/orders/create_modify_cancel_order_ws.py) +- [Read public REST endpoints](examples/get_info.py) +- [Stream order books and account state over websocket](examples/ws.py) +- [Create / modify / cancel an order over HTTP](examples/create_modify_cancel_order_http.py) +- [Create / modify / cancel an order over websocket](examples/create_modify_cancel_order_ws.py) - [System setup (API key, signer)](examples/system_setup.py) See [`examples/README.md`](examples/README.md) for the full annotated list. @@ -63,6 +63,7 @@ Class | Method | HTTP request | Description *AccountApi* | [**change_account_tier**](docs/AccountApi.md#change_account_tier) | **POST** /api/v1/changeAccountTier | changeAccountTier *AccountApi* | [**get_maker_only_api_keys**](docs/AccountApi.md#get_maker_only_api_keys) | **GET** /api/v1/getMakerOnlyApiKeys | getMakerOnlyApiKeys *AccountApi* | [**l1_metadata**](docs/AccountApi.md#l1_metadata) | **GET** /api/v1/l1Metadata | l1Metadata +*AccountApi* | [**leaderboard**](docs/AccountApi.md#leaderboard) | **GET** /api/v1/leaderboard | leaderboard *AccountApi* | [**lease_options**](docs/AccountApi.md#lease_options) | **GET** /api/v1/leaseOptions | leaseOptions *AccountApi* | [**leases**](docs/AccountApi.md#leases) | **GET** /api/v1/leases | leases *AccountApi* | [**liquidations**](docs/AccountApi.md#liquidations) | **GET** /api/v1/liquidations | liquidations @@ -93,15 +94,19 @@ Class | Method | HTTP request | Description *BridgeApi* | [**fastwithdraw_info**](docs/BridgeApi.md#fastwithdraw_info) | **GET** /api/v1/fastwithdraw/info | fastwithdraw_info *CandlestickApi* | [**candles**](docs/CandlestickApi.md#candles) | **GET** /api/v1/candles | candles *CandlestickApi* | [**fundings**](docs/CandlestickApi.md#fundings) | **GET** /api/v1/fundings | fundings +*CandlestickApi* | [**mark_price_candles**](docs/CandlestickApi.md#mark_price_candles) | **GET** /api/v1/markPriceCandles | markPriceCandles +*CandlestickApi* | [**market_price_charts**](docs/CandlestickApi.md#market_price_charts) | **GET** /api/v1/marketPriceCharts | marketPriceCharts *FundingApi* | [**funding_rates**](docs/FundingApi.md#funding_rates) | **GET** /api/v1/funding-rates | funding-rates *InfoApi* | [**layer1_basic_info**](docs/InfoApi.md#layer1_basic_info) | **GET** /api/v1/layer1BasicInfo | layer1BasicInfo *InfoApi* | [**synthetic_spot_info**](docs/InfoApi.md#synthetic_spot_info) | **GET** /api/v1/syntheticSpotInfo | syntheticSpotInfo *InfoApi* | [**system_config**](docs/InfoApi.md#system_config) | **GET** /api/v1/systemConfig | systemConfig *InfoApi* | [**transfer_fee_info**](docs/InfoApi.md#transfer_fee_info) | **GET** /api/v1/transferFeeInfo | transferFeeInfo *InfoApi* | [**withdrawal_delay**](docs/InfoApi.md#withdrawal_delay) | **GET** /api/v1/withdrawalDelay | withdrawalDelay +*LivepointsApi* | [**live_points_total**](docs/LivepointsApi.md#live_points_total) | **GET** /api/v1/livePoints/total | livePoints_total *NotificationApi* | [**notification_ack**](docs/NotificationApi.md#notification_ack) | **POST** /api/v1/notification/ack | notification_ack *OrderApi* | [**account_active_orders**](docs/OrderApi.md#account_active_orders) | **GET** /api/v1/accountActiveOrders | accountActiveOrders *OrderApi* | [**account_inactive_orders**](docs/OrderApi.md#account_inactive_orders) | **GET** /api/v1/accountInactiveOrders | accountInactiveOrders +*OrderApi* | [**account_orders**](docs/OrderApi.md#account_orders) | **GET** /api/v1/accountOrders | accountOrders *OrderApi* | [**asset_details**](docs/OrderApi.md#asset_details) | **GET** /api/v1/assetDetails | assetDetails *OrderApi* | [**exchange_metrics**](docs/OrderApi.md#exchange_metrics) | **GET** /api/v1/exchangeMetrics | exchangeMetrics *OrderApi* | [**exchange_stats**](docs/OrderApi.md#exchange_stats) | **GET** /api/v1/exchangeStats | exchangeStats @@ -178,13 +183,20 @@ Class | Method | HTTP request | Description - [L1Metadata](docs/L1Metadata.md) - [L1ProviderInfo](docs/L1ProviderInfo.md) - [Layer1BasicInfo](docs/Layer1BasicInfo.md) + - [Leaderboard](docs/Leaderboard.md) + - [LeaderboardEntry](docs/LeaderboardEntry.md) - [LeaseEntry](docs/LeaseEntry.md) - [LeaseOptionEntry](docs/LeaseOptionEntry.md) - [LiqTrade](docs/LiqTrade.md) - [Liquidation](docs/Liquidation.md) - [LiquidationInfo](docs/LiquidationInfo.md) - [LiquidationInfos](docs/LiquidationInfos.md) + - [LivePointsTotal](docs/LivePointsTotal.md) + - [MarkPriceCandle](docs/MarkPriceCandle.md) + - [MarkPriceCandles](docs/MarkPriceCandles.md) - [MarketConfig](docs/MarketConfig.md) + - [MarketPriceChart](docs/MarketPriceChart.md) + - [MarketPriceCharts](docs/MarketPriceCharts.md) - [NextNonce](docs/NextNonce.md) - [Order](docs/Order.md) - [OrderBook](docs/OrderBook.md) @@ -209,6 +221,8 @@ Class | Method | HTTP request | Description - [ReferralCode](docs/ReferralCode.md) - [ReferralPointEntry](docs/ReferralPointEntry.md) - [ReferralPoints](docs/ReferralPoints.md) + - [ReferralProgramKickback](docs/ReferralProgramKickback.md) + - [ReferralTotals](docs/ReferralTotals.md) - [ReqSetAccountMetadata](docs/ReqSetAccountMetadata.md) - [RespChangeAccountTier](docs/RespChangeAccountTier.md) - [RespCreateRFQ](docs/RespCreateRFQ.md) @@ -243,6 +257,7 @@ Class | Method | HTTP request | Description - [SpotOrderBookDetail](docs/SpotOrderBookDetail.md) - [Status](docs/Status.md) - [Strategy](docs/Strategy.md) + - [SubAccountMetadata](docs/SubAccountMetadata.md) - [SubAccounts](docs/SubAccounts.md) - [SystemConfig](docs/SystemConfig.md) - [Token](docs/Token.md) diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 98adb1ca..849797f3 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**change_account_tier**](AccountApi.md#change_account_tier) | **POST** /api/v1/changeAccountTier | changeAccountTier [**get_maker_only_api_keys**](AccountApi.md#get_maker_only_api_keys) | **GET** /api/v1/getMakerOnlyApiKeys | getMakerOnlyApiKeys [**l1_metadata**](AccountApi.md#l1_metadata) | **GET** /api/v1/l1Metadata | l1Metadata +[**leaderboard**](AccountApi.md#leaderboard) | **GET** /api/v1/leaderboard | leaderboard [**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 @@ -396,7 +397,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) # **change_account_tier** -> RespChangeAccountTier change_account_tier(account_index, new_tier, authorization=authorization, auth=auth) +> RespChangeAccountTier change_account_tier(account_index, new_tier, authorization=authorization) changeAccountTier @@ -424,12 +425,11 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.AccountApi(api_client) account_index = 56 # int | new_tier = 'new_tier_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) + authorization = 'authorization_example' # str | (optional) try: # changeAccountTier - api_response = await api_instance.change_account_tier(account_index, new_tier, authorization=authorization, auth=auth) + api_response = await api_instance.change_account_tier(account_index, new_tier, authorization=authorization) print("The response of AccountApi->change_account_tier:\n") pprint(api_response) except Exception as e: @@ -445,8 +445,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_index** | **int**| | **new_tier** | **str**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **authorization** | **str**| | [optional] ### Return type @@ -612,6 +611,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) +# **leaderboard** +> Leaderboard leaderboard(type, authorization=authorization, l1_address=l1_address, competition_id=competition_id) + +leaderboard + +Get points leaderboard. Type should be all. + +### Example + + +```python +import lighter +from lighter.models.leaderboard import Leaderboard +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) + type = 'type_example' # str | + authorization = 'authorization_example' # str | (optional) + l1_address = 'l1_address_example' # str | (optional) + competition_id = 'competition_id_example' # str | (optional) + + try: + # leaderboard + api_response = await api_instance.leaderboard(type, authorization=authorization, l1_address=l1_address, competition_id=competition_id) + print("The response of AccountApi->leaderboard:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->leaderboard: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| | + **authorization** | **str**| | [optional] + **l1_address** | **str**| | [optional] + **competition_id** | **str**| | [optional] + +### Return type + +[**Leaderboard**](Leaderboard.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) + # **lease_options** > RespGetLeaseOptions lease_options() @@ -678,7 +752,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) # **leases** -> RespGetLeases leases(account_index, authorization=authorization, cursor=cursor, limit=limit, auth=auth) +> RespGetLeases leases(account_index, authorization=authorization, cursor=cursor, limit=limit) leases @@ -708,11 +782,10 @@ async with lighter.ApiClient(configuration) as api_client: authorization = 'authorization_example' # str | API token authorization (optional) cursor = 'cursor_example' # str | Pagination cursor from a previous response (optional) limit = 20 # int | Number of results to return (1–100, default 20) (optional) (default to 20) - auth = 'auth_example' # str | Read-only auth (alternative to header authorization) (optional) try: # leases - api_response = await api_instance.leases(account_index, authorization=authorization, cursor=cursor, limit=limit, auth=auth) + api_response = await api_instance.leases(account_index, authorization=authorization, cursor=cursor, limit=limit) print("The response of AccountApi->leases:\n") pprint(api_response) except Exception as e: @@ -730,7 +803,6 @@ Name | Type | Description | Notes **authorization** | **str**| API token authorization | [optional] **cursor** | **str**| Pagination cursor from a previous response | [optional] **limit** | **int**| Number of results to return (1–100, default 20) | [optional] [default to 20] - **auth** | **str**| Read-only auth (alternative to header authorization) | [optional] ### Return type @@ -907,7 +979,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) # **partner_stats** -> PartnerStats partner_stats(account_index, start_timestamp=start_timestamp, end_timestamp=end_timestamp) +> PartnerStats partner_stats(account_index, start_timestamp=start_timestamp, end_timestamp=end_timestamp, period=period) partnerStats @@ -936,10 +1008,11 @@ async with lighter.ApiClient(configuration) as api_client: account_index = 56 # int | start_timestamp = 56 # int | (optional) end_timestamp = 56 # int | (optional) + period = 'period_example' # str | (optional) try: # partnerStats - api_response = await api_instance.partner_stats(account_index, start_timestamp=start_timestamp, end_timestamp=end_timestamp) + api_response = await api_instance.partner_stats(account_index, start_timestamp=start_timestamp, end_timestamp=end_timestamp, period=period) print("The response of AccountApi->partner_stats:\n") pprint(api_response) except Exception as e: @@ -956,6 +1029,7 @@ Name | Type | Description | Notes **account_index** | **int**| | **start_timestamp** | **int**| | [optional] **end_timestamp** | **int**| | [optional] + **period** | **str**| | [optional] ### Return type @@ -1063,7 +1137,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) # **position_funding** -> PositionFundings position_funding(account_index, limit, authorization=authorization, market_id=market_id, cursor=cursor, side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp) +> PositionFundings position_funding(account_index, limit, authorization=authorization, cursor=cursor, side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp, market_ids=market_ids) positionFunding @@ -1092,15 +1166,15 @@ async with lighter.ApiClient(configuration) as api_client: account_index = 56 # int | limit = 56 # int | authorization = 'authorization_example' # str | (optional) - market_id = 56 # int | (optional) cursor = 'cursor_example' # str | (optional) side = all # str | (optional) (default to all) start_timestamp = 56 # int | (optional) end_timestamp = 56 # int | (optional) + market_ids = [56] # List[int] | comma-separated int64s, e.g. \"1,2\" (optional) try: # positionFunding - api_response = await api_instance.position_funding(account_index, limit, authorization=authorization, market_id=market_id, cursor=cursor, side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp) + api_response = await api_instance.position_funding(account_index, limit, authorization=authorization, cursor=cursor, side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp, market_ids=market_ids) print("The response of AccountApi->position_funding:\n") pprint(api_response) except Exception as e: @@ -1117,11 +1191,11 @@ Name | Type | Description | Notes **account_index** | **int**| | **limit** | **int**| | **authorization** | **str**| | [optional] - **market_id** | **int**| | [optional] **cursor** | **str**| | [optional] **side** | **str**| | [optional] [default to all] **start_timestamp** | **int**| | [optional] **end_timestamp** | **int**| | [optional] + **market_ids** | [**List[int]**](int.md)| comma-separated int64s, e.g. \"1,2\" | [optional] ### Return type @@ -1223,7 +1297,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) # **referral_user_referrals** -> UserReferrals referral_user_referrals(l1_address, authorization=authorization, cursor=cursor, auth=auth, stats_start_timestamp=stats_start_timestamp, stats_end_timestamp=stats_end_timestamp, limit=limit) +> UserReferrals referral_user_referrals(l1_address, authorization=authorization, cursor=cursor, stats_start_timestamp=stats_start_timestamp, stats_end_timestamp=stats_end_timestamp, limit=limit, is_eligible=is_eligible) userReferrals @@ -1252,14 +1326,14 @@ async with lighter.ApiClient(configuration) as api_client: l1_address = 'l1_address_example' # str | authorization = 'authorization_example' # str | (optional) cursor = 'cursor_example' # str | (optional) - auth = 'auth_example' # str | (optional) stats_start_timestamp = 56 # int | (optional) stats_end_timestamp = 56 # int | (optional) limit = 56 # int | (optional) + is_eligible = False # bool | (optional) (default to False) try: # userReferrals - api_response = await api_instance.referral_user_referrals(l1_address, authorization=authorization, cursor=cursor, auth=auth, stats_start_timestamp=stats_start_timestamp, stats_end_timestamp=stats_end_timestamp, limit=limit) + api_response = await api_instance.referral_user_referrals(l1_address, authorization=authorization, cursor=cursor, stats_start_timestamp=stats_start_timestamp, stats_end_timestamp=stats_end_timestamp, limit=limit, is_eligible=is_eligible) print("The response of AccountApi->referral_user_referrals:\n") pprint(api_response) except Exception as e: @@ -1276,10 +1350,10 @@ Name | Type | Description | Notes **l1_address** | **str**| | **authorization** | **str**| | [optional] **cursor** | **str**| | [optional] - **auth** | **str**| | [optional] **stats_start_timestamp** | **int**| | [optional] **stats_end_timestamp** | **int**| | [optional] **limit** | **int**| | [optional] + **is_eligible** | **bool**| | [optional] [default to False] ### Return type @@ -1308,7 +1382,7 @@ No authorization required rfq_create -Create RFQ +Create RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing. ### Example @@ -1535,7 +1609,7 @@ No authorization required rfq_respond -Respond to RFQ +Respond to RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing. ### Example @@ -1677,7 +1751,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) # **set_maker_only_api_keys** -> RespSetMakerOnlyApiKeys set_maker_only_api_keys(authorization, account_index, api_key_indexes, auth=auth) +> RespSetMakerOnlyApiKeys set_maker_only_api_keys(authorization, account_index, api_key_indexes) setMakerOnlyApiKeys @@ -1706,11 +1780,10 @@ async with lighter.ApiClient(configuration) as api_client: authorization = 'authorization_example' # str | account_index = 56 # int | api_key_indexes = 'api_key_indexes_example' # str | JSON array string of API key indexes, e.g. \\\"[4,5]\\\". Use [] to clear all maker-only restrictions. - auth = 'auth_example' # str | (optional) try: # setMakerOnlyApiKeys - api_response = await api_instance.set_maker_only_api_keys(authorization, account_index, api_key_indexes, auth=auth) + api_response = await api_instance.set_maker_only_api_keys(authorization, account_index, api_key_indexes) print("The response of AccountApi->set_maker_only_api_keys:\n") pprint(api_response) except Exception as e: @@ -1727,7 +1800,6 @@ Name | Type | Description | Notes **authorization** | **str**| | **account_index** | **int**| | **api_key_indexes** | **str**| JSON array string of API key indexes, e.g. \\\"[4,5]\\\". Use [] to clear all maker-only restrictions. | - **auth** | **str**| | [optional] ### Return type @@ -1779,7 +1851,7 @@ 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) + authorization = 'authorization_example' # str | (optional) try: # tokens @@ -1798,7 +1870,7 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_index** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] + **authorization** | **str**| | [optional] ### Return type diff --git a/docs/AccountAsset.md b/docs/AccountAsset.md index 5ccf3838..8adcd44e 100644 --- a/docs/AccountAsset.md +++ b/docs/AccountAsset.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **locked_balance** | **str** | | **margin_balance** | **str** | | **margin_mode** | **str** | | +**multiplier** | **str** | | ## Example diff --git a/docs/AccountMetadata.md b/docs/AccountMetadata.md index 21a152ef..3a053aeb 100644 --- a/docs/AccountMetadata.md +++ b/docs/AccountMetadata.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **created_at** | **int** | | **can_rfq** | **bool** | | **can_rfq_market_ids** | **List[str]** | | +**metadata** | [**SubAccountMetadata**](SubAccountMetadata.md) | | ## Example diff --git a/docs/AccountPosition.md b/docs/AccountPosition.md index d807c28d..fe5d1df0 100644 --- a/docs/AccountPosition.md +++ b/docs/AccountPosition.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes **margin_mode** | **int** | | **allocated_margin** | **str** | | **total_discount** | **str** | | +**margin_set_flag** | **int** | | ## Example diff --git a/docs/Asset.md b/docs/Asset.md index 3113ae56..be7c42c1 100644 --- a/docs/Asset.md +++ b/docs/Asset.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes **total_supplied** | **str** | | **user_supply_cap** | **str** | | **liquidation_factor** | **str** | | +**multiplier** | **str** | | ## Example diff --git a/docs/BridgeApi.md b/docs/BridgeApi.md index 343f0870..9385aadf 100644 --- a/docs/BridgeApi.md +++ b/docs/BridgeApi.md @@ -287,7 +287,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) # **fastwithdraw** -> ResultCode fastwithdraw(tx_info, to_address, authorization=authorization, auth=auth) +> ResultCode fastwithdraw(tx_info, to_address, authorization=authorization) fastwithdraw @@ -315,12 +315,11 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.BridgeApi(api_client) tx_info = 'tx_info_example' # str | to_address = 'to_address_example' # str | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) + authorization = 'authorization_example' # str | (optional) try: # fastwithdraw - api_response = await api_instance.fastwithdraw(tx_info, to_address, authorization=authorization, auth=auth) + api_response = await api_instance.fastwithdraw(tx_info, to_address, authorization=authorization) print("The response of BridgeApi->fastwithdraw:\n") pprint(api_response) except Exception as e: @@ -336,8 +335,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tx_info** | **str**| | **to_address** | **str**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **authorization** | **str**| | [optional] ### Return type diff --git a/docs/CandlestickApi.md b/docs/CandlestickApi.md index a524abcc..6ee39d67 100644 --- a/docs/CandlestickApi.md +++ b/docs/CandlestickApi.md @@ -6,6 +6,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**candles**](CandlestickApi.md#candles) | **GET** /api/v1/candles | candles [**fundings**](CandlestickApi.md#fundings) | **GET** /api/v1/fundings | fundings +[**mark_price_candles**](CandlestickApi.md#mark_price_candles) | **GET** /api/v1/markPriceCandles | markPriceCandles +[**market_price_charts**](CandlestickApi.md#market_price_charts) | **GET** /api/v1/marketPriceCharts | marketPriceCharts # **candles** @@ -92,7 +94,7 @@ No authorization required fundings -Get fundings +Get fundings. Maximum 750 fundings will be returned per call. `count_back` indicates the number of fundings you would like to be returned, starting from `start_timestamp`, if set to 0, all fundings will be returned. ### Example @@ -164,3 +166,149 @@ 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) +# **mark_price_candles** +> MarkPriceCandles mark_price_candles(market_id, resolution, start_timestamp, end_timestamp, count_back) + +markPriceCandles + +Get mark price candles + +### Example + + +```python +import lighter +from lighter.models.mark_price_candles import MarkPriceCandles +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.CandlestickApi(api_client) + market_id = 56 # int | + resolution = 'resolution_example' # str | + start_timestamp = 56 # int | + end_timestamp = 56 # int | + count_back = 56 # int | + + try: + # markPriceCandles + api_response = await api_instance.mark_price_candles(market_id, resolution, start_timestamp, end_timestamp, count_back) + print("The response of CandlestickApi->mark_price_candles:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CandlestickApi->mark_price_candles: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **market_id** | **int**| | + **resolution** | **str**| | + **start_timestamp** | **int**| | + **end_timestamp** | **int**| | + **count_back** | **int**| | + +### Return type + +[**MarkPriceCandles**](MarkPriceCandles.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) + +# **market_price_charts** +> MarketPriceCharts market_price_charts(market_ids=market_ids) + +marketPriceCharts + +Get last 24h hourly prices for all markets (mark price for perps, index price for spot) + +### Example + + +```python +import lighter +from lighter.models.market_price_charts import MarketPriceCharts +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.CandlestickApi(api_client) + market_ids = [56] # List[int] | (optional) + + try: + # marketPriceCharts + api_response = await api_instance.market_price_charts(market_ids=market_ids) + print("The response of CandlestickApi->market_price_charts:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CandlestickApi->market_price_charts: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **market_ids** | [**List[int]**](int.md)| | [optional] + +### Return type + +[**MarketPriceCharts**](MarketPriceCharts.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/DetailedAccount.md b/docs/DetailedAccount.md index c04f1f8b..08b8080c 100644 --- a/docs/DetailedAccount.md +++ b/docs/DetailedAccount.md @@ -37,6 +37,7 @@ Name | Type | Description | Notes **cross_initial_margin_requirement** | **str** | | **cross_maintenance_margin_requirement** | **str** | | **can_rfq_market_ids** | **List[str]** | | +**metadata** | [**SubAccountMetadata**](SubAccountMetadata.md) | | ## Example diff --git a/docs/L1Metadata.md b/docs/L1Metadata.md index 2d277c48..f7c67f3b 100644 --- a/docs/L1Metadata.md +++ b/docs/L1Metadata.md @@ -8,6 +8,8 @@ Name | Type | Description | Notes **l1_address** | **str** | | **can_invite** | **bool** | | **referral_points_percentage** | **str** | | +**referral_program_kickback** | **str** | | +**referral_program_kickback_history** | [**List[ReferralProgramKickback]**](ReferralProgramKickback.md) | | ## Example diff --git a/docs/PriceLevel.md b/docs/Leaderboard.md similarity index 50% rename from docs/PriceLevel.md rename to docs/Leaderboard.md index dd1cc9c9..7d0f836e 100644 --- a/docs/PriceLevel.md +++ b/docs/Leaderboard.md @@ -1,29 +1,28 @@ -# PriceLevel +# Leaderboard ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**price** | **str** | | -**size** | **str** | | +**entries** | [**List[LeaderboardEntry]**](LeaderboardEntry.md) | | ## Example ```python -from lighter.models.price_level import PriceLevel +from lighter.models.leaderboard import Leaderboard # TODO update the JSON string below json = "{}" -# create an instance of PriceLevel from a JSON string -price_level_instance = PriceLevel.from_json(json) +# create an instance of Leaderboard from a JSON string +leaderboard_instance = Leaderboard.from_json(json) # print the JSON string representation of the object -print(PriceLevel.to_json()) +print(Leaderboard.to_json()) # convert the object into a dict -price_level_dict = price_level_instance.to_dict() -# create an instance of PriceLevel from a dict -price_level_from_dict = PriceLevel.from_dict(price_level_dict) +leaderboard_dict = leaderboard_instance.to_dict() +# create an instance of Leaderboard from a dict +leaderboard_from_dict = Leaderboard.from_dict(leaderboard_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/LeaderboardEntry.md b/docs/LeaderboardEntry.md new file mode 100644 index 00000000..ae8ee433 --- /dev/null +++ b/docs/LeaderboardEntry.md @@ -0,0 +1,33 @@ +# LeaderboardEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**l1_address** | **str** | | +**points** | **float** | | +**entry** | **int** | | +**entry_id** | **int** | | +**metadata** | **str** | | + +## Example + +```python +from lighter.models.leaderboard_entry import LeaderboardEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of LeaderboardEntry from a JSON string +leaderboard_entry_instance = LeaderboardEntry.from_json(json) +# print the JSON string representation of the object +print(LeaderboardEntry.to_json()) + +# convert the object into a dict +leaderboard_entry_dict = leaderboard_entry_instance.to_dict() +# create an instance of LeaderboardEntry from a dict +leaderboard_entry_from_dict = LeaderboardEntry.from_dict(leaderboard_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/LivePointsTotal.md b/docs/LivePointsTotal.md new file mode 100644 index 00000000..f3765fcb --- /dev/null +++ b/docs/LivePointsTotal.md @@ -0,0 +1,31 @@ +# LivePointsTotal + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**total_live_points** | **float** | | + +## Example + +```python +from lighter.models.live_points_total import LivePointsTotal + +# TODO update the JSON string below +json = "{}" +# create an instance of LivePointsTotal from a JSON string +live_points_total_instance = LivePointsTotal.from_json(json) +# print the JSON string representation of the object +print(LivePointsTotal.to_json()) + +# convert the object into a dict +live_points_total_dict = live_points_total_instance.to_dict() +# create an instance of LivePointsTotal from a dict +live_points_total_from_dict = LivePointsTotal.from_dict(live_points_total_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/LivepointsApi.md b/docs/LivepointsApi.md new file mode 100644 index 00000000..1446cff5 --- /dev/null +++ b/docs/LivepointsApi.md @@ -0,0 +1,80 @@ +# lighter.LivepointsApi + +All URIs are relative to *https://mainnet.zklighter.elliot.ai* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**live_points_total**](LivepointsApi.md#live_points_total) | **GET** /api/v1/livePoints/total | livePoints_total + + +# **live_points_total** +> LivePointsTotal live_points_total(account_index, authorization=authorization) + +livePoints_total + +Get live points total for an account + +### Example + + +```python +import lighter +from lighter.models.live_points_total import LivePointsTotal +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.LivepointsApi(api_client) + account_index = 56 # int | + authorization = 'authorization_example' # str | (optional) + + try: + # livePoints_total + api_response = await api_instance.live_points_total(account_index, authorization=authorization) + print("The response of LivepointsApi->live_points_total:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling LivepointsApi->live_points_total: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **authorization** | **str**| | [optional] + +### Return type + +[**LivePointsTotal**](LivePointsTotal.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/MarkPriceCandle.md b/docs/MarkPriceCandle.md new file mode 100644 index 00000000..b1672a06 --- /dev/null +++ b/docs/MarkPriceCandle.md @@ -0,0 +1,34 @@ +# MarkPriceCandle + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**t** | **int** | timestamp | +**o** | **float** | open | +**h** | **float** | high | +**l** | **float** | low | +**c** | **float** | close | +**sc** | **int** | sample_count | + +## Example + +```python +from lighter.models.mark_price_candle import MarkPriceCandle + +# TODO update the JSON string below +json = "{}" +# create an instance of MarkPriceCandle from a JSON string +mark_price_candle_instance = MarkPriceCandle.from_json(json) +# print the JSON string representation of the object +print(MarkPriceCandle.to_json()) + +# convert the object into a dict +mark_price_candle_dict = mark_price_candle_instance.to_dict() +# create an instance of MarkPriceCandle from a dict +mark_price_candle_from_dict = MarkPriceCandle.from_dict(mark_price_candle_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MarkPriceCandles.md b/docs/MarkPriceCandles.md new file mode 100644 index 00000000..2f63c28e --- /dev/null +++ b/docs/MarkPriceCandles.md @@ -0,0 +1,32 @@ +# MarkPriceCandles + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**r** | **str** | resolution | +**c** | [**List[MarkPriceCandle]**](MarkPriceCandle.md) | candles | + +## Example + +```python +from lighter.models.mark_price_candles import MarkPriceCandles + +# TODO update the JSON string below +json = "{}" +# create an instance of MarkPriceCandles from a JSON string +mark_price_candles_instance = MarkPriceCandles.from_json(json) +# print the JSON string representation of the object +print(MarkPriceCandles.to_json()) + +# convert the object into a dict +mark_price_candles_dict = mark_price_candles_instance.to_dict() +# create an instance of MarkPriceCandles from a dict +mark_price_candles_from_dict = MarkPriceCandles.from_dict(mark_price_candles_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MarketPriceChart.md b/docs/MarketPriceChart.md new file mode 100644 index 00000000..cb2c7641 --- /dev/null +++ b/docs/MarketPriceChart.md @@ -0,0 +1,30 @@ +# MarketPriceChart + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**market_id** | **int** | | +**prices** | **List[str]** | | + +## Example + +```python +from lighter.models.market_price_chart import MarketPriceChart + +# TODO update the JSON string below +json = "{}" +# create an instance of MarketPriceChart from a JSON string +market_price_chart_instance = MarketPriceChart.from_json(json) +# print the JSON string representation of the object +print(MarketPriceChart.to_json()) + +# convert the object into a dict +market_price_chart_dict = market_price_chart_instance.to_dict() +# create an instance of MarketPriceChart from a dict +market_price_chart_from_dict = MarketPriceChart.from_dict(market_price_chart_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/MarketPriceCharts.md b/docs/MarketPriceCharts.md new file mode 100644 index 00000000..9d5fdfff --- /dev/null +++ b/docs/MarketPriceCharts.md @@ -0,0 +1,32 @@ +# MarketPriceCharts + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**resolution** | **str** | | +**price_charts** | [**List[MarketPriceChart]**](MarketPriceChart.md) | | + +## Example + +```python +from lighter.models.market_price_charts import MarketPriceCharts + +# TODO update the JSON string below +json = "{}" +# create an instance of MarketPriceCharts from a JSON string +market_price_charts_instance = MarketPriceCharts.from_json(json) +# print the JSON string representation of the object +print(MarketPriceCharts.to_json()) + +# convert the object into a dict +market_price_charts_dict = market_price_charts_instance.to_dict() +# create an instance of MarketPriceCharts from a dict +market_price_charts_from_dict = MarketPriceCharts.from_dict(market_price_charts_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/NotificationApi.md b/docs/NotificationApi.md index 38d2daad..085d1c7f 100644 --- a/docs/NotificationApi.md +++ b/docs/NotificationApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **notification_ack** -> ResultCode notification_ack(notif_id, account_index, authorization=authorization, auth=auth) +> ResultCode notification_ack(notif_id, account_index, authorization=authorization) notification_ack @@ -36,12 +36,11 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.NotificationApi(api_client) notif_id = 'notif_id_example' # str | 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) + authorization = 'authorization_example' # str | (optional) try: # notification_ack - api_response = await api_instance.notification_ack(notif_id, account_index, authorization=authorization, auth=auth) + api_response = await api_instance.notification_ack(notif_id, account_index, authorization=authorization) print("The response of NotificationApi->notification_ack:\n") pprint(api_response) except Exception as e: @@ -57,8 +56,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **notif_id** | **str**| | **account_index** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **authorization** | **str**| | [optional] ### Return type diff --git a/docs/Order.md b/docs/Order.md index f05cb19b..21e5834e 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -42,6 +42,7 @@ Name | Type | Description | Notes **integrator_fee_collector_index** | **str** | | **integrator_maker_fee** | **str** | | **integrator_taker_fee** | **str** | | +**order_flags** | **int** | | ## Example diff --git a/docs/OrderApi.md b/docs/OrderApi.md index f5248b15..cc100ed6 100644 --- a/docs/OrderApi.md +++ b/docs/OrderApi.md @@ -6,6 +6,7 @@ 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 +[**account_orders**](OrderApi.md#account_orders) | **GET** /api/v1/accountOrders | accountOrders [**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 @@ -176,6 +177,79 @@ 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) +# **account_orders** +> Orders account_orders(authorization, client_order_indexes, account_index=account_index) + +accountOrders + +Get account orders by client order indexes. Account index defaults to the authorization token's account. Supports the last 10K active orders (with no time limits), or the last 1K inactive orders (in the last 24 hours). + +### Example + + +```python +import lighter +from lighter.models.orders import Orders +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) + authorization = 'authorization_example' # str | + client_order_indexes = 'client_order_indexes_example' # str | comma-separated int64s, e.g. \"123,456\", with a limit of 20. + account_index = 56 # int | (optional) + + try: + # accountOrders + api_response = await api_instance.account_orders(authorization, client_order_indexes, account_index=account_index) + print("The response of OrderApi->account_orders:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrderApi->account_orders: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | + **client_order_indexes** | **str**| comma-separated int64s, e.g. \"123,456\", with a limit of 20. | + **account_index** | **int**| | [optional] + +### Return type + +[**Orders**](Orders.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) + # **asset_details** > AssetDetails asset_details(asset_id=asset_id) @@ -455,7 +529,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) # **export** -> ExportData export(authorization, type, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, end_timestamp=end_timestamp, side=side, role=role, trade_type=trade_type) +> ExportData export(authorization, type, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, end_timestamp=end_timestamp, side=side, role=role, trade_type=trade_type, aggregate=aggregate) export @@ -490,10 +564,11 @@ async with lighter.ApiClient(configuration) as api_client: side = all # str | (optional) (default to all) role = all # str | (optional) (default to all) trade_type = all # str | (optional) (default to all) + aggregate = False # bool | (optional) (default to False) try: # export - api_response = await api_instance.export(authorization, type, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, end_timestamp=end_timestamp, side=side, role=role, trade_type=trade_type) + api_response = await api_instance.export(authorization, type, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, end_timestamp=end_timestamp, side=side, role=role, trade_type=trade_type, aggregate=aggregate) print("The response of OrderApi->export:\n") pprint(api_response) except Exception as e: @@ -516,6 +591,7 @@ Name | Type | Description | Notes **side** | **str**| | [optional] [default to all] **role** | **str**| | [optional] [default to all] **trade_type** | **str**| | [optional] [default to all] + **aggregate** | **bool**| | [optional] [default to False] ### Return type diff --git a/docs/OrderBook.md b/docs/OrderBook.md index 6a61c4da..cb88ca03 100644 --- a/docs/OrderBook.md +++ b/docs/OrderBook.md @@ -22,6 +22,8 @@ Name | Type | Description | Notes **order_quote_limit** | **str** | | **is_maker_fee_enabled** | **bool** | | **is_taker_fee_enabled** | **bool** | | +**created_at** | **str** | | +**multiplier** | **str** | | ## Example diff --git a/docs/OrderBookDepth.md b/docs/OrderBookDepth.md deleted file mode 100644 index 6659c515..00000000 --- a/docs/OrderBookDepth.md +++ /dev/null @@ -1,34 +0,0 @@ -# OrderBookDepth - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | -**message** | **str** | | [optional] -**asks** | [**List[PriceLevel]**](PriceLevel.md) | | -**bids** | [**List[PriceLevel]**](PriceLevel.md) | | -**offset** | **int** | | -**nonce** | **int** | | - -## Example - -```python -from lighter.models.order_book_depth import OrderBookDepth - -# TODO update the JSON string below -json = "{}" -# create an instance of OrderBookDepth from a JSON string -order_book_depth_instance = OrderBookDepth.from_json(json) -# print the JSON string representation of the object -print(OrderBookDepth.to_json()) - -# convert the object into a dict -order_book_depth_dict = order_book_depth_instance.to_dict() -# create an instance of OrderBookDepth from a dict -order_book_depth_from_dict = OrderBookDepth.from_dict(order_book_depth_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 05cc7994..dd682daa 100644 --- a/docs/PerpsOrderBookDetail.md +++ b/docs/PerpsOrderBookDetail.md @@ -43,6 +43,12 @@ Name | Type | Description | Notes **funding_clamp_small** | **str** | | **funding_clamp_big** | **str** | | **base_interest_rate** | **str** | | +**created_at** | **str** | | +**mark_price** | **str** | | [optional] +**index_price** | **str** | | [optional] +**multiplier** | **str** | | [optional] +**market_flags** | **int** | | [optional] +**funding_premium_multiplier** | **int** | | [optional] ## Example diff --git a/docs/RFQMetadata.md b/docs/RFQMetadata.md index 19cf57c4..afd3f95a 100644 --- a/docs/RFQMetadata.md +++ b/docs/RFQMetadata.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **requested_max_slippage** | **str** | | **requested_slippage** | **str** | | **worst_price** | **str** | | +**mark_price** | **str** | | ## Example diff --git a/docs/ReferralApi.md b/docs/ReferralApi.md index 389e7fd4..1fed20c3 100644 --- a/docs/ReferralApi.md +++ b/docs/ReferralApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **referral_create** -> ReferralCode referral_create(account_index, authorization=authorization, auth=auth) +> ReferralCode referral_create(account_index, authorization=authorization) referral_create @@ -40,12 +40,11 @@ async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.ReferralApi(api_client) account_index = 56 # int | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) + authorization = 'authorization_example' # str | (optional) try: # referral_create - api_response = await api_instance.referral_create(account_index, authorization=authorization, auth=auth) + api_response = await api_instance.referral_create(account_index, authorization=authorization) print("The response of ReferralApi->referral_create:\n") pprint(api_response) except Exception as e: @@ -60,8 +59,7 @@ async with lighter.ApiClient(configuration) as api_client: 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] + **authorization** | **str**| | [optional] ### Return type @@ -86,7 +84,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) # **referral_get** -> ReferralCode referral_get(account_index, authorization=authorization, auth=auth) +> ReferralCode referral_get(account_index, authorization=authorization) referral_get @@ -113,12 +111,11 @@ async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.ReferralApi(api_client) account_index = 56 # int | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) + authorization = 'authorization_example' # str | (optional) try: # referral_get - api_response = await api_instance.referral_get(account_index, authorization=authorization, auth=auth) + api_response = await api_instance.referral_get(account_index, authorization=authorization) print("The response of ReferralApi->referral_get:\n") pprint(api_response) except Exception as e: @@ -133,8 +130,7 @@ async with lighter.ApiClient(configuration) as api_client: 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] + **authorization** | **str**| | [optional] ### Return type @@ -159,7 +155,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) # **referral_kickback_update** -> RespUpdateKickback referral_kickback_update(account_index, kickback_percentage, authorization=authorization, auth=auth) +> RespUpdateKickback referral_kickback_update(account_index, kickback_percentage, authorization=authorization) referral_kickback_update @@ -187,12 +183,11 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.ReferralApi(api_client) account_index = 56 # int | kickback_percentage = 3.4 # float | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) + authorization = 'authorization_example' # str | (optional) try: # referral_kickback_update - api_response = await api_instance.referral_kickback_update(account_index, kickback_percentage, authorization=authorization, auth=auth) + api_response = await api_instance.referral_kickback_update(account_index, kickback_percentage, authorization=authorization) print("The response of ReferralApi->referral_kickback_update:\n") pprint(api_response) except Exception as e: @@ -208,8 +203,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_index** | **int**| | **kickback_percentage** | **float**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **authorization** | **str**| | [optional] ### Return type @@ -305,7 +299,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) # **referral_update** -> RespUpdateReferralCode referral_update(account_index, new_referral_code, authorization=authorization, auth=auth) +> RespUpdateReferralCode referral_update(account_index, new_referral_code, authorization=authorization) referral_update @@ -333,12 +327,11 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.ReferralApi(api_client) account_index = 56 # int | new_referral_code = 'new_referral_code_example' # str | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) + authorization = 'authorization_example' # str | (optional) try: # referral_update - api_response = await api_instance.referral_update(account_index, new_referral_code, authorization=authorization, auth=auth) + api_response = await api_instance.referral_update(account_index, new_referral_code, authorization=authorization) print("The response of ReferralApi->referral_update:\n") pprint(api_response) except Exception as e: @@ -354,8 +347,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_index** | **int**| | **new_referral_code** | **str**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **authorization** | **str**| | [optional] ### Return type @@ -380,7 +372,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) # **referral_use** -> ResultCode referral_use(l1_address, referral_code, x, authorization=authorization, auth=auth, discord=discord, telegram=telegram, signature=signature) +> ResultCode referral_use(l1_address, referral_code, authorization=authorization, discord=discord, telegram=telegram, x=x, signature=signature) referral_use @@ -408,16 +400,15 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.ReferralApi(api_client) l1_address = 'l1_address_example' # str | referral_code = 'referral_code_example' # str | - x = 'x_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) + authorization = 'authorization_example' # str | (optional) discord = 'discord_example' # str | (optional) telegram = 'telegram_example' # str | (optional) + x = 'x_example' # str | (optional) signature = 'signature_example' # str | (optional) try: # referral_use - api_response = await api_instance.referral_use(l1_address, referral_code, x, authorization=authorization, auth=auth, discord=discord, telegram=telegram, signature=signature) + api_response = await api_instance.referral_use(l1_address, referral_code, authorization=authorization, discord=discord, telegram=telegram, x=x, signature=signature) print("The response of ReferralApi->referral_use:\n") pprint(api_response) except Exception as e: @@ -433,11 +424,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **l1_address** | **str**| | **referral_code** | **str**| | - **x** | **str**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **authorization** | **str**| | [optional] **discord** | **str**| | [optional] **telegram** | **str**| | [optional] + **x** | **str**| | [optional] **signature** | **str**| | [optional] ### Return type diff --git a/docs/ReferralCode.md b/docs/ReferralCode.md index 4bcf6d7f..c3c090ab 100644 --- a/docs/ReferralCode.md +++ b/docs/ReferralCode.md @@ -8,7 +8,6 @@ Name | Type | Description | Notes **code** | **int** | | **message** | **str** | | [optional] **referral_code** | **str** | | -**remaining_usage** | **int** | | ## Example diff --git a/docs/ReferralProgramKickback.md b/docs/ReferralProgramKickback.md new file mode 100644 index 00000000..b16a9b4c --- /dev/null +++ b/docs/ReferralProgramKickback.md @@ -0,0 +1,30 @@ +# ReferralProgramKickback + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **int** | | +**percentage** | **str** | | + +## Example + +```python +from lighter.models.referral_program_kickback import ReferralProgramKickback + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferralProgramKickback from a JSON string +referral_program_kickback_instance = ReferralProgramKickback.from_json(json) +# print the JSON string representation of the object +print(ReferralProgramKickback.to_json()) + +# convert the object into a dict +referral_program_kickback_dict = referral_program_kickback_instance.to_dict() +# create an instance of ReferralProgramKickback from a dict +referral_program_kickback_from_dict = ReferralProgramKickback.from_dict(referral_program_kickback_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReferralTotals.md b/docs/ReferralTotals.md new file mode 100644 index 00000000..bbeaba0a --- /dev/null +++ b/docs/ReferralTotals.md @@ -0,0 +1,38 @@ +# ReferralTotals + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | | +**volume** | **str** | | +**free_maker_volume** | **str** | | +**free_taker_volume** | **str** | | +**non_free_maker_volume** | **str** | | +**non_free_taker_volume** | **str** | | +**maker_fees_paid** | **str** | | +**taker_fees_paid** | **str** | | +**total_referrals** | **int** | | +**total_premium_referrals** | **int** | | + +## Example + +```python +from lighter.models.referral_totals import ReferralTotals + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferralTotals from a JSON string +referral_totals_instance = ReferralTotals.from_json(json) +# print the JSON string representation of the object +print(ReferralTotals.to_json()) + +# convert the object into a dict +referral_totals_dict = referral_totals_instance.to_dict() +# create an instance of ReferralTotals from a dict +referral_totals_from_dict = ReferralTotals.from_dict(referral_totals_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/ReqSetAccountMetadata.md b/docs/ReqSetAccountMetadata.md index 62756e9c..eb8180be 100644 --- a/docs/ReqSetAccountMetadata.md +++ b/docs/ReqSetAccountMetadata.md @@ -9,7 +9,6 @@ Name | Type | Description | Notes **target_account_index** | **int** | | **api_key_index** | **int** | | **metadata** | **str** | | -**auth** | **str** | | [optional] ## Example diff --git a/docs/RiskParameters.md b/docs/RiskParameters.md index 8c93fe40..2a385075 100644 --- a/docs/RiskParameters.md +++ b/docs/RiskParameters.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **total_account_liquidation_threshold** | **str** | | **usdc_collateral_with_funding** | **str** | | **usdc_portfolio_value** | **str** | | +**total_portfolio_value** | **str** | | [optional] ## Example diff --git a/docs/SpotOrderBookDetail.md b/docs/SpotOrderBookDetail.md index e7d5ca51..cde90fe4 100644 --- a/docs/SpotOrderBookDetail.md +++ b/docs/SpotOrderBookDetail.md @@ -32,6 +32,8 @@ Name | Type | Description | Notes **daily_chart** | **Dict[str, float]** | | **is_maker_fee_enabled** | **bool** | | **is_taker_fee_enabled** | **bool** | | +**created_at** | **str** | | +**multiplier** | **str** | | ## Example diff --git a/docs/SubAccountMetadata.md b/docs/SubAccountMetadata.md new file mode 100644 index 00000000..b6304efc --- /dev/null +++ b/docs/SubAccountMetadata.md @@ -0,0 +1,29 @@ +# SubAccountMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **str** | | + +## Example + +```python +from lighter.models.sub_account_metadata import SubAccountMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of SubAccountMetadata from a JSON string +sub_account_metadata_instance = SubAccountMetadata.from_json(json) +# print the JSON string representation of the object +print(SubAccountMetadata.to_json()) + +# convert the object into a dict +sub_account_metadata_dict = sub_account_metadata_instance.to_dict() +# create an instance of SubAccountMetadata from a dict +sub_account_metadata_from_dict = SubAccountMetadata.from_dict(sub_account_metadata_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 140f1d2b..0ba4aab3 100644 --- a/docs/Trade.md +++ b/docs/Trade.md @@ -47,6 +47,8 @@ Name | Type | Description | Notes **taker_allocated_margin_usdc_after** | **int** | | **maker_allocated_margin_usdc_before** | **int** | | **maker_allocated_margin_usdc_after** | **int** | | +**bid_order_version** | **int** | | +**ask_order_version** | **int** | | ## Example diff --git a/docs/TradeStats.md b/docs/TradeStats.md index eb2ae62c..d6761df8 100644 --- a/docs/TradeStats.md +++ b/docs/TradeStats.md @@ -13,6 +13,12 @@ Name | Type | Description | Notes **mobile_app_volume** | **str** | | **mobile_browser_count** | **int** | | **mobile_browser_volume** | **str** | | +**maker_fees_paid** | **str** | | +**non_free_taker_volume** | **str** | | +**non_free_maker_volume** | **str** | | +**free_taker_volume** | **str** | | +**taker_fees_paid** | **str** | | +**free_maker_volume** | **str** | | ## Example diff --git a/docs/TransactionApi.md b/docs/TransactionApi.md index dd3fa167..7779fbfc 100644 --- a/docs/TransactionApi.md +++ b/docs/TransactionApi.md @@ -19,7 +19,7 @@ Method | HTTP request | Description # **account_txs** -> Txs account_txs(limit, by, value, index=index, authorization=authorization, auth=auth, types=types) +> Txs account_txs(limit, by, value, index=index, authorization=authorization, types=types) accountTxs @@ -49,13 +49,12 @@ async with lighter.ApiClient(configuration) as api_client: by = 'by_example' # str | value = 'value_example' # str | index = 56 # int | (optional) - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) + authorization = 'authorization_example' # str | (optional) types = [56] # List[int] | (optional) try: # accountTxs - api_response = await api_instance.account_txs(limit, by, value, index=index, authorization=authorization, auth=auth, types=types) + api_response = await api_instance.account_txs(limit, by, value, index=index, authorization=authorization, types=types) print("The response of TransactionApi->account_txs:\n") pprint(api_response) except Exception as e: @@ -73,8 +72,7 @@ Name | Type | Description | Notes **by** | **str**| | **value** | **str**| | **index** | **int**| | [optional] - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **authorization** | **str**| | [optional] **types** | [**List[int]**](int.md)| | [optional] ### Return type diff --git a/docs/UserReferrals.md b/docs/UserReferrals.md index d4b727cc..00243dc0 100644 --- a/docs/UserReferrals.md +++ b/docs/UserReferrals.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **cursor** | **str** | | **referrals** | [**List[Referral]**](Referral.md) | | **used_code** | **str** | | +**totals** | [**ReferralTotals**](ReferralTotals.md) | | ## Example diff --git a/lighter/__init__.py b/lighter/__init__.py index a45fd7b9..b43facbf 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -24,6 +24,7 @@ from lighter.api.candlestick_api import CandlestickApi from lighter.api.funding_api import FundingApi from lighter.api.info_api import InfoApi +from lighter.api.livepoints_api import LivepointsApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi from lighter.api.referral_api import ReferralApi @@ -85,17 +86,23 @@ from lighter.models.l1_metadata import L1Metadata from lighter.models.l1_provider_info import L1ProviderInfo from lighter.models.layer1_basic_info import Layer1BasicInfo +from lighter.models.leaderboard import Leaderboard +from lighter.models.leaderboard_entry import LeaderboardEntry 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 from lighter.models.liquidation_infos import LiquidationInfos +from lighter.models.live_points_total import LivePointsTotal +from lighter.models.mark_price_candle import MarkPriceCandle +from lighter.models.mark_price_candles import MarkPriceCandles from lighter.models.market_config import MarketConfig +from lighter.models.market_price_chart import MarketPriceChart +from lighter.models.market_price_charts import MarketPriceCharts from lighter.models.next_nonce import NextNonce from lighter.models.order import Order from lighter.models.order_book import OrderBook -from lighter.models.order_book_depth import OrderBookDepth from lighter.models.order_book_details import OrderBookDetails from lighter.models.order_book_orders import OrderBookOrders from lighter.models.order_book_stats import OrderBookStats @@ -107,7 +114,6 @@ from lighter.models.pn_l_entry import PnLEntry from lighter.models.position_funding import PositionFunding from lighter.models.position_fundings import PositionFundings -from lighter.models.price_level import PriceLevel from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_metadata import PublicPoolMetadata from lighter.models.public_pool_share import PublicPoolShare @@ -118,6 +124,8 @@ from lighter.models.referral_code import ReferralCode from lighter.models.referral_point_entry import ReferralPointEntry from lighter.models.referral_points import ReferralPoints +from lighter.models.referral_program_kickback import ReferralProgramKickback +from lighter.models.referral_totals import ReferralTotals from lighter.models.req_set_account_metadata import ReqSetAccountMetadata from lighter.models.resp_change_account_tier import RespChangeAccountTier from lighter.models.resp_create_rfq import RespCreateRFQ @@ -152,6 +160,7 @@ 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_account_metadata import SubAccountMetadata from lighter.models.sub_accounts import SubAccounts from lighter.models.system_config import SystemConfig from lighter.models.token import Token @@ -191,4 +200,4 @@ PaperOrderType, PaperPosition, PaperTrade, -) +) \ No newline at end of file diff --git a/lighter/api/__init__.py b/lighter/api/__init__.py index 4f71f1ed..ca0290d8 100644 --- a/lighter/api/__init__.py +++ b/lighter/api/__init__.py @@ -8,6 +8,7 @@ from lighter.api.candlestick_api import CandlestickApi from lighter.api.funding_api import FundingApi from lighter.api.info_api import InfoApi +from lighter.api.livepoints_api import LivepointsApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi from lighter.api.referral_api import ReferralApi diff --git a/lighter/api/account_api.py b/lighter/api/account_api.py index ec65efb8..67241b81 100644 --- a/lighter/api/account_api.py +++ b/lighter/api/account_api.py @@ -17,7 +17,7 @@ from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Optional +from typing import List, Optional from typing_extensions import Annotated from lighter.models.account_api_keys import AccountApiKeys from lighter.models.account_limits import AccountLimits @@ -25,6 +25,7 @@ from lighter.models.account_pn_l import AccountPnL from lighter.models.detailed_accounts import DetailedAccounts from lighter.models.l1_metadata import L1Metadata +from lighter.models.leaderboard import Leaderboard from lighter.models.liquidation_infos import LiquidationInfos from lighter.models.partner_stats import PartnerStats from lighter.models.position_fundings import PositionFundings @@ -1517,8 +1518,7 @@ async def change_account_tier( self, account_index: StrictInt, new_tier: 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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1540,10 +1540,8 @@ async def change_account_tier( :type account_index: int :param new_tier: (required) :type new_tier: str - :param authorization: make required after integ is done + :param authorization: :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 @@ -1570,7 +1568,6 @@ async def change_account_tier( account_index=account_index, new_tier=new_tier, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1596,8 +1593,7 @@ async def change_account_tier_with_http_info( self, account_index: StrictInt, new_tier: 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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1619,10 +1615,8 @@ async def change_account_tier_with_http_info( :type account_index: int :param new_tier: (required) :type new_tier: str - :param authorization: make required after integ is done + :param authorization: :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 @@ -1649,7 +1643,6 @@ async def change_account_tier_with_http_info( account_index=account_index, new_tier=new_tier, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1675,8 +1668,7 @@ async def change_account_tier_without_preload_content( self, account_index: StrictInt, new_tier: 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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1698,10 +1690,8 @@ async def change_account_tier_without_preload_content( :type account_index: int :param new_tier: (required) :type new_tier: str - :param authorization: make required after integ is done + :param authorization: :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 @@ -1728,7 +1718,6 @@ async def change_account_tier_without_preload_content( account_index=account_index, new_tier=new_tier, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1751,7 +1740,6 @@ def _change_account_tier_serialize( account_index, new_tier, authorization, - auth, _request_auth, _content_type, _headers, @@ -1776,8 +1764,6 @@ def _change_account_tier_serialize( if authorization is not None: _header_params['authorization'] = authorization # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) if account_index is not None: _form_params.append(('account_index', account_index)) if new_tier is not None: @@ -2379,6 +2365,315 @@ def _l1_metadata_serialize( + async def leaderboard( + self, + type: StrictStr, + authorization: Optional[StrictStr] = None, + l1_address: Optional[StrictStr] = None, + competition_id: 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, + ) -> Leaderboard: + """leaderboard + + Get points leaderboard. Type should be all. + + :param type: (required) + :type type: str + :param authorization: + :type authorization: str + :param l1_address: + :type l1_address: str + :param competition_id: + :type competition_id: 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._leaderboard_serialize( + type=type, + authorization=authorization, + l1_address=l1_address, + competition_id=competition_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Leaderboard", + '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 leaderboard_with_http_info( + self, + type: StrictStr, + authorization: Optional[StrictStr] = None, + l1_address: Optional[StrictStr] = None, + competition_id: 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[Leaderboard]: + """leaderboard + + Get points leaderboard. Type should be all. + + :param type: (required) + :type type: str + :param authorization: + :type authorization: str + :param l1_address: + :type l1_address: str + :param competition_id: + :type competition_id: 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._leaderboard_serialize( + type=type, + authorization=authorization, + l1_address=l1_address, + competition_id=competition_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Leaderboard", + '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 leaderboard_without_preload_content( + self, + type: StrictStr, + authorization: Optional[StrictStr] = None, + l1_address: Optional[StrictStr] = None, + competition_id: 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: + """leaderboard + + Get points leaderboard. Type should be all. + + :param type: (required) + :type type: str + :param authorization: + :type authorization: str + :param l1_address: + :type l1_address: str + :param competition_id: + :type competition_id: 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._leaderboard_serialize( + type=type, + authorization=authorization, + l1_address=l1_address, + competition_id=competition_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Leaderboard", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _leaderboard_serialize( + self, + type, + authorization, + l1_address, + competition_id, + _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 type is not None: + + _query_params.append(('type', type)) + + if l1_address is not None: + + _query_params.append(('l1_address', l1_address)) + + if competition_id is not None: + + _query_params.append(('competition_id', competition_id)) + + # 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/leaderboard', + 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 lease_options( self, _request_timeout: Union[ @@ -2628,7 +2923,6 @@ async def leases( authorization: Annotated[Optional[StrictStr], Field(description="API token authorization")] = None, cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor from a previous response")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of results to return (1–100, default 20)")] = None, - auth: Annotated[Optional[StrictStr], Field(description="Read-only auth (alternative to header authorization)")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2654,8 +2948,6 @@ async def leases( :type cursor: str :param limit: Number of results to return (1–100, default 20) :type limit: int - :param auth: Read-only auth (alternative to header authorization) - :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 @@ -2683,7 +2975,6 @@ async def leases( authorization=authorization, cursor=cursor, limit=limit, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2711,7 +3002,6 @@ async def leases_with_http_info( authorization: Annotated[Optional[StrictStr], Field(description="API token authorization")] = None, cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor from a previous response")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of results to return (1–100, default 20)")] = None, - auth: Annotated[Optional[StrictStr], Field(description="Read-only auth (alternative to header authorization)")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2737,8 +3027,6 @@ async def leases_with_http_info( :type cursor: str :param limit: Number of results to return (1–100, default 20) :type limit: int - :param auth: Read-only auth (alternative to header authorization) - :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 @@ -2766,7 +3054,6 @@ async def leases_with_http_info( authorization=authorization, cursor=cursor, limit=limit, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2794,7 +3081,6 @@ async def leases_without_preload_content( authorization: Annotated[Optional[StrictStr], Field(description="API token authorization")] = None, cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor from a previous response")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Number of results to return (1–100, default 20)")] = None, - auth: Annotated[Optional[StrictStr], Field(description="Read-only auth (alternative to header authorization)")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2820,8 +3106,6 @@ async def leases_without_preload_content( :type cursor: str :param limit: Number of results to return (1–100, default 20) :type limit: int - :param auth: Read-only auth (alternative to header authorization) - :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 @@ -2849,7 +3133,6 @@ async def leases_without_preload_content( authorization=authorization, cursor=cursor, limit=limit, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2873,7 +3156,6 @@ def _leases_serialize( authorization, cursor, limit, - auth, _request_auth, _content_type, _headers, @@ -2906,10 +3188,6 @@ def _leases_serialize( _query_params.append(('limit', limit)) - if auth is not None: - - _query_params.append(('auth', auth)) - # process the header parameters if authorization is not None: _header_params['authorization'] = authorization @@ -3595,6 +3873,7 @@ async def partner_stats( account_index: StrictInt, start_timestamp: Optional[StrictInt] = None, end_timestamp: Optional[StrictInt] = None, + period: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3618,6 +3897,8 @@ async def partner_stats( :type start_timestamp: int :param end_timestamp: :type end_timestamp: int + :param period: + :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 @@ -3644,6 +3925,7 @@ async def partner_stats( account_index=account_index, start_timestamp=start_timestamp, end_timestamp=end_timestamp, + period=period, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3670,6 +3952,7 @@ async def partner_stats_with_http_info( account_index: StrictInt, start_timestamp: Optional[StrictInt] = None, end_timestamp: Optional[StrictInt] = None, + period: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3693,6 +3976,8 @@ async def partner_stats_with_http_info( :type start_timestamp: int :param end_timestamp: :type end_timestamp: int + :param period: + :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 @@ -3719,6 +4004,7 @@ async def partner_stats_with_http_info( account_index=account_index, start_timestamp=start_timestamp, end_timestamp=end_timestamp, + period=period, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3745,6 +4031,7 @@ async def partner_stats_without_preload_content( account_index: StrictInt, start_timestamp: Optional[StrictInt] = None, end_timestamp: Optional[StrictInt] = None, + period: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3768,6 +4055,8 @@ async def partner_stats_without_preload_content( :type start_timestamp: int :param end_timestamp: :type end_timestamp: int + :param period: + :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 @@ -3794,6 +4083,7 @@ async def partner_stats_without_preload_content( account_index=account_index, start_timestamp=start_timestamp, end_timestamp=end_timestamp, + period=period, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3816,6 +4106,7 @@ def _partner_stats_serialize( account_index, start_timestamp, end_timestamp, + period, _request_auth, _content_type, _headers, @@ -3848,6 +4139,10 @@ def _partner_stats_serialize( _query_params.append(('end_timestamp', end_timestamp)) + if period is not None: + + _query_params.append(('period', period)) + # process the header parameters # process the form parameters # process the body parameter @@ -4266,11 +4561,11 @@ async def position_funding( account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], authorization: Optional[StrictStr] = None, - market_id: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, side: Optional[StrictStr] = None, start_timestamp: Optional[StrictInt] = None, end_timestamp: Optional[StrictInt] = None, + market_ids: Annotated[Optional[List[StrictInt]], Field(description="comma-separated int64s, e.g. \"1,2\"")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4294,8 +4589,6 @@ async def position_funding( :type limit: int :param authorization: :type authorization: str - :param market_id: - :type market_id: int :param cursor: :type cursor: str :param side: @@ -4304,6 +4597,8 @@ async def position_funding( :type start_timestamp: int :param end_timestamp: :type end_timestamp: int + :param market_ids: comma-separated int64s, e.g. \"1,2\" + :type market_ids: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4330,11 +4625,11 @@ async def position_funding( account_index=account_index, limit=limit, authorization=authorization, - market_id=market_id, cursor=cursor, side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp, + market_ids=market_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4361,11 +4656,11 @@ async def position_funding_with_http_info( account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], authorization: Optional[StrictStr] = None, - market_id: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, side: Optional[StrictStr] = None, start_timestamp: Optional[StrictInt] = None, end_timestamp: Optional[StrictInt] = None, + market_ids: Annotated[Optional[List[StrictInt]], Field(description="comma-separated int64s, e.g. \"1,2\"")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4389,8 +4684,6 @@ async def position_funding_with_http_info( :type limit: int :param authorization: :type authorization: str - :param market_id: - :type market_id: int :param cursor: :type cursor: str :param side: @@ -4399,6 +4692,8 @@ async def position_funding_with_http_info( :type start_timestamp: int :param end_timestamp: :type end_timestamp: int + :param market_ids: comma-separated int64s, e.g. \"1,2\" + :type market_ids: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4425,11 +4720,11 @@ async def position_funding_with_http_info( account_index=account_index, limit=limit, authorization=authorization, - market_id=market_id, cursor=cursor, side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp, + market_ids=market_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4456,11 +4751,11 @@ async def position_funding_without_preload_content( account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], authorization: Optional[StrictStr] = None, - market_id: Optional[StrictInt] = None, cursor: Optional[StrictStr] = None, side: Optional[StrictStr] = None, start_timestamp: Optional[StrictInt] = None, end_timestamp: Optional[StrictInt] = None, + market_ids: Annotated[Optional[List[StrictInt]], Field(description="comma-separated int64s, e.g. \"1,2\"")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4484,8 +4779,6 @@ async def position_funding_without_preload_content( :type limit: int :param authorization: :type authorization: str - :param market_id: - :type market_id: int :param cursor: :type cursor: str :param side: @@ -4494,6 +4787,8 @@ async def position_funding_without_preload_content( :type start_timestamp: int :param end_timestamp: :type end_timestamp: int + :param market_ids: comma-separated int64s, e.g. \"1,2\" + :type market_ids: List[int] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4520,11 +4815,11 @@ async def position_funding_without_preload_content( account_index=account_index, limit=limit, authorization=authorization, - market_id=market_id, cursor=cursor, side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp, + market_ids=market_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4547,11 +4842,11 @@ def _position_funding_serialize( account_index, limit, authorization, - market_id, cursor, side, start_timestamp, end_timestamp, + market_ids, _request_auth, _content_type, _headers, @@ -4561,6 +4856,7 @@ def _position_funding_serialize( _host = None _collection_formats: Dict[str, str] = { + 'market_ids': 'multi', } _path_params: Dict[str, str] = {} @@ -4576,10 +4872,6 @@ def _position_funding_serialize( _query_params.append(('account_index', account_index)) - if market_id is not None: - - _query_params.append(('market_id', market_id)) - if cursor is not None: _query_params.append(('cursor', cursor)) @@ -4600,6 +4892,10 @@ def _position_funding_serialize( _query_params.append(('end_timestamp', end_timestamp)) + if market_ids is not None: + + _query_params.append(('market_ids', market_ids)) + # process the header parameters if authorization is not None: _header_params['authorization'] = authorization @@ -4969,10 +5265,10 @@ async def referral_user_referrals( l1_address: StrictStr, authorization: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, stats_start_timestamp: Optional[StrictInt] = None, stats_end_timestamp: Optional[StrictInt] = None, limit: Optional[Annotated[int, Field(le=300, strict=True, ge=1)]] = None, + is_eligible: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4996,14 +5292,14 @@ async def referral_user_referrals( :type authorization: str :param cursor: :type cursor: str - :param auth: - :type auth: str :param stats_start_timestamp: :type stats_start_timestamp: int :param stats_end_timestamp: :type stats_end_timestamp: int :param limit: :type limit: int + :param is_eligible: + :type is_eligible: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5030,10 +5326,10 @@ async def referral_user_referrals( l1_address=l1_address, authorization=authorization, cursor=cursor, - auth=auth, stats_start_timestamp=stats_start_timestamp, stats_end_timestamp=stats_end_timestamp, limit=limit, + is_eligible=is_eligible, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5060,10 +5356,10 @@ async def referral_user_referrals_with_http_info( l1_address: StrictStr, authorization: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, stats_start_timestamp: Optional[StrictInt] = None, stats_end_timestamp: Optional[StrictInt] = None, limit: Optional[Annotated[int, Field(le=300, strict=True, ge=1)]] = None, + is_eligible: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5087,14 +5383,14 @@ async def referral_user_referrals_with_http_info( :type authorization: str :param cursor: :type cursor: str - :param auth: - :type auth: str :param stats_start_timestamp: :type stats_start_timestamp: int :param stats_end_timestamp: :type stats_end_timestamp: int :param limit: :type limit: int + :param is_eligible: + :type is_eligible: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5121,10 +5417,10 @@ async def referral_user_referrals_with_http_info( l1_address=l1_address, authorization=authorization, cursor=cursor, - auth=auth, stats_start_timestamp=stats_start_timestamp, stats_end_timestamp=stats_end_timestamp, limit=limit, + is_eligible=is_eligible, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5151,10 +5447,10 @@ async def referral_user_referrals_without_preload_content( l1_address: StrictStr, authorization: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, stats_start_timestamp: Optional[StrictInt] = None, stats_end_timestamp: Optional[StrictInt] = None, limit: Optional[Annotated[int, Field(le=300, strict=True, ge=1)]] = None, + is_eligible: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5178,14 +5474,14 @@ async def referral_user_referrals_without_preload_content( :type authorization: str :param cursor: :type cursor: str - :param auth: - :type auth: str :param stats_start_timestamp: :type stats_start_timestamp: int :param stats_end_timestamp: :type stats_end_timestamp: int :param limit: :type limit: int + :param is_eligible: + :type is_eligible: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5212,10 +5508,10 @@ async def referral_user_referrals_without_preload_content( l1_address=l1_address, authorization=authorization, cursor=cursor, - auth=auth, stats_start_timestamp=stats_start_timestamp, stats_end_timestamp=stats_end_timestamp, limit=limit, + is_eligible=is_eligible, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5238,10 +5534,10 @@ def _referral_user_referrals_serialize( l1_address, authorization, cursor, - auth, stats_start_timestamp, stats_end_timestamp, limit, + is_eligible, _request_auth, _content_type, _headers, @@ -5270,10 +5566,6 @@ def _referral_user_referrals_serialize( _query_params.append(('cursor', cursor)) - if auth is not None: - - _query_params.append(('auth', auth)) - if stats_start_timestamp is not None: _query_params.append(('stats_start_timestamp', stats_start_timestamp)) @@ -5286,6 +5578,10 @@ def _referral_user_referrals_serialize( _query_params.append(('limit', limit)) + if is_eligible is not None: + + _query_params.append(('is_eligible', is_eligible)) + # process the header parameters if authorization is not None: _header_params['authorization'] = authorization @@ -5347,7 +5643,7 @@ async def rfq_create( ) -> RespCreateRFQ: """rfq_create - Create RFQ + Create RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing. :param authorization: (required) :type authorization: str @@ -5434,7 +5730,7 @@ async def rfq_create_with_http_info( ) -> ApiResponse[RespCreateRFQ]: """rfq_create - Create RFQ + Create RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing. :param authorization: (required) :type authorization: str @@ -5521,7 +5817,7 @@ async def rfq_create_without_preload_content( ) -> RESTResponseType: """rfq_create - Create RFQ + Create RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing. :param authorization: (required) :type authorization: str @@ -6291,7 +6587,7 @@ async def rfq_respond( ) -> RespRespondToRFQ: """rfq_respond - Respond to RFQ + Respond to RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing. :param authorization: (required) :type authorization: str @@ -6366,7 +6662,7 @@ async def rfq_respond_with_http_info( ) -> ApiResponse[RespRespondToRFQ]: """rfq_respond - Respond to RFQ + Respond to RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing. :param authorization: (required) :type authorization: str @@ -6441,7 +6737,7 @@ async def rfq_respond_without_preload_content( ) -> RESTResponseType: """rfq_respond - Respond to RFQ + Respond to RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing. :param authorization: (required) :type authorization: str @@ -6878,7 +7174,6 @@ async def set_maker_only_api_keys( authorization: StrictStr, account_index: StrictInt, api_key_indexes: Annotated[StrictStr, Field(description="JSON array string of API key indexes, e.g. \\\"[4,5]\\\". Use [] to clear all maker-only restrictions.")], - auth: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6902,8 +7197,6 @@ async def set_maker_only_api_keys( :type account_index: int :param api_key_indexes: JSON array string of API key indexes, e.g. \\\"[4,5]\\\". Use [] to clear all maker-only restrictions. (required) :type api_key_indexes: str - :param auth: - :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6930,7 +7223,6 @@ async def set_maker_only_api_keys( authorization=authorization, account_index=account_index, api_key_indexes=api_key_indexes, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6957,7 +7249,6 @@ async def set_maker_only_api_keys_with_http_info( authorization: StrictStr, account_index: StrictInt, api_key_indexes: Annotated[StrictStr, Field(description="JSON array string of API key indexes, e.g. \\\"[4,5]\\\". Use [] to clear all maker-only restrictions.")], - auth: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6981,8 +7272,6 @@ async def set_maker_only_api_keys_with_http_info( :type account_index: int :param api_key_indexes: JSON array string of API key indexes, e.g. \\\"[4,5]\\\". Use [] to clear all maker-only restrictions. (required) :type api_key_indexes: str - :param auth: - :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7009,7 +7298,6 @@ async def set_maker_only_api_keys_with_http_info( authorization=authorization, account_index=account_index, api_key_indexes=api_key_indexes, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7036,7 +7324,6 @@ async def set_maker_only_api_keys_without_preload_content( authorization: StrictStr, account_index: StrictInt, api_key_indexes: Annotated[StrictStr, Field(description="JSON array string of API key indexes, e.g. \\\"[4,5]\\\". Use [] to clear all maker-only restrictions.")], - auth: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7060,8 +7347,6 @@ async def set_maker_only_api_keys_without_preload_content( :type account_index: int :param api_key_indexes: JSON array string of API key indexes, e.g. \\\"[4,5]\\\". Use [] to clear all maker-only restrictions. (required) :type api_key_indexes: str - :param auth: - :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7088,7 +7373,6 @@ async def set_maker_only_api_keys_without_preload_content( authorization=authorization, account_index=account_index, api_key_indexes=api_key_indexes, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7111,7 +7395,6 @@ def _set_maker_only_api_keys_serialize( authorization, account_index, api_key_indexes, - auth, _request_auth, _content_type, _headers, @@ -7140,8 +7423,6 @@ def _set_maker_only_api_keys_serialize( _form_params.append(('account_index', account_index)) if api_key_indexes is not None: _form_params.append(('api_key_indexes', api_key_indexes)) - if auth is not None: - _form_params.append(('auth', auth)) # process the body parameter @@ -7193,7 +7474,7 @@ def _set_maker_only_api_keys_serialize( async def tokens( self, account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7213,7 +7494,7 @@ async def tokens( :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :type authorization: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -7264,7 +7545,7 @@ async def tokens( async def tokens_with_http_info( self, account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7284,7 +7565,7 @@ async def tokens_with_http_info( :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :type authorization: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -7335,7 +7616,7 @@ async def tokens_with_http_info( async def tokens_without_preload_content( self, account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7355,7 +7636,7 @@ async def tokens_without_preload_content( :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :type authorization: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/lighter/api/bridge_api.py b/lighter/api/bridge_api.py index d31de1ef..db5b5e4d 100644 --- a/lighter/api/bridge_api.py +++ b/lighter/api/bridge_api.py @@ -16,9 +16,8 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr +from pydantic import StrictBool, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from lighter.models.bridge_supported_networks import BridgeSupportedNetworks from lighter.models.create_intent_address_resp import CreateIntentAddressResp from lighter.models.deposit import Deposit @@ -1110,8 +1109,7 @@ async def fastwithdraw( self, tx_info: StrictStr, to_address: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1133,10 +1131,8 @@ async def fastwithdraw( :type tx_info: str :param to_address: (required) :type to_address: str - :param authorization: make required after integ is done + :param authorization: :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 @@ -1163,7 +1159,6 @@ async def fastwithdraw( tx_info=tx_info, to_address=to_address, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1189,8 +1184,7 @@ async def fastwithdraw_with_http_info( self, tx_info: StrictStr, to_address: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1212,10 +1206,8 @@ async def fastwithdraw_with_http_info( :type tx_info: str :param to_address: (required) :type to_address: str - :param authorization: make required after integ is done + :param authorization: :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 @@ -1242,7 +1234,6 @@ async def fastwithdraw_with_http_info( tx_info=tx_info, to_address=to_address, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1268,8 +1259,7 @@ async def fastwithdraw_without_preload_content( self, tx_info: StrictStr, to_address: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1291,10 +1281,8 @@ async def fastwithdraw_without_preload_content( :type tx_info: str :param to_address: (required) :type to_address: str - :param authorization: make required after integ is done + :param authorization: :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 @@ -1321,7 +1309,6 @@ async def fastwithdraw_without_preload_content( tx_info=tx_info, to_address=to_address, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1344,7 +1331,6 @@ def _fastwithdraw_serialize( tx_info, to_address, authorization, - auth, _request_auth, _content_type, _headers, @@ -1373,8 +1359,6 @@ def _fastwithdraw_serialize( _form_params.append(('tx_info', tx_info)) if to_address is not None: _form_params.append(('to_address', to_address)) - if auth is not None: - _form_params.append(('auth', auth)) # process the body parameter diff --git a/lighter/api/candlestick_api.py b/lighter/api/candlestick_api.py index 571740ec..84984bf6 100644 --- a/lighter/api/candlestick_api.py +++ b/lighter/api/candlestick_api.py @@ -17,10 +17,12 @@ from typing_extensions import Annotated from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Optional +from typing import List, Optional from typing_extensions import Annotated from lighter.models.candles import Candles from lighter.models.fundings import Fundings +from lighter.models.mark_price_candles import MarkPriceCandles +from lighter.models.market_price_charts import MarketPriceCharts from lighter.api_client import ApiClient, RequestSerialized from lighter.api_response import ApiResponse @@ -407,7 +409,7 @@ async def fundings( ) -> Fundings: """fundings - Get fundings + Get fundings. Maximum 750 fundings will be returned per call. `count_back` indicates the number of fundings you would like to be returned, starting from `start_timestamp`, if set to 0, all fundings will be returned. :param market_id: (required) :type market_id: int @@ -490,7 +492,7 @@ async def fundings_with_http_info( ) -> ApiResponse[Fundings]: """fundings - Get fundings + Get fundings. Maximum 750 fundings will be returned per call. `count_back` indicates the number of fundings you would like to be returned, starting from `start_timestamp`, if set to 0, all fundings will be returned. :param market_id: (required) :type market_id: int @@ -573,7 +575,7 @@ async def fundings_without_preload_content( ) -> RESTResponseType: """fundings - Get fundings + Get fundings. Maximum 750 fundings will be returned per call. `count_back` indicates the number of fundings you would like to be returned, starting from `start_timestamp`, if set to 0, all fundings will be returned. :param market_id: (required) :type market_id: int @@ -711,3 +713,592 @@ def _fundings_serialize( ) + + + async def mark_price_candles( + self, + market_id: StrictInt, + resolution: StrictStr, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + count_back: StrictInt, + _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, + ) -> MarkPriceCandles: + """markPriceCandles + + Get mark price candles + + :param market_id: (required) + :type market_id: int + :param resolution: (required) + :type resolution: str + :param start_timestamp: (required) + :type start_timestamp: int + :param end_timestamp: (required) + :type end_timestamp: int + :param count_back: (required) + :type count_back: 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._mark_price_candles_serialize( + market_id=market_id, + resolution=resolution, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + count_back=count_back, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MarkPriceCandles", + '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 mark_price_candles_with_http_info( + self, + market_id: StrictInt, + resolution: StrictStr, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + count_back: StrictInt, + _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[MarkPriceCandles]: + """markPriceCandles + + Get mark price candles + + :param market_id: (required) + :type market_id: int + :param resolution: (required) + :type resolution: str + :param start_timestamp: (required) + :type start_timestamp: int + :param end_timestamp: (required) + :type end_timestamp: int + :param count_back: (required) + :type count_back: 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._mark_price_candles_serialize( + market_id=market_id, + resolution=resolution, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + count_back=count_back, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MarkPriceCandles", + '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 mark_price_candles_without_preload_content( + self, + market_id: StrictInt, + resolution: StrictStr, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + count_back: StrictInt, + _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: + """markPriceCandles + + Get mark price candles + + :param market_id: (required) + :type market_id: int + :param resolution: (required) + :type resolution: str + :param start_timestamp: (required) + :type start_timestamp: int + :param end_timestamp: (required) + :type end_timestamp: int + :param count_back: (required) + :type count_back: 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._mark_price_candles_serialize( + market_id=market_id, + resolution=resolution, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + count_back=count_back, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MarkPriceCandles", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _mark_price_candles_serialize( + self, + market_id, + resolution, + start_timestamp, + end_timestamp, + count_back, + _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 market_id is not None: + + _query_params.append(('market_id', market_id)) + + if resolution is not None: + + _query_params.append(('resolution', resolution)) + + 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 count_back is not None: + + _query_params.append(('count_back', count_back)) + + # 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/markPriceCandles', + 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 market_price_charts( + self, + market_ids: Optional[List[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, + ) -> MarketPriceCharts: + """marketPriceCharts + + Get last 24h hourly prices for all markets (mark price for perps, index price for spot) + + :param market_ids: + :type market_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._market_price_charts_serialize( + market_ids=market_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MarketPriceCharts", + '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 market_price_charts_with_http_info( + self, + market_ids: Optional[List[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[MarketPriceCharts]: + """marketPriceCharts + + Get last 24h hourly prices for all markets (mark price for perps, index price for spot) + + :param market_ids: + :type market_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._market_price_charts_serialize( + market_ids=market_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MarketPriceCharts", + '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 market_price_charts_without_preload_content( + self, + market_ids: Optional[List[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: + """marketPriceCharts + + Get last 24h hourly prices for all markets (mark price for perps, index price for spot) + + :param market_ids: + :type market_ids: List[int] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._market_price_charts_serialize( + market_ids=market_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MarketPriceCharts", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _market_price_charts_serialize( + self, + market_ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'market_ids': 'multi', + } + + _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 market_ids is not None: + + _query_params.append(('market_ids', market_ids)) + + # 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/marketPriceCharts', + 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/livepoints_api.py b/lighter/api/livepoints_api.py new file mode 100644 index 00000000..eeb8af20 --- /dev/null +++ b/lighter/api/livepoints_api.py @@ -0,0 +1,313 @@ +# 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 StrictInt, StrictStr +from typing import Optional +from lighter.models.live_points_total import LivePointsTotal + +from lighter.api_client import ApiClient, RequestSerialized +from lighter.api_response import ApiResponse +from lighter.rest import RESTResponseType + + +class LivepointsApi: + """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 live_points_total( + self, + account_index: StrictInt, + authorization: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LivePointsTotal: + """livePoints_total + + Get live points total for an account + + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._live_points_total_serialize( + account_index=account_index, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LivePointsTotal", + '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 live_points_total_with_http_info( + self, + account_index: StrictInt, + authorization: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LivePointsTotal]: + """livePoints_total + + Get live points total for an account + + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._live_points_total_serialize( + account_index=account_index, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LivePointsTotal", + '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 live_points_total_without_preload_content( + self, + account_index: StrictInt, + authorization: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """livePoints_total + + Get live points total for an account + + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._live_points_total_serialize( + account_index=account_index, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LivePointsTotal", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _live_points_total_serialize( + self, + account_index, + authorization, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if account_index is not None: + + _query_params.append(('account_index', account_index)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/livePoints/total', + 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/notification_api.py b/lighter/api/notification_api.py index f3ee029b..cbe0c02f 100644 --- a/lighter/api/notification_api.py +++ b/lighter/api/notification_api.py @@ -16,9 +16,8 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr +from pydantic import StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from lighter.models.result_code import ResultCode from lighter.api_client import ApiClient, RequestSerialized @@ -43,8 +42,7 @@ async def notification_ack( self, notif_id: StrictStr, 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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -66,10 +64,8 @@ async def notification_ack( :type notif_id: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :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 @@ -96,7 +92,6 @@ async def notification_ack( notif_id=notif_id, account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -122,8 +117,7 @@ async def notification_ack_with_http_info( self, notif_id: StrictStr, 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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -145,10 +139,8 @@ async def notification_ack_with_http_info( :type notif_id: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :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 @@ -175,7 +167,6 @@ async def notification_ack_with_http_info( notif_id=notif_id, account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -201,8 +192,7 @@ async def notification_ack_without_preload_content( self, notif_id: StrictStr, 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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -224,10 +214,8 @@ async def notification_ack_without_preload_content( :type notif_id: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :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 @@ -254,7 +242,6 @@ async def notification_ack_without_preload_content( notif_id=notif_id, account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -277,7 +264,6 @@ def _notification_ack_serialize( notif_id, account_index, authorization, - auth, _request_auth, _content_type, _headers, @@ -304,8 +290,6 @@ def _notification_ack_serialize( # process the form parameters if notif_id is not None: _form_params.append(('notif_id', notif_id)) - if auth is not None: - _form_params.append(('auth', auth)) if account_index is not None: _form_params.append(('account_index', account_index)) # process the body parameter diff --git a/lighter/api/order_api.py b/lighter/api/order_api.py index a01ead3f..6df1c42e 100644 --- a/lighter/api/order_api.py +++ b/lighter/api/order_api.py @@ -734,6 +734,298 @@ def _account_inactive_orders_serialize( + async def account_orders( + self, + authorization: StrictStr, + client_order_indexes: Annotated[StrictStr, Field(description=" comma-separated int64s, e.g. \"123,456\", with a limit of 20.")], + account_index: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Orders: + """accountOrders + + Get account orders by client order indexes. Account index defaults to the authorization token's account. Supports the last 10K active orders (with no time limits), or the last 1K inactive orders (in the last 24 hours). + + :param authorization: (required) + :type authorization: str + :param client_order_indexes: comma-separated int64s, e.g. \"123,456\", with a limit of 20. (required) + :type client_order_indexes: str + :param account_index: + :type account_index: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_orders_serialize( + authorization=authorization, + client_order_indexes=client_order_indexes, + account_index=account_index, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Orders", + '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 account_orders_with_http_info( + self, + authorization: StrictStr, + client_order_indexes: Annotated[StrictStr, Field(description=" comma-separated int64s, e.g. \"123,456\", with a limit of 20.")], + account_index: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Orders]: + """accountOrders + + Get account orders by client order indexes. Account index defaults to the authorization token's account. Supports the last 10K active orders (with no time limits), or the last 1K inactive orders (in the last 24 hours). + + :param authorization: (required) + :type authorization: str + :param client_order_indexes: comma-separated int64s, e.g. \"123,456\", with a limit of 20. (required) + :type client_order_indexes: str + :param account_index: + :type account_index: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_orders_serialize( + authorization=authorization, + client_order_indexes=client_order_indexes, + account_index=account_index, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Orders", + '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 account_orders_without_preload_content( + self, + authorization: StrictStr, + client_order_indexes: Annotated[StrictStr, Field(description=" comma-separated int64s, e.g. \"123,456\", with a limit of 20.")], + account_index: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """accountOrders + + Get account orders by client order indexes. Account index defaults to the authorization token's account. Supports the last 10K active orders (with no time limits), or the last 1K inactive orders (in the last 24 hours). + + :param authorization: (required) + :type authorization: str + :param client_order_indexes: comma-separated int64s, e.g. \"123,456\", with a limit of 20. (required) + :type client_order_indexes: str + :param account_index: + :type account_index: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._account_orders_serialize( + authorization=authorization, + client_order_indexes=client_order_indexes, + account_index=account_index, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Orders", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _account_orders_serialize( + self, + authorization, + client_order_indexes, + account_index, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if account_index is not None: + + _query_params.append(('account_index', account_index)) + + if client_order_indexes is not None: + + _query_params.append(('client_order_indexes', client_order_indexes)) + + # 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/accountOrders', + 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 asset_details( self, asset_id: Optional[StrictInt] = None, @@ -1819,6 +2111,7 @@ async def export( side: Optional[StrictStr] = None, role: Optional[StrictStr] = None, trade_type: Optional[StrictStr] = None, + aggregate: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1854,6 +2147,8 @@ async def export( :type role: str :param trade_type: :type trade_type: str + :param aggregate: + :type aggregate: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1886,6 +2181,7 @@ async def export( side=side, role=role, trade_type=trade_type, + aggregate=aggregate, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1918,6 +2214,7 @@ async def export_with_http_info( side: Optional[StrictStr] = None, role: Optional[StrictStr] = None, trade_type: Optional[StrictStr] = None, + aggregate: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1953,6 +2250,8 @@ async def export_with_http_info( :type role: str :param trade_type: :type trade_type: str + :param aggregate: + :type aggregate: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1985,6 +2284,7 @@ async def export_with_http_info( side=side, role=role, trade_type=trade_type, + aggregate=aggregate, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2017,6 +2317,7 @@ async def export_without_preload_content( side: Optional[StrictStr] = None, role: Optional[StrictStr] = None, trade_type: Optional[StrictStr] = None, + aggregate: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2052,6 +2353,8 @@ async def export_without_preload_content( :type role: str :param trade_type: :type trade_type: str + :param aggregate: + :type aggregate: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2084,6 +2387,7 @@ async def export_without_preload_content( side=side, role=role, trade_type=trade_type, + aggregate=aggregate, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2112,6 +2416,7 @@ def _export_serialize( side, role, trade_type, + aggregate, _request_auth, _content_type, _headers, @@ -2164,6 +2469,10 @@ def _export_serialize( _query_params.append(('trade_type', trade_type)) + if aggregate is not None: + + _query_params.append(('aggregate', aggregate)) + # process the header parameters if authorization is not None: _header_params['authorization'] = authorization diff --git a/lighter/api/referral_api.py b/lighter/api/referral_api.py index dfc50419..02e772e7 100644 --- a/lighter/api/referral_api.py +++ b/lighter/api/referral_api.py @@ -46,8 +46,7 @@ def __init__(self, api_client=None) -> None: async def referral_create( 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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -67,10 +66,8 @@ async def referral_create( :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :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 @@ -96,7 +93,6 @@ async def referral_create( _param = self._referral_create_serialize( account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -121,8 +117,7 @@ async def referral_create( async def referral_create_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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -142,10 +137,8 @@ async def referral_create_with_http_info( :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :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 @@ -171,7 +164,6 @@ async def referral_create_with_http_info( _param = self._referral_create_serialize( account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -196,8 +188,7 @@ async def referral_create_with_http_info( async def referral_create_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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -217,10 +208,8 @@ async def referral_create_without_preload_content( :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :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 @@ -246,7 +235,6 @@ async def referral_create_without_preload_content( _param = self._referral_create_serialize( account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -268,7 +256,6 @@ def _referral_create_serialize( self, account_index, authorization, - auth, _request_auth, _content_type, _headers, @@ -293,8 +280,6 @@ def _referral_create_serialize( if authorization is not None: _header_params['authorization'] = authorization # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) if account_index is not None: _form_params.append(('account_index', account_index)) # process the body parameter @@ -347,8 +332,7 @@ def _referral_create_serialize( async def referral_get( 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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -368,10 +352,8 @@ async def referral_get( :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :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 @@ -397,7 +379,6 @@ async def referral_get( _param = self._referral_get_serialize( account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -422,8 +403,7 @@ async def referral_get( async def referral_get_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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -443,10 +423,8 @@ async def referral_get_with_http_info( :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :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 @@ -472,7 +450,6 @@ async def referral_get_with_http_info( _param = self._referral_get_serialize( account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -497,8 +474,7 @@ async def referral_get_with_http_info( async def referral_get_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, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -518,10 +494,8 @@ async def referral_get_without_preload_content( :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: :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 @@ -547,7 +521,6 @@ async def referral_get_without_preload_content( _param = self._referral_get_serialize( account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -569,7 +542,6 @@ def _referral_get_serialize( self, account_index, authorization, - auth, _request_auth, _content_type, _headers, @@ -590,19 +562,13 @@ def _referral_get_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - if account_index is not None: _query_params.append(('account_index', account_index)) # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -642,8 +608,7 @@ async def referral_kickback_update( self, account_index: StrictInt, kickback_percentage: Union[Annotated[float, Field(le=100, strict=True)], Annotated[int, Field(le=100, strict=True)]], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -665,10 +630,8 @@ async def referral_kickback_update( :type account_index: int :param kickback_percentage: (required) :type kickback_percentage: float - :param authorization: make required after integ is done + :param authorization: :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 @@ -695,7 +658,6 @@ async def referral_kickback_update( account_index=account_index, kickback_percentage=kickback_percentage, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -721,8 +683,7 @@ async def referral_kickback_update_with_http_info( self, account_index: StrictInt, kickback_percentage: Union[Annotated[float, Field(le=100, strict=True)], Annotated[int, Field(le=100, strict=True)]], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -744,10 +705,8 @@ async def referral_kickback_update_with_http_info( :type account_index: int :param kickback_percentage: (required) :type kickback_percentage: float - :param authorization: make required after integ is done + :param authorization: :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 @@ -774,7 +733,6 @@ async def referral_kickback_update_with_http_info( account_index=account_index, kickback_percentage=kickback_percentage, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -800,8 +758,7 @@ async def referral_kickback_update_without_preload_content( self, account_index: StrictInt, kickback_percentage: Union[Annotated[float, Field(le=100, strict=True)], Annotated[int, Field(le=100, strict=True)]], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -823,10 +780,8 @@ async def referral_kickback_update_without_preload_content( :type account_index: int :param kickback_percentage: (required) :type kickback_percentage: float - :param authorization: make required after integ is done + :param authorization: :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 @@ -853,7 +808,6 @@ async def referral_kickback_update_without_preload_content( account_index=account_index, kickback_percentage=kickback_percentage, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -876,7 +830,6 @@ def _referral_kickback_update_serialize( account_index, kickback_percentage, authorization, - auth, _request_auth, _content_type, _headers, @@ -901,8 +854,6 @@ def _referral_kickback_update_serialize( if authorization is not None: _header_params['authorization'] = authorization # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) if account_index is not None: _form_params.append(('account_index', account_index)) if kickback_percentage is not None: @@ -1233,8 +1184,7 @@ async def referral_update( self, account_index: StrictInt, new_referral_code: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1256,10 +1206,8 @@ async def referral_update( :type account_index: int :param new_referral_code: (required) :type new_referral_code: str - :param authorization: make required after integ is done + :param authorization: :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 @@ -1286,7 +1234,6 @@ async def referral_update( account_index=account_index, new_referral_code=new_referral_code, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1312,8 +1259,7 @@ async def referral_update_with_http_info( self, account_index: StrictInt, new_referral_code: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1335,10 +1281,8 @@ async def referral_update_with_http_info( :type account_index: int :param new_referral_code: (required) :type new_referral_code: str - :param authorization: make required after integ is done + :param authorization: :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 @@ -1365,7 +1309,6 @@ async def referral_update_with_http_info( account_index=account_index, new_referral_code=new_referral_code, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1391,8 +1334,7 @@ async def referral_update_without_preload_content( self, account_index: StrictInt, new_referral_code: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1414,10 +1356,8 @@ async def referral_update_without_preload_content( :type account_index: int :param new_referral_code: (required) :type new_referral_code: str - :param authorization: make required after integ is done + :param authorization: :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 @@ -1444,7 +1384,6 @@ async def referral_update_without_preload_content( account_index=account_index, new_referral_code=new_referral_code, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1467,7 +1406,6 @@ def _referral_update_serialize( account_index, new_referral_code, authorization, - auth, _request_auth, _content_type, _headers, @@ -1492,8 +1430,6 @@ def _referral_update_serialize( if authorization is not None: _header_params['authorization'] = authorization # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) if account_index is not None: _form_params.append(('account_index', account_index)) if new_referral_code is not None: @@ -1549,11 +1485,10 @@ async def referral_use( self, l1_address: StrictStr, referral_code: StrictStr, - x: 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, + authorization: Optional[StrictStr] = None, discord: Optional[StrictStr] = None, telegram: Optional[StrictStr] = None, + x: Optional[StrictStr] = None, signature: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -1576,16 +1511,14 @@ async def referral_use( :type l1_address: str :param referral_code: (required) :type referral_code: str - :param x: (required) - :type x: str - :param authorization: make required after integ is done + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param discord: :type discord: str :param telegram: :type telegram: str + :param x: + :type x: str :param signature: :type signature: str :param _request_timeout: timeout setting for this request. If one @@ -1613,11 +1546,10 @@ async def referral_use( _param = self._referral_use_serialize( l1_address=l1_address, referral_code=referral_code, - x=x, authorization=authorization, - auth=auth, discord=discord, telegram=telegram, + x=x, signature=signature, _request_auth=_request_auth, _content_type=_content_type, @@ -1644,11 +1576,10 @@ async def referral_use_with_http_info( self, l1_address: StrictStr, referral_code: StrictStr, - x: 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, + authorization: Optional[StrictStr] = None, discord: Optional[StrictStr] = None, telegram: Optional[StrictStr] = None, + x: Optional[StrictStr] = None, signature: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -1671,16 +1602,14 @@ async def referral_use_with_http_info( :type l1_address: str :param referral_code: (required) :type referral_code: str - :param x: (required) - :type x: str - :param authorization: make required after integ is done + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param discord: :type discord: str :param telegram: :type telegram: str + :param x: + :type x: str :param signature: :type signature: str :param _request_timeout: timeout setting for this request. If one @@ -1708,11 +1637,10 @@ async def referral_use_with_http_info( _param = self._referral_use_serialize( l1_address=l1_address, referral_code=referral_code, - x=x, authorization=authorization, - auth=auth, discord=discord, telegram=telegram, + x=x, signature=signature, _request_auth=_request_auth, _content_type=_content_type, @@ -1739,11 +1667,10 @@ async def referral_use_without_preload_content( self, l1_address: StrictStr, referral_code: StrictStr, - x: 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, + authorization: Optional[StrictStr] = None, discord: Optional[StrictStr] = None, telegram: Optional[StrictStr] = None, + x: Optional[StrictStr] = None, signature: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -1766,16 +1693,14 @@ async def referral_use_without_preload_content( :type l1_address: str :param referral_code: (required) :type referral_code: str - :param x: (required) - :type x: str - :param authorization: make required after integ is done + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param discord: :type discord: str :param telegram: :type telegram: str + :param x: + :type x: str :param signature: :type signature: str :param _request_timeout: timeout setting for this request. If one @@ -1803,11 +1728,10 @@ async def referral_use_without_preload_content( _param = self._referral_use_serialize( l1_address=l1_address, referral_code=referral_code, - x=x, authorization=authorization, - auth=auth, discord=discord, telegram=telegram, + x=x, signature=signature, _request_auth=_request_auth, _content_type=_content_type, @@ -1830,11 +1754,10 @@ def _referral_use_serialize( self, l1_address, referral_code, - x, authorization, - auth, discord, telegram, + x, signature, _request_auth, _content_type, @@ -1860,8 +1783,6 @@ def _referral_use_serialize( if authorization is not None: _header_params['authorization'] = authorization # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) if l1_address is not None: _form_params.append(('l1_address', l1_address)) if referral_code is not None: diff --git a/lighter/api/transaction_api.py b/lighter/api/transaction_api.py index bd4dda12..af234cec 100644 --- a/lighter/api/transaction_api.py +++ b/lighter/api/transaction_api.py @@ -54,8 +54,7 @@ async def account_txs( by: StrictStr, value: StrictStr, index: Optional[StrictInt] = None, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, @@ -82,10 +81,8 @@ async def account_txs( :type value: str :param index: :type index: int - :param authorization: make required after integ is done + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param types: :type types: List[int] :param _request_timeout: timeout setting for this request. If one @@ -116,7 +113,6 @@ async def account_txs( value=value, index=index, authorization=authorization, - auth=auth, types=types, _request_auth=_request_auth, _content_type=_content_type, @@ -145,8 +141,7 @@ async def account_txs_with_http_info( by: StrictStr, value: StrictStr, index: Optional[StrictInt] = None, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, @@ -173,10 +168,8 @@ async def account_txs_with_http_info( :type value: str :param index: :type index: int - :param authorization: make required after integ is done + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param types: :type types: List[int] :param _request_timeout: timeout setting for this request. If one @@ -207,7 +200,6 @@ async def account_txs_with_http_info( value=value, index=index, authorization=authorization, - auth=auth, types=types, _request_auth=_request_auth, _content_type=_content_type, @@ -236,8 +228,7 @@ async def account_txs_without_preload_content( by: StrictStr, value: StrictStr, index: Optional[StrictInt] = None, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + authorization: Optional[StrictStr] = None, types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, @@ -264,10 +255,8 @@ async def account_txs_without_preload_content( :type value: str :param index: :type index: int - :param authorization: make required after integ is done + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param types: :type types: List[int] :param _request_timeout: timeout setting for this request. If one @@ -298,7 +287,6 @@ async def account_txs_without_preload_content( value=value, index=index, authorization=authorization, - auth=auth, types=types, _request_auth=_request_auth, _content_type=_content_type, @@ -324,7 +312,6 @@ def _account_txs_serialize( value, index, authorization, - auth, types, _request_auth, _content_type, @@ -363,10 +350,6 @@ def _account_txs_serialize( _query_params.append(('value', value)) - if auth is not None: - - _query_params.append(('auth', auth)) - if types is not None: _query_params.append(('types', types)) diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index 25da79c5..02195384 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -56,17 +56,23 @@ from lighter.models.l1_metadata import L1Metadata from lighter.models.l1_provider_info import L1ProviderInfo from lighter.models.layer1_basic_info import Layer1BasicInfo +from lighter.models.leaderboard import Leaderboard +from lighter.models.leaderboard_entry import LeaderboardEntry 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 from lighter.models.liquidation_infos import LiquidationInfos +from lighter.models.live_points_total import LivePointsTotal +from lighter.models.mark_price_candle import MarkPriceCandle +from lighter.models.mark_price_candles import MarkPriceCandles from lighter.models.market_config import MarketConfig +from lighter.models.market_price_chart import MarketPriceChart +from lighter.models.market_price_charts import MarketPriceCharts from lighter.models.next_nonce import NextNonce from lighter.models.order import Order from lighter.models.order_book import OrderBook -from lighter.models.order_book_depth import OrderBookDepth from lighter.models.order_book_details import OrderBookDetails from lighter.models.order_book_orders import OrderBookOrders from lighter.models.order_book_stats import OrderBookStats @@ -78,7 +84,6 @@ from lighter.models.pn_l_entry import PnLEntry from lighter.models.position_funding import PositionFunding from lighter.models.position_fundings import PositionFundings -from lighter.models.price_level import PriceLevel from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_metadata import PublicPoolMetadata from lighter.models.public_pool_share import PublicPoolShare @@ -89,6 +94,8 @@ from lighter.models.referral_code import ReferralCode from lighter.models.referral_point_entry import ReferralPointEntry from lighter.models.referral_points import ReferralPoints +from lighter.models.referral_program_kickback import ReferralProgramKickback +from lighter.models.referral_totals import ReferralTotals from lighter.models.req_set_account_metadata import ReqSetAccountMetadata from lighter.models.resp_change_account_tier import RespChangeAccountTier from lighter.models.resp_create_rfq import RespCreateRFQ @@ -123,6 +130,7 @@ 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_account_metadata import SubAccountMetadata from lighter.models.sub_accounts import SubAccounts from lighter.models.system_config import SystemConfig from lighter.models.token import Token diff --git a/lighter/models/account_asset.py b/lighter/models/account_asset.py index c4cf5461..3434d591 100644 --- a/lighter/models/account_asset.py +++ b/lighter/models/account_asset.py @@ -32,8 +32,9 @@ class AccountAsset(BaseModel): locked_balance: StrictStr margin_balance: StrictStr margin_mode: StrictStr + multiplier: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "asset_id", "balance", "locked_balance", "margin_balance", "margin_mode"] + __properties: ClassVar[List[str]] = ["symbol", "asset_id", "balance", "locked_balance", "margin_balance", "margin_mode", "multiplier"] @field_validator('margin_mode') def margin_mode_validate_enum(cls, value): @@ -105,7 +106,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "balance": obj.get("balance"), "locked_balance": obj.get("locked_balance"), "margin_balance": obj.get("margin_balance"), - "margin_mode": obj.get("margin_mode") + "margin_mode": obj.get("margin_mode"), + "multiplier": obj.get("multiplier") }) # 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 76fd86da..be870e70 100644 --- a/lighter/models/account_metadata.py +++ b/lighter/models/account_metadata.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List +from lighter.models.sub_account_metadata import SubAccountMetadata from typing import Optional, Set from typing_extensions import Self @@ -34,8 +35,9 @@ class AccountMetadata(BaseModel): created_at: StrictInt can_rfq: StrictBool can_rfq_market_ids: List[StrictStr] + metadata: SubAccountMetadata additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "name", "description", "can_invite", "referral_points_percentage", "created_at", "can_rfq", "can_rfq_market_ids"] + __properties: ClassVar[List[str]] = ["account_index", "name", "description", "can_invite", "referral_points_percentage", "created_at", "can_rfq", "can_rfq_market_ids", "metadata"] model_config = ConfigDict( populate_by_name=True, @@ -78,6 +80,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -102,7 +107,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "referral_points_percentage": obj.get("referral_points_percentage"), "created_at": obj.get("created_at"), "can_rfq": obj.get("can_rfq"), - "can_rfq_market_ids": obj.get("can_rfq_market_ids") + "can_rfq_market_ids": obj.get("can_rfq_market_ids"), + "metadata": SubAccountMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) # 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 18816453..93cc661c 100644 --- a/lighter/models/account_position.py +++ b/lighter/models/account_position.py @@ -43,8 +43,9 @@ class AccountPosition(BaseModel): margin_mode: StrictInt allocated_margin: StrictStr total_discount: StrictStr + margin_set_flag: StrictInt 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", "total_discount"] + __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", "margin_set_flag"] model_config = ConfigDict( populate_by_name=True, @@ -120,7 +121,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total_funding_paid_out": obj.get("total_funding_paid_out"), "margin_mode": obj.get("margin_mode"), "allocated_margin": obj.get("allocated_margin"), - "total_discount": obj.get("total_discount") + "total_discount": obj.get("total_discount"), + "margin_set_flag": obj.get("margin_set_flag") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/asset.py b/lighter/models/asset.py index 339e8d2d..46f70d1f 100644 --- a/lighter/models/asset.py +++ b/lighter/models/asset.py @@ -43,8 +43,9 @@ class Asset(BaseModel): total_supplied: StrictStr user_supply_cap: StrictStr liquidation_factor: StrictStr + multiplier: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["asset_id", "symbol", "l1_decimals", "decimals", "min_transfer_amount", "min_withdrawal_amount", "margin_mode", "index_price", "l1_address", "global_supply_cap", "liquidation_fee", "liquidation_threshold", "loan_to_value", "price_decimals", "total_supplied", "user_supply_cap", "liquidation_factor"] + __properties: ClassVar[List[str]] = ["asset_id", "symbol", "l1_decimals", "decimals", "min_transfer_amount", "min_withdrawal_amount", "margin_mode", "index_price", "l1_address", "global_supply_cap", "liquidation_fee", "liquidation_threshold", "loan_to_value", "price_decimals", "total_supplied", "user_supply_cap", "liquidation_factor", "multiplier"] @field_validator('margin_mode') def margin_mode_validate_enum(cls, value): @@ -127,7 +128,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "price_decimals": obj.get("price_decimals"), "total_supplied": obj.get("total_supplied"), "user_supply_cap": obj.get("user_supply_cap"), - "liquidation_factor": obj.get("liquidation_factor") + "liquidation_factor": obj.get("liquidation_factor"), + "multiplier": obj.get("multiplier") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/detailed_account.py b/lighter/models/detailed_account.py index e7d71c80..866349d4 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -25,6 +25,7 @@ from lighter.models.pending_unlock import PendingUnlock from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_share import PublicPoolShare +from lighter.models.sub_account_metadata import SubAccountMetadata from typing import Optional, Set from typing_extensions import Self @@ -64,8 +65,9 @@ class DetailedAccount(BaseModel): cross_initial_margin_requirement: StrictStr cross_maintenance_margin_requirement: StrictStr can_rfq_market_ids: List[StrictStr] + metadata: SubAccountMetadata additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_type", "account_trading_mode", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "available_balance", "status", "collateral", "account_index", "name", "description", "can_invite", "referral_points_percentage", "positions", "assets", "total_asset_value", "cross_asset_value", "pool_info", "shares", "created_at", "transaction_time", "pending_unlocks", "approved_integrators", "can_rfq", "cross_initial_margin_requirement", "cross_maintenance_margin_requirement", "can_rfq_market_ids"] + __properties: ClassVar[List[str]] = ["code", "message", "account_type", "account_trading_mode", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "available_balance", "status", "collateral", "account_index", "name", "description", "can_invite", "referral_points_percentage", "positions", "assets", "total_asset_value", "cross_asset_value", "pool_info", "shares", "created_at", "transaction_time", "pending_unlocks", "approved_integrators", "can_rfq", "cross_initial_margin_requirement", "cross_maintenance_margin_requirement", "can_rfq_market_ids", "metadata"] model_config = ConfigDict( populate_by_name=True, @@ -146,6 +148,9 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['approved_integrators'] = _items + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -194,7 +199,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "can_rfq": obj.get("can_rfq"), "cross_initial_margin_requirement": obj.get("cross_initial_margin_requirement"), "cross_maintenance_margin_requirement": obj.get("cross_maintenance_margin_requirement"), - "can_rfq_market_ids": obj.get("can_rfq_market_ids") + "can_rfq_market_ids": obj.get("can_rfq_market_ids"), + "metadata": SubAccountMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/l1_metadata.py b/lighter/models/l1_metadata.py index 736c0c25..5fb68607 100644 --- a/lighter/models/l1_metadata.py +++ b/lighter/models/l1_metadata.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List +from lighter.models.referral_program_kickback import ReferralProgramKickback from typing import Optional, Set from typing_extensions import Self @@ -29,8 +30,10 @@ class L1Metadata(BaseModel): l1_address: StrictStr can_invite: StrictBool referral_points_percentage: StrictStr + referral_program_kickback: StrictStr + referral_program_kickback_history: List[ReferralProgramKickback] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address", "can_invite", "referral_points_percentage"] + __properties: ClassVar[List[str]] = ["l1_address", "can_invite", "referral_points_percentage", "referral_program_kickback", "referral_program_kickback_history"] model_config = ConfigDict( populate_by_name=True, @@ -73,6 +76,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in referral_program_kickback_history (list) + _items = [] + if self.referral_program_kickback_history: + for _item in self.referral_program_kickback_history: + if _item: + _items.append(_item.to_dict()) + _dict['referral_program_kickback_history'] = _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(): @@ -92,7 +102,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "l1_address": obj.get("l1_address"), "can_invite": obj.get("can_invite"), - "referral_points_percentage": obj.get("referral_points_percentage") + "referral_points_percentage": obj.get("referral_points_percentage"), + "referral_program_kickback": obj.get("referral_program_kickback"), + "referral_program_kickback_history": [ReferralProgramKickback.from_dict(_item) for _item in obj["referral_program_kickback_history"]] if obj.get("referral_program_kickback_history") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/leaderboard.py b/lighter/models/leaderboard.py new file mode 100644 index 00000000..bb71f66c --- /dev/null +++ b/lighter/models/leaderboard.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 +from typing import Any, ClassVar, Dict, List +from lighter.models.leaderboard_entry import LeaderboardEntry +from typing import Optional, Set +from typing_extensions import Self + +class Leaderboard(BaseModel): + """ + Leaderboard + """ # noqa: E501 + entries: List[LeaderboardEntry] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["entries"] + + 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 Leaderboard 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 entries (list) + _items = [] + if self.entries: + for _item in self.entries: + if _item: + _items.append(_item.to_dict()) + _dict['entries'] = _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 Leaderboard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "entries": [LeaderboardEntry.from_dict(_item) for _item in obj["entries"]] if obj.get("entries") 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/leaderboard_entry.py b/lighter/models/leaderboard_entry.py new file mode 100644 index 00000000..ff8121a8 --- /dev/null +++ b/lighter/models/leaderboard_entry.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, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class LeaderboardEntry(BaseModel): + """ + LeaderboardEntry + """ # noqa: E501 + l1_address: StrictStr + points: Union[StrictFloat, StrictInt] + entry: StrictInt + entry_id: StrictInt = Field(alias="entryId") + metadata: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["l1_address", "points", "entry", "entryId", "metadata"] + + 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 LeaderboardEntry 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 LeaderboardEntry 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"), + "points": obj.get("points"), + "entry": obj.get("entry"), + "entryId": obj.get("entryId"), + "metadata": obj.get("metadata") + }) + # 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/live_points_total.py b/lighter/models/live_points_total.py new file mode 100644 index 00000000..0d3c046a --- /dev/null +++ b/lighter/models/live_points_total.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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class LivePointsTotal(BaseModel): + """ + LivePointsTotal + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + total_live_points: Union[StrictFloat, StrictInt] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "total_live_points"] + + 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 LivePointsTotal 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 LivePointsTotal 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"), + "total_live_points": obj.get("total_live_points") + }) + # 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/mark_price_candle.py b/lighter/models/mark_price_candle.py new file mode 100644 index 00000000..93f2b0d1 --- /dev/null +++ b/lighter/models/mark_price_candle.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, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class MarkPriceCandle(BaseModel): + """ + MarkPriceCandle + """ # noqa: E501 + t: StrictInt = Field(description=" timestamp") + o: Union[StrictFloat, StrictInt] = Field(description=" open") + h: Union[StrictFloat, StrictInt] = Field(description=" high") + l: Union[StrictFloat, StrictInt] = Field(description=" low") + c: Union[StrictFloat, StrictInt] = Field(description=" close") + sc: StrictInt = Field(description=" sample_count") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["t", "o", "h", "l", "c", "sc"] + + 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 MarkPriceCandle 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 MarkPriceCandle from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "t": obj.get("t"), + "o": obj.get("o"), + "h": obj.get("h"), + "l": obj.get("l"), + "c": obj.get("c"), + "sc": obj.get("sc") + }) + # 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/mark_price_candles.py b/lighter/models/mark_price_candles.py new file mode 100644 index 00000000..607a455d --- /dev/null +++ b/lighter/models/mark_price_candles.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, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.mark_price_candle import MarkPriceCandle +from typing import Optional, Set +from typing_extensions import Self + +class MarkPriceCandles(BaseModel): + """ + MarkPriceCandles + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + r: StrictStr = Field(description=" resolution") + c: List[MarkPriceCandle] = Field(description=" candles") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "r", "c"] + + 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 MarkPriceCandles 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 c (list) + _items = [] + if self.c: + for _item in self.c: + if _item: + _items.append(_item.to_dict()) + _dict['c'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MarkPriceCandles 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"), + "r": obj.get("r"), + "c": [MarkPriceCandle.from_dict(_item) for _item in obj["c"]] if obj.get("c") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/market_price_chart.py b/lighter/models/market_price_chart.py new file mode 100644 index 00000000..f94efde5 --- /dev/null +++ b/lighter/models/market_price_chart.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class MarketPriceChart(BaseModel): + """ + MarketPriceChart + """ # noqa: E501 + market_id: StrictInt + prices: List[StrictStr] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["market_id", "prices"] + + 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 MarketPriceChart 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 MarketPriceChart from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "market_id": obj.get("market_id"), + "prices": obj.get("prices") + }) + # 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_price_charts.py b/lighter/models/market_price_charts.py new file mode 100644 index 00000000..181d5655 --- /dev/null +++ b/lighter/models/market_price_charts.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.market_price_chart import MarketPriceChart +from typing import Optional, Set +from typing_extensions import Self + +class MarketPriceCharts(BaseModel): + """ + MarketPriceCharts + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + resolution: StrictStr + price_charts: List[MarketPriceChart] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "resolution", "price_charts"] + + 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 MarketPriceCharts 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 price_charts (list) + _items = [] + if self.price_charts: + for _item in self.price_charts: + if _item: + _items.append(_item.to_dict()) + _dict['price_charts'] = _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 MarketPriceCharts 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"), + "resolution": obj.get("resolution"), + "price_charts": [MarketPriceChart.from_dict(_item) for _item in obj["price_charts"]] if obj.get("price_charts") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/order.py b/lighter/models/order.py index b88cb766..3a9d5967 100644 --- a/lighter/models/order.py +++ b/lighter/models/order.py @@ -63,8 +63,9 @@ class Order(BaseModel): integrator_fee_collector_index: StrictStr integrator_maker_fee: StrictStr integrator_taker_fee: StrictStr + order_flags: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["order_index", "client_order_index", "order_id", "client_order_id", "market_index", "owner_account_index", "initial_base_amount", "price", "nonce", "remaining_base_amount", "is_ask", "base_size", "base_price", "filled_base_amount", "filled_quote_amount", "side", "type", "time_in_force", "reduce_only", "trigger_price", "order_expiry", "status", "trigger_status", "trigger_time", "parent_order_index", "parent_order_id", "to_trigger_order_id_0", "to_trigger_order_id_1", "to_cancel_order_id_0", "block_height", "timestamp", "created_at", "updated_at", "transaction_time", "integrator_fee_collector_index", "integrator_maker_fee", "integrator_taker_fee"] + __properties: ClassVar[List[str]] = ["order_index", "client_order_index", "order_id", "client_order_id", "market_index", "owner_account_index", "initial_base_amount", "price", "nonce", "remaining_base_amount", "is_ask", "base_size", "base_price", "filled_base_amount", "filled_quote_amount", "side", "type", "time_in_force", "reduce_only", "trigger_price", "order_expiry", "status", "trigger_status", "trigger_time", "parent_order_index", "parent_order_id", "to_trigger_order_id_0", "to_trigger_order_id_1", "to_cancel_order_id_0", "block_height", "timestamp", "created_at", "updated_at", "transaction_time", "integrator_fee_collector_index", "integrator_maker_fee", "integrator_taker_fee", "order_flags"] @field_validator('type') def type_validate_enum(cls, value): @@ -188,7 +189,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "transaction_time": obj.get("transaction_time"), "integrator_fee_collector_index": obj.get("integrator_fee_collector_index"), "integrator_maker_fee": obj.get("integrator_maker_fee"), - "integrator_taker_fee": obj.get("integrator_taker_fee") + "integrator_taker_fee": obj.get("integrator_taker_fee"), + "order_flags": obj.get("order_flags") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/order_book.py b/lighter/models/order_book.py index 8bbc3f89..20444f0a 100644 --- a/lighter/models/order_book.py +++ b/lighter/models/order_book.py @@ -43,8 +43,10 @@ class OrderBook(BaseModel): order_quote_limit: StrictStr is_maker_fee_enabled: StrictBool is_taker_fee_enabled: StrictBool + created_at: StrictStr + multiplier: StrictStr 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", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "order_quote_limit", "is_maker_fee_enabled", "is_taker_fee_enabled"] + __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", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "order_quote_limit", "is_maker_fee_enabled", "is_taker_fee_enabled", "created_at", "multiplier"] @field_validator('market_type') def market_type_validate_enum(cls, value): @@ -134,7 +136,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "supported_quote_decimals": obj.get("supported_quote_decimals"), "order_quote_limit": obj.get("order_quote_limit"), "is_maker_fee_enabled": obj.get("is_maker_fee_enabled"), - "is_taker_fee_enabled": obj.get("is_taker_fee_enabled") + "is_taker_fee_enabled": obj.get("is_taker_fee_enabled"), + "created_at": obj.get("created_at"), + "multiplier": obj.get("multiplier") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/perps_order_book_detail.py b/lighter/models/perps_order_book_detail.py index a9ee033f..608ed5e9 100644 --- a/lighter/models/perps_order_book_detail.py +++ b/lighter/models/perps_order_book_detail.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Union +from typing import Any, ClassVar, Dict, List, Optional, Union from lighter.models.market_config import MarketConfig from typing import Optional, Set from typing_extensions import Self @@ -65,8 +65,14 @@ class PerpsOrderBookDetail(BaseModel): funding_clamp_small: StrictStr funding_clamp_big: StrictStr base_interest_rate: StrictStr + created_at: StrictStr + mark_price: Optional[StrictStr] = None + index_price: Optional[StrictStr] = None + multiplier: Optional[StrictStr] = None + market_flags: Optional[StrictInt] = None + funding_premium_multiplier: Optional[StrictInt] = None 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", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "order_quote_limit", "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", "is_maker_fee_enabled", "is_taker_fee_enabled", "funding_clamp_small", "funding_clamp_big", "base_interest_rate"] + __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", "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", "order_quote_limit", "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", "is_maker_fee_enabled", "is_taker_fee_enabled", "funding_clamp_small", "funding_clamp_big", "base_interest_rate", "created_at", "mark_price", "index_price", "multiplier", "market_flags", "funding_premium_multiplier"] @field_validator('market_type') def market_type_validate_enum(cls, value): @@ -180,7 +186,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "is_taker_fee_enabled": obj.get("is_taker_fee_enabled"), "funding_clamp_small": obj.get("funding_clamp_small"), "funding_clamp_big": obj.get("funding_clamp_big"), - "base_interest_rate": obj.get("base_interest_rate") + "base_interest_rate": obj.get("base_interest_rate"), + "created_at": obj.get("created_at"), + "mark_price": obj.get("mark_price"), + "index_price": obj.get("index_price"), + "multiplier": obj.get("multiplier"), + "market_flags": obj.get("market_flags"), + "funding_premium_multiplier": obj.get("funding_premium_multiplier") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/referral_code.py b/lighter/models/referral_code.py index d22655a6..a572d9f2 100644 --- a/lighter/models/referral_code.py +++ b/lighter/models/referral_code.py @@ -29,9 +29,8 @@ class ReferralCode(BaseModel): code: StrictInt message: Optional[StrictStr] = None referral_code: StrictStr - remaining_usage: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "referral_code", "remaining_usage"] + __properties: ClassVar[List[str]] = ["code", "message", "referral_code"] model_config = ConfigDict( populate_by_name=True, @@ -93,8 +92,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), - "referral_code": obj.get("referral_code"), - "remaining_usage": obj.get("remaining_usage") + "referral_code": obj.get("referral_code") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/referral_program_kickback.py b/lighter/models/referral_program_kickback.py new file mode 100644 index 00000000..f4aad0ff --- /dev/null +++ b/lighter/models/referral_program_kickback.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, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ReferralProgramKickback(BaseModel): + """ + ReferralProgramKickback + """ # noqa: E501 + var_date: StrictInt = Field(alias="date") + percentage: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["date", "percentage"] + + 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 ReferralProgramKickback 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 ReferralProgramKickback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "date": obj.get("date"), + "percentage": obj.get("percentage") + }) + # 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_totals.py b/lighter/models/referral_totals.py new file mode 100644 index 00000000..7b5dab4c --- /dev/null +++ b/lighter/models/referral_totals.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ReferralTotals(BaseModel): + """ + ReferralTotals + """ # noqa: E501 + count: StrictInt + volume: StrictStr + free_maker_volume: StrictStr + free_taker_volume: StrictStr + non_free_maker_volume: StrictStr + non_free_taker_volume: StrictStr + maker_fees_paid: StrictStr + taker_fees_paid: StrictStr + total_referrals: StrictInt + total_premium_referrals: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["count", "volume", "free_maker_volume", "free_taker_volume", "non_free_maker_volume", "non_free_taker_volume", "maker_fees_paid", "taker_fees_paid", "total_referrals", "total_premium_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 ReferralTotals 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 ReferralTotals from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "count": obj.get("count"), + "volume": obj.get("volume"), + "free_maker_volume": obj.get("free_maker_volume"), + "free_taker_volume": obj.get("free_taker_volume"), + "non_free_maker_volume": obj.get("non_free_maker_volume"), + "non_free_taker_volume": obj.get("non_free_taker_volume"), + "maker_fees_paid": obj.get("maker_fees_paid"), + "taker_fees_paid": obj.get("taker_fees_paid"), + "total_referrals": obj.get("total_referrals"), + "total_premium_referrals": obj.get("total_premium_referrals") + }) + # 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_set_account_metadata.py b/lighter/models/req_set_account_metadata.py index b8539c9f..e9862322 100644 --- a/lighter/models/req_set_account_metadata.py +++ b/lighter/models/req_set_account_metadata.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -30,9 +30,8 @@ class ReqSetAccountMetadata(BaseModel): target_account_index: StrictInt api_key_index: StrictInt metadata: StrictStr - auth: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["master_account_index", "target_account_index", "api_key_index", "metadata", "auth"] + __properties: ClassVar[List[str]] = ["master_account_index", "target_account_index", "api_key_index", "metadata"] model_config = ConfigDict( populate_by_name=True, @@ -95,8 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "master_account_index": obj.get("master_account_index"), "target_account_index": obj.get("target_account_index"), "api_key_index": obj.get("api_key_index"), - "metadata": obj.get("metadata"), - "auth": obj.get("auth") + "metadata": obj.get("metadata") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/rfq_metadata.py b/lighter/models/rfq_metadata.py index c4b14760..26f88ff9 100644 --- a/lighter/models/rfq_metadata.py +++ b/lighter/models/rfq_metadata.py @@ -30,8 +30,9 @@ class RFQMetadata(BaseModel): requested_max_slippage: StrictStr requested_slippage: StrictStr worst_price: StrictStr + mark_price: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["requested_est_price", "requested_max_slippage", "requested_slippage", "worst_price"] + __properties: ClassVar[List[str]] = ["requested_est_price", "requested_max_slippage", "requested_slippage", "worst_price", "mark_price"] model_config = ConfigDict( populate_by_name=True, @@ -94,7 +95,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "requested_est_price": obj.get("requested_est_price"), "requested_max_slippage": obj.get("requested_max_slippage"), "requested_slippage": obj.get("requested_slippage"), - "worst_price": obj.get("worst_price") + "worst_price": obj.get("worst_price"), + "mark_price": obj.get("mark_price") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/risk_parameters.py b/lighter/models/risk_parameters.py index 1e2745b2..e86e7012 100644 --- a/lighter/models/risk_parameters.py +++ b/lighter/models/risk_parameters.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -35,8 +35,9 @@ class RiskParameters(BaseModel): total_account_liquidation_threshold: StrictStr usdc_collateral_with_funding: StrictStr usdc_portfolio_value: StrictStr + total_portfolio_value: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "collateral", "total_account_value", "initial_margin_req", "maintenance_margin_req", "close_out_margin_req", "total_account_liquidation_threshold", "usdc_collateral_with_funding", "usdc_portfolio_value"] + __properties: ClassVar[List[str]] = ["market_id", "collateral", "total_account_value", "initial_margin_req", "maintenance_margin_req", "close_out_margin_req", "total_account_liquidation_threshold", "usdc_collateral_with_funding", "usdc_portfolio_value", "total_portfolio_value"] model_config = ConfigDict( populate_by_name=True, @@ -104,7 +105,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "close_out_margin_req": obj.get("close_out_margin_req"), "total_account_liquidation_threshold": obj.get("total_account_liquidation_threshold"), "usdc_collateral_with_funding": obj.get("usdc_collateral_with_funding"), - "usdc_portfolio_value": obj.get("usdc_portfolio_value") + "usdc_portfolio_value": obj.get("usdc_portfolio_value"), + "total_portfolio_value": obj.get("total_portfolio_value") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/spot_order_book_detail.py b/lighter/models/spot_order_book_detail.py index 07aa96c2..b7330af9 100644 --- a/lighter/models/spot_order_book_detail.py +++ b/lighter/models/spot_order_book_detail.py @@ -53,8 +53,10 @@ class SpotOrderBookDetail(BaseModel): daily_chart: Dict[str, Union[StrictFloat, StrictInt]] is_maker_fee_enabled: StrictBool is_taker_fee_enabled: StrictBool + created_at: StrictStr + multiplier: StrictStr 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", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change", "daily_chart", "is_maker_fee_enabled", "is_taker_fee_enabled"] + __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", "last_trade_price", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change", "daily_chart", "is_maker_fee_enabled", "is_taker_fee_enabled", "created_at", "multiplier"] @field_validator('market_type') def market_type_validate_enum(cls, value): @@ -154,7 +156,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "daily_price_change": obj.get("daily_price_change"), "daily_chart": obj.get("daily_chart"), "is_maker_fee_enabled": obj.get("is_maker_fee_enabled"), - "is_taker_fee_enabled": obj.get("is_taker_fee_enabled") + "is_taker_fee_enabled": obj.get("is_taker_fee_enabled"), + "created_at": obj.get("created_at"), + "multiplier": obj.get("multiplier") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/sub_account_metadata.py b/lighter/models/sub_account_metadata.py new file mode 100644 index 00000000..08088a22 --- /dev/null +++ b/lighter/models/sub_account_metadata.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 SubAccountMetadata(BaseModel): + """ + SubAccountMetadata + """ # noqa: E501 + color: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["color"] + + 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 SubAccountMetadata 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 SubAccountMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "color": obj.get("color") + }) + # 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 05ea1a96..04ee96ba 100644 --- a/lighter/models/trade.py +++ b/lighter/models/trade.py @@ -68,8 +68,10 @@ class Trade(BaseModel): taker_allocated_margin_usdc_after: StrictInt maker_allocated_margin_usdc_before: StrictInt maker_allocated_margin_usdc_after: StrictInt + bid_order_version: StrictInt + ask_order_version: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["trade_id", "tx_hash", "type", "market_id", "size", "price", "usd_amount", "ask_id", "bid_id", "ask_account_id", "bid_account_id", "is_maker_ask", "block_height", "timestamp", "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", "bid_account_pnl", "ask_account_pnl", "ask_client_id", "bid_client_id", "ask_client_id_str", "bid_client_id_str", "ask_id_str", "bid_id_str", "trade_id_str", "integrator_maker_fee", "integrator_maker_fee_collector_index", "integrator_taker_fee", "integrator_taker_fee_collector_index", "taker_allocated_margin_usdc_before", "taker_allocated_margin_usdc_after", "maker_allocated_margin_usdc_before", "maker_allocated_margin_usdc_after"] + __properties: ClassVar[List[str]] = ["trade_id", "tx_hash", "type", "market_id", "size", "price", "usd_amount", "ask_id", "bid_id", "ask_account_id", "bid_account_id", "is_maker_ask", "block_height", "timestamp", "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", "bid_account_pnl", "ask_account_pnl", "ask_client_id", "bid_client_id", "ask_client_id_str", "bid_client_id_str", "ask_id_str", "bid_id_str", "trade_id_str", "integrator_maker_fee", "integrator_maker_fee_collector_index", "integrator_taker_fee", "integrator_taker_fee_collector_index", "taker_allocated_margin_usdc_before", "taker_allocated_margin_usdc_after", "maker_allocated_margin_usdc_before", "maker_allocated_margin_usdc_after", "bid_order_version", "ask_order_version"] @field_validator('type') def type_validate_enum(cls, value): @@ -177,7 +179,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "taker_allocated_margin_usdc_before": obj.get("taker_allocated_margin_usdc_before"), "taker_allocated_margin_usdc_after": obj.get("taker_allocated_margin_usdc_after"), "maker_allocated_margin_usdc_before": obj.get("maker_allocated_margin_usdc_before"), - "maker_allocated_margin_usdc_after": obj.get("maker_allocated_margin_usdc_after") + "maker_allocated_margin_usdc_after": obj.get("maker_allocated_margin_usdc_after"), + "bid_order_version": obj.get("bid_order_version"), + "ask_order_version": obj.get("ask_order_version") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/trade_stats.py b/lighter/models/trade_stats.py index 28e48ef3..1f33e4e9 100644 --- a/lighter/models/trade_stats.py +++ b/lighter/models/trade_stats.py @@ -34,8 +34,14 @@ class TradeStats(BaseModel): mobile_app_volume: StrictStr mobile_browser_count: StrictInt mobile_browser_volume: StrictStr + maker_fees_paid: StrictStr + non_free_taker_volume: StrictStr + non_free_maker_volume: StrictStr + free_taker_volume: StrictStr + taker_fees_paid: StrictStr + free_maker_volume: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["count", "volume", "web_count", "web_volume", "mobile_app_count", "mobile_app_volume", "mobile_browser_count", "mobile_browser_volume"] + __properties: ClassVar[List[str]] = ["count", "volume", "web_count", "web_volume", "mobile_app_count", "mobile_app_volume", "mobile_browser_count", "mobile_browser_volume", "maker_fees_paid", "non_free_taker_volume", "non_free_maker_volume", "free_taker_volume", "taker_fees_paid", "free_maker_volume"] model_config = ConfigDict( populate_by_name=True, @@ -102,7 +108,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "mobile_app_count": obj.get("mobile_app_count"), "mobile_app_volume": obj.get("mobile_app_volume"), "mobile_browser_count": obj.get("mobile_browser_count"), - "mobile_browser_volume": obj.get("mobile_browser_volume") + "mobile_browser_volume": obj.get("mobile_browser_volume"), + "maker_fees_paid": obj.get("maker_fees_paid"), + "non_free_taker_volume": obj.get("non_free_taker_volume"), + "non_free_maker_volume": obj.get("non_free_maker_volume"), + "free_taker_volume": obj.get("free_taker_volume"), + "taker_fees_paid": obj.get("taker_fees_paid"), + "free_maker_volume": obj.get("free_maker_volume") }) # 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 864e64d8..cb53092f 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', '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')") + if value not in set(['L2TransferInflow', 'L2TransferOutflow', 'L2BurnSharesInflow', 'L2BurnSharesOutflow', 'L2MintSharesInflow', 'L2MintSharesOutflow', 'L2SelfTransfer', 'L2StakeAssetInflow', 'L2StakeAssetOutflow', 'L2UnstakeAssetInflow', 'L2UnstakeAssetOutflow', 'L2ForceBurnSharesInflow', 'L2ForceBurnSharesOutflow', 'L1BurnSharesInflow', 'L1BurnSharesOutflow', 'L1UnstakeAssetInflow', 'L1UnstakeAssetOutflow', 'L2CreatePublicPoolInflow', 'L2CreatePublicPoolOutflow', 'L2CreateStakingPoolInflow', 'L2CreateStakingPoolOutflow']): + raise ValueError("must be one of enum values ('L2TransferInflow', 'L2TransferOutflow', 'L2BurnSharesInflow', 'L2BurnSharesOutflow', 'L2MintSharesInflow', 'L2MintSharesOutflow', 'L2SelfTransfer', 'L2StakeAssetInflow', 'L2StakeAssetOutflow', 'L2UnstakeAssetInflow', 'L2UnstakeAssetOutflow', 'L2ForceBurnSharesInflow', 'L2ForceBurnSharesOutflow', 'L1BurnSharesInflow', 'L1BurnSharesOutflow', 'L1UnstakeAssetInflow', 'L1UnstakeAssetOutflow', 'L2CreatePublicPoolInflow', 'L2CreatePublicPoolOutflow', 'L2CreateStakingPoolInflow', 'L2CreateStakingPoolOutflow')") return value @field_validator('from_route') diff --git a/lighter/models/user_referrals.py b/lighter/models/user_referrals.py index 288a0a50..73617e81 100644 --- a/lighter/models/user_referrals.py +++ b/lighter/models/user_referrals.py @@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from lighter.models.referral import Referral +from lighter.models.referral_totals import ReferralTotals from typing import Optional, Set from typing_extensions import Self @@ -32,8 +33,9 @@ class UserReferrals(BaseModel): cursor: StrictStr referrals: List[Referral] used_code: StrictStr + totals: ReferralTotals additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "cursor", "referrals", "used_code"] + __properties: ClassVar[List[str]] = ["code", "message", "cursor", "referrals", "used_code", "totals"] model_config = ConfigDict( populate_by_name=True, @@ -83,6 +85,9 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['referrals'] = _items + # override the default output from pydantic by calling `to_dict()` of totals + if self.totals: + _dict['totals'] = self.totals.to_dict() # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -104,7 +109,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "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, - "used_code": obj.get("used_code") + "used_code": obj.get("used_code"), + "totals": ReferralTotals.from_dict(obj["totals"]) if obj.get("totals") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/paper_client/order_book.py b/lighter/paper_client/order_book.py index 7b6eecf5..8338ca64 100644 --- a/lighter/paper_client/order_book.py +++ b/lighter/paper_client/order_book.py @@ -1,9 +1,9 @@ from dataclasses import dataclass, field from typing import Any, Iterable, List, Mapping, Optional, Tuple, Union -from lighter.models.order_book_depth import OrderBookDepth +from lighter.paper_client.order_book_depth import OrderBookDepth from lighter.models.order_book_orders import OrderBookOrders -from lighter.models.price_level import PriceLevel +from lighter.paper_client.price_level import PriceLevel from lighter.models.simple_order import SimpleOrder diff --git a/lighter/models/order_book_depth.py b/lighter/paper_client/order_book_depth.py similarity index 97% rename from lighter/models/order_book_depth.py rename to lighter/paper_client/order_book_depth.py index 485558ab..41cf1e65 100644 --- a/lighter/models/order_book_depth.py +++ b/lighter/paper_client/order_book_depth.py @@ -1,17 +1,16 @@ # coding: utf-8 """ - + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: + 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 @@ -19,14 +18,15 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from lighter.models.price_level import PriceLevel +from lighter.paper_client.price_level import PriceLevel from typing import Optional, Set from typing_extensions import Self + class OrderBookDepth(BaseModel): """ OrderBookDepth - """ # noqa: E501 + """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None asks: List[PriceLevel] @@ -42,7 +42,6 @@ class OrderBookDepth(BaseModel): 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)) @@ -122,4 +121,3 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return _obj - diff --git a/lighter/models/price_level.py b/lighter/paper_client/price_level.py similarity index 97% rename from lighter/models/price_level.py rename to lighter/paper_client/price_level.py index 188551a7..07ea69fb 100644 --- a/lighter/models/price_level.py +++ b/lighter/paper_client/price_level.py @@ -1,17 +1,16 @@ # coding: utf-8 """ - + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: + 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 @@ -22,10 +21,11 @@ from typing import Optional, Set from typing_extensions import Self + class PriceLevel(BaseModel): """ PriceLevel - """ # noqa: E501 + """ # noqa: E501 price: StrictStr size: StrictStr additional_properties: Dict[str, Any] = {} @@ -37,7 +37,6 @@ class PriceLevel(BaseModel): 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)) @@ -99,4 +98,3 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return _obj - diff --git a/openapi.json b/openapi.json index 57aff283..4c4656d0 100644 --- a/openapi.json +++ b/openapi.json @@ -470,16 +470,6 @@ "name": "authorization", "in": "header", "required": false, - "description": " make required after integ is done", - "schema": { - "type": "string" - } - }, - { - "name": "auth", - "in": "query", - "required": false, - "description": " made optional to support header auth clients", "schema": { "type": "string" } @@ -906,8 +896,7 @@ "1h", "4h", "12h", - "1d", - "1w" + "1d" ] } }, @@ -990,7 +979,6 @@ "name": "authorization", "in": "header", "required": false, - "description": " make required after integ is done", "schema": { "type": "string" } @@ -1288,6 +1276,16 @@ ], "default": "all" } + }, + { + "name": "aggregate", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "format": "boolean", + "default": "false" + } } ], "responses": { @@ -1385,7 +1383,7 @@ "tags": [ "candlestick" ], - "description": "Get fundings", + "description": "Get fundings. Maximum 750 fundings will be returned per call. `count_back` indicates the number of fundings you would like to be returned, starting from `start_timestamp`, if set to 0, all fundings will be returned.", "parameters": [ { "name": "market_id", @@ -1659,7 +1657,6 @@ "name": "authorization", "in": "header", "required": false, - "description": " make required after integ is done", "schema": { "type": "string" } @@ -2014,16 +2011,6 @@ "format": "int64" } }, - { - "name": "market_id", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int16", - "default": "255" - } - }, { "name": "cursor", "in": "query", @@ -2074,6 +2061,19 @@ "type": "integer", "format": "int64" } + }, + { + "name": "market_ids", + "in": "query", + "required": false, + "description": "comma-separated int64s, e.g. \"1,2\"", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int16" + } + } } ], "responses": { @@ -2630,7 +2630,12 @@ "L2MintShares", "L2BurnShares", "L2StakeAssets", - "L2UnstakeAssets" + "L2UnstakeAssets", + "L2CreatePublicPool", + "L2CreateStakingPool", + "L1BurnShares", + "L1UnstakeAssets", + "ReferralProgramPayout" ] } } @@ -3020,7 +3025,6 @@ "name": "authorization", "in": "header", "required": false, - "description": " make required after integ is done", "schema": { "type": "string" } @@ -3124,7 +3128,6 @@ "name": "authorization", "in": "header", "required": false, - "description": " make required after integ is done", "schema": { "type": "string" } @@ -3483,7 +3486,6 @@ "name": "authorization", "in": "header", "required": false, - "description": " make required after integ is done", "schema": { "type": "string" } @@ -3534,18 +3536,8 @@ "parameters": [ { "name": "authorization", - "in": "query", - "required": false, - "description": " make required after integ is done", - "schema": { - "type": "string" - } - }, - { - "name": "auth", - "in": "query", + "in": "header", "required": false, - "description": " made optional to support header auth clients", "schema": { "type": "string" } @@ -3597,7 +3589,6 @@ "name": "authorization", "in": "header", "required": false, - "description": " make required after integ is done", "schema": { "type": "string" } @@ -3650,7 +3641,6 @@ "name": "authorization", "in": "header", "required": false, - "description": " make required after integ is done", "schema": { "type": "string" } @@ -3703,7 +3693,6 @@ "name": "authorization", "in": "header", "required": false, - "description": " make required after integ is done", "schema": { "type": "string" } @@ -3874,15 +3863,6 @@ "maximum": 100 }, "description": "Number of results to return (1–100, default 20)" - }, - { - "name": "auth", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "description": "Read-only auth (alternative to header authorization)" } ], "responses": { @@ -3995,14 +3975,6 @@ "type": "string" } }, - { - "name": "auth", - "in": "query", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "stats_start_timestamp", "in": "query", @@ -4031,6 +4003,16 @@ "minimum": 1, "maximum": 300 } + }, + { + "name": "is_eligible", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "format": "boolean", + "default": "false" + } } ], "responses": { @@ -4316,6 +4298,14 @@ "type": "integer", "format": "int64" } + }, + { + "name": "period", + "in": "query", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { @@ -4433,7 +4423,7 @@ "tags": [ "account" ], - "description": "Respond to RFQ", + "description": "Respond to RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing.", "parameters": [ { "name": "authorization", @@ -4619,7 +4609,7 @@ "tags": [ "account" ], - "description": "Create RFQ", + "description": "Create RFQ. Makers have up to 1 minute to answer an RFQ, after which the user has up to 2 minutes to execute the trade. Quotes are not locked. Makers place orders directly into the order book and can dynamically adjust pricing.", "parameters": [ { "name": "authorization", @@ -4715,72 +4705,393 @@ } } } - } - }, - "servers": [ - { - "url": "https://mainnet.zklighter.elliot.ai" - } - ], - "components": { - "securitySchemes": { - "apiKey": { - "type": "apiKey", - "description": "Enter JWT Bearer token **_only_**", - "name": "Authorization", - "in": "header" - } }, - "schemas": { - "Account": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" + "/api/v1/markPriceCandles": { + "get": { + "summary": "markPriceCandles", + "operationId": "markPriceCandles", + "tags": [ + "candlestick" + ], + "description": "Get mark price candles", + "parameters": [ + { + "name": "market_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int16" + } }, - "account_type": { - "type": "integer", - "format": "uint8", - "example": "1" + { + "name": "resolution", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "1m", + "5m", + "15m", + "30m", + "1h", + "4h", + "12h", + "1d" + ] + } }, - "account_trading_mode": { - "type": "integer", - "format": "uint8", - "example": "1", - "description": "Classic=0 and Unified=1" + { + "name": "start_timestamp", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 + } }, - "index": { - "type": "integer", - "format": "int64", - "example": "1" + { + "name": "end_timestamp", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 + } }, - "l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + { + "name": "count_back", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkPriceCandles" + } + } + } }, - "cancel_all_time": { - "type": "integer", - "format": "int64", - "example": "1640995200" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/accountOrders": { + "get": { + "summary": "accountOrders", + "operationId": "accountOrders", + "tags": [ + "order" + ], + "description": "Get account orders by client order indexes. Account index defaults to the authorization token's account. Supports the last 10K active orders (with no time limits), or the last 1K inactive orders (in the last 24 hours).", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } }, - "total_order_count": { - "type": "integer", - "format": "int64", - "example": "100" + { + "name": "account_index", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": "281474976710655" + } }, - "total_isolated_order_count": { - "type": "integer", - "format": "int64", - "example": "100" + { + "name": "client_order_indexes", + "in": "query", + "description": " comma-separated int64s, e.g. \"123,456\", with a limit of 20.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Orders" + } + } + } }, - "pending_order_count": { - "type": "integer", - "format": "int64", + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/marketPriceCharts": { + "get": { + "summary": "marketPriceCharts", + "operationId": "marketPriceCharts", + "tags": [ + "candlestick" + ], + "description": "Get last 24h hourly prices for all markets (mark price for perps, index price for spot)", + "parameters": [ + { + "name": "market_ids", + "in": "query", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int16" + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarketPriceCharts" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/livePoints/total": { + "get": { + "summary": "livePoints_total", + "operationId": "livePoints_total", + "tags": [ + "livepoints" + ], + "description": "Get live points total for an account", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "account_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LivePointsTotal" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/leaderboard": { + "get": { + "summary": "leaderboard", + "operationId": "leaderboard", + "tags": [ + "account" + ], + "description": "Get points leaderboard. Type should be all.", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "weekly", + "all", + "competition" + ] + } + }, + { + "name": "l1_address", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "competition_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Leaderboard" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + } + }, + "servers": [ + { + "url": "https://mainnet.zklighter.elliot.ai" + } + ], + "components": { + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } + }, + "schemas": { + "Account": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "account_type": { + "type": "integer", + "format": "uint8", + "example": "1" + }, + "account_trading_mode": { + "type": "integer", + "format": "uint8", + "example": "1", + "description": "Classic=0 and Unified=1" + }, + "index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "cancel_all_time": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "total_order_count": { + "type": "integer", + "format": "int64", + "example": "100" + }, + "total_isolated_order_count": { + "type": "integer", + "format": "int64", + "example": "100" + }, + "pending_order_count": { + "type": "integer", + "format": "int64", "example": "100" }, "available_balance": { @@ -4849,6 +5160,10 @@ "enabled", "disabled" ] + }, + "multiplier": { + "type": "string", + "example": "1.000000000000000000" } }, "title": "AccountAsset", @@ -4857,8 +5172,9 @@ "asset_id", "balance", "locked_balance", + "margin_mode", "margin_balance", - "margin_mode" + "multiplier" ] }, "AccountApiKeys": { @@ -4990,6 +5306,9 @@ "items": { "type": "string" } + }, + "metadata": { + "$ref": "#/components/schemas/SubAccountMetadata" } }, "title": "AccountMetadata", @@ -5001,7 +5320,8 @@ "referral_points_percentage", "can_rfq", "can_rfq_market_ids", - "created_at" + "created_at", + "metadata" ] }, "AccountMetadatas": { @@ -5135,6 +5455,11 @@ }, "total_discount": { "type": "string" + }, + "margin_set_flag": { + "type": "integer", + "format": "int32", + "example": "1" } }, "title": "AccountPosition", @@ -5153,6 +5478,7 @@ "realized_pnl", "liquidation_price", "margin_mode", + "margin_set_flag", "allocated_margin", "total_discount" ] @@ -5285,6 +5611,10 @@ "liquidation_factor": { "type": "string", "example": "0.9" + }, + "multiplier": { + "type": "string", + "example": "1.000000000000000000" } }, "title": "Asset", @@ -5305,7 +5635,8 @@ "liquidation_fee", "global_supply_cap", "user_supply_cap", - "total_supplied" + "total_supplied", + "multiplier" ] }, "AssetDetails": { @@ -5889,6 +6220,9 @@ "items": { "type": "string" } + }, + "metadata": { + "$ref": "#/components/schemas/SubAccountMetadata" } }, "title": "DetailedAccount", @@ -5913,6 +6247,7 @@ "can_rfq", "can_rfq_market_ids", "created_at", + "metadata", "positions", "assets", "total_asset_value", @@ -6275,13 +6610,25 @@ }, "referral_points_percentage": { "type": "string" + }, + "referral_program_kickback": { + "type": "string", + "example": "10.0" + }, + "referral_program_kickback_history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReferralProgramKickback" + } } }, "title": "L1Metadata", "required": [ "l1_address", "can_invite", - "referral_points_percentage" + "referral_points_percentage", + "referral_program_kickback", + "referral_program_kickback_history" ] }, "L1ProviderInfo": { @@ -6731,6 +7078,11 @@ }, "integrator_taker_fee": { "type": "string" + }, + "order_flags": { + "type": "integer", + "format": "int64", + "example": "1" } }, "title": "Order", @@ -6764,13 +7116,14 @@ "to_trigger_order_id_0", "to_trigger_order_id_1", "to_cancel_order_id_0", + "integrator_fee_collector_index", + "integrator_taker_fee", + "integrator_maker_fee", + "order_flags", "block_height", "timestamp", "created_at", "updated_at", - "integrator_fee_collector_index", - "integrator_maker_fee", - "integrator_taker_fee", "transaction_time" ] }, @@ -6858,6 +7211,14 @@ "is_taker_fee_enabled": { "type": "boolean", "example": true + }, + "created_at": { + "type": "string", + "example": "1640995200000" + }, + "multiplier": { + "type": "string", + "example": "1.000000000000000000" } }, "title": "OrderBook", @@ -6878,7 +7239,9 @@ "order_quote_limit", "supported_size_decimals", "supported_price_decimals", - "supported_quote_decimals" + "supported_quote_decimals", + "created_at", + "multiplier" ] }, "PerpsOrderBookDetail": { @@ -7067,6 +7430,31 @@ "base_interest_rate": { "type": "string", "example": "0.0001" + }, + "created_at": { + "type": "string", + "example": "1640995200000" + }, + "mark_price": { + "type": "string", + "example": "3024.66" + }, + "index_price": { + "type": "string", + "example": "3024.66" + }, + "multiplier": { + "type": "string", + "example": "1.000000000000000000" + }, + "market_flags": { + "type": "integer", + "format": "int64" + }, + "funding_premium_multiplier": { + "type": "integer", + "format": "uin16", + "example": "100" } }, "title": "PerpsOrderBookDetail", @@ -7088,6 +7476,7 @@ "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", + "created_at", "size_decimals", "price_decimals", "quote_multiplier", @@ -7279,6 +7668,14 @@ "is_taker_fee_enabled": { "type": "boolean", "example": true + }, + "created_at": { + "type": "string", + "example": "1640995200000" + }, + "multiplier": { + "type": "string", + "example": "1.000000000000000000" } }, "title": "SpotOrderBookDetail", @@ -7300,6 +7697,8 @@ "supported_size_decimals", "supported_price_decimals", "supported_quote_decimals", + "created_at", + "multiplier", "size_decimals", "price_decimals", "last_trade_price", @@ -7928,10 +8327,6 @@ "type": "string", "example": "'liq:17:5898'" }, - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, "account_index": { "type": "integer", "format": "int64" @@ -7946,10 +8341,6 @@ "ReqChangeAccountTier": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, "account_index": { "type": "integer", "format": "int64" @@ -8001,9 +8392,6 @@ "api_key_indexes": { "type": "string", "description": "JSON array string of API key indexes, e.g. \"[4,5]\". Use [] to clear all maker-only restrictions." - }, - "auth": { - "type": "string" } }, "required": [ @@ -8276,6 +8664,9 @@ }, "usdc_portfolio_value": { "type": "string" + }, + "total_portfolio_value": { + "type": "string" } }, "title": "RiskParameters", @@ -8388,6 +8779,18 @@ "timestamp" ] }, + "SubAccountMetadata": { + "type": "object", + "properties": { + "color": { + "type": "string" + } + }, + "title": "SubAccountMetadata", + "required": [ + "color" + ] + }, "SubAccounts": { "type": "object", "properties": { @@ -8625,6 +9028,16 @@ "type": "integer", "format": "int64", "example": "250000000000000" + }, + "bid_order_version": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "ask_order_version": { + "type": "integer", + "format": "int64", + "example": "1" } }, "title": "Trade", @@ -8666,7 +9079,9 @@ "taker_allocated_margin_usdc_before", "taker_allocated_margin_usdc_after", "maker_allocated_margin_usdc_before", - "maker_allocated_margin_usdc_after" + "maker_allocated_margin_usdc_after", + "ask_order_version", + "bid_order_version" ] }, "Trades": { @@ -8776,7 +9191,15 @@ "L2UnstakeAssetInflow", "L2UnstakeAssetOutflow", "L2ForceBurnSharesInflow", - "L2ForceBurnSharesOutflow" + "L2ForceBurnSharesOutflow", + "L1BurnSharesInflow", + "L1BurnSharesOutflow", + "L1UnstakeAssetInflow", + "L1UnstakeAssetOutflow", + "L2CreatePublicPoolInflow", + "L2CreatePublicPoolOutflow", + "L2CreateStakingPoolInflow", + "L2CreateStakingPoolOutflow" ] }, "from_l1_address": { @@ -9111,10 +9534,6 @@ }, "to_address": { "type": "string" - }, - "auth": { - "type": "string", - "description": " made optional to support header auth clients" } }, "title": "ReqFastwithdraw", @@ -9356,10 +9775,6 @@ "ReqUpdateReferralCode": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, "account_index": { "type": "integer", "format": "int64" @@ -9421,10 +9836,6 @@ "ReqUseReferralCode": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, "l1_address": { "type": "string" }, @@ -9447,8 +9858,7 @@ "title": "ReqUseReferralCode", "required": [ "l1_address", - "referral_code", - "x" + "referral_code" ] }, "ReqCreateIntentAddress": { @@ -9513,27 +9923,17 @@ "referral_code": { "type": "string", "example": "5V24K3MJ" - }, - "remaining_usage": { - "type": "integer", - "format": "int32", - "example": "3" } }, "title": "ReferralCode", "required": [ "code", - "referral_code", - "remaining_usage" + "referral_code" ] }, "ReqCreateReferralCode": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, "account_index": { "type": "integer", "format": "int64" @@ -9547,10 +9947,6 @@ "ReqUpdateKickback": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, "account_index": { "type": "integer", "format": "int64" @@ -10063,13 +10459,17 @@ }, "used_code": { "type": "string" + }, + "totals": { + "$ref": "#/components/schemas/ReferralTotals" } }, "required": [ "code", "cursor", - "referrals", - "used_code" + "used_code", + "totals", + "referrals" ] }, "ReqSetAccountMetadata": { @@ -10089,9 +10489,6 @@ }, "metadata": { "type": "string" - }, - "auth": { - "type": "string" } }, "required": [ @@ -10229,6 +10626,24 @@ }, "mobile_browser_volume": { "type": "string" + }, + "maker_fees_paid": { + "type": "string" + }, + "non_free_taker_volume": { + "type": "string" + }, + "non_free_maker_volume": { + "type": "string" + }, + "free_taker_volume": { + "type": "string" + }, + "taker_fees_paid": { + "type": "string" + }, + "free_maker_volume": { + "type": "string" } }, "title": "TradeStats", @@ -10240,7 +10655,13 @@ "mobile_app_count", "mobile_app_volume", "mobile_browser_count", - "mobile_browser_volume" + "mobile_browser_volume", + "free_maker_volume", + "free_taker_volume", + "non_free_maker_volume", + "non_free_taker_volume", + "maker_fees_paid", + "taker_fees_paid" ] }, "ApprovedIntegrator": { @@ -10604,6 +11025,9 @@ }, "worst_price": { "type": "string" + }, + "mark_price": { + "type": "string" } }, "title": "RFQMetadata", @@ -10611,6 +11035,7 @@ "requested_est_price", "requested_max_slippage", "requested_slippage", + "mark_price", "worst_price" ] }, @@ -10995,6 +11420,277 @@ "created_at", "updated_at" ] + }, + "MarkPriceCandles": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "r": { + "type": "string", + "example": "15m", + "description": " resolution" + }, + "c": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MarkPriceCandle" + }, + "description": " candles" + } + }, + "title": "MarkPriceCandles", + "required": [ + "code", + "r", + "c" + ] + }, + "MarkPriceCandle": { + "type": "object", + "properties": { + "t": { + "type": "integer", + "format": "int64", + "example": "1640995200", + "description": " timestamp" + }, + "o": { + "type": "number", + "format": "double", + "example": "3024.66", + "description": " open" + }, + "h": { + "type": "number", + "format": "double", + "example": "3034.66", + "description": " high" + }, + "l": { + "type": "number", + "format": "double", + "example": "3014.66", + "description": " low" + }, + "c": { + "type": "number", + "format": "double", + "example": "3024.66", + "description": " close" + }, + "sc": { + "type": "integer", + "format": "int64", + "example": "42", + "description": " sample_count" + } + }, + "title": "MarkPriceCandle", + "required": [ + "t", + "o", + "h", + "l", + "c", + "sc" + ] + }, + "MarketPriceCharts": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "resolution": { + "type": "string", + "example": "1h" + }, + "price_charts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MarketPriceChart" + } + } + }, + "title": "MarketPriceCharts", + "required": [ + "code", + "resolution", + "price_charts" + ] + }, + "MarketPriceChart": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "int16" + }, + "prices": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "MarketPriceChart", + "required": [ + "market_id", + "prices" + ] + }, + "LivePointsTotal": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "total_live_points": { + "type": "number", + "format": "double" + } + }, + "title": "LivePointsTotal", + "required": [ + "code", + "total_live_points" + ] + }, + "ReferralProgramKickback": { + "type": "object", + "properties": { + "date": { + "type": "integer", + "format": "int64", + "example": "1785110400000" + }, + "percentage": { + "type": "string", + "example": "10.0" + } + }, + "title": "ReferralProgramKickback", + "required": [ + "date", + "percentage" + ] + }, + "ReferralTotals": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int64" + }, + "volume": { + "type": "string" + }, + "free_maker_volume": { + "type": "string" + }, + "free_taker_volume": { + "type": "string" + }, + "non_free_maker_volume": { + "type": "string" + }, + "non_free_taker_volume": { + "type": "string" + }, + "maker_fees_paid": { + "type": "string" + }, + "taker_fees_paid": { + "type": "string" + }, + "total_referrals": { + "type": "integer", + "format": "int64" + }, + "total_premium_referrals": { + "type": "integer", + "format": "int64" + } + }, + "title": "ReferralTotals", + "required": [ + "count", + "volume", + "free_maker_volume", + "free_taker_volume", + "non_free_maker_volume", + "non_free_taker_volume", + "maker_fees_paid", + "taker_fees_paid", + "total_referrals", + "total_premium_referrals" + ] + }, + "Leaderboard": { + "type": "object", + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LeaderboardEntry" + } + } + }, + "title": "Leaderboard", + "required": [ + "entries" + ] + }, + "LeaderboardEntry": { + "type": "object", + "properties": { + "l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "points": { + "type": "number", + "format": "float", + "example": "1000.01" + }, + "entry": { + "type": "integer", + "format": "int32" + }, + "entryId": { + "type": "integer", + "format": "int32" + }, + "metadata": { + "type": "string", + "example": "{}" + } + }, + "title": "LeaderboardEntry", + "required": [ + "l1_address", + "points", + "entry", + "entryId", + "metadata" + ] } } } diff --git a/test/paper_client/helpers.py b/test/paper_client/helpers.py index 5f278dc7..0ce3a223 100644 --- a/test/paper_client/helpers.py +++ b/test/paper_client/helpers.py @@ -70,6 +70,7 @@ def default_detail( hidden=False, rfq_enabled=False, ), + created_at="0", strategy_index=0, is_maker_fee_enabled=True, is_taker_fee_enabled=True, diff --git a/test/paper_client/test_order_book.py b/test/paper_client/test_order_book.py index 928d2b07..1951c027 100644 --- a/test/paper_client/test_order_book.py +++ b/test/paper_client/test_order_book.py @@ -1,8 +1,8 @@ import unittest -from lighter.models.order_book_depth import OrderBookDepth +from lighter.paper_client.order_book_depth import OrderBookDepth from lighter.models.order_book_orders import OrderBookOrders -from lighter.models.price_level import PriceLevel +from lighter.paper_client.price_level import PriceLevel from lighter.models.simple_order import SimpleOrder from lighter.paper_client.order_book import InMemoryOrderBook