Skip to content

Commit dcf7a31

Browse files
authored
fix(apps/hermes/client): allow baseURL with suffixes (#1728)
* fix(apps/hermes/client): allow baseURL with prefixes * use baseURL + url format * update package version
1 parent 3d3bd49 commit dcf7a31

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apps/hermes/client/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/hermes-client",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Pyth Hermes Client",
55
"author": {
66
"name": "Pyth Data Association"

apps/hermes/client/js/src/HermesClient.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class HermesClient {
100100
query?: string;
101101
filter?: string;
102102
}): Promise<PriceFeedMetadata[]> {
103-
const url = new URL("/v2/price_feeds", this.baseURL);
103+
const url = new URL("v2/price_feeds", this.baseURL);
104104
if (options) {
105105
this.appendUrlSearchParams(url, options);
106106
}
@@ -129,7 +129,7 @@ export class HermesClient {
129129
parsed?: boolean;
130130
}
131131
): Promise<PriceUpdate> {
132-
const url = new URL(`${this.baseURL}/v2/updates/price/latest`);
132+
const url = new URL(`v2/updates/price/latest`, this.baseURL);
133133
for (const id of ids) {
134134
url.searchParams.append("ids[]", id);
135135
}
@@ -162,7 +162,7 @@ export class HermesClient {
162162
parsed?: boolean;
163163
}
164164
): Promise<PriceUpdate> {
165-
const url = new URL(`${this.baseURL}/v2/updates/price/${publishTime}`);
165+
const url = new URL(`v2/updates/price/${publishTime}`, this.baseURL);
166166
for (const id of ids) {
167167
url.searchParams.append("ids[]", id);
168168
}
@@ -198,7 +198,7 @@ export class HermesClient {
198198
benchmarksOnly?: boolean;
199199
}
200200
): Promise<EventSource> {
201-
const url = new URL("/v2/updates/price/stream", this.baseURL);
201+
const url = new URL("v2/updates/price/stream", this.baseURL);
202202
ids.forEach((id) => {
203203
url.searchParams.append("ids[]", id);
204204
});

0 commit comments

Comments
 (0)