@n1xyz/nord-ts 0.0.21 → 0.0.22

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 (45) hide show
  1. package/dist/api/client.d.ts +14 -0
  2. package/dist/api/client.js +45 -0
  3. package/dist/bridge/client.d.ts +151 -0
  4. package/dist/bridge/client.js +434 -0
  5. package/dist/bridge/const.d.ts +23 -0
  6. package/dist/bridge/const.js +47 -0
  7. package/dist/bridge/index.d.ts +4 -0
  8. package/dist/bridge/index.js +23 -0
  9. package/dist/bridge/types.d.ts +120 -0
  10. package/dist/bridge/types.js +18 -0
  11. package/dist/bridge/utils.d.ts +64 -0
  12. package/dist/bridge/utils.js +131 -0
  13. package/dist/gen/common.d.ts +68 -0
  14. package/dist/gen/common.js +215 -0
  15. package/dist/gen/nord_pb.d.ts +3651 -0
  16. package/dist/gen/nord_pb.js +892 -0
  17. package/dist/gen/openapi.d.ts +241 -2
  18. package/dist/idl/bridge.d.ts +569 -0
  19. package/dist/idl/bridge.js +8 -0
  20. package/dist/idl/bridge.json +1506 -0
  21. package/dist/idl/index.d.ts +607 -0
  22. package/dist/idl/index.js +8 -0
  23. package/dist/nord/api/actions.d.ts +30 -72
  24. package/dist/nord/api/actions.js +179 -200
  25. package/dist/nord/api/market.d.ts +36 -0
  26. package/dist/nord/api/market.js +96 -0
  27. package/dist/nord/api/queries.d.ts +46 -0
  28. package/dist/nord/api/queries.js +109 -0
  29. package/dist/nord/client/Nord.js +3 -3
  30. package/dist/nord/client/NordUser.d.ts +26 -13
  31. package/dist/nord/client/NordUser.js +13 -10
  32. package/dist/types.d.ts +12 -1
  33. package/dist/types.js +29 -2
  34. package/dist/utils.d.ts +6 -20
  35. package/dist/utils.js +17 -35
  36. package/dist/websocket/NordWebSocketClient.js +2 -6
  37. package/package.json +26 -23
  38. package/src/gen/nord_pb.ts +4172 -0
  39. package/src/gen/openapi.ts +241 -2
  40. package/src/nord/api/actions.ts +249 -370
  41. package/src/nord/client/Nord.ts +3 -3
  42. package/src/nord/client/NordUser.ts +40 -19
  43. package/src/types.ts +32 -1
  44. package/src/utils.ts +24 -43
  45. package/src/websocket/NordWebSocketClient.ts +2 -8
@@ -7,8 +7,6 @@ exports.NordWebSocketClient = void 0;
7
7
  const events_1 = require("events");
8
8
  const ws_1 = __importDefault(require("ws"));
9
9
  const VALID_STREAM_TYPES = ["trades", "delta", "account"];
