hufi-cli 0.5.3 → 0.6.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.
Files changed (3) hide show
  1. package/README.md +110 -46
  2. package/dist/cli.js +19261 -5591
  3. package/package.json +5 -3
package/README.md CHANGED
@@ -1,82 +1,146 @@
1
1
  # hufi-cli
2
2
 
3
- CLI tool for the hu.fi DeFi platform.
3
+ CLI tool for the [hu.fi](https://hu.finance) DeFi platform.
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- bun install
8
+ bun install -g hufi-cli
9
9
  ```
10
10
 
11
- ## Usage
11
+ Or run without installing:
12
12
 
13
13
  ```bash
14
- # Show help
15
- bunx hufi-cli --help
14
+ bunx hufi-cli <command>
15
+ ```
16
+
17
+ All examples below assume global install. Otherwise replace `hufi` with `bunx hufi-cli`.
16
18
 
17
- # Generate a new wallet (key saved to ~/.hufi-cli/key.json)
18
- bunx hufi-cli auth generate
19
+ ## Quick Start
19
20
 
20
- # Authenticate (uses saved key by default)
21
- bunx hufi-cli auth login
21
+ ```bash
22
+ # Generate a wallet
23
+ hufi auth generate
22
24
 
23
- # Check auth status
24
- bunx hufi-cli auth status
25
+ # Login with saved key
26
+ hufi auth login
25
27
 
26
- # Register exchange API key
27
- bunx hufi-cli exchange register --name mexc --api-key xxx --secret-key yyy
28
+ # Browse campaigns
29
+ hufi campaign list
30
+ ```
28
31
 
29
- # List exchange API keys
30
- bunx hufi-cli exchange list
32
+ ## Commands
31
33
 
32
- # Check campaign join status
33
- bunx hufi-cli campaign status --chain-id 137 --address 0x...
34
+ ### auth
34
35
 
35
- # Join a campaign
36
- bunx hufi-cli campaign join --chain-id 137 --address 0x...
36
+ | Command | Description |
37
+ |---------|-------------|
38
+ | `auth generate` | Generate a new EVM wallet (saves to `~/.hufi-cli/key.json`) |
39
+ | `auth login` | Authenticate with Recording Oracle (uses saved key by default) |
40
+ | `auth status` | Show current auth status |
37
41
 
38
- # List joined campaigns
39
- bunx hufi-cli campaign list --limit 20
42
+ ```bash
43
+ hufi auth generate --json
44
+ hufi auth login --private-key <key>
45
+ hufi auth status
40
46
  ```
41
47
 
42
- ## Global Options
48
+ ### campaign
43
49
 
44
- - `--json` - Output as JSON (available on all commands)
50
+ | Command | Description |
51
+ |---------|-------------|
52
+ | `campaign list` | Browse available campaigns |
53
+ | `campaign get` | Get details for a specific campaign |
54
+ | `campaign joined` | List campaigns you've joined |
55
+ | `campaign join` | Join a campaign |
56
+ | `campaign status` | Check join status |
57
+ | `campaign progress` | Check your progress |
58
+ | `campaign leaderboard` | View campaign leaderboard |
45
59
 
46
- ## Configuration
60
+ ```bash
61
+ hufi campaign list # list active campaigns
62
+ hufi campaign list --status completed --chain-id 1 # completed on Ethereum
63
+ hufi campaign get --chain-id 137 --address 0x... # campaign details
64
+ hufi campaign join --address 0x... # join (chain-id defaults to 137)
65
+ hufi campaign status --address 0x... # check status
66
+ hufi campaign progress --address 0x... # your progress
67
+ hufi campaign leaderboard --address 0x... # leaderboard
68
+ ```
47
69
 
48
- Configuration is stored at `~/.hufi-cli/config.json`.
70
+ Running `campaign status/join/progress/leaderboard` without `-a` shows help.
49
71
 
50
- ## Capabilities
72
+ ### exchange
51
73
 
52
- ### What This CLI Can Do
74
+ | Command | Description |
75
+ |---------|-------------|
76
+ | `exchange register` | Register a read-only exchange API key |
77
+ | `exchange list` | List registered API keys |
53
78
 
54
- | Module | Commands | Description |
55
- |--------|----------|-------------|
56
- | **auth** | login, generate, status | Authentication & wallet management |
57
- | **exchange** | register, list | Exchange API key management |
58
- | **campaign** | list, get, joined, join, status, progress, leaderboard | Campaign browsing, joining, and monitoring |
79
+ ```bash
80
+ hufi exchange register --name mexc --api-key <key> --secret-key <secret>
81
+ hufi exchange list
82
+ ```
59
83
 
60
- ### What This CLI Cannot Do
84
+ ### staking
61
85
 
62
- - Execute on-chain transactions
63
- - ❌ Configure trading strategies
64
- - Multi-signature or voting operations
86
+ | Command | Description |
87
+ |---------|-------------|
88
+ | `staking status` | Check HMT staking status |
89
+ | `staking deposit` | Show deposit address and QR code |
90
+ | `staking stake` | Stake HMT tokens |
91
+ | `staking unstake` | Initiate unstaking (tokens locked for lock period) |
92
+ | `staking withdraw` | Withdraw unlocked tokens after lock period |
65
93
 
66
- ## API Endpoints
94
+ ```bash
95
+ hufi staking deposit # show address QR code
96
+ hufi staking status # check your staking
97
+ hufi staking status --address 0x... # check another address
98
+ hufi staking stake -a 1000 # stake 1000 HMT
99
+ hufi staking unstake -a 500 # unstake 500 HMT
100
+ hufi staking withdraw # withdraw unlocked tokens
101
+ ```
102
+
103
+ Supports Polygon (chain 137) and Ethereum (chain 1). Staking contract: `0x01D1...07F1D` on Polygon.
104
+
105
+ ## Global Options
67
106
 
68
- - Recording Oracle: `https://ro.hu.finance`
69
- - Campaign Launcher: `https://cl.hu.finance`
107
+ | Option | Description |
108
+ |--------|-------------|
109
+ | `--config-file <path>` | Custom config file (default: `~/.hufi-cli/config.json`) |
110
+ | `--key-file <path>` | Custom key file (default: `~/.hufi-cli/key.json`) |
111
+ | `-V, --version` | Show version |
112
+ | `-h, --help` | Show help |
113
+
114
+ All commands support `--json` for machine-readable output.
115
+
116
+ ## Configuration
117
+
118
+ Stored at `~/.hufi-cli/config.json`:
119
+
120
+ ```json
121
+ {
122
+ "recordingApiUrl": "https://ro.hu.finance",
123
+ "launcherApiUrl": "https://cl.hu.finance",
124
+ "defaultChainId": 137,
125
+ "address": "0x...",
126
+ "accessToken": "..."
127
+ }
128
+ ```
70
129
 
71
130
  ## Development
72
131
 
73
132
  ```bash
74
- # Run directly
75
- bunx hufi-cli --help
133
+ bun install # install deps
134
+ bun run dev -- --help # run from source
135
+ bun run build # build to dist/cli.js
136
+ bun test # unit tests
137
+ bun run test:cli # integration tests
138
+ bun run typecheck # type check
139
+ ```
76
140
 
77
- # Run tests
78
- bun test
141
+ ## API Endpoints
79
142
 
80
- # Type check
81
- bun run typecheck
82
- ```
143
+ | Service | URL |
144
+ |---------|-----|
145
+ | Recording Oracle | https://ro.hu.finance |
146
+ | Campaign Launcher | https://cl.hu.finance |