diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index f580ffb5..c6096e1d 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -42,8 +42,8 @@ jobs: - name: Install dependencies run: | poetry config virtualenvs.in-project true - make install - poetry install --extras dev + poetry install -n + poetry run pip install -e ".[dev]" - name: Lint run: | diff --git a/.github/workflows/version-consistency.yml b/.github/workflows/version-consistency.yml index 6ca3148c..36a4280d 100644 --- a/.github/workflows/version-consistency.yml +++ b/.github/workflows/version-consistency.yml @@ -222,9 +222,13 @@ jobs: git config --local user.email "${{ env.CI_COMMIT_EMAIL }}" git config --local user.name "${{ env.CI_COMMIT_AUTHOR }}" git add pyproject.toml - git commit -m "chore: bump SDK version to $NEW_VERSION" - git push origin HEAD:${{ github.head_ref }} - echo "✅ Committed and pushed version bump to $NEW_VERSION" + if git diff --cached --quiet; then + echo "✅ Version already at $NEW_VERSION, nothing to commit" + else + git commit -m "chore: bump SDK version to $NEW_VERSION" + git push origin HEAD:${{ github.head_ref }} + echo "✅ Committed and pushed version bump to $NEW_VERSION" + fi - name: Validate version progression (for manual changes) if: github.event_name == 'pull_request' && env.VERSION_MANUALLY_MODIFIED == 'true' diff --git a/pyproject.toml b/pyproject.toml index 1e275118..3b935d12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "reya-python-sdk" -version = "2.1.3.5" +version = "2.1.4.0" description = "SDK for interacting with Reya Labs APIs" authors = [ {name = "Reya Labs"} diff --git a/scripts/generate-api.sh b/scripts/generate-api.sh index 6617e7c3..1ce4cc99 100755 --- a/scripts/generate-api.sh +++ b/scripts/generate-api.sh @@ -15,6 +15,14 @@ NC='\033[0m' # No Color echo -e "${GREEN}🚀 Generating Python SDK from OpenAPI specifications...${NC}" +# Read package version from pyproject.toml +PACKAGE_VERSION=$(grep -m1 '^version' "$ROOT_DIR/pyproject.toml" | sed 's/version = "\(.*\)"/\1/') +if [ -z "$PACKAGE_VERSION" ]; then + echo -e "${RED}❌ Could not read version from pyproject.toml${NC}" + exit 1 +fi +echo -e "${GREEN}📦 Using package version: $PACKAGE_VERSION${NC}" + # Check if OpenAPI Generator CLI is installed if ! command -v openapi-generator-cli &> /dev/null; then echo -e "${YELLOW}⚠️ OpenAPI Generator CLI not found. Installing...${NC}" @@ -38,7 +46,7 @@ if [ -d "$PYTHON_SDK_REPO" ]; then -o "$PYTHON_SDK_REPO" \ --skip-operation-example \ --global-property=models,apis,modelDocs=false,modelTests=false,apiDocs=false,apiTests=false,supportingFiles=__init__.py:api_client.py:configuration.py:api_response.py:exceptions.py:rest.py \ - --additional-properties=library=asyncio,packageName=sdk.open_api,projectName=open-api,packageVersion=2.0.0,packageUrl=https://github.com/reya-network/reya-python-sdk + --additional-properties=library=asyncio,packageName=sdk.open_api,projectName=open-api,packageVersion=$PACKAGE_VERSION,packageUrl=https://github.com/reya-network/reya-python-sdk if [ $? -ne 0 ]; then diff --git a/sdk/open_api/__init__.py b/sdk/open_api/__init__.py index 0700cf89..b3e943ee 100644 --- a/sdk/open_api/__init__.py +++ b/sdk/open_api/__init__.py @@ -7,14 +7,14 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 -__version__ = "2.0.0" +__version__ = "2.1.4.0" # Define package exports __all__ = [ diff --git a/sdk/open_api/api/market_data_api.py b/sdk/open_api/api/market_data_api.py index 9043fc31..98e25758 100644 --- a/sdk/open_api/api/market_data_api.py +++ b/sdk/open_api/api/market_data_api.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/api/order_entry_api.py b/sdk/open_api/api/order_entry_api.py index 8d89171f..363c2403 100644 --- a/sdk/open_api/api/order_entry_api.py +++ b/sdk/open_api/api/order_entry_api.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/api/reference_data_api.py b/sdk/open_api/api/reference_data_api.py index 67a91075..cc4a859a 100644 --- a/sdk/open_api/api/reference_data_api.py +++ b/sdk/open_api/api/reference_data_api.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/api/specs_api.py b/sdk/open_api/api/specs_api.py index c73966c8..f9534464 100644 --- a/sdk/open_api/api/specs_api.py +++ b/sdk/open_api/api/specs_api.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/api/wallet_data_api.py b/sdk/open_api/api/wallet_data_api.py index 9b1176d2..245f00e8 100644 --- a/sdk/open_api/api/wallet_data_api.py +++ b/sdk/open_api/api/wallet_data_api.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/api_client.py b/sdk/open_api/api_client.py index a0acfb69..f84f385d 100644 --- a/sdk/open_api/api_client.py +++ b/sdk/open_api/api_client.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/2.0.0/python' + self.user_agent = 'OpenAPI-Generator/2.1.4.0/python' self.client_side_validation = configuration.client_side_validation async def __aenter__(self): diff --git a/sdk/open_api/configuration.py b/sdk/open_api/configuration.py index ea7c7709..60bdb6eb 100644 --- a/sdk/open_api/configuration.py +++ b/sdk/open_api/configuration.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -496,8 +496,8 @@ def to_debug_report(self) -> str: return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 2.1.3\n"\ - "SDK Package Version: 2.0.0".\ + "Version of the API: 2.1.4\n"\ + "SDK Package Version: 2.1.4.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/sdk/open_api/exceptions.py b/sdk/open_api/exceptions.py index 05d1e7a7..7bac3088 100644 --- a/sdk/open_api/exceptions.py +++ b/sdk/open_api/exceptions.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/__init__.py b/sdk/open_api/models/__init__.py index bc8bdeb6..b67ebec0 100644 --- a/sdk/open_api/models/__init__.py +++ b/sdk/open_api/models/__init__.py @@ -6,7 +6,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/account.py b/sdk/open_api/models/account.py index 99ab0e12..1f954856 100644 --- a/sdk/open_api/models/account.py +++ b/sdk/open_api/models/account.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/account_balance.py b/sdk/open_api/models/account_balance.py index 6d5494d4..b23eb7e6 100644 --- a/sdk/open_api/models/account_balance.py +++ b/sdk/open_api/models/account_balance.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -44,15 +44,15 @@ def asset_validate_regular_expression(cls, value): @field_validator('real_balance') def real_balance_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^\d+(\.\d+)?([eE][+-]?\d+)?$", value): - raise ValueError(r"must validate the regular expression /^\d+(\.\d+)?([eE][+-]?\d+)?$/") + if not re.match(r"^-?\d+(\.\d+)?([eE][+-]?\d+)?$", value): + raise ValueError(r"must validate the regular expression /^-?\d+(\.\d+)?([eE][+-]?\d+)?$/") return value @field_validator('balance_deprecated') def balance_deprecated_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^\d+(\.\d+)?([eE][+-]?\d+)?$", value): - raise ValueError(r"must validate the regular expression /^\d+(\.\d+)?([eE][+-]?\d+)?$/") + if not re.match(r"^-?\d+(\.\d+)?([eE][+-]?\d+)?$", value): + raise ValueError(r"must validate the regular expression /^-?\d+(\.\d+)?([eE][+-]?\d+)?$/") return value model_config = ConfigDict( diff --git a/sdk/open_api/models/account_type.py b/sdk/open_api/models/account_type.py index fcb46728..2bcefd5f 100644 --- a/sdk/open_api/models/account_type.py +++ b/sdk/open_api/models/account_type.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/asset_definition.py b/sdk/open_api/models/asset_definition.py index 56f6e3c5..065df50c 100644 --- a/sdk/open_api/models/asset_definition.py +++ b/sdk/open_api/models/asset_definition.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/cancel_order_request.py b/sdk/open_api/models/cancel_order_request.py index 1b8b1b36..d678e3e9 100644 --- a/sdk/open_api/models/cancel_order_request.py +++ b/sdk/open_api/models/cancel_order_request.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/cancel_order_response.py b/sdk/open_api/models/cancel_order_response.py index 610f2cd6..ae61a5c7 100644 --- a/sdk/open_api/models/cancel_order_response.py +++ b/sdk/open_api/models/cancel_order_response.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/candle_history_data.py b/sdk/open_api/models/candle_history_data.py index d6495b3f..542d3da2 100644 --- a/sdk/open_api/models/candle_history_data.py +++ b/sdk/open_api/models/candle_history_data.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/create_order_request.py b/sdk/open_api/models/create_order_request.py index 0d02ad5d..69c7c3dc 100644 --- a/sdk/open_api/models/create_order_request.py +++ b/sdk/open_api/models/create_order_request.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/create_order_response.py b/sdk/open_api/models/create_order_response.py index 68621ae8..cae1170c 100644 --- a/sdk/open_api/models/create_order_response.py +++ b/sdk/open_api/models/create_order_response.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/depth.py b/sdk/open_api/models/depth.py index a41821d3..d952507a 100644 --- a/sdk/open_api/models/depth.py +++ b/sdk/open_api/models/depth.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/depth_type.py b/sdk/open_api/models/depth_type.py index 36c2d8fe..bd49455a 100644 --- a/sdk/open_api/models/depth_type.py +++ b/sdk/open_api/models/depth_type.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/execution_type.py b/sdk/open_api/models/execution_type.py index de70cc50..376e088f 100644 --- a/sdk/open_api/models/execution_type.py +++ b/sdk/open_api/models/execution_type.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/fee_tier_parameters.py b/sdk/open_api/models/fee_tier_parameters.py index 76a3bb02..c7adb50c 100644 --- a/sdk/open_api/models/fee_tier_parameters.py +++ b/sdk/open_api/models/fee_tier_parameters.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/global_fee_parameters.py b/sdk/open_api/models/global_fee_parameters.py index 390b32c5..6b04528b 100644 --- a/sdk/open_api/models/global_fee_parameters.py +++ b/sdk/open_api/models/global_fee_parameters.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/level.py b/sdk/open_api/models/level.py index c162f011..8b597eed 100644 --- a/sdk/open_api/models/level.py +++ b/sdk/open_api/models/level.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/liquidity_parameters.py b/sdk/open_api/models/liquidity_parameters.py index 3faaf054..f801e80b 100644 --- a/sdk/open_api/models/liquidity_parameters.py +++ b/sdk/open_api/models/liquidity_parameters.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/market_definition.py b/sdk/open_api/models/market_definition.py index 89e0787e..40634592 100644 --- a/sdk/open_api/models/market_definition.py +++ b/sdk/open_api/models/market_definition.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/market_summary.py b/sdk/open_api/models/market_summary.py index f2cabcd6..ba9578d6 100644 --- a/sdk/open_api/models/market_summary.py +++ b/sdk/open_api/models/market_summary.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/mass_cancel_request.py b/sdk/open_api/models/mass_cancel_request.py index 4b8100fd..c7ce9ffa 100644 --- a/sdk/open_api/models/mass_cancel_request.py +++ b/sdk/open_api/models/mass_cancel_request.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/mass_cancel_response.py b/sdk/open_api/models/mass_cancel_response.py index 3bb0f25b..26277846 100644 --- a/sdk/open_api/models/mass_cancel_response.py +++ b/sdk/open_api/models/mass_cancel_response.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/order.py b/sdk/open_api/models/order.py index fbb33636..4ae4aa72 100644 --- a/sdk/open_api/models/order.py +++ b/sdk/open_api/models/order.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/order_status.py b/sdk/open_api/models/order_status.py index 1a96a230..b420c6b3 100644 --- a/sdk/open_api/models/order_status.py +++ b/sdk/open_api/models/order_status.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/order_type.py b/sdk/open_api/models/order_type.py index 12233520..036f4e4c 100644 --- a/sdk/open_api/models/order_type.py +++ b/sdk/open_api/models/order_type.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/pagination_meta.py b/sdk/open_api/models/pagination_meta.py index b7fec1d0..308c26b2 100644 --- a/sdk/open_api/models/pagination_meta.py +++ b/sdk/open_api/models/pagination_meta.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/perp_execution.py b/sdk/open_api/models/perp_execution.py index 5ad0b789..52f5a59f 100644 --- a/sdk/open_api/models/perp_execution.py +++ b/sdk/open_api/models/perp_execution.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/perp_execution_list.py b/sdk/open_api/models/perp_execution_list.py index beae0da2..2472acf8 100644 --- a/sdk/open_api/models/perp_execution_list.py +++ b/sdk/open_api/models/perp_execution_list.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/position.py b/sdk/open_api/models/position.py index 80292a04..27c1d8db 100644 --- a/sdk/open_api/models/position.py +++ b/sdk/open_api/models/position.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/price.py b/sdk/open_api/models/price.py index a8ca6122..c627404e 100644 --- a/sdk/open_api/models/price.py +++ b/sdk/open_api/models/price.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/request_error.py b/sdk/open_api/models/request_error.py index 4ad3a817..2ae152bd 100644 --- a/sdk/open_api/models/request_error.py +++ b/sdk/open_api/models/request_error.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/request_error_code.py b/sdk/open_api/models/request_error_code.py index d5f54d2f..a6ef66ba 100644 --- a/sdk/open_api/models/request_error_code.py +++ b/sdk/open_api/models/request_error_code.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/server_error.py b/sdk/open_api/models/server_error.py index df634bac..09516b7b 100644 --- a/sdk/open_api/models/server_error.py +++ b/sdk/open_api/models/server_error.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/server_error_code.py b/sdk/open_api/models/server_error_code.py index 966409b6..dc693c12 100644 --- a/sdk/open_api/models/server_error_code.py +++ b/sdk/open_api/models/server_error_code.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/side.py b/sdk/open_api/models/side.py index 4d3d894a..98a47def 100644 --- a/sdk/open_api/models/side.py +++ b/sdk/open_api/models/side.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/spot_execution.py b/sdk/open_api/models/spot_execution.py index 0cba557c..21db2643 100644 --- a/sdk/open_api/models/spot_execution.py +++ b/sdk/open_api/models/spot_execution.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/spot_execution_list.py b/sdk/open_api/models/spot_execution_list.py index a7022cea..b1195e76 100644 --- a/sdk/open_api/models/spot_execution_list.py +++ b/sdk/open_api/models/spot_execution_list.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/spot_market_definition.py b/sdk/open_api/models/spot_market_definition.py index 26a218fb..63cf2c2f 100644 --- a/sdk/open_api/models/spot_market_definition.py +++ b/sdk/open_api/models/spot_market_definition.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/tier_type.py b/sdk/open_api/models/tier_type.py index 4d5c0dad..808df028 100644 --- a/sdk/open_api/models/tier_type.py +++ b/sdk/open_api/models/tier_type.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/time_in_force.py b/sdk/open_api/models/time_in_force.py index 8bbd275b..2fbffb60 100644 --- a/sdk/open_api/models/time_in_force.py +++ b/sdk/open_api/models/time_in_force.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/models/wallet_configuration.py b/sdk/open_api/models/wallet_configuration.py index 26697a68..fa0aa3fb 100644 --- a/sdk/open_api/models/wallet_configuration.py +++ b/sdk/open_api/models/wallet_configuration.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/sdk/open_api/rest.py b/sdk/open_api/rest.py index 251e28d4..744b2bb5 100644 --- a/sdk/open_api/rest.py +++ b/sdk/open_api/rest.py @@ -5,7 +5,7 @@ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - The version of the OpenAPI document: 2.1.3 + The version of the OpenAPI document: 2.1.4 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/specs b/specs index 8903d3b2..d98ff28b 160000 --- a/specs +++ b/specs @@ -1 +1 @@ -Subproject commit 8903d3b2c42b5ddecb3cd6eef9577adb982bf75b +Subproject commit d98ff28bb86dfc1bb4d6ecbd3ad451201157d33c diff --git a/tests/helpers/market_trackers.py b/tests/helpers/market_trackers.py index f82b9abe..dfad1e77 100644 --- a/tests/helpers/market_trackers.py +++ b/tests/helpers/market_trackers.py @@ -9,10 +9,11 @@ for execution price calculations. """ +from typing import Optional + import logging from dataclasses import dataclass from decimal import Decimal -from typing import Optional import aiohttp diff --git a/tests/test_perps/test_dynamic_pricing.py b/tests/test_perps/test_dynamic_pricing.py index ad97a666..d55933b8 100644 --- a/tests/test_perps/test_dynamic_pricing.py +++ b/tests/test_perps/test_dynamic_pricing.py @@ -96,20 +96,16 @@ async def test_market_tracker_fields_exist_and_valid(self): trackers = await fetch_market_trackers(api_url, ETH_MARKET_ID) # depth_factor must be non-negative (drives price impact scaling; 0 on unconfigured markets) - assert trackers.depth_factor >= 0, ( - f"depth_factor should be >= 0, got {trackers.depth_factor}" - ) + assert trackers.depth_factor >= 0, f"depth_factor should be >= 0, got {trackers.depth_factor}" # price_spread must be non-negative (symmetric spread around pool price) - assert trackers.price_spread >= 0, ( - f"price_spread should be >= 0, got {trackers.price_spread}" - ) + assert trackers.price_spread >= 0, f"price_spread should be >= 0, got {trackers.price_spread}" # log_price_multiplier is a valid signed number (can be 0, positive, or negative) # Just verify it's finite and within a reasonable range (< 1e18 in magnitude) - assert trackers.log_price_multiplier.is_finite(), ( - f"log_price_multiplier should be finite, got {trackers.log_price_multiplier}" - ) + assert ( + trackers.log_price_multiplier.is_finite() + ), f"log_price_multiplier should be finite, got {trackers.log_price_multiplier}" logger.info( f"✅ T1.1 passed: depth_factor={trackers.depth_factor}, " @@ -172,15 +168,15 @@ async def test_pool_price_direction_consistency(self): zero_threshold = 1e14 if log_f > zero_threshold: - assert pool_price > oracle_price, ( - f"logF > 0 ({log_f}) but poolPrice ({pool_price}) <= oraclePrice ({oracle_price})" - ) - logger.info(f"✅ T1.3: logF > 0 → poolPrice > oraclePrice") + assert ( + pool_price > oracle_price + ), f"logF > 0 ({log_f}) but poolPrice ({pool_price}) <= oraclePrice ({oracle_price})" + logger.info("✅ T1.3: logF > 0 → poolPrice > oraclePrice") elif log_f < -zero_threshold: - assert pool_price < oracle_price, ( - f"logF < 0 ({log_f}) but poolPrice ({pool_price}) >= oraclePrice ({oracle_price})" - ) - logger.info(f"✅ T1.3: logF < 0 → poolPrice < oraclePrice") + assert ( + pool_price < oracle_price + ), f"logF < 0 ({log_f}) but poolPrice ({pool_price}) >= oraclePrice ({oracle_price})" + logger.info("✅ T1.3: logF < 0 → poolPrice < oraclePrice") else: # logF ≈ 0, pool price should be approximately equal to oracle relative_diff = abs(pool_price - oracle_price) / oracle_price @@ -188,7 +184,7 @@ async def test_pool_price_direction_consistency(self): f"logF ≈ 0 ({log_f}) but poolPrice ({pool_price}) differs from " f"oraclePrice ({oracle_price}) by {relative_diff:.6f}" ) - logger.info(f"✅ T1.3: logF ≈ 0 → poolPrice ≈ oraclePrice") + logger.info("✅ T1.3: logF ≈ 0 → poolPrice ≈ oraclePrice") # ============================================================================ @@ -217,13 +213,11 @@ async def test_long_execution_price_above_pool_price(self, reya_tester: ReyaTest execution = await _execute_ioc_trade(reya_tester, is_buy=True) exec_price = float(execution.price) - assert exec_price > pool_price_before, ( - f"Long exec_price ({exec_price}) should be > poolPrice_before ({pool_price_before})" - ) + assert ( + exec_price > pool_price_before + ), f"Long exec_price ({exec_price}) should be > poolPrice_before ({pool_price_before})" - logger.info( - f"✅ T2.1 passed: exec_price={exec_price:.2f} > poolPrice={pool_price_before:.2f}" - ) + logger.info(f"✅ T2.1 passed: exec_price={exec_price:.2f} > poolPrice={pool_price_before:.2f}") @pytest.mark.asyncio async def test_short_execution_price_below_pool_price(self, reya_tester: ReyaTester): @@ -241,6 +235,7 @@ async def test_short_execution_price_below_pool_price(self, reya_tester: ReyaTes exec_price = float(execution.price) price_info_after: Price = await reya_tester.client.markets.get_price(SYMBOL) + assert price_info_after.pool_price is not None, "pool_price should be available for ETHRUSDPERP" pool_price_after = float(price_info_after.pool_price) pool_price_upper = max(pool_price_before, pool_price_after) @@ -249,9 +244,7 @@ async def test_short_execution_price_below_pool_price(self, reya_tester: ReyaTes f"(before={pool_price_before:.6f}, after={pool_price_after:.6f})" ) - logger.info( - f"✅ T2.2 passed: exec_price={exec_price:.2f} < poolPrice={pool_price_upper:.2f}" - ) + logger.info(f"✅ T2.2 passed: exec_price={exec_price:.2f} < poolPrice={pool_price_upper:.2f}") @pytest.mark.asyncio async def test_execution_price_bounded_by_oracle(self, reya_tester: ReyaTester): @@ -275,9 +268,7 @@ async def test_execution_price_bounded_by_oracle(self, reya_tester: ReyaTester): f"[{lower_bound:.2f}, {upper_bound:.2f}] (oracle={oracle_price:.2f})" ) - logger.info( - f"✅ T2.3 passed: exec_price={exec_price:.2f} within 5% of oracle={oracle_price:.2f}" - ) + logger.info(f"✅ T2.3 passed: exec_price={exec_price:.2f} within 5% of oracle={oracle_price:.2f}") @pytest.mark.asyncio async def test_spread_floor_on_execution_price(self, reya_tester: ReyaTester): @@ -290,6 +281,7 @@ async def test_spread_floor_on_execution_price(self, reya_tester: ReyaTester): """ api_url = _get_api_url() price_info, trackers = await _get_price_and_trackers(api_url) + assert price_info.pool_price is not None, "pool_price should be available for ETHRUSDPERP" pool_price_before = float(price_info.pool_price) spread_normalized = float(trackers.price_spread) / 1e18 @@ -297,6 +289,7 @@ async def test_spread_floor_on_execution_price(self, reya_tester: ReyaTester): exec_price = float(execution.price) price_info_after = await fetch_price(api_url, SYMBOL) + assert price_info_after.pool_price is not None, "pool_price should be available for ETHRUSDPERP" pool_price_after = float(price_info_after.pool_price) pool_price_lower = min(pool_price_before, pool_price_after) @@ -309,9 +302,7 @@ async def test_spread_floor_on_execution_price(self, reya_tester: ReyaTester): f"(poolPrice_min={pool_price_lower:.2f}, spread={spread_normalized:.6f})" ) - logger.info( - f"✅ T2.4 passed: exec_price={exec_price:.2f} >= spread_floor={spread_floor:.2f}" - ) + logger.info(f"✅ T2.4 passed: exec_price={exec_price:.2f} >= spread_floor={spread_floor:.2f}") # ============================================================================ @@ -331,9 +322,7 @@ async def test_log_price_multiplier_changes_after_trade(self, reya_tester: ReyaT Includes a delay to account for indexer lag. """ - trackers_before = await fetch_market_trackers( - reya_tester.client.config.api_url, ETH_MARKET_ID - ) + trackers_before = await fetch_market_trackers(reya_tester.client.config.api_url, ETH_MARKET_ID) log_f_before = trackers_before.log_price_multiplier await _execute_ioc_trade(reya_tester, is_buy=True) @@ -341,14 +330,11 @@ async def test_log_price_multiplier_changes_after_trade(self, reya_tester: ReyaT # Wait for indexer to pick up the on-chain state change await asyncio.sleep(3.0) - trackers_after = await fetch_market_trackers( - reya_tester.client.config.api_url, ETH_MARKET_ID - ) + trackers_after = await fetch_market_trackers(reya_tester.client.config.api_url, ETH_MARKET_ID) log_f_after = trackers_after.log_price_multiplier assert log_f_after > log_f_before, ( - f"logPriceMultiplier should increase after long trade: " - f"before={log_f_before}, after={log_f_after}" + f"logPriceMultiplier should increase after long trade: " f"before={log_f_before}, after={log_f_after}" ) logger.info(