Skip to content

Commit f99f23c

Browse files
authored
update price service sdk (#849)
* update price service sdk * bump version * fix test * include slot * bump price-service-client version * bump all that uses price-service-client * bump all that uses price-service-client
1 parent ce8e064 commit f99f23c

File tree

11 files changed

+52
-33
lines changed

11 files changed

+52
-33
lines changed

package-lock.json

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

price_pusher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/price-pusher",
3-
"version": "5.2.1",
3+
"version": "5.3.0",
44
"description": "Pyth Price Pusher",
55
"homepage": "https://pyth.network",
66
"main": "lib/index.js",

price_service/client/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/price-service-client",
3-
"version": "1.4.1",
3+
"version": "1.5.0",
44
"description": "Pyth price service client",
55
"author": {
66
"name": "Pyth Data Association"

price_service/sdk/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/price-service-sdk",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "Pyth price service SDK",
55
"homepage": "https://pyth.network",
66
"main": "lib/index.js",

price_service/sdk/js/src/index.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,30 +83,36 @@ export class PriceFeedMetadata {
8383
/**
8484
* Attestation time of the price
8585
*/
86-
attestationTime: number;
86+
attestationTime?: number;
8787
/**
8888
* Chain of the emitter
8989
*/
9090
emitterChain: number;
9191
/**
9292
* The time that the price service received the price
9393
*/
94-
priceServiceReceiveTime: number;
94+
priceServiceReceiveTime?: number;
9595
/**
9696
* Sequence number of the price
9797
*/
98-
sequenceNumber: number;
98+
sequenceNumber?: number;
99+
/**
100+
* Pythnet slot number of the price
101+
*/
102+
slot?: number;
99103

100104
constructor(metadata: {
101-
attestationTime: number;
105+
attestationTime?: number;
102106
emitterChain: number;
103-
receiveTime: number;
104-
sequenceNumber: number;
107+
receiveTime?: number;
108+
sequenceNumber?: number;
109+
slot?: number;
105110
}) {
106111
this.attestationTime = metadata.attestationTime;
107112
this.emitterChain = metadata.emitterChain;
108113
this.priceServiceReceiveTime = metadata.receiveTime;
109114
this.sequenceNumber = metadata.sequenceNumber;
115+
this.slot = metadata.slot;
110116
}
111117

112118
static fromJson(json: any): PriceFeedMetadata | undefined {
@@ -119,6 +125,7 @@ export class PriceFeedMetadata {
119125
emitterChain: jsonFeed.emitter_chain,
120126
receiveTime: jsonFeed.price_service_receive_time,
121127
sequenceNumber: jsonFeed.sequence_number,
128+
slot: jsonFeed.slot,
122129
});
123130
}
124131

@@ -128,6 +135,7 @@ export class PriceFeedMetadata {
128135
emitter_chain: this.emitterChain,
129136
price_service_receive_time: this.priceServiceReceiveTime,
130137
sequence_number: this.sequenceNumber,
138+
slot: this.slot,
131139
};
132140
// this is done to avoid sending undefined values to the server
133141
return Convert.priceFeedMetadataToJson(jsonFeed);

price_service/sdk/js/src/schemas/PriceFeed.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,23 @@ export interface PriceFeedMetadata {
6868
/**
6969
* Attestation time of the price
7070
*/
71-
attestation_time: number;
71+
attestation_time?: number;
7272
/**
7373
* Chain of the emitter
7474
*/
7575
emitter_chain: number;
7676
/**
7777
* The time that the price service received the price
7878
*/
79-
price_service_receive_time: number;
79+
price_service_receive_time?: number;
8080
/**
8181
* Sequence number of the price
8282
*/
83-
sequence_number: number;
83+
sequence_number?: number;
84+
/**
85+
* Pythnet slot number of the price
86+
*/
87+
slot?: number;
8488
}
8589

8690
// Converts JSON types to/from your types
@@ -284,14 +288,19 @@ const typeMap: any = {
284288
),
285289
PriceFeedMetadata: o(
286290
[
287-
{ json: "attestation_time", js: "attestation_time", typ: 0 },
291+
{
292+
json: "attestation_time",
293+
js: "attestation_time",
294+
typ: u(undefined, 0),
295+
},
288296
{ json: "emitter_chain", js: "emitter_chain", typ: 0 },
289297
{
290298
json: "price_service_receive_time",
291299
js: "price_service_receive_time",
292-
typ: 0,
300+
typ: u(undefined, 0),
293301
},
294-
{ json: "sequence_number", js: "sequence_number", typ: 0 },
302+
{ json: "sequence_number", js: "sequence_number", typ: u(undefined, 0) },
303+
{ json: "slot", js: "slot", typ: u(undefined, 0) },
295304
],
296305
"any"
297306
),

price_service/sdk/js/src/schemas/price_feed.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@
5858
"PriceFeedMetadata": {
5959
"description": "Represents metadata of a price feed.",
6060
"type": "object",
61-
"required": [
62-
"attestation_time",
63-
"emitter_chain",
64-
"price_service_receive_time",
65-
"sequence_number"
66-
],
61+
"required": ["emitter_chain"],
6762
"properties": {
6863
"attestation_time": {
6964
"description": "Attestation time of the price",
@@ -84,6 +79,11 @@
8479
"description": "Sequence number of the price",
8580
"type": "integer",
8681
"format": "int64"
82+
},
83+
"slot": {
84+
"description": "Pythnet slot number of the price",
85+
"type": "integer",
86+
"format": "int64"
8787
}
8888
}
8989
}

target_chains/aptos/sdk/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/pyth-aptos-js",
3-
"version": "1.0.2",
3+
"version": "1.1.0",
44
"description": "Pyth Network Aptos Utilities",
55
"homepage": "https://pyth.network",
66
"author": {

target_chains/cosmwasm/sdk/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/pyth-terra-js",
3-
"version": "1.1.2",
3+
"version": "1.2.0",
44
"description": "Pyth Network Terra Utils in JS",
55
"homepage": "https://pyth.network",
66
"author": {

target_chains/cosmwasm/tools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pythnetwork/cosmwasm-deploy-tools",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "",
55
"main": "deploy-pyth-bridge.ts",
66
"scripts": {

0 commit comments

Comments
 (0)