Skip to content

Commit 4cf6d32

Browse files
authored
Merge pull request #2 from cryptechdev/release-please--branches--main--changes--next
release: 0.2.0
2 parents 02f42dd + b8dc171 commit 4cf6d32

117 files changed

Lines changed: 1976 additions & 593 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish-pypi.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
publish:
1313
name: publish
1414
runs-on: ubuntu-latest
15+
environment: production
16+
permissions:
17+
contents: read
18+
id-token: write
1519

1620
steps:
1721
- uses: actions/checkout@v6
@@ -24,5 +28,3 @@ jobs:
2428
- name: Publish to PyPI
2529
run: |
2630
bash ./bin/publish-pypi
27-
env:
28-
PYPI_TOKEN: ${{ secrets.NEPTUNE_API_V2_PYPI_TOKEN || secrets.PYPI_TOKEN }}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Release Doctor
22
on:
3-
pull_request:
3+
push:
44
branches:
55
- main
66
workflow_dispatch:
@@ -9,6 +9,7 @@ jobs:
99
release_doctor:
1010
name: release doctor
1111
runs-on: ubuntu-latest
12+
environment: production
1213
if: github.repository == 'cryptechdev/neptune-api-v2-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
1314

1415
steps:
@@ -17,5 +18,3 @@ jobs:
1718
- name: Check release environment
1819
run: |
1920
bash ./bin/check-release-environment
20-
env:
21-
PYPI_TOKEN: ${{ secrets.NEPTUNE_API_V2_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0"
2+
".": "0.2.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 48
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-5768d4f43166406f5b74235f2dd9e91082bd67a7b182ca05d5df55604ebedd7e.yml
3-
openapi_spec_hash: 2c5da98fd945fbfc68611634b7aa7042
4-
config_hash: fa0efc29593602eac57523d55bc83fa6
1+
configured_endpoints: 50
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-cd88dd75403e620991c3659cd7e9278f9c8c439f3857c25db8634dfc7e77a9b9.yml
3+
openapi_spec_hash: 35a0cbd0262458d633e38fc5ba442118
4+
config_hash: a79df81e5bba11abab18a84163248141

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 0.2.0 (2026-04-03)
4+
5+
Full Changelog: [v0.1.0...v0.2.0](https://github.com/cryptechdev/neptune-api-v2-python/compare/v0.1.0...v0.2.0)
6+
7+
### Features
8+
9+
* **api:** add missing models, pagination impls ([1aa9a59](https://github.com/cryptechdev/neptune-api-v2-python/commit/1aa9a590bdc800e554100b00a41b552add478bce))
10+
* **api:** add python publishing config ([72173a4](https://github.com/cryptechdev/neptune-api-v2-python/commit/72173a429dddb88648a29991c1870d86dd8c6b0a))
11+
* **api:** api update ([ebee3a7](https://github.com/cryptechdev/neptune-api-v2-python/commit/ebee3a79f42790d9fba6fced90848e432581817f))
12+
* **api:** api update ([a2daaa3](https://github.com/cryptechdev/neptune-api-v2-python/commit/a2daaa306f5c0ea3c17d2816d25ab9eaf90f058c))
13+
* **api:** api update ([64bfdf0](https://github.com/cryptechdev/neptune-api-v2-python/commit/64bfdf0f0f702d71e05b37a490f1ced871af27d0))
14+
* **api:** disable series pagn, update example requests ([9d71f0b](https://github.com/cryptechdev/neptune-api-v2-python/commit/9d71f0b3d797212151cb8d65c5ff72886904a6e9))
15+
* **api:** Fix readme title, fix inverted example params ([c90715f](https://github.com/cryptechdev/neptune-api-v2-python/commit/c90715f3ad82baedeb47f32889d7aba4404d5114))
16+
* **api:** manual updates ([3424a81](https://github.com/cryptechdev/neptune-api-v2-python/commit/3424a811af4205ad9396f23f7fd56055f6e2fb35))
17+
* **api:** manual updates ([f1f5aae](https://github.com/cryptechdev/neptune-api-v2-python/commit/f1f5aaef9e720cdb0933330c9836e8a666b806b4))
18+
19+
20+
### Chores
21+
22+
* remove custom code ([d81def3](https://github.com/cryptechdev/neptune-api-v2-python/commit/d81def31c6a38ad5972605a6054bf701bcaad6be))
23+
* update SDK settings ([3ea9109](https://github.com/cryptechdev/neptune-api-v2-python/commit/3ea910942b953e7ee8f5ed1baa371d72df8dfaf6))
24+
* update SDK settings ([3b2c9f9](https://github.com/cryptechdev/neptune-api-v2-python/commit/3b2c9f9b390aa03d3601dea10cb69133568726fd))
25+
* update SDK settings ([a41b0dd](https://github.com/cryptechdev/neptune-api-v2-python/commit/a41b0dd737f1ca76a0af6af4792c05dac3ea0b93))
26+
* update SDK settings ([5759a86](https://github.com/cryptechdev/neptune-api-v2-python/commit/5759a869889951c83f68dfc8d7df247c81fe6cd1))
27+
328
## 0.1.0 (2026-03-30)
429

530
Full Changelog: [v0.0.1...v0.1.0](https://github.com/cryptechdev/neptune-api-v2-python/compare/v0.0.1...v0.1.0)

README.md

Lines changed: 97 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ The full API of this library can be found in [api.md](api.md).
1616
## Installation
1717

1818
```sh
19-
# install from the production repo
20-
pip install git+ssh://git@github.com/cryptechdev/neptune-api-v2-python.git
19+
# install from PyPI
20+
pip install neptune_api_v2
2121
```
2222

23-
> [!NOTE]
24-
> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install neptune_api_v2`
25-
2623
## Usage
2724

2825
The full API of this library can be found in [api.md](api.md).
@@ -32,8 +29,11 @@ from neptune_api_v2 import NeptuneAPIV2
3229

3330
client = NeptuneAPIV2()
3431

35-
response = client.status.check_health()
36-
print(response.status)
32+
response = client.markets.get_overview(
33+
with_text=True,
34+
with_value=True,
35+
)
36+
print(response.data)
3737
```
3838

3939
## Async usage
@@ -48,8 +48,11 @@ client = AsyncNeptuneAPIV2()
4848

4949

5050
async def main() -> None:
51-
response = await client.status.check_health()
52-
print(response.status)
51+
response = await client.markets.get_overview(
52+
with_text=True,
53+
with_value=True,
54+
)
55+
print(response.data)
5356

5457

5558
asyncio.run(main())
@@ -64,8 +67,8 @@ By default, the async client uses `httpx` for HTTP requests. However, for improv
6467
You can enable this by installing `aiohttp`:
6568

6669
```sh
67-
# install from the production repo
68-
pip install 'neptune_api_v2[aiohttp] @ git+ssh://git@github.com/cryptechdev/neptune-api-v2-python.git'
70+
# install from PyPI
71+
pip install neptune_api_v2[aiohttp]
6972
```
7073

7174
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
@@ -80,8 +83,11 @@ async def main() -> None:
8083
async with AsyncNeptuneAPIV2(
8184
http_client=DefaultAioHttpClient(),
8285
) as client:
83-
response = await client.status.check_health()
84-
print(response.status)
86+
response = await client.markets.get_overview(
87+
with_text=True,
88+
with_value=True,
89+
)
90+
print(response.data)
8591

8692

8793
asyncio.run(main())
@@ -96,6 +102,77 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
96102

97103
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
98104

105+
## Pagination
106+
107+
List methods in the Neptune API V2 API are paginated.
108+
109+
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
110+
111+
```python
112+
from neptune_api_v2 import NeptuneAPIV2
113+
114+
client = NeptuneAPIV2()
115+
116+
all_users = []
117+
# Automatically fetches more pages as needed.
118+
for user in client.user.get_tx_history(
119+
address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0",
120+
):
121+
# Do something with user here
122+
all_users.append(user)
123+
print(all_users)
124+
```
125+
126+
Or, asynchronously:
127+
128+
```python
129+
import asyncio
130+
from neptune_api_v2 import AsyncNeptuneAPIV2
131+
132+
client = AsyncNeptuneAPIV2()
133+
134+
135+
async def main() -> None:
136+
all_users = []
137+
# Iterate through items across all pages, issuing requests as needed.
138+
async for user in client.user.get_tx_history(
139+
address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0",
140+
):
141+
all_users.append(user)
142+
print(all_users)
143+
144+
145+
asyncio.run(main())
146+
```
147+
148+
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
149+
150+
```python
151+
first_page = await client.user.get_tx_history(
152+
address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0",
153+
)
154+
if first_page.has_next_page():
155+
print(f"will fetch next page using these details: {first_page.next_page_info()}")
156+
next_page = await first_page.get_next_page()
157+
print(f"number of items we just fetched: {len(next_page.data)}")
158+
159+
# Remove `await` for non-async usage.
160+
```
161+
162+
Or just work directly with the returned data:
163+
164+
```python
165+
first_page = await client.user.get_tx_history(
166+
address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0",
167+
)
168+
169+
print(f"next page cursor: {first_page.prev_event_uuid}") # => "next page cursor: ..."
170+
for user in first_page.data:
171+
print(user.event_uuid)
172+
173+
# Remove `await` for non-async usage.
174+
```
175+
99176
## Handling errors
100177

101178
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `neptune_api_v2.APIConnectionError` is raised.
@@ -112,7 +189,7 @@ from neptune_api_v2 import NeptuneAPIV2
112189
client = NeptuneAPIV2()
113190

114191
try:
115-
client.status.check_health()
192+
client.markets.get_overview()
116193
except neptune_api_v2.APIConnectionError as e:
117194
print("The server could not be reached")
118195
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -155,7 +232,7 @@ client = NeptuneAPIV2(
155232
)
156233

157234
# Or, configure per-request:
158-
client.with_options(max_retries=5).status.check_health()
235+
client.with_options(max_retries=5).markets.get_overview()
159236
```
160237

161238
### Timeouts
@@ -178,7 +255,7 @@ client = NeptuneAPIV2(
178255
)
179256

180257
# Override per-request:
181-
client.with_options(timeout=5.0).status.check_health()
258+
client.with_options(timeout=5.0).markets.get_overview()
182259
```
183260

184261
On timeout, an `APITimeoutError` is thrown.
@@ -219,11 +296,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
219296
from neptune_api_v2 import NeptuneAPIV2
220297

221298
client = NeptuneAPIV2()
222-
response = client.status.with_raw_response.check_health()
299+
response = client.markets.with_raw_response.get_overview()
223300
print(response.headers.get('X-My-Header'))
224301

225-
status = response.parse() # get the object that `status.check_health()` would have returned
226-
print(status.status)
302+
market = response.parse() # get the object that `markets.get_overview()` would have returned
303+
print(market.data)
227304
```
228305

229306
These methods return an [`APIResponse`](https://github.com/cryptechdev/neptune-api-v2-python/tree/main/src/neptune_api_v2/_response.py) object.
@@ -237,7 +314,7 @@ The above interface eagerly reads the full response body when you make the reque
237314
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
238315

239316
```python
240-
with client.status.with_streaming_response.check_health() as response:
317+
with client.markets.with_streaming_response.get_overview() as response:
241318
print(response.headers.get("X-My-Header"))
242319

243320
for line in response.iter_lines():

api.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ from neptune_api_v2.types import (
77
ErrorData,
88
ErrorDataVariants,
99
ErrorKind,
10-
ErrorResponseVariants,
10+
ErrorResponse,
1111
ErrorScope,
1212
FieldValidationError,
1313
Interval,
1414
IntervalUnit,
15-
ListErrorResponse,
16-
ObjErrorResponse,
1715
ValidationErrorData,
1816
ValidationFieldSource,
1917
)
@@ -186,18 +184,12 @@ Methods:
186184
Types:
187185

188186
```python
189-
from neptune_api_v2.types import (
190-
EventAction,
191-
User,
192-
UserTx,
193-
UserGetTxHistoryResponse,
194-
UserGetUserResponse,
195-
)
187+
from neptune_api_v2.types import EventAction, User, UserTx, UserGetUserResponse
196188
```
197189

198190
Methods:
199191

200-
- <code title="get /api/v1/users/{address}/tx-history">client.user.<a href="./src/neptune_api_v2/resources/user/user.py">get_tx_history</a>(address, \*\*<a href="src/neptune_api_v2/types/user_get_tx_history_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/user_get_tx_history_response.py">UserGetTxHistoryResponse</a></code>
192+
- <code title="get /api/v1/users/{address}/tx-history">client.user.<a href="./src/neptune_api_v2/resources/user/user.py">get_tx_history</a>(address, \*\*<a href="src/neptune_api_v2/types/user_get_tx_history_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/user_tx.py">SyncTxHistoryPage[UserTx]</a></code>
201193
- <code title="get /api/v1/users/{address}/user">client.user.<a href="./src/neptune_api_v2/resources/user/user.py">get_user</a>(address, \*\*<a href="src/neptune_api_v2/types/user_get_user_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/user_get_user_response.py">UserGetUserResponse</a></code>
202194

203195
## Market
@@ -226,7 +218,10 @@ Types:
226218

227219
```python
228220
from neptune_api_v2.types.user.market import (
221+
UserLendAssetPool,
229222
UserLendMarket,
223+
UserLendOriginAmounts,
224+
UserLendReceiptAmounts,
230225
LendListResponse,
231226
LendGetByAssetResponse,
232227
)
@@ -379,7 +374,7 @@ from neptune_api_v2.types.analytics.market import (
379374

380375
Methods:
381376

382-
- <code title="get /api/v1/analytics/market/history/loans-originated">client.analytics.market.history.<a href="./src/neptune_api_v2/resources/analytics/market/history.py">get_loans_originated</a>(\*\*<a href="src/neptune_api_v2/types/analytics/market/history_get_loans_originated_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/analytics/market/history_get_loans_originated_response.py">HistoryGetLoansOriginatedResponse</a></code>
377+
- <code title="get /api/v1/analytics/market/history/loans-originated">client.analytics.market.history.<a href="./src/neptune_api_v2/resources/analytics/market/history.py">get_loans_originated</a>(\*\*<a href="src/neptune_api_v2/types/analytics/market/history_get_loans_originated_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/analytics/market/history_get_loans_originated_response.py">SyncIntervalSinglePage[HistoryGetLoansOriginatedResponse]</a></code>
383378
- <code title="get /api/v1/analytics/market/history/loans-originated/by-asset">client.analytics.market.history.<a href="./src/neptune_api_v2/resources/analytics/market/history.py">get_loans_originated_by_asset</a>(\*\*<a href="src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_response.py">HistoryGetLoansOriginatedByAssetResponse</a></code>
384379

385380
## Nept
@@ -407,3 +402,22 @@ from neptune_api_v2.types.integrations import BantrGetTransactionsResponse
407402
Methods:
408403

409404
- <code title="get /api/v1/integrations/bantr/transactions">client.integrations.bantr.<a href="./src/neptune_api_v2/resources/integrations/bantr.py">get_transactions</a>(\*\*<a href="src/neptune_api_v2/types/integrations/bantr_get_transactions_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/integrations/bantr_get_transactions_response.py">BantrGetTransactionsResponse</a></code>
405+
406+
# Swap
407+
408+
## Routes
409+
410+
Types:
411+
412+
```python
413+
from neptune_api_v2.types.swap import (
414+
SwapRouteTargetSet,
415+
RouteListAllResponse,
416+
RouteListByDenomResponse,
417+
)
418+
```
419+
420+
Methods:
421+
422+
- <code title="get /api/v1/swap/routes/all">client.swap.routes.<a href="./src/neptune_api_v2/resources/swap/routes.py">list_all</a>(\*\*<a href="src/neptune_api_v2/types/swap/route_list_all_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/swap/route_list_all_response.py">RouteListAllResponse</a></code>
423+
- <code title="get /api/v1/swap/routes">client.swap.routes.<a href="./src/neptune_api_v2/resources/swap/routes.py">list_by_denom</a>(\*\*<a href="src/neptune_api_v2/types/swap/route_list_by_denom_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/swap/route_list_by_denom_response.py">RouteListByDenomResponse</a></code>

bin/check-release-environment

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
errors=()
44

5-
if [ -z "${PYPI_TOKEN}" ]; then
6-
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
7-
fi
8-
95
lenErrors=${#errors[@]}
106

117
if [[ lenErrors -gt 0 ]]; then

bin/publish-pypi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ set -eux
44
rm -rf dist
55
mkdir -p dist
66
uv build
7-
uv publish --token=$PYPI_TOKEN
7+
if [ -n "${PYPI_TOKEN:-}" ]; then
8+
uv publish --token=$PYPI_TOKEN
9+
else
10+
uv publish
11+
fi

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "neptune_api_v2"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
description = "The official Python library for the neptune-api-v2 API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)