From f3dc171474cb886cbf6b48d39d813ffe378583f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 03:44:39 +0000 Subject: [PATCH 1/3] fix(client): preserve hardcoded query params when merging with user params --- src/neptune_api_v2/_base_client.py | 4 +++ tests/test_client.py | 48 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/src/neptune_api_v2/_base_client.py b/src/neptune_api_v2/_base_client.py index 45dd543..c40f0b8 100644 --- a/src/neptune_api_v2/_base_client.py +++ b/src/neptune_api_v2/_base_client.py @@ -558,6 +558,10 @@ def _build_request( files = cast(HttpxRequestFiles, ForceMultipartDict()) prepared_url = self._prepare_url(options.url) + # preserve hard-coded query params from the url + if params and prepared_url.query: + params = {**dict(prepared_url.params.items()), **params} + prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0]) if "_" in prepared_url.host: # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} diff --git a/tests/test_client.py b/tests/test_client.py index 366c625..79e866d 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -394,6 +394,30 @@ def test_default_query_option(self) -> None: client.close() + def test_hardcoded_query_params_in_url(self, client: NeptuneAPIV2) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: NeptuneAPIV2) -> None: request = client._build_request( FinalRequestOptions( @@ -1255,6 +1279,30 @@ async def test_default_query_option(self) -> None: await client.close() + async def test_hardcoded_query_params_in_url(self, async_client: AsyncNeptuneAPIV2) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo?beta=true")) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/foo?beta=true", + params={"limit": "10", "page": "abc"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"beta": "true", "limit": "10", "page": "abc"} + + request = async_client._build_request( + FinalRequestOptions( + method="get", + url="/files/a%2Fb?beta=true", + params={"limit": "10"}, + ) + ) + assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" + def test_request_extra_json(self, client: NeptuneAPIV2) -> None: request = client._build_request( FinalRequestOptions( From 404a198d748b43053c14018ec69bac544a93bba9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 23:48:15 +0000 Subject: [PATCH 2/3] feat(api): API backend sync --- .stats.yml | 4 ++-- .../resources/analytics/market/history.py | 4 ++-- .../types/user/market/lend_list_response.py | 7 +----- .../nept/staking_get_unstaking_response.py | 24 +++---------------- .../user/wallet_get_balances_response.py | 22 +++-------------- 5 files changed, 11 insertions(+), 50 deletions(-) diff --git a/.stats.yml b/.stats.yml index b33261c..511af12 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-cd6572e5c8f35a293af2a1dae3e41c63da19dad8d2ab456a7322a09614de3ae9.yml -openapi_spec_hash: 68dd5648c3ee92f07f52c5d4ebf2f8fc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-99a21fdf9159c28a75eb60c0b7ad4710d01b0a98dd0474267a07e9914039fa83.yml +openapi_spec_hash: f58f326c00c34bc45b28b09b9530566c config_hash: 27aff5f3f84397a9b3c2cb8a3c1d1e71 diff --git a/src/neptune_api_v2/resources/analytics/market/history.py b/src/neptune_api_v2/resources/analytics/market/history.py index d464fe1..14954a2 100644 --- a/src/neptune_api_v2/resources/analytics/market/history.py +++ b/src/neptune_api_v2/resources/analytics/market/history.py @@ -152,7 +152,7 @@ def get_loans_originated_by_asset( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HistoryGetLoansOriginatedByAssetResponse: """ - Get cumulative lending value history assets + Get loans originated history Args: end: End timestamp for interval range (inclusive) @@ -347,7 +347,7 @@ async def get_loans_originated_by_asset( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HistoryGetLoansOriginatedByAssetResponse: """ - Get cumulative lending value history assets + Get loans originated history Args: end: End timestamp for interval range (inclusive) diff --git a/src/neptune_api_v2/types/user/market/lend_list_response.py b/src/neptune_api_v2/types/user/market/lend_list_response.py index 8996586..80d3ef0 100644 --- a/src/neptune_api_v2/types/user/market/lend_list_response.py +++ b/src/neptune_api_v2/types/user/market/lend_list_response.py @@ -1,7 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List - from ...._models import BaseModel from .user_lend_market import UserLendMarket @@ -9,10 +7,7 @@ class LendListResponse(BaseModel): - count: int - """Total number of objects irrespective of any pagination parameters.""" - - data: List[UserLendMarket] + data: UserLendMarket error: None = None """Error data. Guaranteed `null` for successful response.""" diff --git a/src/neptune_api_v2/types/user/nept/staking_get_unstaking_response.py b/src/neptune_api_v2/types/user/nept/staking_get_unstaking_response.py index ebfe72f..c4cc34f 100644 --- a/src/neptune_api_v2/types/user/nept/staking_get_unstaking_response.py +++ b/src/neptune_api_v2/types/user/nept/staking_get_unstaking_response.py @@ -1,31 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List - from ...._models import BaseModel -from .user_stake_unbonding_entry import UserStakeUnbondingEntry - -__all__ = ["StakingGetUnstakingResponse", "Data"] - - -class Data(BaseModel): - amount_sum: str - """Total amount of all unbond entries +from .user_stake_unbonding import UserStakeUnbonding - **NOTE:** this value is affected by active filters, if any (e.g. filtering over - account index) - """ - - contents: List[UserStakeUnbondingEntry] - """Unbonding/unstake entries - - **NOTE:** cascade unbondings from pool >= 2 are contained in the bondings list - of the lower adjacent pool from which the unbond occurred. - """ +__all__ = ["StakingGetUnstakingResponse"] class StakingGetUnstakingResponse(BaseModel): - data: Data + data: UserStakeUnbonding error: None = None """Error data. Guaranteed `null` for successful response.""" diff --git a/src/neptune_api_v2/types/user/wallet_get_balances_response.py b/src/neptune_api_v2/types/user/wallet_get_balances_response.py index 9e2dc22..ea0c65f 100644 --- a/src/neptune_api_v2/types/user/wallet_get_balances_response.py +++ b/src/neptune_api_v2/types/user/wallet_get_balances_response.py @@ -1,29 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional - from ..._models import BaseModel -from .wallet_balance import WalletBalance - -__all__ = ["WalletGetBalancesResponse", "Data"] - - -class Data(BaseModel): - balances: List[WalletBalance] - """Array of each wallet balance""" +from .user_wallet_portfolio import UserWalletPortfolio - total_value: Optional[str] = None - """ - Sum value in USD. Guaranteed null if value calculation is disabled / guaranteed - non-null if calculation is enabled. - - **NOTE:** this only accounts for assets which are internally known & tracked. - See the `/assets` endpoint for a list of supported assets. - """ +__all__ = ["WalletGetBalancesResponse"] class WalletGetBalancesResponse(BaseModel): - data: Data + data: UserWalletPortfolio error: None = None """Error data. Guaranteed `null` for successful response.""" From cae91e66b6101888493b7e14d810b95a4fb1d40d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 23:48:52 +0000 Subject: [PATCH 3/3] release: 0.4.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ pyproject.toml | 2 +- src/neptune_api_v2/_version.py | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6b7b74c..da59f99 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.4.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 25f6dbf..cfd6e22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.4.0 (2026-04-09) + +Full Changelog: [v0.3.0...v0.4.0](https://github.com/cryptechdev/neptune-api-v2-python/compare/v0.3.0...v0.4.0) + +### Features + +* **api:** API backend sync ([404a198](https://github.com/cryptechdev/neptune-api-v2-python/commit/404a198d748b43053c14018ec69bac544a93bba9)) + + +### Bug Fixes + +* **client:** preserve hardcoded query params when merging with user params ([f3dc171](https://github.com/cryptechdev/neptune-api-v2-python/commit/f3dc171474cb886cbf6b48d39d813ffe378583f0)) + ## 0.3.0 (2026-04-04) Full Changelog: [v0.2.0...v0.3.0](https://github.com/cryptechdev/neptune-api-v2-python/compare/v0.2.0...v0.3.0) diff --git a/pyproject.toml b/pyproject.toml index bb10197..c3feb42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "neptune_api_v2" -version = "0.3.0" +version = "0.4.0" description = "The official Python library for the neptune-api-v2 API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/neptune_api_v2/_version.py b/src/neptune_api_v2/_version.py index c00dd36..aa48814 100644 --- a/src/neptune_api_v2/_version.py +++ b/src/neptune_api_v2/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "neptune_api_v2" -__version__ = "0.3.0" # x-release-please-version +__version__ = "0.4.0" # x-release-please-version