10
- // Constants for WebSocket readyState
11
- const WS_OPEN = 1;
12
10
  /**
13
11
  * WebSocket client for Nord exchange
14
12
  *
@@ -132,9 +130,7 @@ class NordWebSocketClient extends events_1.EventEmitter {
132
130
  this.emit("error", new Error(`Failed to parse message: ${error instanceof Error ? error.message : String(error)}`));
133
131
  }
134
132
  };
135
- this.ws.onclose = (event) => {
136
- const reason = event && event.reason ? ` Reason: ${event.reason}` : "";
137
- const code = event && event.code ? ` Code: ${event.code}` : "";
133
+ this.ws.onclose = (_event) => {
138
134
  this.emit("disconnected");
139
135
  this.reconnect();
140
136
  };
@@ -162,7 +158,7 @@ class NordWebSocketClient extends events_1.EventEmitter {
162
158
  this.emit("error", new Error(`Failed to parse message: ${error instanceof Error ? error.message : String(error)}`));
163
159
  }
164
160
  });
165
- nodeWs.on("close", (code, reason) => {
161
+ nodeWs.on("close", (_code, _reason) => {
166
162
  this.emit("disconnected");
167
163
  if (this.pingInterval) {
168
164
  clearInterval(this.pingInterval);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n1xyz/nord-ts",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Typescript for Nord",
5
5
  "keywords": [],
6
6
  "author": "",
@@ -14,46 +14,49 @@
14
14
  "README.md"
15
15
  ],
16
16
  "scripts": {
17
- "gen:proto": "nix run ..#nord-ts-proto ../engine/nord.proto src/gen/",
18
- "gen:api": "nix run ..#nord-openapi | bunx openapi-typescript > src/gen/openapi.ts",
17
+ "gen:proto": "bunx @bufbuild/buf generate ../engine",
18
+ "gen:api": "nix run ..#openapi | bunx openapi-typescript > src/gen/openapi.ts",
19
19
  "gen": "bun run gen:proto && bun run gen:api",
20
20
  "build": "bun run gen && bunx tsc && bun run docs",
21
21
  "docs": "bunx typedoc --out ./docs ./src",
22
22
  "compile": "tsc",
23
23
  "clean": "rm -rf ./src/gen ./dist ./docs",
24
24
  "fmt": "prettier --write src tests",
25
- "ci": "bunx eslint && prettier --check src tests"
25
+ "ci": "bunx eslint && prettier --check src tests",
26
+ "all": "bun install && bun run build && bun run ci && bun fmt"
26
27
  },
27
28
  "devDependencies": {
29
+ "@bufbuild/protoc-gen-es": "^2.6.3",
30
+ "@bufbuild/protoplugin": "^2.6.3",
28
31
  "@types/bun": "latest",
29
- "@types/google-protobuf": "^3.15.10",
30
- "@types/node": "^22.15.29",
31
- "@types/node-fetch": "^2.6.9",
32
- "@types/ws": "^8.5.10",
33
- "@typescript-eslint/eslint-plugin": "^8.26.1",
34
- "@typescript-eslint/parser": "^8.26.1",
35
- "eslint": "^9.22.0",
36
- "globals": "^16.0.0",
37
- "openapi-typescript": "^7.8.0",
38
- "prettier": "^3.5.3",
32
+ "@types/google-protobuf": "^3.15.12",
33
+ "@types/node": "^22.17.1",
34
+ "@types/node-fetch": "^2.6.13",
35
+ "@types/ws": "^8.18.1",
36
+ "@typescript-eslint/eslint-plugin": "^8.39.1",
37
+ "@typescript-eslint/parser": "^8.39.1",
38
+ "eslint": "^9.33.0",
39
+ "globals": "^16.3.0",
40
+ "openapi-typescript": "^7.9.1",
41
+ "prettier": "^3.6.2",
39
42
  "ts-node": "^10.9.2",
40
43
  "typedoc": "^0.27.9",
41
- "typescript": "*"
44
+ "typescript": "^5.9.2"
42
45
  },
43
46
  "dependencies": {
44
- "@bufbuild/protobuf": "^2.0.0",
47
+ "@bufbuild/protobuf": "^2.6.3",
45
48
  "@n1xyz/proton": "0.0.2",
46
- "@noble/curves": "^1.3.0",
47
- "@noble/ed25519": "^2.2.3",
48
- "@noble/hashes": "^1.3.2",
49
+ "@noble/curves": "^1.9.6",
50
+ "@noble/ed25519": "^2.3.0",
51
+ "@noble/hashes": "^1.8.0",
49
52
  "@solana/spl-token": "^0.4.13",
50
- "@solana/web3.js": "^1.98.2",
53
+ "@solana/web3.js": "^1.98.4",
51
54
  "bs58": "^6.0.0",
52
- "decimal.js": "^10.4.3",
53
- "ethers": "^6.11.1",
55
+ "decimal.js": "^10.6.0",
56
+ "ethers": "^6.15.0",
54
57
  "node-fetch": "2.6.13",
55
58
  "openapi-fetch": "^0.14.0",
56
59
  "tweetnacl": "^1.0.3",
57
- "ws": "^8.16.0"
60
+ "ws": "^8.18.3"
58
61
  }
59
62
  }