Skip to content

Commit fabb464

Browse files
feat(api): fix missing unlocks endpoint
1 parent 75d052f commit fabb464

9 files changed

Lines changed: 665 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 47
1+
configured_endpoints: 48
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-65d147ca43891623187340ff0aa56887343ee8e60d19ad156b65e241ebea8a99.yml
33
openapi_spec_hash: c063aafd7db98b2572545d87247fc8a1
4-
config_hash: 86d436d2720b30be618058b316c2100e
4+
config_hash: 25ce124efff11211f32262e6c378136d

api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,18 @@ Methods:
344344
- <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>
345345
- <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>
346346

347+
## Nept
348+
349+
Types:
350+
351+
```python
352+
from neptune_api_v2.types.analytics import NeptUnlocksDistributionResponse
353+
```
354+
355+
Methods:
356+
357+
- <code title="get /api/v1/analytics/nept/unlocks-distribution">client.analytics.nept.<a href="./src/neptune_api_v2/resources/analytics/nept.py">unlocks_distribution</a>(\*\*<a href="src/neptune_api_v2/types/analytics/nept_unlocks_distribution_params.py">params</a>) -> <a href="./src/neptune_api_v2/types/analytics/nept_unlocks_distribution_response.py">NeptUnlocksDistributionResponse</a></code>
358+
347359
# Integrations
348360

349361
## Bantr

