diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0189133..16d12a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' @@ -17,7 +19,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/neptune-api-v2-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -33,7 +35,7 @@ jobs: run: ./scripts/lint build: - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') timeout-minutes: 10 name: build permissions: @@ -55,14 +57,18 @@ jobs: run: uv build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/neptune-api-v2-python' + if: |- + github.repository == 'stainless-sdks/neptune-api-v2-python' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/neptune-api-v2-python' + if: |- + github.repository == 'stainless-sdks/neptune-api-v2-python' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index c6ea521..6035a80 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,6 +1,6 @@ # This workflow is triggered when a GitHub release is created. # It can also be run manually to re-publish to PyPI in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/cryptechdev/stainless-api-v2-python/actions/workflows/publish-pypi.yml +# You can run this workflow by navigating to https://www.github.com/cryptechdev/neptune-api-v2-python/actions/workflows/publish-pypi.yml name: Publish PyPI on: workflow_dispatch: diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 78f401d..b8e1556 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -9,7 +9,7 @@ jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'cryptechdev/stainless-api-v2-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + 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') steps: - uses: actions/checkout@v6 diff --git a/.gitignore b/.gitignore index 95ceb18..3824f4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log _dev __pycache__ diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1332969..3d2ac0b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1" + ".": "0.1.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 6530d99..6e0347a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-9048b9a34641ce9f489cc9813115c2cbe53ba4e19fec4d4be8ad50cc4c6dc955.yml -openapi_spec_hash: 90a2e162ca6a44232297cba2c5017476 -config_hash: da42ffa688c006ab6ebd3493c9dfb0c6 +configured_endpoints: 48 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-5768d4f43166406f5b74235f2dd9e91082bd67a7b182ca05d5df55604ebedd7e.yml +openapi_spec_hash: 2c5da98fd945fbfc68611634b7aa7042 +config_hash: fa0efc29593602eac57523d55bc83fa6 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6fb1613 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,50 @@ +# Changelog + +## 0.1.0 (2026-03-30) + +Full Changelog: [v0.0.1...v0.1.0](https://github.com/cryptechdev/neptune-api-v2-python/compare/v0.0.1...v0.1.0) + +### Features + +* **api:** api update ([b6c29db](https://github.com/cryptechdev/neptune-api-v2-python/commit/b6c29dbc5c8474713d3b45ad71d9e6ad36f269d5)) +* **api:** fix missing unlocks endpoint ([fabb464](https://github.com/cryptechdev/neptune-api-v2-python/commit/fabb464d4759502d7f49abdad35c2d06e227f414)) +* **api:** fix npm package name yaml ([9ce497f](https://github.com/cryptechdev/neptune-api-v2-python/commit/9ce497f5da04a604c0fa6f1ff0ee229372a27bfb)) +* **api:** manual updates ([b7c41b2](https://github.com/cryptechdev/neptune-api-v2-python/commit/b7c41b2c316bc714f82b75233307cb53040366c9)) +* **api:** manual updates ([f9cfab2](https://github.com/cryptechdev/neptune-api-v2-python/commit/f9cfab2a146e924b7d3f07f253be4de3ba9e4a2a)) +* **api:** manual updates ([6f72f25](https://github.com/cryptechdev/neptune-api-v2-python/commit/6f72f25e1ad1f5209d896e95ec091df0175e7381)) +* **api:** manual updates ([ad3aa1d](https://github.com/cryptechdev/neptune-api-v2-python/commit/ad3aa1d9eb34446c929eef61fc8c1c7f02c47d27)) +* **api:** manual updates ([1637771](https://github.com/cryptechdev/neptune-api-v2-python/commit/163777148c4c49df2a6a1bc43f674527c87543b8)) +* **api:** manual updates ([88800d5](https://github.com/cryptechdev/neptune-api-v2-python/commit/88800d595d34fca5b632ee8905c691e8ece062d5)) +* **api:** manual updates ([734507c](https://github.com/cryptechdev/neptune-api-v2-python/commit/734507cb06dfce17a1577895c23ee9498a6b2cc2)) +* **api:** manual updates ([078f551](https://github.com/cryptechdev/neptune-api-v2-python/commit/078f551028b777b9f32caa954d16f98b0a188385)) +* **api:** manual updates ([c020beb](https://github.com/cryptechdev/neptune-api-v2-python/commit/c020bebc90b10afcb8e3fb4c4bb92db31d79a3a6)) +* **api:** manual updates ([e86feeb](https://github.com/cryptechdev/neptune-api-v2-python/commit/e86feeb3249f10c94bff4c20870d66b5d87c797f)) +* **api:** manual updates ([3208888](https://github.com/cryptechdev/neptune-api-v2-python/commit/32088880c9c616e927016134b5ffaa8fc25bbcc4)) +* **api:** manual updates ([e19ffc5](https://github.com/cryptechdev/neptune-api-v2-python/commit/e19ffc53385463539ba1ef1a2550c269053f301d)) +* **api:** manual updates ([665f696](https://github.com/cryptechdev/neptune-api-v2-python/commit/665f696256c564619c93dffcb53afd7359c95e30)) +* **api:** update openapi spec ([67890ec](https://github.com/cryptechdev/neptune-api-v2-python/commit/67890ec54db761e15180cb2553a757e57d4f9007)) +* **internal:** implement indices array format for query and form serialization ([03d9eb0](https://github.com/cryptechdev/neptune-api-v2-python/commit/03d9eb0b52e51bef70134c34432e4899b2094632)) + + +### Bug Fixes + +* **deps:** bump minimum typing-extensions version ([c53e89a](https://github.com/cryptechdev/neptune-api-v2-python/commit/c53e89a6e5ba4e1b20012c7a141bc1858de26148)) +* **pydantic:** do not pass `by_alias` unless set ([fc8fe1a](https://github.com/cryptechdev/neptune-api-v2-python/commit/fc8fe1ae1177429d60d06dc7f0ba836b90964ff1)) +* sanitize endpoint path params ([44c0c8b](https://github.com/cryptechdev/neptune-api-v2-python/commit/44c0c8b8e3f5eeed5b54674c5a7ae43b8a176976)) + + +### Chores + +* **ci:** bump uv version ([2eb8bd0](https://github.com/cryptechdev/neptune-api-v2-python/commit/2eb8bd02d7bb0cfbd130a4c1fcadf80422954c64)) +* **ci:** skip lint on metadata-only changes ([05a360f](https://github.com/cryptechdev/neptune-api-v2-python/commit/05a360fc519e9a75b6befeba4929e75f50bbd40b)) +* **ci:** skip uploading artifacts on stainless-internal branches ([18daf63](https://github.com/cryptechdev/neptune-api-v2-python/commit/18daf632e1cce3dcd2a6ff59252f39523a731e86)) +* configure new SDK language ([46f828a](https://github.com/cryptechdev/neptune-api-v2-python/commit/46f828ac3c0610a7e01eaa8577f8e822c629f3ec)) +* configure new SDK language ([e5f08fa](https://github.com/cryptechdev/neptune-api-v2-python/commit/e5f08fa74eec724defb1621f896a5182522a540b)) +* **internal:** add request options to SSE classes ([580d4ce](https://github.com/cryptechdev/neptune-api-v2-python/commit/580d4ce4f69a5cd75421af1465b5ebd209c34699)) +* **internal:** make `test_proxy_environment_variables` more resilient ([29b6d23](https://github.com/cryptechdev/neptune-api-v2-python/commit/29b6d2306832ef6eec67c77cbe1147b785d0ce17)) +* **internal:** make `test_proxy_environment_variables` more resilient to env ([75f44ea](https://github.com/cryptechdev/neptune-api-v2-python/commit/75f44eac55564fa4af69a3bf7bb00e4ede77ff29)) +* **internal:** refactor authentication internals ([3261db6](https://github.com/cryptechdev/neptune-api-v2-python/commit/3261db685ebc85d286eef92d04fb416f2bed5b6c)) +* **internal:** tweak CI branches ([73115dc](https://github.com/cryptechdev/neptune-api-v2-python/commit/73115dce28adf13fd26721e8d012ca37a5a15c5e)) +* **internal:** update gitignore ([234d18a](https://github.com/cryptechdev/neptune-api-v2-python/commit/234d18a2f8796f655ae9b581a183d8692679cf32)) +* update SDK settings ([a258db0](https://github.com/cryptechdev/neptune-api-v2-python/commit/a258db0798d0887900eec2e89153fde27f024349)) +* update SDK settings ([658ca27](https://github.com/cryptechdev/neptune-api-v2-python/commit/658ca278b9e97285664bee1bea5664a36dd3afea)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 75ff9b5..d0f5d2b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```sh -$ pip install git+ssh://git@github.com/cryptechdev/stainless-api-v2-python.git +$ pip install git+ssh://git@github.com/cryptechdev/neptune-api-v2-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -113,7 +113,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/cryptechdev/stainless-api-v2-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/cryptechdev/neptune-api-v2-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index a05340b..89bf3ae 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The full API of this library can be found in [api.md](api.md). ```sh # install from the production repo -pip install git+ssh://git@github.com/cryptechdev/stainless-api-v2-python.git +pip install git+ssh://git@github.com/cryptechdev/neptune-api-v2-python.git ``` > [!NOTE] @@ -65,7 +65,7 @@ You can enable this by installing `aiohttp`: ```sh # install from the production repo -pip install 'neptune_api_v2[aiohttp] @ git+ssh://git@github.com/cryptechdev/stainless-api-v2-python.git' +pip install 'neptune_api_v2[aiohttp] @ git+ssh://git@github.com/cryptechdev/neptune-api-v2-python.git' ``` Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: @@ -226,9 +226,9 @@ status = response.parse() # get the object that `status.check_health()` would h print(status.status) ``` -These methods return an [`APIResponse`](https://github.com/cryptechdev/stainless-api-v2-python/tree/main/src/neptune_api_v2/_response.py) object. +These methods return an [`APIResponse`](https://github.com/cryptechdev/neptune-api-v2-python/tree/main/src/neptune_api_v2/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/cryptechdev/stainless-api-v2-python/tree/main/src/neptune_api_v2/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/cryptechdev/neptune-api-v2-python/tree/main/src/neptune_api_v2/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -332,7 +332,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/cryptechdev/stainless-api-v2-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/cryptechdev/neptune-api-v2-python/issues) with questions, bugs, or suggestions. ### Determining the installed version diff --git a/api.md b/api.md index 646fa64..7fbed9f 100644 --- a/api.md +++ b/api.md @@ -3,7 +3,20 @@ Types: ```python -from neptune_api_v2.types import ErrorData, Interval, IntervalUnit +from neptune_api_v2.types import ( + ErrorData, + ErrorDataVariants, + ErrorKind, + ErrorResponseVariants, + ErrorScope, + FieldValidationError, + Interval, + IntervalUnit, + ListErrorResponse, + ObjErrorResponse, + ValidationErrorData, + ValidationFieldSource, +) ``` # Status @@ -27,6 +40,9 @@ from neptune_api_v2.types import ( AssetClassification, AssetInfo, AssetMetadata, + AssetPrice, + AssetPriceHistory, + AssetRateHistory, AssetSpec, AssetListResponse, AssetGetPriceHistoryResponse, @@ -46,8 +62,8 @@ Types: ```python from neptune_api_v2.types import ( - AssetRateHistory, GlobalMarketConfig, + MarketRate, MergedMarket, MarketGetMergedResponse, MarketGetMergedByAssetResponse, @@ -70,8 +86,8 @@ Types: ```python from neptune_api_v2.types.markets import ( LendMarket, + LendMarketData, LendMarketState, - MarketRate, LendListResponse, LendGetByAssetResponse, LendGetRateHistoryResponse, @@ -109,6 +125,7 @@ Types: from neptune_api_v2.types.markets.borrow import ( BorrowCollateralConfig, BorrowCollateralMarket, + BorrowCollateralMarketData, BorrowCollateralState, CollateralListResponse, CollateralGetByAssetResponse, @@ -128,6 +145,7 @@ Types: from neptune_api_v2.types.markets.borrow import ( BorrowDebtConfig, BorrowDebtMarket, + BorrowDebtMarketData, BorrowDebtState, DebtListResponse, DebtGetByAssetResponse, @@ -145,6 +163,9 @@ Types: ```python from neptune_api_v2.types import ( + NeptParams, + NeptState, + NeptUnlockDistributionGroup, StakingPoolFull, StakingPoolParams, StakingPoolState, @@ -165,7 +186,13 @@ Methods: Types: ```python -from neptune_api_v2.types import EventAction, UserGetTxHistoryResponse, UserGetUserResponse +from neptune_api_v2.types import ( + EventAction, + User, + UserTx, + UserGetTxHistoryResponse, + UserGetUserResponse, +) ``` Methods: @@ -199,7 +226,7 @@ Types: ```python from neptune_api_v2.types.user.market import ( - UserDebtAssetPool, + UserLendMarket, LendListResponse, LendGetByAssetResponse, ) @@ -217,6 +244,7 @@ Types: ```python from neptune_api_v2.types.user.market import ( UserBorrowMarket, + UserBorrowMarketPools, BorrowGetCollateralAccountsByAssetResponse, BorrowGetCollateralTotalsResponse, BorrowGetDebtAccountsByAssetResponse, @@ -241,7 +269,10 @@ Types: from neptune_api_v2.types.user.market.borrow import ( UserAccountHealth, UserBorrowMarketAccount, + UserCollateralAccountPool, UserCollateralAssetPool, + UserDebtAccountPool, + UserDebtAssetPool, SubaccountGetSubaccountResponse, SubaccountGetSubaccountCollateralsResponse, SubaccountGetSubaccountDebtsResponse, @@ -262,8 +293,11 @@ Types: ```python from neptune_api_v2.types.user import ( - UserNeptUnlockAmounts, - UserNeptUnlockOverview, + UserUnlockAmounts, + UserUnlockOverview, + UserUnlockSchedule, + UserUnlockScheduleLinear, + UserUnlockScheduleLumpSum, NeptGetUnlocksResponse, ) ``` @@ -279,7 +313,9 @@ Types: ```python from neptune_api_v2.types.user.nept import ( UserStake, + UserStakeBondingEntry, UserStakePool, + UserStakeUnbonding, UserStakeUnbondingEntry, StakingGetOverviewResponse, StakingGetStakingPoolResponse, @@ -302,7 +338,9 @@ Types: ```python from neptune_api_v2.types.user import ( UserWalletPortfolio, + WalletAsset, WalletAssetKnown, + WalletAssetUnknown, WalletBalance, WalletGetBalanceByAssetResponse, WalletGetBalancesResponse, @@ -344,6 +382,18 @@ Methods: - client.analytics.market.history.get_loans_originated(\*\*params) -> HistoryGetLoansOriginatedResponse - client.analytics.market.history.get_loans_originated_by_asset(\*\*params) -> HistoryGetLoansOriginatedByAssetResponse +## Nept + +Types: + +```python +from neptune_api_v2.types.analytics import NeptUnlocksDistributionResponse +``` + +Methods: + +- client.analytics.nept.unlocks_distribution(\*\*params) -> NeptUnlocksDistributionResponse + # Integrations ## Bantr diff --git a/pyproject.toml b/pyproject.toml index bf78a83..64d3057 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "neptune_api_v2" -version = "0.0.1" +version = "0.1.0" description = "The official Python library for the neptune-api-v2 API" dynamic = ["readme"] license = "Apache-2.0" @@ -11,7 +11,7 @@ authors = [ dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", + "typing-extensions>=4.14, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", @@ -37,8 +37,8 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/cryptechdev/stainless-api-v2-python" -Repository = "https://github.com/cryptechdev/stainless-api-v2-python" +Homepage = "https://github.com/cryptechdev/neptune-api-v2-python" +Repository = "https://github.com/cryptechdev/neptune-api-v2-python" [project.optional-dependencies] aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] @@ -112,7 +112,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/cryptechdev/stainless-api-v2-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/cryptechdev/neptune-api-v2-python/tree/main/\g<2>)' [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/src/neptune_api_v2/_compat.py b/src/neptune_api_v2/_compat.py index 786ff42..e6690a4 100644 --- a/src/neptune_api_v2/_compat.py +++ b/src/neptune_api_v2/_compat.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self, Literal +from typing_extensions import Self, Literal, TypedDict import pydantic from pydantic.fields import FieldInfo @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: return model.model_dump_json(indent=indent) +class _ModelDumpKwargs(TypedDict, total=False): + by_alias: bool + + def model_dump( model: pydantic.BaseModel, *, @@ -142,6 +146,9 @@ def model_dump( by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): + kwargs: _ModelDumpKwargs = {} + if by_alias is not None: + kwargs["by_alias"] = by_alias return model.model_dump( mode=mode, exclude=exclude, @@ -149,7 +156,7 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, - by_alias=by_alias, + **kwargs, ) return cast( "dict[str, Any]", diff --git a/src/neptune_api_v2/_qs.py b/src/neptune_api_v2/_qs.py index ada6fd3..de8c99b 100644 --- a/src/neptune_api_v2/_qs.py +++ b/src/neptune_api_v2/_qs.py @@ -101,7 +101,10 @@ def _stringify_item( items.extend(self._stringify_item(key, item, opts)) return items elif array_format == "indices": - raise NotImplementedError("The array indices format is not supported yet") + items = [] + for i, item in enumerate(value): + items.extend(self._stringify_item(f"{key}[{i}]", item, opts)) + return items elif array_format == "brackets": items = [] key = key + "[]" diff --git a/src/neptune_api_v2/_utils/__init__.py b/src/neptune_api_v2/_utils/__init__.py index dc64e29..10cb66d 100644 --- a/src/neptune_api_v2/_utils/__init__.py +++ b/src/neptune_api_v2/_utils/__init__.py @@ -1,3 +1,4 @@ +from ._path import path_template as path_template from ._sync import asyncify as asyncify from ._proxy import LazyProxy as LazyProxy from ._utils import ( diff --git a/src/neptune_api_v2/_utils/_path.py b/src/neptune_api_v2/_utils/_path.py new file mode 100644 index 0000000..4d6e1e4 --- /dev/null +++ b/src/neptune_api_v2/_utils/_path.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +import re +from typing import ( + Any, + Mapping, + Callable, +) +from urllib.parse import quote + +# Matches '.' or '..' where each dot is either literal or percent-encoded (%2e / %2E). +_DOT_SEGMENT_RE = re.compile(r"^(?:\.|%2[eE]){1,2}$") + +_PLACEHOLDER_RE = re.compile(r"\{(\w+)\}") + + +def _quote_path_segment_part(value: str) -> str: + """Percent-encode `value` for use in a URI path segment. + + Considers characters not in `pchar` set from RFC 3986 §3.3 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 + """ + # quote() already treats unreserved characters (letters, digits, and -._~) + # as safe, so we only need to add sub-delims, ':', and '@'. + # Notably, unlike the default `safe` for quote(), / is unsafe and must be quoted. + return quote(value, safe="!$&'()*+,;=:@") + + +def _quote_query_part(value: str) -> str: + """Percent-encode `value` for use in a URI query string. + + Considers &, = and characters not in `query` set from RFC 3986 §3.4 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 + """ + return quote(value, safe="!$'()*+,;:@/?") + + +def _quote_fragment_part(value: str) -> str: + """Percent-encode `value` for use in a URI fragment. + + Considers characters not in `fragment` set from RFC 3986 §3.5 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.5 + """ + return quote(value, safe="!$&'()*+,;=:@/?") + + +def _interpolate( + template: str, + values: Mapping[str, Any], + quoter: Callable[[str], str], +) -> str: + """Replace {name} placeholders in `template`, quoting each value with `quoter`. + + Placeholder names are looked up in `values`. + + Raises: + KeyError: If a placeholder is not found in `values`. + """ + # re.split with a capturing group returns alternating + # [text, name, text, name, ..., text] elements. + parts = _PLACEHOLDER_RE.split(template) + + for i in range(1, len(parts), 2): + name = parts[i] + if name not in values: + raise KeyError(f"a value for placeholder {{{name}}} was not provided") + val = values[name] + if val is None: + parts[i] = "null" + elif isinstance(val, bool): + parts[i] = "true" if val else "false" + else: + parts[i] = quoter(str(values[name])) + + return "".join(parts) + + +def path_template(template: str, /, **kwargs: Any) -> str: + """Interpolate {name} placeholders in `template` from keyword arguments. + + Args: + template: The template string containing {name} placeholders. + **kwargs: Keyword arguments to interpolate into the template. + + Returns: + The template with placeholders interpolated and percent-encoded. + + Safe characters for percent-encoding are dependent on the URI component. + Placeholders in path and fragment portions are percent-encoded where the `segment` + and `fragment` sets from RFC 3986 respectively are considered safe. + Placeholders in the query portion are percent-encoded where the `query` set from + RFC 3986 §3.3 is considered safe except for = and & characters. + + Raises: + KeyError: If a placeholder is not found in `kwargs`. + ValueError: If resulting path contains /./ or /../ segments (including percent-encoded dot-segments). + """ + # Split the template into path, query, and fragment portions. + fragment_template: str | None = None + query_template: str | None = None + + rest = template + if "#" in rest: + rest, fragment_template = rest.split("#", 1) + if "?" in rest: + rest, query_template = rest.split("?", 1) + path_template = rest + + # Interpolate each portion with the appropriate quoting rules. + path_result = _interpolate(path_template, kwargs, _quote_path_segment_part) + + # Reject dot-segments (. and ..) in the final assembled path. The check + # runs after interpolation so that adjacent placeholders or a mix of static + # text and placeholders that together form a dot-segment are caught. + # Also reject percent-encoded dot-segments to protect against incorrectly + # implemented normalization in servers/proxies. + for segment in path_result.split("/"): + if _DOT_SEGMENT_RE.match(segment): + raise ValueError(f"Constructed path {path_result!r} contains dot-segment {segment!r} which is not allowed") + + result = path_result + if query_template is not None: + result += "?" + _interpolate(query_template, kwargs, _quote_query_part) + if fragment_template is not None: + result += "#" + _interpolate(fragment_template, kwargs, _quote_fragment_part) + + return result diff --git a/src/neptune_api_v2/_version.py b/src/neptune_api_v2/_version.py index 0de3c05..ec05cbf 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.0.1" # x-release-please-version +__version__ = "0.1.0" # x-release-please-version diff --git a/src/neptune_api_v2/resources/analytics/__init__.py b/src/neptune_api_v2/resources/analytics/__init__.py index 9f6da41..6cc4d7d 100644 --- a/src/neptune_api_v2/resources/analytics/__init__.py +++ b/src/neptune_api_v2/resources/analytics/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .nept import ( + NeptResource, + AsyncNeptResource, + NeptResourceWithRawResponse, + AsyncNeptResourceWithRawResponse, + NeptResourceWithStreamingResponse, + AsyncNeptResourceWithStreamingResponse, +) from .market import ( MarketResource, AsyncMarketResource, @@ -24,6 +32,12 @@ "AsyncMarketResourceWithRawResponse", "MarketResourceWithStreamingResponse", "AsyncMarketResourceWithStreamingResponse", + "NeptResource", + "AsyncNeptResource", + "NeptResourceWithRawResponse", + "AsyncNeptResourceWithRawResponse", + "NeptResourceWithStreamingResponse", + "AsyncNeptResourceWithStreamingResponse", "AnalyticsResource", "AsyncAnalyticsResource", "AnalyticsResourceWithRawResponse", diff --git a/src/neptune_api_v2/resources/analytics/analytics.py b/src/neptune_api_v2/resources/analytics/analytics.py index 487b4dc..45df7b1 100644 --- a/src/neptune_api_v2/resources/analytics/analytics.py +++ b/src/neptune_api_v2/resources/analytics/analytics.py @@ -2,6 +2,14 @@ from __future__ import annotations +from .nept import ( + NeptResource, + AsyncNeptResource, + NeptResourceWithRawResponse, + AsyncNeptResourceWithRawResponse, + NeptResourceWithStreamingResponse, + AsyncNeptResourceWithStreamingResponse, +) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from .market.market import ( @@ -21,13 +29,17 @@ class AnalyticsResource(SyncAPIResource): def market(self) -> MarketResource: return MarketResource(self._client) + @cached_property + def nept(self) -> NeptResource: + return NeptResource(self._client) + @cached_property def with_raw_response(self) -> AnalyticsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AnalyticsResourceWithRawResponse(self) @@ -36,7 +48,7 @@ def with_streaming_response(self) -> AnalyticsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AnalyticsResourceWithStreamingResponse(self) @@ -46,13 +58,17 @@ class AsyncAnalyticsResource(AsyncAPIResource): def market(self) -> AsyncMarketResource: return AsyncMarketResource(self._client) + @cached_property + def nept(self) -> AsyncNeptResource: + return AsyncNeptResource(self._client) + @cached_property def with_raw_response(self) -> AsyncAnalyticsResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncAnalyticsResourceWithRawResponse(self) @@ -61,7 +77,7 @@ def with_streaming_response(self) -> AsyncAnalyticsResourceWithStreamingResponse """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncAnalyticsResourceWithStreamingResponse(self) @@ -74,6 +90,10 @@ def __init__(self, analytics: AnalyticsResource) -> None: def market(self) -> MarketResourceWithRawResponse: return MarketResourceWithRawResponse(self._analytics.market) + @cached_property + def nept(self) -> NeptResourceWithRawResponse: + return NeptResourceWithRawResponse(self._analytics.nept) + class AsyncAnalyticsResourceWithRawResponse: def __init__(self, analytics: AsyncAnalyticsResource) -> None: @@ -83,6 +103,10 @@ def __init__(self, analytics: AsyncAnalyticsResource) -> None: def market(self) -> AsyncMarketResourceWithRawResponse: return AsyncMarketResourceWithRawResponse(self._analytics.market) + @cached_property + def nept(self) -> AsyncNeptResourceWithRawResponse: + return AsyncNeptResourceWithRawResponse(self._analytics.nept) + class AnalyticsResourceWithStreamingResponse: def __init__(self, analytics: AnalyticsResource) -> None: @@ -92,6 +116,10 @@ def __init__(self, analytics: AnalyticsResource) -> None: def market(self) -> MarketResourceWithStreamingResponse: return MarketResourceWithStreamingResponse(self._analytics.market) + @cached_property + def nept(self) -> NeptResourceWithStreamingResponse: + return NeptResourceWithStreamingResponse(self._analytics.nept) + class AsyncAnalyticsResourceWithStreamingResponse: def __init__(self, analytics: AsyncAnalyticsResource) -> None: @@ -100,3 +128,7 @@ def __init__(self, analytics: AsyncAnalyticsResource) -> None: @cached_property def market(self) -> AsyncMarketResourceWithStreamingResponse: return AsyncMarketResourceWithStreamingResponse(self._analytics.market) + + @cached_property + def nept(self) -> AsyncNeptResourceWithStreamingResponse: + return AsyncNeptResourceWithStreamingResponse(self._analytics.nept) diff --git a/src/neptune_api_v2/resources/analytics/market/history.py b/src/neptune_api_v2/resources/analytics/market/history.py index 304abc5..e054aa0 100644 --- a/src/neptune_api_v2/resources/analytics/market/history.py +++ b/src/neptune_api_v2/resources/analytics/market/history.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Optional + import httpx from ....types import IntervalUnit @@ -33,7 +35,7 @@ def with_raw_response(self) -> HistoryResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return HistoryResourceWithRawResponse(self) @@ -42,7 +44,7 @@ def with_streaming_response(self) -> HistoryResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return HistoryResourceWithStreamingResponse(self) @@ -136,7 +138,7 @@ def get_loans_originated_by_asset( end: int, period: IntervalUnit, start: int, - asset_ids: str | Omit = omit, + asset_ids: Optional[str] | Omit = omit, interval: int | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, @@ -227,7 +229,7 @@ def with_raw_response(self) -> AsyncHistoryResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncHistoryResourceWithRawResponse(self) @@ -236,7 +238,7 @@ def with_streaming_response(self) -> AsyncHistoryResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncHistoryResourceWithStreamingResponse(self) @@ -330,7 +332,7 @@ async def get_loans_originated_by_asset( end: int, period: IntervalUnit, start: int, - asset_ids: str | Omit = omit, + asset_ids: Optional[str] | Omit = omit, interval: int | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, diff --git a/src/neptune_api_v2/resources/analytics/market/market.py b/src/neptune_api_v2/resources/analytics/market/market.py index a4221bc..914fdb0 100644 --- a/src/neptune_api_v2/resources/analytics/market/market.py +++ b/src/neptune_api_v2/resources/analytics/market/market.py @@ -38,7 +38,7 @@ def with_raw_response(self) -> MarketResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return MarketResourceWithRawResponse(self) @@ -47,7 +47,7 @@ def with_streaming_response(self) -> MarketResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return MarketResourceWithStreamingResponse(self) @@ -82,7 +82,7 @@ def with_raw_response(self) -> AsyncMarketResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncMarketResourceWithRawResponse(self) @@ -91,7 +91,7 @@ def with_streaming_response(self) -> AsyncMarketResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncMarketResourceWithStreamingResponse(self) diff --git a/src/neptune_api_v2/resources/analytics/nept.py b/src/neptune_api_v2/resources/analytics/nept.py new file mode 100644 index 0000000..1367be3 --- /dev/null +++ b/src/neptune_api_v2/resources/analytics/nept.py @@ -0,0 +1,199 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.analytics import nept_unlocks_distribution_params +from ...types.analytics.nept_unlocks_distribution_response import NeptUnlocksDistributionResponse + +__all__ = ["NeptResource", "AsyncNeptResource"] + + +class NeptResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> NeptResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers + """ + return NeptResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> NeptResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response + """ + return NeptResourceWithStreamingResponse(self) + + def unlocks_distribution( + self, + *, + with_percent: bool | Omit = omit, + with_text: bool | Omit = omit, + with_value: bool | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NeptUnlocksDistributionResponse: + """ + Get distribution analytics for NEPT unlocks + + Args: + with_percent: Calculate and include proportional percentages, where applicable + + with_text: Include text variation fields + + with_value: Calculate and include USD values for amounts, where applicable + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/api/v1/analytics/nept/unlocks-distribution", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "with_percent": with_percent, + "with_text": with_text, + "with_value": with_value, + }, + nept_unlocks_distribution_params.NeptUnlocksDistributionParams, + ), + ), + cast_to=NeptUnlocksDistributionResponse, + ) + + +class AsyncNeptResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncNeptResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers + """ + return AsyncNeptResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncNeptResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response + """ + return AsyncNeptResourceWithStreamingResponse(self) + + async def unlocks_distribution( + self, + *, + with_percent: bool | Omit = omit, + with_text: bool | Omit = omit, + with_value: bool | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NeptUnlocksDistributionResponse: + """ + Get distribution analytics for NEPT unlocks + + Args: + with_percent: Calculate and include proportional percentages, where applicable + + with_text: Include text variation fields + + with_value: Calculate and include USD values for amounts, where applicable + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/api/v1/analytics/nept/unlocks-distribution", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "with_percent": with_percent, + "with_text": with_text, + "with_value": with_value, + }, + nept_unlocks_distribution_params.NeptUnlocksDistributionParams, + ), + ), + cast_to=NeptUnlocksDistributionResponse, + ) + + +class NeptResourceWithRawResponse: + def __init__(self, nept: NeptResource) -> None: + self._nept = nept + + self.unlocks_distribution = to_raw_response_wrapper( + nept.unlocks_distribution, + ) + + +class AsyncNeptResourceWithRawResponse: + def __init__(self, nept: AsyncNeptResource) -> None: + self._nept = nept + + self.unlocks_distribution = async_to_raw_response_wrapper( + nept.unlocks_distribution, + ) + + +class NeptResourceWithStreamingResponse: + def __init__(self, nept: NeptResource) -> None: + self._nept = nept + + self.unlocks_distribution = to_streamed_response_wrapper( + nept.unlocks_distribution, + ) + + +class AsyncNeptResourceWithStreamingResponse: + def __init__(self, nept: AsyncNeptResource) -> None: + self._nept = nept + + self.unlocks_distribution = async_to_streamed_response_wrapper( + nept.unlocks_distribution, + ) diff --git a/src/neptune_api_v2/resources/assets.py b/src/neptune_api_v2/resources/assets.py index e6cac28..ba20705 100644 --- a/src/neptune_api_v2/resources/assets.py +++ b/src/neptune_api_v2/resources/assets.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Optional + import httpx from ..types import IntervalUnit, asset_list_prices_params, asset_get_price_history_params @@ -31,7 +33,7 @@ def with_raw_response(self) -> AssetsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AssetsResourceWithRawResponse(self) @@ -40,7 +42,7 @@ def with_streaming_response(self) -> AssetsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AssetsResourceWithStreamingResponse(self) @@ -69,7 +71,7 @@ def get_price_history( end: int, period: IntervalUnit, start: int, - asset_ids: str | Omit = omit, + asset_ids: Optional[str] | Omit = omit, interval: int | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, @@ -197,7 +199,7 @@ def with_raw_response(self) -> AsyncAssetsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncAssetsResourceWithRawResponse(self) @@ -206,7 +208,7 @@ def with_streaming_response(self) -> AsyncAssetsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncAssetsResourceWithStreamingResponse(self) @@ -235,7 +237,7 @@ async def get_price_history( end: int, period: IntervalUnit, start: int, - asset_ids: str | Omit = omit, + asset_ids: Optional[str] | Omit = omit, interval: int | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, diff --git a/src/neptune_api_v2/resources/integrations/bantr.py b/src/neptune_api_v2/resources/integrations/bantr.py index 61a8c54..0b36876 100644 --- a/src/neptune_api_v2/resources/integrations/bantr.py +++ b/src/neptune_api_v2/resources/integrations/bantr.py @@ -30,7 +30,7 @@ def with_raw_response(self) -> BantrResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return BantrResourceWithRawResponse(self) @@ -39,7 +39,7 @@ def with_streaming_response(self) -> BantrResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return BantrResourceWithStreamingResponse(self) @@ -101,7 +101,7 @@ def with_raw_response(self) -> AsyncBantrResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncBantrResourceWithRawResponse(self) @@ -110,7 +110,7 @@ def with_streaming_response(self) -> AsyncBantrResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncBantrResourceWithStreamingResponse(self) diff --git a/src/neptune_api_v2/resources/integrations/integrations.py b/src/neptune_api_v2/resources/integrations/integrations.py index 40c404e..7a56c8e 100644 --- a/src/neptune_api_v2/resources/integrations/integrations.py +++ b/src/neptune_api_v2/resources/integrations/integrations.py @@ -27,7 +27,7 @@ def with_raw_response(self) -> IntegrationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return IntegrationsResourceWithRawResponse(self) @@ -36,7 +36,7 @@ def with_streaming_response(self) -> IntegrationsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return IntegrationsResourceWithStreamingResponse(self) @@ -52,7 +52,7 @@ def with_raw_response(self) -> AsyncIntegrationsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncIntegrationsResourceWithRawResponse(self) @@ -61,7 +61,7 @@ def with_streaming_response(self) -> AsyncIntegrationsResourceWithStreamingRespo """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncIntegrationsResourceWithStreamingResponse(self) diff --git a/src/neptune_api_v2/resources/markets/borrow/borrow.py b/src/neptune_api_v2/resources/markets/borrow/borrow.py index 8055efa..de746b2 100644 --- a/src/neptune_api_v2/resources/markets/borrow/borrow.py +++ b/src/neptune_api_v2/resources/markets/borrow/borrow.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Optional + import httpx from .debts import ( @@ -55,7 +57,7 @@ def with_raw_response(self) -> BorrowResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return BorrowResourceWithRawResponse(self) @@ -64,7 +66,7 @@ def with_streaming_response(self) -> BorrowResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return BorrowResourceWithStreamingResponse(self) @@ -120,7 +122,7 @@ def get_rate_history( end: int, period: IntervalUnit, start: int, - asset_ids: str | Omit = omit, + asset_ids: Optional[str] | Omit = omit, interval: int | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, @@ -219,7 +221,7 @@ def with_raw_response(self) -> AsyncBorrowResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncBorrowResourceWithRawResponse(self) @@ -228,7 +230,7 @@ def with_streaming_response(self) -> AsyncBorrowResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncBorrowResourceWithStreamingResponse(self) @@ -284,7 +286,7 @@ async def get_rate_history( end: int, period: IntervalUnit, start: int, - asset_ids: str | Omit = omit, + asset_ids: Optional[str] | Omit = omit, interval: int | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, diff --git a/src/neptune_api_v2/resources/markets/borrow/collaterals.py b/src/neptune_api_v2/resources/markets/borrow/collaterals.py index 9f89f4b..2ef430b 100644 --- a/src/neptune_api_v2/resources/markets/borrow/collaterals.py +++ b/src/neptune_api_v2/resources/markets/borrow/collaterals.py @@ -29,7 +29,7 @@ def with_raw_response(self) -> CollateralsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return CollateralsResourceWithRawResponse(self) @@ -38,7 +38,7 @@ def with_streaming_response(self) -> CollateralsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return CollateralsResourceWithStreamingResponse(self) @@ -146,7 +146,7 @@ def with_raw_response(self) -> AsyncCollateralsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncCollateralsResourceWithRawResponse(self) @@ -155,7 +155,7 @@ def with_streaming_response(self) -> AsyncCollateralsResourceWithStreamingRespon """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncCollateralsResourceWithStreamingResponse(self) diff --git a/src/neptune_api_v2/resources/markets/borrow/debts.py b/src/neptune_api_v2/resources/markets/borrow/debts.py index 262aadd..c9602ae 100644 --- a/src/neptune_api_v2/resources/markets/borrow/debts.py +++ b/src/neptune_api_v2/resources/markets/borrow/debts.py @@ -29,7 +29,7 @@ def with_raw_response(self) -> DebtsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return DebtsResourceWithRawResponse(self) @@ -38,7 +38,7 @@ def with_streaming_response(self) -> DebtsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return DebtsResourceWithStreamingResponse(self) @@ -146,7 +146,7 @@ def with_raw_response(self) -> AsyncDebtsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncDebtsResourceWithRawResponse(self) @@ -155,7 +155,7 @@ def with_streaming_response(self) -> AsyncDebtsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncDebtsResourceWithStreamingResponse(self) diff --git a/src/neptune_api_v2/resources/markets/lend.py b/src/neptune_api_v2/resources/markets/lend.py index b65f30e..67de206 100644 --- a/src/neptune_api_v2/resources/markets/lend.py +++ b/src/neptune_api_v2/resources/markets/lend.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Optional + import httpx from ...types import IntervalUnit @@ -32,7 +34,7 @@ def with_raw_response(self) -> LendResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return LendResourceWithRawResponse(self) @@ -41,7 +43,7 @@ def with_streaming_response(self) -> LendResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return LendResourceWithStreamingResponse(self) @@ -147,7 +149,7 @@ def get_rate_history( end: int, period: IntervalUnit, start: int, - asset_ids: str | Omit = omit, + asset_ids: Optional[str] | Omit = omit, interval: int | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, @@ -238,7 +240,7 @@ def with_raw_response(self) -> AsyncLendResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncLendResourceWithRawResponse(self) @@ -247,7 +249,7 @@ def with_streaming_response(self) -> AsyncLendResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncLendResourceWithStreamingResponse(self) @@ -353,7 +355,7 @@ async def get_rate_history( end: int, period: IntervalUnit, start: int, - asset_ids: str | Omit = omit, + asset_ids: Optional[str] | Omit = omit, interval: int | Omit = omit, limit: int | Omit = omit, offset: int | Omit = omit, diff --git a/src/neptune_api_v2/resources/markets/markets.py b/src/neptune_api_v2/resources/markets/markets.py index cb6b5a7..95d3787 100644 --- a/src/neptune_api_v2/resources/markets/markets.py +++ b/src/neptune_api_v2/resources/markets/markets.py @@ -60,7 +60,7 @@ def with_raw_response(self) -> MarketsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return MarketsResourceWithRawResponse(self) @@ -69,7 +69,7 @@ def with_streaming_response(self) -> MarketsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return MarketsResourceWithStreamingResponse(self) @@ -268,7 +268,7 @@ def with_raw_response(self) -> AsyncMarketsResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncMarketsResourceWithRawResponse(self) @@ -277,7 +277,7 @@ def with_streaming_response(self) -> AsyncMarketsResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncMarketsResourceWithStreamingResponse(self) diff --git a/src/neptune_api_v2/resources/nept.py b/src/neptune_api_v2/resources/nept.py index 39f3ad6..a3e3897 100644 --- a/src/neptune_api_v2/resources/nept.py +++ b/src/neptune_api_v2/resources/nept.py @@ -30,7 +30,7 @@ def with_raw_response(self) -> NeptResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return NeptResourceWithRawResponse(self) @@ -39,7 +39,7 @@ def with_streaming_response(self) -> NeptResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return NeptResourceWithStreamingResponse(self) @@ -190,7 +190,7 @@ def with_raw_response(self) -> AsyncNeptResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncNeptResourceWithRawResponse(self) @@ -199,7 +199,7 @@ def with_streaming_response(self) -> AsyncNeptResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncNeptResourceWithStreamingResponse(self) diff --git a/src/neptune_api_v2/resources/status.py b/src/neptune_api_v2/resources/status.py index ca994e5..853f7a4 100644 --- a/src/neptune_api_v2/resources/status.py +++ b/src/neptune_api_v2/resources/status.py @@ -26,7 +26,7 @@ def with_raw_response(self) -> StatusResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return StatusResourceWithRawResponse(self) @@ -35,7 +35,7 @@ def with_streaming_response(self) -> StatusResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return StatusResourceWithStreamingResponse(self) @@ -70,7 +70,7 @@ def with_raw_response(self) -> AsyncStatusResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncStatusResourceWithRawResponse(self) @@ -79,7 +79,7 @@ def with_streaming_response(self) -> AsyncStatusResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncStatusResourceWithStreamingResponse(self) diff --git a/src/neptune_api_v2/resources/user/market/borrow/borrow.py b/src/neptune_api_v2/resources/user/market/borrow/borrow.py index a69fe35..c7253b1 100644 --- a/src/neptune_api_v2/resources/user/market/borrow/borrow.py +++ b/src/neptune_api_v2/resources/user/market/borrow/borrow.py @@ -5,7 +5,7 @@ import httpx from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ....._utils import maybe_transform, async_maybe_transform +from ....._utils import path_template, maybe_transform, async_maybe_transform from .subaccount import ( SubaccountResource, AsyncSubaccountResource, @@ -52,7 +52,7 @@ def with_raw_response(self) -> BorrowResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return BorrowResourceWithRawResponse(self) @@ -61,7 +61,7 @@ def with_streaming_response(self) -> BorrowResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return BorrowResourceWithStreamingResponse(self) @@ -102,7 +102,7 @@ def get_collateral_accounts_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/borrow/lookup/collateral", + path_template("/api/v1/users/{address}/markets/borrow/lookup/collateral", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -154,7 +154,7 @@ def get_collateral_totals( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/borrow/sum/collaterals", + path_template("/api/v1/users/{address}/markets/borrow/sum/collaterals", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -208,7 +208,7 @@ def get_debt_accounts_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/borrow/lookup/debt", + path_template("/api/v1/users/{address}/markets/borrow/lookup/debt", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -260,7 +260,7 @@ def get_debts_totals( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/borrow/sum/debts", + path_template("/api/v1/users/{address}/markets/borrow/sum/debts", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -311,7 +311,7 @@ def get_portfolio( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/borrow", + path_template("/api/v1/users/{address}/markets/borrow", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -340,7 +340,7 @@ def with_raw_response(self) -> AsyncBorrowResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncBorrowResourceWithRawResponse(self) @@ -349,7 +349,7 @@ def with_streaming_response(self) -> AsyncBorrowResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncBorrowResourceWithStreamingResponse(self) @@ -390,7 +390,7 @@ async def get_collateral_accounts_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/borrow/lookup/collateral", + path_template("/api/v1/users/{address}/markets/borrow/lookup/collateral", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -442,7 +442,7 @@ async def get_collateral_totals( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/borrow/sum/collaterals", + path_template("/api/v1/users/{address}/markets/borrow/sum/collaterals", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -496,7 +496,7 @@ async def get_debt_accounts_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/borrow/lookup/debt", + path_template("/api/v1/users/{address}/markets/borrow/lookup/debt", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -548,7 +548,7 @@ async def get_debts_totals( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/borrow/sum/debts", + path_template("/api/v1/users/{address}/markets/borrow/sum/debts", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -599,7 +599,7 @@ async def get_portfolio( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/borrow", + path_template("/api/v1/users/{address}/markets/borrow", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/neptune_api_v2/resources/user/market/borrow/subaccount.py b/src/neptune_api_v2/resources/user/market/borrow/subaccount.py index ff4bdfd..d406b82 100644 --- a/src/neptune_api_v2/resources/user/market/borrow/subaccount.py +++ b/src/neptune_api_v2/resources/user/market/borrow/subaccount.py @@ -5,7 +5,7 @@ import httpx from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ....._utils import maybe_transform, async_maybe_transform +from ....._utils import path_template, maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -40,7 +40,7 @@ def with_raw_response(self) -> SubaccountResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return SubaccountResourceWithRawResponse(self) @@ -49,7 +49,7 @@ def with_streaming_response(self) -> SubaccountResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return SubaccountResourceWithStreamingResponse(self) @@ -90,7 +90,7 @@ def get_subaccount( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/borrow/accounts/{index}", + path_template("/api/v1/users/{address}/markets/borrow/accounts/{index}", address=address, index=index), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -144,7 +144,9 @@ def get_subaccount_collaterals( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/borrow/accounts/{index}/collaterals", + path_template( + "/api/v1/users/{address}/markets/borrow/accounts/{index}/collaterals", address=address, index=index + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -198,7 +200,9 @@ def get_subaccount_debts( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/borrow/accounts/{index}/debts", + path_template( + "/api/v1/users/{address}/markets/borrow/accounts/{index}/debts", address=address, index=index + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -221,7 +225,6 @@ def get_subaccount_health( *, address: str, with_text: bool | Omit = omit, - with_value: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -239,8 +242,6 @@ def get_subaccount_health( with_text: Include text variation fields - with_value: Calculate and include USD values for amounts, where applicable - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -252,17 +253,16 @@ def get_subaccount_health( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/borrow/accounts/{index}/health", + path_template( + "/api/v1/users/{address}/markets/borrow/accounts/{index}/health", address=address, index=index + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( - { - "with_text": with_text, - "with_value": with_value, - }, + {"with_text": with_text}, subaccount_get_subaccount_health_params.SubaccountGetSubaccountHealthParams, ), ), @@ -277,7 +277,7 @@ def with_raw_response(self) -> AsyncSubaccountResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncSubaccountResourceWithRawResponse(self) @@ -286,7 +286,7 @@ def with_streaming_response(self) -> AsyncSubaccountResourceWithStreamingRespons """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncSubaccountResourceWithStreamingResponse(self) @@ -327,7 +327,7 @@ async def get_subaccount( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/borrow/accounts/{index}", + path_template("/api/v1/users/{address}/markets/borrow/accounts/{index}", address=address, index=index), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -381,7 +381,9 @@ async def get_subaccount_collaterals( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/borrow/accounts/{index}/collaterals", + path_template( + "/api/v1/users/{address}/markets/borrow/accounts/{index}/collaterals", address=address, index=index + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -435,7 +437,9 @@ async def get_subaccount_debts( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/borrow/accounts/{index}/debts", + path_template( + "/api/v1/users/{address}/markets/borrow/accounts/{index}/debts", address=address, index=index + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -458,7 +462,6 @@ async def get_subaccount_health( *, address: str, with_text: bool | Omit = omit, - with_value: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -476,8 +479,6 @@ async def get_subaccount_health( with_text: Include text variation fields - with_value: Calculate and include USD values for amounts, where applicable - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -489,17 +490,16 @@ async def get_subaccount_health( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/borrow/accounts/{index}/health", + path_template( + "/api/v1/users/{address}/markets/borrow/accounts/{index}/health", address=address, index=index + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform( - { - "with_text": with_text, - "with_value": with_value, - }, + {"with_text": with_text}, subaccount_get_subaccount_health_params.SubaccountGetSubaccountHealthParams, ), ), diff --git a/src/neptune_api_v2/resources/user/market/lend.py b/src/neptune_api_v2/resources/user/market/lend.py index b347495..e09bf29 100644 --- a/src/neptune_api_v2/resources/user/market/lend.py +++ b/src/neptune_api_v2/resources/user/market/lend.py @@ -5,7 +5,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -29,7 +29,7 @@ def with_raw_response(self) -> LendResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return LendResourceWithRawResponse(self) @@ -38,7 +38,7 @@ def with_streaming_response(self) -> LendResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return LendResourceWithStreamingResponse(self) @@ -76,7 +76,7 @@ def list( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/lend", + path_template("/api/v1/users/{address}/markets/lend", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -130,7 +130,7 @@ def get_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/lend/lookup", + path_template("/api/v1/users/{address}/markets/lend/lookup", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -156,7 +156,7 @@ def with_raw_response(self) -> AsyncLendResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncLendResourceWithRawResponse(self) @@ -165,7 +165,7 @@ def with_streaming_response(self) -> AsyncLendResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncLendResourceWithStreamingResponse(self) @@ -203,7 +203,7 @@ async def list( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/lend", + path_template("/api/v1/users/{address}/markets/lend", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -257,7 +257,7 @@ async def get_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/lend/lookup", + path_template("/api/v1/users/{address}/markets/lend/lookup", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/neptune_api_v2/resources/user/market/market.py b/src/neptune_api_v2/resources/user/market/market.py index 90fe01f..cbf8406 100644 --- a/src/neptune_api_v2/resources/user/market/market.py +++ b/src/neptune_api_v2/resources/user/market/market.py @@ -13,7 +13,7 @@ AsyncLendResourceWithStreamingResponse, ) from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -54,7 +54,7 @@ def with_raw_response(self) -> MarketResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return MarketResourceWithRawResponse(self) @@ -63,7 +63,7 @@ def with_streaming_response(self) -> MarketResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return MarketResourceWithStreamingResponse(self) @@ -102,7 +102,7 @@ def get_merged( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/merged", + path_template("/api/v1/users/{address}/markets/merged", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -156,7 +156,7 @@ def get_merged_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets/merged/lookup", + path_template("/api/v1/users/{address}/markets/merged/lookup", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -208,7 +208,7 @@ def get_portfolio( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/markets", + path_template("/api/v1/users/{address}/markets", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -241,7 +241,7 @@ def with_raw_response(self) -> AsyncMarketResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncMarketResourceWithRawResponse(self) @@ -250,7 +250,7 @@ def with_streaming_response(self) -> AsyncMarketResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncMarketResourceWithStreamingResponse(self) @@ -289,7 +289,7 @@ async def get_merged( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/merged", + path_template("/api/v1/users/{address}/markets/merged", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -343,7 +343,7 @@ async def get_merged_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets/merged/lookup", + path_template("/api/v1/users/{address}/markets/merged/lookup", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -395,7 +395,7 @@ async def get_portfolio( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/markets", + path_template("/api/v1/users/{address}/markets", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/neptune_api_v2/resources/user/nept/nept.py b/src/neptune_api_v2/resources/user/nept/nept.py index 09b799b..473d5f1 100644 --- a/src/neptune_api_v2/resources/user/nept/nept.py +++ b/src/neptune_api_v2/resources/user/nept/nept.py @@ -13,7 +13,7 @@ AsyncStakingResourceWithStreamingResponse, ) from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -40,7 +40,7 @@ def with_raw_response(self) -> NeptResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return NeptResourceWithRawResponse(self) @@ -49,7 +49,7 @@ def with_streaming_response(self) -> NeptResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return NeptResourceWithStreamingResponse(self) @@ -90,7 +90,7 @@ def get_unlocks( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/nept/unlocks", + path_template("/api/v1/users/{address}/nept/unlocks", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -120,7 +120,7 @@ def with_raw_response(self) -> AsyncNeptResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncNeptResourceWithRawResponse(self) @@ -129,7 +129,7 @@ def with_streaming_response(self) -> AsyncNeptResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncNeptResourceWithStreamingResponse(self) @@ -170,7 +170,7 @@ async def get_unlocks( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/nept/unlocks", + path_template("/api/v1/users/{address}/nept/unlocks", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/neptune_api_v2/resources/user/nept/staking.py b/src/neptune_api_v2/resources/user/nept/staking.py index 03a5edd..2622988 100644 --- a/src/neptune_api_v2/resources/user/nept/staking.py +++ b/src/neptune_api_v2/resources/user/nept/staking.py @@ -5,7 +5,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -36,7 +36,7 @@ def with_raw_response(self) -> StakingResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return StakingResourceWithRawResponse(self) @@ -45,7 +45,7 @@ def with_streaming_response(self) -> StakingResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return StakingResourceWithStreamingResponse(self) @@ -83,7 +83,7 @@ def get_overview( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/nept/staking", + path_template("/api/v1/users/{address}/nept/staking", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -144,7 +144,7 @@ def get_staking_pool( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/nept/staking/pools/lookup", + path_template("/api/v1/users/{address}/nept/staking/pools/lookup", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -197,7 +197,7 @@ def get_staking_pools( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/nept/staking/pools", + path_template("/api/v1/users/{address}/nept/staking/pools", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -248,7 +248,7 @@ def get_unstaking( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/nept/staking/unstaking", + path_template("/api/v1/users/{address}/nept/staking/unstaking", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -273,7 +273,7 @@ def with_raw_response(self) -> AsyncStakingResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncStakingResourceWithRawResponse(self) @@ -282,7 +282,7 @@ def with_streaming_response(self) -> AsyncStakingResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncStakingResourceWithStreamingResponse(self) @@ -320,7 +320,7 @@ async def get_overview( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/nept/staking", + path_template("/api/v1/users/{address}/nept/staking", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -381,7 +381,7 @@ async def get_staking_pool( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/nept/staking/pools/lookup", + path_template("/api/v1/users/{address}/nept/staking/pools/lookup", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -434,7 +434,7 @@ async def get_staking_pools( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/nept/staking/pools", + path_template("/api/v1/users/{address}/nept/staking/pools", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -485,7 +485,7 @@ async def get_unstaking( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/nept/staking/unstaking", + path_template("/api/v1/users/{address}/nept/staking/unstaking", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/neptune_api_v2/resources/user/user.py b/src/neptune_api_v2/resources/user/user.py index 9afd0d4..bd92efc 100644 --- a/src/neptune_api_v2/resources/user/user.py +++ b/src/neptune_api_v2/resources/user/user.py @@ -17,7 +17,7 @@ ) from ...types import EventAction, user_get_user_params, user_get_tx_history_params from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from .nept.nept import ( NeptResource, @@ -69,7 +69,7 @@ def with_raw_response(self) -> UserResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return UserResourceWithRawResponse(self) @@ -78,7 +78,7 @@ def with_streaming_response(self) -> UserResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return UserResourceWithStreamingResponse(self) @@ -138,7 +138,7 @@ def get_tx_history( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/tx-history", + path_template("/api/v1/users/{address}/tx-history", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -196,7 +196,7 @@ def get_user( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/user", + path_template("/api/v1/users/{address}/user", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -234,7 +234,7 @@ def with_raw_response(self) -> AsyncUserResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncUserResourceWithRawResponse(self) @@ -243,7 +243,7 @@ def with_streaming_response(self) -> AsyncUserResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncUserResourceWithStreamingResponse(self) @@ -303,7 +303,7 @@ async def get_tx_history( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/tx-history", + path_template("/api/v1/users/{address}/tx-history", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -361,7 +361,7 @@ async def get_user( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/user", + path_template("/api/v1/users/{address}/user", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/neptune_api_v2/resources/user/wallet.py b/src/neptune_api_v2/resources/user/wallet.py index 555dd4b..de73d10 100644 --- a/src/neptune_api_v2/resources/user/wallet.py +++ b/src/neptune_api_v2/resources/user/wallet.py @@ -5,7 +5,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -29,7 +29,7 @@ def with_raw_response(self) -> WalletResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return WalletResourceWithRawResponse(self) @@ -38,7 +38,7 @@ def with_streaming_response(self) -> WalletResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return WalletResourceWithStreamingResponse(self) @@ -79,7 +79,7 @@ def get_balance_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/wallet/balance", + path_template("/api/v1/users/{address}/wallet/balance", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -131,7 +131,7 @@ def get_balances( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return self._get( - f"/api/v1/users/{address}/wallet/balances", + path_template("/api/v1/users/{address}/wallet/balances", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -156,7 +156,7 @@ def with_raw_response(self) -> AsyncWalletResourceWithRawResponse: This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#accessing-raw-response-data-eg-headers """ return AsyncWalletResourceWithRawResponse(self) @@ -165,7 +165,7 @@ def with_streaming_response(self) -> AsyncWalletResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/cryptechdev/stainless-api-v2-python#with_streaming_response + For more information, see https://www.github.com/cryptechdev/neptune-api-v2-python#with_streaming_response """ return AsyncWalletResourceWithStreamingResponse(self) @@ -206,7 +206,7 @@ async def get_balance_by_asset( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/wallet/balance", + path_template("/api/v1/users/{address}/wallet/balance", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -258,7 +258,7 @@ async def get_balances( if not address: raise ValueError(f"Expected a non-empty value for `address` but received {address!r}") return await self._get( - f"/api/v1/users/{address}/wallet/balances", + path_template("/api/v1/users/{address}/wallet/balances", address=address), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/neptune_api_v2/types/__init__.py b/src/neptune_api_v2/types/__init__.py index df2e4cb..78878e1 100644 --- a/src/neptune_api_v2/types/__init__.py +++ b/src/neptune_api_v2/types/__init__.py @@ -2,10 +2,17 @@ from __future__ import annotations +from .user import User as User +from .user_tx import UserTx as UserTx from .interval import Interval as Interval from .asset_info import AssetInfo as AssetInfo from .asset_spec import AssetSpec as AssetSpec -from .error_data import ErrorData as ErrorData +from .error_kind import ErrorKind as ErrorKind +from .nept_state import NeptState as NeptState +from .asset_price import AssetPrice as AssetPrice +from .error_scope import ErrorScope as ErrorScope +from .market_rate import MarketRate as MarketRate +from .nept_params import NeptParams as NeptParams from .event_action import EventAction as EventAction from .interval_unit import IntervalUnit as IntervalUnit from .merged_market import MergedMarket as MergedMarket @@ -14,6 +21,7 @@ from .asset_rate_history import AssetRateHistory as AssetRateHistory from .staking_pool_state import StakingPoolState as StakingPoolState from .asset_list_response import AssetListResponse as AssetListResponse +from .asset_price_history import AssetPriceHistory as AssetPriceHistory from .staking_pool_params import StakingPoolParams as StakingPoolParams from .asset_classification import AssetClassification as AssetClassification from .global_market_config import GlobalMarketConfig as GlobalMarketConfig @@ -22,6 +30,7 @@ from .nept_get_params_params import NeptGetParamsParams as NeptGetParamsParams from .user_get_user_response import UserGetUserResponse as UserGetUserResponse from .nept_get_state_response import NeptGetStateResponse as NeptGetStateResponse +from .validation_field_source import ValidationFieldSource as ValidationFieldSource from .asset_list_prices_params import AssetListPricesParams as AssetListPricesParams from .market_get_merged_params import MarketGetMergedParams as MarketGetMergedParams from .market_get_params_params import MarketGetParamsParams as MarketGetParamsParams @@ -35,6 +44,7 @@ from .status_check_health_response import StatusCheckHealthResponse as StatusCheckHealthResponse from .user_get_tx_history_response import UserGetTxHistoryResponse as UserGetTxHistoryResponse from .asset_get_price_history_params import AssetGetPriceHistoryParams as AssetGetPriceHistoryParams +from .nept_unlock_distribution_group import NeptUnlockDistributionGroup as NeptUnlockDistributionGroup from .asset_get_price_history_response import AssetGetPriceHistoryResponse as AssetGetPriceHistoryResponse from .nept_get_staking_overview_params import NeptGetStakingOverviewParams as NeptGetStakingOverviewParams from .market_get_merged_by_asset_params import MarketGetMergedByAssetParams as MarketGetMergedByAssetParams diff --git a/src/neptune_api_v2/types/analytics/__init__.py b/src/neptune_api_v2/types/analytics/__init__.py index 3ab4d39..601cef0 100644 --- a/src/neptune_api_v2/types/analytics/__init__.py +++ b/src/neptune_api_v2/types/analytics/__init__.py @@ -2,4 +2,6 @@ from __future__ import annotations +from .nept_unlocks_distribution_params import NeptUnlocksDistributionParams as NeptUnlocksDistributionParams from .market_get_current_state_response import MarketGetCurrentStateResponse as MarketGetCurrentStateResponse +from .nept_unlocks_distribution_response import NeptUnlocksDistributionResponse as NeptUnlocksDistributionResponse diff --git a/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_params.py b/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_params.py index 8274cf3..c587804 100644 --- a/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_params.py +++ b/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict from ...interval_unit import IntervalUnit @@ -36,7 +37,7 @@ class HistoryGetLoansOriginatedByAssetParams(TypedDict, total=False): Must be provided as unix timestamp (in seconds) """ - asset_ids: str + asset_ids: Optional[str] """Optional comma-separated list of asset IDs to filter for. If excluded, values will be returned for all assets. diff --git a/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_response.py b/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_response.py index 525b2e9..d54dbe9 100644 --- a/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_response.py +++ b/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_by_asset_response.py @@ -6,7 +6,6 @@ from ...._models import BaseModel from ...interval import Interval from ...asset_spec import AssetSpec -from ...error_data import ErrorData __all__ = [ "HistoryGetLoansOriginatedByAssetResponse", @@ -82,14 +81,20 @@ class Data(BaseModel): class HistoryGetLoansOriginatedByAssetResponse(BaseModel): - data: Optional[Data] = None + """Object data success response""" + + data: Data """Historical cumulative lend value for assets""" - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_response.py b/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_response.py index 5a4e6ec..1cd56be 100644 --- a/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_response.py +++ b/src/neptune_api_v2/types/analytics/market/history_get_loans_originated_response.py @@ -5,7 +5,6 @@ from ...._models import BaseModel from ...interval import Interval -from ...error_data import ErrorData __all__ = ["HistoryGetLoansOriginatedResponse", "Data", "DataPagination", "DataPoint", "DataRange"] @@ -58,14 +57,20 @@ class Data(BaseModel): class HistoryGetLoansOriginatedResponse(BaseModel): - data: Optional[Data] = None + """Object data success response""" + + data: Data """Historical cumulative lend value for assets""" - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/analytics/market_get_current_state_response.py b/src/neptune_api_v2/types/analytics/market_get_current_state_response.py index d45e835..1690a67 100644 --- a/src/neptune_api_v2/types/analytics/market_get_current_state_response.py +++ b/src/neptune_api_v2/types/analytics/market_get_current_state_response.py @@ -1,10 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Union from ..._models import BaseModel from ..asset_spec import AssetSpec -from ..error_data import ErrorData __all__ = ["MarketGetCurrentStateResponse", "Data", "DataAsset", "DataLoansOriginated", "DataLoansOriginatedBreakdown"] @@ -43,8 +42,6 @@ class DataLoansOriginated(BaseModel): class Data(BaseModel): - """Object data""" - assets: List[DataAsset] borrower_account_active: int @@ -60,14 +57,19 @@ class Data(BaseModel): class MarketGetCurrentStateResponse(BaseModel): - data: Optional[Data] = None - """Object data""" + """Object data success response""" + + data: Data - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/analytics/nept_unlocks_distribution_params.py b/src/neptune_api_v2/types/analytics/nept_unlocks_distribution_params.py new file mode 100644 index 0000000..f34b588 --- /dev/null +++ b/src/neptune_api_v2/types/analytics/nept_unlocks_distribution_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["NeptUnlocksDistributionParams"] + + +class NeptUnlocksDistributionParams(TypedDict, total=False): + with_percent: bool + """Calculate and include proportional percentages, where applicable""" + + with_text: bool + """Include text variation fields""" + + with_value: bool + """Calculate and include USD values for amounts, where applicable""" diff --git a/src/neptune_api_v2/types/analytics/nept_unlocks_distribution_response.py b/src/neptune_api_v2/types/analytics/nept_unlocks_distribution_response.py new file mode 100644 index 0000000..ab881cc --- /dev/null +++ b/src/neptune_api_v2/types/analytics/nept_unlocks_distribution_response.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from ..nept_unlock_distribution_group import NeptUnlockDistributionGroup + +__all__ = ["NeptUnlocksDistributionResponse", "Data"] + + +class Data(BaseModel): + groups: List[NeptUnlockDistributionGroup] + + +class NeptUnlocksDistributionResponse(BaseModel): + """Object data success response""" + + data: Data + + error: None = None + """Error data. Guaranteed `null` for successful response.""" + + status: int + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ + + status_text: str + """HTTP status text""" diff --git a/src/neptune_api_v2/types/asset_get_price_history_params.py b/src/neptune_api_v2/types/asset_get_price_history_params.py index 7a3d918..8a7f4cf 100644 --- a/src/neptune_api_v2/types/asset_get_price_history_params.py +++ b/src/neptune_api_v2/types/asset_get_price_history_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict from .interval_unit import IntervalUnit @@ -36,7 +37,7 @@ class AssetGetPriceHistoryParams(TypedDict, total=False): Must be provided as unix timestamp (in seconds) """ - asset_ids: str + asset_ids: Optional[str] """Optional comma-separated list of asset IDs to filter for. If excluded, values will be returned for all assets. diff --git a/src/neptune_api_v2/types/asset_get_price_history_response.py b/src/neptune_api_v2/types/asset_get_price_history_response.py index 54f2b5a..ed9ddeb 100644 --- a/src/neptune_api_v2/types/asset_get_price_history_response.py +++ b/src/neptune_api_v2/types/asset_get_price_history_response.py @@ -1,88 +1,26 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime - from .._models import BaseModel -from .interval import Interval -from .asset_spec import AssetSpec -from .error_data import ErrorData - -__all__ = ["AssetGetPriceHistoryResponse", "Data", "DataPagination", "DataRange", "DataSeries", "DataSeriesPoint"] - - -class DataPagination(BaseModel): - """Values used for paginating the time series data""" - - interval_count: int - """ - The total number of intervals/buckets for the provided interval parameters - (size, period, start, end) - """ - - next_offset: Optional[int] = None - """ - The offset a client should use to fetch the next page of intervals (so long as - limit remains unchanged) - """ - - -class DataRange(BaseModel): - """ - Provides values for the requested range in it's entire width, regardless of page/limit. - """ - - end: datetime - - interval: Interval - """Interval period & size""" - - start: datetime - +from .asset_price_history import AssetPriceHistory -class DataSeriesPoint(BaseModel): - """Time + value pair representing a point in time for use with time series""" - - t: datetime - - v: Optional[str] = None - - -class DataSeries(BaseModel): - asset: AssetSpec - """Provides a unique identifier for an asset for use throughout the Neptune API. - - IDs are unique across asset domains (contract tokens, native denoms, etc) - """ - - points: List[DataSeriesPoint] - - -class Data(BaseModel): - """Historical prices for assets""" - - pagination: DataPagination - """Values used for paginating the time series data""" - - range: DataRange - """ - Provides values for the requested range in it's entire width, regardless of - page/limit. - """ - - series: List[DataSeries] - """Pairs of items and their associated points""" +__all__ = ["AssetGetPriceHistoryResponse"] class AssetGetPriceHistoryResponse(BaseModel): - data: Optional[Data] = None + """Object data success response""" + + data: AssetPriceHistory """Historical prices for assets""" - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/asset_list_prices_response.py b/src/neptune_api_v2/types/asset_list_prices_response.py index cae5d25..993366a 100644 --- a/src/neptune_api_v2/types/asset_list_prices_response.py +++ b/src/neptune_api_v2/types/asset_list_prices_response.py @@ -1,46 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from datetime import datetime +from typing import List from .._models import BaseModel from .asset_spec import AssetSpec -from .error_data import ErrorData +from .asset_price import AssetPrice from .asset_metadata import AssetMetadata from .asset_classification import AssetClassification -__all__ = ["AssetListPricesResponse", "Data", "DataPrice", "DataPriceExtra", "DataPriceExtraText"] - - -class DataPriceExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with-text` is `true`. - """ - - last_updated_at: str - - price: str - - -class DataPriceExtra(BaseModel): - text: Optional[DataPriceExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with-text` is `true`. - """ - - -class DataPrice(BaseModel): - """> **Note**: Prices are sourced from Neptune's Price Oracle""" - - extra: DataPriceExtra - - last_updated_at: datetime - """Asset price value, as per Neptune Price Oracle""" - - price: str - """Asset price""" +__all__ = ["AssetListPricesResponse", "Data"] class Data(BaseModel): @@ -68,22 +36,27 @@ class Data(BaseModel): metadata: AssetMetadata """Additional metadata for assets""" - price: DataPrice + price: AssetPrice """> **Note**: Prices are sourced from Neptune's Price Oracle""" class AssetListPricesResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" + + count: int + """Total number of objects irrespective of any pagination parameters.""" - data: Optional[List[Data]] = None - """List contents""" + data: List[Data] - error: Optional[ErrorData] = None - """Error message, if any""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/asset_list_response.py b/src/neptune_api_v2/types/asset_list_response.py index f04686f..b3d758d 100644 --- a/src/neptune_api_v2/types/asset_list_response.py +++ b/src/neptune_api_v2/types/asset_list_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel from .asset_info import AssetInfo -from .error_data import ErrorData __all__ = ["AssetListResponse"] class AssetListResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[AssetInfo]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[AssetInfo] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/asset_price.py b/src/neptune_api_v2/types/asset_price.py new file mode 100644 index 0000000..c635ba1 --- /dev/null +++ b/src/neptune_api_v2/types/asset_price.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from .._models import BaseModel + +__all__ = ["AssetPrice", "Extra", "ExtraText"] + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with-text` is `true`. + """ + + last_updated_at: str + + price: str + + +class Extra(BaseModel): + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with-text` is `true`. + """ + + +class AssetPrice(BaseModel): + """> **Note**: Prices are sourced from Neptune's Price Oracle""" + + extra: Extra + + last_updated_at: datetime + """Asset price value, as per Neptune Price Oracle""" + + price: str + """Asset price""" diff --git a/src/neptune_api_v2/types/asset_price_history.py b/src/neptune_api_v2/types/asset_price_history.py new file mode 100644 index 0000000..cc8a290 --- /dev/null +++ b/src/neptune_api_v2/types/asset_price_history.py @@ -0,0 +1,73 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from .._models import BaseModel +from .interval import Interval +from .asset_spec import AssetSpec + +__all__ = ["AssetPriceHistory", "Pagination", "Range", "Series", "SeriesPoint"] + + +class Pagination(BaseModel): + """Values used for paginating the time series data""" + + interval_count: int + """ + The total number of intervals/buckets for the provided interval parameters + (size, period, start, end) + """ + + next_offset: Optional[int] = None + """ + The offset a client should use to fetch the next page of intervals (so long as + limit remains unchanged) + """ + + +class Range(BaseModel): + """ + Provides values for the requested range in it's entire width, regardless of page/limit. + """ + + end: datetime + + interval: Interval + """Interval period & size""" + + start: datetime + + +class SeriesPoint(BaseModel): + """Time + value pair representing a point in time for use with time series""" + + t: datetime + + v: Optional[str] = None + + +class Series(BaseModel): + asset: AssetSpec + """Provides a unique identifier for an asset for use throughout the Neptune API. + + IDs are unique across asset domains (contract tokens, native denoms, etc) + """ + + points: List[SeriesPoint] + + +class AssetPriceHistory(BaseModel): + """Historical prices for assets""" + + pagination: Pagination + """Values used for paginating the time series data""" + + range: Range + """ + Provides values for the requested range in it's entire width, regardless of + page/limit. + """ + + series: List[Series] + """Pairs of items and their associated points""" diff --git a/src/neptune_api_v2/types/error_data.py b/src/neptune_api_v2/types/error_data.py deleted file mode 100644 index 2a6dfec..0000000 --- a/src/neptune_api_v2/types/error_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["ErrorData", "Field"] - - -class Field(BaseModel): - field: str - - message: str - - -class ErrorData(BaseModel): - fields: Optional[List[Field]] = None - """List of names and error messages for invalid fields. - - Never NULL when `error.kind == 'validation'`. Always NULL for all other cases. - """ - - kind: Literal["invalid_request", "validation", "entity_not_found", "contract", "internal"] - """Error kind/category - - Useful to match against for clients that require custom logic depending on the - type of error encountered - """ - - message: str - """Error message""" - - scope: Literal["user", "client", "server"] - """The scope/region of the error. - - Clients may use this to determine how to handle an error message (e.g. log it to - console or display it to the user). - """ diff --git a/src/neptune_api_v2/types/error_kind.py b/src/neptune_api_v2/types/error_kind.py new file mode 100644 index 0000000..22bfb93 --- /dev/null +++ b/src/neptune_api_v2/types/error_kind.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ErrorKind"] + +ErrorKind: TypeAlias = Literal[ + "entity_not_found", + "path_invalid", + "path_unknown", + "path_parameter_invalid", + "query_invalid", + "query_parameter_invalid", + "query_parameter_unknown", + "query_parameter_missing", + "json_invalid", + "json_decode", + "json_body_deserialize_failure", + "content_type_unsupported", + "validation", + "internal", +] diff --git a/src/neptune_api_v2/types/error_scope.py b/src/neptune_api_v2/types/error_scope.py new file mode 100644 index 0000000..f37ed81 --- /dev/null +++ b/src/neptune_api_v2/types/error_scope.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ErrorScope"] + +ErrorScope: TypeAlias = Literal["user", "client", "server"] diff --git a/src/neptune_api_v2/types/market_get_merged_by_asset_response.py b/src/neptune_api_v2/types/market_get_merged_by_asset_response.py index 49739c3..f4f7b41 100644 --- a/src/neptune_api_v2/types/market_get_merged_by_asset_response.py +++ b/src/neptune_api_v2/types/market_get_merged_by_asset_response.py @@ -1,23 +1,26 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from .._models import BaseModel -from .error_data import ErrorData from .merged_market import MergedMarket __all__ = ["MarketGetMergedByAssetResponse"] class MarketGetMergedByAssetResponse(BaseModel): - data: Optional[MergedMarket] = None + """Object data success response""" + + data: MergedMarket """Data for all of an assets markets""" - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/market_get_merged_response.py b/src/neptune_api_v2/types/market_get_merged_response.py index 01f13d2..48030cf 100644 --- a/src/neptune_api_v2/types/market_get_merged_response.py +++ b/src/neptune_api_v2/types/market_get_merged_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel -from .error_data import ErrorData from .merged_market import MergedMarket __all__ = ["MarketGetMergedResponse"] class MarketGetMergedResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[MergedMarket]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[MergedMarket] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/market_get_overview_response.py b/src/neptune_api_v2/types/market_get_overview_response.py index 33d6848..27c0c45 100644 --- a/src/neptune_api_v2/types/market_get_overview_response.py +++ b/src/neptune_api_v2/types/market_get_overview_response.py @@ -1,9 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel -from .error_data import ErrorData from .markets.lend_market import LendMarket from .global_market_config import GlobalMarketConfig from .markets.borrow_market_overview import BorrowMarketOverview @@ -12,8 +11,6 @@ class Data(BaseModel): - """Object data""" - borrow: BorrowMarketOverview """Borrow market overview""" @@ -25,14 +22,19 @@ class Data(BaseModel): class MarketGetOverviewResponse(BaseModel): - data: Optional[Data] = None - """Object data""" + """Object data success response""" + + data: Data - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/market_get_params_response.py b/src/neptune_api_v2/types/market_get_params_response.py index 99970dd..6f08b8a 100644 --- a/src/neptune_api_v2/types/market_get_params_response.py +++ b/src/neptune_api_v2/types/market_get_params_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from .._models import BaseModel -from .error_data import ErrorData from .global_market_config import GlobalMarketConfig __all__ = ["MarketGetParamsResponse"] class MarketGetParamsResponse(BaseModel): - data: Optional[GlobalMarketConfig] = None - """Object data""" + """Object data success response""" + + data: GlobalMarketConfig - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/market_rate.py b/src/neptune_api_v2/types/market_rate.py similarity index 95% rename from src/neptune_api_v2/types/markets/market_rate.py rename to src/neptune_api_v2/types/market_rate.py index 5dc59d4..ca04c3c 100644 --- a/src/neptune_api_v2/types/markets/market_rate.py +++ b/src/neptune_api_v2/types/market_rate.py @@ -2,7 +2,7 @@ from typing import Optional -from ..._models import BaseModel +from .._models import BaseModel __all__ = ["MarketRate", "Extra", "ExtraText"] diff --git a/src/neptune_api_v2/types/markets/__init__.py b/src/neptune_api_v2/types/markets/__init__.py index f2dc764..d64c771 100644 --- a/src/neptune_api_v2/types/markets/__init__.py +++ b/src/neptune_api_v2/types/markets/__init__.py @@ -3,8 +3,8 @@ from __future__ import annotations from .lend_market import LendMarket as LendMarket -from .market_rate import MarketRate as MarketRate from .lend_list_params import LendListParams as LendListParams +from .lend_market_data import LendMarketData as LendMarketData from .lend_market_state import LendMarketState as LendMarketState from .lend_list_response import LendListResponse as LendListResponse from .borrow_market_overview import BorrowMarketOverview as BorrowMarketOverview diff --git a/src/neptune_api_v2/types/markets/borrow/__init__.py b/src/neptune_api_v2/types/markets/borrow/__init__.py index 389d3a4..221b631 100644 --- a/src/neptune_api_v2/types/markets/borrow/__init__.py +++ b/src/neptune_api_v2/types/markets/borrow/__init__.py @@ -9,10 +9,12 @@ from .debt_list_response import DebtListResponse as DebtListResponse from .collateral_list_params import CollateralListParams as CollateralListParams from .borrow_collateral_state import BorrowCollateralState as BorrowCollateralState +from .borrow_debt_market_data import BorrowDebtMarketData as BorrowDebtMarketData from .borrow_collateral_config import BorrowCollateralConfig as BorrowCollateralConfig from .borrow_collateral_market import BorrowCollateralMarket as BorrowCollateralMarket from .collateral_list_response import CollateralListResponse as CollateralListResponse from .debt_get_by_asset_params import DebtGetByAssetParams as DebtGetByAssetParams from .debt_get_by_asset_response import DebtGetByAssetResponse as DebtGetByAssetResponse +from .borrow_collateral_market_data import BorrowCollateralMarketData as BorrowCollateralMarketData from .collateral_get_by_asset_params import CollateralGetByAssetParams as CollateralGetByAssetParams from .collateral_get_by_asset_response import CollateralGetByAssetResponse as CollateralGetByAssetResponse diff --git a/src/neptune_api_v2/types/markets/borrow/borrow_collateral_market_data.py b/src/neptune_api_v2/types/markets/borrow/borrow_collateral_market_data.py new file mode 100644 index 0000000..33f3361 --- /dev/null +++ b/src/neptune_api_v2/types/markets/borrow/borrow_collateral_market_data.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ...._models import BaseModel +from .borrow_collateral_state import BorrowCollateralState +from .borrow_collateral_config import BorrowCollateralConfig + +__all__ = ["BorrowCollateralMarketData"] + + +class BorrowCollateralMarketData(BaseModel): + config: BorrowCollateralConfig + """Collateral configuration parameters""" + + state: BorrowCollateralState + """Current collateral state""" diff --git a/src/neptune_api_v2/types/markets/borrow/borrow_debt_market.py b/src/neptune_api_v2/types/markets/borrow/borrow_debt_market.py index 51fffed..4adf326 100644 --- a/src/neptune_api_v2/types/markets/borrow/borrow_debt_market.py +++ b/src/neptune_api_v2/types/markets/borrow/borrow_debt_market.py @@ -4,7 +4,7 @@ from ...._models import BaseModel from ...asset_info import AssetInfo -from ..market_rate import MarketRate +from ...market_rate import MarketRate from .borrow_debt_state import BorrowDebtState from .borrow_debt_config import BorrowDebtConfig diff --git a/src/neptune_api_v2/types/markets/borrow/borrow_debt_market_data.py b/src/neptune_api_v2/types/markets/borrow/borrow_debt_market_data.py new file mode 100644 index 0000000..385251b --- /dev/null +++ b/src/neptune_api_v2/types/markets/borrow/borrow_debt_market_data.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel +from ...market_rate import MarketRate +from .borrow_debt_state import BorrowDebtState +from .borrow_debt_config import BorrowDebtConfig + +__all__ = ["BorrowDebtMarketData"] + + +class BorrowDebtMarketData(BaseModel): + config: BorrowDebtConfig + """Debt market configuration parameters""" + + rate: Optional[MarketRate] = None + """Market rates""" + + state: BorrowDebtState + """Current debt market state""" diff --git a/src/neptune_api_v2/types/markets/borrow/collateral_get_by_asset_response.py b/src/neptune_api_v2/types/markets/borrow/collateral_get_by_asset_response.py index 43ff109..1ef8032 100644 --- a/src/neptune_api_v2/types/markets/borrow/collateral_get_by_asset_response.py +++ b/src/neptune_api_v2/types/markets/borrow/collateral_get_by_asset_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ...._models import BaseModel -from ...error_data import ErrorData from .borrow_collateral_market import BorrowCollateralMarket __all__ = ["CollateralGetByAssetResponse"] class CollateralGetByAssetResponse(BaseModel): - data: Optional[BorrowCollateralMarket] = None - """Object data""" + """Object data success response""" + + data: BorrowCollateralMarket - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/borrow/collateral_list_response.py b/src/neptune_api_v2/types/markets/borrow/collateral_list_response.py index 735f761..f1e49c6 100644 --- a/src/neptune_api_v2/types/markets/borrow/collateral_list_response.py +++ b/src/neptune_api_v2/types/markets/borrow/collateral_list_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ...._models import BaseModel -from ...error_data import ErrorData from .borrow_collateral_market import BorrowCollateralMarket __all__ = ["CollateralListResponse"] class CollateralListResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[BorrowCollateralMarket]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[BorrowCollateralMarket] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/borrow/debt_get_by_asset_response.py b/src/neptune_api_v2/types/markets/borrow/debt_get_by_asset_response.py index 8ed45dc..8ef143a 100644 --- a/src/neptune_api_v2/types/markets/borrow/debt_get_by_asset_response.py +++ b/src/neptune_api_v2/types/markets/borrow/debt_get_by_asset_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ...._models import BaseModel -from ...error_data import ErrorData from .borrow_debt_market import BorrowDebtMarket __all__ = ["DebtGetByAssetResponse"] class DebtGetByAssetResponse(BaseModel): - data: Optional[BorrowDebtMarket] = None - """Object data""" + """Object data success response""" + + data: BorrowDebtMarket - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/borrow/debt_list_response.py b/src/neptune_api_v2/types/markets/borrow/debt_list_response.py index 03dec36..4c79060 100644 --- a/src/neptune_api_v2/types/markets/borrow/debt_list_response.py +++ b/src/neptune_api_v2/types/markets/borrow/debt_list_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ...._models import BaseModel -from ...error_data import ErrorData from .borrow_debt_market import BorrowDebtMarket __all__ = ["DebtListResponse"] class DebtListResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[BorrowDebtMarket]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[BorrowDebtMarket] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/borrow_get_overview_response.py b/src/neptune_api_v2/types/markets/borrow_get_overview_response.py index 9f03107..027ed45 100644 --- a/src/neptune_api_v2/types/markets/borrow_get_overview_response.py +++ b/src/neptune_api_v2/types/markets/borrow_get_overview_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ..._models import BaseModel -from ..error_data import ErrorData from .borrow_market_overview import BorrowMarketOverview __all__ = ["BorrowGetOverviewResponse"] class BorrowGetOverviewResponse(BaseModel): - data: Optional[BorrowMarketOverview] = None - """Object data""" + """Object data success response""" + + data: BorrowMarketOverview - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/borrow_get_rate_history_params.py b/src/neptune_api_v2/types/markets/borrow_get_rate_history_params.py index 23d457b..df6ca37 100644 --- a/src/neptune_api_v2/types/markets/borrow_get_rate_history_params.py +++ b/src/neptune_api_v2/types/markets/borrow_get_rate_history_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict from ..interval_unit import IntervalUnit @@ -36,7 +37,7 @@ class BorrowGetRateHistoryParams(TypedDict, total=False): Must be provided as unix timestamp (in seconds) """ - asset_ids: str + asset_ids: Optional[str] """Optional comma-separated list of asset IDs to filter for. If excluded, values will be returned for all assets. diff --git a/src/neptune_api_v2/types/markets/borrow_get_rate_history_response.py b/src/neptune_api_v2/types/markets/borrow_get_rate_history_response.py index dd21c45..cb43c85 100644 --- a/src/neptune_api_v2/types/markets/borrow_get_rate_history_response.py +++ b/src/neptune_api_v2/types/markets/borrow_get_rate_history_response.py @@ -1,23 +1,26 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ..._models import BaseModel -from ..error_data import ErrorData from ..asset_rate_history import AssetRateHistory __all__ = ["BorrowGetRateHistoryResponse"] class BorrowGetRateHistoryResponse(BaseModel): - data: Optional[AssetRateHistory] = None + """Object data success response""" + + data: AssetRateHistory """Historical rates for assets""" - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/lend_get_by_asset_response.py b/src/neptune_api_v2/types/markets/lend_get_by_asset_response.py index 5fb685d..9b7c1f2 100644 --- a/src/neptune_api_v2/types/markets/lend_get_by_asset_response.py +++ b/src/neptune_api_v2/types/markets/lend_get_by_asset_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ..._models import BaseModel -from ..error_data import ErrorData from .lend_market import LendMarket __all__ = ["LendGetByAssetResponse"] class LendGetByAssetResponse(BaseModel): - data: Optional[LendMarket] = None - """Object data""" + """Object data success response""" + + data: LendMarket - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/lend_get_rate_history_params.py b/src/neptune_api_v2/types/markets/lend_get_rate_history_params.py index a3bcd6c..29825d6 100644 --- a/src/neptune_api_v2/types/markets/lend_get_rate_history_params.py +++ b/src/neptune_api_v2/types/markets/lend_get_rate_history_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict from ..interval_unit import IntervalUnit @@ -36,7 +37,7 @@ class LendGetRateHistoryParams(TypedDict, total=False): Must be provided as unix timestamp (in seconds) """ - asset_ids: str + asset_ids: Optional[str] """Optional comma-separated list of asset IDs to filter for. If excluded, values will be returned for all assets. diff --git a/src/neptune_api_v2/types/markets/lend_get_rate_history_response.py b/src/neptune_api_v2/types/markets/lend_get_rate_history_response.py index ba67c7e..59deeae 100644 --- a/src/neptune_api_v2/types/markets/lend_get_rate_history_response.py +++ b/src/neptune_api_v2/types/markets/lend_get_rate_history_response.py @@ -1,23 +1,26 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ..._models import BaseModel -from ..error_data import ErrorData from ..asset_rate_history import AssetRateHistory __all__ = ["LendGetRateHistoryResponse"] class LendGetRateHistoryResponse(BaseModel): - data: Optional[AssetRateHistory] = None + """Object data success response""" + + data: AssetRateHistory """Historical rates for assets""" - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/lend_list_response.py b/src/neptune_api_v2/types/markets/lend_list_response.py index 613e43b..40d25fd 100644 --- a/src/neptune_api_v2/types/markets/lend_list_response.py +++ b/src/neptune_api_v2/types/markets/lend_list_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ..._models import BaseModel -from ..error_data import ErrorData from .lend_market import LendMarket __all__ = ["LendListResponse"] class LendListResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[LendMarket]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[LendMarket] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/markets/lend_market.py b/src/neptune_api_v2/types/markets/lend_market.py index 05e6918..77c468f 100644 --- a/src/neptune_api_v2/types/markets/lend_market.py +++ b/src/neptune_api_v2/types/markets/lend_market.py @@ -4,7 +4,7 @@ from ..._models import BaseModel from ..asset_info import AssetInfo -from .market_rate import MarketRate +from ..market_rate import MarketRate from .lend_market_state import LendMarketState __all__ = ["LendMarket"] diff --git a/src/neptune_api_v2/types/markets/lend_market_data.py b/src/neptune_api_v2/types/markets/lend_market_data.py new file mode 100644 index 0000000..de79a04 --- /dev/null +++ b/src/neptune_api_v2/types/markets/lend_market_data.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from ..market_rate import MarketRate +from .lend_market_state import LendMarketState + +__all__ = ["LendMarketData"] + + +class LendMarketData(BaseModel): + rate: Optional[MarketRate] = None + """Lending market rates""" + + state: LendMarketState + """Current lending market state""" diff --git a/src/neptune_api_v2/types/merged_market.py b/src/neptune_api_v2/types/merged_market.py index 97f494c..98b1e68 100644 --- a/src/neptune_api_v2/types/merged_market.py +++ b/src/neptune_api_v2/types/merged_market.py @@ -4,47 +4,11 @@ from .._models import BaseModel from .asset_info import AssetInfo -from .markets.market_rate import MarketRate -from .markets.lend_market_state import LendMarketState -from .markets.borrow.borrow_debt_state import BorrowDebtState -from .markets.borrow.borrow_debt_config import BorrowDebtConfig -from .markets.borrow.borrow_collateral_state import BorrowCollateralState -from .markets.borrow.borrow_collateral_config import BorrowCollateralConfig +from .markets.lend_market_data import LendMarketData +from .markets.borrow.borrow_debt_market_data import BorrowDebtMarketData +from .markets.borrow.borrow_collateral_market_data import BorrowCollateralMarketData -__all__ = ["MergedMarket", "BorrowCollateral", "BorrowDebt", "Lend"] - - -class BorrowCollateral(BaseModel): - """Info for asset as collateral for borrow market, if one exists""" - - config: BorrowCollateralConfig - """Collateral configuration parameters""" - - state: BorrowCollateralState - """Current collateral state""" - - -class BorrowDebt(BaseModel): - """Info for asset as debt for borrow market, if one exists""" - - config: BorrowDebtConfig - """Debt market configuration parameters""" - - rate: Optional[MarketRate] = None - """Market rates""" - - state: BorrowDebtState - """Current debt market state""" - - -class Lend(BaseModel): - """Info for asset's lending market, if one exists""" - - rate: Optional[MarketRate] = None - """Lending market rates""" - - state: LendMarketState - """Current lending market state""" +__all__ = ["MergedMarket"] class MergedMarket(BaseModel): @@ -53,11 +17,11 @@ class MergedMarket(BaseModel): asset_info: AssetInfo """Asset identifiers with associated metadata""" - borrow_collateral: Optional[BorrowCollateral] = None + borrow_collateral: Optional[BorrowCollateralMarketData] = None """Info for asset as collateral for borrow market, if one exists""" - borrow_debt: Optional[BorrowDebt] = None + borrow_debt: Optional[BorrowDebtMarketData] = None """Info for asset as debt for borrow market, if one exists""" - lend: Optional[Lend] = None + lend: Optional[LendMarketData] = None """Info for asset's lending market, if one exists""" diff --git a/src/neptune_api_v2/types/nept_get_params_response.py b/src/neptune_api_v2/types/nept_get_params_response.py index e5b9373..e246773 100644 --- a/src/neptune_api_v2/types/nept_get_params_response.py +++ b/src/neptune_api_v2/types/nept_get_params_response.py @@ -1,137 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional - from .._models import BaseModel -from .error_data import ErrorData -from .staking_pool_params import StakingPoolParams - -__all__ = [ - "NeptGetParamsResponse", - "Data", - "DataExtra", - "DataExtraText", - "DataExtraValue", - "DataExtraValueExtra", - "DataExtraValueExtraText", - "DataStakingPool", - "DataStakingPoolExtra", - "DataStakingPoolExtraText", -] - - -class DataExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - emission_rate: str +from .nept_params import NeptParams +__all__ = ["NeptGetParamsResponse"] -class DataExtraValueExtraText(BaseModel): - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - emission_rate: str - - -class DataExtraValueExtra(BaseModel): - text: Optional[DataExtraValueExtraText] = None - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - -class DataExtraValue(BaseModel): - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - emission_rate: str - - extra: DataExtraValueExtra - - -class DataExtra(BaseModel): - text: Optional[DataExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - value: Optional[DataExtraValue] = None - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ +class NeptGetParamsResponse(BaseModel): + """Object data success response""" -class DataStakingPoolExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - duration: str - - index: str - - -class DataStakingPoolExtra(BaseModel): - text: Optional[DataStakingPoolExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - -class DataStakingPool(BaseModel): - """Merges `StakingPool` with `StakingPoolParams`""" - - duration: int - """The lockup duration for this pool in seconds""" - - extra: DataStakingPoolExtra - - index: int - """The ordered index (position) of this pool""" - - params: StakingPoolParams - """-- Staking pool contract parameters""" - - -class Data(BaseModel): - """Object data""" - - emission_rate: str - """The emission rate of NEPT in tokens per year""" - - extra: DataExtra + data: NeptParams - staking_pools: List[DataStakingPool] - """Staking pools (pool params are included)""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" - tokens_per_weight: int - """Weight:token scaling factor + status: int + """HTTP status. - This is defined in the contract spec to mitigate library type restrictions + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. """ - -class NeptGetParamsResponse(BaseModel): - data: Optional[Data] = None - """Object data""" - - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" - - status: int - """Request status""" - status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/nept_get_staking_overview_response.py b/src/neptune_api_v2/types/nept_get_staking_overview_response.py index 2c2a97e..8badf4a 100644 --- a/src/neptune_api_v2/types/nept_get_staking_overview_response.py +++ b/src/neptune_api_v2/types/nept_get_staking_overview_response.py @@ -5,7 +5,6 @@ from .._models import BaseModel from .asset_info import AssetInfo -from .error_data import ErrorData from .staking_pool_full import StakingPoolFull __all__ = [ @@ -43,15 +42,13 @@ class DataGlobalState(BaseModel): """When staking rewards were last distributed""" stake_acc: str - """**TODO:** rename, proper description + """**! TODO:** rename, proper description, text/value? stake_acc = ∫ ( emission_rate / total_reward_weight ) dt """ class Data(BaseModel): - """Object data""" - asset_info: AssetInfo """Asset identifiers with associated metadata""" @@ -66,14 +63,19 @@ class Data(BaseModel): class NeptGetStakingOverviewResponse(BaseModel): - data: Optional[Data] = None - """Object data""" + """Object data success response""" + + data: Data - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/nept_get_state_response.py b/src/neptune_api_v2/types/nept_get_state_response.py index 5332039..8594aa7 100644 --- a/src/neptune_api_v2/types/nept_get_state_response.py +++ b/src/neptune_api_v2/types/nept_get_state_response.py @@ -1,170 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional - from .._models import BaseModel -from .error_data import ErrorData -from .staking_pool_state import StakingPoolState - -__all__ = [ - "NeptGetStateResponse", - "Data", - "DataExtra", - "DataExtraText", - "DataExtraValue", - "DataExtraValueExtra", - "DataExtraValueExtraText", - "DataStaking", - "DataStakingExtra", - "DataStakingExtraText", -] - - -class DataExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - total_claimed: str - - total_issued: str - - total_locked: str - - total_supply: str - - -class DataExtraValueExtraText(BaseModel): - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - total_claimed: str - - total_issued: str - - total_locked: str - - total_supply: str - - -class DataExtraValueExtra(BaseModel): - text: Optional[DataExtraValueExtraText] = None - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - -class DataExtraValue(BaseModel): - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - extra: DataExtraValueExtra - - total_claimed: str - - total_issued: str - - total_locked: str - - total_supply: str - - -class DataExtra(BaseModel): - text: Optional[DataExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ +from .nept_state import NeptState - value: Optional[DataExtraValue] = None - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - -class DataStakingExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - duration: str - - index: str - - -class DataStakingExtra(BaseModel): - text: Optional[DataStakingExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - -class DataStaking(BaseModel): - """Merges `StakingPool` with `StakingPoolState`""" - - duration: int - """The lockup duration for this pool in seconds""" - - extra: DataStakingExtra - - index: int - """The ordered index (position) of this pool""" - - state: StakingPoolState - """-- Current contract state of staking pool""" +__all__ = ["NeptGetStateResponse"] -class Data(BaseModel): - """Object data""" - - extra: DataExtra - - staking: List[DataStaking] - """Staking pools (current pool state is included)""" - - total_claimed: str - """Total amount of NEPT claimed, either locked or unlocked - - Includes initial balances and claimed rewards but not unclaimed rewards - """ - - total_issued: str - """Total amount of NEPT issued, either locked or unlocked +class NeptGetStateResponse(BaseModel): + """Object data success response""" - Includes initial balances and all claimed or claimable rewards - """ + data: NeptState - total_locked: str - """Total amount of NEPT locked + error: None = None + """Error data. Guaranteed `null` for successful response.""" - Inlcudes unlocks which have not yet been claimed - """ - - total_supply: str - """Total supply of NEPT + status: int + """HTTP status. - Includes locked and unissued tokens + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. """ - -class NeptGetStateResponse(BaseModel): - data: Optional[Data] = None - """Object data""" - - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" - - status: int - """Request status""" - status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/nept_params.py b/src/neptune_api_v2/types/nept_params.py new file mode 100644 index 0000000..714a0a2 --- /dev/null +++ b/src/neptune_api_v2/types/nept_params.py @@ -0,0 +1,119 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .staking_pool_params import StakingPoolParams + +__all__ = [ + "NeptParams", + "Extra", + "ExtraText", + "ExtraValue", + "ExtraValueExtra", + "ExtraValueExtraText", + "StakingPool", + "StakingPoolExtra", + "StakingPoolExtraText", +] + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + emission_rate: str + + +class ExtraValueExtraText(BaseModel): + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + emission_rate: str + + +class ExtraValueExtra(BaseModel): + text: Optional[ExtraValueExtraText] = None + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + +class ExtraValue(BaseModel): + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + emission_rate: str + + extra: ExtraValueExtra + + +class Extra(BaseModel): + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + value: Optional[ExtraValue] = None + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + +class StakingPoolExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + duration: str + + index: str + + +class StakingPoolExtra(BaseModel): + text: Optional[StakingPoolExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + +class StakingPool(BaseModel): + """Merges `StakingPool` with `StakingPoolParams`""" + + duration: int + """The lockup duration for this pool in seconds""" + + extra: StakingPoolExtra + + index: int + """The ordered index (position) of this pool""" + + params: StakingPoolParams + """Staking pool contract parameters""" + + +class NeptParams(BaseModel): + emission_rate: str + """The emission rate of NEPT in tokens per year""" + + extra: Extra + + staking_pools: List[StakingPool] + """Staking pools (pool params are included)""" + + tokens_per_weight: int + """Weight:token scaling factor + + This is defined in the contract spec to mitigate library type restrictions + """ diff --git a/src/neptune_api_v2/types/nept_state.py b/src/neptune_api_v2/types/nept_state.py new file mode 100644 index 0000000..59c6a2a --- /dev/null +++ b/src/neptune_api_v2/types/nept_state.py @@ -0,0 +1,152 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .staking_pool_state import StakingPoolState + +__all__ = [ + "NeptState", + "Extra", + "ExtraText", + "ExtraValue", + "ExtraValueExtra", + "ExtraValueExtraText", + "Staking", + "StakingExtra", + "StakingExtraText", +] + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + total_claimed: str + + total_issued: str + + total_locked: str + + total_supply: str + + +class ExtraValueExtraText(BaseModel): + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + total_claimed: str + + total_issued: str + + total_locked: str + + total_supply: str + + +class ExtraValueExtra(BaseModel): + text: Optional[ExtraValueExtraText] = None + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + +class ExtraValue(BaseModel): + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + extra: ExtraValueExtra + + total_claimed: str + + total_issued: str + + total_locked: str + + total_supply: str + + +class Extra(BaseModel): + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + value: Optional[ExtraValue] = None + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + +class StakingExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + duration: str + + index: str + + +class StakingExtra(BaseModel): + text: Optional[StakingExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + +class Staking(BaseModel): + """Merges `StakingPool` with `StakingPoolState`""" + + duration: int + """The lockup duration for this pool in seconds""" + + extra: StakingExtra + + index: int + """The ordered index (position) of this pool""" + + state: StakingPoolState + """Current contract state of staking pool""" + + +class NeptState(BaseModel): + extra: Extra + + staking: List[Staking] + """Staking pools (current pool state is included)""" + + total_claimed: str + """Total amount of NEPT claimed, either locked or unlocked + + Includes initial balances and claimed rewards but not unclaimed rewards + """ + + total_issued: str + """Total amount of NEPT issued, either locked or unlocked + + Includes initial balances and all claimed or claimable rewards + """ + + total_locked: str + """Total amount of NEPT locked + + Inlcudes unlocks which have not yet been claimed + """ + + total_supply: str + """Total supply of NEPT + + Includes locked and unissued tokens + """ diff --git a/src/neptune_api_v2/types/nept_unlock_distribution_group.py b/src/neptune_api_v2/types/nept_unlock_distribution_group.py new file mode 100644 index 0000000..9316443 --- /dev/null +++ b/src/neptune_api_v2/types/nept_unlock_distribution_group.py @@ -0,0 +1,258 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = [ + "NeptUnlockDistributionGroup", + "Extra", + "ExtraPercent", + "ExtraPercentExtra", + "ExtraPercentExtraText", + "ExtraText", + "ExtraValue", + "ExtraValueExtra", + "ExtraValueExtraText", +] + + +class ExtraPercentExtraText(BaseModel): + """Human-readable variants of percentages for unlock amounts. + + Will not be null when query params `with_text` and `with_percent` are `true`. + """ + + amount_claimable: str + + amount_claimed: str + + amount_expired: str + + amount_locked: str + + amount_reclaimed: str + + amount_unlocked: str + + +class ExtraPercentExtra(BaseModel): + text: Optional[ExtraPercentExtraText] = None + """Human-readable variants of percentages for unlock amounts. + + Will not be null when query params `with_text` and `with_percent` are `true`. + """ + + +class ExtraPercent(BaseModel): + """Percentages for unlock amounts. + + These do not factor in the `amount_staked` or `amount_held` values. Will not be null when query param `with_percent` is `true`. + """ + + amount_claimable: str + + amount_claimed: str + + amount_expired: str + + amount_locked: str + + amount_reclaimed: str + + amount_unlocked: str + + extra: ExtraPercentExtra + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + amount: str + + amount_claimable: str + + amount_claimed: str + + amount_expired: str + + amount_held: str + + amount_locked: str + + amount_reclaimed: str + + amount_staked: str + + amount_unlocked: str + + member_class: str + + +class ExtraValueExtraText(BaseModel): + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + amount: str + + amount_claimable: str + + amount_claimed: str + + amount_expired: str + + amount_held: str + + amount_locked: str + + amount_reclaimed: str + + amount_staked: str + + amount_unlocked: str + + +class ExtraValueExtra(BaseModel): + text: Optional[ExtraValueExtraText] = None + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + +class ExtraValue(BaseModel): + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + amount: str + + amount_claimable: str + + amount_claimed: str + + amount_expired: str + + amount_held: str + + amount_locked: str + + amount_reclaimed: str + + amount_staked: str + + amount_unlocked: str + + extra: ExtraValueExtra + + +class Extra(BaseModel): + percent: Optional[ExtraPercent] = None + """Percentages for unlock amounts. + + These do not factor in the `amount_staked` or `amount_held` values. Will not be + null when query param `with_percent` is `true`. + """ + + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + value: Optional[ExtraValue] = None + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + +class NeptUnlockDistributionGroup(BaseModel): + amount: str + """The sum of all token distribution unlock amounts for this group. + + This value is immutable and does not change with regards to + expiry/reclamation/lock states. + """ + + amount_claimable: str + """The amount currently claimable + + This takes into account: reclamation, lock state, expiry, and previously + claimed. In other words, this is an accurate representation of what the user can + currently claim. + """ + + amount_claimed: str + """The amount that has already been successfully claimed by the user""" + + amount_expired: str + """The amount that has expired. + + This will be the remaining unclaimed amount (if any) once the time specified by + the `expires_at` is past (if one is set). + + **NOTE:** Reclaimed amouts take priority. + + - If the remaining amount is reclaimed prior to a configured `expires_at`, this + will remain at 0 and will not change even after the `expires_at` time is + reached. + """ + + amount_held: str + """The total amount of NEPT currently held by the addresses in this group.""" + + amount_locked: str + """The total amount of NEPT currently time-locked. + + **NOTE:** This does not factor in reclaimed or expired states. + + - For linear unlock schedules: + + - This represents how much NEPT is time-locked by the `begins_at` and the + `ends_at` properties. + + - For lump sum unlocks: + - This will be the full amount prior to the `begins_at` unlock property. + - Once the time indicated by the `begins_at` property has been reached, this + value will be 0. + """ + + amount_reclaimed: str + """The amount that has been reclaimed from the unlock arrangement admin + + This will be the amount of the remaining unclaimed and locked at the time the + reclaim is issued. + """ + + amount_staked: str + """The total amount of NEPT current staked by the addresses in this group.""" + + amount_unlocked: str + """The total amount of NEPT currently unlocked + + **NOTE:** This does not factor in reclaimed or expired states. + + - For linear unlock schedules: + + - This represents the "progress" of unlocked NEPT from the time range between + the `begins_at` and the `ends_at` properties. + + - For lump sum unlocks: + - This will be 0 at any given time prior to the timestamp provided by the + `begins_at` unlock property. + - Once the time indicated by the `begins_at` property has been reached, this + value will be the full amount of the unlock. + """ + + extra: Extra + + member_class: Literal["team", "advisor", "investor"] + """The group category""" diff --git a/src/neptune_api_v2/types/staking_pool_full.py b/src/neptune_api_v2/types/staking_pool_full.py index 2424e9c..bd003a1 100644 --- a/src/neptune_api_v2/types/staking_pool_full.py +++ b/src/neptune_api_v2/types/staking_pool_full.py @@ -40,7 +40,7 @@ class StakingPoolFull(BaseModel): """The ordered index (position) of this pool""" params: StakingPoolParams - """-- Staking pool contract parameters""" + """Staking pool contract parameters""" state: StakingPoolState - """-- Current contract state of staking pool""" + """Current contract state of staking pool""" diff --git a/src/neptune_api_v2/types/user/__init__.py b/src/neptune_api_v2/types/user/__init__.py index 18aa241..0b53244 100644 --- a/src/neptune_api_v2/types/user/__init__.py +++ b/src/neptune_api_v2/types/user/__init__.py @@ -2,21 +2,27 @@ from __future__ import annotations +from .user import User as User from .user_market import UserMarket as UserMarket +from .wallet_asset import WalletAsset as WalletAsset from .wallet_balance import WalletBalance as WalletBalance from .user_merged_market import UserMergedMarket as UserMergedMarket from .wallet_asset_known import WalletAssetKnown as WalletAssetKnown +from .user_unlock_amounts import UserUnlockAmounts as UserUnlockAmounts +from .user_unlock_overview import UserUnlockOverview as UserUnlockOverview +from .user_unlock_schedule import UserUnlockSchedule as UserUnlockSchedule +from .wallet_asset_unknown import WalletAssetUnknown as WalletAssetUnknown from .user_wallet_portfolio import UserWalletPortfolio as UserWalletPortfolio from .nept_get_unlocks_params import NeptGetUnlocksParams as NeptGetUnlocksParams from .market_get_merged_params import MarketGetMergedParams as MarketGetMergedParams -from .user_nept_unlock_amounts import UserNeptUnlockAmounts as UserNeptUnlockAmounts from .nept_get_unlocks_response import NeptGetUnlocksResponse as NeptGetUnlocksResponse -from .user_nept_unlock_overview import UserNeptUnlockOverview as UserNeptUnlockOverview from .market_get_merged_response import MarketGetMergedResponse as MarketGetMergedResponse from .wallet_get_balances_params import WalletGetBalancesParams as WalletGetBalancesParams from .market_get_portfolio_params import MarketGetPortfolioParams as MarketGetPortfolioParams +from .user_unlock_schedule_linear import UserUnlockScheduleLinear as UserUnlockScheduleLinear from .wallet_get_balances_response import WalletGetBalancesResponse as WalletGetBalancesResponse from .market_get_portfolio_response import MarketGetPortfolioResponse as MarketGetPortfolioResponse +from .user_unlock_schedule_lump_sum import UserUnlockScheduleLumpSum as UserUnlockScheduleLumpSum from .market_get_merged_by_asset_params import MarketGetMergedByAssetParams as MarketGetMergedByAssetParams from .wallet_get_balance_by_asset_params import WalletGetBalanceByAssetParams as WalletGetBalanceByAssetParams from .market_get_merged_by_asset_response import MarketGetMergedByAssetResponse as MarketGetMergedByAssetResponse diff --git a/src/neptune_api_v2/types/user/market/__init__.py b/src/neptune_api_v2/types/user/market/__init__.py index f1012a9..0f686ae 100644 --- a/src/neptune_api_v2/types/user/market/__init__.py +++ b/src/neptune_api_v2/types/user/market/__init__.py @@ -3,10 +3,11 @@ from __future__ import annotations from .lend_list_params import LendListParams as LendListParams +from .user_lend_market import UserLendMarket as UserLendMarket from .lend_list_response import LendListResponse as LendListResponse from .user_borrow_market import UserBorrowMarket as UserBorrowMarket -from .user_debt_asset_pool import UserDebtAssetPool as UserDebtAssetPool from .lend_get_by_asset_params import LendGetByAssetParams as LendGetByAssetParams +from .user_borrow_market_pools import UserBorrowMarketPools as UserBorrowMarketPools from .lend_get_by_asset_response import LendGetByAssetResponse as LendGetByAssetResponse from .borrow_get_portfolio_params import BorrowGetPortfolioParams as BorrowGetPortfolioParams from .borrow_get_portfolio_response import BorrowGetPortfolioResponse as BorrowGetPortfolioResponse diff --git a/src/neptune_api_v2/types/user/market/borrow/__init__.py b/src/neptune_api_v2/types/user/market/borrow/__init__.py index c12083c..6418b4a 100644 --- a/src/neptune_api_v2/types/user/market/borrow/__init__.py +++ b/src/neptune_api_v2/types/user/market/borrow/__init__.py @@ -3,8 +3,11 @@ from __future__ import annotations from .user_account_health import UserAccountHealth as UserAccountHealth +from .user_debt_asset_pool import UserDebtAssetPool as UserDebtAssetPool +from .user_debt_account_pool import UserDebtAccountPool as UserDebtAccountPool from .user_borrow_market_account import UserBorrowMarketAccount as UserBorrowMarketAccount from .user_collateral_asset_pool import UserCollateralAssetPool as UserCollateralAssetPool +from .user_collateral_account_pool import UserCollateralAccountPool as UserCollateralAccountPool from .subaccount_get_subaccount_params import SubaccountGetSubaccountParams as SubaccountGetSubaccountParams from .subaccount_get_subaccount_response import SubaccountGetSubaccountResponse as SubaccountGetSubaccountResponse from .subaccount_get_subaccount_debts_params import ( diff --git a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_collaterals_response.py b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_collaterals_response.py index 9b8666d..6cb10c5 100644 --- a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_collaterals_response.py +++ b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_collaterals_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ....._models import BaseModel -from ....error_data import ErrorData from .user_collateral_asset_pool import UserCollateralAssetPool __all__ = ["SubaccountGetSubaccountCollateralsResponse"] class SubaccountGetSubaccountCollateralsResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[UserCollateralAssetPool]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[UserCollateralAssetPool] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_debts_response.py b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_debts_response.py index 3e5e085..d6709bf 100644 --- a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_debts_response.py +++ b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_debts_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ....._models import BaseModel -from ....error_data import ErrorData -from ..user_debt_asset_pool import UserDebtAssetPool +from .user_debt_asset_pool import UserDebtAssetPool __all__ = ["SubaccountGetSubaccountDebtsResponse"] class SubaccountGetSubaccountDebtsResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[UserDebtAssetPool]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[UserDebtAssetPool] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_health_params.py b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_health_params.py index 4208ca4..d423946 100644 --- a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_health_params.py +++ b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_health_params.py @@ -13,6 +13,3 @@ class SubaccountGetSubaccountHealthParams(TypedDict, total=False): with_text: bool """Include text variation fields""" - - with_value: bool - """Calculate and include USD values for amounts, where applicable""" diff --git a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_health_response.py b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_health_response.py index e9c75d4..fd48d28 100644 --- a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_health_response.py +++ b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_health_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ....._models import BaseModel -from ....error_data import ErrorData from .user_account_health import UserAccountHealth __all__ = ["SubaccountGetSubaccountHealthResponse"] class SubaccountGetSubaccountHealthResponse(BaseModel): - data: Optional[UserAccountHealth] = None - """Object data""" + """Object data success response""" + + data: UserAccountHealth - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_response.py b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_response.py index 21ef2ec..993fcb7 100644 --- a/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_response.py +++ b/src/neptune_api_v2/types/user/market/borrow/subaccount_get_subaccount_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ....._models import BaseModel -from ....error_data import ErrorData from .user_borrow_market_account import UserBorrowMarketAccount __all__ = ["SubaccountGetSubaccountResponse"] class SubaccountGetSubaccountResponse(BaseModel): - data: Optional[UserBorrowMarketAccount] = None - """Object data""" + """Object data success response""" + + data: UserBorrowMarketAccount - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/borrow/user_borrow_market_account.py b/src/neptune_api_v2/types/user/market/borrow/user_borrow_market_account.py index be5491c..19ebffd 100644 --- a/src/neptune_api_v2/types/user/market/borrow/user_borrow_market_account.py +++ b/src/neptune_api_v2/types/user/market/borrow/user_borrow_market_account.py @@ -4,7 +4,7 @@ from ....._models import BaseModel from .user_account_health import UserAccountHealth -from ..user_debt_asset_pool import UserDebtAssetPool +from .user_debt_asset_pool import UserDebtAssetPool from .user_collateral_asset_pool import UserCollateralAssetPool __all__ = ["UserBorrowMarketAccount"] diff --git a/src/neptune_api_v2/types/user/market/borrow/user_collateral_account_pool.py b/src/neptune_api_v2/types/user/market/borrow/user_collateral_account_pool.py new file mode 100644 index 0000000..67f11af --- /dev/null +++ b/src/neptune_api_v2/types/user/market/borrow/user_collateral_account_pool.py @@ -0,0 +1,68 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ....._models import BaseModel + +__all__ = ["UserCollateralAccountPool", "Extra", "ExtraText", "ExtraValue", "ExtraValueExtra", "ExtraValueExtraText"] + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + amount: str + + +class ExtraValueExtraText(BaseModel): + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + amount: str + + +class ExtraValueExtra(BaseModel): + text: Optional[ExtraValueExtraText] = None + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + +class ExtraValue(BaseModel): + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + amount: str + + extra: ExtraValueExtra + + +class Extra(BaseModel): + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + value: Optional[ExtraValue] = None + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + +class UserCollateralAccountPool(BaseModel): + amount: str + """Amount of this asset which is actively collateralized""" + + extra: Extra + + index: int + """Account index""" diff --git a/src/neptune_api_v2/types/user/market/borrow/user_debt_account_pool.py b/src/neptune_api_v2/types/user/market/borrow/user_debt_account_pool.py new file mode 100644 index 0000000..74931f5 --- /dev/null +++ b/src/neptune_api_v2/types/user/market/borrow/user_debt_account_pool.py @@ -0,0 +1,86 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ....._models import BaseModel + +__all__ = ["UserDebtAccountPool", "Extra", "ExtraText", "ExtraValue", "ExtraValueExtra", "ExtraValueExtraText"] + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + debt: str + + interest: str + + principal: str + + +class ExtraValueExtraText(BaseModel): + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + debt: str + + interest: str + + principal: str + + +class ExtraValueExtra(BaseModel): + text: Optional[ExtraValueExtraText] = None + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + +class ExtraValue(BaseModel): + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + debt: str + + extra: ExtraValueExtra + + interest: str + + principal: str + + +class Extra(BaseModel): + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + value: Optional[ExtraValue] = None + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + +class UserDebtAccountPool(BaseModel): + debt: str + """Sum open debt amount (this is simply the principal + interest)""" + + extra: Extra + + index: int + """Account index""" + + interest: str + """Sum of accrued interest for open debt position""" + + principal: str + """Initial amount borrowed (of debts which have not yet been repaid)""" diff --git a/src/neptune_api_v2/types/user/market/user_debt_asset_pool.py b/src/neptune_api_v2/types/user/market/borrow/user_debt_asset_pool.py similarity index 96% rename from src/neptune_api_v2/types/user/market/user_debt_asset_pool.py rename to src/neptune_api_v2/types/user/market/borrow/user_debt_asset_pool.py index 7d95afb..b66bde3 100644 --- a/src/neptune_api_v2/types/user/market/user_debt_asset_pool.py +++ b/src/neptune_api_v2/types/user/market/borrow/user_debt_asset_pool.py @@ -2,8 +2,8 @@ from typing import Optional -from ...._models import BaseModel -from ...asset_info import AssetInfo +from ....._models import BaseModel +from ....asset_info import AssetInfo __all__ = ["UserDebtAssetPool", "Extra", "ExtraText", "ExtraValue", "ExtraValueExtra", "ExtraValueExtraText"] diff --git a/src/neptune_api_v2/types/user/market/borrow_get_collateral_accounts_by_asset_response.py b/src/neptune_api_v2/types/user/market/borrow_get_collateral_accounts_by_asset_response.py index 13ce62d..61c4f7d 100644 --- a/src/neptune_api_v2/types/user/market/borrow_get_collateral_accounts_by_asset_response.py +++ b/src/neptune_api_v2/types/user/market/borrow_get_collateral_accounts_by_asset_response.py @@ -1,106 +1,36 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ...._models import BaseModel from ...asset_info import AssetInfo -from ...error_data import ErrorData +from .borrow.user_collateral_account_pool import UserCollateralAccountPool -__all__ = [ - "BorrowGetCollateralAccountsByAssetResponse", - "Data", - "DataAccount", - "DataAccountExtra", - "DataAccountExtraText", - "DataAccountExtraValue", - "DataAccountExtraValueExtra", - "DataAccountExtraValueExtraText", -] - - -class DataAccountExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - amount: str - - -class DataAccountExtraValueExtraText(BaseModel): - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - amount: str - - -class DataAccountExtraValueExtra(BaseModel): - text: Optional[DataAccountExtraValueExtraText] = None - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - -class DataAccountExtraValue(BaseModel): - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - amount: str - - extra: DataAccountExtraValueExtra - - -class DataAccountExtra(BaseModel): - text: Optional[DataAccountExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - value: Optional[DataAccountExtraValue] = None - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - -class DataAccount(BaseModel): - amount: str - """Amount of this asset which is actively collateralized""" - - extra: DataAccountExtra - - index: int - """Account index""" +__all__ = ["BorrowGetCollateralAccountsByAssetResponse", "Data"] class Data(BaseModel): - """Object data""" - - accounts: List[DataAccount] - """ - All collateral subaccounts for the associated asset type Collateral sub-accounts - for the user - """ + accounts: List[UserCollateralAccountPool] + """All collateral subaccounts for the associated asset type""" asset_info: AssetInfo """Asset identifiers with associated metadata""" class BorrowGetCollateralAccountsByAssetResponse(BaseModel): - data: Optional[Data] = None - """Object data""" + """Object data success response""" + + data: Data - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/borrow_get_collateral_totals_response.py b/src/neptune_api_v2/types/user/market/borrow_get_collateral_totals_response.py index 3c3a455..392c30f 100644 --- a/src/neptune_api_v2/types/user/market/borrow_get_collateral_totals_response.py +++ b/src/neptune_api_v2/types/user/market/borrow_get_collateral_totals_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ...._models import BaseModel -from ...error_data import ErrorData from .borrow.user_collateral_asset_pool import UserCollateralAssetPool __all__ = ["BorrowGetCollateralTotalsResponse"] class BorrowGetCollateralTotalsResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[UserCollateralAssetPool]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[UserCollateralAssetPool] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/borrow_get_debt_accounts_by_asset_response.py b/src/neptune_api_v2/types/user/market/borrow_get_debt_accounts_by_asset_response.py index 8382e6b..c13cb66 100644 --- a/src/neptune_api_v2/types/user/market/borrow_get_debt_accounts_by_asset_response.py +++ b/src/neptune_api_v2/types/user/market/borrow_get_debt_accounts_by_asset_response.py @@ -1,106 +1,16 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ...._models import BaseModel from ...asset_info import AssetInfo -from ...error_data import ErrorData +from .borrow.user_debt_account_pool import UserDebtAccountPool -__all__ = [ - "BorrowGetDebtAccountsByAssetResponse", - "Data", - "DataAccount", - "DataAccountExtra", - "DataAccountExtraText", - "DataAccountExtraValue", - "DataAccountExtraValueExtra", - "DataAccountExtraValueExtraText", -] - - -class DataAccountExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - debt: str - - interest: str - - principal: str - - -class DataAccountExtraValueExtraText(BaseModel): - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - debt: str - - interest: str - - principal: str - - -class DataAccountExtraValueExtra(BaseModel): - text: Optional[DataAccountExtraValueExtraText] = None - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - -class DataAccountExtraValue(BaseModel): - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - debt: str - - extra: DataAccountExtraValueExtra - - interest: str - - principal: str - - -class DataAccountExtra(BaseModel): - text: Optional[DataAccountExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - value: Optional[DataAccountExtraValue] = None - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - -class DataAccount(BaseModel): - debt: str - """Sum open debt amount (this is simply the principal + interest)""" - - extra: DataAccountExtra - - index: int - """Account index""" - - interest: str - """Sum of accrued interest for open debt position""" - - principal: str - """Initial amount borrowed (of debts which have not yet been repaid)""" +__all__ = ["BorrowGetDebtAccountsByAssetResponse", "Data"] class Data(BaseModel): - """Object data""" - - accounts: List[DataAccount] + accounts: List[UserDebtAccountPool] """All debt subaccounts for the associated asset type""" asset_info: AssetInfo @@ -108,14 +18,19 @@ class Data(BaseModel): class BorrowGetDebtAccountsByAssetResponse(BaseModel): - data: Optional[Data] = None - """Object data""" + """Object data success response""" + + data: Data - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/borrow_get_debts_totals_response.py b/src/neptune_api_v2/types/user/market/borrow_get_debts_totals_response.py index c3cff8d..0280984 100644 --- a/src/neptune_api_v2/types/user/market/borrow_get_debts_totals_response.py +++ b/src/neptune_api_v2/types/user/market/borrow_get_debts_totals_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ...._models import BaseModel -from ...error_data import ErrorData -from .user_debt_asset_pool import UserDebtAssetPool +from .borrow.user_debt_asset_pool import UserDebtAssetPool __all__ = ["BorrowGetDebtsTotalsResponse"] class BorrowGetDebtsTotalsResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[UserDebtAssetPool]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[UserDebtAssetPool] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/borrow_get_portfolio_response.py b/src/neptune_api_v2/types/user/market/borrow_get_portfolio_response.py index 499a872..b85f86d 100644 --- a/src/neptune_api_v2/types/user/market/borrow_get_portfolio_response.py +++ b/src/neptune_api_v2/types/user/market/borrow_get_portfolio_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ...._models import BaseModel -from ...error_data import ErrorData from .user_borrow_market import UserBorrowMarket __all__ = ["BorrowGetPortfolioResponse"] class BorrowGetPortfolioResponse(BaseModel): - data: Optional[UserBorrowMarket] = None - """Object data""" + """Object data success response""" + + data: UserBorrowMarket - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/lend_get_by_asset_response.py b/src/neptune_api_v2/types/user/market/lend_get_by_asset_response.py index f7de6df..c19d8e3 100644 --- a/src/neptune_api_v2/types/user/market/lend_get_by_asset_response.py +++ b/src/neptune_api_v2/types/user/market/lend_get_by_asset_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ...._models import BaseModel -from ...error_data import ErrorData -from .user_debt_asset_pool import UserDebtAssetPool +from .borrow.user_debt_asset_pool import UserDebtAssetPool __all__ = ["LendGetByAssetResponse"] class LendGetByAssetResponse(BaseModel): - data: Optional[UserDebtAssetPool] = None - """Object data""" + """Object data success response""" + + data: UserDebtAssetPool - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" 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 6286aef..f90512d 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,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ...._models import BaseModel -from ...error_data import ErrorData -from .user_debt_asset_pool import UserDebtAssetPool +from .borrow.user_debt_asset_pool import UserDebtAssetPool __all__ = ["LendListResponse"] class LendListResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[UserDebtAssetPool]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[UserDebtAssetPool] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market/user_borrow_market.py b/src/neptune_api_v2/types/user/market/user_borrow_market.py index 9aa21f7..ab07213 100644 --- a/src/neptune_api_v2/types/user/market/user_borrow_market.py +++ b/src/neptune_api_v2/types/user/market/user_borrow_market.py @@ -3,26 +3,15 @@ from typing import List from ...._models import BaseModel -from .user_debt_asset_pool import UserDebtAssetPool +from .user_borrow_market_pools import UserBorrowMarketPools from .borrow.user_borrow_market_account import UserBorrowMarketAccount -from .borrow.user_collateral_asset_pool import UserCollateralAssetPool -__all__ = ["UserBorrowMarket", "Totals"] - - -class Totals(BaseModel): - """Collateral/debt totals of all sub-accounts by asset""" - - collaterals: List[UserCollateralAssetPool] - """Account collateral allocations""" - - debts: List[UserDebtAssetPool] - """Account debt allocations""" +__all__ = ["UserBorrowMarket"] class UserBorrowMarket(BaseModel): accounts: List[UserBorrowMarketAccount] """Market sub-accounts for the user""" - totals: Totals + totals: UserBorrowMarketPools """Collateral/debt totals of all sub-accounts by asset""" diff --git a/src/neptune_api_v2/types/user/market/user_borrow_market_pools.py b/src/neptune_api_v2/types/user/market/user_borrow_market_pools.py new file mode 100644 index 0000000..e5b253c --- /dev/null +++ b/src/neptune_api_v2/types/user/market/user_borrow_market_pools.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ...._models import BaseModel +from .borrow.user_debt_asset_pool import UserDebtAssetPool +from .borrow.user_collateral_asset_pool import UserCollateralAssetPool + +__all__ = ["UserBorrowMarketPools"] + + +class UserBorrowMarketPools(BaseModel): + collaterals: List[UserCollateralAssetPool] + """Account collateral allocations""" + + debts: List[UserDebtAssetPool] + """Account debt allocations""" diff --git a/src/neptune_api_v2/types/user/market/user_lend_market.py b/src/neptune_api_v2/types/user/market/user_lend_market.py new file mode 100644 index 0000000..0263e20 --- /dev/null +++ b/src/neptune_api_v2/types/user/market/user_lend_market.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ...._models import BaseModel +from .borrow.user_debt_asset_pool import UserDebtAssetPool + +__all__ = ["UserLendMarket"] + + +class UserLendMarket(BaseModel): + asset_pools: List[UserDebtAssetPool] + """User lending allocations""" diff --git a/src/neptune_api_v2/types/user/market_get_merged_by_asset_response.py b/src/neptune_api_v2/types/user/market_get_merged_by_asset_response.py index 0114d35..061fd50 100644 --- a/src/neptune_api_v2/types/user/market_get_merged_by_asset_response.py +++ b/src/neptune_api_v2/types/user/market_get_merged_by_asset_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ..._models import BaseModel -from ..error_data import ErrorData from .user_merged_market import UserMergedMarket __all__ = ["MarketGetMergedByAssetResponse"] class MarketGetMergedByAssetResponse(BaseModel): - data: Optional[UserMergedMarket] = None - """Object data""" + """Object data success response""" + + data: UserMergedMarket - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market_get_merged_response.py b/src/neptune_api_v2/types/user/market_get_merged_response.py index 6c9788d..faeb17f 100644 --- a/src/neptune_api_v2/types/user/market_get_merged_response.py +++ b/src/neptune_api_v2/types/user/market_get_merged_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ..._models import BaseModel -from ..error_data import ErrorData from .user_merged_market import UserMergedMarket __all__ = ["MarketGetMergedResponse"] class MarketGetMergedResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[UserMergedMarket]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[UserMergedMarket] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/market_get_portfolio_response.py b/src/neptune_api_v2/types/user/market_get_portfolio_response.py index b29dd79..11eb072 100644 --- a/src/neptune_api_v2/types/user/market_get_portfolio_response.py +++ b/src/neptune_api_v2/types/user/market_get_portfolio_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ..._models import BaseModel -from ..error_data import ErrorData from .user_market import UserMarket __all__ = ["MarketGetPortfolioResponse"] class MarketGetPortfolioResponse(BaseModel): - data: Optional[UserMarket] = None - """Object data""" + """Object data success response""" + + data: UserMarket - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/nept/__init__.py b/src/neptune_api_v2/types/user/nept/__init__.py index 73939ad..30e6143 100644 --- a/src/neptune_api_v2/types/user/nept/__init__.py +++ b/src/neptune_api_v2/types/user/nept/__init__.py @@ -4,6 +4,8 @@ from .user_stake import UserStake as UserStake from .user_stake_pool import UserStakePool as UserStakePool +from .user_stake_unbonding import UserStakeUnbonding as UserStakeUnbonding +from .user_stake_bonding_entry import UserStakeBondingEntry as UserStakeBondingEntry from .user_stake_unbonding_entry import UserStakeUnbondingEntry as UserStakeUnbondingEntry from .staking_get_overview_params import StakingGetOverviewParams as StakingGetOverviewParams from .staking_get_unstaking_params import StakingGetUnstakingParams as StakingGetUnstakingParams diff --git a/src/neptune_api_v2/types/user/nept/staking_get_overview_response.py b/src/neptune_api_v2/types/user/nept/staking_get_overview_response.py index 2d6a183..6c3e290 100644 --- a/src/neptune_api_v2/types/user/nept/staking_get_overview_response.py +++ b/src/neptune_api_v2/types/user/nept/staking_get_overview_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ...._models import BaseModel from .user_stake import UserStake -from ...error_data import ErrorData __all__ = ["StakingGetOverviewResponse"] class StakingGetOverviewResponse(BaseModel): - data: Optional[UserStake] = None - """Object data""" + """Object data success response""" + + data: UserStake - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/nept/staking_get_staking_pool_response.py b/src/neptune_api_v2/types/user/nept/staking_get_staking_pool_response.py index ec6c81f..609b590 100644 --- a/src/neptune_api_v2/types/user/nept/staking_get_staking_pool_response.py +++ b/src/neptune_api_v2/types/user/nept/staking_get_staking_pool_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ...._models import BaseModel -from ...error_data import ErrorData from .user_stake_pool import UserStakePool __all__ = ["StakingGetStakingPoolResponse"] class StakingGetStakingPoolResponse(BaseModel): - data: Optional[UserStakePool] = None - """Object data""" + """Object data success response""" + + data: UserStakePool - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/nept/staking_get_staking_pools_response.py b/src/neptune_api_v2/types/user/nept/staking_get_staking_pools_response.py index 1dd9d61..1689c3d 100644 --- a/src/neptune_api_v2/types/user/nept/staking_get_staking_pools_response.py +++ b/src/neptune_api_v2/types/user/nept/staking_get_staking_pools_response.py @@ -1,26 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ...._models import BaseModel -from ...error_data import ErrorData from .user_stake_pool import UserStakePool __all__ = ["StakingGetStakingPoolsResponse"] class StakingGetStakingPoolsResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" + """List data success response""" - data: Optional[List[UserStakePool]] = None - """List contents""" + count: int + """Total number of objects irrespective of any pagination parameters.""" - error: Optional[ErrorData] = None - """Error message, if any""" + data: List[UserStakePool] + + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" 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 813a303..7f9f8b9 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,17 +1,14 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ...._models import BaseModel -from ...error_data import ErrorData from .user_stake_unbonding_entry import UserStakeUnbondingEntry __all__ = ["StakingGetUnstakingResponse", "Data"] class Data(BaseModel): - """Object data""" - amount_sum: str """Total amount of all unbond entries @@ -28,14 +25,19 @@ class Data(BaseModel): class StakingGetUnstakingResponse(BaseModel): - data: Optional[Data] = None - """Object data""" + """Object data success response""" + + data: Data - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/nept/user_stake.py b/src/neptune_api_v2/types/user/nept/user_stake.py index a1cbab2..42fedb9 100644 --- a/src/neptune_api_v2/types/user/nept/user_stake.py +++ b/src/neptune_api_v2/types/user/nept/user_stake.py @@ -5,22 +5,9 @@ from ...._models import BaseModel from ...asset_info import AssetInfo from .user_stake_pool import UserStakePool -from .user_stake_unbonding_entry import UserStakeUnbondingEntry - -__all__ = [ - "UserStake", - "Extra", - "ExtraText", - "ExtraValue", - "ExtraValueExtra", - "ExtraValueExtraText", - "Unbonding", - "UnbondingExtra", - "UnbondingExtraText", - "UnbondingExtraValue", - "UnbondingExtraValueExtra", - "UnbondingExtraValueExtraText", -] +from .user_stake_unbonding import UserStakeUnbonding + +__all__ = ["UserStake", "Extra", "ExtraText", "ExtraValue", "ExtraValueExtra", "ExtraValueExtraText"] class ExtraText(BaseModel): @@ -92,77 +79,6 @@ class Extra(BaseModel): """ -class UnbondingExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - amount_sum: str - - -class UnbondingExtraValueExtraText(BaseModel): - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - amount_sum: str - - -class UnbondingExtraValueExtra(BaseModel): - text: Optional[UnbondingExtraValueExtraText] = None - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - -class UnbondingExtraValue(BaseModel): - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - amount_sum: str - - extra: UnbondingExtraValueExtra - - -class UnbondingExtra(BaseModel): - text: Optional[UnbondingExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - value: Optional[UnbondingExtraValue] = None - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - -class Unbonding(BaseModel): - """User unstake/unbonding data""" - - amount_sum: str - """Total amount of all unbond entries - - **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. - """ - - extra: UnbondingExtra - - class UserStake(BaseModel): asset_info: AssetInfo """Asset identifiers with associated metadata""" @@ -188,7 +104,7 @@ class UserStake(BaseModel): pools: List[UserStakePool] """User allocations for each staking pool""" - unbonding: Unbonding + unbonding: UserStakeUnbonding """User unstake/unbonding data""" unclaimed: str diff --git a/src/neptune_api_v2/types/user/nept/user_stake_bonding_entry.py b/src/neptune_api_v2/types/user/nept/user_stake_bonding_entry.py new file mode 100644 index 0000000..053900f --- /dev/null +++ b/src/neptune_api_v2/types/user/nept/user_stake_bonding_entry.py @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["UserStakeBondingEntry", "Extra", "ExtraText", "ExtraValue", "ExtraValueExtra", "ExtraValueExtraText"] + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + amount: str + + transition_at: str + + +class ExtraValueExtraText(BaseModel): + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + amount: str + + +class ExtraValueExtra(BaseModel): + text: Optional[ExtraValueExtraText] = None + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + +class ExtraValue(BaseModel): + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + amount: str + + extra: ExtraValueExtra + + +class Extra(BaseModel): + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + value: Optional[ExtraValue] = None + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + +class UserStakeBondingEntry(BaseModel): + account_index: int + """User account index""" + + amount: str + """Bonding amount""" + + cascade: bool + + extra: Extra + + last_stake_acc: str + + transition_at: Optional[datetime] = None diff --git a/src/neptune_api_v2/types/user/nept/user_stake_pool.py b/src/neptune_api_v2/types/user/nept/user_stake_pool.py index 96eff95..73728fc 100644 --- a/src/neptune_api_v2/types/user/nept/user_stake_pool.py +++ b/src/neptune_api_v2/types/user/nept/user_stake_pool.py @@ -1,94 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional -from datetime import datetime from ...._models import BaseModel from ...staking_pool_full import StakingPoolFull +from .user_stake_bonding_entry import UserStakeBondingEntry -__all__ = [ - "UserStakePool", - "Content", - "ContentExtra", - "ContentExtraText", - "ContentExtraValue", - "ContentExtraValueExtra", - "ContentExtraValueExtraText", - "Extra", - "ExtraText", - "ExtraValue", - "ExtraValueExtra", - "ExtraValueExtraText", -] - - -class ContentExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - amount: str - - transition_at: str - - -class ContentExtraValueExtraText(BaseModel): - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - amount: str - - -class ContentExtraValueExtra(BaseModel): - text: Optional[ContentExtraValueExtraText] = None - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - -class ContentExtraValue(BaseModel): - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - amount: str - - extra: ContentExtraValueExtra - - -class ContentExtra(BaseModel): - text: Optional[ContentExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - value: Optional[ContentExtraValue] = None - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - -class Content(BaseModel): - account_index: int - """User account index""" - - amount: str - """Bonding amount""" - - cascade: bool - - extra: ContentExtra - - last_stake_acc: str - - transition_at: Optional[datetime] = None +__all__ = ["UserStakePool", "Extra", "ExtraText", "ExtraValue", "ExtraValueExtra", "ExtraValueExtraText"] class ExtraText(BaseModel): @@ -153,7 +71,7 @@ class UserStakePool(BaseModel): common: StakingPoolFull """Merges `StakingPool` with both `StakingPoolWithParams` and `StakingPoolState`""" - contents: List[Content] + contents: List[UserStakeBondingEntry] """Bonding/stake entries **NOTE:** entries that differ only in amount are merged upon creation diff --git a/src/neptune_api_v2/types/user/nept/user_stake_unbonding.py b/src/neptune_api_v2/types/user/nept/user_stake_unbonding.py new file mode 100644 index 0000000..75a21ca --- /dev/null +++ b/src/neptune_api_v2/types/user/nept/user_stake_unbonding.py @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel +from .user_stake_unbonding_entry import UserStakeUnbondingEntry + +__all__ = ["UserStakeUnbonding", "Extra", "ExtraText", "ExtraValue", "ExtraValueExtra", "ExtraValueExtraText"] + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + amount_sum: str + + +class ExtraValueExtraText(BaseModel): + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + amount_sum: str + + +class ExtraValueExtra(BaseModel): + text: Optional[ExtraValueExtraText] = None + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + +class ExtraValue(BaseModel): + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + amount_sum: str + + extra: ExtraValueExtra + + +class Extra(BaseModel): + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + value: Optional[ExtraValue] = None + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + +class UserStakeUnbonding(BaseModel): + amount_sum: str + """Total amount of all unbond entries + + **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. + """ + + extra: Extra diff --git a/src/neptune_api_v2/types/user/nept_get_unlocks_response.py b/src/neptune_api_v2/types/user/nept_get_unlocks_response.py index c946438..3988e5d 100644 --- a/src/neptune_api_v2/types/user/nept_get_unlocks_response.py +++ b/src/neptune_api_v2/types/user/nept_get_unlocks_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ..._models import BaseModel -from ..error_data import ErrorData -from .user_nept_unlock_overview import UserNeptUnlockOverview +from .user_unlock_overview import UserUnlockOverview __all__ = ["NeptGetUnlocksResponse"] class NeptGetUnlocksResponse(BaseModel): - data: Optional[UserNeptUnlockOverview] = None - """Object data""" + """Object data success response""" + + data: UserUnlockOverview - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user/user.py b/src/neptune_api_v2/types/user/user.py new file mode 100644 index 0000000..8239996 --- /dev/null +++ b/src/neptune_api_v2/types/user/user.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel +from .user_market import UserMarket +from .nept.user_stake import UserStake +from .user_unlock_overview import UserUnlockOverview +from .user_wallet_portfolio import UserWalletPortfolio + +__all__ = ["User", "Nept"] + + +class Nept(BaseModel): + """User's NEPT associations (e.g. stake, unlocks)""" + + staking: UserStake + """Overview of the user's staking contributions/activity""" + + unlocks: UserUnlockOverview + """Overview of the user's unlock arrangements and claim statistics""" + + +class User(BaseModel): + markets: UserMarket + """User's market contribution overview""" + + nept: Nept + """User's NEPT associations (e.g. stake, unlocks)""" + + wallets: UserWalletPortfolio + """User's wallets and balances""" diff --git a/src/neptune_api_v2/types/user/user_market.py b/src/neptune_api_v2/types/user/user_market.py index fe0dda6..5a1e2a9 100644 --- a/src/neptune_api_v2/types/user/user_market.py +++ b/src/neptune_api_v2/types/user/user_market.py @@ -1,24 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List - from ..._models import BaseModel +from .market.user_lend_market import UserLendMarket from .market.user_borrow_market import UserBorrowMarket -from .market.user_debt_asset_pool import UserDebtAssetPool - -__all__ = ["UserMarket", "Lend"] - - -class Lend(BaseModel): - """Overview of user lending portfolio""" - asset_pools: List[UserDebtAssetPool] - """User lending allocations""" +__all__ = ["UserMarket"] class UserMarket(BaseModel): borrow: UserBorrowMarket """Overview of user borrowing portfolio""" - lend: Lend + lend: UserLendMarket """Overview of user lending portfolio""" diff --git a/src/neptune_api_v2/types/user/user_nept_unlock_amounts.py b/src/neptune_api_v2/types/user/user_unlock_amounts.py similarity index 95% rename from src/neptune_api_v2/types/user/user_nept_unlock_amounts.py rename to src/neptune_api_v2/types/user/user_unlock_amounts.py index b2accba..1b99d5d 100644 --- a/src/neptune_api_v2/types/user/user_nept_unlock_amounts.py +++ b/src/neptune_api_v2/types/user/user_unlock_amounts.py @@ -5,7 +5,7 @@ from ..._models import BaseModel __all__ = [ - "UserNeptUnlockAmounts", + "UserUnlockAmounts", "Extra", "ExtraPercent", "ExtraPercentExtra", @@ -148,16 +148,16 @@ class Extra(BaseModel): """ -class UserNeptUnlockAmounts(BaseModel): +class UserUnlockAmounts(BaseModel): amount: str - """The full unlock amount. + """The full unlock amount This value is immutable and does not change with regards to expiry/reclamation/lock states. """ claimable: str - """The amount currently claimable. + """The amount currently claimable This takes into account: reclamation, lock state, expiry, and previously claimed. In other words, this is an accurate representation of what the user can @@ -170,7 +170,7 @@ class UserNeptUnlockAmounts(BaseModel): expired: str """ The amount that was claimable but has now expired due to the presence and - subsequent passing of `expires_at`. + subsequent passing of `expires_at` """ extra: Extra diff --git a/src/neptune_api_v2/types/user/user_nept_unlock_overview.py b/src/neptune_api_v2/types/user/user_unlock_overview.py similarity index 51% rename from src/neptune_api_v2/types/user/user_nept_unlock_overview.py rename to src/neptune_api_v2/types/user/user_unlock_overview.py index 7633f19..0919017 100644 --- a/src/neptune_api_v2/types/user/user_nept_unlock_overview.py +++ b/src/neptune_api_v2/types/user/user_unlock_overview.py @@ -1,23 +1,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional +from typing import List, Optional from datetime import datetime -from typing_extensions import Literal, TypeAlias from ..._models import BaseModel -from .user_nept_unlock_amounts import UserNeptUnlockAmounts +from .user_unlock_amounts import UserUnlockAmounts +from .user_unlock_schedule import UserUnlockSchedule __all__ = [ - "UserNeptUnlockOverview", + "UserUnlockOverview", "Arrangement", "ArrangementAdmin", "ArrangementExtra", "ArrangementExtraText", - "ArrangementSchedule", - "ArrangementScheduleUnlockScheduleLinear", - "ArrangementScheduleUnlockScheduleLinearExtra", - "ArrangementScheduleUnlockScheduleLinearExtraText", - "ArrangementScheduleUnlockScheduleLumpSum", "Extra", "ExtraText", ] @@ -54,57 +49,11 @@ class ArrangementExtra(BaseModel): """ -class ArrangementScheduleUnlockScheduleLinearExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - duration: str - - ends_at: str - - -class ArrangementScheduleUnlockScheduleLinearExtra(BaseModel): - text: Optional[ArrangementScheduleUnlockScheduleLinearExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - -class ArrangementScheduleUnlockScheduleLinear(BaseModel): - duration: int - """The duration of the unlock in seconds""" - - ends_at: datetime - """ - The time at which the unlock has/was/would've completed. This is identical to - `begins_at + duration`. - - This timestamp will remain valid even if the unlock has been reclaimed. - Therefore, it should not be used as a validity check. - """ - - extra: ArrangementScheduleUnlockScheduleLinearExtra - - kind: Literal["linear"] - - -class ArrangementScheduleUnlockScheduleLumpSum(BaseModel): - kind: Literal["lump_sum"] - - -ArrangementSchedule: TypeAlias = Union[ - ArrangementScheduleUnlockScheduleLinear, ArrangementScheduleUnlockScheduleLumpSum -] - - class Arrangement(BaseModel): admin: Optional[ArrangementAdmin] = None """The admin of the unlock, if any""" - amounts: UserNeptUnlockAmounts + amounts: UserUnlockAmounts """Primary unlock amount and other pre-calculated/derived amounts""" begins_at: datetime @@ -118,7 +67,7 @@ class Arrangement(BaseModel): last_claimed_at: Optional[datetime] = None """The time at which the unlock was last claimed, if any""" - schedule: ArrangementSchedule + schedule: UserUnlockSchedule """The schedule of the unlock""" @@ -139,14 +88,14 @@ class Extra(BaseModel): """ -class UserNeptUnlockOverview(BaseModel): +class UserUnlockOverview(BaseModel): arrangements: List[Arrangement] - """-- A list of the user's active unlock arrangements""" + """A list of the user's active unlock arrangements""" extra: Extra last_claimed_at: Optional[datetime] = None """The time at which the most recent unlock claim occurred, if any""" - totals: UserNeptUnlockAmounts - """-- Contains pre-calculated total amounts for all unlock agreements""" + totals: UserUnlockAmounts + """Contains pre-calculated total amounts for all unlock agreements""" diff --git a/src/neptune_api_v2/types/user/user_unlock_schedule.py b/src/neptune_api_v2/types/user/user_unlock_schedule.py new file mode 100644 index 0000000..28d74e5 --- /dev/null +++ b/src/neptune_api_v2/types/user/user_unlock_schedule.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import TypeAlias + +from .user_unlock_schedule_linear import UserUnlockScheduleLinear +from .user_unlock_schedule_lump_sum import UserUnlockScheduleLumpSum + +__all__ = ["UserUnlockSchedule"] + +UserUnlockSchedule: TypeAlias = Union[UserUnlockScheduleLinear, UserUnlockScheduleLumpSum] diff --git a/src/neptune_api_v2/types/user/user_unlock_schedule_linear.py b/src/neptune_api_v2/types/user/user_unlock_schedule_linear.py new file mode 100644 index 0000000..ae15995 --- /dev/null +++ b/src/neptune_api_v2/types/user/user_unlock_schedule_linear.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["UserUnlockScheduleLinear", "Extra", "ExtraText"] + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + duration: str + + ends_at: str + + +class Extra(BaseModel): + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + +class UserUnlockScheduleLinear(BaseModel): + duration: int + """The duration of the unlock in seconds""" + + ends_at: datetime + """ + The time at which the unlock has/was/would've completed. This is identical to + `begins_at + duration`. + + This timestamp will remain valid even if the unlock has been reclaimed. + Therefore, it should not be used as a validity check. + """ + + extra: Extra + + kind: Literal["linear"] diff --git a/src/neptune_api_v2/types/user/user_unlock_schedule_lump_sum.py b/src/neptune_api_v2/types/user/user_unlock_schedule_lump_sum.py new file mode 100644 index 0000000..9e9ca66 --- /dev/null +++ b/src/neptune_api_v2/types/user/user_unlock_schedule_lump_sum.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["UserUnlockScheduleLumpSum"] + + +class UserUnlockScheduleLumpSum(BaseModel): + kind: Literal["lump_sum"] diff --git a/src/neptune_api_v2/types/user/wallet_asset.py b/src/neptune_api_v2/types/user/wallet_asset.py new file mode 100644 index 0000000..02b1507 --- /dev/null +++ b/src/neptune_api_v2/types/user/wallet_asset.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import TypeAlias + +from .wallet_asset_known import WalletAssetKnown +from .wallet_asset_unknown import WalletAssetUnknown + +__all__ = ["WalletAsset"] + +WalletAsset: TypeAlias = Union[WalletAssetKnown, WalletAssetUnknown] diff --git a/src/neptune_api_v2/types/user/wallet_asset_unknown.py b/src/neptune_api_v2/types/user/wallet_asset_unknown.py new file mode 100644 index 0000000..a18896d --- /dev/null +++ b/src/neptune_api_v2/types/user/wallet_asset_unknown.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["WalletAssetUnknown"] + + +class WalletAssetUnknown(BaseModel): + amount: str + """Wallet balance in native denom.""" + + kind: Literal["unknown"] diff --git a/src/neptune_api_v2/types/user/wallet_balance.py b/src/neptune_api_v2/types/user/wallet_balance.py index a7625a2..558a560 100644 --- a/src/neptune_api_v2/types/user/wallet_balance.py +++ b/src/neptune_api_v2/types/user/wallet_balance.py @@ -1,23 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union -from typing_extensions import Literal, TypeAlias - from ..._models import BaseModel from ..asset_spec import AssetSpec -from .wallet_asset_known import WalletAssetKnown - -__all__ = ["WalletBalance", "Values", "ValuesWalletAssetUnknown"] - - -class ValuesWalletAssetUnknown(BaseModel): - amount: str - """Wallet balance in native denom.""" - - kind: Literal["unknown"] - +from .wallet_asset import WalletAsset -Values: TypeAlias = Union[WalletAssetKnown, ValuesWalletAssetUnknown] +__all__ = ["WalletBalance"] class WalletBalance(BaseModel): @@ -27,5 +14,5 @@ class WalletBalance(BaseModel): IDs are unique across asset domains (contract tokens, native denoms, etc) """ - values: Values + values: WalletAsset """Derived values and amounts.""" diff --git a/src/neptune_api_v2/types/user/wallet_get_balance_by_asset_response.py b/src/neptune_api_v2/types/user/wallet_get_balance_by_asset_response.py index bd296b1..325172a 100644 --- a/src/neptune_api_v2/types/user/wallet_get_balance_by_asset_response.py +++ b/src/neptune_api_v2/types/user/wallet_get_balance_by_asset_response.py @@ -1,23 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from ..._models import BaseModel -from ..error_data import ErrorData from .wallet_balance import WalletBalance __all__ = ["WalletGetBalanceByAssetResponse"] class WalletGetBalanceByAssetResponse(BaseModel): - data: Optional[WalletBalance] = None - """Object data""" + """Object data success response""" + + data: WalletBalance - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" 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 c1c615f..3e6bf1f 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 @@ -3,15 +3,12 @@ from typing import List, Optional from ..._models import BaseModel -from ..error_data import ErrorData from .wallet_balance import WalletBalance __all__ = ["WalletGetBalancesResponse", "Data"] class Data(BaseModel): - """Object data""" - balances: List[WalletBalance] """Array of each wallet balance""" @@ -26,14 +23,19 @@ class Data(BaseModel): class WalletGetBalancesResponse(BaseModel): - data: Optional[Data] = None - """Object data""" + """Object data success response""" + + data: Data - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user_get_tx_history_response.py b/src/neptune_api_v2/types/user_get_tx_history_response.py index 40cc72f..74154dc 100644 --- a/src/neptune_api_v2/types/user_get_tx_history_response.py +++ b/src/neptune_api_v2/types/user_get_tx_history_response.py @@ -1,170 +1,30 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Union, Optional -from datetime import datetime +from typing import List +from .user_tx import UserTx from .._models import BaseModel -from .asset_info import AssetInfo -from .error_data import ErrorData -from .event_action import EventAction -__all__ = [ - "UserGetTxHistoryResponse", - "Data", - "DataExtra", - "DataExtraText", - "DataExtraValue", - "DataExtraValueExtra", - "DataExtraValueExtraText", -] +__all__ = ["UserGetTxHistoryResponse"] -class DataExtraText(BaseModel): - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - action: str - - amount: str - - event_time: str - - price: str - - value: str - - -class DataExtraValueExtraText(BaseModel): - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - amount: Optional[str] = None - - -class DataExtraValueExtra(BaseModel): - text: Optional[DataExtraValueExtraText] = None - """Human-readable variants of USD values. - - Will not be null when query params `with_text` and `with_value` are `true`. - """ - - -class DataExtraValue(BaseModel): - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - amount: Optional[str] = None - - extra: DataExtraValueExtra - - -class DataExtra(BaseModel): - text: Optional[DataExtraText] = None - """Human-readable field variants. - - Will not be null when query param `with_text` is `true`. - """ - - value: Optional[DataExtraValue] = None - """USD values for the corresponding amounts above. - - Will not be null when query param `with_value` is `true`. - """ - - -class Data(BaseModel): - account_address: str - """Account address corresponding to the transaction""" - - account_index: Optional[int] = None - """Neptune market sub-account index. - - Will be set for the following event types: `borrow`, `return`, - `deposit_collateral`, `withdraw_collateral`, `liquidate`, `bond`, `unbond`. - - Otherwise the value is guaranteed to be null. - """ - - action: EventAction - """Neptune event type for the given market/token contract execute call""" - - amount: Optional[str] = None - """The relevant amount for the given tx/event. - - This value will be set for all currently implemented action types. It is set as - nullable for forwards compatibility for future action types which may not have - an associated amount. - """ - - asset: AssetInfo - """Asset identifiers with associated metadata""" - - contract_address: str - """Address for the event's corresponding contract""" - - destination_address: Optional[str] = None - """Destination account address. Non-null for `send`/`transfer` transactions. - - This field will be null for all other action types. - """ - - event_time: datetime - """Event/transaction block time""" - - event_uuid: str - """Internal UUID created when the transaction was first indexed by Neptune. - - Primary usage for API clients is tx history pagination offsets. - - NOTE: event UUIDs should not be used as a guaranteed method of uniquely - identifying a transaction event over extended periods of time. - - Future updates to our indexer may infrequently require a full re-index of - transactions, resulting in newly generated UUIDs. - """ - - extra: DataExtra - - price: Union[str, float, None] = None - """The price of the associated asset at the time of the transaction. +class UserGetTxHistoryResponse(BaseModel): + """List data success response""" - This value will be set for all currently implemented action types. It is set as - nullable for forwards compatibility for future action types which may not have - an associated amount. - """ + count: int + """Total number of objects irrespective of any pagination parameters.""" - tx_hash: str - """Transaction hash""" + data: List[UserTx] - value: Union[str, float, None] = None - """The USD value at the time of the transaction. + error: None = None + """Error data. Guaranteed `null` for successful response.""" - Derived using the amount and historical price of the associated asset. + status: int + """HTTP status. - This value will be set for all currently implemented action types. It is set as - nullable for forwards compatibility for future action types which may not have - an associated amount. + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. """ - -class UserGetTxHistoryResponse(BaseModel): - count: Optional[int] = None - """Total number of objects in all pages""" - - data: Optional[List[Data]] = None - """List contents""" - - error: Optional[ErrorData] = None - """Error message, if any""" - - status: int - """Request status""" - status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user_get_user_response.py b/src/neptune_api_v2/types/user_get_user_response.py index 60d0a44..8449c66 100644 --- a/src/neptune_api_v2/types/user_get_user_response.py +++ b/src/neptune_api_v2/types/user_get_user_response.py @@ -1,49 +1,25 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional - from .._models import BaseModel -from .error_data import ErrorData -from .user.user_market import UserMarket -from .user.nept.user_stake import UserStake -from .user.user_wallet_portfolio import UserWalletPortfolio -from .user.user_nept_unlock_overview import UserNeptUnlockOverview - -__all__ = ["UserGetUserResponse", "Data", "DataNept"] - - -class DataNept(BaseModel): - """User's NEPT associations (e.g. stake, unlocks)""" - - staking: UserStake - """-- Overview of the user's staking contributions/activity""" - - unlocks: UserNeptUnlockOverview - """-- Overview of the user's unlock arrangements and claim statistics""" +from .user.user import User - -class Data(BaseModel): - """Object data""" - - markets: UserMarket - """User's market contribution overview""" - - nept: DataNept - """User's NEPT associations (e.g. stake, unlocks)""" - - wallets: UserWalletPortfolio - """User's wallets and balances""" +__all__ = ["UserGetUserResponse"] class UserGetUserResponse(BaseModel): - data: Optional[Data] = None - """Object data""" + """Object data success response""" + + data: User - error: Optional[ErrorData] = None - """Error content, only set if an error occurs""" + error: None = None + """Error data. Guaranteed `null` for successful response.""" status: int - """Request status""" + """HTTP status. + + Successful responses are guaranteed to be < `400`. Conversely, error responses + are guaranteed to be >= `400`. + """ status_text: str - """Request status text""" + """HTTP status text""" diff --git a/src/neptune_api_v2/types/user_tx.py b/src/neptune_api_v2/types/user_tx.py new file mode 100644 index 0000000..61da072 --- /dev/null +++ b/src/neptune_api_v2/types/user_tx.py @@ -0,0 +1,144 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from datetime import datetime + +from .._models import BaseModel +from .asset_info import AssetInfo +from .event_action import EventAction + +__all__ = ["UserTx", "Extra", "ExtraText", "ExtraValue", "ExtraValueExtra", "ExtraValueExtraText"] + + +class ExtraText(BaseModel): + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + action: str + + amount: str + + event_time: str + + price: str + + value: str + + +class ExtraValueExtraText(BaseModel): + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + amount: Optional[str] = None + + +class ExtraValueExtra(BaseModel): + text: Optional[ExtraValueExtraText] = None + """Human-readable variants of USD values. + + Will not be null when query params `with_text` and `with_value` are `true`. + """ + + +class ExtraValue(BaseModel): + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + amount: Optional[str] = None + + extra: ExtraValueExtra + + +class Extra(BaseModel): + text: Optional[ExtraText] = None + """Human-readable field variants. + + Will not be null when query param `with_text` is `true`. + """ + + value: Optional[ExtraValue] = None + """USD values for the corresponding amounts above. + + Will not be null when query param `with_value` is `true`. + """ + + +class UserTx(BaseModel): + account_address: str + """Account address corresponding to the transaction""" + + account_index: Optional[int] = None + """Neptune market sub-account index. + + Will be set for the following event types: `borrow`, `return`, + `deposit_collateral`, `withdraw_collateral`, `liquidate`, `bond`, `unbond`. + + Otherwise the value is guaranteed to be null. + """ + + action: EventAction + """Neptune event type for the given market/token contract execute call""" + + amount: Optional[str] = None + """The relevant amount for the given tx/event. + + This value will be set for all currently implemented action types. It is set as + nullable for forwards compatibility for future action types which may not have + an associated amount. + """ + + asset: AssetInfo + """Asset identifiers with associated metadata""" + + contract_address: str + """Address for the event's corresponding contract""" + + destination_address: Optional[str] = None + """Destination account address. Non-null for `send`/`transfer` transactions. + + This field will be null for all other action types. + """ + + event_time: datetime + """Event/transaction block time""" + + event_uuid: str + """Internal UUID created when the transaction was first indexed by Neptune. + + Primary usage for API clients is tx history pagination offsets. + + NOTE: event UUIDs should not be used as a guaranteed method of uniquely + identifying a transaction event over extended periods of time. + + Future updates to our indexer may infrequently require a full re-index of + transactions, resulting in newly generated UUIDs. + """ + + extra: Extra + + price: Union[str, float, None] = None + """The price of the associated asset at the time of the transaction. + + This value will be set for all currently implemented action types. It is set as + nullable for forwards compatibility for future action types which may not have + an associated amount. + """ + + tx_hash: str + """Transaction hash""" + + value: Union[str, float, None] = None + """The USD value at the time of the transaction. + + Derived using the amount and historical price of the associated asset. + + This value will be set for all currently implemented action types. It is set as + nullable for forwards compatibility for future action types which may not have + an associated amount. + """ diff --git a/src/neptune_api_v2/types/validation_field_source.py b/src/neptune_api_v2/types/validation_field_source.py new file mode 100644 index 0000000..c258c2c --- /dev/null +++ b/src/neptune_api_v2/types/validation_field_source.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ValidationFieldSource"] + +ValidationFieldSource: TypeAlias = Literal["header", "query", "path", "body"] diff --git a/tests/api_resources/analytics/test_nept.py b/tests/api_resources/analytics/test_nept.py new file mode 100644 index 0000000..53ecf99 --- /dev/null +++ b/tests/api_resources/analytics/test_nept.py @@ -0,0 +1,100 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from neptune_api_v2 import NeptuneAPIV2, AsyncNeptuneAPIV2 +from neptune_api_v2.types.analytics import NeptUnlocksDistributionResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestNept: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_unlocks_distribution(self, client: NeptuneAPIV2) -> None: + nept = client.analytics.nept.unlocks_distribution() + assert_matches_type(NeptUnlocksDistributionResponse, nept, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_unlocks_distribution_with_all_params(self, client: NeptuneAPIV2) -> None: + nept = client.analytics.nept.unlocks_distribution( + with_percent=True, + with_text=True, + with_value=True, + ) + assert_matches_type(NeptUnlocksDistributionResponse, nept, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_unlocks_distribution(self, client: NeptuneAPIV2) -> None: + response = client.analytics.nept.with_raw_response.unlocks_distribution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nept = response.parse() + assert_matches_type(NeptUnlocksDistributionResponse, nept, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_unlocks_distribution(self, client: NeptuneAPIV2) -> None: + with client.analytics.nept.with_streaming_response.unlocks_distribution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nept = response.parse() + assert_matches_type(NeptUnlocksDistributionResponse, nept, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncNept: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_unlocks_distribution(self, async_client: AsyncNeptuneAPIV2) -> None: + nept = await async_client.analytics.nept.unlocks_distribution() + assert_matches_type(NeptUnlocksDistributionResponse, nept, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_unlocks_distribution_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: + nept = await async_client.analytics.nept.unlocks_distribution( + with_percent=True, + with_text=True, + with_value=True, + ) + assert_matches_type(NeptUnlocksDistributionResponse, nept, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_unlocks_distribution(self, async_client: AsyncNeptuneAPIV2) -> None: + response = await async_client.analytics.nept.with_raw_response.unlocks_distribution() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nept = await response.parse() + assert_matches_type(NeptUnlocksDistributionResponse, nept, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_unlocks_distribution(self, async_client: AsyncNeptuneAPIV2) -> None: + async with async_client.analytics.nept.with_streaming_response.unlocks_distribution() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nept = await response.parse() + assert_matches_type(NeptUnlocksDistributionResponse, nept, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_user.py b/tests/api_resources/test_user.py index 0db2cb8..8fca026 100644 --- a/tests/api_resources/test_user.py +++ b/tests/api_resources/test_user.py @@ -24,7 +24,7 @@ class TestUser: @parametrize def test_method_get_tx_history(self, client: NeptuneAPIV2) -> None: user = client.user.get_tx_history( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(UserGetTxHistoryResponse, user, path=["response"]) @@ -32,7 +32,7 @@ def test_method_get_tx_history(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_tx_history_with_all_params(self, client: NeptuneAPIV2) -> None: user = client.user.get_tx_history( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", action="borrow_flash_loan", limit=1, prev_event_uuid="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -46,7 +46,7 @@ def test_method_get_tx_history_with_all_params(self, client: NeptuneAPIV2) -> No @parametrize def test_raw_response_get_tx_history(self, client: NeptuneAPIV2) -> None: response = client.user.with_raw_response.get_tx_history( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -58,7 +58,7 @@ def test_raw_response_get_tx_history(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_tx_history(self, client: NeptuneAPIV2) -> None: with client.user.with_streaming_response.get_tx_history( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -80,7 +80,7 @@ def test_path_params_get_tx_history(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_user(self, client: NeptuneAPIV2) -> None: user = client.user.get_user( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(UserGetUserResponse, user, path=["response"]) @@ -88,7 +88,7 @@ def test_method_get_user(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_user_with_all_params(self, client: NeptuneAPIV2) -> None: user = client.user.get_user( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_percent=True, with_text=True, with_value=True, @@ -99,7 +99,7 @@ def test_method_get_user_with_all_params(self, client: NeptuneAPIV2) -> None: @parametrize def test_raw_response_get_user(self, client: NeptuneAPIV2) -> None: response = client.user.with_raw_response.get_user( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -111,7 +111,7 @@ def test_raw_response_get_user(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_user(self, client: NeptuneAPIV2) -> None: with client.user.with_streaming_response.get_user( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -139,7 +139,7 @@ class TestAsyncUser: @parametrize async def test_method_get_tx_history(self, async_client: AsyncNeptuneAPIV2) -> None: user = await async_client.user.get_tx_history( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(UserGetTxHistoryResponse, user, path=["response"]) @@ -147,7 +147,7 @@ async def test_method_get_tx_history(self, async_client: AsyncNeptuneAPIV2) -> N @parametrize async def test_method_get_tx_history_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: user = await async_client.user.get_tx_history( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", action="borrow_flash_loan", limit=1, prev_event_uuid="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -161,7 +161,7 @@ async def test_method_get_tx_history_with_all_params(self, async_client: AsyncNe @parametrize async def test_raw_response_get_tx_history(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.with_raw_response.get_tx_history( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -173,7 +173,7 @@ async def test_raw_response_get_tx_history(self, async_client: AsyncNeptuneAPIV2 @parametrize async def test_streaming_response_get_tx_history(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.with_streaming_response.get_tx_history( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -195,7 +195,7 @@ async def test_path_params_get_tx_history(self, async_client: AsyncNeptuneAPIV2) @parametrize async def test_method_get_user(self, async_client: AsyncNeptuneAPIV2) -> None: user = await async_client.user.get_user( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(UserGetUserResponse, user, path=["response"]) @@ -203,7 +203,7 @@ async def test_method_get_user(self, async_client: AsyncNeptuneAPIV2) -> None: @parametrize async def test_method_get_user_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: user = await async_client.user.get_user( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_percent=True, with_text=True, with_value=True, @@ -214,7 +214,7 @@ async def test_method_get_user_with_all_params(self, async_client: AsyncNeptuneA @parametrize async def test_raw_response_get_user(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.with_raw_response.get_user( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -226,7 +226,7 @@ async def test_raw_response_get_user(self, async_client: AsyncNeptuneAPIV2) -> N @parametrize async def test_streaming_response_get_user(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.with_streaming_response.get_user( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/user/market/borrow/test_subaccount.py b/tests/api_resources/user/market/borrow/test_subaccount.py index b2aa6d6..7c4b1a7 100644 --- a/tests/api_resources/user/market/borrow/test_subaccount.py +++ b/tests/api_resources/user/market/borrow/test_subaccount.py @@ -27,7 +27,7 @@ class TestSubaccount: def test_method_get_subaccount(self, client: NeptuneAPIV2) -> None: subaccount = client.user.market.borrow.subaccount.get_subaccount( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(SubaccountGetSubaccountResponse, subaccount, path=["response"]) @@ -36,7 +36,7 @@ def test_method_get_subaccount(self, client: NeptuneAPIV2) -> None: def test_method_get_subaccount_with_all_params(self, client: NeptuneAPIV2) -> None: subaccount = client.user.market.borrow.subaccount.get_subaccount( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -47,7 +47,7 @@ def test_method_get_subaccount_with_all_params(self, client: NeptuneAPIV2) -> No def test_raw_response_get_subaccount(self, client: NeptuneAPIV2) -> None: response = client.user.market.borrow.subaccount.with_raw_response.get_subaccount( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -60,7 +60,7 @@ def test_raw_response_get_subaccount(self, client: NeptuneAPIV2) -> None: def test_streaming_response_get_subaccount(self, client: NeptuneAPIV2) -> None: with client.user.market.borrow.subaccount.with_streaming_response.get_subaccount( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -84,7 +84,7 @@ def test_path_params_get_subaccount(self, client: NeptuneAPIV2) -> None: def test_method_get_subaccount_collaterals(self, client: NeptuneAPIV2) -> None: subaccount = client.user.market.borrow.subaccount.get_subaccount_collaterals( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(SubaccountGetSubaccountCollateralsResponse, subaccount, path=["response"]) @@ -93,7 +93,7 @@ def test_method_get_subaccount_collaterals(self, client: NeptuneAPIV2) -> None: def test_method_get_subaccount_collaterals_with_all_params(self, client: NeptuneAPIV2) -> None: subaccount = client.user.market.borrow.subaccount.get_subaccount_collaterals( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -104,7 +104,7 @@ def test_method_get_subaccount_collaterals_with_all_params(self, client: Neptune def test_raw_response_get_subaccount_collaterals(self, client: NeptuneAPIV2) -> None: response = client.user.market.borrow.subaccount.with_raw_response.get_subaccount_collaterals( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -117,7 +117,7 @@ def test_raw_response_get_subaccount_collaterals(self, client: NeptuneAPIV2) -> def test_streaming_response_get_subaccount_collaterals(self, client: NeptuneAPIV2) -> None: with client.user.market.borrow.subaccount.with_streaming_response.get_subaccount_collaterals( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -141,7 +141,7 @@ def test_path_params_get_subaccount_collaterals(self, client: NeptuneAPIV2) -> N def test_method_get_subaccount_debts(self, client: NeptuneAPIV2) -> None: subaccount = client.user.market.borrow.subaccount.get_subaccount_debts( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(SubaccountGetSubaccountDebtsResponse, subaccount, path=["response"]) @@ -150,7 +150,7 @@ def test_method_get_subaccount_debts(self, client: NeptuneAPIV2) -> None: def test_method_get_subaccount_debts_with_all_params(self, client: NeptuneAPIV2) -> None: subaccount = client.user.market.borrow.subaccount.get_subaccount_debts( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -161,7 +161,7 @@ def test_method_get_subaccount_debts_with_all_params(self, client: NeptuneAPIV2) def test_raw_response_get_subaccount_debts(self, client: NeptuneAPIV2) -> None: response = client.user.market.borrow.subaccount.with_raw_response.get_subaccount_debts( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -174,7 +174,7 @@ def test_raw_response_get_subaccount_debts(self, client: NeptuneAPIV2) -> None: def test_streaming_response_get_subaccount_debts(self, client: NeptuneAPIV2) -> None: with client.user.market.borrow.subaccount.with_streaming_response.get_subaccount_debts( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -198,7 +198,7 @@ def test_path_params_get_subaccount_debts(self, client: NeptuneAPIV2) -> None: def test_method_get_subaccount_health(self, client: NeptuneAPIV2) -> None: subaccount = client.user.market.borrow.subaccount.get_subaccount_health( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(SubaccountGetSubaccountHealthResponse, subaccount, path=["response"]) @@ -207,9 +207,8 @@ def test_method_get_subaccount_health(self, client: NeptuneAPIV2) -> None: def test_method_get_subaccount_health_with_all_params(self, client: NeptuneAPIV2) -> None: subaccount = client.user.market.borrow.subaccount.get_subaccount_health( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, - with_value=True, ) assert_matches_type(SubaccountGetSubaccountHealthResponse, subaccount, path=["response"]) @@ -218,7 +217,7 @@ def test_method_get_subaccount_health_with_all_params(self, client: NeptuneAPIV2 def test_raw_response_get_subaccount_health(self, client: NeptuneAPIV2) -> None: response = client.user.market.borrow.subaccount.with_raw_response.get_subaccount_health( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -231,7 +230,7 @@ def test_raw_response_get_subaccount_health(self, client: NeptuneAPIV2) -> None: def test_streaming_response_get_subaccount_health(self, client: NeptuneAPIV2) -> None: with client.user.market.borrow.subaccount.with_streaming_response.get_subaccount_health( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -261,7 +260,7 @@ class TestAsyncSubaccount: async def test_method_get_subaccount(self, async_client: AsyncNeptuneAPIV2) -> None: subaccount = await async_client.user.market.borrow.subaccount.get_subaccount( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(SubaccountGetSubaccountResponse, subaccount, path=["response"]) @@ -270,7 +269,7 @@ async def test_method_get_subaccount(self, async_client: AsyncNeptuneAPIV2) -> N async def test_method_get_subaccount_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: subaccount = await async_client.user.market.borrow.subaccount.get_subaccount( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -281,7 +280,7 @@ async def test_method_get_subaccount_with_all_params(self, async_client: AsyncNe async def test_raw_response_get_subaccount(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.borrow.subaccount.with_raw_response.get_subaccount( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -294,7 +293,7 @@ async def test_raw_response_get_subaccount(self, async_client: AsyncNeptuneAPIV2 async def test_streaming_response_get_subaccount(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.borrow.subaccount.with_streaming_response.get_subaccount( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -318,7 +317,7 @@ async def test_path_params_get_subaccount(self, async_client: AsyncNeptuneAPIV2) async def test_method_get_subaccount_collaterals(self, async_client: AsyncNeptuneAPIV2) -> None: subaccount = await async_client.user.market.borrow.subaccount.get_subaccount_collaterals( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(SubaccountGetSubaccountCollateralsResponse, subaccount, path=["response"]) @@ -327,7 +326,7 @@ async def test_method_get_subaccount_collaterals(self, async_client: AsyncNeptun async def test_method_get_subaccount_collaterals_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: subaccount = await async_client.user.market.borrow.subaccount.get_subaccount_collaterals( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -338,7 +337,7 @@ async def test_method_get_subaccount_collaterals_with_all_params(self, async_cli async def test_raw_response_get_subaccount_collaterals(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.borrow.subaccount.with_raw_response.get_subaccount_collaterals( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -351,7 +350,7 @@ async def test_raw_response_get_subaccount_collaterals(self, async_client: Async async def test_streaming_response_get_subaccount_collaterals(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.borrow.subaccount.with_streaming_response.get_subaccount_collaterals( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -375,7 +374,7 @@ async def test_path_params_get_subaccount_collaterals(self, async_client: AsyncN async def test_method_get_subaccount_debts(self, async_client: AsyncNeptuneAPIV2) -> None: subaccount = await async_client.user.market.borrow.subaccount.get_subaccount_debts( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(SubaccountGetSubaccountDebtsResponse, subaccount, path=["response"]) @@ -384,7 +383,7 @@ async def test_method_get_subaccount_debts(self, async_client: AsyncNeptuneAPIV2 async def test_method_get_subaccount_debts_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: subaccount = await async_client.user.market.borrow.subaccount.get_subaccount_debts( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -395,7 +394,7 @@ async def test_method_get_subaccount_debts_with_all_params(self, async_client: A async def test_raw_response_get_subaccount_debts(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.borrow.subaccount.with_raw_response.get_subaccount_debts( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -408,7 +407,7 @@ async def test_raw_response_get_subaccount_debts(self, async_client: AsyncNeptun async def test_streaming_response_get_subaccount_debts(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.borrow.subaccount.with_streaming_response.get_subaccount_debts( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -432,7 +431,7 @@ async def test_path_params_get_subaccount_debts(self, async_client: AsyncNeptune async def test_method_get_subaccount_health(self, async_client: AsyncNeptuneAPIV2) -> None: subaccount = await async_client.user.market.borrow.subaccount.get_subaccount_health( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(SubaccountGetSubaccountHealthResponse, subaccount, path=["response"]) @@ -441,9 +440,8 @@ async def test_method_get_subaccount_health(self, async_client: AsyncNeptuneAPIV async def test_method_get_subaccount_health_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: subaccount = await async_client.user.market.borrow.subaccount.get_subaccount_health( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, - with_value=True, ) assert_matches_type(SubaccountGetSubaccountHealthResponse, subaccount, path=["response"]) @@ -452,7 +450,7 @@ async def test_method_get_subaccount_health_with_all_params(self, async_client: async def test_raw_response_get_subaccount_health(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.borrow.subaccount.with_raw_response.get_subaccount_health( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -465,7 +463,7 @@ async def test_raw_response_get_subaccount_health(self, async_client: AsyncNeptu async def test_streaming_response_get_subaccount_health(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.borrow.subaccount.with_streaming_response.get_subaccount_health( index=0, - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/user/market/test_borrow.py b/tests/api_resources/user/market/test_borrow.py index 5af9899..a10de55 100644 --- a/tests/api_resources/user/market/test_borrow.py +++ b/tests/api_resources/user/market/test_borrow.py @@ -27,7 +27,7 @@ class TestBorrow: @parametrize def test_method_get_collateral_accounts_by_asset(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_collateral_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(BorrowGetCollateralAccountsByAssetResponse, borrow, path=["response"]) @@ -36,7 +36,7 @@ def test_method_get_collateral_accounts_by_asset(self, client: NeptuneAPIV2) -> @parametrize def test_method_get_collateral_accounts_by_asset_with_all_params(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_collateral_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -47,7 +47,7 @@ def test_method_get_collateral_accounts_by_asset_with_all_params(self, client: N @parametrize def test_raw_response_get_collateral_accounts_by_asset(self, client: NeptuneAPIV2) -> None: response = client.user.market.borrow.with_raw_response.get_collateral_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -60,7 +60,7 @@ def test_raw_response_get_collateral_accounts_by_asset(self, client: NeptuneAPIV @parametrize def test_streaming_response_get_collateral_accounts_by_asset(self, client: NeptuneAPIV2) -> None: with client.user.market.borrow.with_streaming_response.get_collateral_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed @@ -84,7 +84,7 @@ def test_path_params_get_collateral_accounts_by_asset(self, client: NeptuneAPIV2 @parametrize def test_method_get_collateral_totals(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_collateral_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(BorrowGetCollateralTotalsResponse, borrow, path=["response"]) @@ -92,7 +92,7 @@ def test_method_get_collateral_totals(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_collateral_totals_with_all_params(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_collateral_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -102,7 +102,7 @@ def test_method_get_collateral_totals_with_all_params(self, client: NeptuneAPIV2 @parametrize def test_raw_response_get_collateral_totals(self, client: NeptuneAPIV2) -> None: response = client.user.market.borrow.with_raw_response.get_collateral_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -114,7 +114,7 @@ def test_raw_response_get_collateral_totals(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_collateral_totals(self, client: NeptuneAPIV2) -> None: with client.user.market.borrow.with_streaming_response.get_collateral_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -136,7 +136,7 @@ def test_path_params_get_collateral_totals(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_debt_accounts_by_asset(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_debt_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(BorrowGetDebtAccountsByAssetResponse, borrow, path=["response"]) @@ -145,7 +145,7 @@ def test_method_get_debt_accounts_by_asset(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_debt_accounts_by_asset_with_all_params(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_debt_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -156,7 +156,7 @@ def test_method_get_debt_accounts_by_asset_with_all_params(self, client: Neptune @parametrize def test_raw_response_get_debt_accounts_by_asset(self, client: NeptuneAPIV2) -> None: response = client.user.market.borrow.with_raw_response.get_debt_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -169,7 +169,7 @@ def test_raw_response_get_debt_accounts_by_asset(self, client: NeptuneAPIV2) -> @parametrize def test_streaming_response_get_debt_accounts_by_asset(self, client: NeptuneAPIV2) -> None: with client.user.market.borrow.with_streaming_response.get_debt_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed @@ -193,7 +193,7 @@ def test_path_params_get_debt_accounts_by_asset(self, client: NeptuneAPIV2) -> N @parametrize def test_method_get_debts_totals(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_debts_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(BorrowGetDebtsTotalsResponse, borrow, path=["response"]) @@ -201,7 +201,7 @@ def test_method_get_debts_totals(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_debts_totals_with_all_params(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_debts_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -211,7 +211,7 @@ def test_method_get_debts_totals_with_all_params(self, client: NeptuneAPIV2) -> @parametrize def test_raw_response_get_debts_totals(self, client: NeptuneAPIV2) -> None: response = client.user.market.borrow.with_raw_response.get_debts_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -223,7 +223,7 @@ def test_raw_response_get_debts_totals(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_debts_totals(self, client: NeptuneAPIV2) -> None: with client.user.market.borrow.with_streaming_response.get_debts_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -245,7 +245,7 @@ def test_path_params_get_debts_totals(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_portfolio(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(BorrowGetPortfolioResponse, borrow, path=["response"]) @@ -253,7 +253,7 @@ def test_method_get_portfolio(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_portfolio_with_all_params(self, client: NeptuneAPIV2) -> None: borrow = client.user.market.borrow.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -263,7 +263,7 @@ def test_method_get_portfolio_with_all_params(self, client: NeptuneAPIV2) -> Non @parametrize def test_raw_response_get_portfolio(self, client: NeptuneAPIV2) -> None: response = client.user.market.borrow.with_raw_response.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -275,7 +275,7 @@ def test_raw_response_get_portfolio(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_portfolio(self, client: NeptuneAPIV2) -> None: with client.user.market.borrow.with_streaming_response.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -303,7 +303,7 @@ class TestAsyncBorrow: @parametrize async def test_method_get_collateral_accounts_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: borrow = await async_client.user.market.borrow.get_collateral_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(BorrowGetCollateralAccountsByAssetResponse, borrow, path=["response"]) @@ -314,7 +314,7 @@ async def test_method_get_collateral_accounts_by_asset_with_all_params( self, async_client: AsyncNeptuneAPIV2 ) -> None: borrow = await async_client.user.market.borrow.get_collateral_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -325,7 +325,7 @@ async def test_method_get_collateral_accounts_by_asset_with_all_params( @parametrize async def test_raw_response_get_collateral_accounts_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.borrow.with_raw_response.get_collateral_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -338,7 +338,7 @@ async def test_raw_response_get_collateral_accounts_by_asset(self, async_client: @parametrize async def test_streaming_response_get_collateral_accounts_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.borrow.with_streaming_response.get_collateral_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed @@ -362,7 +362,7 @@ async def test_path_params_get_collateral_accounts_by_asset(self, async_client: @parametrize async def test_method_get_collateral_totals(self, async_client: AsyncNeptuneAPIV2) -> None: borrow = await async_client.user.market.borrow.get_collateral_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(BorrowGetCollateralTotalsResponse, borrow, path=["response"]) @@ -370,7 +370,7 @@ async def test_method_get_collateral_totals(self, async_client: AsyncNeptuneAPIV @parametrize async def test_method_get_collateral_totals_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: borrow = await async_client.user.market.borrow.get_collateral_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -380,7 +380,7 @@ async def test_method_get_collateral_totals_with_all_params(self, async_client: @parametrize async def test_raw_response_get_collateral_totals(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.borrow.with_raw_response.get_collateral_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -392,7 +392,7 @@ async def test_raw_response_get_collateral_totals(self, async_client: AsyncNeptu @parametrize async def test_streaming_response_get_collateral_totals(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.borrow.with_streaming_response.get_collateral_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -414,7 +414,7 @@ async def test_path_params_get_collateral_totals(self, async_client: AsyncNeptun @parametrize async def test_method_get_debt_accounts_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: borrow = await async_client.user.market.borrow.get_debt_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(BorrowGetDebtAccountsByAssetResponse, borrow, path=["response"]) @@ -423,7 +423,7 @@ async def test_method_get_debt_accounts_by_asset(self, async_client: AsyncNeptun @parametrize async def test_method_get_debt_accounts_by_asset_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: borrow = await async_client.user.market.borrow.get_debt_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -434,7 +434,7 @@ async def test_method_get_debt_accounts_by_asset_with_all_params(self, async_cli @parametrize async def test_raw_response_get_debt_accounts_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.borrow.with_raw_response.get_debt_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -447,7 +447,7 @@ async def test_raw_response_get_debt_accounts_by_asset(self, async_client: Async @parametrize async def test_streaming_response_get_debt_accounts_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.borrow.with_streaming_response.get_debt_accounts_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed @@ -471,7 +471,7 @@ async def test_path_params_get_debt_accounts_by_asset(self, async_client: AsyncN @parametrize async def test_method_get_debts_totals(self, async_client: AsyncNeptuneAPIV2) -> None: borrow = await async_client.user.market.borrow.get_debts_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(BorrowGetDebtsTotalsResponse, borrow, path=["response"]) @@ -479,7 +479,7 @@ async def test_method_get_debts_totals(self, async_client: AsyncNeptuneAPIV2) -> @parametrize async def test_method_get_debts_totals_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: borrow = await async_client.user.market.borrow.get_debts_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -489,7 +489,7 @@ async def test_method_get_debts_totals_with_all_params(self, async_client: Async @parametrize async def test_raw_response_get_debts_totals(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.borrow.with_raw_response.get_debts_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -501,7 +501,7 @@ async def test_raw_response_get_debts_totals(self, async_client: AsyncNeptuneAPI @parametrize async def test_streaming_response_get_debts_totals(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.borrow.with_streaming_response.get_debts_totals( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -523,7 +523,7 @@ async def test_path_params_get_debts_totals(self, async_client: AsyncNeptuneAPIV @parametrize async def test_method_get_portfolio(self, async_client: AsyncNeptuneAPIV2) -> None: borrow = await async_client.user.market.borrow.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(BorrowGetPortfolioResponse, borrow, path=["response"]) @@ -531,7 +531,7 @@ async def test_method_get_portfolio(self, async_client: AsyncNeptuneAPIV2) -> No @parametrize async def test_method_get_portfolio_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: borrow = await async_client.user.market.borrow.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -541,7 +541,7 @@ async def test_method_get_portfolio_with_all_params(self, async_client: AsyncNep @parametrize async def test_raw_response_get_portfolio(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.borrow.with_raw_response.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -553,7 +553,7 @@ async def test_raw_response_get_portfolio(self, async_client: AsyncNeptuneAPIV2) @parametrize async def test_streaming_response_get_portfolio(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.borrow.with_streaming_response.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/user/market/test_lend.py b/tests/api_resources/user/market/test_lend.py index 81febfc..4a9ea74 100644 --- a/tests/api_resources/user/market/test_lend.py +++ b/tests/api_resources/user/market/test_lend.py @@ -24,7 +24,7 @@ class TestLend: @parametrize def test_method_list(self, client: NeptuneAPIV2) -> None: lend = client.user.market.lend.list( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(LendListResponse, lend, path=["response"]) @@ -32,7 +32,7 @@ def test_method_list(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_list_with_all_params(self, client: NeptuneAPIV2) -> None: lend = client.user.market.lend.list( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -42,7 +42,7 @@ def test_method_list_with_all_params(self, client: NeptuneAPIV2) -> None: @parametrize def test_raw_response_list(self, client: NeptuneAPIV2) -> None: response = client.user.market.lend.with_raw_response.list( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -54,7 +54,7 @@ def test_raw_response_list(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_list(self, client: NeptuneAPIV2) -> None: with client.user.market.lend.with_streaming_response.list( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -76,7 +76,7 @@ def test_path_params_list(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_by_asset(self, client: NeptuneAPIV2) -> None: lend = client.user.market.lend.get_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(LendGetByAssetResponse, lend, path=["response"]) @@ -85,7 +85,7 @@ def test_method_get_by_asset(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_by_asset_with_all_params(self, client: NeptuneAPIV2) -> None: lend = client.user.market.lend.get_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -96,7 +96,7 @@ def test_method_get_by_asset_with_all_params(self, client: NeptuneAPIV2) -> None @parametrize def test_raw_response_get_by_asset(self, client: NeptuneAPIV2) -> None: response = client.user.market.lend.with_raw_response.get_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -109,7 +109,7 @@ def test_raw_response_get_by_asset(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_by_asset(self, client: NeptuneAPIV2) -> None: with client.user.market.lend.with_streaming_response.get_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed @@ -139,7 +139,7 @@ class TestAsyncLend: @parametrize async def test_method_list(self, async_client: AsyncNeptuneAPIV2) -> None: lend = await async_client.user.market.lend.list( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(LendListResponse, lend, path=["response"]) @@ -147,7 +147,7 @@ async def test_method_list(self, async_client: AsyncNeptuneAPIV2) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: lend = await async_client.user.market.lend.list( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -157,7 +157,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncNeptuneAPIV2 @parametrize async def test_raw_response_list(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.lend.with_raw_response.list( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -169,7 +169,7 @@ async def test_raw_response_list(self, async_client: AsyncNeptuneAPIV2) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.lend.with_streaming_response.list( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -191,7 +191,7 @@ async def test_path_params_list(self, async_client: AsyncNeptuneAPIV2) -> None: @parametrize async def test_method_get_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: lend = await async_client.user.market.lend.get_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(LendGetByAssetResponse, lend, path=["response"]) @@ -200,7 +200,7 @@ async def test_method_get_by_asset(self, async_client: AsyncNeptuneAPIV2) -> Non @parametrize async def test_method_get_by_asset_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: lend = await async_client.user.market.lend.get_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -211,7 +211,7 @@ async def test_method_get_by_asset_with_all_params(self, async_client: AsyncNept @parametrize async def test_raw_response_get_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.lend.with_raw_response.get_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -224,7 +224,7 @@ async def test_raw_response_get_by_asset(self, async_client: AsyncNeptuneAPIV2) @parametrize async def test_streaming_response_get_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.lend.with_streaming_response.get_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed diff --git a/tests/api_resources/user/nept/test_staking.py b/tests/api_resources/user/nept/test_staking.py index 7c0fc6b..7d486de 100644 --- a/tests/api_resources/user/nept/test_staking.py +++ b/tests/api_resources/user/nept/test_staking.py @@ -26,7 +26,7 @@ class TestStaking: @parametrize def test_method_get_overview(self, client: NeptuneAPIV2) -> None: staking = client.user.nept.staking.get_overview( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(StakingGetOverviewResponse, staking, path=["response"]) @@ -34,7 +34,7 @@ def test_method_get_overview(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_overview_with_all_params(self, client: NeptuneAPIV2) -> None: staking = client.user.nept.staking.get_overview( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -44,7 +44,7 @@ def test_method_get_overview_with_all_params(self, client: NeptuneAPIV2) -> None @parametrize def test_raw_response_get_overview(self, client: NeptuneAPIV2) -> None: response = client.user.nept.staking.with_raw_response.get_overview( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -56,7 +56,7 @@ def test_raw_response_get_overview(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_overview(self, client: NeptuneAPIV2) -> None: with client.user.nept.staking.with_streaming_response.get_overview( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -78,7 +78,7 @@ def test_path_params_get_overview(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_staking_pool(self, client: NeptuneAPIV2) -> None: staking = client.user.nept.staking.get_staking_pool( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(StakingGetStakingPoolResponse, staking, path=["response"]) @@ -86,7 +86,7 @@ def test_method_get_staking_pool(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_staking_pool_with_all_params(self, client: NeptuneAPIV2) -> None: staking = client.user.nept.staking.get_staking_pool( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", duration=0, index=0, with_text=True, @@ -98,7 +98,7 @@ def test_method_get_staking_pool_with_all_params(self, client: NeptuneAPIV2) -> @parametrize def test_raw_response_get_staking_pool(self, client: NeptuneAPIV2) -> None: response = client.user.nept.staking.with_raw_response.get_staking_pool( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -110,7 +110,7 @@ def test_raw_response_get_staking_pool(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_staking_pool(self, client: NeptuneAPIV2) -> None: with client.user.nept.staking.with_streaming_response.get_staking_pool( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -132,7 +132,7 @@ def test_path_params_get_staking_pool(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_staking_pools(self, client: NeptuneAPIV2) -> None: staking = client.user.nept.staking.get_staking_pools( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(StakingGetStakingPoolsResponse, staking, path=["response"]) @@ -140,7 +140,7 @@ def test_method_get_staking_pools(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_staking_pools_with_all_params(self, client: NeptuneAPIV2) -> None: staking = client.user.nept.staking.get_staking_pools( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -150,7 +150,7 @@ def test_method_get_staking_pools_with_all_params(self, client: NeptuneAPIV2) -> @parametrize def test_raw_response_get_staking_pools(self, client: NeptuneAPIV2) -> None: response = client.user.nept.staking.with_raw_response.get_staking_pools( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -162,7 +162,7 @@ def test_raw_response_get_staking_pools(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_staking_pools(self, client: NeptuneAPIV2) -> None: with client.user.nept.staking.with_streaming_response.get_staking_pools( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -184,7 +184,7 @@ def test_path_params_get_staking_pools(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_unstaking(self, client: NeptuneAPIV2) -> None: staking = client.user.nept.staking.get_unstaking( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(StakingGetUnstakingResponse, staking, path=["response"]) @@ -192,7 +192,7 @@ def test_method_get_unstaking(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_unstaking_with_all_params(self, client: NeptuneAPIV2) -> None: staking = client.user.nept.staking.get_unstaking( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -202,7 +202,7 @@ def test_method_get_unstaking_with_all_params(self, client: NeptuneAPIV2) -> Non @parametrize def test_raw_response_get_unstaking(self, client: NeptuneAPIV2) -> None: response = client.user.nept.staking.with_raw_response.get_unstaking( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -214,7 +214,7 @@ def test_raw_response_get_unstaking(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_unstaking(self, client: NeptuneAPIV2) -> None: with client.user.nept.staking.with_streaming_response.get_unstaking( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -242,7 +242,7 @@ class TestAsyncStaking: @parametrize async def test_method_get_overview(self, async_client: AsyncNeptuneAPIV2) -> None: staking = await async_client.user.nept.staking.get_overview( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(StakingGetOverviewResponse, staking, path=["response"]) @@ -250,7 +250,7 @@ async def test_method_get_overview(self, async_client: AsyncNeptuneAPIV2) -> Non @parametrize async def test_method_get_overview_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: staking = await async_client.user.nept.staking.get_overview( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -260,7 +260,7 @@ async def test_method_get_overview_with_all_params(self, async_client: AsyncNept @parametrize async def test_raw_response_get_overview(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.nept.staking.with_raw_response.get_overview( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -272,7 +272,7 @@ async def test_raw_response_get_overview(self, async_client: AsyncNeptuneAPIV2) @parametrize async def test_streaming_response_get_overview(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.nept.staking.with_streaming_response.get_overview( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -294,7 +294,7 @@ async def test_path_params_get_overview(self, async_client: AsyncNeptuneAPIV2) - @parametrize async def test_method_get_staking_pool(self, async_client: AsyncNeptuneAPIV2) -> None: staking = await async_client.user.nept.staking.get_staking_pool( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(StakingGetStakingPoolResponse, staking, path=["response"]) @@ -302,7 +302,7 @@ async def test_method_get_staking_pool(self, async_client: AsyncNeptuneAPIV2) -> @parametrize async def test_method_get_staking_pool_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: staking = await async_client.user.nept.staking.get_staking_pool( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", duration=0, index=0, with_text=True, @@ -314,7 +314,7 @@ async def test_method_get_staking_pool_with_all_params(self, async_client: Async @parametrize async def test_raw_response_get_staking_pool(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.nept.staking.with_raw_response.get_staking_pool( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -326,7 +326,7 @@ async def test_raw_response_get_staking_pool(self, async_client: AsyncNeptuneAPI @parametrize async def test_streaming_response_get_staking_pool(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.nept.staking.with_streaming_response.get_staking_pool( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -348,7 +348,7 @@ async def test_path_params_get_staking_pool(self, async_client: AsyncNeptuneAPIV @parametrize async def test_method_get_staking_pools(self, async_client: AsyncNeptuneAPIV2) -> None: staking = await async_client.user.nept.staking.get_staking_pools( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(StakingGetStakingPoolsResponse, staking, path=["response"]) @@ -356,7 +356,7 @@ async def test_method_get_staking_pools(self, async_client: AsyncNeptuneAPIV2) - @parametrize async def test_method_get_staking_pools_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: staking = await async_client.user.nept.staking.get_staking_pools( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -366,7 +366,7 @@ async def test_method_get_staking_pools_with_all_params(self, async_client: Asyn @parametrize async def test_raw_response_get_staking_pools(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.nept.staking.with_raw_response.get_staking_pools( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -378,7 +378,7 @@ async def test_raw_response_get_staking_pools(self, async_client: AsyncNeptuneAP @parametrize async def test_streaming_response_get_staking_pools(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.nept.staking.with_streaming_response.get_staking_pools( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -400,7 +400,7 @@ async def test_path_params_get_staking_pools(self, async_client: AsyncNeptuneAPI @parametrize async def test_method_get_unstaking(self, async_client: AsyncNeptuneAPIV2) -> None: staking = await async_client.user.nept.staking.get_unstaking( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(StakingGetUnstakingResponse, staking, path=["response"]) @@ -408,7 +408,7 @@ async def test_method_get_unstaking(self, async_client: AsyncNeptuneAPIV2) -> No @parametrize async def test_method_get_unstaking_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: staking = await async_client.user.nept.staking.get_unstaking( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -418,7 +418,7 @@ async def test_method_get_unstaking_with_all_params(self, async_client: AsyncNep @parametrize async def test_raw_response_get_unstaking(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.nept.staking.with_raw_response.get_unstaking( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -430,7 +430,7 @@ async def test_raw_response_get_unstaking(self, async_client: AsyncNeptuneAPIV2) @parametrize async def test_streaming_response_get_unstaking(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.nept.staking.with_streaming_response.get_unstaking( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/user/test_market.py b/tests/api_resources/user/test_market.py index 853b082..bf26fff 100644 --- a/tests/api_resources/user/test_market.py +++ b/tests/api_resources/user/test_market.py @@ -25,7 +25,7 @@ class TestMarket: @parametrize def test_method_get_merged(self, client: NeptuneAPIV2) -> None: market = client.user.market.get_merged( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(MarketGetMergedResponse, market, path=["response"]) @@ -33,7 +33,7 @@ def test_method_get_merged(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_merged_with_all_params(self, client: NeptuneAPIV2) -> None: market = client.user.market.get_merged( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -43,7 +43,7 @@ def test_method_get_merged_with_all_params(self, client: NeptuneAPIV2) -> None: @parametrize def test_raw_response_get_merged(self, client: NeptuneAPIV2) -> None: response = client.user.market.with_raw_response.get_merged( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -55,7 +55,7 @@ def test_raw_response_get_merged(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_merged(self, client: NeptuneAPIV2) -> None: with client.user.market.with_streaming_response.get_merged( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -77,7 +77,7 @@ def test_path_params_get_merged(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_merged_by_asset(self, client: NeptuneAPIV2) -> None: market = client.user.market.get_merged_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(MarketGetMergedByAssetResponse, market, path=["response"]) @@ -86,7 +86,7 @@ def test_method_get_merged_by_asset(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_merged_by_asset_with_all_params(self, client: NeptuneAPIV2) -> None: market = client.user.market.get_merged_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -97,7 +97,7 @@ def test_method_get_merged_by_asset_with_all_params(self, client: NeptuneAPIV2) @parametrize def test_raw_response_get_merged_by_asset(self, client: NeptuneAPIV2) -> None: response = client.user.market.with_raw_response.get_merged_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -110,7 +110,7 @@ def test_raw_response_get_merged_by_asset(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_merged_by_asset(self, client: NeptuneAPIV2) -> None: with client.user.market.with_streaming_response.get_merged_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed @@ -134,7 +134,7 @@ def test_path_params_get_merged_by_asset(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_portfolio(self, client: NeptuneAPIV2) -> None: market = client.user.market.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(MarketGetPortfolioResponse, market, path=["response"]) @@ -142,7 +142,7 @@ def test_method_get_portfolio(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_portfolio_with_all_params(self, client: NeptuneAPIV2) -> None: market = client.user.market.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -152,7 +152,7 @@ def test_method_get_portfolio_with_all_params(self, client: NeptuneAPIV2) -> Non @parametrize def test_raw_response_get_portfolio(self, client: NeptuneAPIV2) -> None: response = client.user.market.with_raw_response.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -164,7 +164,7 @@ def test_raw_response_get_portfolio(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_portfolio(self, client: NeptuneAPIV2) -> None: with client.user.market.with_streaming_response.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -192,7 +192,7 @@ class TestAsyncMarket: @parametrize async def test_method_get_merged(self, async_client: AsyncNeptuneAPIV2) -> None: market = await async_client.user.market.get_merged( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(MarketGetMergedResponse, market, path=["response"]) @@ -200,7 +200,7 @@ async def test_method_get_merged(self, async_client: AsyncNeptuneAPIV2) -> None: @parametrize async def test_method_get_merged_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: market = await async_client.user.market.get_merged( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -210,7 +210,7 @@ async def test_method_get_merged_with_all_params(self, async_client: AsyncNeptun @parametrize async def test_raw_response_get_merged(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.with_raw_response.get_merged( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -222,7 +222,7 @@ async def test_raw_response_get_merged(self, async_client: AsyncNeptuneAPIV2) -> @parametrize async def test_streaming_response_get_merged(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.with_streaming_response.get_merged( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -244,7 +244,7 @@ async def test_path_params_get_merged(self, async_client: AsyncNeptuneAPIV2) -> @parametrize async def test_method_get_merged_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: market = await async_client.user.market.get_merged_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(MarketGetMergedByAssetResponse, market, path=["response"]) @@ -253,7 +253,7 @@ async def test_method_get_merged_by_asset(self, async_client: AsyncNeptuneAPIV2) @parametrize async def test_method_get_merged_by_asset_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: market = await async_client.user.market.get_merged_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -264,7 +264,7 @@ async def test_method_get_merged_by_asset_with_all_params(self, async_client: As @parametrize async def test_raw_response_get_merged_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.with_raw_response.get_merged_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -277,7 +277,7 @@ async def test_raw_response_get_merged_by_asset(self, async_client: AsyncNeptune @parametrize async def test_streaming_response_get_merged_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.with_streaming_response.get_merged_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed @@ -301,7 +301,7 @@ async def test_path_params_get_merged_by_asset(self, async_client: AsyncNeptuneA @parametrize async def test_method_get_portfolio(self, async_client: AsyncNeptuneAPIV2) -> None: market = await async_client.user.market.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(MarketGetPortfolioResponse, market, path=["response"]) @@ -309,7 +309,7 @@ async def test_method_get_portfolio(self, async_client: AsyncNeptuneAPIV2) -> No @parametrize async def test_method_get_portfolio_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: market = await async_client.user.market.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -319,7 +319,7 @@ async def test_method_get_portfolio_with_all_params(self, async_client: AsyncNep @parametrize async def test_raw_response_get_portfolio(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.market.with_raw_response.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -331,7 +331,7 @@ async def test_raw_response_get_portfolio(self, async_client: AsyncNeptuneAPIV2) @parametrize async def test_streaming_response_get_portfolio(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.market.with_streaming_response.get_portfolio( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/user/test_nept.py b/tests/api_resources/user/test_nept.py index ba03d3f..b1456cc 100644 --- a/tests/api_resources/user/test_nept.py +++ b/tests/api_resources/user/test_nept.py @@ -21,7 +21,7 @@ class TestNept: @parametrize def test_method_get_unlocks(self, client: NeptuneAPIV2) -> None: nept = client.user.nept.get_unlocks( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(NeptGetUnlocksResponse, nept, path=["response"]) @@ -29,7 +29,7 @@ def test_method_get_unlocks(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_unlocks_with_all_params(self, client: NeptuneAPIV2) -> None: nept = client.user.nept.get_unlocks( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_percent=True, with_text=True, with_value=True, @@ -40,7 +40,7 @@ def test_method_get_unlocks_with_all_params(self, client: NeptuneAPIV2) -> None: @parametrize def test_raw_response_get_unlocks(self, client: NeptuneAPIV2) -> None: response = client.user.nept.with_raw_response.get_unlocks( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -52,7 +52,7 @@ def test_raw_response_get_unlocks(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_unlocks(self, client: NeptuneAPIV2) -> None: with client.user.nept.with_streaming_response.get_unlocks( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -80,7 +80,7 @@ class TestAsyncNept: @parametrize async def test_method_get_unlocks(self, async_client: AsyncNeptuneAPIV2) -> None: nept = await async_client.user.nept.get_unlocks( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(NeptGetUnlocksResponse, nept, path=["response"]) @@ -88,7 +88,7 @@ async def test_method_get_unlocks(self, async_client: AsyncNeptuneAPIV2) -> None @parametrize async def test_method_get_unlocks_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: nept = await async_client.user.nept.get_unlocks( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_percent=True, with_text=True, with_value=True, @@ -99,7 +99,7 @@ async def test_method_get_unlocks_with_all_params(self, async_client: AsyncNeptu @parametrize async def test_raw_response_get_unlocks(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.nept.with_raw_response.get_unlocks( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -111,7 +111,7 @@ async def test_raw_response_get_unlocks(self, async_client: AsyncNeptuneAPIV2) - @parametrize async def test_streaming_response_get_unlocks(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.nept.with_streaming_response.get_unlocks( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/user/test_wallet.py b/tests/api_resources/user/test_wallet.py index 68945d7..7a702dd 100644 --- a/tests/api_resources/user/test_wallet.py +++ b/tests/api_resources/user/test_wallet.py @@ -24,7 +24,7 @@ class TestWallet: @parametrize def test_method_get_balance_by_asset(self, client: NeptuneAPIV2) -> None: wallet = client.user.wallet.get_balance_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(WalletGetBalanceByAssetResponse, wallet, path=["response"]) @@ -33,7 +33,7 @@ def test_method_get_balance_by_asset(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_balance_by_asset_with_all_params(self, client: NeptuneAPIV2) -> None: wallet = client.user.wallet.get_balance_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -44,7 +44,7 @@ def test_method_get_balance_by_asset_with_all_params(self, client: NeptuneAPIV2) @parametrize def test_raw_response_get_balance_by_asset(self, client: NeptuneAPIV2) -> None: response = client.user.wallet.with_raw_response.get_balance_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -57,7 +57,7 @@ def test_raw_response_get_balance_by_asset(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_balance_by_asset(self, client: NeptuneAPIV2) -> None: with client.user.wallet.with_streaming_response.get_balance_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed @@ -81,7 +81,7 @@ def test_path_params_get_balance_by_asset(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_balances(self, client: NeptuneAPIV2) -> None: wallet = client.user.wallet.get_balances( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(WalletGetBalancesResponse, wallet, path=["response"]) @@ -89,7 +89,7 @@ def test_method_get_balances(self, client: NeptuneAPIV2) -> None: @parametrize def test_method_get_balances_with_all_params(self, client: NeptuneAPIV2) -> None: wallet = client.user.wallet.get_balances( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -99,7 +99,7 @@ def test_method_get_balances_with_all_params(self, client: NeptuneAPIV2) -> None @parametrize def test_raw_response_get_balances(self, client: NeptuneAPIV2) -> None: response = client.user.wallet.with_raw_response.get_balances( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -111,7 +111,7 @@ def test_raw_response_get_balances(self, client: NeptuneAPIV2) -> None: @parametrize def test_streaming_response_get_balances(self, client: NeptuneAPIV2) -> None: with client.user.wallet.with_streaming_response.get_balances( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -139,7 +139,7 @@ class TestAsyncWallet: @parametrize async def test_method_get_balance_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: wallet = await async_client.user.wallet.get_balance_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) assert_matches_type(WalletGetBalanceByAssetResponse, wallet, path=["response"]) @@ -148,7 +148,7 @@ async def test_method_get_balance_by_asset(self, async_client: AsyncNeptuneAPIV2 @parametrize async def test_method_get_balance_by_asset_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: wallet = await async_client.user.wallet.get_balance_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", with_text=True, with_value=True, @@ -159,7 +159,7 @@ async def test_method_get_balance_by_asset_with_all_params(self, async_client: A @parametrize async def test_raw_response_get_balance_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.wallet.with_raw_response.get_balance_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) @@ -172,7 +172,7 @@ async def test_raw_response_get_balance_by_asset(self, async_client: AsyncNeptun @parametrize async def test_streaming_response_get_balance_by_asset(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.wallet.with_streaming_response.get_balance_by_asset( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", asset_id="token;-K-//-//3-", ) as response: assert not response.is_closed @@ -196,7 +196,7 @@ async def test_path_params_get_balance_by_asset(self, async_client: AsyncNeptune @parametrize async def test_method_get_balances(self, async_client: AsyncNeptuneAPIV2) -> None: wallet = await async_client.user.wallet.get_balances( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert_matches_type(WalletGetBalancesResponse, wallet, path=["response"]) @@ -204,7 +204,7 @@ async def test_method_get_balances(self, async_client: AsyncNeptuneAPIV2) -> Non @parametrize async def test_method_get_balances_with_all_params(self, async_client: AsyncNeptuneAPIV2) -> None: wallet = await async_client.user.wallet.get_balances( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", with_text=True, with_value=True, ) @@ -214,7 +214,7 @@ async def test_method_get_balances_with_all_params(self, async_client: AsyncNept @parametrize async def test_raw_response_get_balances(self, async_client: AsyncNeptuneAPIV2) -> None: response = await async_client.user.wallet.with_raw_response.get_balances( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) assert response.is_closed is True @@ -226,7 +226,7 @@ async def test_raw_response_get_balances(self, async_client: AsyncNeptuneAPIV2) @parametrize async def test_streaming_response_get_balances(self, async_client: AsyncNeptuneAPIV2) -> None: async with async_client.user.wallet.with_streaming_response.get_balances( - address="address", + address="injvalcons1a03k0ztfyjnd70apawva003pkh0adqmau0a9q0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/test_utils/test_path.py b/tests/test_utils/test_path.py new file mode 100644 index 0000000..5da6cc2 --- /dev/null +++ b/tests/test_utils/test_path.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from typing import Any + +import pytest + +from neptune_api_v2._utils._path import path_template + + +@pytest.mark.parametrize( + "template, kwargs, expected", + [ + ("/v1/{id}", dict(id="abc"), "/v1/abc"), + ("/v1/{a}/{b}", dict(a="x", b="y"), "/v1/x/y"), + ("/v1/{a}{b}/path/{c}?val={d}#{e}", dict(a="x", b="y", c="z", d="u", e="v"), "/v1/xy/path/z?val=u#v"), + ("/{w}/{w}", dict(w="echo"), "/echo/echo"), + ("/v1/static", {}, "/v1/static"), + ("", {}, ""), + ("/v1/?q={n}&count=10", dict(n=42), "/v1/?q=42&count=10"), + ("/v1/{v}", dict(v=None), "/v1/null"), + ("/v1/{v}", dict(v=True), "/v1/true"), + ("/v1/{v}", dict(v=False), "/v1/false"), + ("/v1/{v}", dict(v=".hidden"), "/v1/.hidden"), # dot prefix ok + ("/v1/{v}", dict(v="file.txt"), "/v1/file.txt"), # dot in middle ok + ("/v1/{v}", dict(v="..."), "/v1/..."), # triple dot ok + ("/v1/{a}{b}", dict(a=".", b="txt"), "/v1/.txt"), # dot var combining with adjacent to be ok + ("/items?q={v}#{f}", dict(v=".", f=".."), "/items?q=.#.."), # dots in query/fragment are fine + ( + "/v1/{a}?query={b}", + dict(a="../../other/endpoint", b="a&bad=true"), + "/v1/..%2F..%2Fother%2Fendpoint?query=a%26bad%3Dtrue", + ), + ("/v1/{val}", dict(val="a/b/c"), "/v1/a%2Fb%2Fc"), + ("/v1/{val}", dict(val="a/b/c?query=value"), "/v1/a%2Fb%2Fc%3Fquery=value"), + ("/v1/{val}", dict(val="a/b/c?query=value&bad=true"), "/v1/a%2Fb%2Fc%3Fquery=value&bad=true"), + ("/v1/{val}", dict(val="%20"), "/v1/%2520"), # escapes escape sequences in input + # Query: slash and ? are safe, # is not + ("/items?q={v}", dict(v="a/b"), "/items?q=a/b"), + ("/items?q={v}", dict(v="a?b"), "/items?q=a?b"), + ("/items?q={v}", dict(v="a#b"), "/items?q=a%23b"), + ("/items?q={v}", dict(v="a b"), "/items?q=a%20b"), + # Fragment: slash and ? are safe + ("/docs#{v}", dict(v="a/b"), "/docs#a/b"), + ("/docs#{v}", dict(v="a?b"), "/docs#a?b"), + # Path: slash, ? and # are all encoded + ("/v1/{v}", dict(v="a/b"), "/v1/a%2Fb"), + ("/v1/{v}", dict(v="a?b"), "/v1/a%3Fb"), + ("/v1/{v}", dict(v="a#b"), "/v1/a%23b"), + # same var encoded differently by component + ( + "/v1/{v}?q={v}#{v}", + dict(v="a/b?c#d"), + "/v1/a%2Fb%3Fc%23d?q=a/b?c%23d#a/b?c%23d", + ), + ("/v1/{val}", dict(val="x?admin=true"), "/v1/x%3Fadmin=true"), # query injection + ("/v1/{val}", dict(val="x#admin"), "/v1/x%23admin"), # fragment injection + ], +) +def test_interpolation(template: str, kwargs: dict[str, Any], expected: str) -> None: + assert path_template(template, **kwargs) == expected + + +def test_missing_kwarg_raises_key_error() -> None: + with pytest.raises(KeyError, match="org_id"): + path_template("/v1/{org_id}") + + +@pytest.mark.parametrize( + "template, kwargs", + [ + ("{a}/path", dict(a=".")), + ("{a}/path", dict(a="..")), + ("/v1/{a}", dict(a=".")), + ("/v1/{a}", dict(a="..")), + ("/v1/{a}/path", dict(a=".")), + ("/v1/{a}/path", dict(a="..")), + ("/v1/{a}{b}", dict(a=".", b=".")), # adjacent vars → ".." + ("/v1/{a}.", dict(a=".")), # var + static → ".." + ("/v1/{a}{b}", dict(a="", b=".")), # empty + dot → "." + ("/v1/%2e/{x}", dict(x="ok")), # encoded dot in static text + ("/v1/%2e./{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/.%2E/{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/{v}?q=1", dict(v="..")), + ("/v1/{v}#frag", dict(v="..")), + ], +) +def test_dot_segment_rejected(template: str, kwargs: dict[str, Any]) -> None: + with pytest.raises(ValueError, match="dot-segment"): + path_template(template, **kwargs) diff --git a/uv.lock b/uv.lock index 1b59a20..befbd83 100644 --- a/uv.lock +++ b/uv.lock @@ -821,7 +821,7 @@ requires-dist = [ { name = "httpx-aiohttp", marker = "extra == 'aiohttp'", specifier = ">=0.1.9" }, { name = "pydantic", specifier = ">=1.9.0,<3" }, { name = "sniffio" }, - { name = "typing-extensions", specifier = ">=4.10,<5" }, + { name = "typing-extensions", specifier = ">=4.14,<5" }, ] provides-extras = ["aiohttp"]