@pythnetwork/pyth-lazer-sdk 5.0.0 → 5.2.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.
Files changed (33) hide show
  1. package/dist/cjs/{client.js → client.cjs} +93 -98
  2. package/dist/cjs/constants.cjs +36 -0
  3. package/dist/cjs/index.cjs +20 -0
  4. package/dist/cjs/package.json +1 -1
  5. package/dist/cjs/protocol.cjs +33 -0
  6. package/dist/cjs/protocol.d.ts +1 -1
  7. package/dist/cjs/socket/{resilient-websocket.js → resilient-websocket.cjs} +47 -48
  8. package/dist/cjs/socket/{websocket-pool.js → websocket-pool.cjs} +68 -65
  9. package/dist/cjs/util/{buffer-util.js → buffer-util.cjs} +14 -14
  10. package/dist/cjs/util/env-util.cjs +33 -0
  11. package/dist/cjs/util/index.cjs +20 -0
  12. package/dist/cjs/util/url-util.cjs +17 -0
  13. package/dist/esm/{client.js → client.mjs} +76 -88
  14. package/dist/esm/index.mjs +3 -0
  15. package/dist/esm/package.json +1 -1
  16. package/dist/esm/protocol.d.ts +1 -1
  17. package/dist/esm/{protocol.js → protocol.mjs} +4 -4
  18. package/dist/esm/socket/{resilient-websocket.js → resilient-websocket.mjs} +27 -36
  19. package/dist/esm/socket/{websocket-pool.js → websocket-pool.mjs} +47 -53
  20. package/dist/esm/util/{buffer-util.js → buffer-util.mjs} +3 -6
  21. package/dist/esm/util/{env-util.js → env-util.mjs} +4 -8
  22. package/dist/esm/util/index.mjs +3 -0
  23. package/dist/esm/util/{url-util.js → url-util.mjs} +2 -4
  24. package/package.json +108 -15
  25. package/dist/cjs/constants.js +0 -9
  26. package/dist/cjs/index.js +0 -19
  27. package/dist/cjs/protocol.js +0 -15
  28. package/dist/cjs/util/env-util.js +0 -32
  29. package/dist/cjs/util/index.js +0 -19
  30. package/dist/cjs/util/url-util.js +0 -18
  31. package/dist/esm/index.js +0 -3
  32. package/dist/esm/util/index.js +0 -3
  33. /package/dist/esm/{constants.js → constants.mjs} +0 -0
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomSocketClosureCodes = exports.FORMAT_MAGICS_LE = exports.BINARY_UPDATE_FORMAT_MAGIC_LE = void 0;
4
- exports.BINARY_UPDATE_FORMAT_MAGIC_LE = 461_928_307;
5
- exports.FORMAT_MAGICS_LE = {
6
- JSON: 3_302_625_434,
7
- EVM: 2_593_727_018,
8
- SOLANA: 2_182_742_457,
9
- LE_ECDSA: 1_296_547_300,
10
- LE_UNSIGNED: 1_499_680_012,
11
- };
12
- var CustomSocketClosureCodes;
13
- (function (CustomSocketClosureCodes) {
14
- CustomSocketClosureCodes[CustomSocketClosureCodes["CLIENT_TIMEOUT_BUT_RECONNECTING"] = 4000] = "CLIENT_TIMEOUT_BUT_RECONNECTING";
15
- })(CustomSocketClosureCodes || (exports.CustomSocketClosureCodes = CustomSocketClosureCodes = {}));
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.envIsServiceOrWebWorker = envIsServiceOrWebWorker;
4
- exports.envIsBrowser = envIsBrowser;
5
- exports.envIsBrowserOrWorker = envIsBrowserOrWorker;
6
- // we create this local-only type, which has assertions made to indicate
7
- // that we do not know and cannot guarantee which JS environment we are in
8
- const g = globalThis;
9
- /**
10
- * Detects if this code is running within any Service or WebWorker context.
11
- * @returns true if in a worker of some kind, false if otherwise
12
- */
13
- function envIsServiceOrWebWorker() {
14
- return (typeof WorkerGlobalScope !== "undefined" &&
15
- g.self instanceof WorkerGlobalScope);
16
- }
17
- /**
18
- * Detects if the code is running in a regular DOM or Web Worker context.
19
- * @returns true if running in a DOM or Web Worker context, false if running in Node.js
20
- */
21
- function envIsBrowser() {
22
- return g.window !== undefined;
23
- }
24
- /**
25
- * a convenience method that returns whether or not
26
- * this code is executing in some type of browser-centric environment
27
- *
28
- * @returns true if in the browser's main UI thread or in a worker, false if otherwise
29
- */
30
- function envIsBrowserOrWorker() {
31
- return envIsServiceOrWebWorker() || envIsBrowser();
32
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./buffer-util.js"), exports);
18
- __exportStar(require("./env-util.js"), exports);
19
- __exportStar(require("./url-util.js"), exports);
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addAuthTokenToWebSocketUrl = addAuthTokenToWebSocketUrl;
4
- const ACCESS_TOKEN_QUERY_PARAM_KEY = "ACCESS_TOKEN";
5
- /**
6
- * Given a URL to a hosted lazer stream service and a possible auth token,
7
- * appends the auth token as a query parameter and returns the URL with the token
8
- * contained within.
9
- * If the URL provided is nullish, it is returned as-is (in the same nullish format).
10
- * If the token is nullish, the baseUrl given is returned, instead.
11
- */
12
- function addAuthTokenToWebSocketUrl(baseUrl, authToken) {
13
- if (!baseUrl || !authToken)
14
- return baseUrl;
15
- const parsedUrl = new URL(baseUrl);
16
- parsedUrl.searchParams.set(ACCESS_TOKEN_QUERY_PARAM_KEY, authToken);
17
- return parsedUrl.toString();
18
- }
package/dist/esm/index.js DELETED
@@ -1,3 +0,0 @@
1
- export * from "./client.js";
2
- export * from "./protocol.js";
3
- export * from "./constants.js";
@@ -1,3 +0,0 @@
1
- export * from "./buffer-util.js";
2
- export * from "./env-util.js";
3
- export * from "./url-util.js";
File without changes