diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 9c5af95..f434d7a 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,16 +1,13 @@ +README.md docs/Account.md docs/AccountApi.md docs/AccountApiKeys.md docs/AccountAsset.md docs/AccountLimits.md -docs/AccountMarginStats.md -docs/AccountMarketStats.md docs/AccountMetadata.md docs/AccountMetadatas.md docs/AccountPnL.md docs/AccountPosition.md -docs/AccountStats.md -docs/AccountTradeStats.md docs/Announcement.md docs/AnnouncementApi.md docs/Announcements.md @@ -19,21 +16,24 @@ docs/ApiToken.md docs/ApprovedIntegrator.md docs/Asset.md docs/AssetDetails.md -docs/Auth.md -docs/Bridge.md +docs/Block.md +docs/BlockApi.md +docs/Blocks.md docs/BridgeApi.md docs/BridgeSupportedNetwork.md +docs/BridgeSupportedNetworks.md docs/Candle.md docs/Candles.md docs/CandlestickApi.md docs/ContractAddress.md -docs/Cursor.md +docs/CreateIntentAddressResp.md +docs/CurrentHeight.md docs/DailyReturn.md +docs/Deposit.md docs/DepositHistory.md docs/DepositHistoryItem.md docs/DetailedAccount.md docs/DetailedAccounts.md -docs/DetailedCandlestick.md docs/EnrichedTx.md docs/ExchangeMetric.md docs/ExchangeStats.md @@ -47,6 +47,7 @@ docs/Fundings.md docs/InfoApi.md docs/L1Metadata.md docs/L1ProviderInfo.md +docs/Layer1BasicInfo.md docs/LeaseEntry.md docs/LeaseOptionEntry.md docs/LiqTrade.md @@ -59,88 +60,43 @@ docs/NotificationApi.md docs/Order.md docs/OrderApi.md docs/OrderBook.md -docs/OrderBookDepth.md -docs/OrderBookDepthWithBeginNonce.md docs/OrderBookDetails.md docs/OrderBookOrders.md docs/OrderBookStats.md docs/OrderBooks.md docs/Orders.md +docs/PartnerStats.md docs/PendingUnlock.md -docs/PerpsMarketStats.md docs/PerpsOrderBookDetail.md docs/PnLEntry.md docs/PositionFunding.md docs/PositionFundings.md -docs/PriceLevel.md docs/PublicPoolInfo.md docs/PublicPoolMetadata.md docs/PublicPoolShare.md -docs/PushNotifDeliveryResult.md -docs/PushnotifApi.md docs/Referral.md docs/ReferralApi.md -docs/ReqDoFaucet.md -docs/ReqExportData.md -docs/ReqGetAccount.md -docs/ReqGetAccountActiveOrders.md -docs/ReqGetAccountApiKeys.md -docs/ReqGetAccountByL1Address.md -docs/ReqGetAccountInactiveOrders.md -docs/ReqGetAccountLimits.md -docs/ReqGetAccountMetadata.md -docs/ReqGetAccountPnL.md -docs/ReqGetAccountTxs.md -docs/ReqGetApiTokens.md -docs/ReqGetAssetDetails.md -docs/ReqGetBlock.md -docs/ReqGetBlockTxs.md -docs/ReqGetBridgesByL1Addr.md -docs/ReqGetByAccount.md -docs/ReqGetCandles.md -docs/ReqGetDepositHistory.md -docs/ReqGetExchangeMetrics.md -docs/ReqGetExecuteStats.md -docs/ReqGetFastWithdrawInfo.md -docs/ReqGetFundings.md -docs/ReqGetL1Metadata.md -docs/ReqGetL1Tx.md -docs/ReqGetLatestDeposit.md -docs/ReqGetLeases.md -docs/ReqGetLiquidationInfos.md -docs/ReqGetNextNonce.md -docs/ReqGetOrderBookDetails.md -docs/ReqGetOrderBookOrders.md -docs/ReqGetOrderBooks.md -docs/ReqGetPositionFunding.md -docs/ReqGetPublicPoolsMetadata.md -docs/ReqGetPushNotifSettings.md -docs/ReqGetRangeWithCursor.md -docs/ReqGetRangeWithIndex.md -docs/ReqGetRangeWithIndexSortable.md -docs/ReqGetRecentTrades.md -docs/ReqGetTrades.md -docs/ReqGetTransferFeeInfo.md -docs/ReqGetTransferHistory.md -docs/ReqGetTx.md -docs/ReqGetUserReferrals.md -docs/ReqGetWithdrawHistory.md +docs/ReferralCode.md +docs/ReferralPointEntry.md +docs/ReferralPoints.md +docs/ReqSetAccountMetadata.md docs/RespChangeAccountTier.md docs/RespGetApiTokens.md -docs/RespGetBridgesByL1Addr.md docs/RespGetExchangeMetrics.md docs/RespGetExecuteStats.md docs/RespGetFastBridgeInfo.md docs/RespGetFastwithdrawalInfo.md -docs/RespGetIsNextBridgeFast.md docs/RespGetLeaseOptions.md docs/RespGetLeases.md -docs/RespGetPushNotifSettings.md +docs/RespGetMakerOnlyApiKeys.md docs/RespPostApiToken.md docs/RespPublicPoolsMetadata.md docs/RespRevokeApiToken.md docs/RespSendTx.md docs/RespSendTxBatch.md +docs/RespSetMakerOnlyApiKeys.md +docs/RespUpdateKickback.md +docs/RespUpdateReferralCode.md docs/RespWithdrawalDelay.md docs/ResultCode.md docs/RiskInfo.md @@ -149,14 +105,14 @@ docs/RootApi.md docs/SharePrice.md docs/SimpleOrder.md docs/SlippageResult.md -docs/SpotAvgEntryPrice.md -docs/SpotMarketStats.md docs/SpotOrderBookDetail.md docs/Status.md docs/Strategy.md docs/SubAccounts.md docs/SystemConfig.md -docs/Ticker.md +docs/Token.md +docs/TokenList.md +docs/TokenlistApi.md docs/Trade.md docs/TradeStats.md docs/Trades.md @@ -164,27 +120,28 @@ docs/TransactionApi.md docs/TransferFeeInfo.md docs/TransferHistory.md docs/TransferHistoryItem.md +docs/Tx.md docs/TxHash.md -docs/TxHashes.md +docs/Txs.md docs/UserReferrals.md docs/ValidatorInfo.md docs/WithdrawHistory.md docs/WithdrawHistoryItem.md docs/ZkLighterInfo.md -git_push.sh lighter/__init__.py lighter/api/__init__.py lighter/api/account_api.py lighter/api/announcement_api.py +lighter/api/block_api.py lighter/api/bridge_api.py lighter/api/candlestick_api.py lighter/api/funding_api.py lighter/api/info_api.py lighter/api/notification_api.py lighter/api/order_api.py -lighter/api/pushnotif_api.py lighter/api/referral_api.py lighter/api/root_api.py +lighter/api/tokenlist_api.py lighter/api/transaction_api.py lighter/api_client.py lighter/api_response.py @@ -195,14 +152,10 @@ lighter/models/account.py lighter/models/account_api_keys.py lighter/models/account_asset.py lighter/models/account_limits.py -lighter/models/account_margin_stats.py -lighter/models/account_market_stats.py lighter/models/account_metadata.py lighter/models/account_metadatas.py lighter/models/account_pn_l.py lighter/models/account_position.py -lighter/models/account_stats.py -lighter/models/account_trade_stats.py lighter/models/announcement.py lighter/models/announcements.py lighter/models/api_key.py @@ -210,19 +163,21 @@ lighter/models/api_token.py lighter/models/approved_integrator.py lighter/models/asset.py lighter/models/asset_details.py -lighter/models/auth.py -lighter/models/bridge.py +lighter/models/block.py +lighter/models/blocks.py lighter/models/bridge_supported_network.py +lighter/models/bridge_supported_networks.py lighter/models/candle.py lighter/models/candles.py lighter/models/contract_address.py -lighter/models/cursor.py +lighter/models/create_intent_address_resp.py +lighter/models/current_height.py lighter/models/daily_return.py +lighter/models/deposit.py lighter/models/deposit_history.py lighter/models/deposit_history_item.py lighter/models/detailed_account.py lighter/models/detailed_accounts.py -lighter/models/detailed_candlestick.py lighter/models/enriched_tx.py lighter/models/exchange_metric.py lighter/models/exchange_stats.py @@ -234,6 +189,7 @@ lighter/models/funding_rates.py lighter/models/fundings.py lighter/models/l1_metadata.py lighter/models/l1_provider_info.py +lighter/models/layer1_basic_info.py lighter/models/lease_entry.py lighter/models/lease_option_entry.py lighter/models/liq_trade.py @@ -244,86 +200,42 @@ lighter/models/market_config.py lighter/models/next_nonce.py lighter/models/order.py lighter/models/order_book.py -lighter/models/order_book_depth.py -lighter/models/order_book_depth_with_begin_nonce.py lighter/models/order_book_details.py lighter/models/order_book_orders.py lighter/models/order_book_stats.py lighter/models/order_books.py lighter/models/orders.py +lighter/models/partner_stats.py lighter/models/pending_unlock.py -lighter/models/perps_market_stats.py lighter/models/perps_order_book_detail.py lighter/models/pn_l_entry.py lighter/models/position_funding.py lighter/models/position_fundings.py -lighter/models/price_level.py lighter/models/public_pool_info.py lighter/models/public_pool_metadata.py lighter/models/public_pool_share.py -lighter/models/push_notif_delivery_result.py lighter/models/referral.py -lighter/models/req_do_faucet.py -lighter/models/req_export_data.py -lighter/models/req_get_account.py -lighter/models/req_get_account_active_orders.py -lighter/models/req_get_account_api_keys.py -lighter/models/req_get_account_by_l1_address.py -lighter/models/req_get_account_inactive_orders.py -lighter/models/req_get_account_limits.py -lighter/models/req_get_account_metadata.py -lighter/models/req_get_account_pn_l.py -lighter/models/req_get_account_txs.py -lighter/models/req_get_api_tokens.py -lighter/models/req_get_asset_details.py -lighter/models/req_get_block.py -lighter/models/req_get_block_txs.py -lighter/models/req_get_bridges_by_l1_addr.py -lighter/models/req_get_by_account.py -lighter/models/req_get_candles.py -lighter/models/req_get_deposit_history.py -lighter/models/req_get_exchange_metrics.py -lighter/models/req_get_execute_stats.py -lighter/models/req_get_fast_withdraw_info.py -lighter/models/req_get_fundings.py -lighter/models/req_get_l1_metadata.py -lighter/models/req_get_l1_tx.py -lighter/models/req_get_latest_deposit.py -lighter/models/req_get_leases.py -lighter/models/req_get_liquidation_infos.py -lighter/models/req_get_next_nonce.py -lighter/models/req_get_order_book_details.py -lighter/models/req_get_order_book_orders.py -lighter/models/req_get_order_books.py -lighter/models/req_get_position_funding.py -lighter/models/req_get_public_pools_metadata.py -lighter/models/req_get_push_notif_settings.py -lighter/models/req_get_range_with_cursor.py -lighter/models/req_get_range_with_index.py -lighter/models/req_get_range_with_index_sortable.py -lighter/models/req_get_recent_trades.py -lighter/models/req_get_trades.py -lighter/models/req_get_transfer_fee_info.py -lighter/models/req_get_transfer_history.py -lighter/models/req_get_tx.py -lighter/models/req_get_user_referrals.py -lighter/models/req_get_withdraw_history.py +lighter/models/referral_code.py +lighter/models/referral_point_entry.py +lighter/models/referral_points.py +lighter/models/req_set_account_metadata.py lighter/models/resp_change_account_tier.py lighter/models/resp_get_api_tokens.py -lighter/models/resp_get_bridges_by_l1_addr.py lighter/models/resp_get_exchange_metrics.py lighter/models/resp_get_execute_stats.py lighter/models/resp_get_fast_bridge_info.py lighter/models/resp_get_fastwithdrawal_info.py -lighter/models/resp_get_is_next_bridge_fast.py lighter/models/resp_get_lease_options.py lighter/models/resp_get_leases.py -lighter/models/resp_get_push_notif_settings.py +lighter/models/resp_get_maker_only_api_keys.py lighter/models/resp_post_api_token.py lighter/models/resp_public_pools_metadata.py lighter/models/resp_revoke_api_token.py lighter/models/resp_send_tx.py lighter/models/resp_send_tx_batch.py +lighter/models/resp_set_maker_only_api_keys.py +lighter/models/resp_update_kickback.py +lighter/models/resp_update_referral_code.py lighter/models/resp_withdrawal_delay.py lighter/models/result_code.py lighter/models/risk_info.py @@ -331,56 +243,26 @@ lighter/models/risk_parameters.py lighter/models/share_price.py lighter/models/simple_order.py lighter/models/slippage_result.py -lighter/models/spot_avg_entry_price.py -lighter/models/spot_market_stats.py lighter/models/spot_order_book_detail.py lighter/models/status.py lighter/models/strategy.py lighter/models/sub_accounts.py lighter/models/system_config.py -lighter/models/ticker.py +lighter/models/token.py +lighter/models/token_list.py lighter/models/trade.py lighter/models/trade_stats.py lighter/models/trades.py lighter/models/transfer_fee_info.py lighter/models/transfer_history.py lighter/models/transfer_history_item.py +lighter/models/tx.py lighter/models/tx_hash.py -lighter/models/tx_hashes.py +lighter/models/txs.py lighter/models/user_referrals.py lighter/models/validator_info.py lighter/models/withdraw_history.py lighter/models/withdraw_history_item.py lighter/models/zk_lighter_info.py lighter/py.typed -lighter/rest.py -setup.cfg -test-requirements.txt -test/__init__.py -test/test_approved_integrator.py -test/test_exchange_metric.py -test/test_execute_stat.py -test/test_lease_entry.py -test/test_lease_option_entry.py -test/test_pending_unlock.py -test/test_push_notif_delivery_result.py -test/test_pushnotif_api.py -test/test_referral.py -test/test_referral_api.py -test/test_req_get_exchange_metrics.py -test/test_req_get_execute_stats.py -test/test_req_get_leases.py -test/test_req_get_push_notif_settings.py -test/test_req_get_user_referrals.py -test/test_resp_get_exchange_metrics.py -test/test_resp_get_execute_stats.py -test/test_resp_get_lease_options.py -test/test_resp_get_leases.py -test/test_resp_get_push_notif_settings.py -test/test_slippage_result.py -test/test_spot_avg_entry_price.py -test/test_strategy.py -test/test_system_config.py -test/test_trade_stats.py -test/test_user_referrals.py -tox.ini +setup.py diff --git a/README.md b/README.md index b0d9eee..6f6594d 100644 --- a/README.md +++ b/README.md @@ -1,203 +1,254 @@ -# Lighter Python +# lighter -Python SDK for Lighter +Python SDK for [Lighter](https://lighter.xyz) (zkLighter perpetuals exchange). -## Requirements. +## Requirements Python 3.8+ -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: +## Installation ```sh -pip install git+https://github.com/elliottech/lighter-python.git +pip install git+https://github.com/elliottech/zklighter-perps-python.git ``` +Then: -Then import the package: ```python import lighter ``` -### Tests - -Execute `pytest` to run the tests. - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: +## Getting started ```python - -import lighter import asyncio +import lighter + async def main(): client = lighter.ApiClient() - try: - account_api = lighter.AccountApi(client) - account = await account_api.account(by="index", value="1") - print(account) - finally: - await client.close() # Make sure connection is cleanly closed + account_api = lighter.AccountApi(client) + account = await account_api.account(by="index", value="1") + print(account) + await client.close() + if __name__ == "__main__": asyncio.run(main()) - -``` - -# Examples -## [Read API Functions](examples/get_info.py) -```sh -python examples/get_info.py -``` - -## [Websocket Sync Order Books & Accounts](examples/ws.py) -```sh -python examples/ws.py ``` -## [Create & Cancel Orders](examples/create_cancel_order.py) -```sh -python examples/create_cancel_order.py -``` - -## Paper Trading - -#### [Snapshot Mode](examples/paper_trading_snapshot.py) -```sh -python examples/paper_trading_snapshot.py -``` +## Examples -#### [Live Mode](examples/paper_trading_live.py) -```sh -python examples/paper_trading_live.py -``` +The [`examples/`](examples) directory contains end-to-end scripts for the +common flows. A few starting points: -#### [Health Inspection](examples/paper_trading_health.py) -```sh -python examples/paper_trading_health.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) -## Documentation for API Endpoints +See [`examples/README.md`](examples/README.md) for the full annotated list. + All URIs are relative to *https://mainnet.zklighter.elliot.ai* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AccountApi* | [**account**](docs/AccountApi.md#account) | **GET** /api/v1/account | account +*AccountApi* | [**account_limits**](docs/AccountApi.md#account_limits) | **GET** /api/v1/accountLimits | accountLimits +*AccountApi* | [**account_metadata**](docs/AccountApi.md#account_metadata) | **GET** /api/v1/accountMetadata | accountMetadata *AccountApi* | [**accounts_by_l1_address**](docs/AccountApi.md#accounts_by_l1_address) | **GET** /api/v1/accountsByL1Address | accountsByL1Address *AccountApi* | [**apikeys**](docs/AccountApi.md#apikeys) | **GET** /api/v1/apikeys | apikeys +*AccountApi* | [**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* | [**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 +*AccountApi* | [**lit_lease**](docs/AccountApi.md#lit_lease) | **POST** /api/v1/litLease | litLease +*AccountApi* | [**partner_stats**](docs/AccountApi.md#partner_stats) | **GET** /api/v1/partnerStats | partnerStats *AccountApi* | [**pnl**](docs/AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl +*AccountApi* | [**position_funding**](docs/AccountApi.md#position_funding) | **GET** /api/v1/positionFunding | positionFunding +*AccountApi* | [**public_pools_metadata**](docs/AccountApi.md#public_pools_metadata) | **GET** /api/v1/publicPoolsMetadata | publicPoolsMetadata +*AccountApi* | [**referral_user_referrals**](docs/AccountApi.md#referral_user_referrals) | **GET** /api/v1/referral/userReferrals | userReferrals +*AccountApi* | [**set_maker_only_api_keys**](docs/AccountApi.md#set_maker_only_api_keys) | **POST** /api/v1/setMakerOnlyApiKeys | setMakerOnlyApiKeys +*AccountApi* | [**tokens**](docs/AccountApi.md#tokens) | **GET** /api/v1/tokens | tokens +*AccountApi* | [**tokens_create**](docs/AccountApi.md#tokens_create) | **POST** /api/v1/tokens/create | tokens_create +*AccountApi* | [**tokens_revoke**](docs/AccountApi.md#tokens_revoke) | **POST** /api/v1/tokens/revoke | tokens_revoke +*AnnouncementApi* | [**announcement**](docs/AnnouncementApi.md#announcement) | **GET** /api/v1/announcement | announcement +*BlockApi* | [**block**](docs/BlockApi.md#block) | **GET** /api/v1/block | block +*BlockApi* | [**blocks**](docs/BlockApi.md#blocks) | **GET** /api/v1/blocks | blocks +*BlockApi* | [**current_height**](docs/BlockApi.md#current_height) | **GET** /api/v1/currentHeight | currentHeight +*BridgeApi* | [**create_intent_address**](docs/BridgeApi.md#create_intent_address) | **POST** /api/v1/createIntentAddress | createIntentAddress +*BridgeApi* | [**deposit_latest**](docs/BridgeApi.md#deposit_latest) | **GET** /api/v1/deposit/latest | deposit_latest +*BridgeApi* | [**deposit_networks**](docs/BridgeApi.md#deposit_networks) | **GET** /api/v1/deposit/networks | deposit_networks +*BridgeApi* | [**fastbridge_info**](docs/BridgeApi.md#fastbridge_info) | **GET** /api/v1/fastbridge/info | fastbridge_info +*BridgeApi* | [**fastwithdraw**](docs/BridgeApi.md#fastwithdraw) | **POST** /api/v1/fastwithdraw | fastwithdraw +*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 +*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* | [**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 +*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* | [**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 +*OrderApi* | [**execute_stats**](docs/OrderApi.md#execute_stats) | **GET** /api/v1/executeStats | executeStats +*OrderApi* | [**export**](docs/OrderApi.md#export) | **GET** /api/v1/export | export *OrderApi* | [**order_book_details**](docs/OrderApi.md#order_book_details) | **GET** /api/v1/orderBookDetails | orderBookDetails *OrderApi* | [**order_book_orders**](docs/OrderApi.md#order_book_orders) | **GET** /api/v1/orderBookOrders | orderBookOrders *OrderApi* | [**order_books**](docs/OrderApi.md#order_books) | **GET** /api/v1/orderBooks | orderBooks *OrderApi* | [**recent_trades**](docs/OrderApi.md#recent_trades) | **GET** /api/v1/recentTrades | recentTrades *OrderApi* | [**trades**](docs/OrderApi.md#trades) | **GET** /api/v1/trades | trades +*ReferralApi* | [**referral_create**](docs/ReferralApi.md#referral_create) | **POST** /api/v1/referral/create | referral_create +*ReferralApi* | [**referral_get**](docs/ReferralApi.md#referral_get) | **GET** /api/v1/referral/get | referral_get +*ReferralApi* | [**referral_kickback_update**](docs/ReferralApi.md#referral_kickback_update) | **POST** /api/v1/referral/kickback/update | referral_kickback_update +*ReferralApi* | [**referral_points**](docs/ReferralApi.md#referral_points) | **GET** /api/v1/referral/points | referral_points +*ReferralApi* | [**referral_update**](docs/ReferralApi.md#referral_update) | **POST** /api/v1/referral/update | referral_update +*ReferralApi* | [**referral_use**](docs/ReferralApi.md#referral_use) | **POST** /api/v1/referral/use | referral_use *RootApi* | [**info**](docs/RootApi.md#info) | **GET** /info | info *RootApi* | [**status**](docs/RootApi.md#status) | **GET** / | status +*TokenlistApi* | [**tokenlist**](docs/TokenlistApi.md#tokenlist) | **GET** /api/v1/tokenlist | tokenlist +*TransactionApi* | [**account_txs**](docs/TransactionApi.md#account_txs) | **GET** /api/v1/accountTxs | accountTxs +*TransactionApi* | [**block_txs**](docs/TransactionApi.md#block_txs) | **GET** /api/v1/blockTxs | blockTxs *TransactionApi* | [**deposit_history**](docs/TransactionApi.md#deposit_history) | **GET** /api/v1/deposit/history | deposit_history *TransactionApi* | [**next_nonce**](docs/TransactionApi.md#next_nonce) | **GET** /api/v1/nextNonce | nextNonce *TransactionApi* | [**send_tx**](docs/TransactionApi.md#send_tx) | **POST** /api/v1/sendTx | sendTx *TransactionApi* | [**send_tx_batch**](docs/TransactionApi.md#send_tx_batch) | **POST** /api/v1/sendTxBatch | sendTxBatch +*TransactionApi* | [**set_account_metadata**](docs/TransactionApi.md#set_account_metadata) | **POST** /api/v1/setAccountMetadata | setAccountMetadata +*TransactionApi* | [**transfer_history**](docs/TransactionApi.md#transfer_history) | **GET** /api/v1/transfer/history | transfer_history +*TransactionApi* | [**tx**](docs/TransactionApi.md#tx) | **GET** /api/v1/tx | tx *TransactionApi* | [**tx_from_l1_tx_hash**](docs/TransactionApi.md#tx_from_l1_tx_hash) | **GET** /api/v1/txFromL1TxHash | txFromL1TxHash *TransactionApi* | [**txs**](docs/TransactionApi.md#txs) | **GET** /api/v1/txs | txs *TransactionApi* | [**withdraw_history**](docs/TransactionApi.md#withdraw_history) | **GET** /api/v1/withdraw/history | withdraw_history + - -## Documentation For Models - + - [Account](docs/Account.md) - [AccountApiKeys](docs/AccountApiKeys.md) - - [AccountMarketStats](docs/AccountMarketStats.md) + - [AccountAsset](docs/AccountAsset.md) + - [AccountLimits](docs/AccountLimits.md) - [AccountMetadata](docs/AccountMetadata.md) + - [AccountMetadatas](docs/AccountMetadatas.md) - [AccountPnL](docs/AccountPnL.md) - [AccountPosition](docs/AccountPosition.md) - - [AccountStats](docs/AccountStats.md) + - [Announcement](docs/Announcement.md) + - [Announcements](docs/Announcements.md) - [ApiKey](docs/ApiKey.md) + - [ApiToken](docs/ApiToken.md) + - [ApprovedIntegrator](docs/ApprovedIntegrator.md) + - [Asset](docs/Asset.md) + - [AssetDetails](docs/AssetDetails.md) + - [Block](docs/Block.md) + - [Blocks](docs/Blocks.md) - [BridgeSupportedNetwork](docs/BridgeSupportedNetwork.md) + - [BridgeSupportedNetworks](docs/BridgeSupportedNetworks.md) + - [Candle](docs/Candle.md) + - [Candles](docs/Candles.md) - [ContractAddress](docs/ContractAddress.md) - - [Cursor](docs/Cursor.md) + - [CreateIntentAddressResp](docs/CreateIntentAddressResp.md) + - [CurrentHeight](docs/CurrentHeight.md) + - [DailyReturn](docs/DailyReturn.md) + - [Deposit](docs/Deposit.md) - [DepositHistory](docs/DepositHistory.md) - [DepositHistoryItem](docs/DepositHistoryItem.md) - [DetailedAccount](docs/DetailedAccount.md) - [DetailedAccounts](docs/DetailedAccounts.md) - - [DetailedCandlestick](docs/DetailedCandlestick.md) - [EnrichedTx](docs/EnrichedTx.md) + - [ExchangeMetric](docs/ExchangeMetric.md) - [ExchangeStats](docs/ExchangeStats.md) + - [ExecuteStat](docs/ExecuteStat.md) + - [ExportData](docs/ExportData.md) - [Funding](docs/Funding.md) + - [FundingRate](docs/FundingRate.md) + - [FundingRates](docs/FundingRates.md) - [Fundings](docs/Fundings.md) + - [L1Metadata](docs/L1Metadata.md) - [L1ProviderInfo](docs/L1ProviderInfo.md) + - [Layer1BasicInfo](docs/Layer1BasicInfo.md) + - [LeaseEntry](docs/LeaseEntry.md) + - [LeaseOptionEntry](docs/LeaseOptionEntry.md) + - [LiqTrade](docs/LiqTrade.md) - [Liquidation](docs/Liquidation.md) - - [MarketInfo](docs/MarketInfo.md) + - [LiquidationInfo](docs/LiquidationInfo.md) + - [LiquidationInfos](docs/LiquidationInfos.md) + - [MarketConfig](docs/MarketConfig.md) - [NextNonce](docs/NextNonce.md) - [Order](docs/Order.md) - [OrderBook](docs/OrderBook.md) - [OrderBookDepth](docs/OrderBookDepth.md) - - [OrderBookDetail](docs/OrderBookDetail.md) - [OrderBookDetails](docs/OrderBookDetails.md) - [OrderBookOrders](docs/OrderBookOrders.md) - [OrderBookStats](docs/OrderBookStats.md) - [OrderBooks](docs/OrderBooks.md) - [Orders](docs/Orders.md) + - [PartnerStats](docs/PartnerStats.md) + - [PendingUnlock](docs/PendingUnlock.md) + - [PerpsOrderBookDetail](docs/PerpsOrderBookDetail.md) - [PnLEntry](docs/PnLEntry.md) - [PositionFunding](docs/PositionFunding.md) + - [PositionFundings](docs/PositionFundings.md) - [PriceLevel](docs/PriceLevel.md) - - [PublicPool](docs/PublicPool.md) - [PublicPoolInfo](docs/PublicPoolInfo.md) + - [PublicPoolMetadata](docs/PublicPoolMetadata.md) - [PublicPoolShare](docs/PublicPoolShare.md) - - [PublicPools](docs/PublicPools.md) - - [ReqGetAccount](docs/ReqGetAccount.md) - - [ReqGetAccountApiKeys](docs/ReqGetAccountApiKeys.md) - - [ReqGetAccountByL1Address](docs/ReqGetAccountByL1Address.md) - - [ReqGetAccountInactiveOrders](docs/ReqGetAccountInactiveOrders.md) - - [ReqGetAccountPnL](docs/ReqGetAccountPnL.md) - - [ReqGetAccountTxs](docs/ReqGetAccountTxs.md) - - [ReqGetBlock](docs/ReqGetBlock.md) - - [ReqGetBlockTxs](docs/ReqGetBlockTxs.md) - - [ReqGetByAccount](docs/ReqGetByAccount.md) - - [ReqGetCandlesticks](docs/ReqGetCandlesticks.md) - - [ReqGetDepositHistory](docs/ReqGetDepositHistory.md) - - [ReqGetFundings](docs/ReqGetFundings.md) - - [ReqGetL1Tx](docs/ReqGetL1Tx.md) - - [ReqGetLatestDeposit](docs/ReqGetLatestDeposit.md) - - [ReqGetNextNonce](docs/ReqGetNextNonce.md) - - [ReqGetOrderBookDetails](docs/ReqGetOrderBookDetails.md) - - [ReqGetOrderBookOrders](docs/ReqGetOrderBookOrders.md) - - [ReqGetOrderBooks](docs/ReqGetOrderBooks.md) - - [ReqGetPublicPools](docs/ReqGetPublicPools.md) - - [ReqGetRangeWithCursor](docs/ReqGetRangeWithCursor.md) - - [ReqGetRangeWithIndex](docs/ReqGetRangeWithIndex.md) - - [ReqGetRangeWithIndexSortable](docs/ReqGetRangeWithIndexSortable.md) - - [ReqGetRecentTrades](docs/ReqGetRecentTrades.md) - - [ReqGetTrades](docs/ReqGetTrades.md) - - [ReqGetTx](docs/ReqGetTx.md) - - [ReqGetWithdrawHistory](docs/ReqGetWithdrawHistory.md) + - [Referral](docs/Referral.md) + - [ReferralCode](docs/ReferralCode.md) + - [ReferralPointEntry](docs/ReferralPointEntry.md) + - [ReferralPoints](docs/ReferralPoints.md) + - [ReqSetAccountMetadata](docs/ReqSetAccountMetadata.md) + - [RespChangeAccountTier](docs/RespChangeAccountTier.md) + - [RespGetApiTokens](docs/RespGetApiTokens.md) + - [RespGetExchangeMetrics](docs/RespGetExchangeMetrics.md) + - [RespGetExecuteStats](docs/RespGetExecuteStats.md) + - [RespGetFastBridgeInfo](docs/RespGetFastBridgeInfo.md) + - [RespGetFastwithdrawalInfo](docs/RespGetFastwithdrawalInfo.md) + - [RespGetLeaseOptions](docs/RespGetLeaseOptions.md) + - [RespGetLeases](docs/RespGetLeases.md) + - [RespGetMakerOnlyApiKeys](docs/RespGetMakerOnlyApiKeys.md) + - [RespPostApiToken](docs/RespPostApiToken.md) + - [RespPublicPoolsMetadata](docs/RespPublicPoolsMetadata.md) + - [RespRevokeApiToken](docs/RespRevokeApiToken.md) + - [RespSendTx](docs/RespSendTx.md) + - [RespSendTxBatch](docs/RespSendTxBatch.md) + - [RespSetMakerOnlyApiKeys](docs/RespSetMakerOnlyApiKeys.md) + - [RespUpdateKickback](docs/RespUpdateKickback.md) + - [RespUpdateReferralCode](docs/RespUpdateReferralCode.md) + - [RespWithdrawalDelay](docs/RespWithdrawalDelay.md) - [ResultCode](docs/ResultCode.md) + - [RiskInfo](docs/RiskInfo.md) + - [RiskParameters](docs/RiskParameters.md) + - [SharePrice](docs/SharePrice.md) - [SimpleOrder](docs/SimpleOrder.md) + - [SlippageResult](docs/SlippageResult.md) + - [SpotOrderBookDetail](docs/SpotOrderBookDetail.md) - [Status](docs/Status.md) + - [Strategy](docs/Strategy.md) - [SubAccounts](docs/SubAccounts.md) - - [Ticker](docs/Ticker.md) + - [SystemConfig](docs/SystemConfig.md) + - [Token](docs/Token.md) + - [TokenList](docs/TokenList.md) - [Trade](docs/Trade.md) + - [TradeStats](docs/TradeStats.md) - [Trades](docs/Trades.md) + - [TransferFeeInfo](docs/TransferFeeInfo.md) + - [TransferHistory](docs/TransferHistory.md) + - [TransferHistoryItem](docs/TransferHistoryItem.md) + - [Tx](docs/Tx.md) - [TxHash](docs/TxHash.md) - - [TxHashes](docs/TxHashes.md) + - [Txs](docs/Txs.md) + - [UserReferrals](docs/UserReferrals.md) - [ValidatorInfo](docs/ValidatorInfo.md) - [WithdrawHistory](docs/WithdrawHistory.md) - [WithdrawHistoryItem](docs/WithdrawHistoryItem.md) - [ZkLighterInfo](docs/ZkLighterInfo.md) -[//]: # () - -[//]: # (## Documentation For Authorization) - -[//]: # () -[//]: # (Endpoints do not require authorization.) - - + + diff --git a/docs/Account.md b/docs/Account.md index 75cdc2e..e2dc303 100644 --- a/docs/Account.md +++ b/docs/Account.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **code** | **int** | | **message** | **str** | | [optional] **account_type** | **int** | | +**account_trading_mode** | **int** | Classic=0 and Unified=1 | **index** | **int** | | **l1_address** | **str** | | **cancel_all_time** | **int** | | @@ -18,7 +19,6 @@ Name | Type | Description | Notes **status** | **int** | | **collateral** | **str** | | **transaction_time** | **int** | | -**account_trading_mode** | **int** | | ## Example diff --git a/docs/AccountApi.md b/docs/AccountApi.md index b3347dc..c0c2155 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -10,7 +10,6 @@ Method | HTTP request | Description [**accounts_by_l1_address**](AccountApi.md#accounts_by_l1_address) | **GET** /api/v1/accountsByL1Address | accountsByL1Address [**apikeys**](AccountApi.md#apikeys) | **GET** /api/v1/apikeys | apikeys [**change_account_tier**](AccountApi.md#change_account_tier) | **POST** /api/v1/changeAccountTier | changeAccountTier -[**faucet**](AccountApi.md#faucet) | **GET** /api/v1/faucet | faucet [**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 [**lease_options**](AccountApi.md#lease_options) | **GET** /api/v1/leaseOptions | leaseOptions @@ -21,6 +20,7 @@ Method | HTTP request | Description [**pnl**](AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl [**position_funding**](AccountApi.md#position_funding) | **GET** /api/v1/positionFunding | positionFunding [**public_pools_metadata**](AccountApi.md#public_pools_metadata) | **GET** /api/v1/publicPoolsMetadata | publicPoolsMetadata +[**referral_user_referrals**](AccountApi.md#referral_user_referrals) | **GET** /api/v1/referral/userReferrals | userReferrals [**set_maker_only_api_keys**](AccountApi.md#set_maker_only_api_keys) | **POST** /api/v1/setMakerOnlyApiKeys | setMakerOnlyApiKeys [**tokens**](AccountApi.md#tokens) | **GET** /api/v1/tokens | tokens [**tokens_create**](AccountApi.md#tokens_create) | **POST** /api/v1/tokens/create | tokens_create @@ -32,7 +32,7 @@ Method | HTTP request | Description account -Get account by account's index.
More details about account index: [Account Index](https://apidocs.lighter.xyz/docs/account-index)
**Response Description:**

1) **Status:** 1 is active 0 is inactive.
2) **Collateral:** The amount of collateral in the account.
**Position Details Description:**
1) **OOC:** Open order count in that market.
2) **Sign:** 1 for Long, -1 for Short.
3) **Position:** The amount of position in that market.
4) **Avg Entry Price:** The average entry price of the position.
5) **Position Value:** The value of the position.
6) **Unrealized PnL:** The unrealized profit and loss of the position.
7) **Realized PnL:** The realized profit and loss of the position. +Get account by an account's index, or L1 address ### Example @@ -56,7 +56,7 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.AccountApi(api_client) by = 'by_example' # str | value = 'value_example' # str | - active_only = False # bool | (optional) (default to False) + active_only = False # bool | Hide markets for which leverage and margin settings are present (meaning the account traded it at least once), but with no active position. (optional) (default to False) cursor = 'cursor_example' # str | (optional) try: @@ -77,7 +77,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **by** | **str**| | **value** | **str**| | - **active_only** | **bool**| | [optional] [default to False] + **active_only** | **bool**| Hide markets for which leverage and margin settings are present (meaning the account traded it at least once), but with no active position. | [optional] [default to False] **cursor** | **str**| | [optional] ### Return type @@ -103,11 +103,11 @@ 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_limits** -> AccountLimits account_limits(account_index, authorization=authorization, auth=auth) +> AccountLimits account_limits(account_index, authorization) accountLimits -Get account limits +Get account limits. For more details on account types, see this page: https://apidocs.lighter.xyz/docs/account-types ### Example @@ -130,12 +130,11 @@ async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.AccountApi(api_client) account_index = 56 # int | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) + authorization = 'authorization_example' # str | try: # accountLimits - api_response = await api_instance.account_limits(account_index, authorization=authorization, auth=auth) + api_response = await api_instance.account_limits(account_index, authorization) print("The response of AccountApi->account_limits:\n") pprint(api_response) except Exception as e: @@ -150,8 +149,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**| | ### Return type @@ -176,7 +174,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) # **account_metadata** -> AccountMetadatas account_metadata(by, value, authorization=authorization, auth=auth, cursor=cursor) +> AccountMetadatas account_metadata(by, value, authorization=authorization, cursor=cursor) accountMetadata @@ -205,12 +203,11 @@ async with lighter.ApiClient(configuration) as api_client: by = 'by_example' # str | value = 'value_example' # str | authorization = 'authorization_example' # str | (optional) - auth = 'auth_example' # str | (optional) cursor = 'cursor_example' # str | (optional) try: # accountMetadata - api_response = await api_instance.account_metadata(by, value, authorization=authorization, auth=auth, cursor=cursor) + api_response = await api_instance.account_metadata(by, value, authorization=authorization, cursor=cursor) print("The response of AccountApi->account_metadata:\n") pprint(api_response) except Exception as e: @@ -227,7 +224,6 @@ Name | Type | Description | Notes **by** | **str**| | **value** | **str**| | **authorization** | **str**| | [optional] - **auth** | **str**| | [optional] **cursor** | **str**| | [optional] ### Return type @@ -257,7 +253,7 @@ No authorization required accountsByL1Address -Get accounts by l1_address returns all accounts associated with the given L1 address +Returns all accounts associated with the given L1 address ### Example @@ -351,7 +347,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 | - api_key_index = 255 # int | (optional) (default to 255) + api_key_index = 56 # int | (optional) try: # apikeys @@ -370,7 +366,7 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_index** | **int**| | - **api_key_index** | **int**| | [optional] [default to 255] + **api_key_index** | **int**| | [optional] ### Return type @@ -399,7 +395,7 @@ No authorization required changeAccountTier -Change account tier +Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open. ### Example @@ -457,78 +453,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **faucet** -> ResultCode faucet(l1_address, do_l1_transfer) - -faucet - -Request funds from faucet - -### Example - - -```python -import lighter -from lighter.models.result_code import ResultCode -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.AccountApi(api_client) - l1_address = 'l1_address_example' # str | - do_l1_transfer = False # bool | (default to False) - - try: - # faucet - api_response = await api_instance.faucet(l1_address, do_l1_transfer) - print("The response of AccountApi->faucet:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling AccountApi->faucet: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **l1_address** | **str**| | - **do_l1_transfer** | **bool**| | [default to False] - -### Return type - -[**ResultCode**](ResultCode.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -541,7 +466,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) # **get_maker_only_api_keys** -> RespGetMakerOnlyApiKeys get_maker_only_api_keys(account_index, authorization=authorization, auth=auth) +> RespGetMakerOnlyApiKeys get_maker_only_api_keys(authorization, account_index) getMakerOnlyApiKeys @@ -567,13 +492,12 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.AccountApi(api_client) + authorization = 'authorization_example' # str | account_index = 56 # int | - authorization = 'authorization_example' # str | (optional) - auth = 'auth_example' # str | (optional) try: # getMakerOnlyApiKeys - api_response = await api_instance.get_maker_only_api_keys(account_index, authorization=authorization, auth=auth) + api_response = await api_instance.get_maker_only_api_keys(authorization, account_index) print("The response of AccountApi->get_maker_only_api_keys:\n") pprint(api_response) except Exception as e: @@ -587,9 +511,8 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **account_index** | **int**| | - **authorization** | **str**| | [optional] - **auth** | **str**| | [optional] ### Return type @@ -614,7 +537,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) # **l1_metadata** -> L1Metadata l1_metadata(l1_address, authorization=authorization, auth=auth) +> L1Metadata l1_metadata(authorization, l1_address) l1Metadata @@ -640,13 +563,12 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.AccountApi(api_client) + authorization = 'authorization_example' # str | l1_address = 'l1_address_example' # str | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) try: # l1Metadata - api_response = await api_instance.l1_metadata(l1_address, authorization=authorization, auth=auth) + api_response = await api_instance.l1_metadata(authorization, l1_address) print("The response of AccountApi->l1_metadata:\n") pprint(api_response) except Exception as e: @@ -660,9 +582,8 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **l1_address** | **str**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] ### Return type @@ -691,7 +612,7 @@ No authorization required leaseOptions -Get lease options +Returns available lease duration/rate tiers, sorted by duration descending. ### Example @@ -752,11 +673,11 @@ 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, auth=auth, cursor=cursor, limit=limit) +> RespGetLeases leases(account_index, authorization=authorization, cursor=cursor, limit=limit, auth=auth) leases -Get leases +Returns paginated lease entries for an account, most recent first. Supports read-only auth via signature/account_index/timestamp query params. ### Example @@ -778,15 +699,15 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.AccountApi(api_client) - account_index = 56 # int | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) - cursor = 'cursor_example' # str | (optional) - limit = 20 # int | (optional) (default to 20) + account_index = 56 # int | Account index to fetch leases for + 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, auth=auth, cursor=cursor, limit=limit) + api_response = await api_instance.leases(account_index, authorization=authorization, cursor=cursor, limit=limit, auth=auth) print("The response of AccountApi->leases:\n") pprint(api_response) except Exception as e: @@ -800,11 +721,11 @@ 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] - **cursor** | **str**| | [optional] - **limit** | **int**| | [optional] [default to 20] + **account_index** | **int**| Account index to fetch leases for | + **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 @@ -829,7 +750,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) # **liquidations** -> LiquidationInfos liquidations(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, cursor=cursor) +> LiquidationInfos liquidations(authorization, account_index, limit, market_id=market_id, cursor=cursor) liquidations @@ -855,16 +776,15 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.AccountApi(api_client) + authorization = 'authorization_example' # str | account_index = 56 # int | limit = 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) - market_id = 255 # int | (optional) (default to 255) + market_id = 56 # int | (optional) cursor = 'cursor_example' # str | (optional) try: # liquidations - api_response = await api_instance.liquidations(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, cursor=cursor) + api_response = await api_instance.liquidations(authorization, account_index, limit, market_id=market_id, cursor=cursor) print("The response of AccountApi->liquidations:\n") pprint(api_response) except Exception as e: @@ -878,11 +798,10 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **account_index** | **int**| | **limit** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - **market_id** | **int**| | [optional] [default to 255] + **market_id** | **int**| | [optional] **cursor** | **str**| | [optional] ### Return type @@ -912,7 +831,7 @@ No authorization required litLease -Submit LIT lease transfer +Submit a LIT lease transfer. The server calculates the required fee based on lease_amount and duration_days, then executes the transfer. Fee formula (integer arithmetic): fee = lease_amount × (annual_rate × 100) × duration_days / (360 × 10000). ### Example @@ -934,10 +853,10 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.AccountApi(api_client) - tx_info = 'tx_info_example' # str | - lease_amount = 'lease_amount_example' # str | - duration_days = 56 # int | - authorization = 'authorization_example' # str | (optional) + tx_info = 'tx_info_example' # str | Signed transaction info (JSON with L2 signature, L1 signature, etc.) + lease_amount = 'lease_amount_example' # str | Amount of LIT to lease in raw units (1 LIT = 100000000) + duration_days = 56 # int | Lease duration in days. Must match one of the available lease options. + authorization = 'authorization_example' # str | API token authorization (optional) try: # litLease @@ -955,10 +874,10 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tx_info** | **str**| | - **lease_amount** | **str**| | - **duration_days** | **int**| | - **authorization** | **str**| | [optional] + **tx_info** | **str**| Signed transaction info (JSON with L2 signature, L1 signature, etc.) | + **lease_amount** | **str**| Amount of LIT to lease in raw units (1 LIT = 100000000) | + **duration_days** | **int**| Lease duration in days. Must match one of the available lease options. | + **authorization** | **str**| API token authorization | [optional] ### Return type @@ -970,7 +889,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -987,7 +906,7 @@ No authorization required partnerStats -Get partner stats +Get partner stats. If timestamps are not provided, all-time stats will be returned. ### Example @@ -1056,7 +975,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) # **pnl** -> AccountPnL pnl(by, value, resolution, start_timestamp, end_timestamp, count_back, authorization=authorization, auth=auth, ignore_transfers=ignore_transfers) +> AccountPnL pnl(by, value, resolution, start_timestamp, end_timestamp, count_back, authorization=authorization, ignore_transfers=ignore_transfers) pnl @@ -1088,13 +1007,12 @@ async with lighter.ApiClient(configuration) as api_client: start_timestamp = 56 # int | end_timestamp = 56 # int | count_back = 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) ignore_transfers = False # bool | (optional) (default to False) try: # pnl - api_response = await api_instance.pnl(by, value, resolution, start_timestamp, end_timestamp, count_back, authorization=authorization, auth=auth, ignore_transfers=ignore_transfers) + api_response = await api_instance.pnl(by, value, resolution, start_timestamp, end_timestamp, count_back, authorization=authorization, ignore_transfers=ignore_transfers) print("The response of AccountApi->pnl:\n") pprint(api_response) except Exception as e: @@ -1114,8 +1032,7 @@ Name | Type | Description | Notes **start_timestamp** | **int**| | **end_timestamp** | **int**| | **count_back** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **authorization** | **str**| | [optional] **ignore_transfers** | **bool**| | [optional] [default to False] ### Return type @@ -1141,7 +1058,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, auth=auth, market_id=market_id, cursor=cursor, side=side) +> PositionFundings position_funding(account_index, limit, authorization=authorization, market_id=market_id, cursor=cursor, side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp) positionFunding @@ -1169,15 +1086,16 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.AccountApi(api_client) account_index = 56 # int | limit = 56 # int | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) - market_id = 255 # int | (optional) (default to 255) + 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) try: # positionFunding - api_response = await api_instance.position_funding(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, cursor=cursor, side=side) + 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) print("The response of AccountApi->position_funding:\n") pprint(api_response) except Exception as e: @@ -1193,11 +1111,12 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_index** | **int**| | **limit** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - **market_id** | **int**| | [optional] [default to 255] + **authorization** | **str**| | [optional] + **market_id** | **int**| | [optional] **cursor** | **str**| | [optional] **side** | **str**| | [optional] [default to all] + **start_timestamp** | **int**| | [optional] + **end_timestamp** | **int**| | [optional] ### Return type @@ -1222,11 +1141,11 @@ 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) # **public_pools_metadata** -> RespPublicPoolsMetadata public_pools_metadata(index, limit, authorization=authorization, auth=auth, filter=filter, account_index=account_index) +> RespPublicPoolsMetadata public_pools_metadata(index, limit, authorization=authorization, filter=filter, account_index=account_index) publicPoolsMetadata -Get public pools metadata +Get public pools metadata. `auth` is required in case you specify an account_index. You will see public pools with an index that starts an n-1 of the one you specify. To see staking pools, use `filter=stake` ### Example @@ -1250,14 +1169,13 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.AccountApi(api_client) index = 56 # int | limit = 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) filter = 'filter_example' # str | (optional) account_index = 56 # int | (optional) try: # publicPoolsMetadata - api_response = await api_instance.public_pools_metadata(index, limit, authorization=authorization, auth=auth, filter=filter, account_index=account_index) + api_response = await api_instance.public_pools_metadata(index, limit, authorization=authorization, filter=filter, account_index=account_index) print("The response of AccountApi->public_pools_metadata:\n") pprint(api_response) except Exception as e: @@ -1273,8 +1191,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **index** | **int**| | **limit** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **authorization** | **str**| | [optional] **filter** | **str**| | [optional] **account_index** | **int**| | [optional] @@ -1300,12 +1217,93 @@ 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 + +Get user referrals + +### Example + + +```python +import lighter +from lighter.models.user_referrals import UserReferrals +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.AccountApi(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) + + 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) + print("The response of AccountApi->referral_user_referrals:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->referral_user_referrals: %s\n" % e) +``` + + + +### Parameters + + +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] + +### Return type + +[**UserReferrals**](UserReferrals.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **set_maker_only_api_keys** -> RespSetMakerOnlyApiKeys set_maker_only_api_keys(account_index, api_key_indexes, authorization=authorization, auth=auth) +> RespSetMakerOnlyApiKeys set_maker_only_api_keys(authorization, account_index, api_key_indexes, auth=auth) setMakerOnlyApiKeys -Set maker-only API key indexes +Set maker-only API key indexes. This replaces the current list; pass all indexes you want marked as maker-only. Pass [] to clear all maker-only restrictions. ### Example @@ -1327,14 +1325,14 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.AccountApi(api_client) + authorization = 'authorization_example' # str | account_index = 56 # int | - api_key_indexes = 'api_key_indexes_example' # str | JSON array of int16, e.g. \\\"[1,2]\\\" - authorization = 'authorization_example' # str | (optional) + 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(account_index, api_key_indexes, authorization=authorization, auth=auth) + api_response = await api_instance.set_maker_only_api_keys(authorization, account_index, api_key_indexes, auth=auth) print("The response of AccountApi->set_maker_only_api_keys:\n") pprint(api_response) except Exception as e: @@ -1348,9 +1346,9 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **account_index** | **int**| | - **api_key_indexes** | **str**| JSON array of int16, e.g. \\\"[1,2]\\\" | - **authorization** | **str**| | [optional] + **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 @@ -1363,7 +1361,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/x-www-form-urlencoded, multipart/form-data - **Accept**: application/json ### HTTP response details @@ -1380,7 +1378,7 @@ No authorization required tokens -Get api tokens of an account +Get read only auth tokens for an account ### Example @@ -1451,7 +1449,7 @@ No authorization required tokens_create -Create api token +Create an API token for read-only access ### Example @@ -1513,7 +1511,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -1530,7 +1528,7 @@ No authorization required tokens_revoke -Revoke api token +Revoke read only auth token for an account ### Example @@ -1586,7 +1584,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details diff --git a/docs/AccountAsset.md b/docs/AccountAsset.md index 45956b9..5ccf383 100644 --- a/docs/AccountAsset.md +++ b/docs/AccountAsset.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **asset_id** | **int** | | **balance** | **str** | | **locked_balance** | **str** | | +**margin_balance** | **str** | | +**margin_mode** | **str** | | ## Example diff --git a/docs/AccountLimits.md b/docs/AccountLimits.md index 8e536ac..6c2334e 100644 --- a/docs/AccountLimits.md +++ b/docs/AccountLimits.md @@ -8,14 +8,15 @@ Name | Type | Description | Notes **code** | **int** | | **message** | **str** | | [optional] **max_llp_percentage** | **int** | | -**max_llp_amount** | **str** | | **user_tier** | **str** | | **can_create_public_pool** | **bool** | | -**user_tier_name** | **str** | | +**max_llp_amount** | **str** | | **current_maker_fee_tick** | **int** | | **current_taker_fee_tick** | **int** | | -**leased_lit** | **str** | | -**effective_lit_stakes** | **str** | | +**effective_lit_stakes** | **str** | Effective staked LIT shares including active leases. | +**leased_lit** | **str** | Total actively leased LIT. | +**user_tier_name** | **str** | | +**user_tier_last_update** | **int** | | [optional] ## Example diff --git a/docs/AccountMarginStats.md b/docs/AccountMarginStats.md deleted file mode 100644 index 2fedfac..0000000 --- a/docs/AccountMarginStats.md +++ /dev/null @@ -1,34 +0,0 @@ -# AccountMarginStats - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**collateral** | **str** | | -**portfolio_value** | **str** | | -**leverage** | **str** | | -**available_balance** | **str** | | -**margin_usage** | **str** | | -**buying_power** | **str** | | - -## Example - -```python -from lighter.models.account_margin_stats import AccountMarginStats - -# TODO update the JSON string below -json = "{}" -# create an instance of AccountMarginStats from a JSON string -account_margin_stats_instance = AccountMarginStats.from_json(json) -# print the JSON string representation of the object -print(AccountMarginStats.to_json()) - -# convert the object into a dict -account_margin_stats_dict = account_margin_stats_instance.to_dict() -# create an instance of AccountMarginStats from a dict -account_margin_stats_from_dict = AccountMarginStats.from_dict(account_margin_stats_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/AccountMarketStats.md b/docs/AccountMarketStats.md deleted file mode 100644 index c365818..0000000 --- a/docs/AccountMarketStats.md +++ /dev/null @@ -1,41 +0,0 @@ -# AccountMarketStats - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**market_id** | **int** | | -**daily_trades_count** | **int** | | -**daily_base_token_volume** | **float** | | -**daily_quote_token_volume** | **float** | | -**weekly_trades_count** | **int** | | -**weekly_base_token_volume** | **float** | | -**weekly_quote_token_volume** | **float** | | -**monthly_trades_count** | **int** | | -**monthly_base_token_volume** | **float** | | -**monthly_quote_token_volume** | **float** | | -**total_trades_count** | **int** | | -**total_base_token_volume** | **float** | | -**total_quote_token_volume** | **float** | | - -## Example - -```python -from lighter.models.account_market_stats import AccountMarketStats - -# TODO update the JSON string below -json = "{}" -# create an instance of AccountMarketStats from a JSON string -account_market_stats_instance = AccountMarketStats.from_json(json) -# print the JSON string representation of the object -print(AccountMarketStats.to_json()) - -# convert the object into a dict -account_market_stats_dict = account_market_stats_instance.to_dict() -# create an instance of AccountMarketStats from a dict -account_market_stats_from_dict = AccountMarketStats.from_dict(account_market_stats_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/AccountMetadata.md b/docs/AccountMetadata.md index b726ad2..21a152e 100644 --- a/docs/AccountMetadata.md +++ b/docs/AccountMetadata.md @@ -10,8 +10,9 @@ Name | Type | Description | Notes **description** | **str** | | **can_invite** | **bool** | Remove After FE uses L1 meta endpoint | **referral_points_percentage** | **str** | Remove After FE uses L1 meta endpoint | -**can_rfq** | **bool** | | **created_at** | **int** | | +**can_rfq** | **bool** | | +**can_rfq_market_ids** | **List[str]** | | ## Example diff --git a/docs/AccountStats.md b/docs/AccountStats.md deleted file mode 100644 index 89f38ed..0000000 --- a/docs/AccountStats.md +++ /dev/null @@ -1,37 +0,0 @@ -# AccountStats - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**collateral** | **str** | | -**portfolio_value** | **str** | | -**leverage** | **str** | | -**available_balance** | **str** | | -**margin_usage** | **str** | | -**buying_power** | **str** | | -**account_trading_mode** | **int** | | -**cross_stats** | [**AccountMarginStats**](AccountMarginStats.md) | | -**total_stats** | [**AccountMarginStats**](AccountMarginStats.md) | | - -## Example - -```python -from lighter.models.account_stats import AccountStats - -# TODO update the JSON string below -json = "{}" -# create an instance of AccountStats from a JSON string -account_stats_instance = AccountStats.from_json(json) -# print the JSON string representation of the object -print(AccountStats.to_json()) - -# convert the object into a dict -account_stats_dict = account_stats_instance.to_dict() -# create an instance of AccountStats from a dict -account_stats_from_dict = AccountStats.from_dict(account_stats_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/AccountTradeStats.md b/docs/AccountTradeStats.md deleted file mode 100644 index e42f167..0000000 --- a/docs/AccountTradeStats.md +++ /dev/null @@ -1,36 +0,0 @@ -# AccountTradeStats - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**daily_trades_count** | **int** | | -**daily_volume** | **float** | | -**weekly_trades_count** | **int** | | -**weekly_volume** | **float** | | -**monthly_trades_count** | **int** | | -**monthly_volume** | **float** | | -**total_trades_count** | **int** | | -**total_volume** | **float** | | - -## Example - -```python -from lighter.models.account_trade_stats import AccountTradeStats - -# TODO update the JSON string below -json = "{}" -# create an instance of AccountTradeStats from a JSON string -account_trade_stats_instance = AccountTradeStats.from_json(json) -# print the JSON string representation of the object -print(AccountTradeStats.to_json()) - -# convert the object into a dict -account_trade_stats_dict = account_trade_stats_instance.to_dict() -# create an instance of AccountTradeStats from a dict -account_trade_stats_from_dict = AccountTradeStats.from_dict(account_trade_stats_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/AnnouncementApi.md b/docs/AnnouncementApi.md index 11d1f03..bc66f17 100644 --- a/docs/AnnouncementApi.md +++ b/docs/AnnouncementApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description announcement -Get announcement +Get announcements ### Example diff --git a/docs/Asset.md b/docs/Asset.md index 1987347..3113ae5 100644 --- a/docs/Asset.md +++ b/docs/Asset.md @@ -14,6 +14,14 @@ Name | Type | Description | Notes **margin_mode** | **str** | | **index_price** | **str** | | **l1_address** | **str** | | +**global_supply_cap** | **str** | | +**liquidation_fee** | **str** | | +**liquidation_threshold** | **str** | | +**loan_to_value** | **str** | | +**price_decimals** | **int** | | +**total_supplied** | **str** | | +**user_supply_cap** | **str** | | +**liquidation_factor** | **str** | | ## Example diff --git a/docs/Block.md b/docs/Block.md new file mode 100644 index 0000000..78ad751 --- /dev/null +++ b/docs/Block.md @@ -0,0 +1,41 @@ +# Block + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commitment** | **str** | | +**height** | **int** | | +**state_root** | **str** | | +**priority_operations** | **int** | | +**on_chain_l2_operations** | **int** | | +**pending_on_chain_operations_pub_data** | **str** | | +**committed_tx_hash** | **str** | | +**committed_at** | **int** | | +**verified_tx_hash** | **str** | | +**verified_at** | **int** | | +**txs** | [**List[Tx]**](Tx.md) | | +**status** | **int** | | +**size** | **int** | | + +## Example + +```python +from lighter.models.block import Block + +# TODO update the JSON string below +json = "{}" +# create an instance of Block from a JSON string +block_instance = Block.from_json(json) +# print the JSON string representation of the object +print(Block.to_json()) + +# convert the object into a dict +block_dict = block_instance.to_dict() +# create an instance of Block from a dict +block_from_dict = Block.from_dict(block_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BlockApi.md b/docs/BlockApi.md new file mode 100644 index 0000000..6d02f71 --- /dev/null +++ b/docs/BlockApi.md @@ -0,0 +1,220 @@ +# lighter.BlockApi + +All URIs are relative to *https://mainnet.zklighter.elliot.ai* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**block**](BlockApi.md#block) | **GET** /api/v1/block | block +[**blocks**](BlockApi.md#blocks) | **GET** /api/v1/blocks | blocks +[**current_height**](BlockApi.md#current_height) | **GET** /api/v1/currentHeight | currentHeight + + +# **block** +> Blocks block(by, value) + +block + +Get block by its height or commitment + +### Example + + +```python +import lighter +from lighter.models.blocks import Blocks +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.BlockApi(api_client) + by = 'by_example' # str | + value = 'value_example' # str | + + try: + # block + api_response = await api_instance.block(by, value) + print("The response of BlockApi->block:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BlockApi->block: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **by** | **str**| | + **value** | **str**| | + +### Return type + +[**Blocks**](Blocks.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **blocks** +> Blocks blocks(limit, index=index, sort=sort) + +blocks + +Get blocks + +### Example + + +```python +import lighter +from lighter.models.blocks import Blocks +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.BlockApi(api_client) + limit = 56 # int | + index = 56 # int | (optional) + sort = asc # str | (optional) (default to asc) + + try: + # blocks + api_response = await api_instance.blocks(limit, index=index, sort=sort) + print("The response of BlockApi->blocks:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BlockApi->blocks: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| | + **index** | **int**| | [optional] + **sort** | **str**| | [optional] [default to asc] + +### Return type + +[**Blocks**](Blocks.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **current_height** +> CurrentHeight current_height() + +currentHeight + +Get current height + +### Example + + +```python +import lighter +from lighter.models.current_height import CurrentHeight +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.BlockApi(api_client) + + try: + # currentHeight + api_response = await api_instance.current_height() + print("The response of BlockApi->current_height:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BlockApi->current_height: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**CurrentHeight**](CurrentHeight.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Auth.md b/docs/Blocks.md similarity index 50% rename from docs/Auth.md rename to docs/Blocks.md index e8c4a9c..09ea46c 100644 --- a/docs/Auth.md +++ b/docs/Blocks.md @@ -1,28 +1,31 @@ -# Auth +# Blocks ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | +**code** | **int** | | +**message** | **str** | | [optional] +**total** | **int** | | +**blocks** | [**List[Block]**](Block.md) | | ## Example ```python -from lighter.models.auth import Auth +from lighter.models.blocks import Blocks # TODO update the JSON string below json = "{}" -# create an instance of Auth from a JSON string -auth_instance = Auth.from_json(json) +# create an instance of Blocks from a JSON string +blocks_instance = Blocks.from_json(json) # print the JSON string representation of the object -print(Auth.to_json()) +print(Blocks.to_json()) # convert the object into a dict -auth_dict = auth_instance.to_dict() -# create an instance of Auth from a dict -auth_from_dict = Auth.from_dict(auth_dict) +blocks_dict = blocks_instance.to_dict() +# create an instance of Blocks from a dict +blocks_from_dict = Blocks.from_dict(blocks_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/BridgeApi.md b/docs/BridgeApi.md index ecad9cc..343f087 100644 --- a/docs/BridgeApi.md +++ b/docs/BridgeApi.md @@ -4,26 +4,27 @@ All URIs are relative to *https://mainnet.zklighter.elliot.ai* Method | HTTP request | Description ------------- | ------------- | ------------- -[**bridges**](BridgeApi.md#bridges) | **GET** /api/v1/bridges | bridges -[**bridges_is_next_bridge_fast**](BridgeApi.md#bridges_is_next_bridge_fast) | **GET** /api/v1/bridges/isNextBridgeFast | bridges_isNextBridgeFast +[**create_intent_address**](BridgeApi.md#create_intent_address) | **POST** /api/v1/createIntentAddress | createIntentAddress +[**deposit_latest**](BridgeApi.md#deposit_latest) | **GET** /api/v1/deposit/latest | deposit_latest +[**deposit_networks**](BridgeApi.md#deposit_networks) | **GET** /api/v1/deposit/networks | deposit_networks [**fastbridge_info**](BridgeApi.md#fastbridge_info) | **GET** /api/v1/fastbridge/info | fastbridge_info [**fastwithdraw**](BridgeApi.md#fastwithdraw) | **POST** /api/v1/fastwithdraw | fastwithdraw [**fastwithdraw_info**](BridgeApi.md#fastwithdraw_info) | **GET** /api/v1/fastwithdraw/info | fastwithdraw_info -# **bridges** -> RespGetBridgesByL1Addr bridges(l1_address) +# **create_intent_address** +> CreateIntentAddressResp create_intent_address(chain_id, from_addr, amount, is_external_deposit=is_external_deposit) -bridges +createIntentAddress -Get bridges for given l1 address +Create a bridge intent address for CCTP bridge ### Example ```python import lighter -from lighter.models.resp_get_bridges_by_l1_addr import RespGetBridgesByL1Addr +from lighter.models.create_intent_address_resp import CreateIntentAddressResp from lighter.rest import ApiException from pprint import pprint @@ -38,15 +39,18 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.BridgeApi(api_client) - l1_address = 'l1_address_example' # str | + chain_id = 'chain_id_example' # str | + from_addr = 'from_addr_example' # str | + amount = 'amount_example' # str | + is_external_deposit = True # bool | (optional) try: - # bridges - api_response = await api_instance.bridges(l1_address) - print("The response of BridgeApi->bridges:\n") + # createIntentAddress + api_response = await api_instance.create_intent_address(chain_id, from_addr, amount, is_external_deposit=is_external_deposit) + print("The response of BridgeApi->create_intent_address:\n") pprint(api_response) except Exception as e: - print("Exception when calling BridgeApi->bridges: %s\n" % e) + print("Exception when calling BridgeApi->create_intent_address: %s\n" % e) ``` @@ -56,11 +60,14 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **l1_address** | **str**| | + **chain_id** | **str**| | + **from_addr** | **str**| | + **amount** | **str**| | + **is_external_deposit** | **bool**| | [optional] ### Return type -[**RespGetBridgesByL1Addr**](RespGetBridgesByL1Addr.md) +[**CreateIntentAddressResp**](CreateIntentAddressResp.md) ### Authorization @@ -68,7 +75,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -80,19 +87,19 @@ 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) -# **bridges_is_next_bridge_fast** -> RespGetIsNextBridgeFast bridges_is_next_bridge_fast(l1_address) +# **deposit_latest** +> Deposit deposit_latest(l1_address) -bridges_isNextBridgeFast +deposit_latest -Get if next bridge is fast +Get most recent deposit for given l1 address ### Example ```python import lighter -from lighter.models.resp_get_is_next_bridge_fast import RespGetIsNextBridgeFast +from lighter.models.deposit import Deposit from lighter.rest import ApiException from pprint import pprint @@ -110,12 +117,12 @@ async with lighter.ApiClient(configuration) as api_client: l1_address = 'l1_address_example' # str | try: - # bridges_isNextBridgeFast - api_response = await api_instance.bridges_is_next_bridge_fast(l1_address) - print("The response of BridgeApi->bridges_is_next_bridge_fast:\n") + # deposit_latest + api_response = await api_instance.deposit_latest(l1_address) + print("The response of BridgeApi->deposit_latest:\n") pprint(api_response) except Exception as e: - print("Exception when calling BridgeApi->bridges_is_next_bridge_fast: %s\n" % e) + print("Exception when calling BridgeApi->deposit_latest: %s\n" % e) ``` @@ -129,7 +136,72 @@ Name | Type | Description | Notes ### Return type -[**RespGetIsNextBridgeFast**](RespGetIsNextBridgeFast.md) +[**Deposit**](Deposit.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deposit_networks** +> BridgeSupportedNetworks deposit_networks() + +deposit_networks + +Get networks that support deposits via intent address + +### Example + + +```python +import lighter +from lighter.models.bridge_supported_networks import BridgeSupportedNetworks +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.BridgeApi(api_client) + + try: + # deposit_networks + api_response = await api_instance.deposit_networks() + print("The response of BridgeApi->deposit_networks:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BridgeApi->deposit_networks: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**BridgeSupportedNetworks**](BridgeSupportedNetworks.md) ### Authorization @@ -277,7 +349,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -290,7 +362,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_info** -> RespGetFastwithdrawalInfo fastwithdraw_info(account_index, authorization=authorization, auth=auth) +> RespGetFastwithdrawalInfo fastwithdraw_info(authorization, account_index) fastwithdraw_info @@ -316,13 +388,12 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.BridgeApi(api_client) + authorization = 'authorization_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) try: # fastwithdraw_info - api_response = await api_instance.fastwithdraw_info(account_index, authorization=authorization, auth=auth) + api_response = await api_instance.fastwithdraw_info(authorization, account_index) print("The response of BridgeApi->fastwithdraw_info:\n") pprint(api_response) except Exception as e: @@ -336,9 +407,8 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **account_index** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] ### Return type diff --git a/docs/BridgeSupportedNetworks.md b/docs/BridgeSupportedNetworks.md new file mode 100644 index 0000000..fa6b2dd --- /dev/null +++ b/docs/BridgeSupportedNetworks.md @@ -0,0 +1,31 @@ +# BridgeSupportedNetworks + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**networks** | [**List[BridgeSupportedNetwork]**](BridgeSupportedNetwork.md) | | + +## Example + +```python +from lighter.models.bridge_supported_networks import BridgeSupportedNetworks + +# TODO update the JSON string below +json = "{}" +# create an instance of BridgeSupportedNetworks from a JSON string +bridge_supported_networks_instance = BridgeSupportedNetworks.from_json(json) +# print the JSON string representation of the object +print(BridgeSupportedNetworks.to_json()) + +# convert the object into a dict +bridge_supported_networks_dict = bridge_supported_networks_instance.to_dict() +# create an instance of BridgeSupportedNetworks from a dict +bridge_supported_networks_from_dict = BridgeSupportedNetworks.from_dict(bridge_supported_networks_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/Candle.md b/docs/Candle.md index 6742064..b27d449 100644 --- a/docs/Candle.md +++ b/docs/Candle.md @@ -1,22 +1,23 @@ # Candle +Abbreviated candle format. Zero values are omitted. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**t** | **int** | timestamp | -**o** | **float** | open | -**h** | **float** | high | -**l** | **float** | low | -**c** | **float** | close | -**o** | **float** | open_raw | -**h** | **float** | high_raw | -**l** | **float** | low_raw | -**c** | **float** | close_raw | -**v** | **float** | volume0 | -**v** | **float** | volume1 | -**i** | **int** | last_trade_id | +**t** | **int** | Timestamp | +**o** | **float** | Open price | +**h** | **float** | High price | +**l** | **float** | Low price | +**c** | **float** | Close price | +**v** | **float** | Base token volume (volume0) | +**v** | **float** | Quote token volume (volume1) | +**i** | **int** | Last trade ID | +**c** | **float** | close_raw | [optional] +**h** | **float** | high_raw | [optional] +**l** | **float** | low_raw | [optional] +**o** | **float** | open_raw | [optional] ## Example diff --git a/docs/Candles.md b/docs/Candles.md index 3467403..f4d14ae 100644 --- a/docs/Candles.md +++ b/docs/Candles.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **int** | | +**r** | **str** | Resolution | +**c** | [**List[Candle]**](Candle.md) | Array of candles (max 500 per call) | **message** | **str** | | [optional] -**r** | **str** | resolution | -**c** | [**List[Candle]**](Candle.md) | candles | ## Example diff --git a/docs/CandlestickApi.md b/docs/CandlestickApi.md index 7975c88..a524abc 100644 --- a/docs/CandlestickApi.md +++ b/docs/CandlestickApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description candles -Get candles (optimized with shortened fields and smaller response size) +Get candles data. Returns at most 500 candles per call. Zero values are omitted from the response. ### Example diff --git a/docs/CreateIntentAddressResp.md b/docs/CreateIntentAddressResp.md new file mode 100644 index 0000000..74afe58 --- /dev/null +++ b/docs/CreateIntentAddressResp.md @@ -0,0 +1,31 @@ +# CreateIntentAddressResp + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**intent_address** | **str** | | + +## Example + +```python +from lighter.models.create_intent_address_resp import CreateIntentAddressResp + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateIntentAddressResp from a JSON string +create_intent_address_resp_instance = CreateIntentAddressResp.from_json(json) +# print the JSON string representation of the object +print(CreateIntentAddressResp.to_json()) + +# convert the object into a dict +create_intent_address_resp_dict = create_intent_address_resp_instance.to_dict() +# create an instance of CreateIntentAddressResp from a dict +create_intent_address_resp_from_dict = CreateIntentAddressResp.from_dict(create_intent_address_resp_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/CurrentHeight.md b/docs/CurrentHeight.md new file mode 100644 index 0000000..f790bae --- /dev/null +++ b/docs/CurrentHeight.md @@ -0,0 +1,31 @@ +# CurrentHeight + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**height** | **int** | | + +## Example + +```python +from lighter.models.current_height import CurrentHeight + +# TODO update the JSON string below +json = "{}" +# create an instance of CurrentHeight from a JSON string +current_height_instance = CurrentHeight.from_json(json) +# print the JSON string representation of the object +print(CurrentHeight.to_json()) + +# convert the object into a dict +current_height_dict = current_height_instance.to_dict() +# create an instance of CurrentHeight from a dict +current_height_from_dict = CurrentHeight.from_dict(current_height_dict) +``` +[[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/Cursor.md b/docs/Cursor.md deleted file mode 100644 index 76b077a..0000000 --- a/docs/Cursor.md +++ /dev/null @@ -1,29 +0,0 @@ -# Cursor - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**next_cursor** | **str** | | [optional] - -## Example - -```python -from lighter.models.cursor import Cursor - -# TODO update the JSON string below -json = "{}" -# create an instance of Cursor from a JSON string -cursor_instance = Cursor.from_json(json) -# print the JSON string representation of the object -print(Cursor.to_json()) - -# convert the object into a dict -cursor_dict = cursor_instance.to_dict() -# create an instance of Cursor from a dict -cursor_from_dict = Cursor.from_dict(cursor_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/Bridge.md b/docs/Deposit.md similarity index 67% rename from docs/Bridge.md rename to docs/Deposit.md index 9147bde..98550e4 100644 --- a/docs/Bridge.md +++ b/docs/Deposit.md @@ -1,12 +1,12 @@ -# Bridge +# Deposit ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | -**version** | **int** | | +**code** | **int** | | +**message** | **str** | | [optional] **source** | **str** | | **source_chain_id** | **str** | | **fast_bridge_tx_hash** | **str** | | @@ -20,23 +20,24 @@ Name | Type | Description | Notes **created_at** | **int** | | **updated_at** | **int** | | **is_external_deposit** | **bool** | | +**is_next_bridge_fast** | **bool** | | ## Example ```python -from lighter.models.bridge import Bridge +from lighter.models.deposit import Deposit # TODO update the JSON string below json = "{}" -# create an instance of Bridge from a JSON string -bridge_instance = Bridge.from_json(json) +# create an instance of Deposit from a JSON string +deposit_instance = Deposit.from_json(json) # print the JSON string representation of the object -print(Bridge.to_json()) +print(Deposit.to_json()) # convert the object into a dict -bridge_dict = bridge_instance.to_dict() -# create an instance of Bridge from a dict -bridge_from_dict = Bridge.from_dict(bridge_dict) +deposit_dict = deposit_instance.to_dict() +# create an instance of Deposit from a dict +deposit_from_dict = Deposit.from_dict(deposit_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/DepositHistoryItem.md b/docs/DepositHistoryItem.md index c046dfc..0c94c1b 100644 --- a/docs/DepositHistoryItem.md +++ b/docs/DepositHistoryItem.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | -**asset_id** | **int** | | **amount** | **str** | | **timestamp** | **int** | | **status** | **str** | | **l1_tx_hash** | **str** | | +**asset_id** | **int** | | ## Example diff --git a/docs/DetailedAccount.md b/docs/DetailedAccount.md index d3abdbb..c04f1f8 100644 --- a/docs/DetailedAccount.md +++ b/docs/DetailedAccount.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **code** | **int** | | **message** | **str** | | [optional] **account_type** | **int** | | +**account_trading_mode** | **int** | Classic=0 and Unified=1 | [optional] **index** | **int** | | **l1_address** | **str** | | **cancel_all_time** | **int** | | @@ -17,23 +18,25 @@ Name | Type | Description | Notes **available_balance** | **str** | | **status** | **int** | | **collateral** | **str** | | -**transaction_time** | **int** | | -**account_trading_mode** | **int** | | **account_index** | **int** | | **name** | **str** | | **description** | **str** | | **can_invite** | **bool** | Remove After FE uses L1 meta endpoint | **referral_points_percentage** | **str** | Remove After FE uses L1 meta endpoint | -**can_rfq** | **bool** | | -**created_at** | **int** | | **positions** | [**List[AccountPosition]**](AccountPosition.md) | | **assets** | [**List[AccountAsset]**](AccountAsset.md) | | **total_asset_value** | **str** | | **cross_asset_value** | **str** | | **pool_info** | [**PublicPoolInfo**](PublicPoolInfo.md) | | **shares** | [**List[PublicPoolShare]**](PublicPoolShare.md) | | -**pending_unlocks** | [**List[PendingUnlock]**](PendingUnlock.md) | | -**approved_integrators** | [**List[ApprovedIntegrator]**](ApprovedIntegrator.md) | | +**created_at** | **int** | | +**transaction_time** | **int** | | +**pending_unlocks** | [**List[PendingUnlock]**](PendingUnlock.md) | | [optional] +**approved_integrators** | [**List[ApprovedIntegrator]**](ApprovedIntegrator.md) | | [optional] +**can_rfq** | **bool** | | +**cross_initial_margin_requirement** | **str** | | +**cross_maintenance_margin_requirement** | **str** | | +**can_rfq_market_ids** | **List[str]** | | ## Example diff --git a/docs/DetailedAccounts.md b/docs/DetailedAccounts.md index ac4dd23..294253b 100644 --- a/docs/DetailedAccounts.md +++ b/docs/DetailedAccounts.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **message** | **str** | | [optional] **total** | **int** | | **accounts** | [**List[DetailedAccount]**](DetailedAccount.md) | | -**next_cursor** | **str** | | [optional] +**next_cursor** | **str** | | ## Example diff --git a/docs/DetailedCandlestick.md b/docs/DetailedCandlestick.md deleted file mode 100644 index f00f2e1..0000000 --- a/docs/DetailedCandlestick.md +++ /dev/null @@ -1,41 +0,0 @@ -# DetailedCandlestick - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**timestamp** | **int** | | -**open** | **float** | | -**high** | **float** | | -**low** | **float** | | -**close** | **float** | | -**open_raw** | **float** | | -**high_raw** | **float** | | -**low_raw** | **float** | | -**close_raw** | **float** | | -**volume0** | **float** | | -**volume1** | **float** | | -**last_trade_id** | **int** | | -**trade_count** | **int** | | - -## Example - -```python -from lighter.models.detailed_candlestick import DetailedCandlestick - -# TODO update the JSON string below -json = "{}" -# create an instance of DetailedCandlestick from a JSON string -detailed_candlestick_instance = DetailedCandlestick.from_json(json) -# print the JSON string representation of the object -print(DetailedCandlestick.to_json()) - -# convert the object into a dict -detailed_candlestick_dict = detailed_candlestick_instance.to_dict() -# create an instance of DetailedCandlestick from a dict -detailed_candlestick_from_dict = DetailedCandlestick.from_dict(detailed_candlestick_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/InfoApi.md b/docs/InfoApi.md index dd63e2d..2d7f3ed 100644 --- a/docs/InfoApi.md +++ b/docs/InfoApi.md @@ -4,17 +4,83 @@ All URIs are relative to *https://mainnet.zklighter.elliot.ai* Method | HTTP request | Description ------------- | ------------- | ------------- +[**layer1_basic_info**](InfoApi.md#layer1_basic_info) | **GET** /api/v1/layer1BasicInfo | layer1BasicInfo [**system_config**](InfoApi.md#system_config) | **GET** /api/v1/systemConfig | systemConfig [**transfer_fee_info**](InfoApi.md#transfer_fee_info) | **GET** /api/v1/transferFeeInfo | transferFeeInfo [**withdrawal_delay**](InfoApi.md#withdrawal_delay) | **GET** /api/v1/withdrawalDelay | withdrawalDelay +# **layer1_basic_info** +> Layer1BasicInfo layer1_basic_info() + +layer1BasicInfo + +Get zklighter l1 general info, including contract address and rpc info + +### Example + + +```python +import lighter +from lighter.models.layer1_basic_info import Layer1BasicInfo +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.InfoApi(api_client) + + try: + # layer1BasicInfo + api_response = await api_instance.layer1_basic_info() + print("The response of InfoApi->layer1_basic_info:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InfoApi->layer1_basic_info: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Layer1BasicInfo**](Layer1BasicInfo.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) + # **system_config** > SystemConfig system_config() systemConfig -Get system configuration including pool indexes and lockup/cooldown periods +Get system config ### Example @@ -75,7 +141,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **transfer_fee_info** -> TransferFeeInfo transfer_fee_info(account_index, authorization=authorization, auth=auth, to_account_index=to_account_index) +> TransferFeeInfo transfer_fee_info(authorization, account_index, to_account_index=to_account_index) transferFeeInfo @@ -101,14 +167,13 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.InfoApi(api_client) + authorization = 'authorization_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) - to_account_index = -1 # int | (optional) (default to -1) + to_account_index = 56 # int | (optional) try: # transferFeeInfo - api_response = await api_instance.transfer_fee_info(account_index, authorization=authorization, auth=auth, to_account_index=to_account_index) + api_response = await api_instance.transfer_fee_info(authorization, account_index, to_account_index=to_account_index) print("The response of InfoApi->transfer_fee_info:\n") pprint(api_response) except Exception as e: @@ -122,10 +187,9 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **account_index** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - **to_account_index** | **int**| | [optional] [default to -1] + **to_account_index** | **int**| | [optional] ### Return type diff --git a/docs/Layer1BasicInfo.md b/docs/Layer1BasicInfo.md new file mode 100644 index 0000000..91b91a1 --- /dev/null +++ b/docs/Layer1BasicInfo.md @@ -0,0 +1,37 @@ +# Layer1BasicInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**l1_providers** | [**List[L1ProviderInfo]**](L1ProviderInfo.md) | | +**l1_providers_health** | **bool** | | +**validator_info** | [**List[ValidatorInfo]**](ValidatorInfo.md) | | +**contract_addresses** | [**List[ContractAddress]**](ContractAddress.md) | | +**latest_l1_generic_block** | **int** | | +**latest_l1_governance_block** | **int** | | +**latest_l1_desert_block** | **int** | | + +## Example + +```python +from lighter.models.layer1_basic_info import Layer1BasicInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of Layer1BasicInfo from a JSON string +layer1_basic_info_instance = Layer1BasicInfo.from_json(json) +# print the JSON string representation of the object +print(Layer1BasicInfo.to_json()) + +# convert the object into a dict +layer1_basic_info_dict = layer1_basic_info_instance.to_dict() +# create an instance of Layer1BasicInfo from a dict +layer1_basic_info_from_dict = Layer1BasicInfo.from_dict(layer1_basic_info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LeaseEntry.md b/docs/LeaseEntry.md index 5c85cec..e051eb0 100644 --- a/docs/LeaseEntry.md +++ b/docs/LeaseEntry.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | | -**master_account_index** | **int** | | -**lease_amount** | **int** | | -**fee_amount** | **int** | | -**start** | **int** | | -**end** | **int** | | -**status** | **str** | | -**error** | **str** | | +**id** | **int** | Lease ID | +**master_account_index** | **int** | Master account index | +**lease_amount** | **int** | Leased LIT amount in raw units (1 LIT = 1e8) | +**fee_amount** | **int** | Fee paid in raw units | +**start** | **int** | Lease start time (Unix milliseconds) | +**end** | **int** | Lease end time (Unix milliseconds) | +**status** | **str** | Lease status | +**error** | **str** | Error message if lease was canceled | ## Example diff --git a/docs/LeaseOptionEntry.md b/docs/LeaseOptionEntry.md index 15af9a2..f276371 100644 --- a/docs/LeaseOptionEntry.md +++ b/docs/LeaseOptionEntry.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**duration_days** | **int** | | -**annual_rate** | **float** | | +**duration_days** | **int** | Lease duration in days | +**annual_rate** | **float** | Annual rate as a percentage (e.g. 25.0 means 25%) | ## Example diff --git a/docs/LiquidationInfo.md b/docs/LiquidationInfo.md index 6f388dc..5ed6deb 100644 --- a/docs/LiquidationInfo.md +++ b/docs/LiquidationInfo.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **risk_info_before** | [**RiskInfo**](RiskInfo.md) | | **risk_info_after** | [**RiskInfo**](RiskInfo.md) | | **mark_prices** | **Dict[str, float]** | | +**assets** | [**List[AccountAsset]**](AccountAsset.md) | | +**asset_index_prices** | **Dict[str, str]** | | ## Example diff --git a/docs/MarketConfig.md b/docs/MarketConfig.md index 8417308..66442d1 100644 --- a/docs/MarketConfig.md +++ b/docs/MarketConfig.md @@ -9,9 +9,10 @@ Name | Type | Description | Notes **insurance_fund_account_index** | **int** | | **liquidation_mode** | **int** | | **force_reduce_only** | **bool** | | +**funding_fee_discounts_enabled** | **bool** | | [optional] **trading_hours** | **str** | | -**funding_fee_discounts_enabled** | **bool** | | **hidden** | **bool** | | +**rfq_enabled** | **bool** | | ## Example diff --git a/docs/NotificationApi.md b/docs/NotificationApi.md index 4bdc22d..38d2daa 100644 --- a/docs/NotificationApi.md +++ b/docs/NotificationApi.md @@ -70,7 +70,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details diff --git a/docs/Order.md b/docs/Order.md index 72c269c..f05cb19 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -34,14 +34,14 @@ Name | Type | Description | Notes **to_trigger_order_id_0** | **str** | | **to_trigger_order_id_1** | **str** | | **to_cancel_order_id_0** | **str** | | -**integrator_fee_collector_index** | **str** | | -**integrator_taker_fee** | **str** | | -**integrator_maker_fee** | **str** | | **block_height** | **int** | | **timestamp** | **int** | | **created_at** | **int** | | **updated_at** | **int** | | **transaction_time** | **int** | | +**integrator_fee_collector_index** | **str** | | +**integrator_maker_fee** | **str** | | +**integrator_taker_fee** | **str** | | ## Example diff --git a/docs/OrderApi.md b/docs/OrderApi.md index 77fe83b..f5248b1 100644 --- a/docs/OrderApi.md +++ b/docs/OrderApi.md @@ -19,7 +19,7 @@ Method | HTTP request | Description # **account_active_orders** -> Orders account_active_orders(account_index, market_id, authorization=authorization, auth=auth) +> Orders account_active_orders(authorization, account_index, market_id=market_id, market_type=market_type) accountActiveOrders @@ -45,14 +45,14 @@ configuration = lighter.Configuration( 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 | account_index = 56 # int | - market_id = 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) + market_id = 56 # int | If not specified, returns active orders for all markets. (optional) + market_type = all # str | (optional) (default to all) try: # accountActiveOrders - api_response = await api_instance.account_active_orders(account_index, market_id, authorization=authorization, auth=auth) + api_response = await api_instance.account_active_orders(authorization, account_index, market_id=market_id, market_type=market_type) print("The response of OrderApi->account_active_orders:\n") pprint(api_response) except Exception as e: @@ -66,10 +66,10 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **account_index** | **int**| | - **market_id** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] + **market_id** | **int**| If not specified, returns active orders for all markets. | [optional] + **market_type** | **str**| | [optional] [default to all] ### Return type @@ -94,11 +94,11 @@ 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_inactive_orders** -> Orders account_inactive_orders(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, ask_filter=ask_filter, between_timestamps=between_timestamps, cursor=cursor) +> Orders account_inactive_orders(authorization, account_index, limit, market_id=market_id, ask_filter=ask_filter, between_timestamps=between_timestamps, cursor=cursor, market_type=market_type) accountInactiveOrders -Get account inactive orders +Get account inactive orders. `auth` can be generated using the SDK. ### Example @@ -120,18 +120,18 @@ configuration = lighter.Configuration( 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 | account_index = 56 # int | limit = 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) - market_id = 255 # int | (optional) (default to 255) - ask_filter = -1 # int | (optional) (default to -1) + market_id = 56 # int | (optional) + ask_filter = 56 # int | (optional) between_timestamps = 'between_timestamps_example' # str | (optional) cursor = 'cursor_example' # str | (optional) + market_type = all # str | (optional) (default to all) try: # accountInactiveOrders - api_response = await api_instance.account_inactive_orders(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, ask_filter=ask_filter, between_timestamps=between_timestamps, cursor=cursor) + api_response = await api_instance.account_inactive_orders(authorization, account_index, limit, market_id=market_id, ask_filter=ask_filter, between_timestamps=between_timestamps, cursor=cursor, market_type=market_type) print("The response of OrderApi->account_inactive_orders:\n") pprint(api_response) except Exception as e: @@ -145,14 +145,14 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **account_index** | **int**| | **limit** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - **market_id** | **int**| | [optional] [default to 255] - **ask_filter** | **int**| | [optional] [default to -1] + **market_id** | **int**| | [optional] + **ask_filter** | **int**| | [optional] **between_timestamps** | **str**| | [optional] **cursor** | **str**| | [optional] + **market_type** | **str**| | [optional] [default to all] ### Return type @@ -181,7 +181,7 @@ No authorization required assetDetails -Get asset details +Get asset details for a specific asset or all assets ### Example @@ -203,7 +203,7 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.OrderApi(api_client) - asset_id = 0 # int | (optional) (default to 0) + asset_id = 56 # int | (optional) try: # assetDetails @@ -221,7 +221,7 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **asset_id** | **int**| | [optional] [default to 0] + **asset_id** | **int**| | [optional] ### Return type @@ -250,7 +250,7 @@ No authorization required exchangeMetrics -Get exchange metrics +Get exchange metrics. When filtering by market, use the market symbol as a value. ### Example @@ -455,11 +455,11 @@ 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(type, authorization=authorization, auth=auth, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, end_timestamp=end_timestamp, side=side, role=role, trade_type=trade_type) +> 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) export -Export data +Export trades and funding payments, limited to 12 months or 1M trades. END_TS_IN_MS - START_TS_IN_MS should not be larger than 12 months in milliseconds, both timestamps should be greater than or equal to 17 January 2025 00:00:00 UTC (lighter's mainnet genesis) ### Example @@ -481,11 +481,10 @@ configuration = lighter.Configuration( 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 | type = 'type_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) - account_index = -1 # int | (optional) (default to -1) - market_id = 255 # int | (optional) (default to 255) + account_index = 56 # int | (optional) + market_id = 56 # int | (optional) start_timestamp = 56 # int | (optional) end_timestamp = 56 # int | (optional) side = all # str | (optional) (default to all) @@ -494,7 +493,7 @@ async with lighter.ApiClient(configuration) as api_client: try: # export - api_response = await api_instance.export(type, authorization=authorization, auth=auth, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, end_timestamp=end_timestamp, side=side, role=role, trade_type=trade_type) + 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) print("The response of OrderApi->export:\n") pprint(api_response) except Exception as e: @@ -508,11 +507,10 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **type** | **str**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - **account_index** | **int**| | [optional] [default to -1] - **market_id** | **int**| | [optional] [default to 255] + **account_index** | **int**| | [optional] + **market_id** | **int**| | [optional] **start_timestamp** | **int**| | [optional] **end_timestamp** | **int**| | [optional] **side** | **str**| | [optional] [default to all] @@ -568,8 +566,8 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.OrderApi(api_client) - market_id = 255 # int | (optional) (default to 255) - filter = all # str | (optional) (default to all) + market_id = 56 # int | (optional) + filter = all # str | Filter order books by type (optional) (default to all) try: # orderBookDetails @@ -587,8 +585,8 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **market_id** | **int**| | [optional] [default to 255] - **filter** | **str**| | [optional] [default to all] + **market_id** | **int**| | [optional] + **filter** | **str**| Filter order books by type | [optional] [default to all] ### Return type @@ -710,7 +708,7 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.OrderApi(api_client) - market_id = 255 # int | (optional) (default to 255) + market_id = 56 # int | (optional) filter = all # str | (optional) (default to all) try: @@ -729,7 +727,7 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **market_id** | **int**| | [optional] [default to 255] + **market_id** | **int**| | [optional] **filter** | **str**| | [optional] [default to all] ### Return type @@ -826,11 +824,11 @@ 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) # **trades** -> Trades trades(sort_by, limit, authorization=authorization, auth=auth, market_id=market_id, account_index=account_index, order_index=order_index, sort_dir=sort_dir, cursor=cursor, var_from=var_from, ask_filter=ask_filter, role=role, type=type, aggregate=aggregate) +> Trades trades(sort_by, limit, authorization=authorization, market_id=market_id, market_type=market_type, account_index=account_index, order_index=order_index, sort_dir=sort_dir, cursor=cursor, var_from=var_from, ask_filter=ask_filter, role=role, type=type, aggregate=aggregate, skip_ask_order_id=skip_ask_order_id, skip_bid_order_id=skip_bid_order_id) trades -Get trades +Get trades for lighter accounts, including sub-accounts and public pools. `auth` is required for master accounts and sub accounts. ### Example @@ -854,22 +852,24 @@ async with lighter.ApiClient(configuration) as api_client: api_instance = lighter.OrderApi(api_client) sort_by = 'sort_by_example' # str | limit = 56 # int | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) - market_id = 255 # int | (optional) (default to 255) - account_index = -1 # int | (optional) (default to -1) + authorization = 'authorization_example' # str | (optional) + market_id = 56 # int | (optional) + market_type = all # str | (optional) (default to all) + account_index = 56 # int | (optional) order_index = 56 # int | (optional) sort_dir = desc # str | (optional) (default to desc) cursor = 'cursor_example' # str | (optional) - var_from = -1 # int | (optional) (default to -1) - ask_filter = -1 # int | (optional) (default to -1) + var_from = 56 # int | (optional) + ask_filter = 56 # int | (optional) role = all # str | (optional) (default to all) type = all # str | (optional) (default to all) aggregate = False # bool | (optional) (default to False) + skip_ask_order_id = 'skip_ask_order_id_example' # str | (optional) + skip_bid_order_id = 'skip_bid_order_id_example' # str | (optional) try: # trades - api_response = await api_instance.trades(sort_by, limit, authorization=authorization, auth=auth, market_id=market_id, account_index=account_index, order_index=order_index, sort_dir=sort_dir, cursor=cursor, var_from=var_from, ask_filter=ask_filter, role=role, type=type, aggregate=aggregate) + api_response = await api_instance.trades(sort_by, limit, authorization=authorization, market_id=market_id, market_type=market_type, account_index=account_index, order_index=order_index, sort_dir=sort_dir, cursor=cursor, var_from=var_from, ask_filter=ask_filter, role=role, type=type, aggregate=aggregate, skip_ask_order_id=skip_ask_order_id, skip_bid_order_id=skip_bid_order_id) print("The response of OrderApi->trades:\n") pprint(api_response) except Exception as e: @@ -885,18 +885,20 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **sort_by** | **str**| | **limit** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - **market_id** | **int**| | [optional] [default to 255] - **account_index** | **int**| | [optional] [default to -1] + **authorization** | **str**| | [optional] + **market_id** | **int**| | [optional] + **market_type** | **str**| | [optional] [default to all] + **account_index** | **int**| | [optional] **order_index** | **int**| | [optional] **sort_dir** | **str**| | [optional] [default to desc] **cursor** | **str**| | [optional] - **var_from** | **int**| | [optional] [default to -1] - **ask_filter** | **int**| | [optional] [default to -1] + **var_from** | **int**| | [optional] + **ask_filter** | **int**| | [optional] **role** | **str**| | [optional] [default to all] **type** | **str**| | [optional] [default to all] **aggregate** | **bool**| | [optional] [default to False] + **skip_ask_order_id** | **str**| | [optional] + **skip_bid_order_id** | **str**| | [optional] ### Return type diff --git a/docs/OrderBook.md b/docs/OrderBook.md index 18d7edb..6a61c4d 100644 --- a/docs/OrderBook.md +++ b/docs/OrderBook.md @@ -16,10 +16,12 @@ Name | Type | Description | Notes **liquidation_fee** | **str** | | **min_base_amount** | **str** | | **min_quote_amount** | **str** | | -**order_quote_limit** | **str** | | **supported_size_decimals** | **int** | | **supported_price_decimals** | **int** | | **supported_quote_decimals** | **int** | | +**order_quote_limit** | **str** | | +**is_maker_fee_enabled** | **bool** | | +**is_taker_fee_enabled** | **bool** | | ## Example diff --git a/docs/OrderBookDepthWithBeginNonce.md b/docs/OrderBookDepthWithBeginNonce.md deleted file mode 100644 index 7a5d7a1..0000000 --- a/docs/OrderBookDepthWithBeginNonce.md +++ /dev/null @@ -1,33 +0,0 @@ -# OrderBookDepthWithBeginNonce - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**asks** | [**List[PriceLevel]**](PriceLevel.md) | | -**bids** | [**List[PriceLevel]**](PriceLevel.md) | | -**offset** | **int** | | -**nonce** | **int** | | -**begin_nonce** | **int** | | - -## Example - -```python -from lighter.models.order_book_depth_with_begin_nonce import OrderBookDepthWithBeginNonce - -# TODO update the JSON string below -json = "{}" -# create an instance of OrderBookDepthWithBeginNonce from a JSON string -order_book_depth_with_begin_nonce_instance = OrderBookDepthWithBeginNonce.from_json(json) -# print the JSON string representation of the object -print(OrderBookDepthWithBeginNonce.to_json()) - -# convert the object into a dict -order_book_depth_with_begin_nonce_dict = order_book_depth_with_begin_nonce_instance.to_dict() -# create an instance of OrderBookDepthWithBeginNonce from a dict -order_book_depth_with_begin_nonce_from_dict = OrderBookDepthWithBeginNonce.from_dict(order_book_depth_with_begin_nonce_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PerpsMarketStats.md b/docs/PerpsMarketStats.md deleted file mode 100644 index bd2ed7b..0000000 --- a/docs/PerpsMarketStats.md +++ /dev/null @@ -1,45 +0,0 @@ -# PerpsMarketStats - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**symbol** | **str** | | -**market_id** | **int** | | -**index_price** | **str** | | -**mark_price** | **str** | | -**open_interest** | **str** | | -**open_interest_limit** | **str** | | -**funding_clamp_small** | **str** | | -**funding_clamp_big** | **str** | | -**last_trade_price** | **str** | | -**current_funding_rate** | **str** | | -**funding_rate** | **str** | | -**funding_timestamp** | **int** | | -**daily_base_token_volume** | **float** | | -**daily_quote_token_volume** | **float** | | -**daily_price_low** | **float** | | -**daily_price_high** | **float** | | -**daily_price_change** | **float** | | - -## Example - -```python -from lighter.models.perps_market_stats import PerpsMarketStats - -# TODO update the JSON string below -json = "{}" -# create an instance of PerpsMarketStats from a JSON string -perps_market_stats_instance = PerpsMarketStats.from_json(json) -# print the JSON string representation of the object -print(PerpsMarketStats.to_json()) - -# convert the object into a dict -perps_market_stats_dict = perps_market_stats_instance.to_dict() -# create an instance of PerpsMarketStats from a dict -perps_market_stats_from_dict = PerpsMarketStats.from_dict(perps_market_stats_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PerpsOrderBookDetail.md b/docs/PerpsOrderBookDetail.md index ba0ed8d..05cc799 100644 --- a/docs/PerpsOrderBookDetail.md +++ b/docs/PerpsOrderBookDetail.md @@ -16,10 +16,10 @@ Name | Type | Description | Notes **liquidation_fee** | **str** | | **min_base_amount** | **str** | | **min_quote_amount** | **str** | | -**order_quote_limit** | **str** | | **supported_size_decimals** | **int** | | **supported_price_decimals** | **int** | | **supported_quote_decimals** | **int** | | +**order_quote_limit** | **str** | | **size_decimals** | **int** | | **price_decimals** | **int** | | **quote_multiplier** | **int** | | @@ -38,6 +38,11 @@ Name | Type | Description | Notes **daily_chart** | **Dict[str, float]** | | **market_config** | [**MarketConfig**](MarketConfig.md) | | **strategy_index** | **int** | | +**is_maker_fee_enabled** | **bool** | | +**is_taker_fee_enabled** | **bool** | | +**funding_clamp_small** | **str** | | +**funding_clamp_big** | **str** | | +**base_interest_rate** | **str** | | ## Example diff --git a/docs/PnLEntry.md b/docs/PnLEntry.md index 3c9019d..246ee57 100644 --- a/docs/PnLEntry.md +++ b/docs/PnLEntry.md @@ -7,19 +7,20 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **timestamp** | **int** | | **trade_pnl** | **float** | | -**trade_spot_pnl** | **float** | | **inflow** | **float** | | **outflow** | **float** | | -**spot_outflow** | **float** | | -**spot_inflow** | **float** | | **pool_pnl** | **float** | | **pool_inflow** | **float** | | **pool_outflow** | **float** | | -**staking_pnl** | **float** | | -**staking_inflow** | **float** | | -**staking_outflow** | **float** | | **pool_total_shares** | **float** | | +**spot_inflow** | **float** | | +**spot_outflow** | **float** | | **staked_lit** | **float** | | +**staking_inflow** | **float** | | +**staking_outflow** | **float** | | +**staking_pnl** | **float** | | +**trade_spot_pnl** | **float** | | +**volume** | **float** | | ## Example diff --git a/docs/PositionFunding.md b/docs/PositionFunding.md index 1a2f584..7079869 100644 --- a/docs/PositionFunding.md +++ b/docs/PositionFunding.md @@ -9,10 +9,10 @@ Name | Type | Description | Notes **market_id** | **int** | | **funding_id** | **int** | | **change** | **str** | | +**discount** | **str** | | **rate** | **str** | | **position_size** | **str** | | **position_side** | **str** | | -**discount** | **str** | | ## Example diff --git a/docs/PublicPoolInfo.md b/docs/PublicPoolInfo.md index 5ab4114..15e2b39 100644 --- a/docs/PublicPoolInfo.md +++ b/docs/PublicPoolInfo.md @@ -11,9 +11,9 @@ Name | Type | Description | Notes **total_shares** | **int** | | **operator_shares** | **int** | | **annual_percentage_yield** | **float** | | -**sharpe_ratio** | **float** | | **daily_returns** | [**List[DailyReturn]**](DailyReturn.md) | | **share_prices** | [**List[SharePrice]**](SharePrice.md) | | +**sharpe_ratio** | **float** | | **strategies** | [**List[Strategy]**](Strategy.md) | | ## Example diff --git a/docs/PublicPoolMetadata.md b/docs/PublicPoolMetadata.md index e5c0f61..8cf999d 100644 --- a/docs/PublicPoolMetadata.md +++ b/docs/PublicPoolMetadata.md @@ -8,21 +8,21 @@ Name | Type | Description | Notes **code** | **int** | | **message** | **str** | | [optional] **account_index** | **int** | | -**created_at** | **int** | | -**master_account_index** | **int** | | **account_type** | **int** | | **name** | **str** | | **l1_address** | **str** | | **annual_percentage_yield** | **float** | | -**sharpe_ratio** | **float** | | **status** | **int** | | **operator_fee** | **str** | | **total_asset_value** | **str** | | -**total_spot_value** | **str** | | -**total_perps_value** | **str** | | **total_shares** | **int** | | **account_share** | [**PublicPoolShare**](PublicPoolShare.md) | | [optional] **assets** | [**List[AccountAsset]**](AccountAsset.md) | | +**created_at** | **int** | | +**master_account_index** | **int** | | +**sharpe_ratio** | **float** | | +**total_perps_value** | **str** | | +**total_spot_value** | **str** | | ## Example diff --git a/docs/PublicPoolShare.md b/docs/PublicPoolShare.md index 15d62d5..73b9a53 100644 --- a/docs/PublicPoolShare.md +++ b/docs/PublicPoolShare.md @@ -7,9 +7,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **public_pool_index** | **int** | | **shares_amount** | **int** | | -**entry_usdc** | **str** | For public pools and insurance fund | -**principal_amount** | **str** | | +**entry_usdc** | **str** | | **entry_timestamp** | **int** | | +**principal_amount** | **str** | | ## Example diff --git a/docs/PushNotifDeliveryResult.md b/docs/PushNotifDeliveryResult.md deleted file mode 100644 index 66d82f3..0000000 --- a/docs/PushNotifDeliveryResult.md +++ /dev/null @@ -1,31 +0,0 @@ -# PushNotifDeliveryResult - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expo_token** | **str** | | -**status** | **str** | | -**error** | **str** | | - -## Example - -```python -from lighter.models.push_notif_delivery_result import PushNotifDeliveryResult - -# TODO update the JSON string below -json = "{}" -# create an instance of PushNotifDeliveryResult from a JSON string -push_notif_delivery_result_instance = PushNotifDeliveryResult.from_json(json) -# print the JSON string representation of the object -print(PushNotifDeliveryResult.to_json()) - -# convert the object into a dict -push_notif_delivery_result_dict = push_notif_delivery_result_instance.to_dict() -# create an instance of PushNotifDeliveryResult from a dict -push_notif_delivery_result_from_dict = PushNotifDeliveryResult.from_dict(push_notif_delivery_result_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/PushnotifApi.md b/docs/PushnotifApi.md deleted file mode 100644 index 74b6aa2..0000000 --- a/docs/PushnotifApi.md +++ /dev/null @@ -1,312 +0,0 @@ -# lighter.PushnotifApi - -All URIs are relative to *https://mainnet.zklighter.elliot.ai* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_pushnotif_settings**](PushnotifApi.md#get_pushnotif_settings) | **GET** /api/v1/pushnotif/settings | get_pushnotif_settings -[**post_pushnotif_settings**](PushnotifApi.md#post_pushnotif_settings) | **POST** /api/v1/pushnotif/settings | post_pushnotif_settings -[**pushnotif_register**](PushnotifApi.md#pushnotif_register) | **POST** /api/v1/pushnotif/register | pushnotif_register -[**pushnotif_unregister**](PushnotifApi.md#pushnotif_unregister) | **POST** /api/v1/pushnotif/unregister | pushnotif_unregister - - -# **get_pushnotif_settings** -> RespGetPushNotifSettings get_pushnotif_settings(account_index, expo_token, authorization=authorization, auth=auth) - -get_pushnotif_settings - -Get push notification settings - -### Example - - -```python -import lighter -from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.PushnotifApi(api_client) - account_index = 56 # int | - expo_token = 'expo_token_example' # str | - authorization = 'authorization_example' # str | make required after integ is done (optional) - auth = 'auth_example' # str | made optional to support header auth clients (optional) - - try: - # get_pushnotif_settings - api_response = await api_instance.get_pushnotif_settings(account_index, expo_token, authorization=authorization, auth=auth) - print("The response of PushnotifApi->get_pushnotif_settings:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling PushnotifApi->get_pushnotif_settings: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **account_index** | **int**| | - **expo_token** | **str**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] - -### Return type - -[**RespGetPushNotifSettings**](RespGetPushNotifSettings.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **post_pushnotif_settings** -> ResultCode post_pushnotif_settings(account_index, expo_token, enabled, auth=auth) - -post_pushnotif_settings - -Update push notification settings - -### Example - - -```python -import lighter -from lighter.models.result_code import ResultCode -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.PushnotifApi(api_client) - account_index = 56 # int | - expo_token = 'expo_token_example' # str | - enabled = True # bool | - auth = 'auth_example' # str | made optional to support header auth clients (optional) - - try: - # post_pushnotif_settings - api_response = await api_instance.post_pushnotif_settings(account_index, expo_token, enabled, auth=auth) - print("The response of PushnotifApi->post_pushnotif_settings:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling PushnotifApi->post_pushnotif_settings: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **account_index** | **int**| | - **expo_token** | **str**| | - **enabled** | **bool**| | - **auth** | **str**| made optional to support header auth clients | [optional] - -### Return type - -[**ResultCode**](ResultCode.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **pushnotif_register** -> ResultCode pushnotif_register(account_index, expo_token, platform, auth=auth, app_version=app_version) - -pushnotif_register - -Register device for push notifications - -### Example - - -```python -import lighter -from lighter.models.result_code import ResultCode -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.PushnotifApi(api_client) - account_index = 56 # int | - expo_token = 'expo_token_example' # str | - platform = 'platform_example' # str | - auth = 'auth_example' # str | made optional to support header auth clients (optional) - app_version = 'app_version_example' # str | (optional) - - try: - # pushnotif_register - api_response = await api_instance.pushnotif_register(account_index, expo_token, platform, auth=auth, app_version=app_version) - print("The response of PushnotifApi->pushnotif_register:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling PushnotifApi->pushnotif_register: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **account_index** | **int**| | - **expo_token** | **str**| | - **platform** | **str**| | - **auth** | **str**| made optional to support header auth clients | [optional] - **app_version** | **str**| | [optional] - -### Return type - -[**ResultCode**](ResultCode.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **pushnotif_unregister** -> ResultCode pushnotif_unregister(account_index, expo_token, auth=auth) - -pushnotif_unregister - -Unregister device from push notifications - -### Example - - -```python -import lighter -from lighter.models.result_code import ResultCode -from lighter.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai -# See configuration.py for a list of all supported configuration parameters. -configuration = lighter.Configuration( - host = "https://mainnet.zklighter.elliot.ai" -) - - -# Enter a context with an instance of the API client -async with lighter.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = lighter.PushnotifApi(api_client) - account_index = 56 # int | - expo_token = 'expo_token_example' # str | - auth = 'auth_example' # str | made optional to support header auth clients (optional) - - try: - # pushnotif_unregister - api_response = await api_instance.pushnotif_unregister(account_index, expo_token, auth=auth) - print("The response of PushnotifApi->pushnotif_unregister:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling PushnotifApi->pushnotif_unregister: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **account_index** | **int**| | - **expo_token** | **str**| | - **auth** | **str**| made optional to support header auth clients | [optional] - -### Return type - -[**ResultCode**](ResultCode.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | A successful response. | - | -**400** | Bad request | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/Referral.md b/docs/Referral.md index 35fa907..0f8b27b 100644 --- a/docs/Referral.md +++ b/docs/Referral.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **referral_code** | **str** | | **used_at** | **int** | | **trade_stats** | [**TradeStats**](TradeStats.md) | | +**tier** | **str** | | ## Example diff --git a/docs/ReferralApi.md b/docs/ReferralApi.md index 7195a2f..389e7fd 100644 --- a/docs/ReferralApi.md +++ b/docs/ReferralApi.md @@ -4,22 +4,394 @@ All URIs are relative to *https://mainnet.zklighter.elliot.ai* Method | HTTP request | Description ------------- | ------------- | ------------- -[**referral_user_referrals**](ReferralApi.md#referral_user_referrals) | **GET** /api/v1/referral/userReferrals | referral_userReferrals +[**referral_create**](ReferralApi.md#referral_create) | **POST** /api/v1/referral/create | referral_create +[**referral_get**](ReferralApi.md#referral_get) | **GET** /api/v1/referral/get | referral_get +[**referral_kickback_update**](ReferralApi.md#referral_kickback_update) | **POST** /api/v1/referral/kickback/update | referral_kickback_update +[**referral_points**](ReferralApi.md#referral_points) | **GET** /api/v1/referral/points | referral_points +[**referral_update**](ReferralApi.md#referral_update) | **POST** /api/v1/referral/update | referral_update +[**referral_use**](ReferralApi.md#referral_use) | **POST** /api/v1/referral/use | referral_use -# **referral_user_referrals** -> UserReferrals referral_user_referrals(l1_address, authorization=authorization, auth=auth, cursor=cursor) +# **referral_create** +> ReferralCode referral_create(account_index, authorization=authorization, auth=auth) -referral_userReferrals +referral_create -Get user referrals +Create referral code ### Example ```python import lighter -from lighter.models.user_referrals import UserReferrals +from lighter.models.referral_code import ReferralCode +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.ReferralApi(api_client) + account_index = 56 # int | + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # referral_create + api_response = await api_instance.referral_create(account_index, authorization=authorization, auth=auth) + print("The response of ReferralApi->referral_create:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReferralApi->referral_create: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + +### Return type + +[**ReferralCode**](ReferralCode.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **referral_get** +> ReferralCode referral_get(account_index, authorization=authorization, auth=auth) + +referral_get + +Get referral code + +### Example + + +```python +import lighter +from lighter.models.referral_code import ReferralCode +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.ReferralApi(api_client) + account_index = 56 # int | + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # referral_get + api_response = await api_instance.referral_get(account_index, authorization=authorization, auth=auth) + print("The response of ReferralApi->referral_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReferralApi->referral_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + +### Return type + +[**ReferralCode**](ReferralCode.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **referral_kickback_update** +> RespUpdateKickback referral_kickback_update(account_index, kickback_percentage, authorization=authorization, auth=auth) + +referral_kickback_update + +Update kickback percentage for referral rewards (allowed once per day) + +### Example + + +```python +import lighter +from lighter.models.resp_update_kickback import RespUpdateKickback +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.ReferralApi(api_client) + account_index = 56 # int | + kickback_percentage = 3.4 # float | + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # referral_kickback_update + api_response = await api_instance.referral_kickback_update(account_index, kickback_percentage, authorization=authorization, auth=auth) + print("The response of ReferralApi->referral_kickback_update:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReferralApi->referral_kickback_update: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **kickback_percentage** | **float**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + +### Return type + +[**RespUpdateKickback**](RespUpdateKickback.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **referral_points** +> ReferralPoints referral_points(authorization, account_index) + +referral_points + +Get referral points + +### Example + + +```python +import lighter +from lighter.models.referral_points import ReferralPoints +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.ReferralApi(api_client) + authorization = 'authorization_example' # str | + account_index = 56 # int | + + try: + # referral_points + api_response = await api_instance.referral_points(authorization, account_index) + print("The response of ReferralApi->referral_points:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReferralApi->referral_points: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | + **account_index** | **int**| | + +### Return type + +[**ReferralPoints**](ReferralPoints.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **referral_update** +> RespUpdateReferralCode referral_update(account_index, new_referral_code, authorization=authorization, auth=auth) + +referral_update + +Update referral code (allowed once per account) + +### Example + + +```python +import lighter +from lighter.models.resp_update_referral_code import RespUpdateReferralCode +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.ReferralApi(api_client) + account_index = 56 # int | + new_referral_code = 'new_referral_code_example' # str | + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # referral_update + api_response = await api_instance.referral_update(account_index, new_referral_code, authorization=authorization, auth=auth) + print("The response of ReferralApi->referral_update:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ReferralApi->referral_update: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **new_referral_code** | **str**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + +### Return type + +[**RespUpdateReferralCode**](RespUpdateReferralCode.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **referral_use** +> ResultCode referral_use(l1_address, referral_code, x, authorization=authorization, auth=auth, discord=discord, telegram=telegram, signature=signature) + +referral_use + +Use a referral code. You can change this at a later time. + +### Example + + +```python +import lighter +from lighter.models.result_code import ResultCode from lighter.rest import ApiException from pprint import pprint @@ -35,17 +407,21 @@ async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.ReferralApi(api_client) l1_address = 'l1_address_example' # str | - authorization = 'authorization_example' # str | (optional) - auth = 'auth_example' # str | (optional) - cursor = 'cursor_example' # str | (optional) + 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) + discord = 'discord_example' # str | (optional) + telegram = 'telegram_example' # str | (optional) + signature = 'signature_example' # str | (optional) try: - # referral_userReferrals - api_response = await api_instance.referral_user_referrals(l1_address, authorization=authorization, auth=auth, cursor=cursor) - print("The response of ReferralApi->referral_user_referrals:\n") + # referral_use + api_response = await api_instance.referral_use(l1_address, referral_code, x, authorization=authorization, auth=auth, discord=discord, telegram=telegram, signature=signature) + print("The response of ReferralApi->referral_use:\n") pprint(api_response) except Exception as e: - print("Exception when calling ReferralApi->referral_user_referrals: %s\n" % e) + print("Exception when calling ReferralApi->referral_use: %s\n" % e) ``` @@ -56,13 +432,17 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **l1_address** | **str**| | - **authorization** | **str**| | [optional] - **auth** | **str**| | [optional] - **cursor** | **str**| | [optional] + **referral_code** | **str**| | + **x** | **str**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + **discord** | **str**| | [optional] + **telegram** | **str**| | [optional] + **signature** | **str**| | [optional] ### Return type -[**UserReferrals**](UserReferrals.md) +[**ResultCode**](ResultCode.md) ### Authorization @@ -70,7 +450,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details diff --git a/docs/ReferralCode.md b/docs/ReferralCode.md new file mode 100644 index 0000000..4bcf6d7 --- /dev/null +++ b/docs/ReferralCode.md @@ -0,0 +1,32 @@ +# ReferralCode + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**referral_code** | **str** | | +**remaining_usage** | **int** | | + +## Example + +```python +from lighter.models.referral_code import ReferralCode + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferralCode from a JSON string +referral_code_instance = ReferralCode.from_json(json) +# print the JSON string representation of the object +print(ReferralCode.to_json()) + +# convert the object into a dict +referral_code_dict = referral_code_instance.to_dict() +# create an instance of ReferralCode from a dict +referral_code_from_dict = ReferralCode.from_dict(referral_code_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReferralPointEntry.md b/docs/ReferralPointEntry.md new file mode 100644 index 0000000..359a2eb --- /dev/null +++ b/docs/ReferralPointEntry.md @@ -0,0 +1,34 @@ +# ReferralPointEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**l1_address** | **str** | | +**total_points** | **float** | | +**week_points** | **float** | | +**total_reward_points** | **float** | | +**week_reward_points** | **float** | | +**reward_point_multiplier** | **str** | | + +## Example + +```python +from lighter.models.referral_point_entry import ReferralPointEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferralPointEntry from a JSON string +referral_point_entry_instance = ReferralPointEntry.from_json(json) +# print the JSON string representation of the object +print(ReferralPointEntry.to_json()) + +# convert the object into a dict +referral_point_entry_dict = referral_point_entry_instance.to_dict() +# create an instance of ReferralPointEntry from a dict +referral_point_entry_from_dict = ReferralPointEntry.from_dict(referral_point_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReferralPoints.md b/docs/ReferralPoints.md new file mode 100644 index 0000000..4235fa6 --- /dev/null +++ b/docs/ReferralPoints.md @@ -0,0 +1,34 @@ +# ReferralPoints + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**referrals** | [**List[ReferralPointEntry]**](ReferralPointEntry.md) | | +**user_total_points** | **float** | | +**user_last_week_points** | **float** | | +**user_total_referral_reward_points** | **float** | | +**user_last_week_referral_reward_points** | **float** | | +**reward_point_multiplier** | **str** | | + +## Example + +```python +from lighter.models.referral_points import ReferralPoints + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferralPoints from a JSON string +referral_points_instance = ReferralPoints.from_json(json) +# print the JSON string representation of the object +print(ReferralPoints.to_json()) + +# convert the object into a dict +referral_points_dict = referral_points_instance.to_dict() +# create an instance of ReferralPoints from a dict +referral_points_from_dict = ReferralPoints.from_dict(referral_points_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ReqDoFaucet.md b/docs/ReqDoFaucet.md deleted file mode 100644 index 75bdd3b..0000000 --- a/docs/ReqDoFaucet.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqDoFaucet - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**l1_address** | **str** | | -**do_l1_transfer** | **bool** | | [default to False] - -## Example - -```python -from lighter.models.req_do_faucet import ReqDoFaucet - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqDoFaucet from a JSON string -req_do_faucet_instance = ReqDoFaucet.from_json(json) -# print the JSON string representation of the object -print(ReqDoFaucet.to_json()) - -# convert the object into a dict -req_do_faucet_dict = req_do_faucet_instance.to_dict() -# create an instance of ReqDoFaucet from a dict -req_do_faucet_from_dict = ReqDoFaucet.from_dict(req_do_faucet_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqExportData.md b/docs/ReqExportData.md deleted file mode 100644 index 8ecd9d4..0000000 --- a/docs/ReqExportData.md +++ /dev/null @@ -1,37 +0,0 @@ -# ReqExportData - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | [optional] [default to -1] -**market_id** | **int** | | [optional] -**type** | **str** | | -**start_timestamp** | **int** | | [optional] -**end_timestamp** | **int** | | [optional] -**side** | **str** | | [optional] [default to 'all'] -**role** | **str** | | [optional] [default to 'all'] -**trade_type** | **str** | | [optional] [default to 'all'] - -## Example - -```python -from lighter.models.req_export_data import ReqExportData - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqExportData from a JSON string -req_export_data_instance = ReqExportData.from_json(json) -# print the JSON string representation of the object -print(ReqExportData.to_json()) - -# convert the object into a dict -req_export_data_dict = req_export_data_instance.to_dict() -# create an instance of ReqExportData from a dict -req_export_data_from_dict = ReqExportData.from_dict(req_export_data_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/ReqGetAccount.md b/docs/ReqGetAccount.md deleted file mode 100644 index 492d423..0000000 --- a/docs/ReqGetAccount.md +++ /dev/null @@ -1,32 +0,0 @@ -# ReqGetAccount - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**by** | **str** | | -**value** | **str** | | -**active_only** | **bool** | | [optional] [default to False] -**cursor** | **str** | | [optional] - -## Example - -```python -from lighter.models.req_get_account import ReqGetAccount - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAccount from a JSON string -req_get_account_instance = ReqGetAccount.from_json(json) -# print the JSON string representation of the object -print(ReqGetAccount.to_json()) - -# convert the object into a dict -req_get_account_dict = req_get_account_instance.to_dict() -# create an instance of ReqGetAccount from a dict -req_get_account_from_dict = ReqGetAccount.from_dict(req_get_account_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/ReqGetAccountActiveOrders.md b/docs/ReqGetAccountActiveOrders.md deleted file mode 100644 index 9900779..0000000 --- a/docs/ReqGetAccountActiveOrders.md +++ /dev/null @@ -1,31 +0,0 @@ -# ReqGetAccountActiveOrders - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**market_id** | **int** | | - -## Example - -```python -from lighter.models.req_get_account_active_orders import ReqGetAccountActiveOrders - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAccountActiveOrders from a JSON string -req_get_account_active_orders_instance = ReqGetAccountActiveOrders.from_json(json) -# print the JSON string representation of the object -print(ReqGetAccountActiveOrders.to_json()) - -# convert the object into a dict -req_get_account_active_orders_dict = req_get_account_active_orders_instance.to_dict() -# create an instance of ReqGetAccountActiveOrders from a dict -req_get_account_active_orders_from_dict = ReqGetAccountActiveOrders.from_dict(req_get_account_active_orders_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/ReqGetAccountApiKeys.md b/docs/ReqGetAccountApiKeys.md deleted file mode 100644 index 6f3ceaa..0000000 --- a/docs/ReqGetAccountApiKeys.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetAccountApiKeys - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**account_index** | **int** | | -**api_key_index** | **int** | | [optional] - -## Example - -```python -from lighter.models.req_get_account_api_keys import ReqGetAccountApiKeys - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAccountApiKeys from a JSON string -req_get_account_api_keys_instance = ReqGetAccountApiKeys.from_json(json) -# print the JSON string representation of the object -print(ReqGetAccountApiKeys.to_json()) - -# convert the object into a dict -req_get_account_api_keys_dict = req_get_account_api_keys_instance.to_dict() -# create an instance of ReqGetAccountApiKeys from a dict -req_get_account_api_keys_from_dict = ReqGetAccountApiKeys.from_dict(req_get_account_api_keys_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/ReqGetAccountByL1Address.md b/docs/ReqGetAccountByL1Address.md deleted file mode 100644 index cd76093..0000000 --- a/docs/ReqGetAccountByL1Address.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetAccountByL1Address - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**l1_address** | **str** | | -**cursor** | **str** | | [optional] - -## Example - -```python -from lighter.models.req_get_account_by_l1_address import ReqGetAccountByL1Address - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAccountByL1Address from a JSON string -req_get_account_by_l1_address_instance = ReqGetAccountByL1Address.from_json(json) -# print the JSON string representation of the object -print(ReqGetAccountByL1Address.to_json()) - -# convert the object into a dict -req_get_account_by_l1_address_dict = req_get_account_by_l1_address_instance.to_dict() -# create an instance of ReqGetAccountByL1Address from a dict -req_get_account_by_l1_address_from_dict = ReqGetAccountByL1Address.from_dict(req_get_account_by_l1_address_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/ReqGetAccountInactiveOrders.md b/docs/ReqGetAccountInactiveOrders.md deleted file mode 100644 index d23b114..0000000 --- a/docs/ReqGetAccountInactiveOrders.md +++ /dev/null @@ -1,35 +0,0 @@ -# ReqGetAccountInactiveOrders - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**market_id** | **int** | | [optional] -**ask_filter** | **int** | | [optional] -**between_timestamps** | **str** | | [optional] -**cursor** | **str** | | [optional] -**limit** | **int** | | - -## Example - -```python -from lighter.models.req_get_account_inactive_orders import ReqGetAccountInactiveOrders - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAccountInactiveOrders from a JSON string -req_get_account_inactive_orders_instance = ReqGetAccountInactiveOrders.from_json(json) -# print the JSON string representation of the object -print(ReqGetAccountInactiveOrders.to_json()) - -# convert the object into a dict -req_get_account_inactive_orders_dict = req_get_account_inactive_orders_instance.to_dict() -# create an instance of ReqGetAccountInactiveOrders from a dict -req_get_account_inactive_orders_from_dict = ReqGetAccountInactiveOrders.from_dict(req_get_account_inactive_orders_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/ReqGetAccountLimits.md b/docs/ReqGetAccountLimits.md deleted file mode 100644 index 9459c9e..0000000 --- a/docs/ReqGetAccountLimits.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetAccountLimits - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**account_index** | **int** | | -**auth** | **str** | made optional to support header auth clients | [optional] - -## Example - -```python -from lighter.models.req_get_account_limits import ReqGetAccountLimits - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAccountLimits from a JSON string -req_get_account_limits_instance = ReqGetAccountLimits.from_json(json) -# print the JSON string representation of the object -print(ReqGetAccountLimits.to_json()) - -# convert the object into a dict -req_get_account_limits_dict = req_get_account_limits_instance.to_dict() -# create an instance of ReqGetAccountLimits from a dict -req_get_account_limits_from_dict = ReqGetAccountLimits.from_dict(req_get_account_limits_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/ReqGetAccountMetadata.md b/docs/ReqGetAccountMetadata.md deleted file mode 100644 index 8bad7c0..0000000 --- a/docs/ReqGetAccountMetadata.md +++ /dev/null @@ -1,32 +0,0 @@ -# ReqGetAccountMetadata - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**by** | **str** | | -**value** | **str** | | -**auth** | **str** | | [optional] -**cursor** | **str** | | [optional] - -## Example - -```python -from lighter.models.req_get_account_metadata import ReqGetAccountMetadata - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAccountMetadata from a JSON string -req_get_account_metadata_instance = ReqGetAccountMetadata.from_json(json) -# print the JSON string representation of the object -print(ReqGetAccountMetadata.to_json()) - -# convert the object into a dict -req_get_account_metadata_dict = req_get_account_metadata_instance.to_dict() -# create an instance of ReqGetAccountMetadata from a dict -req_get_account_metadata_from_dict = ReqGetAccountMetadata.from_dict(req_get_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/ReqGetAccountPnL.md b/docs/ReqGetAccountPnL.md deleted file mode 100644 index 77233f8..0000000 --- a/docs/ReqGetAccountPnL.md +++ /dev/null @@ -1,36 +0,0 @@ -# ReqGetAccountPnL - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**by** | **str** | | -**value** | **str** | | -**resolution** | **str** | | -**start_timestamp** | **int** | | -**end_timestamp** | **int** | | -**count_back** | **int** | | -**ignore_transfers** | **bool** | | [optional] [default to False] - -## Example - -```python -from lighter.models.req_get_account_pn_l import ReqGetAccountPnL - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAccountPnL from a JSON string -req_get_account_pn_l_instance = ReqGetAccountPnL.from_json(json) -# print the JSON string representation of the object -print(ReqGetAccountPnL.to_json()) - -# convert the object into a dict -req_get_account_pn_l_dict = req_get_account_pn_l_instance.to_dict() -# create an instance of ReqGetAccountPnL from a dict -req_get_account_pn_l_from_dict = ReqGetAccountPnL.from_dict(req_get_account_pn_l_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/ReqGetAccountTxs.md b/docs/ReqGetAccountTxs.md deleted file mode 100644 index 0072602..0000000 --- a/docs/ReqGetAccountTxs.md +++ /dev/null @@ -1,34 +0,0 @@ -# ReqGetAccountTxs - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**index** | **int** | | [optional] -**limit** | **int** | | [optional] -**by** | **str** | | [optional] -**value** | **str** | | [optional] -**auth** | **str** | made optional to support header auth clients | [optional] -**types** | **List[int]** | | [optional] - -## Example - -```python -from lighter.models.req_get_account_txs import ReqGetAccountTxs - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAccountTxs from a JSON string -req_get_account_txs_instance = ReqGetAccountTxs.from_json(json) -# print the JSON string representation of the object -print(ReqGetAccountTxs.to_json()) - -# convert the object into a dict -req_get_account_txs_dict = req_get_account_txs_instance.to_dict() -# create an instance of ReqGetAccountTxs from a dict -req_get_account_txs_from_dict = ReqGetAccountTxs.from_dict(req_get_account_txs_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/ReqGetApiTokens.md b/docs/ReqGetApiTokens.md deleted file mode 100644 index 7dc459b..0000000 --- a/docs/ReqGetApiTokens.md +++ /dev/null @@ -1,29 +0,0 @@ -# ReqGetApiTokens - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**account_index** | **int** | | - -## Example - -```python -from lighter.models.req_get_api_tokens import ReqGetApiTokens - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetApiTokens from a JSON string -req_get_api_tokens_instance = ReqGetApiTokens.from_json(json) -# print the JSON string representation of the object -print(ReqGetApiTokens.to_json()) - -# convert the object into a dict -req_get_api_tokens_dict = req_get_api_tokens_instance.to_dict() -# create an instance of ReqGetApiTokens from a dict -req_get_api_tokens_from_dict = ReqGetApiTokens.from_dict(req_get_api_tokens_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetAssetDetails.md b/docs/ReqGetAssetDetails.md deleted file mode 100644 index ee1e39d..0000000 --- a/docs/ReqGetAssetDetails.md +++ /dev/null @@ -1,29 +0,0 @@ -# ReqGetAssetDetails - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**asset_id** | **int** | | [optional] - -## Example - -```python -from lighter.models.req_get_asset_details import ReqGetAssetDetails - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetAssetDetails from a JSON string -req_get_asset_details_instance = ReqGetAssetDetails.from_json(json) -# print the JSON string representation of the object -print(ReqGetAssetDetails.to_json()) - -# convert the object into a dict -req_get_asset_details_dict = req_get_asset_details_instance.to_dict() -# create an instance of ReqGetAssetDetails from a dict -req_get_asset_details_from_dict = ReqGetAssetDetails.from_dict(req_get_asset_details_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/ReqGetBlock.md b/docs/ReqGetBlock.md deleted file mode 100644 index 3fdd4d2..0000000 --- a/docs/ReqGetBlock.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetBlock - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**by** | **str** | | -**value** | **str** | | - -## Example - -```python -from lighter.models.req_get_block import ReqGetBlock - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetBlock from a JSON string -req_get_block_instance = ReqGetBlock.from_json(json) -# print the JSON string representation of the object -print(ReqGetBlock.to_json()) - -# convert the object into a dict -req_get_block_dict = req_get_block_instance.to_dict() -# create an instance of ReqGetBlock from a dict -req_get_block_from_dict = ReqGetBlock.from_dict(req_get_block_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetBlockTxs.md b/docs/ReqGetBlockTxs.md deleted file mode 100644 index 0a8af03..0000000 --- a/docs/ReqGetBlockTxs.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetBlockTxs - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**by** | **str** | | -**value** | **str** | | - -## Example - -```python -from lighter.models.req_get_block_txs import ReqGetBlockTxs - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetBlockTxs from a JSON string -req_get_block_txs_instance = ReqGetBlockTxs.from_json(json) -# print the JSON string representation of the object -print(ReqGetBlockTxs.to_json()) - -# convert the object into a dict -req_get_block_txs_dict = req_get_block_txs_instance.to_dict() -# create an instance of ReqGetBlockTxs from a dict -req_get_block_txs_from_dict = ReqGetBlockTxs.from_dict(req_get_block_txs_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/ReqGetBridgesByL1Addr.md b/docs/ReqGetBridgesByL1Addr.md deleted file mode 100644 index a06ef98..0000000 --- a/docs/ReqGetBridgesByL1Addr.md +++ /dev/null @@ -1,29 +0,0 @@ -# ReqGetBridgesByL1Addr - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**l1_address** | **str** | | - -## Example - -```python -from lighter.models.req_get_bridges_by_l1_addr import ReqGetBridgesByL1Addr - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetBridgesByL1Addr from a JSON string -req_get_bridges_by_l1_addr_instance = ReqGetBridgesByL1Addr.from_json(json) -# print the JSON string representation of the object -print(ReqGetBridgesByL1Addr.to_json()) - -# convert the object into a dict -req_get_bridges_by_l1_addr_dict = req_get_bridges_by_l1_addr_instance.to_dict() -# create an instance of ReqGetBridgesByL1Addr from a dict -req_get_bridges_by_l1_addr_from_dict = ReqGetBridgesByL1Addr.from_dict(req_get_bridges_by_l1_addr_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/ReqGetByAccount.md b/docs/ReqGetByAccount.md deleted file mode 100644 index 701b6cc..0000000 --- a/docs/ReqGetByAccount.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetByAccount - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**by** | **str** | | -**value** | **str** | | - -## Example - -```python -from lighter.models.req_get_by_account import ReqGetByAccount - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetByAccount from a JSON string -req_get_by_account_instance = ReqGetByAccount.from_json(json) -# print the JSON string representation of the object -print(ReqGetByAccount.to_json()) - -# convert the object into a dict -req_get_by_account_dict = req_get_by_account_instance.to_dict() -# create an instance of ReqGetByAccount from a dict -req_get_by_account_from_dict = ReqGetByAccount.from_dict(req_get_by_account_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/ReqGetCandles.md b/docs/ReqGetCandles.md deleted file mode 100644 index 830834d..0000000 --- a/docs/ReqGetCandles.md +++ /dev/null @@ -1,34 +0,0 @@ -# ReqGetCandles - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**market_id** | **int** | | -**resolution** | **str** | | -**start_timestamp** | **int** | | -**end_timestamp** | **int** | | -**count_back** | **int** | | -**set_timestamp_to_end** | **bool** | | [optional] [default to False] - -## Example - -```python -from lighter.models.req_get_candles import ReqGetCandles - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetCandles from a JSON string -req_get_candles_instance = ReqGetCandles.from_json(json) -# print the JSON string representation of the object -print(ReqGetCandles.to_json()) - -# convert the object into a dict -req_get_candles_dict = req_get_candles_instance.to_dict() -# create an instance of ReqGetCandles from a dict -req_get_candles_from_dict = ReqGetCandles.from_dict(req_get_candles_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetDepositHistory.md b/docs/ReqGetDepositHistory.md deleted file mode 100644 index 37fccdc..0000000 --- a/docs/ReqGetDepositHistory.md +++ /dev/null @@ -1,33 +0,0 @@ -# ReqGetDepositHistory - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**l1_address** | **str** | | -**cursor** | **str** | | [optional] -**filter** | **str** | | [optional] - -## Example - -```python -from lighter.models.req_get_deposit_history import ReqGetDepositHistory - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetDepositHistory from a JSON string -req_get_deposit_history_instance = ReqGetDepositHistory.from_json(json) -# print the JSON string representation of the object -print(ReqGetDepositHistory.to_json()) - -# convert the object into a dict -req_get_deposit_history_dict = req_get_deposit_history_instance.to_dict() -# create an instance of ReqGetDepositHistory from a dict -req_get_deposit_history_from_dict = ReqGetDepositHistory.from_dict(req_get_deposit_history_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/ReqGetExchangeMetrics.md b/docs/ReqGetExchangeMetrics.md deleted file mode 100644 index d9a63c4..0000000 --- a/docs/ReqGetExchangeMetrics.md +++ /dev/null @@ -1,32 +0,0 @@ -# ReqGetExchangeMetrics - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**period** | **str** | | -**kind** | **str** | | -**filter** | **str** | | [optional] -**value** | **str** | | [optional] - -## Example - -```python -from lighter.models.req_get_exchange_metrics import ReqGetExchangeMetrics - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetExchangeMetrics from a JSON string -req_get_exchange_metrics_instance = ReqGetExchangeMetrics.from_json(json) -# print the JSON string representation of the object -print(ReqGetExchangeMetrics.to_json()) - -# convert the object into a dict -req_get_exchange_metrics_dict = req_get_exchange_metrics_instance.to_dict() -# create an instance of ReqGetExchangeMetrics from a dict -req_get_exchange_metrics_from_dict = ReqGetExchangeMetrics.from_dict(req_get_exchange_metrics_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetExecuteStats.md b/docs/ReqGetExecuteStats.md deleted file mode 100644 index 3678a12..0000000 --- a/docs/ReqGetExecuteStats.md +++ /dev/null @@ -1,29 +0,0 @@ -# ReqGetExecuteStats - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**period** | **str** | | - -## Example - -```python -from lighter.models.req_get_execute_stats import ReqGetExecuteStats - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetExecuteStats from a JSON string -req_get_execute_stats_instance = ReqGetExecuteStats.from_json(json) -# print the JSON string representation of the object -print(ReqGetExecuteStats.to_json()) - -# convert the object into a dict -req_get_execute_stats_dict = req_get_execute_stats_instance.to_dict() -# create an instance of ReqGetExecuteStats from a dict -req_get_execute_stats_from_dict = ReqGetExecuteStats.from_dict(req_get_execute_stats_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetFastWithdrawInfo.md b/docs/ReqGetFastWithdrawInfo.md deleted file mode 100644 index ce0a224..0000000 --- a/docs/ReqGetFastWithdrawInfo.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetFastWithdrawInfo - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | - -## Example - -```python -from lighter.models.req_get_fast_withdraw_info import ReqGetFastWithdrawInfo - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetFastWithdrawInfo from a JSON string -req_get_fast_withdraw_info_instance = ReqGetFastWithdrawInfo.from_json(json) -# print the JSON string representation of the object -print(ReqGetFastWithdrawInfo.to_json()) - -# convert the object into a dict -req_get_fast_withdraw_info_dict = req_get_fast_withdraw_info_instance.to_dict() -# create an instance of ReqGetFastWithdrawInfo from a dict -req_get_fast_withdraw_info_from_dict = ReqGetFastWithdrawInfo.from_dict(req_get_fast_withdraw_info_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetFundings.md b/docs/ReqGetFundings.md deleted file mode 100644 index 32f6baa..0000000 --- a/docs/ReqGetFundings.md +++ /dev/null @@ -1,33 +0,0 @@ -# ReqGetFundings - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**market_id** | **int** | | -**resolution** | **str** | | -**start_timestamp** | **int** | | -**end_timestamp** | **int** | | -**count_back** | **int** | | - -## Example - -```python -from lighter.models.req_get_fundings import ReqGetFundings - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetFundings from a JSON string -req_get_fundings_instance = ReqGetFundings.from_json(json) -# print the JSON string representation of the object -print(ReqGetFundings.to_json()) - -# convert the object into a dict -req_get_fundings_dict = req_get_fundings_instance.to_dict() -# create an instance of ReqGetFundings from a dict -req_get_fundings_from_dict = ReqGetFundings.from_dict(req_get_fundings_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/ReqGetL1Metadata.md b/docs/ReqGetL1Metadata.md deleted file mode 100644 index e66cc76..0000000 --- a/docs/ReqGetL1Metadata.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetL1Metadata - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**l1_address** | **str** | | - -## Example - -```python -from lighter.models.req_get_l1_metadata import ReqGetL1Metadata - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetL1Metadata from a JSON string -req_get_l1_metadata_instance = ReqGetL1Metadata.from_json(json) -# print the JSON string representation of the object -print(ReqGetL1Metadata.to_json()) - -# convert the object into a dict -req_get_l1_metadata_dict = req_get_l1_metadata_instance.to_dict() -# create an instance of ReqGetL1Metadata from a dict -req_get_l1_metadata_from_dict = ReqGetL1Metadata.from_dict(req_get_l1_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/ReqGetL1Tx.md b/docs/ReqGetL1Tx.md deleted file mode 100644 index 3b722c7..0000000 --- a/docs/ReqGetL1Tx.md +++ /dev/null @@ -1,29 +0,0 @@ -# ReqGetL1Tx - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hash** | **str** | | - -## Example - -```python -from lighter.models.req_get_l1_tx import ReqGetL1Tx - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetL1Tx from a JSON string -req_get_l1_tx_instance = ReqGetL1Tx.from_json(json) -# print the JSON string representation of the object -print(ReqGetL1Tx.to_json()) - -# convert the object into a dict -req_get_l1_tx_dict = req_get_l1_tx_instance.to_dict() -# create an instance of ReqGetL1Tx from a dict -req_get_l1_tx_from_dict = ReqGetL1Tx.from_dict(req_get_l1_tx_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetLatestDeposit.md b/docs/ReqGetLatestDeposit.md deleted file mode 100644 index 1d84f65..0000000 --- a/docs/ReqGetLatestDeposit.md +++ /dev/null @@ -1,29 +0,0 @@ -# ReqGetLatestDeposit - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**l1_address** | **str** | | - -## Example - -```python -from lighter.models.req_get_latest_deposit import ReqGetLatestDeposit - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetLatestDeposit from a JSON string -req_get_latest_deposit_instance = ReqGetLatestDeposit.from_json(json) -# print the JSON string representation of the object -print(ReqGetLatestDeposit.to_json()) - -# convert the object into a dict -req_get_latest_deposit_dict = req_get_latest_deposit_instance.to_dict() -# create an instance of ReqGetLatestDeposit from a dict -req_get_latest_deposit_from_dict = ReqGetLatestDeposit.from_dict(req_get_latest_deposit_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetLeases.md b/docs/ReqGetLeases.md deleted file mode 100644 index 013a7f9..0000000 --- a/docs/ReqGetLeases.md +++ /dev/null @@ -1,32 +0,0 @@ -# ReqGetLeases - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**cursor** | **str** | | [optional] -**limit** | **int** | | [optional] [default to 20] - -## Example - -```python -from lighter.models.req_get_leases import ReqGetLeases - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetLeases from a JSON string -req_get_leases_instance = ReqGetLeases.from_json(json) -# print the JSON string representation of the object -print(ReqGetLeases.to_json()) - -# convert the object into a dict -req_get_leases_dict = req_get_leases_instance.to_dict() -# create an instance of ReqGetLeases from a dict -req_get_leases_from_dict = ReqGetLeases.from_dict(req_get_leases_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetLiquidationInfos.md b/docs/ReqGetLiquidationInfos.md deleted file mode 100644 index 20e45af..0000000 --- a/docs/ReqGetLiquidationInfos.md +++ /dev/null @@ -1,33 +0,0 @@ -# ReqGetLiquidationInfos - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**market_id** | **int** | | [optional] -**cursor** | **str** | | [optional] -**limit** | **int** | | - -## Example - -```python -from lighter.models.req_get_liquidation_infos import ReqGetLiquidationInfos - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetLiquidationInfos from a JSON string -req_get_liquidation_infos_instance = ReqGetLiquidationInfos.from_json(json) -# print the JSON string representation of the object -print(ReqGetLiquidationInfos.to_json()) - -# convert the object into a dict -req_get_liquidation_infos_dict = req_get_liquidation_infos_instance.to_dict() -# create an instance of ReqGetLiquidationInfos from a dict -req_get_liquidation_infos_from_dict = ReqGetLiquidationInfos.from_dict(req_get_liquidation_infos_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/ReqGetMakerOnlyApiKeys.md b/docs/ReqGetMakerOnlyApiKeys.md deleted file mode 100644 index fd7de11..0000000 --- a/docs/ReqGetMakerOnlyApiKeys.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetMakerOnlyApiKeys - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | | [optional] -**account_index** | **int** | | - -## Example - -```python -from lighter.models.req_get_maker_only_api_keys import ReqGetMakerOnlyApiKeys - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetMakerOnlyApiKeys from a JSON string -req_get_maker_only_api_keys_instance = ReqGetMakerOnlyApiKeys.from_json(json) -# print the JSON string representation of the object -print(ReqGetMakerOnlyApiKeys.to_json()) - -# convert the object into a dict -req_get_maker_only_api_keys_dict = req_get_maker_only_api_keys_instance.to_dict() -# create an instance of ReqGetMakerOnlyApiKeys from a dict -req_get_maker_only_api_keys_from_dict = ReqGetMakerOnlyApiKeys.from_dict(req_get_maker_only_api_keys_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/ReqGetNextNonce.md b/docs/ReqGetNextNonce.md deleted file mode 100644 index b421d91..0000000 --- a/docs/ReqGetNextNonce.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetNextNonce - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**account_index** | **int** | | -**api_key_index** | **int** | | - -## Example - -```python -from lighter.models.req_get_next_nonce import ReqGetNextNonce - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetNextNonce from a JSON string -req_get_next_nonce_instance = ReqGetNextNonce.from_json(json) -# print the JSON string representation of the object -print(ReqGetNextNonce.to_json()) - -# convert the object into a dict -req_get_next_nonce_dict = req_get_next_nonce_instance.to_dict() -# create an instance of ReqGetNextNonce from a dict -req_get_next_nonce_from_dict = ReqGetNextNonce.from_dict(req_get_next_nonce_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetOrderBookDetails.md b/docs/ReqGetOrderBookDetails.md deleted file mode 100644 index 81d1cf8..0000000 --- a/docs/ReqGetOrderBookDetails.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetOrderBookDetails - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**market_id** | **int** | | [optional] -**filter** | **str** | | [optional] [default to 'all'] - -## Example - -```python -from lighter.models.req_get_order_book_details import ReqGetOrderBookDetails - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetOrderBookDetails from a JSON string -req_get_order_book_details_instance = ReqGetOrderBookDetails.from_json(json) -# print the JSON string representation of the object -print(ReqGetOrderBookDetails.to_json()) - -# convert the object into a dict -req_get_order_book_details_dict = req_get_order_book_details_instance.to_dict() -# create an instance of ReqGetOrderBookDetails from a dict -req_get_order_book_details_from_dict = ReqGetOrderBookDetails.from_dict(req_get_order_book_details_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/ReqGetOrderBookOrders.md b/docs/ReqGetOrderBookOrders.md deleted file mode 100644 index 7f543eb..0000000 --- a/docs/ReqGetOrderBookOrders.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetOrderBookOrders - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**market_id** | **int** | | -**limit** | **int** | | - -## Example - -```python -from lighter.models.req_get_order_book_orders import ReqGetOrderBookOrders - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetOrderBookOrders from a JSON string -req_get_order_book_orders_instance = ReqGetOrderBookOrders.from_json(json) -# print the JSON string representation of the object -print(ReqGetOrderBookOrders.to_json()) - -# convert the object into a dict -req_get_order_book_orders_dict = req_get_order_book_orders_instance.to_dict() -# create an instance of ReqGetOrderBookOrders from a dict -req_get_order_book_orders_from_dict = ReqGetOrderBookOrders.from_dict(req_get_order_book_orders_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/ReqGetOrderBooks.md b/docs/ReqGetOrderBooks.md deleted file mode 100644 index 0b89605..0000000 --- a/docs/ReqGetOrderBooks.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetOrderBooks - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**market_id** | **int** | | [optional] -**filter** | **str** | | [optional] [default to 'all'] - -## Example - -```python -from lighter.models.req_get_order_books import ReqGetOrderBooks - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetOrderBooks from a JSON string -req_get_order_books_instance = ReqGetOrderBooks.from_json(json) -# print the JSON string representation of the object -print(ReqGetOrderBooks.to_json()) - -# convert the object into a dict -req_get_order_books_dict = req_get_order_books_instance.to_dict() -# create an instance of ReqGetOrderBooks from a dict -req_get_order_books_from_dict = ReqGetOrderBooks.from_dict(req_get_order_books_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/ReqGetPartnerStats.md b/docs/ReqGetPartnerStats.md deleted file mode 100644 index e4f0a77..0000000 --- a/docs/ReqGetPartnerStats.md +++ /dev/null @@ -1,31 +0,0 @@ -# ReqGetPartnerStats - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**account_index** | **int** | | -**start_timestamp** | **int** | | [optional] -**end_timestamp** | **int** | | [optional] - -## Example - -```python -from lighter.models.req_get_partner_stats import ReqGetPartnerStats - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetPartnerStats from a JSON string -req_get_partner_stats_instance = ReqGetPartnerStats.from_json(json) -# print the JSON string representation of the object -print(ReqGetPartnerStats.to_json()) - -# convert the object into a dict -req_get_partner_stats_dict = req_get_partner_stats_instance.to_dict() -# create an instance of ReqGetPartnerStats from a dict -req_get_partner_stats_from_dict = ReqGetPartnerStats.from_dict(req_get_partner_stats_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetPositionFunding.md b/docs/ReqGetPositionFunding.md deleted file mode 100644 index af72ef1..0000000 --- a/docs/ReqGetPositionFunding.md +++ /dev/null @@ -1,34 +0,0 @@ -# ReqGetPositionFunding - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**market_id** | **int** | | [optional] -**cursor** | **str** | | [optional] -**limit** | **int** | | -**side** | **str** | | [optional] [default to 'all'] - -## Example - -```python -from lighter.models.req_get_position_funding import ReqGetPositionFunding - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetPositionFunding from a JSON string -req_get_position_funding_instance = ReqGetPositionFunding.from_json(json) -# print the JSON string representation of the object -print(ReqGetPositionFunding.to_json()) - -# convert the object into a dict -req_get_position_funding_dict = req_get_position_funding_instance.to_dict() -# create an instance of ReqGetPositionFunding from a dict -req_get_position_funding_from_dict = ReqGetPositionFunding.from_dict(req_get_position_funding_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/ReqGetPublicPoolsMetadata.md b/docs/ReqGetPublicPoolsMetadata.md deleted file mode 100644 index b1cc952..0000000 --- a/docs/ReqGetPublicPoolsMetadata.md +++ /dev/null @@ -1,33 +0,0 @@ -# ReqGetPublicPoolsMetadata - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**filter** | **str** | | [optional] -**index** | **int** | | -**limit** | **int** | | -**account_index** | **int** | | [optional] - -## Example - -```python -from lighter.models.req_get_public_pools_metadata import ReqGetPublicPoolsMetadata - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetPublicPoolsMetadata from a JSON string -req_get_public_pools_metadata_instance = ReqGetPublicPoolsMetadata.from_json(json) -# print the JSON string representation of the object -print(ReqGetPublicPoolsMetadata.to_json()) - -# convert the object into a dict -req_get_public_pools_metadata_dict = req_get_public_pools_metadata_instance.to_dict() -# create an instance of ReqGetPublicPoolsMetadata from a dict -req_get_public_pools_metadata_from_dict = ReqGetPublicPoolsMetadata.from_dict(req_get_public_pools_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/ReqGetPushNotifSettings.md b/docs/ReqGetPushNotifSettings.md deleted file mode 100644 index 72d08dd..0000000 --- a/docs/ReqGetPushNotifSettings.md +++ /dev/null @@ -1,31 +0,0 @@ -# ReqGetPushNotifSettings - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**expo_token** | **str** | | - -## Example - -```python -from lighter.models.req_get_push_notif_settings import ReqGetPushNotifSettings - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetPushNotifSettings from a JSON string -req_get_push_notif_settings_instance = ReqGetPushNotifSettings.from_json(json) -# print the JSON string representation of the object -print(ReqGetPushNotifSettings.to_json()) - -# convert the object into a dict -req_get_push_notif_settings_dict = req_get_push_notif_settings_instance.to_dict() -# create an instance of ReqGetPushNotifSettings from a dict -req_get_push_notif_settings_from_dict = ReqGetPushNotifSettings.from_dict(req_get_push_notif_settings_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetRangeWithCursor.md b/docs/ReqGetRangeWithCursor.md deleted file mode 100644 index 9fd0055..0000000 --- a/docs/ReqGetRangeWithCursor.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetRangeWithCursor - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cursor** | **str** | | [optional] -**limit** | **int** | | - -## Example - -```python -from lighter.models.req_get_range_with_cursor import ReqGetRangeWithCursor - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetRangeWithCursor from a JSON string -req_get_range_with_cursor_instance = ReqGetRangeWithCursor.from_json(json) -# print the JSON string representation of the object -print(ReqGetRangeWithCursor.to_json()) - -# convert the object into a dict -req_get_range_with_cursor_dict = req_get_range_with_cursor_instance.to_dict() -# create an instance of ReqGetRangeWithCursor from a dict -req_get_range_with_cursor_from_dict = ReqGetRangeWithCursor.from_dict(req_get_range_with_cursor_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/ReqGetRangeWithIndex.md b/docs/ReqGetRangeWithIndex.md deleted file mode 100644 index b195dd5..0000000 --- a/docs/ReqGetRangeWithIndex.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetRangeWithIndex - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**index** | **int** | | [optional] -**limit** | **int** | | - -## Example - -```python -from lighter.models.req_get_range_with_index import ReqGetRangeWithIndex - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetRangeWithIndex from a JSON string -req_get_range_with_index_instance = ReqGetRangeWithIndex.from_json(json) -# print the JSON string representation of the object -print(ReqGetRangeWithIndex.to_json()) - -# convert the object into a dict -req_get_range_with_index_dict = req_get_range_with_index_instance.to_dict() -# create an instance of ReqGetRangeWithIndex from a dict -req_get_range_with_index_from_dict = ReqGetRangeWithIndex.from_dict(req_get_range_with_index_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/ReqGetRangeWithIndexSortable.md b/docs/ReqGetRangeWithIndexSortable.md deleted file mode 100644 index e4f2c72..0000000 --- a/docs/ReqGetRangeWithIndexSortable.md +++ /dev/null @@ -1,31 +0,0 @@ -# ReqGetRangeWithIndexSortable - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**index** | **int** | | [optional] -**limit** | **int** | | [optional] -**sort** | **str** | | [optional] [default to 'asc'] - -## Example - -```python -from lighter.models.req_get_range_with_index_sortable import ReqGetRangeWithIndexSortable - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetRangeWithIndexSortable from a JSON string -req_get_range_with_index_sortable_instance = ReqGetRangeWithIndexSortable.from_json(json) -# print the JSON string representation of the object -print(ReqGetRangeWithIndexSortable.to_json()) - -# convert the object into a dict -req_get_range_with_index_sortable_dict = req_get_range_with_index_sortable_instance.to_dict() -# create an instance of ReqGetRangeWithIndexSortable from a dict -req_get_range_with_index_sortable_from_dict = ReqGetRangeWithIndexSortable.from_dict(req_get_range_with_index_sortable_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/ReqGetRecentTrades.md b/docs/ReqGetRecentTrades.md deleted file mode 100644 index e96aac5..0000000 --- a/docs/ReqGetRecentTrades.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetRecentTrades - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**market_id** | **int** | | -**limit** | **int** | | - -## Example - -```python -from lighter.models.req_get_recent_trades import ReqGetRecentTrades - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetRecentTrades from a JSON string -req_get_recent_trades_instance = ReqGetRecentTrades.from_json(json) -# print the JSON string representation of the object -print(ReqGetRecentTrades.to_json()) - -# convert the object into a dict -req_get_recent_trades_dict = req_get_recent_trades_instance.to_dict() -# create an instance of ReqGetRecentTrades from a dict -req_get_recent_trades_from_dict = ReqGetRecentTrades.from_dict(req_get_recent_trades_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetTrades.md b/docs/ReqGetTrades.md deleted file mode 100644 index 6ec8aad..0000000 --- a/docs/ReqGetTrades.md +++ /dev/null @@ -1,41 +0,0 @@ -# ReqGetTrades - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**market_id** | **int** | | [optional] -**account_index** | **int** | | [optional] [default to -1] -**order_index** | **int** | | [optional] -**sort_by** | **str** | | -**sort_dir** | **str** | | [optional] [default to 'desc'] -**cursor** | **str** | | [optional] -**var_from** | **int** | | [optional] [default to -1] -**ask_filter** | **int** | | [optional] -**role** | **str** | | [optional] [default to 'all'] -**type** | **str** | | [optional] [default to 'all'] -**limit** | **int** | | -**aggregate** | **bool** | | [optional] [default to False] - -## Example - -```python -from lighter.models.req_get_trades import ReqGetTrades - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetTrades from a JSON string -req_get_trades_instance = ReqGetTrades.from_json(json) -# print the JSON string representation of the object -print(ReqGetTrades.to_json()) - -# convert the object into a dict -req_get_trades_dict = req_get_trades_instance.to_dict() -# create an instance of ReqGetTrades from a dict -req_get_trades_from_dict = ReqGetTrades.from_dict(req_get_trades_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/ReqGetTransferFeeInfo.md b/docs/ReqGetTransferFeeInfo.md deleted file mode 100644 index 4715488..0000000 --- a/docs/ReqGetTransferFeeInfo.md +++ /dev/null @@ -1,31 +0,0 @@ -# ReqGetTransferFeeInfo - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**to_account_index** | **int** | | [optional] [default to -1] - -## Example - -```python -from lighter.models.req_get_transfer_fee_info import ReqGetTransferFeeInfo - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetTransferFeeInfo from a JSON string -req_get_transfer_fee_info_instance = ReqGetTransferFeeInfo.from_json(json) -# print the JSON string representation of the object -print(ReqGetTransferFeeInfo.to_json()) - -# convert the object into a dict -req_get_transfer_fee_info_dict = req_get_transfer_fee_info_instance.to_dict() -# create an instance of ReqGetTransferFeeInfo from a dict -req_get_transfer_fee_info_from_dict = ReqGetTransferFeeInfo.from_dict(req_get_transfer_fee_info_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetTransferHistory.md b/docs/ReqGetTransferHistory.md deleted file mode 100644 index 181e5c9..0000000 --- a/docs/ReqGetTransferHistory.md +++ /dev/null @@ -1,32 +0,0 @@ -# ReqGetTransferHistory - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**cursor** | **str** | | [optional] -**type** | **List[str]** | | [optional] - -## Example - -```python -from lighter.models.req_get_transfer_history import ReqGetTransferHistory - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetTransferHistory from a JSON string -req_get_transfer_history_instance = ReqGetTransferHistory.from_json(json) -# print the JSON string representation of the object -print(ReqGetTransferHistory.to_json()) - -# convert the object into a dict -req_get_transfer_history_dict = req_get_transfer_history_instance.to_dict() -# create an instance of ReqGetTransferHistory from a dict -req_get_transfer_history_from_dict = ReqGetTransferHistory.from_dict(req_get_transfer_history_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/ReqGetTx.md b/docs/ReqGetTx.md deleted file mode 100644 index 52a83e1..0000000 --- a/docs/ReqGetTx.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReqGetTx - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**by** | **str** | | -**value** | **str** | | - -## Example - -```python -from lighter.models.req_get_tx import ReqGetTx - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetTx from a JSON string -req_get_tx_instance = ReqGetTx.from_json(json) -# print the JSON string representation of the object -print(ReqGetTx.to_json()) - -# convert the object into a dict -req_get_tx_dict = req_get_tx_instance.to_dict() -# create an instance of ReqGetTx from a dict -req_get_tx_from_dict = ReqGetTx.from_dict(req_get_tx_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetUserReferrals.md b/docs/ReqGetUserReferrals.md deleted file mode 100644 index 45cb2bf..0000000 --- a/docs/ReqGetUserReferrals.md +++ /dev/null @@ -1,31 +0,0 @@ -# ReqGetUserReferrals - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | | [optional] -**l1_address** | **str** | | -**cursor** | **str** | | [optional] - -## Example - -```python -from lighter.models.req_get_user_referrals import ReqGetUserReferrals - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetUserReferrals from a JSON string -req_get_user_referrals_instance = ReqGetUserReferrals.from_json(json) -# print the JSON string representation of the object -print(ReqGetUserReferrals.to_json()) - -# convert the object into a dict -req_get_user_referrals_dict = req_get_user_referrals_instance.to_dict() -# create an instance of ReqGetUserReferrals from a dict -req_get_user_referrals_from_dict = ReqGetUserReferrals.from_dict(req_get_user_referrals_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReqGetWithdrawHistory.md b/docs/ReqGetWithdrawHistory.md deleted file mode 100644 index 65c6485..0000000 --- a/docs/ReqGetWithdrawHistory.md +++ /dev/null @@ -1,32 +0,0 @@ -# ReqGetWithdrawHistory - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth** | **str** | made optional to support header auth clients | [optional] -**account_index** | **int** | | -**cursor** | **str** | | [optional] -**filter** | **str** | | [optional] - -## Example - -```python -from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory - -# TODO update the JSON string below -json = "{}" -# create an instance of ReqGetWithdrawHistory from a JSON string -req_get_withdraw_history_instance = ReqGetWithdrawHistory.from_json(json) -# print the JSON string representation of the object -print(ReqGetWithdrawHistory.to_json()) - -# convert the object into a dict -req_get_withdraw_history_dict = req_get_withdraw_history_instance.to_dict() -# create an instance of ReqGetWithdrawHistory from a dict -req_get_withdraw_history_from_dict = ReqGetWithdrawHistory.from_dict(req_get_withdraw_history_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 new file mode 100644 index 0000000..62756e9 --- /dev/null +++ b/docs/ReqSetAccountMetadata.md @@ -0,0 +1,33 @@ +# ReqSetAccountMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**master_account_index** | **int** | | +**target_account_index** | **int** | | +**api_key_index** | **int** | | +**metadata** | **str** | | +**auth** | **str** | | [optional] + +## Example + +```python +from lighter.models.req_set_account_metadata import ReqSetAccountMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of ReqSetAccountMetadata from a JSON string +req_set_account_metadata_instance = ReqSetAccountMetadata.from_json(json) +# print the JSON string representation of the object +print(ReqSetAccountMetadata.to_json()) + +# convert the object into a dict +req_set_account_metadata_dict = req_set_account_metadata_instance.to_dict() +# create an instance of ReqSetAccountMetadata from a dict +req_set_account_metadata_from_dict = ReqSetAccountMetadata.from_dict(req_set_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/RespGetBridgesByL1Addr.md b/docs/RespGetBridgesByL1Addr.md deleted file mode 100644 index 3d797bd..0000000 --- a/docs/RespGetBridgesByL1Addr.md +++ /dev/null @@ -1,31 +0,0 @@ -# RespGetBridgesByL1Addr - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | -**message** | **str** | | [optional] -**bridges** | [**List[Bridge]**](Bridge.md) | | - -## Example - -```python -from lighter.models.resp_get_bridges_by_l1_addr import RespGetBridgesByL1Addr - -# TODO update the JSON string below -json = "{}" -# create an instance of RespGetBridgesByL1Addr from a JSON string -resp_get_bridges_by_l1_addr_instance = RespGetBridgesByL1Addr.from_json(json) -# print the JSON string representation of the object -print(RespGetBridgesByL1Addr.to_json()) - -# convert the object into a dict -resp_get_bridges_by_l1_addr_dict = resp_get_bridges_by_l1_addr_instance.to_dict() -# create an instance of RespGetBridgesByL1Addr from a dict -resp_get_bridges_by_l1_addr_from_dict = RespGetBridgesByL1Addr.from_dict(resp_get_bridges_by_l1_addr_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/RespGetIsNextBridgeFast.md b/docs/RespGetIsNextBridgeFast.md deleted file mode 100644 index 09ccf87..0000000 --- a/docs/RespGetIsNextBridgeFast.md +++ /dev/null @@ -1,31 +0,0 @@ -# RespGetIsNextBridgeFast - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | -**message** | **str** | | [optional] -**is_next_bridge_fast** | **bool** | | - -## Example - -```python -from lighter.models.resp_get_is_next_bridge_fast import RespGetIsNextBridgeFast - -# TODO update the JSON string below -json = "{}" -# create an instance of RespGetIsNextBridgeFast from a JSON string -resp_get_is_next_bridge_fast_instance = RespGetIsNextBridgeFast.from_json(json) -# print the JSON string representation of the object -print(RespGetIsNextBridgeFast.to_json()) - -# convert the object into a dict -resp_get_is_next_bridge_fast_dict = resp_get_is_next_bridge_fast_instance.to_dict() -# create an instance of RespGetIsNextBridgeFast from a dict -resp_get_is_next_bridge_fast_from_dict = RespGetIsNextBridgeFast.from_dict(resp_get_is_next_bridge_fast_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RespGetLeaseOptions.md b/docs/RespGetLeaseOptions.md index 8a85584..9cb5568 100644 --- a/docs/RespGetLeaseOptions.md +++ b/docs/RespGetLeaseOptions.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **code** | **int** | | **message** | **str** | | [optional] **options** | [**List[LeaseOptionEntry]**](LeaseOptionEntry.md) | | -**lit_incentives_account_index** | **int** | | +**lit_incentives_account_index** | **int** | Account index that receives the leasing fee | ## Example diff --git a/docs/RespGetLeases.md b/docs/RespGetLeases.md index b1c16e9..f06c330 100644 --- a/docs/RespGetLeases.md +++ b/docs/RespGetLeases.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **code** | **int** | | **message** | **str** | | [optional] **leases** | [**List[LeaseEntry]**](LeaseEntry.md) | | -**next_cursor** | **str** | | [optional] +**next_cursor** | **str** | Cursor to pass as the cursor param to fetch the next page. Absent if no more pages. | [optional] ## Example diff --git a/docs/RespGetMakerOnlyApiKeys.md b/docs/RespGetMakerOnlyApiKeys.md index 9256257..dd37f64 100644 --- a/docs/RespGetMakerOnlyApiKeys.md +++ b/docs/RespGetMakerOnlyApiKeys.md @@ -3,10 +3,10 @@ ## Properties -Name | Type | Description | Notes ------------- |---------------| ------------- | ------------- -**code** | **int** | | -**message** | **str** | | [optional] +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] **api_key_indexes** | **List[int]** | | ## Example diff --git a/docs/RespGetPushNotifSettings.md b/docs/RespGetPushNotifSettings.md deleted file mode 100644 index ece0eb8..0000000 --- a/docs/RespGetPushNotifSettings.md +++ /dev/null @@ -1,32 +0,0 @@ -# RespGetPushNotifSettings - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | -**message** | **str** | | [optional] -**account_index** | **int** | | -**enabled** | **bool** | | - -## Example - -```python -from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings - -# TODO update the JSON string below -json = "{}" -# create an instance of RespGetPushNotifSettings from a JSON string -resp_get_push_notif_settings_instance = RespGetPushNotifSettings.from_json(json) -# print the JSON string representation of the object -print(RespGetPushNotifSettings.to_json()) - -# convert the object into a dict -resp_get_push_notif_settings_dict = resp_get_push_notif_settings_instance.to_dict() -# create an instance of RespGetPushNotifSettings from a dict -resp_get_push_notif_settings_from_dict = RespGetPushNotifSettings.from_dict(resp_get_push_notif_settings_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RespUpdateKickback.md b/docs/RespUpdateKickback.md new file mode 100644 index 0000000..db81414 --- /dev/null +++ b/docs/RespUpdateKickback.md @@ -0,0 +1,31 @@ +# RespUpdateKickback + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**success** | **bool** | | + +## Example + +```python +from lighter.models.resp_update_kickback import RespUpdateKickback + +# TODO update the JSON string below +json = "{}" +# create an instance of RespUpdateKickback from a JSON string +resp_update_kickback_instance = RespUpdateKickback.from_json(json) +# print the JSON string representation of the object +print(RespUpdateKickback.to_json()) + +# convert the object into a dict +resp_update_kickback_dict = resp_update_kickback_instance.to_dict() +# create an instance of RespUpdateKickback from a dict +resp_update_kickback_from_dict = RespUpdateKickback.from_dict(resp_update_kickback_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RespUpdateReferralCode.md b/docs/RespUpdateReferralCode.md new file mode 100644 index 0000000..0579638 --- /dev/null +++ b/docs/RespUpdateReferralCode.md @@ -0,0 +1,31 @@ +# RespUpdateReferralCode + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**success** | **bool** | | + +## Example + +```python +from lighter.models.resp_update_referral_code import RespUpdateReferralCode + +# TODO update the JSON string below +json = "{}" +# create an instance of RespUpdateReferralCode from a JSON string +resp_update_referral_code_instance = RespUpdateReferralCode.from_json(json) +# print the JSON string representation of the object +print(RespUpdateReferralCode.to_json()) + +# convert the object into a dict +resp_update_referral_code_dict = resp_update_referral_code_instance.to_dict() +# create an instance of RespUpdateReferralCode from a dict +resp_update_referral_code_from_dict = RespUpdateReferralCode.from_dict(resp_update_referral_code_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RiskParameters.md b/docs/RiskParameters.md index 26f9e61..8c93fe4 100644 --- a/docs/RiskParameters.md +++ b/docs/RiskParameters.md @@ -11,6 +11,9 @@ Name | Type | Description | Notes **initial_margin_req** | **str** | | **maintenance_margin_req** | **str** | | **close_out_margin_req** | **str** | | +**total_account_liquidation_threshold** | **str** | | +**usdc_collateral_with_funding** | **str** | | +**usdc_portfolio_value** | **str** | | ## Example diff --git a/docs/SpotAvgEntryPrice.md b/docs/SpotAvgEntryPrice.md deleted file mode 100644 index db9830c..0000000 --- a/docs/SpotAvgEntryPrice.md +++ /dev/null @@ -1,32 +0,0 @@ -# SpotAvgEntryPrice - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**asset_id** | **int** | | -**avg_entry_price** | **str** | | -**asset_size** | **str** | | -**last_trade_id** | **int** | | - -## Example - -```python -from lighter.models.spot_avg_entry_price import SpotAvgEntryPrice - -# TODO update the JSON string below -json = "{}" -# create an instance of SpotAvgEntryPrice from a JSON string -spot_avg_entry_price_instance = SpotAvgEntryPrice.from_json(json) -# print the JSON string representation of the object -print(SpotAvgEntryPrice.to_json()) - -# convert the object into a dict -spot_avg_entry_price_dict = spot_avg_entry_price_instance.to_dict() -# create an instance of SpotAvgEntryPrice from a dict -spot_avg_entry_price_from_dict = SpotAvgEntryPrice.from_dict(spot_avg_entry_price_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SpotMarketStats.md b/docs/SpotMarketStats.md deleted file mode 100644 index d471d39..0000000 --- a/docs/SpotMarketStats.md +++ /dev/null @@ -1,38 +0,0 @@ -# SpotMarketStats - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**symbol** | **str** | | -**market_id** | **int** | | -**index_price** | **str** | | -**mid_price** | **str** | | -**last_trade_price** | **str** | | -**daily_base_token_volume** | **float** | | -**daily_quote_token_volume** | **float** | | -**daily_price_low** | **float** | | -**daily_price_high** | **float** | | -**daily_price_change** | **float** | | - -## Example - -```python -from lighter.models.spot_market_stats import SpotMarketStats - -# TODO update the JSON string below -json = "{}" -# create an instance of SpotMarketStats from a JSON string -spot_market_stats_instance = SpotMarketStats.from_json(json) -# print the JSON string representation of the object -print(SpotMarketStats.to_json()) - -# convert the object into a dict -spot_market_stats_dict = spot_market_stats_instance.to_dict() -# create an instance of SpotMarketStats from a dict -spot_market_stats_from_dict = SpotMarketStats.from_dict(spot_market_stats_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SpotOrderBookDetail.md b/docs/SpotOrderBookDetail.md index a41e15e..e7d5ca5 100644 --- a/docs/SpotOrderBookDetail.md +++ b/docs/SpotOrderBookDetail.md @@ -30,6 +30,8 @@ Name | Type | Description | Notes **daily_price_high** | **float** | | **daily_price_change** | **float** | | **daily_chart** | **Dict[str, float]** | | +**is_maker_fee_enabled** | **bool** | | +**is_taker_fee_enabled** | **bool** | | ## Example diff --git a/docs/SystemConfig.md b/docs/SystemConfig.md index ac5cc1d..05ab95d 100644 --- a/docs/SystemConfig.md +++ b/docs/SystemConfig.md @@ -12,10 +12,11 @@ Name | Type | Description | Notes **funding_fee_rebate_account_index** | **int** | | **liquidity_pool_cooldown_period** | **int** | | **staking_pool_lockup_period** | **int** | | -**max_integrator_spot_taker_fee** | **int** | | -**max_integrator_spot_maker_fee** | **int** | | -**max_integrator_perps_taker_fee** | **int** | | **max_integrator_perps_maker_fee** | **int** | | +**max_integrator_perps_taker_fee** | **int** | | +**max_integrator_spot_maker_fee** | **int** | | +**max_integrator_spot_taker_fee** | **int** | | +**market_maker_incentive_account_index** | **int** | | ## Example diff --git a/docs/Ticker.md b/docs/Ticker.md deleted file mode 100644 index 593d4ed..0000000 --- a/docs/Ticker.md +++ /dev/null @@ -1,31 +0,0 @@ -# Ticker - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**s** | **str** | | -**a** | [**PriceLevel**](PriceLevel.md) | | -**b** | [**PriceLevel**](PriceLevel.md) | | - -## Example - -```python -from lighter.models.ticker import Ticker - -# TODO update the JSON string below -json = "{}" -# create an instance of Ticker from a JSON string -ticker_instance = Ticker.from_json(json) -# print the JSON string representation of the object -print(Ticker.to_json()) - -# convert the object into a dict -ticker_dict = ticker_instance.to_dict() -# create an instance of Ticker from a dict -ticker_from_dict = Ticker.from_dict(ticker_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/Token.md b/docs/Token.md new file mode 100644 index 0000000..0fc79c5 --- /dev/null +++ b/docs/Token.md @@ -0,0 +1,40 @@ +# Token + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**symbol** | **str** | | +**name** | **str** | | +**logo** | **str** | | +**logo_extension** | **str** | | +**description_key** | **str** | | +**gecko_id** | **str** | | +**paprika_id** | **str** | | +**market** | **str** | | +**asset_type** | **str** | | +**categories** | **List[str]** | | +**is_allowed_mainnet** | **bool** | | +**is_asset_allowed_mainnet** | **bool** | | + +## Example + +```python +from lighter.models.token import Token + +# TODO update the JSON string below +json = "{}" +# create an instance of Token from a JSON string +token_instance = Token.from_json(json) +# print the JSON string representation of the object +print(Token.to_json()) + +# convert the object into a dict +token_dict = token_instance.to_dict() +# create an instance of Token from a dict +token_from_dict = Token.from_dict(token_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TokenList.md b/docs/TokenList.md new file mode 100644 index 0000000..a102c55 --- /dev/null +++ b/docs/TokenList.md @@ -0,0 +1,31 @@ +# TokenList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**tokens** | [**List[Token]**](Token.md) | | + +## Example + +```python +from lighter.models.token_list import TokenList + +# TODO update the JSON string below +json = "{}" +# create an instance of TokenList from a JSON string +token_list_instance = TokenList.from_json(json) +# print the JSON string representation of the object +print(TokenList.to_json()) + +# convert the object into a dict +token_list_dict = token_list_instance.to_dict() +# create an instance of TokenList from a dict +token_list_from_dict = TokenList.from_dict(token_list_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/TokenlistApi.md b/docs/TokenlistApi.md new file mode 100644 index 0000000..f14fed3 --- /dev/null +++ b/docs/TokenlistApi.md @@ -0,0 +1,74 @@ +# lighter.TokenlistApi + +All URIs are relative to *https://mainnet.zklighter.elliot.ai* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**tokenlist**](TokenlistApi.md#tokenlist) | **GET** /api/v1/tokenlist | tokenlist + + +# **tokenlist** +> TokenList tokenlist() + +tokenlist + +Get token list and their metadata + +### Example + + +```python +import lighter +from lighter.models.token_list import TokenList +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.TokenlistApi(api_client) + + try: + # tokenlist + api_response = await api_instance.tokenlist() + print("The response of TokenlistApi->tokenlist:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TokenlistApi->tokenlist: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**TokenList**](TokenList.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/Trade.md b/docs/Trade.md index e49bd76..140f1d2 100644 --- a/docs/Trade.md +++ b/docs/Trade.md @@ -14,26 +14,39 @@ Name | Type | Description | Notes **usd_amount** | **str** | | **ask_id** | **int** | | **bid_id** | **int** | | -**ask_client_id** | **int** | | -**bid_client_id** | **int** | | **ask_account_id** | **int** | | **bid_account_id** | **int** | | **is_maker_ask** | **bool** | | **block_height** | **int** | | **timestamp** | **int** | | -**taker_fee** | **int** | | +**taker_fee** | **int** | | [optional] **taker_position_size_before** | **str** | | **taker_entry_quote_before** | **str** | | **taker_initial_margin_fraction_before** | **int** | | **taker_position_sign_changed** | **bool** | | -**maker_fee** | **int** | | +**maker_fee** | **int** | | [optional] **maker_position_size_before** | **str** | | **maker_entry_quote_before** | **str** | | **maker_initial_margin_fraction_before** | **int** | | **maker_position_sign_changed** | **bool** | | **transaction_time** | **int** | | -**ask_account_pnl** | **str** | | -**bid_account_pnl** | **str** | | +**bid_account_pnl** | **str** | Realized PnL for the queried account index, triggered by reducing a short position | +**ask_account_pnl** | **str** | Realized PnL for the queried account index, triggered by reducing a long position, or a spot position | +**ask_client_id** | **int** | | +**bid_client_id** | **int** | | +**ask_client_id_str** | **str** | | +**bid_client_id_str** | **str** | | +**ask_id_str** | **str** | | [optional] +**bid_id_str** | **str** | | [optional] +**trade_id_str** | **str** | | +**integrator_maker_fee** | **int** | | +**integrator_maker_fee_collector_index** | **int** | | +**integrator_taker_fee** | **int** | | +**integrator_taker_fee_collector_index** | **int** | | +**taker_allocated_margin_usdc_before** | **int** | | +**taker_allocated_margin_usdc_after** | **int** | | +**maker_allocated_margin_usdc_before** | **int** | | +**maker_allocated_margin_usdc_after** | **int** | | ## Example diff --git a/docs/TransactionApi.md b/docs/TransactionApi.md index 1f6a691..dd3fa16 100644 --- a/docs/TransactionApi.md +++ b/docs/TransactionApi.md @@ -4,18 +4,174 @@ All URIs are relative to *https://mainnet.zklighter.elliot.ai* Method | HTTP request | Description ------------- | ------------- | ------------- +[**account_txs**](TransactionApi.md#account_txs) | **GET** /api/v1/accountTxs | accountTxs +[**block_txs**](TransactionApi.md#block_txs) | **GET** /api/v1/blockTxs | blockTxs [**deposit_history**](TransactionApi.md#deposit_history) | **GET** /api/v1/deposit/history | deposit_history [**next_nonce**](TransactionApi.md#next_nonce) | **GET** /api/v1/nextNonce | nextNonce [**send_tx**](TransactionApi.md#send_tx) | **POST** /api/v1/sendTx | sendTx [**send_tx_batch**](TransactionApi.md#send_tx_batch) | **POST** /api/v1/sendTxBatch | sendTxBatch +[**set_account_metadata**](TransactionApi.md#set_account_metadata) | **POST** /api/v1/setAccountMetadata | setAccountMetadata [**transfer_history**](TransactionApi.md#transfer_history) | **GET** /api/v1/transfer/history | transfer_history [**tx**](TransactionApi.md#tx) | **GET** /api/v1/tx | tx [**tx_from_l1_tx_hash**](TransactionApi.md#tx_from_l1_tx_hash) | **GET** /api/v1/txFromL1TxHash | txFromL1TxHash +[**txs**](TransactionApi.md#txs) | **GET** /api/v1/txs | txs [**withdraw_history**](TransactionApi.md#withdraw_history) | **GET** /api/v1/withdraw/history | withdraw_history +# **account_txs** +> Txs account_txs(limit, by, value, index=index, authorization=authorization, auth=auth, types=types) + +accountTxs + +Get transactions of a specific account + +### Example + + +```python +import lighter +from lighter.models.txs import Txs +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.TransactionApi(api_client) + limit = 56 # int | + by = 'by_example' # str | + value = 'value_example' # str | + 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) + 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) + print("The response of TransactionApi->account_txs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionApi->account_txs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| | + **by** | **str**| | + **value** | **str**| | + **index** | **int**| | [optional] + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + **types** | [**List[int]**](int.md)| | [optional] + +### Return type + +[**Txs**](Txs.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **block_txs** +> Txs block_txs(by, value) + +blockTxs + +Get transactions in a block + +### Example + + +```python +import lighter +from lighter.models.txs import Txs +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.TransactionApi(api_client) + by = 'by_example' # str | + value = 'value_example' # str | + + try: + # blockTxs + api_response = await api_instance.block_txs(by, value) + print("The response of TransactionApi->block_txs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionApi->block_txs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **by** | **str**| | + **value** | **str**| | + +### Return type + +[**Txs**](Txs.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **deposit_history** -> DepositHistory deposit_history(account_index, l1_address, authorization=authorization, auth=auth, cursor=cursor, filter=filter) +> DepositHistory deposit_history(authorization, account_index, l1_address, cursor=cursor, filter=filter) deposit_history @@ -41,16 +197,15 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.TransactionApi(api_client) + authorization = 'authorization_example' # str | account_index = 56 # int | l1_address = 'l1_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) cursor = 'cursor_example' # str | (optional) filter = 'filter_example' # str | (optional) try: # deposit_history - api_response = await api_instance.deposit_history(account_index, l1_address, authorization=authorization, auth=auth, cursor=cursor, filter=filter) + api_response = await api_instance.deposit_history(authorization, account_index, l1_address, cursor=cursor, filter=filter) print("The response of TransactionApi->deposit_history:\n") pprint(api_response) except Exception as e: @@ -64,10 +219,9 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **account_index** | **int**| | **l1_address** | **str**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] **cursor** | **str**| | [optional] **filter** | **str**| | [optional] @@ -169,7 +323,7 @@ No authorization required sendTx -You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers) +You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started ### Example @@ -225,7 +379,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -242,7 +396,7 @@ No authorization required sendTxBatch -You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers) +You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started ### Example @@ -296,7 +450,79 @@ No authorization required ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/x-www-form-urlencoded + - **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) + +# **set_account_metadata** +> ResultCode set_account_metadata(req_set_account_metadata, authorization=authorization) + +setAccountMetadata + +Set account metadata + +### Example + + +```python +import lighter +from lighter.models.req_set_account_metadata import ReqSetAccountMetadata +from lighter.models.result_code import ResultCode +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.TransactionApi(api_client) + req_set_account_metadata = lighter.ReqSetAccountMetadata() # ReqSetAccountMetadata | + authorization = 'authorization_example' # str | (optional) + + try: + # setAccountMetadata + api_response = await api_instance.set_account_metadata(req_set_account_metadata, authorization=authorization) + print("The response of TransactionApi->set_account_metadata:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionApi->set_account_metadata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **req_set_account_metadata** | [**ReqSetAccountMetadata**](ReqSetAccountMetadata.md)| | + **authorization** | **str**| | [optional] + +### Return type + +[**ResultCode**](ResultCode.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -309,11 +535,11 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **transfer_history** -> TransferHistory transfer_history(account_index, authorization=authorization, auth=auth, cursor=cursor, type=type) +> TransferHistory transfer_history(account_index, authorization=authorization, cursor=cursor, type=type) transfer_history -Get transfer history +Get transfer history. To fetch an account index, you will need to `auth` the request, unless it's a public pool. ### Example @@ -336,14 +562,13 @@ async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.TransactionApi(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) cursor = 'cursor_example' # str | (optional) - type = 'type_example' # str | (optional) + type = ['type_example'] # List[str] | (optional) try: # transfer_history - api_response = await api_instance.transfer_history(account_index, authorization=authorization, auth=auth, cursor=cursor, type=type) + api_response = await api_instance.transfer_history(account_index, authorization=authorization, cursor=cursor, type=type) print("The response of TransactionApi->transfer_history:\n") pprint(api_response) except Exception as e: @@ -358,10 +583,9 @@ 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] **cursor** | **str**| | [optional] - **type** | **str**| | [optional] + **type** | [**List[str]**](str.md)| | [optional] ### Return type @@ -525,12 +749,83 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **txs** +> Txs txs(limit, index=index) + +txs + +Get transactions which are already packed into blocks + +### Example + + +```python +import lighter +from lighter.models.txs import Txs +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.TransactionApi(api_client) + limit = 56 # int | + index = 56 # int | (optional) + + try: + # txs + api_response = await api_instance.txs(limit, index=index) + print("The response of TransactionApi->txs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionApi->txs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| | + **index** | **int**| | [optional] + +### Return type + +[**Txs**](Txs.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **withdraw_history** -> WithdrawHistory withdraw_history(account_index, authorization=authorization, auth=auth, cursor=cursor, filter=filter) +> WithdrawHistory withdraw_history(authorization, account_index, cursor=cursor, filter=filter) withdraw_history -Get withdraw history +Get withdraw history. Secure withdrawals are only set to `claimable` when ready. You should only expect the `completed` status on fast withdrawals via Arbitrum. ### Example @@ -552,15 +847,14 @@ configuration = lighter.Configuration( async with lighter.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = lighter.TransactionApi(api_client) + authorization = 'authorization_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) cursor = 'cursor_example' # str | (optional) filter = 'filter_example' # str | (optional) try: # withdraw_history - api_response = await api_instance.withdraw_history(account_index, authorization=authorization, auth=auth, cursor=cursor, filter=filter) + api_response = await api_instance.withdraw_history(authorization, account_index, cursor=cursor, filter=filter) print("The response of TransactionApi->withdraw_history:\n") pprint(api_response) except Exception as e: @@ -574,9 +868,8 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | **account_index** | **int**| | - **authorization** | **str**| make required after integ is done | [optional] - **auth** | **str**| made optional to support header auth clients | [optional] **cursor** | **str**| | [optional] **filter** | **str**| | [optional] diff --git a/docs/TransferHistoryItem.md b/docs/TransferHistoryItem.md index 56b71aa..11201e8 100644 --- a/docs/TransferHistoryItem.md +++ b/docs/TransferHistoryItem.md @@ -6,18 +6,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | -**asset_id** | **int** | | **amount** | **str** | | -**fee** | **str** | | **timestamp** | **int** | | **type** | **str** | | **from_l1_address** | **str** | | **to_l1_address** | **str** | | **from_account_index** | **int** | | **to_account_index** | **int** | | +**tx_hash** | **str** | | +**asset_id** | **int** | | +**fee** | **str** | | **from_route** | **str** | | **to_route** | **str** | | -**tx_hash** | **str** | | ## Example diff --git a/docs/Tx.md b/docs/Tx.md new file mode 100644 index 0000000..708b4f6 --- /dev/null +++ b/docs/Tx.md @@ -0,0 +1,45 @@ +# Tx + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hash** | **str** | | +**type** | **int** | | +**info** | **str** | | +**event_info** | **str** | | +**status** | **int** | | +**transaction_index** | **int** | | +**l1_address** | **str** | | +**account_index** | **int** | | +**nonce** | **int** | | +**expire_at** | **int** | | +**block_height** | **int** | | +**queued_at** | **int** | | +**executed_at** | **int** | | +**sequence_index** | **int** | | +**parent_hash** | **str** | | +**api_key_index** | **int** | | +**transaction_time** | **int** | | + +## Example + +```python +from lighter.models.tx import Tx + +# TODO update the JSON string below +json = "{}" +# create an instance of Tx from a JSON string +tx_instance = Tx.from_json(json) +# print the JSON string representation of the object +print(Tx.to_json()) + +# convert the object into a dict +tx_dict = tx_instance.to_dict() +# create an instance of Tx from a dict +tx_from_dict = Tx.from_dict(tx_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TxHashes.md b/docs/Txs.md similarity index 58% rename from docs/TxHashes.md rename to docs/Txs.md index 18194ca..634d6c6 100644 --- a/docs/TxHashes.md +++ b/docs/Txs.md @@ -1,4 +1,4 @@ -# TxHashes +# Txs ## Properties @@ -7,24 +7,24 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **int** | | **message** | **str** | | [optional] -**tx_hash** | **List[str]** | | +**txs** | [**List[Tx]**](Tx.md) | | ## Example ```python -from lighter.models.tx_hashes import TxHashes +from lighter.models.txs import Txs # TODO update the JSON string below json = "{}" -# create an instance of TxHashes from a JSON string -tx_hashes_instance = TxHashes.from_json(json) +# create an instance of Txs from a JSON string +txs_instance = Txs.from_json(json) # print the JSON string representation of the object -print(TxHashes.to_json()) +print(Txs.to_json()) # convert the object into a dict -tx_hashes_dict = tx_hashes_instance.to_dict() -# create an instance of TxHashes from a dict -tx_hashes_from_dict = TxHashes.from_dict(tx_hashes_dict) +txs_dict = txs_instance.to_dict() +# create an instance of Txs from a dict +txs_from_dict = Txs.from_dict(txs_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/UserReferrals.md b/docs/UserReferrals.md index ccb0f1b..d4b727c 100644 --- a/docs/UserReferrals.md +++ b/docs/UserReferrals.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **message** | **str** | | [optional] **cursor** | **str** | | **referrals** | [**List[Referral]**](Referral.md) | | +**used_code** | **str** | | ## Example diff --git a/docs/WithdrawHistoryItem.md b/docs/WithdrawHistoryItem.md index 8ce329d..0293e65 100644 --- a/docs/WithdrawHistoryItem.md +++ b/docs/WithdrawHistoryItem.md @@ -6,12 +6,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | -**asset_id** | **int** | | **amount** | **str** | | **timestamp** | **int** | | **status** | **str** | | **type** | **str** | | **l1_tx_hash** | **str** | | +**asset_id** | **int** | | ## Example diff --git a/lighter/__init__.py b/lighter/__init__.py index fd7a3d5..8d7d36a 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -7,11 +7,11 @@ Public APIs for Lighter - The version of the OpenAPI document: 1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 +""" + __version__ = "1.0.0" @@ -19,15 +19,16 @@ # import apis into sdk package from lighter.api.account_api import AccountApi from lighter.api.announcement_api import AnnouncementApi +from lighter.api.block_api import BlockApi from lighter.api.bridge_api import BridgeApi from lighter.api.candlestick_api import CandlestickApi from lighter.api.funding_api import FundingApi from lighter.api.info_api import InfoApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi -from lighter.api.pushnotif_api import PushnotifApi from lighter.api.referral_api import ReferralApi from lighter.api.root_api import RootApi +from lighter.api.tokenlist_api import TokenlistApi from lighter.api.transaction_api import TransactionApi # import ApiClient @@ -46,14 +47,10 @@ from lighter.models.account_api_keys import AccountApiKeys from lighter.models.account_asset import AccountAsset from lighter.models.account_limits import AccountLimits -from lighter.models.account_margin_stats import AccountMarginStats -from lighter.models.account_market_stats import AccountMarketStats from lighter.models.account_metadata import AccountMetadata 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_stats import AccountStats -from lighter.models.account_trade_stats import AccountTradeStats from lighter.models.announcement import Announcement from lighter.models.announcements import Announcements from lighter.models.api_key import ApiKey @@ -61,19 +58,21 @@ from lighter.models.approved_integrator import ApprovedIntegrator from lighter.models.asset import Asset from lighter.models.asset_details import AssetDetails -from lighter.models.auth import Auth -from lighter.models.bridge import Bridge +from lighter.models.block import Block +from lighter.models.blocks import Blocks from lighter.models.bridge_supported_network import BridgeSupportedNetwork +from lighter.models.bridge_supported_networks import BridgeSupportedNetworks from lighter.models.candle import Candle from lighter.models.candles import Candles from lighter.models.contract_address import ContractAddress -from lighter.models.cursor import Cursor +from lighter.models.create_intent_address_resp import CreateIntentAddressResp +from lighter.models.current_height import CurrentHeight from lighter.models.daily_return import DailyReturn +from lighter.models.deposit import Deposit 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_accounts import DetailedAccounts -from lighter.models.detailed_candlestick import DetailedCandlestick from lighter.models.enriched_tx import EnrichedTx from lighter.models.exchange_metric import ExchangeMetric from lighter.models.exchange_stats import ExchangeStats @@ -85,6 +84,7 @@ from lighter.models.fundings import Fundings 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.lease_entry import LeaseEntry from lighter.models.lease_option_entry import LeaseOptionEntry from lighter.models.liq_trade import LiqTrade @@ -96,14 +96,13 @@ from lighter.models.order import Order from lighter.models.order_book import OrderBook from lighter.models.order_book_depth import OrderBookDepth -from lighter.models.order_book_depth_with_begin_nonce import OrderBookDepthWithBeginNonce from lighter.models.order_book_details import OrderBookDetails from lighter.models.order_book_orders import OrderBookOrders from lighter.models.order_book_stats import OrderBookStats from lighter.models.order_books import OrderBooks from lighter.models.orders import Orders +from lighter.models.partner_stats import PartnerStats from lighter.models.pending_unlock import PendingUnlock -from lighter.models.perps_market_stats import PerpsMarketStats from lighter.models.perps_order_book_detail import PerpsOrderBookDetail from lighter.models.pn_l_entry import PnLEntry from lighter.models.position_funding import PositionFunding @@ -112,69 +111,28 @@ from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_metadata import PublicPoolMetadata from lighter.models.public_pool_share import PublicPoolShare -from lighter.models.push_notif_delivery_result import PushNotifDeliveryResult from lighter.models.referral import Referral -from lighter.models.req_do_faucet import ReqDoFaucet -from lighter.models.req_export_data import ReqExportData -from lighter.models.req_get_account import ReqGetAccount -from lighter.models.req_get_account_active_orders import ReqGetAccountActiveOrders -from lighter.models.req_get_account_api_keys import ReqGetAccountApiKeys -from lighter.models.req_get_account_by_l1_address import ReqGetAccountByL1Address -from lighter.models.req_get_account_inactive_orders import ReqGetAccountInactiveOrders -from lighter.models.req_get_account_limits import ReqGetAccountLimits -from lighter.models.req_get_account_metadata import ReqGetAccountMetadata -from lighter.models.req_get_account_pn_l import ReqGetAccountPnL -from lighter.models.req_get_account_txs import ReqGetAccountTxs -from lighter.models.req_get_api_tokens import ReqGetApiTokens -from lighter.models.req_get_asset_details import ReqGetAssetDetails -from lighter.models.req_get_block import ReqGetBlock -from lighter.models.req_get_block_txs import ReqGetBlockTxs -from lighter.models.req_get_bridges_by_l1_addr import ReqGetBridgesByL1Addr -from lighter.models.req_get_by_account import ReqGetByAccount -from lighter.models.req_get_candles import ReqGetCandles -from lighter.models.req_get_deposit_history import ReqGetDepositHistory -from lighter.models.req_get_exchange_metrics import ReqGetExchangeMetrics -from lighter.models.req_get_execute_stats import ReqGetExecuteStats -from lighter.models.req_get_fast_withdraw_info import ReqGetFastWithdrawInfo -from lighter.models.req_get_fundings import ReqGetFundings -from lighter.models.req_get_l1_metadata import ReqGetL1Metadata -from lighter.models.req_get_l1_tx import ReqGetL1Tx -from lighter.models.req_get_latest_deposit import ReqGetLatestDeposit -from lighter.models.req_get_leases import ReqGetLeases -from lighter.models.req_get_liquidation_infos import ReqGetLiquidationInfos -from lighter.models.req_get_next_nonce import ReqGetNextNonce -from lighter.models.req_get_order_book_details import ReqGetOrderBookDetails -from lighter.models.req_get_order_book_orders import ReqGetOrderBookOrders -from lighter.models.req_get_order_books import ReqGetOrderBooks -from lighter.models.req_get_position_funding import ReqGetPositionFunding -from lighter.models.req_get_public_pools_metadata import ReqGetPublicPoolsMetadata -from lighter.models.req_get_push_notif_settings import ReqGetPushNotifSettings -from lighter.models.req_get_range_with_cursor import ReqGetRangeWithCursor -from lighter.models.req_get_range_with_index import ReqGetRangeWithIndex -from lighter.models.req_get_range_with_index_sortable import ReqGetRangeWithIndexSortable -from lighter.models.req_get_recent_trades import ReqGetRecentTrades -from lighter.models.req_get_trades import ReqGetTrades -from lighter.models.req_get_transfer_fee_info import ReqGetTransferFeeInfo -from lighter.models.req_get_transfer_history import ReqGetTransferHistory -from lighter.models.req_get_tx import ReqGetTx -from lighter.models.req_get_user_referrals import ReqGetUserReferrals -from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory +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.req_set_account_metadata import ReqSetAccountMetadata from lighter.models.resp_change_account_tier import RespChangeAccountTier from lighter.models.resp_get_api_tokens import RespGetApiTokens -from lighter.models.resp_get_bridges_by_l1_addr import RespGetBridgesByL1Addr from lighter.models.resp_get_exchange_metrics import RespGetExchangeMetrics from lighter.models.resp_get_execute_stats import RespGetExecuteStats from lighter.models.resp_get_fast_bridge_info import RespGetFastBridgeInfo from lighter.models.resp_get_fastwithdrawal_info import RespGetFastwithdrawalInfo -from lighter.models.resp_get_is_next_bridge_fast import RespGetIsNextBridgeFast from lighter.models.resp_get_lease_options import RespGetLeaseOptions from lighter.models.resp_get_leases import RespGetLeases -from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings +from lighter.models.resp_get_maker_only_api_keys import RespGetMakerOnlyApiKeys from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata from lighter.models.resp_revoke_api_token import RespRevokeApiToken from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch +from lighter.models.resp_set_maker_only_api_keys import RespSetMakerOnlyApiKeys +from lighter.models.resp_update_kickback import RespUpdateKickback +from lighter.models.resp_update_referral_code import RespUpdateReferralCode from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode from lighter.models.risk_info import RiskInfo @@ -182,36 +140,35 @@ from lighter.models.share_price import SharePrice from lighter.models.simple_order import SimpleOrder from lighter.models.slippage_result import SlippageResult -from lighter.models.spot_avg_entry_price import SpotAvgEntryPrice -from lighter.models.spot_market_stats import SpotMarketStats from lighter.models.spot_order_book_detail import SpotOrderBookDetail from lighter.models.status import Status from lighter.models.strategy import Strategy from lighter.models.sub_accounts import SubAccounts from lighter.models.system_config import SystemConfig -from lighter.models.ticker import Ticker +from lighter.models.token import Token +from lighter.models.token_list import TokenList from lighter.models.trade import Trade from lighter.models.trade_stats import TradeStats from lighter.models.trades import Trades from lighter.models.transfer_fee_info import TransferFeeInfo from lighter.models.transfer_history import TransferHistory from lighter.models.transfer_history_item import TransferHistoryItem +from lighter.models.tx import Tx from lighter.models.tx_hash import TxHash -from lighter.models.tx_hashes import TxHashes +from lighter.models.txs import Txs from lighter.models.user_referrals import UserReferrals from lighter.models.validator_info import ValidatorInfo from lighter.models.withdraw_history import WithdrawHistory from lighter.models.withdraw_history_item import WithdrawHistoryItem from lighter.models.zk_lighter_info import ZkLighterInfo -from lighter.models.resp_get_maker_only_api_keys import RespGetMakerOnlyApiKeys -from lighter.models.resp_set_maker_only_api_keys import RespSetMakerOnlyApiKeys -from lighter.models.req_get_partner_stats import ReqGetPartnerStats -from lighter.models.req_get_maker_only_api_keys import ReqGetMakerOnlyApiKeys -from lighter.models.partner_stats import PartnerStats + +# manual additions from lighter.ws_client import WsClient from lighter.signer_client import SignerClient, create_api_key from lighter.paper_client import ( + AccountTier, InMemoryOrderBook, + MarketConfig, OrderBookLevel, PaperAccount, PaperAccountHealth, @@ -225,4 +182,3 @@ PaperPosition, PaperTrade, ) -from lighter.nonce_manager import NonceManagerType diff --git a/lighter/api/__init__.py b/lighter/api/__init__.py index 112ca77..4f71f1e 100644 --- a/lighter/api/__init__.py +++ b/lighter/api/__init__.py @@ -3,14 +3,15 @@ # import apis into api package from lighter.api.account_api import AccountApi from lighter.api.announcement_api import AnnouncementApi +from lighter.api.block_api import BlockApi from lighter.api.bridge_api import BridgeApi from lighter.api.candlestick_api import CandlestickApi from lighter.api.funding_api import FundingApi from lighter.api.info_api import InfoApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi -from lighter.api.pushnotif_api import PushnotifApi from lighter.api.referral_api import ReferralApi from lighter.api.root_api import RootApi +from lighter.api.tokenlist_api import TokenlistApi from lighter.api.transaction_api import TransactionApi diff --git a/lighter/api/account_api.py b/lighter/api/account_api.py index 901b1fb..d5c100c 100644 --- a/lighter/api/account_api.py +++ b/lighter/api/account_api.py @@ -33,13 +33,13 @@ from lighter.models.resp_get_lease_options import RespGetLeaseOptions from lighter.models.resp_get_leases import RespGetLeases from lighter.models.resp_get_maker_only_api_keys import RespGetMakerOnlyApiKeys -from lighter.models.resp_set_maker_only_api_keys import RespSetMakerOnlyApiKeys from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata from lighter.models.resp_revoke_api_token import RespRevokeApiToken -from lighter.models.result_code import ResultCode +from lighter.models.resp_set_maker_only_api_keys import RespSetMakerOnlyApiKeys from lighter.models.sub_accounts import SubAccounts from lighter.models.tx_hash import TxHash +from lighter.models.user_referrals import UserReferrals from lighter.api_client import ApiClient, RequestSerialized from lighter.api_response import ApiResponse @@ -63,7 +63,7 @@ async def account( self, by: StrictStr, value: StrictStr, - active_only: Optional[StrictBool] = None, + active_only: Annotated[Optional[StrictBool], Field(description="Hide markets for which leverage and margin settings are present (meaning the account traded it at least once), but with no active position.")] = None, cursor: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -80,13 +80,13 @@ async def account( ) -> DetailedAccounts: """account - Get account by account's index.
More details about account index: [Account Index](https://apidocs.lighter.xyz/docs/account-index)
**Response Description:**

1) **Status:** 1 is active 0 is inactive.
2) **Collateral:** The amount of collateral in the account.
**Position Details Description:**
1) **OOC:** Open order count in that market.
2) **Sign:** 1 for Long, -1 for Short.
3) **Position:** The amount of position in that market.
4) **Avg Entry Price:** The average entry price of the position.
5) **Position Value:** The value of the position.
6) **Unrealized PnL:** The unrealized profit and loss of the position.
7) **Realized PnL:** The realized profit and loss of the position. + Get account by an account's index, or L1 address :param by: (required) :type by: str :param value: (required) :type value: str - :param active_only: + :param active_only: Hide markets for which leverage and margin settings are present (meaning the account traded it at least once), but with no active position. :type active_only: bool :param cursor: :type cursor: str @@ -142,7 +142,7 @@ async def account_with_http_info( self, by: StrictStr, value: StrictStr, - active_only: Optional[StrictBool] = None, + active_only: Annotated[Optional[StrictBool], Field(description="Hide markets for which leverage and margin settings are present (meaning the account traded it at least once), but with no active position.")] = None, cursor: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -159,13 +159,13 @@ async def account_with_http_info( ) -> ApiResponse[DetailedAccounts]: """account - Get account by account's index.
More details about account index: [Account Index](https://apidocs.lighter.xyz/docs/account-index)
**Response Description:**

1) **Status:** 1 is active 0 is inactive.
2) **Collateral:** The amount of collateral in the account.
**Position Details Description:**
1) **OOC:** Open order count in that market.
2) **Sign:** 1 for Long, -1 for Short.
3) **Position:** The amount of position in that market.
4) **Avg Entry Price:** The average entry price of the position.
5) **Position Value:** The value of the position.
6) **Unrealized PnL:** The unrealized profit and loss of the position.
7) **Realized PnL:** The realized profit and loss of the position. + Get account by an account's index, or L1 address :param by: (required) :type by: str :param value: (required) :type value: str - :param active_only: + :param active_only: Hide markets for which leverage and margin settings are present (meaning the account traded it at least once), but with no active position. :type active_only: bool :param cursor: :type cursor: str @@ -221,7 +221,7 @@ async def account_without_preload_content( self, by: StrictStr, value: StrictStr, - active_only: Optional[StrictBool] = None, + active_only: Annotated[Optional[StrictBool], Field(description="Hide markets for which leverage and margin settings are present (meaning the account traded it at least once), but with no active position.")] = None, cursor: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -238,13 +238,13 @@ async def account_without_preload_content( ) -> RESTResponseType: """account - Get account by account's index.
More details about account index: [Account Index](https://apidocs.lighter.xyz/docs/account-index)
**Response Description:**

1) **Status:** 1 is active 0 is inactive.
2) **Collateral:** The amount of collateral in the account.
**Position Details Description:**
1) **OOC:** Open order count in that market.
2) **Sign:** 1 for Long, -1 for Short.
3) **Position:** The amount of position in that market.
4) **Avg Entry Price:** The average entry price of the position.
5) **Position Value:** The value of the position.
6) **Unrealized PnL:** The unrealized profit and loss of the position.
7) **Realized PnL:** The realized profit and loss of the position. + Get account by an account's index, or L1 address :param by: (required) :type by: str :param value: (required) :type value: str - :param active_only: + :param active_only: Hide markets for which leverage and margin settings are present (meaning the account traded it at least once), but with no active position. :type active_only: bool :param cursor: :type cursor: str @@ -373,8 +373,7 @@ def _account_serialize( async def account_limits( 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: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -390,14 +389,12 @@ async def account_limits( ) -> AccountLimits: """accountLimits - Get account limits + Get account limits. For more details on account types, see this page: https://apidocs.lighter.xyz/docs/account-types :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: (required) :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 @@ -423,7 +420,6 @@ async def account_limits( _param = self._account_limits_serialize( account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -448,8 +444,7 @@ async def account_limits( async def account_limits_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: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -465,14 +460,12 @@ async def account_limits_with_http_info( ) -> ApiResponse[AccountLimits]: """accountLimits - Get account limits + Get account limits. For more details on account types, see this page: https://apidocs.lighter.xyz/docs/account-types :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: (required) :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 @@ -498,7 +491,6 @@ async def account_limits_with_http_info( _param = self._account_limits_serialize( account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -523,8 +515,7 @@ async def account_limits_with_http_info( async def account_limits_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: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -540,14 +531,12 @@ async def account_limits_without_preload_content( ) -> RESTResponseType: """accountLimits - Get account limits + Get account limits. For more details on account types, see this page: https://apidocs.lighter.xyz/docs/account-types :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done + :param authorization: (required) :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 @@ -573,7 +562,6 @@ async def account_limits_without_preload_content( _param = self._account_limits_serialize( account_index=account_index, authorization=authorization, - auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -595,7 +583,6 @@ def _account_limits_serialize( self, account_index, authorization, - auth, _request_auth, _content_type, _headers, @@ -620,15 +607,9 @@ def _account_limits_serialize( _query_params.append(('account_index', account_index)) - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -669,7 +650,6 @@ async def account_metadata( by: StrictStr, value: StrictStr, authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -694,8 +674,6 @@ async def account_metadata( :type value: str :param authorization: :type authorization: str - :param auth: - :type auth: str :param cursor: :type cursor: str :param _request_timeout: timeout setting for this request. If one @@ -724,7 +702,6 @@ async def account_metadata( by=by, value=value, authorization=authorization, - auth=auth, cursor=cursor, _request_auth=_request_auth, _content_type=_content_type, @@ -752,7 +729,6 @@ async def account_metadata_with_http_info( by: StrictStr, value: StrictStr, authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -777,8 +753,6 @@ async def account_metadata_with_http_info( :type value: str :param authorization: :type authorization: str - :param auth: - :type auth: str :param cursor: :type cursor: str :param _request_timeout: timeout setting for this request. If one @@ -807,7 +781,6 @@ async def account_metadata_with_http_info( by=by, value=value, authorization=authorization, - auth=auth, cursor=cursor, _request_auth=_request_auth, _content_type=_content_type, @@ -835,7 +808,6 @@ async def account_metadata_without_preload_content( by: StrictStr, value: StrictStr, authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -860,8 +832,6 @@ async def account_metadata_without_preload_content( :type value: str :param authorization: :type authorization: str - :param auth: - :type auth: str :param cursor: :type cursor: str :param _request_timeout: timeout setting for this request. If one @@ -890,7 +860,6 @@ async def account_metadata_without_preload_content( by=by, value=value, authorization=authorization, - auth=auth, cursor=cursor, _request_auth=_request_auth, _content_type=_content_type, @@ -914,7 +883,6 @@ def _account_metadata_serialize( by, value, authorization, - auth, cursor, _request_auth, _content_type, @@ -944,10 +912,6 @@ def _account_metadata_serialize( _query_params.append(('value', value)) - if auth is not None: - - _query_params.append(('auth', auth)) - if cursor is not None: _query_params.append(('cursor', cursor)) @@ -1009,7 +973,7 @@ async def accounts_by_l1_address( ) -> SubAccounts: """accountsByL1Address - Get accounts by l1_address returns all accounts associated with the given L1 address + Returns all accounts associated with the given L1 address :param l1_address: (required) :type l1_address: str @@ -1080,7 +1044,7 @@ async def accounts_by_l1_address_with_http_info( ) -> ApiResponse[SubAccounts]: """accountsByL1Address - Get accounts by l1_address returns all accounts associated with the given L1 address + Returns all accounts associated with the given L1 address :param l1_address: (required) :type l1_address: str @@ -1151,7 +1115,7 @@ async def accounts_by_l1_address_without_preload_content( ) -> RESTResponseType: """accountsByL1Address - Get accounts by l1_address returns all accounts associated with the given L1 address + Returns all accounts associated with the given L1 address :param l1_address: (required) :type l1_address: str @@ -1565,7 +1529,7 @@ async def change_account_tier( ) -> RespChangeAccountTier: """changeAccountTier - Change account tier + Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open. :param account_index: (required) :type account_index: int @@ -1644,7 +1608,7 @@ async def change_account_tier_with_http_info( ) -> ApiResponse[RespChangeAccountTier]: """changeAccountTier - Change account tier + Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open. :param account_index: (required) :type account_index: int @@ -1723,7 +1687,7 @@ async def change_account_tier_without_preload_content( ) -> RESTResponseType: """changeAccountTier - Change account tier + Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open. :param account_index: (required) :type account_index: int @@ -1831,7 +1795,7 @@ def _change_account_tier_serialize( _default_content_type = ( self.api_client.select_header_content_type( [ - 'multipart/form-data' + 'application/x-www-form-urlencoded' ] ) ) @@ -1860,10 +1824,10 @@ def _change_account_tier_serialize( - async def faucet( + async def get_maker_only_api_keys( self, - l1_address: StrictStr, - do_l1_transfer: StrictBool, + authorization: StrictStr, + account_index: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1876,15 +1840,15 @@ async def faucet( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ResultCode: - """faucet + ) -> RespGetMakerOnlyApiKeys: + """getMakerOnlyApiKeys - Request funds from faucet + Get maker-only API key indexes - :param l1_address: (required) - :type l1_address: str - :param do_l1_transfer: (required) - :type do_l1_transfer: bool + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :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 @@ -1907,9 +1871,9 @@ async def faucet( :return: Returns the result object. """ # noqa: E501 - _param = self._faucet_serialize( - l1_address=l1_address, - do_l1_transfer=do_l1_transfer, + _param = self._get_maker_only_api_keys_serialize( + authorization=authorization, + account_index=account_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1917,7 +1881,7 @@ async def faucet( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", + '200': "RespGetMakerOnlyApiKeys", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1931,10 +1895,10 @@ async def faucet( ).data - async def faucet_with_http_info( + async def get_maker_only_api_keys_with_http_info( self, - l1_address: StrictStr, - do_l1_transfer: StrictBool, + authorization: StrictStr, + account_index: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1947,15 +1911,15 @@ async def faucet_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ResultCode]: - """faucet + ) -> ApiResponse[RespGetMakerOnlyApiKeys]: + """getMakerOnlyApiKeys - Request funds from faucet + Get maker-only API key indexes - :param l1_address: (required) - :type l1_address: str - :param do_l1_transfer: (required) - :type do_l1_transfer: bool + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :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 @@ -1978,9 +1942,9 @@ async def faucet_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._faucet_serialize( - l1_address=l1_address, - do_l1_transfer=do_l1_transfer, + _param = self._get_maker_only_api_keys_serialize( + authorization=authorization, + account_index=account_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1988,7 +1952,7 @@ async def faucet_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", + '200': "RespGetMakerOnlyApiKeys", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2002,10 +1966,10 @@ async def faucet_with_http_info( ) - async def faucet_without_preload_content( + async def get_maker_only_api_keys_without_preload_content( self, - l1_address: StrictStr, - do_l1_transfer: StrictBool, + authorization: StrictStr, + account_index: StrictInt, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2019,14 +1983,14 @@ async def faucet_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """faucet + """getMakerOnlyApiKeys - Request funds from faucet + Get maker-only API key indexes - :param l1_address: (required) - :type l1_address: str - :param do_l1_transfer: (required) - :type do_l1_transfer: bool + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :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 @@ -2049,9 +2013,9 @@ async def faucet_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._faucet_serialize( - l1_address=l1_address, - do_l1_transfer=do_l1_transfer, + _param = self._get_maker_only_api_keys_serialize( + authorization=authorization, + account_index=account_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2059,7 +2023,7 @@ async def faucet_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", + '200': "RespGetMakerOnlyApiKeys", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2069,10 +2033,10 @@ async def faucet_without_preload_content( return response_data.response - def _faucet_serialize( + def _get_maker_only_api_keys_serialize( self, - l1_address, - do_l1_transfer, + authorization, + account_index, _request_auth, _content_type, _headers, @@ -2093,15 +2057,13 @@ def _faucet_serialize( # process the path parameters # process the query parameters - if l1_address is not None: - - _query_params.append(('l1_address', l1_address)) - - if do_l1_transfer is not None: + if account_index is not None: - _query_params.append(('do_l1_transfer', do_l1_transfer)) + _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 @@ -2121,7 +2083,7 @@ def _faucet_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/faucet', + resource_path='/api/v1/getMakerOnlyApiKeys', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2137,11 +2099,10 @@ def _faucet_serialize( - async def get_maker_only_api_keys( + async def l1_metadata( self, - account_index: StrictInt, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: StrictStr, + l1_address: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2154,17 +2115,15 @@ async def get_maker_only_api_keys( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RespGetMakerOnlyApiKeys: - """getMakerOnlyApiKeys + ) -> L1Metadata: + """l1Metadata - Get maker-only API key indexes + Get L1 metadata - :param account_index: (required) - :type account_index: int - :param authorization: + :param authorization: (required) :type authorization: str - :param auth: - :type auth: str + :param l1_address: (required) + :type l1_address: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2187,10 +2146,9 @@ async def get_maker_only_api_keys( :return: Returns the result object. """ # noqa: E501 - _param = self._get_maker_only_api_keys_serialize( - account_index=account_index, + _param = self._l1_metadata_serialize( authorization=authorization, - auth=auth, + l1_address=l1_address, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2198,7 +2156,7 @@ async def get_maker_only_api_keys( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetMakerOnlyApiKeys", + '200': "L1Metadata", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2212,11 +2170,10 @@ async def get_maker_only_api_keys( ).data - async def get_maker_only_api_keys_with_http_info( + async def l1_metadata_with_http_info( self, - account_index: StrictInt, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: StrictStr, + l1_address: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2229,17 +2186,15 @@ async def get_maker_only_api_keys_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RespGetMakerOnlyApiKeys]: - """getMakerOnlyApiKeys + ) -> ApiResponse[L1Metadata]: + """l1Metadata - Get maker-only API key indexes + Get L1 metadata - :param account_index: (required) - :type account_index: int - :param authorization: + :param authorization: (required) :type authorization: str - :param auth: - :type auth: str + :param l1_address: (required) + :type l1_address: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2262,10 +2217,9 @@ async def get_maker_only_api_keys_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_maker_only_api_keys_serialize( - account_index=account_index, + _param = self._l1_metadata_serialize( authorization=authorization, - auth=auth, + l1_address=l1_address, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2273,7 +2227,7 @@ async def get_maker_only_api_keys_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetMakerOnlyApiKeys", + '200': "L1Metadata", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2287,11 +2241,10 @@ async def get_maker_only_api_keys_with_http_info( ) - async def get_maker_only_api_keys_without_preload_content( + async def l1_metadata_without_preload_content( self, - account_index: StrictInt, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, + authorization: StrictStr, + l1_address: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2305,16 +2258,14 @@ async def get_maker_only_api_keys_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """getMakerOnlyApiKeys + """l1Metadata - Get maker-only API key indexes + Get L1 metadata - :param account_index: (required) - :type account_index: int - :param authorization: + :param authorization: (required) :type authorization: str - :param auth: - :type auth: str + :param l1_address: (required) + :type l1_address: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2337,10 +2288,9 @@ async def get_maker_only_api_keys_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_maker_only_api_keys_serialize( - account_index=account_index, + _param = self._l1_metadata_serialize( authorization=authorization, - auth=auth, + l1_address=l1_address, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2348,7 +2298,7 @@ async def get_maker_only_api_keys_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetMakerOnlyApiKeys", + '200': "L1Metadata", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2358,11 +2308,10 @@ async def get_maker_only_api_keys_without_preload_content( return response_data.response - def _get_maker_only_api_keys_serialize( + def _l1_metadata_serialize( self, - account_index, authorization, - auth, + l1_address, _request_auth, _content_type, _headers, @@ -2383,13 +2332,9 @@ def _get_maker_only_api_keys_serialize( # process the path parameters # process the query parameters - if auth is not None: - - _query_params.append(('auth', auth)) - - if account_index is not None: + if l1_address is not None: - _query_params.append(('account_index', account_index)) + _query_params.append(('l1_address', l1_address)) # process the header parameters if authorization is not None: @@ -2413,7 +2358,7 @@ def _get_maker_only_api_keys_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/getMakerOnlyApiKeys', + resource_path='/api/v1/l1Metadata', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2426,36 +2371,28 @@ def _get_maker_only_api_keys_serialize( _request_auth=_request_auth ) - @validate_call - async def set_maker_only_api_keys( - self, - 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.")], - _request_timeout: Union[ - None, + + + + async def lease_options( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ 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, - ) -> RespSetMakerOnlyApiKeys: - """setMakerOnlyApiKeys + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RespGetLeaseOptions: + """leaseOptions - Set maker-only API key indexes. This replaces the current list; pass all indexes you want marked as maker-only. Pass [] to clear all maker-only restrictions. + Returns available lease duration/rate tiers, sorted by duration descending. - :param authorization: (required) - :type authorization: str - :param account_index: (required) - :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 _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 @@ -2476,12 +2413,9 @@ async def set_maker_only_api_keys( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._set_maker_only_api_keys_serialize( - authorization=authorization, - account_index=account_index, - api_key_indexes=api_key_indexes, + _param = self._lease_options_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2489,7 +2423,7 @@ async def set_maker_only_api_keys( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespSetMakerOnlyApiKeys", + '200': "RespGetLeaseOptions", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2502,36 +2436,26 @@ async def set_maker_only_api_keys( response_types_map=_response_types_map, ).data - @validate_call - async def set_maker_only_api_keys_with_http_info( - self, - 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.")], - _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[RespSetMakerOnlyApiKeys]: - """setMakerOnlyApiKeys - - Set maker-only API key indexes. This replaces the current list; pass all indexes you want marked as maker-only. Pass [] to clear all maker-only restrictions. - :param authorization: (required) - :type authorization: str - :param account_index: (required) - :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 + async def lease_options_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RespGetLeaseOptions]: + """leaseOptions + + Returns available lease duration/rate tiers, sorted by duration descending. + :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 @@ -2552,12 +2476,9 @@ async def set_maker_only_api_keys_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._set_maker_only_api_keys_serialize( - authorization=authorization, - account_index=account_index, - api_key_indexes=api_key_indexes, + _param = self._lease_options_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2565,7 +2486,7 @@ async def set_maker_only_api_keys_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespSetMakerOnlyApiKeys", + '200': "RespGetLeaseOptions", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2578,36 +2499,26 @@ async def set_maker_only_api_keys_with_http_info( response_types_map=_response_types_map, ) - @validate_call - async def set_maker_only_api_keys_without_preload_content( - self, - 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.")], - _request_timeout: Union[ - None, + + async def lease_options_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ 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, + 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: - """setMakerOnlyApiKeys + """leaseOptions - Set maker-only API key indexes. This replaces the current list; pass all indexes you want marked as maker-only. Pass [] to clear all maker-only restrictions. + Returns available lease duration/rate tiers, sorted by duration descending. - :param authorization: (required) - :type authorization: str - :param account_index: (required) - :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 _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 @@ -2628,12 +2539,9 @@ async def set_maker_only_api_keys_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._set_maker_only_api_keys_serialize( - authorization=authorization, - account_index=account_index, - api_key_indexes=api_key_indexes, + _param = self._lease_options_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2641,7 +2549,7 @@ async def set_maker_only_api_keys_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespSetMakerOnlyApiKeys", + '200': "RespGetLeaseOptions", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2650,15 +2558,13 @@ async def set_maker_only_api_keys_without_preload_content( ) return response_data.response - def _set_maker_only_api_keys_serialize( - self, - authorization, - account_index, - api_key_indexes, - _request_auth, - _content_type, - _headers, - _host_index, + + def _lease_options_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, ) -> RequestSerialized: _host = None @@ -2670,23 +2576,16 @@ def _set_maker_only_api_keys_serialize( _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, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} + _files: Dict[str, Union[str, bytes]] = {} _body_params: Optional[bytes] = None # process the path parameters # process the query parameters # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization # process the form parameters - if account_index is not None: - _form_params.append(('account_index', account_index)) - if api_key_indexes is not None: - _form_params.append(('api_key_indexes', api_key_indexes)) # process the body parameter + # set the HTTP header `Accept` if 'Accept' not in _header_params: _header_params['Accept'] = self.api_client.select_header_accept( @@ -2695,28 +2594,14 @@ def _set_maker_only_api_keys_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/x-www-form-urlencoded', - 'multipart/form-data' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/setMakerOnlyApiKeys', + method='GET', + resource_path='/api/v1/leaseOptions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2730,11 +2615,15 @@ def _set_maker_only_api_keys_serialize( ) - async def l1_metadata( + + + async def leases( self, - l1_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, + account_index: Annotated[StrictInt, Field(description="Account index to fetch leases for")], + 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)], @@ -2747,16 +2636,20 @@ async def l1_metadata( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> L1Metadata: - """l1Metadata + ) -> RespGetLeases: + """leases - Get L1 metadata + Returns paginated lease entries for an account, most recent first. Supports read-only auth via signature/account_index/timestamp query params. - :param l1_address: (required) - :type l1_address: str - :param authorization: make required after integ is done + :param account_index: Account index to fetch leases for (required) + :type account_index: int + :param authorization: API token authorization :type authorization: str - :param auth: made optional to support header auth clients + :param cursor: Pagination cursor from a previous response + :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 @@ -2780,9 +2673,11 @@ async def l1_metadata( :return: Returns the result object. """ # noqa: E501 - _param = self._l1_metadata_serialize( - l1_address=l1_address, + _param = self._leases_serialize( + account_index=account_index, authorization=authorization, + cursor=cursor, + limit=limit, auth=auth, _request_auth=_request_auth, _content_type=_content_type, @@ -2791,7 +2686,7 @@ async def l1_metadata( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "L1Metadata", + '200': "RespGetLeases", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2805,11 +2700,13 @@ async def l1_metadata( ).data - async def l1_metadata_with_http_info( + async def leases_with_http_info( self, - l1_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, + account_index: Annotated[StrictInt, Field(description="Account index to fetch leases for")], + 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)], @@ -2822,16 +2719,20 @@ async def l1_metadata_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[L1Metadata]: - """l1Metadata + ) -> ApiResponse[RespGetLeases]: + """leases - Get L1 metadata + Returns paginated lease entries for an account, most recent first. Supports read-only auth via signature/account_index/timestamp query params. - :param l1_address: (required) - :type l1_address: str - :param authorization: make required after integ is done + :param account_index: Account index to fetch leases for (required) + :type account_index: int + :param authorization: API token authorization :type authorization: str - :param auth: made optional to support header auth clients + :param cursor: Pagination cursor from a previous response + :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 @@ -2855,9 +2756,11 @@ async def l1_metadata_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._l1_metadata_serialize( - l1_address=l1_address, + _param = self._leases_serialize( + account_index=account_index, authorization=authorization, + cursor=cursor, + limit=limit, auth=auth, _request_auth=_request_auth, _content_type=_content_type, @@ -2866,7 +2769,7 @@ async def l1_metadata_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "L1Metadata", + '200': "RespGetLeases", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2880,11 +2783,13 @@ async def l1_metadata_with_http_info( ) - async def l1_metadata_without_preload_content( + async def leases_without_preload_content( self, - l1_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, + account_index: Annotated[StrictInt, Field(description="Account index to fetch leases for")], + 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)], @@ -2898,15 +2803,19 @@ async def l1_metadata_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """l1Metadata + """leases - Get L1 metadata + Returns paginated lease entries for an account, most recent first. Supports read-only auth via signature/account_index/timestamp query params. - :param l1_address: (required) - :type l1_address: str - :param authorization: make required after integ is done + :param account_index: Account index to fetch leases for (required) + :type account_index: int + :param authorization: API token authorization :type authorization: str - :param auth: made optional to support header auth clients + :param cursor: Pagination cursor from a previous response + :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 @@ -2930,9 +2839,11 @@ async def l1_metadata_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._l1_metadata_serialize( - l1_address=l1_address, + _param = self._leases_serialize( + account_index=account_index, authorization=authorization, + cursor=cursor, + limit=limit, auth=auth, _request_auth=_request_auth, _content_type=_content_type, @@ -2941,7 +2852,7 @@ async def l1_metadata_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "L1Metadata", + '200': "RespGetLeases", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2951,10 +2862,12 @@ async def l1_metadata_without_preload_content( return response_data.response - def _l1_metadata_serialize( + def _leases_serialize( self, - l1_address, + account_index, authorization, + cursor, + limit, auth, _request_auth, _content_type, @@ -2976,13 +2889,21 @@ def _l1_metadata_serialize( # process the path parameters # process the query parameters - if auth is not None: + if account_index is not None: - _query_params.append(('auth', auth)) + _query_params.append(('account_index', account_index)) - if l1_address is not None: + if cursor is not None: - _query_params.append(('l1_address', l1_address)) + _query_params.append(('cursor', cursor)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if auth is not None: + + _query_params.append(('auth', auth)) # process the header parameters if authorization is not None: @@ -3006,7 +2927,7 @@ def _l1_metadata_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/l1Metadata', + resource_path='/api/v1/leases', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3022,8 +2943,13 @@ def _l1_metadata_serialize( - async def lease_options( + async def liquidations( self, + authorization: StrictStr, + account_index: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + market_id: Optional[StrictInt] = None, + cursor: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3036,11 +2962,21 @@ async def lease_options( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RespGetLeaseOptions: - """leaseOptions + ) -> LiquidationInfos: + """liquidations - Get lease options + Get liquidation infos + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :type account_index: int + :param limit: (required) + :type limit: int + :param market_id: + :type market_id: int + :param cursor: + :type cursor: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3063,7 +2999,12 @@ async def lease_options( :return: Returns the result object. """ # noqa: E501 - _param = self._lease_options_serialize( + _param = self._liquidations_serialize( + authorization=authorization, + account_index=account_index, + limit=limit, + market_id=market_id, + cursor=cursor, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3071,7 +3012,7 @@ async def lease_options( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetLeaseOptions", + '200': "LiquidationInfos", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -3085,8 +3026,13 @@ async def lease_options( ).data - async def lease_options_with_http_info( + async def liquidations_with_http_info( self, + authorization: StrictStr, + account_index: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + market_id: Optional[StrictInt] = None, + cursor: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3099,11 +3045,21 @@ async def lease_options_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RespGetLeaseOptions]: - """leaseOptions + ) -> ApiResponse[LiquidationInfos]: + """liquidations - Get lease options + Get liquidation infos + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :type account_index: int + :param limit: (required) + :type limit: int + :param market_id: + :type market_id: int + :param cursor: + :type cursor: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3126,7 +3082,12 @@ async def lease_options_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._lease_options_serialize( + _param = self._liquidations_serialize( + authorization=authorization, + account_index=account_index, + limit=limit, + market_id=market_id, + cursor=cursor, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3134,7 +3095,7 @@ async def lease_options_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetLeaseOptions", + '200': "LiquidationInfos", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -3148,9 +3109,14 @@ async def lease_options_with_http_info( ) - async def lease_options_without_preload_content( + async def liquidations_without_preload_content( self, - _request_timeout: Union[ + authorization: StrictStr, + account_index: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + market_id: Optional[StrictInt] = None, + cursor: Optional[StrictStr] = None, + _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ @@ -3163,10 +3129,20 @@ async def lease_options_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """leaseOptions + """liquidations - Get lease options + Get liquidation infos + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :type account_index: int + :param limit: (required) + :type limit: int + :param market_id: + :type market_id: int + :param cursor: + :type cursor: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3189,7 +3165,12 @@ async def lease_options_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._lease_options_serialize( + _param = self._liquidations_serialize( + authorization=authorization, + account_index=account_index, + limit=limit, + market_id=market_id, + cursor=cursor, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3197,7 +3178,7 @@ async def lease_options_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetLeaseOptions", + '200': "LiquidationInfos", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -3207,8 +3188,13 @@ async def lease_options_without_preload_content( return response_data.response - def _lease_options_serialize( + def _liquidations_serialize( self, + authorization, + account_index, + limit, + market_id, + cursor, _request_auth, _content_type, _headers, @@ -3229,7 +3215,25 @@ def _lease_options_serialize( # process the path parameters # process the query parameters + if account_index is not None: + + _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)) + + if limit is not None: + + _query_params.append(('limit', limit)) + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -3249,7 +3253,7 @@ def _lease_options_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/leaseOptions', + resource_path='/api/v1/liquidations', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3265,13 +3269,12 @@ def _lease_options_serialize( - async def leases( + async def lit_lease( self, - account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - cursor: Optional[StrictStr] = None, - limit: Optional[StrictInt] = None, + tx_info: Annotated[StrictStr, Field(description="Signed transaction info (JSON with L2 signature, L1 signature, etc.)")], + lease_amount: Annotated[StrictStr, Field(description="Amount of LIT to lease in raw units (1 LIT = 100000000)")], + duration_days: Annotated[StrictInt, Field(description="Lease duration in days. Must match one of the available lease options.")], + authorization: Annotated[Optional[StrictStr], Field(description="API token authorization")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3284,21 +3287,19 @@ async def leases( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RespGetLeases: - """leases + ) -> TxHash: + """litLease - Get leases + Submit a LIT lease transfer. The server calculates the required fee based on lease_amount and duration_days, then executes the transfer. Fee formula (integer arithmetic): fee = lease_amount × (annual_rate × 100) × duration_days / (360 × 10000). - :param account_index: (required) - :type account_index: int - :param authorization: make required after integ is done + :param tx_info: Signed transaction info (JSON with L2 signature, L1 signature, etc.) (required) + :type tx_info: str + :param lease_amount: Amount of LIT to lease in raw units (1 LIT = 100000000) (required) + :type lease_amount: str + :param duration_days: Lease duration in days. Must match one of the available lease options. (required) + :type duration_days: int + :param authorization: API token authorization :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param cursor: - :type cursor: str - :param limit: - :type limit: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3321,12 +3322,11 @@ async def leases( :return: Returns the result object. """ # noqa: E501 - _param = self._leases_serialize( - account_index=account_index, + _param = self._lit_lease_serialize( + tx_info=tx_info, + lease_amount=lease_amount, + duration_days=duration_days, authorization=authorization, - auth=auth, - cursor=cursor, - limit=limit, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3334,7 +3334,7 @@ async def leases( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetLeases", + '200': "TxHash", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -3348,13 +3348,12 @@ async def leases( ).data - async def leases_with_http_info( + async def lit_lease_with_http_info( self, - account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - cursor: Optional[StrictStr] = None, - limit: Optional[StrictInt] = None, + tx_info: Annotated[StrictStr, Field(description="Signed transaction info (JSON with L2 signature, L1 signature, etc.)")], + lease_amount: Annotated[StrictStr, Field(description="Amount of LIT to lease in raw units (1 LIT = 100000000)")], + duration_days: Annotated[StrictInt, Field(description="Lease duration in days. Must match one of the available lease options.")], + authorization: Annotated[Optional[StrictStr], Field(description="API token authorization")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3367,21 +3366,19 @@ async def leases_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RespGetLeases]: - """leases + ) -> ApiResponse[TxHash]: + """litLease - Get leases + Submit a LIT lease transfer. The server calculates the required fee based on lease_amount and duration_days, then executes the transfer. Fee formula (integer arithmetic): fee = lease_amount × (annual_rate × 100) × duration_days / (360 × 10000). - :param account_index: (required) - :type account_index: int - :param authorization: make required after integ is done + :param tx_info: Signed transaction info (JSON with L2 signature, L1 signature, etc.) (required) + :type tx_info: str + :param lease_amount: Amount of LIT to lease in raw units (1 LIT = 100000000) (required) + :type lease_amount: str + :param duration_days: Lease duration in days. Must match one of the available lease options. (required) + :type duration_days: int + :param authorization: API token authorization :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param cursor: - :type cursor: str - :param limit: - :type limit: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3404,12 +3401,11 @@ async def leases_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._leases_serialize( - account_index=account_index, + _param = self._lit_lease_serialize( + tx_info=tx_info, + lease_amount=lease_amount, + duration_days=duration_days, authorization=authorization, - auth=auth, - cursor=cursor, - limit=limit, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3417,7 +3413,7 @@ async def leases_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetLeases", + '200': "TxHash", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -3431,13 +3427,12 @@ async def leases_with_http_info( ) - async def leases_without_preload_content( + async def lit_lease_without_preload_content( self, - account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - cursor: Optional[StrictStr] = None, - limit: Optional[StrictInt] = None, + tx_info: Annotated[StrictStr, Field(description="Signed transaction info (JSON with L2 signature, L1 signature, etc.)")], + lease_amount: Annotated[StrictStr, Field(description="Amount of LIT to lease in raw units (1 LIT = 100000000)")], + duration_days: Annotated[StrictInt, Field(description="Lease duration in days. Must match one of the available lease options.")], + authorization: Annotated[Optional[StrictStr], Field(description="API token authorization")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3451,20 +3446,18 @@ async def leases_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """leases + """litLease - Get leases + Submit a LIT lease transfer. The server calculates the required fee based on lease_amount and duration_days, then executes the transfer. Fee formula (integer arithmetic): fee = lease_amount × (annual_rate × 100) × duration_days / (360 × 10000). - :param account_index: (required) - :type account_index: int - :param authorization: make required after integ is done + :param tx_info: Signed transaction info (JSON with L2 signature, L1 signature, etc.) (required) + :type tx_info: str + :param lease_amount: Amount of LIT to lease in raw units (1 LIT = 100000000) (required) + :type lease_amount: str + :param duration_days: Lease duration in days. Must match one of the available lease options. (required) + :type duration_days: int + :param authorization: API token authorization :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param cursor: - :type cursor: str - :param limit: - :type limit: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3487,12 +3480,11 @@ async def leases_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._leases_serialize( - account_index=account_index, + _param = self._lit_lease_serialize( + tx_info=tx_info, + lease_amount=lease_amount, + duration_days=duration_days, authorization=authorization, - auth=auth, - cursor=cursor, - limit=limit, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3500,7 +3492,7 @@ async def leases_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetLeases", + '200': "TxHash", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -3510,13 +3502,12 @@ async def leases_without_preload_content( return response_data.response - def _leases_serialize( + def _lit_lease_serialize( self, - account_index, + tx_info, + lease_amount, + duration_days, authorization, - auth, - cursor, - limit, _request_auth, _content_type, _headers, @@ -3537,28 +3528,16 @@ def _leases_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)) - - if cursor is not None: - - _query_params.append(('cursor', cursor)) - - if limit is not None: - - _query_params.append(('limit', limit)) - # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters + if tx_info is not None: + _form_params.append(('tx_info', tx_info)) + if lease_amount is not None: + _form_params.append(('lease_amount', lease_amount)) + if duration_days is not None: + _form_params.append(('duration_days', duration_days)) # process the body parameter @@ -3570,14 +3549,27 @@ def _leases_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/leases', + method='POST', + resource_path='/api/v1/litLease', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3593,14 +3585,11 @@ def _leases_serialize( - async def liquidations( + async def partner_stats( self, account_index: StrictInt, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - market_id: Optional[StrictInt] = None, - cursor: Optional[StrictStr] = None, + start_timestamp: Optional[StrictInt] = None, + end_timestamp: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3613,23 +3602,17 @@ async def liquidations( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LiquidationInfos: - """liquidations + ) -> PartnerStats: + """partnerStats - Get liquidation infos + Get partner stats. If timestamps are not provided, all-time stats will be returned. :param account_index: (required) :type account_index: int - :param limit: (required) - :type limit: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param market_id: - :type market_id: int - :param cursor: - :type cursor: str + :param start_timestamp: + :type start_timestamp: int + :param end_timestamp: + :type end_timestamp: 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 @@ -3652,13 +3635,10 @@ async def liquidations( :return: Returns the result object. """ # noqa: E501 - _param = self._liquidations_serialize( + _param = self._partner_stats_serialize( account_index=account_index, - limit=limit, - authorization=authorization, - auth=auth, - market_id=market_id, - cursor=cursor, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3666,7 +3646,7 @@ async def liquidations( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LiquidationInfos", + '200': "PartnerStats", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -3680,14 +3660,11 @@ async def liquidations( ).data - async def liquidations_with_http_info( + async def partner_stats_with_http_info( self, account_index: StrictInt, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - market_id: Optional[StrictInt] = None, - cursor: Optional[StrictStr] = None, + start_timestamp: Optional[StrictInt] = None, + end_timestamp: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3700,23 +3677,17 @@ async def liquidations_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LiquidationInfos]: - """liquidations + ) -> ApiResponse[PartnerStats]: + """partnerStats - Get liquidation infos + Get partner stats. If timestamps are not provided, all-time stats will be returned. :param account_index: (required) :type account_index: int - :param limit: (required) - :type limit: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param market_id: - :type market_id: int - :param cursor: - :type cursor: str + :param start_timestamp: + :type start_timestamp: int + :param end_timestamp: + :type end_timestamp: 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 @@ -3739,13 +3710,10 @@ async def liquidations_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._liquidations_serialize( + _param = self._partner_stats_serialize( account_index=account_index, - limit=limit, - authorization=authorization, - auth=auth, - market_id=market_id, - cursor=cursor, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3753,7 +3721,7 @@ async def liquidations_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LiquidationInfos", + '200': "PartnerStats", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -3767,14 +3735,11 @@ async def liquidations_with_http_info( ) - async def liquidations_without_preload_content( + async def partner_stats_without_preload_content( self, account_index: StrictInt, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - market_id: Optional[StrictInt] = None, - cursor: Optional[StrictStr] = None, + start_timestamp: Optional[StrictInt] = None, + end_timestamp: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3788,22 +3753,16 @@ async def liquidations_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """liquidations + """partnerStats - Get liquidation infos + Get partner stats. If timestamps are not provided, all-time stats will be returned. :param account_index: (required) :type account_index: int - :param limit: (required) - :type limit: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param market_id: - :type market_id: int - :param cursor: - :type cursor: str + :param start_timestamp: + :type start_timestamp: int + :param end_timestamp: + :type end_timestamp: 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 @@ -3826,13 +3785,10 @@ async def liquidations_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._liquidations_serialize( + _param = self._partner_stats_serialize( account_index=account_index, - limit=limit, - authorization=authorization, - auth=auth, - market_id=market_id, - cursor=cursor, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3840,7 +3796,7 @@ async def liquidations_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LiquidationInfos", + '200': "PartnerStats", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -3850,14 +3806,11 @@ async def liquidations_without_preload_content( return response_data.response - def _liquidations_serialize( + def _partner_stats_serialize( self, account_index, - limit, - authorization, - auth, - market_id, - cursor, + start_timestamp, + end_timestamp, _request_auth, _content_type, _headers, @@ -3878,29 +3831,17 @@ def _liquidations_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - if account_index is not None: _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: + if start_timestamp is not None: - _query_params.append(('cursor', cursor)) + _query_params.append(('start_timestamp', start_timestamp)) - if limit is not None: + if end_timestamp is not None: - _query_params.append(('limit', limit)) + _query_params.append(('end_timestamp', end_timestamp)) # process the header parameters # process the form parameters @@ -3922,7 +3863,7 @@ def _liquidations_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/liquidations', + resource_path='/api/v1/partnerStats', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3938,12 +3879,16 @@ def _liquidations_serialize( - async def lit_lease( + async def pnl( self, - tx_info: StrictStr, - lease_amount: StrictStr, - duration_days: StrictInt, + by: StrictStr, + value: StrictStr, + 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, authorization: Optional[StrictStr] = None, + ignore_transfers: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3956,19 +3901,27 @@ async def lit_lease( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TxHash: - """litLease + ) -> AccountPnL: + """pnl - Submit LIT lease transfer + Get account PnL chart - :param tx_info: (required) - :type tx_info: str - :param lease_amount: (required) - :type lease_amount: str - :param duration_days: (required) - :type duration_days: int + :param by: (required) + :type by: str + :param value: (required) + :type value: str + :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 authorization: :type authorization: str + :param ignore_transfers: + :type ignore_transfers: 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 @@ -3991,11 +3944,15 @@ async def lit_lease( :return: Returns the result object. """ # noqa: E501 - _param = self._lit_lease_serialize( - tx_info=tx_info, - lease_amount=lease_amount, - duration_days=duration_days, + _param = self._pnl_serialize( + by=by, + value=value, + resolution=resolution, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + count_back=count_back, authorization=authorization, + ignore_transfers=ignore_transfers, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4003,7 +3960,7 @@ async def lit_lease( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TxHash", + '200': "AccountPnL", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -4017,12 +3974,16 @@ async def lit_lease( ).data - async def lit_lease_with_http_info( + async def pnl_with_http_info( self, - tx_info: StrictStr, - lease_amount: StrictStr, - duration_days: StrictInt, + by: StrictStr, + value: StrictStr, + 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, authorization: Optional[StrictStr] = None, + ignore_transfers: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4035,19 +3996,27 @@ async def lit_lease_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[TxHash]: - """litLease + ) -> ApiResponse[AccountPnL]: + """pnl - Submit LIT lease transfer + Get account PnL chart - :param tx_info: (required) - :type tx_info: str - :param lease_amount: (required) - :type lease_amount: str - :param duration_days: (required) - :type duration_days: int + :param by: (required) + :type by: str + :param value: (required) + :type value: str + :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 authorization: :type authorization: str + :param ignore_transfers: + :type ignore_transfers: 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 @@ -4070,11 +4039,15 @@ async def lit_lease_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._lit_lease_serialize( - tx_info=tx_info, - lease_amount=lease_amount, - duration_days=duration_days, + _param = self._pnl_serialize( + by=by, + value=value, + resolution=resolution, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + count_back=count_back, authorization=authorization, + ignore_transfers=ignore_transfers, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4082,7 +4055,7 @@ async def lit_lease_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TxHash", + '200': "AccountPnL", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -4096,12 +4069,16 @@ async def lit_lease_with_http_info( ) - async def lit_lease_without_preload_content( + async def pnl_without_preload_content( self, - tx_info: StrictStr, - lease_amount: StrictStr, - duration_days: StrictInt, + by: StrictStr, + value: StrictStr, + 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, authorization: Optional[StrictStr] = None, + ignore_transfers: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4115,18 +4092,26 @@ async def lit_lease_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """litLease + """pnl - Submit LIT lease transfer + Get account PnL chart - :param tx_info: (required) - :type tx_info: str - :param lease_amount: (required) - :type lease_amount: str - :param duration_days: (required) - :type duration_days: int + :param by: (required) + :type by: str + :param value: (required) + :type value: str + :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 authorization: :type authorization: str + :param ignore_transfers: + :type ignore_transfers: 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 @@ -4149,11 +4134,15 @@ async def lit_lease_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._lit_lease_serialize( - tx_info=tx_info, - lease_amount=lease_amount, - duration_days=duration_days, + _param = self._pnl_serialize( + by=by, + value=value, + resolution=resolution, + start_timestamp=start_timestamp, + end_timestamp=end_timestamp, + count_back=count_back, authorization=authorization, + ignore_transfers=ignore_transfers, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4161,7 +4150,7 @@ async def lit_lease_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TxHash", + '200': "AccountPnL", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -4171,12 +4160,16 @@ async def lit_lease_without_preload_content( return response_data.response - def _lit_lease_serialize( + def _pnl_serialize( self, - tx_info, - lease_amount, - duration_days, + by, + value, + resolution, + start_timestamp, + end_timestamp, + count_back, authorization, + ignore_transfers, _request_auth, _content_type, _headers, @@ -4197,48 +4190,57 @@ def _lit_lease_serialize( # process the path parameters # process the query parameters - # process the header parameters - if authorization is not None: - _header_params['authorization'] = authorization - # process the form parameters - if tx_info is not None: - _form_params.append(('tx_info', tx_info)) - if lease_amount is not None: - _form_params.append(('lease_amount', lease_amount)) - if duration_days is not None: - _form_params.append(('duration_days', duration_days)) - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'multipart/form-data' - ] - ) + if by is not None: + + _query_params.append(('by', by)) + + if value is not None: + + _query_params.append(('value', value)) + + 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)) + + if ignore_transfers is not None: + + _query_params.append(('ignore_transfers', ignore_transfers)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/litLease', + method='GET', + resource_path='/api/v1/pnl', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4254,30 +4256,45 @@ def _lit_lease_serialize( - async def partner_stats( - self, - account_index: StrictInt, - start_timestamp: Optional[StrictInt] = None, - end_timestamp: Optional[StrictInt] = None, - _request_timeout: Union[ - None, + async def position_funding( + self, + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ 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, - ) -> PartnerStats: - """partnerStats + 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, + ) -> PositionFundings: + """positionFunding - Get partner stats + Get accounts position fundings :param account_index: (required) :type account_index: int + :param limit: (required) + :type limit: int + :param authorization: + :type authorization: str + :param market_id: + :type market_id: int + :param cursor: + :type cursor: str + :param side: + :type side: str :param start_timestamp: :type start_timestamp: int :param end_timestamp: @@ -4302,10 +4319,15 @@ async def partner_stats( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._partner_stats_serialize( + _param = self._position_funding_serialize( account_index=account_index, + limit=limit, + authorization=authorization, + market_id=market_id, + cursor=cursor, + side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp, _request_auth=_request_auth, @@ -4315,7 +4337,7 @@ async def partner_stats( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PartnerStats", + '200': "PositionFundings", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -4328,30 +4350,46 @@ async def partner_stats( response_types_map=_response_types_map, ).data - async def partner_stats_with_http_info( - self, - account_index: StrictInt, - start_timestamp: Optional[StrictInt] = None, - end_timestamp: Optional[StrictInt] = None, - _request_timeout: Union[ - None, + + async def position_funding_with_http_info( + self, + account_index: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + authorization: Optional[StrictStr] = None, + market_id: Optional[StrictInt] = None, + cursor: Optional[StrictStr] = None, + side: Optional[StrictStr] = None, + start_timestamp: Optional[StrictInt] = None, + end_timestamp: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ 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[PartnerStats]: - """partnerStats + 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[PositionFundings]: + """positionFunding - Get partner stats + Get accounts position fundings :param account_index: (required) :type account_index: int + :param limit: (required) + :type limit: int + :param authorization: + :type authorization: str + :param market_id: + :type market_id: int + :param cursor: + :type cursor: str + :param side: + :type side: str :param start_timestamp: :type start_timestamp: int :param end_timestamp: @@ -4376,10 +4414,15 @@ async def partner_stats_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._partner_stats_serialize( + _param = self._position_funding_serialize( account_index=account_index, + limit=limit, + authorization=authorization, + market_id=market_id, + cursor=cursor, + side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp, _request_auth=_request_auth, @@ -4389,7 +4432,7 @@ async def partner_stats_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PartnerStats", + '200': "PositionFundings", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -4402,30 +4445,46 @@ async def partner_stats_with_http_info( response_types_map=_response_types_map, ) - async def partner_stats_without_preload_content( - self, - account_index: StrictInt, - start_timestamp: Optional[StrictInt] = None, - end_timestamp: Optional[StrictInt] = None, - _request_timeout: Union[ - None, + + async def position_funding_without_preload_content( + self, + account_index: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + authorization: Optional[StrictStr] = None, + market_id: Optional[StrictInt] = None, + cursor: Optional[StrictStr] = None, + side: Optional[StrictStr] = None, + start_timestamp: Optional[StrictInt] = None, + end_timestamp: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ 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, + 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: - """partnerStats + """positionFunding - Get partner stats + Get accounts position fundings :param account_index: (required) :type account_index: int + :param limit: (required) + :type limit: int + :param authorization: + :type authorization: str + :param market_id: + :type market_id: int + :param cursor: + :type cursor: str + :param side: + :type side: str :param start_timestamp: :type start_timestamp: int :param end_timestamp: @@ -4450,10 +4509,15 @@ async def partner_stats_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 + """ # noqa: E501 - _param = self._partner_stats_serialize( + _param = self._position_funding_serialize( account_index=account_index, + limit=limit, + authorization=authorization, + market_id=market_id, + cursor=cursor, + side=side, start_timestamp=start_timestamp, end_timestamp=end_timestamp, _request_auth=_request_auth, @@ -4463,7 +4527,7 @@ async def partner_stats_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PartnerStats", + '200': "PositionFundings", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -4472,15 +4536,21 @@ async def partner_stats_without_preload_content( ) return response_data.response - def _partner_stats_serialize( - self, - account_index, - start_timestamp, - end_timestamp, - _request_auth, - _content_type, - _headers, - _host_index, + + def _position_funding_serialize( + self, + account_index, + limit, + authorization, + market_id, + cursor, + side, + start_timestamp, + end_timestamp, + _request_auth, + _content_type, + _headers, + _host_index, ) -> RequestSerialized: _host = None @@ -4498,18 +4568,40 @@ def _partner_stats_serialize( # process the path parameters # process the query parameters if account_index is not None: + _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)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if side is not None: + + _query_params.append(('side', side)) + 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)) - + # 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( @@ -4518,13 +4610,14 @@ def _partner_stats_serialize( ] ) + # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/partnerStats', + resource_path='/api/v1/positionFunding', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4540,17 +4633,13 @@ def _partner_stats_serialize( - async def pnl( + async def public_pools_metadata( self, - by: StrictStr, - value: StrictStr, - 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, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - ignore_transfers: Optional[StrictBool] = None, + index: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + authorization: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, + account_index: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4563,29 +4652,21 @@ async def pnl( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AccountPnL: - """pnl + ) -> RespPublicPoolsMetadata: + """publicPoolsMetadata - Get account PnL chart + Get public pools metadata. `auth` is required in case you specify an account_index. You will see public pools with an index that starts an n-1 of the one you specify. To see staking pools, use `filter=stake` - :param by: (required) - :type by: str - :param value: (required) - :type value: str - :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 authorization: make required after integ is done + :param index: (required) + :type index: int + :param limit: (required) + :type limit: int + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param ignore_transfers: - :type ignore_transfers: bool + :param filter: + :type filter: 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 @@ -4608,16 +4689,12 @@ async def pnl( :return: Returns the result object. """ # noqa: E501 - _param = self._pnl_serialize( - by=by, - value=value, - resolution=resolution, - start_timestamp=start_timestamp, - end_timestamp=end_timestamp, - count_back=count_back, + _param = self._public_pools_metadata_serialize( + index=index, + limit=limit, authorization=authorization, - auth=auth, - ignore_transfers=ignore_transfers, + filter=filter, + account_index=account_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4625,7 +4702,7 @@ async def pnl( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountPnL", + '200': "RespPublicPoolsMetadata", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -4639,17 +4716,13 @@ async def pnl( ).data - async def pnl_with_http_info( + async def public_pools_metadata_with_http_info( self, - by: StrictStr, - value: StrictStr, - 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, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - ignore_transfers: Optional[StrictBool] = None, + index: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + authorization: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, + account_index: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4662,29 +4735,21 @@ async def pnl_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AccountPnL]: - """pnl + ) -> ApiResponse[RespPublicPoolsMetadata]: + """publicPoolsMetadata - Get account PnL chart + Get public pools metadata. `auth` is required in case you specify an account_index. You will see public pools with an index that starts an n-1 of the one you specify. To see staking pools, use `filter=stake` - :param by: (required) - :type by: str - :param value: (required) - :type value: str - :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 authorization: make required after integ is done + :param index: (required) + :type index: int + :param limit: (required) + :type limit: int + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param ignore_transfers: - :type ignore_transfers: bool + :param filter: + :type filter: 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 @@ -4707,16 +4772,12 @@ async def pnl_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._pnl_serialize( - by=by, - value=value, - resolution=resolution, - start_timestamp=start_timestamp, - end_timestamp=end_timestamp, - count_back=count_back, + _param = self._public_pools_metadata_serialize( + index=index, + limit=limit, authorization=authorization, - auth=auth, - ignore_transfers=ignore_transfers, + filter=filter, + account_index=account_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4724,7 +4785,7 @@ async def pnl_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountPnL", + '200': "RespPublicPoolsMetadata", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -4738,17 +4799,13 @@ async def pnl_with_http_info( ) - async def pnl_without_preload_content( + async def public_pools_metadata_without_preload_content( self, - by: StrictStr, - value: StrictStr, - 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, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - ignore_transfers: Optional[StrictBool] = None, + index: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + authorization: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, + account_index: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4762,28 +4819,20 @@ async def pnl_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """pnl + """publicPoolsMetadata - Get account PnL chart + Get public pools metadata. `auth` is required in case you specify an account_index. You will see public pools with an index that starts an n-1 of the one you specify. To see staking pools, use `filter=stake` - :param by: (required) - :type by: str - :param value: (required) - :type value: str - :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 authorization: make required after integ is done + :param index: (required) + :type index: int + :param limit: (required) + :type limit: int + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param ignore_transfers: - :type ignore_transfers: bool + :param filter: + :type filter: 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 @@ -4806,16 +4855,12 @@ async def pnl_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._pnl_serialize( - by=by, - value=value, - resolution=resolution, - start_timestamp=start_timestamp, - end_timestamp=end_timestamp, - count_back=count_back, + _param = self._public_pools_metadata_serialize( + index=index, + limit=limit, authorization=authorization, - auth=auth, - ignore_transfers=ignore_transfers, + filter=filter, + account_index=account_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4823,7 +4868,7 @@ async def pnl_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AccountPnL", + '200': "RespPublicPoolsMetadata", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -4833,17 +4878,13 @@ async def pnl_without_preload_content( return response_data.response - def _pnl_serialize( + def _public_pools_metadata_serialize( self, - by, - value, - resolution, - start_timestamp, - end_timestamp, - count_back, + index, + limit, authorization, - auth, - ignore_transfers, + filter, + account_index, _request_auth, _content_type, _headers, @@ -4864,43 +4905,25 @@ def _pnl_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - - if by is not None: - - _query_params.append(('by', by)) - - if value is not None: - - _query_params.append(('value', value)) - - if resolution is not None: - - _query_params.append(('resolution', resolution)) - - if start_timestamp is not None: + if filter is not None: - _query_params.append(('start_timestamp', start_timestamp)) + _query_params.append(('filter', filter)) - if end_timestamp is not None: + if index is not None: - _query_params.append(('end_timestamp', end_timestamp)) + _query_params.append(('index', index)) - if count_back is not None: + if limit is not None: - _query_params.append(('count_back', count_back)) + _query_params.append(('limit', limit)) - if ignore_transfers is not None: + if account_index is not None: - _query_params.append(('ignore_transfers', ignore_transfers)) + _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 @@ -4920,7 +4943,7 @@ def _pnl_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/pnl', + resource_path='/api/v1/publicPoolsMetadata', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4936,15 +4959,15 @@ def _pnl_serialize( - async def position_funding( + async def referral_user_referrals( self, - account_index: StrictInt, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - market_id: Optional[StrictInt] = None, + l1_address: StrictStr, + authorization: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, - side: 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, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4957,25 +4980,25 @@ async def position_funding( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PositionFundings: - """positionFunding + ) -> UserReferrals: + """userReferrals - Get accounts position fundings + Get user referrals - :param account_index: (required) - :type account_index: int - :param limit: (required) - :type limit: int - :param authorization: make required after integ is done + :param l1_address: (required) + :type l1_address: str + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param market_id: - :type market_id: int :param cursor: :type cursor: str - :param side: - :type side: 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 _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 @@ -4998,14 +5021,14 @@ async def position_funding( :return: Returns the result object. """ # noqa: E501 - _param = self._position_funding_serialize( - account_index=account_index, - limit=limit, + _param = self._referral_user_referrals_serialize( + l1_address=l1_address, authorization=authorization, - auth=auth, - market_id=market_id, cursor=cursor, - side=side, + auth=auth, + stats_start_timestamp=stats_start_timestamp, + stats_end_timestamp=stats_end_timestamp, + limit=limit, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5013,7 +5036,7 @@ async def position_funding( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PositionFundings", + '200': "UserReferrals", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -5027,15 +5050,15 @@ async def position_funding( ).data - async def position_funding_with_http_info( + async def referral_user_referrals_with_http_info( self, - account_index: StrictInt, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - market_id: Optional[StrictInt] = None, + l1_address: StrictStr, + authorization: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, - side: 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, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5048,25 +5071,25 @@ async def position_funding_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PositionFundings]: - """positionFunding + ) -> ApiResponse[UserReferrals]: + """userReferrals - Get accounts position fundings + Get user referrals - :param account_index: (required) - :type account_index: int - :param limit: (required) - :type limit: int - :param authorization: make required after integ is done + :param l1_address: (required) + :type l1_address: str + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param market_id: - :type market_id: int :param cursor: :type cursor: str - :param side: - :type side: 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 _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 @@ -5089,14 +5112,14 @@ async def position_funding_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._position_funding_serialize( - account_index=account_index, - limit=limit, + _param = self._referral_user_referrals_serialize( + l1_address=l1_address, authorization=authorization, - auth=auth, - market_id=market_id, cursor=cursor, - side=side, + auth=auth, + stats_start_timestamp=stats_start_timestamp, + stats_end_timestamp=stats_end_timestamp, + limit=limit, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5104,7 +5127,7 @@ async def position_funding_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PositionFundings", + '200': "UserReferrals", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -5118,15 +5141,15 @@ async def position_funding_with_http_info( ) - async def position_funding_without_preload_content( + async def referral_user_referrals_without_preload_content( self, - account_index: StrictInt, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - market_id: Optional[StrictInt] = None, + l1_address: StrictStr, + authorization: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, - side: 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, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5140,24 +5163,24 @@ async def position_funding_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """positionFunding + """userReferrals - Get accounts position fundings + Get user referrals - :param account_index: (required) - :type account_index: int - :param limit: (required) - :type limit: int - :param authorization: make required after integ is done + :param l1_address: (required) + :type l1_address: str + :param authorization: :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param market_id: - :type market_id: int :param cursor: :type cursor: str - :param side: - :type side: 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 _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 @@ -5180,14 +5203,14 @@ async def position_funding_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._position_funding_serialize( - account_index=account_index, - limit=limit, + _param = self._referral_user_referrals_serialize( + l1_address=l1_address, authorization=authorization, - auth=auth, - market_id=market_id, cursor=cursor, - side=side, + auth=auth, + stats_start_timestamp=stats_start_timestamp, + stats_end_timestamp=stats_end_timestamp, + limit=limit, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5195,7 +5218,7 @@ async def position_funding_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "PositionFundings", + '200': "UserReferrals", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -5205,15 +5228,15 @@ async def position_funding_without_preload_content( return response_data.response - def _position_funding_serialize( + def _referral_user_referrals_serialize( self, - account_index, - limit, + l1_address, authorization, - auth, - market_id, cursor, - side, + auth, + stats_start_timestamp, + stats_end_timestamp, + limit, _request_auth, _content_type, _headers, @@ -5234,35 +5257,33 @@ def _position_funding_serialize( # process the path parameters # process the query parameters - if authorization is not None: + if l1_address is not None: - _query_params.append(('authorization', authorization)) + _query_params.append(('l1_address', l1_address)) - if auth is not None: + if cursor is not None: - _query_params.append(('auth', auth)) + _query_params.append(('cursor', cursor)) - if account_index is not None: + if auth is not None: - _query_params.append(('account_index', account_index)) + _query_params.append(('auth', auth)) - if market_id is not None: + if stats_start_timestamp is not None: - _query_params.append(('market_id', market_id)) + _query_params.append(('stats_start_timestamp', stats_start_timestamp)) - if cursor is not None: + if stats_end_timestamp is not None: - _query_params.append(('cursor', cursor)) + _query_params.append(('stats_end_timestamp', stats_end_timestamp)) if limit is not None: _query_params.append(('limit', limit)) - if side is not None: - - _query_params.append(('side', side)) - # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -5282,7 +5303,7 @@ def _position_funding_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/positionFunding', + resource_path='/api/v1/referral/userReferrals', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5298,14 +5319,12 @@ def _position_funding_serialize( - async def public_pools_metadata( + async def set_maker_only_api_keys( self, - index: StrictInt, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - filter: Optional[StrictStr] = None, - account_index: Optional[StrictInt] = None, + 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)], @@ -5318,23 +5337,19 @@ async def public_pools_metadata( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RespPublicPoolsMetadata: - """publicPoolsMetadata + ) -> RespSetMakerOnlyApiKeys: + """setMakerOnlyApiKeys - Get public pools metadata + Set maker-only API key indexes. This replaces the current list; pass all indexes you want marked as maker-only. Pass [] to clear all maker-only restrictions. - :param index: (required) - :type index: int - :param limit: (required) - :type limit: int - :param authorization: make required after integ is done + :param authorization: (required) :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param filter: - :type filter: str - :param account_index: + :param account_index: (required) :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 @@ -5357,13 +5372,11 @@ async def public_pools_metadata( :return: Returns the result object. """ # noqa: E501 - _param = self._public_pools_metadata_serialize( - index=index, - limit=limit, + _param = self._set_maker_only_api_keys_serialize( authorization=authorization, - auth=auth, - filter=filter, account_index=account_index, + api_key_indexes=api_key_indexes, + auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5371,7 +5384,7 @@ async def public_pools_metadata( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespPublicPoolsMetadata", + '200': "RespSetMakerOnlyApiKeys", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -5385,14 +5398,12 @@ async def public_pools_metadata( ).data - async def public_pools_metadata_with_http_info( + async def set_maker_only_api_keys_with_http_info( self, - index: StrictInt, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - filter: Optional[StrictStr] = None, - account_index: Optional[StrictInt] = None, + 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)], @@ -5405,23 +5416,19 @@ async def public_pools_metadata_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RespPublicPoolsMetadata]: - """publicPoolsMetadata + ) -> ApiResponse[RespSetMakerOnlyApiKeys]: + """setMakerOnlyApiKeys - Get public pools metadata + Set maker-only API key indexes. This replaces the current list; pass all indexes you want marked as maker-only. Pass [] to clear all maker-only restrictions. - :param index: (required) - :type index: int - :param limit: (required) - :type limit: int - :param authorization: make required after integ is done + :param authorization: (required) :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param filter: - :type filter: str - :param account_index: + :param account_index: (required) :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 @@ -5444,13 +5451,11 @@ async def public_pools_metadata_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._public_pools_metadata_serialize( - index=index, - limit=limit, + _param = self._set_maker_only_api_keys_serialize( authorization=authorization, - auth=auth, - filter=filter, account_index=account_index, + api_key_indexes=api_key_indexes, + auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5458,7 +5463,7 @@ async def public_pools_metadata_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespPublicPoolsMetadata", + '200': "RespSetMakerOnlyApiKeys", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -5472,14 +5477,12 @@ async def public_pools_metadata_with_http_info( ) - async def public_pools_metadata_without_preload_content( + async def set_maker_only_api_keys_without_preload_content( self, - index: StrictInt, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - filter: Optional[StrictStr] = None, - account_index: Optional[StrictInt] = None, + 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)], @@ -5493,22 +5496,18 @@ async def public_pools_metadata_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """publicPoolsMetadata + """setMakerOnlyApiKeys - Get public pools metadata + Set maker-only API key indexes. This replaces the current list; pass all indexes you want marked as maker-only. Pass [] to clear all maker-only restrictions. - :param index: (required) - :type index: int - :param limit: (required) - :type limit: int - :param authorization: make required after integ is done + :param authorization: (required) :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param filter: - :type filter: str - :param account_index: + :param account_index: (required) :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 @@ -5531,13 +5530,11 @@ async def public_pools_metadata_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._public_pools_metadata_serialize( - index=index, - limit=limit, + _param = self._set_maker_only_api_keys_serialize( authorization=authorization, - auth=auth, - filter=filter, account_index=account_index, + api_key_indexes=api_key_indexes, + auth=auth, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5545,7 +5542,7 @@ async def public_pools_metadata_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespPublicPoolsMetadata", + '200': "RespSetMakerOnlyApiKeys", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -5555,14 +5552,12 @@ async def public_pools_metadata_without_preload_content( return response_data.response - def _public_pools_metadata_serialize( + def _set_maker_only_api_keys_serialize( self, - index, - limit, authorization, - auth, - filter, account_index, + api_key_indexes, + auth, _request_auth, _content_type, _headers, @@ -5583,32 +5578,16 @@ def _public_pools_metadata_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - - if filter is not None: - - _query_params.append(('filter', filter)) - - if index is not None: - - _query_params.append(('index', index)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - 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 + if account_index is not None: + _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 @@ -5620,14 +5599,28 @@ def _public_pools_metadata_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/publicPoolsMetadata', + method='POST', + resource_path='/api/v1/setMakerOnlyApiKeys', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5662,7 +5655,7 @@ async def tokens( ) -> RespGetApiTokens: """tokens - Get api tokens of an account + Get read only auth tokens for an account :param account_index: (required) :type account_index: int @@ -5733,7 +5726,7 @@ async def tokens_with_http_info( ) -> ApiResponse[RespGetApiTokens]: """tokens - Get api tokens of an account + Get read only auth tokens for an account :param account_index: (required) :type account_index: int @@ -5804,7 +5797,7 @@ async def tokens_without_preload_content( ) -> RESTResponseType: """tokens - Get api tokens of an account + Get read only auth tokens for an account :param account_index: (required) :type account_index: int @@ -5941,7 +5934,7 @@ async def tokens_create( ) -> RespPostApiToken: """tokens_create - Create api token + Create an API token for read-only access :param name: (required) :type name: str @@ -6028,7 +6021,7 @@ async def tokens_create_with_http_info( ) -> ApiResponse[RespPostApiToken]: """tokens_create - Create api token + Create an API token for read-only access :param name: (required) :type name: str @@ -6115,7 +6108,7 @@ async def tokens_create_without_preload_content( ) -> RESTResponseType: """tokens_create - Create api token + Create an API token for read-only access :param name: (required) :type name: str @@ -6235,7 +6228,7 @@ def _tokens_create_serialize( _default_content_type = ( self.api_client.select_header_content_type( [ - 'multipart/form-data' + 'application/x-www-form-urlencoded' ] ) ) @@ -6284,7 +6277,7 @@ async def tokens_revoke( ) -> RespRevokeApiToken: """tokens_revoke - Revoke api token + Revoke read only auth token for an account :param token_id: (required) :type token_id: int @@ -6359,7 +6352,7 @@ async def tokens_revoke_with_http_info( ) -> ApiResponse[RespRevokeApiToken]: """tokens_revoke - Revoke api token + Revoke read only auth token for an account :param token_id: (required) :type token_id: int @@ -6434,7 +6427,7 @@ async def tokens_revoke_without_preload_content( ) -> RESTResponseType: """tokens_revoke - Revoke api token + Revoke read only auth token for an account :param token_id: (required) :type token_id: int @@ -6536,7 +6529,7 @@ def _tokens_revoke_serialize( _default_content_type = ( self.api_client.select_header_content_type( [ - 'multipart/form-data' + 'application/x-www-form-urlencoded' ] ) ) diff --git a/lighter/api/announcement_api.py b/lighter/api/announcement_api.py index 2f62113..73e255e 100644 --- a/lighter/api/announcement_api.py +++ b/lighter/api/announcement_api.py @@ -53,7 +53,7 @@ async def announcement( ) -> Announcements: """announcement - Get announcement + Get announcements :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -116,7 +116,7 @@ async def announcement_with_http_info( ) -> ApiResponse[Announcements]: """announcement - Get announcement + Get announcements :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -179,7 +179,7 @@ async def announcement_without_preload_content( ) -> RESTResponseType: """announcement - Get announcement + Get announcements :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/lighter/api/pushnotif_api.py b/lighter/api/block_api.py similarity index 53% rename from lighter/api/pushnotif_api.py rename to lighter/api/block_api.py index 3c0f4fd..1e7d109 100644 --- a/lighter/api/pushnotif_api.py +++ b/lighter/api/block_api.py @@ -16,18 +16,18 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator +from pydantic import Field, StrictInt, StrictStr, field_validator from typing import Optional from typing_extensions import Annotated -from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings -from lighter.models.result_code import ResultCode +from lighter.models.blocks import Blocks +from lighter.models.current_height import CurrentHeight from lighter.api_client import ApiClient, RequestSerialized from lighter.api_response import ApiResponse from lighter.rest import RESTResponseType -class PushnotifApi: +class BlockApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -40,12 +40,10 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - async def get_pushnotif_settings( + async def block( self, - account_index: StrictInt, - expo_token: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + by: StrictStr, + value: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -58,19 +56,15 @@ async def get_pushnotif_settings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RespGetPushNotifSettings: - """get_pushnotif_settings - - Get push notification settings - - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str + ) -> Blocks: + """block + + Get block by its height or commitment + + :param by: (required) + :type by: str + :param value: (required) + :type value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -93,11 +87,9 @@ async def get_pushnotif_settings( :return: Returns the result object. """ # noqa: E501 - _param = self._get_pushnotif_settings_serialize( - account_index=account_index, - expo_token=expo_token, - authorization=authorization, - auth=auth, + _param = self._block_serialize( + by=by, + value=value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -105,7 +97,7 @@ async def get_pushnotif_settings( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetPushNotifSettings", + '200': "Blocks", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -119,12 +111,10 @@ async def get_pushnotif_settings( ).data - async def get_pushnotif_settings_with_http_info( + async def block_with_http_info( self, - account_index: StrictInt, - expo_token: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + by: StrictStr, + value: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -137,19 +127,15 @@ async def get_pushnotif_settings_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RespGetPushNotifSettings]: - """get_pushnotif_settings - - Get push notification settings - - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str + ) -> ApiResponse[Blocks]: + """block + + Get block by its height or commitment + + :param by: (required) + :type by: str + :param value: (required) + :type value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -172,11 +158,9 @@ async def get_pushnotif_settings_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_pushnotif_settings_serialize( - account_index=account_index, - expo_token=expo_token, - authorization=authorization, - auth=auth, + _param = self._block_serialize( + by=by, + value=value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -184,7 +168,7 @@ async def get_pushnotif_settings_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetPushNotifSettings", + '200': "Blocks", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -198,12 +182,10 @@ async def get_pushnotif_settings_with_http_info( ) - async def get_pushnotif_settings_without_preload_content( + async def block_without_preload_content( self, - account_index: StrictInt, - expo_token: StrictStr, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + by: StrictStr, + value: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -217,18 +199,14 @@ async def get_pushnotif_settings_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_pushnotif_settings - - Get push notification settings - - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str + """block + + Get block by its height or commitment + + :param by: (required) + :type by: str + :param value: (required) + :type value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -251,11 +229,9 @@ async def get_pushnotif_settings_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_pushnotif_settings_serialize( - account_index=account_index, - expo_token=expo_token, - authorization=authorization, - auth=auth, + _param = self._block_serialize( + by=by, + value=value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -263,7 +239,7 @@ async def get_pushnotif_settings_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetPushNotifSettings", + '200': "Blocks", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -273,12 +249,10 @@ async def get_pushnotif_settings_without_preload_content( return response_data.response - def _get_pushnotif_settings_serialize( + def _block_serialize( self, - account_index, - expo_token, - authorization, - auth, + by, + value, _request_auth, _content_type, _headers, @@ -299,21 +273,13 @@ def _get_pushnotif_settings_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: + if by is not None: - _query_params.append(('auth', auth)) + _query_params.append(('by', by)) - if account_index is not None: + if value is not None: - _query_params.append(('account_index', account_index)) - - if expo_token is not None: - - _query_params.append(('expo_token', expo_token)) + _query_params.append(('value', value)) # process the header parameters # process the form parameters @@ -335,7 +301,7 @@ def _get_pushnotif_settings_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/pushnotif/settings', + resource_path='/api/v1/block', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -351,12 +317,11 @@ def _get_pushnotif_settings_serialize( - async def post_pushnotif_settings( + async def blocks( self, - account_index: StrictInt, - expo_token: StrictStr, - enabled: StrictBool, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + index: Optional[StrictInt] = None, + sort: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -369,98 +334,17 @@ async def post_pushnotif_settings( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ResultCode: - """post_pushnotif_settings - - Update push notification settings - - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param enabled: (required) - :type enabled: bool - :param auth: made optional to support header auth clients - :type auth: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_pushnotif_settings_serialize( - account_index=account_index, - expo_token=expo_token, - enabled=enabled, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + ) -> Blocks: + """blocks + Get blocks - async def post_pushnotif_settings_with_http_info( - self, - account_index: StrictInt, - expo_token: StrictStr, - enabled: StrictBool, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ResultCode]: - """post_pushnotif_settings - - Update push notification settings - - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param enabled: (required) - :type enabled: bool - :param auth: made optional to support header auth clients - :type auth: str + :param limit: (required) + :type limit: int + :param index: + :type index: int + :param sort: + :type sort: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -483,11 +367,10 @@ async def post_pushnotif_settings_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._post_pushnotif_settings_serialize( - account_index=account_index, - expo_token=expo_token, - enabled=enabled, - auth=auth, + _param = self._blocks_serialize( + limit=limit, + index=index, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -495,7 +378,7 @@ async def post_pushnotif_settings_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", + '200': "Blocks", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -506,174 +389,14 @@ async def post_pushnotif_settings_with_http_info( return self.api_client.response_deserialize( response_data=response_data, response_types_map=_response_types_map, - ) - - - async def post_pushnotif_settings_without_preload_content( - self, - account_index: StrictInt, - expo_token: StrictStr, - enabled: StrictBool, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """post_pushnotif_settings - - Update push notification settings - - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param enabled: (required) - :type enabled: bool - :param auth: made optional to support header auth clients - :type auth: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_pushnotif_settings_serialize( - account_index=account_index, - expo_token=expo_token, - enabled=enabled, - auth=auth, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _post_pushnotif_settings_serialize( - self, - account_index, - expo_token, - enabled, - auth, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) - if account_index is not None: - _form_params.append(('account_index', account_index)) - if expo_token is not None: - _form_params.append(('expo_token', expo_token)) - if enabled is not None: - _form_params.append(('enabled', enabled)) - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'multipart/form-data' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/pushnotif/settings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + ).data - async def pushnotif_register( + async def blocks_with_http_info( self, - account_index: StrictInt, - expo_token: StrictStr, - platform: StrictStr, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - app_version: Optional[StrictStr] = None, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + index: Optional[StrictInt] = None, + sort: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -686,104 +409,17 @@ async def pushnotif_register( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ResultCode: - """pushnotif_register - - Register device for push notifications - - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param platform: (required) - :type platform: str - :param auth: made optional to support header auth clients - :type auth: str - :param app_version: - :type app_version: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + ) -> ApiResponse[Blocks]: + """blocks - _param = self._pushnotif_register_serialize( - account_index=account_index, - expo_token=expo_token, - platform=platform, - auth=auth, - app_version=app_version, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + Get blocks - _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - async def pushnotif_register_with_http_info( - self, - account_index: StrictInt, - expo_token: StrictStr, - platform: StrictStr, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - app_version: Optional[StrictStr] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ResultCode]: - """pushnotif_register - - Register device for push notifications - - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param platform: (required) - :type platform: str - :param auth: made optional to support header auth clients - :type auth: str - :param app_version: - :type app_version: str + :param limit: (required) + :type limit: int + :param index: + :type index: int + :param sort: + :type sort: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -806,12 +442,10 @@ async def pushnotif_register_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._pushnotif_register_serialize( - account_index=account_index, - expo_token=expo_token, - platform=platform, - auth=auth, - app_version=app_version, + _param = self._blocks_serialize( + limit=limit, + index=index, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -819,7 +453,7 @@ async def pushnotif_register_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", + '200': "Blocks", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -833,13 +467,11 @@ async def pushnotif_register_with_http_info( ) - async def pushnotif_register_without_preload_content( + async def blocks_without_preload_content( self, - account_index: StrictInt, - expo_token: StrictStr, - platform: StrictStr, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - app_version: Optional[StrictStr] = None, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + index: Optional[StrictInt] = None, + sort: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -853,20 +485,16 @@ async def pushnotif_register_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """pushnotif_register - - Register device for push notifications - - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param platform: (required) - :type platform: str - :param auth: made optional to support header auth clients - :type auth: str - :param app_version: - :type app_version: str + """blocks + + Get blocks + + :param limit: (required) + :type limit: int + :param index: + :type index: int + :param sort: + :type sort: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -889,12 +517,10 @@ async def pushnotif_register_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._pushnotif_register_serialize( - account_index=account_index, - expo_token=expo_token, - platform=platform, - auth=auth, - app_version=app_version, + _param = self._blocks_serialize( + limit=limit, + index=index, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -902,7 +528,7 @@ async def pushnotif_register_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", + '200': "Blocks", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -912,13 +538,11 @@ async def pushnotif_register_without_preload_content( return response_data.response - def _pushnotif_register_serialize( + def _blocks_serialize( self, - account_index, - expo_token, - platform, - auth, - app_version, + limit, + index, + sort, _request_auth, _content_type, _headers, @@ -939,18 +563,20 @@ def _pushnotif_register_serialize( # process the path parameters # process the query parameters + if index is not None: + + _query_params.append(('index', index)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + # process the header parameters # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) - if account_index is not None: - _form_params.append(('account_index', account_index)) - if expo_token is not None: - _form_params.append(('expo_token', expo_token)) - if platform is not None: - _form_params.append(('platform', platform)) - if app_version is not None: - _form_params.append(('app_version', app_version)) # process the body parameter @@ -962,27 +588,14 @@ def _pushnotif_register_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'multipart/form-data' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/pushnotif/register', + method='GET', + resource_path='/api/v1/blocks', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -998,11 +611,8 @@ def _pushnotif_register_serialize( - async def pushnotif_unregister( + async def current_height( self, - account_index: StrictInt, - expo_token: StrictStr, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1015,17 +625,11 @@ async def pushnotif_unregister( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ResultCode: - """pushnotif_unregister + ) -> CurrentHeight: + """currentHeight - Unregister device from push notifications + Get current height - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param auth: made optional to support header auth clients - :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1048,10 +652,7 @@ async def pushnotif_unregister( :return: Returns the result object. """ # noqa: E501 - _param = self._pushnotif_unregister_serialize( - account_index=account_index, - expo_token=expo_token, - auth=auth, + _param = self._current_height_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1059,7 +660,7 @@ async def pushnotif_unregister( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", + '200': "CurrentHeight", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1073,11 +674,8 @@ async def pushnotif_unregister( ).data - async def pushnotif_unregister_with_http_info( + async def current_height_with_http_info( self, - account_index: StrictInt, - expo_token: StrictStr, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1090,17 +688,11 @@ async def pushnotif_unregister_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ResultCode]: - """pushnotif_unregister + ) -> ApiResponse[CurrentHeight]: + """currentHeight - Unregister device from push notifications + Get current height - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param auth: made optional to support header auth clients - :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1123,10 +715,7 @@ async def pushnotif_unregister_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._pushnotif_unregister_serialize( - account_index=account_index, - expo_token=expo_token, - auth=auth, + _param = self._current_height_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1134,7 +723,7 @@ async def pushnotif_unregister_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", + '200': "CurrentHeight", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1148,11 +737,8 @@ async def pushnotif_unregister_with_http_info( ) - async def pushnotif_unregister_without_preload_content( + async def current_height_without_preload_content( self, - account_index: StrictInt, - expo_token: StrictStr, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1166,16 +752,10 @@ async def pushnotif_unregister_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """pushnotif_unregister + """currentHeight - Unregister device from push notifications + Get current height - :param account_index: (required) - :type account_index: int - :param expo_token: (required) - :type expo_token: str - :param auth: made optional to support header auth clients - :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1198,10 +778,7 @@ async def pushnotif_unregister_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._pushnotif_unregister_serialize( - account_index=account_index, - expo_token=expo_token, - auth=auth, + _param = self._current_height_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1209,7 +786,7 @@ async def pushnotif_unregister_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ResultCode", + '200': "CurrentHeight", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1219,11 +796,8 @@ async def pushnotif_unregister_without_preload_content( return response_data.response - def _pushnotif_unregister_serialize( + def _current_height_serialize( self, - account_index, - expo_token, - auth, _request_auth, _content_type, _headers, @@ -1246,12 +820,6 @@ def _pushnotif_unregister_serialize( # process the query parameters # process the header parameters # process the form parameters - if auth is not None: - _form_params.append(('auth', auth)) - if account_index is not None: - _form_params.append(('account_index', account_index)) - if expo_token is not None: - _form_params.append(('expo_token', expo_token)) # process the body parameter @@ -1263,27 +831,14 @@ def _pushnotif_unregister_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'multipart/form-data' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/pushnotif/unregister', + method='GET', + resource_path='/api/v1/currentHeight', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/lighter/api/bridge_api.py b/lighter/api/bridge_api.py index 6f1fb9b..d31de1e 100644 --- a/lighter/api/bridge_api.py +++ b/lighter/api/bridge_api.py @@ -16,13 +16,14 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr +from pydantic import Field, StrictBool, StrictInt, StrictStr from typing import Optional from typing_extensions import Annotated -from lighter.models.resp_get_bridges_by_l1_addr import RespGetBridgesByL1Addr +from lighter.models.bridge_supported_networks import BridgeSupportedNetworks +from lighter.models.create_intent_address_resp import CreateIntentAddressResp +from lighter.models.deposit import Deposit from lighter.models.resp_get_fast_bridge_info import RespGetFastBridgeInfo from lighter.models.resp_get_fastwithdrawal_info import RespGetFastwithdrawalInfo -from lighter.models.resp_get_is_next_bridge_fast import RespGetIsNextBridgeFast from lighter.models.result_code import ResultCode from lighter.api_client import ApiClient, RequestSerialized @@ -43,7 +44,323 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - async def bridges( + async def create_intent_address( + self, + chain_id: StrictStr, + from_addr: StrictStr, + amount: StrictStr, + is_external_deposit: Optional[StrictBool] = 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, + ) -> CreateIntentAddressResp: + """createIntentAddress + + Create a bridge intent address for CCTP bridge + + :param chain_id: (required) + :type chain_id: str + :param from_addr: (required) + :type from_addr: str + :param amount: (required) + :type amount: str + :param is_external_deposit: + :type is_external_deposit: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_intent_address_serialize( + chain_id=chain_id, + from_addr=from_addr, + amount=amount, + is_external_deposit=is_external_deposit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateIntentAddressResp", + '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 create_intent_address_with_http_info( + self, + chain_id: StrictStr, + from_addr: StrictStr, + amount: StrictStr, + is_external_deposit: Optional[StrictBool] = 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[CreateIntentAddressResp]: + """createIntentAddress + + Create a bridge intent address for CCTP bridge + + :param chain_id: (required) + :type chain_id: str + :param from_addr: (required) + :type from_addr: str + :param amount: (required) + :type amount: str + :param is_external_deposit: + :type is_external_deposit: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_intent_address_serialize( + chain_id=chain_id, + from_addr=from_addr, + amount=amount, + is_external_deposit=is_external_deposit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateIntentAddressResp", + '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 create_intent_address_without_preload_content( + self, + chain_id: StrictStr, + from_addr: StrictStr, + amount: StrictStr, + is_external_deposit: Optional[StrictBool] = 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: + """createIntentAddress + + Create a bridge intent address for CCTP bridge + + :param chain_id: (required) + :type chain_id: str + :param from_addr: (required) + :type from_addr: str + :param amount: (required) + :type amount: str + :param is_external_deposit: + :type is_external_deposit: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_intent_address_serialize( + chain_id=chain_id, + from_addr=from_addr, + amount=amount, + is_external_deposit=is_external_deposit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateIntentAddressResp", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_intent_address_serialize( + self, + chain_id, + from_addr, + amount, + is_external_deposit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if chain_id is not None: + _form_params.append(('chain_id', chain_id)) + if from_addr is not None: + _form_params.append(('from_addr', from_addr)) + if amount is not None: + _form_params.append(('amount', amount)) + if is_external_deposit is not None: + _form_params.append(('is_external_deposit', is_external_deposit)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/createIntentAddress', + 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 deposit_latest( self, l1_address: StrictStr, _request_timeout: Union[ @@ -58,10 +375,10 @@ async def bridges( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RespGetBridgesByL1Addr: - """bridges + ) -> Deposit: + """deposit_latest - Get bridges for given l1 address + Get most recent deposit for given l1 address :param l1_address: (required) :type l1_address: str @@ -87,7 +404,7 @@ async def bridges( :return: Returns the result object. """ # noqa: E501 - _param = self._bridges_serialize( + _param = self._deposit_latest_serialize( l1_address=l1_address, _request_auth=_request_auth, _content_type=_content_type, @@ -96,7 +413,7 @@ async def bridges( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetBridgesByL1Addr", + '200': "Deposit", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -110,7 +427,7 @@ async def bridges( ).data - async def bridges_with_http_info( + async def deposit_latest_with_http_info( self, l1_address: StrictStr, _request_timeout: Union[ @@ -125,10 +442,10 @@ async def bridges_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RespGetBridgesByL1Addr]: - """bridges + ) -> ApiResponse[Deposit]: + """deposit_latest - Get bridges for given l1 address + Get most recent deposit for given l1 address :param l1_address: (required) :type l1_address: str @@ -154,7 +471,7 @@ async def bridges_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._bridges_serialize( + _param = self._deposit_latest_serialize( l1_address=l1_address, _request_auth=_request_auth, _content_type=_content_type, @@ -163,7 +480,7 @@ async def bridges_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetBridgesByL1Addr", + '200': "Deposit", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -177,7 +494,7 @@ async def bridges_with_http_info( ) - async def bridges_without_preload_content( + async def deposit_latest_without_preload_content( self, l1_address: StrictStr, _request_timeout: Union[ @@ -193,9 +510,9 @@ async def bridges_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """bridges + """deposit_latest - Get bridges for given l1 address + Get most recent deposit for given l1 address :param l1_address: (required) :type l1_address: str @@ -221,7 +538,7 @@ async def bridges_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._bridges_serialize( + _param = self._deposit_latest_serialize( l1_address=l1_address, _request_auth=_request_auth, _content_type=_content_type, @@ -230,7 +547,7 @@ async def bridges_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetBridgesByL1Addr", + '200': "Deposit", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -240,7 +557,7 @@ async def bridges_without_preload_content( return response_data.response - def _bridges_serialize( + def _deposit_latest_serialize( self, l1_address, _request_auth, @@ -287,7 +604,7 @@ def _bridges_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/bridges', + resource_path='/api/v1/deposit/latest', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -303,9 +620,8 @@ def _bridges_serialize( - async def bridges_is_next_bridge_fast( + async def deposit_networks( self, - l1_address: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -318,13 +634,11 @@ async def bridges_is_next_bridge_fast( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RespGetIsNextBridgeFast: - """bridges_isNextBridgeFast + ) -> BridgeSupportedNetworks: + """deposit_networks - Get if next bridge is fast + Get networks that support deposits via intent address - :param l1_address: (required) - :type l1_address: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -347,8 +661,7 @@ async def bridges_is_next_bridge_fast( :return: Returns the result object. """ # noqa: E501 - _param = self._bridges_is_next_bridge_fast_serialize( - l1_address=l1_address, + _param = self._deposit_networks_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -356,7 +669,7 @@ async def bridges_is_next_bridge_fast( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetIsNextBridgeFast", + '200': "BridgeSupportedNetworks", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -370,9 +683,8 @@ async def bridges_is_next_bridge_fast( ).data - async def bridges_is_next_bridge_fast_with_http_info( + async def deposit_networks_with_http_info( self, - l1_address: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -385,13 +697,11 @@ async def bridges_is_next_bridge_fast_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RespGetIsNextBridgeFast]: - """bridges_isNextBridgeFast + ) -> ApiResponse[BridgeSupportedNetworks]: + """deposit_networks - Get if next bridge is fast + Get networks that support deposits via intent address - :param l1_address: (required) - :type l1_address: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -414,8 +724,7 @@ async def bridges_is_next_bridge_fast_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._bridges_is_next_bridge_fast_serialize( - l1_address=l1_address, + _param = self._deposit_networks_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -423,7 +732,7 @@ async def bridges_is_next_bridge_fast_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetIsNextBridgeFast", + '200': "BridgeSupportedNetworks", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -437,9 +746,8 @@ async def bridges_is_next_bridge_fast_with_http_info( ) - async def bridges_is_next_bridge_fast_without_preload_content( + async def deposit_networks_without_preload_content( self, - l1_address: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -453,12 +761,10 @@ async def bridges_is_next_bridge_fast_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """bridges_isNextBridgeFast + """deposit_networks - Get if next bridge is fast + Get networks that support deposits via intent address - :param l1_address: (required) - :type l1_address: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -481,8 +787,7 @@ async def bridges_is_next_bridge_fast_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._bridges_is_next_bridge_fast_serialize( - l1_address=l1_address, + _param = self._deposit_networks_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -490,7 +795,7 @@ async def bridges_is_next_bridge_fast_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespGetIsNextBridgeFast", + '200': "BridgeSupportedNetworks", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -500,9 +805,8 @@ async def bridges_is_next_bridge_fast_without_preload_content( return response_data.response - def _bridges_is_next_bridge_fast_serialize( + def _deposit_networks_serialize( self, - l1_address, _request_auth, _content_type, _headers, @@ -523,10 +827,6 @@ def _bridges_is_next_bridge_fast_serialize( # process the path parameters # process the query parameters - if l1_address is not None: - - _query_params.append(('l1_address', l1_address)) - # process the header parameters # process the form parameters # process the body parameter @@ -547,7 +847,7 @@ def _bridges_is_next_bridge_fast_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/bridges/isNextBridgeFast', + resource_path='/api/v1/deposit/networks', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1093,7 +1393,7 @@ def _fastwithdraw_serialize( _default_content_type = ( self.api_client.select_header_content_type( [ - 'multipart/form-data' + 'application/x-www-form-urlencoded' ] ) ) @@ -1124,9 +1424,8 @@ def _fastwithdraw_serialize( async def fastwithdraw_info( self, + authorization: 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, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1144,12 +1443,10 @@ async def fastwithdraw_info( Get fast withdraw info + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1173,9 +1470,8 @@ async def fastwithdraw_info( """ # noqa: E501 _param = self._fastwithdraw_info_serialize( - account_index=account_index, authorization=authorization, - auth=auth, + account_index=account_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1199,9 +1495,8 @@ async def fastwithdraw_info( async def fastwithdraw_info_with_http_info( self, + authorization: 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, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1219,12 +1514,10 @@ async def fastwithdraw_info_with_http_info( Get fast withdraw info + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1248,9 +1541,8 @@ async def fastwithdraw_info_with_http_info( """ # noqa: E501 _param = self._fastwithdraw_info_serialize( - account_index=account_index, authorization=authorization, - auth=auth, + account_index=account_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1274,9 +1566,8 @@ async def fastwithdraw_info_with_http_info( async def fastwithdraw_info_without_preload_content( self, + authorization: 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, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1294,12 +1585,10 @@ async def fastwithdraw_info_without_preload_content( Get fast withdraw info + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1323,9 +1612,8 @@ async def fastwithdraw_info_without_preload_content( """ # noqa: E501 _param = self._fastwithdraw_info_serialize( - account_index=account_index, authorization=authorization, - auth=auth, + account_index=account_index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1345,9 +1633,8 @@ async def fastwithdraw_info_without_preload_content( def _fastwithdraw_info_serialize( self, - account_index, authorization, - auth, + account_index, _request_auth, _content_type, _headers, @@ -1368,19 +1655,13 @@ def _fastwithdraw_info_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - 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 diff --git a/lighter/api/candlestick_api.py b/lighter/api/candlestick_api.py index 2486ab1..571740e 100644 --- a/lighter/api/candlestick_api.py +++ b/lighter/api/candlestick_api.py @@ -63,7 +63,7 @@ async def candles( ) -> Candles: """candles - Get candles (optimized with shortened fields and smaller response size) + Get candles data. Returns at most 500 candles per call. Zero values are omitted from the response. :param market_id: (required) :type market_id: int @@ -150,7 +150,7 @@ async def candles_with_http_info( ) -> ApiResponse[Candles]: """candles - Get candles (optimized with shortened fields and smaller response size) + Get candles data. Returns at most 500 candles per call. Zero values are omitted from the response. :param market_id: (required) :type market_id: int @@ -237,7 +237,7 @@ async def candles_without_preload_content( ) -> RESTResponseType: """candles - Get candles (optimized with shortened fields and smaller response size) + Get candles data. Returns at most 500 candles per call. Zero values are omitted from the response. :param market_id: (required) :type market_id: int diff --git a/lighter/api/info_api.py b/lighter/api/info_api.py index e2d501c..e24d85d 100644 --- a/lighter/api/info_api.py +++ b/lighter/api/info_api.py @@ -16,9 +16,9 @@ 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.layer1_basic_info import Layer1BasicInfo from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.system_config import SystemConfig from lighter.models.transfer_fee_info import TransferFeeInfo @@ -41,6 +41,249 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + async def layer1_basic_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Layer1BasicInfo: + """layer1BasicInfo + + Get zklighter l1 general info, including contract address and rpc info + + :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._layer1_basic_info_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Layer1BasicInfo", + '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 layer1_basic_info_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Layer1BasicInfo]: + """layer1BasicInfo + + Get zklighter l1 general info, including contract address and rpc info + + :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._layer1_basic_info_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Layer1BasicInfo", + '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 layer1_basic_info_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """layer1BasicInfo + + Get zklighter l1 general info, including contract address and rpc info + + :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._layer1_basic_info_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Layer1BasicInfo", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _layer1_basic_info_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/layer1BasicInfo', + 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 system_config( self, _request_timeout: Union[ @@ -58,7 +301,7 @@ async def system_config( ) -> SystemConfig: """systemConfig - Get system configuration including pool indexes and lockup/cooldown periods + Get system config :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -121,7 +364,7 @@ async def system_config_with_http_info( ) -> ApiResponse[SystemConfig]: """systemConfig - Get system configuration including pool indexes and lockup/cooldown periods + Get system config :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -184,7 +427,7 @@ async def system_config_without_preload_content( ) -> RESTResponseType: """systemConfig - Get system configuration including pool indexes and lockup/cooldown periods + Get system config :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -286,9 +529,8 @@ def _system_config_serialize( async def transfer_fee_info( self, + authorization: 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, to_account_index: Optional[StrictInt] = None, _request_timeout: Union[ None, @@ -307,12 +549,10 @@ async def transfer_fee_info( Transfer fee info + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param to_account_index: :type to_account_index: int :param _request_timeout: timeout setting for this request. If one @@ -338,9 +578,8 @@ async def transfer_fee_info( """ # noqa: E501 _param = self._transfer_fee_info_serialize( - account_index=account_index, authorization=authorization, - auth=auth, + account_index=account_index, to_account_index=to_account_index, _request_auth=_request_auth, _content_type=_content_type, @@ -365,9 +604,8 @@ async def transfer_fee_info( async def transfer_fee_info_with_http_info( self, + authorization: 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, to_account_index: Optional[StrictInt] = None, _request_timeout: Union[ None, @@ -386,12 +624,10 @@ async def transfer_fee_info_with_http_info( Transfer fee info + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param to_account_index: :type to_account_index: int :param _request_timeout: timeout setting for this request. If one @@ -417,9 +653,8 @@ async def transfer_fee_info_with_http_info( """ # noqa: E501 _param = self._transfer_fee_info_serialize( - account_index=account_index, authorization=authorization, - auth=auth, + account_index=account_index, to_account_index=to_account_index, _request_auth=_request_auth, _content_type=_content_type, @@ -444,9 +679,8 @@ async def transfer_fee_info_with_http_info( async def transfer_fee_info_without_preload_content( self, + authorization: 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, to_account_index: Optional[StrictInt] = None, _request_timeout: Union[ None, @@ -465,12 +699,10 @@ async def transfer_fee_info_without_preload_content( Transfer fee info + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param to_account_index: :type to_account_index: int :param _request_timeout: timeout setting for this request. If one @@ -496,9 +728,8 @@ async def transfer_fee_info_without_preload_content( """ # noqa: E501 _param = self._transfer_fee_info_serialize( - account_index=account_index, authorization=authorization, - auth=auth, + account_index=account_index, to_account_index=to_account_index, _request_auth=_request_auth, _content_type=_content_type, @@ -519,9 +750,8 @@ async def transfer_fee_info_without_preload_content( def _transfer_fee_info_serialize( self, - account_index, authorization, - auth, + account_index, to_account_index, _request_auth, _content_type, @@ -543,14 +773,6 @@ def _transfer_fee_info_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - if account_index is not None: _query_params.append(('account_index', account_index)) @@ -560,6 +782,8 @@ def _transfer_fee_info_serialize( _query_params.append(('to_account_index', to_account_index)) # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter diff --git a/lighter/api/notification_api.py b/lighter/api/notification_api.py index f514353..f3ee029 100644 --- a/lighter/api/notification_api.py +++ b/lighter/api/notification_api.py @@ -326,7 +326,7 @@ def _notification_ack_serialize( _default_content_type = ( self.api_client.select_header_content_type( [ - 'multipart/form-data' + 'application/x-www-form-urlencoded' ] ) ) diff --git a/lighter/api/order_api.py b/lighter/api/order_api.py index 45358f6..a01ead3 100644 --- a/lighter/api/order_api.py +++ b/lighter/api/order_api.py @@ -50,10 +50,10 @@ def __init__(self, api_client=None) -> None: async def account_active_orders( self, + authorization: StrictStr, account_index: StrictInt, - market_id: 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, + market_id: Annotated[Optional[StrictInt], Field(description="If not specified, returns active orders for all markets.")] = None, + market_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -71,14 +71,14 @@ async def account_active_orders( Get account active orders. `auth` can be generated using the SDK. + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param market_id: (required) + :param market_id: If not specified, returns active orders for all markets. :type market_id: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str + :param market_type: + :type market_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -102,10 +102,10 @@ async def account_active_orders( """ # noqa: E501 _param = self._account_active_orders_serialize( + authorization=authorization, account_index=account_index, market_id=market_id, - authorization=authorization, - auth=auth, + market_type=market_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -129,10 +129,10 @@ async def account_active_orders( async def account_active_orders_with_http_info( self, + authorization: StrictStr, account_index: StrictInt, - market_id: 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, + market_id: Annotated[Optional[StrictInt], Field(description="If not specified, returns active orders for all markets.")] = None, + market_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -150,14 +150,14 @@ async def account_active_orders_with_http_info( Get account active orders. `auth` can be generated using the SDK. + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param market_id: (required) + :param market_id: If not specified, returns active orders for all markets. :type market_id: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str + :param market_type: + :type market_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -181,10 +181,10 @@ async def account_active_orders_with_http_info( """ # noqa: E501 _param = self._account_active_orders_serialize( + authorization=authorization, account_index=account_index, market_id=market_id, - authorization=authorization, - auth=auth, + market_type=market_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -208,10 +208,10 @@ async def account_active_orders_with_http_info( async def account_active_orders_without_preload_content( self, + authorization: StrictStr, account_index: StrictInt, - market_id: 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, + market_id: Annotated[Optional[StrictInt], Field(description="If not specified, returns active orders for all markets.")] = None, + market_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -229,14 +229,14 @@ async def account_active_orders_without_preload_content( Get account active orders. `auth` can be generated using the SDK. + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param market_id: (required) + :param market_id: If not specified, returns active orders for all markets. :type market_id: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str + :param market_type: + :type market_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -260,10 +260,10 @@ async def account_active_orders_without_preload_content( """ # noqa: E501 _param = self._account_active_orders_serialize( + authorization=authorization, account_index=account_index, market_id=market_id, - authorization=authorization, - auth=auth, + market_type=market_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -283,10 +283,10 @@ async def account_active_orders_without_preload_content( def _account_active_orders_serialize( self, + authorization, account_index, market_id, - authorization, - auth, + market_type, _request_auth, _content_type, _headers, @@ -307,14 +307,6 @@ def _account_active_orders_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - if account_index is not None: _query_params.append(('account_index', account_index)) @@ -323,7 +315,13 @@ def _account_active_orders_serialize( _query_params.append(('market_id', market_id)) + if market_type is not None: + + _query_params.append(('market_type', market_type)) + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -361,14 +359,14 @@ def _account_active_orders_serialize( async def account_inactive_orders( self, + authorization: StrictStr, account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, market_id: Optional[StrictInt] = None, ask_filter: Optional[StrictInt] = None, between_timestamps: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, + market_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -384,16 +382,14 @@ async def account_inactive_orders( ) -> Orders: """accountInactiveOrders - Get account inactive orders + Get account inactive orders. `auth` can be generated using the SDK. + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int :param limit: (required) :type limit: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param market_id: :type market_id: int :param ask_filter: @@ -402,6 +398,8 @@ async def account_inactive_orders( :type between_timestamps: str :param cursor: :type cursor: str + :param market_type: + :type market_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -425,14 +423,14 @@ async def account_inactive_orders( """ # noqa: E501 _param = self._account_inactive_orders_serialize( + authorization=authorization, account_index=account_index, limit=limit, - authorization=authorization, - auth=auth, market_id=market_id, ask_filter=ask_filter, between_timestamps=between_timestamps, cursor=cursor, + market_type=market_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -456,14 +454,14 @@ async def account_inactive_orders( async def account_inactive_orders_with_http_info( self, + authorization: StrictStr, account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, market_id: Optional[StrictInt] = None, ask_filter: Optional[StrictInt] = None, between_timestamps: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, + market_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -479,16 +477,14 @@ async def account_inactive_orders_with_http_info( ) -> ApiResponse[Orders]: """accountInactiveOrders - Get account inactive orders + Get account inactive orders. `auth` can be generated using the SDK. + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int :param limit: (required) :type limit: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param market_id: :type market_id: int :param ask_filter: @@ -497,6 +493,8 @@ async def account_inactive_orders_with_http_info( :type between_timestamps: str :param cursor: :type cursor: str + :param market_type: + :type market_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -520,14 +518,14 @@ async def account_inactive_orders_with_http_info( """ # noqa: E501 _param = self._account_inactive_orders_serialize( + authorization=authorization, account_index=account_index, limit=limit, - authorization=authorization, - auth=auth, market_id=market_id, ask_filter=ask_filter, between_timestamps=between_timestamps, cursor=cursor, + market_type=market_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -551,14 +549,14 @@ async def account_inactive_orders_with_http_info( async def account_inactive_orders_without_preload_content( self, + authorization: StrictStr, account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, market_id: Optional[StrictInt] = None, ask_filter: Optional[StrictInt] = None, between_timestamps: Optional[StrictStr] = None, cursor: Optional[StrictStr] = None, + market_type: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -574,16 +572,14 @@ async def account_inactive_orders_without_preload_content( ) -> RESTResponseType: """accountInactiveOrders - Get account inactive orders + Get account inactive orders. `auth` can be generated using the SDK. + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int :param limit: (required) :type limit: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param market_id: :type market_id: int :param ask_filter: @@ -592,6 +588,8 @@ async def account_inactive_orders_without_preload_content( :type between_timestamps: str :param cursor: :type cursor: str + :param market_type: + :type market_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -615,14 +613,14 @@ async def account_inactive_orders_without_preload_content( """ # noqa: E501 _param = self._account_inactive_orders_serialize( + authorization=authorization, account_index=account_index, limit=limit, - authorization=authorization, - auth=auth, market_id=market_id, ask_filter=ask_filter, between_timestamps=between_timestamps, cursor=cursor, + market_type=market_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -642,14 +640,14 @@ async def account_inactive_orders_without_preload_content( def _account_inactive_orders_serialize( self, + authorization, account_index, limit, - authorization, - auth, market_id, ask_filter, between_timestamps, cursor, + market_type, _request_auth, _content_type, _headers, @@ -670,14 +668,6 @@ def _account_inactive_orders_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - if account_index is not None: _query_params.append(('account_index', account_index)) @@ -702,7 +692,13 @@ def _account_inactive_orders_serialize( _query_params.append(('limit', limit)) + if market_type is not None: + + _query_params.append(('market_type', market_type)) + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -756,7 +752,7 @@ async def asset_details( ) -> AssetDetails: """assetDetails - Get asset details + Get asset details for a specific asset or all assets :param asset_id: :type asset_id: int @@ -823,7 +819,7 @@ async def asset_details_with_http_info( ) -> ApiResponse[AssetDetails]: """assetDetails - Get asset details + Get asset details for a specific asset or all assets :param asset_id: :type asset_id: int @@ -890,7 +886,7 @@ async def asset_details_without_preload_content( ) -> RESTResponseType: """assetDetails - Get asset details + Get asset details for a specific asset or all assets :param asset_id: :type asset_id: int @@ -1019,7 +1015,7 @@ async def exchange_metrics( ) -> RespGetExchangeMetrics: """exchangeMetrics - Get exchange metrics + Get exchange metrics. When filtering by market, use the market symbol as a value. :param period: (required) :type period: str @@ -1098,7 +1094,7 @@ async def exchange_metrics_with_http_info( ) -> ApiResponse[RespGetExchangeMetrics]: """exchangeMetrics - Get exchange metrics + Get exchange metrics. When filtering by market, use the market symbol as a value. :param period: (required) :type period: str @@ -1177,7 +1173,7 @@ async def exchange_metrics_without_preload_content( ) -> RESTResponseType: """exchangeMetrics - Get exchange metrics + Get exchange metrics. When filtering by market, use the market symbol as a value. :param period: (required) :type period: str @@ -1814,9 +1810,8 @@ def _execute_stats_serialize( async def export( self, + authorization: StrictStr, type: 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, account_index: Optional[StrictInt] = None, market_id: Optional[StrictInt] = None, start_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None, @@ -1839,14 +1834,12 @@ async def export( ) -> ExportData: """export - Export data + Export trades and funding payments, limited to 12 months or 1M trades. END_TS_IN_MS - START_TS_IN_MS should not be larger than 12 months in milliseconds, both timestamps should be greater than or equal to 17 January 2025 00:00:00 UTC (lighter's mainnet genesis) + :param authorization: (required) + :type authorization: str :param type: (required) :type type: str - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param account_index: :type account_index: int :param market_id: @@ -1884,9 +1877,8 @@ async def export( """ # noqa: E501 _param = self._export_serialize( - type=type, authorization=authorization, - auth=auth, + type=type, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, @@ -1917,9 +1909,8 @@ async def export( async def export_with_http_info( self, + authorization: StrictStr, type: 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, account_index: Optional[StrictInt] = None, market_id: Optional[StrictInt] = None, start_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None, @@ -1942,14 +1933,12 @@ async def export_with_http_info( ) -> ApiResponse[ExportData]: """export - Export data + Export trades and funding payments, limited to 12 months or 1M trades. END_TS_IN_MS - START_TS_IN_MS should not be larger than 12 months in milliseconds, both timestamps should be greater than or equal to 17 January 2025 00:00:00 UTC (lighter's mainnet genesis) + :param authorization: (required) + :type authorization: str :param type: (required) :type type: str - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param account_index: :type account_index: int :param market_id: @@ -1987,9 +1976,8 @@ async def export_with_http_info( """ # noqa: E501 _param = self._export_serialize( - type=type, authorization=authorization, - auth=auth, + type=type, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, @@ -2020,9 +2008,8 @@ async def export_with_http_info( async def export_without_preload_content( self, + authorization: StrictStr, type: 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, account_index: Optional[StrictInt] = None, market_id: Optional[StrictInt] = None, start_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None, @@ -2045,14 +2032,12 @@ async def export_without_preload_content( ) -> RESTResponseType: """export - Export data + Export trades and funding payments, limited to 12 months or 1M trades. END_TS_IN_MS - START_TS_IN_MS should not be larger than 12 months in milliseconds, both timestamps should be greater than or equal to 17 January 2025 00:00:00 UTC (lighter's mainnet genesis) + :param authorization: (required) + :type authorization: str :param type: (required) :type type: str - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param account_index: :type account_index: int :param market_id: @@ -2090,9 +2075,8 @@ async def export_without_preload_content( """ # noqa: E501 _param = self._export_serialize( - type=type, authorization=authorization, - auth=auth, + type=type, account_index=account_index, market_id=market_id, start_timestamp=start_timestamp, @@ -2119,9 +2103,8 @@ async def export_without_preload_content( def _export_serialize( self, - type, authorization, - auth, + type, account_index, market_id, start_timestamp, @@ -2149,14 +2132,6 @@ def _export_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - if account_index is not None: _query_params.append(('account_index', account_index)) @@ -2190,6 +2165,8 @@ def _export_serialize( _query_params.append(('trade_type', trade_type)) # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -2228,7 +2205,7 @@ def _export_serialize( async def order_book_details( self, market_id: Optional[StrictInt] = None, - filter: Optional[StrictStr] = None, + filter: Annotated[Optional[StrictStr], Field(description="Filter order books by type")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2248,7 +2225,7 @@ async def order_book_details( :param market_id: :type market_id: int - :param filter: + :param filter: Filter order books by type :type filter: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2299,7 +2276,7 @@ async def order_book_details( async def order_book_details_with_http_info( self, market_id: Optional[StrictInt] = None, - filter: Optional[StrictStr] = None, + filter: Annotated[Optional[StrictStr], Field(description="Filter order books by type")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2319,7 +2296,7 @@ async def order_book_details_with_http_info( :param market_id: :type market_id: int - :param filter: + :param filter: Filter order books by type :type filter: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2370,7 +2347,7 @@ async def order_book_details_with_http_info( async def order_book_details_without_preload_content( self, market_id: Optional[StrictInt] = None, - filter: Optional[StrictStr] = None, + filter: Annotated[Optional[StrictStr], Field(description="Filter order books by type")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2390,7 +2367,7 @@ async def order_book_details_without_preload_content( :param market_id: :type market_id: int - :param filter: + :param filter: Filter order books by type :type filter: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -3337,9 +3314,9 @@ async def trades( self, sort_by: StrictStr, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - 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, market_id: Optional[StrictInt] = None, + market_type: Optional[StrictStr] = None, account_index: Optional[StrictInt] = None, order_index: Optional[StrictInt] = None, sort_dir: Optional[StrictStr] = None, @@ -3349,6 +3326,8 @@ async def trades( role: Optional[StrictStr] = None, type: Optional[StrictStr] = None, aggregate: Optional[StrictBool] = None, + skip_ask_order_id: Optional[StrictStr] = None, + skip_bid_order_id: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3364,18 +3343,18 @@ async def trades( ) -> Trades: """trades - Get trades + Get trades for lighter accounts, including sub-accounts and public pools. `auth` is required for master accounts and sub accounts. :param sort_by: (required) :type sort_by: str :param limit: (required) :type limit: 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 market_id: :type market_id: int + :param market_type: + :type market_type: str :param account_index: :type account_index: int :param order_index: @@ -3394,6 +3373,10 @@ async def trades( :type type: str :param aggregate: :type aggregate: bool + :param skip_ask_order_id: + :type skip_ask_order_id: str + :param skip_bid_order_id: + :type skip_bid_order_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 @@ -3420,8 +3403,8 @@ async def trades( sort_by=sort_by, limit=limit, authorization=authorization, - auth=auth, market_id=market_id, + market_type=market_type, account_index=account_index, order_index=order_index, sort_dir=sort_dir, @@ -3431,6 +3414,8 @@ async def trades( role=role, type=type, aggregate=aggregate, + skip_ask_order_id=skip_ask_order_id, + skip_bid_order_id=skip_bid_order_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3456,9 +3441,9 @@ async def trades_with_http_info( self, sort_by: StrictStr, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - 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, market_id: Optional[StrictInt] = None, + market_type: Optional[StrictStr] = None, account_index: Optional[StrictInt] = None, order_index: Optional[StrictInt] = None, sort_dir: Optional[StrictStr] = None, @@ -3468,6 +3453,8 @@ async def trades_with_http_info( role: Optional[StrictStr] = None, type: Optional[StrictStr] = None, aggregate: Optional[StrictBool] = None, + skip_ask_order_id: Optional[StrictStr] = None, + skip_bid_order_id: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3483,18 +3470,18 @@ async def trades_with_http_info( ) -> ApiResponse[Trades]: """trades - Get trades + Get trades for lighter accounts, including sub-accounts and public pools. `auth` is required for master accounts and sub accounts. :param sort_by: (required) :type sort_by: str :param limit: (required) :type limit: 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 market_id: :type market_id: int + :param market_type: + :type market_type: str :param account_index: :type account_index: int :param order_index: @@ -3513,6 +3500,10 @@ async def trades_with_http_info( :type type: str :param aggregate: :type aggregate: bool + :param skip_ask_order_id: + :type skip_ask_order_id: str + :param skip_bid_order_id: + :type skip_bid_order_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 @@ -3539,8 +3530,8 @@ async def trades_with_http_info( sort_by=sort_by, limit=limit, authorization=authorization, - auth=auth, market_id=market_id, + market_type=market_type, account_index=account_index, order_index=order_index, sort_dir=sort_dir, @@ -3550,6 +3541,8 @@ async def trades_with_http_info( role=role, type=type, aggregate=aggregate, + skip_ask_order_id=skip_ask_order_id, + skip_bid_order_id=skip_bid_order_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3575,9 +3568,9 @@ async def trades_without_preload_content( self, sort_by: StrictStr, limit: Annotated[int, Field(le=100, strict=True, ge=1)], - 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, market_id: Optional[StrictInt] = None, + market_type: Optional[StrictStr] = None, account_index: Optional[StrictInt] = None, order_index: Optional[StrictInt] = None, sort_dir: Optional[StrictStr] = None, @@ -3587,6 +3580,8 @@ async def trades_without_preload_content( role: Optional[StrictStr] = None, type: Optional[StrictStr] = None, aggregate: Optional[StrictBool] = None, + skip_ask_order_id: Optional[StrictStr] = None, + skip_bid_order_id: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3602,18 +3597,18 @@ async def trades_without_preload_content( ) -> RESTResponseType: """trades - Get trades + Get trades for lighter accounts, including sub-accounts and public pools. `auth` is required for master accounts and sub accounts. :param sort_by: (required) :type sort_by: str :param limit: (required) :type limit: 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 market_id: :type market_id: int + :param market_type: + :type market_type: str :param account_index: :type account_index: int :param order_index: @@ -3632,6 +3627,10 @@ async def trades_without_preload_content( :type type: str :param aggregate: :type aggregate: bool + :param skip_ask_order_id: + :type skip_ask_order_id: str + :param skip_bid_order_id: + :type skip_bid_order_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 @@ -3658,8 +3657,8 @@ async def trades_without_preload_content( sort_by=sort_by, limit=limit, authorization=authorization, - auth=auth, market_id=market_id, + market_type=market_type, account_index=account_index, order_index=order_index, sort_dir=sort_dir, @@ -3669,6 +3668,8 @@ async def trades_without_preload_content( role=role, type=type, aggregate=aggregate, + skip_ask_order_id=skip_ask_order_id, + skip_bid_order_id=skip_bid_order_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3691,8 +3692,8 @@ def _trades_serialize( sort_by, limit, authorization, - auth, market_id, + market_type, account_index, order_index, sort_dir, @@ -3702,6 +3703,8 @@ def _trades_serialize( role, type, aggregate, + skip_ask_order_id, + skip_bid_order_id, _request_auth, _content_type, _headers, @@ -3722,18 +3725,14 @@ def _trades_serialize( # process the path parameters # process the query parameters - if authorization is not None: - - _query_params.append(('authorization', authorization)) - - if auth is not None: - - _query_params.append(('auth', auth)) - if market_id is not None: _query_params.append(('market_id', market_id)) + if market_type is not None: + + _query_params.append(('market_type', market_type)) + if account_index is not None: _query_params.append(('account_index', account_index)) @@ -3778,7 +3777,17 @@ def _trades_serialize( _query_params.append(('aggregate', aggregate)) + if skip_ask_order_id is not None: + + _query_params.append(('skip_ask_order_id', skip_ask_order_id)) + + if skip_bid_order_id is not None: + + _query_params.append(('skip_bid_order_id', skip_bid_order_id)) + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter diff --git a/lighter/api/referral_api.py b/lighter/api/referral_api.py index 353ed4c..dfc5041 100644 --- a/lighter/api/referral_api.py +++ b/lighter/api/referral_api.py @@ -16,34 +16,1545 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictStr -from typing import Optional -from lighter.models.user_referrals import UserReferrals +from pydantic import Field, StrictInt, StrictStr +from typing import Optional, Union +from typing_extensions import Annotated +from lighter.models.referral_code import ReferralCode +from lighter.models.referral_points import ReferralPoints +from lighter.models.resp_update_kickback import RespUpdateKickback +from lighter.models.resp_update_referral_code import RespUpdateReferralCode +from lighter.models.result_code import ResultCode + +from lighter.api_client import ApiClient, RequestSerialized +from lighter.api_response import ApiResponse +from lighter.rest import RESTResponseType + + +class ReferralApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + async def referral_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, + _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, + ) -> ReferralCode: + """referral_create + + Create referral code + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_create_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferralCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def referral_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, + _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[ReferralCode]: + """referral_create + + Create referral code + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_create_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferralCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def referral_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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """referral_create + + Create referral code + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_create_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferralCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _referral_create_serialize( + self, + account_index, + authorization, + auth, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + if auth is not None: + _form_params.append(('auth', auth)) + if account_index is not None: + _form_params.append(('account_index', account_index)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/referral/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + async def 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, + _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, + ) -> ReferralCode: + """referral_get + + Get referral code + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_get_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferralCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def referral_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, + _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[ReferralCode]: + """referral_get + + Get referral code + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_get_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferralCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def referral_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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """referral_get + + Get referral code + + :param account_index: (required) + :type account_index: int + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_get_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferralCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _referral_get_serialize( + self, + account_index, + authorization, + auth, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if authorization is not None: + + _query_params.append(('authorization', authorization)) + + if auth is not None: + + _query_params.append(('auth', auth)) + + if account_index is not None: + + _query_params.append(('account_index', account_index)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/referral/get', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + async def referral_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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RespUpdateKickback: + """referral_kickback_update + + Update kickback percentage for referral rewards (allowed once per day) + + :param account_index: (required) + :type account_index: int + :param kickback_percentage: (required) + :type kickback_percentage: float + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_kickback_update_serialize( + account_index=account_index, + kickback_percentage=kickback_percentage, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespUpdateKickback", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def referral_kickback_update_with_http_info( + self, + account_index: StrictInt, + kickback_percentage: Union[Annotated[float, Field(le=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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RespUpdateKickback]: + """referral_kickback_update + + Update kickback percentage for referral rewards (allowed once per day) + + :param account_index: (required) + :type account_index: int + :param kickback_percentage: (required) + :type kickback_percentage: float + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_kickback_update_serialize( + account_index=account_index, + kickback_percentage=kickback_percentage, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespUpdateKickback", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def referral_kickback_update_without_preload_content( + self, + account_index: StrictInt, + kickback_percentage: Union[Annotated[float, Field(le=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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """referral_kickback_update + + Update kickback percentage for referral rewards (allowed once per day) + + :param account_index: (required) + :type account_index: int + :param kickback_percentage: (required) + :type kickback_percentage: float + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_kickback_update_serialize( + account_index=account_index, + kickback_percentage=kickback_percentage, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespUpdateKickback", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _referral_kickback_update_serialize( + self, + account_index, + kickback_percentage, + authorization, + auth, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + if auth is not None: + _form_params.append(('auth', auth)) + if account_index is not None: + _form_params.append(('account_index', account_index)) + if kickback_percentage is not None: + _form_params.append(('kickback_percentage', kickback_percentage)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/referral/kickback/update', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + async def referral_points( + self, + authorization: StrictStr, + account_index: 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, + ) -> ReferralPoints: + """referral_points + + Get referral points + + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :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._referral_points_serialize( + authorization=authorization, + 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': "ReferralPoints", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def referral_points_with_http_info( + self, + authorization: StrictStr, + account_index: 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[ReferralPoints]: + """referral_points + + Get referral points + + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :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._referral_points_serialize( + authorization=authorization, + 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': "ReferralPoints", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def referral_points_without_preload_content( + self, + authorization: StrictStr, + account_index: 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: + """referral_points + + Get referral points + + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :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._referral_points_serialize( + authorization=authorization, + 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': "ReferralPoints", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _referral_points_serialize( + self, + authorization, + 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)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/referral/points', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + async def referral_update( + self, + account_index: StrictInt, + new_referral_code: StrictStr, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RespUpdateReferralCode: + """referral_update -from lighter.api_client import ApiClient, RequestSerialized -from lighter.api_response import ApiResponse -from lighter.rest import RESTResponseType + Update referral code (allowed once per account) + :param account_index: (required) + :type account_index: int + :param new_referral_code: (required) + :type new_referral_code: str + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 -class ReferralApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech + _param = self._referral_update_serialize( + account_index=account_index, + new_referral_code=new_referral_code, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Do not edit the class manually. - """ + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespUpdateReferralCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client + async def referral_update_with_http_info( + self, + account_index: StrictInt, + new_referral_code: StrictStr, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RespUpdateReferralCode]: + """referral_update + + Update referral code (allowed once per account) + + :param account_index: (required) + :type account_index: int + :param new_referral_code: (required) + :type new_referral_code: str + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_update_serialize( + account_index=account_index, + new_referral_code=new_referral_code, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespUpdateReferralCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def referral_update_without_preload_content( + self, + account_index: StrictInt, + new_referral_code: StrictStr, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """referral_update + + Update referral code (allowed once per account) + + :param account_index: (required) + :type account_index: int + :param new_referral_code: (required) + :type new_referral_code: str + :param authorization: make required after integ is done + :type authorization: str + :param auth: made optional to support header auth clients + :type auth: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._referral_update_serialize( + account_index=account_index, + new_referral_code=new_referral_code, + authorization=authorization, + auth=auth, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespUpdateReferralCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _referral_update_serialize( + self, + account_index, + new_referral_code, + authorization, + auth, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + if auth is not None: + _form_params.append(('auth', auth)) + if account_index is not None: + _form_params.append(('account_index', account_index)) + if new_referral_code is not None: + _form_params.append(('new_referral_code', new_referral_code)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/referral/update', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - async def referral_user_referrals( + + + + async def referral_use( self, l1_address: StrictStr, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, - cursor: Optional[StrictStr] = None, + 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, + discord: Optional[StrictStr] = None, + telegram: Optional[StrictStr] = None, + signature: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -56,19 +1567,27 @@ async def referral_user_referrals( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UserReferrals: - """referral_userReferrals + ) -> ResultCode: + """referral_use - Get user referrals + Use a referral code. You can change this at a later time. :param l1_address: (required) :type l1_address: str - :param authorization: + :param referral_code: (required) + :type referral_code: str + :param x: (required) + :type x: str + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str - :param cursor: - :type cursor: str + :param discord: + :type discord: str + :param telegram: + :type telegram: str + :param signature: + :type signature: 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 @@ -91,11 +1610,15 @@ async def referral_user_referrals( :return: Returns the result object. """ # noqa: E501 - _param = self._referral_user_referrals_serialize( + _param = self._referral_use_serialize( l1_address=l1_address, + referral_code=referral_code, + x=x, authorization=authorization, auth=auth, - cursor=cursor, + discord=discord, + telegram=telegram, + signature=signature, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -103,7 +1626,7 @@ async def referral_user_referrals( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserReferrals", + '200': "ResultCode", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -117,12 +1640,16 @@ async def referral_user_referrals( ).data - async def referral_user_referrals_with_http_info( + async def referral_use_with_http_info( self, l1_address: StrictStr, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, - cursor: Optional[StrictStr] = None, + 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, + discord: Optional[StrictStr] = None, + telegram: Optional[StrictStr] = None, + signature: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -135,19 +1662,27 @@ async def referral_user_referrals_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[UserReferrals]: - """referral_userReferrals + ) -> ApiResponse[ResultCode]: + """referral_use - Get user referrals + Use a referral code. You can change this at a later time. :param l1_address: (required) :type l1_address: str - :param authorization: + :param referral_code: (required) + :type referral_code: str + :param x: (required) + :type x: str + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str - :param cursor: - :type cursor: str + :param discord: + :type discord: str + :param telegram: + :type telegram: str + :param signature: + :type signature: 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 @@ -170,11 +1705,15 @@ async def referral_user_referrals_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._referral_user_referrals_serialize( + _param = self._referral_use_serialize( l1_address=l1_address, + referral_code=referral_code, + x=x, authorization=authorization, auth=auth, - cursor=cursor, + discord=discord, + telegram=telegram, + signature=signature, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -182,7 +1721,7 @@ async def referral_user_referrals_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserReferrals", + '200': "ResultCode", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -196,12 +1735,16 @@ async def referral_user_referrals_with_http_info( ) - async def referral_user_referrals_without_preload_content( + async def referral_use_without_preload_content( self, l1_address: StrictStr, - authorization: Optional[StrictStr] = None, - auth: Optional[StrictStr] = None, - cursor: Optional[StrictStr] = None, + 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, + discord: Optional[StrictStr] = None, + telegram: Optional[StrictStr] = None, + signature: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -215,18 +1758,26 @@ async def referral_user_referrals_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """referral_userReferrals + """referral_use - Get user referrals + Use a referral code. You can change this at a later time. :param l1_address: (required) :type l1_address: str - :param authorization: + :param referral_code: (required) + :type referral_code: str + :param x: (required) + :type x: str + :param authorization: make required after integ is done :type authorization: str - :param auth: + :param auth: made optional to support header auth clients :type auth: str - :param cursor: - :type cursor: str + :param discord: + :type discord: str + :param telegram: + :type telegram: str + :param signature: + :type signature: 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 @@ -249,11 +1800,15 @@ async def referral_user_referrals_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._referral_user_referrals_serialize( + _param = self._referral_use_serialize( l1_address=l1_address, + referral_code=referral_code, + x=x, authorization=authorization, auth=auth, - cursor=cursor, + discord=discord, + telegram=telegram, + signature=signature, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -261,7 +1816,7 @@ async def referral_user_referrals_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "UserReferrals", + '200': "ResultCode", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -271,12 +1826,16 @@ async def referral_user_referrals_without_preload_content( return response_data.response - def _referral_user_referrals_serialize( + def _referral_use_serialize( self, l1_address, + referral_code, + x, authorization, auth, - cursor, + discord, + telegram, + signature, _request_auth, _content_type, _headers, @@ -297,22 +1856,24 @@ def _referral_user_referrals_serialize( # process the path parameters # process the query parameters - if auth is not None: - - _query_params.append(('auth', auth)) - - if l1_address is not None: - - _query_params.append(('l1_address', l1_address)) - - if cursor is not None: - - _query_params.append(('cursor', cursor)) - # process the header parameters if authorization is not None: _header_params['authorization'] = authorization # process the form parameters + 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: + _form_params.append(('referral_code', referral_code)) + if discord is not None: + _form_params.append(('discord', discord)) + if telegram is not None: + _form_params.append(('telegram', telegram)) + if x is not None: + _form_params.append(('x', x)) + if signature is not None: + _form_params.append(('signature', signature)) # process the body parameter @@ -324,14 +1885,27 @@ def _referral_user_referrals_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/referral/userReferrals', + method='POST', + resource_path='/api/v1/referral/use', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/lighter/api/tokenlist_api.py b/lighter/api/tokenlist_api.py new file mode 100644 index 0000000..7000077 --- /dev/null +++ b/lighter/api/tokenlist_api.py @@ -0,0 +1,279 @@ +# 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 lighter.models.token_list import TokenList + +from lighter.api_client import ApiClient, RequestSerialized +from lighter.api_response import ApiResponse +from lighter.rest import RESTResponseType + + +class TokenlistApi: + """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 tokenlist( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TokenList: + """tokenlist + + Get token list and their metadata + + :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._tokenlist_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TokenList", + '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 tokenlist_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TokenList]: + """tokenlist + + Get token list and their metadata + + :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._tokenlist_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TokenList", + '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 tokenlist_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """tokenlist + + Get token list and their metadata + + :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._tokenlist_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TokenList", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _tokenlist_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/tokenlist', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/lighter/api/transaction_api.py b/lighter/api/transaction_api.py index fb5df75..bd4dda1 100644 --- a/lighter/api/transaction_api.py +++ b/lighter/api/transaction_api.py @@ -17,14 +17,17 @@ 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.deposit_history import DepositHistory from lighter.models.enriched_tx import EnrichedTx from lighter.models.next_nonce import NextNonce +from lighter.models.req_set_account_metadata import ReqSetAccountMetadata from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch +from lighter.models.result_code import ResultCode from lighter.models.transfer_history import TransferHistory +from lighter.models.txs import Txs from lighter.models.withdraw_history import WithdrawHistory from lighter.api_client import ApiClient, RequestSerialized @@ -45,14 +48,15 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - async def deposit_history( + async def account_txs( self, - account_index: StrictInt, - l1_address: StrictStr, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + 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, - cursor: Optional[StrictStr] = None, - filter: Optional[StrictStr] = None, + types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -65,23 +69,25 @@ async def deposit_history( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DepositHistory: - """deposit_history + ) -> Txs: + """accountTxs - Get deposit history + Get transactions of a specific account - :param account_index: (required) - :type account_index: int - :param l1_address: (required) - :type l1_address: str + :param limit: (required) + :type limit: int + :param by: (required) + :type by: str + :param value: (required) + :type value: str + :param index: + :type index: int :param authorization: make required after integ is done :type authorization: str :param auth: made optional to support header auth clients :type auth: str - :param cursor: - :type cursor: str - :param filter: - :type filter: str + :param types: + :type types: 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 @@ -104,13 +110,14 @@ async def deposit_history( :return: Returns the result object. """ # noqa: E501 - _param = self._deposit_history_serialize( - account_index=account_index, - l1_address=l1_address, + _param = self._account_txs_serialize( + limit=limit, + by=by, + value=value, + index=index, authorization=authorization, auth=auth, - cursor=cursor, - filter=filter, + types=types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -118,7 +125,7 @@ async def deposit_history( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DepositHistory", + '200': "Txs", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -132,14 +139,15 @@ async def deposit_history( ).data - async def deposit_history_with_http_info( + async def account_txs_with_http_info( self, - account_index: StrictInt, - l1_address: StrictStr, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + 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, - cursor: Optional[StrictStr] = None, - filter: Optional[StrictStr] = None, + types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -152,23 +160,25 @@ async def deposit_history_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DepositHistory]: - """deposit_history + ) -> ApiResponse[Txs]: + """accountTxs - Get deposit history + Get transactions of a specific account - :param account_index: (required) - :type account_index: int - :param l1_address: (required) - :type l1_address: str + :param limit: (required) + :type limit: int + :param by: (required) + :type by: str + :param value: (required) + :type value: str + :param index: + :type index: int :param authorization: make required after integ is done :type authorization: str :param auth: made optional to support header auth clients :type auth: str - :param cursor: - :type cursor: str - :param filter: - :type filter: str + :param types: + :type types: 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 @@ -191,13 +201,14 @@ async def deposit_history_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._deposit_history_serialize( - account_index=account_index, - l1_address=l1_address, + _param = self._account_txs_serialize( + limit=limit, + by=by, + value=value, + index=index, authorization=authorization, auth=auth, - cursor=cursor, - filter=filter, + types=types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -205,7 +216,7 @@ async def deposit_history_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DepositHistory", + '200': "Txs", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -219,14 +230,15 @@ async def deposit_history_with_http_info( ) - async def deposit_history_without_preload_content( + async def account_txs_without_preload_content( self, - account_index: StrictInt, - l1_address: StrictStr, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + 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, - cursor: Optional[StrictStr] = None, - filter: Optional[StrictStr] = None, + types: Optional[List[StrictInt]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -240,22 +252,24 @@ async def deposit_history_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """deposit_history + """accountTxs - Get deposit history + Get transactions of a specific account - :param account_index: (required) - :type account_index: int - :param l1_address: (required) - :type l1_address: str + :param limit: (required) + :type limit: int + :param by: (required) + :type by: str + :param value: (required) + :type value: str + :param index: + :type index: int :param authorization: make required after integ is done :type authorization: str :param auth: made optional to support header auth clients :type auth: str - :param cursor: - :type cursor: str - :param filter: - :type filter: str + :param types: + :type types: 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 @@ -278,13 +292,14 @@ async def deposit_history_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._deposit_history_serialize( - account_index=account_index, - l1_address=l1_address, + _param = self._account_txs_serialize( + limit=limit, + by=by, + value=value, + index=index, authorization=authorization, auth=auth, - cursor=cursor, - filter=filter, + types=types, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -292,7 +307,7 @@ async def deposit_history_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DepositHistory", + '200': "Txs", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -302,14 +317,15 @@ async def deposit_history_without_preload_content( return response_data.response - def _deposit_history_serialize( + def _account_txs_serialize( self, - account_index, - l1_address, + limit, + by, + value, + index, authorization, auth, - cursor, - filter, + types, _request_auth, _content_type, _headers, @@ -319,6 +335,7 @@ def _deposit_history_serialize( _host = None _collection_formats: Dict[str, str] = { + 'types': 'multi', } _path_params: Dict[str, str] = {} @@ -330,31 +347,33 @@ def _deposit_history_serialize( # process the path parameters # process the query parameters - if authorization is not None: + if index is not None: - _query_params.append(('authorization', authorization)) + _query_params.append(('index', index)) - if auth is not None: + if limit is not None: - _query_params.append(('auth', auth)) + _query_params.append(('limit', limit)) - if account_index is not None: + if by is not None: - _query_params.append(('account_index', account_index)) + _query_params.append(('by', by)) - if l1_address is not None: + if value is not None: - _query_params.append(('l1_address', l1_address)) + _query_params.append(('value', value)) - if cursor is not None: + if auth is not None: - _query_params.append(('cursor', cursor)) + _query_params.append(('auth', auth)) - if filter is not None: + if types is not None: - _query_params.append(('filter', filter)) + _query_params.append(('types', types)) # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter @@ -374,7 +393,7 @@ def _deposit_history_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/deposit/history', + resource_path='/api/v1/accountTxs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -390,10 +409,10 @@ def _deposit_history_serialize( - async def next_nonce( + async def block_txs( self, - account_index: StrictInt, - api_key_index: StrictInt, + by: StrictStr, + value: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -406,15 +425,15 @@ async def next_nonce( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> NextNonce: - """nextNonce + ) -> Txs: + """blockTxs - Get next nonce for a specific account and api key + Get transactions in a block - :param account_index: (required) - :type account_index: int - :param api_key_index: (required) - :type api_key_index: int + :param by: (required) + :type by: str + :param value: (required) + :type value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -437,9 +456,9 @@ async def next_nonce( :return: Returns the result object. """ # noqa: E501 - _param = self._next_nonce_serialize( - account_index=account_index, - api_key_index=api_key_index, + _param = self._block_txs_serialize( + by=by, + value=value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -447,7 +466,7 @@ async def next_nonce( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "NextNonce", + '200': "Txs", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -461,10 +480,10 @@ async def next_nonce( ).data - async def next_nonce_with_http_info( + async def block_txs_with_http_info( self, - account_index: StrictInt, - api_key_index: StrictInt, + by: StrictStr, + value: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -477,15 +496,15 @@ async def next_nonce_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[NextNonce]: - """nextNonce + ) -> ApiResponse[Txs]: + """blockTxs - Get next nonce for a specific account and api key + Get transactions in a block - :param account_index: (required) - :type account_index: int - :param api_key_index: (required) - :type api_key_index: int + :param by: (required) + :type by: str + :param value: (required) + :type value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -508,9 +527,9 @@ async def next_nonce_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._next_nonce_serialize( - account_index=account_index, - api_key_index=api_key_index, + _param = self._block_txs_serialize( + by=by, + value=value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -518,7 +537,7 @@ async def next_nonce_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "NextNonce", + '200': "Txs", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -532,10 +551,10 @@ async def next_nonce_with_http_info( ) - async def next_nonce_without_preload_content( + async def block_txs_without_preload_content( self, - account_index: StrictInt, - api_key_index: StrictInt, + by: StrictStr, + value: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -549,14 +568,14 @@ async def next_nonce_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """nextNonce + """blockTxs - Get next nonce for a specific account and api key + Get transactions in a block - :param account_index: (required) - :type account_index: int - :param api_key_index: (required) - :type api_key_index: int + :param by: (required) + :type by: str + :param value: (required) + :type value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -579,9 +598,9 @@ async def next_nonce_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._next_nonce_serialize( - account_index=account_index, - api_key_index=api_key_index, + _param = self._block_txs_serialize( + by=by, + value=value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -589,7 +608,7 @@ async def next_nonce_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "NextNonce", + '200': "Txs", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -599,10 +618,10 @@ async def next_nonce_without_preload_content( return response_data.response - def _next_nonce_serialize( + def _block_txs_serialize( self, - account_index, - api_key_index, + by, + value, _request_auth, _content_type, _headers, @@ -623,13 +642,13 @@ def _next_nonce_serialize( # process the path parameters # process the query parameters - if account_index is not None: + if by is not None: - _query_params.append(('account_index', account_index)) + _query_params.append(('by', by)) - if api_key_index is not None: + if value is not None: - _query_params.append(('api_key_index', api_key_index)) + _query_params.append(('value', value)) # process the header parameters # process the form parameters @@ -651,7 +670,7 @@ def _next_nonce_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/nextNonce', + resource_path='/api/v1/blockTxs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -667,11 +686,13 @@ def _next_nonce_serialize( - async def send_tx( + async def deposit_history( self, - tx_type: StrictInt, - tx_info: StrictStr, - price_protection: Optional[StrictBool] = None, + authorization: StrictStr, + account_index: StrictInt, + l1_address: StrictStr, + cursor: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -684,17 +705,21 @@ async def send_tx( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RespSendTx: - """sendTx + ) -> DepositHistory: + """deposit_history - You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers) + Get deposit history - :param tx_type: (required) - :type tx_type: int - :param tx_info: (required) - :type tx_info: str - :param price_protection: - :type price_protection: bool + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :type account_index: int + :param l1_address: (required) + :type l1_address: str + :param cursor: + :type cursor: str + :param filter: + :type filter: 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 @@ -717,10 +742,12 @@ async def send_tx( :return: Returns the result object. """ # noqa: E501 - _param = self._send_tx_serialize( - tx_type=tx_type, - tx_info=tx_info, - price_protection=price_protection, + _param = self._deposit_history_serialize( + authorization=authorization, + account_index=account_index, + l1_address=l1_address, + cursor=cursor, + filter=filter, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -728,7 +755,7 @@ async def send_tx( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespSendTx", + '200': "DepositHistory", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -742,11 +769,13 @@ async def send_tx( ).data - async def send_tx_with_http_info( + async def deposit_history_with_http_info( self, - tx_type: StrictInt, - tx_info: StrictStr, - price_protection: Optional[StrictBool] = None, + authorization: StrictStr, + account_index: StrictInt, + l1_address: StrictStr, + cursor: Optional[StrictStr] = None, + filter: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -759,18 +788,1191 @@ async def send_tx_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RespSendTx]: - """sendTx + ) -> ApiResponse[DepositHistory]: + """deposit_history - You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers) + Get deposit history - :param tx_type: (required) - :type tx_type: int - :param tx_info: (required) - :type tx_info: str - :param price_protection: - :type price_protection: bool - :param _request_timeout: timeout setting for this request. If one + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :type account_index: int + :param l1_address: (required) + :type l1_address: str + :param cursor: + :type cursor: str + :param filter: + :type filter: 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._deposit_history_serialize( + authorization=authorization, + account_index=account_index, + l1_address=l1_address, + cursor=cursor, + filter=filter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DepositHistory", + '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 deposit_history_without_preload_content( + self, + authorization: StrictStr, + account_index: StrictInt, + l1_address: StrictStr, + cursor: Optional[StrictStr] = None, + filter: 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: + """deposit_history + + Get deposit history + + :param authorization: (required) + :type authorization: str + :param account_index: (required) + :type account_index: int + :param l1_address: (required) + :type l1_address: str + :param cursor: + :type cursor: str + :param filter: + :type filter: 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._deposit_history_serialize( + authorization=authorization, + account_index=account_index, + l1_address=l1_address, + cursor=cursor, + filter=filter, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DepositHistory", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _deposit_history_serialize( + self, + authorization, + account_index, + l1_address, + cursor, + filter, + _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 l1_address is not None: + + _query_params.append(('l1_address', l1_address)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if filter is not None: + + _query_params.append(('filter', filter)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + + + # 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/deposit/history', + 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 next_nonce( + self, + account_index: StrictInt, + api_key_index: 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, + ) -> NextNonce: + """nextNonce + + Get next nonce for a specific account and api key + + :param account_index: (required) + :type account_index: int + :param api_key_index: (required) + :type api_key_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._next_nonce_serialize( + account_index=account_index, + api_key_index=api_key_index, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NextNonce", + '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 next_nonce_with_http_info( + self, + account_index: StrictInt, + api_key_index: 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[NextNonce]: + """nextNonce + + Get next nonce for a specific account and api key + + :param account_index: (required) + :type account_index: int + :param api_key_index: (required) + :type api_key_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._next_nonce_serialize( + account_index=account_index, + api_key_index=api_key_index, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NextNonce", + '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 next_nonce_without_preload_content( + self, + account_index: StrictInt, + api_key_index: 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: + """nextNonce + + Get next nonce for a specific account and api key + + :param account_index: (required) + :type account_index: int + :param api_key_index: (required) + :type api_key_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._next_nonce_serialize( + account_index=account_index, + api_key_index=api_key_index, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NextNonce", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _next_nonce_serialize( + self, + account_index, + api_key_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 api_key_index is not None: + + _query_params.append(('api_key_index', api_key_index)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/nextNonce', + 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 send_tx( + self, + tx_type: StrictInt, + tx_info: StrictStr, + price_protection: Optional[StrictBool] = 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, + ) -> RespSendTx: + """sendTx + + You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started + + :param tx_type: (required) + :type tx_type: int + :param tx_info: (required) + :type tx_info: str + :param price_protection: + :type price_protection: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_tx_serialize( + tx_type=tx_type, + tx_info=tx_info, + price_protection=price_protection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespSendTx", + '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 send_tx_with_http_info( + self, + tx_type: StrictInt, + tx_info: StrictStr, + price_protection: Optional[StrictBool] = 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[RespSendTx]: + """sendTx + + You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started + + :param tx_type: (required) + :type tx_type: int + :param tx_info: (required) + :type tx_info: str + :param price_protection: + :type price_protection: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_tx_serialize( + tx_type=tx_type, + tx_info=tx_info, + price_protection=price_protection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespSendTx", + '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 send_tx_without_preload_content( + self, + tx_type: StrictInt, + tx_info: StrictStr, + price_protection: Optional[StrictBool] = 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: + """sendTx + + You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started + + :param tx_type: (required) + :type tx_type: int + :param tx_info: (required) + :type tx_info: str + :param price_protection: + :type price_protection: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._send_tx_serialize( + tx_type=tx_type, + tx_info=tx_info, + price_protection=price_protection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespSendTx", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _send_tx_serialize( + self, + tx_type, + tx_info, + price_protection, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if tx_type is not None: + _form_params.append(('tx_type', tx_type)) + if tx_info is not None: + _form_params.append(('tx_info', tx_info)) + if price_protection is not None: + _form_params.append(('price_protection', price_protection)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/sendTx', + 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 send_tx_batch( + self, + tx_types: StrictStr, + tx_infos: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RespSendTxBatch: + """sendTxBatch + + You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started + + :param tx_types: (required) + :type tx_types: str + :param tx_infos: (required) + :type tx_infos: 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._send_tx_batch_serialize( + tx_types=tx_types, + tx_infos=tx_infos, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespSendTxBatch", + '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 send_tx_batch_with_http_info( + self, + tx_types: StrictStr, + tx_infos: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RespSendTxBatch]: + """sendTxBatch + + You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started + + :param tx_types: (required) + :type tx_types: str + :param tx_infos: (required) + :type tx_infos: 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._send_tx_batch_serialize( + tx_types=tx_types, + tx_infos=tx_infos, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespSendTxBatch", + '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 send_tx_batch_without_preload_content( + self, + tx_types: StrictStr, + tx_infos: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """sendTxBatch + + You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started + + :param tx_types: (required) + :type tx_types: str + :param tx_infos: (required) + :type tx_infos: 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._send_tx_batch_serialize( + tx_types=tx_types, + tx_infos=tx_infos, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespSendTxBatch", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _send_tx_batch_serialize( + self, + tx_types, + tx_infos, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + if tx_types is not None: + _form_params.append(('tx_types', tx_types)) + if tx_infos is not None: + _form_params.append(('tx_infos', tx_infos)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/sendTxBatch', + 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 set_account_metadata( + self, + req_set_account_metadata: ReqSetAccountMetadata, + 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, + ) -> ResultCode: + """setAccountMetadata + + Set account metadata + + :param req_set_account_metadata: (required) + :type req_set_account_metadata: ReqSetAccountMetadata + :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._set_account_metadata_serialize( + req_set_account_metadata=req_set_account_metadata, + authorization=authorization, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultCode", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def set_account_metadata_with_http_info( + self, + req_set_account_metadata: ReqSetAccountMetadata, + 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[ResultCode]: + """setAccountMetadata + + Set account metadata + + :param req_set_account_metadata: (required) + :type req_set_account_metadata: ReqSetAccountMetadata + :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. @@ -792,10 +1994,9 @@ async def send_tx_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._send_tx_serialize( - tx_type=tx_type, - tx_info=tx_info, - price_protection=price_protection, + _param = self._set_account_metadata_serialize( + req_set_account_metadata=req_set_account_metadata, + authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -803,7 +2004,7 @@ async def send_tx_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespSendTx", + '200': "ResultCode", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -817,11 +2018,10 @@ async def send_tx_with_http_info( ) - async def send_tx_without_preload_content( + async def set_account_metadata_without_preload_content( self, - tx_type: StrictInt, - tx_info: StrictStr, - price_protection: Optional[StrictBool] = None, + req_set_account_metadata: ReqSetAccountMetadata, + authorization: Optional[StrictStr] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -835,16 +2035,14 @@ async def send_tx_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """sendTx + """setAccountMetadata - You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers) + Set account metadata - :param tx_type: (required) - :type tx_type: int - :param tx_info: (required) - :type tx_info: str - :param price_protection: - :type price_protection: bool + :param req_set_account_metadata: (required) + :type req_set_account_metadata: ReqSetAccountMetadata + :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 @@ -867,10 +2065,9 @@ async def send_tx_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._send_tx_serialize( - tx_type=tx_type, - tx_info=tx_info, - price_protection=price_protection, + _param = self._set_account_metadata_serialize( + req_set_account_metadata=req_set_account_metadata, + authorization=authorization, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -878,7 +2075,7 @@ async def send_tx_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespSendTx", + '200': "ResultCode", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -888,11 +2085,10 @@ async def send_tx_without_preload_content( return response_data.response - def _send_tx_serialize( + def _set_account_metadata_serialize( self, - tx_type, - tx_info, - price_protection, + req_set_account_metadata, + authorization, _request_auth, _content_type, _headers, @@ -914,14 +2110,12 @@ def _send_tx_serialize( # process the path parameters # process the query parameters # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters - if tx_type is not None: - _form_params.append(('tx_type', tx_type)) - if tx_info is not None: - _form_params.append(('tx_info', tx_info)) - if price_protection is not None: - _form_params.append(('price_protection', price_protection)) # process the body parameter + if req_set_account_metadata is not None: + _body_params = req_set_account_metadata # set the HTTP header `Accept` @@ -939,7 +2133,7 @@ def _send_tx_serialize( _default_content_type = ( self.api_client.select_header_content_type( [ - 'multipart/form-data' + 'application/json' ] ) ) @@ -952,7 +2146,7 @@ def _send_tx_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/api/v1/sendTx', + resource_path='/api/v1/setAccountMetadata', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -968,10 +2162,12 @@ def _send_tx_serialize( - async def send_tx_batch( + async def transfer_history( self, - tx_types: StrictStr, - tx_infos: StrictStr, + account_index: StrictInt, + authorization: Optional[StrictStr] = None, + cursor: Optional[StrictStr] = None, + type: Optional[List[StrictStr]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -984,15 +2180,19 @@ async def send_tx_batch( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RespSendTxBatch: - """sendTxBatch + ) -> TransferHistory: + """transfer_history - You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers) + Get transfer history. To fetch an account index, you will need to `auth` the request, unless it's a public pool. - :param tx_types: (required) - :type tx_types: str - :param tx_infos: (required) - :type tx_infos: str + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: str + :param cursor: + :type cursor: str + :param type: + :type type: List[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 @@ -1015,9 +2215,11 @@ async def send_tx_batch( :return: Returns the result object. """ # noqa: E501 - _param = self._send_tx_batch_serialize( - tx_types=tx_types, - tx_infos=tx_infos, + _param = self._transfer_history_serialize( + account_index=account_index, + authorization=authorization, + cursor=cursor, + type=type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1025,7 +2227,7 @@ async def send_tx_batch( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespSendTxBatch", + '200': "TransferHistory", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1039,10 +2241,12 @@ async def send_tx_batch( ).data - async def send_tx_batch_with_http_info( + async def transfer_history_with_http_info( self, - tx_types: StrictStr, - tx_infos: StrictStr, + account_index: StrictInt, + authorization: Optional[StrictStr] = None, + cursor: Optional[StrictStr] = None, + type: Optional[List[StrictStr]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1055,15 +2259,19 @@ async def send_tx_batch_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[RespSendTxBatch]: - """sendTxBatch + ) -> ApiResponse[TransferHistory]: + """transfer_history - You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers) + Get transfer history. To fetch an account index, you will need to `auth` the request, unless it's a public pool. - :param tx_types: (required) - :type tx_types: str - :param tx_infos: (required) - :type tx_infos: str + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: str + :param cursor: + :type cursor: str + :param type: + :type type: List[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 @@ -1086,9 +2294,11 @@ async def send_tx_batch_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._send_tx_batch_serialize( - tx_types=tx_types, - tx_infos=tx_infos, + _param = self._transfer_history_serialize( + account_index=account_index, + authorization=authorization, + cursor=cursor, + type=type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1096,7 +2306,7 @@ async def send_tx_batch_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespSendTxBatch", + '200': "TransferHistory", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1110,10 +2320,12 @@ async def send_tx_batch_with_http_info( ) - async def send_tx_batch_without_preload_content( + async def transfer_history_without_preload_content( self, - tx_types: StrictStr, - tx_infos: StrictStr, + account_index: StrictInt, + authorization: Optional[StrictStr] = None, + cursor: Optional[StrictStr] = None, + type: Optional[List[StrictStr]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1127,14 +2339,18 @@ async def send_tx_batch_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """sendTxBatch + """transfer_history - You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers) + Get transfer history. To fetch an account index, you will need to `auth` the request, unless it's a public pool. - :param tx_types: (required) - :type tx_types: str - :param tx_infos: (required) - :type tx_infos: str + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: str + :param cursor: + :type cursor: str + :param type: + :type type: List[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 @@ -1157,9 +2373,11 @@ async def send_tx_batch_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._send_tx_batch_serialize( - tx_types=tx_types, - tx_infos=tx_infos, + _param = self._transfer_history_serialize( + account_index=account_index, + authorization=authorization, + cursor=cursor, + type=type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1167,7 +2385,7 @@ async def send_tx_batch_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "RespSendTxBatch", + '200': "TransferHistory", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1177,10 +2395,12 @@ async def send_tx_batch_without_preload_content( return response_data.response - def _send_tx_batch_serialize( + def _transfer_history_serialize( self, - tx_types, - tx_infos, + account_index, + authorization, + cursor, + type, _request_auth, _content_type, _headers, @@ -1190,6 +2410,7 @@ def _send_tx_batch_serialize( _host = None _collection_formats: Dict[str, str] = { + 'type': 'multi', } _path_params: Dict[str, str] = {} @@ -1201,12 +2422,22 @@ def _send_tx_batch_serialize( # process the path parameters # process the query parameters + if account_index is not None: + + _query_params.append(('account_index', account_index)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if type is not None: + + _query_params.append(('type', type)) + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters - if tx_types is not None: - _form_params.append(('tx_types', tx_types)) - if tx_infos is not None: - _form_params.append(('tx_infos', tx_infos)) # process the body parameter @@ -1218,27 +2449,14 @@ def _send_tx_batch_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'multipart/form-data' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/sendTxBatch', + method='GET', + resource_path='/api/v1/transfer/history', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1254,13 +2472,10 @@ def _send_tx_batch_serialize( - async def transfer_history( + async def tx( self, - account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - cursor: Optional[StrictStr] = None, - type: Optional[StrictStr] = None, + by: StrictStr, + value: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1273,21 +2488,15 @@ async def transfer_history( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TransferHistory: - """transfer_history + ) -> EnrichedTx: + """tx - Get transfer history + Get transaction by hash or sequence index - :param account_index: (required) - :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param cursor: - :type cursor: str - :param type: - :type type: str + :param by: (required) + :type by: str + :param value: (required) + :type value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1310,12 +2519,9 @@ async def transfer_history( :return: Returns the result object. """ # noqa: E501 - _param = self._transfer_history_serialize( - account_index=account_index, - authorization=authorization, - auth=auth, - cursor=cursor, - type=type, + _param = self._tx_serialize( + by=by, + value=value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1323,7 +2529,7 @@ async def transfer_history( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TransferHistory", + '200': "EnrichedTx", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1337,13 +2543,10 @@ async def transfer_history( ).data - async def transfer_history_with_http_info( + async def tx_with_http_info( self, - account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - cursor: Optional[StrictStr] = None, - type: Optional[StrictStr] = None, + by: StrictStr, + value: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1356,21 +2559,15 @@ async def transfer_history_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[TransferHistory]: - """transfer_history + ) -> ApiResponse[EnrichedTx]: + """tx - Get transfer history + Get transaction by hash or sequence index - :param account_index: (required) - :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param cursor: - :type cursor: str - :param type: - :type type: str + :param by: (required) + :type by: str + :param value: (required) + :type value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1393,12 +2590,9 @@ async def transfer_history_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._transfer_history_serialize( - account_index=account_index, - authorization=authorization, - auth=auth, - cursor=cursor, - type=type, + _param = self._tx_serialize( + by=by, + value=value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1406,7 +2600,7 @@ async def transfer_history_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TransferHistory", + '200': "EnrichedTx", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1420,13 +2614,10 @@ async def transfer_history_with_http_info( ) - async def transfer_history_without_preload_content( + async def tx_without_preload_content( self, - account_index: StrictInt, - authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, - auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, - cursor: Optional[StrictStr] = None, - type: Optional[StrictStr] = None, + by: StrictStr, + value: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1440,20 +2631,14 @@ async def transfer_history_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """transfer_history + """tx - Get transfer history + Get transaction by hash or sequence index - :param account_index: (required) - :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str - :param cursor: - :type cursor: str - :param type: - :type type: str + :param by: (required) + :type by: str + :param value: (required) + :type value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1476,12 +2661,9 @@ async def transfer_history_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._transfer_history_serialize( - account_index=account_index, - authorization=authorization, - auth=auth, - cursor=cursor, - type=type, + _param = self._tx_serialize( + by=by, + value=value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1489,7 +2671,7 @@ async def transfer_history_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TransferHistory", + '200': "EnrichedTx", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1499,13 +2681,10 @@ async def transfer_history_without_preload_content( return response_data.response - def _transfer_history_serialize( + def _tx_serialize( self, - account_index, - authorization, - auth, - cursor, - type, + by, + value, _request_auth, _content_type, _headers, @@ -1526,25 +2705,13 @@ def _transfer_history_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)) - - if cursor is not None: + if by is not None: - _query_params.append(('cursor', cursor)) + _query_params.append(('by', by)) - if type is not None: + if value is not None: - _query_params.append(('type', type)) + _query_params.append(('value', value)) # process the header parameters # process the form parameters @@ -1566,7 +2733,7 @@ def _transfer_history_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/transfer/history', + resource_path='/api/v1/tx', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1582,10 +2749,9 @@ def _transfer_history_serialize( - async def tx( + async def tx_from_l1_tx_hash( self, - by: StrictStr, - value: StrictStr, + hash: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1599,14 +2765,12 @@ async def tx( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> EnrichedTx: - """tx + """txFromL1TxHash - Get transaction by hash or sequence index + Get L1 transaction by L1 transaction hash - :param by: (required) - :type by: str - :param value: (required) - :type value: str + :param hash: (required) + :type hash: 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 @@ -1629,9 +2793,8 @@ async def tx( :return: Returns the result object. """ # noqa: E501 - _param = self._tx_serialize( - by=by, - value=value, + _param = self._tx_from_l1_tx_hash_serialize( + hash=hash, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1653,10 +2816,9 @@ async def tx( ).data - async def tx_with_http_info( + async def tx_from_l1_tx_hash_with_http_info( self, - by: StrictStr, - value: StrictStr, + hash: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1670,14 +2832,12 @@ async def tx_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[EnrichedTx]: - """tx + """txFromL1TxHash - Get transaction by hash or sequence index + Get L1 transaction by L1 transaction hash - :param by: (required) - :type by: str - :param value: (required) - :type value: str + :param hash: (required) + :type hash: 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 @@ -1700,9 +2860,8 @@ async def tx_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._tx_serialize( - by=by, - value=value, + _param = self._tx_from_l1_tx_hash_serialize( + hash=hash, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1724,10 +2883,9 @@ async def tx_with_http_info( ) - async def tx_without_preload_content( + async def tx_from_l1_tx_hash_without_preload_content( self, - by: StrictStr, - value: StrictStr, + hash: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1741,14 +2899,12 @@ async def tx_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """tx + """txFromL1TxHash - Get transaction by hash or sequence index + Get L1 transaction by L1 transaction hash - :param by: (required) - :type by: str - :param value: (required) - :type value: str + :param hash: (required) + :type hash: 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 @@ -1771,9 +2927,8 @@ async def tx_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._tx_serialize( - by=by, - value=value, + _param = self._tx_from_l1_tx_hash_serialize( + hash=hash, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1791,10 +2946,9 @@ async def tx_without_preload_content( return response_data.response - def _tx_serialize( + def _tx_from_l1_tx_hash_serialize( self, - by, - value, + hash, _request_auth, _content_type, _headers, @@ -1815,13 +2969,9 @@ def _tx_serialize( # process the path parameters # process the query parameters - if by is not None: - - _query_params.append(('by', by)) - - if value is not None: + if hash is not None: - _query_params.append(('value', value)) + _query_params.append(('hash', hash)) # process the header parameters # process the form parameters @@ -1843,7 +2993,7 @@ def _tx_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/tx', + resource_path='/api/v1/txFromL1TxHash', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1859,9 +3009,10 @@ def _tx_serialize( - async def tx_from_l1_tx_hash( + async def txs( self, - hash: StrictStr, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + index: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1874,13 +3025,15 @@ async def tx_from_l1_tx_hash( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EnrichedTx: - """txFromL1TxHash + ) -> Txs: + """txs - Get L1 transaction by L1 transaction hash + Get transactions which are already packed into blocks - :param hash: (required) - :type hash: str + :param limit: (required) + :type limit: int + :param index: + :type index: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1903,8 +3056,9 @@ async def tx_from_l1_tx_hash( :return: Returns the result object. """ # noqa: E501 - _param = self._tx_from_l1_tx_hash_serialize( - hash=hash, + _param = self._txs_serialize( + limit=limit, + index=index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1912,7 +3066,7 @@ async def tx_from_l1_tx_hash( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrichedTx", + '200': "Txs", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1926,9 +3080,10 @@ async def tx_from_l1_tx_hash( ).data - async def tx_from_l1_tx_hash_with_http_info( + async def txs_with_http_info( self, - hash: StrictStr, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + index: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1941,13 +3096,15 @@ async def tx_from_l1_tx_hash_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EnrichedTx]: - """txFromL1TxHash + ) -> ApiResponse[Txs]: + """txs - Get L1 transaction by L1 transaction hash + Get transactions which are already packed into blocks - :param hash: (required) - :type hash: str + :param limit: (required) + :type limit: int + :param index: + :type index: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1970,8 +3127,9 @@ async def tx_from_l1_tx_hash_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._tx_from_l1_tx_hash_serialize( - hash=hash, + _param = self._txs_serialize( + limit=limit, + index=index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1979,7 +3137,7 @@ async def tx_from_l1_tx_hash_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrichedTx", + '200': "Txs", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1993,9 +3151,10 @@ async def tx_from_l1_tx_hash_with_http_info( ) - async def tx_from_l1_tx_hash_without_preload_content( + async def txs_without_preload_content( self, - hash: StrictStr, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + index: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2009,12 +3168,14 @@ async def tx_from_l1_tx_hash_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """txFromL1TxHash + """txs - Get L1 transaction by L1 transaction hash + Get transactions which are already packed into blocks - :param hash: (required) - :type hash: str + :param limit: (required) + :type limit: int + :param index: + :type index: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2037,8 +3198,9 @@ async def tx_from_l1_tx_hash_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._tx_from_l1_tx_hash_serialize( - hash=hash, + _param = self._txs_serialize( + limit=limit, + index=index, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2046,7 +3208,7 @@ async def tx_from_l1_tx_hash_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "EnrichedTx", + '200': "Txs", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -2056,9 +3218,10 @@ async def tx_from_l1_tx_hash_without_preload_content( return response_data.response - def _tx_from_l1_tx_hash_serialize( + def _txs_serialize( self, - hash, + limit, + index, _request_auth, _content_type, _headers, @@ -2079,9 +3242,13 @@ def _tx_from_l1_tx_hash_serialize( # process the path parameters # process the query parameters - if hash is not None: + if index is not None: - _query_params.append(('hash', hash)) + _query_params.append(('index', index)) + + if limit is not None: + + _query_params.append(('limit', limit)) # process the header parameters # process the form parameters @@ -2103,7 +3270,7 @@ def _tx_from_l1_tx_hash_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/txFromL1TxHash', + resource_path='/api/v1/txs', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2121,9 +3288,8 @@ def _tx_from_l1_tx_hash_serialize( async def withdraw_history( self, + authorization: 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, cursor: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, _request_timeout: Union[ @@ -2141,14 +3307,12 @@ async def withdraw_history( ) -> WithdrawHistory: """withdraw_history - Get withdraw history + Get withdraw history. Secure withdrawals are only set to `claimable` when ready. You should only expect the `completed` status on fast withdrawals via Arbitrum. + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param cursor: :type cursor: str :param filter: @@ -2176,9 +3340,8 @@ async def withdraw_history( """ # noqa: E501 _param = self._withdraw_history_serialize( - account_index=account_index, authorization=authorization, - auth=auth, + account_index=account_index, cursor=cursor, filter=filter, _request_auth=_request_auth, @@ -2204,9 +3367,8 @@ async def withdraw_history( async def withdraw_history_with_http_info( self, + authorization: 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, cursor: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, _request_timeout: Union[ @@ -2224,14 +3386,12 @@ async def withdraw_history_with_http_info( ) -> ApiResponse[WithdrawHistory]: """withdraw_history - Get withdraw history + Get withdraw history. Secure withdrawals are only set to `claimable` when ready. You should only expect the `completed` status on fast withdrawals via Arbitrum. + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param cursor: :type cursor: str :param filter: @@ -2259,9 +3419,8 @@ async def withdraw_history_with_http_info( """ # noqa: E501 _param = self._withdraw_history_serialize( - account_index=account_index, authorization=authorization, - auth=auth, + account_index=account_index, cursor=cursor, filter=filter, _request_auth=_request_auth, @@ -2287,9 +3446,8 @@ async def withdraw_history_with_http_info( async def withdraw_history_without_preload_content( self, + authorization: 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, cursor: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, _request_timeout: Union[ @@ -2307,14 +3465,12 @@ async def withdraw_history_without_preload_content( ) -> RESTResponseType: """withdraw_history - Get withdraw history + Get withdraw history. Secure withdrawals are only set to `claimable` when ready. You should only expect the `completed` status on fast withdrawals via Arbitrum. + :param authorization: (required) + :type authorization: str :param account_index: (required) :type account_index: int - :param authorization: make required after integ is done - :type authorization: str - :param auth: made optional to support header auth clients - :type auth: str :param cursor: :type cursor: str :param filter: @@ -2342,9 +3498,8 @@ async def withdraw_history_without_preload_content( """ # noqa: E501 _param = self._withdraw_history_serialize( - account_index=account_index, authorization=authorization, - auth=auth, + account_index=account_index, cursor=cursor, filter=filter, _request_auth=_request_auth, @@ -2366,9 +3521,8 @@ async def withdraw_history_without_preload_content( def _withdraw_history_serialize( self, - account_index, authorization, - auth, + account_index, cursor, filter, _request_auth, @@ -2391,14 +3545,6 @@ def _withdraw_history_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)) @@ -2412,6 +3558,8 @@ def _withdraw_history_serialize( _query_params.append(('filter', filter)) # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization # process the form parameters # process the body parameter diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index a8bf7f6..a12674f 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -18,14 +18,10 @@ from lighter.models.account_api_keys import AccountApiKeys from lighter.models.account_asset import AccountAsset from lighter.models.account_limits import AccountLimits -from lighter.models.account_margin_stats import AccountMarginStats -from lighter.models.account_market_stats import AccountMarketStats from lighter.models.account_metadata import AccountMetadata 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_stats import AccountStats -from lighter.models.account_trade_stats import AccountTradeStats from lighter.models.announcement import Announcement from lighter.models.announcements import Announcements from lighter.models.api_key import ApiKey @@ -33,19 +29,21 @@ from lighter.models.approved_integrator import ApprovedIntegrator from lighter.models.asset import Asset from lighter.models.asset_details import AssetDetails -from lighter.models.auth import Auth -from lighter.models.bridge import Bridge +from lighter.models.block import Block +from lighter.models.blocks import Blocks from lighter.models.bridge_supported_network import BridgeSupportedNetwork +from lighter.models.bridge_supported_networks import BridgeSupportedNetworks from lighter.models.candle import Candle from lighter.models.candles import Candles from lighter.models.contract_address import ContractAddress -from lighter.models.cursor import Cursor +from lighter.models.create_intent_address_resp import CreateIntentAddressResp +from lighter.models.current_height import CurrentHeight from lighter.models.daily_return import DailyReturn +from lighter.models.deposit import Deposit 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_accounts import DetailedAccounts -from lighter.models.detailed_candlestick import DetailedCandlestick from lighter.models.enriched_tx import EnrichedTx from lighter.models.exchange_metric import ExchangeMetric from lighter.models.exchange_stats import ExchangeStats @@ -57,6 +55,7 @@ from lighter.models.fundings import Fundings 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.lease_entry import LeaseEntry from lighter.models.lease_option_entry import LeaseOptionEntry from lighter.models.liq_trade import LiqTrade @@ -68,7 +67,6 @@ from lighter.models.order import Order from lighter.models.order_book import OrderBook from lighter.models.order_book_depth import OrderBookDepth -from lighter.models.order_book_depth_with_begin_nonce import OrderBookDepthWithBeginNonce from lighter.models.order_book_details import OrderBookDetails from lighter.models.order_book_orders import OrderBookOrders from lighter.models.order_book_stats import OrderBookStats @@ -76,7 +74,6 @@ from lighter.models.orders import Orders from lighter.models.partner_stats import PartnerStats from lighter.models.pending_unlock import PendingUnlock -from lighter.models.perps_market_stats import PerpsMarketStats from lighter.models.perps_order_book_detail import PerpsOrderBookDetail from lighter.models.pn_l_entry import PnLEntry from lighter.models.position_funding import PositionFunding @@ -85,73 +82,28 @@ from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_metadata import PublicPoolMetadata from lighter.models.public_pool_share import PublicPoolShare -from lighter.models.push_notif_delivery_result import PushNotifDeliveryResult from lighter.models.referral import Referral -from lighter.models.req_do_faucet import ReqDoFaucet -from lighter.models.req_export_data import ReqExportData -from lighter.models.req_get_account import ReqGetAccount -from lighter.models.req_get_account_active_orders import ReqGetAccountActiveOrders -from lighter.models.req_get_account_api_keys import ReqGetAccountApiKeys -from lighter.models.req_get_account_by_l1_address import ReqGetAccountByL1Address -from lighter.models.req_get_account_inactive_orders import ReqGetAccountInactiveOrders -from lighter.models.req_get_account_limits import ReqGetAccountLimits -from lighter.models.req_get_account_metadata import ReqGetAccountMetadata -from lighter.models.req_get_account_pn_l import ReqGetAccountPnL -from lighter.models.req_get_account_txs import ReqGetAccountTxs -from lighter.models.req_get_api_tokens import ReqGetApiTokens -from lighter.models.req_get_asset_details import ReqGetAssetDetails -from lighter.models.req_get_block import ReqGetBlock -from lighter.models.req_get_block_txs import ReqGetBlockTxs -from lighter.models.req_get_bridges_by_l1_addr import ReqGetBridgesByL1Addr -from lighter.models.req_get_by_account import ReqGetByAccount -from lighter.models.req_get_candles import ReqGetCandles -from lighter.models.req_get_deposit_history import ReqGetDepositHistory -from lighter.models.req_get_exchange_metrics import ReqGetExchangeMetrics -from lighter.models.req_get_execute_stats import ReqGetExecuteStats -from lighter.models.req_get_fast_withdraw_info import ReqGetFastWithdrawInfo -from lighter.models.req_get_fundings import ReqGetFundings -from lighter.models.req_get_l1_metadata import ReqGetL1Metadata -from lighter.models.req_get_l1_tx import ReqGetL1Tx -from lighter.models.req_get_latest_deposit import ReqGetLatestDeposit -from lighter.models.req_get_leases import ReqGetLeases -from lighter.models.req_get_liquidation_infos import ReqGetLiquidationInfos -from lighter.models.req_get_maker_only_api_keys import ReqGetMakerOnlyApiKeys -from lighter.models.req_get_next_nonce import ReqGetNextNonce -from lighter.models.req_get_order_book_details import ReqGetOrderBookDetails -from lighter.models.req_get_order_book_orders import ReqGetOrderBookOrders -from lighter.models.req_get_order_books import ReqGetOrderBooks -from lighter.models.req_get_partner_stats import ReqGetPartnerStats -from lighter.models.req_get_position_funding import ReqGetPositionFunding -from lighter.models.req_get_public_pools_metadata import ReqGetPublicPoolsMetadata -from lighter.models.req_get_push_notif_settings import ReqGetPushNotifSettings -from lighter.models.req_get_range_with_cursor import ReqGetRangeWithCursor -from lighter.models.req_get_range_with_index import ReqGetRangeWithIndex -from lighter.models.req_get_range_with_index_sortable import ReqGetRangeWithIndexSortable -from lighter.models.req_get_recent_trades import ReqGetRecentTrades -from lighter.models.req_get_trades import ReqGetTrades -from lighter.models.req_get_transfer_fee_info import ReqGetTransferFeeInfo -from lighter.models.req_get_transfer_history import ReqGetTransferHistory -from lighter.models.req_get_tx import ReqGetTx -from lighter.models.req_get_user_referrals import ReqGetUserReferrals -from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory +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.req_set_account_metadata import ReqSetAccountMetadata from lighter.models.resp_change_account_tier import RespChangeAccountTier from lighter.models.resp_get_api_tokens import RespGetApiTokens -from lighter.models.resp_get_bridges_by_l1_addr import RespGetBridgesByL1Addr from lighter.models.resp_get_exchange_metrics import RespGetExchangeMetrics from lighter.models.resp_get_execute_stats import RespGetExecuteStats from lighter.models.resp_get_fast_bridge_info import RespGetFastBridgeInfo from lighter.models.resp_get_fastwithdrawal_info import RespGetFastwithdrawalInfo -from lighter.models.resp_get_is_next_bridge_fast import RespGetIsNextBridgeFast from lighter.models.resp_get_lease_options import RespGetLeaseOptions from lighter.models.resp_get_leases import RespGetLeases from lighter.models.resp_get_maker_only_api_keys import RespGetMakerOnlyApiKeys -from lighter.models.resp_get_push_notif_settings import RespGetPushNotifSettings from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata from lighter.models.resp_revoke_api_token import RespRevokeApiToken from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch from lighter.models.resp_set_maker_only_api_keys import RespSetMakerOnlyApiKeys +from lighter.models.resp_update_kickback import RespUpdateKickback +from lighter.models.resp_update_referral_code import RespUpdateReferralCode from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode from lighter.models.risk_info import RiskInfo @@ -159,26 +111,27 @@ from lighter.models.share_price import SharePrice from lighter.models.simple_order import SimpleOrder from lighter.models.slippage_result import SlippageResult -from lighter.models.spot_avg_entry_price import SpotAvgEntryPrice -from lighter.models.spot_market_stats import SpotMarketStats from lighter.models.spot_order_book_detail import SpotOrderBookDetail from lighter.models.status import Status from lighter.models.strategy import Strategy from lighter.models.sub_accounts import SubAccounts from lighter.models.system_config import SystemConfig -from lighter.models.ticker import Ticker +from lighter.models.token import Token +from lighter.models.token_list import TokenList from lighter.models.trade import Trade from lighter.models.trade_stats import TradeStats from lighter.models.trades import Trades from lighter.models.transfer_fee_info import TransferFeeInfo from lighter.models.transfer_history import TransferHistory from lighter.models.transfer_history_item import TransferHistoryItem +from lighter.models.tx import Tx from lighter.models.tx_hash import TxHash -from lighter.models.tx_hashes import TxHashes +from lighter.models.txs import Txs from lighter.models.user_referrals import UserReferrals from lighter.models.validator_info import ValidatorInfo from lighter.models.withdraw_history import WithdrawHistory from lighter.models.withdraw_history_item import WithdrawHistoryItem from lighter.models.zk_lighter_info import ZkLighterInfo +# manual additions from lighter.models.ws_account_assets import WSAccountAssets diff --git a/lighter/models/account.py b/lighter/models/account.py index 78d42db..87c11b0 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, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -29,6 +29,7 @@ class Account(BaseModel): code: StrictInt message: Optional[StrictStr] = None account_type: StrictInt + account_trading_mode: StrictInt = Field(description="Classic=0 and Unified=1") index: StrictInt l1_address: StrictStr cancel_all_time: StrictInt @@ -39,9 +40,8 @@ class Account(BaseModel): status: StrictInt collateral: StrictStr transaction_time: StrictInt - account_trading_mode: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "available_balance", "status", "collateral", "transaction_time", "account_trading_mode"] + __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"] model_config = ConfigDict( populate_by_name=True, @@ -104,6 +104,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "code": obj.get("code"), "message": obj.get("message"), "account_type": obj.get("account_type"), + "account_trading_mode": obj.get("account_trading_mode"), "index": obj.get("index"), "l1_address": obj.get("l1_address"), "cancel_all_time": obj.get("cancel_all_time"), @@ -113,8 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "available_balance": obj.get("available_balance"), "status": obj.get("status"), "collateral": obj.get("collateral"), - "transaction_time": obj.get("transaction_time"), - "account_trading_mode": obj.get("account_trading_mode") + "transaction_time": obj.get("transaction_time") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_asset.py b/lighter/models/account_asset.py index c6ca30a..c4cf546 100644 --- a/lighter/models/account_asset.py +++ b/lighter/models/account_asset.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -30,8 +30,17 @@ class AccountAsset(BaseModel): asset_id: StrictInt balance: StrictStr locked_balance: StrictStr + margin_balance: StrictStr + margin_mode: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "asset_id", "balance", "locked_balance"] + __properties: ClassVar[List[str]] = ["symbol", "asset_id", "balance", "locked_balance", "margin_balance", "margin_mode"] + + @field_validator('margin_mode') + def margin_mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['enabled', 'disabled']): + raise ValueError("must be one of enum values ('enabled', 'disabled')") + return value model_config = ConfigDict( populate_by_name=True, @@ -94,7 +103,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "symbol": obj.get("symbol"), "asset_id": obj.get("asset_id"), "balance": obj.get("balance"), - "locked_balance": obj.get("locked_balance") + "locked_balance": obj.get("locked_balance"), + "margin_balance": obj.get("margin_balance"), + "margin_mode": obj.get("margin_mode") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_limits.py b/lighter/models/account_limits.py index 4803894..c5a6fd5 100644 --- a/lighter/models/account_limits.py +++ b/lighter/models/account_limits.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 from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -29,16 +29,17 @@ class AccountLimits(BaseModel): code: StrictInt message: Optional[StrictStr] = None max_llp_percentage: StrictInt - max_llp_amount: StrictStr user_tier: StrictStr can_create_public_pool: StrictBool - user_tier_name: StrictStr + max_llp_amount: StrictStr current_maker_fee_tick: StrictInt current_taker_fee_tick: StrictInt - leased_lit: StrictStr - effective_lit_stakes: StrictStr + effective_lit_stakes: StrictStr = Field(description="Effective staked LIT shares including active leases.") + leased_lit: StrictStr = Field(description="Total actively leased LIT.") + user_tier_name: StrictStr + user_tier_last_update: Optional[StrictInt] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "max_llp_percentage", "max_llp_amount", "user_tier", "can_create_public_pool", "user_tier_name", "current_maker_fee_tick", "current_taker_fee_tick", "leased_lit", "effective_lit_stakes"] + __properties: ClassVar[List[str]] = ["code", "message", "max_llp_percentage", "user_tier", "can_create_public_pool", "max_llp_amount", "current_maker_fee_tick", "current_taker_fee_tick", "effective_lit_stakes", "leased_lit", "user_tier_name", "user_tier_last_update"] model_config = ConfigDict( populate_by_name=True, @@ -101,14 +102,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "code": obj.get("code"), "message": obj.get("message"), "max_llp_percentage": obj.get("max_llp_percentage"), - "max_llp_amount": obj.get("max_llp_amount"), "user_tier": obj.get("user_tier"), "can_create_public_pool": obj.get("can_create_public_pool"), - "user_tier_name": obj.get("user_tier_name"), + "max_llp_amount": obj.get("max_llp_amount"), "current_maker_fee_tick": obj.get("current_maker_fee_tick"), "current_taker_fee_tick": obj.get("current_taker_fee_tick"), + "effective_lit_stakes": obj.get("effective_lit_stakes"), "leased_lit": obj.get("leased_lit"), - "effective_lit_stakes": obj.get("effective_lit_stakes") + "user_tier_name": obj.get("user_tier_name"), + "user_tier_last_update": obj.get("user_tier_last_update") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_margin_stats.py b/lighter/models/account_margin_stats.py deleted file mode 100644 index 03e5dea..0000000 --- a/lighter/models/account_margin_stats.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class AccountMarginStats(BaseModel): - """ - AccountMarginStats - """ # noqa: E501 - collateral: StrictStr - portfolio_value: StrictStr - leverage: StrictStr - available_balance: StrictStr - margin_usage: StrictStr - buying_power: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["collateral", "portfolio_value", "leverage", "available_balance", "margin_usage", "buying_power"] - - 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 AccountMarginStats 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 AccountMarginStats from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "collateral": obj.get("collateral"), - "portfolio_value": obj.get("portfolio_value"), - "leverage": obj.get("leverage"), - "available_balance": obj.get("available_balance"), - "margin_usage": obj.get("margin_usage"), - "buying_power": obj.get("buying_power") - }) - # 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/account_market_stats.py b/lighter/models/account_market_stats.py deleted file mode 100644 index 7065b2d..0000000 --- a/lighter/models/account_market_stats.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class AccountMarketStats(BaseModel): - """ - AccountMarketStats - """ # noqa: E501 - market_id: StrictInt - daily_trades_count: StrictInt - daily_base_token_volume: Union[StrictFloat, StrictInt] - daily_quote_token_volume: Union[StrictFloat, StrictInt] - weekly_trades_count: StrictInt - weekly_base_token_volume: Union[StrictFloat, StrictInt] - weekly_quote_token_volume: Union[StrictFloat, StrictInt] - monthly_trades_count: StrictInt - monthly_base_token_volume: Union[StrictFloat, StrictInt] - monthly_quote_token_volume: Union[StrictFloat, StrictInt] - total_trades_count: StrictInt - total_base_token_volume: Union[StrictFloat, StrictInt] - total_quote_token_volume: Union[StrictFloat, StrictInt] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "weekly_trades_count", "weekly_base_token_volume", "weekly_quote_token_volume", "monthly_trades_count", "monthly_base_token_volume", "monthly_quote_token_volume", "total_trades_count", "total_base_token_volume", "total_quote_token_volume"] - - 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 AccountMarketStats 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 AccountMarketStats 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"), - "daily_trades_count": obj.get("daily_trades_count"), - "daily_base_token_volume": obj.get("daily_base_token_volume"), - "daily_quote_token_volume": obj.get("daily_quote_token_volume"), - "weekly_trades_count": obj.get("weekly_trades_count"), - "weekly_base_token_volume": obj.get("weekly_base_token_volume"), - "weekly_quote_token_volume": obj.get("weekly_quote_token_volume"), - "monthly_trades_count": obj.get("monthly_trades_count"), - "monthly_base_token_volume": obj.get("monthly_base_token_volume"), - "monthly_quote_token_volume": obj.get("monthly_quote_token_volume"), - "total_trades_count": obj.get("total_trades_count"), - "total_base_token_volume": obj.get("total_base_token_volume"), - "total_quote_token_volume": obj.get("total_quote_token_volume") - }) - # 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/account_metadata.py b/lighter/models/account_metadata.py index feb1ae6..76fd86d 100644 --- a/lighter/models/account_metadata.py +++ b/lighter/models/account_metadata.py @@ -31,10 +31,11 @@ class AccountMetadata(BaseModel): description: StrictStr can_invite: StrictBool = Field(description=" Remove After FE uses L1 meta endpoint") referral_points_percentage: StrictStr = Field(description=" Remove After FE uses L1 meta endpoint") - can_rfq: StrictBool created_at: StrictInt + can_rfq: StrictBool + can_rfq_market_ids: List[StrictStr] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "name", "description", "can_invite", "referral_points_percentage", "can_rfq", "created_at"] + __properties: ClassVar[List[str]] = ["account_index", "name", "description", "can_invite", "referral_points_percentage", "created_at", "can_rfq", "can_rfq_market_ids"] model_config = ConfigDict( populate_by_name=True, @@ -99,8 +100,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "description": obj.get("description"), "can_invite": obj.get("can_invite"), "referral_points_percentage": obj.get("referral_points_percentage"), + "created_at": obj.get("created_at"), "can_rfq": obj.get("can_rfq"), - "created_at": obj.get("created_at") + "can_rfq_market_ids": obj.get("can_rfq_market_ids") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_trade_stats.py b/lighter/models/account_trade_stats.py deleted file mode 100644 index 2a783fc..0000000 --- a/lighter/models/account_trade_stats.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class AccountTradeStats(BaseModel): - """ - AccountTradeStats - """ # noqa: E501 - daily_trades_count: StrictInt - daily_volume: Union[StrictFloat, StrictInt] - weekly_trades_count: StrictInt - weekly_volume: Union[StrictFloat, StrictInt] - monthly_trades_count: StrictInt - monthly_volume: Union[StrictFloat, StrictInt] - total_trades_count: StrictInt - total_volume: Union[StrictFloat, StrictInt] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["daily_trades_count", "daily_volume", "weekly_trades_count", "weekly_volume", "monthly_trades_count", "monthly_volume", "total_trades_count", "total_volume"] - - 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 AccountTradeStats 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 AccountTradeStats from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "daily_trades_count": obj.get("daily_trades_count"), - "daily_volume": obj.get("daily_volume"), - "weekly_trades_count": obj.get("weekly_trades_count"), - "weekly_volume": obj.get("weekly_volume"), - "monthly_trades_count": obj.get("monthly_trades_count"), - "monthly_volume": obj.get("monthly_volume"), - "total_trades_count": obj.get("total_trades_count"), - "total_volume": obj.get("total_volume") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/asset.py b/lighter/models/asset.py index 462bac2..339e8d2 100644 --- a/lighter/models/asset.py +++ b/lighter/models/asset.py @@ -35,8 +35,16 @@ class Asset(BaseModel): margin_mode: StrictStr index_price: StrictStr l1_address: StrictStr + global_supply_cap: StrictStr + liquidation_fee: StrictStr + liquidation_threshold: StrictStr + loan_to_value: StrictStr + price_decimals: StrictInt + total_supplied: StrictStr + user_supply_cap: StrictStr + liquidation_factor: 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"] + __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"] @field_validator('margin_mode') def margin_mode_validate_enum(cls, value): @@ -111,7 +119,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "min_withdrawal_amount": obj.get("min_withdrawal_amount"), "margin_mode": obj.get("margin_mode"), "index_price": obj.get("index_price"), - "l1_address": obj.get("l1_address") + "l1_address": obj.get("l1_address"), + "global_supply_cap": obj.get("global_supply_cap"), + "liquidation_fee": obj.get("liquidation_fee"), + "liquidation_threshold": obj.get("liquidation_threshold"), + "loan_to_value": obj.get("loan_to_value"), + "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") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/auth.py b/lighter/models/auth.py deleted file mode 100644 index 7f590f7..0000000 --- a/lighter/models/auth.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class Auth(BaseModel): - """ - Auth - """ # noqa: E501 - auth: StrictStr = Field(description=" made optional to support header auth clients") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth"] - - 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 Auth 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 Auth from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth") - }) - # 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/account_stats.py b/lighter/models/block.py similarity index 60% rename from lighter/models/account_stats.py rename to lighter/models/block.py index 1dbc3a5..2630f01 100644 --- a/lighter/models/account_stats.py +++ b/lighter/models/block.py @@ -19,25 +19,29 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List -from lighter.models.account_margin_stats import AccountMarginStats +from lighter.models.tx import Tx from typing import Optional, Set from typing_extensions import Self -class AccountStats(BaseModel): +class Block(BaseModel): """ - AccountStats + Block """ # noqa: E501 - collateral: StrictStr - portfolio_value: StrictStr - leverage: StrictStr - available_balance: StrictStr - margin_usage: StrictStr - buying_power: StrictStr - account_trading_mode: StrictInt - cross_stats: AccountMarginStats - total_stats: AccountMarginStats + commitment: StrictStr + height: StrictInt + state_root: StrictStr + priority_operations: StrictInt + on_chain_l2_operations: StrictInt + pending_on_chain_operations_pub_data: StrictStr + committed_tx_hash: StrictStr + committed_at: StrictInt + verified_tx_hash: StrictStr + verified_at: StrictInt + txs: List[Tx] + status: StrictInt + size: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["collateral", "portfolio_value", "leverage", "available_balance", "margin_usage", "buying_power", "account_trading_mode", "cross_stats", "total_stats"] + __properties: ClassVar[List[str]] = ["commitment", "height", "state_root", "priority_operations", "on_chain_l2_operations", "pending_on_chain_operations_pub_data", "committed_tx_hash", "committed_at", "verified_tx_hash", "verified_at", "txs", "status", "size"] model_config = ConfigDict( populate_by_name=True, @@ -57,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AccountStats from a JSON string""" + """Create an instance of Block from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,12 +84,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 cross_stats - if self.cross_stats: - _dict['cross_stats'] = self.cross_stats.to_dict() - # override the default output from pydantic by calling `to_dict()` of total_stats - if self.total_stats: - _dict['total_stats'] = self.total_stats.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in txs (list) + _items = [] + if self.txs: + for _item in self.txs: + if _item: + _items.append(_item.to_dict()) + _dict['txs'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -95,7 +100,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AccountStats from a dict""" + """Create an instance of Block from a dict""" if obj is None: return None @@ -103,15 +108,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_construct(**{ - "collateral": obj.get("collateral"), - "portfolio_value": obj.get("portfolio_value"), - "leverage": obj.get("leverage"), - "available_balance": obj.get("available_balance"), - "margin_usage": obj.get("margin_usage"), - "buying_power": obj.get("buying_power"), - "account_trading_mode": obj.get("account_trading_mode"), - "cross_stats": AccountMarginStats.from_dict(obj["cross_stats"]) if obj.get("cross_stats") is not None else None, - "total_stats": AccountMarginStats.from_dict(obj["total_stats"]) if obj.get("total_stats") is not None else None + "commitment": obj.get("commitment"), + "height": obj.get("height"), + "state_root": obj.get("state_root"), + "priority_operations": obj.get("priority_operations"), + "on_chain_l2_operations": obj.get("on_chain_l2_operations"), + "pending_on_chain_operations_pub_data": obj.get("pending_on_chain_operations_pub_data"), + "committed_tx_hash": obj.get("committed_tx_hash"), + "committed_at": obj.get("committed_at"), + "verified_tx_hash": obj.get("verified_tx_hash"), + "verified_at": obj.get("verified_at"), + "txs": [Tx.from_dict(_item) for _item in obj["txs"]] if obj.get("txs") is not None else None, + "status": obj.get("status"), + "size": obj.get("size") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/resp_get_bridges_by_l1_addr.py b/lighter/models/blocks.py similarity index 83% rename from lighter/models/resp_get_bridges_by_l1_addr.py rename to lighter/models/blocks.py index 923f331..7e3fb9f 100644 --- a/lighter/models/resp_get_bridges_by_l1_addr.py +++ b/lighter/models/blocks.py @@ -19,19 +19,20 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from lighter.models.bridge import Bridge +from lighter.models.block import Block from typing import Optional, Set from typing_extensions import Self -class RespGetBridgesByL1Addr(BaseModel): +class Blocks(BaseModel): """ - RespGetBridgesByL1Addr + Blocks """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - bridges: List[Bridge] + total: StrictInt + blocks: List[Block] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "bridges"] + __properties: ClassVar[List[str]] = ["code", "message", "total", "blocks"] model_config = ConfigDict( populate_by_name=True, @@ -51,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RespGetBridgesByL1Addr from a JSON string""" + """Create an instance of Blocks from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,13 +75,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in bridges (list) + # override the default output from pydantic by calling `to_dict()` of each item in blocks (list) _items = [] - if self.bridges: - for _item in self.bridges: + if self.blocks: + for _item in self.blocks: if _item: _items.append(_item.to_dict()) - _dict['bridges'] = _items + _dict['blocks'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -90,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RespGetBridgesByL1Addr from a dict""" + """Create an instance of Blocks from a dict""" if obj is None: return None @@ -100,7 +101,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "code": obj.get("code"), "message": obj.get("message"), - "bridges": [Bridge.from_dict(_item) for _item in obj["bridges"]] if obj.get("bridges") is not None else None + "total": obj.get("total"), + "blocks": [Block.from_dict(_item) for _item in obj["blocks"]] if obj.get("blocks") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/bridge_supported_networks.py b/lighter/models/bridge_supported_networks.py new file mode 100644 index 0000000..236df62 --- /dev/null +++ b/lighter/models/bridge_supported_networks.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.bridge_supported_network import BridgeSupportedNetwork +from typing import Optional, Set +from typing_extensions import Self + +class BridgeSupportedNetworks(BaseModel): + """ + BridgeSupportedNetworks + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + networks: List[BridgeSupportedNetwork] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "networks"] + + 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 BridgeSupportedNetworks 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 networks (list) + _items = [] + if self.networks: + for _item in self.networks: + if _item: + _items.append(_item.to_dict()) + _dict['networks'] = _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 BridgeSupportedNetworks 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"), + "networks": [BridgeSupportedNetwork.from_dict(_item) for _item in obj["networks"]] if obj.get("networks") 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/candle.py b/lighter/models/candle.py index b9255a6..43d5eca 100644 --- a/lighter/models/candle.py +++ b/lighter/models/candle.py @@ -18,28 +18,28 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union +from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self class Candle(BaseModel): """ - Candle + Abbreviated candle format. Zero values are omitted. """ # 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") - O: Union[StrictFloat, StrictInt] = Field(description=" open_raw", alias="O") - H: Union[StrictFloat, StrictInt] = Field(description=" high_raw", alias="H") - L: Union[StrictFloat, StrictInt] = Field(description=" low_raw", alias="L") - C: Union[StrictFloat, StrictInt] = Field(description=" close_raw", alias="C") - v: Union[StrictFloat, StrictInt] = Field(description=" volume0") - V: Union[StrictFloat, StrictInt] = Field(description=" volume1", alias="V") - i: StrictInt = Field(description=" last_trade_id") + t: StrictInt = Field(description="Timestamp") + o: Union[StrictFloat, StrictInt] = Field(description="Open price") + h: Union[StrictFloat, StrictInt] = Field(description="High price") + l: Union[StrictFloat, StrictInt] = Field(description="Low price") + c: Union[StrictFloat, StrictInt] = Field(description="Close price") + v: Union[StrictFloat, StrictInt] = Field(description="Base token volume (volume0)") + V: Union[StrictFloat, StrictInt] = Field(description="Quote token volume (volume1)", alias="V") + i: StrictInt = Field(description="Last trade ID") + C: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description=" close_raw", alias="C") + H: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description=" high_raw", alias="H") + L: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description=" low_raw", alias="L") + O: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description=" open_raw", alias="O") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["t", "o", "h", "l", "c", "O", "H", "L", "C", "v", "V", "i"] + __properties: ClassVar[List[str]] = ["t", "o", "h", "l", "c", "v", "V", "i", "C", "H", "L", "O"] model_config = ConfigDict( populate_by_name=True, @@ -104,13 +104,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "h": obj.get("h"), "l": obj.get("l"), "c": obj.get("c"), - "O": obj.get("O"), - "H": obj.get("H"), - "L": obj.get("L"), - "C": obj.get("C"), "v": obj.get("v"), "V": obj.get("V"), - "i": obj.get("i") + "i": obj.get("i"), + "C": obj.get("C"), + "H": obj.get("H"), + "L": obj.get("L"), + "O": obj.get("O") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/candles.py b/lighter/models/candles.py index 53a41de..e387414 100644 --- a/lighter/models/candles.py +++ b/lighter/models/candles.py @@ -28,11 +28,11 @@ class Candles(BaseModel): Candles """ # noqa: E501 code: StrictInt + r: StrictStr = Field(description="Resolution") + c: List[Candle] = Field(description="Array of candles (max 500 per call)") message: Optional[StrictStr] = None - r: StrictStr = Field(description=" resolution") - c: List[Candle] = Field(description=" candles") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "r", "c"] + __properties: ClassVar[List[str]] = ["code", "r", "c", "message"] model_config = ConfigDict( populate_by_name=True, @@ -100,9 +100,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "code": obj.get("code"), - "message": obj.get("message"), "r": obj.get("r"), - "c": [Candle.from_dict(_item) for _item in obj["c"]] if obj.get("c") is not None else None + "c": [Candle.from_dict(_item) for _item in obj["c"]] if obj.get("c") is not None else None, + "message": obj.get("message") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_get_maker_only_api_keys.py b/lighter/models/create_intent_address_resp.py similarity index 84% rename from lighter/models/req_get_maker_only_api_keys.py rename to lighter/models/create_intent_address_resp.py index 28d562d..43bc7fb 100644 --- a/lighter/models/req_get_maker_only_api_keys.py +++ b/lighter/models/create_intent_address_resp.py @@ -22,14 +22,15 @@ from typing import Optional, Set from typing_extensions import Self -class ReqGetMakerOnlyApiKeys(BaseModel): +class CreateIntentAddressResp(BaseModel): """ - ReqGetMakerOnlyApiKeys + CreateIntentAddressResp """ # noqa: E501 - auth: Optional[StrictStr] = None - account_index: StrictInt + code: StrictInt + message: Optional[StrictStr] = None + intent_address: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index"] + __properties: ClassVar[List[str]] = ["code", "message", "intent_address"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetMakerOnlyApiKeys from a JSON string""" + """Create an instance of CreateIntentAddressResp from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetMakerOnlyApiKeys from a dict""" + """Create an instance of CreateIntentAddressResp from a dict""" if obj is None: return None @@ -89,8 +90,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index") + "code": obj.get("code"), + "message": obj.get("message"), + "intent_address": obj.get("intent_address") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/tx_hashes.py b/lighter/models/current_height.py similarity index 90% rename from lighter/models/tx_hashes.py rename to lighter/models/current_height.py index a313f12..404bda6 100644 --- a/lighter/models/tx_hashes.py +++ b/lighter/models/current_height.py @@ -22,15 +22,15 @@ from typing import Optional, Set from typing_extensions import Self -class TxHashes(BaseModel): +class CurrentHeight(BaseModel): """ - TxHashes + CurrentHeight """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - tx_hash: List[StrictStr] + height: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "tx_hash"] + __properties: ClassVar[List[str]] = ["code", "message", "height"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TxHashes from a JSON string""" + """Create an instance of CurrentHeight from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TxHashes from a dict""" + """Create an instance of CurrentHeight from a dict""" if obj is None: return None @@ -92,7 +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"), - "tx_hash": obj.get("tx_hash") + "height": obj.get("height") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/cursor.py b/lighter/models/cursor.py deleted file mode 100644 index 4468d46..0000000 --- a/lighter/models/cursor.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class Cursor(BaseModel): - """ - Cursor - """ # noqa: E501 - next_cursor: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["next_cursor"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Cursor 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 Cursor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "next_cursor": obj.get("next_cursor") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/bridge.py b/lighter/models/deposit.py similarity index 76% rename from lighter/models/bridge.py rename to lighter/models/deposit.py index 2b4f5f6..2364201 100644 --- a/lighter/models/bridge.py +++ b/lighter/models/deposit.py @@ -17,17 +17,17 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class Bridge(BaseModel): +class Deposit(BaseModel): """ - Bridge + Deposit """ # noqa: E501 - id: StrictInt - version: StrictInt + code: StrictInt + message: Optional[StrictStr] = None source: StrictStr source_chain_id: StrictStr fast_bridge_tx_hash: StrictStr @@ -41,22 +41,9 @@ class Bridge(BaseModel): created_at: StrictInt updated_at: StrictInt is_external_deposit: StrictBool + is_next_bridge_fast: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "version", "source", "source_chain_id", "fast_bridge_tx_hash", "batch_claim_tx_hash", "cctp_burn_tx_hash", "amount", "intent_address", "status", "step", "description", "created_at", "updated_at", "is_external_deposit"] - - @field_validator('version') - def version_validate_enum(cls, value): - """Validates the enum""" - if value not in set([1, 2]): - raise ValueError("must be one of enum values (1, 2)") - return value - - @field_validator('status') - def status_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['pending', 'bridging', 'completed']): - raise ValueError("must be one of enum values ('pending', 'bridging', 'completed')") - return value + __properties: ClassVar[List[str]] = ["code", "message", "source", "source_chain_id", "fast_bridge_tx_hash", "batch_claim_tx_hash", "cctp_burn_tx_hash", "amount", "intent_address", "status", "step", "description", "created_at", "updated_at", "is_external_deposit", "is_next_bridge_fast"] model_config = ConfigDict( populate_by_name=True, @@ -76,7 +63,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Bridge from a JSON string""" + """Create an instance of Deposit from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -108,7 +95,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Bridge from a dict""" + """Create an instance of Deposit from a dict""" if obj is None: return None @@ -116,8 +103,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_construct(**{ - "id": obj.get("id"), - "version": obj.get("version"), + "code": obj.get("code"), + "message": obj.get("message"), "source": obj.get("source"), "source_chain_id": obj.get("source_chain_id"), "fast_bridge_tx_hash": obj.get("fast_bridge_tx_hash"), @@ -130,7 +117,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "description": obj.get("description"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), - "is_external_deposit": obj.get("is_external_deposit") + "is_external_deposit": obj.get("is_external_deposit"), + "is_next_bridge_fast": obj.get("is_next_bridge_fast") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/deposit_history_item.py b/lighter/models/deposit_history_item.py index 49f6186..e7ce1a4 100644 --- a/lighter/models/deposit_history_item.py +++ b/lighter/models/deposit_history_item.py @@ -27,13 +27,13 @@ class DepositHistoryItem(BaseModel): DepositHistoryItem """ # noqa: E501 id: StrictStr - asset_id: StrictInt amount: StrictStr timestamp: StrictInt status: StrictStr l1_tx_hash: StrictStr + asset_id: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "asset_id", "amount", "timestamp", "status", "l1_tx_hash"] + __properties: ClassVar[List[str]] = ["id", "amount", "timestamp", "status", "l1_tx_hash", "asset_id"] @field_validator('status') def status_validate_enum(cls, value): @@ -101,11 +101,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "id": obj.get("id"), - "asset_id": obj.get("asset_id"), "amount": obj.get("amount"), "timestamp": obj.get("timestamp"), "status": obj.get("status"), - "l1_tx_hash": obj.get("l1_tx_hash") + "l1_tx_hash": obj.get("l1_tx_hash"), + "asset_id": obj.get("asset_id") }) # 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 d068815..e7d71c8 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -35,6 +35,7 @@ class DetailedAccount(BaseModel): code: StrictInt message: Optional[StrictStr] = None account_type: StrictInt + account_trading_mode: Optional[StrictInt] = Field(default=None, description="Classic=0 and Unified=1") index: StrictInt l1_address: StrictStr cancel_all_time: StrictInt @@ -44,25 +45,27 @@ class DetailedAccount(BaseModel): available_balance: StrictStr status: StrictInt collateral: StrictStr - transaction_time: StrictInt - account_trading_mode: StrictInt account_index: StrictInt name: StrictStr description: StrictStr can_invite: StrictBool = Field(description=" Remove After FE uses L1 meta endpoint") referral_points_percentage: StrictStr = Field(description=" Remove After FE uses L1 meta endpoint") - can_rfq: StrictBool - created_at: StrictInt positions: List[AccountPosition] assets: List[AccountAsset] total_asset_value: StrictStr cross_asset_value: StrictStr pool_info: PublicPoolInfo shares: List[PublicPoolShare] - pending_unlocks: List[PendingUnlock] - approved_integrators: List[ApprovedIntegrator] + created_at: StrictInt + transaction_time: StrictInt + pending_unlocks: Optional[List[PendingUnlock]] = None + approved_integrators: Optional[List[ApprovedIntegrator]] = None + can_rfq: StrictBool + cross_initial_margin_requirement: StrictStr + cross_maintenance_margin_requirement: StrictStr + can_rfq_market_ids: List[StrictStr] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "available_balance", "status", "collateral", "transaction_time", "account_trading_mode", "account_index", "name", "description", "can_invite", "referral_points_percentage", "can_rfq", "created_at", "positions", "assets", "total_asset_value", "cross_asset_value", "pool_info", "shares", "pending_unlocks", "approved_integrators"] + __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"] model_config = ConfigDict( populate_by_name=True, @@ -163,6 +166,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "code": obj.get("code"), "message": obj.get("message"), "account_type": obj.get("account_type"), + "account_trading_mode": obj.get("account_trading_mode"), "index": obj.get("index"), "l1_address": obj.get("l1_address"), "cancel_all_time": obj.get("cancel_all_time"), @@ -172,23 +176,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "available_balance": obj.get("available_balance"), "status": obj.get("status"), "collateral": obj.get("collateral"), - "transaction_time": obj.get("transaction_time"), - "account_trading_mode": obj.get("account_trading_mode"), "account_index": obj.get("account_index"), "name": obj.get("name"), "description": obj.get("description"), "can_invite": obj.get("can_invite"), "referral_points_percentage": obj.get("referral_points_percentage"), - "can_rfq": obj.get("can_rfq"), - "created_at": obj.get("created_at"), "positions": [AccountPosition.from_dict(_item) for _item in obj["positions"]] if obj.get("positions") is not None else None, "assets": [AccountAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None, "total_asset_value": obj.get("total_asset_value"), "cross_asset_value": obj.get("cross_asset_value"), "pool_info": PublicPoolInfo.from_dict(obj["pool_info"]) if obj.get("pool_info") is not None else None, "shares": [PublicPoolShare.from_dict(_item) for _item in obj["shares"]] if obj.get("shares") is not None else None, + "created_at": obj.get("created_at"), + "transaction_time": obj.get("transaction_time"), "pending_unlocks": [PendingUnlock.from_dict(_item) for _item in obj["pending_unlocks"]] if obj.get("pending_unlocks") is not None else None, - "approved_integrators": [ApprovedIntegrator.from_dict(_item) for _item in obj["approved_integrators"]] if obj.get("approved_integrators") is not None else None + "approved_integrators": [ApprovedIntegrator.from_dict(_item) for _item in obj["approved_integrators"]] if obj.get("approved_integrators") is not None else None, + "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") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/detailed_accounts.py b/lighter/models/detailed_accounts.py index cb14759..f9e8ece 100644 --- a/lighter/models/detailed_accounts.py +++ b/lighter/models/detailed_accounts.py @@ -31,7 +31,7 @@ class DetailedAccounts(BaseModel): message: Optional[StrictStr] = None total: StrictInt accounts: List[DetailedAccount] - next_cursor: Optional[StrictStr] = None + next_cursor: StrictStr additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "total", "accounts", "next_cursor"] diff --git a/lighter/models/detailed_candlestick.py b/lighter/models/detailed_candlestick.py deleted file mode 100644 index 4ff5987..0000000 --- a/lighter/models/detailed_candlestick.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class DetailedCandlestick(BaseModel): - """ - DetailedCandlestick - """ # noqa: E501 - timestamp: StrictInt - open: Union[StrictFloat, StrictInt] - high: Union[StrictFloat, StrictInt] - low: Union[StrictFloat, StrictInt] - close: Union[StrictFloat, StrictInt] - open_raw: Union[StrictFloat, StrictInt] - high_raw: Union[StrictFloat, StrictInt] - low_raw: Union[StrictFloat, StrictInt] - close_raw: Union[StrictFloat, StrictInt] - volume0: Union[StrictFloat, StrictInt] - volume1: Union[StrictFloat, StrictInt] - last_trade_id: StrictInt - trade_count: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["timestamp", "open", "high", "low", "close", "open_raw", "high_raw", "low_raw", "close_raw", "volume0", "volume1", "last_trade_id", "trade_count"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DetailedCandlestick 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 DetailedCandlestick from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "timestamp": obj.get("timestamp"), - "open": obj.get("open"), - "high": obj.get("high"), - "low": obj.get("low"), - "close": obj.get("close"), - "open_raw": obj.get("open_raw"), - "high_raw": obj.get("high_raw"), - "low_raw": obj.get("low_raw"), - "close_raw": obj.get("close_raw"), - "volume0": obj.get("volume0"), - "volume1": obj.get("volume1"), - "last_trade_id": obj.get("last_trade_id"), - "trade_count": obj.get("trade_count") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/layer1_basic_info.py b/lighter/models/layer1_basic_info.py new file mode 100644 index 0000000..f3c98fc --- /dev/null +++ b/lighter/models/layer1_basic_info.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.contract_address import ContractAddress +from lighter.models.l1_provider_info import L1ProviderInfo +from lighter.models.validator_info import ValidatorInfo +from typing import Optional, Set +from typing_extensions import Self + +class Layer1BasicInfo(BaseModel): + """ + Layer1BasicInfo + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + l1_providers: List[L1ProviderInfo] + l1_providers_health: StrictBool + validator_info: List[ValidatorInfo] + contract_addresses: List[ContractAddress] + latest_l1_generic_block: StrictInt + latest_l1_governance_block: StrictInt + latest_l1_desert_block: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "l1_providers", "l1_providers_health", "validator_info", "contract_addresses", "latest_l1_generic_block", "latest_l1_governance_block", "latest_l1_desert_block"] + + 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 Layer1BasicInfo 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 l1_providers (list) + _items = [] + if self.l1_providers: + for _item in self.l1_providers: + if _item: + _items.append(_item.to_dict()) + _dict['l1_providers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in validator_info (list) + _items = [] + if self.validator_info: + for _item in self.validator_info: + if _item: + _items.append(_item.to_dict()) + _dict['validator_info'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in contract_addresses (list) + _items = [] + if self.contract_addresses: + for _item in self.contract_addresses: + if _item: + _items.append(_item.to_dict()) + _dict['contract_addresses'] = _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 Layer1BasicInfo 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"), + "l1_providers": [L1ProviderInfo.from_dict(_item) for _item in obj["l1_providers"]] if obj.get("l1_providers") is not None else None, + "l1_providers_health": obj.get("l1_providers_health"), + "validator_info": [ValidatorInfo.from_dict(_item) for _item in obj["validator_info"]] if obj.get("validator_info") is not None else None, + "contract_addresses": [ContractAddress.from_dict(_item) for _item in obj["contract_addresses"]] if obj.get("contract_addresses") is not None else None, + "latest_l1_generic_block": obj.get("latest_l1_generic_block"), + "latest_l1_governance_block": obj.get("latest_l1_governance_block"), + "latest_l1_desert_block": obj.get("latest_l1_desert_block") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/lease_entry.py b/lighter/models/lease_entry.py index e5a2ed5..5ea0980 100644 --- a/lighter/models/lease_entry.py +++ b/lighter/models/lease_entry.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -26,14 +26,14 @@ class LeaseEntry(BaseModel): """ LeaseEntry """ # noqa: E501 - id: StrictInt - master_account_index: StrictInt - lease_amount: StrictInt - fee_amount: StrictInt - start: StrictInt - end: StrictInt - status: StrictStr - error: StrictStr + id: StrictInt = Field(description="Lease ID") + master_account_index: StrictInt = Field(description="Master account index") + lease_amount: StrictInt = Field(description="Leased LIT amount in raw units (1 LIT = 1e8)") + fee_amount: StrictInt = Field(description="Fee paid in raw units") + start: StrictInt = Field(description="Lease start time (Unix milliseconds)") + end: StrictInt = Field(description="Lease end time (Unix milliseconds)") + status: StrictStr = Field(description="Lease status") + error: StrictStr = Field(description="Error message if lease was canceled") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "master_account_index", "lease_amount", "fee_amount", "start", "end", "status", "error"] diff --git a/lighter/models/lease_option_entry.py b/lighter/models/lease_option_entry.py index 4b481c7..21cd574 100644 --- a/lighter/models/lease_option_entry.py +++ b/lighter/models/lease_option_entry.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +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 @@ -26,8 +26,8 @@ class LeaseOptionEntry(BaseModel): """ LeaseOptionEntry """ # noqa: E501 - duration_days: StrictInt - annual_rate: Union[StrictFloat, StrictInt] + duration_days: StrictInt = Field(description="Lease duration in days") + annual_rate: Union[StrictFloat, StrictInt] = Field(description="Annual rate as a percentage (e.g. 25.0 means 25%)") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["duration_days", "annual_rate"] diff --git a/lighter/models/liquidation_info.py b/lighter/models/liquidation_info.py index ad0a781..327ae0f 100644 --- a/lighter/models/liquidation_info.py +++ b/lighter/models/liquidation_info.py @@ -17,8 +17,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Union +from lighter.models.account_asset import AccountAsset from lighter.models.account_position import AccountPosition from lighter.models.risk_info import RiskInfo from typing import Optional, Set @@ -32,8 +33,10 @@ class LiquidationInfo(BaseModel): risk_info_before: RiskInfo risk_info_after: RiskInfo mark_prices: Dict[str, Union[StrictFloat, StrictInt]] + assets: List[AccountAsset] + asset_index_prices: Dict[str, StrictStr] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["positions", "risk_info_before", "risk_info_after", "mark_prices"] + __properties: ClassVar[List[str]] = ["positions", "risk_info_before", "risk_info_after", "mark_prices", "assets", "asset_index_prices"] model_config = ConfigDict( populate_by_name=True, @@ -89,6 +92,13 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of risk_info_after if self.risk_info_after: _dict['risk_info_after'] = self.risk_info_after.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in assets (list) + _items = [] + if self.assets: + for _item in self.assets: + if _item: + _items.append(_item.to_dict()) + _dict['assets'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -109,7 +119,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "positions": [AccountPosition.from_dict(_item) for _item in obj["positions"]] if obj.get("positions") is not None else None, "risk_info_before": RiskInfo.from_dict(obj["risk_info_before"]) if obj.get("risk_info_before") is not None else None, "risk_info_after": RiskInfo.from_dict(obj["risk_info_after"]) if obj.get("risk_info_after") is not None else None, - "mark_prices": obj.get("mark_prices") + "mark_prices": obj.get("mark_prices"), + "assets": [AccountAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None, + "asset_index_prices": obj.get("asset_index_prices") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/market_config.py b/lighter/models/market_config.py index 168ca30..767d405 100644 --- a/lighter/models/market_config.py +++ b/lighter/models/market_config.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictBool, 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 @@ -30,11 +30,12 @@ class MarketConfig(BaseModel): insurance_fund_account_index: StrictInt liquidation_mode: StrictInt force_reduce_only: StrictBool + funding_fee_discounts_enabled: Optional[StrictBool] = None trading_hours: StrictStr - funding_fee_discounts_enabled: StrictBool hidden: StrictBool + rfq_enabled: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_margin_mode", "insurance_fund_account_index", "liquidation_mode", "force_reduce_only", "trading_hours", "funding_fee_discounts_enabled", "hidden"] + __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"] model_config = ConfigDict( populate_by_name=True, @@ -98,9 +99,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "insurance_fund_account_index": obj.get("insurance_fund_account_index"), "liquidation_mode": obj.get("liquidation_mode"), "force_reduce_only": obj.get("force_reduce_only"), - "trading_hours": obj.get("trading_hours"), "funding_fee_discounts_enabled": obj.get("funding_fee_discounts_enabled"), - "hidden": obj.get("hidden") + "trading_hours": obj.get("trading_hours"), + "hidden": obj.get("hidden"), + "rfq_enabled": obj.get("rfq_enabled") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/order.py b/lighter/models/order.py index 0e56204..b88cb76 100644 --- a/lighter/models/order.py +++ b/lighter/models/order.py @@ -55,16 +55,16 @@ class Order(BaseModel): to_trigger_order_id_0: StrictStr to_trigger_order_id_1: StrictStr to_cancel_order_id_0: StrictStr - integrator_fee_collector_index: StrictStr - integrator_taker_fee: StrictStr - integrator_maker_fee: StrictStr block_height: StrictInt timestamp: StrictInt created_at: StrictInt updated_at: StrictInt transaction_time: StrictInt + integrator_fee_collector_index: StrictStr + integrator_maker_fee: StrictStr + integrator_taker_fee: StrictStr 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", "integrator_fee_collector_index", "integrator_taker_fee", "integrator_maker_fee", "block_height", "timestamp", "created_at", "updated_at", "transaction_time"] + __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"] @field_validator('type') def type_validate_enum(cls, value): @@ -181,14 +181,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "to_trigger_order_id_0": obj.get("to_trigger_order_id_0"), "to_trigger_order_id_1": obj.get("to_trigger_order_id_1"), "to_cancel_order_id_0": obj.get("to_cancel_order_id_0"), - "integrator_fee_collector_index": obj.get("integrator_fee_collector_index"), - "integrator_taker_fee": obj.get("integrator_taker_fee"), - "integrator_maker_fee": obj.get("integrator_maker_fee"), "block_height": obj.get("block_height"), "timestamp": obj.get("timestamp"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), - "transaction_time": obj.get("transaction_time") + "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") }) # 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 c269137..8bbc3f8 100644 --- a/lighter/models/order_book.py +++ b/lighter/models/order_book.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -37,12 +37,14 @@ class OrderBook(BaseModel): liquidation_fee: StrictStr min_base_amount: StrictStr min_quote_amount: StrictStr - order_quote_limit: StrictStr supported_size_decimals: StrictInt supported_price_decimals: StrictInt supported_quote_decimals: StrictInt + order_quote_limit: StrictStr + is_maker_fee_enabled: StrictBool + is_taker_fee_enabled: StrictBool 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"] + __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"] @field_validator('market_type') def market_type_validate_enum(cls, value): @@ -127,10 +129,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "liquidation_fee": obj.get("liquidation_fee"), "min_base_amount": obj.get("min_base_amount"), "min_quote_amount": obj.get("min_quote_amount"), - "order_quote_limit": obj.get("order_quote_limit"), "supported_size_decimals": obj.get("supported_size_decimals"), "supported_price_decimals": obj.get("supported_price_decimals"), - "supported_quote_decimals": obj.get("supported_quote_decimals") + "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") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/perps_market_stats.py b/lighter/models/perps_market_stats.py deleted file mode 100644 index d28434f..0000000 --- a/lighter/models/perps_market_stats.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class PerpsMarketStats(BaseModel): - """ - PerpsMarketStats - """ # noqa: E501 - symbol: StrictStr - market_id: StrictInt - index_price: StrictStr - mark_price: StrictStr - open_interest: StrictStr - open_interest_limit: StrictStr - funding_clamp_small: StrictStr - funding_clamp_big: StrictStr - last_trade_price: StrictStr - current_funding_rate: StrictStr - funding_rate: StrictStr - funding_timestamp: StrictInt - daily_base_token_volume: Union[StrictFloat, StrictInt] - daily_quote_token_volume: Union[StrictFloat, StrictInt] - daily_price_low: Union[StrictFloat, StrictInt] - daily_price_high: Union[StrictFloat, StrictInt] - daily_price_change: Union[StrictFloat, StrictInt] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "market_id", "index_price", "mark_price", "open_interest", "open_interest_limit", "funding_clamp_small", "funding_clamp_big", "last_trade_price", "current_funding_rate", "funding_rate", "funding_timestamp", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change"] - - 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 PerpsMarketStats 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 PerpsMarketStats from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "symbol": obj.get("symbol"), - "market_id": obj.get("market_id"), - "index_price": obj.get("index_price"), - "mark_price": obj.get("mark_price"), - "open_interest": obj.get("open_interest"), - "open_interest_limit": obj.get("open_interest_limit"), - "funding_clamp_small": obj.get("funding_clamp_small"), - "funding_clamp_big": obj.get("funding_clamp_big"), - "last_trade_price": obj.get("last_trade_price"), - "current_funding_rate": obj.get("current_funding_rate"), - "funding_rate": obj.get("funding_rate"), - "funding_timestamp": obj.get("funding_timestamp"), - "daily_base_token_volume": obj.get("daily_base_token_volume"), - "daily_quote_token_volume": obj.get("daily_quote_token_volume"), - "daily_price_low": obj.get("daily_price_low"), - "daily_price_high": obj.get("daily_price_high"), - "daily_price_change": obj.get("daily_price_change") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/perps_order_book_detail.py b/lighter/models/perps_order_book_detail.py index 7dc4b62..a9ee033 100644 --- a/lighter/models/perps_order_book_detail.py +++ b/lighter/models/perps_order_book_detail.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Union from lighter.models.market_config import MarketConfig from typing import Optional, Set @@ -38,10 +38,10 @@ class PerpsOrderBookDetail(BaseModel): liquidation_fee: StrictStr min_base_amount: StrictStr min_quote_amount: StrictStr - order_quote_limit: StrictStr supported_size_decimals: StrictInt supported_price_decimals: StrictInt supported_quote_decimals: StrictInt + order_quote_limit: StrictStr size_decimals: StrictInt price_decimals: StrictInt quote_multiplier: StrictInt @@ -60,8 +60,13 @@ class PerpsOrderBookDetail(BaseModel): daily_chart: Dict[str, Union[StrictFloat, StrictInt]] market_config: MarketConfig strategy_index: StrictInt + is_maker_fee_enabled: StrictBool + is_taker_fee_enabled: StrictBool + funding_clamp_small: StrictStr + funding_clamp_big: StrictStr + base_interest_rate: 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", "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"] + __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"] @field_validator('market_type') def market_type_validate_enum(cls, value): @@ -149,10 +154,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "liquidation_fee": obj.get("liquidation_fee"), "min_base_amount": obj.get("min_base_amount"), "min_quote_amount": obj.get("min_quote_amount"), - "order_quote_limit": obj.get("order_quote_limit"), "supported_size_decimals": obj.get("supported_size_decimals"), "supported_price_decimals": obj.get("supported_price_decimals"), "supported_quote_decimals": obj.get("supported_quote_decimals"), + "order_quote_limit": obj.get("order_quote_limit"), "size_decimals": obj.get("size_decimals"), "price_decimals": obj.get("price_decimals"), "quote_multiplier": obj.get("quote_multiplier"), @@ -170,7 +175,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "open_interest": obj.get("open_interest"), "daily_chart": obj.get("daily_chart"), "market_config": MarketConfig.from_dict(obj["market_config"]) if obj.get("market_config") is not None else None, - "strategy_index": obj.get("strategy_index") + "strategy_index": obj.get("strategy_index"), + "is_maker_fee_enabled": obj.get("is_maker_fee_enabled"), + "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") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/pn_l_entry.py b/lighter/models/pn_l_entry.py index b360dcb..64cec10 100644 --- a/lighter/models/pn_l_entry.py +++ b/lighter/models/pn_l_entry.py @@ -28,21 +28,22 @@ class PnLEntry(BaseModel): """ # noqa: E501 timestamp: StrictInt trade_pnl: Union[StrictFloat, StrictInt] - trade_spot_pnl: Union[StrictFloat, StrictInt] inflow: Union[StrictFloat, StrictInt] outflow: Union[StrictFloat, StrictInt] - spot_outflow: Union[StrictFloat, StrictInt] - spot_inflow: Union[StrictFloat, StrictInt] pool_pnl: Union[StrictFloat, StrictInt] pool_inflow: Union[StrictFloat, StrictInt] pool_outflow: Union[StrictFloat, StrictInt] - staking_pnl: Union[StrictFloat, StrictInt] - staking_inflow: Union[StrictFloat, StrictInt] - staking_outflow: Union[StrictFloat, StrictInt] pool_total_shares: Union[StrictFloat, StrictInt] + spot_inflow: Union[StrictFloat, StrictInt] + spot_outflow: Union[StrictFloat, StrictInt] staked_lit: Union[StrictFloat, StrictInt] + staking_inflow: Union[StrictFloat, StrictInt] + staking_outflow: Union[StrictFloat, StrictInt] + staking_pnl: Union[StrictFloat, StrictInt] + trade_spot_pnl: Union[StrictFloat, StrictInt] + volume: Union[StrictFloat, StrictInt] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["timestamp", "trade_pnl", "trade_spot_pnl", "inflow", "outflow", "spot_outflow", "spot_inflow", "pool_pnl", "pool_inflow", "pool_outflow", "staking_pnl", "staking_inflow", "staking_outflow", "pool_total_shares", "staked_lit"] + __properties: ClassVar[List[str]] = ["timestamp", "trade_pnl", "inflow", "outflow", "pool_pnl", "pool_inflow", "pool_outflow", "pool_total_shares", "spot_inflow", "spot_outflow", "staked_lit", "staking_inflow", "staking_outflow", "staking_pnl", "trade_spot_pnl", "volume"] model_config = ConfigDict( populate_by_name=True, @@ -104,19 +105,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "timestamp": obj.get("timestamp"), "trade_pnl": obj.get("trade_pnl"), - "trade_spot_pnl": obj.get("trade_spot_pnl"), "inflow": obj.get("inflow"), "outflow": obj.get("outflow"), - "spot_outflow": obj.get("spot_outflow"), - "spot_inflow": obj.get("spot_inflow"), "pool_pnl": obj.get("pool_pnl"), "pool_inflow": obj.get("pool_inflow"), "pool_outflow": obj.get("pool_outflow"), - "staking_pnl": obj.get("staking_pnl"), + "pool_total_shares": obj.get("pool_total_shares"), + "spot_inflow": obj.get("spot_inflow"), + "spot_outflow": obj.get("spot_outflow"), + "staked_lit": obj.get("staked_lit"), "staking_inflow": obj.get("staking_inflow"), "staking_outflow": obj.get("staking_outflow"), - "pool_total_shares": obj.get("pool_total_shares"), - "staked_lit": obj.get("staked_lit") + "staking_pnl": obj.get("staking_pnl"), + "trade_spot_pnl": obj.get("trade_spot_pnl"), + "volume": obj.get("volume") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/position_funding.py b/lighter/models/position_funding.py index 5eeb65b..8ccb4db 100644 --- a/lighter/models/position_funding.py +++ b/lighter/models/position_funding.py @@ -30,12 +30,12 @@ class PositionFunding(BaseModel): market_id: StrictInt funding_id: StrictInt change: StrictStr + discount: StrictStr rate: StrictStr position_size: StrictStr position_side: StrictStr - discount: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["timestamp", "market_id", "funding_id", "change", "rate", "position_size", "position_side", "discount"] + __properties: ClassVar[List[str]] = ["timestamp", "market_id", "funding_id", "change", "discount", "rate", "position_size", "position_side"] @field_validator('position_side') def position_side_validate_enum(cls, value): @@ -106,10 +106,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "market_id": obj.get("market_id"), "funding_id": obj.get("funding_id"), "change": obj.get("change"), + "discount": obj.get("discount"), "rate": obj.get("rate"), "position_size": obj.get("position_size"), - "position_side": obj.get("position_side"), - "discount": obj.get("discount") + "position_side": obj.get("position_side") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/public_pool_info.py b/lighter/models/public_pool_info.py index 3e528fd..d7587cd 100644 --- a/lighter/models/public_pool_info.py +++ b/lighter/models/public_pool_info.py @@ -35,12 +35,12 @@ class PublicPoolInfo(BaseModel): total_shares: StrictInt operator_shares: StrictInt annual_percentage_yield: Union[StrictFloat, StrictInt] - sharpe_ratio: Union[StrictFloat, StrictInt] daily_returns: List[DailyReturn] share_prices: List[SharePrice] + sharpe_ratio: Union[StrictFloat, StrictInt] strategies: List[Strategy] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "operator_fee", "min_operator_share_rate", "total_shares", "operator_shares", "annual_percentage_yield", "sharpe_ratio", "daily_returns", "share_prices", "strategies"] + __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"] model_config = ConfigDict( populate_by_name=True, @@ -127,9 +127,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total_shares": obj.get("total_shares"), "operator_shares": obj.get("operator_shares"), "annual_percentage_yield": obj.get("annual_percentage_yield"), - "sharpe_ratio": obj.get("sharpe_ratio"), "daily_returns": [DailyReturn.from_dict(_item) for _item in obj["daily_returns"]] if obj.get("daily_returns") is not None else None, "share_prices": [SharePrice.from_dict(_item) for _item in obj["share_prices"]] if obj.get("share_prices") is not None else None, + "sharpe_ratio": obj.get("sharpe_ratio"), "strategies": [Strategy.from_dict(_item) for _item in obj["strategies"]] if obj.get("strategies") is not None else None }) # store additional fields in additional_properties diff --git a/lighter/models/public_pool_metadata.py b/lighter/models/public_pool_metadata.py index 3c61207..68c8b74 100644 --- a/lighter/models/public_pool_metadata.py +++ b/lighter/models/public_pool_metadata.py @@ -31,23 +31,23 @@ class PublicPoolMetadata(BaseModel): code: StrictInt message: Optional[StrictStr] = None account_index: StrictInt - created_at: StrictInt - master_account_index: StrictInt account_type: StrictInt name: StrictStr l1_address: StrictStr annual_percentage_yield: Union[StrictFloat, StrictInt] - sharpe_ratio: Union[StrictFloat, StrictInt] status: StrictInt operator_fee: StrictStr total_asset_value: StrictStr - total_spot_value: StrictStr - total_perps_value: StrictStr total_shares: StrictInt account_share: Optional[PublicPoolShare] = None assets: List[AccountAsset] + created_at: StrictInt + master_account_index: StrictInt + sharpe_ratio: Union[StrictFloat, StrictInt] + total_perps_value: StrictStr + total_spot_value: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_index", "created_at", "master_account_index", "account_type", "name", "l1_address", "annual_percentage_yield", "sharpe_ratio", "status", "operator_fee", "total_asset_value", "total_spot_value", "total_perps_value", "total_shares", "account_share", "assets"] + __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"] model_config = ConfigDict( populate_by_name=True, @@ -120,21 +120,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "code": obj.get("code"), "message": obj.get("message"), "account_index": obj.get("account_index"), - "created_at": obj.get("created_at"), - "master_account_index": obj.get("master_account_index"), "account_type": obj.get("account_type"), "name": obj.get("name"), "l1_address": obj.get("l1_address"), "annual_percentage_yield": obj.get("annual_percentage_yield"), - "sharpe_ratio": obj.get("sharpe_ratio"), "status": obj.get("status"), "operator_fee": obj.get("operator_fee"), "total_asset_value": obj.get("total_asset_value"), - "total_spot_value": obj.get("total_spot_value"), - "total_perps_value": obj.get("total_perps_value"), "total_shares": obj.get("total_shares"), "account_share": PublicPoolShare.from_dict(obj["account_share"]) if obj.get("account_share") is not None else None, - "assets": [AccountAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None + "assets": [AccountAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None, + "created_at": obj.get("created_at"), + "master_account_index": obj.get("master_account_index"), + "sharpe_ratio": obj.get("sharpe_ratio"), + "total_perps_value": obj.get("total_perps_value"), + "total_spot_value": obj.get("total_spot_value") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/public_pool_share.py b/lighter/models/public_pool_share.py index 90e7203..eff07d8 100644 --- a/lighter/models/public_pool_share.py +++ b/lighter/models/public_pool_share.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -28,11 +28,11 @@ class PublicPoolShare(BaseModel): """ # noqa: E501 public_pool_index: StrictInt shares_amount: StrictInt - entry_usdc: StrictStr = Field(description=" For public pools and insurance fund") - principal_amount: StrictStr + entry_usdc: StrictStr entry_timestamp: StrictInt + principal_amount: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["public_pool_index", "shares_amount", "entry_usdc", "principal_amount", "entry_timestamp"] + __properties: ClassVar[List[str]] = ["public_pool_index", "shares_amount", "entry_usdc", "entry_timestamp", "principal_amount"] model_config = ConfigDict( populate_by_name=True, @@ -95,8 +95,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "public_pool_index": obj.get("public_pool_index"), "shares_amount": obj.get("shares_amount"), "entry_usdc": obj.get("entry_usdc"), - "principal_amount": obj.get("principal_amount"), - "entry_timestamp": obj.get("entry_timestamp") + "entry_timestamp": obj.get("entry_timestamp"), + "principal_amount": obj.get("principal_amount") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/push_notif_delivery_result.py b/lighter/models/push_notif_delivery_result.py deleted file mode 100644 index 5d757b0..0000000 --- a/lighter/models/push_notif_delivery_result.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class PushNotifDeliveryResult(BaseModel): - """ - PushNotifDeliveryResult - """ # noqa: E501 - expo_token: StrictStr - status: StrictStr - error: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["expo_token", "status", "error"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PushNotifDeliveryResult from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PushNotifDeliveryResult from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "expo_token": obj.get("expo_token"), - "status": obj.get("status"), - "error": obj.get("error") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/referral.py b/lighter/models/referral.py index 2dc106a..7d91b9d 100644 --- a/lighter/models/referral.py +++ b/lighter/models/referral.py @@ -31,8 +31,9 @@ class Referral(BaseModel): referral_code: StrictStr used_at: StrictInt trade_stats: TradeStats + tier: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address", "referral_code", "used_at", "trade_stats"] + __properties: ClassVar[List[str]] = ["l1_address", "referral_code", "used_at", "trade_stats", "tier"] model_config = ConfigDict( populate_by_name=True, @@ -98,7 +99,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "l1_address": obj.get("l1_address"), "referral_code": obj.get("referral_code"), "used_at": obj.get("used_at"), - "trade_stats": TradeStats.from_dict(obj["trade_stats"]) if obj.get("trade_stats") is not None else None + "trade_stats": TradeStats.from_dict(obj["trade_stats"]) if obj.get("trade_stats") is not None else None, + "tier": obj.get("tier") }) # 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 new file mode 100644 index 0000000..d22655a --- /dev/null +++ b/lighter/models/referral_code.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReferralCode(BaseModel): + """ + ReferralCode + """ # noqa: E501 + 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"] + + 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 ReferralCode 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 ReferralCode 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"), + "referral_code": obj.get("referral_code"), + "remaining_usage": obj.get("remaining_usage") + }) + # 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_do_faucet.py b/lighter/models/referral_point_entry.py similarity index 72% rename from lighter/models/req_do_faucet.py rename to lighter/models/referral_point_entry.py index 16281b1..ce53f83 100644 --- a/lighter/models/req_do_faucet.py +++ b/lighter/models/referral_point_entry.py @@ -17,19 +17,23 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self -class ReqDoFaucet(BaseModel): +class ReferralPointEntry(BaseModel): """ - ReqDoFaucet + ReferralPointEntry """ # noqa: E501 l1_address: StrictStr - do_l1_transfer: StrictBool + total_points: Union[StrictFloat, StrictInt] + week_points: Union[StrictFloat, StrictInt] + total_reward_points: Union[StrictFloat, StrictInt] + week_reward_points: Union[StrictFloat, StrictInt] + reward_point_multiplier: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address", "do_l1_transfer"] + __properties: ClassVar[List[str]] = ["l1_address", "total_points", "week_points", "total_reward_points", "week_reward_points", "reward_point_multiplier"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqDoFaucet from a JSON string""" + """Create an instance of ReferralPointEntry from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,7 +85,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqDoFaucet from a dict""" + """Create an instance of ReferralPointEntry from a dict""" if obj is None: return None @@ -90,7 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "l1_address": obj.get("l1_address"), - "do_l1_transfer": obj.get("do_l1_transfer") if obj.get("do_l1_transfer") is not None else False + "total_points": obj.get("total_points"), + "week_points": obj.get("week_points"), + "total_reward_points": obj.get("total_reward_points"), + "week_reward_points": obj.get("week_reward_points"), + "reward_point_multiplier": obj.get("reward_point_multiplier") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/order_book_depth_with_begin_nonce.py b/lighter/models/referral_points.py similarity index 63% rename from lighter/models/order_book_depth_with_begin_nonce.py rename to lighter/models/referral_points.py index 641ab10..708fa95 100644 --- a/lighter/models/order_book_depth_with_begin_nonce.py +++ b/lighter/models/referral_points.py @@ -17,23 +17,24 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List -from lighter.models.price_level import PriceLevel +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from lighter.models.referral_point_entry import ReferralPointEntry from typing import Optional, Set from typing_extensions import Self -class OrderBookDepthWithBeginNonce(BaseModel): +class ReferralPoints(BaseModel): """ - OrderBookDepthWithBeginNonce + ReferralPoints """ # noqa: E501 - asks: List[PriceLevel] - bids: List[PriceLevel] - offset: StrictInt - nonce: StrictInt - begin_nonce: StrictInt + referrals: List[ReferralPointEntry] + user_total_points: Union[StrictFloat, StrictInt] + user_last_week_points: Union[StrictFloat, StrictInt] + user_total_referral_reward_points: Union[StrictFloat, StrictInt] + user_last_week_referral_reward_points: Union[StrictFloat, StrictInt] + reward_point_multiplier: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["asks", "bids", "offset", "nonce", "begin_nonce"] + __properties: ClassVar[List[str]] = ["referrals", "user_total_points", "user_last_week_points", "user_total_referral_reward_points", "user_last_week_referral_reward_points", "reward_point_multiplier"] model_config = ConfigDict( populate_by_name=True, @@ -53,7 +54,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrderBookDepthWithBeginNonce from a JSON string""" + """Create an instance of ReferralPoints from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -76,20 +77,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 asks (list) + # override the default output from pydantic by calling `to_dict()` of each item in referrals (list) _items = [] - if self.asks: - for _item in self.asks: + if self.referrals: + for _item in self.referrals: if _item: _items.append(_item.to_dict()) - _dict['asks'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in bids (list) - _items = [] - if self.bids: - for _item in self.bids: - if _item: - _items.append(_item.to_dict()) - _dict['bids'] = _items + _dict['referrals'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -99,7 +93,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrderBookDepthWithBeginNonce from a dict""" + """Create an instance of ReferralPoints from a dict""" if obj is None: return None @@ -107,11 +101,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_construct(**{ - "asks": [PriceLevel.from_dict(_item) for _item in obj["asks"]] if obj.get("asks") is not None else None, - "bids": [PriceLevel.from_dict(_item) for _item in obj["bids"]] if obj.get("bids") is not None else None, - "offset": obj.get("offset"), - "nonce": obj.get("nonce"), - "begin_nonce": obj.get("begin_nonce") + "referrals": [ReferralPointEntry.from_dict(_item) for _item in obj["referrals"]] if obj.get("referrals") is not None else None, + "user_total_points": obj.get("user_total_points"), + "user_last_week_points": obj.get("user_last_week_points"), + "user_total_referral_reward_points": obj.get("user_total_referral_reward_points"), + "user_last_week_referral_reward_points": obj.get("user_last_week_referral_reward_points"), + "reward_point_multiplier": obj.get("reward_point_multiplier") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_export_data.py b/lighter/models/req_export_data.py deleted file mode 100644 index f800a93..0000000 --- a/lighter/models/req_export_data.py +++ /dev/null @@ -1,154 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqExportData(BaseModel): - """ - ReqExportData - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: Optional[StrictInt] = -1 - market_id: Optional[StrictInt] = None - type: StrictStr - start_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None - end_timestamp: Optional[Annotated[int, Field(le=1830297600000, strict=True, ge=1735689600000)]] = None - side: Optional[StrictStr] = 'all' - role: Optional[StrictStr] = 'all' - trade_type: Optional[StrictStr] = 'all' - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "market_id", "type", "start_timestamp", "end_timestamp", "side", "role", "trade_type"] - - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['funding', 'trade']): - raise ValueError("must be one of enum values ('funding', 'trade')") - return value - - @field_validator('side') - def side_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'long', 'short']): - raise ValueError("must be one of enum values ('all', 'long', 'short')") - return value - - @field_validator('role') - def role_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'maker', 'taker']): - raise ValueError("must be one of enum values ('all', 'maker', 'taker')") - return value - - @field_validator('trade_type') - def trade_type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'trade', 'liquidation', 'deleverage', 'market-settlement']): - raise ValueError("must be one of enum values ('all', 'trade', 'liquidation', 'deleverage', 'market-settlement')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - 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 ReqExportData 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 ReqExportData from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index") if obj.get("account_index") is not None else -1, - "market_id": obj.get("market_id"), - "type": obj.get("type"), - "start_timestamp": obj.get("start_timestamp"), - "end_timestamp": obj.get("end_timestamp"), - "side": obj.get("side") if obj.get("side") is not None else 'all', - "role": obj.get("role") if obj.get("role") is not None else 'all', - "trade_type": obj.get("trade_type") if obj.get("trade_type") is not None else 'all' - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account.py b/lighter/models/req_get_account.py deleted file mode 100644 index 50c4fd3..0000000 --- a/lighter/models/req_get_account.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccount(BaseModel): - """ - ReqGetAccount - """ # noqa: E501 - by: StrictStr - value: StrictStr - active_only: Optional[StrictBool] = False - cursor: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value", "active_only", "cursor"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['index', 'l1_address']): - raise ValueError("must be one of enum values ('index', 'l1_address')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccount 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 ReqGetAccount from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "by": obj.get("by"), - "value": obj.get("value"), - "active_only": obj.get("active_only") if obj.get("active_only") is not None else False, - "cursor": obj.get("cursor") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_active_orders.py b/lighter/models/req_get_account_active_orders.py deleted file mode 100644 index 7e976cd..0000000 --- a/lighter/models/req_get_account_active_orders.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountActiveOrders(BaseModel): - """ - ReqGetAccountActiveOrders - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - market_id: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "market_id"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountActiveOrders 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 ReqGetAccountActiveOrders from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), - "market_id": obj.get("market_id") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_api_keys.py b/lighter/models/req_get_account_api_keys.py deleted file mode 100644 index ce423e3..0000000 --- a/lighter/models/req_get_account_api_keys.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountApiKeys(BaseModel): - """ - ReqGetAccountApiKeys - """ # noqa: E501 - account_index: StrictInt - api_key_index: Optional[StrictInt] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "api_key_index"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountApiKeys 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 ReqGetAccountApiKeys from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "account_index": obj.get("account_index"), - "api_key_index": obj.get("api_key_index") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_by_l1_address.py b/lighter/models/req_get_account_by_l1_address.py deleted file mode 100644 index 4174b82..0000000 --- a/lighter/models/req_get_account_by_l1_address.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountByL1Address(BaseModel): - """ - ReqGetAccountByL1Address - """ # noqa: E501 - l1_address: StrictStr - cursor: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address", "cursor"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountByL1Address 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 ReqGetAccountByL1Address 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"), - "cursor": obj.get("cursor") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_inactive_orders.py b/lighter/models/req_get_account_inactive_orders.py deleted file mode 100644 index 6ab3288..0000000 --- a/lighter/models/req_get_account_inactive_orders.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountInactiveOrders(BaseModel): - """ - ReqGetAccountInactiveOrders - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - market_id: Optional[StrictInt] = None - ask_filter: Optional[StrictInt] = None - between_timestamps: Optional[StrictStr] = None - cursor: Optional[StrictStr] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "market_id", "ask_filter", "between_timestamps", "cursor", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountInactiveOrders 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 ReqGetAccountInactiveOrders from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), - "market_id": obj.get("market_id"), - "ask_filter": obj.get("ask_filter"), - "between_timestamps": obj.get("between_timestamps"), - "cursor": obj.get("cursor"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_limits.py b/lighter/models/req_get_account_limits.py deleted file mode 100644 index eb483ac..0000000 --- a/lighter/models/req_get_account_limits.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountLimits(BaseModel): - """ - ReqGetAccountLimits - """ # noqa: E501 - account_index: StrictInt - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "auth"] - - 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 ReqGetAccountLimits 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 ReqGetAccountLimits from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "account_index": obj.get("account_index"), - "auth": obj.get("auth") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_metadata.py b/lighter/models/req_get_account_metadata.py deleted file mode 100644 index 98e6c71..0000000 --- a/lighter/models/req_get_account_metadata.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountMetadata(BaseModel): - """ - ReqGetAccountMetadata - """ # noqa: E501 - by: StrictStr - value: StrictStr - auth: Optional[StrictStr] = None - cursor: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value", "auth", "cursor"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['index', 'l1_address']): - raise ValueError("must be one of enum values ('index', 'l1_address')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountMetadata 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 ReqGetAccountMetadata from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "by": obj.get("by"), - "value": obj.get("value"), - "auth": obj.get("auth"), - "cursor": obj.get("cursor") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_pn_l.py b/lighter/models/req_get_account_pn_l.py deleted file mode 100644 index ed47aa4..0000000 --- a/lighter/models/req_get_account_pn_l.py +++ /dev/null @@ -1,129 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountPnL(BaseModel): - """ - ReqGetAccountPnL - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - by: StrictStr - value: StrictStr - resolution: StrictStr - start_timestamp: Annotated[int, Field(le=5000000000000, strict=True)] - end_timestamp: Annotated[int, Field(le=5000000000000, strict=True)] - count_back: StrictInt - ignore_transfers: Optional[StrictBool] = False - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "by", "value", "resolution", "start_timestamp", "end_timestamp", "count_back", "ignore_transfers"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['index']): - raise ValueError("must be one of enum values ('index')") - return value - - @field_validator('resolution') - def resolution_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['1m', '5m', '15m', '1h', '4h', '1d']): - raise ValueError("must be one of enum values ('1m', '5m', '15m', '1h', '4h', '1d')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountPnL 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 ReqGetAccountPnL from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "by": obj.get("by"), - "value": obj.get("value"), - "resolution": obj.get("resolution"), - "start_timestamp": obj.get("start_timestamp"), - "end_timestamp": obj.get("end_timestamp"), - "count_back": obj.get("count_back"), - "ignore_transfers": obj.get("ignore_transfers") if obj.get("ignore_transfers") is not None else False - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_txs.py b/lighter/models/req_get_account_txs.py deleted file mode 100644 index e9fa53f..0000000 --- a/lighter/models/req_get_account_txs.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountTxs(BaseModel): - """ - ReqGetAccountTxs - """ # noqa: E501 - index: Optional[StrictInt] = None - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None - by: Optional[StrictStr] = None - value: Optional[StrictStr] = None - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - types: Optional[List[StrictInt]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["index", "limit", "by", "value", "auth", "types"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['account_index']): - raise ValueError("must be one of enum values ('account_index')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountTxs 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 ReqGetAccountTxs from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "index": obj.get("index"), - "limit": obj.get("limit"), - "by": obj.get("by"), - "value": obj.get("value"), - "auth": obj.get("auth"), - "types": obj.get("types") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_api_tokens.py b/lighter/models/req_get_api_tokens.py deleted file mode 100644 index e0de034..0000000 --- a/lighter/models/req_get_api_tokens.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetApiTokens(BaseModel): - """ - ReqGetApiTokens - """ # noqa: E501 - account_index: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetApiTokens 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 ReqGetApiTokens from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "account_index": obj.get("account_index") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_asset_details.py b/lighter/models/req_get_asset_details.py deleted file mode 100644 index 93dae58..0000000 --- a/lighter/models/req_get_asset_details.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAssetDetails(BaseModel): - """ - ReqGetAssetDetails - """ # noqa: E501 - asset_id: Optional[StrictInt] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["asset_id"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAssetDetails 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 ReqGetAssetDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "asset_id": obj.get("asset_id") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_block.py b/lighter/models/req_get_block.py deleted file mode 100644 index d0fe811..0000000 --- a/lighter/models/req_get_block.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetBlock(BaseModel): - """ - ReqGetBlock - """ # noqa: E501 - by: StrictStr - value: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['commitment', 'height']): - raise ValueError("must be one of enum values ('commitment', 'height')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetBlock 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 ReqGetBlock from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "by": obj.get("by"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_block_txs.py b/lighter/models/req_get_block_txs.py deleted file mode 100644 index 6a3aa66..0000000 --- a/lighter/models/req_get_block_txs.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetBlockTxs(BaseModel): - """ - ReqGetBlockTxs - """ # noqa: E501 - by: StrictStr - value: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['block_height', 'block_commitment']): - raise ValueError("must be one of enum values ('block_height', 'block_commitment')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetBlockTxs 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 ReqGetBlockTxs from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "by": obj.get("by"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_bridges_by_l1_addr.py b/lighter/models/req_get_bridges_by_l1_addr.py deleted file mode 100644 index 6ba63fe..0000000 --- a/lighter/models/req_get_bridges_by_l1_addr.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetBridgesByL1Addr(BaseModel): - """ - ReqGetBridgesByL1Addr - """ # noqa: E501 - l1_address: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address"] - - 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 ReqGetBridgesByL1Addr 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 ReqGetBridgesByL1Addr 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") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_by_account.py b/lighter/models/req_get_by_account.py deleted file mode 100644 index 85557cf..0000000 --- a/lighter/models/req_get_by_account.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetByAccount(BaseModel): - """ - ReqGetByAccount - """ # noqa: E501 - by: StrictStr - value: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['account_index']): - raise ValueError("must be one of enum values ('account_index')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetByAccount 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 ReqGetByAccount from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "by": obj.get("by"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_candles.py b/lighter/models/req_get_candles.py deleted file mode 100644 index 8814c7e..0000000 --- a/lighter/models/req_get_candles.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetCandles(BaseModel): - """ - ReqGetCandles - """ # noqa: E501 - market_id: StrictInt - resolution: StrictStr - start_timestamp: Annotated[int, Field(le=5000000000000, strict=True)] - end_timestamp: Annotated[int, Field(le=5000000000000, strict=True)] - count_back: StrictInt - set_timestamp_to_end: Optional[StrictBool] = False - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "resolution", "start_timestamp", "end_timestamp", "count_back", "set_timestamp_to_end"] - - @field_validator('resolution') - def resolution_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['1m', '5m', '15m', '30m', '1h', '4h', '12h', '1d', '1w']): - raise ValueError("must be one of enum values ('1m', '5m', '15m', '30m', '1h', '4h', '12h', '1d', '1w')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetCandles 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 ReqGetCandles 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"), - "resolution": obj.get("resolution"), - "start_timestamp": obj.get("start_timestamp"), - "end_timestamp": obj.get("end_timestamp"), - "count_back": obj.get("count_back"), - "set_timestamp_to_end": obj.get("set_timestamp_to_end") if obj.get("set_timestamp_to_end") is not None else False - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_execute_stats.py b/lighter/models/req_get_execute_stats.py deleted file mode 100644 index 266d02a..0000000 --- a/lighter/models/req_get_execute_stats.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetExecuteStats(BaseModel): - """ - ReqGetExecuteStats - """ # noqa: E501 - period: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["period"] - - @field_validator('period') - def period_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['d', 'w', 'm', 'q', 'y', 'all']): - raise ValueError("must be one of enum values ('d', 'w', 'm', 'q', 'y', 'all')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetExecuteStats from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetExecuteStats from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "period": obj.get("period") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_fast_withdraw_info.py b/lighter/models/req_get_fast_withdraw_info.py deleted file mode 100644 index 401af0a..0000000 --- a/lighter/models/req_get_fast_withdraw_info.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetFastWithdrawInfo(BaseModel): - """ - ReqGetFastWithdrawInfo - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index"] - - 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 ReqGetFastWithdrawInfo 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 ReqGetFastWithdrawInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_fundings.py b/lighter/models/req_get_fundings.py deleted file mode 100644 index d879d47..0000000 --- a/lighter/models/req_get_fundings.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetFundings(BaseModel): - """ - ReqGetFundings - """ # noqa: E501 - market_id: StrictInt - resolution: StrictStr - start_timestamp: Annotated[int, Field(le=5000000000000, strict=True)] - end_timestamp: Annotated[int, Field(le=5000000000000, strict=True)] - count_back: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "resolution", "start_timestamp", "end_timestamp", "count_back"] - - @field_validator('resolution') - def resolution_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['1h', '1d']): - raise ValueError("must be one of enum values ('1h', '1d')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetFundings 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 ReqGetFundings 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"), - "resolution": obj.get("resolution"), - "start_timestamp": obj.get("start_timestamp"), - "end_timestamp": obj.get("end_timestamp"), - "count_back": obj.get("count_back") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_l1_metadata.py b/lighter/models/req_get_l1_metadata.py deleted file mode 100644 index 5ee9d19..0000000 --- a/lighter/models/req_get_l1_metadata.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetL1Metadata(BaseModel): - """ - ReqGetL1Metadata - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - l1_address: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "l1_address"] - - 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 ReqGetL1Metadata 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 ReqGetL1Metadata from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "l1_address": obj.get("l1_address") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_l1_tx.py b/lighter/models/req_get_l1_tx.py deleted file mode 100644 index 02f7f87..0000000 --- a/lighter/models/req_get_l1_tx.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetL1Tx(BaseModel): - """ - ReqGetL1Tx - """ # noqa: E501 - hash: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["hash"] - - 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 ReqGetL1Tx 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 ReqGetL1Tx from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "hash": obj.get("hash") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_latest_deposit.py b/lighter/models/req_get_latest_deposit.py deleted file mode 100644 index 7bd652d..0000000 --- a/lighter/models/req_get_latest_deposit.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetLatestDeposit(BaseModel): - """ - ReqGetLatestDeposit - """ # noqa: E501 - l1_address: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address"] - - 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 ReqGetLatestDeposit 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 ReqGetLatestDeposit 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") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_leases.py b/lighter/models/req_get_leases.py deleted file mode 100644 index 37c02d0..0000000 --- a/lighter/models/req_get_leases.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetLeases(BaseModel): - """ - ReqGetLeases - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - cursor: Optional[StrictStr] = None - limit: Optional[StrictInt] = 20 - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "cursor", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetLeases from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetLeases from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), - "cursor": obj.get("cursor"), - "limit": obj.get("limit") if obj.get("limit") is not None else 20 - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_liquidation_infos.py b/lighter/models/req_get_liquidation_infos.py deleted file mode 100644 index aa7f818..0000000 --- a/lighter/models/req_get_liquidation_infos.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetLiquidationInfos(BaseModel): - """ - ReqGetLiquidationInfos - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - market_id: Optional[StrictInt] = None - cursor: Optional[StrictStr] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "market_id", "cursor", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetLiquidationInfos 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 ReqGetLiquidationInfos from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), - "market_id": obj.get("market_id"), - "cursor": obj.get("cursor"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_next_nonce.py b/lighter/models/req_get_next_nonce.py deleted file mode 100644 index 1ae8fbc..0000000 --- a/lighter/models/req_get_next_nonce.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetNextNonce(BaseModel): - """ - ReqGetNextNonce - """ # noqa: E501 - account_index: StrictInt - api_key_index: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "api_key_index"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetNextNonce 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 ReqGetNextNonce from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "account_index": obj.get("account_index"), - "api_key_index": obj.get("api_key_index") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_order_book_details.py b/lighter/models/req_get_order_book_details.py deleted file mode 100644 index 50dd1d0..0000000 --- a/lighter/models/req_get_order_book_details.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetOrderBookDetails(BaseModel): - """ - ReqGetOrderBookDetails - """ # noqa: E501 - market_id: Optional[StrictInt] = None - filter: Optional[StrictStr] = 'all' - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "filter"] - - @field_validator('filter') - def filter_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'spot', 'perp']): - raise ValueError("must be one of enum values ('all', 'spot', 'perp')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetOrderBookDetails 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 ReqGetOrderBookDetails 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"), - "filter": obj.get("filter") if obj.get("filter") is not None else 'all' - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_order_book_orders.py b/lighter/models/req_get_order_book_orders.py deleted file mode 100644 index 4e72111..0000000 --- a/lighter/models/req_get_order_book_orders.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetOrderBookOrders(BaseModel): - """ - ReqGetOrderBookOrders - """ # noqa: E501 - market_id: StrictInt - limit: Annotated[int, Field(le=250, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetOrderBookOrders 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 ReqGetOrderBookOrders 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"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_partner_stats.py b/lighter/models/req_get_partner_stats.py deleted file mode 100644 index b4b64e8..0000000 --- a/lighter/models/req_get_partner_stats.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetPartnerStats(BaseModel): - """ - ReqGetPartnerStats - """ # noqa: E501 - account_index: StrictInt - start_timestamp: Optional[StrictInt] = None - end_timestamp: Optional[StrictInt] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "start_timestamp", "end_timestamp"] - - 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 ReqGetPartnerStats 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 ReqGetPartnerStats from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "account_index": obj.get("account_index"), - "start_timestamp": obj.get("start_timestamp"), - "end_timestamp": obj.get("end_timestamp") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_position_funding.py b/lighter/models/req_get_position_funding.py deleted file mode 100644 index 08ab0d9..0000000 --- a/lighter/models/req_get_position_funding.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetPositionFunding(BaseModel): - """ - ReqGetPositionFunding - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - market_id: Optional[StrictInt] = None - cursor: Optional[StrictStr] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - side: Optional[StrictStr] = 'all' - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "market_id", "cursor", "limit", "side"] - - @field_validator('side') - def side_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['long', 'short', 'all']): - raise ValueError("must be one of enum values ('long', 'short', 'all')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetPositionFunding 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 ReqGetPositionFunding from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), - "market_id": obj.get("market_id"), - "cursor": obj.get("cursor"), - "limit": obj.get("limit"), - "side": obj.get("side") if obj.get("side") is not None else 'all' - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_public_pools_metadata.py b/lighter/models/req_get_public_pools_metadata.py deleted file mode 100644 index 4c05fa4..0000000 --- a/lighter/models/req_get_public_pools_metadata.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetPublicPoolsMetadata(BaseModel): - """ - ReqGetPublicPoolsMetadata - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - filter: Optional[StrictStr] = None - index: StrictInt - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - account_index: Optional[StrictInt] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "filter", "index", "limit", "account_index"] - - @field_validator('filter') - def filter_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'user', 'protocol', 'account_index', 'stake']): - raise ValueError("must be one of enum values ('all', 'user', 'protocol', 'account_index', 'stake')") - return value - - model_config = ConfigDict( - 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 ReqGetPublicPoolsMetadata 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 ReqGetPublicPoolsMetadata from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "filter": obj.get("filter"), - "index": obj.get("index"), - "limit": obj.get("limit"), - "account_index": obj.get("account_index") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_push_notif_settings.py b/lighter/models/req_get_push_notif_settings.py deleted file mode 100644 index 3795d7d..0000000 --- a/lighter/models/req_get_push_notif_settings.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetPushNotifSettings(BaseModel): - """ - ReqGetPushNotifSettings - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - expo_token: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "expo_token"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetPushNotifSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetPushNotifSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), - "expo_token": obj.get("expo_token") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_range_with_cursor.py b/lighter/models/req_get_range_with_cursor.py deleted file mode 100644 index e7ea2e5..0000000 --- a/lighter/models/req_get_range_with_cursor.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetRangeWithCursor(BaseModel): - """ - ReqGetRangeWithCursor - """ # noqa: E501 - cursor: Optional[StrictStr] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["cursor", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetRangeWithCursor 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 ReqGetRangeWithCursor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "cursor": obj.get("cursor"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_range_with_index.py b/lighter/models/req_get_range_with_index.py deleted file mode 100644 index 4e5f7f9..0000000 --- a/lighter/models/req_get_range_with_index.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetRangeWithIndex(BaseModel): - """ - ReqGetRangeWithIndex - """ # noqa: E501 - index: Optional[StrictInt] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["index", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetRangeWithIndex 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 ReqGetRangeWithIndex from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "index": obj.get("index"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_range_with_index_sortable.py b/lighter/models/req_get_range_with_index_sortable.py deleted file mode 100644 index 920b5bb..0000000 --- a/lighter/models/req_get_range_with_index_sortable.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetRangeWithIndexSortable(BaseModel): - """ - ReqGetRangeWithIndexSortable - """ # noqa: E501 - index: Optional[StrictInt] = None - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None - sort: Optional[StrictStr] = 'asc' - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["index", "limit", "sort"] - - @field_validator('sort') - def sort_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['asc', 'desc']): - raise ValueError("must be one of enum values ('asc', 'desc')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetRangeWithIndexSortable 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 ReqGetRangeWithIndexSortable from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "index": obj.get("index"), - "limit": obj.get("limit"), - "sort": obj.get("sort") if obj.get("sort") is not None else 'asc' - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_recent_trades.py b/lighter/models/req_get_recent_trades.py deleted file mode 100644 index f2f32ba..0000000 --- a/lighter/models/req_get_recent_trades.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetRecentTrades(BaseModel): - """ - ReqGetRecentTrades - """ # noqa: E501 - market_id: StrictInt - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetRecentTrades 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 ReqGetRecentTrades 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"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_trades.py b/lighter/models/req_get_trades.py deleted file mode 100644 index acc205c..0000000 --- a/lighter/models/req_get_trades.py +++ /dev/null @@ -1,162 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetTrades(BaseModel): - """ - ReqGetTrades - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - market_id: Optional[StrictInt] = None - account_index: Optional[StrictInt] = -1 - order_index: Optional[StrictInt] = None - sort_by: StrictStr - sort_dir: Optional[StrictStr] = 'desc' - cursor: Optional[StrictStr] = None - var_from: Optional[StrictInt] = Field(default=-1, alias="from") - ask_filter: Optional[StrictInt] = None - role: Optional[StrictStr] = 'all' - type: Optional[StrictStr] = 'all' - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - aggregate: Optional[StrictBool] = False - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "market_id", "account_index", "order_index", "sort_by", "sort_dir", "cursor", "from", "ask_filter", "role", "type", "limit", "aggregate"] - - @field_validator('sort_by') - def sort_by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['block_height', 'timestamp', 'trade_id']): - raise ValueError("must be one of enum values ('block_height', 'timestamp', 'trade_id')") - return value - - @field_validator('sort_dir') - def sort_dir_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['desc']): - raise ValueError("must be one of enum values ('desc')") - return value - - @field_validator('role') - def role_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'maker', 'taker']): - raise ValueError("must be one of enum values ('all', 'maker', 'taker')") - return value - - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'trade', 'liquidation', 'deleverage', 'market-settlement']): - raise ValueError("must be one of enum values ('all', 'trade', 'liquidation', 'deleverage', 'market-settlement')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - 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 ReqGetTrades 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 ReqGetTrades from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "market_id": obj.get("market_id"), - "account_index": obj.get("account_index") if obj.get("account_index") is not None else -1, - "order_index": obj.get("order_index"), - "sort_by": obj.get("sort_by"), - "sort_dir": obj.get("sort_dir") if obj.get("sort_dir") is not None else 'desc', - "cursor": obj.get("cursor"), - "from": obj.get("from") if obj.get("from") is not None else -1, - "ask_filter": obj.get("ask_filter"), - "role": obj.get("role") if obj.get("role") is not None else 'all', - "type": obj.get("type") if obj.get("type") is not None else 'all', - "limit": obj.get("limit"), - "aggregate": obj.get("aggregate") if obj.get("aggregate") is not None else False - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_transfer_fee_info.py b/lighter/models/req_get_transfer_fee_info.py deleted file mode 100644 index 1636b55..0000000 --- a/lighter/models/req_get_transfer_fee_info.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetTransferFeeInfo(BaseModel): - """ - ReqGetTransferFeeInfo - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - to_account_index: Optional[StrictInt] = -1 - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "to_account_index"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetTransferFeeInfo 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 ReqGetTransferFeeInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), - "to_account_index": obj.get("to_account_index") if obj.get("to_account_index") is not None else -1 - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_transfer_history.py b/lighter/models/req_get_transfer_history.py deleted file mode 100644 index d128bd4..0000000 --- a/lighter/models/req_get_transfer_history.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetTransferHistory(BaseModel): - """ - ReqGetTransferHistory - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - cursor: Optional[StrictStr] = None - type: Optional[List[StrictStr]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "cursor", "type"] - - 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 ReqGetTransferHistory 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 ReqGetTransferHistory from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), - "cursor": obj.get("cursor"), - "type": obj.get("type") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_tx.py b/lighter/models/req_get_tx.py deleted file mode 100644 index 70706fd..0000000 --- a/lighter/models/req_get_tx.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetTx(BaseModel): - """ - ReqGetTx - """ # noqa: E501 - by: StrictStr - value: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['hash', 'sequence_index']): - raise ValueError("must be one of enum values ('hash', 'sequence_index')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetTx 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 ReqGetTx from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "by": obj.get("by"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_user_referrals.py b/lighter/models/req_get_user_referrals.py deleted file mode 100644 index 4149ffd..0000000 --- a/lighter/models/req_get_user_referrals.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetUserReferrals(BaseModel): - """ - ReqGetUserReferrals - """ # noqa: E501 - auth: Optional[StrictStr] = None - l1_address: StrictStr - cursor: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "l1_address", "cursor"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetUserReferrals from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetUserReferrals from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "l1_address": obj.get("l1_address"), - "cursor": obj.get("cursor") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_withdraw_history.py b/lighter/models/req_get_withdraw_history.py deleted file mode 100644 index fc2f730..0000000 --- a/lighter/models/req_get_withdraw_history.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetWithdrawHistory(BaseModel): - """ - ReqGetWithdrawHistory - """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt - cursor: Optional[StrictStr] = None - filter: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "cursor", "filter"] - - @field_validator('filter') - def filter_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'pending', 'claimable']): - raise ValueError("must be one of enum values ('all', 'pending', 'claimable')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetWithdrawHistory 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 ReqGetWithdrawHistory from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), - "cursor": obj.get("cursor"), - "filter": obj.get("filter") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_order_books.py b/lighter/models/req_set_account_metadata.py similarity index 77% rename from lighter/models/req_get_order_books.py rename to lighter/models/req_set_account_metadata.py index be80217..b8539c9 100644 --- a/lighter/models/req_get_order_books.py +++ b/lighter/models/req_set_account_metadata.py @@ -17,29 +17,22 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class ReqGetOrderBooks(BaseModel): +class ReqSetAccountMetadata(BaseModel): """ - ReqGetOrderBooks + ReqSetAccountMetadata """ # noqa: E501 - market_id: Optional[StrictInt] = None - filter: Optional[StrictStr] = 'all' + master_account_index: StrictInt + target_account_index: StrictInt + api_key_index: StrictInt + metadata: StrictStr + auth: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "filter"] - - @field_validator('filter') - def filter_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'spot', 'perp']): - raise ValueError("must be one of enum values ('all', 'spot', 'perp')") - return value + __properties: ClassVar[List[str]] = ["master_account_index", "target_account_index", "api_key_index", "metadata", "auth"] model_config = ConfigDict( populate_by_name=True, @@ -59,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetOrderBooks from a JSON string""" + """Create an instance of ReqSetAccountMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -91,7 +84,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetOrderBooks from a dict""" + """Create an instance of ReqSetAccountMetadata from a dict""" if obj is None: return None @@ -99,8 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_construct(**{ - "market_id": obj.get("market_id"), - "filter": obj.get("filter") if obj.get("filter") is not None else 'all' + "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") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/resp_get_lease_options.py b/lighter/models/resp_get_lease_options.py index cc153ca..7d26959 100644 --- a/lighter/models/resp_get_lease_options.py +++ b/lighter/models/resp_get_lease_options.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from lighter.models.lease_option_entry import LeaseOptionEntry from typing import Optional, Set @@ -30,7 +30,7 @@ class RespGetLeaseOptions(BaseModel): code: StrictInt message: Optional[StrictStr] = None options: List[LeaseOptionEntry] - lit_incentives_account_index: StrictInt + lit_incentives_account_index: StrictInt = Field(description="Account index that receives the leasing fee") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "options", "lit_incentives_account_index"] diff --git a/lighter/models/resp_get_leases.py b/lighter/models/resp_get_leases.py index bfd03db..5a0b757 100644 --- a/lighter/models/resp_get_leases.py +++ b/lighter/models/resp_get_leases.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from lighter.models.lease_entry import LeaseEntry from typing import Optional, Set @@ -30,7 +30,7 @@ class RespGetLeases(BaseModel): code: StrictInt message: Optional[StrictStr] = None leases: List[LeaseEntry] - next_cursor: Optional[StrictStr] = None + next_cursor: Optional[StrictStr] = Field(default=None, description="Cursor to pass as the cursor param to fetch the next page. Absent if no more pages.") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["code", "message", "leases", "next_cursor"] diff --git a/lighter/models/resp_get_maker_only_api_keys.py b/lighter/models/resp_get_maker_only_api_keys.py index 189f906..b794dab 100644 --- a/lighter/models/resp_get_maker_only_api_keys.py +++ b/lighter/models/resp_get_maker_only_api_keys.py @@ -73,13 +73,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in api_key_indexes (list) - _items = [] - if self.api_key_indexes: - for _item in self.api_key_indexes: - if _item: - _items.append(_item.to_dict()) - _dict['api_key_indexes'] = _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(): @@ -99,7 +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"), - "api_key_indexes": obj.get("api_key_indexes"), + "api_key_indexes": obj.get("api_key_indexes") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/resp_get_is_next_bridge_fast.py b/lighter/models/resp_update_kickback.py similarity index 87% rename from lighter/models/resp_get_is_next_bridge_fast.py rename to lighter/models/resp_update_kickback.py index 8245973..546896c 100644 --- a/lighter/models/resp_get_is_next_bridge_fast.py +++ b/lighter/models/resp_update_kickback.py @@ -22,15 +22,15 @@ from typing import Optional, Set from typing_extensions import Self -class RespGetIsNextBridgeFast(BaseModel): +class RespUpdateKickback(BaseModel): """ - RespGetIsNextBridgeFast + RespUpdateKickback """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - is_next_bridge_fast: StrictBool + success: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "is_next_bridge_fast"] + __properties: ClassVar[List[str]] = ["code", "message", "success"] model_config = ConfigDict( populate_by_name=True, @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RespGetIsNextBridgeFast from a JSON string""" + """Create an instance of RespUpdateKickback from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -82,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RespGetIsNextBridgeFast from a dict""" + """Create an instance of RespUpdateKickback from a dict""" if obj is None: return None @@ -92,7 +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"), - "is_next_bridge_fast": obj.get("is_next_bridge_fast") + "success": obj.get("success") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/resp_get_push_notif_settings.py b/lighter/models/resp_update_referral_code.py similarity index 86% rename from lighter/models/resp_get_push_notif_settings.py rename to lighter/models/resp_update_referral_code.py index c839303..e31d519 100644 --- a/lighter/models/resp_get_push_notif_settings.py +++ b/lighter/models/resp_update_referral_code.py @@ -22,16 +22,15 @@ from typing import Optional, Set from typing_extensions import Self -class RespGetPushNotifSettings(BaseModel): +class RespUpdateReferralCode(BaseModel): """ - RespGetPushNotifSettings + RespUpdateReferralCode """ # noqa: E501 code: StrictInt message: Optional[StrictStr] = None - account_index: StrictInt - enabled: StrictBool + success: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_index", "enabled"] + __properties: ClassVar[List[str]] = ["code", "message", "success"] model_config = ConfigDict( populate_by_name=True, @@ -51,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of RespGetPushNotifSettings from a JSON string""" + """Create an instance of RespUpdateReferralCode from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,7 +82,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of RespGetPushNotifSettings from a dict""" + """Create an instance of RespUpdateReferralCode from a dict""" if obj is None: return None @@ -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"), - "account_index": obj.get("account_index"), - "enabled": obj.get("enabled") + "success": obj.get("success") }) # 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 2d0463c..1e2745b 100644 --- a/lighter/models/risk_parameters.py +++ b/lighter/models/risk_parameters.py @@ -32,8 +32,11 @@ class RiskParameters(BaseModel): initial_margin_req: StrictStr maintenance_margin_req: StrictStr close_out_margin_req: StrictStr + total_account_liquidation_threshold: StrictStr + usdc_collateral_with_funding: StrictStr + usdc_portfolio_value: StrictStr 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"] + __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"] model_config = ConfigDict( populate_by_name=True, @@ -98,7 +101,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total_account_value": obj.get("total_account_value"), "initial_margin_req": obj.get("initial_margin_req"), "maintenance_margin_req": obj.get("maintenance_margin_req"), - "close_out_margin_req": obj.get("close_out_margin_req") + "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") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/spot_avg_entry_price.py b/lighter/models/spot_avg_entry_price.py deleted file mode 100644 index 3139afd..0000000 --- a/lighter/models/spot_avg_entry_price.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class SpotAvgEntryPrice(BaseModel): - """ - SpotAvgEntryPrice - """ # noqa: E501 - asset_id: StrictInt - avg_entry_price: StrictStr - asset_size: StrictStr - last_trade_id: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["asset_id", "avg_entry_price", "asset_size", "last_trade_id"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SpotAvgEntryPrice from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SpotAvgEntryPrice from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "asset_id": obj.get("asset_id"), - "avg_entry_price": obj.get("avg_entry_price"), - "asset_size": obj.get("asset_size"), - "last_trade_id": obj.get("last_trade_id") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/spot_market_stats.py b/lighter/models/spot_market_stats.py deleted file mode 100644 index 60e7945..0000000 --- a/lighter/models/spot_market_stats.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class SpotMarketStats(BaseModel): - """ - SpotMarketStats - """ # noqa: E501 - symbol: StrictStr - market_id: StrictInt - index_price: StrictStr - mid_price: StrictStr - last_trade_price: StrictStr - daily_base_token_volume: Union[StrictFloat, StrictInt] - daily_quote_token_volume: Union[StrictFloat, StrictInt] - daily_price_low: Union[StrictFloat, StrictInt] - daily_price_high: Union[StrictFloat, StrictInt] - daily_price_change: Union[StrictFloat, StrictInt] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["symbol", "market_id", "index_price", "mid_price", "last_trade_price", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change"] - - 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 SpotMarketStats 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 SpotMarketStats from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "symbol": obj.get("symbol"), - "market_id": obj.get("market_id"), - "index_price": obj.get("index_price"), - "mid_price": obj.get("mid_price"), - "last_trade_price": obj.get("last_trade_price"), - "daily_base_token_volume": obj.get("daily_base_token_volume"), - "daily_quote_token_volume": obj.get("daily_quote_token_volume"), - "daily_price_low": obj.get("daily_price_low"), - "daily_price_high": obj.get("daily_price_high"), - "daily_price_change": obj.get("daily_price_change") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/spot_order_book_detail.py b/lighter/models/spot_order_book_detail.py index b606737..07aa96c 100644 --- a/lighter/models/spot_order_book_detail.py +++ b/lighter/models/spot_order_book_detail.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self @@ -51,8 +51,10 @@ class SpotOrderBookDetail(BaseModel): daily_price_high: Union[StrictFloat, StrictInt] daily_price_change: Union[StrictFloat, StrictInt] daily_chart: Dict[str, Union[StrictFloat, StrictInt]] + is_maker_fee_enabled: StrictBool + is_taker_fee_enabled: StrictBool 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"] + __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"] @field_validator('market_type') def market_type_validate_enum(cls, value): @@ -150,7 +152,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "daily_price_low": obj.get("daily_price_low"), "daily_price_high": obj.get("daily_price_high"), "daily_price_change": obj.get("daily_price_change"), - "daily_chart": obj.get("daily_chart") + "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") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/system_config.py b/lighter/models/system_config.py index 61a814b..1e71118 100644 --- a/lighter/models/system_config.py +++ b/lighter/models/system_config.py @@ -33,12 +33,13 @@ class SystemConfig(BaseModel): funding_fee_rebate_account_index: StrictInt liquidity_pool_cooldown_period: StrictInt staking_pool_lockup_period: StrictInt - max_integrator_spot_taker_fee: StrictInt - max_integrator_spot_maker_fee: StrictInt - max_integrator_perps_taker_fee: StrictInt max_integrator_perps_maker_fee: StrictInt + max_integrator_perps_taker_fee: StrictInt + max_integrator_spot_maker_fee: StrictInt + max_integrator_spot_taker_fee: StrictInt + market_maker_incentive_account_index: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "liquidity_pool_index", "staking_pool_index", "funding_fee_rebate_account_index", "liquidity_pool_cooldown_period", "staking_pool_lockup_period", "max_integrator_spot_taker_fee", "max_integrator_spot_maker_fee", "max_integrator_perps_taker_fee", "max_integrator_perps_maker_fee"] + __properties: ClassVar[List[str]] = ["code", "message", "liquidity_pool_index", "staking_pool_index", "funding_fee_rebate_account_index", "liquidity_pool_cooldown_period", "staking_pool_lockup_period", "max_integrator_perps_maker_fee", "max_integrator_perps_taker_fee", "max_integrator_spot_maker_fee", "max_integrator_spot_taker_fee", "market_maker_incentive_account_index"] model_config = ConfigDict( populate_by_name=True, @@ -105,10 +106,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "funding_fee_rebate_account_index": obj.get("funding_fee_rebate_account_index"), "liquidity_pool_cooldown_period": obj.get("liquidity_pool_cooldown_period"), "staking_pool_lockup_period": obj.get("staking_pool_lockup_period"), - "max_integrator_spot_taker_fee": obj.get("max_integrator_spot_taker_fee"), - "max_integrator_spot_maker_fee": obj.get("max_integrator_spot_maker_fee"), + "max_integrator_perps_maker_fee": obj.get("max_integrator_perps_maker_fee"), "max_integrator_perps_taker_fee": obj.get("max_integrator_perps_taker_fee"), - "max_integrator_perps_maker_fee": obj.get("max_integrator_perps_maker_fee") + "max_integrator_spot_maker_fee": obj.get("max_integrator_spot_maker_fee"), + "max_integrator_spot_taker_fee": obj.get("max_integrator_spot_taker_fee"), + "market_maker_incentive_account_index": obj.get("market_maker_incentive_account_index") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/ticker.py b/lighter/models/ticker.py deleted file mode 100644 index 7c262c2..0000000 --- a/lighter/models/ticker.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from lighter.models.price_level import PriceLevel -from typing import Optional, Set -from typing_extensions import Self - -class Ticker(BaseModel): - """ - Ticker - """ # noqa: E501 - s: StrictStr - a: PriceLevel - b: PriceLevel - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["s", "a", "b"] - - 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 Ticker 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 a - if self.a: - _dict['a'] = self.a.to_dict() - # override the default output from pydantic by calling `to_dict()` of b - if self.b: - _dict['b'] = self.b.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(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Ticker from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_construct(**{ - "s": obj.get("s"), - "a": PriceLevel.from_dict(obj["a"]) if obj.get("a") is not None else None, - "b": PriceLevel.from_dict(obj["b"]) if obj.get("b") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_exchange_metrics.py b/lighter/models/token.py similarity index 58% rename from lighter/models/req_get_exchange_metrics.py rename to lighter/models/token.py index 6089da1..0819cfc 100644 --- a/lighter/models/req_get_exchange_metrics.py +++ b/lighter/models/token.py @@ -17,44 +17,49 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class ReqGetExchangeMetrics(BaseModel): +class Token(BaseModel): """ - ReqGetExchangeMetrics + Token """ # noqa: E501 - period: StrictStr - kind: StrictStr - filter: Optional[StrictStr] = None - value: Optional[StrictStr] = None + symbol: StrictStr + name: StrictStr + logo: StrictStr + logo_extension: StrictStr + description_key: StrictStr + gecko_id: StrictStr + paprika_id: StrictStr + market: StrictStr + asset_type: StrictStr + categories: List[StrictStr] + is_allowed_mainnet: StrictBool + is_asset_allowed_mainnet: StrictBool additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["period", "kind", "filter", "value"] + __properties: ClassVar[List[str]] = ["symbol", "name", "logo", "logo_extension", "description_key", "gecko_id", "paprika_id", "market", "asset_type", "categories", "is_allowed_mainnet", "is_asset_allowed_mainnet"] - @field_validator('period') - def period_validate_enum(cls, value): + @field_validator('logo_extension') + def logo_extension_validate_enum(cls, value): """Validates the enum""" - if value not in set(['h', 'd', 'w', 'm', 'q', 'y', 'all']): - raise ValueError("must be one of enum values ('h', 'd', 'w', 'm', 'q', 'y', 'all')") + if value not in set(['svg', 'png']): + raise ValueError("must be one of enum values ('svg', 'png')") return value - @field_validator('kind') - def kind_validate_enum(cls, value): + @field_validator('market') + def market_validate_enum(cls, value): """Validates the enum""" - if value not in set(['volume', 'maker_fee', 'taker_fee', 'liquidation_fee', 'trade_count', 'liquidation_count', 'liquidation_volume', 'inflow', 'outflow', 'transfer_fee', 'withdraw_fee', 'open_interest', 'account_count', 'active_account_count', 'tps']): - raise ValueError("must be one of enum values ('volume', 'maker_fee', 'taker_fee', 'liquidation_fee', 'trade_count', 'liquidation_count', 'liquidation_volume', 'inflow', 'outflow', 'transfer_fee', 'withdraw_fee', 'open_interest', 'account_count', 'active_account_count', 'tps')") + if value not in set(['SPOT', 'PERPS']): + raise ValueError("must be one of enum values ('SPOT', 'PERPS')") return value - @field_validator('filter') - def filter_validate_enum(cls, value): + @field_validator('asset_type') + def asset_type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['byMarket']): - raise ValueError("must be one of enum values ('byMarket')") + if value not in set(['CRYPTO', 'RWA']): + raise ValueError("must be one of enum values ('CRYPTO', 'RWA')") return value model_config = ConfigDict( @@ -75,7 +80,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetExchangeMetrics from a JSON string""" + """Create an instance of Token from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -107,7 +112,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetExchangeMetrics from a dict""" + """Create an instance of Token from a dict""" if obj is None: return None @@ -115,10 +120,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_construct(**{ - "period": obj.get("period"), - "kind": obj.get("kind"), - "filter": obj.get("filter"), - "value": obj.get("value") + "symbol": obj.get("symbol"), + "name": obj.get("name"), + "logo": obj.get("logo"), + "logo_extension": obj.get("logo_extension"), + "description_key": obj.get("description_key"), + "gecko_id": obj.get("gecko_id"), + "paprika_id": obj.get("paprika_id"), + "market": obj.get("market"), + "asset_type": obj.get("asset_type"), + "categories": obj.get("categories"), + "is_allowed_mainnet": obj.get("is_allowed_mainnet"), + "is_asset_allowed_mainnet": obj.get("is_asset_allowed_mainnet") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/token_list.py b/lighter/models/token_list.py new file mode 100644 index 0000000..9a41d23 --- /dev/null +++ b/lighter/models/token_list.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.token import Token +from typing import Optional, Set +from typing_extensions import Self + +class TokenList(BaseModel): + """ + TokenList + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + tokens: List[Token] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "tokens"] + + 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 TokenList 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 tokens (list) + _items = [] + if self.tokens: + for _item in self.tokens: + if _item: + _items.append(_item.to_dict()) + _dict['tokens'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TokenList 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"), + "tokens": [Token.from_dict(_item) for _item in obj["tokens"]] if obj.get("tokens") 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/trade.py b/lighter/models/trade.py index b9000c5..05ea1a9 100644 --- a/lighter/models/trade.py +++ b/lighter/models/trade.py @@ -17,8 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List +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 @@ -35,28 +35,41 @@ class Trade(BaseModel): usd_amount: StrictStr ask_id: StrictInt bid_id: StrictInt - ask_client_id: StrictInt - bid_client_id: StrictInt ask_account_id: StrictInt bid_account_id: StrictInt is_maker_ask: StrictBool block_height: StrictInt timestamp: StrictInt - taker_fee: StrictInt + taker_fee: Optional[StrictInt] = None taker_position_size_before: StrictStr taker_entry_quote_before: StrictStr taker_initial_margin_fraction_before: StrictInt taker_position_sign_changed: StrictBool - maker_fee: StrictInt + maker_fee: Optional[StrictInt] = None maker_position_size_before: StrictStr maker_entry_quote_before: StrictStr maker_initial_margin_fraction_before: StrictInt maker_position_sign_changed: StrictBool transaction_time: StrictInt - ask_account_pnl: StrictStr - bid_account_pnl: StrictStr + bid_account_pnl: StrictStr = Field(description="Realized PnL for the queried account index, triggered by reducing a short position") + ask_account_pnl: StrictStr = Field(description="Realized PnL for the queried account index, triggered by reducing a long position, or a spot position") + ask_client_id: StrictInt + bid_client_id: StrictInt + ask_client_id_str: StrictStr + bid_client_id_str: StrictStr + ask_id_str: Optional[StrictStr] = None + bid_id_str: Optional[StrictStr] = None + trade_id_str: StrictStr + integrator_maker_fee: StrictInt + integrator_maker_fee_collector_index: StrictInt + integrator_taker_fee: StrictInt + integrator_taker_fee_collector_index: StrictInt + taker_allocated_margin_usdc_before: StrictInt + taker_allocated_margin_usdc_after: StrictInt + maker_allocated_margin_usdc_before: StrictInt + maker_allocated_margin_usdc_after: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["trade_id", "tx_hash", "type", "market_id", "size", "price", "usd_amount", "ask_id", "bid_id", "ask_client_id", "bid_client_id", "ask_account_id", "bid_account_id", "is_maker_ask", "block_height", "timestamp", "taker_fee", "taker_position_size_before", "taker_entry_quote_before", "taker_initial_margin_fraction_before", "taker_position_sign_changed", "maker_fee", "maker_position_size_before", "maker_entry_quote_before", "maker_initial_margin_fraction_before", "maker_position_sign_changed", "transaction_time", "ask_account_pnl", "bid_account_pnl"] + __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"] @field_validator('type') def type_validate_enum(cls, value): @@ -132,8 +145,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "usd_amount": obj.get("usd_amount"), "ask_id": obj.get("ask_id"), "bid_id": obj.get("bid_id"), - "ask_client_id": obj.get("ask_client_id"), - "bid_client_id": obj.get("bid_client_id"), "ask_account_id": obj.get("ask_account_id"), "bid_account_id": obj.get("bid_account_id"), "is_maker_ask": obj.get("is_maker_ask"), @@ -150,8 +161,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "maker_initial_margin_fraction_before": obj.get("maker_initial_margin_fraction_before"), "maker_position_sign_changed": obj.get("maker_position_sign_changed"), "transaction_time": obj.get("transaction_time"), + "bid_account_pnl": obj.get("bid_account_pnl"), "ask_account_pnl": obj.get("ask_account_pnl"), - "bid_account_pnl": obj.get("bid_account_pnl") + "ask_client_id": obj.get("ask_client_id"), + "bid_client_id": obj.get("bid_client_id"), + "ask_client_id_str": obj.get("ask_client_id_str"), + "bid_client_id_str": obj.get("bid_client_id_str"), + "ask_id_str": obj.get("ask_id_str"), + "bid_id_str": obj.get("bid_id_str"), + "trade_id_str": obj.get("trade_id_str"), + "integrator_maker_fee": obj.get("integrator_maker_fee"), + "integrator_maker_fee_collector_index": obj.get("integrator_maker_fee_collector_index"), + "integrator_taker_fee": obj.get("integrator_taker_fee"), + "integrator_taker_fee_collector_index": obj.get("integrator_taker_fee_collector_index"), + "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") }) # 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 0f5aa82..864e64d 100644 --- a/lighter/models/transfer_history_item.py +++ b/lighter/models/transfer_history_item.py @@ -27,20 +27,20 @@ class TransferHistoryItem(BaseModel): TransferHistoryItem """ # noqa: E501 id: StrictStr - asset_id: StrictInt amount: StrictStr - fee: StrictStr timestamp: StrictInt type: StrictStr from_l1_address: StrictStr to_l1_address: StrictStr from_account_index: StrictInt to_account_index: StrictInt + tx_hash: StrictStr + asset_id: StrictInt + fee: StrictStr from_route: StrictStr to_route: StrictStr - tx_hash: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "asset_id", "amount", "fee", "timestamp", "type", "from_l1_address", "to_l1_address", "from_account_index", "to_account_index", "from_route", "to_route", "tx_hash"] + __properties: ClassVar[List[str]] = ["id", "amount", "timestamp", "type", "from_l1_address", "to_l1_address", "from_account_index", "to_account_index", "tx_hash", "asset_id", "fee", "from_route", "to_route"] @field_validator('type') def type_validate_enum(cls, value): @@ -122,18 +122,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "id": obj.get("id"), - "asset_id": obj.get("asset_id"), "amount": obj.get("amount"), - "fee": obj.get("fee"), "timestamp": obj.get("timestamp"), "type": obj.get("type"), "from_l1_address": obj.get("from_l1_address"), "to_l1_address": obj.get("to_l1_address"), "from_account_index": obj.get("from_account_index"), "to_account_index": obj.get("to_account_index"), + "tx_hash": obj.get("tx_hash"), + "asset_id": obj.get("asset_id"), + "fee": obj.get("fee"), "from_route": obj.get("from_route"), - "to_route": obj.get("to_route"), - "tx_hash": obj.get("tx_hash") + "to_route": obj.get("to_route") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_get_deposit_history.py b/lighter/models/tx.py similarity index 63% rename from lighter/models/req_get_deposit_history.py rename to lighter/models/tx.py index c090e2f..3ec6ef2 100644 --- a/lighter/models/req_get_deposit_history.py +++ b/lighter/models/tx.py @@ -17,32 +17,35 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self -class ReqGetDepositHistory(BaseModel): +class Tx(BaseModel): """ - ReqGetDepositHistory + Tx """ # noqa: E501 - auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") - account_index: StrictInt + hash: StrictStr + type: Annotated[int, Field(le=64, strict=True, ge=1)] + info: StrictStr + event_info: StrictStr + status: StrictInt + transaction_index: StrictInt l1_address: StrictStr - cursor: Optional[StrictStr] = None - filter: Optional[StrictStr] = None + account_index: StrictInt + nonce: StrictInt + expire_at: StrictInt + block_height: StrictInt + queued_at: StrictInt + executed_at: StrictInt + sequence_index: StrictInt + parent_hash: StrictStr + api_key_index: StrictInt + transaction_time: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["auth", "account_index", "l1_address", "cursor", "filter"] - - @field_validator('filter') - def filter_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'pending', 'claimable']): - raise ValueError("must be one of enum values ('all', 'pending', 'claimable')") - return value + __properties: ClassVar[List[str]] = ["hash", "type", "info", "event_info", "status", "transaction_index", "l1_address", "account_index", "nonce", "expire_at", "block_height", "queued_at", "executed_at", "sequence_index", "parent_hash", "api_key_index", "transaction_time"] model_config = ConfigDict( populate_by_name=True, @@ -62,7 +65,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetDepositHistory from a JSON string""" + """Create an instance of Tx from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -94,7 +97,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetDepositHistory from a dict""" + """Create an instance of Tx from a dict""" if obj is None: return None @@ -102,11 +105,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_construct(**{ - "auth": obj.get("auth"), - "account_index": obj.get("account_index"), + "hash": obj.get("hash"), + "type": obj.get("type"), + "info": obj.get("info"), + "event_info": obj.get("event_info"), + "status": obj.get("status"), + "transaction_index": obj.get("transaction_index"), "l1_address": obj.get("l1_address"), - "cursor": obj.get("cursor"), - "filter": obj.get("filter") + "account_index": obj.get("account_index"), + "nonce": obj.get("nonce"), + "expire_at": obj.get("expire_at"), + "block_height": obj.get("block_height"), + "queued_at": obj.get("queued_at"), + "executed_at": obj.get("executed_at"), + "sequence_index": obj.get("sequence_index"), + "parent_hash": obj.get("parent_hash"), + "api_key_index": obj.get("api_key_index"), + "transaction_time": obj.get("transaction_time") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/txs.py b/lighter/models/txs.py new file mode 100644 index 0000000..c5d1028 --- /dev/null +++ b/lighter/models/txs.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.tx import Tx +from typing import Optional, Set +from typing_extensions import Self + +class Txs(BaseModel): + """ + Txs + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + txs: List[Tx] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "txs"] + + 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 Txs from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in txs (list) + _items = [] + if self.txs: + for _item in self.txs: + if _item: + _items.append(_item.to_dict()) + _dict['txs'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Txs 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"), + "txs": [Tx.from_dict(_item) for _item in obj["txs"]] if obj.get("txs") 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/user_referrals.py b/lighter/models/user_referrals.py index b1b113c..288a0a5 100644 --- a/lighter/models/user_referrals.py +++ b/lighter/models/user_referrals.py @@ -31,8 +31,9 @@ class UserReferrals(BaseModel): message: Optional[StrictStr] = None cursor: StrictStr referrals: List[Referral] + used_code: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "cursor", "referrals"] + __properties: ClassVar[List[str]] = ["code", "message", "cursor", "referrals", "used_code"] model_config = ConfigDict( populate_by_name=True, @@ -102,7 +103,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "code": obj.get("code"), "message": obj.get("message"), "cursor": obj.get("cursor"), - "referrals": [Referral.from_dict(_item) for _item in obj["referrals"]] if obj.get("referrals") is not None else None + "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") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/withdraw_history_item.py b/lighter/models/withdraw_history_item.py index 9812939..9ca2b2f 100644 --- a/lighter/models/withdraw_history_item.py +++ b/lighter/models/withdraw_history_item.py @@ -27,14 +27,14 @@ class WithdrawHistoryItem(BaseModel): WithdrawHistoryItem """ # noqa: E501 id: StrictStr - asset_id: StrictInt amount: StrictStr timestamp: StrictInt status: StrictStr type: StrictStr l1_tx_hash: StrictStr + asset_id: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["id", "asset_id", "amount", "timestamp", "status", "type", "l1_tx_hash"] + __properties: ClassVar[List[str]] = ["id", "amount", "timestamp", "status", "type", "l1_tx_hash", "asset_id"] @field_validator('status') def status_validate_enum(cls, value): @@ -109,12 +109,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_construct(**{ "id": obj.get("id"), - "asset_id": obj.get("asset_id"), "amount": obj.get("amount"), "timestamp": obj.get("timestamp"), "status": obj.get("status"), "type": obj.get("type"), - "l1_tx_hash": obj.get("l1_tx_hash") + "l1_tx_hash": obj.get("l1_tx_hash"), + "asset_id": obj.get("asset_id") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/openapi.json b/openapi.json index 5c56e0d..3e58a45 100644 --- a/openapi.json +++ b/openapi.json @@ -1,9670 +1,10131 @@ { - "swagger": "2.0", + "openapi": "3.0.0", "info": { "title": "", "version": "" }, - "host": "mainnet.zklighter.elliot.ai", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "paths": { "/": { "get": { "summary": "status", "operationId": "status", + "tags": [ + "root" + ], + "description": "Get status of zklighter", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Status" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Status" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, - "tags": [ - "root" - ], - "description": "Get status of zklighter" + } } }, "/api/v1/account": { "get": { "summary": "account", "operationId": "account", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/DetailedAccounts" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, + "tags": [ + "account" + ], + "description": "Get account by an account's index, or L1 address", "parameters": [ { "name": "by", "in": "query", "required": true, - "type": "string", - "enum": [ - "index", - "l1_address" - ] + "schema": { + "type": "string", + "enum": [ + "index", + "l1_address" + ] + } }, { "name": "value", "in": "query", "required": true, - "type": "string" + "schema": { + "type": "string" + } + }, + { + "name": "active_only", + "in": "query", + "required": false, + "description": "Hide markets for which leverage and margin settings are present (meaning the account traded it at least once), but with no active position.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "cursor", + "in": "query", + "required": false, + "schema": { + "type": "string" + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get account by account's index.
More details about account index: [Account Index](https://apidocs.lighter.xyz/docs/account-index)
**Response Description:**

1) **Status:** 1 is active 0 is inactive.
2) **Collateral:** The amount of collateral in the account.
**Position Details Description:**
1) **OOC:** Open order count in that market.
2) **Sign:** 1 for Long, -1 for Short.
3) **Position:** The amount of position in that market.
4) **Avg Entry Price:** The average entry price of the position.
5) **Position Value:** The value of the position.
6) **Unrealized PnL:** The unrealized profit and loss of the position.
7) **Realized PnL:** The realized profit and loss of the position." - } - }, - "/api/v1/accountActiveOrders": { - "get": { - "summary": "accountActiveOrders", - "operationId": "accountActiveOrders", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Orders" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DetailedAccounts" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/accountActiveOrders": { + "get": { + "summary": "accountActiveOrders", + "operationId": "accountActiveOrders", + "tags": [ + "order" + ], + "description": "Get account active orders. `auth` can be generated using the SDK.", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" + "in": "header", + "required": true, + "schema": { + "type": "string" + } }, { "name": "account_index", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "integer", + "format": "int64" + } }, { "name": "market_id", "in": "query", - "required": true, - "type": "integer", - "format": "int16" + "required": false, + "description": "If not specified, returns active orders for all markets.", + "schema": { + "type": "integer", + "format": "int16", + "default": "255" + } + }, + { + "name": "market_type", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "spot", + "perp" + ], + "default": "all" + } } ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get account active orders. `auth` can be generated using the SDK." - } - }, - "/api/v1/accountInactiveOrders": { - "get": { - "summary": "accountInactiveOrders", - "operationId": "accountInactiveOrders", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Orders" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Orders" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/accountInactiveOrders": { + "get": { + "summary": "accountInactiveOrders", + "operationId": "accountInactiveOrders", + "tags": [ + "order" + ], + "description": "Get account inactive orders. `auth` can be generated using the SDK.", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" + "in": "header", + "required": true, + "schema": { + "type": "string" + } }, { "name": "account_index", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "integer", + "format": "int64" + } }, { "name": "market_id", "in": "query", "required": false, - "type": "integer", - "format": "int16", - "default": "255" + "schema": { + "type": "integer", + "format": "int16", + "default": "255" + } }, { "name": "ask_filter", "in": "query", "required": false, - "type": "integer", - "format": "int8", - "default": "-1" + "schema": { + "type": "integer", + "format": "int8", + "default": "-1" + } }, { "name": "between_timestamps", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "cursor", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "limit", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + }, + { + "name": "market_type", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "spot", + "perp" + ], + "default": "all" + } } ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get account inactive orders" - } - }, - "/api/v1/accountLimits": { - "get": { - "summary": "accountLimits", - "operationId": "accountLimits", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/AccountLimits" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Orders" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/accountLimits": { + "get": { + "summary": "accountLimits", + "operationId": "accountLimits", + "tags": [ + "account" + ], + "description": "Get account limits. For more details on account types, see this page: https://apidocs.lighter.xyz/docs/account-types", "parameters": [ { "name": "account_index", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "integer", + "format": "int64" + } }, { "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" + "in": "header", + "required": true, + "schema": { + "type": "string" + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get account limits" - } - }, - "/api/v1/accountMetadata": { - "get": { - "summary": "accountMetadata", - "operationId": "accountMetadata", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/AccountMetadatas" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountLimits" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/accountMetadata": { + "get": { + "summary": "accountMetadata", + "operationId": "accountMetadata", + "tags": [ + "account" + ], + "description": "Get account metadatas", "parameters": [ { "name": "authorization", "in": "header", "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "by", "in": "query", "required": true, - "type": "string", - "enum": [ - "index", - "l1_address" - ] + "schema": { + "type": "string", + "enum": [ + "index", + "l1_address" + ] + } }, { "name": "value", "in": "query", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { - "name": "auth", + "name": "cursor", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "string" + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get account metadatas" - } - }, - "/api/v1/accountsByL1Address": { - "get": { - "summary": "accountsByL1Address", - "operationId": "accountsByL1Address", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SubAccounts" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountMetadatas" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/accountTxs": { + "get": { + "summary": "accountTxs", + "operationId": "accountTxs", + "tags": [ + "transaction" + ], + "description": "Get transactions of a specific account", "parameters": [ { - "name": "l1_address", + "name": "index", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", "in": "query", "required": true, - "type": "string" + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + }, + { + "name": "by", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "account_index" + ] + } + }, + { + "name": "value", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "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" + } + }, + { + "name": "types", + "in": "query", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get accounts by l1_address returns all accounts associated with the given L1 address" - } - }, - "/api/v1/announcement": { - "get": { - "summary": "announcement", - "operationId": "announcement", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Announcements" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Txs" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, - "tags": [ - "announcement" - ], - "description": "Get announcement" + } } }, - "/api/v1/apikeys": { + "/api/v1/assetDetails": { "get": { - "summary": "apikeys", - "operationId": "apikeys", + "summary": "assetDetails", + "operationId": "assetDetails", + "tags": [ + "order" + ], + "description": "Get asset details for a specific asset or all assets", + "parameters": [ + { + "name": "asset_id", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int16" + } + } + ], "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/AccountApiKeys" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetDetails" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/accountsByL1Address": { + "get": { + "summary": "accountsByL1Address", + "operationId": "accountsByL1Address", + "tags": [ + "account" + ], + "description": "Returns all accounts associated with the given L1 address", "parameters": [ { - "name": "account_index", + "name": "l1_address", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "string" + } }, { - "name": "api_key_index", + "name": "cursor", "in": "query", "required": false, - "type": "integer", - "format": "uint8", - "default": "255" + "schema": { + "type": "string" + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account." + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubAccounts" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } } }, - "/api/v1/assetDetails": { + "/api/v1/announcement": { "get": { - "summary": "assetDetails", - "operationId": "assetDetails", + "summary": "announcement", + "operationId": "announcement", + "tags": [ + "announcement" + ], + "description": "Get announcements", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/AssetDetails" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Announcements" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/apikeys": { + "get": { + "summary": "apikeys", + "operationId": "apikeys", + "tags": [ + "account" + ], + "description": "Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account.", "parameters": [ { - "name": "asset_id", + "name": "account_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "api_key_index", "in": "query", "required": false, - "type": "integer", - "format": "int16", - "default": "0" + "schema": { + "type": "integer", + "format": "uint8", + "default": "255" + } } ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get asset details" - } - }, - "/api/v1/bridges": { - "get": { - "summary": "bridges", - "operationId": "bridges", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespGetBridgesByL1Addr" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountApiKeys" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/block": { + "get": { + "summary": "block", + "operationId": "block", + "tags": [ + "block" + ], + "description": "Get block by its height or commitment", "parameters": [ { - "name": "l1_address", + "name": "by", "in": "query", "required": true, - "type": "string" + "schema": { + "type": "string", + "enum": [ + "commitment", + "height" + ] + } + }, + { + "name": "value", + "in": "query", + "required": true, + "schema": { + "type": "string" + } } ], - "tags": [ - "bridge" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get bridges for given l1 address" - } - }, - "/api/v1/bridges/isNextBridgeFast": { - "get": { - "summary": "bridges_isNextBridgeFast", - "operationId": "bridges_isNextBridgeFast", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespGetIsNextBridgeFast" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Blocks" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/blockTxs": { + "get": { + "summary": "blockTxs", + "operationId": "blockTxs", + "tags": [ + "transaction" + ], + "description": "Get transactions in a block", "parameters": [ { - "name": "l1_address", + "name": "by", "in": "query", "required": true, - "type": "string" + "schema": { + "type": "string", + "enum": [ + "block_height", + "block_commitment" + ] + } + }, + { + "name": "value", + "in": "query", + "required": true, + "schema": { + "type": "string" + } } ], - "tags": [ - "bridge" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get if next bridge is fast" - } - }, - "/api/v1/candles": { - "get": { - "summary": "candles", - "operationId": "candles", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Candles" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Txs" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/blocks": { + "get": { + "summary": "blocks", + "operationId": "blocks", + "tags": [ + "block" + ], + "description": "Get blocks", "parameters": [ { - "name": "market_id", + "name": "index", "in": "query", - "required": true, - "type": "integer", - "format": "int16" + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } }, { - "name": "resolution", + "name": "limit", "in": "query", "required": true, - "type": "string", - "enum": [ - "1m", - "5m", - "15m", - "30m", - "1h", - "4h", - "12h", - "1d", - "1w" - ] + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Blocks" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/candles": { + "get": { + "summary": "candles", + "operationId": "candles", + "tags": [ + "candlestick" + ], + "description": "Get candles data. Returns at most 500 candles per call. Zero values are omitted from the response.", + "parameters": [ + { + "name": "market_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int16" + } + }, + { + "name": "resolution", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "1m", + "5m", + "15m", + "30m", + "1h", + "4h", + "12h", + "1d", + "1w" + ] + } }, { "name": "start_timestamp", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 0, - "maximum": 5000000000000 + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 + } }, { "name": "end_timestamp", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 0, - "maximum": 5000000000000 + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 + } }, { "name": "count_back", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "integer", + "format": "int64" + } }, { "name": "set_timestamp_to_end", "in": "query", "required": false, - "type": "boolean", - "format": "boolean", - "default": "false" + "schema": { + "type": "boolean", + "format": "boolean", + "default": "false" + } } ], - "tags": [ - "candlestick" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get candles (optimized with shortened fields and smaller response size)" - } - }, - "/api/v1/changeAccountTier": { - "post": { - "summary": "changeAccountTier", - "operationId": "changeAccountTier", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespChangeAccountTier" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Candles" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/changeAccountTier": { + "post": { + "summary": "changeAccountTier", + "operationId": "changeAccountTier", + "tags": [ + "account" + ], + "description": "Change account tier. You can only perform this action once every 24 hours, and with no orders or positions open.", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", "in": "header", "required": false, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, + "description": " make required after integ is done", "schema": { - "$ref": "#/definitions/ReqChangeAccountTier" + "type": "string" } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Change account tier" + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqChangeAccountTier" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespChangeAccountTier" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } } }, - "/api/v1/deposit/history": { + "/api/v1/currentHeight": { "get": { - "summary": "deposit_history", - "operationId": "deposit_history", + "summary": "currentHeight", + "operationId": "currentHeight", + "tags": [ + "block" + ], + "description": "Get current height", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/DepositHistory" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CurrentHeight" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/deposit/history": { + "get": { + "summary": "deposit_history", + "operationId": "deposit_history", + "tags": [ + "transaction" + ], + "description": "Get deposit history", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" + "in": "header", + "required": true, + "schema": { + "type": "string" + } }, { "name": "account_index", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "integer", + "format": "int64" + } }, { "name": "l1_address", "in": "query", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "cursor", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "filter", "in": "query", "required": false, - "type": "string", - "enum": [ - "all", - "pending", - "claimable" - ] + "schema": { + "type": "string", + "enum": [ + "all", + "pending", + "claimable" + ] + } } ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get deposit history" - } - }, - "/api/v1/exchangeMetrics": { - "get": { - "summary": "exchangeMetrics", - "operationId": "exchangeMetrics", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespGetExchangeMetrics" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DepositHistory" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, - "parameters": [ - { - "name": "period", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "h", - "d", - "w", - "m", - "q", - "y", - "all" - ] - }, - { - "name": "kind", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "volume", - "maker_fee", - "taker_fee", - "liquidation_fee", - "trade_count", - "liquidation_count", - "liquidation_volume", - "inflow", - "outflow", - "transfer_fee", - "withdraw_fee", - "open_interest", - "account_count", - "active_account_count", - "tps" - ] - }, - { - "name": "filter", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "byMarket" - ] - }, - { - "name": "value", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get exchange metrics" + } } }, "/api/v1/exchangeStats": { "get": { "summary": "exchangeStats", "operationId": "exchangeStats", + "tags": [ + "order" + ], + "description": "Get exchange stats", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ExchangeStats" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExchangeStats" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, - "tags": [ - "order" - ], - "description": "Get exchange stats" + } } }, - "/api/v1/executeStats": { + "/api/v1/export": { "get": { - "summary": "executeStats", - "operationId": "executeStats", - "responses": { - "200": { - "description": "A successful response.", + "summary": "export", + "operationId": "export", + "tags": [ + "order" + ], + "description": "Export trades and funding payments, limited to 12 months or 1M trades. END_TS_IN_MS - START_TS_IN_MS should not be larger than 12 months in milliseconds, both timestamps should be greater than or equal to 17 January 2025 00:00:00 UTC (lighter's mainnet genesis)", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, "schema": { - "$ref": "#/definitions/RespGetExecuteStats" + "type": "string" } }, - "400": { - "description": "Bad request", + { + "name": "account_index", + "in": "query", + "required": false, "schema": { - "$ref": "#/definitions/ResultCode" + "type": "integer", + "format": "int64", + "default": "-1" } - } - }, - "parameters": [ + }, { - "name": "period", + "name": "market_id", "in": "query", - "required": true, - "type": "string", - "enum": [ - "d", - "w", - "m", - "q", - "y", - "all" - ] - } - ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get execute stats" - } - }, - "/api/v1/export": { - "get": { - "summary": "export", - "operationId": "export", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ExportData" - } - }, - "400": { - "description": "Bad request", + "required": false, "schema": { - "$ref": "#/definitions/ResultCode" + "type": "integer", + "format": "int16", + "default": "255" } - } - }, - "parameters": [ - { - "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "account_index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64", - "default": "-1" - }, - { - "name": "market_id", - "in": "query", - "required": false, - "type": "integer", - "format": "int16", - "default": "255" }, { "name": "type", "in": "query", "required": true, - "type": "string", - "enum": [ - "funding", - "trade" - ] + "schema": { + "type": "string", + "enum": [ + "funding", + "trade" + ] + } }, { "name": "start_timestamp", "in": "query", "required": false, - "type": "integer", - "format": "int64", - "minimum": 1735689600000, - "maximum": 1830297600000 + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1735689600000, + "maximum": 1830297600000 + } }, { "name": "end_timestamp", "in": "query", "required": false, - "type": "integer", - "format": "int64", - "minimum": 1735689600000, - "maximum": 1830297600000 + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1735689600000, + "maximum": 1830297600000 + } }, { "name": "side", "in": "query", "required": false, - "type": "string", - "enum": [ - "all", - "long", - "short" - ], - "default": "all" + "schema": { + "type": "string", + "enum": [ + "all", + "long", + "short" + ], + "default": "all" + } }, { "name": "role", "in": "query", "required": false, - "type": "string", - "enum": [ - "all", - "maker", - "taker" - ], - "default": "all" + "schema": { + "type": "string", + "enum": [ + "all", + "maker", + "taker" + ], + "default": "all" + } }, { "name": "trade_type", "in": "query", "required": false, - "type": "string", - "enum": [ - "all", - "trade", - "liquidation", - "deleverage", - "market-settlement" - ], - "default": "all" + "schema": { + "type": "string", + "enum": [ + "all", + "trade", + "liquidation", + "deleverage", + "market-settlement" + ], + "default": "all" + } } ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Export data" - } - }, - "/api/v1/fastbridge/info": { - "get": { - "summary": "fastbridge_info", - "operationId": "fastbridge_info", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespGetFastBridgeInfo" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExportData" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/fastbridge/info": { + "get": { + "summary": "fastbridge_info", + "operationId": "fastbridge_info", "tags": [ "bridge" ], - "description": "Get fast bridge info" - } - }, - "/api/v1/fastwithdraw": { - "post": { - "summary": "fastwithdraw", - "operationId": "fastwithdraw", + "description": "Get fast bridge info", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespGetFastBridgeInfo" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "authorization", - "description": " make required after integ is done", - "in": "header", - "required": false, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ReqFastwithdraw" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - ], - "tags": [ - "bridge" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Fast withdraw" + } } }, - "/api/v1/fastwithdraw/info": { + "/api/v1/funding-rates": { "get": { - "summary": "fastwithdraw_info", - "operationId": "fastwithdraw_info", + "summary": "funding-rates", + "operationId": "funding-rates", + "tags": [ + "funding" + ], + "description": "Get funding rates", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespGetFastwithdrawalInfo" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FundingRates" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/fundings": { + "get": { + "summary": "fundings", + "operationId": "fundings", + "tags": [ + "candlestick" + ], + "description": "Get fundings", "parameters": [ { - "name": "authorization", - "description": " make required after integ is done", + "name": "market_id", "in": "query", - "required": false, - "type": "string" + "required": true, + "schema": { + "type": "integer", + "format": "int16" + } }, { - "name": "auth", - "description": " made optional to support header auth clients", + "name": "resolution", "in": "query", - "required": false, - "type": "string" + "required": true, + "schema": { + "type": "string", + "enum": [ + "1h", + "1d" + ] + } }, { - "name": "account_index", + "name": "start_timestamp", "in": "query", "required": true, - "type": "integer", - "format": "int64" - } - ], - "tags": [ - "bridge" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get fast withdraw info" - } - }, - "/api/v1/faucet": { - "get": { - "summary": "faucet", - "operationId": "faucet", - "responses": { - "200": { - "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResultCode" + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 } }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ { - "name": "l1_address", + "name": "end_timestamp", "in": "query", "required": true, - "type": "string" + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 + } }, { - "name": "do_l1_transfer", + "name": "count_back", "in": "query", "required": true, - "type": "boolean", - "format": "boolean", - "default": "false" + "schema": { + "type": "integer", + "format": "int64" + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Request funds from faucet" - } - }, - "/api/v1/funding-rates": { - "get": { - "summary": "funding-rates", - "operationId": "funding-rates", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/FundingRates" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Fundings" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, - "tags": [ - "funding" - ], - "description": "Get funding rates" + } } }, - "/api/v1/fundings": { + "/api/v1/l1Metadata": { "get": { - "summary": "fundings", - "operationId": "fundings", + "summary": "l1Metadata", + "operationId": "l1Metadata", + "tags": [ + "account" + ], + "description": "Get L1 metadata", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "l1_address", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Fundings" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/L1Metadata" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/liquidations": { + "get": { + "summary": "liquidations", + "operationId": "liquidations", + "tags": [ + "account" + ], + "description": "Get liquidation infos", "parameters": [ { - "name": "market_id", - "in": "query", + "name": "authorization", + "in": "header", "required": true, - "type": "integer", - "format": "int16" + "schema": { + "type": "string" + } }, { - "name": "resolution", + "name": "account_index", "in": "query", "required": true, - "type": "string", - "enum": [ - "1h", - "1d" - ] + "schema": { + "type": "integer", + "format": "int64" + } }, { - "name": "start_timestamp", + "name": "market_id", "in": "query", - "required": true, - "type": "integer", - "format": "int64", - "minimum": 0, - "maximum": 5000000000000 + "required": false, + "schema": { + "type": "integer", + "format": "int16", + "default": "255" + } }, { - "name": "end_timestamp", + "name": "cursor", "in": "query", - "required": true, - "type": "integer", - "format": "int64", - "minimum": 0, - "maximum": 5000000000000 + "required": false, + "schema": { + "type": "string" + } }, { - "name": "count_back", + "name": "limit", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } } ], - "tags": [ - "candlestick" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get fundings" - } - }, - "/api/v1/l1Metadata": { - "get": { - "summary": "l1Metadata", - "operationId": "l1Metadata", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/L1Metadata" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiquidationInfos" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/nextNonce": { + "get": { + "summary": "nextNonce", + "operationId": "nextNonce", + "tags": [ + "transaction" + ], + "description": "Get next nonce for a specific account and api key", "parameters": [ { - "name": "authorization", - "description": " make required after integ is done", - "in": "header", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", + "name": "account_index", "in": "query", - "required": false, - "type": "string" + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } }, { - "name": "l1_address", + "name": "api_key_index", "in": "query", "required": true, - "type": "string" + "schema": { + "type": "integer", + "format": "uint8" + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get L1 metadata" - } - }, - "/api/v1/leaseOptions": { - "get": { - "summary": "leaseOptions", - "operationId": "leaseOptions", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespGetLeaseOptions" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NextNonce" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, - "tags": [ - "account" - ], - "description": "Get lease options" + } } }, - "/api/v1/leases": { - "get": { - "summary": "leases", - "operationId": "leases", + "/api/v1/notification/ack": { + "post": { + "summary": "notification_ack", + "operationId": "notification_ack", + "tags": [ + "notification" + ], + "description": "Ack notification", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "description": " make required after integ is done", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqAckNotif" + } + } + } + }, "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespGetLeases" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/orderBookDetails": { + "get": { + "summary": "orderBookDetails", + "operationId": "orderBookDetails", + "tags": [ + "order" + ], + "description": "Get order books metadata", "parameters": [ { - "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "account_index", - "in": "query", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cursor", + "name": "market_id", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "integer", + "format": "int16", + "default": "255" + } }, { - "name": "limit", + "name": "filter", "in": "query", "required": false, - "type": "integer", - "format": "int64", - "default": "20" + "schema": { + "type": "string", + "enum": [ + "all", + "spot", + "perp" + ], + "default": "all" + }, + "description": "Filter order books by type" } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get leases" - } - }, - "/api/v1/liquidations": { - "get": { - "summary": "liquidations", - "operationId": "liquidations", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/LiquidationInfos" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrderBookDetails" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/orderBookOrders": { + "get": { + "summary": "orderBookOrders", + "operationId": "orderBookOrders", + "tags": [ + "order" + ], + "description": "Get order book orders", "parameters": [ - { - "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "account_index", - "in": "query", - "required": true, - "type": "integer", - "format": "int64" - }, { "name": "market_id", "in": "query", - "required": false, - "type": "integer", - "format": "int16", - "default": "255" - }, - { - "name": "cursor", - "in": "query", - "required": false, - "type": "string" + "required": true, + "schema": { + "type": "integer", + "format": "int16" + } }, { "name": "limit", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 250 + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get liquidation infos" - } - }, - "/api/v1/litLease": { - "post": { - "summary": "litLease", - "operationId": "litLease", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/TxHash" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrderBookOrders" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, - "parameters": [ - { - "name": "authorization", - "in": "header", - "required": false, - "type": "string" + } + } + }, + "/api/v1/orderBooks": { + "get": { + "summary": "orderBooks", + "operationId": "orderBooks", + "tags": [ + "order" + ], + "description": "Get order books metadata.
**Response Description:**

1) **Taker and maker fees** are in percentage.
2) **Min base amount:** The amount of base token that can be traded in a single order.
3) **Min quote amount:** The amount of quote token that can be traded in a single order.
4) **Supported size decimals:** The number of decimal places that can be used for the size of the order.
5) **Supported price decimals:** The number of decimal places that can be used for the price of the order.
6) **Supported quote decimals:** Size Decimals + Quote Decimals.", + "parameters": [ + { + "name": "market_id", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int16", + "default": "255" + } }, { - "name": "body", - "in": "body", - "required": true, + "name": "filter", + "in": "query", + "required": false, "schema": { - "$ref": "#/definitions/ReqLITLease" + "type": "string", + "enum": [ + "all", + "spot", + "perp" + ], + "default": "all" } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Submit LIT lease transfer" - } - }, - "/api/v1/nextNonce": { - "get": { - "summary": "nextNonce", - "operationId": "nextNonce", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/NextNonce" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrderBooks" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/pnl": { + "get": { + "summary": "pnl", + "operationId": "pnl", + "tags": [ + "account" + ], + "description": "Get account PnL chart", "parameters": [ { - "name": "account_index", + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "by", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "string", + "enum": [ + "index" + ] + } }, { - "name": "api_key_index", + "name": "value", "in": "query", "required": true, - "type": "integer", - "format": "uint8" - } - ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get next nonce for a specific account and api key" - } - }, - "/api/v1/notification/ack": { - "post": { - "summary": "notification_ack", - "operationId": "notification_ack", - "responses": { - "200": { - "description": "A successful response.", "schema": { - "$ref": "#/definitions/ResultCode" + "type": "string" } }, - "400": { - "description": "Bad request", + { + "name": "resolution", + "in": "query", + "required": true, "schema": { - "$ref": "#/definitions/ResultCode" + "type": "string", + "enum": [ + "1m", + "5m", + "15m", + "1h", + "4h", + "1d" + ] } - } - }, - "parameters": [ + }, { - "name": "authorization", - "description": " make required after integ is done", - "in": "header", - "required": false, - "type": "string" + "name": "start_timestamp", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 + } }, { - "name": "body", - "in": "body", + "name": "end_timestamp", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 + } + }, + { + "name": "count_back", + "in": "query", "required": true, "schema": { - "$ref": "#/definitions/ReqAckNotif" + "type": "integer", + "format": "int64" + } + }, + { + "name": "ignore_transfers", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "format": "boolean", + "default": "false" } } ], - "tags": [ - "notification" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Ack notification" - } - }, - "/api/v1/orderBookDetails": { - "get": { - "summary": "orderBookDetails", - "operationId": "orderBookDetails", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/OrderBookDetails" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccountPnL" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/positionFunding": { + "get": { + "summary": "positionFunding", + "operationId": "positionFunding", + "tags": [ + "account" + ], + "description": "Get accounts position fundings", "parameters": [ { - "name": "market_id", - "in": "query", + "name": "authorization", + "in": "header", "required": false, - "type": "integer", - "format": "int16", - "default": "255" + "schema": { + "type": "string" + } }, { - "name": "filter", + "name": "account_index", "in": "query", - "required": false, - "type": "string", - "enum": [ - "all", - "spot", - "perp" - ], - "default": "all" - } - ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get order books metadata" - } - }, - "/api/v1/orderBookOrders": { - "get": { - "summary": "orderBookOrders", - "operationId": "orderBookOrders", - "responses": { - "200": { - "description": "A successful response.", + "required": true, "schema": { - "$ref": "#/definitions/OrderBookOrders" + "type": "integer", + "format": "int64" } }, - "400": { - "description": "Bad request", + { + "name": "market_id", + "in": "query", + "required": false, "schema": { - "$ref": "#/definitions/ResultCode" + "type": "integer", + "format": "int16", + "default": "255" } - } - }, - "parameters": [ + }, { - "name": "market_id", + "name": "cursor", "in": "query", - "required": true, - "type": "integer", - "format": "int16" + "required": false, + "schema": { + "type": "string" + } }, { "name": "limit", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 250 - } - ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get order book orders" - } - }, - "/api/v1/orderBooks": { - "get": { - "summary": "orderBooks", - "operationId": "orderBooks", - "responses": { - "200": { - "description": "A successful response.", "schema": { - "$ref": "#/definitions/OrderBooks" + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 } }, - "400": { - "description": "Bad request", + { + "name": "side", + "in": "query", + "required": false, "schema": { - "$ref": "#/definitions/ResultCode" + "type": "string", + "enum": [ + "long", + "short", + "all" + ], + "default": "all" } - } - }, - "parameters": [ + }, { - "name": "market_id", + "name": "start_timestamp", "in": "query", "required": false, - "type": "integer", - "format": "int16", - "default": "255" + "schema": { + "type": "integer", + "format": "int64" + } }, { - "name": "filter", + "name": "end_timestamp", "in": "query", "required": false, - "type": "string", - "enum": [ - "all", - "spot", - "perp" - ], - "default": "all" + "schema": { + "type": "integer", + "format": "int64" + } } ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get order books metadata.
**Response Description:**

1) **Taker and maker fees** are in percentage.
2) **Min base amount:** The amount of base token that can be traded in a single order.
3) **Min quote amount:** The amount of quote token that can be traded in a single order.
4) **Supported size decimals:** The number of decimal places that can be used for the size of the order.
5) **Supported price decimals:** The number of decimal places that can be used for the price of the order.
6) **Supported quote decimals:** Size Decimals + Quote Decimals." - } - }, - "/api/v1/pnl": { - "get": { - "summary": "pnl", - "operationId": "pnl", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/AccountPnL" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PositionFundings" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/publicPoolsMetadata": { + "get": { + "summary": "publicPoolsMetadata", + "operationId": "publicPoolsMetadata", + "tags": [ + "account" + ], + "description": "Get public pools metadata. `auth` is required in case you specify an account_index. You will see public pools with an index that starts an n-1 of the one you specify. To see staking pools, use `filter=stake`", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", - "in": "query", + "in": "header", "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { - "name": "auth", - "description": " made optional to support header auth clients", + "name": "filter", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "string", + "enum": [ + "all", + "user", + "protocol", + "account_index", + "stake" + ] + } }, { - "name": "by", + "name": "index", "in": "query", "required": true, - "type": "string", - "enum": [ - "index" - ] + "schema": { + "type": "integer", + "format": "int64" + } }, { - "name": "value", + "name": "limit", "in": "query", "required": true, - "type": "string" + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } }, { - "name": "resolution", + "name": "account_index", "in": "query", - "required": true, - "type": "string", - "enum": [ - "1m", - "5m", - "15m", - "1h", - "4h", - "1d" - ] + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespPublicPoolsMetadata" + } + } + } }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/recentTrades": { + "get": { + "summary": "recentTrades", + "operationId": "recentTrades", + "tags": [ + "order" + ], + "description": "Get recent trades", + "parameters": [ { - "name": "start_timestamp", + "name": "market_id", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 0, - "maximum": 5000000000000 + "schema": { + "type": "integer", + "format": "int16" + } }, { - "name": "end_timestamp", + "name": "limit", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 0, - "maximum": 5000000000000 + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Trades" + } + } + } }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/referral/points": { + "get": { + "summary": "referral_points", + "operationId": "referral_points", + "tags": [ + "referral" + ], + "description": "Get referral points", + "parameters": [ { - "name": "count_back", - "in": "query", + "name": "authorization", + "in": "header", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "string" + } }, { - "name": "ignore_transfers", + "name": "account_index", "in": "query", - "required": false, - "type": "boolean", - "format": "boolean", - "default": "false" + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } } ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReferralPoints" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/sendTx": { + "post": { + "summary": "sendTx", + "operationId": "sendTx", "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" + "transaction" ], - "description": "Get account PnL chart" + "description": "You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqSendTx" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespSendTx" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } } }, - "/api/v1/positionFunding": { - "get": { - "summary": "positionFunding", - "operationId": "positionFunding", + "/api/v1/sendTxBatch": { + "post": { + "summary": "sendTxBatch", + "operationId": "sendTxBatch", + "tags": [ + "transaction" + ], + "description": "You need to sign the transaction body before sending it to the server. More details can be found here: https://apidocs.lighter.xyz/docs/get-started", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqSendTxBatch" + } + } + } + }, "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/PositionFundings" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespSendTxBatch" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/trades": { + "get": { + "summary": "trades", + "operationId": "trades", + "tags": [ + "order" + ], + "description": "Get trades for lighter accounts, including sub-accounts and public pools. `auth` is required for master accounts and sub accounts.", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", - "in": "query", + "in": "header", "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { - "name": "auth", - "description": " made optional to support header auth clients", + "name": "market_id", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "integer", + "format": "int16", + "default": "255" + } }, { - "name": "account_index", + "name": "market_type", "in": "query", - "required": true, - "type": "integer", - "format": "int64" + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "spot", + "perp" + ], + "default": "all" + } }, { - "name": "market_id", + "name": "account_index", "in": "query", "required": false, - "type": "integer", - "format": "int16", - "default": "255" + "schema": { + "type": "integer", + "format": "int64", + "default": "-1" + } }, { - "name": "cursor", + "name": "order_index", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "integer", + "format": "int64" + } }, { - "name": "limit", + "name": "sort_by", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 + "schema": { + "type": "string", + "enum": [ + "block_height", + "timestamp", + "trade_id" + ] + } }, { - "name": "side", + "name": "sort_dir", "in": "query", "required": false, - "type": "string", - "enum": [ - "long", - "short", - "all" - ], - "default": "all" - } - ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get accounts position fundings" - } - }, - "/api/v1/publicPoolsMetadata": { - "get": { - "summary": "publicPoolsMetadata", - "operationId": "publicPoolsMetadata", - "responses": { - "200": { - "description": "A successful response.", "schema": { - "$ref": "#/definitions/RespPublicPoolsMetadata" + "type": "string", + "enum": [ + "desc" + ], + "default": "desc" } }, - "400": { - "description": "Bad request", + { + "name": "cursor", + "in": "query", + "required": false, "schema": { - "$ref": "#/definitions/ResultCode" + "type": "string" } - } - }, - "parameters": [ + }, { - "name": "authorization", - "description": " make required after integ is done", + "name": "from", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "integer", + "format": "int64", + "default": "-1" + } }, { - "name": "auth", - "description": " made optional to support header auth clients", + "name": "ask_filter", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "integer", + "format": "int8", + "default": "-1" + } }, { - "name": "filter", + "name": "role", "in": "query", "required": false, - "type": "string", - "enum": [ - "all", - "user", - "protocol", - "account_index", - "stake" - ] + "schema": { + "type": "string", + "enum": [ + "all", + "maker", + "taker" + ], + "default": "all" + } }, { - "name": "index", + "name": "type", "in": "query", - "required": true, - "type": "integer", - "format": "int64" + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "trade", + "liquidation", + "deleverage", + "market-settlement" + ], + "default": "all" + } }, { "name": "limit", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } }, { - "name": "account_index", + "name": "aggregate", "in": "query", "required": false, - "type": "integer", - "format": "int64" + "schema": { + "type": "boolean", + "format": "boolean", + "default": "false" + } + }, + { + "name": "skip_ask_order_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "skip_bid_order_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get public pools metadata" - } - }, - "/api/v1/pushnotif/register": { - "post": { - "summary": "pushnotif_register", - "operationId": "pushnotif_register", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Trades" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/transfer/history": { + "get": { + "summary": "transfer_history", + "operationId": "transfer_history", + "tags": [ + "transaction" + ], + "description": "Get transfer history. To fetch an account index, you will need to `auth` the request, unless it's a public pool.", "parameters": [ { - "name": "body", - "in": "body", + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "account_index", + "in": "query", "required": true, "schema": { - "$ref": "#/definitions/ReqRegisterPushNotifToken" + "type": "integer", + "format": "int64" + } + }, + { + "name": "cursor", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "type", + "in": "query", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "all", + "L2Transfer", + "L2MintShares", + "L2BurnShares", + "L2StakeAssets", + "L2UnstakeAssets" + ] + } } } ], - "tags": [ - "pushnotif" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Register device for push notifications" - } - }, - "/api/v1/pushnotif/settings": { - "get": { - "summary": "get_pushnotif_settings", - "operationId": "get_pushnotif_settings", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespGetPushNotifSettings" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferHistory" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/transferFeeInfo": { + "get": { + "summary": "transferFeeInfo", + "operationId": "transferFeeInfo", + "tags": [ + "info" + ], + "description": "Transfer fee info", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" + "in": "header", + "required": true, + "schema": { + "type": "string" + } }, { "name": "account_index", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "integer", + "format": "int64" + } }, { - "name": "expo_token", + "name": "to_account_index", "in": "query", - "required": true, - "type": "string" + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": "-1" + } } ], - "tags": [ - "pushnotif" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get push notification settings" - }, - "post": { - "summary": "post_pushnotif_settings", - "operationId": "post_pushnotif_settings", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferFeeInfo" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/tx": { + "get": { + "summary": "tx", + "operationId": "tx", + "tags": [ + "transaction" + ], + "description": "Get transaction by hash or sequence index", "parameters": [ { - "name": "body", - "in": "body", + "name": "by", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "hash", + "sequence_index" + ] + } + }, + { + "name": "value", + "in": "query", "required": true, "schema": { - "$ref": "#/definitions/ReqUpdatePushNotifSettings" + "type": "string" } } ], - "tags": [ - "pushnotif" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Update push notification settings" - } - }, - "/api/v1/pushnotif/unregister": { - "post": { - "summary": "pushnotif_unregister", - "operationId": "pushnotif_unregister", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnrichedTx" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/txFromL1TxHash": { + "get": { + "summary": "txFromL1TxHash", + "operationId": "txFromL1TxHash", + "tags": [ + "transaction" + ], + "description": "Get L1 transaction by L1 transaction hash", "parameters": [ { - "name": "body", - "in": "body", + "name": "hash", + "in": "query", "required": true, "schema": { - "$ref": "#/definitions/ReqUnregisterPushNotifToken" + "type": "string" } } ], - "tags": [ - "pushnotif" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Unregister device from push notifications" - } - }, - "/api/v1/recentTrades": { - "get": { - "summary": "recentTrades", - "operationId": "recentTrades", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Trades" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnrichedTx" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/txs": { + "get": { + "summary": "txs", + "operationId": "txs", + "tags": [ + "transaction" + ], + "description": "Get transactions which are already packed into blocks", "parameters": [ { - "name": "market_id", + "name": "index", "in": "query", - "required": true, - "type": "integer", - "format": "int16" + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } }, { "name": "limit", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } } ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get recent trades" - } - }, - "/api/v1/referral/userReferrals": { - "get": { - "summary": "referral_userReferrals", - "operationId": "referral_userReferrals", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/UserReferrals" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Txs" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/withdraw/history": { + "get": { + "summary": "withdraw_history", + "operationId": "withdraw_history", + "tags": [ + "transaction" + ], + "description": "Get withdraw history. Secure withdrawals are only set to `claimable` when ready. You should only expect the `completed` status on fast withdrawals via Arbitrum.", "parameters": [ { "name": "authorization", "in": "header", - "required": false, - "type": "string" + "required": true, + "schema": { + "type": "string" + } }, { - "name": "auth", + "name": "account_index", "in": "query", - "required": false, - "type": "string" + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } }, { - "name": "l1_address", + "name": "cursor", "in": "query", - "required": true, - "type": "string" + "required": false, + "schema": { + "type": "string" + } }, { - "name": "cursor", + "name": "filter", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "string", + "enum": [ + "all", + "pending", + "claimable" + ] + } } ], - "tags": [ - "referral" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get user referrals" - } - }, - "/api/v1/sendTx": { - "post": { - "summary": "sendTx", - "operationId": "sendTx", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespSendTx" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WithdrawHistory" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ReqSendTx" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)" + } } }, - "/api/v1/sendTxBatch": { - "post": { - "summary": "sendTxBatch", - "operationId": "sendTxBatch", + "/api/v1/withdrawalDelay": { + "get": { + "summary": "withdrawalDelay", + "operationId": "withdrawalDelay", + "tags": [ + "info" + ], + "description": "Withdrawal delay in seconds", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespSendTxBatch" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespWithdrawalDelay" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ReqSendTxBatch" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)" + } } }, - "/api/v1/systemConfig": { + "/info": { "get": { - "summary": "systemConfig", - "operationId": "systemConfig", + "summary": "info", + "operationId": "info", + "tags": [ + "root" + ], + "description": "Get info of zklighter", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SystemConfig" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ZkLighterInfo" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, - "tags": [ - "info" - ], - "description": "Get system configuration including pool indexes and lockup/cooldown periods" + } } }, - "/api/v1/tokens": { - "get": { - "summary": "tokens", - "operationId": "tokens", + "/api/v1/fastwithdraw": { + "post": { + "summary": "fastwithdraw", + "operationId": "fastwithdraw", + "tags": [ + "bridge" + ], + "description": "Fast withdraw", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "description": " make required after integ is done", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqFastwithdraw" + } + } + } + }, "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespGetApiTokens" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/fastwithdraw/info": { + "get": { + "summary": "fastwithdraw_info", + "operationId": "fastwithdraw_info", + "tags": [ + "bridge" + ], + "description": "Get fast withdraw info", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", "in": "header", - "required": false, - "type": "string" + "required": true, + "schema": { + "type": "string" + } }, { "name": "account_index", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "integer", + "format": "int64" + } } ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get api tokens of an account" - } - }, - "/api/v1/tokens/create": { - "post": { - "summary": "tokens_create", - "operationId": "tokens_create", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespPostApiToken" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespGetFastwithdrawalInfo" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/tokens": { + "get": { + "summary": "tokens", + "operationId": "tokens", + "tags": [ + "account" + ], + "description": "Get read only auth tokens for an account", "parameters": [ { "name": "authorization", "in": "header", "required": false, - "type": "string" + "description": " make required after integ is done", + "schema": { + "type": "string" + } }, { - "name": "body", - "in": "body", + "name": "account_index", + "in": "query", "required": true, "schema": { - "$ref": "#/definitions/ReqPostApiToken" + "type": "integer", + "format": "int64" } } ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespGetApiTokens" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/tokens/create": { + "post": { + "summary": "tokens_create", + "operationId": "tokens_create", "tags": [ "account" ], - "consumes": [ - "multipart/form-data" + "description": "Create an API token for read-only access", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } ], - "description": "Create api token" - } - }, - "/api/v1/tokens/revoke": { - "post": { - "summary": "tokens_revoke", - "operationId": "tokens_revoke", + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqPostApiToken" + } + } + } + }, "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespRevokeApiToken" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespPostApiToken" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/tokens/revoke": { + "post": { + "summary": "tokens_revoke", + "operationId": "tokens_revoke", + "tags": [ + "account" + ], + "description": "Revoke read only auth token for an account", "parameters": [ { "name": "authorization", "in": "header", "required": false, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, "schema": { - "$ref": "#/definitions/ReqRevokeApiToken" + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqRevokeApiToken" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespRevokeApiToken" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/createIntentAddress": { + "post": { + "summary": "createIntentAddress", + "operationId": "createIntentAddress", "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" + "bridge" ], - "description": "Revoke api token" + "description": "Create a bridge intent address for CCTP bridge", + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqCreateIntentAddress" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateIntentAddressResp" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } } }, - "/api/v1/trades": { + "/api/v1/deposit/networks": { "get": { - "summary": "trades", - "operationId": "trades", + "summary": "deposit_networks", + "operationId": "deposit_networks", + "tags": [ + "bridge" + ], + "description": "Get networks that support deposits via intent address", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Trades" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BridgeSupportedNetworks" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/exchangeMetrics": { + "get": { + "summary": "exchangeMetrics", + "operationId": "exchangeMetrics", + "tags": [ + "order" + ], + "description": "Get exchange metrics. When filtering by market, use the market symbol as a value.", "parameters": [ { - "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", + "name": "period", "in": "query", - "required": false, - "type": "string" + "required": true, + "schema": { + "type": "string", + "enum": [ + "h", + "d", + "w", + "m", + "q", + "y", + "all" + ] + } }, { - "name": "market_id", + "name": "kind", "in": "query", - "required": false, - "type": "integer", - "format": "int16", - "default": "255" + "required": true, + "schema": { + "type": "string", + "enum": [ + "volume", + "maker_fee", + "taker_fee", + "liquidation_fee", + "trade_count", + "liquidation_count", + "liquidation_volume", + "inflow", + "outflow", + "transfer_fee", + "withdraw_fee", + "open_interest", + "account_count", + "active_account_count", + "tps", + "buyback", + "buyback_usdc" + ] + } }, { - "name": "account_index", + "name": "filter", "in": "query", "required": false, - "type": "integer", - "format": "int64", - "default": "-1" + "schema": { + "type": "string", + "enum": [ + "byMarket" + ] + } }, { - "name": "order_index", + "name": "value", "in": "query", "required": false, - "type": "integer", - "format": "int64" + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespGetExchangeMetrics" + } + } + } }, - { - "name": "sort_by", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "block_height", - "timestamp", - "trade_id" - ] - }, - { - "name": "sort_dir", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "desc" - ], - "default": "desc" - }, - { - "name": "cursor", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "from", - "in": "query", - "required": false, - "type": "integer", - "format": "int64", - "default": "-1" - }, - { - "name": "ask_filter", - "in": "query", - "required": false, - "type": "integer", - "format": "int8", - "default": "-1" - }, - { - "name": "role", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "all", - "maker", - "taker" - ], - "default": "all" - }, - { - "name": "type", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "all", - "trade", - "liquidation", - "deleverage", - "market-settlement" - ], - "default": "all" - }, - { - "name": "limit", - "in": "query", - "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 - }, - { - "name": "aggregate", - "in": "query", - "required": false, - "type": "boolean", - "format": "boolean", - "default": "false" + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } } - ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get trades" + } } }, - "/api/v1/transfer/history": { + "/api/v1/layer1BasicInfo": { "get": { - "summary": "transfer_history", - "operationId": "transfer_history", + "summary": "layer1BasicInfo", + "operationId": "layer1BasicInfo", + "tags": [ + "info" + ], + "description": "Get zklighter l1 general info, including contract address and rpc info", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/TransferHistory" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Layer1BasicInfo" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/referral/create": { + "post": { + "summary": "referral_create", + "operationId": "referral_create", + "tags": [ + "referral" + ], + "description": "Create referral code", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "auth", - "description": " made optional to support header auth clients", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "account_index", - "in": "query", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "cursor", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "type", - "in": "query", + "in": "header", "required": false, - "type": "string", - "enum": [ - "all", - "L2Transfer", - "L2MintShares", - "L2BurnShares", - "L2StakeAssets", - "L2UnstakeAssets" - ] + "description": " make required after integ is done", + "schema": { + "type": "string" + } } ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get transfer history" - } - }, - "/api/v1/transferFeeInfo": { - "get": { - "summary": "transferFeeInfo", - "operationId": "transferFeeInfo", + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqCreateReferralCode" + } + } + } + }, "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/TransferFeeInfo" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReferralCode" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/referral/get": { + "get": { + "summary": "referral_get", + "operationId": "referral_get", + "tags": [ + "referral" + ], + "description": "Get referral code", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", "in": "query", "required": false, - "type": "string" + "description": " make required after integ is done", + "schema": { + "type": "string" + } }, { "name": "auth", - "description": " made optional to support header auth clients", "in": "query", "required": false, - "type": "string" + "description": " made optional to support header auth clients", + "schema": { + "type": "string" + } }, { "name": "account_index", "in": "query", "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "to_account_index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64", - "default": "-1" + "schema": { + "type": "integer", + "format": "int64" + } } ], - "tags": [ - "info" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Transfer fee info" - } - }, - "/api/v1/tx": { - "get": { - "summary": "tx", - "operationId": "tx", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/EnrichedTx" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReferralCode" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/referral/kickback/update": { + "post": { + "summary": "referral_kickback_update", + "operationId": "referral_kickback_update", + "tags": [ + "referral" + ], + "description": "Update kickback percentage for referral rewards (allowed once per day)", "parameters": [ { - "name": "by", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "hash", - "sequence_index" - ] - }, - { - "name": "value", - "in": "query", - "required": true, - "type": "string" + "name": "authorization", + "in": "header", + "required": false, + "description": " make required after integ is done", + "schema": { + "type": "string" + } } ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get transaction by hash or sequence index" - } - }, - "/api/v1/txFromL1TxHash": { - "get": { - "summary": "txFromL1TxHash", - "operationId": "txFromL1TxHash", + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqUpdateKickback" + } + } + } + }, "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/EnrichedTx" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespUpdateKickback" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/referral/update": { + "post": { + "summary": "referral_update", + "operationId": "referral_update", + "tags": [ + "referral" + ], + "description": "Update referral code (allowed once per account)", "parameters": [ { - "name": "hash", - "in": "query", - "required": true, - "type": "string" + "name": "authorization", + "in": "header", + "required": false, + "description": " make required after integ is done", + "schema": { + "type": "string" + } } ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get L1 transaction by L1 transaction hash" - } - }, - "/api/v1/withdraw/history": { - "get": { - "summary": "withdraw_history", - "operationId": "withdraw_history", - "responses": { - "200": { + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqUpdateReferralCode" + } + } + } + }, + "responses": { + "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/WithdrawHistory" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespUpdateReferralCode" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/referral/use": { + "post": { + "summary": "referral_use", + "operationId": "referral_use", + "tags": [ + "referral" + ], + "description": "Use a referral code. You can change this at a later time.", "parameters": [ { "name": "authorization", - "description": " make required after integ is done", - "in": "query", + "in": "header", "required": false, - "type": "string" + "description": " make required after integ is done", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqUseReferralCode" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/executeStats": { + "get": { + "summary": "executeStats", + "operationId": "executeStats", + "tags": [ + "order" + ], + "description": "Get execute stats", + "parameters": [ { - "name": "auth", - "description": " made optional to support header auth clients", + "name": "period", "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "d", + "w", + "m", + "q", + "y", + "all" + ] + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespGetExecuteStats" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/leaseOptions": { + "get": { + "summary": "leaseOptions", + "operationId": "leaseOptions", + "tags": [ + "account" + ], + "description": "Returns available lease duration/rate tiers, sorted by duration descending.", + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespGetLeaseOptions" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/leases": { + "get": { + "summary": "leases", + "operationId": "leases", + "tags": [ + "account" + ], + "description": "Returns paginated lease entries for an account, most recent first. Supports read-only auth via signature/account_index/timestamp query params.", + "parameters": [ + { + "name": "authorization", + "in": "header", "required": false, - "type": "string" + "schema": { + "type": "string" + }, + "description": "API token authorization" }, { "name": "account_index", "in": "query", "required": true, - "type": "integer", - "format": "int64" + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "Account index to fetch leases for" }, { "name": "cursor", "in": "query", "required": false, - "type": "string" + "schema": { + "type": "string" + }, + "description": "Pagination cursor from a previous response" }, { - "name": "filter", + "name": "limit", "in": "query", "required": false, - "type": "string", - "enum": [ - "all", - "pending", - "claimable" - ] + "schema": { + "type": "integer", + "default": 20, + "format": "uint64", + "minimum": 1, + "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)" } ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get withdraw history" - } - }, - "/api/v1/withdrawalDelay": { - "get": { - "summary": "withdrawalDelay", - "operationId": "withdrawalDelay", "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/RespWithdrawalDelay" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespGetLeases" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, + } + } + }, + "/api/v1/litLease": { + "post": { + "summary": "litLease", + "operationId": "litLease", "tags": [ - "info" + "account" ], - "description": "Withdrawal delay in seconds" + "description": "Submit a LIT lease transfer. The server calculates the required fee based on lease_amount and duration_days, then executes the transfer. Fee formula (integer arithmetic): fee = lease_amount × (annual_rate × 100) × duration_days / (360 × 10000).", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "type": "string" + }, + "description": "API token authorization" + } + ], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqLITLease" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TxHash" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } } }, - "/info": { + "/api/v1/referral/userReferrals": { "get": { - "summary": "info", - "operationId": "info", + "summary": "userReferrals", + "operationId": "referral_userReferrals", + "tags": [ + "account" + ], + "description": "Get user referrals", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "l1_address", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "cursor", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "auth", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "stats_start_timestamp", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "stats_end_timestamp", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 300 + } + } + ], "responses": { "200": { "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ZkLighterInfo" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserReferrals" + } + } } }, "400": { "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } } } - }, - "tags": [ - "root" - ], - "description": "Get info of zklighter" - } - } - }, - "definitions": { - "Account": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "account_type": { - "type": "integer", - "format": "uint8", - "example": "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": { - "type": "string", - "example": "19995" - }, - "status": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "collateral": { - "type": "string", - "example": "46342" - }, - "transaction_time": { - "type": "integer", - "format": "int64", - "example": "1257894000000000" - }, - "account_trading_mode": { - "type": "integer", - "format": "uint8", - "example": "1" } - }, - "title": "Account", - "required": [ - "code", - "account_type", - "index", - "l1_address", - "cancel_all_time", - "total_order_count", - "total_isolated_order_count", - "pending_order_count", - "available_balance", - "status", - "collateral", - "transaction_time", - "account_trading_mode" - ] + } }, - "AccountApiKeys": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "api_keys": { - "type": "array", - "items": { - "$ref": "#/definitions/ApiKey" + "/api/v1/setAccountMetadata": { + "post": { + "summary": "setAccountMetadata", + "operationId": "setAccountMetadata", + "tags": [ + "transaction" + ], + "description": "Set account metadata", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReqSetAccountMetadata" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } } } - }, - "title": "AccountApiKeys", - "required": [ - "code", - "api_keys" - ] - }, - "AccountAsset": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "example": "USDC" - }, - "asset_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "balance": { - "type": "string", - "example": "1000" - }, - "locked_balance": { - "type": "string", - "example": "1000" - } - }, - "title": "AccountAsset", - "required": [ - "symbol", - "asset_id", - "balance", - "locked_balance" - ] + } }, - "AccountLimits": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "max_llp_percentage": { - "type": "integer", - "format": "int32", - "example": "25" - }, - "max_llp_amount": { - "type": "string", - "example": "1000000" - }, - "user_tier": { - "type": "string", - "example": "std" - }, - "can_create_public_pool": { - "type": "boolean", - "format": "boolean", - "example": "true" - }, - "current_maker_fee_tick": { - "type": "integer", - "format": "int32", - "example": "0" - }, - "current_taker_fee_tick": { - "type": "integer", - "format": "int32", - "example": "0" - }, - "leased_lit": { - "type": "string" - }, - "effective_lit_stakes": { - "type": "string" - } - }, - "title": "AccountLimits", - "required": [ - "code", - "max_llp_percentage", - "max_llp_amount", - "user_tier", - "can_create_public_pool", - "current_maker_fee_tick", - "current_taker_fee_tick", - "leased_lit", - "effective_lit_stakes" - ] - }, - "AccountMarginStats": { - "type": "object", - "properties": { - "collateral": { - "type": "string", - "example": "199955" - }, - "portfolio_value": { - "type": "string", - "example": "199955" - }, - "leverage": { - "type": "string", - "example": "1.0" - }, - "available_balance": { - "type": "string", - "example": "199955" - }, - "margin_usage": { - "type": "string", - "example": "0.0" - }, - "buying_power": { - "type": "string", - "example": "199955" - } - }, - "title": "AccountMarginStats", - "required": [ - "collateral", - "portfolio_value", - "leverage", - "available_balance", - "margin_usage", - "buying_power" - ] - }, - "AccountMarketStats": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "daily_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "daily_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "daily_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "weekly_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "weekly_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "weekly_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "monthly_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "monthly_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "monthly_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "total_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "total_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "total_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - } - }, - "title": "AccountMarketStats", - "required": [ - "market_id", - "daily_trades_count", - "daily_base_token_volume", - "daily_quote_token_volume", - "weekly_trades_count", - "weekly_base_token_volume", - "weekly_quote_token_volume", - "monthly_trades_count", - "monthly_base_token_volume", - "monthly_quote_token_volume", - "total_trades_count", - "total_base_token_volume", - "total_quote_token_volume" - ] - }, - "AccountMetadata": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "can_invite": { - "type": "boolean", - "format": "boolean", - "description": " Remove After FE uses L1 meta endpoint" - }, - "referral_points_percentage": { - "type": "string", - "description": " Remove After FE uses L1 meta endpoint" - }, - "created_at": { - "type": "integer", - "format": "int64" - } - }, - "title": "AccountMetadata", - "required": [ - "account_index", - "name", - "description", - "can_invite", - "referral_points_percentage", - "created_at" - ] - }, - "AccountMetadatas": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "account_metadatas": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountMetadata" - } - } - }, - "title": "AccountMetadatas", - "required": [ - "code", - "account_metadatas" - ] - }, - "AccountPnL": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "resolution": { - "type": "string", - "example": "15m" - }, - "pnl": { - "type": "array", - "items": { - "$ref": "#/definitions/PnLEntry" + "/api/v1/systemConfig": { + "get": { + "summary": "systemConfig", + "operationId": "systemConfig", + "tags": [ + "info" + ], + "description": "Get system config", + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SystemConfig" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } } } - }, - "title": "AccountPnL", - "required": [ - "code", - "resolution", - "pnl" - ] - }, - "AccountPosition": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "symbol": { - "type": "string", - "example": "ETH" - }, - "initial_margin_fraction": { - "type": "string", - "example": "20.00" - }, - "open_order_count": { - "type": "integer", - "format": "int64", - "example": "3" - }, - "pending_order_count": { - "type": "integer", - "format": "int64", - "example": "3" - }, - "position_tied_order_count": { - "type": "integer", - "format": "int64", - "example": "3" - }, - "sign": { - "type": "integer", - "format": "int32", - "example": "1" - }, - "position": { - "type": "string", - "example": "3.6956" - }, - "avg_entry_price": { - "type": "string", - "example": "3024.66" - }, - "position_value": { - "type": "string", - "example": "3019.92" - }, - "unrealized_pnl": { - "type": "string", - "example": "17.521309" - }, - "realized_pnl": { - "type": "string", - "example": "2.000000" - }, - "liquidation_price": { - "type": "string", - "example": "3024.66" - }, - "total_funding_paid_out": { - "type": "string", - "example": "34.2" - }, - "margin_mode": { - "type": "integer", - "format": "int32", - "example": "1" - }, - "allocated_margin": { - "type": "string", - "example": "46342" - }, - "total_discount": { - "type": "string", - "example": "34.2" - } - }, - "title": "AccountPosition", - "required": [ - "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", - "margin_mode", - "allocated_margin", - "total_discount" - ] - }, - "AccountStats": { - "type": "object", - "properties": { - "collateral": { - "type": "string", - "example": "199955" - }, - "portfolio_value": { - "type": "string", - "example": "199955" - }, - "leverage": { - "type": "string", - "example": "1.0" - }, - "available_balance": { - "type": "string", - "example": "199955" - }, - "margin_usage": { - "type": "string", - "example": "0.0" - }, - "buying_power": { - "type": "string", - "example": "199955" - }, - "account_trading_mode": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "cross_stats": { - "$ref": "#/definitions/AccountMarginStats" - }, - "total_stats": { - "$ref": "#/definitions/AccountMarginStats" - } - }, - "title": "AccountStats", - "required": [ - "collateral", - "portfolio_value", - "leverage", - "available_balance", - "margin_usage", - "buying_power", - "account_trading_mode", - "cross_stats", - "total_stats" - ] - }, - "AccountTradeStats": { - "type": "object", - "properties": { - "daily_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "daily_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "weekly_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "weekly_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "monthly_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "monthly_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "total_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "total_volume": { - "type": "number", - "format": "double", - "example": "235.25" - } - }, - "title": "AccountTradeStats", - "required": [ - "daily_trades_count", - "daily_volume", - "weekly_trades_count", - "weekly_volume", - "monthly_trades_count", - "monthly_volume", - "total_trades_count", - "total_volume" - ] - }, - "Announcement": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "content": { - "type": "string" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "expired_at": { - "type": "integer", - "format": "int64" - } - }, - "title": "Announcement", - "required": [ - "title", - "content", - "created_at", - "expired_at" - ] + } }, - "Announcements": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "announcements": { - "type": "array", - "items": { - "$ref": "#/definitions/Announcement" + "/api/v1/tokenlist": { + "get": { + "summary": "tokenlist", + "operationId": "tokenlist", + "tags": [ + "tokenlist" + ], + "description": "Get token list and their metadata", + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokenList" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } } } - }, - "title": "Announcements", - "required": [ - "code", - "announcements" - ] - }, - "ApiKey": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64", - "example": "3" - }, - "api_key_index": { - "type": "integer", - "format": "uint8", - "example": "0" - }, - "nonce": { - "type": "integer", - "format": "int64", - "example": "722" - }, - "public_key": { - "type": "string" - }, - "transaction_time": { - "type": "integer", - "format": "int64", - "example": "1257894000000000" - } - }, - "title": "ApiKey", - "required": [ - "account_index", - "api_key_index", - "nonce", - "public_key", - "transaction_time" - ] - }, - "ApiToken": { - "type": "object", - "properties": { - "token_id": { - "type": "integer", - "format": "int64" - }, - "api_token": { - "type": "string" - }, - "name": { - "type": "string" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "expiry": { - "type": "integer", - "format": "int64" - }, - "sub_account_access": { - "type": "boolean", - "format": "boolean" - }, - "revoked": { - "type": "boolean", - "format": "boolean" - }, - "scopes": { - "type": "string" - } - }, - "title": "ApiToken", - "required": [ - "token_id", - "api_token", - "name", - "account_index", - "expiry", - "sub_account_access", - "revoked", - "scopes" - ] - }, - "ApprovedIntegrator": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64", - "example": "54621" - }, - "name": { - "type": "string", - "example": "Integrator1" - }, - "max_perps_taker_fee": { - "type": "integer", - "format": "int32", - "example": "10" - }, - "max_perps_maker_fee": { - "type": "integer", - "format": "int32", - "example": "1" - }, - "max_spot_taker_fee": { - "type": "integer", - "format": "int32", - "example": "10" - }, - "max_spot_maker_fee": { - "type": "integer", - "format": "int32", - "example": "1" - }, - "approval_expiry": { - "type": "integer", - "format": "int64", - "example": "1640995200", - "description": " Timestamp in milliseconds, after which the integrator is no longer approved" - } - }, - "title": "ApprovedIntegrator", - "required": [ - "account_index", - "name", - "max_perps_taker_fee", - "max_perps_maker_fee", - "max_spot_taker_fee", - "max_spot_maker_fee", - "approval_expiry" - ] - }, - "Asset": { - "type": "object", - "properties": { - "asset_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "symbol": { - "type": "string", - "example": "ETH" - }, - "l1_decimals": { - "type": "integer", - "format": "uint8", - "example": "18" - }, - "decimals": { - "type": "integer", - "format": "uint8", - "example": "2" - }, - "min_transfer_amount": { - "type": "string", - "example": "0.01" - }, - "min_withdrawal_amount": { - "type": "string", - "example": "0.01" - }, - "margin_mode": { - "type": "string", - "example": "enabled", - "enum": [ - "enabled", - "disabled" - ] - }, - "index_price": { - "type": "string", - "example": "3024.66" - }, - "l1_address": { - "type": "string", - "example": "0x0000000000000000000000000000000000000000" - } - }, - "title": "Asset", - "required": [ - "asset_id", - "symbol", - "l1_decimals", - "decimals", - "min_transfer_amount", - "min_withdrawal_amount", - "margin_mode", - "index_price", - "l1_address" - ] + } }, - "AssetDetails": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "asset_details": { - "type": "array", - "items": { - "$ref": "#/definitions/Asset" + "/api/v1/getMakerOnlyApiKeys": { + "get": { + "summary": "getMakerOnlyApiKeys", + "operationId": "getMakerOnlyApiKeys", + "tags": [ + "account" + ], + "description": "Get maker-only API key indexes", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "account_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } } - } - }, - "title": "AssetDetails", - "required": [ - "code", - "asset_details" - ] - }, - "Auth": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - } - }, - "title": "Auth", - "required": [ - "auth" - ] - }, - "Bridge": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "version": { - "type": "integer", - "format": "int32", - "enum": [ - "1", - "2" - ] - }, - "source": { - "type": "string", - "example": "Arbitrum" - }, - "source_chain_id": { - "type": "string", - "example": "42161" - }, - "fast_bridge_tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "batch_claim_tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "cctp_burn_tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "amount": { - "type": "string" - }, - "intent_address": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "bridging", - "completed" - ] - }, - "step": { - "type": "string" - }, - "description": { - "type": "string" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "updated_at": { - "type": "integer", - "format": "int64" - }, - "is_external_deposit": { - "type": "boolean", - "format": "boolean" - } - }, - "title": "Bridge", - "required": [ - "id", - "version", - "source", - "source_chain_id", - "fast_bridge_tx_hash", - "batch_claim_tx_hash", - "cctp_burn_tx_hash", - "amount", - "intent_address", - "status", - "step", - "description", - "created_at", - "updated_at", - "is_external_deposit" - ] - }, - "BridgeSupportedNetwork": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Arbitrum" - }, - "chain_id": { - "type": "string", - "example": "4164" - }, - "explorer": { - "type": "string", - "example": "https://arbiscan.io/" - } - }, - "title": "BridgeSupportedNetwork", - "required": [ - "name", - "chain_id", - "explorer" - ] - }, - "Candle": { - "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" - }, - "O": { - "type": "number", - "format": "double", - "example": "3024.66", - "description": " open_raw" - }, - "H": { - "type": "number", - "format": "double", - "example": "3034.66", - "description": " high_raw" - }, - "L": { - "type": "number", - "format": "double", - "example": "3014.66", - "description": " low_raw" - }, - "C": { - "type": "number", - "format": "double", - "example": "3024.66", - "description": " close_raw" - }, - "v": { - "type": "number", - "format": "double", - "example": "235.25", - "description": " volume0" - }, - "V": { - "type": "number", - "format": "double", - "example": "93566.25", - "description": " volume1" - }, - "i": { - "type": "integer", - "format": "int64", - "example": "1", - "description": " last_trade_id" - } - }, - "title": "Candle", - "required": [ - "t", - "o", - "h", - "l", - "c", - "O", - "H", - "L", - "C", - "v", - "V", - "i" - ] - }, - "Candles": { - "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": "#/definitions/Candle" - }, - "description": " candles" - } - }, - "title": "Candles", - "required": [ - "code", - "r", - "c" - ] - }, - "ContractAddress": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "1" - }, - "address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - } - }, - "title": "ContractAddress", - "required": [ - "name", - "address" - ] - }, - "Cursor": { - "type": "object", - "properties": { - "next_cursor": { - "type": "string" - } - }, - "title": "Cursor" - }, - "DailyReturn": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "daily_return": { - "type": "number", - "format": "double", - "example": "0.0001" - } - }, - "title": "DailyReturn", - "required": [ - "timestamp", - "daily_return" - ] - }, - "DepositHistory": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "deposits": { - "type": "array", - "items": { - "$ref": "#/definitions/DepositHistoryItem" + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespGetMakerOnlyApiKeys" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } } - }, - "cursor": { - "type": "string" - } - }, - "title": "DepositHistory", - "required": [ - "code", - "deposits", - "cursor" - ] - }, - "DepositHistoryItem": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "asset_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "amount": { - "type": "string", - "example": "0.1" - }, - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "status": { - "type": "string", - "enum": [ - "failed", - "pending", - "completed", - "claimable" - ] - }, - "l1_tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" } - }, - "title": "DepositHistoryItem", - "required": [ - "id", - "asset_id", - "amount", - "timestamp", - "status", - "l1_tx_hash" - ] + } }, - "DetailedAccount": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "account_type": { - "type": "integer", - "format": "uint8", - "example": "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": { - "type": "string", - "example": "19995" - }, - "status": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "collateral": { - "type": "string", - "example": "46342" - }, - "transaction_time": { - "type": "integer", - "format": "int64", - "example": "1257894000000000" - }, - "account_trading_mode": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "can_invite": { - "type": "boolean", - "format": "boolean", - "description": " Remove After FE uses L1 meta endpoint" - }, - "referral_points_percentage": { - "type": "string", - "description": " Remove After FE uses L1 meta endpoint" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "positions": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountPosition" - } - }, - "assets": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountAsset" - } - }, - "total_asset_value": { - "type": "string", - "example": "19995" - }, - "cross_asset_value": { - "type": "string", - "example": "19995" - }, - "pool_info": { - "$ref": "#/definitions/PublicPoolInfo" - }, - "shares": { - "type": "array", - "items": { - "$ref": "#/definitions/PublicPoolShare" + "/api/v1/setMakerOnlyApiKeys": { + "post": { + "summary": "setMakerOnlyApiKeys", + "operationId": "setMakerOnlyApiKeys", + "tags": [ + "account" + ], + "description": "Set maker-only API key indexes. This replaces the current list; pass all indexes you want marked as maker-only. Pass [] to clear all maker-only restrictions.", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } } - }, - "pending_unlocks": { - "type": "array", - "items": { - "$ref": "#/definitions/PendingUnlock" + ], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqSetMakerOnlyApiKeys" + } + }, + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/ReqSetMakerOnlyApiKeys" + } + } } }, - "approved_integrators": { - "type": "array", - "items": { - "$ref": "#/definitions/ApprovedIntegrator" + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespSetMakerOnlyApiKeys" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } } } - }, - "title": "DetailedAccount", - "required": [ - "code", - "account_type", - "index", - "l1_address", - "cancel_all_time", - "total_order_count", - "total_isolated_order_count", - "pending_order_count", - "available_balance", - "status", - "collateral", - "transaction_time", - "account_trading_mode", - "account_index", - "name", - "description", - "can_invite", - "referral_points_percentage", - "created_at", - "positions", - "assets", - "total_asset_value", - "cross_asset_value", - "pool_info", - "shares", - "pending_unlocks", - "approved_integrators" - ] + } }, - "DetailedAccounts": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "total": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "accounts": { - "type": "array", - "items": { - "$ref": "#/definitions/DetailedAccount" + "/api/v1/partnerStats": { + "get": { + "summary": "partnerStats", + "operationId": "partnerStats", + "description": "Get partner stats. If timestamps are not provided, all-time stats will be returned.", + "tags": [ + "account" + ], + "parameters": [ + { + "name": "account_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "start_timestamp", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "end_timestamp", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } } - } - }, - "title": "DetailedAccounts", - "required": [ - "code", - "total", - "accounts" - ] - }, - "DetailedCandlestick": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "open": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "high": { - "type": "number", - "format": "double", - "example": "3034.66" - }, - "low": { - "type": "number", - "format": "double", - "example": "3014.66" - }, - "close": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "open_raw": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "high_raw": { - "type": "number", - "format": "double", - "example": "3034.66" - }, - "low_raw": { - "type": "number", - "format": "double", - "example": "3014.66" - }, - "close_raw": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "volume0": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "volume1": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "last_trade_id": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "trade_count": { - "type": "integer", - "format": "int64", - "example": "1503241" - } - }, - "title": "DetailedCandlestick", - "required": [ - "timestamp", - "open", - "high", - "low", - "close", - "open_raw", - "high_raw", - "low_raw", - "close_raw", - "volume0", - "volume1", - "last_trade_id", - "trade_count" - ] - }, - "EnrichedTx": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "type": { - "type": "integer", - "format": "uint8", - "example": "1", - "maximum": 64, - "minimum": 1 - }, - "info": { - "type": "string", - "example": "{}" - }, - "event_info": { - "type": "string", - "example": "{}" - }, - "status": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "transaction_index": { - "type": "integer", - "format": "int64", - "example": "8761" - }, - "l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "account_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "nonce": { - "type": "integer", - "format": "int64", - "example": "722" - }, - "expire_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "block_height": { - "type": "integer", - "format": "int64", - "example": "45434" - }, - "queued_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "executed_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "sequence_index": { - "type": "integer", - "format": "int64", - "example": "8761" - }, - "parent_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "api_key_index": { - "type": "integer", - "format": "uint8", - "example": "0" - }, - "transaction_time": { - "type": "integer", - "format": "int64", - "example": "1257894000000000" - }, - "committed_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "verified_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - } - }, - "title": "EnrichedTx", - "required": [ - "code", - "hash", - "type", - "info", - "event_info", - "status", - "transaction_index", - "l1_address", - "account_index", - "nonce", - "expire_at", - "block_height", - "queued_at", - "executed_at", - "sequence_index", - "parent_hash", - "api_key_index", - "transaction_time", - "committed_at", - "verified_at" - ] - }, - "ExchangeMetric": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "data": { - "type": "number", - "format": "double", - "example": "93566.25" - } - }, - "title": "ExchangeMetric", - "required": [ - "timestamp", - "data" - ] - }, - "ExchangeStats": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "total": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "order_book_stats": { - "type": "array", - "example": "1", - "items": { - "$ref": "#/definitions/OrderBookStats" - } - }, - "daily_usd_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "daily_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - } - }, - "title": "ExchangeStats", - "required": [ - "code", - "total", - "order_book_stats", - "daily_usd_volume", - "daily_trades_count" - ] - }, - "ExecuteStat": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "slippage": { - "type": "array", - "items": { - "$ref": "#/definitions/SlippageResult" + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PartnerStats" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } } } - }, - "title": "ExecuteStat", - "required": [ - "timestamp", - "slippage" - ] - }, - "ExportData": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "data_url": { - "type": "string" - } - }, - "title": "ExportData", - "required": [ - "code", - "data_url" - ] - }, - "Funding": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "value": { - "type": "string", - "example": "0.0001" - }, - "rate": { - "type": "string", - "example": "0.0001" - }, - "direction": { - "type": "string", - "example": "long" - } - }, - "title": "Funding", - "required": [ - "timestamp", - "value", - "rate", - "direction" - ] - }, - "FundingRate": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16" - }, - "exchange": { - "type": "string", - "enum": [ - "binance", - "bybit", - "hyperliquid", - "lighter" - ] - }, - "symbol": { - "type": "string" - }, - "rate": { - "type": "number", - "format": "double" - } - }, - "title": "FundingRate", - "required": [ - "market_id", - "exchange", - "symbol", - "rate" - ] + } }, - "FundingRates": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "funding_rates": { - "type": "array", - "items": { - "$ref": "#/definitions/FundingRate" + "/api/v1/deposit/latest": { + "get": { + "summary": "deposit_latest", + "operationId": "deposit_latest", + "tags": [ + "bridge" + ], + "description": "Get most recent deposit for given l1 address", + "parameters": [ + { + "name": "l1_address", + "in": "query", + "required": true, + "schema": { + "type": "string" + } } - } - }, - "title": "FundingRates", - "required": [ - "code", - "funding_rates" - ] - }, - "Fundings": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "resolution": { - "type": "string", - "example": "1h" - }, - "fundings": { - "type": "array", - "items": { - "$ref": "#/definitions/Funding" + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Deposit" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } } } - }, - "title": "Fundings", - "required": [ - "code", - "resolution", - "fundings" - ] - }, - "L1Metadata": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - }, - "can_invite": { - "type": "boolean", - "format": "boolean" - }, - "referral_points_percentage": { - "type": "string" - } - }, - "title": "L1Metadata", - "required": [ - "l1_address", - "can_invite", - "referral_points_percentage" - ] - }, - "L1ProviderInfo": { - "type": "object", - "properties": { - "chainId": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "networkId": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "latestBlockNumber": { - "type": "integer", - "format": "int64", - "example": "45434" - } - }, - "title": "L1ProviderInfo", - "required": [ - "chainId", - "networkId", - "latestBlockNumber" - ] - }, - "LeaseEntry": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "master_account_index": { - "type": "integer", - "format": "int64" - }, - "lease_amount": { - "type": "integer", - "format": "int64" - }, - "fee_amount": { - "type": "integer", - "format": "int64" - }, - "start": { - "type": "integer", - "format": "int64" - }, - "end": { - "type": "integer", - "format": "int64" - }, - "status": { - "type": "string", - "enum": [ - "waiting_fee", - "leased", - "expired", - "canceled" - ] - }, - "error": { - "type": "string" - } - }, - "title": "LeaseEntry", - "required": [ - "id", - "master_account_index", - "lease_amount", - "fee_amount", - "start", - "end", - "status", - "error" - ] - }, - "LeaseOptionEntry": { - "type": "object", - "properties": { - "duration_days": { - "type": "integer", - "format": "int32" - }, - "annual_rate": { - "type": "number", - "format": "double" - } - }, - "title": "LeaseOptionEntry", - "required": [ - "duration_days", - "annual_rate" - ] - }, - "LiqTrade": { - "type": "object", - "properties": { - "price": { - "type": "string" - }, - "size": { - "type": "string" - }, - "taker_fee": { - "type": "string" - }, - "maker_fee": { - "type": "string" - }, - "transaction_time": { - "type": "integer", - "format": "int64" - } - }, - "title": "LiqTrade", - "required": [ - "price", - "size", - "taker_fee", - "maker_fee", - "transaction_time" - ] - }, - "Liquidation": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "market_id": { - "type": "integer", - "format": "int16" - }, - "type": { - "type": "string", - "enum": [ - "partial", - "deleverage" - ] - }, - "trade": { - "$ref": "#/definitions/LiqTrade" - }, - "info": { - "$ref": "#/definitions/LiquidationInfo" - }, - "executed_at": { - "type": "integer", - "format": "int64" - } - }, - "title": "Liquidation", - "required": [ - "id", - "market_id", - "type", - "trade", - "info", - "executed_at" - ] + } + } + }, + "servers": [ + { + "url": "https://mainnet.zklighter.elliot.ai" + } + ], + "components": { + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "description": "Enter JWT Bearer token **_only_**", + "name": "Authorization", + "in": "header" + } }, - "LiquidationInfo": { - "type": "object", - "properties": { - "positions": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountPosition" + "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": { + "type": "string", + "example": "19995" + }, + "status": { + "type": "integer", + "format": "uint8", + "example": "1" + }, + "collateral": { + "type": "string", + "example": "46342" + }, + "transaction_time": { + "type": "integer", + "format": "int64" } }, - "risk_info_before": { - "$ref": "#/definitions/RiskInfo" - }, - "risk_info_after": { - "$ref": "#/definitions/RiskInfo" - }, - "mark_prices": { - "type": "object", - "additionalProperties": { - "type": "number", - "format": "double" + "title": "Account", + "required": [ + "code", + "account_type", + "index", + "l1_address", + "cancel_all_time", + "total_order_count", + "total_isolated_order_count", + "pending_order_count", + "available_balance", + "status", + "collateral", + "account_trading_mode", + "transaction_time" + ] + }, + "AccountAsset": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "example": "USDC" + }, + "asset_id": { + "type": "integer", + "format": "int16", + "example": 1 + }, + "balance": { + "type": "string", + "example": "1000" + }, + "locked_balance": { + "type": "string", + "example": "1000" + }, + "margin_balance": { + "type": "string", + "example": "1000" + }, + "margin_mode": { + "type": "string", + "example": "enabled", + "enum": [ + "enabled", + "disabled" + ] } - } - }, - "title": "LiquidationInfo", - "required": [ - "positions", - "risk_info_before", - "risk_info_after", - "mark_prices" - ] - }, - "LiquidationInfos": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" }, - "message": { - "type": "string" - }, - "liquidations": { - "type": "array", - "items": { - "$ref": "#/definitions/Liquidation" + "title": "AccountAsset", + "required": [ + "symbol", + "asset_id", + "balance", + "locked_balance", + "margin_balance", + "margin_mode" + ] + }, + "AccountApiKeys": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "api_keys": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApiKey" + } } }, - "next_cursor": { - "type": "string" - } - }, - "title": "LiquidationInfos", - "required": [ - "code", - "liquidations" - ] - }, - "MarketConfig": { - "type": "object", - "properties": { - "market_margin_mode": { - "type": "integer", - "format": "int32" - }, - "insurance_fund_account_index": { - "type": "integer", - "format": "int64" - }, - "liquidation_mode": { - "type": "integer", - "format": "int32" - }, - "force_reduce_only": { - "type": "boolean", - "format": "boolean" - }, - "trading_hours": { - "type": "string" - }, - "funding_fee_discounts_enabled": { - "type": "boolean", - "format": "boolean" - }, - "hidden": { - "type": "boolean", - "format": "boolean" - } - }, - "title": "MarketConfig", - "required": [ - "market_margin_mode", - "insurance_fund_account_index", - "liquidation_mode", - "force_reduce_only", - "trading_hours", - "funding_fee_discounts_enabled", - "hidden" - ] - }, - "NextNonce": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "nonce": { - "type": "integer", - "format": "int64", - "example": "722" - } - }, - "title": "NextNonce", - "required": [ - "code", - "nonce" - ] - }, - "Order": { - "type": "object", - "properties": { - "order_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "client_order_index": { - "type": "integer", - "format": "int64", - "example": "234" - }, - "order_id": { - "type": "string", - "example": "1" - }, - "client_order_id": { - "type": "string", - "example": "234" - }, - "market_index": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "owner_account_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "initial_base_amount": { - "type": "string", - "example": "0.1" - }, - "price": { - "type": "string", - "example": "3024.66" - }, - "nonce": { - "type": "integer", - "format": "int64", - "example": "722" - }, - "remaining_base_amount": { - "type": "string", - "example": "0.1" - }, - "is_ask": { - "type": "boolean", - "format": "boolean", - "example": "true" - }, - "base_size": { - "type": "integer", - "format": "int64", - "example": "12354" - }, - "base_price": { - "type": "integer", - "format": "int32", - "example": "3024" - }, - "filled_base_amount": { - "type": "string", - "example": "0.1" - }, - "filled_quote_amount": { - "type": "string", - "example": "0.1" - }, - "side": { - "type": "string", - "example": "buy", - "default": "buy", - "description": " TODO: remove this" - }, - "type": { - "type": "string", - "example": "limit", - "enum": [ - "limit", - "market", - "stop-loss", - "stop-loss-limit", - "take-profit", - "take-profit-limit", - "twap", - "twap-sub", - "liquidation" - ] - }, - "time_in_force": { - "type": "string", - "enum": [ - "good-till-time", - "immediate-or-cancel", - "post-only", - "Unknown" - ], - "default": "good-till-time" - }, - "reduce_only": { - "type": "boolean", - "format": "boolean", - "example": "true" - }, - "trigger_price": { - "type": "string", - "example": "3024.66" - }, - "order_expiry": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "status": { - "type": "string", - "example": "open", - "enum": [ - "in-progress", - "pending", - "open", - "filled", - "canceled", - "canceled-post-only", - "canceled-reduce-only", - "canceled-position-not-allowed", - "canceled-margin-not-allowed", - "canceled-too-much-slippage", - "canceled-not-enough-liquidity", - "canceled-self-trade", - "canceled-expired", - "canceled-oco", - "canceled-child", - "canceled-liquidation", - "canceled-invalid-balance" - ] - }, - "trigger_status": { - "type": "string", - "example": "twap", - "enum": [ - "na", - "ready", - "mark-price", - "twap", - "parent-order" - ] - }, - "trigger_time": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "parent_order_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "parent_order_id": { - "type": "string", - "example": "1" - }, - "to_trigger_order_id_0": { - "type": "string", - "example": "1" - }, - "to_trigger_order_id_1": { - "type": "string", - "example": "1" - }, - "to_cancel_order_id_0": { - "type": "string", - "example": "1" - }, - "integrator_fee_collector_index": { - "type": "string", - "example": "1" - }, - "integrator_taker_fee": { - "type": "string", - "example": "1" - }, - "integrator_maker_fee": { - "type": "string", - "example": "1" - }, - "block_height": { - "type": "integer", - "format": "int64", - "example": "45434" - }, - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "created_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "updated_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "transaction_time": { - "type": "integer", - "format": "int64", - "example": "1257894000000000" - } + "title": "AccountApiKeys", + "required": [ + "code", + "api_keys" + ] }, - "title": "Order", - "required": [ - "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", - "integrator_fee_collector_index", - "integrator_taker_fee", - "integrator_maker_fee", - "block_height", - "timestamp", - "created_at", - "updated_at", - "transaction_time" - ] - }, - "OrderBook": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "example": "ETH" - }, - "market_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "market_type": { - "type": "string", - "example": "perp", - "enum": [ - "perp", - "spot" - ] - }, - "base_asset_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "quote_asset_id": { - "type": "integer", - "format": "int16", - "example": "2" - }, - "status": { - "type": "string", - "example": "active", - "enum": [ - "inactive", - "active" - ] - }, - "taker_fee": { - "type": "string", - "example": "0.0001" - }, - "maker_fee": { - "type": "string", - "example": "0.0000" - }, - "liquidation_fee": { - "type": "string", - "example": "0.01" - }, - "min_base_amount": { - "type": "string", - "example": "0.01" - }, - "min_quote_amount": { - "type": "string", - "example": "0.1" - }, - "order_quote_limit": { - "type": "string", - "example": "235.25" - }, - "supported_size_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "supported_price_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "supported_quote_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - } - }, - "title": "OrderBook", - "required": [ - "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" - ] - }, - "OrderBookDepth": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "asks": { - "type": "array", - "items": { - "$ref": "#/definitions/PriceLevel" - } - }, - "bids": { - "type": "array", - "items": { - "$ref": "#/definitions/PriceLevel" - } - }, - "offset": { - "type": "integer", - "format": "int64", - "example": "0" - }, - "nonce": { - "type": "integer", - "format": "int64", - "example": "0" - } - }, - "title": "OrderBookDepth", - "required": [ - "code", - "asks", - "bids", - "offset", - "nonce" - ] - }, - "OrderBookDepthWithBeginNonce": { - "type": "object", - "properties": { - "asks": { - "type": "array", - "items": { - "$ref": "#/definitions/PriceLevel" - } - }, - "bids": { - "type": "array", - "items": { - "$ref": "#/definitions/PriceLevel" - } - }, - "offset": { - "type": "integer", - "format": "int64", - "example": "0" - }, - "nonce": { - "type": "integer", - "format": "int64", - "example": "0" - }, - "begin_nonce": { - "type": "integer", - "format": "int64", - "example": "0" - } - }, - "title": "OrderBookDepthWithBeginNonce", - "required": [ - "asks", - "bids", - "offset", - "nonce", - "begin_nonce" - ] - }, - "OrderBookDetails": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "order_book_details": { - "type": "array", - "items": { - "$ref": "#/definitions/PerpsOrderBookDetail" + "AccountLimits": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "max_llp_percentage": { + "type": "integer", + "format": "int32", + "example": "25" + }, + "user_tier": { + "type": "string", + "example": "std" + }, + "can_create_public_pool": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "max_llp_amount": { + "type": "string", + "example": "1000000" + }, + "current_maker_fee_tick": { + "type": "integer", + "format": "int32", + "example": "0" + }, + "current_taker_fee_tick": { + "type": "integer", + "format": "int32", + "example": "0" + }, + "effective_lit_stakes": { + "type": "string", + "description": "Effective staked LIT shares including active leases." + }, + "leased_lit": { + "type": "string", + "description": "Total actively leased LIT." + }, + "user_tier_name": { + "type": "string", + "example": "standard" + }, + "user_tier_last_update": { + "type": "integer", + "format": "int64" } }, - "spot_order_book_details": { - "type": "array", - "items": { - "$ref": "#/definitions/SpotOrderBookDetail" + "title": "AccountLimits", + "required": [ + "code", + "max_llp_percentage", + "user_tier", + "can_create_public_pool", + "max_llp_amount", + "current_maker_fee_tick", + "current_taker_fee_tick", + "effective_lit_stakes", + "leased_lit", + "user_tier_name" + ] + }, + "AccountMetadata": { + "type": "object", + "properties": { + "account_index": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "can_invite": { + "type": "boolean", + "format": "boolean", + "description": " Remove After FE uses L1 meta endpoint" + }, + "referral_points_percentage": { + "type": "string", + "description": " Remove After FE uses L1 meta endpoint" + }, + "created_at": { + "type": "integer", + "format": "int64" + }, + "can_rfq": { + "type": "boolean", + "format": "boolean" + }, + "can_rfq_market_ids": { + "type": "array", + "items": { + "type": "string" + } } - } - }, - "title": "OrderBookDetails", - "required": [ - "code", - "order_book_details", - "spot_order_book_details" - ] - }, - "OrderBookOrders": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "total_asks": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "asks": { - "type": "array", - "items": { - "$ref": "#/definitions/SimpleOrder" - } - }, - "total_bids": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "bids": { - "type": "array", - "items": { - "$ref": "#/definitions/SimpleOrder" + }, + "title": "AccountMetadata", + "required": [ + "account_index", + "name", + "description", + "can_invite", + "referral_points_percentage", + "can_rfq", + "can_rfq_market_ids", + "created_at" + ] + }, + "AccountMetadatas": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "account_metadatas": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountMetadata" + } + }, + "next_cursor": { + "type": "string" } - } - }, - "title": "OrderBookOrders", - "required": [ - "code", - "total_asks", - "asks", - "total_bids", - "bids" - ] - }, - "OrderBookStats": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "example": "ETH" - }, - "last_trade_price": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "daily_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "daily_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "daily_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "daily_price_change": { - "type": "number", - "format": "double", - "example": "3.66" - } + }, + "title": "AccountMetadatas", + "required": [ + "code", + "account_metadatas" + ] }, - "title": "OrderBookStats", - "required": [ - "symbol", - "last_trade_price", - "daily_trades_count", - "daily_base_token_volume", - "daily_quote_token_volume", - "daily_price_change" - ] - }, - "OrderBooks": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "order_books": { - "type": "array", - "items": { - "$ref": "#/definitions/OrderBook" + "AccountPnL": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "resolution": { + "type": "string", + "example": "15m" + }, + "pnl": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PnLEntry" + } } - } - }, - "title": "OrderBooks", - "required": [ - "code", - "order_books" - ] - }, - "Orders": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "next_cursor": { - "type": "string" }, - "orders": { - "type": "array", - "items": { - "$ref": "#/definitions/Order" - } - } - }, - "title": "Orders", - "required": [ - "code", - "orders" - ] - }, - "PendingUnlock": { - "type": "object", - "properties": { - "unlock_timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "asset_index": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "amount": { - "type": "string", - "example": "1" - } - }, - "title": "PendingUnlock", - "required": [ - "unlock_timestamp", - "asset_index", - "amount" - ] - }, - "PerpsMarketStats": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "example": "ETH" - }, - "market_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "index_price": { - "type": "string", - "example": "3024.66" - }, - "mark_price": { - "type": "string", - "example": "3024.66" - }, - "open_interest": { - "type": "string", - "example": "235.25" - }, - "open_interest_limit": { - "type": "string", - "example": "235.25" - }, - "funding_clamp_small": { - "type": "string", - "example": "0.005" - }, - "funding_clamp_big": { - "type": "string", - "example": "0.4" - }, - "last_trade_price": { - "type": "string", - "example": "3024.66" - }, - "current_funding_rate": { - "type": "string", - "example": "0.0001" - }, - "funding_rate": { - "type": "string", - "example": "0.0001" - }, - "funding_timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "daily_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "daily_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "daily_price_low": { - "type": "number", - "format": "double", - "example": "3014.66" - }, - "daily_price_high": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "daily_price_change": { - "type": "number", - "format": "double", - "example": "3.66" - } + "title": "AccountPnL", + "required": [ + "code", + "resolution", + "pnl" + ] }, - "title": "PerpsMarketStats", - "required": [ - "symbol", - "market_id", - "index_price", - "mark_price", - "open_interest", - "open_interest_limit", - "funding_clamp_small", - "funding_clamp_big", - "last_trade_price", - "current_funding_rate", - "funding_rate", - "funding_timestamp", - "daily_base_token_volume", - "daily_quote_token_volume", - "daily_price_low", - "daily_price_high", - "daily_price_change" - ] - }, - "PerpsOrderBookDetail": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "example": "ETH" - }, - "market_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "market_type": { - "type": "string", - "example": "perp", - "enum": [ - "perp", - "spot" - ] - }, - "base_asset_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "quote_asset_id": { - "type": "integer", - "format": "int16", - "example": "2" - }, - "status": { - "type": "string", - "example": "active", - "enum": [ - "inactive", - "active" - ] - }, - "taker_fee": { - "type": "string", - "example": "0.0001" - }, - "maker_fee": { - "type": "string", - "example": "0.0000" - }, - "liquidation_fee": { - "type": "string", - "example": "0.01" - }, - "min_base_amount": { - "type": "string", - "example": "0.01" - }, - "min_quote_amount": { - "type": "string", - "example": "0.1" - }, - "order_quote_limit": { - "type": "string", - "example": "235.25" - }, - "supported_size_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "supported_price_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "supported_quote_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "size_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "price_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "quote_multiplier": { - "type": "integer", - "format": "int64", - "example": "10000" - }, - "default_initial_margin_fraction": { - "type": "integer", - "format": "uin16", - "example": "100" - }, - "min_initial_margin_fraction": { - "type": "integer", - "format": "uin16", - "example": "100" - }, - "maintenance_margin_fraction": { - "type": "integer", - "format": "uin16", - "example": "50" - }, - "closeout_margin_fraction": { - "type": "integer", - "format": "uin16", - "example": "100" - }, - "last_trade_price": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "daily_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "daily_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "daily_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "daily_price_low": { - "type": "number", - "format": "double", - "example": "3014.66" - }, - "daily_price_high": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "daily_price_change": { - "type": "number", - "format": "double", - "example": "3.66" - }, - "open_interest": { - "type": "number", - "format": "double", - "example": "93.0" - }, - "daily_chart": { - "type": "object", - "example": "{1640995200:3024.66}", - "additionalProperties": { - "type": "number", - "format": "double" + "AccountPosition": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "int16", + "example": "1" + }, + "symbol": { + "type": "string", + "example": "ETH" + }, + "initial_margin_fraction": { + "type": "string", + "example": "20.00" + }, + "open_order_count": { + "type": "integer", + "format": "int64", + "example": "3" + }, + "pending_order_count": { + "type": "integer", + "format": "int64", + "example": "3" + }, + "position_tied_order_count": { + "type": "integer", + "format": "int64", + "example": "3" + }, + "sign": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "position": { + "type": "string", + "example": "3.6956" + }, + "avg_entry_price": { + "type": "string", + "example": "3024.66" + }, + "position_value": { + "type": "string", + "example": "3019.92" + }, + "unrealized_pnl": { + "type": "string", + "example": "17.521309" + }, + "realized_pnl": { + "type": "string", + "example": "2.000000" + }, + "liquidation_price": { + "type": "string", + "example": "3024.66" + }, + "total_funding_paid_out": { + "type": "string", + "example": "34.2" + }, + "margin_mode": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "allocated_margin": { + "type": "string", + "example": "46342" + }, + "total_discount": { + "type": "string" } }, - "market_config": { - "$ref": "#/definitions/MarketConfig" + "title": "AccountPosition", + "required": [ + "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", + "margin_mode", + "allocated_margin", + "total_discount" + ] + }, + "Announcement": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "content": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64" + }, + "expired_at": { + "type": "integer", + "format": "int64" + } }, - "strategy_index": { - "type": "integer", - "format": "uint8" - } + "title": "Announcement", + "required": [ + "title", + "content", + "created_at", + "expired_at" + ] }, - "title": "PerpsOrderBookDetail", - "required": [ - "symbol", - "market_id", - "market_type", - "base_asset_id", - "quote_asset_id", - "status", - "taker_fee", - "maker_fee", - "liquidation_fee", - "min_base_amount", - "min_quote_amount", - "order_quote_limit", - "supported_size_decimals", - "supported_price_decimals", - "supported_quote_decimals", - "size_decimals", - "price_decimals", - "quote_multiplier", - "default_initial_margin_fraction", - "min_initial_margin_fraction", - "maintenance_margin_fraction", - "closeout_margin_fraction", - "last_trade_price", - "daily_trades_count", - "daily_base_token_volume", - "daily_quote_token_volume", - "daily_price_low", - "daily_price_high", - "daily_price_change", - "open_interest", - "daily_chart", - "market_config", - "strategy_index" - ] - }, - "PnLEntry": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "trade_pnl": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "trade_spot_pnl": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "inflow": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "outflow": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "spot_outflow": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "spot_inflow": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "pool_pnl": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "pool_inflow": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "pool_outflow": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "staking_pnl": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "staking_inflow": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "staking_outflow": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "pool_total_shares": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "staked_lit": { - "type": "number", - "format": "double", - "example": "12.0" - } - }, - "title": "PnLEntry", - "required": [ - "timestamp", - "trade_pnl", - "trade_spot_pnl", - "inflow", - "outflow", - "spot_outflow", - "spot_inflow", - "pool_pnl", - "pool_inflow", - "pool_outflow", - "staking_pnl", - "staking_inflow", - "staking_outflow", - "pool_total_shares", - "staked_lit" - ] - }, - "PositionFunding": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "market_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "funding_id": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "change": { - "type": "string", - "example": "1" - }, - "rate": { - "type": "string", - "example": "1" - }, - "position_size": { - "type": "string", - "example": "1" - }, - "position_side": { - "type": "string", - "example": "long", - "enum": [ - "long", - "short" - ] - }, - "discount": { - "type": "string", - "example": "1" - } - }, - "title": "PositionFunding", - "required": [ - "timestamp", - "market_id", - "funding_id", - "change", - "rate", - "position_size", - "position_side", - "discount" - ] - }, - "PositionFundings": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "position_fundings": { - "type": "array", - "items": { - "$ref": "#/definitions/PositionFunding" + "Announcements": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "announcements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Announcement" + } } }, - "next_cursor": { - "type": "string" - } - }, - "title": "PositionFundings", - "required": [ - "code", - "position_fundings" - ] - }, - "PriceLevel": { - "type": "object", - "properties": { - "price": { - "type": "string", - "example": "3024.66" - }, - "size": { - "type": "string", - "example": "0.1" - } + "title": "Announcements", + "required": [ + "code", + "announcements" + ] }, - "title": "PriceLevel", - "required": [ - "price", - "size" - ] - }, - "PublicPoolInfo": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "format": "uint8", - "example": "0" - }, - "operator_fee": { - "type": "string", - "example": "100" - }, - "min_operator_share_rate": { - "type": "string", - "example": "200" - }, - "total_shares": { - "type": "integer", - "format": "int64", - "example": "100000" - }, - "operator_shares": { - "type": "integer", - "format": "int64", - "example": "20000" - }, - "annual_percentage_yield": { - "type": "number", - "format": "double", - "example": "20.5000" - }, - "sharpe_ratio": { - "type": "number", - "format": "double", - "example": "1.5" - }, - "daily_returns": { - "type": "array", - "items": { - "$ref": "#/definitions/DailyReturn" - } - }, - "share_prices": { - "type": "array", - "items": { - "$ref": "#/definitions/SharePrice" - } - }, - "strategies": { - "type": "array", - "items": { - "$ref": "#/definitions/Strategy" + "Asset": { + "type": "object", + "properties": { + "asset_id": { + "type": "integer", + "format": "int16", + "example": 1 + }, + "symbol": { + "type": "string", + "example": "ETH" + }, + "l1_decimals": { + "type": "integer", + "format": "uint8", + "example": 18 + }, + "decimals": { + "type": "integer", + "format": "uint8", + "example": 18 + }, + "min_transfer_amount": { + "type": "string", + "example": "0.01" + }, + "min_withdrawal_amount": { + "type": "string", + "example": "0.01" + }, + "margin_mode": { + "type": "string", + "example": "enabled", + "enum": [ + "enabled", + "disabled" + ] + }, + "index_price": { + "type": "string", + "example": "3024.66" + }, + "l1_address": { + "type": "string", + "example": "0x0000000000000000000000000000000000000000" + }, + "global_supply_cap": { + "type": "string", + "example": "1000000" + }, + "liquidation_fee": { + "type": "string", + "example": "0.01" + }, + "liquidation_threshold": { + "type": "string", + "example": "0.8" + }, + "loan_to_value": { + "type": "string", + "example": "0.5" + }, + "price_decimals": { + "type": "integer", + "format": "uint8", + "example": "4" + }, + "total_supplied": { + "type": "string", + "example": "100" + }, + "user_supply_cap": { + "type": "string", + "example": "1000" + }, + "liquidation_factor": { + "type": "string", + "example": "0.9" + } + }, + "title": "Asset", + "required": [ + "asset_id", + "symbol", + "l1_decimals", + "decimals", + "min_transfer_amount", + "min_withdrawal_amount", + "margin_mode", + "index_price", + "price_decimals", + "l1_address", + "loan_to_value", + "liquidation_threshold", + "liquidation_factor", + "liquidation_fee", + "global_supply_cap", + "user_supply_cap", + "total_supplied" + ] + }, + "AssetDetails": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": 200 + }, + "message": { + "type": "string" + }, + "asset_details": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Asset" + } } - } + }, + "title": "AssetDetails", + "required": [ + "code", + "asset_details" + ] }, - "title": "PublicPoolInfo", - "required": [ - "status", - "operator_fee", - "min_operator_share_rate", - "total_shares", - "operator_shares", - "annual_percentage_yield", - "sharpe_ratio", - "daily_returns", - "share_prices", - "strategies" - ] - }, - "PublicPoolMetadata": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "account_index": { - "type": "integer", - "format": "int64", - "example": "3" - }, - "created_at": { - "type": "integer", - "format": "int64" - }, - "master_account_index": { - "type": "integer", - "format": "int64", - "example": "61" - }, - "account_type": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "name": { - "type": "string" - }, - "l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "annual_percentage_yield": { - "type": "number", - "format": "double", - "example": "20.5000" - }, - "sharpe_ratio": { - "type": "number", - "format": "double", - "example": "1.5" - }, - "status": { - "type": "integer", - "format": "uint8", - "example": "0" - }, - "operator_fee": { - "type": "string", - "example": "100" - }, - "total_asset_value": { - "type": "string", - "example": "19995" - }, - "total_spot_value": { - "type": "string", - "example": "19995" - }, - "total_perps_value": { - "type": "string", - "example": "19995" - }, - "total_shares": { - "type": "integer", - "format": "int64", - "example": "100000" - }, - "account_share": { - "$ref": "#/definitions/PublicPoolShare" - }, - "assets": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountAsset" + "ApiKey": { + "type": "object", + "properties": { + "account_index": { + "type": "integer", + "format": "int64", + "example": "3" + }, + "api_key_index": { + "type": "integer", + "format": "uint8", + "example": "0" + }, + "nonce": { + "type": "integer", + "format": "int64", + "example": "722" + }, + "public_key": { + "type": "string" + }, + "transaction_time": { + "type": "integer", + "format": "int64" } - } - }, - "title": "PublicPoolMetadata", - "required": [ - "code", - "account_index", - "created_at", - "master_account_index", - "account_type", - "name", - "l1_address", - "annual_percentage_yield", - "sharpe_ratio", - "status", - "operator_fee", - "total_asset_value", - "total_spot_value", - "total_perps_value", - "total_shares", - "assets" - ] - }, - "PublicPoolShare": { - "type": "object", - "properties": { - "public_pool_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "shares_amount": { - "type": "integer", - "format": "int64", - "example": "3000" - }, - "entry_usdc": { - "type": "string", - "example": "3000", - "description": " For public pools and insurance fund" - }, - "principal_amount": { - "type": "string", - "example": "3000" - }, - "entry_timestamp": { - "type": "integer", - "format": "int64", - "example": "3600000" - } - }, - "title": "PublicPoolShare", - "required": [ - "public_pool_index", - "shares_amount", - "entry_usdc", - "principal_amount", - "entry_timestamp" - ] - }, - "PushNotifDeliveryResult": { - "type": "object", - "properties": { - "expo_token": { - "type": "string" }, - "status": { - "type": "string" - }, - "error": { - "type": "string" - } + "title": "ApiKey", + "required": [ + "account_index", + "api_key_index", + "nonce", + "public_key", + "transaction_time" + ] }, - "title": "PushNotifDeliveryResult", - "required": [ - "expo_token", - "status", - "error" - ] - }, - "Referral": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - }, - "referral_code": { - "type": "string" - }, - "used_at": { - "type": "integer", - "format": "int64" + "Block": { + "type": "object", + "properties": { + "commitment": { + "type": "string" + }, + "height": { + "type": "integer", + "format": "int64" + }, + "state_root": { + "type": "string" + }, + "priority_operations": { + "type": "integer", + "format": "int32" + }, + "on_chain_l2_operations": { + "type": "integer", + "format": "int32" + }, + "pending_on_chain_operations_pub_data": { + "type": "string" + }, + "committed_tx_hash": { + "type": "string" + }, + "committed_at": { + "type": "integer", + "format": "int64" + }, + "verified_tx_hash": { + "type": "string" + }, + "verified_at": { + "type": "integer", + "format": "int64" + }, + "txs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tx" + } + }, + "status": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "uin16" + } + }, + "title": "Block", + "required": [ + "commitment", + "height", + "state_root", + "priority_operations", + "on_chain_l2_operations", + "pending_on_chain_operations_pub_data", + "committed_tx_hash", + "committed_at", + "verified_tx_hash", + "verified_at", + "txs", + "status", + "size" + ] + }, + "Blocks": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "total": { + "type": "integer", + "format": "int64" + }, + "blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Block" + } + } }, - "trade_stats": { - "$ref": "#/definitions/TradeStats" - } + "title": "Blocks", + "required": [ + "code", + "total", + "blocks" + ] }, - "title": "Referral", - "required": [ - "l1_address", - "referral_code", - "used_at", - "trade_stats" - ] - }, - "ReqAckNotif": { - "type": "object", - "properties": { - "notif_id": { - "type": "string", - "example": "'liq:17:5898'" - }, - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - } - }, - "title": "ReqAckNotif", - "required": [ - "notif_id", - "account_index" - ] - }, - "ReqChangeAccountTier": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "new_tier": { - "type": "string" - } - }, - "title": "ReqChangeAccountTier", - "required": [ - "account_index", - "new_tier" - ] - }, - "ReqDoFaucet": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - }, - "do_l1_transfer": { - "type": "boolean", - "format": "boolean", - "default": "false" - } - }, - "title": "ReqDoFaucet", - "required": [ - "l1_address", - "do_l1_transfer" - ] - }, - "ReqExportData": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64", - "default": "-1" - }, - "market_id": { - "type": "integer", - "format": "int16", - "default": "255" - }, - "type": { - "type": "string", - "enum": [ - "funding", - "trade" - ] - }, - "start_timestamp": { - "type": "integer", - "format": "int64", - "maximum": 1830297600000, - "minimum": 1735689600000 - }, - "end_timestamp": { - "type": "integer", - "format": "int64", - "maximum": 1830297600000, - "minimum": 1735689600000 - }, - "side": { - "type": "string", - "enum": [ - "all", - "long", - "short" - ], - "default": "all" - }, - "role": { - "type": "string", - "enum": [ - "all", - "maker", - "taker" - ], - "default": "all" - }, - "trade_type": { - "type": "string", - "enum": [ - "all", - "trade", - "liquidation", - "deleverage", - "market-settlement" - ], - "default": "all" - } - }, - "title": "ReqExportData", - "required": [ - "type" - ] - }, - "ReqFastwithdraw": { - "type": "object", - "properties": { - "tx_info": { - "type": "string" - }, - "to_address": { - "type": "string" - }, - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - } - }, - "title": "ReqFastwithdraw", - "required": [ - "tx_info", - "to_address" - ] - }, - "ReqGetAccount": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "index", - "l1_address" - ] - }, - "value": { - "type": "string" - } - }, - "title": "ReqGetAccount", - "required": [ - "by", - "value" - ] - }, - "ReqGetAccountActiveOrders": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "market_id": { - "type": "integer", - "format": "int16" - } - }, - "title": "ReqGetAccountActiveOrders", - "required": [ - "account_index", - "market_id" - ] - }, - "ReqGetAccountApiKeys": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, - "api_key_index": { - "type": "integer", - "format": "uint8", - "default": "255" - } - }, - "title": "ReqGetAccountApiKeys", - "required": [ - "account_index" - ] - }, - "ReqGetAccountByL1Address": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - } - }, - "title": "ReqGetAccountByL1Address", - "required": [ - "l1_address" - ] - }, - "ReqGetAccountInactiveOrders": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "market_id": { - "type": "integer", - "format": "int16", - "default": "255" - }, - "ask_filter": { - "type": "integer", - "format": "int8", - "default": "-1" - }, - "between_timestamps": { - "type": "string" - }, - "cursor": { - "type": "string" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } - }, - "title": "ReqGetAccountInactiveOrders", - "required": [ - "account_index", - "limit" - ] - }, - "ReqGetAccountLimits": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - } - }, - "title": "ReqGetAccountLimits", - "required": [ - "account_index" - ] - }, - "ReqGetAccountMetadata": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "index", - "l1_address" - ] - }, - "value": { - "type": "string" - }, - "auth": { - "type": "string" - } - }, - "title": "ReqGetAccountMetadata", - "required": [ - "by", - "value" - ] - }, - "ReqGetAccountPnL": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "by": { - "type": "string", - "enum": [ - "index" - ] - }, - "value": { - "type": "string" - }, - "resolution": { - "type": "string", - "enum": [ - "1m", - "5m", - "15m", - "1h", - "4h", - "1d" - ] - }, - "start_timestamp": { - "type": "integer", - "format": "int64", - "maximum": 5000000000000 - }, - "end_timestamp": { - "type": "integer", - "format": "int64", - "maximum": 5000000000000 - }, - "count_back": { - "type": "integer", - "format": "int64" - }, - "ignore_transfers": { - "type": "boolean", - "format": "boolean", - "default": "false" - } + "BridgeSupportedNetwork": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "Arbitrum" + }, + "chain_id": { + "type": "string", + "example": "4164" + }, + "explorer": { + "type": "string", + "example": "https://arbiscan.io/" + } + }, + "title": "BridgeSupportedNetwork", + "required": [ + "name", + "chain_id", + "explorer" + ] }, - "title": "ReqGetAccountPnL", - "required": [ - "by", - "value", - "resolution", - "start_timestamp", - "end_timestamp", - "count_back" - ] - }, - "ReqGetAccountTxs": { - "type": "object", - "properties": { - "index": { - "type": "integer", - "format": "int64" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - }, - "by": { - "type": "string", - "enum": [ - "account_index" - ] - }, - "value": { - "type": "string" - }, - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "types": { - "type": "array", - "items": { + "Candle": { + "type": "object", + "properties": { + "t": { "type": "integer", - "format": "uint8" + "format": "int64", + "example": 1767700500000, + "description": "Timestamp" + }, + "o": { + "type": "number", + "format": "double", + "example": 3236.86, + "description": "Open price" + }, + "h": { + "type": "number", + "format": "double", + "example": 3237.78, + "description": "High price" + }, + "l": { + "type": "number", + "format": "double", + "example": 3235.36, + "description": "Low price" + }, + "c": { + "type": "number", + "format": "double", + "example": 3235.39, + "description": "Close price" + }, + "v": { + "type": "number", + "format": "double", + "example": 55.1632, + "description": "Base token volume (volume0)" + }, + "V": { + "type": "number", + "format": "double", + "example": 178530.793575, + "description": "Quote token volume (volume1)" + }, + "i": { + "type": "integer", + "format": "int64", + "example": 779870452, + "description": "Last trade ID" + }, + "C": { + "type": "number", + "format": "double", + "example": "3024.66", + "description": " close_raw" + }, + "H": { + "type": "number", + "format": "double", + "example": "3034.66", + "description": " high_raw" + }, + "L": { + "type": "number", + "format": "double", + "example": "3014.66", + "description": " low_raw" + }, + "O": { + "type": "number", + "format": "double", + "example": "3024.66", + "description": " open_raw" + } + }, + "title": "Candle", + "description": "Abbreviated candle format. Zero values are omitted.", + "required": [ + "t", + "o", + "h", + "l", + "c", + "v", + "V", + "i" + ] + }, + "Candles": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": 200 + }, + "r": { + "type": "string", + "example": "1m", + "description": "Resolution" + }, + "c": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Candle" + }, + "description": "Array of candles (max 500 per call)" + }, + "message": { + "type": "string" } - } - }, - "title": "ReqGetAccountTxs" - }, - "ReqGetApiTokens": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - } - }, - "title": "ReqGetApiTokens", - "required": [ - "account_index" - ] - }, - "ReqGetAssetDetails": { - "type": "object", - "properties": { - "asset_id": { - "type": "integer", - "format": "int16", - "default": "0" - } - }, - "title": "ReqGetAssetDetails" - }, - "ReqGetBlock": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "commitment", - "height" - ] - }, - "value": { - "type": "string" - } - }, - "title": "ReqGetBlock", - "required": [ - "by", - "value" - ] - }, - "ReqGetBlockTxs": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "block_height", - "block_commitment" - ] - }, - "value": { - "type": "string" - } + }, + "title": "Candles", + "required": [ + "code", + "r", + "c" + ] }, - "title": "ReqGetBlockTxs", - "required": [ - "by", - "value" - ] - }, - "ReqGetBridgesByL1Addr": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - } + "ContractAddress": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "1" + }, + "address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + } + }, + "title": "ContractAddress", + "required": [ + "name", + "address" + ] }, - "title": "ReqGetBridgesByL1Addr", - "required": [ - "l1_address" - ] - }, - "ReqGetByAccount": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "account_index" - ] - }, - "value": { - "type": "string" - } + "CurrentHeight": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "height": { + "type": "integer", + "format": "int64" + } + }, + "title": "CurrentHeight", + "required": [ + "code", + "height" + ] }, - "title": "ReqGetByAccount", - "required": [ - "by", - "value" - ] - }, - "ReqGetCandles": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16" - }, - "resolution": { - "type": "string", - "enum": [ - "1m", - "5m", - "15m", - "30m", - "1h", - "4h", - "12h", - "1d", - "1w" - ] - }, - "start_timestamp": { - "type": "integer", - "format": "int64", - "maximum": 5000000000000 - }, - "end_timestamp": { - "type": "integer", - "format": "int64", - "maximum": 5000000000000 - }, - "count_back": { - "type": "integer", - "format": "int64" - }, - "set_timestamp_to_end": { - "type": "boolean", - "format": "boolean", - "default": "false" - } + "DailyReturn": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "daily_return": { + "type": "number", + "format": "double", + "example": "0.0001" + } + }, + "title": "DailyReturn", + "required": [ + "timestamp", + "daily_return" + ] }, - "title": "ReqGetCandles", - "required": [ - "market_id", - "resolution", - "start_timestamp", - "end_timestamp", - "count_back" - ] - }, - "ReqGetDepositHistory": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "l1_address": { - "type": "string" - }, - "cursor": { - "type": "string" - }, - "filter": { - "type": "string", - "enum": [ - "all", - "pending", - "claimable" - ] - } + "DepositHistory": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "deposits": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DepositHistoryItem" + } + }, + "cursor": { + "type": "string" + } + }, + "title": "DepositHistory", + "required": [ + "code", + "deposits", + "cursor" + ] }, - "title": "ReqGetDepositHistory", - "required": [ - "account_index", - "l1_address" - ] - }, - "ReqGetExchangeMetrics": { - "type": "object", - "properties": { - "period": { - "type": "string", - "enum": [ - "h", - "d", - "w", - "m", - "q", - "y", - "all" - ] - }, - "kind": { - "type": "string", - "enum": [ - "volume", - "maker_fee", - "taker_fee", - "liquidation_fee", - "trade_count", - "liquidation_count", - "liquidation_volume", - "inflow", - "outflow", - "transfer_fee", - "withdraw_fee", - "open_interest", - "account_count", - "active_account_count", - "tps" - ] - }, - "filter": { - "type": "string", - "enum": [ - "byMarket" - ] - }, - "value": { - "type": "string" - } + "DepositHistoryItem": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "string", + "example": "0.1" + }, + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "status": { + "type": "string", + "enum": [ + "failed", + "pending", + "completed", + "claimable" + ] + }, + "l1_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "asset_id": { + "type": "integer", + "format": "int16" + } + }, + "title": "DepositHistoryItem", + "required": [ + "id", + "amount", + "timestamp", + "status", + "l1_tx_hash", + "asset_id" + ] + }, + "DetailedAccount": { + "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": { + "type": "string", + "example": "19995" + }, + "status": { + "type": "integer", + "format": "uint8", + "example": "1" + }, + "collateral": { + "type": "string", + "example": "46342" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "can_invite": { + "type": "boolean", + "format": "boolean", + "description": " Remove After FE uses L1 meta endpoint" + }, + "referral_points_percentage": { + "type": "string", + "description": " Remove After FE uses L1 meta endpoint" + }, + "positions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountPosition" + } + }, + "assets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountAsset" + } + }, + "total_asset_value": { + "type": "string", + "example": "19995" + }, + "cross_asset_value": { + "type": "string", + "example": "19995" + }, + "pool_info": { + "$ref": "#/components/schemas/PublicPoolInfo" + }, + "shares": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PublicPoolShare" + } + }, + "created_at": { + "type": "integer", + "format": "int64" + }, + "transaction_time": { + "type": "integer", + "format": "int64" + }, + "pending_unlocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PendingUnlock" + } + }, + "approved_integrators": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApprovedIntegrator" + } + }, + "can_rfq": { + "type": "boolean", + "format": "boolean" + }, + "cross_initial_margin_requirement": { + "type": "string", + "example": "5998.500000" + }, + "cross_maintenance_margin_requirement": { + "type": "string", + "example": "2999.250000" + }, + "can_rfq_market_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "title": "DetailedAccount", + "required": [ + "code", + "account_type", + "index", + "l1_address", + "cancel_all_time", + "total_order_count", + "total_isolated_order_count", + "pending_order_count", + "available_balance", + "status", + "collateral", + "transaction_time", + "account_index", + "name", + "description", + "can_invite", + "referral_points_percentage", + "can_rfq", + "can_rfq_market_ids", + "created_at", + "positions", + "assets", + "total_asset_value", + "cross_asset_value", + "cross_initial_margin_requirement", + "cross_maintenance_margin_requirement", + "pool_info", + "shares" + ] + }, + "DetailedAccounts": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "total": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DetailedAccount" + } + }, + "next_cursor": { + "type": "string" + } + }, + "title": "DetailedAccounts", + "required": [ + "code", + "total", + "accounts", + "next_cursor" + ] + }, + "EnrichedTx": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "type": { + "type": "integer", + "format": "uint8", + "example": "1", + "maximum": 64, + "minimum": 1 + }, + "info": { + "type": "string", + "example": "{}" + }, + "event_info": { + "type": "string", + "example": "{}" + }, + "status": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "transaction_index": { + "type": "integer", + "format": "int64", + "example": "8761" + }, + "l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "account_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "nonce": { + "type": "integer", + "format": "int64", + "example": "722" + }, + "expire_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "block_height": { + "type": "integer", + "format": "int64", + "example": "45434" + }, + "queued_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "executed_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "sequence_index": { + "type": "integer", + "format": "int64", + "example": "8761" + }, + "parent_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "api_key_index": { + "type": "integer", + "format": "uint8", + "example": "0" + }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1257894000000000" + }, + "committed_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "verified_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + } + }, + "title": "EnrichedTx", + "required": [ + "code", + "hash", + "type", + "info", + "event_info", + "status", + "transaction_index", + "l1_address", + "account_index", + "nonce", + "expire_at", + "block_height", + "queued_at", + "executed_at", + "sequence_index", + "parent_hash", + "api_key_index", + "transaction_time", + "committed_at", + "verified_at" + ] + }, + "ExchangeStats": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "total": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "order_book_stats": { + "type": "array", + "example": "1", + "items": { + "$ref": "#/components/schemas/OrderBookStats" + } + }, + "daily_usd_volume": { + "type": "number", + "format": "double", + "example": "93566.25" + }, + "daily_trades_count": { + "type": "integer", + "format": "int64", + "example": "68" + } + }, + "title": "ExchangeStats", + "required": [ + "code", + "total", + "order_book_stats", + "daily_usd_volume", + "daily_trades_count" + ] + }, + "ExportData": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "data_url": { + "type": "string" + } + }, + "title": "ExportData", + "required": [ + "code", + "data_url" + ] + }, + "Funding": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "value": { + "type": "string", + "example": "0.0001" + }, + "rate": { + "type": "string", + "example": "0.0001" + }, + "direction": { + "type": "string", + "example": "long" + } + }, + "title": "Funding", + "required": [ + "timestamp", + "value", + "rate", + "direction" + ] + }, + "FundingRate": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "int16" + }, + "exchange": { + "type": "string", + "enum": [ + "binance", + "bybit", + "hyperliquid", + "lighter" + ] + }, + "symbol": { + "type": "string" + }, + "rate": { + "type": "number", + "format": "double" + } + }, + "title": "FundingRate", + "required": [ + "market_id", + "exchange", + "symbol", + "rate" + ] + }, + "FundingRates": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "funding_rates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FundingRate" + } + } + }, + "title": "FundingRates", + "required": [ + "code", + "funding_rates" + ] + }, + "Fundings": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "resolution": { + "type": "string", + "example": "1h" + }, + "fundings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Funding" + } + } + }, + "title": "Fundings", + "required": [ + "code", + "resolution", + "fundings" + ] + }, + "L1Metadata": { + "type": "object", + "properties": { + "l1_address": { + "type": "string" + }, + "can_invite": { + "type": "boolean", + "format": "boolean" + }, + "referral_points_percentage": { + "type": "string" + } + }, + "title": "L1Metadata", + "required": [ + "l1_address", + "can_invite", + "referral_points_percentage" + ] + }, + "L1ProviderInfo": { + "type": "object", + "properties": { + "chainId": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "networkId": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "latestBlockNumber": { + "type": "integer", + "format": "int64", + "example": "45434" + } + }, + "title": "L1ProviderInfo", + "required": [ + "chainId", + "networkId", + "latestBlockNumber" + ] + }, + "LiqTrade": { + "type": "object", + "properties": { + "price": { + "type": "string" + }, + "size": { + "type": "string" + }, + "taker_fee": { + "type": "string" + }, + "maker_fee": { + "type": "string" + }, + "transaction_time": { + "type": "integer", + "format": "int64" + } + }, + "title": "LiqTrade", + "required": [ + "price", + "size", + "taker_fee", + "maker_fee", + "transaction_time" + ] + }, + "Liquidation": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "market_id": { + "type": "integer", + "format": "int16" + }, + "type": { + "type": "string", + "enum": [ + "partial", + "deleverage" + ] + }, + "trade": { + "$ref": "#/components/schemas/LiqTrade" + }, + "info": { + "$ref": "#/components/schemas/LiquidationInfo" + }, + "executed_at": { + "type": "integer", + "format": "int64" + } + }, + "title": "Liquidation", + "required": [ + "id", + "market_id", + "type", + "trade", + "info", + "executed_at" + ] + }, + "LiquidationInfo": { + "type": "object", + "properties": { + "positions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountPosition" + } + }, + "risk_info_before": { + "$ref": "#/components/schemas/RiskInfo" + }, + "risk_info_after": { + "$ref": "#/components/schemas/RiskInfo" + }, + "mark_prices": { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double" + } + }, + "assets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountAsset" + } + }, + "asset_index_prices": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "title": "LiquidationInfo", + "required": [ + "positions", + "risk_info_before", + "risk_info_after", + "mark_prices", + "assets", + "asset_index_prices" + ] + }, + "LiquidationInfos": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "liquidations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Liquidation" + } + }, + "next_cursor": { + "type": "string" + } + }, + "title": "LiquidationInfos", + "required": [ + "code", + "liquidations" + ] + }, + "MarketConfig": { + "type": "object", + "properties": { + "market_margin_mode": { + "type": "integer", + "format": "int32", + "example": 0 + }, + "insurance_fund_account_index": { + "type": "integer", + "format": "int64", + "example": 281474976710655 + }, + "liquidation_mode": { + "type": "integer", + "format": "int32", + "example": 0 + }, + "force_reduce_only": { + "type": "boolean", + "format": "boolean", + "example": false + }, + "funding_fee_discounts_enabled": { + "type": "boolean", + "format": "boolean" + }, + "trading_hours": { + "type": "string", + "example": "" + }, + "hidden": { + "type": "boolean" + }, + "rfq_enabled": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "MarketConfig", + "required": [ + "market_margin_mode", + "insurance_fund_account_index", + "liquidation_mode", + "force_reduce_only", + "trading_hours", + "hidden", + "rfq_enabled" + ] + }, + "NextNonce": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "nonce": { + "type": "integer", + "format": "int64", + "example": "722" + } + }, + "title": "NextNonce", + "required": [ + "code", + "nonce" + ] + }, + "Order": { + "type": "object", + "properties": { + "order_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "client_order_index": { + "type": "integer", + "format": "int64", + "example": "234" + }, + "order_id": { + "type": "string", + "example": "1" + }, + "client_order_id": { + "type": "string", + "example": "234" + }, + "market_index": { + "type": "integer", + "format": "int16", + "example": "1" + }, + "owner_account_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "initial_base_amount": { + "type": "string", + "example": "0.1" + }, + "price": { + "type": "string", + "example": "3024.66" + }, + "nonce": { + "type": "integer", + "format": "int64", + "example": "722" + }, + "remaining_base_amount": { + "type": "string", + "example": "0.1" + }, + "is_ask": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "base_size": { + "type": "integer", + "format": "int64", + "example": "12354" + }, + "base_price": { + "type": "integer", + "format": "int32", + "example": "3024" + }, + "filled_base_amount": { + "type": "string", + "example": "0.1" + }, + "filled_quote_amount": { + "type": "string", + "example": "0.1" + }, + "side": { + "type": "string", + "example": "buy", + "default": "buy", + "description": " TODO: remove this" + }, + "type": { + "type": "string", + "example": "limit", + "enum": [ + "limit", + "market", + "stop-loss", + "stop-loss-limit", + "take-profit", + "take-profit-limit", + "twap", + "twap-sub", + "liquidation" + ] + }, + "time_in_force": { + "type": "string", + "enum": [ + "good-till-time", + "immediate-or-cancel", + "post-only", + "Unknown" + ], + "default": "good-till-time" + }, + "reduce_only": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "trigger_price": { + "type": "string", + "example": "3024.66" + }, + "order_expiry": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "status": { + "type": "string", + "example": "open", + "enum": [ + "in-progress", + "pending", + "open", + "filled", + "canceled", + "canceled-post-only", + "canceled-reduce-only", + "canceled-position-not-allowed", + "canceled-margin-not-allowed", + "canceled-too-much-slippage", + "canceled-not-enough-liquidity", + "canceled-self-trade", + "canceled-expired", + "canceled-oco", + "canceled-child", + "canceled-liquidation", + "canceled-invalid-balance" + ] + }, + "trigger_status": { + "type": "string", + "example": "twap", + "enum": [ + "na", + "ready", + "mark-price", + "twap", + "parent-order" + ] + }, + "trigger_time": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "parent_order_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "parent_order_id": { + "type": "string", + "example": "1" + }, + "to_trigger_order_id_0": { + "type": "string", + "example": "1" + }, + "to_trigger_order_id_1": { + "type": "string", + "example": "1" + }, + "to_cancel_order_id_0": { + "type": "string", + "example": "1" + }, + "block_height": { + "type": "integer", + "format": "int64", + "example": "45434" + }, + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "created_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "updated_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "transaction_time": { + "type": "integer", + "format": "int64" + }, + "integrator_fee_collector_index": { + "type": "string" + }, + "integrator_maker_fee": { + "type": "string" + }, + "integrator_taker_fee": { + "type": "string" + } + }, + "title": "Order", + "required": [ + "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", + "integrator_fee_collector_index", + "integrator_maker_fee", + "integrator_taker_fee", + "transaction_time" + ] + }, + "OrderBook": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "example": "ETH" + }, + "market_id": { + "type": "integer", + "format": "int16", + "example": 0 + }, + "market_type": { + "type": "string", + "example": "perp", + "enum": [ + "perp", + "spot" + ] + }, + "base_asset_id": { + "type": "integer", + "format": "int16", + "example": 0 + }, + "quote_asset_id": { + "type": "integer", + "format": "int16", + "example": 0 + }, + "status": { + "type": "string", + "example": "active", + "enum": [ + "inactive", + "active" + ] + }, + "taker_fee": { + "type": "string", + "example": "0.0001" + }, + "maker_fee": { + "type": "string", + "example": "0.0000" + }, + "liquidation_fee": { + "type": "string", + "example": "0.01" + }, + "min_base_amount": { + "type": "string", + "example": "0.01" + }, + "min_quote_amount": { + "type": "string", + "example": "0.1" + }, + "supported_size_decimals": { + "type": "integer", + "format": "uint8", + "example": "4" + }, + "supported_price_decimals": { + "type": "integer", + "format": "uint8", + "example": "4" + }, + "supported_quote_decimals": { + "type": "integer", + "format": "uint8", + "example": "4" + }, + "order_quote_limit": { + "type": "string", + "example": "281474976.710655" + }, + "is_maker_fee_enabled": { + "type": "boolean", + "example": true + }, + "is_taker_fee_enabled": { + "type": "boolean", + "example": true + } + }, + "title": "OrderBook", + "required": [ + "symbol", + "market_id", + "market_type", + "base_asset_id", + "quote_asset_id", + "status", + "taker_fee", + "is_taker_fee_enabled", + "maker_fee", + "is_maker_fee_enabled", + "liquidation_fee", + "min_base_amount", + "min_quote_amount", + "order_quote_limit", + "supported_size_decimals", + "supported_price_decimals", + "supported_quote_decimals" + ] + }, + "PerpsOrderBookDetail": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "example": "ETH" + }, + "market_id": { + "type": "integer", + "format": "int16", + "example": 0 + }, + "market_type": { + "type": "string", + "example": "perp", + "enum": [ + "perp", + "spot" + ] + }, + "base_asset_id": { + "type": "integer", + "format": "int16", + "example": 0 + }, + "quote_asset_id": { + "type": "integer", + "format": "int16", + "example": 0 + }, + "status": { + "type": "string", + "example": "active", + "enum": [ + "inactive", + "active" + ] + }, + "taker_fee": { + "type": "string", + "example": "0.0001" + }, + "maker_fee": { + "type": "string", + "example": "0.0000" + }, + "liquidation_fee": { + "type": "string", + "example": "0.01" + }, + "min_base_amount": { + "type": "string", + "example": "0.01" + }, + "min_quote_amount": { + "type": "string", + "example": "0.1" + }, + "supported_size_decimals": { + "type": "integer", + "format": "uint8", + "example": "4" + }, + "supported_price_decimals": { + "type": "integer", + "format": "uint8", + "example": "4" + }, + "supported_quote_decimals": { + "type": "integer", + "format": "uint8", + "example": "4" + }, + "order_quote_limit": { + "type": "string", + "example": "281474976.710655" + }, + "size_decimals": { + "type": "integer", + "format": "uint8", + "example": "4" + }, + "price_decimals": { + "type": "integer", + "format": "uint8", + "example": "4" + }, + "quote_multiplier": { + "type": "integer", + "format": "int64", + "example": "10000" + }, + "default_initial_margin_fraction": { + "type": "integer", + "format": "uin16", + "example": "100" + }, + "min_initial_margin_fraction": { + "type": "integer", + "format": "uin16", + "example": "100" + }, + "maintenance_margin_fraction": { + "type": "integer", + "format": "uin16", + "example": "50" + }, + "closeout_margin_fraction": { + "type": "integer", + "format": "uin16", + "example": "100" + }, + "last_trade_price": { + "type": "number", + "format": "double", + "example": "3024.66" + }, + "daily_trades_count": { + "type": "integer", + "format": "int64", + "example": "68" + }, + "daily_base_token_volume": { + "type": "number", + "format": "double", + "example": "235.25" + }, + "daily_quote_token_volume": { + "type": "number", + "format": "double", + "example": "93566.25" + }, + "daily_price_low": { + "type": "number", + "format": "double", + "example": "3014.66" + }, + "daily_price_high": { + "type": "number", + "format": "double", + "example": "3024.66" + }, + "daily_price_change": { + "type": "number", + "format": "double", + "example": "3.66" + }, + "open_interest": { + "type": "number", + "format": "double", + "example": "93.0" + }, + "daily_chart": { + "type": "object", + "example": "{1640995200:3024.66}", + "additionalProperties": { + "type": "number", + "format": "double" + } + }, + "market_config": { + "$ref": "#/components/schemas/MarketConfig" + }, + "strategy_index": { + "type": "integer", + "format": "uint8" + }, + "is_maker_fee_enabled": { + "type": "boolean", + "example": true + }, + "is_taker_fee_enabled": { + "type": "boolean", + "example": true + }, + "funding_clamp_small": { + "type": "string", + "example": "0.005" + }, + "funding_clamp_big": { + "type": "string", + "example": "0.4" + }, + "base_interest_rate": { + "type": "string", + "example": "0.0001" + } + }, + "title": "PerpsOrderBookDetail", + "required": [ + "symbol", + "market_id", + "market_type", + "base_asset_id", + "quote_asset_id", + "status", + "taker_fee", + "is_taker_fee_enabled", + "maker_fee", + "is_maker_fee_enabled", + "liquidation_fee", + "min_base_amount", + "min_quote_amount", + "order_quote_limit", + "supported_size_decimals", + "supported_price_decimals", + "supported_quote_decimals", + "size_decimals", + "price_decimals", + "quote_multiplier", + "default_initial_margin_fraction", + "min_initial_margin_fraction", + "maintenance_margin_fraction", + "closeout_margin_fraction", + "last_trade_price", + "daily_trades_count", + "daily_base_token_volume", + "daily_quote_token_volume", + "daily_price_low", + "daily_price_high", + "daily_price_change", + "open_interest", + "daily_chart", + "market_config", + "strategy_index", + "funding_clamp_small", + "funding_clamp_big", + "base_interest_rate" + ] + }, + "OrderBookDetails": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "order_book_details": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PerpsOrderBookDetail" + } + }, + "spot_order_book_details": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SpotOrderBookDetail" + } + } + }, + "title": "OrderBookDetails", + "required": [ + "code", + "order_book_details", + "spot_order_book_details" + ] + }, + "SpotOrderBookDetail": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "example": "ETH/USDC" + }, + "market_id": { + "type": "integer", + "format": "int16", + "example": 2048 + }, + "market_type": { + "type": "string", + "example": "spot", + "enum": [ + "perp", + "spot" + ] + }, + "base_asset_id": { + "type": "integer", + "format": "int16", + "example": 1 + }, + "quote_asset_id": { + "type": "integer", + "format": "int16", + "example": 3 + }, + "status": { + "type": "string", + "example": "active", + "enum": [ + "inactive", + "active" + ] + }, + "taker_fee": { + "type": "string", + "example": "0.0000" + }, + "maker_fee": { + "type": "string", + "example": "0.0000" + }, + "liquidation_fee": { + "type": "string", + "example": "0.0000" + }, + "min_base_amount": { + "type": "string", + "example": "0.0001" + }, + "min_quote_amount": { + "type": "string", + "example": "0.000001" + }, + "order_quote_limit": { + "type": "string", + "example": "2500000.000000" + }, + "supported_size_decimals": { + "type": "integer", + "format": "uint8", + "example": 4 + }, + "supported_price_decimals": { + "type": "integer", + "format": "uint8", + "example": 2 + }, + "supported_quote_decimals": { + "type": "integer", + "format": "uint8", + "example": 6 + }, + "size_decimals": { + "type": "integer", + "format": "uint8", + "example": 4 + }, + "price_decimals": { + "type": "integer", + "format": "uint8", + "example": 2 + }, + "last_trade_price": { + "type": "number", + "format": "double", + "example": 2731.79 + }, + "daily_trades_count": { + "type": "integer", + "format": "int64", + "example": 126993 + }, + "daily_base_token_volume": { + "type": "number", + "format": "double", + "example": 1203.0962 + }, + "daily_quote_token_volume": { + "type": "number", + "format": "double", + "example": 3516374.947553 + }, + "daily_price_low": { + "type": "number", + "format": "double", + "example": 2717.47 + }, + "daily_price_high": { + "type": "number", + "format": "double", + "example": 3044.21 + }, + "daily_price_change": { + "type": "number", + "format": "double", + "example": -10.2389493724579 + }, + "daily_chart": { + "type": "object", + "example": "{1640995200:3024.66}", + "additionalProperties": { + "type": "number", + "format": "double" + } + }, + "is_maker_fee_enabled": { + "type": "boolean", + "example": true + }, + "is_taker_fee_enabled": { + "type": "boolean", + "example": true + } + }, + "title": "SpotOrderBookDetail", + "required": [ + "symbol", + "market_id", + "market_type", + "base_asset_id", + "quote_asset_id", + "status", + "taker_fee", + "is_taker_fee_enabled", + "maker_fee", + "is_maker_fee_enabled", + "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" + ] + }, + "OrderBookOrders": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "total_asks": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "asks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SimpleOrder" + } + }, + "total_bids": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "bids": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SimpleOrder" + } + } + }, + "title": "OrderBookOrders", + "required": [ + "code", + "total_asks", + "asks", + "total_bids", + "bids" + ] + }, + "OrderBookStats": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "example": "ETH" + }, + "last_trade_price": { + "type": "number", + "format": "double", + "example": "3024.66" + }, + "daily_trades_count": { + "type": "integer", + "format": "int64", + "example": "68" + }, + "daily_base_token_volume": { + "type": "number", + "format": "double", + "example": "235.25" + }, + "daily_quote_token_volume": { + "type": "number", + "format": "double", + "example": "93566.25" + }, + "daily_price_change": { + "type": "number", + "format": "double", + "example": "3.66" + } + }, + "title": "OrderBookStats", + "required": [ + "symbol", + "last_trade_price", + "daily_trades_count", + "daily_base_token_volume", + "daily_quote_token_volume", + "daily_price_change" + ] + }, + "OrderBooks": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "order_books": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderBook" + } + } + }, + "title": "OrderBooks", + "required": [ + "code", + "order_books" + ] + }, + "Orders": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "next_cursor": { + "type": "string" + }, + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Order" + } + } + }, + "title": "Orders", + "required": [ + "code", + "orders" + ] + }, + "PnLEntry": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "trade_pnl": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "inflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "outflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "pool_pnl": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "pool_inflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "pool_outflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "pool_total_shares": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "spot_inflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "spot_outflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "staked_lit": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "staking_inflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "staking_outflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "staking_pnl": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "trade_spot_pnl": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "volume": { + "type": "number", + "format": "double", + "example": "12.0" + } + }, + "title": "PnLEntry", + "required": [ + "timestamp", + "trade_pnl", + "inflow", + "outflow", + "pool_pnl", + "pool_inflow", + "pool_outflow", + "pool_total_shares", + "spot_inflow", + "spot_outflow", + "staked_lit", + "staking_inflow", + "staking_outflow", + "staking_pnl", + "trade_spot_pnl", + "volume" + ] + }, + "PositionFunding": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "market_id": { + "type": "integer", + "format": "int16", + "example": "1" + }, + "funding_id": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "change": { + "type": "string", + "example": "1" + }, + "discount": { + "type": "string", + "example": "1" + }, + "rate": { + "type": "string", + "example": "1" + }, + "position_size": { + "type": "string", + "example": "1" + }, + "position_side": { + "type": "string", + "example": "long", + "enum": [ + "long", + "short" + ] + } + }, + "title": "PositionFunding", + "required": [ + "timestamp", + "market_id", + "funding_id", + "change", + "rate", + "position_size", + "position_side", + "discount" + ] + }, + "PositionFundings": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "position_fundings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PositionFunding" + } + }, + "next_cursor": { + "type": "string" + } + }, + "title": "PositionFundings", + "required": [ + "code", + "position_fundings" + ] }, - "title": "ReqGetExchangeMetrics", - "required": [ - "period", - "kind" - ] - }, - "ReqGetExchangeStats": { - "type": "object", - "title": "ReqGetExchangeStats" - }, - "ReqGetExecuteStats": { - "type": "object", - "properties": { - "period": { - "type": "string", - "enum": [ - "d", - "w", - "m", - "q", - "y", - "all" - ] - } + "PublicPoolInfo": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "format": "uint8", + "example": "0" + }, + "operator_fee": { + "type": "string", + "example": "100" + }, + "min_operator_share_rate": { + "type": "string", + "example": "200" + }, + "total_shares": { + "type": "integer", + "format": "int64", + "example": "100000" + }, + "operator_shares": { + "type": "integer", + "format": "int64", + "example": "20000" + }, + "annual_percentage_yield": { + "type": "number", + "format": "double", + "example": "20.5000" + }, + "daily_returns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DailyReturn" + } + }, + "share_prices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SharePrice" + } + }, + "sharpe_ratio": { + "type": "number", + "format": "double" + }, + "strategies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Strategy" + } + } + }, + "title": "PublicPoolInfo", + "required": [ + "status", + "operator_fee", + "min_operator_share_rate", + "total_shares", + "operator_shares", + "annual_percentage_yield", + "daily_returns", + "share_prices", + "sharpe_ratio", + "strategies" + ] + }, + "PublicPoolMetadata": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "account_index": { + "type": "integer", + "format": "int64", + "example": "3" + }, + "account_type": { + "type": "integer", + "format": "uint8", + "example": "1" + }, + "name": { + "type": "string" + }, + "l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "annual_percentage_yield": { + "type": "number", + "format": "double", + "example": "20.5000" + }, + "status": { + "type": "integer", + "format": "uint8", + "example": "0" + }, + "operator_fee": { + "type": "string", + "example": "100" + }, + "total_asset_value": { + "type": "string", + "example": "19995" + }, + "total_shares": { + "type": "integer", + "format": "int64", + "example": "100000" + }, + "account_share": { + "$ref": "#/components/schemas/PublicPoolShare" + }, + "assets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountAsset" + } + }, + "created_at": { + "type": "integer", + "format": "int64" + }, + "master_account_index": { + "type": "integer", + "format": "int64" + }, + "sharpe_ratio": { + "type": "number", + "format": "double" + }, + "total_perps_value": { + "type": "string" + }, + "total_spot_value": { + "type": "string" + } + }, + "title": "PublicPoolMetadata", + "required": [ + "code", + "account_index", + "account_type", + "name", + "l1_address", + "annual_percentage_yield", + "status", + "operator_fee", + "total_asset_value", + "total_shares", + "assets", + "created_at", + "master_account_index", + "sharpe_ratio", + "total_perps_value", + "total_spot_value" + ] + }, + "PublicPoolShare": { + "type": "object", + "properties": { + "public_pool_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "shares_amount": { + "type": "integer", + "format": "int64", + "example": "3000" + }, + "entry_usdc": { + "type": "string", + "example": "3000" + }, + "entry_timestamp": { + "type": "integer", + "format": "int64" + }, + "principal_amount": { + "type": "string" + } + }, + "title": "PublicPoolShare", + "required": [ + "public_pool_index", + "shares_amount", + "entry_usdc", + "entry_timestamp", + "principal_amount" + ] }, - "title": "ReqGetExecuteStats", - "required": [ - "period" - ] - }, - "ReqGetFastWithdrawInfo": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - } + "ReferralPointEntry": { + "type": "object", + "properties": { + "l1_address": { + "type": "string" + }, + "total_points": { + "type": "number", + "format": "float", + "example": "1000.01" + }, + "week_points": { + "type": "number", + "format": "float", + "example": "1000.01" + }, + "total_reward_points": { + "type": "number", + "format": "float", + "example": "200" + }, + "week_reward_points": { + "type": "number", + "format": "float", + "example": "200" + }, + "reward_point_multiplier": { + "type": "string", + "example": "0.1" + } + }, + "title": "ReferralPointEntry", + "required": [ + "l1_address", + "total_points", + "week_points", + "total_reward_points", + "week_reward_points", + "reward_point_multiplier" + ] + }, + "ReferralPoints": { + "type": "object", + "properties": { + "referrals": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReferralPointEntry" + } + }, + "user_total_points": { + "type": "number", + "format": "float", + "example": "1000" + }, + "user_last_week_points": { + "type": "number", + "format": "float", + "example": "1000" + }, + "user_total_referral_reward_points": { + "type": "number", + "format": "float", + "example": "1000" + }, + "user_last_week_referral_reward_points": { + "type": "number", + "format": "float", + "example": "1000" + }, + "reward_point_multiplier": { + "type": "string", + "example": "0.1" + } + }, + "title": "ReferralPoints", + "required": [ + "referrals", + "user_total_points", + "user_last_week_points", + "user_total_referral_reward_points", + "user_last_week_referral_reward_points", + "reward_point_multiplier" + ] + }, + "ReqAckNotif": { + "type": "object", + "properties": { + "notif_id": { + "type": "string", + "example": "'liq:17:5898'" + }, + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + } + }, + "title": "ReqAckNotif", + "required": [ + "notif_id", + "account_index" + ] }, - "title": "ReqGetFastWithdrawInfo", - "required": [ - "account_index" - ] - }, - "ReqGetFundings": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16" - }, - "resolution": { - "type": "string", - "enum": [ - "1h", - "1d" - ] - }, - "start_timestamp": { - "type": "integer", - "format": "int64", - "maximum": 5000000000000 - }, - "end_timestamp": { - "type": "integer", - "format": "int64", - "maximum": 5000000000000 - }, - "count_back": { - "type": "integer", - "format": "int64" - } + "ReqChangeAccountTier": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "new_tier": { + "type": "string" + } + }, + "title": "ReqChangeAccountTier", + "required": [ + "account_index", + "new_tier" + ] }, - "title": "ReqGetFundings", - "required": [ - "market_id", - "resolution", - "start_timestamp", - "end_timestamp", - "count_back" - ] - }, - "ReqGetGeckoContracts": { - "type": "object", - "title": "ReqGetGeckoContracts" - }, - "ReqGetGeckoTickers": { - "type": "object", - "title": "ReqGetGeckoTickers" - }, - "ReqGetL1Metadata": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "l1_address": { - "type": "string" - } + "RespGetMakerOnlyApiKeys": { + "type": "object", + "title": "RespGetMakerOnlyApiKeys", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "api_key_indexes": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + } + }, + "required": [ + "code", + "api_key_indexes" + ] }, - "title": "ReqGetL1Metadata", - "required": [ - "l1_address" - ] - }, - "ReqGetL1Tx": { - "type": "object", - "properties": { - "hash": { - "type": "string" - } + "ReqSetMakerOnlyApiKeys": { + "type": "object", + "title": "ReqSetMakerOnlyApiKeys", + "description": "Send as form data, not JSON. The value replaces the full maker-only API key list; use [] to clear all restrictions.", + "properties": { + "account_index": { + "type": "integer", + "format": "int64" + }, + "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": [ + "account_index", + "api_key_indexes" + ] }, - "title": "ReqGetL1Tx", - "required": [ - "hash" - ] - }, - "ReqGetLatestDeposit": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - } + "RespSetMakerOnlyApiKeys": { + "type": "object", + "title": "RespSetMakerOnlyApiKeys", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code" + ] }, - "title": "ReqGetLatestDeposit", - "required": [ - "l1_address" - ] - }, - "ReqGetLeases": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "cursor": { - "type": "string" - }, - "limit": { - "type": "integer", - "format": "int64", - "default": "20" - } + "ReqSendTx": { + "type": "object", + "properties": { + "tx_type": { + "type": "integer", + "format": "uint8" + }, + "tx_info": { + "type": "string" + }, + "price_protection": { + "type": "boolean", + "format": "boolean", + "default": "true" + } + }, + "title": "ReqSendTx", + "required": [ + "tx_type", + "tx_info" + ] }, - "title": "ReqGetLeases", - "required": [ - "account_index" - ] - }, - "ReqGetLiquidationInfos": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "market_id": { - "type": "integer", - "format": "int16", - "default": "255" - }, - "cursor": { - "type": "string" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } + "ReqSendTxBatch": { + "type": "object", + "properties": { + "tx_types": { + "type": "string" + }, + "tx_infos": { + "type": "string" + } + }, + "title": "ReqSendTxBatch", + "required": [ + "tx_types", + "tx_infos" + ] }, - "title": "ReqGetLiquidationInfos", - "required": [ - "account_index", - "limit" - ] - }, - "ReqGetNextNonce": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, - "api_key_index": { - "type": "integer", - "format": "uint8" - } + "RespChangeAccountTier": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + } + }, + "title": "RespChangeAccountTier", + "required": [ + "code" + ] }, - "title": "ReqGetNextNonce", - "required": [ - "account_index", - "api_key_index" - ] - }, - "ReqGetOrderBookDetails": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16", - "default": "255" - }, - "filter": { - "type": "string", - "enum": [ - "all", - "spot", - "perp" - ], - "default": "all" - } + "RespGetFastBridgeInfo": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "fast_bridge_limit": { + "type": "string" + } + }, + "title": "RespGetFastBridgeInfo", + "required": [ + "code", + "fast_bridge_limit" + ] }, - "title": "ReqGetOrderBookDetails" - }, - "ReqGetOrderBookOrders": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 250, - "minimum": 1 - } + "RespPublicPoolsMetadata": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "public_pools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PublicPoolMetadata" + } + } + }, + "title": "RespPublicPoolsMetadata", + "required": [ + "code", + "public_pools" + ] }, - "title": "ReqGetOrderBookOrders", - "required": [ - "market_id", - "limit" - ] - }, - "ReqGetOrderBooks": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16", - "default": "255" - }, - "filter": { - "type": "string", - "enum": [ - "all", - "spot", - "perp" - ], - "default": "all" - } + "RespSendTx": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "predicted_execution_time_ms": { + "type": "integer", + "format": "int64", + "example": "1751465474" + }, + "volume_quota_remaining": { + "type": "integer", + "format": "int64" + } + }, + "title": "RespSendTx", + "required": [ + "code", + "tx_hash", + "predicted_execution_time_ms", + "volume_quota_remaining" + ] + }, + "RespSendTxBatch": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "tx_hash": { + "type": "array", + "items": { + "type": "string" + } + }, + "predicted_execution_time_ms": { + "type": "integer", + "format": "int64", + "example": "1751465474" + }, + "volume_quota_remaining": { + "type": "integer", + "format": "int64" + } + }, + "title": "RespSendTxBatch", + "required": [ + "code", + "tx_hash", + "predicted_execution_time_ms", + "volume_quota_remaining" + ] + }, + "RespWithdrawalDelay": { + "type": "object", + "properties": { + "seconds": { + "type": "integer", + "format": "int64", + "example": "86400" + } + }, + "title": "RespWithdrawalDelay", + "required": [ + "seconds" + ] + }, + "ResultCode": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + } + }, + "title": "ResultCode", + "required": [ + "code" + ] }, - "title": "ReqGetOrderBooks" - }, - "ReqGetPositionFunding": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "market_id": { - "type": "integer", - "format": "int16", - "default": "255" - }, - "cursor": { - "type": "string" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - }, - "side": { - "type": "string", - "enum": [ - "long", - "short", - "all" - ], - "default": "all" - } + "RiskInfo": { + "type": "object", + "properties": { + "cross_risk_parameters": { + "$ref": "#/components/schemas/RiskParameters" + }, + "isolated_risk_parameters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RiskParameters" + } + } + }, + "title": "RiskInfo", + "required": [ + "cross_risk_parameters", + "isolated_risk_parameters" + ] }, - "title": "ReqGetPositionFunding", - "required": [ - "account_index", - "limit" - ] - }, - "ReqGetPublicPoolsMetadata": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "filter": { - "type": "string", - "enum": [ - "all", - "user", - "protocol", - "account_index", - "stake" - ] - }, - "index": { - "type": "integer", - "format": "int64" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - }, - "account_index": { - "type": "integer", - "format": "int64" - } + "RiskParameters": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "int16" + }, + "collateral": { + "type": "string" + }, + "total_account_value": { + "type": "string" + }, + "initial_margin_req": { + "type": "string" + }, + "maintenance_margin_req": { + "type": "string" + }, + "close_out_margin_req": { + "type": "string" + }, + "total_account_liquidation_threshold": { + "type": "string" + }, + "usdc_collateral_with_funding": { + "type": "string" + }, + "usdc_portfolio_value": { + "type": "string" + } + }, + "title": "RiskParameters", + "required": [ + "market_id", + "total_account_value", + "initial_margin_req", + "maintenance_margin_req", + "close_out_margin_req", + "total_account_liquidation_threshold", + "collateral", + "usdc_collateral_with_funding", + "usdc_portfolio_value" + ] + }, + "SharePrice": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "share_price": { + "type": "number", + "format": "double", + "example": "0.0001" + } + }, + "title": "SharePrice", + "required": [ + "timestamp", + "share_price" + ] }, - "title": "ReqGetPublicPoolsMetadata", - "required": [ - "index", - "limit" - ] - }, - "ReqGetPushNotifSettings": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "expo_token": { - "type": "string" - } + "SimpleOrder": { + "type": "object", + "properties": { + "order_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "order_id": { + "type": "string", + "example": "1" + }, + "owner_account_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "initial_base_amount": { + "type": "string", + "example": "0.1" + }, + "remaining_base_amount": { + "type": "string", + "example": "0.1" + }, + "price": { + "type": "string", + "example": "3024.66" + }, + "order_expiry": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "transaction_time": { + "type": "integer", + "format": "int64" + } + }, + "title": "SimpleOrder", + "required": [ + "order_index", + "order_id", + "owner_account_index", + "initial_base_amount", + "remaining_base_amount", + "price", + "order_expiry", + "transaction_time" + ] + }, + "Status": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "network_id": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1717777777" + } + }, + "title": "Status", + "required": [ + "status", + "network_id", + "timestamp" + ] }, - "title": "ReqGetPushNotifSettings", - "required": [ - "account_index", - "expo_token" - ] - }, - "ReqGetRangeWithCursor": { - "type": "object", - "properties": { - "cursor": { - "type": "string" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } + "SubAccounts": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "sub_accounts": { + "type": "array", + "example": "1", + "items": { + "$ref": "#/components/schemas/Account" + } + }, + "next_cursor": { + "type": "string" + } + }, + "title": "SubAccounts", + "required": [ + "code", + "l1_address", + "sub_accounts" + ] }, - "title": "ReqGetRangeWithCursor", - "required": [ - "limit" - ] - }, - "ReqGetRangeWithIndex": { - "type": "object", - "properties": { - "index": { - "type": "integer", - "format": "int64" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } + "Trade": { + "type": "object", + "properties": { + "trade_id": { + "type": "integer", + "format": "int64", + "example": "145" + }, + "tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "type": { + "type": "string", + "example": "trade", + "enum": [ + "trade", + "liquidation", + "deleverage", + "market-settlement" + ] + }, + "market_id": { + "type": "integer", + "format": "int16", + "example": "1" + }, + "size": { + "type": "string", + "example": "0.1" + }, + "price": { + "type": "string", + "example": "3024.66" + }, + "usd_amount": { + "type": "string", + "example": "3024.66" + }, + "ask_id": { + "type": "integer", + "format": "int64", + "example": "145" + }, + "bid_id": { + "type": "integer", + "format": "int64", + "example": "245" + }, + "ask_account_id": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "bid_account_id": { + "type": "integer", + "format": "int64", + "example": "3" + }, + "is_maker_ask": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "block_height": { + "type": "integer", + "format": "int64", + "example": "45434" + }, + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "taker_fee": { + "type": "integer", + "format": "int32", + "example": "0" + }, + "taker_position_size_before": { + "type": "string", + "example": "0" + }, + "taker_entry_quote_before": { + "type": "string", + "example": "0" + }, + "taker_initial_margin_fraction_before": { + "type": "integer", + "format": "uin16", + "example": "0" + }, + "taker_position_sign_changed": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "maker_fee": { + "type": "integer", + "format": "int32", + "example": "0" + }, + "maker_position_size_before": { + "type": "string", + "example": "0" + }, + "maker_entry_quote_before": { + "type": "string", + "example": "0" + }, + "maker_initial_margin_fraction_before": { + "type": "integer", + "format": "uin16", + "example": "0" + }, + "maker_position_sign_changed": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1771943742851429" + }, + "bid_account_pnl": { + "type": "string", + "description": "Realized PnL for the queried account index, triggered by reducing a short position", + "example": "-0.022890" + }, + "ask_account_pnl": { + "type": "string", + "description": "Realized PnL for the queried account index, triggered by reducing a long position, or a spot position", + "example": "1.989696" + }, + "ask_client_id": { + "type": "integer", + "format": "int64", + "example": "145" + }, + "bid_client_id": { + "type": "integer", + "format": "int64", + "example": "245" + }, + "ask_client_id_str": { + "type": "string", + "example": "145" + }, + "bid_client_id_str": { + "type": "string", + "example": "245" + }, + "ask_id_str": { + "type": "string", + "example": "145" + }, + "bid_id_str": { + "type": "string", + "example": "245" + }, + "trade_id_str": { + "type": "string", + "example": "145" + }, + "integrator_maker_fee": { + "type": "integer", + "format": "int32", + "example": "50" + }, + "integrator_maker_fee_collector_index": { + "type": "integer", + "format": "int64", + "example": "156" + }, + "integrator_taker_fee": { + "type": "integer", + "format": "int32", + "example": "50" + }, + "integrator_taker_fee_collector_index": { + "type": "integer", + "format": "int64", + "example": "156" + }, + "taker_allocated_margin_usdc_before": { + "type": "integer", + "format": "int64", + "example": "1100000000000000" + }, + "taker_allocated_margin_usdc_after": { + "type": "integer", + "format": "int64", + "example": "150000000000000" + }, + "maker_allocated_margin_usdc_before": { + "type": "integer", + "format": "int64", + "example": "210000000000000" + }, + "maker_allocated_margin_usdc_after": { + "type": "integer", + "format": "int64", + "example": "250000000000000" + } + }, + "title": "Trade", + "required": [ + "trade_id", + "trade_id_str", + "tx_hash", + "type", + "market_id", + "size", + "price", + "usd_amount", + "ask_id", + "bid_id", + "ask_client_id", + "ask_client_id_str", + "bid_client_id", + "bid_client_id_str", + "ask_account_id", + "bid_account_id", + "is_maker_ask", + "block_height", + "timestamp", + "taker_position_size_before", + "taker_entry_quote_before", + "taker_initial_margin_fraction_before", + "taker_position_sign_changed", + "maker_position_size_before", + "maker_entry_quote_before", + "maker_initial_margin_fraction_before", + "maker_position_sign_changed", + "transaction_time", + "ask_account_pnl", + "bid_account_pnl", + "integrator_taker_fee", + "integrator_taker_fee_collector_index", + "integrator_maker_fee", + "integrator_maker_fee_collector_index", + "taker_allocated_margin_usdc_before", + "taker_allocated_margin_usdc_after", + "maker_allocated_margin_usdc_before", + "maker_allocated_margin_usdc_after" + ] + }, + "Trades": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "next_cursor": { + "type": "string" + }, + "trades": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Trade" + } + } + }, + "title": "Trades", + "required": [ + "code", + "trades" + ] }, - "title": "ReqGetRangeWithIndex", - "required": [ - "limit" - ] - }, - "ReqGetRangeWithIndexSortable": { - "type": "object", - "properties": { - "index": { - "type": "integer", - "format": "int64" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - }, - "sort": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - } + "TransferFeeInfo": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "transfer_fee_usdc": { + "type": "integer", + "format": "int64" + } + }, + "title": "TransferFeeInfo", + "required": [ + "code", + "transfer_fee_usdc" + ] }, - "title": "ReqGetRangeWithIndexSortable" - }, - "ReqGetRecentTrades": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } + "TransferHistory": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "transfers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransferHistoryItem" + } + }, + "cursor": { + "type": "string" + } + }, + "title": "TransferHistory", + "required": [ + "code", + "transfers", + "cursor" + ] }, - "title": "ReqGetRecentTrades", - "required": [ - "market_id", - "limit" - ] - }, - "ReqGetTrades": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "market_id": { - "type": "integer", - "format": "int16", - "default": "255" - }, - "account_index": { - "type": "integer", - "format": "int64", - "default": "-1" - }, - "order_index": { - "type": "integer", - "format": "int64" - }, - "sort_by": { - "type": "string", - "enum": [ - "block_height", - "timestamp", - "trade_id" - ] - }, - "sort_dir": { - "type": "string", - "enum": [ - "desc" - ], - "default": "desc" - }, - "cursor": { - "type": "string" - }, - "from": { - "type": "integer", - "format": "int64", - "default": "-1" - }, - "ask_filter": { - "type": "integer", - "format": "int8", - "default": "-1" - }, - "role": { - "type": "string", - "enum": [ - "all", - "maker", - "taker" - ], - "default": "all" - }, - "type": { - "type": "string", - "enum": [ - "all", - "trade", - "liquidation", - "deleverage", - "market-settlement" - ], - "default": "all" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - }, - "aggregate": { - "type": "boolean", - "format": "boolean", - "default": "false" - } + "TransferHistoryItem": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "string", + "example": "0.1" + }, + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "type": { + "type": "string", + "enum": [ + "L2TransferInflow", + "L2TransferOutflow", + "L2BurnSharesInflow", + "L2BurnSharesOutflow", + "L2MintSharesInflow", + "L2MintSharesOutflow", + "L2SelfTransfer", + "L2StakeAssetInflow", + "L2StakeAssetOutflow", + "L2UnstakeAssetInflow", + "L2UnstakeAssetOutflow", + "L2ForceBurnSharesInflow", + "L2ForceBurnSharesOutflow" + ] + }, + "from_l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "to_l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "from_account_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "to_account_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "asset_id": { + "type": "integer", + "format": "int16" + }, + "fee": { + "type": "string" + }, + "from_route": { + "type": "string", + "enum": [ + "spot", + "perps" + ] + }, + "to_route": { + "type": "string", + "enum": [ + "spot", + "perps" + ] + } + }, + "title": "TransferHistoryItem", + "required": [ + "id", + "amount", + "timestamp", + "type", + "from_l1_address", + "to_l1_address", + "from_account_index", + "to_account_index", + "tx_hash", + "asset_id", + "fee", + "from_route", + "to_route" + ] + }, + "Tx": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "type": { + "type": "integer", + "format": "uint8", + "example": "1", + "maximum": 64, + "minimum": 1 + }, + "info": { + "type": "string", + "example": "{}" + }, + "event_info": { + "type": "string", + "example": "{}" + }, + "status": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "transaction_index": { + "type": "integer", + "format": "int64", + "example": "8761" + }, + "l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "account_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "nonce": { + "type": "integer", + "format": "int64", + "example": "722" + }, + "expire_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "block_height": { + "type": "integer", + "format": "int64", + "example": "45434" + }, + "queued_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "executed_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "sequence_index": { + "type": "integer", + "format": "int64", + "example": "8761" + }, + "parent_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "api_key_index": { + "type": "integer", + "format": "uint8" + }, + "transaction_time": { + "type": "integer", + "format": "int64" + } + }, + "title": "Tx", + "required": [ + "hash", + "type", + "info", + "event_info", + "status", + "transaction_index", + "l1_address", + "account_index", + "nonce", + "expire_at", + "block_height", + "queued_at", + "executed_at", + "sequence_index", + "parent_hash", + "api_key_index", + "transaction_time" + ] + }, + "TxHash": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + } + }, + "title": "TxHash", + "required": [ + "code", + "tx_hash" + ] }, - "title": "ReqGetTrades", - "required": [ - "sort_by", - "limit" - ] - }, - "ReqGetTransferFeeInfo": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "to_account_index": { - "type": "integer", - "format": "int64", - "default": "-1" - } + "Txs": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "txs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tx" + } + } + }, + "title": "Txs", + "required": [ + "code", + "txs" + ] }, - "title": "ReqGetTransferFeeInfo", - "required": [ - "account_index" - ] - }, - "ReqGetTransferHistory": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "cursor": { - "type": "string" - }, - "type": { - "type": "array", - "items": { - "type": "string" - }, - "enum": [ - "all", - "L2Transfer", - "L2MintShares", - "L2BurnShares", - "L2StakeAssets", - "L2UnstakeAssets" - ] - } + "ValidatorInfo": { + "type": "object", + "properties": { + "address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "is_active": { + "type": "boolean", + "format": "boolean", + "example": "true" + } + }, + "title": "ValidatorInfo", + "required": [ + "address", + "is_active" + ] }, - "title": "ReqGetTransferHistory", - "required": [ - "account_index" - ] - }, - "ReqGetTx": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "hash", - "sequence_index" - ] - }, - "value": { - "type": "string" - } + "WithdrawHistory": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "withdraws": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WithdrawHistoryItem" + } + }, + "cursor": { + "type": "string" + } + }, + "title": "WithdrawHistory", + "required": [ + "code", + "withdraws", + "cursor" + ] }, - "title": "ReqGetTx", - "required": [ - "by", - "value" - ] - }, - "ReqGetUserReferrals": { - "type": "object", - "properties": { - "auth": { - "type": "string" + "WithdrawHistoryItem": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "amount": { + "type": "string", + "example": "0.1" + }, + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "status": { + "type": "string", + "enum": [ + "failed", + "pending", + "claimable", + "refunded", + "completed" + ] + }, + "type": { + "type": "string", + "enum": [ + "secure", + "fast" + ] + }, + "l1_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "asset_id": { + "type": "integer", + "format": "int16" + } }, - "l1_address": { - "type": "string" + "title": "WithdrawHistoryItem", + "required": [ + "id", + "amount", + "timestamp", + "status", + "type", + "l1_tx_hash", + "asset_id" + ] + }, + "ZkLighterInfo": { + "type": "object", + "properties": { + "contract_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + } }, - "cursor": { - "type": "string" - } - }, - "title": "ReqGetUserReferrals", - "required": [ - "l1_address" - ] - }, - "ReqGetWithdrawHistory": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "cursor": { - "type": "string" - }, - "filter": { - "type": "string", - "enum": [ - "all", - "pending", - "claimable" - ] - } - }, - "title": "ReqGetWithdrawHistory", - "required": [ - "account_index" - ] - }, - "ReqLITLease": { - "type": "object", - "properties": { - "tx_info": { - "type": "string" - }, - "lease_amount": { - "type": "string" - }, - "duration_days": { - "type": "integer", - "format": "int32" - } + "title": "ZkLighterInfo", + "required": [ + "contract_address" + ] }, - "title": "ReqLITLease", - "required": [ - "tx_info", - "lease_amount", - "duration_days" - ] - }, - "ReqPostApiToken": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "expiry": { - "type": "integer", - "format": "int64" - }, - "sub_account_access": { - "type": "boolean", - "format": "boolean" - }, - "scopes": { - "type": "string", - "example": "read.*", - "default": "read.*" - } - }, - "title": "ReqPostApiToken", - "required": [ - "name", - "account_index", - "expiry", - "sub_account_access" - ] - }, - "ReqRegisterPushNotifToken": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "expo_token": { - "type": "string" - }, - "platform": { - "type": "string", - "enum": [ - "ios", - "android" - ] - }, - "app_version": { - "type": "string" - } + "ReqFastwithdraw": { + "type": "object", + "properties": { + "tx_info": { + "type": "string" + }, + "to_address": { + "type": "string" + }, + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + } + }, + "title": "ReqFastwithdraw", + "required": [ + "tx_info", + "to_address" + ] }, - "title": "ReqRegisterPushNotifToken", - "required": [ - "account_index", - "expo_token", - "platform" - ] - }, - "ReqRevokeApiToken": { - "type": "object", - "properties": { - "token_id": { - "type": "integer", - "format": "int64" - }, - "account_index": { - "type": "integer", - "format": "int64" - } + "ReqPostApiToken": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expiry": { + "type": "integer", + "format": "int64" + }, + "sub_account_access": { + "type": "boolean", + "format": "boolean" + }, + "scopes": { + "type": "string", + "example": "read.*", + "default": "read.*" + } + }, + "title": "ReqPostApiToken", + "required": [ + "name", + "account_index", + "expiry", + "sub_account_access" + ] + }, + "ReqRevokeApiToken": { + "type": "object", + "properties": { + "token_id": { + "type": "integer", + "format": "int64" + }, + "account_index": { + "type": "integer", + "format": "int64" + } + }, + "title": "ReqRevokeApiToken", + "required": [ + "token_id", + "account_index" + ] }, - "title": "ReqRevokeApiToken", - "required": [ - "token_id", - "account_index" - ] - }, - "ReqSendTx": { - "type": "object", - "properties": { - "tx_type": { - "type": "integer", - "format": "uint8" - }, - "tx_info": { - "type": "string" - }, - "price_protection": { - "type": "boolean", - "format": "boolean", - "default": "true" - } + "RespGetApiTokens": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "api_tokens": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApiToken" + } + } + }, + "title": "RespGetApiTokens", + "required": [ + "code", + "api_tokens" + ] }, - "title": "ReqSendTx", - "required": [ - "tx_type", - "tx_info" - ] - }, - "ReqSendTxBatch": { - "type": "object", - "properties": { - "tx_types": { - "type": "string" - }, - "tx_infos": { - "type": "string" - } + "RespGetFastwithdrawalInfo": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "to_account_index": { + "type": "integer", + "format": "int64" + }, + "withdraw_limit": { + "type": "string" + }, + "max_withdrawal_amount": { + "type": "string" + } + }, + "title": "RespGetFastwithdrawalInfo", + "required": [ + "code", + "to_account_index", + "withdraw_limit", + "max_withdrawal_amount" + ] }, - "title": "ReqSendTxBatch", - "required": [ - "tx_types", - "tx_infos" - ] - }, - "ReqUnregisterPushNotifToken": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "expo_token": { - "type": "string" - } + "RespPostApiToken": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "token_id": { + "type": "integer", + "format": "int64" + }, + "api_token": { + "type": "string" + }, + "name": { + "type": "string" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expiry": { + "type": "integer", + "format": "int64" + }, + "sub_account_access": { + "type": "boolean", + "format": "boolean" + }, + "revoked": { + "type": "boolean", + "format": "boolean" + }, + "scopes": { + "type": "string" + } + }, + "title": "RespPostApiToken", + "required": [ + "code", + "token_id", + "api_token", + "name", + "account_index", + "expiry", + "sub_account_access", + "revoked", + "scopes" + ] + }, + "RespRevokeApiToken": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "token_id": { + "type": "integer", + "format": "int64" + }, + "revoked": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "RespRevokeApiToken", + "required": [ + "code", + "token_id", + "revoked" + ] }, - "title": "ReqUnregisterPushNotifToken", - "required": [ - "account_index", - "expo_token" - ] - }, - "ReqUpdatePushNotifSettings": { - "type": "object", - "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "expo_token": { - "type": "string" - }, - "enabled": { - "type": "boolean", - "format": "boolean" - } + "ApiToken": { + "type": "object", + "properties": { + "token_id": { + "type": "integer", + "format": "int64" + }, + "api_token": { + "type": "string" + }, + "name": { + "type": "string" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "expiry": { + "type": "integer", + "format": "int64" + }, + "sub_account_access": { + "type": "boolean", + "format": "boolean" + }, + "revoked": { + "type": "boolean", + "format": "boolean" + }, + "scopes": { + "type": "string" + } + }, + "title": "ApiToken", + "required": [ + "token_id", + "api_token", + "name", + "account_index", + "expiry", + "sub_account_access", + "revoked", + "scopes" + ] + }, + "ReqUpdateReferralCode": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "new_referral_code": { + "type": "string" + } + }, + "title": "ReqUpdateReferralCode", + "required": [ + "account_index", + "new_referral_code" + ] }, - "title": "ReqUpdatePushNotifSettings", - "required": [ - "account_index", - "expo_token", - "enabled" - ] - }, - "RespChangeAccountTier": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - } + "RespUpdateReferralCode": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "success": { + "type": "boolean", + "format": "boolean", + "example": "true" + } + }, + "title": "RespUpdateReferralCode", + "required": [ + "code", + "success" + ] }, - "title": "RespChangeAccountTier", - "required": [ - "code" - ] - }, - "RespGetApiTokens": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "api_tokens": { - "type": "array", - "items": { - "$ref": "#/definitions/ApiToken" + "CreateIntentAddressResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "intent_address": { + "type": "string" } - } + }, + "title": "CreateIntentAddressResp", + "required": [ + "code", + "intent_address" + ] }, - "title": "RespGetApiTokens", - "required": [ - "code", - "api_tokens" - ] - }, - "RespGetBridgesByL1Addr": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "bridges": { - "type": "array", - "items": { - "$ref": "#/definitions/Bridge" + "ReqUseReferralCode": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "l1_address": { + "type": "string" + }, + "referral_code": { + "type": "string" + }, + "discord": { + "type": "string" + }, + "telegram": { + "type": "string" + }, + "x": { + "type": "string" + }, + "signature": { + "type": "string" } - } + }, + "title": "ReqUseReferralCode", + "required": [ + "l1_address", + "referral_code", + "x" + ] }, - "title": "RespGetBridgesByL1Addr", - "required": [ - "code", - "bridges" - ] - }, - "RespGetExchangeMetrics": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "metrics": { - "type": "array", - "items": { - "$ref": "#/definitions/ExchangeMetric" + "ReqCreateIntentAddress": { + "type": "object", + "properties": { + "chain_id": { + "type": "string" + }, + "from_addr": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "is_external_deposit": { + "type": "boolean", + "format": "boolean" } - } + }, + "title": "ReqCreateIntentAddress", + "required": [ + "chain_id", + "from_addr", + "amount" + ] }, - "title": "RespGetExchangeMetrics", - "required": [ - "code", - "metrics" - ] - }, - "RespGetExecuteStats": { - "type": "object", - "properties": { - "period": { - "type": "string", - "enum": [ - "d", - "w", - "m", - "q", - "y", - "all" - ] - }, - "result": { - "type": "array", - "items": { - "$ref": "#/definitions/ExecuteStat" + "BridgeSupportedNetworks": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "networks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BridgeSupportedNetwork" + } } - } - }, - "title": "RespGetExecuteStats", - "required": [ - "period", - "result" - ] - }, - "RespGetFastBridgeInfo": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "fast_bridge_limit": { - "type": "string" - } - }, - "title": "RespGetFastBridgeInfo", - "required": [ - "code", - "fast_bridge_limit" - ] - }, - "RespGetFastwithdrawalInfo": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "to_account_index": { - "type": "integer", - "format": "int64" - }, - "withdraw_limit": { - "type": "string" - }, - "max_withdrawal_amount": { - "type": "string" - } - }, - "title": "RespGetFastwithdrawalInfo", - "required": [ - "code", - "to_account_index", - "withdraw_limit", - "max_withdrawal_amount" - ] - }, - "RespGetIsNextBridgeFast": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "is_next_bridge_fast": { - "type": "boolean", - "format": "boolean" - } - }, - "title": "RespGetIsNextBridgeFast", - "required": [ - "code", - "is_next_bridge_fast" - ] - }, - "RespGetLeaseOptions": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "options": { - "type": "array", - "items": { - "$ref": "#/definitions/LeaseOptionEntry" - } - }, - "lit_incentives_account_index": { - "type": "integer", - "format": "int64" - } - }, - "title": "RespGetLeaseOptions", - "required": [ - "code", - "options", - "lit_incentives_account_index" - ] - }, - "RespGetLeases": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" }, - "message": { - "type": "string" - }, - "leases": { - "type": "array", - "items": { - "$ref": "#/definitions/LeaseEntry" + "title": "BridgeSupportedNetworks", + "required": [ + "code", + "networks" + ] + }, + "ReferralCode": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "referral_code": { + "type": "string", + "example": "5V24K3MJ" + }, + "remaining_usage": { + "type": "integer", + "format": "int32", + "example": "3" } }, - "next_cursor": { - "type": "string" - } + "title": "ReferralCode", + "required": [ + "code", + "referral_code", + "remaining_usage" + ] }, - "title": "RespGetLeases", - "required": [ - "code", - "leases" - ] - }, - "RespGetPushNotifSettings": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "enabled": { - "type": "boolean", - "format": "boolean" - } - }, - "title": "RespGetPushNotifSettings", - "required": [ - "code", - "account_index", - "enabled" - ] - }, - "RespPostApiToken": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "token_id": { - "type": "integer", - "format": "int64" - }, - "api_token": { - "type": "string" - }, - "name": { - "type": "string" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "expiry": { - "type": "integer", - "format": "int64" - }, - "sub_account_access": { - "type": "boolean", - "format": "boolean" - }, - "revoked": { - "type": "boolean", - "format": "boolean" + "ReqCreateReferralCode": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + } }, - "scopes": { - "type": "string" - } + "title": "ReqCreateReferralCode", + "required": [ + "account_index" + ] }, - "title": "RespPostApiToken", - "required": [ - "code", - "token_id", - "api_token", - "name", - "account_index", - "expiry", - "sub_account_access", - "revoked", - "scopes" - ] - }, - "RespPublicPoolsMetadata": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "public_pools": { - "type": "array", - "items": { - "$ref": "#/definitions/PublicPoolMetadata" + "ReqUpdateKickback": { + "type": "object", + "properties": { + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "kickback_percentage": { + "type": "number", + "format": "double", + "maximum": 100 } - } - }, - "title": "RespPublicPoolsMetadata", - "required": [ - "code", - "public_pools" - ] - }, - "RespRevokeApiToken": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "token_id": { - "type": "integer", - "format": "int64" - }, - "revoked": { - "type": "boolean", - "format": "boolean" - } - }, - "title": "RespRevokeApiToken", - "required": [ - "code", - "token_id", - "revoked" - ] - }, - "RespSendTx": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "predicted_execution_time_ms": { - "type": "integer", - "format": "int64", - "example": "1751465474" - }, - "volume_quota_remaining": { - "type": "integer", - "format": "int64" - } - }, - "title": "RespSendTx", - "required": [ - "code", - "tx_hash", - "predicted_execution_time_ms", - "volume_quota_remaining" - ] - }, - "RespSendTxBatch": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" }, - "tx_hash": { - "type": "array", - "items": { + "title": "ReqUpdateKickback", + "required": [ + "account_index", + "kickback_percentage" + ] + }, + "Deposit": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "source": { + "type": "string", + "example": "Arbitrum" + }, + "source_chain_id": { + "type": "string", + "example": "42161" + }, + "fast_bridge_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "batch_claim_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "cctp_burn_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "amount": { + "type": "string" + }, + "intent_address": { + "type": "string" + }, + "status": { + "type": "string" + }, + "step": { + "type": "string" + }, + "description": { + "type": "string" + }, + "created_at": { + "type": "integer", + "format": "int64" + }, + "updated_at": { + "type": "integer", + "format": "int64" + }, + "is_external_deposit": { + "type": "boolean", + "format": "boolean" + }, + "is_next_bridge_fast": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "Deposit", + "required": [ + "code", + "source", + "source_chain_id", + "fast_bridge_tx_hash", + "batch_claim_tx_hash", + "cctp_burn_tx_hash", + "amount", + "intent_address", + "status", + "step", + "description", + "created_at", + "updated_at", + "is_external_deposit", + "is_next_bridge_fast" + ] + }, + "RespUpdateKickback": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { "type": "string" + }, + "success": { + "type": "boolean", + "format": "boolean", + "example": "true" } }, - "predicted_execution_time_ms": { - "type": "integer", - "format": "int64", - "example": "1751465474" - }, - "volume_quota_remaining": { - "type": "integer", - "format": "int64" - } - }, - "title": "RespSendTxBatch", - "required": [ - "code", - "tx_hash", - "predicted_execution_time_ms", - "volume_quota_remaining" - ] - }, - "RespWithdrawalDelay": { - "type": "object", - "properties": { - "seconds": { - "type": "integer", - "format": "int64", - "example": "86400" - } + "title": "RespUpdateKickback", + "required": [ + "code", + "success" + ] }, - "title": "RespWithdrawalDelay", - "required": [ - "seconds" - ] - }, - "ResultCode": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - } - }, - "title": "ResultCode", - "required": [ - "code" - ] - }, - "RiskInfo": { - "type": "object", - "properties": { - "cross_risk_parameters": { - "$ref": "#/definitions/RiskParameters" - }, - "isolated_risk_parameters": { - "type": "array", - "items": { - "$ref": "#/definitions/RiskParameters" + "Layer1BasicInfo": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "l1_providers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/L1ProviderInfo" + } + }, + "l1_providers_health": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "validator_info": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ValidatorInfo" + } + }, + "contract_addresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContractAddress" + } + }, + "latest_l1_generic_block": { + "type": "integer", + "format": "int64", + "example": "45434" + }, + "latest_l1_governance_block": { + "type": "integer", + "format": "int64", + "example": "45434" + }, + "latest_l1_desert_block": { + "type": "integer", + "format": "int64", + "example": "45434" + } + }, + "title": "Layer1BasicInfo", + "required": [ + "code", + "l1_providers", + "l1_providers_health", + "validator_info", + "contract_addresses", + "latest_l1_generic_block", + "latest_l1_governance_block", + "latest_l1_desert_block" + ] + }, + "RespGetExchangeMetrics": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExchangeMetric" + } } - } - }, - "title": "RiskInfo", - "required": [ - "cross_risk_parameters", - "isolated_risk_parameters" - ] - }, - "RiskParameters": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "int16" - }, - "collateral": { - "type": "string" - }, - "total_account_value": { - "type": "string" }, - "initial_margin_req": { - "type": "string" - }, - "maintenance_margin_req": { - "type": "string" - }, - "close_out_margin_req": { - "type": "string" - } - }, - "title": "RiskParameters", - "required": [ - "market_id", - "collateral", - "total_account_value", - "initial_margin_req", - "maintenance_margin_req", - "close_out_margin_req" - ] - }, - "SharePrice": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "share_price": { - "type": "number", - "format": "double", - "example": "0.0001" - } - }, - "title": "SharePrice", - "required": [ - "timestamp", - "share_price" - ] - }, - "SimpleOrder": { - "type": "object", - "properties": { - "order_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "order_id": { - "type": "string", - "example": "1" - }, - "owner_account_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "initial_base_amount": { - "type": "string", - "example": "0.1" - }, - "remaining_base_amount": { - "type": "string", - "example": "0.1" - }, - "price": { - "type": "string", - "example": "3024.66" - }, - "order_expiry": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "transaction_time": { - "type": "integer", - "format": "int64", - "example": "1257894000000000" - } - }, - "title": "SimpleOrder", - "required": [ - "order_index", - "order_id", - "owner_account_index", - "initial_base_amount", - "remaining_base_amount", - "price", - "order_expiry", - "transaction_time" - ] - }, - "SlippageResult": { - "type": "object", - "properties": { - "exchange": { - "type": "string", - "example": "lighter" - }, - "market": { - "type": "string", - "example": "ETH" - }, - "size_usd": { - "type": "integer", - "format": "int64", - "example": "1000" - }, - "avg_slippage": { - "type": "number", - "format": "double", - "example": "0.5" - }, - "data_count": { - "type": "integer", - "format": "int64", - "example": "100" - } - }, - "title": "SlippageResult", - "required": [ - "exchange", - "market", - "size_usd", - "avg_slippage", - "data_count" - ] - }, - "SpotAvgEntryPrice": { - "type": "object", - "properties": { - "asset_id": { - "type": "integer", - "format": "int16" - }, - "avg_entry_price": { - "type": "string" - }, - "asset_size": { - "type": "string" - }, - "last_trade_id": { - "type": "integer", - "format": "int64" - } - }, - "title": "SpotAvgEntryPrice", - "required": [ - "asset_id", - "avg_entry_price", - "asset_size", - "last_trade_id" - ] - }, - "SpotMarketStats": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "example": "ETH/USDC" - }, - "market_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "index_price": { - "type": "string", - "example": "3024.66" - }, - "mid_price": { - "type": "string", - "example": "3024.66" - }, - "last_trade_price": { - "type": "string", - "example": "3024.66" - }, - "daily_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "daily_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "daily_price_low": { - "type": "number", - "format": "double", - "example": "3014.66" - }, - "daily_price_high": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "daily_price_change": { - "type": "number", - "format": "double", - "example": "3.66" - } + "title": "RespGetExchangeMetrics", + "required": [ + "code", + "metrics" + ] }, - "title": "SpotMarketStats", - "required": [ - "symbol", - "market_id", - "index_price", - "mid_price", - "last_trade_price", - "daily_base_token_volume", - "daily_quote_token_volume", - "daily_price_low", - "daily_price_high", - "daily_price_change" - ] - }, - "SpotOrderBookDetail": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "example": "ETH" - }, - "market_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "market_type": { - "type": "string", - "example": "perp", - "enum": [ - "perp", - "spot" - ] - }, - "base_asset_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "quote_asset_id": { - "type": "integer", - "format": "int16", - "example": "2" - }, - "status": { - "type": "string", - "example": "active", - "enum": [ - "inactive", - "active" - ] - }, - "taker_fee": { - "type": "string", - "example": "0.0001" - }, - "maker_fee": { - "type": "string", - "example": "0.0000" - }, - "liquidation_fee": { - "type": "string", - "example": "0.01" - }, - "min_base_amount": { - "type": "string", - "example": "0.01" - }, - "min_quote_amount": { - "type": "string", - "example": "0.1" - }, - "order_quote_limit": { - "type": "string", - "example": "235.25" - }, - "supported_size_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "supported_price_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "supported_quote_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "size_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "price_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "last_trade_price": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "daily_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "daily_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "daily_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "daily_price_low": { - "type": "number", - "format": "double", - "example": "3014.66" - }, - "daily_price_high": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "daily_price_change": { - "type": "number", - "format": "double", - "example": "3.66" - }, - "daily_chart": { - "type": "object", - "example": "{1640995200:3024.66}", - "additionalProperties": { + "ExchangeMetric": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "data": { "type": "number", - "format": "double" + "format": "double", + "example": "93566.25" } - } - }, - "title": "SpotOrderBookDetail", - "required": [ - "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" - ] - }, - "Status": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "format": "int32", - "example": "1" - }, - "network_id": { - "type": "integer", - "format": "int32", - "example": "1" - }, - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1717777777" - } - }, - "title": "Status", - "required": [ - "status", - "network_id", - "timestamp" - ] - }, - "Strategy": { - "type": "object", - "properties": { - "collateral": { - "type": "string", - "example": "199955" - } + }, + "title": "ExchangeMetric", + "required": [ + "timestamp", + "data" + ] }, - "title": "Strategy", - "required": [ - "collateral" - ] - }, - "SubAccounts": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "sub_accounts": { - "type": "array", - "example": "1", - "items": { - "$ref": "#/definitions/Account" + "ExecuteStat": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64" + }, + "slippage": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SlippageResult" + } } - } - }, - "title": "SubAccounts", - "required": [ - "code", - "l1_address", - "sub_accounts" - ] - }, - "SystemConfig": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "liquidity_pool_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "staking_pool_index": { - "type": "integer", - "format": "int64", - "example": "2" - }, - "funding_fee_rebate_account_index": { - "type": "integer", - "format": "int64", - "example": "2" - }, - "liquidity_pool_cooldown_period": { - "type": "integer", - "format": "int64", - "example": "86400" - }, - "staking_pool_lockup_period": { - "type": "integer", - "format": "int64", - "example": "604800" - }, - "max_integrator_spot_taker_fee": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "max_integrator_spot_maker_fee": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "max_integrator_perps_taker_fee": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "max_integrator_perps_maker_fee": { - "type": "integer", - "format": "int32", - "example": "200" - } - }, - "title": "SystemConfig", - "required": [ - "code", - "liquidity_pool_index", - "staking_pool_index", - "funding_fee_rebate_account_index", - "liquidity_pool_cooldown_period", - "staking_pool_lockup_period", - "max_integrator_spot_taker_fee", - "max_integrator_spot_maker_fee", - "max_integrator_perps_taker_fee", - "max_integrator_perps_maker_fee" - ] - }, - "Ticker": { - "type": "object", - "properties": { - "s": { - "type": "string", - "example": "ETH" - }, - "a": { - "$ref": "#/definitions/PriceLevel" - }, - "b": { - "$ref": "#/definitions/PriceLevel" - } - }, - "title": "Ticker", - "required": [ - "s", - "a", - "b" - ] - }, - "Trade": { - "type": "object", - "properties": { - "trade_id": { - "type": "integer", - "format": "int64", - "example": "145" - }, - "tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "type": { - "type": "string", - "example": "trade", - "enum": [ - "trade", - "liquidation", - "deleverage", - "market-settlement" - ] - }, - "market_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "size": { - "type": "string", - "example": "0.1" - }, - "price": { - "type": "string", - "example": "3024.66" - }, - "usd_amount": { - "type": "string", - "example": "3024.66" - }, - "ask_id": { - "type": "integer", - "format": "int64", - "example": "145" - }, - "bid_id": { - "type": "integer", - "format": "int64", - "example": "245" - }, - "ask_client_id": { - "type": "integer", - "format": "int64", - "example": "145" - }, - "bid_client_id": { - "type": "integer", - "format": "int64", - "example": "245" - }, - "ask_account_id": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "bid_account_id": { - "type": "integer", - "format": "int64", - "example": "3" - }, - "is_maker_ask": { - "type": "boolean", - "format": "boolean", - "example": "true" - }, - "block_height": { - "type": "integer", - "format": "int64", - "example": "45434" - }, - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "taker_fee": { - "type": "integer", - "format": "int32", - "example": "0" - }, - "taker_position_size_before": { - "type": "string", - "example": "0" - }, - "taker_entry_quote_before": { - "type": "string", - "example": "0" - }, - "taker_initial_margin_fraction_before": { - "type": "integer", - "format": "uin16", - "example": "0" - }, - "taker_position_sign_changed": { - "type": "boolean", - "format": "boolean", - "example": "true" - }, - "maker_fee": { - "type": "integer", - "format": "int32", - "example": "0" - }, - "maker_position_size_before": { - "type": "string", - "example": "0" - }, - "maker_entry_quote_before": { - "type": "string", - "example": "0" - }, - "maker_initial_margin_fraction_before": { - "type": "integer", - "format": "uin16", - "example": "0" - }, - "maker_position_sign_changed": { - "type": "boolean", - "format": "boolean", - "example": "true" - }, - "transaction_time": { - "type": "integer", - "format": "int64", - "example": "1257894000000000" - }, - "ask_account_pnl": { - "type": "string", - "example": "1967" - }, - "bid_account_pnl": { - "type": "string", - "example": "1967" - } - }, - "title": "Trade", - "required": [ - "trade_id", - "tx_hash", - "type", - "market_id", - "size", - "price", - "usd_amount", - "ask_id", - "bid_id", - "ask_client_id", - "bid_client_id", - "ask_account_id", - "bid_account_id", - "is_maker_ask", - "block_height", - "timestamp", - "taker_fee", - "taker_position_size_before", - "taker_entry_quote_before", - "taker_initial_margin_fraction_before", - "taker_position_sign_changed", - "maker_fee", - "maker_position_size_before", - "maker_entry_quote_before", - "maker_initial_margin_fraction_before", - "maker_position_sign_changed", - "transaction_time", - "ask_account_pnl", - "bid_account_pnl" - ] - }, - "TradeStats": { - "type": "object", - "properties": { - "count": { - "type": "integer", - "format": "int64" }, - "volume": { - "type": "string" - }, - "web_count": { - "type": "integer", - "format": "int64" - }, - "web_volume": { - "type": "string" - }, - "mobile_app_count": { - "type": "integer", - "format": "int64" - }, - "mobile_app_volume": { - "type": "string" - }, - "mobile_browser_count": { - "type": "integer", - "format": "int64" - }, - "mobile_browser_volume": { - "type": "string" - } + "required": [ + "timestamp", + "slippage" + ] }, - "title": "TradeStats", - "required": [ - "count", - "volume", - "web_count", - "web_volume", - "mobile_app_count", - "mobile_app_volume", - "mobile_browser_count", - "mobile_browser_volume" - ] - }, - "Trades": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "next_cursor": { - "type": "string" - }, - "trades": { - "type": "array", - "items": { - "$ref": "#/definitions/Trade" + "SlippageResult": { + "type": "object", + "properties": { + "exchange": { + "type": "string", + "example": "lighter" + }, + "market": { + "type": "string", + "example": "ETH" + }, + "size_usd": { + "type": "integer", + "format": "int64", + "example": "1000" + }, + "avg_slippage": { + "type": "number", + "format": "double", + "example": "0.5" + }, + "data_count": { + "type": "integer", + "format": "int64", + "example": "100" + } + }, + "title": "SlippageResult", + "required": [ + "exchange", + "market", + "size_usd", + "avg_slippage", + "data_count" + ] + }, + "RespGetExecuteStats": { + "type": "object", + "properties": { + "period": { + "type": "string", + "enum": [ + "d", + "w", + "m", + "q", + "y", + "all" + ] + }, + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExecuteStat" + } } - } - }, - "title": "Trades", - "required": [ - "code", - "trades" - ] - }, - "TransferFeeInfo": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "transfer_fee_usdc": { - "type": "integer", - "format": "int64" - } - }, - "title": "TransferFeeInfo", - "required": [ - "code", - "transfer_fee_usdc" - ] - }, - "TransferHistory": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" }, - "message": { - "type": "string" + "required": [ + "period", + "result" + ] + }, + "LeaseOptionEntry": { + "type": "object", + "properties": { + "duration_days": { + "type": "integer", + "description": "Lease duration in days", + "format": "int32" + }, + "annual_rate": { + "type": "number", + "format": "double", + "description": "Annual rate as a percentage (e.g. 25.0 means 25%)" + } }, - "transfers": { - "type": "array", - "items": { - "$ref": "#/definitions/TransferHistoryItem" + "required": [ + "duration_days", + "annual_rate" + ] + }, + "RespGetLeaseOptions": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LeaseOptionEntry" + } + }, + "lit_incentives_account_index": { + "type": "integer", + "format": "int64", + "description": "Account index that receives the leasing fee" } }, - "cursor": { - "type": "string" - } + "required": [ + "code", + "options", + "lit_incentives_account_index" + ] }, - "title": "TransferHistory", - "required": [ - "code", - "transfers", - "cursor" - ] - }, - "TransferHistoryItem": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "asset_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "amount": { - "type": "string", - "example": "0.1" - }, - "fee": { - "type": "string", - "example": "3" - }, - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "type": { - "type": "string", - "enum": [ - "L2TransferInflow", - "L2TransferOutflow", - "L2BurnSharesInflow", - "L2BurnSharesOutflow", - "L2MintSharesInflow", - "L2MintSharesOutflow", - "L2SelfTransfer", - "L2StakeAssetInflow", - "L2StakeAssetOutflow", - "L2UnstakeAssetInflow", - "L2UnstakeAssetOutflow", - "L2ForceBurnSharesInflow", - "L2ForceBurnSharesOutflow" - ] - }, - "from_l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "to_l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "from_account_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "to_account_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "from_route": { - "type": "string", - "enum": [ - "spot", - "perps" - ] - }, - "to_route": { - "type": "string", - "enum": [ - "spot", - "perps" - ] - }, - "tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - } + "LeaseEntry": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "Lease ID" + }, + "master_account_index": { + "type": "integer", + "format": "int64", + "description": "Master account index" + }, + "lease_amount": { + "type": "integer", + "format": "int64", + "description": "Leased LIT amount in raw units (1 LIT = 1e8)" + }, + "fee_amount": { + "type": "integer", + "format": "int64", + "description": "Fee paid in raw units" + }, + "start": { + "type": "integer", + "format": "int64", + "description": "Lease start time (Unix milliseconds)" + }, + "end": { + "type": "integer", + "format": "int64", + "description": "Lease end time (Unix milliseconds)" + }, + "status": { + "type": "string", + "enum": [ + "waiting_fee", + "leased", + "expired", + "canceled" + ], + "description": "Lease status" + }, + "error": { + "type": "string", + "description": "Error message if lease was canceled" + } + }, + "required": [ + "end", + "error", + "fee_amount", + "id", + "lease_amount", + "master_account_index", + "start", + "status" + ] + }, + "RespGetLeases": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "leases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LeaseEntry" + } + }, + "next_cursor": { + "type": "string", + "description": "Cursor to pass as the cursor param to fetch the next page. Absent if no more pages." + } + }, + "required": [ + "code", + "leases" + ] }, - "title": "TransferHistoryItem", - "required": [ - "id", - "asset_id", - "amount", - "fee", - "timestamp", - "type", - "from_l1_address", - "to_l1_address", - "from_account_index", - "to_account_index", - "from_route", - "to_route", - "tx_hash" - ] - }, - "TxHash": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - } + "ReqLITLease": { + "type": "object", + "properties": { + "tx_info": { + "type": "string", + "description": "Signed transaction info (JSON with L2 signature, L1 signature, etc.)" + }, + "lease_amount": { + "type": "string", + "description": "Amount of LIT to lease in raw units (1 LIT = 100000000)" + }, + "duration_days": { + "type": "integer", + "description": "Lease duration in days. Must match one of the available lease options.", + "format": "int32" + } + }, + "required": [ + "tx_info", + "lease_amount", + "duration_days" + ] }, - "title": "TxHash", - "required": [ - "code", - "tx_hash" - ] - }, - "TxHashes": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" + "Referral": { + "type": "object", + "properties": { + "l1_address": { + "type": "string" + }, + "referral_code": { + "type": "string" + }, + "used_at": { + "type": "integer", + "format": "int64" + }, + "trade_stats": { + "$ref": "#/components/schemas/TradeStats" + }, + "tier": { + "type": "string" + } }, - "message": { - "type": "string" + "required": [ + "trade_stats", + "l1_address", + "referral_code", + "tier", + "used_at" + ] + }, + "UserReferrals": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "cursor": { + "type": "string" + }, + "referrals": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Referral" + } + }, + "used_code": { + "type": "string" + } }, - "tx_hash": { - "type": "array", - "items": { + "required": [ + "code", + "cursor", + "referrals", + "used_code" + ] + }, + "ReqSetAccountMetadata": { + "type": "object", + "properties": { + "master_account_index": { + "type": "integer", + "format": "int64" + }, + "target_account_index": { + "type": "integer", + "format": "int64" + }, + "api_key_index": { + "type": "integer", + "format": "uint8" + }, + "metadata": { + "type": "string" + }, + "auth": { "type": "string" } - } + }, + "required": [ + "master_account_index", + "target_account_index", + "api_key_index", + "metadata" + ] }, - "title": "TxHashes", - "required": [ - "code", - "tx_hash" - ] - }, - "UserReferrals": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" + "SystemConfig": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "liquidity_pool_index": { + "type": "integer", + "format": "int64" + }, + "staking_pool_index": { + "type": "integer", + "format": "int64" + }, + "funding_fee_rebate_account_index": { + "type": "integer", + "format": "int64" + }, + "liquidity_pool_cooldown_period": { + "type": "integer", + "format": "int64" + }, + "staking_pool_lockup_period": { + "type": "integer", + "format": "int64" + }, + "max_integrator_perps_maker_fee": { + "type": "integer", + "format": "int32" + }, + "max_integrator_perps_taker_fee": { + "type": "integer", + "format": "int32" + }, + "max_integrator_spot_maker_fee": { + "type": "integer", + "format": "int32" + }, + "max_integrator_spot_taker_fee": { + "type": "integer", + "format": "int32" + }, + "market_maker_incentive_account_index": { + "type": "integer", + "format": "int64", + "example": "3" + } + }, + "required": [ + "max_integrator_perps_maker_fee", + "max_integrator_perps_taker_fee", + "max_integrator_spot_maker_fee", + "max_integrator_spot_taker_fee", + "code", + "funding_fee_rebate_account_index", + "liquidity_pool_cooldown_period", + "liquidity_pool_index", + "staking_pool_index", + "staking_pool_lockup_period", + "market_maker_incentive_account_index" + ] + }, + "PendingUnlock": { + "type": "object", + "properties": { + "unlock_timestamp": { + "type": "integer", + "format": "int64" + }, + "asset_index": { + "type": "integer", + "format": "int16" + }, + "amount": { + "type": "string" + } }, - "message": { - "type": "string" + "required": [ + "unlock_timestamp", + "asset_index", + "amount" + ] + }, + "Strategy": { + "type": "object", + "properties": { + "collateral": { + "type": "string" + } }, - "cursor": { - "type": "string" + "required": [ + "collateral" + ] + }, + "TradeStats": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "format": "int64" + }, + "volume": { + "type": "string" + }, + "web_count": { + "type": "integer", + "format": "int64" + }, + "web_volume": { + "type": "string" + }, + "mobile_app_count": { + "type": "integer", + "format": "int64" + }, + "mobile_app_volume": { + "type": "string" + }, + "mobile_browser_count": { + "type": "integer", + "format": "int64" + }, + "mobile_browser_volume": { + "type": "string" + } }, - "referrals": { - "type": "array", - "items": { - "$ref": "#/definitions/Referral" + "title": "TradeStats", + "required": [ + "count", + "volume", + "web_count", + "web_volume", + "mobile_app_count", + "mobile_app_volume", + "mobile_browser_count", + "mobile_browser_volume" + ] + }, + "ApprovedIntegrator": { + "type": "object", + "properties": { + "account_index": { + "type": "integer", + "format": "int64", + "example": "54621" + }, + "name": { + "type": "string", + "example": "Integrator1" + }, + "max_perps_taker_fee": { + "type": "integer", + "format": "int32", + "example": "10" + }, + "max_perps_maker_fee": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "max_spot_taker_fee": { + "type": "integer", + "format": "int32", + "example": "10" + }, + "max_spot_maker_fee": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "approval_expiry": { + "type": "integer", + "format": "int64", + "example": "1640995200", + "description": " Timestamp in milliseconds, after which the integrator is no longer approved" + } + }, + "title": "ApprovedIntegrator", + "required": [ + "account_index", + "name", + "max_perps_taker_fee", + "max_perps_maker_fee", + "max_spot_taker_fee", + "max_spot_maker_fee", + "approval_expiry" + ] + }, + "Token": { + "type": "object", + "title": "Token", + "required": [ + "symbol", + "name", + "logo", + "logo_extension", + "description_key", + "gecko_id", + "paprika_id", + "market", + "asset_type", + "categories", + "is_allowed_mainnet", + "is_asset_allowed_mainnet" + ], + "properties": { + "symbol": { + "type": "string", + "example": "ETH" + }, + "name": { + "type": "string", + "example": "Ethereum" + }, + "logo": { + "type": "string", + "example": "eth" + }, + "logo_extension": { + "type": "string", + "example": "svg", + "enum": [ + "svg", + "png" + ] + }, + "description_key": { + "type": "string", + "example": "token_description_eth" + }, + "gecko_id": { + "type": "string", + "example": "ethereum" + }, + "paprika_id": { + "type": "string", + "example": "eth-ethereum" + }, + "market": { + "type": "string", + "enum": [ + "SPOT", + "PERPS" + ] + }, + "asset_type": { + "type": "string", + "enum": [ + "CRYPTO", + "RWA" + ] + }, + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "is_allowed_mainnet": { + "type": "boolean", + "format": "boolean" + }, + "is_asset_allowed_mainnet": { + "type": "boolean", + "format": "boolean" } } }, - "title": "UserReferrals", - "required": [ - "code", - "cursor", - "referrals" - ] - }, - "ValidatorInfo": { - "type": "object", - "properties": { - "address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "is_active": { - "type": "boolean", - "format": "boolean", - "example": "true" + "TokenList": { + "type": "object", + "title": "TokenList", + "required": [ + "code", + "tokens" + ], + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": 200 + }, + "message": { + "type": "string" + }, + "tokens": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Token" + } + } } }, - "title": "ValidatorInfo", - "required": [ - "address", - "is_active" - ] - }, - "WithdrawHistory": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "withdraws": { - "type": "array", - "items": { - "$ref": "#/definitions/WithdrawHistoryItem" + "PartnerStats": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "total_fees_earned": { + "type": "string" + }, + "total_taker_fees_earned": { + "type": "string" + }, + "total_maker_fees_earned": { + "type": "string" + }, + "total_volume": { + "type": "string" + }, + "total_taker_volume": { + "type": "string" + }, + "total_maker_volume": { + "type": "string" + }, + "total_trades": { + "type": "integer", + "format": "int64" + }, + "total_taker_trades": { + "type": "integer", + "format": "int64" + }, + "total_maker_trades": { + "type": "integer", + "format": "int64" + }, + "unique_clients": { + "type": "integer", + "format": "int64" } }, - "cursor": { - "type": "string" - } - }, - "title": "WithdrawHistory", - "required": [ - "code", - "withdraws", - "cursor" - ] - }, - "WithdrawHistoryItem": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "asset_id": { - "type": "integer", - "format": "int16", - "example": "1" - }, - "amount": { - "type": "string", - "example": "0.1" - }, - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "status": { - "type": "string", - "enum": [ - "failed", - "pending", - "claimable", - "refunded", - "completed" - ] - }, - "type": { - "type": "string", - "enum": [ - "secure", - "fast" - ] - }, - "l1_tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - } - }, - "title": "WithdrawHistoryItem", - "required": [ - "id", - "asset_id", - "amount", - "timestamp", - "status", - "type", - "l1_tx_hash" - ] - }, - "ZkLighterInfo": { - "type": "object", - "properties": { - "contract_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - } - }, - "title": "ZkLighterInfo", - "required": [ - "contract_address" - ] - } - }, - "securityDefinitions": { - "apiKey": { - "type": "apiKey", - "description": "Enter JWT Bearer token **_only_**", - "name": "Authorization", - "in": "header" + "title": "PartnerStats", + "required": [ + "code", + "total_fees_earned", + "total_taker_fees_earned", + "total_maker_fees_earned", + "total_volume", + "total_taker_volume", + "total_maker_volume", + "total_trades", + "total_taker_trades", + "total_maker_trades", + "unique_clients" + ] + } } } } \ No newline at end of file diff --git a/test/paper_client/helpers.py b/test/paper_client/helpers.py index 9ee17c2..5f278dc 100644 --- a/test/paper_client/helpers.py +++ b/test/paper_client/helpers.py @@ -68,8 +68,14 @@ def default_detail( trading_hours="", funding_fee_discounts_enabled=False, hidden=False, + rfq_enabled=False, ), strategy_index=0, + is_maker_fee_enabled=True, + is_taker_fee_enabled=True, + funding_clamp_small="0", + funding_clamp_big="0", + base_interest_rate="0", )