hufi-cli 0.5.5 → 0.8.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 +151 -46
  2. package/dist/cli.js +19533 -5547
  3. package/package.json +5 -3
package/README.md CHANGED
@@ -1,82 +1,187 @@
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
16
 
17
- # Generate a new wallet (key saved to ~/.hufi-cli/key.json)
18
- bunx hufi-cli auth generate
17
+ All examples below assume global install. Otherwise replace `hufi` with `bunx hufi-cli`.
19
18
 
20
- # Authenticate (uses saved key by default)
21
- bunx hufi-cli auth login
19
+ ## Quick Start
22
20
 
23
- # Check auth status
24
- bunx hufi-cli auth status
21
+ ```bash
22
+ # Generate a wallet
23
+ hufi auth generate
25
24
 
26
- # Register exchange API key
27
- bunx hufi-cli exchange register --name mexc --api-key xxx --secret-key yyy
25
+ # Login with saved key
26
+ hufi auth login
28
27
 
29
- # List exchange API keys
30
- bunx hufi-cli exchange list
28
+ # Browse campaigns
29
+ hufi campaign list
30
+ ```
31
31
 
32
- # Check campaign join status
33
- bunx hufi-cli campaign status --chain-id 137 --address 0x...
32
+ ## Commands
34
33
 
35
- # Join a campaign
36
- bunx hufi-cli campaign join --chain-id 137 --address 0x...
34
+ ### auth
37
35
 
38
- # List joined campaigns
39
- bunx hufi-cli campaign list --limit 20
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 |
41
+
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 |
59
+ | `campaign create` | Create a new campaign (launch escrow on-chain) |
45
60
 
46
- ## Configuration
61
+ ```bash
62
+ hufi campaign list # list active campaigns
63
+ hufi campaign list --status completed --chain-id 1 # completed on Ethereum
64
+ hufi campaign get --chain-id 137 --address 0x... # campaign details
65
+ hufi campaign join --address 0x... # join (chain-id defaults to 137)
66
+ hufi campaign status --address 0x... # check status
67
+ hufi campaign progress --address 0x... # your progress
68
+ hufi campaign leaderboard --address 0x... # leaderboard
69
+ ```
47
70
 
48
- Configuration is stored at `~/.hufi-cli/config.json`.
71
+ #### Campaign Create
49
72
 
50
- ## Capabilities
73
+ Requires staked HMT, gas, and fund tokens (USDT/USDC). Creates an escrow contract on-chain.
51
74
 
52
- ### What This CLI Can Do
75
+ ```bash
76
+ # Market Making
77
+ hufi campaign create \
78
+ --type market_making --exchange mexc --symbol HMT/USDT \
79
+ --start-date 2026-04-01 --end-date 2026-05-01 \
80
+ --fund-token USDT --fund-amount 10000 \
81
+ --daily-volume-target 50000
82
+
83
+ # Holding
84
+ hufi campaign create \
85
+ --type holding --exchange mexc --symbol HMT \
86
+ --start-date 2026-04-01 --end-date 2026-05-01 \
87
+ --fund-token USDT --fund-amount 5000 \
88
+ --daily-balance-target 1000
89
+
90
+ # Threshold
91
+ hufi campaign create \
92
+ --type threshold --exchange mexc --symbol HMT \
93
+ --start-date 2026-04-01 --end-date 2026-05-01 \
94
+ --fund-token USDT --fund-amount 5000 \
95
+ --minimum-balance-target 500
96
+ ```
53
97
 
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 |
98
+ Running `campaign status/join/progress/leaderboard` without `-a` shows help.
59
99
 
60
- ### What This CLI Cannot Do
100
+ ### exchange
61
101
 
62
- - Execute on-chain transactions
63
- - ❌ Configure trading strategies
64
- - Multi-signature or voting operations
102
+ | Command | Description |
103
+ |---------|-------------|
104
+ | `exchange register` | Register a read-only exchange API key |
105
+ | `exchange list` | List registered API keys |
106
+ | `exchange delete` | Delete API keys for an exchange |
107
+ | `exchange revalidate` | Revalidate an exchange API key |
65
108
 
66
- ## API Endpoints
109
+ ```bash
110
+ hufi exchange register --name mexc --api-key <key> --secret-key <secret>
111
+ hufi exchange list
112
+ hufi exchange revalidate --name mexc
113
+ hufi exchange delete --name mexc
114
+ ```
67
115
 
68
- - Recording Oracle: `https://ro.hu.finance`
69
- - Campaign Launcher: `https://cl.hu.finance`
116
+ ### staking
70
117
 
71
- ## Development
118
+ | Command | Description |
119
+ |---------|-------------|
120
+ | `staking status` | Check HMT staking status |
121
+ | `staking deposit` | Show deposit address and QR code |
122
+ | `staking stake` | Stake HMT tokens |
123
+ | `staking unstake` | Initiate unstaking (tokens locked for lock period) |
124
+ | `staking withdraw` | Withdraw unlocked tokens after lock period |
125
+
126
+ ```bash
127
+ hufi staking deposit # show address QR code
128
+ hufi staking status # check your staking
129
+ hufi staking status --address 0x... # check another address
130
+ hufi staking stake -a 1000 # stake 1000 HMT
131
+ hufi staking unstake -a 500 # unstake 500 HMT
132
+ hufi staking withdraw # withdraw unlocked tokens
133
+ ```
134
+
135
+ Supports Polygon (chain 137) and Ethereum (chain 1). Staking contract: `0x01D1...07F1D` on Polygon.
136
+
137
+ ### dashboard
138
+
139
+ Portfolio overview — staking, active campaigns, and progress in one view.
72
140
 
73
141
  ```bash
74
- # Run directly
75
- bunx hufi-cli --help
142
+ hufi dashboard # full overview
143
+ hufi dashboard --json # machine output
144
+ ```
145
+
146
+ ## Global Options
147
+
148
+ | Option | Description |
149
+ |--------|-------------|
150
+ | `--config-file <path>` | Custom config file (default: `~/.hufi-cli/config.json`) |
151
+ | `--key-file <path>` | Custom key file (default: `~/.hufi-cli/key.json`) |
152
+ | `-V, --version` | Show version |
153
+ | `-h, --help` | Show help |
154
+
155
+ All commands support `--json` for machine-readable output.
156
+
157
+ ## Configuration
76
158
 
77
- # Run tests
78
- bun test
159
+ Stored at `~/.hufi-cli/config.json`:
79
160
 
80
- # Type check
81
- bun run typecheck
161
+ ```json
162
+ {
163
+ "recordingApiUrl": "https://ro.hu.finance",
164
+ "launcherApiUrl": "https://cl.hu.finance",
165
+ "defaultChainId": 137,
166
+ "address": "0x...",
167
+ "accessToken": "..."
168
+ }
82
169
  ```
170
+
171
+ ## Development
172
+
173
+ ```bash
174
+ bun install # install deps
175
+ bun run dev -- --help # run from source
176
+ bun run build # build to dist/cli.js
177
+ bun test # unit tests
178
+ bun run test:cli # integration tests
179
+ bun run typecheck # type check
180
+ ```
181
+
182
+ ## API Endpoints
183
+
184
+ | Service | URL |
185
+ |---------|-----|
186
+ | Recording Oracle | https://ro.hu.finance |
187
+ | Campaign Launcher | https://cl.hu.finance |