@pythnetwork/pyth-lazer-sdk 0.4.0 → 0.5.1
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.
- package/dist/cjs/client.d.ts +2 -2
- package/dist/cjs/ed25519.js +17 -7
- package/dist/cjs/protocol.d.ts +11 -0
- package/dist/cjs/socket/resilient-websocket.d.ts +2 -1
- package/dist/cjs/socket/websocket-pool.d.ts +2 -2
- package/dist/esm/client.d.ts +2 -2
- package/dist/esm/client.js +1 -1
- package/dist/esm/protocol.d.ts +11 -0
- package/dist/esm/socket/resilient-websocket.d.ts +2 -1
- package/dist/esm/socket/resilient-websocket.js +1 -1
- package/dist/esm/socket/websocket-pool.d.ts +2 -2
- package/package.json +19 -22
package/dist/cjs/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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;
|
package/dist/cjs/ed25519.js
CHANGED
|
@@ -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 (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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"));
|
package/dist/cjs/protocol.d.ts
CHANGED
|
@@ -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
|
|
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 {
|
|
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/dist/esm/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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;
|
package/dist/esm/client.js
CHANGED
|
@@ -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
|
|
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;
|
package/dist/esm/protocol.d.ts
CHANGED
|
@@ -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
|
|
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 {
|
|
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.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Pyth Lazer SDK",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,32 +20,19 @@
|
|
|
20
20
|
"default": "./dist/cjs/index.js"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build:cjs": "tsc --project tsconfig.build.json --verbatimModuleSyntax false --module commonjs --outDir ./dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
25
|
-
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm && echo '{\"type\":\"module\"}' > dist/esm/package.json",
|
|
26
|
-
"fix:lint": "eslint --fix . --max-warnings 0",
|
|
27
|
-
"test:lint": "eslint . --max-warnings 0",
|
|
28
|
-
"test:types": "tsc",
|
|
29
|
-
"example": "node --loader ts-node/esm examples/index.js",
|
|
30
|
-
"doc": "typedoc --out docs/typedoc src",
|
|
31
|
-
"publish": "pnpm run script -- publish"
|
|
32
|
-
},
|
|
33
23
|
"devDependencies": {
|
|
34
|
-
"@cprussin/eslint-config": "^
|
|
35
|
-
"@cprussin/tsconfig": "^3.
|
|
36
|
-
"@eslint/js": "^9.12.0",
|
|
37
|
-
"@types/eslint__js": "^8.42.3",
|
|
24
|
+
"@cprussin/eslint-config": "^4.0.2",
|
|
25
|
+
"@cprussin/tsconfig": "^3.1.2",
|
|
38
26
|
"@types/node": "^18.19.54",
|
|
39
27
|
"@types/ws": "^8.5.12",
|
|
40
|
-
"eslint": "^9.
|
|
41
|
-
"prettier": "^3.
|
|
28
|
+
"eslint": "^9.23.0",
|
|
29
|
+
"prettier": "^3.5.3",
|
|
42
30
|
"ts-node": "^10.9.2",
|
|
43
31
|
"typedoc": "^0.26.8",
|
|
44
|
-
"typescript": "
|
|
45
|
-
"typescript-eslint": "^8.8.0"
|
|
32
|
+
"typescript": "^5.8.2"
|
|
46
33
|
},
|
|
47
34
|
"bugs": {
|
|
48
|
-
"url": "https://github.com/pyth-
|
|
35
|
+
"url": "https://github.com/pyth-network/pyth-crosschain/issues"
|
|
49
36
|
},
|
|
50
37
|
"type": "module",
|
|
51
38
|
"homepage": "https://github.com/pyth-network/pyth-crosschain/tree/main/lazer/sdk/js",
|
|
@@ -67,5 +54,15 @@
|
|
|
67
54
|
"ts-log": "^2.2.7",
|
|
68
55
|
"ws": "^8.18.0"
|
|
69
56
|
},
|
|
70
|
-
"
|
|
71
|
-
}
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build:cjs": "tsc --project tsconfig.build.json --verbatimModuleSyntax false --module commonjs --outDir ./dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
59
|
+
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm && echo '{\"type\":\"module\"}' > dist/esm/package.json",
|
|
60
|
+
"fix:lint": "eslint --fix . --max-warnings 0",
|
|
61
|
+
"test:lint": "eslint . --max-warnings 0",
|
|
62
|
+
"test:types": "tsc",
|
|
63
|
+
"test:format": "prettier --check .",
|
|
64
|
+
"fix:format": "prettier --write .",
|
|
65
|
+
"example": "node --loader ts-node/esm examples/index.js",
|
|
66
|
+
"doc": "typedoc --out docs/typedoc src"
|
|
67
|
+
}
|
|
68
|
+
}
|