From e4b97cbddb03ac326cf9629fb0aea0f7db73525e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 19 Mar 2024 16:05:34 +0000 Subject: [PATCH 1/3] chore(release): 4.0.0 ## [4.0.0](https://github.com/NibiruChain/ts-sdk/compare/v3.3.4...v4.0.0) (2024-03-19) ### Features * trigger latest build ([#340](https://github.com/NibiruChain/ts-sdk/issues/340)) ([866c603](https://github.com/NibiruChain/ts-sdk/commit/866c603be250b06f10ead37bc7859a34b9ad4547)) ### Bug Fixes * tests ([00d98cb](https://github.com/NibiruChain/ts-sdk/commit/00d98cbcfafcc21e9bb32f370be7040c167ab198)) ### Code Refactors * adding contract type to user ([7857b2b](https://github.com/NibiruChain/ts-sdk/commit/7857b2b6fca65a502075f365c5fca4cb235ef78d)) ### Tests * fix ([a12ba71](https://github.com/NibiruChain/ts-sdk/commit/a12ba71fb821c1939a60be978bdc3386a43d7f13)) [skip ci] --- CHANGELOG.md | 18 ++++++++++++++++++ package.json | 2 +- src/gql/query/index.ts | 4 ++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d712ac11..215dabf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## [4.0.0](https://github.com/NibiruChain/ts-sdk/compare/v3.3.4...v4.0.0) (2024-03-19) + +### Features + +- trigger latest build ([#340](https://github.com/NibiruChain/ts-sdk/issues/340)) ([866c603](https://github.com/NibiruChain/ts-sdk/commit/866c603be250b06f10ead37bc7859a34b9ad4547)) + +### Bug Fixes + +- tests ([00d98cb](https://github.com/NibiruChain/ts-sdk/commit/00d98cbcfafcc21e9bb32f370be7040c167ab198)) + +### Code Refactors + +- adding contract type to user ([7857b2b](https://github.com/NibiruChain/ts-sdk/commit/7857b2b6fca65a502075f365c5fca4cb235ef78d)) + +### Tests + +- fix ([a12ba71](https://github.com/NibiruChain/ts-sdk/commit/a12ba71fb821c1939a60be978bdc3386a43d7f13)) + ### [3.3.4](https://github.com/NibiruChain/ts-sdk/compare/v3.3.3...v3.3.4) (2024-03-18) ### Miscellaneous Chores diff --git a/package.json b/package.json index fb019433..b0df3ff3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nibiruchain/nibijs", "description": "The TypeScript SDK for the Nibiru blockchain.", - "version": "3.3.4", + "version": "4.0.0", "license": "MIT", "repository": { "type": "git", diff --git a/src/gql/query/index.ts b/src/gql/query/index.ts index c1fe4cb9..fd5d833e 100644 --- a/src/gql/query/index.ts +++ b/src/gql/query/index.ts @@ -9,8 +9,8 @@ export * from "./featureFlags" export * from "./governance" export * from "./ibc" export * from "./inflation" -export * from "./marketing" export * from "./markPriceCandles" +export * from "./marketing" export * from "./oracle" export * from "./perp" export * from "./redelegations" @@ -18,8 +18,8 @@ export * from "./spotLpPositions" export * from "./spotPoolCreated" export * from "./spotPoolExited" export * from "./spotPoolJoined" -export * from "./spotPools" export * from "./spotPoolSwap" +export * from "./spotPools" export * from "./stats" export * from "./unbondings" export * from "./users" From b4ab83c2d9b4f17ec0f8bad6141bc7b5a9dc1228 Mon Sep 17 00:00:00 2001 From: Cameron Gilbert Date: Mon, 1 Apr 2024 16:10:15 -0400 Subject: [PATCH 2/3] feat: proxy prices (#343) (#344) * feat: proxy prices (#343) * fix: test name --- src/gql/heart-monitor/heart-monitor.test.ts | 18 +++++++++++ src/gql/heart-monitor/heart-monitor.ts | 8 +++++ src/gql/query/index.ts | 1 + src/gql/query/proxies.ts | 33 +++++++++++++++++++++ src/gql/utils/defaultObjects.ts | 18 +++++++++++ 5 files changed, 78 insertions(+) create mode 100644 src/gql/query/proxies.ts diff --git a/src/gql/heart-monitor/heart-monitor.test.ts b/src/gql/heart-monitor/heart-monitor.test.ts index d86a020c..329564af 100644 --- a/src/gql/heart-monitor/heart-monitor.test.ts +++ b/src/gql/heart-monitor/heart-monitor.test.ts @@ -101,6 +101,8 @@ import { QueryMarketingMutationArgs, GQLMarketingMutationFields, defaultAccountLinksInfo, + defaultProxy, + GQLProxies, } from ".." const nibiruUrl = "testnet-1" @@ -863,6 +865,22 @@ test("perpPositionsSubscription", async () => { ) }) +const testProxies = async (fields?: GQLProxies) => { + const resp = await heartMonitor.proxies(fields) + expect(resp).toHaveProperty("proxies") + + if (resp.proxies) { + const { proxies } = resp + + checkFields([proxies], ["bybit"]) + } +} + +test("proxies", async () => { + await testProxies(defaultProxy) + await testProxies() +}) + test("queryBatchHandler", async () => { // TODO: Make a partial type that includes all of these const resp = await heartMonitor.GQLQueryGqlBatchHandler<{ diff --git a/src/gql/heart-monitor/heart-monitor.ts b/src/gql/heart-monitor/heart-monitor.ts index 91e0c9c2..3705a5d9 100644 --- a/src/gql/heart-monitor/heart-monitor.ts +++ b/src/gql/heart-monitor/heart-monitor.ts @@ -112,6 +112,9 @@ import { DeepPartial, QueryMarketingMutationArgs, GQLMarketingMutationFields, + GQLProxies, + GqlOutProxies, + proxies, } from ".." /** IHeartMonitor is an interface for a Heart Monitor GraphQL API. @@ -207,6 +210,8 @@ export interface IHeartMonitor { AsyncIterableIterator> | undefined > + readonly proxies: (fields?: DeepPartial) => Promise + readonly GQLQueryGqlBatchHandler: ( queryQueryStrings: string[] ) => Promise @@ -374,6 +379,9 @@ export class HeartMonitor implements IHeartMonitor { fields?: DeepPartial ) => perpPositionsSubscription(args, this.subscriptionClient, fields) + proxies = async (fields?: DeepPartial) => + proxies(this.gqlEndpt, fields) + GQLQueryGqlBatchHandler = async (queryQueryStrings: string[]) => queryBatchHandler(queryQueryStrings, this.gqlEndpt) diff --git a/src/gql/query/index.ts b/src/gql/query/index.ts index fd5d833e..541fbff4 100644 --- a/src/gql/query/index.ts +++ b/src/gql/query/index.ts @@ -13,6 +13,7 @@ export * from "./markPriceCandles" export * from "./marketing" export * from "./oracle" export * from "./perp" +export * from "./proxies" export * from "./redelegations" export * from "./spotLpPositions" export * from "./spotPoolCreated" diff --git a/src/gql/query/proxies.ts b/src/gql/query/proxies.ts new file mode 100644 index 00000000..78ceaf92 --- /dev/null +++ b/src/gql/query/proxies.ts @@ -0,0 +1,33 @@ +import { + defaultProxy, + convertObjectToPropertiesString, + doGqlQuery, + gqlQuery, + GQLQuery, + DeepPartial, + GQLProxies, +} from ".." + +export interface GqlOutProxies { + proxies?: GQLQuery["proxies"] +} + +export const proxiesQueryString = ( + excludeParentObject: boolean, + fields?: DeepPartial +) => { + return gqlQuery( + "proxies", + {}, + fields + ? convertObjectToPropertiesString(fields) + : convertObjectToPropertiesString(defaultProxy), + excludeParentObject + ) +} + +export const proxies = async ( + endpt: string, + fields?: DeepPartial +): Promise => + doGqlQuery(proxiesQueryString(false, fields), endpt) diff --git a/src/gql/utils/defaultObjects.ts b/src/gql/utils/defaultObjects.ts index 8a6916af..732dfc5e 100644 --- a/src/gql/utils/defaultObjects.ts +++ b/src/gql/utils/defaultObjects.ts @@ -23,6 +23,7 @@ import { GQLPerpMarket, GQLPerpPosition, GQLPerpPositionChange, + GQLProxies, GQLRedelegation, GQLSpotLpPosition, GQLSpotPool, @@ -509,3 +510,20 @@ export const defaultAccountLinksInfo: GQLAccountLinksInfo = { discordId: "", twitterUser: defaultTwitterUser, } + +export const defaultProxy: GQLProxies = { + bybit: { + ask1Price: "", + ask1Size: "", + bid1Price: "", + bid1Size: "", + highPrice24h: "", + lastPrice: "", + lowPrice24h: "", + prevPrice24h: "", + price24hPcnt: "", + symbol: "", + turnover24h: "", + volume24h: "", + }, +} From f43d14b154aed4a808582b910fa4807f898ab91d Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 1 Apr 2024 20:12:30 +0000 Subject: [PATCH 3/3] chore(release): 4.1.0 ## [4.1.0](https://github.com/NibiruChain/ts-sdk/compare/v4.0.0...v4.1.0) (2024-04-01) ### Features * proxy prices ([#343](https://github.com/NibiruChain/ts-sdk/issues/343)) ([#344](https://github.com/NibiruChain/ts-sdk/issues/344)) ([b4ab83c](https://github.com/NibiruChain/ts-sdk/commit/b4ab83c2d9b4f17ec0f8bad6141bc7b5a9dc1228)) [skip ci] --- CHANGELOG.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 215dabf9..cead4273 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [4.1.0](https://github.com/NibiruChain/ts-sdk/compare/v4.0.0...v4.1.0) (2024-04-01) + +### Features + +- proxy prices ([#343](https://github.com/NibiruChain/ts-sdk/issues/343)) ([#344](https://github.com/NibiruChain/ts-sdk/issues/344)) ([b4ab83c](https://github.com/NibiruChain/ts-sdk/commit/b4ab83c2d9b4f17ec0f8bad6141bc7b5a9dc1228)) + ## [4.0.0](https://github.com/NibiruChain/ts-sdk/compare/v3.3.4...v4.0.0) (2024-03-19) ### Features diff --git a/package.json b/package.json index b0df3ff3..f6062b23 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nibiruchain/nibijs", "description": "The TypeScript SDK for the Nibiru blockchain.", - "version": "4.0.0", + "version": "4.1.0", "license": "MIT", "repository": { "type": "git",