@pythnetwork/pyth-lazer-sdk 0.4.0 → 0.5.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,5 +1,5 @@
1
- import { type Logger } from "ts-log";
2
- import { type ParsedPayload, type Request, type Response } from "./protocol.js";
1
+ import type { Logger } from "ts-log";
2
+ import type { ParsedPayload, Request, Response } from "./protocol.js";
3
3
  export type BinaryResponse = {
4
4
  subscriptionId: number;
5
5
  evm?: Buffer | undefined;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.createEd25519Instruction = void 0;
27
37
  const BufferLayout = __importStar(require("@solana/buffer-layout"));
@@ -12,6 +12,7 @@ export type Request = {
12
12
  deliveryFormat?: DeliveryFormat;
13
13
  jsonBinaryEncoding?: JsonBinaryEncoding;
14
14
  parsed?: boolean;
15
+ ignoreInvalidFeedIds?: boolean;
15
16
  channel: Channel;
16
17
  } | {
17
18
  type: "unsubscribe";
@@ -34,12 +35,22 @@ export type JsonBinaryData = {
34
35
  encoding: JsonBinaryEncoding;
35
36
  data: string;
36
37
  };
38
+ export type InvalidFeedSubscriptionDetails = {
39
+ unknownIds: number[];
40
+ unsupportedChannels: number[];
41
+ unstable: number[];
42
+ };
37
43
  export type Response = {
38
44
  type: "error";
39
45
  error: string;
40
46
  } | {
41
47
  type: "subscribed";
42
48
  subscriptionId: number;
49
+ } | {
50
+ type: "subscribedWithInvalidFeedIdsIgnored";
51
+ subscriptionId: number;
52
+ subscribedFeedIds: number[];
53
+ ignoredInvalidFeedIds: InvalidFeedSubscriptionDetails;
43
54
  } | {
44
55
  type: "unsubscribed";
45
56
  subscriptionId: number;
@@ -1,5 +1,6 @@
1
1
  import type { ClientRequestArgs } from "node:http";
2
- import WebSocket, { type ClientOptions, type ErrorEvent } from "isomorphic-ws";
2
+ import type { ClientOptions, ErrorEvent } from "isomorphic-ws";
3
+ import WebSocket from "isomorphic-ws";
3
4
  import type { Logger } from "ts-log";
4
5
  export declare class ResilientWebSocket {
5
6
  endpoint: string;
@@ -1,7 +1,7 @@
1
1
  import WebSocket from "isomorphic-ws";
2
- import { type Logger } from "ts-log";
3
- import { ResilientWebSocket } from "./resilient-websocket.js";
2
+ import type { Logger } from "ts-log";
4
3
  import type { Request } from "../protocol.js";
4
+ import { ResilientWebSocket } from "./resilient-websocket.js";
5
5
  export declare class WebSocketPool {
6
6
  private readonly logger;
7
7
  rwsPool: ResilientWebSocket[];
@@ -1,5 +1,5 @@
1
- import { type Logger } from "ts-log";
2
- import { type ParsedPayload, type Request, type Response } from "./protocol.js";
1
+ import type { Logger } from "ts-log";
2
+ import type { ParsedPayload, Request, Response } from "./protocol.js";
3
3
  export type BinaryResponse = {
4
4
  subscriptionId: number;
5
5
  evm?: Buffer | undefined;
@@ -1,6 +1,6 @@
1
1
  import WebSocket from "isomorphic-ws";
2
2
  import { dummyLogger } from "ts-log";
3
- import { BINARY_UPDATE_FORMAT_MAGIC_LE, FORMAT_MAGICS_LE, } from "./protocol.js";
3
+ import { BINARY_UPDATE_FORMAT_MAGIC_LE, FORMAT_MAGICS_LE } from "./protocol.js";
4
4
  import { WebSocketPool } from "./socket/websocket-pool.js";
5
5
  const UINT16_NUM_BYTES = 2;
6
6
  const UINT32_NUM_BYTES = 4;
@@ -12,6 +12,7 @@ export type Request = {
12
12
  deliveryFormat?: DeliveryFormat;
13
13
  jsonBinaryEncoding?: JsonBinaryEncoding;
14
14
  parsed?: boolean;
15
+ ignoreInvalidFeedIds?: boolean;
15
16
  channel: Channel;
16
17
  } | {
17
18
  type: "unsubscribe";
@@ -34,12 +35,22 @@ export type JsonBinaryData = {
34
35
  encoding: JsonBinaryEncoding;
35
36
  data: string;
36
37
  };
38
+ export type InvalidFeedSubscriptionDetails = {
39
+ unknownIds: number[];
40
+ unsupportedChannels: number[];
41
+ unstable: number[];
42
+ };
37
43
  export type Response = {
38
44
  type: "error";
39
45
  error: string;
40
46
  } | {
41
47
  type: "subscribed";
42
48
  subscriptionId: number;
49
+ } | {
50
+ type: "subscribedWithInvalidFeedIdsIgnored";
51
+ subscriptionId: number;
52
+ subscribedFeedIds: number[];
53
+ ignoredInvalidFeedIds: InvalidFeedSubscriptionDetails;
43
54
  } | {
44
55
  type: "unsubscribed";
45
56
  subscriptionId: number;
@@ -1,5 +1,6 @@
1
1
  import type { ClientRequestArgs } from "node:http";
2
- import WebSocket, { type ClientOptions, type ErrorEvent } from "isomorphic-ws";
2
+ import type { ClientOptions, ErrorEvent } from "isomorphic-ws";
3
+ import WebSocket from "isomorphic-ws";
3
4
  import type { Logger } from "ts-log";
4
5
  export declare class ResilientWebSocket {
5
6
  endpoint: string;
@@ -1,4 +1,4 @@
1
- import WebSocket, {} from "isomorphic-ws";
1
+ import WebSocket from "isomorphic-ws";
2
2
  const HEARTBEAT_TIMEOUT_DURATION = 10_000;
3
3
  const CONNECTION_TIMEOUT = 5000;
4
4
  export class ResilientWebSocket {
@@ -1,7 +1,7 @@
1
1
  import WebSocket from "isomorphic-ws";
2
- import { type Logger } from "ts-log";
3
- import { ResilientWebSocket } from "./resilient-websocket.js";
2
+ import type { Logger } from "ts-log";
4
3
  import type { Request } from "../protocol.js";
4
+ import { ResilientWebSocket } from "./resilient-websocket.js";
5
5
  export declare class WebSocketPool {
6
6
  private readonly logger;
7
7
  rwsPool: ResilientWebSocket[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pythnetwork/pyth-lazer-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Pyth Lazer SDK",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -26,23 +26,22 @@
26
26
  "fix:lint": "eslint --fix . --max-warnings 0",
27
27
  "test:lint": "eslint . --max-warnings 0",
28
28
  "test:types": "tsc",
29
+ "test:format": "prettier --check .",
30
+ "fix:format": "prettier --write .",
29
31
  "example": "node --loader ts-node/esm examples/index.js",
30
32
  "doc": "typedoc --out docs/typedoc src",
31
33
  "publish": "pnpm run script -- publish"
32
34
  },
33
35
  "devDependencies": {
34
- "@cprussin/eslint-config": "^3.0.0",
35
- "@cprussin/tsconfig": "^3.0.1",
36
- "@eslint/js": "^9.12.0",
37
- "@types/eslint__js": "^8.42.3",
36
+ "@cprussin/eslint-config": "catalog:",
37
+ "@cprussin/tsconfig": "catalog:",
38
38
  "@types/node": "^18.19.54",
39
39
  "@types/ws": "^8.5.12",
40
- "eslint": "^9.12.0",
41
- "prettier": "^3.3.3",
42
- "ts-node": "^10.9.2",
40
+ "eslint": "catalog:",
41
+ "prettier": "catalog:",
42
+ "ts-node": "catalog:",
43
43
  "typedoc": "^0.26.8",
44
- "typescript": ">=5.5.0 < 5.6.0",
45
- "typescript-eslint": "^8.8.0"
44
+ "typescript": "catalog:"
46
45
  },
47
46
  "bugs": {
48
47
  "url": "https://github.com/pyth-lazer-sdk/pyth-lazer-sdk/issues"
@@ -67,5 +66,5 @@
67
66
  "ts-log": "^2.2.7",
68
67
  "ws": "^8.18.0"
69
68
  },
70
- "gitHead": "f61d4dd5465375d8b4addf1bcd3bc1c634fcb5a1"
69
+ "gitHead": "da6c1185d9fce5e6ca2df4f7e6e1f5edc9b366eb"
71
70
  }