Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.0"
".": "0.4.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 4 additions & 0 deletions src/neptune_api_v2/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("_", "-")}
Expand Down
2 changes: 1 addition & 1 deletion src/neptune_api_v2/_version.py
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/neptune_api_v2/resources/analytics/market/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 1 addition & 6 deletions src/neptune_api_v2/types/user/market/lend_list_response.py
Original file line number Diff line number Diff line change
@@ -1,18 +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_lend_market import UserLendMarket

__all__ = ["LendListResponse"]


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."""
Expand Down
Original file line number Diff line number Diff line change
@@ -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."""
Expand Down
22 changes: 3 additions & 19 deletions src/neptune_api_v2/types/user/wallet_get_balances_response.py
Original file line number Diff line number Diff line change
@@ -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."""
Expand Down
48 changes: 48 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Loading