From babe448ee10fe80f21b8994dde7228d1fbd4f4d9 Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Mon, 24 Jun 2024 17:24:11 +0200 Subject: [PATCH 1/3] fix(apps/hermes/client): allow baseURL with prefixes --- apps/hermes/client/js/src/HermesClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/hermes/client/js/src/HermesClient.ts b/apps/hermes/client/js/src/HermesClient.ts index 12475dadd3..41ac11680e 100644 --- a/apps/hermes/client/js/src/HermesClient.ts +++ b/apps/hermes/client/js/src/HermesClient.ts @@ -100,7 +100,7 @@ export class HermesClient { query?: string; filter?: string; }): Promise { - const url = new URL("/v2/price_feeds", this.baseURL); + const url = new URL(`${this.baseURL}/v2/price_feeds`); if (options) { this.appendUrlSearchParams(url, options); } @@ -198,7 +198,7 @@ export class HermesClient { benchmarksOnly?: boolean; } ): Promise { - const url = new URL("/v2/updates/price/stream", this.baseURL); + const url = new URL(`${this.baseURL}/v2/updates/price/stream`); ids.forEach((id) => { url.searchParams.append("ids[]", id); }); From 8247d5ffaeec6c0ea32cc92d066895d9700532fd Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Tue, 25 Jun 2024 11:57:42 +0200 Subject: [PATCH 2/3] use baseURL + url format --- apps/hermes/client/js/src/HermesClient.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/hermes/client/js/src/HermesClient.ts b/apps/hermes/client/js/src/HermesClient.ts index 41ac11680e..510c1043dd 100644 --- a/apps/hermes/client/js/src/HermesClient.ts +++ b/apps/hermes/client/js/src/HermesClient.ts @@ -100,7 +100,7 @@ export class HermesClient { query?: string; filter?: string; }): Promise { - const url = new URL(`${this.baseURL}/v2/price_feeds`); + const url = new URL("v2/price_feeds", this.baseURL); if (options) { this.appendUrlSearchParams(url, options); } @@ -129,7 +129,7 @@ export class HermesClient { parsed?: boolean; } ): Promise { - const url = new URL(`${this.baseURL}/v2/updates/price/latest`); + const url = new URL(`v2/updates/price/latest`, this.baseURL); for (const id of ids) { url.searchParams.append("ids[]", id); } @@ -162,7 +162,7 @@ export class HermesClient { parsed?: boolean; } ): Promise { - const url = new URL(`${this.baseURL}/v2/updates/price/${publishTime}`); + const url = new URL(`v2/updates/price/${publishTime}`, this.baseURL); for (const id of ids) { url.searchParams.append("ids[]", id); } @@ -198,7 +198,7 @@ export class HermesClient { benchmarksOnly?: boolean; } ): Promise { - const url = new URL(`${this.baseURL}/v2/updates/price/stream`); + const url = new URL("v2/updates/price/stream", this.baseURL); ids.forEach((id) => { url.searchParams.append("ids[]", id); }); From 3a08e38cf7811de8295abe5d274cc8d5e2f50707 Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Tue, 25 Jun 2024 12:03:36 +0200 Subject: [PATCH 3/3] update package version --- apps/hermes/client/js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hermes/client/js/package.json b/apps/hermes/client/js/package.json index a49a5c7b2b..575e86f635 100644 --- a/apps/hermes/client/js/package.json +++ b/apps/hermes/client/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/hermes-client", - "version": "1.0.2", + "version": "1.0.3", "description": "Pyth Hermes Client", "author": { "name": "Pyth Data Association"