Browse Source

chore(lazer-protocol-js): Add exponent and pub count to payload (#2289)

* Add exponent and pub count

* Working receive

* Bump version

* pre-commit check
Darun Seethammagari 10 months ago
parent
commit
5dd180c321
3 changed files with 10 additions and 3 deletions
  1. 1 1
      lazer/sdk/js/examples/index.ts
  2. 1 1
      lazer/sdk/js/package.json
  3. 8 1
      lazer/sdk/js/src/protocol.ts

+ 1 - 1
lazer/sdk/js/examples/index.ts

@@ -62,7 +62,7 @@ await client.subscribe({
   type: "subscribe",
   type: "subscribe",
   subscriptionId: 2,
   subscriptionId: 2,
   priceFeedIds: [1, 2, 3, 4, 5],
   priceFeedIds: [1, 2, 3, 4, 5],
-  properties: ["price"],
+  properties: ["price", "exponent", "publisherCount"],
   chains: ["evm"],
   chains: ["evm"],
   deliveryFormat: "json",
   deliveryFormat: "json",
   channel: "fixed_rate@200ms",
   channel: "fixed_rate@200ms",

+ 1 - 1
lazer/sdk/js/package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "@pythnetwork/pyth-lazer-sdk",
   "name": "@pythnetwork/pyth-lazer-sdk",
-  "version": "0.3.1",
+  "version": "0.3.2",
   "description": "Pyth Lazer SDK",
   "description": "Pyth Lazer SDK",
   "publishConfig": {
   "publishConfig": {
     "access": "public"
     "access": "public"

+ 8 - 1
lazer/sdk/js/src/protocol.ts

@@ -1,7 +1,12 @@
 export type Chain = "evm" | "solana";
 export type Chain = "evm" | "solana";
 export type DeliveryFormat = "json" | "binary";
 export type DeliveryFormat = "json" | "binary";
 export type JsonBinaryEncoding = "base64" | "hex";
 export type JsonBinaryEncoding = "base64" | "hex";
-export type PriceFeedProperty = "price" | "bestBidPrice" | "bestAskPrice";
+export type PriceFeedProperty =
+  | "price"
+  | "bestBidPrice"
+  | "bestAskPrice"
+  | "exponent"
+  | "publisherCount";
 export type Channel = "real_time" | "fixed_rate@50ms" | "fixed_rate@200ms";
 export type Channel = "real_time" | "fixed_rate@50ms" | "fixed_rate@200ms";
 
 
 export type Request =
 export type Request =
@@ -26,6 +31,8 @@ export type ParsedFeedPayload = {
   price?: string | undefined;
   price?: string | undefined;
   bestBidPrice?: string | undefined;
   bestBidPrice?: string | undefined;
   bestAskPrice?: string | undefined;
   bestAskPrice?: string | undefined;
+  publisherCount?: number | undefined;
+  exponent?: number | undefined;
 };
 };
 
 
 export type ParsedPayload = {
 export type ParsedPayload = {