hufi-cli 0.0.1 → 0.1.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.
package/README.md CHANGED
@@ -1,15 +1,193 @@
1
1
  # hufi-cli
2
2
 
3
- To install dependencies:
3
+ CLI tool for the [hu.fi](https://hu.finance) DeFi platform.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ bun install -g hufi-cli
9
+ ```
10
+
11
+ Or run without installing:
12
+
13
+ ```bash
14
+ bunx hufi-cli <command>
15
+ ```
16
+
17
+ All examples below assume global install. Otherwise replace `hufi` with `bunx hufi-cli`.
18
+
19
+ ## Quick Start
20
+
21
+ ```bash
22
+ # Generate a wallet
23
+ hufi auth generate
24
+
25
+ # Login with saved key
26
+ hufi auth login
27
+
28
+ # Browse campaigns
29
+ hufi campaign list
30
+ ```
31
+
32
+ ## Commands
33
+
34
+ ### auth
35
+
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
46
+ ```
47
+
48
+ ### campaign
49
+
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) |
60
+
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 progress --address 0x... --watch # live updates (polling)
69
+ hufi campaign progress --address 0x... --watch --interval 3000
70
+ hufi campaign leaderboard --address 0x... # leaderboard
71
+ ```
72
+
73
+ `campaign list` and `campaign get` print exact campaign timestamps and round token balances for human-readable text output.
74
+
75
+ #### Campaign Create
76
+
77
+ Requires staked HMT, gas, and fund tokens (USDT/USDC). Creates an escrow contract on-chain.
78
+
79
+ ```bash
80
+ # Market Making
81
+ hufi campaign create \
82
+ --type market_making --exchange mexc --symbol HMT/USDT \
83
+ --start-date 2026-04-01 --end-date 2026-05-01 \
84
+ --fund-token USDT --fund-amount 10000 \
85
+ --daily-volume-target 50000
86
+
87
+ # Holding
88
+ hufi campaign create \
89
+ --type holding --exchange mexc --symbol HMT \
90
+ --start-date 2026-04-01 --end-date 2026-05-01 \
91
+ --fund-token USDT --fund-amount 5000 \
92
+ --daily-balance-target 1000
93
+
94
+ # Threshold
95
+ hufi campaign create \
96
+ --type threshold --exchange mexc --symbol HMT \
97
+ --start-date 2026-04-01 --end-date 2026-05-01 \
98
+ --fund-token USDT --fund-amount 5000 \
99
+ --minimum-balance-target 500
100
+ ```
101
+
102
+ Running `campaign status/join/progress/leaderboard` without `-a` shows help.
103
+
104
+ ### exchange
105
+
106
+ | Command | Description |
107
+ |---------|-------------|
108
+ | `exchange register` | Register a read-only exchange API key |
109
+ | `exchange list` | List registered API keys |
110
+ | `exchange delete` | Delete API keys for an exchange |
111
+ | `exchange revalidate` | Revalidate an exchange API key |
112
+
113
+ ```bash
114
+ hufi exchange register --name mexc --api-key <key> --secret-key <secret>
115
+ hufi exchange list
116
+ hufi exchange revalidate --name mexc
117
+ hufi exchange delete --name mexc
118
+ ```
119
+
120
+ ### staking
121
+
122
+ | Command | Description |
123
+ |---------|-------------|
124
+ | `staking status` | Check HMT staking status |
125
+ | `staking deposit` | Show deposit address and QR code |
126
+ | `staking stake` | Stake HMT tokens |
127
+ | `staking unstake` | Initiate unstaking (tokens locked for lock period) |
128
+ | `staking withdraw` | Withdraw unlocked tokens after lock period |
4
129
 
5
130
  ```bash
6
- bun install
131
+ hufi staking deposit # show address QR code
132
+ hufi staking status # check your staking
133
+ hufi staking status --address 0x... # check another address
134
+ hufi staking stake -a 1000 # stake 1000 HMT
135
+ hufi staking unstake -a 500 # unstake 500 HMT
136
+ hufi staking withdraw # withdraw unlocked tokens
7
137
  ```
8
138
 
9
- To run:
139
+ Supports Polygon (chain 137) and Ethereum (chain 1). Staking contract: `0x01D1...07F1D` on Polygon.
140
+
141
+ ### dashboard
142
+
143
+ Portfolio overview — staking, active campaigns, and progress in one view.
144
+
145
+ ```bash
146
+ hufi dashboard # full overview
147
+ hufi dashboard --json # machine output
148
+ hufi dashboard --export csv # export active campaign rows as CSV
149
+ hufi dashboard --export json
150
+ ```
151
+
152
+ ## Global Options
153
+
154
+ | Option | Description |
155
+ |--------|-------------|
156
+ | `--config-file <path>` | Custom config file (default: `~/.hufi-cli/config.json`) |
157
+ | `--key-file <path>` | Custom key file (default: `~/.hufi-cli/key.json`) |
158
+ | `-V, --version` | Show version |
159
+ | `-h, --help` | Show help |
160
+
161
+ All commands support `--json` for machine-readable output.
162
+
163
+ ## Configuration
164
+
165
+ Stored at `~/.hufi-cli/config.json`:
166
+
167
+ ```json
168
+ {
169
+ "recordingApiUrl": "https://ro.hu.finance",
170
+ "launcherApiUrl": "https://cl.hu.finance",
171
+ "defaultChainId": 137,
172
+ "address": "0x...",
173
+ "accessToken": "..."
174
+ }
175
+ ```
176
+
177
+ ## Development
10
178
 
11
179
  ```bash
12
- bun run index.ts
180
+ bun install # install deps
181
+ bun run dev -- --help # run from source
182
+ bun run build # build to dist/cli.js
183
+ bun test # unit tests
184
+ bun run test:cli # integration tests
185
+ bun run typecheck # type check
13
186
  ```
14
187
 
15
- This project was created using `bun init` in bun v1.3.9. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
188
+ ## API Endpoints
189
+
190
+ | Service | URL |
191
+ |---------|-----|
192
+ | Recording Oracle | https://ro.hu.finance |
193
+ | Campaign Launcher | https://cl.hu.finance |