@siphoyawe/mina-cli 1.0.0 → 1.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 +321 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
# @siphoyawe/mina-cli
|
|
2
|
+
|
|
3
|
+
Terminal-based cross-chain bridge to Hyperliquid. Bridge assets from any chain directly from your command line.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@siphoyawe/mina-cli)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
__ __ ___ _ _ _
|
|
11
|
+
| \/ |_ _| \ | | / \
|
|
12
|
+
| |\/| || || \| | / _ \
|
|
13
|
+
| | | || || |\ |/ ___ \
|
|
14
|
+
|_| |_|___|_| \_/_/ \_\
|
|
15
|
+
|
|
16
|
+
Cross-chain bridge to Hyperliquid
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- **Interactive Wizard** - Step-by-step guided bridging experience
|
|
22
|
+
- **Multi-chain Support** - Bridge from 40+ chains including Ethereum, Arbitrum, Polygon, Base, and more
|
|
23
|
+
- **Auto-deposit** - Automatic deposit to Hyperliquid L1 trading account
|
|
24
|
+
- **Transaction Tracking** - Real-time status monitoring with progress indicators
|
|
25
|
+
- **Local History** - Track all your bridge transactions locally
|
|
26
|
+
- **Beautiful TUI** - Dark luxe terminal theme with elegant UI components
|
|
27
|
+
- **JSON Output** - Machine-readable output for scripting and automation
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# npm
|
|
33
|
+
npm install -g @siphoyawe/mina-cli
|
|
34
|
+
|
|
35
|
+
# yarn
|
|
36
|
+
yarn global add @siphoyawe/mina-cli
|
|
37
|
+
|
|
38
|
+
# pnpm
|
|
39
|
+
pnpm add -g @siphoyawe/mina-cli
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
### Interactive Wizard (Recommended)
|
|
45
|
+
|
|
46
|
+
Simply run `mina` with no arguments to launch the interactive wizard:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
mina
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The wizard will guide you through:
|
|
53
|
+
1. Selecting a source chain
|
|
54
|
+
2. Choosing a token to bridge
|
|
55
|
+
3. Entering the amount
|
|
56
|
+
4. Confirming and executing the transaction
|
|
57
|
+
|
|
58
|
+
### Get a Quote
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Get a quote for bridging USDC from Arbitrum
|
|
62
|
+
mina quote --from arbitrum --token USDC --amount 100
|
|
63
|
+
|
|
64
|
+
# Get a quote with JSON output
|
|
65
|
+
mina quote --from ethereum --token ETH --amount 0.5 --json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Execute a Bridge
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Bridge USDC from Arbitrum (will prompt for private key)
|
|
72
|
+
mina bridge --from arbitrum --token USDC --amount 100
|
|
73
|
+
|
|
74
|
+
# Bridge with a key file
|
|
75
|
+
mina bridge --from arbitrum --token USDC --amount 100 --key ./key.json
|
|
76
|
+
|
|
77
|
+
# Skip confirmation prompt
|
|
78
|
+
mina bridge --from ethereum --token ETH --amount 0.5 --key ./key.json --yes
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Commands
|
|
82
|
+
|
|
83
|
+
### `mina` / `mina wizard`
|
|
84
|
+
|
|
85
|
+
Launch the interactive bridge wizard.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
mina
|
|
89
|
+
mina wizard
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `mina quote`
|
|
93
|
+
|
|
94
|
+
Get a bridge quote without executing.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
mina quote --from <chain> --token <symbol> --amount <number> [options]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
| Option | Description | Default |
|
|
101
|
+
|--------|-------------|---------|
|
|
102
|
+
| `--from <chain>` | Source chain (required) | - |
|
|
103
|
+
| `--to <chain>` | Destination chain | `hyperliquid` |
|
|
104
|
+
| `--token <symbol>` | Token symbol (required) | - |
|
|
105
|
+
| `--amount <number>` | Amount to bridge (required) | - |
|
|
106
|
+
| `--json` | Output as JSON | `false` |
|
|
107
|
+
|
|
108
|
+
### `mina bridge`
|
|
109
|
+
|
|
110
|
+
Execute a bridge transaction.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
mina bridge --from <chain> --token <symbol> --amount <number> [options]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
| Option | Description | Default |
|
|
117
|
+
|--------|-------------|---------|
|
|
118
|
+
| `--from <chain>` | Source chain (required) | - |
|
|
119
|
+
| `--token <symbol>` | Token symbol (required) | - |
|
|
120
|
+
| `--amount <number>` | Amount to bridge (required) | - |
|
|
121
|
+
| `--key <path>` | Path to private key file | Prompt |
|
|
122
|
+
| `--yes` | Skip confirmation prompt | `false` |
|
|
123
|
+
| `--auto-deposit` | Auto-deposit to Hyperliquid L1 | `true` |
|
|
124
|
+
|
|
125
|
+
### `mina status`
|
|
126
|
+
|
|
127
|
+
Check the status of a bridge transaction.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
mina status <txHash> [options]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
| Option | Description | Default |
|
|
134
|
+
|--------|-------------|---------|
|
|
135
|
+
| `--watch` | Poll for real-time updates | `false` |
|
|
136
|
+
|
|
137
|
+
### `mina chains`
|
|
138
|
+
|
|
139
|
+
List all supported source chains.
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
mina chains [options]
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
| Option | Description | Default |
|
|
146
|
+
|--------|-------------|---------|
|
|
147
|
+
| `--json` | Output as JSON | `false` |
|
|
148
|
+
|
|
149
|
+
### `mina tokens`
|
|
150
|
+
|
|
151
|
+
List bridgeable tokens.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
mina tokens [options]
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
| Option | Description | Default |
|
|
158
|
+
|--------|-------------|---------|
|
|
159
|
+
| `--chain <chain>` | Filter by chain (name or ID) | All chains |
|
|
160
|
+
| `--json` | Output as JSON | `false` |
|
|
161
|
+
|
|
162
|
+
### `mina balance`
|
|
163
|
+
|
|
164
|
+
Check wallet token balances.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
mina balance --address <address> [options]
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
| Option | Description | Default |
|
|
171
|
+
|--------|-------------|---------|
|
|
172
|
+
| `--address <address>` | Wallet address (required) | - |
|
|
173
|
+
| `--chain <chain>` | Specific chain (name or ID) | All chains |
|
|
174
|
+
| `--all` | Show all tokens including zero balance | `false` |
|
|
175
|
+
| `--json` | Output as JSON | `false` |
|
|
176
|
+
|
|
177
|
+
### `mina history`
|
|
178
|
+
|
|
179
|
+
View bridge transaction history.
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
mina history [options]
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
| Option | Description | Default |
|
|
186
|
+
|--------|-------------|---------|
|
|
187
|
+
| `--limit <number>` | Number of entries to show | `10` |
|
|
188
|
+
| `--address <address>` | Filter by wallet address | All |
|
|
189
|
+
| `--json` | Output as JSON | `false` |
|
|
190
|
+
|
|
191
|
+
### `mina config`
|
|
192
|
+
|
|
193
|
+
Manage CLI configuration.
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# List all config
|
|
197
|
+
mina config list
|
|
198
|
+
|
|
199
|
+
# Get a specific value
|
|
200
|
+
mina config get <key>
|
|
201
|
+
|
|
202
|
+
# Set a value
|
|
203
|
+
mina config set <key> <value>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Configuration Options:**
|
|
207
|
+
|
|
208
|
+
| Key | Type | Description | Default |
|
|
209
|
+
|-----|------|-------------|---------|
|
|
210
|
+
| `slippage` | `number` | Slippage tolerance (percentage) | `0.5` |
|
|
211
|
+
| `autoDeposit` | `boolean` | Auto-deposit to Hyperliquid L1 | `true` |
|
|
212
|
+
| `defaultChain` | `string` | Default source chain | `arbitrum` |
|
|
213
|
+
| `rpc.<chain>` | `string` | Custom RPC URL per chain | Default RPC |
|
|
214
|
+
|
|
215
|
+
**Examples:**
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
mina config set slippage 1.0
|
|
219
|
+
mina config set defaultChain ethereum
|
|
220
|
+
mina config set rpc.arbitrum https://arb1.example.com
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Private Key Handling
|
|
224
|
+
|
|
225
|
+
The CLI supports multiple formats for providing your private key:
|
|
226
|
+
|
|
227
|
+
### Key File (Recommended)
|
|
228
|
+
|
|
229
|
+
Create a JSON file with your private key:
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"privateKey": "0x..."
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Or use plain text format:
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
0x1234567890abcdef...
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Then pass it to the bridge command:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
mina bridge --from arbitrum --token USDC --amount 100 --key ./key.json
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Interactive Prompt
|
|
250
|
+
|
|
251
|
+
If no key file is provided, you'll be prompted to enter your private key:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
mina bridge --from arbitrum --token USDC --amount 100
|
|
255
|
+
# Enter private key (input will be visible):
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Security Note:** Never share your private key. Store key files securely and add them to `.gitignore`.
|
|
259
|
+
|
|
260
|
+
## Configuration File
|
|
261
|
+
|
|
262
|
+
CLI settings are stored in `~/.mina/config.json`. Bridge history is stored in `~/.mina/history.json`.
|
|
263
|
+
|
|
264
|
+
## Supported Chains
|
|
265
|
+
|
|
266
|
+
| Chain | Chain ID |
|
|
267
|
+
|-------|----------|
|
|
268
|
+
| Ethereum | 1 |
|
|
269
|
+
| Arbitrum | 42161 |
|
|
270
|
+
| Optimism | 10 |
|
|
271
|
+
| Base | 8453 |
|
|
272
|
+
| Polygon | 137 |
|
|
273
|
+
| BSC | 56 |
|
|
274
|
+
| Avalanche | 43114 |
|
|
275
|
+
| Fantom | 250 |
|
|
276
|
+
| zkSync Era | 324 |
|
|
277
|
+
| Linea | 59144 |
|
|
278
|
+
| Scroll | 534352 |
|
|
279
|
+
| And 30+ more... | |
|
|
280
|
+
|
|
281
|
+
**Destination:** HyperEVM (Chain ID: 999) with automatic deposit to Hyperliquid L1
|
|
282
|
+
|
|
283
|
+
## Examples
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# Launch the interactive wizard
|
|
287
|
+
mina
|
|
288
|
+
|
|
289
|
+
# Get a quote for bridging 100 USDC from Arbitrum
|
|
290
|
+
mina quote --from arbitrum --token USDC --amount 100
|
|
291
|
+
|
|
292
|
+
# Bridge 0.5 ETH from Ethereum
|
|
293
|
+
mina bridge --from ethereum --token ETH --amount 0.5 --key ./key.json
|
|
294
|
+
|
|
295
|
+
# Check transaction status with live updates
|
|
296
|
+
mina status 0x1234...abcd --watch
|
|
297
|
+
|
|
298
|
+
# View supported chains in JSON format
|
|
299
|
+
mina chains --json
|
|
300
|
+
|
|
301
|
+
# List tokens available on Arbitrum
|
|
302
|
+
mina tokens --chain arbitrum
|
|
303
|
+
|
|
304
|
+
# Check wallet balance on all chains
|
|
305
|
+
mina balance --address 0x1234...abcd
|
|
306
|
+
|
|
307
|
+
# View recent bridge history
|
|
308
|
+
mina history --limit 20
|
|
309
|
+
|
|
310
|
+
# Configure default slippage
|
|
311
|
+
mina config set slippage 1.0
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## Related Packages
|
|
315
|
+
|
|
316
|
+
- [@siphoyawe/mina-sdk](https://www.npmjs.com/package/@siphoyawe/mina-sdk) - The underlying SDK with React hooks
|
|
317
|
+
- [Mina Bridge Web App](https://github.com/siphoyawe/mina-sdk) - Web interface for bridging
|
|
318
|
+
|
|
319
|
+
## License
|
|
320
|
+
|
|
321
|
+
MIT
|