Skip to content
This repository was archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Cascade pyth-sdk-js update to pyth-common-js (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-bahjati authored Oct 5, 2022
1 parent 7ada693 commit 8e74e53
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
18 changes: 9 additions & 9 deletions pyth-common-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyth-common-js/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions pyth-common-js/src/examples/PriceServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)}.`
);
});
Expand Down
1 change: 0 additions & 1 deletion pyth-common-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ export {
HexString,
PriceFeed,
Price,
PriceStatus,
UnixTimestamp,
} from "@pythnetwork/pyth-sdk-js";

0 comments on commit 8e74e53

Please sign in to comment.