From 248d321679c47fb8b7598d7c338a34578aaf0eec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 19:55:58 +0000 Subject: [PATCH 1/5] chore: update SDK settings --- .github/workflows/publish-npm.yml | 5 ++--- .github/workflows/release-doctor.yml | 2 ++ .gitignore | 2 +- .stats.yml | 2 +- bin/check-release-environment | 4 ++++ bin/publish-npm | 12 ++---------- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 01913fa..4a270c0 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -12,9 +12,6 @@ jobs: publish: name: publish runs-on: ubuntu-latest - permissions: - contents: read - id-token: write environment: production steps: @@ -35,3 +32,5 @@ jobs: - name: Publish to NPM run: | bash ./bin/publish-npm + env: + NPM_TOKEN: ${{ secrets.NEPTUNE_API_V2_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index dec09a3..f92d0a7 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -18,4 +18,6 @@ jobs: - name: Check release environment run: | bash ./bin/check-release-environment + env: + NPM_TOKEN: ${{ secrets.NEPTUNE_API_V2_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 9487e48..c85fe68 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ dist-deno /*.tgz .idea/ .eslintcache -oidc + diff --git a/.stats.yml b/.stats.yml index 511af12..d5e23fb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-99a21fdf9159c28a75eb60c0b7ad4710d01b0a98dd0474267a07e9914039fa83.yml openapi_spec_hash: f58f326c00c34bc45b28b09b9530566c -config_hash: 27aff5f3f84397a9b3c2cb8a3c1d1e71 +config_hash: 84d629517f39556d062170b39b3702c6 diff --git a/bin/check-release-environment b/bin/check-release-environment index 6b43775..e4b6d58 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,6 +2,10 @@ errors=() +if [ -z "${NPM_TOKEN}" ]; then + errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + lenErrors=${#errors[@]} if [[ lenErrors -gt 0 ]]; then diff --git a/bin/publish-npm b/bin/publish-npm index 4e094d7..a609989 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -2,12 +2,7 @@ set -eux -if [[ ${NPM_TOKEN:-} ]]; then - npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" -elif [[ ! ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-} ]]; then - echo "ERROR: NPM_TOKEN must be set if not running in a Github Action with id-token permission" - exit 1 -fi +npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" pnpm build cd dist @@ -62,8 +57,5 @@ else TAG="latest" fi -# Install OIDC compatible npm version -npm install --prefix ../oidc/ npm@11.6.2 - # Publish with the appropriate tag -pnpm publish --npm-path "$(cd ../ && pwd)/oidc/node_modules/.bin/npm" --no-git-checks --tag "$TAG" +pnpm publish --no-git-checks --tag "$TAG" From c94d9855135f6fc9765fce2bd21851107f6249b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 19:56:31 +0000 Subject: [PATCH 2/5] chore: update SDK settings --- .github/workflows/publish-npm.yml | 5 +++-- .github/workflows/release-doctor.yml | 2 -- .gitignore | 2 +- .stats.yml | 2 +- bin/check-release-environment | 4 ---- bin/publish-npm | 12 ++++++++++-- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 4a270c0..01913fa 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -12,6 +12,9 @@ jobs: publish: name: publish runs-on: ubuntu-latest + permissions: + contents: read + id-token: write environment: production steps: @@ -32,5 +35,3 @@ jobs: - name: Publish to NPM run: | bash ./bin/publish-npm - env: - NPM_TOKEN: ${{ secrets.NEPTUNE_API_V2_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index f92d0a7..dec09a3 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -18,6 +18,4 @@ jobs: - name: Check release environment run: | bash ./bin/check-release-environment - env: - NPM_TOKEN: ${{ secrets.NEPTUNE_API_V2_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index c85fe68..9487e48 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ dist-deno /*.tgz .idea/ .eslintcache - +oidc diff --git a/.stats.yml b/.stats.yml index d5e23fb..511af12 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-99a21fdf9159c28a75eb60c0b7ad4710d01b0a98dd0474267a07e9914039fa83.yml openapi_spec_hash: f58f326c00c34bc45b28b09b9530566c -config_hash: 84d629517f39556d062170b39b3702c6 +config_hash: 27aff5f3f84397a9b3c2cb8a3c1d1e71 diff --git a/bin/check-release-environment b/bin/check-release-environment index e4b6d58..6b43775 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,10 +2,6 @@ errors=() -if [ -z "${NPM_TOKEN}" ]; then - errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") -fi - lenErrors=${#errors[@]} if [[ lenErrors -gt 0 ]]; then diff --git a/bin/publish-npm b/bin/publish-npm index a609989..4e094d7 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -2,7 +2,12 @@ set -eux -npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +if [[ ${NPM_TOKEN:-} ]]; then + npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +elif [[ ! ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-} ]]; then + echo "ERROR: NPM_TOKEN must be set if not running in a Github Action with id-token permission" + exit 1 +fi pnpm build cd dist @@ -57,5 +62,8 @@ else TAG="latest" fi +# Install OIDC compatible npm version +npm install --prefix ../oidc/ npm@11.6.2 + # Publish with the appropriate tag -pnpm publish --no-git-checks --tag "$TAG" +pnpm publish --npm-path "$(cd ../ && pwd)/oidc/node_modules/.bin/npm" --no-git-checks --tag "$TAG" From 7b26cae978ed8a0521371ddade2e72a376ef4be8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 15 Apr 2026 03:45:48 +0000 Subject: [PATCH 3/5] chore(ci): remove release-doctor workflow --- .github/workflows/release-doctor.yml | 21 --------------------- bin/check-release-environment | 18 ------------------ 2 files changed, 39 deletions(-) delete mode 100644 .github/workflows/release-doctor.yml delete mode 100644 bin/check-release-environment diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml deleted file mode 100644 index dec09a3..0000000 --- a/.github/workflows/release-doctor.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release Doctor -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - release_doctor: - name: release doctor - runs-on: ubuntu-latest - environment: production - if: github.repository == 'cryptechdev/neptune-api-v2-typescript' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') - - steps: - - uses: actions/checkout@v6 - - - name: Check release environment - run: | - bash ./bin/check-release-environment - diff --git a/bin/check-release-environment b/bin/check-release-environment deleted file mode 100644 index 6b43775..0000000 --- a/bin/check-release-environment +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -errors=() - -lenErrors=${#errors[@]} - -if [[ lenErrors -gt 0 ]]; then - echo -e "Found the following errors in the release environment:\n" - - for error in "${errors[@]}"; do - echo -e "- $error\n" - done - - exit 1 -fi - -echo "The environment is ready to push releases!" - From 69837543ef6ddc5cc9fff7ba256ce27860299184 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 03:27:55 +0000 Subject: [PATCH 4/5] feat(api): add TVL, missing balance variants - Added TVL /markets/TVL endpoint - Added TVL field to /markets endpoint - Fixed missing balance variants in collateral state --- .stats.yml | 8 +- api.md | 3 + src/client.ts | 6 ++ src/resources/index.ts | 3 + src/resources/markets/borrow/collaterals.ts | 6 ++ src/resources/markets/index.ts | 3 + src/resources/markets/markets.ts | 88 +++++++++++++++++++++ tests/api-resources/markets/markets.test.ts | 20 +++++ 8 files changed, 133 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 511af12..03d410d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 49 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-99a21fdf9159c28a75eb60c0b7ad4710d01b0a98dd0474267a07e9914039fa83.yml -openapi_spec_hash: f58f326c00c34bc45b28b09b9530566c -config_hash: 27aff5f3f84397a9b3c2cb8a3c1d1e71 +configured_endpoints: 50 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-40d8045cda417d4c8a7a4a0d014345cdeb273fb5fdfa48eea08493bc5a5079ce.yml +openapi_spec_hash: 71ca66dcf6e775aae3f49b42cd6ce2cc +config_hash: f5ca3bc259f95069f0db4114d34e29ef diff --git a/api.md b/api.md index a880f41..6f8ef46 100644 --- a/api.md +++ b/api.md @@ -51,10 +51,12 @@ Types: - GlobalMarketConfig - MarketRate - MergedMarket +- Tvl - MarketGetMergedResponse - MarketGetMergedByAssetResponse - MarketGetOverviewResponse - MarketGetParamsResponse +- MarketGetTvlResponse Methods: @@ -62,6 +64,7 @@ Methods: - client.markets.getMergedByAsset({ ...params }) -> MarketGetMergedByAssetResponse - client.markets.getOverview({ ...params }) -> MarketGetOverviewResponse - client.markets.getParams({ ...params }) -> MarketGetParamsResponse +- client.markets.getTvl({ ...params }) -> MarketGetTvlResponse ## Lend diff --git a/src/client.ts b/src/client.ts index 5db04bc..cb439a3 100644 --- a/src/client.ts +++ b/src/client.ts @@ -82,9 +82,12 @@ import { MarketGetOverviewResponse, MarketGetParamsParams, MarketGetParamsResponse, + MarketGetTvlParams, + MarketGetTvlResponse, MarketRate, Markets, MergedMarket, + Tvl, } from './resources/markets/markets'; import { Swap } from './resources/swap/swap'; import { @@ -871,14 +874,17 @@ export declare namespace NeptuneAPIV2 { type GlobalMarketConfig as GlobalMarketConfig, type MarketRate as MarketRate, type MergedMarket as MergedMarket, + type Tvl as Tvl, type MarketGetMergedResponse as MarketGetMergedResponse, type MarketGetMergedByAssetResponse as MarketGetMergedByAssetResponse, type MarketGetOverviewResponse as MarketGetOverviewResponse, type MarketGetParamsResponse as MarketGetParamsResponse, + type MarketGetTvlResponse as MarketGetTvlResponse, type MarketGetMergedParams as MarketGetMergedParams, type MarketGetMergedByAssetParams as MarketGetMergedByAssetParams, type MarketGetOverviewParams as MarketGetOverviewParams, type MarketGetParamsParams as MarketGetParamsParams, + type MarketGetTvlParams as MarketGetTvlParams, }; export { diff --git a/src/resources/index.ts b/src/resources/index.ts index 5481017..8a2b053 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -34,14 +34,17 @@ export { type GlobalMarketConfig, type MarketRate, type MergedMarket, + type Tvl, type MarketGetMergedResponse, type MarketGetMergedByAssetResponse, type MarketGetOverviewResponse, type MarketGetParamsResponse, + type MarketGetTvlResponse, type MarketGetMergedParams, type MarketGetMergedByAssetParams, type MarketGetOverviewParams, type MarketGetParamsParams, + type MarketGetTvlParams, } from './markets/markets'; export { Nept, diff --git a/src/resources/markets/borrow/collaterals.ts b/src/resources/markets/borrow/collaterals.ts index 41f9c32..579a959 100644 --- a/src/resources/markets/borrow/collaterals.ts +++ b/src/resources/markets/borrow/collaterals.ts @@ -223,6 +223,8 @@ export namespace BorrowCollateralState { * `true`. */ export interface Text { + balance: string; + collateral_sum: string; } @@ -239,6 +241,8 @@ export namespace BorrowCollateralState { * specified as well. */ export interface Value { + balance: string; + collateral_sum: string; extra: Value.Extra; @@ -264,6 +268,8 @@ export namespace BorrowCollateralState { * `with_text` and `with_value` are `true`. */ export interface Text { + balance: string; + collateral_sum: string; /** diff --git a/src/resources/markets/index.ts b/src/resources/markets/index.ts index 1fcb746..ff1747a 100644 --- a/src/resources/markets/index.ts +++ b/src/resources/markets/index.ts @@ -25,12 +25,15 @@ export { type GlobalMarketConfig, type MarketRate, type MergedMarket, + type Tvl, type MarketGetMergedResponse, type MarketGetMergedByAssetResponse, type MarketGetOverviewResponse, type MarketGetParamsResponse, + type MarketGetTvlResponse, type MarketGetMergedParams, type MarketGetMergedByAssetParams, type MarketGetOverviewParams, type MarketGetParamsParams, + type MarketGetTvlParams, } from './markets'; diff --git a/src/resources/markets/markets.ts b/src/resources/markets/markets.ts index 523012c..c3a1b4c 100644 --- a/src/resources/markets/markets.ts +++ b/src/resources/markets/markets.ts @@ -73,6 +73,16 @@ export class Markets extends APIResource { ): APIPromise { return this._client.get('/api/v1/markets/config', { query, ...options }); } + + /** + * Get market TVL + */ + getTvl( + query: MarketGetTvlParams | null | undefined = {}, + options?: RequestOptions, + ): APIPromise { + return this._client.get('/api/v1/markets/tvl', { query, ...options }); + } } export interface GlobalMarketConfig { @@ -238,6 +248,49 @@ export interface MergedMarket { lend: LendAPI.LendMarketData | null; } +export interface Tvl { + /** + * Market TVL in USD - collateral portion + */ + collateral_value: string; + + extra: Tvl.Extra; + + /** + * Market TVL in USD - lend portion + */ + lend_value: string; + + /** + * Market TVL in USD + */ + total_value: string; +} + +export namespace Tvl { + export interface Extra { + /** + * Human-readable field variants. Will not be null when query param `with_text` is + * `true`. + */ + text: Extra.Text | null; + } + + export namespace Extra { + /** + * Human-readable field variants. Will not be null when query param `with_text` is + * `true`. + */ + export interface Text { + collateral_value: string; + + lend_value: string; + + total_value: string; + } + } +} + export interface MarketGetMergedResponse { /** * Total number of objects irrespective of any pagination parameters. @@ -322,6 +375,11 @@ export namespace MarketGetOverviewResponse { * Current lending markets */ lend: Array; + + /** + * Market TVL + */ + tvl: MarketsAPI.Tvl; } } @@ -345,6 +403,26 @@ export interface MarketGetParamsResponse { status_text: string; } +export interface MarketGetTvlResponse { + data: Tvl; + + /** + * Error data. Guaranteed `null` for successful response. + */ + error: null; + + /** + * HTTP status. Successful responses are guaranteed to be < `400`. Conversely, + * error responses are guaranteed to be >= `400`. + */ + status: number; + + /** + * HTTP status text + */ + status_text: string; +} + export interface MarketGetMergedParams { /** * Include text variation fields @@ -393,6 +471,13 @@ export interface MarketGetParamsParams { with_text?: boolean; } +export interface MarketGetTvlParams { + /** + * Include text variation fields + */ + with_text?: boolean; +} + Markets.Lend = Lend; Markets.Borrow = Borrow; @@ -401,14 +486,17 @@ export declare namespace Markets { type GlobalMarketConfig as GlobalMarketConfig, type MarketRate as MarketRate, type MergedMarket as MergedMarket, + type Tvl as Tvl, type MarketGetMergedResponse as MarketGetMergedResponse, type MarketGetMergedByAssetResponse as MarketGetMergedByAssetResponse, type MarketGetOverviewResponse as MarketGetOverviewResponse, type MarketGetParamsResponse as MarketGetParamsResponse, + type MarketGetTvlResponse as MarketGetTvlResponse, type MarketGetMergedParams as MarketGetMergedParams, type MarketGetMergedByAssetParams as MarketGetMergedByAssetParams, type MarketGetOverviewParams as MarketGetOverviewParams, type MarketGetParamsParams as MarketGetParamsParams, + type MarketGetTvlParams as MarketGetTvlParams, }; export { diff --git a/tests/api-resources/markets/markets.test.ts b/tests/api-resources/markets/markets.test.ts index 1fa274f..cec0e45 100644 --- a/tests/api-resources/markets/markets.test.ts +++ b/tests/api-resources/markets/markets.test.ts @@ -85,4 +85,24 @@ describe('resource markets', () => { client.markets.getParams({ with_text: true }, { path: '/_stainless_unknown_path' }), ).rejects.toThrow(NeptuneAPIV2.NotFoundError); }); + + // Mock server tests are disabled + test.skip('getTvl', async () => { + const responsePromise = client.markets.getTvl(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // Mock server tests are disabled + test.skip('getTvl: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.markets.getTvl({ with_text: true }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(NeptuneAPIV2.NotFoundError); + }); }); From b59b7a956ea4dab97f97bd54c38be4500969f25d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 03:28:32 +0000 Subject: [PATCH 5/5] release: 0.6.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f1c1e58..bcd0522 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.0" + ".": "0.6.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index d4c499b..7b810c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.6.0 (2026-04-17) + +Full Changelog: [v0.5.0...v0.6.0](https://github.com/cryptechdev/neptune-api-v2-typescript/compare/v0.5.0...v0.6.0) + +### Features + +* **api:** add TVL, missing balance variants ([6983754](https://github.com/cryptechdev/neptune-api-v2-typescript/commit/69837543ef6ddc5cc9fff7ba256ce27860299184)) + + +### Chores + +* **ci:** remove release-doctor workflow ([7b26cae](https://github.com/cryptechdev/neptune-api-v2-typescript/commit/7b26cae978ed8a0521371ddade2e72a376ef4be8)) +* update SDK settings ([c94d985](https://github.com/cryptechdev/neptune-api-v2-typescript/commit/c94d9855135f6fc9765fce2bd21851107f6249b4)) +* update SDK settings ([248d321](https://github.com/cryptechdev/neptune-api-v2-typescript/commit/248d321679c47fb8b7598d7c338a34578aaf0eec)) + ## 0.5.0 (2026-04-09) Full Changelog: [v0.4.0...v0.5.0](https://github.com/cryptechdev/neptune-api-v2-typescript/compare/v0.4.0...v0.5.0) diff --git a/package.json b/package.json index ee4e7a1..cef7254 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neptunefinance/api-v2", - "version": "0.5.0", + "version": "0.6.0", "description": "The official TypeScript library for the Neptune API V2 API", "author": "Neptune API V2 <>", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 1f5d158..30c2817 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.5.0'; // x-release-please-version +export const VERSION = '0.6.0'; // x-release-please-version