diff --git a/.gitignore b/.gitignore index 46c5c35..dec6fd0 100644 --- a/.gitignore +++ b/.gitignore @@ -69,6 +69,7 @@ openapi-generator-cli.jar .idea examples/secrets.py +examples/system_setup_local.py # Environment variables .env diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index f434d7a..eac6bd7 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -74,6 +74,9 @@ docs/PositionFundings.md docs/PublicPoolInfo.md docs/PublicPoolMetadata.md docs/PublicPoolShare.md +docs/RFQEntry.md +docs/RFQMetadata.md +docs/RFQResponseEntry.md docs/Referral.md docs/ReferralApi.md docs/ReferralCode.md @@ -81,6 +84,7 @@ docs/ReferralPointEntry.md docs/ReferralPoints.md docs/ReqSetAccountMetadata.md docs/RespChangeAccountTier.md +docs/RespCreateRFQ.md docs/RespGetApiTokens.md docs/RespGetExchangeMetrics.md docs/RespGetExecuteStats.md @@ -89,13 +93,18 @@ docs/RespGetFastwithdrawalInfo.md docs/RespGetLeaseOptions.md docs/RespGetLeases.md docs/RespGetMakerOnlyApiKeys.md +docs/RespGetRFQ.md +docs/RespListRFQs.md docs/RespPostApiToken.md docs/RespPublicPoolsMetadata.md +docs/RespRespondToRFQ.md docs/RespRevokeApiToken.md docs/RespSendTx.md docs/RespSendTxBatch.md docs/RespSetMakerOnlyApiKeys.md +docs/RespSyntheticSpotInfo.md docs/RespUpdateKickback.md +docs/RespUpdateRFQ.md docs/RespUpdateReferralCode.md docs/RespWithdrawalDelay.md docs/ResultCode.md @@ -220,6 +229,7 @@ lighter/models/referral_point_entry.py lighter/models/referral_points.py lighter/models/req_set_account_metadata.py lighter/models/resp_change_account_tier.py +lighter/models/resp_create_rfq.py lighter/models/resp_get_api_tokens.py lighter/models/resp_get_exchange_metrics.py lighter/models/resp_get_execute_stats.py @@ -228,16 +238,24 @@ lighter/models/resp_get_fastwithdrawal_info.py lighter/models/resp_get_lease_options.py lighter/models/resp_get_leases.py lighter/models/resp_get_maker_only_api_keys.py +lighter/models/resp_get_rfq.py +lighter/models/resp_list_rfqs.py lighter/models/resp_post_api_token.py lighter/models/resp_public_pools_metadata.py +lighter/models/resp_respond_to_rfq.py lighter/models/resp_revoke_api_token.py lighter/models/resp_send_tx.py lighter/models/resp_send_tx_batch.py lighter/models/resp_set_maker_only_api_keys.py +lighter/models/resp_synthetic_spot_info.py lighter/models/resp_update_kickback.py lighter/models/resp_update_referral_code.py +lighter/models/resp_update_rfq.py lighter/models/resp_withdrawal_delay.py lighter/models/result_code.py +lighter/models/rfq_entry.py +lighter/models/rfq_metadata.py +lighter/models/rfq_response_entry.py lighter/models/risk_info.py lighter/models/risk_parameters.py lighter/models/share_price.py diff --git a/README.md b/README.md index 6f6594d..8fb17d7 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,11 @@ Class | Method | HTTP request | Description *AccountApi* | [**position_funding**](docs/AccountApi.md#position_funding) | **GET** /api/v1/positionFunding | positionFunding *AccountApi* | [**public_pools_metadata**](docs/AccountApi.md#public_pools_metadata) | **GET** /api/v1/publicPoolsMetadata | publicPoolsMetadata *AccountApi* | [**referral_user_referrals**](docs/AccountApi.md#referral_user_referrals) | **GET** /api/v1/referral/userReferrals | userReferrals +*AccountApi* | [**rfq_create**](docs/AccountApi.md#rfq_create) | **POST** /api/v1/rfq/create | rfq_create +*AccountApi* | [**rfq_get**](docs/AccountApi.md#rfq_get) | **GET** /api/v1/rfq/get | rfq_get +*AccountApi* | [**rfq_list**](docs/AccountApi.md#rfq_list) | **GET** /api/v1/rfq/list | rfq_list +*AccountApi* | [**rfq_respond**](docs/AccountApi.md#rfq_respond) | **POST** /api/v1/rfq/respond | rfq_respond +*AccountApi* | [**rfq_update**](docs/AccountApi.md#rfq_update) | **POST** /api/v1/rfq/update | rfq_update *AccountApi* | [**set_maker_only_api_keys**](docs/AccountApi.md#set_maker_only_api_keys) | **POST** /api/v1/setMakerOnlyApiKeys | setMakerOnlyApiKeys *AccountApi* | [**tokens**](docs/AccountApi.md#tokens) | **GET** /api/v1/tokens | tokens *AccountApi* | [**tokens_create**](docs/AccountApi.md#tokens_create) | **POST** /api/v1/tokens/create | tokens_create @@ -90,6 +95,7 @@ Class | Method | HTTP request | Description *CandlestickApi* | [**fundings**](docs/CandlestickApi.md#fundings) | **GET** /api/v1/fundings | fundings *FundingApi* | [**funding_rates**](docs/FundingApi.md#funding_rates) | **GET** /api/v1/funding-rates | funding-rates *InfoApi* | [**layer1_basic_info**](docs/InfoApi.md#layer1_basic_info) | **GET** /api/v1/layer1BasicInfo | layer1BasicInfo +*InfoApi* | [**synthetic_spot_info**](docs/InfoApi.md#synthetic_spot_info) | **GET** /api/v1/syntheticSpotInfo | syntheticSpotInfo *InfoApi* | [**system_config**](docs/InfoApi.md#system_config) | **GET** /api/v1/systemConfig | systemConfig *InfoApi* | [**transfer_fee_info**](docs/InfoApi.md#transfer_fee_info) | **GET** /api/v1/transferFeeInfo | transferFeeInfo *InfoApi* | [**withdrawal_delay**](docs/InfoApi.md#withdrawal_delay) | **GET** /api/v1/withdrawalDelay | withdrawalDelay @@ -182,7 +188,6 @@ Class | Method | HTTP request | Description - [NextNonce](docs/NextNonce.md) - [Order](docs/Order.md) - [OrderBook](docs/OrderBook.md) - - [OrderBookDepth](docs/OrderBookDepth.md) - [OrderBookDetails](docs/OrderBookDetails.md) - [OrderBookOrders](docs/OrderBookOrders.md) - [OrderBookStats](docs/OrderBookStats.md) @@ -194,16 +199,19 @@ Class | Method | HTTP request | Description - [PnLEntry](docs/PnLEntry.md) - [PositionFunding](docs/PositionFunding.md) - [PositionFundings](docs/PositionFundings.md) - - [PriceLevel](docs/PriceLevel.md) - [PublicPoolInfo](docs/PublicPoolInfo.md) - [PublicPoolMetadata](docs/PublicPoolMetadata.md) - [PublicPoolShare](docs/PublicPoolShare.md) + - [RFQEntry](docs/RFQEntry.md) + - [RFQMetadata](docs/RFQMetadata.md) + - [RFQResponseEntry](docs/RFQResponseEntry.md) - [Referral](docs/Referral.md) - [ReferralCode](docs/ReferralCode.md) - [ReferralPointEntry](docs/ReferralPointEntry.md) - [ReferralPoints](docs/ReferralPoints.md) - [ReqSetAccountMetadata](docs/ReqSetAccountMetadata.md) - [RespChangeAccountTier](docs/RespChangeAccountTier.md) + - [RespCreateRFQ](docs/RespCreateRFQ.md) - [RespGetApiTokens](docs/RespGetApiTokens.md) - [RespGetExchangeMetrics](docs/RespGetExchangeMetrics.md) - [RespGetExecuteStats](docs/RespGetExecuteStats.md) @@ -212,13 +220,18 @@ Class | Method | HTTP request | Description - [RespGetLeaseOptions](docs/RespGetLeaseOptions.md) - [RespGetLeases](docs/RespGetLeases.md) - [RespGetMakerOnlyApiKeys](docs/RespGetMakerOnlyApiKeys.md) + - [RespGetRFQ](docs/RespGetRFQ.md) + - [RespListRFQs](docs/RespListRFQs.md) - [RespPostApiToken](docs/RespPostApiToken.md) - [RespPublicPoolsMetadata](docs/RespPublicPoolsMetadata.md) + - [RespRespondToRFQ](docs/RespRespondToRFQ.md) - [RespRevokeApiToken](docs/RespRevokeApiToken.md) - [RespSendTx](docs/RespSendTx.md) - [RespSendTxBatch](docs/RespSendTxBatch.md) - [RespSetMakerOnlyApiKeys](docs/RespSetMakerOnlyApiKeys.md) + - [RespSyntheticSpotInfo](docs/RespSyntheticSpotInfo.md) - [RespUpdateKickback](docs/RespUpdateKickback.md) + - [RespUpdateRFQ](docs/RespUpdateRFQ.md) - [RespUpdateReferralCode](docs/RespUpdateReferralCode.md) - [RespWithdrawalDelay](docs/RespWithdrawalDelay.md) - [ResultCode](docs/ResultCode.md) diff --git a/docs/AccountApi.md b/docs/AccountApi.md index c0c2155..98adb1c 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -21,6 +21,11 @@ Method | HTTP request | Description [**position_funding**](AccountApi.md#position_funding) | **GET** /api/v1/positionFunding | positionFunding [**public_pools_metadata**](AccountApi.md#public_pools_metadata) | **GET** /api/v1/publicPoolsMetadata | publicPoolsMetadata [**referral_user_referrals**](AccountApi.md#referral_user_referrals) | **GET** /api/v1/referral/userReferrals | userReferrals +[**rfq_create**](AccountApi.md#rfq_create) | **POST** /api/v1/rfq/create | rfq_create +[**rfq_get**](AccountApi.md#rfq_get) | **GET** /api/v1/rfq/get | rfq_get +[**rfq_list**](AccountApi.md#rfq_list) | **GET** /api/v1/rfq/list | rfq_list +[**rfq_respond**](AccountApi.md#rfq_respond) | **POST** /api/v1/rfq/respond | rfq_respond +[**rfq_update**](AccountApi.md#rfq_update) | **POST** /api/v1/rfq/update | rfq_update [**set_maker_only_api_keys**](AccountApi.md#set_maker_only_api_keys) | **POST** /api/v1/setMakerOnlyApiKeys | setMakerOnlyApiKeys [**tokens**](AccountApi.md#tokens) | **GET** /api/v1/tokens | tokens [**tokens_create**](AccountApi.md#tokens_create) | **POST** /api/v1/tokens/create | tokens_create @@ -1298,6 +1303,379 @@ 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) +# **rfq_create** +> RespCreateRFQ rfq_create(authorization, market_index, direction, base_amount=base_amount, quote_amount=quote_amount, metadata=metadata) + +rfq_create + +Create RFQ + +### Example + + +```python +import lighter +from lighter.models.resp_create_rfq import RespCreateRFQ +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) + authorization = 'authorization_example' # str | + market_index = 56 # int | + direction = 56 # int | + base_amount = 'base_amount_example' # str | (optional) + quote_amount = 'quote_amount_example' # str | (optional) + metadata = 'metadata_example' # str | (optional) + + try: + # rfq_create + api_response = await api_instance.rfq_create(authorization, market_index, direction, base_amount=base_amount, quote_amount=quote_amount, metadata=metadata) + print("The response of AccountApi->rfq_create:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->rfq_create: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | + **market_index** | **int**| | + **direction** | **int**| | + **base_amount** | **str**| | [optional] + **quote_amount** | **str**| | [optional] + **metadata** | **str**| | [optional] + +### Return type + +[**RespCreateRFQ**](RespCreateRFQ.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **rfq_get** +> RespGetRFQ rfq_get(authorization, rfq_id) + +rfq_get + +Get RFQ by ID + +### Example + + +```python +import lighter +from lighter.models.resp_get_rfq import RespGetRFQ +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) + authorization = 'authorization_example' # str | + rfq_id = 56 # int | + + try: + # rfq_get + api_response = await api_instance.rfq_get(authorization, rfq_id) + print("The response of AccountApi->rfq_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->rfq_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | + **rfq_id** | **int**| | + +### Return type + +[**RespGetRFQ**](RespGetRFQ.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) + +# **rfq_list** +> RespListRFQs rfq_list(authorization, account_index=account_index, status=status, cursor=cursor, limit=limit) + +rfq_list + +List RFQs + +### Example + + +```python +import lighter +from lighter.models.resp_list_rfqs import RespListRFQs +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) + authorization = 'authorization_example' # str | + account_index = 56 # int | (optional) + status = 'status_example' # str | (optional) + cursor = 'cursor_example' # str | (optional) + limit = 56 # int | (optional) + + try: + # rfq_list + api_response = await api_instance.rfq_list(authorization, account_index=account_index, status=status, cursor=cursor, limit=limit) + print("The response of AccountApi->rfq_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->rfq_list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | + **account_index** | **int**| | [optional] + **status** | **str**| | [optional] + **cursor** | **str**| | [optional] + **limit** | **int**| | [optional] + +### Return type + +[**RespListRFQs**](RespListRFQs.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) + +# **rfq_respond** +> RespRespondToRFQ rfq_respond(authorization, rfq_id, status) + +rfq_respond + +Respond to RFQ + +### Example + + +```python +import lighter +from lighter.models.resp_respond_to_rfq import RespRespondToRFQ +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) + authorization = 'authorization_example' # str | + rfq_id = 56 # int | + status = 'status_example' # str | + + try: + # rfq_respond + api_response = await api_instance.rfq_respond(authorization, rfq_id, status) + print("The response of AccountApi->rfq_respond:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->rfq_respond: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | + **rfq_id** | **int**| | + **status** | **str**| | + +### Return type + +[**RespRespondToRFQ**](RespRespondToRFQ.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **rfq_update** +> RespUpdateRFQ rfq_update(authorization, rfq_id, status) + +rfq_update + +Update RFQ status + +### Example + + +```python +import lighter +from lighter.models.resp_update_rfq import RespUpdateRFQ +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) + authorization = 'authorization_example' # str | + rfq_id = 56 # int | + status = 'status_example' # str | + + try: + # rfq_update + api_response = await api_instance.rfq_update(authorization, rfq_id, status) + print("The response of AccountApi->rfq_update:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountApi->rfq_update: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **str**| | + **rfq_id** | **int**| | + **status** | **str**| | + +### Return type + +[**RespUpdateRFQ**](RespUpdateRFQ.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **set_maker_only_api_keys** > RespSetMakerOnlyApiKeys set_maker_only_api_keys(authorization, account_index, api_key_indexes, auth=auth) diff --git a/docs/InfoApi.md b/docs/InfoApi.md index 2d7f3ed..376b8c2 100644 --- a/docs/InfoApi.md +++ b/docs/InfoApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://mainnet.zklighter.elliot.ai* Method | HTTP request | Description ------------- | ------------- | ------------- [**layer1_basic_info**](InfoApi.md#layer1_basic_info) | **GET** /api/v1/layer1BasicInfo | layer1BasicInfo +[**synthetic_spot_info**](InfoApi.md#synthetic_spot_info) | **GET** /api/v1/syntheticSpotInfo | syntheticSpotInfo [**system_config**](InfoApi.md#system_config) | **GET** /api/v1/systemConfig | systemConfig [**transfer_fee_info**](InfoApi.md#transfer_fee_info) | **GET** /api/v1/transferFeeInfo | transferFeeInfo [**withdrawal_delay**](InfoApi.md#withdrawal_delay) | **GET** /api/v1/withdrawalDelay | withdrawalDelay @@ -75,6 +76,75 @@ 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) +# **synthetic_spot_info** +> RespSyntheticSpotInfo synthetic_spot_info(symbol) + +syntheticSpotInfo + +Get synthetic spot info for a symbol. For complete details see: https://docs.lighter.xyz/trading/real-world-assets-rwas/us-equity-indices + +### Example + + +```python +import lighter +from lighter.models.resp_synthetic_spot_info import RespSyntheticSpotInfo +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) + symbol = 'symbol_example' # str | + + try: + # syntheticSpotInfo + api_response = await api_instance.synthetic_spot_info(symbol) + print("The response of InfoApi->synthetic_spot_info:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling InfoApi->synthetic_spot_info: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **symbol** | **str**| | + +### Return type + +[**RespSyntheticSpotInfo**](RespSyntheticSpotInfo.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A successful response. | - | +**400** | Bad request | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **system_config** > SystemConfig system_config() diff --git a/docs/RFQEntry.md b/docs/RFQEntry.md new file mode 100644 index 0000000..ebc6109 --- /dev/null +++ b/docs/RFQEntry.md @@ -0,0 +1,39 @@ +# RFQEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**account_index** | **int** | | +**market_index** | **int** | | +**direction** | **int** | | +**base_amount** | **str** | | +**quote_amount** | **str** | | +**status** | **str** | | +**metadata** | [**RFQMetadata**](RFQMetadata.md) | | +**responses** | [**List[RFQResponseEntry]**](RFQResponseEntry.md) | | +**created_at** | **int** | | +**updated_at** | **int** | | + +## Example + +```python +from lighter.models.rfq_entry import RFQEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of RFQEntry from a JSON string +rfq_entry_instance = RFQEntry.from_json(json) +# print the JSON string representation of the object +print(RFQEntry.to_json()) + +# convert the object into a dict +rfq_entry_dict = rfq_entry_instance.to_dict() +# create an instance of RFQEntry from a dict +rfq_entry_from_dict = RFQEntry.from_dict(rfq_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RFQMetadata.md b/docs/RFQMetadata.md new file mode 100644 index 0000000..19cf57c --- /dev/null +++ b/docs/RFQMetadata.md @@ -0,0 +1,32 @@ +# RFQMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requested_est_price** | **str** | | +**requested_max_slippage** | **str** | | +**requested_slippage** | **str** | | +**worst_price** | **str** | | + +## Example + +```python +from lighter.models.rfq_metadata import RFQMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of RFQMetadata from a JSON string +rfq_metadata_instance = RFQMetadata.from_json(json) +# print the JSON string representation of the object +print(RFQMetadata.to_json()) + +# convert the object into a dict +rfq_metadata_dict = rfq_metadata_instance.to_dict() +# create an instance of RFQMetadata from a dict +rfq_metadata_from_dict = RFQMetadata.from_dict(rfq_metadata_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RFQResponseEntry.md b/docs/RFQResponseEntry.md new file mode 100644 index 0000000..bfecc67 --- /dev/null +++ b/docs/RFQResponseEntry.md @@ -0,0 +1,32 @@ +# RFQResponseEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_index** | **int** | | +**status** | **str** | | +**responded_at** | **int** | | +**updated_at** | **int** | | + +## Example + +```python +from lighter.models.rfq_response_entry import RFQResponseEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of RFQResponseEntry from a JSON string +rfq_response_entry_instance = RFQResponseEntry.from_json(json) +# print the JSON string representation of the object +print(RFQResponseEntry.to_json()) + +# convert the object into a dict +rfq_response_entry_dict = rfq_response_entry_instance.to_dict() +# create an instance of RFQResponseEntry from a dict +rfq_response_entry_from_dict = RFQResponseEntry.from_dict(rfq_response_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RespCreateRFQ.md b/docs/RespCreateRFQ.md new file mode 100644 index 0000000..968e368 --- /dev/null +++ b/docs/RespCreateRFQ.md @@ -0,0 +1,41 @@ +# RespCreateRFQ + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**id** | **int** | | +**account_index** | **int** | | +**market_index** | **int** | | +**direction** | **int** | | +**base_amount** | **str** | | +**quote_amount** | **str** | | +**status** | **str** | | +**metadata** | [**RFQMetadata**](RFQMetadata.md) | | +**responses** | [**List[RFQResponseEntry]**](RFQResponseEntry.md) | | +**created_at** | **int** | | +**updated_at** | **int** | | + +## Example + +```python +from lighter.models.resp_create_rfq import RespCreateRFQ + +# TODO update the JSON string below +json = "{}" +# create an instance of RespCreateRFQ from a JSON string +resp_create_rfq_instance = RespCreateRFQ.from_json(json) +# print the JSON string representation of the object +print(RespCreateRFQ.to_json()) + +# convert the object into a dict +resp_create_rfq_dict = resp_create_rfq_instance.to_dict() +# create an instance of RespCreateRFQ from a dict +resp_create_rfq_from_dict = RespCreateRFQ.from_dict(resp_create_rfq_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/RespGetRFQ.md b/docs/RespGetRFQ.md new file mode 100644 index 0000000..20f004a --- /dev/null +++ b/docs/RespGetRFQ.md @@ -0,0 +1,41 @@ +# RespGetRFQ + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**id** | **int** | | +**account_index** | **int** | | +**market_index** | **int** | | +**direction** | **int** | | +**base_amount** | **str** | | +**quote_amount** | **str** | | +**status** | **str** | | +**metadata** | [**RFQMetadata**](RFQMetadata.md) | | +**responses** | [**List[RFQResponseEntry]**](RFQResponseEntry.md) | | +**created_at** | **int** | | +**updated_at** | **int** | | + +## Example + +```python +from lighter.models.resp_get_rfq import RespGetRFQ + +# TODO update the JSON string below +json = "{}" +# create an instance of RespGetRFQ from a JSON string +resp_get_rfq_instance = RespGetRFQ.from_json(json) +# print the JSON string representation of the object +print(RespGetRFQ.to_json()) + +# convert the object into a dict +resp_get_rfq_dict = resp_get_rfq_instance.to_dict() +# create an instance of RespGetRFQ from a dict +resp_get_rfq_from_dict = RespGetRFQ.from_dict(resp_get_rfq_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/RespListRFQs.md b/docs/RespListRFQs.md new file mode 100644 index 0000000..90710fb --- /dev/null +++ b/docs/RespListRFQs.md @@ -0,0 +1,32 @@ +# RespListRFQs + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**rfqs** | [**List[RFQEntry]**](RFQEntry.md) | | +**next_cursor** | **str** | | [optional] + +## Example + +```python +from lighter.models.resp_list_rfqs import RespListRFQs + +# TODO update the JSON string below +json = "{}" +# create an instance of RespListRFQs from a JSON string +resp_list_rfqs_instance = RespListRFQs.from_json(json) +# print the JSON string representation of the object +print(RespListRFQs.to_json()) + +# convert the object into a dict +resp_list_rfqs_dict = resp_list_rfqs_instance.to_dict() +# create an instance of RespListRFQs from a dict +resp_list_rfqs_from_dict = RespListRFQs.from_dict(resp_list_rfqs_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/RespRespondToRFQ.md b/docs/RespRespondToRFQ.md new file mode 100644 index 0000000..706372c --- /dev/null +++ b/docs/RespRespondToRFQ.md @@ -0,0 +1,41 @@ +# RespRespondToRFQ + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**id** | **int** | | +**account_index** | **int** | | +**market_index** | **int** | | +**direction** | **int** | | +**base_amount** | **str** | | +**quote_amount** | **str** | | +**status** | **str** | | +**metadata** | [**RFQMetadata**](RFQMetadata.md) | | +**responses** | [**List[RFQResponseEntry]**](RFQResponseEntry.md) | | +**created_at** | **int** | | +**updated_at** | **int** | | + +## Example + +```python +from lighter.models.resp_respond_to_rfq import RespRespondToRFQ + +# TODO update the JSON string below +json = "{}" +# create an instance of RespRespondToRFQ from a JSON string +resp_respond_to_rfq_instance = RespRespondToRFQ.from_json(json) +# print the JSON string representation of the object +print(RespRespondToRFQ.to_json()) + +# convert the object into a dict +resp_respond_to_rfq_dict = resp_respond_to_rfq_instance.to_dict() +# create an instance of RespRespondToRFQ from a dict +resp_respond_to_rfq_from_dict = RespRespondToRFQ.from_dict(resp_respond_to_rfq_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/RespSyntheticSpotInfo.md b/docs/RespSyntheticSpotInfo.md new file mode 100644 index 0000000..775d848 --- /dev/null +++ b/docs/RespSyntheticSpotInfo.md @@ -0,0 +1,35 @@ +# RespSyntheticSpotInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**bps_per_day** | **float** | | +**expiry_time_ms** | **int** | | +**spot_close_ms** | **int** | | +**source** | **str** | | +**symbol** | **str** | | + +## Example + +```python +from lighter.models.resp_synthetic_spot_info import RespSyntheticSpotInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of RespSyntheticSpotInfo from a JSON string +resp_synthetic_spot_info_instance = RespSyntheticSpotInfo.from_json(json) +# print the JSON string representation of the object +print(RespSyntheticSpotInfo.to_json()) + +# convert the object into a dict +resp_synthetic_spot_info_dict = resp_synthetic_spot_info_instance.to_dict() +# create an instance of RespSyntheticSpotInfo from a dict +resp_synthetic_spot_info_from_dict = RespSyntheticSpotInfo.from_dict(resp_synthetic_spot_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/RespUpdateRFQ.md b/docs/RespUpdateRFQ.md new file mode 100644 index 0000000..05f5fb6 --- /dev/null +++ b/docs/RespUpdateRFQ.md @@ -0,0 +1,41 @@ +# RespUpdateRFQ + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | +**message** | **str** | | [optional] +**id** | **int** | | +**account_index** | **int** | | +**market_index** | **int** | | +**direction** | **int** | | +**base_amount** | **str** | | +**quote_amount** | **str** | | +**status** | **str** | | +**metadata** | [**RFQMetadata**](RFQMetadata.md) | | +**responses** | [**List[RFQResponseEntry]**](RFQResponseEntry.md) | | +**created_at** | **int** | | +**updated_at** | **int** | | + +## Example + +```python +from lighter.models.resp_update_rfq import RespUpdateRFQ + +# TODO update the JSON string below +json = "{}" +# create an instance of RespUpdateRFQ from a JSON string +resp_update_rfq_instance = RespUpdateRFQ.from_json(json) +# print the JSON string representation of the object +print(RespUpdateRFQ.to_json()) + +# convert the object into a dict +resp_update_rfq_dict = resp_update_rfq_instance.to_dict() +# create an instance of RespUpdateRFQ from a dict +resp_update_rfq_from_dict = RespUpdateRFQ.from_dict(resp_update_rfq_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 8d7d36a..3f84d93 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -111,12 +111,16 @@ from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_metadata import PublicPoolMetadata from lighter.models.public_pool_share import PublicPoolShare +from lighter.models.rfq_entry import RFQEntry +from lighter.models.rfq_metadata import RFQMetadata +from lighter.models.rfq_response_entry import RFQResponseEntry from lighter.models.referral import Referral from lighter.models.referral_code import ReferralCode from lighter.models.referral_point_entry import ReferralPointEntry from lighter.models.referral_points import ReferralPoints from lighter.models.req_set_account_metadata import ReqSetAccountMetadata from lighter.models.resp_change_account_tier import RespChangeAccountTier +from lighter.models.resp_create_rfq import RespCreateRFQ from lighter.models.resp_get_api_tokens import RespGetApiTokens from lighter.models.resp_get_exchange_metrics import RespGetExchangeMetrics from lighter.models.resp_get_execute_stats import RespGetExecuteStats @@ -125,13 +129,18 @@ from lighter.models.resp_get_lease_options import RespGetLeaseOptions from lighter.models.resp_get_leases import RespGetLeases from lighter.models.resp_get_maker_only_api_keys import RespGetMakerOnlyApiKeys +from lighter.models.resp_get_rfq import RespGetRFQ +from lighter.models.resp_list_rfqs import RespListRFQs from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata +from lighter.models.resp_respond_to_rfq import RespRespondToRFQ from lighter.models.resp_revoke_api_token import RespRevokeApiToken from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch from lighter.models.resp_set_maker_only_api_keys import RespSetMakerOnlyApiKeys +from lighter.models.resp_synthetic_spot_info import RespSyntheticSpotInfo from lighter.models.resp_update_kickback import RespUpdateKickback +from lighter.models.resp_update_rfq import RespUpdateRFQ from lighter.models.resp_update_referral_code import RespUpdateReferralCode from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode diff --git a/lighter/api/account_api.py b/lighter/api/account_api.py index d5c100c..ec65efb 100644 --- a/lighter/api/account_api.py +++ b/lighter/api/account_api.py @@ -29,14 +29,19 @@ from lighter.models.partner_stats import PartnerStats from lighter.models.position_fundings import PositionFundings from lighter.models.resp_change_account_tier import RespChangeAccountTier +from lighter.models.resp_create_rfq import RespCreateRFQ from lighter.models.resp_get_api_tokens import RespGetApiTokens from lighter.models.resp_get_lease_options import RespGetLeaseOptions from lighter.models.resp_get_leases import RespGetLeases from lighter.models.resp_get_maker_only_api_keys import RespGetMakerOnlyApiKeys +from lighter.models.resp_get_rfq import RespGetRFQ +from lighter.models.resp_list_rfqs import RespListRFQs from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata +from lighter.models.resp_respond_to_rfq import RespRespondToRFQ from lighter.models.resp_revoke_api_token import RespRevokeApiToken from lighter.models.resp_set_maker_only_api_keys import RespSetMakerOnlyApiKeys +from lighter.models.resp_update_rfq import RespUpdateRFQ from lighter.models.sub_accounts import SubAccounts from lighter.models.tx_hash import TxHash from lighter.models.user_referrals import UserReferrals @@ -5319,6 +5324,1555 @@ def _referral_user_referrals_serialize( + async def rfq_create( + self, + authorization: StrictStr, + market_index: StrictInt, + direction: StrictInt, + base_amount: Optional[StrictStr] = None, + quote_amount: Optional[StrictStr] = None, + metadata: 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, + ) -> RespCreateRFQ: + """rfq_create + + Create RFQ + + :param authorization: (required) + :type authorization: str + :param market_index: (required) + :type market_index: int + :param direction: (required) + :type direction: int + :param base_amount: + :type base_amount: str + :param quote_amount: + :type quote_amount: str + :param metadata: + :type metadata: 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._rfq_create_serialize( + authorization=authorization, + market_index=market_index, + direction=direction, + base_amount=base_amount, + quote_amount=quote_amount, + metadata=metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespCreateRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def rfq_create_with_http_info( + self, + authorization: StrictStr, + market_index: StrictInt, + direction: StrictInt, + base_amount: Optional[StrictStr] = None, + quote_amount: Optional[StrictStr] = None, + metadata: 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[RespCreateRFQ]: + """rfq_create + + Create RFQ + + :param authorization: (required) + :type authorization: str + :param market_index: (required) + :type market_index: int + :param direction: (required) + :type direction: int + :param base_amount: + :type base_amount: str + :param quote_amount: + :type quote_amount: str + :param metadata: + :type metadata: 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._rfq_create_serialize( + authorization=authorization, + market_index=market_index, + direction=direction, + base_amount=base_amount, + quote_amount=quote_amount, + metadata=metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespCreateRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def rfq_create_without_preload_content( + self, + authorization: StrictStr, + market_index: StrictInt, + direction: StrictInt, + base_amount: Optional[StrictStr] = None, + quote_amount: Optional[StrictStr] = None, + metadata: 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: + """rfq_create + + Create RFQ + + :param authorization: (required) + :type authorization: str + :param market_index: (required) + :type market_index: int + :param direction: (required) + :type direction: int + :param base_amount: + :type base_amount: str + :param quote_amount: + :type quote_amount: str + :param metadata: + :type metadata: 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._rfq_create_serialize( + authorization=authorization, + market_index=market_index, + direction=direction, + base_amount=base_amount, + quote_amount=quote_amount, + metadata=metadata, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespCreateRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rfq_create_serialize( + self, + authorization, + market_index, + direction, + base_amount, + quote_amount, + metadata, + _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 market_index is not None: + _form_params.append(('market_index', market_index)) + if base_amount is not None: + _form_params.append(('base_amount', base_amount)) + if quote_amount is not None: + _form_params.append(('quote_amount', quote_amount)) + if direction is not None: + _form_params.append(('direction', direction)) + if metadata is not None: + _form_params.append(('metadata', metadata)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/rfq/create', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + async def rfq_get( + self, + authorization: StrictStr, + rfq_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RespGetRFQ: + """rfq_get + + Get RFQ by ID + + :param authorization: (required) + :type authorization: str + :param rfq_id: (required) + :type rfq_id: 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._rfq_get_serialize( + authorization=authorization, + rfq_id=rfq_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def rfq_get_with_http_info( + self, + authorization: StrictStr, + rfq_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RespGetRFQ]: + """rfq_get + + Get RFQ by ID + + :param authorization: (required) + :type authorization: str + :param rfq_id: (required) + :type rfq_id: 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._rfq_get_serialize( + authorization=authorization, + rfq_id=rfq_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def rfq_get_without_preload_content( + self, + authorization: StrictStr, + rfq_id: StrictInt, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """rfq_get + + Get RFQ by ID + + :param authorization: (required) + :type authorization: str + :param rfq_id: (required) + :type rfq_id: 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._rfq_get_serialize( + authorization=authorization, + rfq_id=rfq_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespGetRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rfq_get_serialize( + self, + authorization, + rfq_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if rfq_id is not None: + + _query_params.append(('rfq_id', rfq_id)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/rfq/get', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + async def rfq_list( + self, + authorization: StrictStr, + account_index: Optional[StrictInt] = None, + status: Optional[StrictStr] = None, + cursor: Optional[StrictStr] = None, + limit: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RespListRFQs: + """rfq_list + + List RFQs + + :param authorization: (required) + :type authorization: str + :param account_index: + :type account_index: int + :param status: + :type status: str + :param cursor: + :type cursor: str + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rfq_list_serialize( + authorization=authorization, + account_index=account_index, + status=status, + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespListRFQs", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def rfq_list_with_http_info( + self, + authorization: StrictStr, + account_index: Optional[StrictInt] = None, + status: Optional[StrictStr] = None, + cursor: Optional[StrictStr] = None, + limit: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RespListRFQs]: + """rfq_list + + List RFQs + + :param authorization: (required) + :type authorization: str + :param account_index: + :type account_index: int + :param status: + :type status: str + :param cursor: + :type cursor: str + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rfq_list_serialize( + authorization=authorization, + account_index=account_index, + status=status, + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespListRFQs", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def rfq_list_without_preload_content( + self, + authorization: StrictStr, + account_index: Optional[StrictInt] = None, + status: Optional[StrictStr] = None, + cursor: Optional[StrictStr] = None, + limit: Optional[StrictInt] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """rfq_list + + List RFQs + + :param authorization: (required) + :type authorization: str + :param account_index: + :type account_index: int + :param status: + :type status: str + :param cursor: + :type cursor: str + :param limit: + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rfq_list_serialize( + authorization=authorization, + account_index=account_index, + status=status, + cursor=cursor, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespListRFQs", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rfq_list_serialize( + self, + authorization, + account_index, + status, + cursor, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if account_index is not None: + + _query_params.append(('account_index', account_index)) + + if status is not None: + + _query_params.append(('status', status)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + if authorization is not None: + _header_params['authorization'] = authorization + # process the form parameters + # process the body parameter + + + # 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/rfq/list', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + async def rfq_respond( + self, + authorization: StrictStr, + rfq_id: StrictInt, + status: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RespRespondToRFQ: + """rfq_respond + + Respond to RFQ + + :param authorization: (required) + :type authorization: str + :param rfq_id: (required) + :type rfq_id: int + :param status: (required) + :type status: 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._rfq_respond_serialize( + authorization=authorization, + rfq_id=rfq_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespRespondToRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def rfq_respond_with_http_info( + self, + authorization: StrictStr, + rfq_id: StrictInt, + status: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RespRespondToRFQ]: + """rfq_respond + + Respond to RFQ + + :param authorization: (required) + :type authorization: str + :param rfq_id: (required) + :type rfq_id: int + :param status: (required) + :type status: 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._rfq_respond_serialize( + authorization=authorization, + rfq_id=rfq_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespRespondToRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def rfq_respond_without_preload_content( + self, + authorization: StrictStr, + rfq_id: StrictInt, + status: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """rfq_respond + + Respond to RFQ + + :param authorization: (required) + :type authorization: str + :param rfq_id: (required) + :type rfq_id: int + :param status: (required) + :type status: 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._rfq_respond_serialize( + authorization=authorization, + rfq_id=rfq_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespRespondToRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rfq_respond_serialize( + self, + authorization, + rfq_id, + status, + _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 rfq_id is not None: + _form_params.append(('rfq_id', rfq_id)) + if status is not None: + _form_params.append(('status', status)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/rfq/respond', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + async def rfq_update( + self, + authorization: StrictStr, + rfq_id: StrictInt, + status: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RespUpdateRFQ: + """rfq_update + + Update RFQ status + + :param authorization: (required) + :type authorization: str + :param rfq_id: (required) + :type rfq_id: int + :param status: (required) + :type status: 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._rfq_update_serialize( + authorization=authorization, + rfq_id=rfq_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespUpdateRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def rfq_update_with_http_info( + self, + authorization: StrictStr, + rfq_id: StrictInt, + status: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RespUpdateRFQ]: + """rfq_update + + Update RFQ status + + :param authorization: (required) + :type authorization: str + :param rfq_id: (required) + :type rfq_id: int + :param status: (required) + :type status: 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._rfq_update_serialize( + authorization=authorization, + rfq_id=rfq_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespUpdateRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def rfq_update_without_preload_content( + self, + authorization: StrictStr, + rfq_id: StrictInt, + status: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """rfq_update + + Update RFQ status + + :param authorization: (required) + :type authorization: str + :param rfq_id: (required) + :type rfq_id: int + :param status: (required) + :type status: 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._rfq_update_serialize( + authorization=authorization, + rfq_id=rfq_id, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespUpdateRFQ", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rfq_update_serialize( + self, + authorization, + rfq_id, + status, + _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 rfq_id is not None: + _form_params.append(('rfq_id', rfq_id)) + if status is not None: + _form_params.append(('status', status)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/rfq/update', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + async def set_maker_only_api_keys( self, authorization: StrictStr, diff --git a/lighter/api/info_api.py b/lighter/api/info_api.py index e24d85d..a64b51c 100644 --- a/lighter/api/info_api.py +++ b/lighter/api/info_api.py @@ -19,6 +19,7 @@ from pydantic import StrictInt, StrictStr from typing import Optional from lighter.models.layer1_basic_info import Layer1BasicInfo +from lighter.models.resp_synthetic_spot_info import RespSyntheticSpotInfo from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.system_config import SystemConfig from lighter.models.transfer_fee_info import TransferFeeInfo @@ -284,6 +285,266 @@ def _layer1_basic_info_serialize( + async def synthetic_spot_info( + self, + symbol: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RespSyntheticSpotInfo: + """syntheticSpotInfo + + Get synthetic spot info for a symbol. For complete details see: https://docs.lighter.xyz/trading/real-world-assets-rwas/us-equity-indices + + :param symbol: (required) + :type symbol: 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._synthetic_spot_info_serialize( + symbol=symbol, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespSyntheticSpotInfo", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + async def synthetic_spot_info_with_http_info( + self, + symbol: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RespSyntheticSpotInfo]: + """syntheticSpotInfo + + Get synthetic spot info for a symbol. For complete details see: https://docs.lighter.xyz/trading/real-world-assets-rwas/us-equity-indices + + :param symbol: (required) + :type symbol: 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._synthetic_spot_info_serialize( + symbol=symbol, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespSyntheticSpotInfo", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + async def synthetic_spot_info_without_preload_content( + self, + symbol: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """syntheticSpotInfo + + Get synthetic spot info for a symbol. For complete details see: https://docs.lighter.xyz/trading/real-world-assets-rwas/us-equity-indices + + :param symbol: (required) + :type symbol: 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._synthetic_spot_info_serialize( + symbol=symbol, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RespSyntheticSpotInfo", + '400': "ResultCode", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _synthetic_spot_info_serialize( + self, + symbol, + _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 symbol is not None: + + _query_params.append(('symbol', symbol)) + + # 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/syntheticSpotInfo', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + async def system_config( self, _request_timeout: Union[ diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index a12674f..25da79c 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -82,12 +82,16 @@ from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_metadata import PublicPoolMetadata from lighter.models.public_pool_share import PublicPoolShare +from lighter.models.rfq_entry import RFQEntry +from lighter.models.rfq_metadata import RFQMetadata +from lighter.models.rfq_response_entry import RFQResponseEntry from lighter.models.referral import Referral from lighter.models.referral_code import ReferralCode from lighter.models.referral_point_entry import ReferralPointEntry from lighter.models.referral_points import ReferralPoints from lighter.models.req_set_account_metadata import ReqSetAccountMetadata from lighter.models.resp_change_account_tier import RespChangeAccountTier +from lighter.models.resp_create_rfq import RespCreateRFQ from lighter.models.resp_get_api_tokens import RespGetApiTokens from lighter.models.resp_get_exchange_metrics import RespGetExchangeMetrics from lighter.models.resp_get_execute_stats import RespGetExecuteStats @@ -96,13 +100,18 @@ from lighter.models.resp_get_lease_options import RespGetLeaseOptions from lighter.models.resp_get_leases import RespGetLeases from lighter.models.resp_get_maker_only_api_keys import RespGetMakerOnlyApiKeys +from lighter.models.resp_get_rfq import RespGetRFQ +from lighter.models.resp_list_rfqs import RespListRFQs from lighter.models.resp_post_api_token import RespPostApiToken from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata +from lighter.models.resp_respond_to_rfq import RespRespondToRFQ from lighter.models.resp_revoke_api_token import RespRevokeApiToken from lighter.models.resp_send_tx import RespSendTx from lighter.models.resp_send_tx_batch import RespSendTxBatch from lighter.models.resp_set_maker_only_api_keys import RespSetMakerOnlyApiKeys +from lighter.models.resp_synthetic_spot_info import RespSyntheticSpotInfo from lighter.models.resp_update_kickback import RespUpdateKickback +from lighter.models.resp_update_rfq import RespUpdateRFQ from lighter.models.resp_update_referral_code import RespUpdateReferralCode from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay from lighter.models.result_code import ResultCode diff --git a/lighter/models/resp_create_rfq.py b/lighter/models/resp_create_rfq.py new file mode 100644 index 0000000..89dd8de --- /dev/null +++ b/lighter/models/resp_create_rfq.py @@ -0,0 +1,136 @@ +# 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.rfq_metadata import RFQMetadata +from lighter.models.rfq_response_entry import RFQResponseEntry +from typing import Optional, Set +from typing_extensions import Self + +class RespCreateRFQ(BaseModel): + """ + RespCreateRFQ + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + id: StrictInt + account_index: StrictInt + market_index: StrictInt + direction: StrictInt + base_amount: StrictStr + quote_amount: StrictStr + status: StrictStr + metadata: RFQMetadata + responses: List[RFQResponseEntry] + created_at: StrictInt + updated_at: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + + 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 RespCreateRFQ 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 metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in responses (list) + _items = [] + if self.responses: + for _item in self.responses: + if _item: + _items.append(_item.to_dict()) + _dict['responses'] = _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 RespCreateRFQ from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "id": obj.get("id"), + "account_index": obj.get("account_index"), + "market_index": obj.get("market_index"), + "direction": obj.get("direction"), + "base_amount": obj.get("base_amount"), + "quote_amount": obj.get("quote_amount"), + "status": obj.get("status"), + "metadata": RFQMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "responses": [RFQResponseEntry.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_get_rfq.py b/lighter/models/resp_get_rfq.py new file mode 100644 index 0000000..47fde13 --- /dev/null +++ b/lighter/models/resp_get_rfq.py @@ -0,0 +1,136 @@ +# 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.rfq_metadata import RFQMetadata +from lighter.models.rfq_response_entry import RFQResponseEntry +from typing import Optional, Set +from typing_extensions import Self + +class RespGetRFQ(BaseModel): + """ + RespGetRFQ + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + id: StrictInt + account_index: StrictInt + market_index: StrictInt + direction: StrictInt + base_amount: StrictStr + quote_amount: StrictStr + status: StrictStr + metadata: RFQMetadata + responses: List[RFQResponseEntry] + created_at: StrictInt + updated_at: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + + 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 RespGetRFQ 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 metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in responses (list) + _items = [] + if self.responses: + for _item in self.responses: + if _item: + _items.append(_item.to_dict()) + _dict['responses'] = _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 RespGetRFQ from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "id": obj.get("id"), + "account_index": obj.get("account_index"), + "market_index": obj.get("market_index"), + "direction": obj.get("direction"), + "base_amount": obj.get("base_amount"), + "quote_amount": obj.get("quote_amount"), + "status": obj.get("status"), + "metadata": RFQMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "responses": [RFQResponseEntry.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_list_rfqs.py b/lighter/models/resp_list_rfqs.py new file mode 100644 index 0000000..e27f8a2 --- /dev/null +++ b/lighter/models/resp_list_rfqs.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.rfq_entry import RFQEntry +from typing import Optional, Set +from typing_extensions import Self + +class RespListRFQs(BaseModel): + """ + RespListRFQs + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + rfqs: List[RFQEntry] + next_cursor: Optional[StrictStr] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "rfqs", "next_cursor"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RespListRFQs 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 rfqs (list) + _items = [] + if self.rfqs: + for _item in self.rfqs: + if _item: + _items.append(_item.to_dict()) + _dict['rfqs'] = _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 RespListRFQs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "rfqs": [RFQEntry.from_dict(_item) for _item in obj["rfqs"]] if obj.get("rfqs") is not None else None, + "next_cursor": obj.get("next_cursor") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_respond_to_rfq.py b/lighter/models/resp_respond_to_rfq.py new file mode 100644 index 0000000..d05b953 --- /dev/null +++ b/lighter/models/resp_respond_to_rfq.py @@ -0,0 +1,136 @@ +# 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.rfq_metadata import RFQMetadata +from lighter.models.rfq_response_entry import RFQResponseEntry +from typing import Optional, Set +from typing_extensions import Self + +class RespRespondToRFQ(BaseModel): + """ + RespRespondToRFQ + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + id: StrictInt + account_index: StrictInt + market_index: StrictInt + direction: StrictInt + base_amount: StrictStr + quote_amount: StrictStr + status: StrictStr + metadata: RFQMetadata + responses: List[RFQResponseEntry] + created_at: StrictInt + updated_at: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + + 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 RespRespondToRFQ 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 metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in responses (list) + _items = [] + if self.responses: + for _item in self.responses: + if _item: + _items.append(_item.to_dict()) + _dict['responses'] = _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 RespRespondToRFQ from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "id": obj.get("id"), + "account_index": obj.get("account_index"), + "market_index": obj.get("market_index"), + "direction": obj.get("direction"), + "base_amount": obj.get("base_amount"), + "quote_amount": obj.get("quote_amount"), + "status": obj.get("status"), + "metadata": RFQMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "responses": [RFQResponseEntry.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/resp_synthetic_spot_info.py b/lighter/models/resp_synthetic_spot_info.py new file mode 100644 index 0000000..abdffd6 --- /dev/null +++ b/lighter/models/resp_synthetic_spot_info.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class RespSyntheticSpotInfo(BaseModel): + """ + RespSyntheticSpotInfo + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + bps_per_day: Union[StrictFloat, StrictInt] + expiry_time_ms: StrictInt + spot_close_ms: StrictInt + source: StrictStr + symbol: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "bps_per_day", "expiry_time_ms", "spot_close_ms", "source", "symbol"] + + 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 RespSyntheticSpotInfo 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 RespSyntheticSpotInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "bps_per_day": obj.get("bps_per_day"), + "expiry_time_ms": obj.get("expiry_time_ms"), + "spot_close_ms": obj.get("spot_close_ms"), + "source": obj.get("source"), + "symbol": obj.get("symbol") + }) + # 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_update_rfq.py b/lighter/models/resp_update_rfq.py new file mode 100644 index 0000000..ed77bdd --- /dev/null +++ b/lighter/models/resp_update_rfq.py @@ -0,0 +1,136 @@ +# 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.rfq_metadata import RFQMetadata +from lighter.models.rfq_response_entry import RFQResponseEntry +from typing import Optional, Set +from typing_extensions import Self + +class RespUpdateRFQ(BaseModel): + """ + RespUpdateRFQ + """ # noqa: E501 + code: StrictInt + message: Optional[StrictStr] = None + id: StrictInt + account_index: StrictInt + market_index: StrictInt + direction: StrictInt + base_amount: StrictStr + quote_amount: StrictStr + status: StrictStr + metadata: RFQMetadata + responses: List[RFQResponseEntry] + created_at: StrictInt + updated_at: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + + 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 RespUpdateRFQ 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 metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in responses (list) + _items = [] + if self.responses: + for _item in self.responses: + if _item: + _items.append(_item.to_dict()) + _dict['responses'] = _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 RespUpdateRFQ from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "code": obj.get("code"), + "message": obj.get("message"), + "id": obj.get("id"), + "account_index": obj.get("account_index"), + "market_index": obj.get("market_index"), + "direction": obj.get("direction"), + "base_amount": obj.get("base_amount"), + "quote_amount": obj.get("quote_amount"), + "status": obj.get("status"), + "metadata": RFQMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "responses": [RFQResponseEntry.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/rfq_entry.py b/lighter/models/rfq_entry.py new file mode 100644 index 0000000..8465419 --- /dev/null +++ b/lighter/models/rfq_entry.py @@ -0,0 +1,132 @@ +# 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 lighter.models.rfq_metadata import RFQMetadata +from lighter.models.rfq_response_entry import RFQResponseEntry +from typing import Optional, Set +from typing_extensions import Self + +class RFQEntry(BaseModel): + """ + RFQEntry + """ # noqa: E501 + id: StrictInt + account_index: StrictInt + market_index: StrictInt + direction: StrictInt + base_amount: StrictStr + quote_amount: StrictStr + status: StrictStr + metadata: RFQMetadata + responses: List[RFQResponseEntry] + created_at: StrictInt + updated_at: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "account_index", "market_index", "direction", "base_amount", "quote_amount", "status", "metadata", "responses", "created_at", "updated_at"] + + 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 RFQEntry 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 metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in responses (list) + _items = [] + if self.responses: + for _item in self.responses: + if _item: + _items.append(_item.to_dict()) + _dict['responses'] = _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 RFQEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "id": obj.get("id"), + "account_index": obj.get("account_index"), + "market_index": obj.get("market_index"), + "direction": obj.get("direction"), + "base_amount": obj.get("base_amount"), + "quote_amount": obj.get("quote_amount"), + "status": obj.get("status"), + "metadata": RFQMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "responses": [RFQResponseEntry.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None, + "created_at": obj.get("created_at"), + "updated_at": obj.get("updated_at") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/lighter/models/rfq_metadata.py b/lighter/models/rfq_metadata.py new file mode 100644 index 0000000..c4b1476 --- /dev/null +++ b/lighter/models/rfq_metadata.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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class RFQMetadata(BaseModel): + """ + RFQMetadata + """ # noqa: E501 + requested_est_price: StrictStr + requested_max_slippage: StrictStr + requested_slippage: StrictStr + worst_price: StrictStr + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["requested_est_price", "requested_max_slippage", "requested_slippage", "worst_price"] + + 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 RFQMetadata 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 RFQMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "requested_est_price": obj.get("requested_est_price"), + "requested_max_slippage": obj.get("requested_max_slippage"), + "requested_slippage": obj.get("requested_slippage"), + "worst_price": obj.get("worst_price") + }) + # 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/rfq_response_entry.py b/lighter/models/rfq_response_entry.py new file mode 100644 index 0000000..99d2fb5 --- /dev/null +++ b/lighter/models/rfq_response_entry.py @@ -0,0 +1,113 @@ +# 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 RFQResponseEntry(BaseModel): + """ + RFQResponseEntry + """ # noqa: E501 + account_index: StrictInt + status: StrictStr + responded_at: StrictInt + updated_at: StrictInt + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["account_index", "status", "responded_at", "updated_at"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['acknowledged', 'liquidity_provided', 'not_interested']): + raise ValueError("must be one of enum values ('acknowledged', 'liquidity_provided', 'not_interested')") + 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 RFQResponseEntry 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 RFQResponseEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_construct(**{ + "account_index": obj.get("account_index"), + "status": obj.get("status"), + "responded_at": obj.get("responded_at"), + "updated_at": obj.get("updated_at") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/openapi.json b/openapi.json index 3e58a45..57aff28 100644 --- a/openapi.json +++ b/openapi.json @@ -4383,6 +4383,338 @@ } } } + }, + "/api/v1/syntheticSpotInfo": { + "get": { + "summary": "syntheticSpotInfo", + "operationId": "syntheticSpotInfo", + "tags": [ + "info" + ], + "description": "Get synthetic spot info for a symbol. For complete details see: https://docs.lighter.xyz/trading/real-world-assets-rwas/us-equity-indices", + "parameters": [ + { + "name": "symbol", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespSyntheticSpotInfo" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/rfq/respond": { + "post": { + "summary": "rfq_respond", + "operationId": "rfq_respond", + "tags": [ + "account" + ], + "description": "Respond to RFQ", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqRespondToRFQ" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespRespondToRFQ" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/rfq/list": { + "get": { + "summary": "rfq_list", + "operationId": "rfq_list", + "tags": [ + "account" + ], + "description": "List RFQs", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "account_index", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": "281474976710655" + } + }, + { + "name": "status", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "opened", + "order_created", + "closed" + ] + } + }, + { + "name": "cursor", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": "20" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespListRFQs" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/rfq/get": { + "get": { + "summary": "rfq_get", + "operationId": "rfq_get", + "tags": [ + "account" + ], + "description": "Get RFQ by ID", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "rfq_id", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespGetRFQ" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/rfq/create": { + "post": { + "summary": "rfq_create", + "operationId": "rfq_create", + "tags": [ + "account" + ], + "description": "Create RFQ", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqCreateRFQ" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespCreateRFQ" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } + }, + "/api/v1/rfq/update": { + "post": { + "summary": "rfq_update", + "operationId": "rfq_update", + "tags": [ + "account" + ], + "description": "Update RFQ status", + "parameters": [ + { + "name": "authorization", + "in": "header", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/ReqUpdateRFQ" + } + } + } + }, + "responses": { + "200": { + "description": "A successful response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RespUpdateRFQ" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResultCode" + } + } + } + } + } + } } }, "servers": [ @@ -7870,15 +8202,193 @@ "seconds": { "type": "integer", "format": "int64", - "example": "86400" + "example": "86400" + } + }, + "title": "RespWithdrawalDelay", + "required": [ + "seconds" + ] + }, + "ResultCode": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + } + }, + "title": "ResultCode", + "required": [ + "code" + ] + }, + "RiskInfo": { + "type": "object", + "properties": { + "cross_risk_parameters": { + "$ref": "#/components/schemas/RiskParameters" + }, + "isolated_risk_parameters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RiskParameters" + } + } + }, + "title": "RiskInfo", + "required": [ + "cross_risk_parameters", + "isolated_risk_parameters" + ] + }, + "RiskParameters": { + "type": "object", + "properties": { + "market_id": { + "type": "integer", + "format": "int16" + }, + "collateral": { + "type": "string" + }, + "total_account_value": { + "type": "string" + }, + "initial_margin_req": { + "type": "string" + }, + "maintenance_margin_req": { + "type": "string" + }, + "close_out_margin_req": { + "type": "string" + }, + "total_account_liquidation_threshold": { + "type": "string" + }, + "usdc_collateral_with_funding": { + "type": "string" + }, + "usdc_portfolio_value": { + "type": "string" + } + }, + "title": "RiskParameters", + "required": [ + "market_id", + "total_account_value", + "initial_margin_req", + "maintenance_margin_req", + "close_out_margin_req", + "total_account_liquidation_threshold", + "collateral", + "usdc_collateral_with_funding", + "usdc_portfolio_value" + ] + }, + "SharePrice": { + "type": "object", + "properties": { + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "share_price": { + "type": "number", + "format": "double", + "example": "0.0001" + } + }, + "title": "SharePrice", + "required": [ + "timestamp", + "share_price" + ] + }, + "SimpleOrder": { + "type": "object", + "properties": { + "order_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "order_id": { + "type": "string", + "example": "1" + }, + "owner_account_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "initial_base_amount": { + "type": "string", + "example": "0.1" + }, + "remaining_base_amount": { + "type": "string", + "example": "0.1" + }, + "price": { + "type": "string", + "example": "3024.66" + }, + "order_expiry": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "transaction_time": { + "type": "integer", + "format": "int64" + } + }, + "title": "SimpleOrder", + "required": [ + "order_index", + "order_id", + "owner_account_index", + "initial_base_amount", + "remaining_base_amount", + "price", + "order_expiry", + "transaction_time" + ] + }, + "Status": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "network_id": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1717777777" } }, - "title": "RespWithdrawalDelay", + "title": "Status", "required": [ - "seconds" + "status", + "network_id", + "timestamp" ] }, - "ResultCode": { + "SubAccounts": { "type": "object", "properties": { "code": { @@ -7888,175 +8398,327 @@ }, "message": { "type": "string" - } - }, - "title": "ResultCode", - "required": [ - "code" - ] - }, - "RiskInfo": { - "type": "object", - "properties": { - "cross_risk_parameters": { - "$ref": "#/components/schemas/RiskParameters" }, - "isolated_risk_parameters": { + "l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "sub_accounts": { "type": "array", + "example": "1", "items": { - "$ref": "#/components/schemas/RiskParameters" + "$ref": "#/components/schemas/Account" } + }, + "next_cursor": { + "type": "string" } }, - "title": "RiskInfo", + "title": "SubAccounts", "required": [ - "cross_risk_parameters", - "isolated_risk_parameters" + "code", + "l1_address", + "sub_accounts" ] }, - "RiskParameters": { + "Trade": { "type": "object", "properties": { + "trade_id": { + "type": "integer", + "format": "int64", + "example": "145" + }, + "tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "type": { + "type": "string", + "example": "trade", + "enum": [ + "trade", + "liquidation", + "deleverage", + "market-settlement" + ] + }, "market_id": { "type": "integer", - "format": "int16" + "format": "int16", + "example": "1" }, - "collateral": { - "type": "string" + "size": { + "type": "string", + "example": "0.1" }, - "total_account_value": { - "type": "string" + "price": { + "type": "string", + "example": "3024.66" }, - "initial_margin_req": { - "type": "string" + "usd_amount": { + "type": "string", + "example": "3024.66" }, - "maintenance_margin_req": { - "type": "string" + "ask_id": { + "type": "integer", + "format": "int64", + "example": "145" }, - "close_out_margin_req": { - "type": "string" + "bid_id": { + "type": "integer", + "format": "int64", + "example": "245" }, - "total_account_liquidation_threshold": { - "type": "string" + "ask_account_id": { + "type": "integer", + "format": "int64", + "example": "1" }, - "usdc_collateral_with_funding": { - "type": "string" + "bid_account_id": { + "type": "integer", + "format": "int64", + "example": "3" + }, + "is_maker_ask": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "block_height": { + "type": "integer", + "format": "int64", + "example": "45434" }, - "usdc_portfolio_value": { - "type": "string" - } - }, - "title": "RiskParameters", - "required": [ - "market_id", - "total_account_value", - "initial_margin_req", - "maintenance_margin_req", - "close_out_margin_req", - "total_account_liquidation_threshold", - "collateral", - "usdc_collateral_with_funding", - "usdc_portfolio_value" - ] - }, - "SharePrice": { - "type": "object", - "properties": { "timestamp": { "type": "integer", "format": "int64", "example": "1640995200" }, - "share_price": { - "type": "number", - "format": "double", - "example": "0.0001" - } - }, - "title": "SharePrice", - "required": [ - "timestamp", - "share_price" - ] - }, - "SimpleOrder": { - "type": "object", - "properties": { - "order_index": { + "taker_fee": { + "type": "integer", + "format": "int32", + "example": "0" + }, + "taker_position_size_before": { + "type": "string", + "example": "0" + }, + "taker_entry_quote_before": { + "type": "string", + "example": "0" + }, + "taker_initial_margin_fraction_before": { + "type": "integer", + "format": "uin16", + "example": "0" + }, + "taker_position_sign_changed": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "maker_fee": { + "type": "integer", + "format": "int32", + "example": "0" + }, + "maker_position_size_before": { + "type": "string", + "example": "0" + }, + "maker_entry_quote_before": { + "type": "string", + "example": "0" + }, + "maker_initial_margin_fraction_before": { + "type": "integer", + "format": "uin16", + "example": "0" + }, + "maker_position_sign_changed": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "transaction_time": { + "type": "integer", + "format": "int64", + "example": "1771943742851429" + }, + "bid_account_pnl": { + "type": "string", + "description": "Realized PnL for the queried account index, triggered by reducing a short position", + "example": "-0.022890" + }, + "ask_account_pnl": { + "type": "string", + "description": "Realized PnL for the queried account index, triggered by reducing a long position, or a spot position", + "example": "1.989696" + }, + "ask_client_id": { + "type": "integer", + "format": "int64", + "example": "145" + }, + "bid_client_id": { + "type": "integer", + "format": "int64", + "example": "245" + }, + "ask_client_id_str": { + "type": "string", + "example": "145" + }, + "bid_client_id_str": { + "type": "string", + "example": "245" + }, + "ask_id_str": { + "type": "string", + "example": "145" + }, + "bid_id_str": { + "type": "string", + "example": "245" + }, + "trade_id_str": { + "type": "string", + "example": "145" + }, + "integrator_maker_fee": { + "type": "integer", + "format": "int32", + "example": "50" + }, + "integrator_maker_fee_collector_index": { "type": "integer", "format": "int64", - "example": "1" + "example": "156" }, - "order_id": { - "type": "string", - "example": "1" + "integrator_taker_fee": { + "type": "integer", + "format": "int32", + "example": "50" }, - "owner_account_index": { + "integrator_taker_fee_collector_index": { "type": "integer", "format": "int64", - "example": "1" - }, - "initial_base_amount": { - "type": "string", - "example": "0.1" + "example": "156" }, - "remaining_base_amount": { - "type": "string", - "example": "0.1" + "taker_allocated_margin_usdc_before": { + "type": "integer", + "format": "int64", + "example": "1100000000000000" }, - "price": { - "type": "string", - "example": "3024.66" + "taker_allocated_margin_usdc_after": { + "type": "integer", + "format": "int64", + "example": "150000000000000" }, - "order_expiry": { + "maker_allocated_margin_usdc_before": { "type": "integer", "format": "int64", - "example": "1640995200" + "example": "210000000000000" }, - "transaction_time": { + "maker_allocated_margin_usdc_after": { "type": "integer", - "format": "int64" + "format": "int64", + "example": "250000000000000" } }, - "title": "SimpleOrder", + "title": "Trade", "required": [ - "order_index", - "order_id", - "owner_account_index", - "initial_base_amount", - "remaining_base_amount", + "trade_id", + "trade_id_str", + "tx_hash", + "type", + "market_id", + "size", "price", - "order_expiry", - "transaction_time" + "usd_amount", + "ask_id", + "bid_id", + "ask_client_id", + "ask_client_id_str", + "bid_client_id", + "bid_client_id_str", + "ask_account_id", + "bid_account_id", + "is_maker_ask", + "block_height", + "timestamp", + "taker_position_size_before", + "taker_entry_quote_before", + "taker_initial_margin_fraction_before", + "taker_position_sign_changed", + "maker_position_size_before", + "maker_entry_quote_before", + "maker_initial_margin_fraction_before", + "maker_position_sign_changed", + "transaction_time", + "ask_account_pnl", + "bid_account_pnl", + "integrator_taker_fee", + "integrator_taker_fee_collector_index", + "integrator_maker_fee", + "integrator_maker_fee_collector_index", + "taker_allocated_margin_usdc_before", + "taker_allocated_margin_usdc_after", + "maker_allocated_margin_usdc_before", + "maker_allocated_margin_usdc_after" ] }, - "Status": { + "Trades": { "type": "object", "properties": { - "status": { + "code": { "type": "integer", "format": "int32", - "example": "1" + "example": "200" }, - "network_id": { + "message": { + "type": "string" + }, + "next_cursor": { + "type": "string" + }, + "trades": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Trade" + } + } + }, + "title": "Trades", + "required": [ + "code", + "trades" + ] + }, + "TransferFeeInfo": { + "type": "object", + "properties": { + "code": { "type": "integer", "format": "int32", - "example": "1" + "example": "200" }, - "timestamp": { + "message": { + "type": "string" + }, + "transfer_fee_usdc": { "type": "integer", - "format": "int64", - "example": "1717777777" + "format": "int64" } }, - "title": "Status", + "title": "TransferFeeInfo", "required": [ - "status", - "network_id", - "timestamp" + "code", + "transfer_fee_usdc" ] }, - "SubAccounts": { + "TransferHistory": { "type": "object", "properties": { "code": { @@ -8067,277 +8729,451 @@ "message": { "type": "string" }, - "l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "sub_accounts": { + "transfers": { "type": "array", - "example": "1", "items": { - "$ref": "#/components/schemas/Account" + "$ref": "#/components/schemas/TransferHistoryItem" } }, - "next_cursor": { + "cursor": { "type": "string" } }, - "title": "SubAccounts", + "title": "TransferHistory", "required": [ "code", - "l1_address", - "sub_accounts" + "transfers", + "cursor" ] }, - "Trade": { + "TransferHistoryItem": { "type": "object", "properties": { - "trade_id": { - "type": "integer", - "format": "int64", - "example": "145" + "id": { + "type": "string" }, - "tx_hash": { + "amount": { "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "example": "0.1" + }, + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" }, "type": { "type": "string", - "example": "trade", "enum": [ - "trade", - "liquidation", - "deleverage", - "market-settlement" + "L2TransferInflow", + "L2TransferOutflow", + "L2BurnSharesInflow", + "L2BurnSharesOutflow", + "L2MintSharesInflow", + "L2MintSharesOutflow", + "L2SelfTransfer", + "L2StakeAssetInflow", + "L2StakeAssetOutflow", + "L2UnstakeAssetInflow", + "L2UnstakeAssetOutflow", + "L2ForceBurnSharesInflow", + "L2ForceBurnSharesOutflow" ] }, - "market_id": { + "from_l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "to_l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "from_account_index": { "type": "integer", - "format": "int16", + "format": "int64", "example": "1" }, - "size": { + "to_account_index": { + "type": "integer", + "format": "int64", + "example": "1" + }, + "tx_hash": { "type": "string", - "example": "0.1" + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "asset_id": { + "type": "integer", + "format": "int16" + }, + "fee": { + "type": "string" + }, + "from_route": { + "type": "string", + "enum": [ + "spot", + "perps" + ] + }, + "to_route": { + "type": "string", + "enum": [ + "spot", + "perps" + ] + } + }, + "title": "TransferHistoryItem", + "required": [ + "id", + "amount", + "timestamp", + "type", + "from_l1_address", + "to_l1_address", + "from_account_index", + "to_account_index", + "tx_hash", + "asset_id", + "fee", + "from_route", + "to_route" + ] + }, + "Tx": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "type": { + "type": "integer", + "format": "uint8", + "example": "1", + "maximum": 64, + "minimum": 1 }, - "price": { + "info": { "type": "string", - "example": "3024.66" + "example": "{}" }, - "usd_amount": { + "event_info": { "type": "string", - "example": "3024.66" + "example": "{}" }, - "ask_id": { + "status": { "type": "integer", "format": "int64", - "example": "145" + "example": "1" }, - "bid_id": { + "transaction_index": { "type": "integer", "format": "int64", - "example": "245" + "example": "8761" }, - "ask_account_id": { + "l1_address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "account_index": { "type": "integer", "format": "int64", "example": "1" }, - "bid_account_id": { + "nonce": { "type": "integer", "format": "int64", - "example": "3" + "example": "722" }, - "is_maker_ask": { - "type": "boolean", - "format": "boolean", - "example": "true" + "expire_at": { + "type": "integer", + "format": "int64", + "example": "1640995200" }, "block_height": { "type": "integer", "format": "int64", "example": "45434" }, - "timestamp": { + "queued_at": { "type": "integer", "format": "int64", "example": "1640995200" }, - "taker_fee": { + "executed_at": { "type": "integer", - "format": "int32", - "example": "0" + "format": "int64", + "example": "1640995200" }, - "taker_position_size_before": { - "type": "string", - "example": "0" + "sequence_index": { + "type": "integer", + "format": "int64", + "example": "8761" }, - "taker_entry_quote_before": { + "parent_hash": { "type": "string", - "example": "0" + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" }, - "taker_initial_margin_fraction_before": { + "api_key_index": { "type": "integer", - "format": "uin16", - "example": "0" - }, - "taker_position_sign_changed": { - "type": "boolean", - "format": "boolean", - "example": "true" + "format": "uint8" }, - "maker_fee": { + "transaction_time": { + "type": "integer", + "format": "int64" + } + }, + "title": "Tx", + "required": [ + "hash", + "type", + "info", + "event_info", + "status", + "transaction_index", + "l1_address", + "account_index", + "nonce", + "expire_at", + "block_height", + "queued_at", + "executed_at", + "sequence_index", + "parent_hash", + "api_key_index", + "transaction_time" + ] + }, + "TxHash": { + "type": "object", + "properties": { + "code": { "type": "integer", "format": "int32", - "example": "0" + "example": "200" }, - "maker_position_size_before": { - "type": "string", - "example": "0" + "message": { + "type": "string" }, - "maker_entry_quote_before": { + "tx_hash": { "type": "string", - "example": "0" - }, - "maker_initial_margin_fraction_before": { + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + } + }, + "title": "TxHash", + "required": [ + "code", + "tx_hash" + ] + }, + "Txs": { + "type": "object", + "properties": { + "code": { "type": "integer", - "format": "uin16", - "example": "0" + "format": "int32", + "example": "200" }, - "maker_position_sign_changed": { + "message": { + "type": "string" + }, + "txs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Tx" + } + } + }, + "title": "Txs", + "required": [ + "code", + "txs" + ] + }, + "ValidatorInfo": { + "type": "object", + "properties": { + "address": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "is_active": { "type": "boolean", "format": "boolean", "example": "true" - }, - "transaction_time": { + } + }, + "title": "ValidatorInfo", + "required": [ + "address", + "is_active" + ] + }, + "WithdrawHistory": { + "type": "object", + "properties": { + "code": { "type": "integer", - "format": "int64", - "example": "1771943742851429" + "format": "int32", + "example": "200" }, - "bid_account_pnl": { - "type": "string", - "description": "Realized PnL for the queried account index, triggered by reducing a short position", - "example": "-0.022890" + "message": { + "type": "string" }, - "ask_account_pnl": { - "type": "string", - "description": "Realized PnL for the queried account index, triggered by reducing a long position, or a spot position", - "example": "1.989696" + "withdraws": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WithdrawHistoryItem" + } }, - "ask_client_id": { - "type": "integer", - "format": "int64", - "example": "145" + "cursor": { + "type": "string" + } + }, + "title": "WithdrawHistory", + "required": [ + "code", + "withdraws", + "cursor" + ] + }, + "WithdrawHistoryItem": { + "type": "object", + "properties": { + "id": { + "type": "string" }, - "bid_client_id": { + "amount": { + "type": "string", + "example": "0.1" + }, + "timestamp": { "type": "integer", "format": "int64", - "example": "245" - }, - "ask_client_id_str": { - "type": "string", - "example": "145" + "example": "1640995200" }, - "bid_client_id_str": { + "status": { "type": "string", - "example": "245" + "enum": [ + "failed", + "pending", + "claimable", + "refunded", + "completed" + ] }, - "ask_id_str": { + "type": { "type": "string", - "example": "145" + "enum": [ + "secure", + "fast" + ] }, - "bid_id_str": { + "l1_tx_hash": { "type": "string", - "example": "245" + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" }, - "trade_id_str": { + "asset_id": { + "type": "integer", + "format": "int16" + } + }, + "title": "WithdrawHistoryItem", + "required": [ + "id", + "amount", + "timestamp", + "status", + "type", + "l1_tx_hash", + "asset_id" + ] + }, + "ZkLighterInfo": { + "type": "object", + "properties": { + "contract_address": { "type": "string", - "example": "145" - }, - "integrator_maker_fee": { - "type": "integer", - "format": "int32", - "example": "50" + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + } + }, + "title": "ZkLighterInfo", + "required": [ + "contract_address" + ] + }, + "ReqFastwithdraw": { + "type": "object", + "properties": { + "tx_info": { + "type": "string" }, - "integrator_maker_fee_collector_index": { - "type": "integer", - "format": "int64", - "example": "156" + "to_address": { + "type": "string" }, - "integrator_taker_fee": { - "type": "integer", - "format": "int32", - "example": "50" + "auth": { + "type": "string", + "description": " made optional to support header auth clients" + } + }, + "title": "ReqFastwithdraw", + "required": [ + "tx_info", + "to_address" + ] + }, + "ReqPostApiToken": { + "type": "object", + "properties": { + "name": { + "type": "string" }, - "integrator_taker_fee_collector_index": { + "account_index": { "type": "integer", - "format": "int64", - "example": "156" + "format": "int64" }, - "taker_allocated_margin_usdc_before": { + "expiry": { "type": "integer", - "format": "int64", - "example": "1100000000000000" + "format": "int64" }, - "taker_allocated_margin_usdc_after": { - "type": "integer", - "format": "int64", - "example": "150000000000000" + "sub_account_access": { + "type": "boolean", + "format": "boolean" }, - "maker_allocated_margin_usdc_before": { + "scopes": { + "type": "string", + "example": "read.*", + "default": "read.*" + } + }, + "title": "ReqPostApiToken", + "required": [ + "name", + "account_index", + "expiry", + "sub_account_access" + ] + }, + "ReqRevokeApiToken": { + "type": "object", + "properties": { + "token_id": { "type": "integer", - "format": "int64", - "example": "210000000000000" + "format": "int64" }, - "maker_allocated_margin_usdc_after": { + "account_index": { "type": "integer", - "format": "int64", - "example": "250000000000000" + "format": "int64" } }, - "title": "Trade", + "title": "ReqRevokeApiToken", "required": [ - "trade_id", - "trade_id_str", - "tx_hash", - "type", - "market_id", - "size", - "price", - "usd_amount", - "ask_id", - "bid_id", - "ask_client_id", - "ask_client_id_str", - "bid_client_id", - "bid_client_id_str", - "ask_account_id", - "bid_account_id", - "is_maker_ask", - "block_height", - "timestamp", - "taker_position_size_before", - "taker_entry_quote_before", - "taker_initial_margin_fraction_before", - "taker_position_sign_changed", - "maker_position_size_before", - "maker_entry_quote_before", - "maker_initial_margin_fraction_before", - "maker_position_sign_changed", - "transaction_time", - "ask_account_pnl", - "bid_account_pnl", - "integrator_taker_fee", - "integrator_taker_fee_collector_index", - "integrator_maker_fee", - "integrator_maker_fee_collector_index", - "taker_allocated_margin_usdc_before", - "taker_allocated_margin_usdc_after", - "maker_allocated_margin_usdc_before", - "maker_allocated_margin_usdc_after" + "token_id", + "account_index" ] }, - "Trades": { + "RespGetApiTokens": { "type": "object", "properties": { "code": { @@ -8348,23 +9184,20 @@ "message": { "type": "string" }, - "next_cursor": { - "type": "string" - }, - "trades": { + "api_tokens": { "type": "array", "items": { - "$ref": "#/components/schemas/Trade" + "$ref": "#/components/schemas/ApiToken" } } }, - "title": "Trades", + "title": "RespGetApiTokens", "required": [ "code", - "trades" + "api_tokens" ] }, - "TransferFeeInfo": { + "RespGetFastwithdrawalInfo": { "type": "object", "properties": { "code": { @@ -8375,18 +9208,26 @@ "message": { "type": "string" }, - "transfer_fee_usdc": { + "to_account_index": { "type": "integer", "format": "int64" + }, + "withdraw_limit": { + "type": "string" + }, + "max_withdrawal_amount": { + "type": "string" } }, - "title": "TransferFeeInfo", + "title": "RespGetFastwithdrawalInfo", "required": [ "code", - "transfer_fee_usdc" + "to_account_index", + "withdraw_limit", + "max_withdrawal_amount" ] }, - "TransferHistory": { + "RespPostApiToken": { "type": "object", "properties": { "code": { @@ -8397,223 +9238,143 @@ "message": { "type": "string" }, - "transfers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransferHistoryItem" - } - }, - "cursor": { - "type": "string" - } - }, - "title": "TransferHistory", - "required": [ - "code", - "transfers", - "cursor" - ] - }, - "TransferHistoryItem": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "amount": { - "type": "string", - "example": "0.1" - }, - "timestamp": { + "token_id": { "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "type": { - "type": "string", - "enum": [ - "L2TransferInflow", - "L2TransferOutflow", - "L2BurnSharesInflow", - "L2BurnSharesOutflow", - "L2MintSharesInflow", - "L2MintSharesOutflow", - "L2SelfTransfer", - "L2StakeAssetInflow", - "L2StakeAssetOutflow", - "L2UnstakeAssetInflow", - "L2UnstakeAssetOutflow", - "L2ForceBurnSharesInflow", - "L2ForceBurnSharesOutflow" - ] - }, - "from_l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "format": "int64" }, - "to_l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "api_token": { + "type": "string" }, - "from_account_index": { - "type": "integer", - "format": "int64", - "example": "1" + "name": { + "type": "string" }, - "to_account_index": { + "account_index": { "type": "integer", - "format": "int64", - "example": "1" - }, - "tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "format": "int64" }, - "asset_id": { + "expiry": { "type": "integer", - "format": "int16" - }, - "fee": { - "type": "string" + "format": "int64" }, - "from_route": { - "type": "string", - "enum": [ - "spot", - "perps" - ] + "sub_account_access": { + "type": "boolean", + "format": "boolean" }, - "to_route": { - "type": "string", - "enum": [ - "spot", - "perps" - ] + "revoked": { + "type": "boolean", + "format": "boolean" + }, + "scopes": { + "type": "string" } }, - "title": "TransferHistoryItem", + "title": "RespPostApiToken", "required": [ - "id", - "amount", - "timestamp", - "type", - "from_l1_address", - "to_l1_address", - "from_account_index", - "to_account_index", - "tx_hash", - "asset_id", - "fee", - "from_route", - "to_route" + "code", + "token_id", + "api_token", + "name", + "account_index", + "expiry", + "sub_account_access", + "revoked", + "scopes" ] }, - "Tx": { + "RespRevokeApiToken": { "type": "object", "properties": { - "hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "type": { + "code": { "type": "integer", - "format": "uint8", - "example": "1", - "maximum": 64, - "minimum": 1 - }, - "info": { - "type": "string", - "example": "{}" - }, - "event_info": { - "type": "string", - "example": "{}" + "format": "int32", + "example": "200" }, - "status": { - "type": "integer", - "format": "int64", - "example": "1" + "message": { + "type": "string" }, - "transaction_index": { + "token_id": { "type": "integer", - "format": "int64", - "example": "8761" - }, - "l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "format": "int64" }, - "account_index": { + "revoked": { + "type": "boolean", + "format": "boolean" + } + }, + "title": "RespRevokeApiToken", + "required": [ + "code", + "token_id", + "revoked" + ] + }, + "ApiToken": { + "type": "object", + "properties": { + "token_id": { "type": "integer", - "format": "int64", - "example": "1" + "format": "int64" }, - "nonce": { - "type": "integer", - "format": "int64", - "example": "722" + "api_token": { + "type": "string" }, - "expire_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" + "name": { + "type": "string" }, - "block_height": { + "account_index": { "type": "integer", - "format": "int64", - "example": "45434" + "format": "int64" }, - "queued_at": { + "expiry": { "type": "integer", - "format": "int64", - "example": "1640995200" + "format": "int64" }, - "executed_at": { - "type": "integer", - "format": "int64", - "example": "1640995200" + "sub_account_access": { + "type": "boolean", + "format": "boolean" }, - "sequence_index": { - "type": "integer", - "format": "int64", - "example": "8761" + "revoked": { + "type": "boolean", + "format": "boolean" }, - "parent_hash": { + "scopes": { + "type": "string" + } + }, + "title": "ApiToken", + "required": [ + "token_id", + "api_token", + "name", + "account_index", + "expiry", + "sub_account_access", + "revoked", + "scopes" + ] + }, + "ReqUpdateReferralCode": { + "type": "object", + "properties": { + "auth": { "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "api_key_index": { - "type": "integer", - "format": "uint8" + "description": " made optional to support header auth clients" }, - "transaction_time": { + "account_index": { "type": "integer", "format": "int64" + }, + "new_referral_code": { + "type": "string" } }, - "title": "Tx", + "title": "ReqUpdateReferralCode", "required": [ - "hash", - "type", - "info", - "event_info", - "status", - "transaction_index", - "l1_address", "account_index", - "nonce", - "expire_at", - "block_height", - "queued_at", - "executed_at", - "sequence_index", - "parent_hash", - "api_key_index", - "transaction_time" + "new_referral_code" ] }, - "TxHash": { + "RespUpdateReferralCode": { "type": "object", "properties": { "code": { @@ -8624,18 +9385,19 @@ "message": { "type": "string" }, - "tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "success": { + "type": "boolean", + "format": "boolean", + "example": "true" } }, - "title": "TxHash", + "title": "RespUpdateReferralCode", "required": [ "code", - "tx_hash" + "success" ] }, - "Txs": { + "CreateIntentAddressResp": { "type": "object", "properties": { "code": { @@ -8646,39 +9408,74 @@ "message": { "type": "string" }, - "txs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Tx" - } + "intent_address": { + "type": "string" } }, - "title": "Txs", + "title": "CreateIntentAddressResp", "required": [ "code", - "txs" + "intent_address" ] }, - "ValidatorInfo": { + "ReqUseReferralCode": { "type": "object", "properties": { - "address": { + "auth": { "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "description": " made optional to support header auth clients" }, - "is_active": { - "type": "boolean", - "format": "boolean", - "example": "true" + "l1_address": { + "type": "string" + }, + "referral_code": { + "type": "string" + }, + "discord": { + "type": "string" + }, + "telegram": { + "type": "string" + }, + "x": { + "type": "string" + }, + "signature": { + "type": "string" + } + }, + "title": "ReqUseReferralCode", + "required": [ + "l1_address", + "referral_code", + "x" + ] + }, + "ReqCreateIntentAddress": { + "type": "object", + "properties": { + "chain_id": { + "type": "string" + }, + "from_addr": { + "type": "string" + }, + "amount": { + "type": "string" + }, + "is_external_deposit": { + "type": "boolean", + "format": "boolean" } }, - "title": "ValidatorInfo", + "title": "ReqCreateIntentAddress", "required": [ - "address", - "is_active" + "chain_id", + "from_addr", + "amount" ] }, - "WithdrawHistory": { + "BridgeSupportedNetworks": { "type": "object", "properties": { "code": { @@ -8689,159 +9486,255 @@ "message": { "type": "string" }, - "withdraws": { + "networks": { "type": "array", "items": { - "$ref": "#/components/schemas/WithdrawHistoryItem" + "$ref": "#/components/schemas/BridgeSupportedNetwork" } - }, - "cursor": { - "type": "string" } }, - "title": "WithdrawHistory", + "title": "BridgeSupportedNetworks", "required": [ "code", - "withdraws", - "cursor" + "networks" ] }, - "WithdrawHistoryItem": { + "ReferralCode": { "type": "object", "properties": { - "id": { - "type": "string" - }, - "amount": { - "type": "string", - "example": "0.1" - }, - "timestamp": { + "code": { "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "status": { - "type": "string", - "enum": [ - "failed", - "pending", - "claimable", - "refunded", - "completed" - ] + "format": "int32", + "example": "200" }, - "type": { - "type": "string", - "enum": [ - "secure", - "fast" - ] + "message": { + "type": "string" }, - "l1_tx_hash": { + "referral_code": { "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "example": "5V24K3MJ" }, - "asset_id": { + "remaining_usage": { "type": "integer", - "format": "int16" + "format": "int32", + "example": "3" } }, - "title": "WithdrawHistoryItem", + "title": "ReferralCode", "required": [ - "id", - "amount", - "timestamp", - "status", - "type", - "l1_tx_hash", - "asset_id" + "code", + "referral_code", + "remaining_usage" ] }, - "ZkLighterInfo": { + "ReqCreateReferralCode": { "type": "object", "properties": { - "contract_address": { + "auth": { "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" } }, - "title": "ZkLighterInfo", + "title": "ReqCreateReferralCode", "required": [ - "contract_address" + "account_index" ] }, - "ReqFastwithdraw": { + "ReqUpdateKickback": { "type": "object", "properties": { - "tx_info": { - "type": "string" - }, - "to_address": { - "type": "string" - }, "auth": { "type": "string", "description": " made optional to support header auth clients" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "kickback_percentage": { + "type": "number", + "format": "double", + "maximum": 100 } }, - "title": "ReqFastwithdraw", + "title": "ReqUpdateKickback", "required": [ - "tx_info", - "to_address" + "account_index", + "kickback_percentage" ] }, - "ReqPostApiToken": { + "Deposit": { "type": "object", "properties": { - "name": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { "type": "string" }, - "account_index": { + "source": { + "type": "string", + "example": "Arbitrum" + }, + "source_chain_id": { + "type": "string", + "example": "42161" + }, + "fast_bridge_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "batch_claim_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "cctp_burn_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" + }, + "amount": { + "type": "string" + }, + "intent_address": { + "type": "string" + }, + "status": { + "type": "string" + }, + "step": { + "type": "string" + }, + "description": { + "type": "string" + }, + "created_at": { "type": "integer", "format": "int64" }, - "expiry": { + "updated_at": { "type": "integer", "format": "int64" }, - "sub_account_access": { + "is_external_deposit": { "type": "boolean", "format": "boolean" }, - "scopes": { - "type": "string", - "example": "read.*", - "default": "read.*" + "is_next_bridge_fast": { + "type": "boolean", + "format": "boolean" } }, - "title": "ReqPostApiToken", + "title": "Deposit", "required": [ - "name", - "account_index", - "expiry", - "sub_account_access" + "code", + "source", + "source_chain_id", + "fast_bridge_tx_hash", + "batch_claim_tx_hash", + "cctp_burn_tx_hash", + "amount", + "intent_address", + "status", + "step", + "description", + "created_at", + "updated_at", + "is_external_deposit", + "is_next_bridge_fast" ] }, - "ReqRevokeApiToken": { + "RespUpdateKickback": { "type": "object", "properties": { - "token_id": { + "code": { "type": "integer", - "format": "int64" + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "success": { + "type": "boolean", + "format": "boolean", + "example": "true" + } + }, + "title": "RespUpdateKickback", + "required": [ + "code", + "success" + ] + }, + "Layer1BasicInfo": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { + "type": "string" + }, + "l1_providers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/L1ProviderInfo" + } + }, + "l1_providers_health": { + "type": "boolean", + "format": "boolean", + "example": "true" + }, + "validator_info": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ValidatorInfo" + } + }, + "contract_addresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContractAddress" + } + }, + "latest_l1_generic_block": { + "type": "integer", + "format": "int64", + "example": "45434" + }, + "latest_l1_governance_block": { + "type": "integer", + "format": "int64", + "example": "45434" }, - "account_index": { + "latest_l1_desert_block": { "type": "integer", - "format": "int64" + "format": "int64", + "example": "45434" } }, - "title": "ReqRevokeApiToken", + "title": "Layer1BasicInfo", "required": [ - "token_id", - "account_index" + "code", + "l1_providers", + "l1_providers_health", + "validator_info", + "contract_addresses", + "latest_l1_generic_block", + "latest_l1_governance_block", + "latest_l1_desert_block" ] }, - "RespGetApiTokens": { + "RespGetExchangeMetrics": { "type": "object", "properties": { "code": { @@ -8852,1220 +9745,1188 @@ "message": { "type": "string" }, - "api_tokens": { + "metrics": { "type": "array", "items": { - "$ref": "#/components/schemas/ApiToken" + "$ref": "#/components/schemas/ExchangeMetric" } } }, - "title": "RespGetApiTokens", + "title": "RespGetExchangeMetrics", "required": [ "code", - "api_tokens" + "metrics" ] }, - "RespGetFastwithdrawalInfo": { + "ExchangeMetric": { "type": "object", "properties": { - "code": { + "timestamp": { "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" + "format": "int64", + "example": "1640995200" }, - "to_account_index": { + "data": { + "type": "number", + "format": "double", + "example": "93566.25" + } + }, + "title": "ExchangeMetric", + "required": [ + "timestamp", + "data" + ] + }, + "ExecuteStat": { + "type": "object", + "properties": { + "timestamp": { "type": "integer", "format": "int64" }, - "withdraw_limit": { - "type": "string" - }, - "max_withdrawal_amount": { - "type": "string" + "slippage": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SlippageResult" + } } }, - "title": "RespGetFastwithdrawalInfo", "required": [ - "code", - "to_account_index", - "withdraw_limit", - "max_withdrawal_amount" + "timestamp", + "slippage" ] }, - "RespPostApiToken": { + "SlippageResult": { "type": "object", "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" + "exchange": { + "type": "string", + "example": "lighter" }, - "message": { - "type": "string" + "market": { + "type": "string", + "example": "ETH" }, - "token_id": { + "size_usd": { "type": "integer", - "format": "int64" - }, - "api_token": { - "type": "string" - }, - "name": { - "type": "string" + "format": "int64", + "example": "1000" }, - "account_index": { - "type": "integer", - "format": "int64" + "avg_slippage": { + "type": "number", + "format": "double", + "example": "0.5" }, - "expiry": { + "data_count": { "type": "integer", - "format": "int64" - }, - "sub_account_access": { - "type": "boolean", - "format": "boolean" - }, - "revoked": { - "type": "boolean", - "format": "boolean" - }, - "scopes": { - "type": "string" + "format": "int64", + "example": "100" } }, - "title": "RespPostApiToken", + "title": "SlippageResult", "required": [ - "code", - "token_id", - "api_token", - "name", - "account_index", - "expiry", - "sub_account_access", - "revoked", - "scopes" + "exchange", + "market", + "size_usd", + "avg_slippage", + "data_count" ] }, - "RespRevokeApiToken": { + "RespGetExecuteStats": { "type": "object", "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" + "period": { + "type": "string", + "enum": [ + "d", + "w", + "m", + "q", + "y", + "all" + ] }, - "token_id": { + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExecuteStat" + } + } + }, + "required": [ + "period", + "result" + ] + }, + "LeaseOptionEntry": { + "type": "object", + "properties": { + "duration_days": { "type": "integer", - "format": "int64" + "description": "Lease duration in days", + "format": "int32" }, - "revoked": { - "type": "boolean", - "format": "boolean" + "annual_rate": { + "type": "number", + "format": "double", + "description": "Annual rate as a percentage (e.g. 25.0 means 25%)" } }, - "title": "RespRevokeApiToken", "required": [ - "code", - "token_id", - "revoked" + "duration_days", + "annual_rate" ] }, - "ApiToken": { + "RespGetLeaseOptions": { "type": "object", "properties": { - "token_id": { + "code": { "type": "integer", - "format": "int64" - }, - "api_token": { - "type": "string" + "format": "int32" }, - "name": { + "message": { "type": "string" }, - "account_index": { - "type": "integer", - "format": "int64" + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LeaseOptionEntry" + } }, - "expiry": { + "lit_incentives_account_index": { "type": "integer", - "format": "int64" - }, - "sub_account_access": { - "type": "boolean", - "format": "boolean" - }, - "revoked": { - "type": "boolean", - "format": "boolean" - }, - "scopes": { - "type": "string" + "format": "int64", + "description": "Account index that receives the leasing fee" } }, - "title": "ApiToken", "required": [ - "token_id", - "api_token", - "name", - "account_index", - "expiry", - "sub_account_access", - "revoked", - "scopes" + "code", + "options", + "lit_incentives_account_index" ] }, - "ReqUpdateReferralCode": { + "LeaseEntry": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" + "id": { + "type": "integer", + "format": "int64", + "description": "Lease ID" + }, + "master_account_index": { + "type": "integer", + "format": "int64", + "description": "Master account index" + }, + "lease_amount": { + "type": "integer", + "format": "int64", + "description": "Leased LIT amount in raw units (1 LIT = 1e8)" }, - "account_index": { + "fee_amount": { "type": "integer", - "format": "int64" + "format": "int64", + "description": "Fee paid in raw units" }, - "new_referral_code": { - "type": "string" + "start": { + "type": "integer", + "format": "int64", + "description": "Lease start time (Unix milliseconds)" + }, + "end": { + "type": "integer", + "format": "int64", + "description": "Lease end time (Unix milliseconds)" + }, + "status": { + "type": "string", + "enum": [ + "waiting_fee", + "leased", + "expired", + "canceled" + ], + "description": "Lease status" + }, + "error": { + "type": "string", + "description": "Error message if lease was canceled" } }, - "title": "ReqUpdateReferralCode", "required": [ - "account_index", - "new_referral_code" + "end", + "error", + "fee_amount", + "id", + "lease_amount", + "master_account_index", + "start", + "status" ] }, - "RespUpdateReferralCode": { + "RespGetLeases": { "type": "object", "properties": { "code": { "type": "integer", - "format": "int32", - "example": "200" + "format": "int32" }, "message": { "type": "string" }, - "success": { - "type": "boolean", - "format": "boolean", - "example": "true" + "leases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LeaseEntry" + } + }, + "next_cursor": { + "type": "string", + "description": "Cursor to pass as the cursor param to fetch the next page. Absent if no more pages." } }, - "title": "RespUpdateReferralCode", "required": [ "code", - "success" + "leases" ] }, - "CreateIntentAddressResp": { + "ReqLITLease": { "type": "object", "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" + "tx_info": { + "type": "string", + "description": "Signed transaction info (JSON with L2 signature, L1 signature, etc.)" }, - "message": { - "type": "string" + "lease_amount": { + "type": "string", + "description": "Amount of LIT to lease in raw units (1 LIT = 100000000)" }, - "intent_address": { - "type": "string" + "duration_days": { + "type": "integer", + "description": "Lease duration in days. Must match one of the available lease options.", + "format": "int32" } }, - "title": "CreateIntentAddressResp", "required": [ - "code", - "intent_address" + "tx_info", + "lease_amount", + "duration_days" ] }, - "ReqUseReferralCode": { + "Referral": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, "l1_address": { "type": "string" }, "referral_code": { "type": "string" }, - "discord": { - "type": "string" - }, - "telegram": { - "type": "string" + "used_at": { + "type": "integer", + "format": "int64" }, - "x": { - "type": "string" + "trade_stats": { + "$ref": "#/components/schemas/TradeStats" }, - "signature": { + "tier": { "type": "string" } }, - "title": "ReqUseReferralCode", "required": [ + "trade_stats", "l1_address", "referral_code", - "x" + "tier", + "used_at" ] }, - "ReqCreateIntentAddress": { + "UserReferrals": { "type": "object", "properties": { - "chain_id": { - "type": "string" + "code": { + "type": "integer", + "format": "int32" }, - "from_addr": { + "message": { "type": "string" }, - "amount": { + "cursor": { "type": "string" }, - "is_external_deposit": { - "type": "boolean", - "format": "boolean" + "referrals": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Referral" + } + }, + "used_code": { + "type": "string" } }, - "title": "ReqCreateIntentAddress", "required": [ - "chain_id", - "from_addr", - "amount" + "code", + "cursor", + "referrals", + "used_code" ] }, - "BridgeSupportedNetworks": { + "ReqSetAccountMetadata": { "type": "object", "properties": { - "code": { + "master_account_index": { "type": "integer", - "format": "int32", - "example": "200" + "format": "int64" }, - "message": { + "target_account_index": { + "type": "integer", + "format": "int64" + }, + "api_key_index": { + "type": "integer", + "format": "uint8" + }, + "metadata": { "type": "string" }, - "networks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BridgeSupportedNetwork" - } + "auth": { + "type": "string" } }, - "title": "BridgeSupportedNetworks", "required": [ - "code", - "networks" + "master_account_index", + "target_account_index", + "api_key_index", + "metadata" ] }, - "ReferralCode": { + "SystemConfig": { "type": "object", "properties": { "code": { "type": "integer", - "format": "int32", - "example": "200" + "format": "int32" }, "message": { "type": "string" }, - "referral_code": { - "type": "string", - "example": "5V24K3MJ" + "liquidity_pool_index": { + "type": "integer", + "format": "int64" }, - "remaining_usage": { + "staking_pool_index": { "type": "integer", - "format": "int32", + "format": "int64" + }, + "funding_fee_rebate_account_index": { + "type": "integer", + "format": "int64" + }, + "liquidity_pool_cooldown_period": { + "type": "integer", + "format": "int64" + }, + "staking_pool_lockup_period": { + "type": "integer", + "format": "int64" + }, + "max_integrator_perps_maker_fee": { + "type": "integer", + "format": "int32" + }, + "max_integrator_perps_taker_fee": { + "type": "integer", + "format": "int32" + }, + "max_integrator_spot_maker_fee": { + "type": "integer", + "format": "int32" + }, + "max_integrator_spot_taker_fee": { + "type": "integer", + "format": "int32" + }, + "market_maker_incentive_account_index": { + "type": "integer", + "format": "int64", "example": "3" } }, - "title": "ReferralCode", "required": [ + "max_integrator_perps_maker_fee", + "max_integrator_perps_taker_fee", + "max_integrator_spot_maker_fee", + "max_integrator_spot_taker_fee", "code", - "referral_code", - "remaining_usage" + "funding_fee_rebate_account_index", + "liquidity_pool_cooldown_period", + "liquidity_pool_index", + "staking_pool_index", + "staking_pool_lockup_period", + "market_maker_incentive_account_index" ] }, - "ReqCreateReferralCode": { + "PendingUnlock": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { + "unlock_timestamp": { "type": "integer", "format": "int64" + }, + "asset_index": { + "type": "integer", + "format": "int16" + }, + "amount": { + "type": "string" } }, - "title": "ReqCreateReferralCode", "required": [ - "account_index" + "unlock_timestamp", + "asset_index", + "amount" ] }, - "ReqUpdateKickback": { + "Strategy": { "type": "object", "properties": { - "auth": { - "type": "string", - "description": " made optional to support header auth clients" - }, - "account_index": { - "type": "integer", - "format": "int64" - }, - "kickback_percentage": { - "type": "number", - "format": "double", - "maximum": 100 + "collateral": { + "type": "string" } }, - "title": "ReqUpdateKickback", "required": [ - "account_index", - "kickback_percentage" + "collateral" ] }, - "Deposit": { + "TradeStats": { "type": "object", "properties": { - "code": { + "count": { "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "source": { - "type": "string", - "example": "Arbitrum" - }, - "source_chain_id": { - "type": "string", - "example": "42161" - }, - "fast_bridge_tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "batch_claim_tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "cctp_burn_tx_hash": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "amount": { - "type": "string" - }, - "intent_address": { - "type": "string" + "format": "int64" }, - "status": { + "volume": { "type": "string" }, - "step": { - "type": "string" + "web_count": { + "type": "integer", + "format": "int64" }, - "description": { + "web_volume": { "type": "string" }, - "created_at": { + "mobile_app_count": { "type": "integer", "format": "int64" }, - "updated_at": { + "mobile_app_volume": { + "type": "string" + }, + "mobile_browser_count": { "type": "integer", "format": "int64" }, - "is_external_deposit": { - "type": "boolean", - "format": "boolean" - }, - "is_next_bridge_fast": { - "type": "boolean", - "format": "boolean" + "mobile_browser_volume": { + "type": "string" } }, - "title": "Deposit", + "title": "TradeStats", "required": [ - "code", - "source", - "source_chain_id", - "fast_bridge_tx_hash", - "batch_claim_tx_hash", - "cctp_burn_tx_hash", - "amount", - "intent_address", - "status", - "step", - "description", - "created_at", - "updated_at", - "is_external_deposit", - "is_next_bridge_fast" + "count", + "volume", + "web_count", + "web_volume", + "mobile_app_count", + "mobile_app_volume", + "mobile_browser_count", + "mobile_browser_volume" ] }, - "RespUpdateKickback": { + "ApprovedIntegrator": { "type": "object", "properties": { - "code": { + "account_index": { + "type": "integer", + "format": "int64", + "example": "54621" + }, + "name": { + "type": "string", + "example": "Integrator1" + }, + "max_perps_taker_fee": { "type": "integer", "format": "int32", - "example": "200" + "example": "10" }, - "message": { - "type": "string" + "max_perps_maker_fee": { + "type": "integer", + "format": "int32", + "example": "1" }, - "success": { - "type": "boolean", - "format": "boolean", - "example": "true" + "max_spot_taker_fee": { + "type": "integer", + "format": "int32", + "example": "10" + }, + "max_spot_maker_fee": { + "type": "integer", + "format": "int32", + "example": "1" + }, + "approval_expiry": { + "type": "integer", + "format": "int64", + "example": "1640995200", + "description": " Timestamp in milliseconds, after which the integrator is no longer approved" } }, - "title": "RespUpdateKickback", + "title": "ApprovedIntegrator", "required": [ - "code", - "success" + "account_index", + "name", + "max_perps_taker_fee", + "max_perps_maker_fee", + "max_spot_taker_fee", + "max_spot_maker_fee", + "approval_expiry" ] }, - "Layer1BasicInfo": { + "Token": { "type": "object", + "title": "Token", + "required": [ + "symbol", + "name", + "logo", + "logo_extension", + "description_key", + "gecko_id", + "paprika_id", + "market", + "asset_type", + "categories", + "is_allowed_mainnet", + "is_asset_allowed_mainnet" + ], "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" + "symbol": { + "type": "string", + "example": "ETH" }, - "message": { - "type": "string" + "name": { + "type": "string", + "example": "Ethereum" }, - "l1_providers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/L1ProviderInfo" - } + "logo": { + "type": "string", + "example": "eth" }, - "l1_providers_health": { - "type": "boolean", - "format": "boolean", - "example": "true" + "logo_extension": { + "type": "string", + "example": "svg", + "enum": [ + "svg", + "png" + ] }, - "validator_info": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ValidatorInfo" - } + "description_key": { + "type": "string", + "example": "token_description_eth" }, - "contract_addresses": { + "gecko_id": { + "type": "string", + "example": "ethereum" + }, + "paprika_id": { + "type": "string", + "example": "eth-ethereum" + }, + "market": { + "type": "string", + "enum": [ + "SPOT", + "PERPS" + ] + }, + "asset_type": { + "type": "string", + "enum": [ + "CRYPTO", + "RWA" + ] + }, + "categories": { "type": "array", "items": { - "$ref": "#/components/schemas/ContractAddress" + "type": "string" } }, - "latest_l1_generic_block": { - "type": "integer", - "format": "int64", - "example": "45434" - }, - "latest_l1_governance_block": { - "type": "integer", - "format": "int64", - "example": "45434" + "is_allowed_mainnet": { + "type": "boolean", + "format": "boolean" }, - "latest_l1_desert_block": { - "type": "integer", - "format": "int64", - "example": "45434" + "is_asset_allowed_mainnet": { + "type": "boolean", + "format": "boolean" } - }, - "title": "Layer1BasicInfo", - "required": [ - "code", - "l1_providers", - "l1_providers_health", - "validator_info", - "contract_addresses", - "latest_l1_generic_block", - "latest_l1_governance_block", - "latest_l1_desert_block" - ] + } }, - "RespGetExchangeMetrics": { + "TokenList": { "type": "object", + "title": "TokenList", + "required": [ + "code", + "tokens" + ], "properties": { "code": { "type": "integer", "format": "int32", - "example": "200" + "example": 200 }, "message": { "type": "string" }, - "metrics": { + "tokens": { "type": "array", "items": { - "$ref": "#/components/schemas/ExchangeMetric" + "$ref": "#/components/schemas/Token" } } - }, - "title": "RespGetExchangeMetrics", - "required": [ - "code", - "metrics" - ] + } }, - "ExchangeMetric": { + "PartnerStats": { "type": "object", "properties": { - "timestamp": { + "code": { "type": "integer", - "format": "int64", - "example": "1640995200" + "format": "int32", + "example": "200" }, - "data": { - "type": "number", - "format": "double", - "example": "93566.25" - } - }, - "title": "ExchangeMetric", - "required": [ - "timestamp", - "data" - ] - }, - "ExecuteStat": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64" + "message": { + "type": "string" }, - "slippage": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SlippageResult" - } - } - }, - "required": [ - "timestamp", - "slippage" - ] - }, - "SlippageResult": { - "type": "object", - "properties": { - "exchange": { - "type": "string", - "example": "lighter" + "total_fees_earned": { + "type": "string" }, - "market": { - "type": "string", - "example": "ETH" + "total_taker_fees_earned": { + "type": "string" }, - "size_usd": { - "type": "integer", - "format": "int64", - "example": "1000" + "total_maker_fees_earned": { + "type": "string" }, - "avg_slippage": { - "type": "number", - "format": "double", - "example": "0.5" + "total_volume": { + "type": "string" }, - "data_count": { + "total_taker_volume": { + "type": "string" + }, + "total_maker_volume": { + "type": "string" + }, + "total_trades": { "type": "integer", - "format": "int64", - "example": "100" - } - }, - "title": "SlippageResult", - "required": [ - "exchange", - "market", - "size_usd", - "avg_slippage", - "data_count" - ] - }, - "RespGetExecuteStats": { - "type": "object", - "properties": { - "period": { - "type": "string", - "enum": [ - "d", - "w", - "m", - "q", - "y", - "all" - ] + "format": "int64" }, - "result": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ExecuteStat" - } - } - }, - "required": [ - "period", - "result" - ] - }, - "LeaseOptionEntry": { - "type": "object", - "properties": { - "duration_days": { + "total_taker_trades": { "type": "integer", - "description": "Lease duration in days", - "format": "int32" + "format": "int64" }, - "annual_rate": { - "type": "number", - "format": "double", - "description": "Annual rate as a percentage (e.g. 25.0 means 25%)" + "total_maker_trades": { + "type": "integer", + "format": "int64" + }, + "unique_clients": { + "type": "integer", + "format": "int64" } }, + "title": "PartnerStats", "required": [ - "duration_days", - "annual_rate" + "code", + "total_fees_earned", + "total_taker_fees_earned", + "total_maker_fees_earned", + "total_volume", + "total_taker_volume", + "total_maker_volume", + "total_trades", + "total_taker_trades", + "total_maker_trades", + "unique_clients" ] }, - "RespGetLeaseOptions": { + "RespSyntheticSpotInfo": { "type": "object", "properties": { "code": { "type": "integer", - "format": "int32" + "format": "int32", + "example": "200" }, "message": { "type": "string" }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LeaseOptionEntry" - } + "bps_per_day": { + "type": "number", + "format": "double" }, - "lit_incentives_account_index": { + "expiry_time_ms": { "type": "integer", - "format": "int64", - "description": "Account index that receives the leasing fee" + "format": "int64" + }, + "spot_close_ms": { + "type": "integer", + "format": "int64" + }, + "source": { + "type": "string" + }, + "symbol": { + "type": "string" } }, + "title": "RespSyntheticSpotInfo", "required": [ "code", - "options", - "lit_incentives_account_index" + "bps_per_day", + "expiry_time_ms", + "spot_close_ms", + "source", + "symbol" ] }, - "LeaseEntry": { + "ReqRespondToRFQ": { "type": "object", "properties": { - "id": { - "type": "integer", - "format": "int64", - "description": "Lease ID" - }, - "master_account_index": { - "type": "integer", - "format": "int64", - "description": "Master account index" - }, - "lease_amount": { - "type": "integer", - "format": "int64", - "description": "Leased LIT amount in raw units (1 LIT = 1e8)" - }, - "fee_amount": { - "type": "integer", - "format": "int64", - "description": "Fee paid in raw units" - }, - "start": { - "type": "integer", - "format": "int64", - "description": "Lease start time (Unix milliseconds)" - }, - "end": { + "rfq_id": { "type": "integer", - "format": "int64", - "description": "Lease end time (Unix milliseconds)" + "format": "int64" }, "status": { "type": "string", - "enum": [ - "waiting_fee", - "leased", - "expired", - "canceled" - ], - "description": "Lease status" - }, - "error": { - "type": "string", - "description": "Error message if lease was canceled" - } - }, - "required": [ - "end", - "error", - "fee_amount", - "id", - "lease_amount", - "master_account_index", - "start", + "enum": [ + "acknowledged", + "liquidity_provided", + "not_interested" + ] + } + }, + "title": "ReqRespondToRFQ", + "required": [ + "rfq_id", "status" ] }, - "RespGetLeases": { + "RespRespondToRFQ": { "type": "object", "properties": { "code": { "type": "integer", - "format": "int32" + "format": "int32", + "example": "200" }, "message": { "type": "string" }, - "leases": { + "id": { + "type": "integer", + "format": "int64" + }, + "account_index": { + "type": "integer", + "format": "int64" + }, + "market_index": { + "type": "integer", + "format": "int16" + }, + "direction": { + "type": "integer", + "format": "int16" + }, + "base_amount": { + "type": "string" + }, + "quote_amount": { + "type": "string" + }, + "status": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/RFQMetadata" + }, + "responses": { "type": "array", "items": { - "$ref": "#/components/schemas/LeaseEntry" + "$ref": "#/components/schemas/RFQResponseEntry" } }, - "next_cursor": { - "type": "string", - "description": "Cursor to pass as the cursor param to fetch the next page. Absent if no more pages." + "created_at": { + "type": "integer", + "format": "int64" + }, + "updated_at": { + "type": "integer", + "format": "int64" } }, + "title": "RespRespondToRFQ", "required": [ "code", - "leases" + "id", + "account_index", + "market_index", + "direction", + "base_amount", + "quote_amount", + "status", + "metadata", + "responses", + "created_at", + "updated_at" ] }, - "ReqLITLease": { + "RFQMetadata": { "type": "object", "properties": { - "tx_info": { - "type": "string", - "description": "Signed transaction info (JSON with L2 signature, L1 signature, etc.)" + "requested_est_price": { + "type": "string" }, - "lease_amount": { - "type": "string", - "description": "Amount of LIT to lease in raw units (1 LIT = 100000000)" + "requested_max_slippage": { + "type": "string" }, - "duration_days": { - "type": "integer", - "description": "Lease duration in days. Must match one of the available lease options.", - "format": "int32" + "requested_slippage": { + "type": "string" + }, + "worst_price": { + "type": "string" } }, + "title": "RFQMetadata", "required": [ - "tx_info", - "lease_amount", - "duration_days" + "requested_est_price", + "requested_max_slippage", + "requested_slippage", + "worst_price" ] }, - "Referral": { + "RFQResponseEntry": { "type": "object", "properties": { - "l1_address": { - "type": "string" + "account_index": { + "type": "integer", + "format": "int64" }, - "referral_code": { - "type": "string" + "status": { + "type": "string", + "enum": [ + "acknowledged", + "liquidity_provided", + "not_interested" + ] }, - "used_at": { + "responded_at": { "type": "integer", "format": "int64" }, - "trade_stats": { - "$ref": "#/components/schemas/TradeStats" - }, - "tier": { - "type": "string" + "updated_at": { + "type": "integer", + "format": "int64" } }, + "title": "RFQResponseEntry", "required": [ - "trade_stats", - "l1_address", - "referral_code", - "tier", - "used_at" + "account_index", + "status", + "responded_at", + "updated_at" ] }, - "UserReferrals": { + "RespListRFQs": { "type": "object", "properties": { "code": { "type": "integer", - "format": "int32" + "format": "int32", + "example": "200" }, "message": { "type": "string" }, - "cursor": { - "type": "string" - }, - "referrals": { + "rfqs": { "type": "array", "items": { - "$ref": "#/components/schemas/Referral" + "$ref": "#/components/schemas/RFQEntry" } }, - "used_code": { + "next_cursor": { "type": "string" } }, + "title": "RespListRFQs", "required": [ "code", - "cursor", - "referrals", - "used_code" + "rfqs" ] }, - "ReqSetAccountMetadata": { + "RFQEntry": { "type": "object", "properties": { - "master_account_index": { + "id": { "type": "integer", "format": "int64" }, - "target_account_index": { + "account_index": { "type": "integer", "format": "int64" }, - "api_key_index": { + "market_index": { "type": "integer", - "format": "uint8" + "format": "int16" }, - "metadata": { + "direction": { + "type": "integer", + "format": "int16" + }, + "base_amount": { "type": "string" }, - "auth": { + "quote_amount": { "type": "string" + }, + "status": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/RFQMetadata" + }, + "responses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RFQResponseEntry" + } + }, + "created_at": { + "type": "integer", + "format": "int64" + }, + "updated_at": { + "type": "integer", + "format": "int64" } }, + "title": "RFQEntry", "required": [ - "master_account_index", - "target_account_index", - "api_key_index", - "metadata" + "id", + "account_index", + "market_index", + "direction", + "base_amount", + "quote_amount", + "status", + "metadata", + "responses", + "created_at", + "updated_at" ] }, - "SystemConfig": { + "RespGetRFQ": { "type": "object", "properties": { "code": { "type": "integer", - "format": "int32" + "format": "int32", + "example": "200" }, "message": { "type": "string" }, - "liquidity_pool_index": { - "type": "integer", - "format": "int64" - }, - "staking_pool_index": { - "type": "integer", - "format": "int64" - }, - "funding_fee_rebate_account_index": { - "type": "integer", - "format": "int64" - }, - "liquidity_pool_cooldown_period": { + "id": { "type": "integer", "format": "int64" }, - "staking_pool_lockup_period": { + "account_index": { "type": "integer", "format": "int64" }, - "max_integrator_perps_maker_fee": { - "type": "integer", - "format": "int32" - }, - "max_integrator_perps_taker_fee": { - "type": "integer", - "format": "int32" - }, - "max_integrator_spot_maker_fee": { - "type": "integer", - "format": "int32" - }, - "max_integrator_spot_taker_fee": { - "type": "integer", - "format": "int32" - }, - "market_maker_incentive_account_index": { - "type": "integer", - "format": "int64", - "example": "3" - } - }, - "required": [ - "max_integrator_perps_maker_fee", - "max_integrator_perps_taker_fee", - "max_integrator_spot_maker_fee", - "max_integrator_spot_taker_fee", - "code", - "funding_fee_rebate_account_index", - "liquidity_pool_cooldown_period", - "liquidity_pool_index", - "staking_pool_index", - "staking_pool_lockup_period", - "market_maker_incentive_account_index" - ] - }, - "PendingUnlock": { - "type": "object", - "properties": { - "unlock_timestamp": { + "market_index": { "type": "integer", - "format": "int64" + "format": "int16" }, - "asset_index": { + "direction": { "type": "integer", "format": "int16" }, - "amount": { + "base_amount": { "type": "string" - } - }, - "required": [ - "unlock_timestamp", - "asset_index", - "amount" - ] - }, - "Strategy": { - "type": "object", - "properties": { - "collateral": { + }, + "quote_amount": { "type": "string" - } - }, - "required": [ - "collateral" - ] - }, - "TradeStats": { - "type": "object", - "properties": { - "count": { - "type": "integer", - "format": "int64" }, - "volume": { + "status": { "type": "string" }, - "web_count": { - "type": "integer", - "format": "int64" + "metadata": { + "$ref": "#/components/schemas/RFQMetadata" }, - "web_volume": { - "type": "string" + "responses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RFQResponseEntry" + } }, - "mobile_app_count": { + "created_at": { "type": "integer", "format": "int64" }, - "mobile_app_volume": { - "type": "string" - }, - "mobile_browser_count": { + "updated_at": { "type": "integer", "format": "int64" - }, - "mobile_browser_volume": { - "type": "string" } }, - "title": "TradeStats", + "title": "RespGetRFQ", "required": [ - "count", - "volume", - "web_count", - "web_volume", - "mobile_app_count", - "mobile_app_volume", - "mobile_browser_count", - "mobile_browser_volume" + "code", + "id", + "account_index", + "market_index", + "direction", + "base_amount", + "quote_amount", + "status", + "metadata", + "responses", + "created_at", + "updated_at" ] }, - "ApprovedIntegrator": { + "ReqCreateRFQ": { "type": "object", "properties": { - "account_index": { - "type": "integer", - "format": "int64", - "example": "54621" - }, - "name": { - "type": "string", - "example": "Integrator1" - }, - "max_perps_taker_fee": { + "market_index": { "type": "integer", - "format": "int32", - "example": "10" + "format": "int16" }, - "max_perps_maker_fee": { - "type": "integer", - "format": "int32", - "example": "1" + "base_amount": { + "type": "string" }, - "max_spot_taker_fee": { - "type": "integer", - "format": "int32", - "example": "10" + "quote_amount": { + "type": "string" }, - "max_spot_maker_fee": { + "direction": { "type": "integer", - "format": "int32", - "example": "1" + "format": "int16", + "enum": [ + "0", + "1" + ] }, - "approval_expiry": { - "type": "integer", - "format": "int64", - "example": "1640995200", - "description": " Timestamp in milliseconds, after which the integrator is no longer approved" + "metadata": { + "type": "string" } }, - "title": "ApprovedIntegrator", + "title": "ReqCreateRFQ", "required": [ - "account_index", - "name", - "max_perps_taker_fee", - "max_perps_maker_fee", - "max_spot_taker_fee", - "max_spot_maker_fee", - "approval_expiry" + "market_index", + "direction" ] }, - "Token": { + "RespCreateRFQ": { "type": "object", - "title": "Token", - "required": [ - "symbol", - "name", - "logo", - "logo_extension", - "description_key", - "gecko_id", - "paprika_id", - "market", - "asset_type", - "categories", - "is_allowed_mainnet", - "is_asset_allowed_mainnet" - ], "properties": { - "symbol": { - "type": "string", - "example": "ETH" + "code": { + "type": "integer", + "format": "int32", + "example": "200" }, - "name": { - "type": "string", - "example": "Ethereum" + "message": { + "type": "string" }, - "logo": { - "type": "string", - "example": "eth" + "id": { + "type": "integer", + "format": "int64" }, - "logo_extension": { - "type": "string", - "example": "svg", - "enum": [ - "svg", - "png" - ] + "account_index": { + "type": "integer", + "format": "int64" }, - "description_key": { - "type": "string", - "example": "token_description_eth" + "market_index": { + "type": "integer", + "format": "int16" }, - "gecko_id": { - "type": "string", - "example": "ethereum" + "direction": { + "type": "integer", + "format": "int16" }, - "paprika_id": { - "type": "string", - "example": "eth-ethereum" + "base_amount": { + "type": "string" }, - "market": { - "type": "string", - "enum": [ - "SPOT", - "PERPS" - ] + "quote_amount": { + "type": "string" }, - "asset_type": { - "type": "string", - "enum": [ - "CRYPTO", - "RWA" - ] + "status": { + "type": "string" }, - "categories": { + "metadata": { + "$ref": "#/components/schemas/RFQMetadata" + }, + "responses": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/RFQResponseEntry" } }, - "is_allowed_mainnet": { - "type": "boolean", - "format": "boolean" + "created_at": { + "type": "integer", + "format": "int64" }, - "is_asset_allowed_mainnet": { - "type": "boolean", - "format": "boolean" + "updated_at": { + "type": "integer", + "format": "int64" } - } - }, - "TokenList": { - "type": "object", - "title": "TokenList", + }, + "title": "RespCreateRFQ", "required": [ "code", - "tokens" - ], + "id", + "account_index", + "market_index", + "direction", + "base_amount", + "quote_amount", + "status", + "metadata", + "responses", + "created_at", + "updated_at" + ] + }, + "ReqUpdateRFQ": { + "type": "object", "properties": { - "code": { + "rfq_id": { "type": "integer", - "format": "int32", - "example": 200 - }, - "message": { - "type": "string" + "format": "int64" }, - "tokens": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Token" - } + "status": { + "type": "string", + "enum": [ + "order_created", + "closed" + ] } - } + }, + "title": "ReqUpdateRFQ", + "required": [ + "rfq_id", + "status" + ] }, - "PartnerStats": { + "RespUpdateRFQ": { "type": "object", "properties": { "code": { @@ -10076,54 +10937,63 @@ "message": { "type": "string" }, - "total_fees_earned": { - "type": "string" + "id": { + "type": "integer", + "format": "int64" }, - "total_taker_fees_earned": { - "type": "string" + "account_index": { + "type": "integer", + "format": "int64" }, - "total_maker_fees_earned": { - "type": "string" + "market_index": { + "type": "integer", + "format": "int16" }, - "total_volume": { + "direction": { + "type": "integer", + "format": "int16" + }, + "base_amount": { "type": "string" }, - "total_taker_volume": { + "quote_amount": { "type": "string" }, - "total_maker_volume": { + "status": { "type": "string" }, - "total_trades": { - "type": "integer", - "format": "int64" + "metadata": { + "$ref": "#/components/schemas/RFQMetadata" }, - "total_taker_trades": { - "type": "integer", - "format": "int64" + "responses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RFQResponseEntry" + } }, - "total_maker_trades": { + "created_at": { "type": "integer", "format": "int64" }, - "unique_clients": { + "updated_at": { "type": "integer", "format": "int64" } }, - "title": "PartnerStats", + "title": "RespUpdateRFQ", "required": [ "code", - "total_fees_earned", - "total_taker_fees_earned", - "total_maker_fees_earned", - "total_volume", - "total_taker_volume", - "total_maker_volume", - "total_trades", - "total_taker_trades", - "total_maker_trades", - "unique_clients" + "id", + "account_index", + "market_index", + "direction", + "base_amount", + "quote_amount", + "status", + "metadata", + "responses", + "created_at", + "updated_at" ] } }