Skip to content

Commit

Permalink
fix(apps/hermes/client): allow baseURL with suffixes (#1728)
Browse files Browse the repository at this point in the history
* fix(apps/hermes/client): allow baseURL with prefixes

* use baseURL + url format

* update package version
  • Loading branch information
mubaris authored Jun 25, 2024
1 parent 3d3bd49 commit dcf7a31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/hermes/client/js/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 4 additions & 4 deletions apps/hermes/client/js/src/HermesClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class HermesClient {
query?: string;
filter?: string;
}): Promise<PriceFeedMetadata[]> {
const url = new URL("/v2/price_feeds", this.baseURL);
const url = new URL("v2/price_feeds", this.baseURL);
if (options) {
this.appendUrlSearchParams(url, options);
}
Expand Down Expand Up @@ -129,7 +129,7 @@ export class HermesClient {
parsed?: boolean;
}
): Promise<PriceUpdate> {
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);
}
Expand Down Expand Up @@ -162,7 +162,7 @@ export class HermesClient {
parsed?: boolean;
}
): Promise<PriceUpdate> {
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);
}
Expand Down Expand Up @@ -198,7 +198,7 @@ export class HermesClient {
benchmarksOnly?: boolean;
}
): Promise<EventSource> {
const url = new URL("/v2/updates/price/stream", this.baseURL);
const url = new URL("v2/updates/price/stream", this.baseURL);
ids.forEach((id) => {
url.searchParams.append("ids[]", id);
});
Expand Down

0 comments on commit dcf7a31

Please sign in to comment.