diff --git a/apps/hermes/client/js/README.md b/apps/hermes/client/js/README.md index eebdb3f5f0..113cdb0fd5 100644 --- a/apps/hermes/client/js/README.md +++ b/apps/hermes/client/js/README.md @@ -32,7 +32,10 @@ const priceIds = [ ]; // Get price feeds -const priceFeeds = await connection.getPriceFeeds("btc", "crypto"); +const priceFeeds = await connection.getPriceFeeds({ + query: "btc", + assetType: "crypto", +}); console.log(priceFeeds); // Latest price updates diff --git a/apps/hermes/client/js/package.json b/apps/hermes/client/js/package.json index 3686b8d034..e75447bd55 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.3.0", + "version": "2.0.0", "description": "Pyth Hermes Client", "author": { "name": "Pyth Data Association" diff --git a/apps/hermes/client/js/src/HermesClient.ts b/apps/hermes/client/js/src/HermesClient.ts index 79635b0e5e..5e062bd02d 100644 --- a/apps/hermes/client/js/src/HermesClient.ts +++ b/apps/hermes/client/js/src/HermesClient.ts @@ -111,17 +111,18 @@ export class HermesClient { * * @param options Optional parameters: * - query: String to filter the price feeds. If provided, the results will be filtered to all price feeds whose symbol contains the query string. Query string is case insensitive. Example: "bitcoin". - * - filter: String to filter the price feeds by asset type. Possible values are "crypto", "equity", "fx", "metal", "rates". Filter string is case insensitive. + * - assetType: String to filter the price feeds by asset type. Possible values are "crypto", "equity", "fx", "metal", "rates", "crypto_redemption_rate". Filter string is case insensitive. * * @returns Array of PriceFeedMetadata objects. */ async getPriceFeeds(options?: { query?: string; - filter?: string; + assetType?: AssetType; }): Promise { const url = new URL("v2/price_feeds", this.baseURL); if (options) { - this.appendUrlSearchParams(url, options); + const transformedOptions = camelToSnakeCaseObject(options); + this.appendUrlSearchParams(url, transformedOptions); } return await this.httpRequest( url.toString(), diff --git a/apps/hermes/client/js/src/examples/HermesClient.ts b/apps/hermes/client/js/src/examples/HermesClient.ts index 20d9e1f0e5..07470b12a0 100644 --- a/apps/hermes/client/js/src/examples/HermesClient.ts +++ b/apps/hermes/client/js/src/examples/HermesClient.ts @@ -64,7 +64,7 @@ async function run() { console.log(`Price feeds matching "btc" with asset type "crypto":`); const priceFeeds = await connection.getPriceFeeds({ query: "btc", - filter: "crypto", + assetType: "crypto", }); console.log(priceFeeds);