diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 1559712..4036197 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,16 +1,23 @@ docs/Account.md docs/AccountApi.md docs/AccountApiKeys.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/Accounts.md +docs/AccountTradeStats.md +docs/Announcement.md +docs/AnnouncementApi.md +docs/Announcements.md docs/ApiKey.md docs/Block.md docs/BlockApi.md docs/Blocks.md +docs/BridgeApi.md docs/BridgeSupportedNetwork.md docs/Candlestick.md docs/CandlestickApi.md @@ -26,16 +33,22 @@ docs/DetailedAccounts.md docs/DetailedCandlestick.md docs/EnrichedTx.md docs/ExchangeStats.md -docs/FeeBucket.md +docs/ExportData.md docs/Funding.md +docs/FundingApi.md +docs/FundingRate.md +docs/FundingRates.md docs/Fundings.md docs/InfoApi.md -docs/IsWhitelisted.md +docs/L1Metadata.md docs/L1ProviderInfo.md -docs/Layer2BasicInfo.md +docs/LiqTrade.md docs/Liquidation.md +docs/LiquidationInfo.md +docs/LiquidationInfos.md docs/MarketInfo.md docs/NextNonce.md +docs/NotificationApi.md docs/Order.md docs/OrderApi.md docs/OrderBook.md @@ -47,17 +60,23 @@ docs/OrderBookStats.md docs/OrderBooks.md docs/Orders.md docs/PnLEntry.md +docs/PositionFunding.md +docs/PositionFundings.md docs/PriceLevel.md docs/PublicPool.md docs/PublicPoolInfo.md docs/PublicPoolShare.md docs/PublicPools.md +docs/ReferralApi.md +docs/ReferralPointEntry.md +docs/ReferralPoints.md +docs/ReqExportData.md docs/ReqGetAccount.md -docs/ReqGetAccountActiveOrders.md docs/ReqGetAccountApiKeys.md docs/ReqGetAccountByL1Address.md docs/ReqGetAccountInactiveOrders.md -docs/ReqGetAccountOrders.md +docs/ReqGetAccountLimits.md +docs/ReqGetAccountMetadata.md docs/ReqGetAccountPendingTxs.md docs/ReqGetAccountPnL.md docs/ReqGetAccountTxs.md @@ -66,24 +85,36 @@ docs/ReqGetBlockTxs.md docs/ReqGetByAccount.md docs/ReqGetCandlesticks.md docs/ReqGetDepositHistory.md -docs/ReqGetFeeBucket.md +docs/ReqGetFastWithdrawInfo.md docs/ReqGetFundings.md +docs/ReqGetL1Metadata.md docs/ReqGetL1Tx.md docs/ReqGetLatestDeposit.md +docs/ReqGetLiquidationInfos.md docs/ReqGetNextNonce.md docs/ReqGetOrderBookDetails.md docs/ReqGetOrderBookOrders.md docs/ReqGetOrderBooks.md +docs/ReqGetPositionFunding.md docs/ReqGetPublicPools.md docs/ReqGetRangeWithCursor.md docs/ReqGetRangeWithIndex.md docs/ReqGetRangeWithIndexSortable.md docs/ReqGetRecentTrades.md +docs/ReqGetReferralPoints.md docs/ReqGetTrades.md +docs/ReqGetTransferFeeInfo.md +docs/ReqGetTransferHistory.md docs/ReqGetTx.md docs/ReqGetWithdrawHistory.md -docs/ReqIsWhitelisted.md +docs/RespChangeAccountTier.md +docs/RespGetFastBridgeInfo.md +docs/RespSendTx.md +docs/RespSendTxBatch.md +docs/RespWithdrawalDelay.md docs/ResultCode.md +docs/RiskInfo.md +docs/RiskParameters.md docs/RootApi.md docs/SimpleOrder.md docs/Status.md @@ -92,21 +123,30 @@ docs/Ticker.md docs/Trade.md docs/Trades.md docs/TransactionApi.md +docs/TransferFeeInfo.md +docs/TransferHistory.md +docs/TransferHistoryItem.md docs/Tx.md docs/TxHash.md docs/TxHashes.md docs/Txs.md docs/ValidatorInfo.md docs/WithdrawHistory.md -docs/WithdrawHistoryCursor.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/referral_api.py lighter/api/root_api.py lighter/api/transaction_api.py lighter/api_client.py @@ -116,28 +156,50 @@ lighter/exceptions.py lighter/models/__init__.py lighter/models/account.py lighter/models/account_api_keys.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 lighter/models/block.py lighter/models/blocks.py +lighter/models/bridge_supported_network.py lighter/models/candlestick.py lighter/models/candlesticks.py +lighter/models/contract_address.py lighter/models/current_height.py +lighter/models/cursor.py lighter/models/daily_return.py lighter/models/deposit_history.py 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_stats.py -lighter/models/fee_bucket.py +lighter/models/export_data.py lighter/models/funding.py +lighter/models/funding_rate.py +lighter/models/funding_rates.py lighter/models/fundings.py -lighter/models/layer2_basic_info.py +lighter/models/l1_metadata.py +lighter/models/l1_provider_info.py +lighter/models/liq_trade.py +lighter/models/liquidation.py +lighter/models/liquidation_info.py +lighter/models/liquidation_infos.py +lighter/models/market_info.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_detail.py lighter/models/order_book_details.py lighter/models/order_book_orders.py @@ -145,21 +207,94 @@ lighter/models/order_book_stats.py lighter/models/order_books.py lighter/models/orders.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.py lighter/models/public_pool_info.py lighter/models/public_pool_share.py lighter/models/public_pools.py +lighter/models/referral_point_entry.py +lighter/models/referral_points.py +lighter/models/req_export_data.py +lighter/models/req_get_account.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_pending_txs.py +lighter/models/req_get_account_pn_l.py +lighter/models/req_get_account_txs.py +lighter/models/req_get_block.py +lighter/models/req_get_block_txs.py +lighter/models/req_get_by_account.py +lighter/models/req_get_candlesticks.py +lighter/models/req_get_deposit_history.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_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.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_referral_points.py +lighter/models/req_get_trades.py +lighter/models/req_get_transfer_fee_info.py +lighter/models/req_get_transfer_history.py +lighter/models/req_get_tx.py +lighter/models/req_get_withdraw_history.py +lighter/models/resp_change_account_tier.py +lighter/models/resp_get_fast_bridge_info.py +lighter/models/resp_send_tx.py +lighter/models/resp_send_tx_batch.py +lighter/models/resp_withdrawal_delay.py +lighter/models/result_code.py +lighter/models/risk_info.py +lighter/models/risk_parameters.py lighter/models/simple_order.py lighter/models/status.py lighter/models/sub_accounts.py +lighter/models/ticker.py lighter/models/trade.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/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_account_margin_stats.py +test/test_info_api.py +test/test_order_book_orders.py +test/test_req_get_order_book_orders.py +test/test_req_get_transfer_fee_info.py +test/test_req_get_transfer_history.py +test/test_resp_change_account_tier.py +test/test_resp_send_tx.py +test/test_resp_send_tx_batch.py +test/test_resp_withdrawal_delay.py +test/test_risk_parameters.py +test/test_transfer_fee_info.py +test/test_transfer_history.py +test/test_transfer_history_item.py +tox.ini diff --git a/README.md b/README.md index 560dcb3..5fc6d13 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,6 @@ Class | Method | HTTP request | Description *CandlestickApi* | [**candlesticks**](docs/CandlestickApi.md#candlesticks) | **GET** /api/v1/candlesticks | candlesticks *CandlestickApi* | [**fundings**](docs/CandlestickApi.md#fundings) | **GET** /api/v1/fundings | fundings *InfoApi* | [**layer2_basic_info**](docs/InfoApi.md#layer2_basic_info) | **GET** /api/v1/layer2BasicInfo | layer2BasicInfo -*OrderApi* | [**account_active_orders**](docs/OrderApi.md#account_active_orders) | **GET** /api/v1/accountActiveOrders | accountActiveOrders *OrderApi* | [**account_inactive_orders**](docs/OrderApi.md#account_inactive_orders) | **GET** /api/v1/accountInactiveOrders | accountInactiveOrders *OrderApi* | [**account_orders**](docs/OrderApi.md#account_orders) | **GET** /api/v1/accountOrders | accountOrders *OrderApi* | [**exchange_stats**](docs/OrderApi.md#exchange_stats) | **GET** /api/v1/exchangeStats | exchangeStats @@ -158,7 +157,6 @@ Class | Method | HTTP request | Description - [PublicPoolShare](docs/PublicPoolShare.md) - [PublicPools](docs/PublicPools.md) - [ReqGetAccount](docs/ReqGetAccount.md) - - [ReqGetAccountActiveOrders](docs/ReqGetAccountActiveOrders.md) - [ReqGetAccountApiKeys](docs/ReqGetAccountApiKeys.md) - [ReqGetAccountByL1Address](docs/ReqGetAccountByL1Address.md) - [ReqGetAccountInactiveOrders](docs/ReqGetAccountInactiveOrders.md) diff --git a/docs/Account.md b/docs/Account.md index d866ec5..21e0c49 100644 --- a/docs/Account.md +++ b/docs/Account.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **l1_address** | **str** | | **cancel_all_time** | **int** | | **total_order_count** | **int** | | +**total_isolated_order_count** | **int** | | **pending_order_count** | **int** | | **status** | **int** | | **collateral** | **str** | | diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 869552e..24bcb76 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -9,6 +9,7 @@ Method | HTTP request | Description [**account_metadata**](AccountApi.md#account_metadata) | **GET** /api/v1/accountMetadata | accountMetadata [**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 [**l1_metadata**](AccountApi.md#l1_metadata) | **GET** /api/v1/l1Metadata | l1Metadata [**liquidations**](AccountApi.md#liquidations) | **GET** /api/v1/liquidations | liquidations [**pnl**](AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl @@ -375,6 +376,81 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **change_account_tier** +> RespChangeAccountTier change_account_tier(account_index, new_tier, authorization=authorization, auth=auth) + +changeAccountTier + +Change account tier + +### Example + + +```python +import lighter +from lighter.models.resp_change_account_tier import RespChangeAccountTier +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.AccountApi(api_client) + account_index = 56 # int | + new_tier = 'new_tier_example' # str | + authorization = 'authorization_example' # str | make required after integ is done (optional) + auth = 'auth_example' # str | made optional to support header auth clients (optional) + + try: + # changeAccountTier + api_response = await api_instance.change_account_tier(account_index, new_tier, authorization=authorization, auth=auth) + print("The response of AccountApi->change_account_tier:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->change_account_tier: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **new_tier** | **str**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + +### Return type + +[**RespChangeAccountTier**](RespChangeAccountTier.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) + # **l1_metadata** > L1Metadata l1_metadata(l1_address, authorization=authorization, auth=auth) diff --git a/docs/AccountLimits.md b/docs/AccountLimits.md index 8dbe1f8..0ca7ba2 100644 --- a/docs/AccountLimits.md +++ b/docs/AccountLimits.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **code** | **int** | | **message** | **str** | | [optional] **max_llp_percentage** | **int** | | +**user_tier** | **str** | | ## Example diff --git a/docs/AccountMarginStats.md b/docs/AccountMarginStats.md new file mode 100644 index 0000000..2fedfac --- /dev/null +++ b/docs/AccountMarginStats.md @@ -0,0 +1,34 @@ +# 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/AccountPosition.md b/docs/AccountPosition.md index 4b30c56..c75cece 100644 --- a/docs/AccountPosition.md +++ b/docs/AccountPosition.md @@ -18,6 +18,8 @@ Name | Type | Description | Notes **unrealized_pnl** | **str** | | **realized_pnl** | **str** | | **total_funding_paid_out** | **str** | | [optional] +**margin_mode** | **int** | | +**allocated_margin** | **str** | | ## Example diff --git a/docs/AccountStats.md b/docs/AccountStats.md index aa261f7..89aaab6 100644 --- a/docs/AccountStats.md +++ b/docs/AccountStats.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **available_balance** | **str** | | **margin_usage** | **str** | | **buying_power** | **str** | | +**cross_stats** | [**AccountMarginStats**](AccountMarginStats.md) | | +**total_stats** | [**AccountMarginStats**](AccountMarginStats.md) | | ## Example diff --git a/docs/DetailedAccount.md b/docs/DetailedAccount.md index eef0ef4..7331ceb 100644 --- a/docs/DetailedAccount.md +++ b/docs/DetailedAccount.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **l1_address** | **str** | | **cancel_all_time** | **int** | | **total_order_count** | **int** | | +**total_isolated_order_count** | **int** | | **pending_order_count** | **int** | | **status** | **int** | | **collateral** | **str** | | @@ -22,6 +23,7 @@ Name | Type | Description | Notes **referral_points_percentage** | **str** | Remove After FE uses L1 meta endpoint | **positions** | [**List[AccountPosition]**](AccountPosition.md) | | **total_asset_value** | **str** | | +**cross_asset_value** | **str** | | **pool_info** | [**PublicPoolInfo**](PublicPoolInfo.md) | | **shares** | [**List[PublicPoolShare]**](PublicPoolShare.md) | | diff --git a/docs/InfoApi.md b/docs/InfoApi.md new file mode 100644 index 0000000..1078327 --- /dev/null +++ b/docs/InfoApi.md @@ -0,0 +1,150 @@ +# lighter.InfoApi + +All URIs are relative to *https://mainnet.zklighter.elliot.ai* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**transfer_fee_info**](InfoApi.md#transfer_fee_info) | **GET** /api/v1/transferFeeInfo | transferFeeInfo +[**withdrawal_delay**](InfoApi.md#withdrawal_delay) | **GET** /api/v1/withdrawalDelay | withdrawalDelay + + +# **transfer_fee_info** +> TransferFeeInfo transfer_fee_info(account_index, authorization=authorization, auth=auth, to_account_index=to_account_index) + +transferFeeInfo + +Transfer fee info + +### Example + + +```python +import lighter +from lighter.models.transfer_fee_info import TransferFeeInfo +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) + account_index = 56 # int | + authorization = 'authorization_example' # str | (optional) + auth = 'auth_example' # str | (optional) + to_account_index = -1 # int | (optional) (default to -1) + + try: + # transferFeeInfo + api_response = await api_instance.transfer_fee_info(account_index, authorization=authorization, auth=auth, to_account_index=to_account_index) + print("The response of InfoApi->transfer_fee_info:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InfoApi->transfer_fee_info: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **authorization** | **str**| | [optional] + **auth** | **str**| | [optional] + **to_account_index** | **int**| | [optional] [default to -1] + +### Return type + +[**TransferFeeInfo**](TransferFeeInfo.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) + +# **withdrawal_delay** +> RespWithdrawalDelay withdrawal_delay() + +withdrawalDelay + +Withdrawal delay in seconds + +### Example + + +```python +import lighter +from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay +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: + # withdrawalDelay + api_response = await api_instance.withdrawal_delay() + print("The response of InfoApi->withdrawal_delay:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InfoApi->withdrawal_delay: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**RespWithdrawalDelay**](RespWithdrawalDelay.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/OrderApi.md b/docs/OrderApi.md index 3c7deb3..c7386cc 100644 --- a/docs/OrderApi.md +++ b/docs/OrderApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**exchange_stats**](OrderApi.md#exchange_stats) | **GET** /api/v1/exchangeStats | exchangeStats [**export**](OrderApi.md#export) | **GET** /api/v1/export | export [**order_book_details**](OrderApi.md#order_book_details) | **GET** /api/v1/orderBookDetails | orderBookDetails +[**order_book_orders**](OrderApi.md#order_book_orders) | **GET** /api/v1/orderBookOrders | orderBookOrders [**order_books**](OrderApi.md#order_books) | **GET** /api/v1/orderBooks | orderBooks [**recent_trades**](OrderApi.md#recent_trades) | **GET** /api/v1/recentTrades | recentTrades [**trades**](OrderApi.md#trades) | **GET** /api/v1/trades | trades @@ -307,6 +308,77 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **order_book_orders** +> OrderBookOrders order_book_orders(market_id, limit) + +orderBookOrders + +Get order book orders + +### Example + + +```python +import lighter +from lighter.models.order_book_orders import OrderBookOrders +from lighter.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai +# See configuration.py for a list of all supported configuration parameters. +configuration = lighter.Configuration( + host = "https://mainnet.zklighter.elliot.ai" +) + + +# Enter a context with an instance of the API client +async with lighter.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = lighter.OrderApi(api_client) + market_id = 56 # int | + limit = 56 # int | + + try: + # orderBookOrders + api_response = await api_instance.order_book_orders(market_id, limit) + print("The response of OrderApi->order_book_orders:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrderApi->order_book_orders: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **market_id** | **int**| | + **limit** | **int**| | + +### Return type + +[**OrderBookOrders**](OrderBookOrders.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) + # **order_books** > OrderBooks order_books(market_id=market_id) diff --git a/docs/OrderBookOrders.md b/docs/OrderBookOrders.md new file mode 100644 index 0000000..960e274 --- /dev/null +++ b/docs/OrderBookOrders.md @@ -0,0 +1,34 @@ +# OrderBookOrders + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**total_asks** | **int** | | +**asks** | [**List[SimpleOrder]**](SimpleOrder.md) | | +**total_bids** | **int** | | +**bids** | [**List[SimpleOrder]**](SimpleOrder.md) | | + +## Example + +```python +from lighter.models.order_book_orders import OrderBookOrders + +# TODO update the JSON string below +json = "{}" +# create an instance of OrderBookOrders from a JSON string +order_book_orders_instance = OrderBookOrders.from_json(json) +# print the JSON string representation of the object +print(OrderBookOrders.to_json()) + +# convert the object into a dict +order_book_orders_dict = order_book_orders_instance.to_dict() +# create an instance of OrderBookOrders from a dict +order_book_orders_from_dict = OrderBookOrders.from_dict(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/PublicPool.md b/docs/PublicPool.md index 35bac90..884d3b3 100644 --- a/docs/PublicPool.md +++ b/docs/PublicPool.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **l1_address** | **str** | | **cancel_all_time** | **int** | | **total_order_count** | **int** | | +**total_isolated_order_count** | **int** | | **pending_order_count** | **int** | | **status** | **int** | | **collateral** | **str** | | @@ -21,6 +22,7 @@ Name | Type | Description | Notes **can_invite** | **bool** | Remove After FE uses L1 meta endpoint | **referral_points_percentage** | **str** | Remove After FE uses L1 meta endpoint | **total_asset_value** | **str** | | +**cross_asset_value** | **str** | | **pool_info** | [**PublicPoolInfo**](PublicPoolInfo.md) | | **account_share** | [**PublicPoolShare**](PublicPoolShare.md) | | [optional] diff --git a/docs/ReqGetOrderBookOrders.md b/docs/ReqGetOrderBookOrders.md new file mode 100644 index 0000000..7f543eb --- /dev/null +++ b/docs/ReqGetOrderBookOrders.md @@ -0,0 +1,30 @@ +# 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/ReqGetTransferFeeInfo.md b/docs/ReqGetTransferFeeInfo.md new file mode 100644 index 0000000..84824f7 --- /dev/null +++ b/docs/ReqGetTransferFeeInfo.md @@ -0,0 +1,31 @@ +# ReqGetTransferFeeInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth** | **str** | | [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 new file mode 100644 index 0000000..cb548fa --- /dev/null +++ b/docs/ReqGetTransferHistory.md @@ -0,0 +1,31 @@ +# ReqGetTransferHistory + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_index** | **int** | | +**auth** | **str** | made optional to support header auth clients | [optional] +**cursor** | **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/RespChangeAccountTier.md b/docs/RespChangeAccountTier.md new file mode 100644 index 0000000..62cd493 --- /dev/null +++ b/docs/RespChangeAccountTier.md @@ -0,0 +1,30 @@ +# RespChangeAccountTier + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] + +## Example + +```python +from lighter.models.resp_change_account_tier import RespChangeAccountTier + +# TODO update the JSON string below +json = "{}" +# create an instance of RespChangeAccountTier from a JSON string +resp_change_account_tier_instance = RespChangeAccountTier.from_json(json) +# print the JSON string representation of the object +print(RespChangeAccountTier.to_json()) + +# convert the object into a dict +resp_change_account_tier_dict = resp_change_account_tier_instance.to_dict() +# create an instance of RespChangeAccountTier from a dict +resp_change_account_tier_from_dict = RespChangeAccountTier.from_dict(resp_change_account_tier_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/RespSendTx.md b/docs/RespSendTx.md new file mode 100644 index 0000000..5d58479 --- /dev/null +++ b/docs/RespSendTx.md @@ -0,0 +1,32 @@ +# RespSendTx + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**tx_hash** | **str** | | +**predicted_execution_time_ms** | **int** | | + +## Example + +```python +from lighter.models.resp_send_tx import RespSendTx + +# TODO update the JSON string below +json = "{}" +# create an instance of RespSendTx from a JSON string +resp_send_tx_instance = RespSendTx.from_json(json) +# print the JSON string representation of the object +print(RespSendTx.to_json()) + +# convert the object into a dict +resp_send_tx_dict = resp_send_tx_instance.to_dict() +# create an instance of RespSendTx from a dict +resp_send_tx_from_dict = RespSendTx.from_dict(resp_send_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/RespSendTxBatch.md b/docs/RespSendTxBatch.md new file mode 100644 index 0000000..1b02a5b --- /dev/null +++ b/docs/RespSendTxBatch.md @@ -0,0 +1,32 @@ +# RespSendTxBatch + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**tx_hash** | **List[str]** | | +**predicted_execution_time_ms** | **int** | | + +## Example + +```python +from lighter.models.resp_send_tx_batch import RespSendTxBatch + +# TODO update the JSON string below +json = "{}" +# create an instance of RespSendTxBatch from a JSON string +resp_send_tx_batch_instance = RespSendTxBatch.from_json(json) +# print the JSON string representation of the object +print(RespSendTxBatch.to_json()) + +# convert the object into a dict +resp_send_tx_batch_dict = resp_send_tx_batch_instance.to_dict() +# create an instance of RespSendTxBatch from a dict +resp_send_tx_batch_from_dict = RespSendTxBatch.from_dict(resp_send_tx_batch_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/RespWithdrawalDelay.md b/docs/RespWithdrawalDelay.md new file mode 100644 index 0000000..5178729 --- /dev/null +++ b/docs/RespWithdrawalDelay.md @@ -0,0 +1,29 @@ +# RespWithdrawalDelay + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seconds** | **int** | | + +## Example + +```python +from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay + +# TODO update the JSON string below +json = "{}" +# create an instance of RespWithdrawalDelay from a JSON string +resp_withdrawal_delay_instance = RespWithdrawalDelay.from_json(json) +# print the JSON string representation of the object +print(RespWithdrawalDelay.to_json()) + +# convert the object into a dict +resp_withdrawal_delay_dict = resp_withdrawal_delay_instance.to_dict() +# create an instance of RespWithdrawalDelay from a dict +resp_withdrawal_delay_from_dict = RespWithdrawalDelay.from_dict(resp_withdrawal_delay_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/RiskInfo.md b/docs/RiskInfo.md index 065091b..2984f0a 100644 --- a/docs/RiskInfo.md +++ b/docs/RiskInfo.md @@ -5,11 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**collateral** | **str** | | -**total_account_value** | **str** | | -**initial_margin_req** | **str** | | -**maintenance_margin_req** | **str** | | -**close_out_margin_req** | **str** | | +**cross_risk_parameters** | [**RiskParameters**](RiskParameters.md) | | +**isolated_risk_parameters** | [**List[RiskParameters]**](RiskParameters.md) | | ## Example diff --git a/docs/RiskParameters.md b/docs/RiskParameters.md new file mode 100644 index 0000000..26f9e61 --- /dev/null +++ b/docs/RiskParameters.md @@ -0,0 +1,34 @@ +# RiskParameters + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**market_id** | **int** | | +**collateral** | **str** | | +**total_account_value** | **str** | | +**initial_margin_req** | **str** | | +**maintenance_margin_req** | **str** | | +**close_out_margin_req** | **str** | | + +## Example + +```python +from lighter.models.risk_parameters import RiskParameters + +# TODO update the JSON string below +json = "{}" +# create an instance of RiskParameters from a JSON string +risk_parameters_instance = RiskParameters.from_json(json) +# print the JSON string representation of the object +print(RiskParameters.to_json()) + +# convert the object into a dict +risk_parameters_dict = risk_parameters_instance.to_dict() +# create an instance of RiskParameters from a dict +risk_parameters_from_dict = RiskParameters.from_dict(risk_parameters_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Trade.md b/docs/Trade.md index 35203a1..ac611a0 100644 --- a/docs/Trade.md +++ b/docs/Trade.md @@ -19,12 +19,16 @@ Name | Type | Description | Notes **is_maker_ask** | **bool** | | **block_height** | **int** | | **timestamp** | **int** | | +**taker_fee** | **int** | | **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_position_size_before** | **str** | | **maker_entry_quote_before** | **str** | | **maker_initial_margin_fraction_before** | **int** | | +**maker_position_sign_changed** | **bool** | | ## Example diff --git a/docs/TransactionApi.md b/docs/TransactionApi.md index c9e472f..4308aa3 100644 --- a/docs/TransactionApi.md +++ b/docs/TransactionApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description [**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 +[**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 @@ -315,7 +316,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) # **send_tx** -> TxHash send_tx(tx_type, tx_info, price_protection=price_protection) +> RespSendTx send_tx(tx_type, tx_info, price_protection=price_protection) sendTx @@ -326,7 +327,7 @@ You need to sign the transaction body before sending it to the server. More deta ```python import lighter -from lighter.models.tx_hash import TxHash +from lighter.models.resp_send_tx import RespSendTx from lighter.rest import ApiException from pprint import pprint @@ -367,7 +368,7 @@ Name | Type | Description | Notes ### Return type -[**TxHash**](TxHash.md) +[**RespSendTx**](RespSendTx.md) ### Authorization @@ -388,7 +389,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) # **send_tx_batch** -> TxHashes send_tx_batch(tx_types, tx_infos) +> RespSendTxBatch send_tx_batch(tx_types, tx_infos) sendTxBatch @@ -399,7 +400,7 @@ You need to sign the transaction body before sending it to the server. More deta ```python import lighter -from lighter.models.tx_hashes import TxHashes +from lighter.models.resp_send_tx_batch import RespSendTxBatch from lighter.rest import ApiException from pprint import pprint @@ -438,7 +439,7 @@ Name | Type | Description | Notes ### Return type -[**TxHashes**](TxHashes.md) +[**RespSendTxBatch**](RespSendTxBatch.md) ### Authorization @@ -458,6 +459,81 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **transfer_history** +> TransferHistory transfer_history(account_index, authorization=authorization, auth=auth, cursor=cursor) + +transfer_history + +Get transfer history + +### Example + + +```python +import lighter +from lighter.models.transfer_history import TransferHistory +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) + 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) + + try: + # transfer_history + api_response = await api_instance.transfer_history(account_index, authorization=authorization, auth=auth, cursor=cursor) + print("The response of TransactionApi->transfer_history:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TransactionApi->transfer_history: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_index** | **int**| | + **authorization** | **str**| make required after integ is done | [optional] + **auth** | **str**| made optional to support header auth clients | [optional] + **cursor** | **str**| | [optional] + +### Return type + +[**TransferHistory**](TransferHistory.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) + # **tx** > EnrichedTx tx(by, value) @@ -670,7 +746,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) # **withdraw_history** -> WithdrawHistory withdraw_history(account_index, authorizatio=authorizatio, auth=auth, cursor=cursor, filter=filter) +> WithdrawHistory withdraw_history(account_index, authorization=authorization, auth=auth, cursor=cursor, filter=filter) withdraw_history @@ -697,14 +773,14 @@ 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 | - authorizatio = 'authorizatio_example' # str | make required after integ is done (optional) + 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, authorizatio=authorizatio, auth=auth, cursor=cursor, filter=filter) + api_response = await api_instance.withdraw_history(account_index, authorization=authorization, auth=auth, cursor=cursor, filter=filter) print("The response of TransactionApi->withdraw_history:\n") pprint(api_response) except Exception as e: @@ -719,7 +795,7 @@ async with lighter.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **account_index** | **int**| | - **authorizatio** | **str**| make required after integ is done | [optional] + **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/TransferFeeInfo.md b/docs/TransferFeeInfo.md new file mode 100644 index 0000000..52c9c27 --- /dev/null +++ b/docs/TransferFeeInfo.md @@ -0,0 +1,31 @@ +# TransferFeeInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**transfer_fee_usdc** | **int** | | + +## Example + +```python +from lighter.models.transfer_fee_info import TransferFeeInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of TransferFeeInfo from a JSON string +transfer_fee_info_instance = TransferFeeInfo.from_json(json) +# print the JSON string representation of the object +print(TransferFeeInfo.to_json()) + +# convert the object into a dict +transfer_fee_info_dict = transfer_fee_info_instance.to_dict() +# create an instance of TransferFeeInfo from a dict +transfer_fee_info_from_dict = TransferFeeInfo.from_dict(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/TransferHistory.md b/docs/TransferHistory.md new file mode 100644 index 0000000..f005cc3 --- /dev/null +++ b/docs/TransferHistory.md @@ -0,0 +1,32 @@ +# TransferHistory + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**transfers** | [**List[TransferHistoryItem]**](TransferHistoryItem.md) | | +**cursor** | **str** | | + +## Example + +```python +from lighter.models.transfer_history import TransferHistory + +# TODO update the JSON string below +json = "{}" +# create an instance of TransferHistory from a JSON string +transfer_history_instance = TransferHistory.from_json(json) +# print the JSON string representation of the object +print(TransferHistory.to_json()) + +# convert the object into a dict +transfer_history_dict = transfer_history_instance.to_dict() +# create an instance of TransferHistory from a dict +transfer_history_from_dict = TransferHistory.from_dict(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/TransferHistoryItem.md b/docs/TransferHistoryItem.md new file mode 100644 index 0000000..4d7f5df --- /dev/null +++ b/docs/TransferHistoryItem.md @@ -0,0 +1,37 @@ +# TransferHistoryItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**amount** | **str** | | +**timestamp** | **int** | | +**type** | **str** | | +**from_l1_address** | **str** | | +**to_l1_address** | **str** | | +**from_account_index** | **int** | | +**to_account_index** | **int** | | +**tx_hash** | **str** | | + +## Example + +```python +from lighter.models.transfer_history_item import TransferHistoryItem + +# TODO update the JSON string below +json = "{}" +# create an instance of TransferHistoryItem from a JSON string +transfer_history_item_instance = TransferHistoryItem.from_json(json) +# print the JSON string representation of the object +print(TransferHistoryItem.to_json()) + +# convert the object into a dict +transfer_history_item_dict = transfer_history_item_instance.to_dict() +# create an instance of TransferHistoryItem from a dict +transfer_history_item_from_dict = TransferHistoryItem.from_dict(transfer_history_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/lighter/__init__.py b/lighter/__init__.py index 47e98fc..8d68c6a 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -23,6 +23,7 @@ from lighter.api.bridge_api import BridgeApi from lighter.api.candlestick_api import CandlestickApi from lighter.api.funding_api import FundingApi +from lighter.api.info_api import InfoApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi from lighter.api.referral_api import ReferralApi @@ -44,6 +45,7 @@ from lighter.models.account import Account from lighter.models.account_api_keys import AccountApiKeys 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 @@ -88,6 +90,7 @@ from lighter.models.order_book_depth import OrderBookDepth from lighter.models.order_book_detail import OrderBookDetail 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 @@ -124,6 +127,7 @@ 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 import ReqGetPublicPools @@ -133,17 +137,27 @@ from lighter.models.req_get_recent_trades import ReqGetRecentTrades from lighter.models.req_get_referral_points import ReqGetReferralPoints from lighter.models.req_get_trades import ReqGetTrades +from lighter.models.req_get_transfer_fee_info import ReqGetTransferFeeInfo +from lighter.models.req_get_transfer_history import ReqGetTransferHistory from lighter.models.req_get_tx import ReqGetTx from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory +from lighter.models.resp_change_account_tier import RespChangeAccountTier from lighter.models.resp_get_fast_bridge_info import RespGetFastBridgeInfo +from lighter.models.resp_send_tx import RespSendTx +from lighter.models.resp_send_tx_batch import RespSendTxBatch +from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode from lighter.models.risk_info import RiskInfo +from lighter.models.risk_parameters import RiskParameters from lighter.models.simple_order import SimpleOrder from lighter.models.status import Status from lighter.models.sub_accounts import SubAccounts from lighter.models.ticker import Ticker from lighter.models.trade import Trade 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 diff --git a/lighter/api/__init__.py b/lighter/api/__init__.py index 5b548eb..a238373 100644 --- a/lighter/api/__init__.py +++ b/lighter/api/__init__.py @@ -7,6 +7,7 @@ from lighter.api.bridge_api import BridgeApi from lighter.api.candlestick_api import CandlestickApi from lighter.api.funding_api import FundingApi +from lighter.api.info_api import InfoApi from lighter.api.notification_api import NotificationApi from lighter.api.order_api import OrderApi from lighter.api.referral_api import ReferralApi diff --git a/lighter/api/account_api.py b/lighter/api/account_api.py index a0f00da..aa7263c 100644 --- a/lighter/api/account_api.py +++ b/lighter/api/account_api.py @@ -28,6 +28,7 @@ from lighter.models.liquidation_infos import LiquidationInfos from lighter.models.position_fundings import PositionFundings from lighter.models.public_pools import PublicPools +from lighter.models.resp_change_account_tier import RespChangeAccountTier from lighter.models.sub_accounts import SubAccounts from lighter.api_client import ApiClient, RequestSerialized @@ -1478,6 +1479,325 @@ def _apikeys_serialize( + @validate_call + async def change_account_tier( + self, + account_index: StrictInt, + new_tier: StrictStr, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + _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, + ) -> RespChangeAccountTier: + """changeAccountTier + + Change account tier + + :param account_index: (required) + :type account_index: int + :param new_tier: (required) + :type new_tier: 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._change_account_tier_serialize( + account_index=account_index, + new_tier=new_tier, + 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': "RespChangeAccountTier", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def change_account_tier_with_http_info( + self, + account_index: StrictInt, + new_tier: StrictStr, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + _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[RespChangeAccountTier]: + """changeAccountTier + + Change account tier + + :param account_index: (required) + :type account_index: int + :param new_tier: (required) + :type new_tier: 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._change_account_tier_serialize( + account_index=account_index, + new_tier=new_tier, + 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': "RespChangeAccountTier", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def change_account_tier_without_preload_content( + self, + account_index: StrictInt, + new_tier: StrictStr, + authorization: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = None, + auth: Annotated[Optional[StrictStr], Field(description=" made optional to support header auth clients")] = None, + _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: + """changeAccountTier + + Change account tier + + :param account_index: (required) + :type account_index: int + :param new_tier: (required) + :type new_tier: 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._change_account_tier_serialize( + account_index=account_index, + new_tier=new_tier, + 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': "RespChangeAccountTier", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _change_account_tier_serialize( + self, + account_index, + new_tier, + 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_tier is not None: + _form_params.append(('new_tier', new_tier)) + # 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/changeAccountTier', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call async def l1_metadata( self, diff --git a/lighter/api/info_api.py b/lighter/api/info_api.py new file mode 100644 index 0000000..9e2591a --- /dev/null +++ b/lighter/api/info_api.py @@ -0,0 +1,597 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictInt, StrictStr +from typing import Optional +from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay +from lighter.models.transfer_fee_info import TransferFeeInfo + +from lighter.api_client import ApiClient, RequestSerialized +from lighter.api_response import ApiResponse +from lighter.rest import RESTResponseType + + +class InfoApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def transfer_fee_info( + self, + account_index: StrictInt, + authorization: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, + to_account_index: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TransferFeeInfo: + """transferFeeInfo + + Transfer fee info + + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: str + :param auth: + :type auth: str + :param to_account_index: + :type to_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._transfer_fee_info_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + to_account_index=to_account_index, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferFeeInfo", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def transfer_fee_info_with_http_info( + self, + account_index: StrictInt, + authorization: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, + to_account_index: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TransferFeeInfo]: + """transferFeeInfo + + Transfer fee info + + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: str + :param auth: + :type auth: str + :param to_account_index: + :type to_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._transfer_fee_info_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + to_account_index=to_account_index, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferFeeInfo", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def transfer_fee_info_without_preload_content( + self, + account_index: StrictInt, + authorization: Optional[StrictStr] = None, + auth: Optional[StrictStr] = None, + to_account_index: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """transferFeeInfo + + Transfer fee info + + :param account_index: (required) + :type account_index: int + :param authorization: + :type authorization: str + :param auth: + :type auth: str + :param to_account_index: + :type to_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._transfer_fee_info_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + to_account_index=to_account_index, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferFeeInfo", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _transfer_fee_info_serialize( + self, + account_index, + authorization, + auth, + to_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 auth is not None: + + _query_params.append(('auth', auth)) + + if account_index is not None: + + _query_params.append(('account_index', account_index)) + + if to_account_index is not None: + + _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 + + + # 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/transferFeeInfo', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def withdrawal_delay( + 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, + ) -> RespWithdrawalDelay: + """withdrawalDelay + + Withdrawal delay in seconds + + :param _request_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._withdrawal_delay_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespWithdrawalDelay", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def withdrawal_delay_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[RespWithdrawalDelay]: + """withdrawalDelay + + Withdrawal delay in seconds + + :param _request_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._withdrawal_delay_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespWithdrawalDelay", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def withdrawal_delay_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: + """withdrawalDelay + + Withdrawal delay in seconds + + :param _request_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._withdrawal_delay_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespWithdrawalDelay", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _withdrawal_delay_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/withdrawalDelay', + 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/order_api.py b/lighter/api/order_api.py index b4f7f4a..396ea69 100644 --- a/lighter/api/order_api.py +++ b/lighter/api/order_api.py @@ -22,6 +22,7 @@ from lighter.models.exchange_stats import ExchangeStats from lighter.models.export_data import ExportData from lighter.models.order_book_details import OrderBookDetails +from lighter.models.order_book_orders import OrderBookOrders from lighter.models.order_books import OrderBooks from lighter.models.orders import Orders from lighter.models.trades import Trades @@ -1262,6 +1263,286 @@ def _order_book_details_serialize( + @validate_call + async def order_book_orders( + self, + market_id: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + _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, + ) -> OrderBookOrders: + """orderBookOrders + + Get order book orders + + :param market_id: (required) + :type market_id: int + :param limit: (required) + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._order_book_orders_serialize( + market_id=market_id, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrderBookOrders", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def order_book_orders_with_http_info( + self, + market_id: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + _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[OrderBookOrders]: + """orderBookOrders + + Get order book orders + + :param market_id: (required) + :type market_id: int + :param limit: (required) + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._order_book_orders_serialize( + market_id=market_id, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrderBookOrders", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def order_book_orders_without_preload_content( + self, + market_id: StrictInt, + limit: Annotated[int, Field(le=100, strict=True, ge=1)], + _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: + """orderBookOrders + + Get order book orders + + :param market_id: (required) + :type market_id: int + :param limit: (required) + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._order_book_orders_serialize( + market_id=market_id, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrderBookOrders", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _order_book_orders_serialize( + self, + market_id, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if market_id is not None: + + _query_params.append(('market_id', market_id)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/orderBookOrders', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call async def order_books( self, diff --git a/lighter/api/transaction_api.py b/lighter/api/transaction_api.py index efee466..066e564 100644 --- a/lighter/api/transaction_api.py +++ b/lighter/api/transaction_api.py @@ -22,8 +22,9 @@ from lighter.models.deposit_history import DepositHistory from lighter.models.enriched_tx import EnrichedTx from lighter.models.next_nonce import NextNonce -from lighter.models.tx_hash import TxHash -from lighter.models.tx_hashes import TxHashes +from lighter.models.resp_send_tx import RespSendTx +from lighter.models.resp_send_tx_batch import RespSendTxBatch +from lighter.models.transfer_history import TransferHistory from lighter.models.txs import Txs from lighter.models.withdraw_history import WithdrawHistory @@ -1301,7 +1302,7 @@ 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, - ) -> TxHash: + ) -> RespSendTx: """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) @@ -1345,7 +1346,7 @@ async def send_tx( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TxHash", + '200': "RespSendTx", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1377,7 +1378,7 @@ 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[TxHash]: + ) -> ApiResponse[RespSendTx]: """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) @@ -1421,7 +1422,7 @@ async def send_tx_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TxHash", + '200': "RespSendTx", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1497,7 +1498,7 @@ async def send_tx_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TxHash", + '200': "RespSendTx", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1604,7 +1605,7 @@ 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, - ) -> TxHashes: + ) -> RespSendTxBatch: """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) @@ -1645,7 +1646,7 @@ async def send_tx_batch( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TxHashes", + '200': "RespSendTxBatch", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1676,7 +1677,7 @@ 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[TxHashes]: + ) -> ApiResponse[RespSendTxBatch]: """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) @@ -1717,7 +1718,7 @@ async def send_tx_batch_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TxHashes", + '200': "RespSendTxBatch", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1789,7 +1790,7 @@ async def send_tx_batch_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TxHashes", + '200': "RespSendTxBatch", '400': "ResultCode", } response_data = await self.api_client.call_api( @@ -1876,6 +1877,318 @@ def _send_tx_batch_serialize( + @validate_call + async def transfer_history( + 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, + _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, + ) -> TransferHistory: + """transfer_history + + Get transfer history + + :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 _request_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._transfer_history_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferHistory", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def transfer_history_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, + _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[TransferHistory]: + """transfer_history + + Get transfer history + + :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 _request_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._transfer_history_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferHistory", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def transfer_history_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, + _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: + """transfer_history + + Get transfer history + + :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 _request_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._transfer_history_serialize( + account_index=account_index, + authorization=authorization, + auth=auth, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TransferHistory", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _transfer_history_serialize( + self, + account_index, + authorization, + auth, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if account_index is not None: + + _query_params.append(('account_index', account_index)) + + if auth is not None: + + _query_params.append(('auth', auth)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/transfer/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 + ) + + + + @validate_call async def tx( self, @@ -2703,7 +3016,7 @@ def _txs_serialize( async def withdraw_history( self, account_index: StrictInt, - authorizatio: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = 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, @@ -2726,8 +3039,8 @@ async def withdraw_history( :param account_index: (required) :type account_index: int - :param authorizatio: make required after integ is done - :type authorizatio: 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 cursor: @@ -2758,7 +3071,7 @@ async def withdraw_history( _param = self._withdraw_history_serialize( account_index=account_index, - authorizatio=authorizatio, + authorization=authorization, auth=auth, cursor=cursor, filter=filter, @@ -2787,7 +3100,7 @@ async def withdraw_history( async def withdraw_history_with_http_info( self, account_index: StrictInt, - authorizatio: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = 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, @@ -2810,8 +3123,8 @@ async def withdraw_history_with_http_info( :param account_index: (required) :type account_index: int - :param authorizatio: make required after integ is done - :type authorizatio: 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 cursor: @@ -2842,7 +3155,7 @@ async def withdraw_history_with_http_info( _param = self._withdraw_history_serialize( account_index=account_index, - authorizatio=authorizatio, + authorization=authorization, auth=auth, cursor=cursor, filter=filter, @@ -2871,7 +3184,7 @@ async def withdraw_history_with_http_info( async def withdraw_history_without_preload_content( self, account_index: StrictInt, - authorizatio: Annotated[Optional[StrictStr], Field(description=" make required after integ is done")] = 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, @@ -2894,8 +3207,8 @@ async def withdraw_history_without_preload_content( :param account_index: (required) :type account_index: int - :param authorizatio: make required after integ is done - :type authorizatio: 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 cursor: @@ -2926,7 +3239,7 @@ async def withdraw_history_without_preload_content( _param = self._withdraw_history_serialize( account_index=account_index, - authorizatio=authorizatio, + authorization=authorization, auth=auth, cursor=cursor, filter=filter, @@ -2950,7 +3263,7 @@ async def withdraw_history_without_preload_content( def _withdraw_history_serialize( self, account_index, - authorizatio, + authorization, auth, cursor, filter, @@ -2991,8 +3304,8 @@ def _withdraw_history_serialize( _query_params.append(('filter', filter)) # process the header parameters - if authorizatio is not None: - _header_params['authorizatio'] = authorizatio + 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 5fea2f6..125d38a 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -17,6 +17,7 @@ from lighter.models.account import Account from lighter.models.account_api_keys import AccountApiKeys 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 @@ -61,6 +62,7 @@ from lighter.models.order_book_depth import OrderBookDepth from lighter.models.order_book_detail import OrderBookDetail 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 @@ -97,6 +99,7 @@ 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 import ReqGetPublicPools @@ -106,17 +109,27 @@ from lighter.models.req_get_recent_trades import ReqGetRecentTrades from lighter.models.req_get_referral_points import ReqGetReferralPoints from lighter.models.req_get_trades import ReqGetTrades +from lighter.models.req_get_transfer_fee_info import ReqGetTransferFeeInfo +from lighter.models.req_get_transfer_history import ReqGetTransferHistory from lighter.models.req_get_tx import ReqGetTx from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory +from lighter.models.resp_change_account_tier import RespChangeAccountTier from lighter.models.resp_get_fast_bridge_info import RespGetFastBridgeInfo +from lighter.models.resp_send_tx import RespSendTx +from lighter.models.resp_send_tx_batch import RespSendTxBatch +from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode from lighter.models.risk_info import RiskInfo +from lighter.models.risk_parameters import RiskParameters from lighter.models.simple_order import SimpleOrder from lighter.models.status import Status from lighter.models.sub_accounts import SubAccounts from lighter.models.ticker import Ticker from lighter.models.trade import Trade 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 diff --git a/lighter/models/account.py b/lighter/models/account.py index 93247c0..766387d 100644 --- a/lighter/models/account.py +++ b/lighter/models/account.py @@ -33,11 +33,12 @@ class Account(BaseModel): l1_address: StrictStr cancel_all_time: StrictInt total_order_count: StrictInt + total_isolated_order_count: StrictInt pending_order_count: StrictInt status: StrictInt collateral: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral"] + __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "status", "collateral"] model_config = ConfigDict( populate_by_name=True, @@ -104,6 +105,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "l1_address": obj.get("l1_address"), "cancel_all_time": obj.get("cancel_all_time"), "total_order_count": obj.get("total_order_count"), + "total_isolated_order_count": obj.get("total_isolated_order_count"), "pending_order_count": obj.get("pending_order_count"), "status": obj.get("status"), "collateral": obj.get("collateral") diff --git a/lighter/models/account_limits.py b/lighter/models/account_limits.py index d899264..81eff07 100644 --- a/lighter/models/account_limits.py +++ b/lighter/models/account_limits.py @@ -29,8 +29,9 @@ class AccountLimits(BaseModel): code: StrictInt message: Optional[StrictStr] = None max_llp_percentage: StrictInt + user_tier: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "max_llp_percentage"] + __properties: ClassVar[List[str]] = ["code", "message", "max_llp_percentage", "user_tier"] model_config = ConfigDict( populate_by_name=True, @@ -92,7 +93,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "code": obj.get("code"), "message": obj.get("message"), - "max_llp_percentage": obj.get("max_llp_percentage") + "max_llp_percentage": obj.get("max_llp_percentage"), + "user_tier": obj.get("user_tier") }) # 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 new file mode 100644 index 0000000..bad64a8 --- /dev/null +++ b/lighter/models/account_margin_stats.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, 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_validate({ + "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_position.py b/lighter/models/account_position.py index c0e590f..655ba12 100644 --- a/lighter/models/account_position.py +++ b/lighter/models/account_position.py @@ -39,8 +39,10 @@ class AccountPosition(BaseModel): unrealized_pnl: StrictStr realized_pnl: StrictStr total_funding_paid_out: Optional[StrictStr] = None + margin_mode: StrictInt + allocated_margin: StrictStr additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "symbol", "initial_margin_fraction", "open_order_count", "pending_order_count", "position_tied_order_count", "sign", "position", "avg_entry_price", "position_value", "unrealized_pnl", "realized_pnl", "total_funding_paid_out"] + __properties: ClassVar[List[str]] = ["market_id", "symbol", "initial_margin_fraction", "open_order_count", "pending_order_count", "position_tied_order_count", "sign", "position", "avg_entry_price", "position_value", "unrealized_pnl", "realized_pnl", "total_funding_paid_out", "margin_mode", "allocated_margin"] model_config = ConfigDict( populate_by_name=True, @@ -112,7 +114,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "position_value": obj.get("position_value"), "unrealized_pnl": obj.get("unrealized_pnl"), "realized_pnl": obj.get("realized_pnl"), - "total_funding_paid_out": obj.get("total_funding_paid_out") + "total_funding_paid_out": obj.get("total_funding_paid_out"), + "margin_mode": obj.get("margin_mode"), + "allocated_margin": obj.get("allocated_margin") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_stats.py b/lighter/models/account_stats.py index 85e14c2..a992e76 100644 --- a/lighter/models/account_stats.py +++ b/lighter/models/account_stats.py @@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List +from lighter.models.account_margin_stats import AccountMarginStats from typing import Optional, Set from typing_extensions import Self @@ -32,8 +33,10 @@ class AccountStats(BaseModel): available_balance: StrictStr margin_usage: StrictStr buying_power: StrictStr + cross_stats: AccountMarginStats + total_stats: AccountMarginStats additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["collateral", "portfolio_value", "leverage", "available_balance", "margin_usage", "buying_power"] + __properties: ClassVar[List[str]] = ["collateral", "portfolio_value", "leverage", "available_balance", "margin_usage", "buying_power", "cross_stats", "total_stats"] model_config = ConfigDict( populate_by_name=True, @@ -76,6 +79,12 @@ 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() # 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(): @@ -98,7 +107,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "leverage": obj.get("leverage"), "available_balance": obj.get("available_balance"), "margin_usage": obj.get("margin_usage"), - "buying_power": obj.get("buying_power") + "buying_power": obj.get("buying_power"), + "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 }) # 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 56123c8..6fb47be 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -36,6 +36,7 @@ class DetailedAccount(BaseModel): l1_address: StrictStr cancel_all_time: StrictInt total_order_count: StrictInt + total_isolated_order_count: StrictInt pending_order_count: StrictInt status: StrictInt collateral: StrictStr @@ -46,10 +47,11 @@ class DetailedAccount(BaseModel): referral_points_percentage: StrictStr = Field(description=" Remove After FE uses L1 meta endpoint") positions: List[AccountPosition] total_asset_value: StrictStr + cross_asset_value: StrictStr pool_info: PublicPoolInfo shares: List[PublicPoolShare] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral", "account_index", "name", "description", "can_invite", "referral_points_percentage", "positions", "total_asset_value", "pool_info", "shares"] + __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "status", "collateral", "account_index", "name", "description", "can_invite", "referral_points_percentage", "positions", "total_asset_value", "cross_asset_value", "pool_info", "shares"] model_config = ConfigDict( populate_by_name=True, @@ -133,6 +135,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "l1_address": obj.get("l1_address"), "cancel_all_time": obj.get("cancel_all_time"), "total_order_count": obj.get("total_order_count"), + "total_isolated_order_count": obj.get("total_isolated_order_count"), "pending_order_count": obj.get("pending_order_count"), "status": obj.get("status"), "collateral": obj.get("collateral"), @@ -143,6 +146,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "referral_points_percentage": obj.get("referral_points_percentage"), "positions": [AccountPosition.from_dict(_item) for _item in obj["positions"]] if obj.get("positions") 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 }) diff --git a/lighter/models/order.py b/lighter/models/order.py index 91d7885..47d6543 100644 --- a/lighter/models/order.py +++ b/lighter/models/order.py @@ -77,8 +77,8 @@ def time_in_force_validate_enum(cls, value): @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(['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']): - raise ValueError("must be one of enum values ('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')") + if value not in set(['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']): + raise ValueError("must be one of enum values ('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')") return value @field_validator('trigger_status') diff --git a/lighter/models/order_book_orders.py b/lighter/models/order_book_orders.py new file mode 100644 index 0000000..549d79c --- /dev/null +++ b/lighter/models/order_book_orders.py @@ -0,0 +1,125 @@ +# 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.simple_order import SimpleOrder +from typing import Optional, Set +from typing_extensions import Self + +class OrderBookOrders(BaseModel): + """ + OrderBookOrders + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + total_asks: StrictInt + asks: List[SimpleOrder] + total_bids: StrictInt + bids: List[SimpleOrder] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "total_asks", "asks", "total_bids", "bids"] + + 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 OrderBookOrders 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 asks (list) + _items = [] + if self.asks: + for _item in self.asks: + 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 + # 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 OrderBookOrders from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "total_asks": obj.get("total_asks"), + "asks": [SimpleOrder.from_dict(_item) for _item in obj["asks"]] if obj.get("asks") is not None else None, + "total_bids": obj.get("total_bids"), + "bids": [SimpleOrder.from_dict(_item) for _item in obj["bids"]] if obj.get("bids") 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/public_pool.py b/lighter/models/public_pool.py index 0c32351..ba21cd1 100644 --- a/lighter/models/public_pool.py +++ b/lighter/models/public_pool.py @@ -35,6 +35,7 @@ class PublicPool(BaseModel): l1_address: StrictStr cancel_all_time: StrictInt total_order_count: StrictInt + total_isolated_order_count: StrictInt pending_order_count: StrictInt status: StrictInt collateral: StrictStr @@ -44,10 +45,11 @@ class PublicPool(BaseModel): 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") total_asset_value: StrictStr + cross_asset_value: StrictStr pool_info: PublicPoolInfo account_share: Optional[PublicPoolShare] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral", "account_index", "name", "description", "can_invite", "referral_points_percentage", "total_asset_value", "pool_info", "account_share"] + __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "total_isolated_order_count", "pending_order_count", "status", "collateral", "account_index", "name", "description", "can_invite", "referral_points_percentage", "total_asset_value", "cross_asset_value", "pool_info", "account_share"] model_config = ConfigDict( populate_by_name=True, @@ -120,6 +122,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "l1_address": obj.get("l1_address"), "cancel_all_time": obj.get("cancel_all_time"), "total_order_count": obj.get("total_order_count"), + "total_isolated_order_count": obj.get("total_isolated_order_count"), "pending_order_count": obj.get("pending_order_count"), "status": obj.get("status"), "collateral": obj.get("collateral"), @@ -129,6 +132,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "can_invite": obj.get("can_invite"), "referral_points_percentage": obj.get("referral_points_percentage"), "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, "account_share": PublicPoolShare.from_dict(obj["account_share"]) if obj.get("account_share") is not None else None }) diff --git a/lighter/models/req_get_fundings.py b/lighter/models/req_get_fundings.py index f694ed6..d2fe9a5 100644 --- a/lighter/models/req_get_fundings.py +++ b/lighter/models/req_get_fundings.py @@ -38,8 +38,8 @@ class ReqGetFundings(BaseModel): @field_validator('resolution') def resolution_validate_enum(cls, value): """Validates the enum""" - if value not in set(['1h']): - raise ValueError("must be one of enum values ('1h')") + if value not in set(['1h', '1d']): + raise ValueError("must be one of enum values ('1h', '1d')") return value model_config = ConfigDict( diff --git a/lighter/models/req_get_order_book_orders.py b/lighter/models/req_get_order_book_orders.py new file mode 100644 index 0000000..52c008f --- /dev/null +++ b/lighter/models/req_get_order_book_orders.py @@ -0,0 +1,103 @@ +# 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=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 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_validate({ + "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_transfer_fee_info.py b/lighter/models/req_get_transfer_fee_info.py new file mode 100644 index 0000000..1d053be --- /dev/null +++ b/lighter/models/req_get_transfer_fee_info.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReqGetTransferFeeInfo(BaseModel): + """ + ReqGetTransferFeeInfo + """ # noqa: E501 + auth: Optional[StrictStr] = None + 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_validate({ + "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 new file mode 100644 index 0000000..b6b75ba --- /dev/null +++ b/lighter/models/req_get_transfer_history.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ReqGetTransferHistory(BaseModel): + """ + ReqGetTransferHistory + """ # noqa: E501 + account_index: StrictInt + auth: Optional[StrictStr] = Field(default=None, description=" made optional to support header auth clients") + cursor: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["account_index", "auth", "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 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_validate({ + "account_index": obj.get("account_index"), + "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/resp_change_account_tier.py b/lighter/models/resp_change_account_tier.py new file mode 100644 index 0000000..35b6c15 --- /dev/null +++ b/lighter/models/resp_change_account_tier.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class RespChangeAccountTier(BaseModel): + """ + RespChangeAccountTier + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message"] + + 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 RespChangeAccountTier 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 RespChangeAccountTier from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_send_tx.py b/lighter/models/resp_send_tx.py new file mode 100644 index 0000000..cc6adcc --- /dev/null +++ b/lighter/models/resp_send_tx.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 RespSendTx(BaseModel): + """ + RespSendTx + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + tx_hash: StrictStr + predicted_execution_time_ms: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "tx_hash", "predicted_execution_time_ms"] + + 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 RespSendTx 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 RespSendTx from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "tx_hash": obj.get("tx_hash"), + "predicted_execution_time_ms": obj.get("predicted_execution_time_ms") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_send_tx_batch.py b/lighter/models/resp_send_tx_batch.py new file mode 100644 index 0000000..2b16358 --- /dev/null +++ b/lighter/models/resp_send_tx_batch.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 RespSendTxBatch(BaseModel): + """ + RespSendTxBatch + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + tx_hash: List[StrictStr] + predicted_execution_time_ms: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "tx_hash", "predicted_execution_time_ms"] + + 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 RespSendTxBatch 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 RespSendTxBatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "tx_hash": obj.get("tx_hash"), + "predicted_execution_time_ms": obj.get("predicted_execution_time_ms") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_withdrawal_delay.py b/lighter/models/resp_withdrawal_delay.py new file mode 100644 index 0000000..3add899 --- /dev/null +++ b/lighter/models/resp_withdrawal_delay.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class RespWithdrawalDelay(BaseModel): + """ + RespWithdrawalDelay + """ # noqa: E501 + seconds: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["seconds"] + + 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 RespWithdrawalDelay 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 RespWithdrawalDelay from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "seconds": obj.get("seconds") + }) + # 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/risk_info.py b/lighter/models/risk_info.py index 0186cc7..93d571e 100644 --- a/lighter/models/risk_info.py +++ b/lighter/models/risk_info.py @@ -17,8 +17,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr +from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List +from lighter.models.risk_parameters import RiskParameters from typing import Optional, Set from typing_extensions import Self @@ -26,13 +27,10 @@ class RiskInfo(BaseModel): """ RiskInfo """ # noqa: E501 - collateral: StrictStr - total_account_value: StrictStr - initial_margin_req: StrictStr - maintenance_margin_req: StrictStr - close_out_margin_req: StrictStr + cross_risk_parameters: RiskParameters + isolated_risk_parameters: List[RiskParameters] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["collateral", "total_account_value", "initial_margin_req", "maintenance_margin_req", "close_out_margin_req"] + __properties: ClassVar[List[str]] = ["cross_risk_parameters", "isolated_risk_parameters"] model_config = ConfigDict( populate_by_name=True, @@ -75,6 +73,16 @@ 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_risk_parameters + if self.cross_risk_parameters: + _dict['cross_risk_parameters'] = self.cross_risk_parameters.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in isolated_risk_parameters (list) + _items = [] + if self.isolated_risk_parameters: + for _item in self.isolated_risk_parameters: + if _item: + _items.append(_item.to_dict()) + _dict['isolated_risk_parameters'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -92,11 +100,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "collateral": obj.get("collateral"), - "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") + "cross_risk_parameters": RiskParameters.from_dict(obj["cross_risk_parameters"]) if obj.get("cross_risk_parameters") is not None else None, + "isolated_risk_parameters": [RiskParameters.from_dict(_item) for _item in obj["isolated_risk_parameters"]] if obj.get("isolated_risk_parameters") is not None else None }) # 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 new file mode 100644 index 0000000..2084032 --- /dev/null +++ b/lighter/models/risk_parameters.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class RiskParameters(BaseModel): + """ + RiskParameters + """ # noqa: E501 + market_id: StrictInt + collateral: StrictStr + total_account_value: StrictStr + initial_margin_req: StrictStr + maintenance_margin_req: StrictStr + close_out_margin_req: 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"] + + 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 RiskParameters 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 RiskParameters from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "market_id": obj.get("market_id"), + "collateral": obj.get("collateral"), + "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") + }) + # 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 7ee6ac6..0520475 100644 --- a/lighter/models/trade.py +++ b/lighter/models/trade.py @@ -40,12 +40,16 @@ class Trade(BaseModel): is_maker_ask: StrictBool block_height: StrictInt timestamp: StrictInt + taker_fee: StrictInt 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_position_size_before: StrictStr maker_entry_quote_before: StrictStr maker_initial_margin_fraction_before: StrictInt + maker_position_sign_changed: StrictBool additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["trade_id", "tx_hash", "type", "market_id", "size", "price", "usd_amount", "ask_id", "bid_id", "ask_account_id", "bid_account_id", "is_maker_ask", "block_height", "timestamp", "taker_fee", "taker_position_size_before", "taker_entry_quote_before", "taker_initial_margin_fraction_before", "taker_position_sign_changed", "maker_fee", "maker_position_size_before", "maker_entry_quote_before", "maker_initial_margin_fraction_before", "maker_position_sign_changed"] diff --git a/lighter/models/transfer_fee_info.py b/lighter/models/transfer_fee_info.py new file mode 100644 index 0000000..b4ee332 --- /dev/null +++ b/lighter/models/transfer_fee_info.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TransferFeeInfo(BaseModel): + """ + TransferFeeInfo + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + transfer_fee_usdc: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "transfer_fee_usdc"] + + 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 TransferFeeInfo 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 TransferFeeInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "transfer_fee_usdc": obj.get("transfer_fee_usdc") + }) + # 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/transfer_history.py b/lighter/models/transfer_history.py new file mode 100644 index 0000000..9c415e6 --- /dev/null +++ b/lighter/models/transfer_history.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from lighter.models.transfer_history_item import TransferHistoryItem +from typing import Optional, Set +from typing_extensions import Self + +class TransferHistory(BaseModel): + """ + TransferHistory + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + transfers: List[TransferHistoryItem] + cursor: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "transfers", "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 TransferHistory 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 transfers (list) + _items = [] + if self.transfers: + for _item in self.transfers: + if _item: + _items.append(_item.to_dict()) + _dict['transfers'] = _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 TransferHistory from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "transfers": [TransferHistoryItem.from_dict(_item) for _item in obj["transfers"]] if obj.get("transfers") is not None else None, + "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/transfer_history_item.py b/lighter/models/transfer_history_item.py new file mode 100644 index 0000000..dcebc4a --- /dev/null +++ b/lighter/models/transfer_history_item.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class TransferHistoryItem(BaseModel): + """ + TransferHistoryItem + """ # noqa: E501 + id: StrictStr + amount: StrictStr + timestamp: StrictInt + type: StrictStr + from_l1_address: StrictStr + to_l1_address: StrictStr + from_account_index: StrictInt + to_account_index: StrictInt + tx_hash: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "amount", "timestamp", "type", "from_l1_address", "to_l1_address", "from_account_index", "to_account_index", "tx_hash"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['L2TransferInflow', 'L2TransferOutflow']): + raise ValueError("must be one of enum values ('L2TransferInflow', 'L2TransferOutflow')") + 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 TransferHistoryItem 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 TransferHistoryItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "amount": obj.get("amount"), + "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") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/openapi.json b/openapi.json index 870d264..1845067 100644 --- a/openapi.json +++ b/openapi.json @@ -84,55 +84,6 @@ "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" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "account_index", - "in": "query", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "name": "market_id", - "in": "query", - "required": true, - "type": "integer", - "format": "uint8" - }, - { - "name": "auth", - "in": "query", - "required": true, - "type": "string" - } - ], - "tags": [ - "order" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get account active orders. `auth` can be generated using the SDK." - } - }, "/api/v1/accountInactiveOrders": { "get": { "summary": "accountInactiveOrders", @@ -152,10 +103,18 @@ } }, "parameters": [ + { + "name": "authorization", + "description": " make required after integ is done", + "in": "header", + "required": false, + "type": "string" + }, { "name": "auth", + "description": " made optional to support header auth clients", "in": "query", - "required": true, + "required": false, "type": "string" }, { @@ -212,15 +171,15 @@ "description": "Get account inactive orders" } }, - "/api/v1/accountOrders": { + "/api/v1/accountLimits": { "get": { - "summary": "accountOrders", - "operationId": "accountOrders", + "summary": "accountLimits", + "operationId": "accountLimits", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/Orders" + "$ref": "#/definitions/AccountLimits" } }, "400": { @@ -232,9 +191,10 @@ }, "parameters": [ { - "name": "auth", - "in": "query", - "required": true, + "name": "authorization", + "description": " make required after integ is done", + "in": "header", + "required": false, "type": "string" }, { @@ -245,35 +205,77 @@ "format": "int64" }, { - "name": "market_id", + "name": "auth", + "description": " made optional to support header auth clients", "in": "query", - "required": true, - "type": "integer", - "format": "uint8" + "required": false, + "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" + } }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ { - "name": "cursor", - "in": "query", + "name": "authorization", + "in": "header", "required": false, "type": "string" }, { - "name": "limit", + "name": "by", "in": "query", "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 + "type": "string", + "enum": [ + "index", + "l1_address" + ] + }, + { + "name": "value", + "in": "query", + "required": true, + "type": "string" + }, + { + "name": "auth", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "order" + "account" ], "consumes": [ "multipart/form-data" ], - "description": "Get account orders" + "description": "Get account metadatas" } }, "/api/v1/accountTxs": { @@ -381,6 +383,30 @@ "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" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "tags": [ + "announcement" + ], + "description": "Get announcement" + } + }, "/api/v1/apikeys": { "get": { "summary": "apikeys", @@ -654,6 +680,50 @@ "description": "Get candlesticks" } }, + "/api/v1/changeAccountTier": { + "post": { + "summary": "changeAccountTier", + "operationId": "changeAccountTier", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespChangeAccountTier" + } + }, + "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/ReqChangeAccountTier" + } + } + ], + "tags": [ + "account" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Change account tier" + } + }, "/api/v1/currentHeight": { "get": { "summary": "currentHeight", @@ -697,6 +767,13 @@ } }, "parameters": [ + { + "name": "authorization", + "description": " make required after integ is done", + "in": "header", + "required": false, + "type": "string" + }, { "name": "account_index", "in": "query", @@ -706,8 +783,9 @@ }, { "name": "auth", + "description": " made optional to support header auth clients", "in": "query", - "required": true, + "required": false, "type": "string" }, { @@ -767,15 +845,15 @@ "description": "Get exchange stats" } }, - "/api/v1/feeBucket": { + "/api/v1/export": { "get": { - "summary": "feeBucket", - "operationId": "feeBucket", + "summary": "export", + "operationId": "export", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/FeeBucket" + "$ref": "#/definitions/ExportData" } }, "400": { @@ -786,21 +864,100 @@ } }, "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, + { + "name": "auth", + "in": "query", + "required": false, + "type": "string" + }, { "name": "account_index", "in": "query", - "required": true, + "required": false, "type": "integer", - "format": "int64" + "format": "int64", + "default": "-1" + }, + { + "name": "market_id", + "in": "query", + "required": false, + "type": "integer", + "format": "uint8", + "default": "255" + }, + { + "name": "type", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "funding", + "trade" + ] } ], "tags": [ - "account" + "order" ], "consumes": [ "multipart/form-data" ], - "description": "Get account fee bucket" + "description": "Export data" + } + }, + "/api/v1/fastbridge/info": { + "get": { + "summary": "fastbridge_info", + "operationId": "fastbridge_info", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespGetFastBridgeInfo" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "tags": [ + "bridge" + ], + "description": "Get fast bridge info" + } + }, + "/api/v1/funding-rates": { + "get": { + "summary": "funding-rates", + "operationId": "funding-rates", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/FundingRates" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "tags": [ + "funding" + ], + "description": "Get funding rates" } }, "/api/v1/fundings": { @@ -835,7 +992,8 @@ "required": true, "type": "string", "enum": [ - "1h" + "1h", + "1d" ] }, { @@ -873,15 +1031,15 @@ "description": "Get fundings" } }, - "/api/v1/nextNonce": { + "/api/v1/l1Metadata": { "get": { - "summary": "nextNonce", - "operationId": "nextNonce", + "summary": "l1Metadata", + "operationId": "l1Metadata", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/NextNonce" + "$ref": "#/definitions/L1Metadata" } }, "400": { @@ -893,14 +1051,136 @@ }, "parameters": [ { - "name": "account_index", - "in": "query", - "required": true, - "type": "integer", - "format": "int64" + "name": "authorization", + "description": " make required after integ is done", + "in": "header", + "required": false, + "type": "string" }, { - "name": "api_key_index", + "name": "auth", + "description": " made optional to support header auth clients", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "l1_address", + "in": "query", + "required": true, + "type": "string" + } + ], + "tags": [ + "account" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Get L1 metadata" + } + }, + "/api/v1/liquidations": { + "get": { + "summary": "liquidations", + "operationId": "liquidations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/LiquidationInfos" + } + }, + "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": "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": "uint8", + "default": "255" + }, + { + "name": "cursor", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + } + ], + "tags": [ + "account" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Get liquidation infos" + } + }, + "/api/v1/nextNonce": { + "get": { + "summary": "nextNonce", + "operationId": "nextNonce", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/NextNonce" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "account_index", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "api_key_index", "in": "query", "required": true, "type": "integer", @@ -916,6 +1196,50 @@ "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" + } + }, + "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/ReqAckNotif" + } + } + ], + "tags": [ + "notification" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Ack notification" + } + }, "/api/v1/orderBookDetails": { "get": { "summary": "orderBookDetails", @@ -1054,6 +1378,12 @@ } }, "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, { "name": "auth", "in": "query", @@ -1132,6 +1462,89 @@ "description": "Get account PnL chart" } }, + "/api/v1/positionFunding": { + "get": { + "summary": "positionFunding", + "operationId": "positionFunding", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/PositionFundings" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, + { + "name": "auth", + "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": "uint8", + "default": "255" + }, + { + "name": "cursor", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "required": true, + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 100 + }, + { + "name": "side", + "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/publicPools": { "get": { "summary": "publicPools", @@ -1151,6 +1564,12 @@ } }, "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, { "name": "auth", "in": "query", @@ -1247,15 +1666,15 @@ "description": "Get recent trades" } }, - "/api/v1/sendTx": { - "post": { - "summary": "sendTx", - "operationId": "sendTx", + "/api/v1/referral/points": { + "get": { + "summary": "referral_points", + "operationId": "referral_points", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/TxHash" + "$ref": "#/definitions/ReferralPoints" } }, "400": { @@ -1267,32 +1686,82 @@ }, "parameters": [ { - "name": "body", - "in": "body", + "name": "authorization", + "description": " make required after integ is done", + "in": "header", + "required": false, + "type": "string" + }, + { + "name": "auth", + "description": " made optional to support header auth clients", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "account_index", + "in": "query", "required": true, - "schema": { - "$ref": "#/definitions/ReqSendTx" - } + "type": "integer", + "format": "int64" } ], "tags": [ - "transaction" + "referral" ], "consumes": [ "multipart/form-data" ], - "description": "You need to sign the transaction body before sending it to the server. More details can be found in the Get Started docs: [Get Started For Programmers](https://apidocs.lighter.xyz/docs/get-started-for-programmers)" + "description": "Get referral points" } }, - "/api/v1/sendTxBatch": { + "/api/v1/sendTx": { "post": { - "summary": "sendTxBatch", - "operationId": "sendTxBatch", - "responses": { + "summary": "sendTx", + "operationId": "sendTx", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespSendTx" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReqSendTx" + } + } + ], + "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", + "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/TxHashes" + "$ref": "#/definitions/RespSendTxBatch" } }, "400": { @@ -1340,6 +1809,12 @@ } }, "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, { "name": "auth", "in": "query", @@ -1386,10 +1861,9 @@ "required": false, "type": "string", "enum": [ - "asc", "desc" ], - "default": "asc" + "default": "desc" }, { "name": "cursor", @@ -1432,6 +1906,118 @@ "description": "Get trades" } }, + "/api/v1/transfer/history": { + "get": { + "summary": "transfer_history", + "operationId": "transfer_history", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/TransferHistory" + } + }, + "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": "account_index", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "auth", + "description": " made optional to support header auth clients", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "cursor", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "transaction" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Get transfer history" + } + }, + "/api/v1/transferFeeInfo": { + "get": { + "summary": "transferFeeInfo", + "operationId": "transferFeeInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/TransferFeeInfo" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": false, + "type": "string" + }, + { + "name": "auth", + "in": "query", + "required": false, + "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" + } + ], + "tags": [ + "info" + ], + "consumes": [ + "multipart/form-data" + ], + "description": "Transfer fee info" + } + }, "/api/v1/tx": { "get": { "summary": "tx", @@ -1576,6 +2162,13 @@ } }, "parameters": [ + { + "name": "authorization", + "description": " make required after integ is done", + "in": "header", + "required": false, + "type": "string" + }, { "name": "account_index", "in": "query", @@ -1585,8 +2178,9 @@ }, { "name": "auth", + "description": " made optional to support header auth clients", "in": "query", - "required": true, + "required": false, "type": "string" }, { @@ -1616,6 +2210,30 @@ "description": "Get withdraw history" } }, + "/api/v1/withdrawalDelay": { + "get": { + "summary": "withdrawalDelay", + "operationId": "withdrawalDelay", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/RespWithdrawalDelay" + } + }, + "400": { + "description": "Bad request", + "schema": { + "$ref": "#/definitions/ResultCode" + } + } + }, + "tags": [ + "info" + ], + "description": "Withdrawal delay in seconds" + } + }, "/info": { "get": { "summary": "info", @@ -1677,6 +2295,11 @@ "format": "int64", "example": "100" }, + "total_isolated_order_count": { + "type": "integer", + "format": "int64", + "example": "100" + }, "pending_order_count": { "type": "integer", "format": "int64", @@ -1700,6 +2323,7 @@ "l1_address", "cancel_all_time", "total_order_count", + "total_isolated_order_count", "pending_order_count", "status", "collateral" @@ -1729,7 +2353,7 @@ "api_keys" ] }, - "AccountPnL": { + "AccountLimits": { "type": "object", "properties": { "code": { @@ -1740,316 +2364,180 @@ "message": { "type": "string" }, - "resolution": { - "type": "string", - "example": "15m" + "max_llp_percentage": { + "type": "integer", + "format": "int32", + "example": "25" }, - "pnl": { - "type": "array", - "items": { - "$ref": "#/definitions/PnLEntry" - } + "user_tier": { + "type": "string", + "example": "std" } }, - "title": "AccountPnL", + "title": "AccountLimits", "required": [ "code", - "resolution", - "pnl" + "max_llp_percentage", + "user_tier" ] }, - "AccountPosition": { + "AccountMarginStats": { "type": "object", "properties": { - "market_id": { - "type": "integer", - "format": "uint8", - "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": { + "collateral": { "type": "string", - "example": "3.6956" + "example": "199955" }, - "avg_entry_price": { + "portfolio_value": { "type": "string", - "example": "3024.66" + "example": "199955" }, - "position_value": { + "leverage": { "type": "string", - "example": "3019.92" + "example": "1.0" }, - "unrealized_pnl": { + "available_balance": { "type": "string", - "example": "17.521309" + "example": "199955" }, - "realized_pnl": { + "margin_usage": { "type": "string", - "example": "2.000000" + "example": "0.0" }, - "total_funding_paid_out": { + "buying_power": { "type": "string", - "example": "34.2" + "example": "199955" } }, - "title": "AccountPosition", + "title": "AccountMarginStats", "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" + "collateral", + "portfolio_value", + "leverage", + "available_balance", + "margin_usage", + "buying_power" ] }, - "ApiKey": { + "AccountMarketStats": { "type": "object", "properties": { - "account_index": { - "type": "integer", - "format": "int64", - "example": "3" - }, - "api_key_index": { + "market_id": { "type": "integer", "format": "uint8", - "example": "0" + "example": "1" }, - "nonce": { + "daily_trades_count": { "type": "integer", "format": "int64", - "example": "722" + "example": "68" }, - "public_key": { - "type": "string" - } - }, - "title": "ApiKey", - "required": [ - "account_index", - "api_key_index", - "nonce", - "public_key" - ] - }, - "Block": { - "type": "object", - "properties": { - "commitment": { - "type": "string" - }, - "height": { - "type": "integer", - "format": "int64" - }, - "state_root": { - "type": "string" - }, - "priority_operations": { - "type": "integer", - "format": "int32" - }, - "on_chain_l2_operations": { - "type": "integer", - "format": "int32" - }, - "pending_on_chain_operations_pub_data": { - "type": "string" - }, - "committed_tx_hash": { - "type": "string" - }, - "committed_at": { - "type": "integer", - "format": "int64" - }, - "verified_tx_hash": { - "type": "string" - }, - "verified_at": { - "type": "integer", - "format": "int64" - }, - "txs": { - "type": "array", - "items": { - "$ref": "#/definitions/Tx" - } - }, - "status": { - "type": "integer", - "format": "int64" - }, - "size": { - "type": "integer", - "format": "uin16" - } - }, - "title": "Block", - "required": [ - "commitment", - "height", - "state_root", - "priority_operations", - "on_chain_l2_operations", - "pending_on_chain_operations_pub_data", - "committed_tx_hash", - "committed_at", - "verified_tx_hash", - "verified_at", - "txs", - "status", - "size" - ] - }, - "Blocks": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" + "daily_base_token_volume": { + "type": "number", + "format": "double", + "example": "235.25" }, - "total": { - "type": "integer", - "format": "int64" + "daily_quote_token_volume": { + "type": "number", + "format": "double", + "example": "93566.25" }, - "blocks": { - "type": "array", - "items": { - "$ref": "#/definitions/Block" - } - } - }, - "title": "Blocks", - "required": [ - "code", - "total", - "blocks" - ] - }, - "Candlestick": { - "type": "object", - "properties": { - "timestamp": { + "weekly_trades_count": { "type": "integer", "format": "int64", - "example": "1640995200" + "example": "68" }, - "open": { + "weekly_base_token_volume": { "type": "number", "format": "double", - "example": "3024.66" + "example": "235.25" }, - "high": { + "weekly_quote_token_volume": { "type": "number", "format": "double", - "example": "3034.66" + "example": "93566.25" }, - "low": { + "monthly_trades_count": { + "type": "integer", + "format": "int64", + "example": "68" + }, + "monthly_base_token_volume": { "type": "number", "format": "double", - "example": "3014.66" + "example": "235.25" }, - "close": { + "monthly_quote_token_volume": { "type": "number", "format": "double", - "example": "3024.66" + "example": "93566.25" }, - "volume0": { + "total_trades_count": { + "type": "integer", + "format": "int64", + "example": "68" + }, + "total_base_token_volume": { "type": "number", "format": "double", "example": "235.25" }, - "volume1": { + "total_quote_token_volume": { "type": "number", "format": "double", "example": "93566.25" - }, - "last_trade_id": { - "type": "integer", - "format": "int64", - "example": "1" } }, - "title": "Candlestick", + "title": "AccountMarketStats", "required": [ - "timestamp", - "open", - "high", - "low", - "close", - "volume0", - "volume1", - "last_trade_id" + "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" ] }, - "Candlesticks": { + "AccountMetadata": { "type": "object", "properties": { - "code": { + "account_index": { "type": "integer", - "format": "int32", - "example": "200" + "format": "int64" }, - "message": { + "name": { "type": "string" }, - "resolution": { - "type": "string", - "example": "15m" + "description": { + "type": "string" }, - "candlesticks": { - "type": "array", - "items": { - "$ref": "#/definitions/Candlestick" - } + "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" } }, - "title": "Candlesticks", + "title": "AccountMetadata", "required": [ - "code", - "resolution", - "candlesticks" + "account_index", + "name", + "description", + "can_invite", + "referral_points_percentage" ] }, - "CurrentHeight": { + "AccountMetadatas": { "type": "object", "properties": { "code": { @@ -2060,38 +2548,20 @@ "message": { "type": "string" }, - "height": { - "type": "integer", - "format": "int64" + "account_metadatas": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountMetadata" + } } }, - "title": "CurrentHeight", + "title": "AccountMetadatas", "required": [ "code", - "height" - ] - }, - "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" + "account_metadatas" ] }, - "DepositHistory": { + "AccountPnL": { "type": "object", "properties": { "code": { @@ -2102,170 +2572,236 @@ "message": { "type": "string" }, - "deposits": { + "resolution": { + "type": "string", + "example": "15m" + }, + "pnl": { "type": "array", "items": { - "$ref": "#/definitions/DepositHistoryItem" + "$ref": "#/definitions/PnLEntry" } - }, - "cursor": { - "type": "string" } }, - "title": "DepositHistory", + "title": "AccountPnL", "required": [ "code", - "deposits", - "cursor" + "resolution", + "pnl" ] }, - "DepositHistoryItem": { + "AccountPosition": { "type": "object", "properties": { - "id": { - "type": "string" + "market_id": { + "type": "integer", + "format": "uint8", + "example": "1" }, - "amount": { + "symbol": { "type": "string", - "example": "0.1" + "example": "ETH" }, - "timestamp": { + "initial_margin_fraction": { + "type": "string", + "example": "20.00" + }, + "open_order_count": { "type": "integer", "format": "int64", - "example": "1640995200" + "example": "3" }, - "status": { + "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", - "enum": [ - "failed", - "pending", - "completed", - "claimable" - ] + "example": "3.6956" }, - "l1_tx_hash": { + "avg_entry_price": { "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "example": "3024.66" + }, + "position_value": { + "type": "string", + "example": "3019.92" + }, + "unrealized_pnl": { + "type": "string", + "example": "17.521309" + }, + "realized_pnl": { + "type": "string", + "example": "2.000000" + }, + "total_funding_paid_out": { + "type": "string", + "example": "34.2" + }, + "margin_mode": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "allocated_margin": { + "type": "string", + "example": "46342" } }, - "title": "DepositHistoryItem", + "title": "AccountPosition", "required": [ - "id", - "amount", - "timestamp", - "status", - "l1_tx_hash" + "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", + "margin_mode", + "allocated_margin" ] }, - "DetailedAccount": { + "AccountStats": { "type": "object", "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" + "collateral": { + "type": "string", + "example": "199955" }, - "message": { - "type": "string" + "portfolio_value": { + "type": "string", + "example": "199955" }, - "account_type": { - "type": "integer", - "format": "uint8", - "example": "1" + "leverage": { + "type": "string", + "example": "1.0" }, - "index": { - "type": "integer", - "format": "int64", - "example": "1" + "available_balance": { + "type": "string", + "example": "199955" }, - "l1_address": { + "margin_usage": { "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "example": "0.0" }, - "cancel_all_time": { - "type": "integer", - "format": "int64", - "example": "1640995200" + "buying_power": { + "type": "string", + "example": "199955" }, - "total_order_count": { + "cross_stats": { + "$ref": "#/definitions/AccountMarginStats" + }, + "total_stats": { + "$ref": "#/definitions/AccountMarginStats" + } + }, + "title": "AccountStats", + "required": [ + "collateral", + "portfolio_value", + "leverage", + "available_balance", + "margin_usage", + "buying_power", + "cross_stats", + "total_stats" + ] + }, + "AccountTradeStats": { + "type": "object", + "properties": { + "daily_trades_count": { "type": "integer", "format": "int64", - "example": "100" + "example": "68" }, - "pending_order_count": { + "daily_volume": { + "type": "number", + "format": "double", + "example": "235.25" + }, + "weekly_trades_count": { "type": "integer", "format": "int64", - "example": "100" + "example": "68" }, - "status": { + "weekly_volume": { + "type": "number", + "format": "double", + "example": "235.25" + }, + "monthly_trades_count": { "type": "integer", - "format": "uint8", - "example": "1" + "format": "int64", + "example": "68" }, - "collateral": { - "type": "string", - "example": "46342" + "monthly_volume": { + "type": "number", + "format": "double", + "example": "235.25" }, - "name": { - "type": "string" + "total_trades_count": { + "type": "integer", + "format": "int64", + "example": "68" }, - "description": { + "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" }, - "can_invite": { - "type": "boolean", - "format": "boolean" - }, - "referral_points_percentage": { + "content": { "type": "string" }, - "max_referral_usage_limit": { + "created_at": { "type": "integer", - "format": "int32" - }, - "positions": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountPosition" - } - }, - "total_asset_value": { - "type": "string", - "example": "19995" - }, - "pool_info": { - "$ref": "#/definitions/PublicPoolInfo" - }, - "shares": { - "type": "array", - "items": { - "$ref": "#/definitions/PublicPoolShare" - } + "format": "int64" } }, - "title": "DetailedAccount", + "title": "Announcement", "required": [ - "code", - "account_type", - "index", - "l1_address", - "cancel_all_time", - "total_order_count", - "pending_order_count", - "status", - "collateral", - "name", - "description", - "can_invite", - "referral_points_percentage", - "max_referral_usage_limit", - "positions", - "total_asset_value", - "pool_info", - "shares" + "title", + "content", + "created_at" ] }, - "DetailedAccounts": { + "Announcements": { "type": "object", "properties": { "code": { @@ -2276,142 +2812,120 @@ "message": { "type": "string" }, - "total": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "accounts": { + "announcements": { "type": "array", "items": { - "$ref": "#/definitions/DetailedAccount" + "$ref": "#/definitions/Announcement" } } }, - "title": "DetailedAccounts", + "title": "Announcements", "required": [ "code", - "total", - "accounts" + "announcements" ] }, - "EnrichedTx": { + "ApiKey": { "type": "object", "properties": { - "code": { + "account_index": { "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "format": "int64", + "example": "3" }, - "type": { + "api_key_index": { "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" + "example": "0" }, - "transaction_index": { + "nonce": { "type": "integer", "format": "int64", - "example": "8761" - }, - "l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "example": "722" }, - "account_index": { - "type": "integer", - "format": "int64", - "example": "1" + "public_key": { + "type": "string" + } + }, + "title": "ApiKey", + "required": [ + "account_index", + "api_key_index", + "nonce", + "public_key" + ] + }, + "Block": { + "type": "object", + "properties": { + "commitment": { + "type": "string" }, - "nonce": { + "height": { "type": "integer", - "format": "int64", - "example": "722" + "format": "int64" }, - "expire_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" + "state_root": { + "type": "string" }, - "block_height": { + "priority_operations": { "type": "integer", - "format": "int64", - "example": "45434" + "format": "int32" }, - "queued_at": { + "on_chain_l2_operations": { "type": "integer", - "format": "int64", - "example": "1640995200" + "format": "int32" }, - "executed_at": { + "pending_on_chain_operations_pub_data": { + "type": "string" + }, + "committed_tx_hash": { + "type": "string" + }, + "committed_at": { "type": "integer", - "format": "int64", - "example": "1640995200" + "format": "int64" }, - "sequence_index": { + "verified_tx_hash": { + "type": "string" + }, + "verified_at": { "type": "integer", - "format": "int64", - "example": "8761" + "format": "int64" }, - "parent_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "txs": { + "type": "array", + "items": { + "$ref": "#/definitions/Tx" + } }, - "committed_at": { + "status": { "type": "integer", - "format": "int64", - "example": "1640995200" + "format": "int64" }, - "verified_at": { + "size": { "type": "integer", - "format": "int64", - "example": "1640995200" + "format": "uin16" } }, - "title": "EnrichedTx", + "title": "Block", "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", + "commitment", + "height", + "state_root", + "priority_operations", + "on_chain_l2_operations", + "pending_on_chain_operations_pub_data", + "committed_tx_hash", "committed_at", - "verified_at" + "verified_tx_hash", + "verified_at", + "txs", + "status", + "size" ] }, - "ExchangeStats": { + "Blocks": { "type": "object", "properties": { "code": { @@ -2424,60 +2938,46 @@ }, "total": { "type": "integer", - "format": "int64", - "example": "1" + "format": "int64" }, - "order_book_stats": { + "blocks": { "type": "array", - "example": "1", "items": { - "$ref": "#/definitions/OrderBookStats" + "$ref": "#/definitions/Block" } - }, - "daily_usd_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "daily_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" } }, - "title": "ExchangeStats", + "title": "Blocks", "required": [ "code", "total", - "order_book_stats", - "daily_usd_volume", - "daily_trades_count" + "blocks" ] }, - "FeeBucket": { + "BridgeSupportedNetwork": { "type": "object", "properties": { - "vip_tier": { - "type": "integer", - "format": "uint8" + "name": { + "type": "string", + "example": "Arbitrum" }, - "taker_fee": { - "type": "integer", - "format": "int32" + "chain_id": { + "type": "string", + "example": "4164" }, - "maker_fee": { - "type": "integer", - "format": "int32" + "explorer": { + "type": "string", + "example": "https://arbiscan.io/" } }, - "title": "FeeBucket", + "title": "BridgeSupportedNetwork", "required": [ - "vip_tier", - "taker_fee", - "maker_fee" + "name", + "chain_id", + "explorer" ] }, - "Funding": { + "Candlestick": { "type": "object", "properties": { "timestamp": { @@ -2485,28 +2985,55 @@ "format": "int64", "example": "1640995200" }, - "value": { - "type": "string", - "example": "0.0001" + "open": { + "type": "number", + "format": "double", + "example": "3024.66" }, - "rate": { - "type": "string", - "example": "0.0001" + "high": { + "type": "number", + "format": "double", + "example": "3034.66" }, - "direction": { - "type": "string", - "example": "long" + "low": { + "type": "number", + "format": "double", + "example": "3014.66" + }, + "close": { + "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" } }, - "title": "Funding", + "title": "Candlestick", "required": [ "timestamp", - "value", - "rate", - "direction" + "open", + "high", + "low", + "close", + "volume0", + "volume1", + "last_trade_id" ] }, - "Fundings": { + "Candlesticks": { "type": "object", "properties": { "code": { @@ -2519,23 +3046,41 @@ }, "resolution": { "type": "string", - "example": "1h" + "example": "15m" }, - "fundings": { + "candlesticks": { "type": "array", "items": { - "$ref": "#/definitions/Funding" + "$ref": "#/definitions/Candlestick" } } }, - "title": "Fundings", + "title": "Candlesticks", "required": [ "code", "resolution", - "fundings" + "candlesticks" ] }, - "NextNonce": { + "ContractAddress": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "1" + }, + "address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + } + }, + "title": "ContractAddress", + "required": [ + "name", + "address" + ] + }, + "CurrentHeight": { "type": "object", "properties": { "code": { @@ -2546,685 +3091,3015 @@ "message": { "type": "string" }, - "nonce": { + "height": { "type": "integer", - "format": "int64", - "example": "722" + "format": "int64" } }, - "title": "NextNonce", + "title": "CurrentHeight", "required": [ "code", - "nonce" + "height" ] }, - "Order": { + "Cursor": { "type": "object", "properties": { - "order_index": { + "next_cursor": { + "type": "string" + } + }, + "title": "Cursor" + }, + "DailyReturn": { + "type": "object", + "properties": { + "timestamp": { "type": "integer", "format": "int64", - "example": "1" + "example": "1640995200" }, - "client_order_index": { - "type": "integer", - "format": "int64", - "example": "234" + "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" + } + }, + "cursor": { + "type": "string" + } + }, + "title": "DepositHistory", + "required": [ + "code", + "deposits", + "cursor" + ] + }, + "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" + } + }, + "title": "DepositHistoryItem", + "required": [ + "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" + }, + "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": "#/definitions/AccountPosition" + } + }, + "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" + } + } + }, + "title": "DetailedAccount", + "required": [ + "code", + "account_type", + "index", + "l1_address", + "cancel_all_time", + "total_order_count", + "total_isolated_order_count", + "pending_order_count", + "status", + "collateral", + "account_index", + "name", + "description", + "can_invite", + "referral_points_percentage", + "positions", + "total_asset_value", + "cross_asset_value", + "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": "#/definitions/DetailedAccount" + } + } + }, + "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" + }, + "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", + "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" + }, + "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", + "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": "#/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" + ] + }, + "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": "uint8" + }, + "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" + } + } + }, + "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" + } + } + }, + "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" + } + }, + "title": "LiqTrade", + "required": [ + "price", + "size", + "taker_fee", + "maker_fee" + ] + }, + "Liquidation": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "market_id": { + "type": "integer", + "format": "uint8" + }, + "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" + ] + }, + "LiquidationInfo": { + "type": "object", + "properties": { + "positions": { + "type": "array", + "items": { + "$ref": "#/definitions/AccountPosition" + } + }, + "risk_info_before": { + "$ref": "#/definitions/RiskInfo" + }, + "risk_info_after": { + "$ref": "#/definitions/RiskInfo" + }, + "mark_prices": { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + }, + "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" + } + }, + "next_cursor": { + "type": "string" + } + }, + "title": "LiquidationInfos", + "required": [ + "code", + "liquidations" + ] + }, + "MarketInfo": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "uint8", + "example": "1" + }, + "index_price": { + "type": "string", + "example": "3024.66" + }, + "mark_price": { + "type": "string", + "example": "3024.66" + }, + "open_interest": { + "type": "string", + "example": "235.25" + }, + "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": "MarketInfo", + "required": [ + "market_id", + "index_price", + "mark_price", + "open_interest", + "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" + ] + }, + "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": "uint8", + "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" + ] + }, + "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" + } + }, + "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" + ] + }, + "OrderBook": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "example": "ETH" + }, + "market_id": { + "type": "integer", + "format": "uint8", + "example": "1" + }, + "status": { + "type": "string", + "example": "active", + "enum": [ + "frozen", + "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" + } + }, + "title": "OrderBook", + "required": [ + "symbol", + "market_id", + "status", + "taker_fee", + "maker_fee", + "liquidation_fee", + "min_base_amount", + "min_quote_amount", + "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" + } + }, + "title": "OrderBookDepth", + "required": [ + "code", + "asks", + "bids", + "offset" + ] + }, + "OrderBookDetail": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "example": "ETH" + }, + "market_id": { + "type": "integer", + "format": "uint8", + "example": "1" + }, + "status": { + "type": "string", + "example": "active", + "enum": [ + "frozen", + "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" + }, + "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" + } + } + }, + "title": "OrderBookDetail", + "required": [ + "symbol", + "market_id", + "status", + "taker_fee", + "maker_fee", + "liquidation_fee", + "min_base_amount", + "min_quote_amount", + "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" + ] + }, + "OrderBookDetails": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "order_book_details": { + "type": "array", + "items": { + "$ref": "#/definitions/OrderBookDetail" + } + } + }, + "title": "OrderBookDetails", + "required": [ + "code", + "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": "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": "#/definitions/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": "#/definitions/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" + } + }, + "title": "PnLEntry", + "required": [ + "timestamp", + "trade_pnl", + "inflow", + "outflow", + "pool_pnl", + "pool_inflow", + "pool_outflow" + ] + }, + "PositionFunding": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "market_id": { + "type": "integer", + "format": "uint8", + "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" + ] + } + }, + "title": "PositionFunding", + "required": [ + "timestamp", + "market_id", + "funding_id", + "change", + "rate", + "position_size", + "position_side" + ] + }, + "PositionFundings": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "position_fundings": { + "type": "array", + "items": { + "$ref": "#/definitions/PositionFunding" + } + }, + "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": "PriceLevel", + "required": [ + "price", + "size" + ] + }, + "PublicPool": { + "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" + }, + "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" + }, + "total_asset_value": { + "type": "string", + "example": "19995" + }, + "cross_asset_value": { + "type": "string", + "example": "19995" + }, + "pool_info": { + "$ref": "#/definitions/PublicPoolInfo" + }, + "account_share": { + "$ref": "#/definitions/PublicPoolShare" + } + }, + "title": "PublicPool", + "required": [ + "code", + "account_type", + "index", + "l1_address", + "cancel_all_time", + "total_order_count", + "total_isolated_order_count", + "pending_order_count", + "status", + "collateral", + "account_index", + "name", + "description", + "can_invite", + "referral_points_percentage", + "total_asset_value", + "cross_asset_value", + "pool_info" + ] + }, + "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" + }, + "share_price_1d": { + "type": "number", + "format": "double", + "example": "0.0001" + }, + "share_price_7d": { + "type": "number", + "format": "double", + "example": "0.0001" + }, + "share_price_30d": { + "type": "number", + "format": "double", + "example": "0.0001" + }, + "annual_percentage_yield": { + "type": "number", + "format": "double", + "example": "20.5000" + }, + "daily_returns": { + "type": "array", + "items": { + "$ref": "#/definitions/DailyReturn" + } + } + }, + "title": "PublicPoolInfo", + "required": [ + "status", + "operator_fee", + "min_operator_share_rate", + "total_shares", + "operator_shares", + "share_price_1d", + "share_price_7d", + "share_price_30d", + "annual_percentage_yield", + "daily_returns" + ] + }, + "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" + } + }, + "title": "PublicPoolShare", + "required": [ + "public_pool_index", + "shares_amount", + "entry_usdc" + ] + }, + "PublicPools": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "total": { + "type": "integer", + "format": "int64" + }, + "public_pools": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicPool" + } + } + }, + "title": "PublicPools", + "required": [ + "code", + "total", + "public_pools" + ] + }, + "ReferralPointEntry": { + "type": "object", + "properties": { + "l1_address": { + "type": "string" + }, + "total_points": { + "type": "integer", + "format": "int64", + "example": "1000" + }, + "week_points": { + "type": "integer", + "format": "int64", + "example": "1000" + }, + "total_reward_points": { + "type": "integer", + "format": "int64", + "example": "200" + }, + "week_reward_points": { + "type": "integer", + "format": "int64", + "example": "200" + }, + "reward_point_multiplier": { + "type": "string", + "example": "0.1" + } + }, + "title": "ReferralPointEntry", + "required": [ + "l1_address", + "total_points", + "week_points", + "total_reward_points", + "week_reward_points", + "reward_point_multiplier" + ] + }, + "ReferralPoints": { + "type": "object", + "properties": { + "referrals": { + "type": "array", + "items": { + "$ref": "#/definitions/ReferralPointEntry" + } + }, + "user_total_points": { + "type": "integer", + "format": "int64", + "example": "1000" + }, + "user_last_week_points": { + "type": "integer", + "format": "int64", + "example": "1000" + }, + "user_total_referral_reward_points": { + "type": "integer", + "format": "int64", + "example": "1000" + }, + "user_last_week_referral_reward_points": { + "type": "integer", + "format": "int64", + "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" + ] + }, + "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" + ] + }, + "ReqExportData": { + "type": "object", + "properties": { + "auth": { + "type": "string" + }, + "account_index": { + "type": "integer", + "format": "int64", + "default": "-1" + }, + "market_id": { + "type": "integer", + "format": "uint8", + "default": "255" + }, + "type": { + "type": "string", + "enum": [ + "funding", + "trade" + ] + } + }, + "title": "ReqExportData", + "required": [ + "type" + ] + }, + "ReqGetAccount": { + "type": "object", + "properties": { + "by": { + "type": "string", + "enum": [ + "index", + "l1_address" + ] + }, + "value": { + "type": "string" + } + }, + "title": "ReqGetAccount", + "required": [ + "by", + "value" + ] + }, + "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": "uint8", + "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" }, - "order_id": { + "auth": { "type": "string", - "example": "1" + "description": " made optional to support header auth clients" + } + }, + "title": "ReqGetAccountLimits", + "required": [ + "account_index" + ] + }, + "ReqGetAccountMetadata": { + "type": "object", + "properties": { + "by": { + "type": "string", + "enum": [ + "index", + "l1_address" + ] }, - "client_order_id": { + "value": { + "type": "string" + }, + "auth": { + "type": "string" + } + }, + "title": "ReqGetAccountMetadata", + "required": [ + "by", + "value" + ] + }, + "ReqGetAccountPendingTxs": { + "type": "object", + "properties": { + "by": { "type": "string", - "example": "234" + "enum": [ + "account_index" + ] }, - "market_index": { - "type": "integer", - "format": "uint8", - "example": "1" + "value": { + "type": "string" }, - "owner_account_index": { - "type": "integer", - "format": "int64", - "example": "1" + "types": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } + }, + "title": "ReqGetAccountPendingTxs" + }, + "ReqGetAccountPnL": { + "type": "object", + "properties": { + "auth": { + "type": "string" }, - "initial_base_amount": { + "by": { "type": "string", - "example": "0.1" + "enum": [ + "index" + ] }, - "price": { + "value": { + "type": "string" + }, + "resolution": { "type": "string", - "example": "3024.66" + "enum": [ + "1m", + "5m", + "15m", + "1h", + "4h", + "1d" + ] }, - "nonce": { + "start_timestamp": { "type": "integer", "format": "int64", - "example": "722" + "maximum": 5000000000000 }, - "remaining_base_amount": { - "type": "string", - "example": "0.1" + "end_timestamp": { + "type": "integer", + "format": "int64", + "maximum": 5000000000000 }, - "is_ask": { + "count_back": { + "type": "integer", + "format": "int64" + }, + "ignore_transfers": { "type": "boolean", "format": "boolean", - "example": "true" - }, - "base_size": { + "default": "false" + } + }, + "title": "ReqGetAccountPnL", + "required": [ + "by", + "value", + "resolution", + "start_timestamp", + "end_timestamp", + "count_back" + ] + }, + "ReqGetAccountTxs": { + "type": "object", + "properties": { + "index": { "type": "integer", - "format": "int64", - "example": "12354" + "format": "int64" }, - "base_price": { + "limit": { "type": "integer", - "format": "int32", - "example": "3024" + "format": "int64", + "maximum": 100, + "minimum": 1 }, - "filled_base_amount": { + "by": { "type": "string", - "example": "0.1" + "enum": [ + "account_index" + ] }, - "filled_quote_amount": { + "value": { + "type": "string" + }, + "types": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8" + } + } + }, + "title": "ReqGetAccountTxs" + }, + "ReqGetBlock": { + "type": "object", + "properties": { + "by": { "type": "string", - "example": "0.1" + "enum": [ + "commitment", + "height" + ] }, - "side": { + "value": { + "type": "string" + } + }, + "title": "ReqGetBlock", + "required": [ + "by", + "value" + ] + }, + "ReqGetBlockTxs": { + "type": "object", + "properties": { + "by": { "type": "string", - "example": "buy", - "default": "buy", - "description": " TODO: remove this" + "enum": [ + "block_height", + "block_commitment" + ] }, - "type": { + "value": { + "type": "string" + } + }, + "title": "ReqGetBlockTxs", + "required": [ + "by", + "value" + ] + }, + "ReqGetByAccount": { + "type": "object", + "properties": { + "by": { "type": "string", - "example": "limit", "enum": [ - "limit", - "market", - "stop-loss", - "stop-loss-limit", - "take-profit", - "take-profit-limit", - "twap", - "twap-sub", - "liquidation" + "account_index" ] }, - "time_in_force": { + "value": { + "type": "string" + } + }, + "title": "ReqGetByAccount", + "required": [ + "by", + "value" + ] + }, + "ReqGetCandlesticks": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "uint8" + }, + "resolution": { "type": "string", "enum": [ - "good-till-time", - "immediate-or-cancel", - "post-only", - "Unknown" - ], - "default": "good-till-time" + "1m", + "5m", + "15m", + "1h", + "4h", + "1d" + ] }, - "reduce_only": { + "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", - "example": "true" + "default": "false" + } + }, + "title": "ReqGetCandlesticks", + "required": [ + "market_id", + "resolution", + "start_timestamp", + "end_timestamp", + "count_back" + ] + }, + "ReqGetDepositHistory": { + "type": "object", + "properties": { + "account_index": { + "type": "integer", + "format": "int64" }, - "trigger_price": { + "auth": { "type": "string", - "example": "3024.66" + "description": " made optional to support header auth clients" }, - "order_expiry": { - "type": "integer", - "format": "int64", - "example": "1640995200" + "l1_address": { + "type": "string" }, - "status": { + "cursor": { + "type": "string" + }, + "filter": { "type": "string", - "example": "open", "enum": [ - "in-progress", + "all", "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" + "claimable" ] + } + }, + "title": "ReqGetDepositHistory", + "required": [ + "account_index", + "l1_address" + ] + }, + "ReqGetExchangeStats": { + "type": "object", + "title": "ReqGetExchangeStats" + }, + "ReqGetFastWithdrawInfo": { + "type": "object", + "properties": { + "account_index": { + "type": "integer", + "format": "int64" + }, + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + } + }, + "title": "ReqGetFastWithdrawInfo", + "required": [ + "account_index" + ] + }, + "ReqGetFundings": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "uint8" }, - "trigger_status": { + "resolution": { "type": "string", - "example": "twap", "enum": [ - "na", - "ready", - "mark-price", - "twap", - "parent-order" + "1h", + "1d" ] }, - "trigger_time": { + "start_timestamp": { "type": "integer", "format": "int64", - "example": "1640995200" + "maximum": 5000000000000 }, - "parent_order_index": { + "end_timestamp": { "type": "integer", "format": "int64", - "example": "1" - }, - "parent_order_id": { - "type": "string", - "example": "1" + "maximum": 5000000000000 }, - "to_trigger_order_id_0": { + "count_back": { + "type": "integer", + "format": "int64" + } + }, + "title": "ReqGetFundings", + "required": [ + "market_id", + "resolution", + "start_timestamp", + "end_timestamp", + "count_back" + ] + }, + "ReqGetL1Metadata": { + "type": "object", + "properties": { + "auth": { "type": "string", - "example": "1" + "description": " made optional to support header auth clients" }, - "to_trigger_order_id_1": { + "l1_address": { + "type": "string" + } + }, + "title": "ReqGetL1Metadata", + "required": [ + "l1_address" + ] + }, + "ReqGetL1Tx": { + "type": "object", + "properties": { + "hash": { + "type": "string" + } + }, + "title": "ReqGetL1Tx", + "required": [ + "hash" + ] + }, + "ReqGetLatestDeposit": { + "type": "object", + "properties": { + "l1_address": { + "type": "string" + } + }, + "title": "ReqGetLatestDeposit", + "required": [ + "l1_address" + ] + }, + "ReqGetLiquidationInfos": { + "type": "object", + "properties": { + "auth": { "type": "string", - "example": "1" + "description": " made optional to support header auth clients" }, - "to_cancel_order_id_0": { - "type": "string", - "example": "1" + "account_index": { + "type": "integer", + "format": "int64" }, - "block_height": { + "market_id": { "type": "integer", - "format": "int64", - "example": "45434" + "format": "uint8", + "default": "255" }, - "timestamp": { + "cursor": { + "type": "string" + }, + "limit": { "type": "integer", "format": "int64", - "example": "1640995200" + "maximum": 100, + "minimum": 1 } }, - "title": "Order", + "title": "ReqGetLiquidationInfos", "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" + "account_index", + "limit" ] }, - "OrderBook": { + "ReqGetNextNonce": { "type": "object", "properties": { - "symbol": { - "type": "string", - "example": "ETH" - }, - "market_id": { + "account_index": { "type": "integer", - "format": "uint8", - "example": "1" - }, - "status": { - "type": "string", - "example": "active", - "enum": [ - "frozen", - "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" + "format": "int64" }, - "supported_size_decimals": { + "api_key_index": { "type": "integer", - "format": "uint8", - "example": "4" - }, - "supported_price_decimals": { + "format": "uint8" + } + }, + "title": "ReqGetNextNonce", + "required": [ + "account_index", + "api_key_index" + ] + }, + "ReqGetOrderBookDetails": { + "type": "object", + "properties": { + "market_id": { "type": "integer", "format": "uint8", - "example": "4" + "default": "255" + } + }, + "title": "ReqGetOrderBookDetails" + }, + "ReqGetOrderBookOrders": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "uint8" }, - "supported_quote_decimals": { + "limit": { "type": "integer", - "format": "uint8", - "example": "4" + "format": "int64", + "maximum": 100, + "minimum": 1 } }, - "title": "OrderBook", + "title": "ReqGetOrderBookOrders", "required": [ - "symbol", "market_id", - "status", - "taker_fee", - "maker_fee", - "liquidation_fee", - "min_base_amount", - "min_quote_amount", - "supported_size_decimals", - "supported_price_decimals", - "supported_quote_decimals" + "limit" ] }, - "OrderBookDetail": { + "ReqGetOrderBooks": { "type": "object", "properties": { - "symbol": { - "type": "string", - "example": "ETH" - }, "market_id": { "type": "integer", "format": "uint8", - "example": "1" + "default": "255" + } + }, + "title": "ReqGetOrderBooks" + }, + "ReqGetPositionFunding": { + "type": "object", + "properties": { + "auth": { + "type": "string" }, - "status": { - "type": "string", - "example": "active", - "enum": [ - "frozen", - "active" - ] + "account_index": { + "type": "integer", + "format": "int64" }, - "taker_fee": { - "type": "string", - "example": "0.0001" + "market_id": { + "type": "integer", + "format": "uint8", + "default": "255" }, - "maker_fee": { - "type": "string", - "example": "0.0000" + "cursor": { + "type": "string" }, - "liquidation_fee": { - "type": "string", - "example": "0.01" + "limit": { + "type": "integer", + "format": "int64", + "maximum": 100, + "minimum": 1 }, - "min_base_amount": { + "side": { "type": "string", - "example": "0.01" + "enum": [ + "long", + "short", + "all" + ], + "default": "all" + } + }, + "title": "ReqGetPositionFunding", + "required": [ + "account_index", + "limit" + ] + }, + "ReqGetPublicPools": { + "type": "object", + "properties": { + "auth": { + "type": "string" }, - "min_quote_amount": { + "filter": { "type": "string", - "example": "0.1" - }, - "supported_size_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" - }, - "supported_price_decimals": { - "type": "integer", - "format": "uint8", - "example": "4" + "enum": [ + "all", + "user", + "protocol", + "account_index" + ] }, - "supported_quote_decimals": { + "index": { "type": "integer", - "format": "uint8", - "example": "4" + "format": "int64" }, - "size_decimals": { + "limit": { "type": "integer", - "format": "uint8", - "example": "4" + "format": "int64", + "maximum": 100, + "minimum": 1 }, - "price_decimals": { + "account_index": { "type": "integer", - "format": "uint8", - "example": "4" + "format": "int64" + } + }, + "title": "ReqGetPublicPools", + "required": [ + "index", + "limit" + ] + }, + "ReqGetRangeWithCursor": { + "type": "object", + "properties": { + "cursor": { + "type": "string" }, - "quote_multiplier": { + "limit": { "type": "integer", "format": "int64", - "example": "10000" - }, - "default_initial_margin_fraction": { + "maximum": 100, + "minimum": 1 + } + }, + "title": "ReqGetRangeWithCursor", + "required": [ + "limit" + ] + }, + "ReqGetRangeWithIndex": { + "type": "object", + "properties": { + "index": { "type": "integer", - "format": "uin16", - "example": "100" + "format": "int64" }, - "min_initial_margin_fraction": { + "limit": { "type": "integer", - "format": "uin16", - "example": "100" - }, - "maintenance_margin_fraction": { + "format": "int64", + "maximum": 100, + "minimum": 1 + } + }, + "title": "ReqGetRangeWithIndex", + "required": [ + "limit" + ] + }, + "ReqGetRangeWithIndexSortable": { + "type": "object", + "properties": { + "index": { "type": "integer", - "format": "uin16", - "example": "50" + "format": "int64" }, - "closeout_margin_fraction": { + "limit": { "type": "integer", - "format": "uin16", - "example": "100" + "format": "int64", + "maximum": 100, + "minimum": 1 }, - "last_trade_price": { - "type": "number", - "format": "double", - "example": "3024.66" + "sort": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + } + }, + "title": "ReqGetRangeWithIndexSortable" + }, + "ReqGetRecentTrades": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "uint8" }, - "daily_trades_count": { + "limit": { "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" - } + "maximum": 100, + "minimum": 1 } }, - "title": "OrderBookDetail", + "title": "ReqGetRecentTrades", "required": [ - "symbol", "market_id", - "status", - "taker_fee", - "maker_fee", - "liquidation_fee", - "min_base_amount", - "min_quote_amount", - "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" + "limit" ] }, - "OrderBookDetails": { + "ReqGetReferralPoints": { "type": "object", "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" + "auth": { + "type": "string", + "description": " made optional to support header auth clients" }, - "order_book_details": { - "type": "array", - "items": { - "$ref": "#/definitions/OrderBookDetail" - } + "account_index": { + "type": "integer", + "format": "int64" } }, - "title": "OrderBookDetails", + "title": "ReqGetReferralPoints", "required": [ - "code", - "order_book_details" + "account_index" ] }, - "OrderBookOrders": { + "ReqGetTrades": { "type": "object", "properties": { - "code": { + "auth": { + "type": "string" + }, + "market_id": { "type": "integer", - "format": "int32", - "example": "200" + "format": "uint8", + "default": "255" }, - "message": { + "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" }, - "total_asks": { + "from": { "type": "integer", "format": "int64", - "example": "1" + "default": "-1" }, - "asks": { - "type": "array", - "items": { - "$ref": "#/definitions/SimpleOrder" - } + "ask_filter": { + "type": "integer", + "format": "int8", + "default": "-1" }, - "total_bids": { + "limit": { "type": "integer", "format": "int64", - "example": "1" - }, - "bids": { - "type": "array", - "items": { - "$ref": "#/definitions/SimpleOrder" - } + "maximum": 100, + "minimum": 1 } }, - "title": "OrderBookOrders", + "title": "ReqGetTrades", "required": [ - "code", - "total_asks", - "asks", - "total_bids", - "bids" + "sort_by", + "limit" ] }, - "OrderBookStats": { + "ReqGetTransferFeeInfo": { "type": "object", "properties": { - "symbol": { - "type": "string", - "example": "ETH" + "auth": { + "type": "string" }, - "last_trade_price": { - "type": "number", - "format": "double", - "example": "3024.66" + "account_index": { + "type": "integer", + "format": "int64" }, - "daily_trades_count": { + "to_account_index": { "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" + "default": "-1" + } + }, + "title": "ReqGetTransferFeeInfo", + "required": [ + "account_index" + ] + }, + "ReqGetTransferHistory": { + "type": "object", + "properties": { + "account_index": { + "type": "integer", + "format": "int64" }, - "daily_price_change": { - "type": "number", - "format": "double", - "example": "3.66" + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + }, + "cursor": { + "type": "string" } }, - "title": "OrderBookStats", + "title": "ReqGetTransferHistory", "required": [ - "symbol", - "last_trade_price", - "daily_trades_count", - "daily_base_token_volume", - "daily_quote_token_volume", - "daily_price_change" + "account_index" ] }, - "OrderBooks": { + "ReqGetTx": { "type": "object", "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" + "by": { + "type": "string", + "enum": [ + "hash", + "sequence_index" + ] }, - "message": { + "value": { "type": "string" - }, - "order_books": { - "type": "array", - "items": { - "$ref": "#/definitions/OrderBook" - } } }, - "title": "OrderBooks", + "title": "ReqGetTx", "required": [ - "code", - "order_books" + "by", + "value" ] }, - "Orders": { + "ReqGetWithdrawHistory": { "type": "object", "properties": { - "code": { + "account_index": { "type": "integer", - "format": "int32", - "example": "200" + "format": "int64" }, - "message": { - "type": "string" + "auth": { + "type": "string", + "description": " made optional to support header auth clients" }, - "next_cursor": { + "cursor": { "type": "string" }, - "orders": { - "type": "array", - "items": { - "$ref": "#/definitions/Order" - } + "filter": { + "type": "string", + "enum": [ + "all", + "pending", + "claimable" + ] } }, - "title": "Orders", + "title": "ReqGetWithdrawHistory", "required": [ - "code", - "orders" + "account_index" ] }, - "PnLEntry": { + "ReqSendTx": { "type": "object", "properties": { - "timestamp": { + "tx_type": { "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "value": { - "type": "number", - "format": "double", - "example": "12.0" - }, - "trade_pnl": { - "type": "number", - "format": "double", - "example": "12.0" + "format": "uint8" }, - "pool_pnl": { - "type": "number", - "format": "double", - "example": "12.0" + "tx_info": { + "type": "string" }, - "inflow": { - "type": "number", - "format": "double", - "example": "12.0" + "price_protection": { + "type": "boolean", + "format": "boolean", + "default": "true" + } + }, + "title": "ReqSendTx", + "required": [ + "tx_type", + "tx_info" + ] + }, + "ReqSendTxBatch": { + "type": "object", + "properties": { + "tx_types": { + "type": "string" }, - "outflow": { - "type": "number", - "format": "double", - "example": "12.0" + "tx_infos": { + "type": "string" } }, - "title": "PnLEntry", + "title": "ReqSendTxBatch", "required": [ - "timestamp", - "value", - "trade_pnl", - "pool_pnl", - "inflow", - "outflow" + "tx_types", + "tx_infos" ] }, - "PublicPool": { + "RespChangeAccountTier": { "type": "object", "properties": { "code": { @@ -3234,186 +6109,63 @@ }, "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" - }, - "pending_order_count": { - "type": "integer", - "format": "int64", - "example": "100" - }, - "status": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "collateral": { - "type": "string", - "example": "46342" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "can_invite": { - "type": "boolean", - "format": "boolean" - }, - "referral_points_percentage": { - "type": "string" - }, - "max_referral_usage_limit": { - "type": "integer", - "format": "int32" - }, - "total_asset_value": { - "type": "string", - "example": "19995" - }, - "pool_info": { - "$ref": "#/definitions/PublicPoolInfo" - }, - "account_share": { - "$ref": "#/definitions/PublicPoolShare" } }, - "title": "PublicPool", + "title": "RespChangeAccountTier", "required": [ - "code", - "account_type", - "index", - "l1_address", - "cancel_all_time", - "total_order_count", - "pending_order_count", - "status", - "collateral", - "name", - "description", - "can_invite", - "referral_points_percentage", - "max_referral_usage_limit", - "total_asset_value", - "pool_info" + "code" ] }, - "PublicPoolInfo": { + "RespGetFastBridgeInfo": { "type": "object", "properties": { - "status": { + "code": { "type": "integer", - "format": "uint8", - "example": "0" - }, - "operator_fee": { - "type": "string", - "example": "100" - }, - "min_operator_share_rate": { - "type": "string", + "format": "int32", "example": "200" }, - "total_shares": { - "type": "integer", - "format": "int64", - "example": "100000" - }, - "operator_shares": { - "type": "integer", - "format": "int64", - "example": "20000" - }, - "share_price_1d": { - "type": "number", - "format": "double", - "example": "0.0001" - }, - "share_price_7d": { - "type": "number", - "format": "double", - "example": "0.0001" - }, - "share_price_30d": { - "type": "number", - "format": "double", - "example": "0.0001" - }, - "annual_percentage_yield": { - "type": "number", - "format": "double", - "example": "20.5000" + "message": { + "type": "string" }, - "daily_returns": { - "type": "array", - "items": { - "$ref": "#/definitions/DailyReturn" - } + "fast_bridge_limit": { + "type": "string" } }, - "title": "PublicPoolInfo", - "required": [ - "status", - "operator_fee", - "min_operator_share_rate", - "total_shares", - "operator_shares", - "share_price_1d", - "share_price_7d", - "share_price_30d", - "annual_percentage_yield", - "daily_returns" + "title": "RespGetFastBridgeInfo", + "required": [ + "code", + "fast_bridge_limit" ] }, - "PublicPoolShare": { + "RespSendTx": { "type": "object", "properties": { - "public_pool_index": { + "code": { "type": "integer", - "format": "int64", - "example": "1" + "format": "int32", + "example": "200" }, - "shares_amount": { - "type": "integer", - "format": "int64", - "example": "3000" + "message": { + "type": "string" }, - "entry_usdc": { + "tx_hash": { "type": "string", - "example": "3000" + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "predicted_execution_time_ms": { + "type": "integer", + "format": "int64", + "example": "1751465474" } }, - "title": "PublicPoolShare", + "title": "RespSendTx", "required": [ - "public_pool_index", - "shares_amount", - "entry_usdc" + "code", + "tx_hash", + "predicted_execution_time_ms" ] }, - "PublicPools": { + "RespSendTxBatch": { "type": "object", "properties": { "code": { @@ -3424,77 +6176,106 @@ "message": { "type": "string" }, - "total": { - "type": "integer", - "format": "int64" - }, - "public_pools": { + "tx_hash": { "type": "array", "items": { - "$ref": "#/definitions/PublicPool" + "type": "string" } + }, + "predicted_execution_time_ms": { + "type": "integer", + "format": "int64", + "example": "1751465474" } }, - "title": "PublicPools", + "title": "RespSendTxBatch", "required": [ "code", - "total", - "public_pools" + "tx_hash", + "predicted_execution_time_ms" ] }, - "ReqSendTx": { + "RespWithdrawalDelay": { "type": "object", "properties": { - "tx_type": { + "seconds": { "type": "integer", - "format": "uint8" + "format": "int64", + "example": "86400" + } + }, + "title": "RespWithdrawalDelay", + "required": [ + "seconds" + ] + }, + "ResultCode": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" }, - "tx_info": { + "message": { "type": "string" - }, - "price_protection": { - "type": "boolean", - "format": "boolean", - "default": "true" } }, - "title": "ReqSendTx", + "title": "ResultCode", "required": [ - "tx_type", - "tx_info" + "code" ] }, - "ReqSendTxBatch": { + "RiskInfo": { "type": "object", "properties": { - "tx_types": { - "type": "string" + "cross_risk_parameters": { + "$ref": "#/definitions/RiskParameters" }, - "tx_infos": { - "type": "string" + "isolated_risk_parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/RiskParameters" + } } }, - "title": "ReqSendTxBatch", + "title": "RiskInfo", "required": [ - "tx_types", - "tx_infos" + "cross_risk_parameters", + "isolated_risk_parameters" ] }, - "ResultCode": { + "RiskParameters": { "type": "object", "properties": { - "code": { + "market_id": { "type": "integer", - "format": "int32", - "example": "200" + "format": "uint8" }, - "message": { + "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": "ResultCode", + "title": "RiskParameters", "required": [ - "code" + "market_id", + "collateral", + "total_account_value", + "initial_margin_req", + "maintenance_margin_req", + "close_out_margin_req" ] }, "SimpleOrder": { @@ -3599,6 +6380,27 @@ "sub_accounts" ] }, + "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": { @@ -3671,6 +6473,52 @@ "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" } }, "title": "Trade", @@ -3688,7 +6536,17 @@ "bid_account_id", "is_maker_ask", "block_height", - "timestamp" + "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" ] }, "Trades": { @@ -3718,6 +6576,114 @@ "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" + }, + "transfers": { + "type": "array", + "items": { + "$ref": "#/definitions/TransferHistoryItem" + } + }, + "cursor": { + "type": "string" + } + }, + "title": "TransferHistory", + "required": [ + "code", + "transfers", + "cursor" + ] + }, + "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" + ] + }, + "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" + } + }, + "title": "TransferHistoryItem", + "required": [ + "id", + "amount", + "timestamp", + "type", + "from_l1_address", + "to_l1_address", + "from_account_index", + "to_account_index", + "tx_hash" + ] + }, "Tx": { "type": "object", "properties": { @@ -3883,6 +6849,25 @@ "txs" ] }, + "ValidatorInfo": { + "type": "object", + "properties": { + "address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "is_active": { + "type": "boolean", + "format": "boolean", + "example": "true" + } + }, + "title": "ValidatorInfo", + "required": [ + "address", + "is_active" + ] + }, "WithdrawHistory": { "type": "object", "properties": { @@ -3980,4 +6965,4 @@ "in": "header" } } -} \ No newline at end of file +}