From bb76e4d475391fc8093a8a213d7c5dc4463a3914 Mon Sep 17 00:00:00 2001 From: mihai Date: Fri, 25 Sep 2026 10:57:27 +0000 Subject: [PATCH] models: add named integer enum types (account type/trading mode, margin mode, pool status, RFQ direction) --- .openapi-generator/FILES | 28 +++++++++++++ README.md | 14 +++++++ docs/Account.md | 4 +- docs/AccountAccountTradingModeEnum.md | 13 ++++++ docs/AccountAccountTypeEnum.md | 21 ++++++++++ docs/AccountPosition.md | 2 +- docs/AccountPositionMarginModeEnum.md | 13 ++++++ docs/DetailedAccount.md | 4 +- docs/DetailedAccountAccountTradingModeEnum.md | 13 ++++++ docs/DetailedAccountAccountTypeEnum.md | 21 ++++++++++ docs/MarketConfig.md | 2 +- docs/MarketConfigMarketMarginModeEnum.md | 13 ++++++ docs/PublicPoolInfo.md | 2 +- docs/PublicPoolInfoStatusEnum.md | 13 ++++++ docs/PublicPoolMetadata.md | 4 +- docs/PublicPoolMetadataAccountTypeEnum.md | 21 ++++++++++ docs/PublicPoolMetadataStatusEnum.md | 13 ++++++ docs/RFQEntry.md | 2 +- docs/RFQEntryDirectionEnum.md | 15 +++++++ docs/RespCreateRFQ.md | 2 +- docs/RespCreateRFQDirectionEnum.md | 15 +++++++ docs/RespGetRFQ.md | 2 +- docs/RespGetRFQDirectionEnum.md | 15 +++++++ docs/RespRespondToRFQ.md | 2 +- docs/RespRespondToRFQDirectionEnum.md | 15 +++++++ docs/RespUpdateRFQ.md | 2 +- docs/RespUpdateRFQDirectionEnum.md | 15 +++++++ lighter/__init__.py | 14 +++++++ lighter/models/__init__.py | 14 +++++++ lighter/models/account.py | 20 +++++++-- .../account_account_trading_mode_enum.py | 37 +++++++++++++++++ lighter/models/account_account_type_enum.py | 41 +++++++++++++++++++ lighter/models/account_position.py | 11 ++++- .../account_position_margin_mode_enum.py | 37 +++++++++++++++++ lighter/models/detailed_account.py | 23 +++++++++-- ...ailed_account_account_trading_mode_enum.py | 37 +++++++++++++++++ .../detailed_account_account_type_enum.py | 41 +++++++++++++++++++ lighter/models/market_config.py | 11 ++++- .../market_config_market_margin_mode_enum.py | 37 +++++++++++++++++ lighter/models/public_pool_info.py | 11 ++++- .../models/public_pool_info_status_enum.py | 37 +++++++++++++++++ lighter/models/public_pool_metadata.py | 20 +++++++-- .../public_pool_metadata_account_type_enum.py | 41 +++++++++++++++++++ .../public_pool_metadata_status_enum.py | 37 +++++++++++++++++ lighter/models/resp_create_rfq.py | 11 ++++- .../models/resp_create_rfq_direction_enum.py | 38 +++++++++++++++++ lighter/models/resp_get_rfq.py | 11 ++++- lighter/models/resp_get_rfq_direction_enum.py | 38 +++++++++++++++++ lighter/models/resp_respond_to_rfq.py | 11 ++++- .../resp_respond_to_rfq_direction_enum.py | 38 +++++++++++++++++ lighter/models/resp_update_rfq.py | 11 ++++- .../models/resp_update_rfq_direction_enum.py | 38 +++++++++++++++++ lighter/models/rfq_entry.py | 11 ++++- lighter/models/rfq_entry_direction_enum.py | 38 +++++++++++++++++ 54 files changed, 961 insertions(+), 39 deletions(-) create mode 100644 docs/AccountAccountTradingModeEnum.md create mode 100644 docs/AccountAccountTypeEnum.md create mode 100644 docs/AccountPositionMarginModeEnum.md create mode 100644 docs/DetailedAccountAccountTradingModeEnum.md create mode 100644 docs/DetailedAccountAccountTypeEnum.md create mode 100644 docs/MarketConfigMarketMarginModeEnum.md create mode 100644 docs/PublicPoolInfoStatusEnum.md create mode 100644 docs/PublicPoolMetadataAccountTypeEnum.md create mode 100644 docs/PublicPoolMetadataStatusEnum.md create mode 100644 docs/RFQEntryDirectionEnum.md create mode 100644 docs/RespCreateRFQDirectionEnum.md create mode 100644 docs/RespGetRFQDirectionEnum.md create mode 100644 docs/RespRespondToRFQDirectionEnum.md create mode 100644 docs/RespUpdateRFQDirectionEnum.md create mode 100644 lighter/models/account_account_trading_mode_enum.py create mode 100644 lighter/models/account_account_type_enum.py create mode 100644 lighter/models/account_position_margin_mode_enum.py create mode 100644 lighter/models/detailed_account_account_trading_mode_enum.py create mode 100644 lighter/models/detailed_account_account_type_enum.py create mode 100644 lighter/models/market_config_market_margin_mode_enum.py create mode 100644 lighter/models/public_pool_info_status_enum.py create mode 100644 lighter/models/public_pool_metadata_account_type_enum.py create mode 100644 lighter/models/public_pool_metadata_status_enum.py create mode 100644 lighter/models/resp_create_rfq_direction_enum.py create mode 100644 lighter/models/resp_get_rfq_direction_enum.py create mode 100644 lighter/models/resp_respond_to_rfq_direction_enum.py create mode 100644 lighter/models/resp_update_rfq_direction_enum.py create mode 100644 lighter/models/rfq_entry_direction_enum.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 722ca2d7..f6aa0817 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,5 +1,7 @@ README.md docs/Account.md +docs/AccountAccountTradingModeEnum.md +docs/AccountAccountTypeEnum.md docs/AccountApi.md docs/AccountApiKeys.md docs/AccountAsset.md @@ -8,6 +10,7 @@ docs/AccountMetadata.md docs/AccountMetadatas.md docs/AccountPnL.md docs/AccountPosition.md +docs/AccountPositionMarginModeEnum.md docs/Announcement.md docs/AnnouncementApi.md docs/Announcements.md @@ -33,6 +36,8 @@ docs/Deposit.md docs/DepositHistory.md docs/DepositHistoryItem.md docs/DetailedAccount.md +docs/DetailedAccountAccountTradingModeEnum.md +docs/DetailedAccountAccountTypeEnum.md docs/DetailedAccounts.md docs/EnrichedTx.md docs/ExchangeMetric.md @@ -61,6 +66,7 @@ docs/LivepointsApi.md docs/MarkPriceCandle.md docs/MarkPriceCandles.md docs/MarketConfig.md +docs/MarketConfigMarketMarginModeEnum.md docs/MarketPriceChart.md docs/MarketPriceCharts.md docs/NextNonce.md @@ -80,9 +86,13 @@ docs/PnLEntry.md docs/PositionFunding.md docs/PositionFundings.md docs/PublicPoolInfo.md +docs/PublicPoolInfoStatusEnum.md docs/PublicPoolMetadata.md +docs/PublicPoolMetadataAccountTypeEnum.md +docs/PublicPoolMetadataStatusEnum.md docs/PublicPoolShare.md docs/RFQEntry.md +docs/RFQEntryDirectionEnum.md docs/RFQMetadata.md docs/RFQResponseEntry.md docs/Referral.md @@ -95,6 +105,7 @@ docs/ReferralTotals.md docs/ReqSetAccountMetadata.md docs/RespChangeAccountTier.md docs/RespCreateRFQ.md +docs/RespCreateRFQDirectionEnum.md docs/RespGetApiTokens.md docs/RespGetExchangeMetrics.md docs/RespGetExecuteStats.md @@ -104,10 +115,12 @@ docs/RespGetLeaseOptions.md docs/RespGetLeases.md docs/RespGetMakerOnlyApiKeys.md docs/RespGetRFQ.md +docs/RespGetRFQDirectionEnum.md docs/RespListRFQs.md docs/RespPostApiToken.md docs/RespPublicPoolsMetadata.md docs/RespRespondToRFQ.md +docs/RespRespondToRFQDirectionEnum.md docs/RespRevokeApiToken.md docs/RespSendTx.md docs/RespSendTxBatch.md @@ -115,6 +128,7 @@ docs/RespSetMakerOnlyApiKeys.md docs/RespSyntheticSpotInfo.md docs/RespUpdateKickback.md docs/RespUpdateRFQ.md +docs/RespUpdateRFQDirectionEnum.md docs/RespUpdateReferralCode.md docs/RespWithdrawalDelay.md docs/ResultCode.md @@ -170,6 +184,8 @@ lighter/configuration.py lighter/exceptions.py lighter/models/__init__.py lighter/models/account.py +lighter/models/account_account_trading_mode_enum.py +lighter/models/account_account_type_enum.py lighter/models/account_api_keys.py lighter/models/account_asset.py lighter/models/account_limits.py @@ -177,6 +193,7 @@ lighter/models/account_metadata.py lighter/models/account_metadatas.py lighter/models/account_pn_l.py lighter/models/account_position.py +lighter/models/account_position_margin_mode_enum.py lighter/models/announcement.py lighter/models/announcements.py lighter/models/api_key.py @@ -198,6 +215,8 @@ lighter/models/deposit.py lighter/models/deposit_history.py lighter/models/deposit_history_item.py lighter/models/detailed_account.py +lighter/models/detailed_account_account_trading_mode_enum.py +lighter/models/detailed_account_account_type_enum.py lighter/models/detailed_accounts.py lighter/models/enriched_tx.py lighter/models/exchange_metric.py @@ -223,6 +242,7 @@ 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_config_market_margin_mode_enum.py lighter/models/market_price_chart.py lighter/models/market_price_charts.py lighter/models/next_nonce.py @@ -240,7 +260,10 @@ lighter/models/pn_l_entry.py lighter/models/position_funding.py lighter/models/position_fundings.py lighter/models/public_pool_info.py +lighter/models/public_pool_info_status_enum.py lighter/models/public_pool_metadata.py +lighter/models/public_pool_metadata_account_type_enum.py +lighter/models/public_pool_metadata_status_enum.py lighter/models/public_pool_share.py lighter/models/referral.py lighter/models/referral_code.py @@ -251,6 +274,7 @@ 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 +lighter/models/resp_create_rfq_direction_enum.py lighter/models/resp_get_api_tokens.py lighter/models/resp_get_exchange_metrics.py lighter/models/resp_get_execute_stats.py @@ -260,10 +284,12 @@ lighter/models/resp_get_lease_options.py lighter/models/resp_get_leases.py lighter/models/resp_get_maker_only_api_keys.py lighter/models/resp_get_rfq.py +lighter/models/resp_get_rfq_direction_enum.py lighter/models/resp_list_rfqs.py lighter/models/resp_post_api_token.py lighter/models/resp_public_pools_metadata.py lighter/models/resp_respond_to_rfq.py +lighter/models/resp_respond_to_rfq_direction_enum.py lighter/models/resp_revoke_api_token.py lighter/models/resp_send_tx.py lighter/models/resp_send_tx_batch.py @@ -272,9 +298,11 @@ lighter/models/resp_synthetic_spot_info.py lighter/models/resp_update_kickback.py lighter/models/resp_update_referral_code.py lighter/models/resp_update_rfq.py +lighter/models/resp_update_rfq_direction_enum.py lighter/models/resp_withdrawal_delay.py lighter/models/result_code.py lighter/models/rfq_entry.py +lighter/models/rfq_entry_direction_enum.py lighter/models/rfq_metadata.py lighter/models/rfq_response_entry.py lighter/models/risk_info.py diff --git a/README.md b/README.md index 48444b3e..64420df4 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,8 @@ Class | Method | HTTP request | Description - [Account](docs/Account.md) + - [AccountAccountTradingModeEnum](docs/AccountAccountTradingModeEnum.md) + - [AccountAccountTypeEnum](docs/AccountAccountTypeEnum.md) - [AccountApiKeys](docs/AccountApiKeys.md) - [AccountAsset](docs/AccountAsset.md) - [AccountLimits](docs/AccountLimits.md) @@ -149,6 +151,7 @@ Class | Method | HTTP request | Description - [AccountMetadatas](docs/AccountMetadatas.md) - [AccountPnL](docs/AccountPnL.md) - [AccountPosition](docs/AccountPosition.md) + - [AccountPositionMarginModeEnum](docs/AccountPositionMarginModeEnum.md) - [Announcement](docs/Announcement.md) - [Announcements](docs/Announcements.md) - [ApiKey](docs/ApiKey.md) @@ -170,6 +173,8 @@ Class | Method | HTTP request | Description - [DepositHistory](docs/DepositHistory.md) - [DepositHistoryItem](docs/DepositHistoryItem.md) - [DetailedAccount](docs/DetailedAccount.md) + - [DetailedAccountAccountTradingModeEnum](docs/DetailedAccountAccountTradingModeEnum.md) + - [DetailedAccountAccountTypeEnum](docs/DetailedAccountAccountTypeEnum.md) - [DetailedAccounts](docs/DetailedAccounts.md) - [EnrichedTx](docs/EnrichedTx.md) - [ExchangeMetric](docs/ExchangeMetric.md) @@ -195,6 +200,7 @@ Class | Method | HTTP request | Description - [MarkPriceCandle](docs/MarkPriceCandle.md) - [MarkPriceCandles](docs/MarkPriceCandles.md) - [MarketConfig](docs/MarketConfig.md) + - [MarketConfigMarketMarginModeEnum](docs/MarketConfigMarketMarginModeEnum.md) - [MarketPriceChart](docs/MarketPriceChart.md) - [MarketPriceCharts](docs/MarketPriceCharts.md) - [NextNonce](docs/NextNonce.md) @@ -212,9 +218,13 @@ Class | Method | HTTP request | Description - [PositionFunding](docs/PositionFunding.md) - [PositionFundings](docs/PositionFundings.md) - [PublicPoolInfo](docs/PublicPoolInfo.md) + - [PublicPoolInfoStatusEnum](docs/PublicPoolInfoStatusEnum.md) - [PublicPoolMetadata](docs/PublicPoolMetadata.md) + - [PublicPoolMetadataAccountTypeEnum](docs/PublicPoolMetadataAccountTypeEnum.md) + - [PublicPoolMetadataStatusEnum](docs/PublicPoolMetadataStatusEnum.md) - [PublicPoolShare](docs/PublicPoolShare.md) - [RFQEntry](docs/RFQEntry.md) + - [RFQEntryDirectionEnum](docs/RFQEntryDirectionEnum.md) - [RFQMetadata](docs/RFQMetadata.md) - [RFQResponseEntry](docs/RFQResponseEntry.md) - [Referral](docs/Referral.md) @@ -226,6 +236,7 @@ Class | Method | HTTP request | Description - [ReqSetAccountMetadata](docs/ReqSetAccountMetadata.md) - [RespChangeAccountTier](docs/RespChangeAccountTier.md) - [RespCreateRFQ](docs/RespCreateRFQ.md) + - [RespCreateRFQDirectionEnum](docs/RespCreateRFQDirectionEnum.md) - [RespGetApiTokens](docs/RespGetApiTokens.md) - [RespGetExchangeMetrics](docs/RespGetExchangeMetrics.md) - [RespGetExecuteStats](docs/RespGetExecuteStats.md) @@ -235,10 +246,12 @@ Class | Method | HTTP request | Description - [RespGetLeases](docs/RespGetLeases.md) - [RespGetMakerOnlyApiKeys](docs/RespGetMakerOnlyApiKeys.md) - [RespGetRFQ](docs/RespGetRFQ.md) + - [RespGetRFQDirectionEnum](docs/RespGetRFQDirectionEnum.md) - [RespListRFQs](docs/RespListRFQs.md) - [RespPostApiToken](docs/RespPostApiToken.md) - [RespPublicPoolsMetadata](docs/RespPublicPoolsMetadata.md) - [RespRespondToRFQ](docs/RespRespondToRFQ.md) + - [RespRespondToRFQDirectionEnum](docs/RespRespondToRFQDirectionEnum.md) - [RespRevokeApiToken](docs/RespRevokeApiToken.md) - [RespSendTx](docs/RespSendTx.md) - [RespSendTxBatch](docs/RespSendTxBatch.md) @@ -246,6 +259,7 @@ Class | Method | HTTP request | Description - [RespSyntheticSpotInfo](docs/RespSyntheticSpotInfo.md) - [RespUpdateKickback](docs/RespUpdateKickback.md) - [RespUpdateRFQ](docs/RespUpdateRFQ.md) + - [RespUpdateRFQDirectionEnum](docs/RespUpdateRFQDirectionEnum.md) - [RespUpdateReferralCode](docs/RespUpdateReferralCode.md) - [RespWithdrawalDelay](docs/RespWithdrawalDelay.md) - [ResultCode](docs/ResultCode.md) diff --git a/docs/Account.md b/docs/Account.md index e2dc303e..ce7d66eb 100644 --- a/docs/Account.md +++ b/docs/Account.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **int** | | **message** | **str** | | [optional] -**account_type** | **int** | | -**account_trading_mode** | **int** | Classic=0 and Unified=1 | +**account_type** | **int** | See AccountAccountTypeEnum | +**account_trading_mode** | **int** | Classic=0 and Unified=1. See AccountAccountTradingModeEnum | **index** | **int** | | **l1_address** | **str** | | **cancel_all_time** | **int** | | diff --git a/docs/AccountAccountTradingModeEnum.md b/docs/AccountAccountTradingModeEnum.md new file mode 100644 index 00000000..e4519d3e --- /dev/null +++ b/docs/AccountAccountTradingModeEnum.md @@ -0,0 +1,13 @@ +# AccountAccountTradingModeEnum + +Named values of Account.account_trading_mode + +## Enum + +* `Simple` (value: `0`) + +* `Unified` (value: `1`) + +[[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/AccountAccountTypeEnum.md b/docs/AccountAccountTypeEnum.md new file mode 100644 index 00000000..376558aa --- /dev/null +++ b/docs/AccountAccountTypeEnum.md @@ -0,0 +1,21 @@ +# AccountAccountTypeEnum + +Named values of Account.account_type + +## Enum + +* `Master` (value: `0`) + +* `Sub` (value: `1`) + +* `PublicPool` (value: `2`) + +* `InsuranceFund` (value: `3`) + +* `LighterStakingPool` (value: `4`) + +* `TreasurySub` (value: `5`) + +[[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/AccountPosition.md b/docs/AccountPosition.md index fe5d1df0..a3f98b36 100644 --- a/docs/AccountPosition.md +++ b/docs/AccountPosition.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **realized_pnl** | **str** | | **liquidation_price** | **str** | | **total_funding_paid_out** | **str** | | [optional] -**margin_mode** | **int** | | +**margin_mode** | **int** | See AccountPositionMarginModeEnum | **allocated_margin** | **str** | | **total_discount** | **str** | | **margin_set_flag** | **int** | | diff --git a/docs/AccountPositionMarginModeEnum.md b/docs/AccountPositionMarginModeEnum.md new file mode 100644 index 00000000..82ef236e --- /dev/null +++ b/docs/AccountPositionMarginModeEnum.md @@ -0,0 +1,13 @@ +# AccountPositionMarginModeEnum + +Named values of AccountPosition.margin_mode + +## Enum + +* `Cross` (value: `0`) + +* `Isolated` (value: `1`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DetailedAccount.md b/docs/DetailedAccount.md index 08b8080c..d4960c62 100644 --- a/docs/DetailedAccount.md +++ b/docs/DetailedAccount.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **int** | | **message** | **str** | | [optional] -**account_type** | **int** | | -**account_trading_mode** | **int** | Classic=0 and Unified=1 | [optional] +**account_type** | **int** | See DetailedAccountAccountTypeEnum | +**account_trading_mode** | **int** | Classic=0 and Unified=1. See DetailedAccountAccountTradingModeEnum | [optional] **index** | **int** | | **l1_address** | **str** | | **cancel_all_time** | **int** | | diff --git a/docs/DetailedAccountAccountTradingModeEnum.md b/docs/DetailedAccountAccountTradingModeEnum.md new file mode 100644 index 00000000..0a4bd22f --- /dev/null +++ b/docs/DetailedAccountAccountTradingModeEnum.md @@ -0,0 +1,13 @@ +# DetailedAccountAccountTradingModeEnum + +Named values of DetailedAccount.account_trading_mode + +## Enum + +* `Simple` (value: `0`) + +* `Unified` (value: `1`) + +[[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/DetailedAccountAccountTypeEnum.md b/docs/DetailedAccountAccountTypeEnum.md new file mode 100644 index 00000000..520217b3 --- /dev/null +++ b/docs/DetailedAccountAccountTypeEnum.md @@ -0,0 +1,21 @@ +# DetailedAccountAccountTypeEnum + +Named values of DetailedAccount.account_type + +## Enum + +* `Master` (value: `0`) + +* `Sub` (value: `1`) + +* `PublicPool` (value: `2`) + +* `InsuranceFund` (value: `3`) + +* `LighterStakingPool` (value: `4`) + +* `TreasurySub` (value: `5`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MarketConfig.md b/docs/MarketConfig.md index 66442d18..207b02aa 100644 --- a/docs/MarketConfig.md +++ b/docs/MarketConfig.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**market_margin_mode** | **int** | | +**market_margin_mode** | **int** | See MarketConfigMarketMarginModeEnum | **insurance_fund_account_index** | **int** | | **liquidation_mode** | **int** | | **force_reduce_only** | **bool** | | diff --git a/docs/MarketConfigMarketMarginModeEnum.md b/docs/MarketConfigMarketMarginModeEnum.md new file mode 100644 index 00000000..c7027222 --- /dev/null +++ b/docs/MarketConfigMarketMarginModeEnum.md @@ -0,0 +1,13 @@ +# MarketConfigMarketMarginModeEnum + +Named values of MarketConfig.market_margin_mode + +## Enum + +* `All` (value: `0`) + +* `IsolatedForNonPools` (value: `1`) + +[[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/PublicPoolInfo.md b/docs/PublicPoolInfo.md index 15e2b39f..41c373f5 100644 --- a/docs/PublicPoolInfo.md +++ b/docs/PublicPoolInfo.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**status** | **int** | | +**status** | **int** | See PublicPoolInfoStatusEnum | **operator_fee** | **str** | | **min_operator_share_rate** | **str** | | **total_shares** | **int** | | diff --git a/docs/PublicPoolInfoStatusEnum.md b/docs/PublicPoolInfoStatusEnum.md new file mode 100644 index 00000000..7e2ddbbf --- /dev/null +++ b/docs/PublicPoolInfoStatusEnum.md @@ -0,0 +1,13 @@ +# PublicPoolInfoStatusEnum + +Named values of PublicPoolInfo.status + +## Enum + +* `Active` (value: `0`) + +* `Frozen` (value: `1`) + +[[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/PublicPoolMetadata.md b/docs/PublicPoolMetadata.md index 8cf999d7..f07dfb02 100644 --- a/docs/PublicPoolMetadata.md +++ b/docs/PublicPoolMetadata.md @@ -8,11 +8,11 @@ Name | Type | Description | Notes **code** | **int** | | **message** | **str** | | [optional] **account_index** | **int** | | -**account_type** | **int** | | +**account_type** | **int** | See PublicPoolMetadataAccountTypeEnum | **name** | **str** | | **l1_address** | **str** | | **annual_percentage_yield** | **float** | | -**status** | **int** | | +**status** | **int** | See PublicPoolMetadataStatusEnum | **operator_fee** | **str** | | **total_asset_value** | **str** | | **total_shares** | **int** | | diff --git a/docs/PublicPoolMetadataAccountTypeEnum.md b/docs/PublicPoolMetadataAccountTypeEnum.md new file mode 100644 index 00000000..5d5c4876 --- /dev/null +++ b/docs/PublicPoolMetadataAccountTypeEnum.md @@ -0,0 +1,21 @@ +# PublicPoolMetadataAccountTypeEnum + +Named values of PublicPoolMetadata.account_type + +## Enum + +* `Master` (value: `0`) + +* `Sub` (value: `1`) + +* `PublicPool` (value: `2`) + +* `InsuranceFund` (value: `3`) + +* `LighterStakingPool` (value: `4`) + +* `TreasurySub` (value: `5`) + +[[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/PublicPoolMetadataStatusEnum.md b/docs/PublicPoolMetadataStatusEnum.md new file mode 100644 index 00000000..577963e5 --- /dev/null +++ b/docs/PublicPoolMetadataStatusEnum.md @@ -0,0 +1,13 @@ +# PublicPoolMetadataStatusEnum + +Named values of PublicPoolMetadata.status + +## Enum + +* `Active` (value: `0`) + +* `Frozen` (value: `1`) + +[[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/RFQEntry.md b/docs/RFQEntry.md index ebc6109a..5e77b885 100644 --- a/docs/RFQEntry.md +++ b/docs/RFQEntry.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **id** | **int** | | **account_index** | **int** | | **market_index** | **int** | | -**direction** | **int** | | +**direction** | **int** | See RFQEntryDirectionEnum | **base_amount** | **str** | | **quote_amount** | **str** | | **status** | **str** | | diff --git a/docs/RFQEntryDirectionEnum.md b/docs/RFQEntryDirectionEnum.md new file mode 100644 index 00000000..f02b627f --- /dev/null +++ b/docs/RFQEntryDirectionEnum.md @@ -0,0 +1,15 @@ +# RFQEntryDirectionEnum + +Named values of RFQEntry.direction + +## Enum + +* `Hidden` (value: `-1`) + +* `Sell` (value: `0`) + +* `Buy` (value: `1`) + +[[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/RespCreateRFQ.md b/docs/RespCreateRFQ.md index 968e368a..68c63121 100644 --- a/docs/RespCreateRFQ.md +++ b/docs/RespCreateRFQ.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **id** | **int** | | **account_index** | **int** | | **market_index** | **int** | | -**direction** | **int** | | +**direction** | **int** | See RespCreateRFQDirectionEnum | **base_amount** | **str** | | **quote_amount** | **str** | | **status** | **str** | | diff --git a/docs/RespCreateRFQDirectionEnum.md b/docs/RespCreateRFQDirectionEnum.md new file mode 100644 index 00000000..c114bb88 --- /dev/null +++ b/docs/RespCreateRFQDirectionEnum.md @@ -0,0 +1,15 @@ +# RespCreateRFQDirectionEnum + +Named values of RespCreateRFQ.direction + +## Enum + +* `Hidden` (value: `-1`) + +* `Sell` (value: `0`) + +* `Buy` (value: `1`) + +[[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/RespGetRFQ.md b/docs/RespGetRFQ.md index 20f004a2..ae8cdf98 100644 --- a/docs/RespGetRFQ.md +++ b/docs/RespGetRFQ.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **id** | **int** | | **account_index** | **int** | | **market_index** | **int** | | -**direction** | **int** | | +**direction** | **int** | See RespGetRFQDirectionEnum | **base_amount** | **str** | | **quote_amount** | **str** | | **status** | **str** | | diff --git a/docs/RespGetRFQDirectionEnum.md b/docs/RespGetRFQDirectionEnum.md new file mode 100644 index 00000000..7046ca43 --- /dev/null +++ b/docs/RespGetRFQDirectionEnum.md @@ -0,0 +1,15 @@ +# RespGetRFQDirectionEnum + +Named values of RespGetRFQ.direction + +## Enum + +* `Hidden` (value: `-1`) + +* `Sell` (value: `0`) + +* `Buy` (value: `1`) + +[[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/RespRespondToRFQ.md b/docs/RespRespondToRFQ.md index 706372ca..e6d3d9b9 100644 --- a/docs/RespRespondToRFQ.md +++ b/docs/RespRespondToRFQ.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **id** | **int** | | **account_index** | **int** | | **market_index** | **int** | | -**direction** | **int** | | +**direction** | **int** | See RespRespondToRFQDirectionEnum | **base_amount** | **str** | | **quote_amount** | **str** | | **status** | **str** | | diff --git a/docs/RespRespondToRFQDirectionEnum.md b/docs/RespRespondToRFQDirectionEnum.md new file mode 100644 index 00000000..6b523423 --- /dev/null +++ b/docs/RespRespondToRFQDirectionEnum.md @@ -0,0 +1,15 @@ +# RespRespondToRFQDirectionEnum + +Named values of RespRespondToRFQ.direction + +## Enum + +* `Hidden` (value: `-1`) + +* `Sell` (value: `0`) + +* `Buy` (value: `1`) + +[[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/RespUpdateRFQ.md b/docs/RespUpdateRFQ.md index 05f5fb63..4bd8ca0d 100644 --- a/docs/RespUpdateRFQ.md +++ b/docs/RespUpdateRFQ.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **id** | **int** | | **account_index** | **int** | | **market_index** | **int** | | -**direction** | **int** | | +**direction** | **int** | See RespUpdateRFQDirectionEnum | **base_amount** | **str** | | **quote_amount** | **str** | | **status** | **str** | | diff --git a/docs/RespUpdateRFQDirectionEnum.md b/docs/RespUpdateRFQDirectionEnum.md new file mode 100644 index 00000000..c0a29ad4 --- /dev/null +++ b/docs/RespUpdateRFQDirectionEnum.md @@ -0,0 +1,15 @@ +# RespUpdateRFQDirectionEnum + +Named values of RespUpdateRFQ.direction + +## Enum + +* `Hidden` (value: `-1`) + +* `Sell` (value: `0`) + +* `Buy` (value: `1`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lighter/__init__.py b/lighter/__init__.py index 941282f4..a5485550 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -45,6 +45,8 @@ # import models into sdk package from lighter.models.account import Account +from lighter.models.account_account_trading_mode_enum import AccountAccountTradingModeEnum +from lighter.models.account_account_type_enum import AccountAccountTypeEnum from lighter.models.account_api_keys import AccountApiKeys from lighter.models.account_asset import AccountAsset from lighter.models.account_limits import AccountLimits @@ -52,6 +54,7 @@ from lighter.models.account_metadatas import AccountMetadatas from lighter.models.account_pn_l import AccountPnL from lighter.models.account_position import AccountPosition +from lighter.models.account_position_margin_mode_enum import AccountPositionMarginModeEnum from lighter.models.announcement import Announcement from lighter.models.announcements import Announcements from lighter.models.api_key import ApiKey @@ -73,6 +76,8 @@ from lighter.models.deposit_history import DepositHistory from lighter.models.deposit_history_item import DepositHistoryItem from lighter.models.detailed_account import DetailedAccount +from lighter.models.detailed_account_account_trading_mode_enum import DetailedAccountAccountTradingModeEnum +from lighter.models.detailed_account_account_type_enum import DetailedAccountAccountTypeEnum from lighter.models.detailed_accounts import DetailedAccounts from lighter.models.enriched_tx import EnrichedTx from lighter.models.exchange_metric import ExchangeMetric @@ -98,6 +103,7 @@ 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_config_market_margin_mode_enum import MarketConfigMarketMarginModeEnum from lighter.models.market_price_chart import MarketPriceChart from lighter.models.market_price_charts import MarketPriceCharts from lighter.models.next_nonce import NextNonce @@ -115,9 +121,13 @@ from lighter.models.position_funding import PositionFunding from lighter.models.position_fundings import PositionFundings from lighter.models.public_pool_info import PublicPoolInfo +from lighter.models.public_pool_info_status_enum import PublicPoolInfoStatusEnum from lighter.models.public_pool_metadata import PublicPoolMetadata +from lighter.models.public_pool_metadata_account_type_enum import PublicPoolMetadataAccountTypeEnum +from lighter.models.public_pool_metadata_status_enum import PublicPoolMetadataStatusEnum from lighter.models.public_pool_share import PublicPoolShare from lighter.models.rfq_entry import RFQEntry +from lighter.models.rfq_entry_direction_enum import RFQEntryDirectionEnum from lighter.models.rfq_metadata import RFQMetadata from lighter.models.rfq_response_entry import RFQResponseEntry from lighter.models.referral import Referral @@ -129,6 +139,7 @@ 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 +from lighter.models.resp_create_rfq_direction_enum import RespCreateRFQDirectionEnum from lighter.models.resp_get_api_tokens import RespGetApiTokens from lighter.models.resp_get_exchange_metrics import RespGetExchangeMetrics from lighter.models.resp_get_execute_stats import RespGetExecuteStats @@ -138,10 +149,12 @@ from lighter.models.resp_get_leases import RespGetLeases from lighter.models.resp_get_maker_only_api_keys import RespGetMakerOnlyApiKeys from lighter.models.resp_get_rfq import RespGetRFQ +from lighter.models.resp_get_rfq_direction_enum import RespGetRFQDirectionEnum from lighter.models.resp_list_rfqs import RespListRFQs from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata from lighter.models.resp_respond_to_rfq import RespRespondToRFQ +from lighter.models.resp_respond_to_rfq_direction_enum import RespRespondToRFQDirectionEnum from lighter.models.resp_revoke_api_token import RespRevokeApiToken from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch @@ -149,6 +162,7 @@ from lighter.models.resp_synthetic_spot_info import RespSyntheticSpotInfo from lighter.models.resp_update_kickback import RespUpdateKickback from lighter.models.resp_update_rfq import RespUpdateRFQ +from lighter.models.resp_update_rfq_direction_enum import RespUpdateRFQDirectionEnum from lighter.models.resp_update_referral_code import RespUpdateReferralCode from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index 02195384..32413f2b 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -15,6 +15,8 @@ # import models into model package from lighter.models.account import Account +from lighter.models.account_account_trading_mode_enum import AccountAccountTradingModeEnum +from lighter.models.account_account_type_enum import AccountAccountTypeEnum from lighter.models.account_api_keys import AccountApiKeys from lighter.models.account_asset import AccountAsset from lighter.models.account_limits import AccountLimits @@ -22,6 +24,7 @@ from lighter.models.account_metadatas import AccountMetadatas from lighter.models.account_pn_l import AccountPnL from lighter.models.account_position import AccountPosition +from lighter.models.account_position_margin_mode_enum import AccountPositionMarginModeEnum from lighter.models.announcement import Announcement from lighter.models.announcements import Announcements from lighter.models.api_key import ApiKey @@ -43,6 +46,8 @@ from lighter.models.deposit_history import DepositHistory from lighter.models.deposit_history_item import DepositHistoryItem from lighter.models.detailed_account import DetailedAccount +from lighter.models.detailed_account_account_trading_mode_enum import DetailedAccountAccountTradingModeEnum +from lighter.models.detailed_account_account_type_enum import DetailedAccountAccountTypeEnum from lighter.models.detailed_accounts import DetailedAccounts from lighter.models.enriched_tx import EnrichedTx from lighter.models.exchange_metric import ExchangeMetric @@ -68,6 +73,7 @@ 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_config_market_margin_mode_enum import MarketConfigMarketMarginModeEnum from lighter.models.market_price_chart import MarketPriceChart from lighter.models.market_price_charts import MarketPriceCharts from lighter.models.next_nonce import NextNonce @@ -85,9 +91,13 @@ from lighter.models.position_funding import PositionFunding from lighter.models.position_fundings import PositionFundings from lighter.models.public_pool_info import PublicPoolInfo +from lighter.models.public_pool_info_status_enum import PublicPoolInfoStatusEnum from lighter.models.public_pool_metadata import PublicPoolMetadata +from lighter.models.public_pool_metadata_account_type_enum import PublicPoolMetadataAccountTypeEnum +from lighter.models.public_pool_metadata_status_enum import PublicPoolMetadataStatusEnum from lighter.models.public_pool_share import PublicPoolShare from lighter.models.rfq_entry import RFQEntry +from lighter.models.rfq_entry_direction_enum import RFQEntryDirectionEnum from lighter.models.rfq_metadata import RFQMetadata from lighter.models.rfq_response_entry import RFQResponseEntry from lighter.models.referral import Referral @@ -99,6 +109,7 @@ 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 +from lighter.models.resp_create_rfq_direction_enum import RespCreateRFQDirectionEnum from lighter.models.resp_get_api_tokens import RespGetApiTokens from lighter.models.resp_get_exchange_metrics import RespGetExchangeMetrics from lighter.models.resp_get_execute_stats import RespGetExecuteStats @@ -108,10 +119,12 @@ from lighter.models.resp_get_leases import RespGetLeases from lighter.models.resp_get_maker_only_api_keys import RespGetMakerOnlyApiKeys from lighter.models.resp_get_rfq import RespGetRFQ +from lighter.models.resp_get_rfq_direction_enum import RespGetRFQDirectionEnum from lighter.models.resp_list_rfqs import RespListRFQs from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata from lighter.models.resp_respond_to_rfq import RespRespondToRFQ +from lighter.models.resp_respond_to_rfq_direction_enum import RespRespondToRFQDirectionEnum from lighter.models.resp_revoke_api_token import RespRevokeApiToken from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch @@ -119,6 +132,7 @@ from lighter.models.resp_synthetic_spot_info import RespSyntheticSpotInfo from lighter.models.resp_update_kickback import RespUpdateKickback from lighter.models.resp_update_rfq import RespUpdateRFQ +from lighter.models.resp_update_rfq_direction_enum import RespUpdateRFQDirectionEnum from lighter.models.resp_update_referral_code import RespUpdateReferralCode from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode diff --git a/lighter/models/account.py b/lighter/models/account.py index 87c11b0c..4d834c7e 100644 --- a/lighter/models/account.py +++ b/lighter/models/account.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -28,8 +28,8 @@ class Account(BaseModel): """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - account_type: StrictInt - account_trading_mode: StrictInt = Field(description="Classic=0 and Unified=1") + account_type: StrictInt = Field(description="See AccountAccountTypeEnum") + account_trading_mode: StrictInt = Field(description="Classic=0 and Unified=1. See AccountAccountTradingModeEnum") index: StrictInt l1_address: StrictStr cancel_all_time: StrictInt @@ -43,6 +43,20 @@ class Account(BaseModel): 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", "transaction_time"] + @field_validator('account_type') + def account_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1, 2, 3, 4, 5]): + raise ValueError("must be one of enum values (0, 1, 2, 3, 4, 5)") + return value + + @field_validator('account_trading_mode') + def account_trading_mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1]): + raise ValueError("must be one of enum values (0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/account_account_trading_mode_enum.py b/lighter/models/account_account_trading_mode_enum.py new file mode 100644 index 00000000..934f37b2 --- /dev/null +++ b/lighter/models/account_account_trading_mode_enum.py @@ -0,0 +1,37 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class AccountAccountTradingModeEnum(int, Enum): + """ + Named values of Account.account_trading_mode + """ + + """ + allowed enum values + """ + Simple = 0 + Unified = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountAccountTradingModeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/account_account_type_enum.py b/lighter/models/account_account_type_enum.py new file mode 100644 index 00000000..e50711b5 --- /dev/null +++ b/lighter/models/account_account_type_enum.py @@ -0,0 +1,41 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class AccountAccountTypeEnum(int, Enum): + """ + Named values of Account.account_type + """ + + """ + allowed enum values + """ + Master = 0 + Sub = 1 + PublicPool = 2 + InsuranceFund = 3 + LighterStakingPool = 4 + TreasurySub = 5 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountAccountTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/account_position.py b/lighter/models/account_position.py index 93cc661c..b61ab8d5 100644 --- a/lighter/models/account_position.py +++ b/lighter/models/account_position.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -40,13 +40,20 @@ class AccountPosition(BaseModel): realized_pnl: StrictStr liquidation_price: StrictStr total_funding_paid_out: Optional[StrictStr] = None - margin_mode: StrictInt + margin_mode: StrictInt = Field(description="See AccountPositionMarginModeEnum") 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", "margin_set_flag"] + @field_validator('margin_mode') + def margin_mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1]): + raise ValueError("must be one of enum values (0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/account_position_margin_mode_enum.py b/lighter/models/account_position_margin_mode_enum.py new file mode 100644 index 00000000..0225fd4a --- /dev/null +++ b/lighter/models/account_position_margin_mode_enum.py @@ -0,0 +1,37 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class AccountPositionMarginModeEnum(int, Enum): + """ + Named values of AccountPosition.margin_mode + """ + + """ + allowed enum values + """ + Cross = 0 + Isolated = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AccountPositionMarginModeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/detailed_account.py b/lighter/models/detailed_account.py index 866349d4..ddac9f4a 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from lighter.models.account_asset import AccountAsset from lighter.models.account_position import AccountPosition @@ -35,8 +35,8 @@ class DetailedAccount(BaseModel): """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - account_type: StrictInt - account_trading_mode: Optional[StrictInt] = Field(default=None, description="Classic=0 and Unified=1") + account_type: StrictInt = Field(description="See DetailedAccountAccountTypeEnum") + account_trading_mode: Optional[StrictInt] = Field(default=None, description="Classic=0 and Unified=1. See DetailedAccountAccountTradingModeEnum") index: StrictInt l1_address: StrictStr cancel_all_time: StrictInt @@ -69,6 +69,23 @@ class DetailedAccount(BaseModel): 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", "metadata"] + @field_validator('account_type') + def account_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1, 2, 3, 4, 5]): + raise ValueError("must be one of enum values (0, 1, 2, 3, 4, 5)") + return value + + @field_validator('account_trading_mode') + def account_trading_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set([0, 1]): + raise ValueError("must be one of enum values (0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/detailed_account_account_trading_mode_enum.py b/lighter/models/detailed_account_account_trading_mode_enum.py new file mode 100644 index 00000000..aa928b25 --- /dev/null +++ b/lighter/models/detailed_account_account_trading_mode_enum.py @@ -0,0 +1,37 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class DetailedAccountAccountTradingModeEnum(int, Enum): + """ + Named values of DetailedAccount.account_trading_mode + """ + + """ + allowed enum values + """ + Simple = 0 + Unified = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DetailedAccountAccountTradingModeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/detailed_account_account_type_enum.py b/lighter/models/detailed_account_account_type_enum.py new file mode 100644 index 00000000..0f5a28d4 --- /dev/null +++ b/lighter/models/detailed_account_account_type_enum.py @@ -0,0 +1,41 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class DetailedAccountAccountTypeEnum(int, Enum): + """ + Named values of DetailedAccount.account_type + """ + + """ + allowed enum values + """ + Master = 0 + Sub = 1 + PublicPool = 2 + InsuranceFund = 3 + LighterStakingPool = 4 + TreasurySub = 5 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DetailedAccountAccountTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/market_config.py b/lighter/models/market_config.py index 767d4057..8217d24d 100644 --- a/lighter/models/market_config.py +++ b/lighter/models/market_config.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -26,7 +26,7 @@ class MarketConfig(BaseModel): """ MarketConfig """ # noqa: E501 - market_margin_mode: StrictInt + market_margin_mode: StrictInt = Field(description="See MarketConfigMarketMarginModeEnum") insurance_fund_account_index: StrictInt liquidation_mode: StrictInt force_reduce_only: StrictBool @@ -37,6 +37,13 @@ class MarketConfig(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["market_margin_mode", "insurance_fund_account_index", "liquidation_mode", "force_reduce_only", "funding_fee_discounts_enabled", "trading_hours", "hidden", "rfq_enabled"] + @field_validator('market_margin_mode') + def market_margin_mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1]): + raise ValueError("must be one of enum values (0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/market_config_market_margin_mode_enum.py b/lighter/models/market_config_market_margin_mode_enum.py new file mode 100644 index 00000000..bae817ff --- /dev/null +++ b/lighter/models/market_config_market_margin_mode_enum.py @@ -0,0 +1,37 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class MarketConfigMarketMarginModeEnum(int, Enum): + """ + Named values of MarketConfig.market_margin_mode + """ + + """ + allowed enum values + """ + All = 0 + IsolatedForNonPools = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of MarketConfigMarketMarginModeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/public_pool_info.py b/lighter/models/public_pool_info.py index d7587cd5..3cac458e 100644 --- a/lighter/models/public_pool_info.py +++ b/lighter/models/public_pool_info.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Union from lighter.models.daily_return import DailyReturn from lighter.models.share_price import SharePrice @@ -29,7 +29,7 @@ class PublicPoolInfo(BaseModel): """ PublicPoolInfo """ # noqa: E501 - status: StrictInt + status: StrictInt = Field(description="See PublicPoolInfoStatusEnum") operator_fee: StrictStr min_operator_share_rate: StrictStr total_shares: StrictInt @@ -42,6 +42,13 @@ class PublicPoolInfo(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["status", "operator_fee", "min_operator_share_rate", "total_shares", "operator_shares", "annual_percentage_yield", "daily_returns", "share_prices", "sharpe_ratio", "strategies"] + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1]): + raise ValueError("must be one of enum values (0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/public_pool_info_status_enum.py b/lighter/models/public_pool_info_status_enum.py new file mode 100644 index 00000000..1cbbc672 --- /dev/null +++ b/lighter/models/public_pool_info_status_enum.py @@ -0,0 +1,37 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class PublicPoolInfoStatusEnum(int, Enum): + """ + Named values of PublicPoolInfo.status + """ + + """ + allowed enum values + """ + Active = 0 + Frozen = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of PublicPoolInfoStatusEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/public_pool_metadata.py b/lighter/models/public_pool_metadata.py index 68c8b745..ba0daed3 100644 --- a/lighter/models/public_pool_metadata.py +++ b/lighter/models/public_pool_metadata.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from lighter.models.account_asset import AccountAsset from lighter.models.public_pool_share import PublicPoolShare @@ -31,11 +31,11 @@ class PublicPoolMetadata(BaseModel): code: StrictInt message: Optional[StrictStr] = None account_index: StrictInt - account_type: StrictInt + account_type: StrictInt = Field(description="See PublicPoolMetadataAccountTypeEnum") name: StrictStr l1_address: StrictStr annual_percentage_yield: Union[StrictFloat, StrictInt] - status: StrictInt + status: StrictInt = Field(description="See PublicPoolMetadataStatusEnum") operator_fee: StrictStr total_asset_value: StrictStr total_shares: StrictInt @@ -49,6 +49,20 @@ class PublicPoolMetadata(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "account_index", "account_type", "name", "l1_address", "annual_percentage_yield", "status", "operator_fee", "total_asset_value", "total_shares", "account_share", "assets", "created_at", "master_account_index", "sharpe_ratio", "total_perps_value", "total_spot_value"] + @field_validator('account_type') + def account_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1, 2, 3, 4, 5]): + raise ValueError("must be one of enum values (0, 1, 2, 3, 4, 5)") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set([0, 1]): + raise ValueError("must be one of enum values (0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/public_pool_metadata_account_type_enum.py b/lighter/models/public_pool_metadata_account_type_enum.py new file mode 100644 index 00000000..af3b4d50 --- /dev/null +++ b/lighter/models/public_pool_metadata_account_type_enum.py @@ -0,0 +1,41 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class PublicPoolMetadataAccountTypeEnum(int, Enum): + """ + Named values of PublicPoolMetadata.account_type + """ + + """ + allowed enum values + """ + Master = 0 + Sub = 1 + PublicPool = 2 + InsuranceFund = 3 + LighterStakingPool = 4 + TreasurySub = 5 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of PublicPoolMetadataAccountTypeEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/public_pool_metadata_status_enum.py b/lighter/models/public_pool_metadata_status_enum.py new file mode 100644 index 00000000..b9cd5cc6 --- /dev/null +++ b/lighter/models/public_pool_metadata_status_enum.py @@ -0,0 +1,37 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class PublicPoolMetadataStatusEnum(int, Enum): + """ + Named values of PublicPoolMetadata.status + """ + + """ + allowed enum values + """ + Active = 0 + Frozen = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of PublicPoolMetadataStatusEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/resp_create_rfq.py b/lighter/models/resp_create_rfq.py index 89dd8dee..f6321515 100644 --- a/lighter/models/resp_create_rfq.py +++ b/lighter/models/resp_create_rfq.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from lighter.models.rfq_metadata import RFQMetadata from lighter.models.rfq_response_entry import RFQResponseEntry @@ -33,7 +33,7 @@ class RespCreateRFQ(BaseModel): id: StrictInt account_index: StrictInt market_index: StrictInt - direction: StrictInt + direction: StrictInt = Field(description="See RespCreateRFQDirectionEnum") base_amount: StrictStr quote_amount: StrictStr status: StrictStr @@ -44,6 +44,13 @@ class RespCreateRFQ(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + @field_validator('direction') + def direction_validate_enum(cls, value): + """Validates the enum""" + if value not in set([-1, 0, 1]): + raise ValueError("must be one of enum values (-1, 0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/resp_create_rfq_direction_enum.py b/lighter/models/resp_create_rfq_direction_enum.py new file mode 100644 index 00000000..c1303f14 --- /dev/null +++ b/lighter/models/resp_create_rfq_direction_enum.py @@ -0,0 +1,38 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class RespCreateRFQDirectionEnum(int, Enum): + """ + Named values of RespCreateRFQ.direction + """ + + """ + allowed enum values + """ + Hidden = -1 + Sell = 0 + Buy = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RespCreateRFQDirectionEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/resp_get_rfq.py b/lighter/models/resp_get_rfq.py index 47fde134..e61ee579 100644 --- a/lighter/models/resp_get_rfq.py +++ b/lighter/models/resp_get_rfq.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from lighter.models.rfq_metadata import RFQMetadata from lighter.models.rfq_response_entry import RFQResponseEntry @@ -33,7 +33,7 @@ class RespGetRFQ(BaseModel): id: StrictInt account_index: StrictInt market_index: StrictInt - direction: StrictInt + direction: StrictInt = Field(description="See RespGetRFQDirectionEnum") base_amount: StrictStr quote_amount: StrictStr status: StrictStr @@ -44,6 +44,13 @@ class RespGetRFQ(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + @field_validator('direction') + def direction_validate_enum(cls, value): + """Validates the enum""" + if value not in set([-1, 0, 1]): + raise ValueError("must be one of enum values (-1, 0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/resp_get_rfq_direction_enum.py b/lighter/models/resp_get_rfq_direction_enum.py new file mode 100644 index 00000000..7bdd0f25 --- /dev/null +++ b/lighter/models/resp_get_rfq_direction_enum.py @@ -0,0 +1,38 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class RespGetRFQDirectionEnum(int, Enum): + """ + Named values of RespGetRFQ.direction + """ + + """ + allowed enum values + """ + Hidden = -1 + Sell = 0 + Buy = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RespGetRFQDirectionEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/resp_respond_to_rfq.py b/lighter/models/resp_respond_to_rfq.py index d05b9534..c8fc1ecc 100644 --- a/lighter/models/resp_respond_to_rfq.py +++ b/lighter/models/resp_respond_to_rfq.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from lighter.models.rfq_metadata import RFQMetadata from lighter.models.rfq_response_entry import RFQResponseEntry @@ -33,7 +33,7 @@ class RespRespondToRFQ(BaseModel): id: StrictInt account_index: StrictInt market_index: StrictInt - direction: StrictInt + direction: StrictInt = Field(description="See RespRespondToRFQDirectionEnum") base_amount: StrictStr quote_amount: StrictStr status: StrictStr @@ -44,6 +44,13 @@ class RespRespondToRFQ(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + @field_validator('direction') + def direction_validate_enum(cls, value): + """Validates the enum""" + if value not in set([-1, 0, 1]): + raise ValueError("must be one of enum values (-1, 0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/resp_respond_to_rfq_direction_enum.py b/lighter/models/resp_respond_to_rfq_direction_enum.py new file mode 100644 index 00000000..af05e309 --- /dev/null +++ b/lighter/models/resp_respond_to_rfq_direction_enum.py @@ -0,0 +1,38 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class RespRespondToRFQDirectionEnum(int, Enum): + """ + Named values of RespRespondToRFQ.direction + """ + + """ + allowed enum values + """ + Hidden = -1 + Sell = 0 + Buy = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RespRespondToRFQDirectionEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/resp_update_rfq.py b/lighter/models/resp_update_rfq.py index ed77bdd1..4637c29c 100644 --- a/lighter/models/resp_update_rfq.py +++ b/lighter/models/resp_update_rfq.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from lighter.models.rfq_metadata import RFQMetadata from lighter.models.rfq_response_entry import RFQResponseEntry @@ -33,7 +33,7 @@ class RespUpdateRFQ(BaseModel): id: StrictInt account_index: StrictInt market_index: StrictInt - direction: StrictInt + direction: StrictInt = Field(description="See RespUpdateRFQDirectionEnum") base_amount: StrictStr quote_amount: StrictStr status: StrictStr @@ -44,6 +44,13 @@ class RespUpdateRFQ(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + @field_validator('direction') + def direction_validate_enum(cls, value): + """Validates the enum""" + if value not in set([-1, 0, 1]): + raise ValueError("must be one of enum values (-1, 0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/resp_update_rfq_direction_enum.py b/lighter/models/resp_update_rfq_direction_enum.py new file mode 100644 index 00000000..4b793169 --- /dev/null +++ b/lighter/models/resp_update_rfq_direction_enum.py @@ -0,0 +1,38 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class RespUpdateRFQDirectionEnum(int, Enum): + """ + Named values of RespUpdateRFQ.direction + """ + + """ + allowed enum values + """ + Hidden = -1 + Sell = 0 + Buy = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RespUpdateRFQDirectionEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/lighter/models/rfq_entry.py b/lighter/models/rfq_entry.py index 8465419b..a9afea11 100644 --- a/lighter/models/rfq_entry.py +++ b/lighter/models/rfq_entry.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List from lighter.models.rfq_metadata import RFQMetadata from lighter.models.rfq_response_entry import RFQResponseEntry @@ -31,7 +31,7 @@ class RFQEntry(BaseModel): id: StrictInt account_index: StrictInt market_index: StrictInt - direction: StrictInt + direction: StrictInt = Field(description="See RFQEntryDirectionEnum") base_amount: StrictStr quote_amount: StrictStr status: StrictStr @@ -42,6 +42,13 @@ class RFQEntry(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + @field_validator('direction') + def direction_validate_enum(cls, value): + """Validates the enum""" + if value not in set([-1, 0, 1]): + raise ValueError("must be one of enum values (-1, 0, 1)") + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, diff --git a/lighter/models/rfq_entry_direction_enum.py b/lighter/models/rfq_entry_direction_enum.py new file mode 100644 index 00000000..0b9fa57d --- /dev/null +++ b/lighter/models/rfq_entry_direction_enum.py @@ -0,0 +1,38 @@ +# 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 json +from enum import Enum +from typing_extensions import Self + + +class RFQEntryDirectionEnum(int, Enum): + """ + Named values of RFQEntry.direction + """ + + """ + allowed enum values + """ + Hidden = -1 + Sell = 0 + Buy = 1 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RFQEntryDirectionEnum from a JSON string""" + return cls(json.loads(json_str)) + +