src/neptune_api_v2/resources/analytics/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .nept import (
4+
NeptResource,
5+
AsyncNeptResource,
6+
NeptResourceWithRawResponse,
7+
AsyncNeptResourceWithRawResponse,
8+
NeptResourceWithStreamingResponse,
9+
AsyncNeptResourceWithStreamingResponse,
10+
)
311
from .market import (
412
MarketResource,
513
AsyncMarketResource,
@@ -24,6 +32,12 @@
2432
"AsyncMarketResourceWithRawResponse",
2533
"MarketResourceWithStreamingResponse",
2634
"AsyncMarketResourceWithStreamingResponse",
35+
"NeptResource",
36+
"AsyncNeptResource",
37+
"NeptResourceWithRawResponse",
38+
"AsyncNeptResourceWithRawResponse",
39+
"NeptResourceWithStreamingResponse",
40+
"AsyncNeptResourceWithStreamingResponse",
2741
"AnalyticsResource",
2842
"AsyncAnalyticsResource",
2943
"AnalyticsResourceWithRawResponse",

src/neptune_api_v2/resources/analytics/analytics.py

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

33
from __future__ import annotations
44

5+
from .nept import (
6+
NeptResource,
7+
AsyncNeptResource,
8+
NeptResourceWithRawResponse,
9+
AsyncNeptResourceWithRawResponse,
10+
NeptResourceWithStreamingResponse,
11+
AsyncNeptResourceWithStreamingResponse,
12+
)
513
from ..._compat import cached_property
614
from ..._resource import SyncAPIResource, AsyncAPIResource
715
from .market.market import (
@@ -21,6 +29,10 @@ class AnalyticsResource(SyncAPIResource):
2129
def market(self) -> MarketResource:
2230
return MarketResource(self._client)
2331

32+
@cached_property
33+
def nept(self) -> NeptResource:
34+
return NeptResource(self._client)
35+
2436
@cached_property
2537
def with_raw_response(self) -> AnalyticsResourceWithRawResponse:
2638
"""
@@ -46,6 +58,10 @@ class AsyncAnalyticsResource(AsyncAPIResource):
4658
def market(self) -> AsyncMarketResource:
4759
return AsyncMarketResource(self._client)
4860

61+
@cached_property
62+
def nept(self) -> AsyncNeptResource:
63+
return AsyncNeptResource(self._client)
64+
4965
@cached_property
5066
def with_raw_response(self) -> AsyncAnalyticsResourceWithRawResponse:
5167
"""
@@ -74,6 +90,10 @@ def __init__(self, analytics: AnalyticsResource) -> None:
7490
def market(self) -> MarketResourceWithRawResponse:
7591
return MarketResourceWithRawResponse(self._analytics.market)
7692

93+
@cached_property
94+
def nept(self) -> NeptResourceWithRawResponse:
95+
return NeptResourceWithRawResponse(self._analytics.nept)
96+
7797

7898
class AsyncAnalyticsResourceWithRawResponse:
7999
def __init__(self, analytics: AsyncAnalyticsResource) -> None:
@@ -83,6 +103,10 @@ def __init__(self, analytics: AsyncAnalyticsResource) -> None:
83103
def market(self) -> AsyncMarketResourceWithRawResponse:
84104
return AsyncMarketResourceWithRawResponse(self._analytics.market)
85105

106+
@cached_property
107+
def nept(self) -> AsyncNeptResourceWithRawResponse:
108+
return AsyncNeptResourceWithRawResponse(self._analytics.nept)
109+
86110

87111
class AnalyticsResourceWithStreamingResponse:
88112
def __init__(self, analytics: AnalyticsResource) -> None:
@@ -92,6 +116,10 @@ def __init__(self, analytics: AnalyticsResource) -> None:
92116
def market(self) -> MarketResourceWithStreamingResponse:
93117
return MarketResourceWithStreamingResponse(self._analytics.market)
94118

119+
@cached_property
120+
def nept(self) -> NeptResourceWithStreamingResponse:
121+
return NeptResourceWithStreamingResponse(self._analytics.nept)
122+
95123

96124
class AsyncAnalyticsResourceWithStreamingResponse:
97125
def __init__(self, analytics: AsyncAnalyticsResource) -> None:
@@ -100,3 +128,7 @@ def __init__(self, analytics: AsyncAnalyticsResource) -> None:
100128
@cached_property
101129
def market(self) -> AsyncMarketResourceWithStreamingResponse:
102130
return AsyncMarketResourceWithStreamingResponse(self._analytics.market)
131+
132+
@cached_property
133+
def nept(self) -> AsyncNeptResourceWithStreamingResponse:
134+
return AsyncNeptResourceWithStreamingResponse(self._analytics.nept)
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
8+
from ..._utils import maybe_transform, async_maybe_transform
9+
from ..._compat import cached_property
10+
from ..._resource import SyncAPIResource, AsyncAPIResource
11+
from ..._response import (
12+
to_raw_response_wrapper,
13+
to_streamed_response_wrapper,
14+
async_to_raw_response_wrapper,
15+
async_to_streamed_response_wrapper,
16+
)
17+
from ..._base_client import make_request_options
18+
from ...types.analytics import nept_unlocks_distribution_params
19+
from ...types.analytics.nept_unlocks_distribution_response import NeptUnlocksDistributionResponse
20+
21+
__all__ = ["NeptResource", "AsyncNeptResource"]
22+
23+
24+
class NeptResource(SyncAPIResource):
25+
@cached_property
26+
def with_raw_response(self) -> NeptResourceWithRawResponse:
27+
"""
28+
This property can be used as a prefix for any HTTP method call to return
29+
the raw response object instead of the parsed content.
30+
31+
For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers
32+
"""
33+
return NeptResourceWithRawResponse(self)
34+
35+
@cached_property
36+
def with_streaming_response(self) -> NeptResourceWithStreamingResponse:
37+
"""
38+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
39+
40+
For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response
41+
"""
42+
return NeptResourceWithStreamingResponse(self)
43+
44+
def unlocks_distribution(
45+
self,
46+
*,
47+
with_percent: bool | Omit = omit,
48+
with_text: bool | Omit = omit,
49+
with_value: bool | Omit = omit,
50+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
51+
# The extra values given here take precedence over values defined on the client or passed to this method.
52+
extra_headers: Headers | None = None,
53+
extra_query: Query | None = None,
54+
extra_body: Body | None = None,
55+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
56+
) -> NeptUnlocksDistributionResponse:
57+
"""
58+
Get distribution analytics for NEPT unlocks
59+
60+
Args:
61+
with_percent: Calculate and include proportional percentages, where applicable
62+
63+
with_text: Include text variation fields
64+
65+
with_value: Calculate and include USD values for amounts, where applicable
66+
67+
extra_headers: Send extra headers
68+
69+
extra_query: Add additional query parameters to the request
70+
71+
extra_body: Add additional JSON properties to the request
72+
73+
timeout: Override the client-level default timeout for this request, in seconds
74+
"""
75+
return self._get(
76+
"/api/v1/analytics/nept/unlocks-distribution",
77+
options=make_request_options(
78+
extra_headers=extra_headers,
79+
extra_query=extra_query,
80+
extra_body=extra_body,
81+
timeout=timeout,
82+
query=maybe_transform(
83+
{
84+
"with_percent": with_percent,
85+
"with_text": with_text,
86+
"with_value": with_value,
87+
},
88+
nept_unlocks_distribution_params.NeptUnlocksDistributionParams,
89+
),
90+
),
91+
cast_to=NeptUnlocksDistributionResponse,
92+
)
93+
94+
95+
class AsyncNeptResource(AsyncAPIResource):
96+
@cached_property
97+
def with_raw_response(self) -> AsyncNeptResourceWithRawResponse:
98+
"""
99+
This property can be used as a prefix for any HTTP method call to return
100+
the raw response object instead of the parsed content.
101+
102+
For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers
103+
"""
104+
return AsyncNeptResourceWithRawResponse(self)
105+
106+
@cached_property
107+
def with_streaming_response(self) -> AsyncNeptResourceWithStreamingResponse:
108+
"""
109+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
110+
111+
For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response
112+
"""
113+
return AsyncNeptResourceWithStreamingResponse(self)
114+
115+
async def unlocks_distribution(
116+
self,
117+
*,
118+
with_percent: bool | Omit = omit,
119+
with_text: bool | Omit = omit,
120+
with_value: bool | Omit = omit,
121+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
122+
# The extra values given here take precedence over values defined on the client or passed to this method.
123+
extra_headers: Headers | None = None,
124+
extra_query: Query | None = None,
125+
extra_body: Body | None = None,
126+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
127+
) -> NeptUnlocksDistributionResponse:
128+
"""
129+
Get distribution analytics for NEPT unlocks
130+
131+
Args:
132+
with_percent: Calculate and include proportional percentages, where applicable
133+
134+
with_text: Include text variation fields
135+
136+
with_value: Calculate and include USD values for amounts, where applicable
137+
138+
extra_headers: Send extra headers
139+
140+
extra_query: Add additional query parameters to the request
141+
142+
extra_body: Add additional JSON properties to the request
143+
144+
timeout: Override the client-level default timeout for this request, in seconds
145+
"""
146+
return await self._get(
147+
"/api/v1/analytics/nept/unlocks-distribution",
148+
options=make_request_options(
149+
extra_headers=extra_headers,
150+
extra_query=extra_query,
151+
extra_body=extra_body,
152+
timeout=timeout,
153+
query=await async_maybe_transform(
154+
{
155+
"with_percent": with_percent,
156+
"with_text": with_text,
157+
"with_value": with_value,
158+
},
159+
nept_unlocks_distribution_params.NeptUnlocksDistributionParams,
160+
),
161+
),
162+
cast_to=NeptUnlocksDistributionResponse,
163+
)
164+
165+
166+
class NeptResourceWithRawResponse:
167+
def __init__(self, nept: NeptResource) -> None:
168+
self._nept = nept
169+
170+
self.unlocks_distribution = to_raw_response_wrapper(
171+
nept.unlocks_distribution,
172+
)
173+
174+
175+
class AsyncNeptResourceWithRawResponse:
176+
def __init__(self, nept: AsyncNeptResource) -> None:
177+
self._nept = nept
178+
179+
self.unlocks_distribution = async_to_raw_response_wrapper(
180+
nept.unlocks_distribution,
181+
)
182+
183+
184+
class NeptResourceWithStreamingResponse:
185+
def __init__(self, nept: NeptResource) -> None:
186+
self._nept = nept
187+
188+
self.unlocks_distribution = to_streamed_response_wrapper(
189+
nept.unlocks_distribution,
190+
)
191+
192+
193+
class AsyncNeptResourceWithStreamingResponse:
194+
def __init__(self, nept: AsyncNeptResource) -> None:
195+
self._nept = nept
196+
197+
self.unlocks_distribution = async_to_streamed_response_wrapper(
198+
nept.unlocks_distribution,
199+
)

src/neptune_api_v2/types/analytics/__init__.py

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

33
from __future__ import annotations
44

5+
from .nept_unlocks_distribution_params import NeptUnlocksDistributionParams as NeptUnlocksDistributionParams
56
from .market_get_current_state_response import MarketGetCurrentStateResponse as MarketGetCurrentStateResponse
7+
from .nept_unlocks_distribution_response import NeptUnlocksDistributionResponse as NeptUnlocksDistributionResponse
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import TypedDict
6+
7+
__all__ = ["NeptUnlocksDistributionParams"]
8+
9+
10+
class NeptUnlocksDistributionParams(TypedDict, total=False):
11+
with_percent: bool
12+
"""Calculate and include proportional percentages, where applicable"""
13+
14+
with_text: bool
15+
"""Include text variation fields"""
16+
17+
with_value: bool
18+
"""Calculate and include USD values for amounts, where applicable"""

0 commit comments

Comments
 (0)