diff --git a/package-lock.json b/package-lock.json index affd2809a..7ee10e73d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57438,7 +57438,7 @@ }, "price_service/client/js": { "name": "@pythnetwork/price-service-client", - "version": "1.7.0", + "version": "1.8.0", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-sdk": "*", @@ -57528,7 +57528,7 @@ }, "price_service/sdk/js": { "name": "@pythnetwork/price-service-sdk", - "version": "1.3.0", + "version": "1.4.0", "license": "Apache-2.0", "devDependencies": { "@types/jest": "^29.4.0", @@ -57964,7 +57964,7 @@ }, "target_chains/aptos/sdk/js": { "name": "@pythnetwork/pyth-aptos-js", - "version": "1.3.0", + "version": "1.4.0", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-client": "*", @@ -58133,7 +58133,7 @@ }, "target_chains/cosmwasm/sdk/js": { "name": "@pythnetwork/pyth-terra-js", - "version": "1.4.0", + "version": "1.5.0", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-client": "*", @@ -59547,7 +59547,7 @@ }, "target_chains/ethereum/sdk/js": { "name": "@pythnetwork/pyth-evm-js", - "version": "1.28.0", + "version": "1.29.0", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-client": "*", @@ -59678,7 +59678,7 @@ }, "target_chains/sui/sdk/js": { "name": "@pythnetwork/pyth-sui-js", - "version": "1.1.0", + "version": "1.2.0", "license": "Apache-2.0", "dependencies": { "@mysten/sui.js": "^0.37.1", diff --git a/price_service/client/js/package.json b/price_service/client/js/package.json index 10d7f4ddd..261a341ac 100644 --- a/price_service/client/js/package.json +++ b/price_service/client/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/price-service-client", - "version": "1.7.0", + "version": "1.8.0", "description": "Pyth price service client", "author": { "name": "Pyth Data Association" diff --git a/price_service/sdk/js/package.json b/price_service/sdk/js/package.json index 3fb5396ba..dca5b4040 100644 --- a/price_service/sdk/js/package.json +++ b/price_service/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/price-service-sdk", - "version": "1.3.0", + "version": "1.4.0", "description": "Pyth price service SDK", "homepage": "https://pyth.network", "main": "lib/index.js", diff --git a/price_service/sdk/js/src/index.ts b/price_service/sdk/js/src/index.ts index 7b23291a3..3c6ae073e 100644 --- a/price_service/sdk/js/src/index.ts +++ b/price_service/sdk/js/src/index.ts @@ -100,6 +100,10 @@ export class PriceFeedMetadata { * Pythnet slot number of the price */ slot?: number; + /** + * The time that the previous price was published + */ + prevPublishTime?: number; constructor(metadata: { attestationTime?: number; @@ -107,12 +111,14 @@ export class PriceFeedMetadata { receiveTime?: number; sequenceNumber?: number; slot?: number; + prevPublishTime?: number; }) { this.attestationTime = metadata.attestationTime; this.emitterChain = metadata.emitterChain; this.priceServiceReceiveTime = metadata.receiveTime; this.sequenceNumber = metadata.sequenceNumber; this.slot = metadata.slot; + this.prevPublishTime = metadata.prevPublishTime; } static fromJson(json: any): PriceFeedMetadata | undefined { @@ -126,6 +132,7 @@ export class PriceFeedMetadata { receiveTime: jsonFeed.price_service_receive_time, sequenceNumber: jsonFeed.sequence_number, slot: jsonFeed.slot, + prevPublishTime: jsonFeed.prev_publish_time, }); } @@ -136,6 +143,7 @@ export class PriceFeedMetadata { price_service_receive_time: this.priceServiceReceiveTime, sequence_number: this.sequenceNumber, slot: this.slot, + prev_publish_time: this.prevPublishTime, }; // this is done to avoid sending undefined values to the server return Convert.priceFeedMetadataToJson(jsonFeed); diff --git a/price_service/sdk/js/src/schemas/PriceFeed.ts b/price_service/sdk/js/src/schemas/PriceFeed.ts index 52e1f500e..f7d59856f 100644 --- a/price_service/sdk/js/src/schemas/PriceFeed.ts +++ b/price_service/sdk/js/src/schemas/PriceFeed.ts @@ -73,6 +73,10 @@ export interface PriceFeedMetadata { * Chain of the emitter */ emitter_chain: number; + /** + * The time that the previous price was published + */ + prev_publish_time?: number; /** * The time that the price service received the price */ @@ -294,6 +298,11 @@ const typeMap: any = { typ: u(undefined, 0), }, { json: "emitter_chain", js: "emitter_chain", typ: 0 }, + { + json: "prev_publish_time", + js: "prev_publish_time", + typ: u(undefined, 0), + }, { json: "price_service_receive_time", js: "price_service_receive_time", diff --git a/price_service/sdk/js/src/schemas/price_feed.json b/price_service/sdk/js/src/schemas/price_feed.json index a3ca6498c..08d3aa894 100644 --- a/price_service/sdk/js/src/schemas/price_feed.json +++ b/price_service/sdk/js/src/schemas/price_feed.json @@ -84,6 +84,11 @@ "description": "Pythnet slot number of the price", "type": "integer", "format": "int64" + }, + "prev_publish_time": { + "description": "The time that the previous price was published", + "type": "integer", + "format": "int64" } } } diff --git a/target_chains/aptos/sdk/js/package.json b/target_chains/aptos/sdk/js/package.json index 797fbd2de..80c94b8a8 100644 --- a/target_chains/aptos/sdk/js/package.json +++ b/target_chains/aptos/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-aptos-js", - "version": "1.3.0", + "version": "1.4.0", "description": "Pyth Network Aptos Utilities", "homepage": "https://pyth.network", "author": { diff --git a/target_chains/cosmwasm/sdk/js/package.json b/target_chains/cosmwasm/sdk/js/package.json index a5d3d65a0..d75afd7b9 100644 --- a/target_chains/cosmwasm/sdk/js/package.json +++ b/target_chains/cosmwasm/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-terra-js", - "version": "1.4.0", + "version": "1.5.0", "description": "Pyth Network Terra Utils in JS", "homepage": "https://pyth.network", "author": { diff --git a/target_chains/ethereum/sdk/js/package.json b/target_chains/ethereum/sdk/js/package.json index 5028e7828..64527ce62 100644 --- a/target_chains/ethereum/sdk/js/package.json +++ b/target_chains/ethereum/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-evm-js", - "version": "1.28.0", + "version": "1.29.0", "description": "Pyth Network EVM Utils in JS", "homepage": "https://pyth.network", "author": { diff --git a/target_chains/sui/sdk/js/package.json b/target_chains/sui/sdk/js/package.json index 2aba6be99..40be40f8a 100644 --- a/target_chains/sui/sdk/js/package.json +++ b/target_chains/sui/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-sui-js", - "version": "1.1.0", + "version": "1.2.0", "description": "Pyth Network Sui Utilities", "homepage": "https://pyth.network", "author": { diff --git a/target_chains/sui/sdk/js/src/examples/SuiRelay.ts b/target_chains/sui/sdk/js/src/examples/SuiRelay.ts index f53b6b522..0d15b698f 100644 --- a/target_chains/sui/sdk/js/src/examples/SuiRelay.ts +++ b/target_chains/sui/sdk/js/src/examples/SuiRelay.ts @@ -18,9 +18,8 @@ const argvPromise = yargs(hideBin(process.argv)) type: "array", demandOption: true, }) - .option("price-service", { - description: - "Endpoint URL for the price service. e.g: https://xc-mainnet.pyth.network", + .option("hermes", { + description: "Endpoint URL for Hermes. e.g: https://hermes.pyth.network", type: "string", demandOption: true, }) @@ -52,7 +51,7 @@ async function run() { const argv = await argvPromise; // Fetch the latest price feed update data from the Price Service - const connection = new SuiPriceServiceConnection(argv["price-service"]); + const connection = new SuiPriceServiceConnection(argv["hermes"]); const feeds = argv["feed-id"] as string[]; const priceFeedUpdateData = await connection.getPriceFeedsUpdateData(feeds);