@pythnetwork/pyth-lazer-sdk 5.2.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,19 @@
1
1
  export type Format = "evm" | "solana" | "leEcdsa" | "leUnsigned";
2
2
  export type DeliveryFormat = "json" | "binary";
3
3
  export type JsonBinaryEncoding = "base64" | "hex";
4
- export type PriceFeedProperty = "price" | "bestBidPrice" | "bestAskPrice" | "exponent" | "publisherCount" | "confidence" | "fundingRate" | "fundingTimestamp" | "fundingRateInterval";
4
+ export type PriceFeedProperty = "price" | "bestBidPrice" | "bestAskPrice" | "exponent" | "publisherCount" | "confidence" | "fundingRate" | "fundingTimestamp" | "fundingRateInterval" | "marketSession" | "emaPrice" | "emaConfidence" | "feedUpdateTimestamp";
5
5
  export type Channel = "real_time" | "fixed_rate@50ms" | "fixed_rate@200ms";
6
6
  export type Request = {
7
7
  type: "subscribe";
8
8
  subscriptionId: number;
9
- priceFeedIds: number[];
9
+ priceFeedIds?: number[] | undefined;
10
+ symbols?: string[] | undefined;
10
11
  properties: PriceFeedProperty[];
11
12
  formats: Format[];
12
- deliveryFormat?: DeliveryFormat;
13
- jsonBinaryEncoding?: JsonBinaryEncoding;
14
- parsed?: boolean;
15
- ignoreInvalidFeedIds?: boolean;
13
+ deliveryFormat?: DeliveryFormat | undefined;
14
+ jsonBinaryEncoding?: JsonBinaryEncoding | undefined;
15
+ parsed?: boolean | undefined;
16
+ ignoreInvalidFeedIds?: boolean | undefined;
16
17
  channel: Channel;
17
18
  } | {
18
19
  type: "unsubscribe";
@@ -25,7 +26,14 @@ export type ParsedFeedPayload = {
25
26
  bestAskPrice?: string | undefined;
26
27
  publisherCount?: number | undefined;
27
28
  exponent?: number | undefined;
28
- confidence?: string | undefined;
29
+ confidence?: number | undefined;
30
+ fundingRate?: number | undefined;
31
+ fundingTimestamp?: number | undefined;
32
+ fundingRateInterval?: number | undefined;
33
+ marketSession?: string | undefined;
34
+ emaPrice?: string | undefined;
35
+ emaConfidence?: number | undefined;
36
+ feedUpdateTimestamp?: number | undefined;
29
37
  };
30
38
  export type ParsedPayload = {
31
39
  timestampUs: string;
@@ -76,7 +84,7 @@ export declare const FORMAT_MAGICS_LE: {
76
84
  LE_ECDSA: number;
77
85
  LE_UNSIGNED: number;
78
86
  };
79
- export type AssetType = "crypto" | "fx" | "equity" | "metal" | "rates" | "nav" | "commodity" | "funding-rate";
87
+ export type AssetType = "crypto" | "fx" | "equity" | "metal" | "rates" | "nav" | "commodity" | "funding-rate" | "eco" | "kalshi";
80
88
  export type SymbolsQueryParams = {
81
89
  query?: string;
82
90
  asset_type?: AssetType;
@@ -5,7 +5,7 @@ import type { Request } from "../protocol.js";
5
5
  import type { ResilientWebSocketConfig } from "./resilient-websocket.js";
6
6
  import { ResilientWebSocket } from "./resilient-websocket.js";
7
7
  import { IsomorphicEventEmitter } from "../emitter/index.js";
8
- type WebSocketOnMessageCallback = (data: WebSocket.Data) => void | Promise<void>;
8
+ type WebSocketOnMessageCallback = (data: WebSocket.Data) => Promise<void>;
9
9
  export type WebSocketPoolConfig = {
10
10
  /**
11
11
  * Maximum number of open, parallel websocket connections
@@ -1,18 +1,19 @@
1
1
  export type Format = "evm" | "solana" | "leEcdsa" | "leUnsigned";
2
2
  export type DeliveryFormat = "json" | "binary";
3
3
  export type JsonBinaryEncoding = "base64" | "hex";
4
- export type PriceFeedProperty = "price" | "bestBidPrice" | "bestAskPrice" | "exponent" | "publisherCount" | "confidence" | "fundingRate" | "fundingTimestamp" | "fundingRateInterval";
4
+ export type PriceFeedProperty = "price" | "bestBidPrice" | "bestAskPrice" | "exponent" | "publisherCount" | "confidence" | "fundingRate" | "fundingTimestamp" | "fundingRateInterval" | "marketSession" | "emaPrice" | "emaConfidence" | "feedUpdateTimestamp";
5
5
  export type Channel = "real_time" | "fixed_rate@50ms" | "fixed_rate@200ms";
6
6
  export type Request = {
7
7
  type: "subscribe";
8
8
  subscriptionId: number;
9
- priceFeedIds: number[];
9
+ priceFeedIds?: number[] | undefined;
10
+ symbols?: string[] | undefined;
10
11
  properties: PriceFeedProperty[];
11
12
  formats: Format[];
12
- deliveryFormat?: DeliveryFormat;
13
- jsonBinaryEncoding?: JsonBinaryEncoding;
14
- parsed?: boolean;
15
- ignoreInvalidFeedIds?: boolean;
13
+ deliveryFormat?: DeliveryFormat | undefined;
14
+ jsonBinaryEncoding?: JsonBinaryEncoding | undefined;
15
+ parsed?: boolean | undefined;
16
+ ignoreInvalidFeedIds?: boolean | undefined;
16
17
  channel: Channel;
17
18
  } | {
18
19
  type: "unsubscribe";
@@ -25,7 +26,14 @@ export type ParsedFeedPayload = {
25
26
  bestAskPrice?: string | undefined;
26
27
  publisherCount?: number | undefined;
27
28
  exponent?: number | undefined;
28
- confidence?: string | undefined;
29
+ confidence?: number | undefined;
30
+ fundingRate?: number | undefined;
31
+ fundingTimestamp?: number | undefined;
32
+ fundingRateInterval?: number | undefined;
33
+ marketSession?: string | undefined;
34
+ emaPrice?: string | undefined;
35
+ emaConfidence?: number | undefined;
36
+ feedUpdateTimestamp?: number | undefined;
29
37
  };
30
38
  export type ParsedPayload = {
31
39
  timestampUs: string;
@@ -76,7 +84,7 @@ export declare const FORMAT_MAGICS_LE: {
76
84
  LE_ECDSA: number;
77
85
  LE_UNSIGNED: number;
78
86
  };
79
- export type AssetType = "crypto" | "fx" | "equity" | "metal" | "rates" | "nav" | "commodity" | "funding-rate";
87
+ export type AssetType = "crypto" | "fx" | "equity" | "metal" | "rates" | "nav" | "commodity" | "funding-rate" | "eco" | "kalshi";
80
88
  export type SymbolsQueryParams = {
81
89
  query?: string;
82
90
  asset_type?: AssetType;
@@ -5,7 +5,7 @@ import type { Request } from "../protocol.js";
5
5
  import type { ResilientWebSocketConfig } from "./resilient-websocket.js";
6
6
  import { ResilientWebSocket } from "./resilient-websocket.js";
7
7
  import { IsomorphicEventEmitter } from "../emitter/index.js";
8
- type WebSocketOnMessageCallback = (data: WebSocket.Data) => void | Promise<void>;
8
+ type WebSocketOnMessageCallback = (data: WebSocket.Data) => Promise<void>;
9
9
  export type WebSocketPoolConfig = {
10
10
  /**
11
11
  * Maximum number of open, parallel websocket connections
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pythnetwork/pyth-lazer-sdk",
3
- "version": "5.2.1",
3
+ "version": "6.0.0",
4
4
  "description": "Pyth Lazer SDK",
5
5
  "engines": {
6
6
  "node": "^24.0.0"
@@ -129,13 +129,14 @@
129
129
  "devDependencies": {
130
130
  "@cprussin/eslint-config": "^4.0.2",
131
131
  "@cprussin/tsconfig": "^3.1.2",
132
- "@types/jest": "^29.5.14",
133
132
  "@types/node": "^18.19.54",
134
133
  "@types/ws": "^8.5.12",
135
134
  "eslint": "^9.23.0",
136
135
  "prettier": "^3.5.3",
137
136
  "ts-node": "^10.9.2",
138
- "typedoc": "^0.26.8"
137
+ "typedoc": "^0.26.8",
138
+ "vite": "^7.3.1",
139
+ "vitest": "^4.0.18"
139
140
  },
140
141
  "bugs": {
141
142
  "url": "https://github.com/pyth-network/pyth-crosschain/issues"
@@ -163,6 +164,7 @@
163
164
  "scripts": {
164
165
  "build": "ts-duality --clean",
165
166
  "fix:lint": "eslint --fix . --max-warnings 0",
167
+ "test:unit": "vitest run",
166
168
  "test:lint": "eslint . --max-warnings 0",
167
169
  "test:types": "tsc",
168
170
  "test:format": "prettier --check .",
package/LICENSE DELETED
@@ -1,13 +0,0 @@
1
- Copyright 2025 Pyth Data Association.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.