From 8e74e53aea3569e24a01e4d35c6c729e5c51894f Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Wed, 5 Oct 2022 16:47:13 +0000 Subject: [PATCH] Cascade pyth-sdk-js update to pyth-common-js (#50) --- pyth-common-js/package-lock.json | 18 +++++++++--------- pyth-common-js/package.json | 4 ++-- .../src/examples/PriceServiceClient.ts | 4 ++-- pyth-common-js/src/index.ts | 1 - 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/pyth-common-js/package-lock.json b/pyth-common-js/package-lock.json index 540e4fc..f28496b 100644 --- a/pyth-common-js/package-lock.json +++ b/pyth-common-js/package-lock.json @@ -1,15 +1,15 @@ { "name": "@pythnetwork/pyth-common-js", - "version": "0.5.0", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@pythnetwork/pyth-common-js", - "version": "0.5.0", + "version": "1.0.0", "license": "Apache-2.0", "dependencies": { - "@pythnetwork/pyth-sdk-js": "^0.2.0", + "@pythnetwork/pyth-sdk-js": "^1.0.0", "@types/ws": "^8.5.3", "axios": "^0.26.1", "axios-retry": "^3.2.4", @@ -1011,9 +1011,9 @@ } }, "node_modules/@pythnetwork/pyth-sdk-js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-js/-/pyth-sdk-js-0.2.0.tgz", - "integrity": "sha512-cR2GprnoXCQm/JA8rmA6K9iPJ/ZxdlZUjTP9iKsZXpwykQUJ6+Dh67W3dl4HrE59YeVL6vrQRIjVq5Fg+DKTKw==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-js/-/pyth-sdk-js-1.0.0.tgz", + "integrity": "sha512-nZ3tmn5EhR7Y6177cAE7p7iQJK40bipMUI4ZBwRhgTONOcg35jG0fsvlETZYgij0baQ1PMJQE6dIqZ50EMZpJw==" }, "node_modules/@sinonjs/commons": { "version": "1.8.3", @@ -6014,9 +6014,9 @@ } }, "@pythnetwork/pyth-sdk-js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-js/-/pyth-sdk-js-0.2.0.tgz", - "integrity": "sha512-cR2GprnoXCQm/JA8rmA6K9iPJ/ZxdlZUjTP9iKsZXpwykQUJ6+Dh67W3dl4HrE59YeVL6vrQRIjVq5Fg+DKTKw==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sdk-js/-/pyth-sdk-js-1.0.0.tgz", + "integrity": "sha512-nZ3tmn5EhR7Y6177cAE7p7iQJK40bipMUI4ZBwRhgTONOcg35jG0fsvlETZYgij0baQ1PMJQE6dIqZ50EMZpJw==" }, "@sinonjs/commons": { "version": "1.8.3", diff --git a/pyth-common-js/package.json b/pyth-common-js/package.json index b1682af..0fc2fdb 100644 --- a/pyth-common-js/package.json +++ b/pyth-common-js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-common-js", - "version": "0.5.0", + "version": "1.0.0", "description": "Pyth Network Common Utils in JS", "author": { "name": "Pyth Data Association" @@ -41,7 +41,7 @@ "yargs": "^17.4.1" }, "dependencies": { - "@pythnetwork/pyth-sdk-js": "^0.2.0", + "@pythnetwork/pyth-sdk-js": "^1.0.0", "@types/ws": "^8.5.3", "axios": "^0.26.1", "axios-retry": "^3.2.4", diff --git a/pyth-common-js/src/examples/PriceServiceClient.ts b/pyth-common-js/src/examples/PriceServiceClient.ts index dc6a92d..5818b36 100644 --- a/pyth-common-js/src/examples/PriceServiceClient.ts +++ b/pyth-common-js/src/examples/PriceServiceClient.ts @@ -36,14 +36,14 @@ async function run() { const priceIds = argv.priceIds as string[]; const priceFeeds = await connection.getLatestPriceFeeds(priceIds); console.log(priceFeeds); - console.log(priceFeeds?.at(0)?.getCurrentPrice()); + console.log(priceFeeds?.at(0)?.getPriceNoOlderThan(60)); console.log("Subscribing to price feed updates."); await connection.subscribePriceFeedUpdates(priceIds, (priceFeed) => { console.log( `Current price for ${priceFeed.id}: ${JSON.stringify( - priceFeed.getCurrentPrice() + priceFeed.getPriceNoOlderThan(60) )}.` ); }); diff --git a/pyth-common-js/src/index.ts b/pyth-common-js/src/index.ts index 33271e6..1289a8b 100644 --- a/pyth-common-js/src/index.ts +++ b/pyth-common-js/src/index.ts @@ -8,6 +8,5 @@ export { HexString, PriceFeed, Price, - PriceStatus, UnixTimestamp, } from "@pythnetwork/pyth-sdk-js";