hyperliquid-prime 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -118,7 +118,30 @@ await hp.disconnect()
118
118
 
119
119
  ### CLI
120
120
 
121
- The `hp` CLI provides the same functionality from the terminal:
121
+ Install globally to get the `hp` command:
122
+
123
+ ```bash
124
+ npm install -g hyperliquid-prime
125
+ hp markets TSLA
126
+ ```
127
+
128
+ Or run one-off without installing:
129
+
130
+ ```bash
131
+ npx hyperliquid-prime markets TSLA
132
+ ```
133
+
134
+ If `hp` isn't found after global install, ensure npm's bin directory is on your PATH:
135
+
136
+ ```bash
137
+ # Check where npm installs global binaries
138
+ npm bin -g
139
+
140
+ # Add to ~/.zshrc or ~/.bashrc if needed
141
+ export PATH="$(npm bin -g):$PATH"
142
+ ```
143
+
144
+ #### Usage
122
145
 
123
146
  ```bash
124
147
  # Show all perp markets for an asset (native + HIP-3)
package/dist/cli/index.js CHANGED
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,wBAAgB,YAAY,CAAC,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,CAOpF;AAED,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAWxB,wBAAgB,YAAY,CAAC,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,CAOpF;AAED,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC"}
@@ -1,8 +1,17 @@
1
1
  import pino from "pino";
2
+ function hasPinoPretty() {
3
+ try {
4
+ import.meta.resolve("pino-pretty");
5
+ return true;
6
+ }
7
+ catch {
8
+ return false;
9
+ }
10
+ }
2
11
  export function createLogger(opts = {}) {
3
12
  return pino({
4
13
  level: opts.level ?? "info",
5
- transport: opts.pretty
14
+ transport: opts.pretty && hasPinoPretty()
6
15
  ? { target: "pino-pretty", options: { colorize: true } }
7
16
  : undefined,
8
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,UAAU,YAAY,CAAC,OAA6C,EAAE;IAC1E,OAAO,IAAI,CAAC;QACV,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,MAAM;QAC3B,SAAS,EAAE,IAAI,CAAC,MAAM;YACpB,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;YACxD,CAAC,CAAC,SAAS;KACd,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,SAAS,aAAa;IACpB,IAAI,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAA6C,EAAE;IAC1E,OAAO,IAAI,CAAC;QACV,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,MAAM;QAC3B,SAAS,EAAE,IAAI,CAAC,MAAM,IAAI,aAAa,EAAE;YACvC,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;YACxD,CAAC,CAAC,SAAS;KACd,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,59 +1,61 @@
1
1
  {
2
- "name": "hyperliquid-prime",
3
- "version": "0.1.0",
4
- "description": "Prime broker SDK for Hyperliquid HIP-3 markets — unified trading across fragmented markets",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "bin": {
9
- "hp": "./dist/cli/index.js"
10
- },
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.js",
14
- "types": "./dist/index.d.ts"
15
- }
16
- },
17
- "scripts": {
18
- "build": "tsc",
19
- "dev": "tsc --watch",
20
- "test": "vitest run",
21
- "test:watch": "vitest",
22
- "test:integration": "vitest run --config vitest.integration.config.ts",
23
- "lint": "eslint src/",
24
- "typecheck": "tsc --noEmit",
25
- "hp": "tsx src/cli/index.ts"
26
- },
27
- "keywords": [
28
- "hyperliquid",
29
- "hip-3",
30
- "prime-broker",
31
- "trading",
32
- "defi",
33
- "sdk"
34
- ],
35
- "license": "MIT",
36
- "dependencies": {
37
- "@nktkas/hyperliquid": "^0.30.0",
38
- "better-sqlite3": "^11.0.0",
39
- "commander": "^12.0.0",
40
- "pino": "^9.0.0",
41
- "viem": "^2.0.0"
42
- },
43
- "devDependencies": {
44
- "@types/better-sqlite3": "^7.0.0",
45
- "@types/node": "^22.0.0",
46
- "eslint": "^9.0.0",
47
- "pino-pretty": "^11.0.0",
48
- "tsx": "^4.0.0",
49
- "typescript": "^5.7.0",
50
- "vitest": "^2.0.0"
51
- },
52
- "files": [
53
- "dist",
54
- "LICENSE"
55
- ],
56
- "engines": {
57
- "node": ">=20.0.0"
58
- }
2
+ "name": "hyperliquid-prime",
3
+ "version": "0.1.2",
4
+ "description": "Prime broker SDK for Hyperliquid HIP-3 markets — unified trading across fragmented markets",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "hp": "./dist/cli/index.js",
10
+ "hyperliquid-prime": "./dist/cli/index.js"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ }
17
+ },
18
+ "scripts": {
19
+ "build": "tsc && chmod +x dist/cli/index.js",
20
+ "prepublishOnly": "npm run build",
21
+ "dev": "tsc --watch",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest",
24
+ "test:integration": "vitest run --config vitest.integration.config.ts",
25
+ "lint": "eslint src/",
26
+ "typecheck": "tsc --noEmit",
27
+ "hp": "tsx src/cli/index.ts"
28
+ },
29
+ "keywords": [
30
+ "hyperliquid",
31
+ "hip-3",
32
+ "prime-broker",
33
+ "trading",
34
+ "defi",
35
+ "sdk"
36
+ ],
37
+ "license": "MIT",
38
+ "dependencies": {
39
+ "@nktkas/hyperliquid": "^0.30.0",
40
+ "better-sqlite3": "^11.0.0",
41
+ "commander": "^12.0.0",
42
+ "pino": "^9.0.0",
43
+ "viem": "^2.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "@types/better-sqlite3": "^7.0.0",
47
+ "@types/node": "^22.0.0",
48
+ "eslint": "^9.0.0",
49
+ "pino-pretty": "^11.0.0",
50
+ "tsx": "^4.0.0",
51
+ "typescript": "^5.7.0",
52
+ "vitest": "^2.0.0"
53
+ },
54
+ "files": [
55
+ "dist",
56
+ "LICENSE"
57
+ ],
58
+ "engines": {
59
+ "node": ">=20.0.0"
60
+ }
59
61
  }