Skip to content

Commit 424072b

Browse files
Michael YuanMichael Yuan
authored andcommitted
fix: remove amount param from deposit — address is permanent and reusable
1 parent 8f87543 commit 424072b

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

src/cli.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ pub enum Commands {
6161
#[command(subcommand)]
6262
Report(ReportCmd),
6363

64-
/// Deposit assets to Hyperliquid via Unit bridge (ETH/BTC/SOL) or Arbitrum (USDC)
64+
/// Get your deposit address for Hyperliquid via Unit bridge (ETH/BTC/SOL) or Arbitrum (USDC)
6565
Deposit {
66-
/// Amount to deposit (e.g. 0.5)
67-
amount: String,
6866
/// Asset: ETH, BTC, SOL, or USDC
6967
asset: String,
7068
},

src/commands/deposit.rs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use serde_json::json;
99
use crate::config;
1010
use crate::unit;
1111

12-
pub async fn run(amount: &str, asset: &str, json_out: bool) -> Result<()> {
12+
pub async fn run(asset: &str, json_out: bool) -> Result<()> {
1313
let asset_lower = asset.to_lowercase();
1414

1515
if asset_lower == "usdc" {
16-
return deposit_usdc(amount, json_out).await;
16+
return deposit_usdc(json_out).await;
1717
}
1818

1919
if !unit::is_supported(&asset_lower) {
@@ -39,15 +39,13 @@ pub async fn run(amount: &str, asset: &str, json_out: bool) -> Result<()> {
3939
let mut out = json!({
4040
"action": "deposit",
4141
"asset": asset.to_uppercase(),
42-
"amount": amount,
4342
"source_chain": chain,
4443
"destination": "hyperliquid",
4544
"hl_address": cfg.address,
4645
"deposit_address": resp.address,
4746
"minimum": min,
4847
"instructions": format!(
49-
"Send {} {} on {} to {}",
50-
amount,
48+
"Send {} on {} to {} (any amount above minimum, reusable address)",
5149
asset.to_uppercase(),
5250
chain,
5351
resp.address
@@ -62,9 +60,8 @@ pub async fn run(amount: &str, asset: &str, json_out: bool) -> Result<()> {
6260
} else {
6361
println!("{}", "━".repeat(50).dimmed());
6462
println!(
65-
" {} {} {} → Hyperliquid",
63+
" {} {} → Hyperliquid",
6664
"Deposit".green().bold(),
67-
amount,
6865
asset.to_uppercase().cyan()
6966
);
7067
println!("{}", "━".repeat(50).dimmed());
@@ -86,9 +83,8 @@ pub async fn run(amount: &str, asset: &str, json_out: bool) -> Result<()> {
8683
);
8784
println!();
8885
println!(
89-
" {} Send {} {} on {} to:",
86+
" {} Send {} on {} to:",
9087
"→".green().bold(),
91-
amount,
9288
asset.to_uppercase(),
9389
chain
9490
);
@@ -119,7 +115,7 @@ pub async fn run(amount: &str, asset: &str, json_out: bool) -> Result<()> {
119115
}
120116
println!();
121117
println!(
122-
" {} This address is permanent for your HL wallet.",
118+
" {} This address is permanent — send any amount, any time.",
123119
"ℹ".blue()
124120
);
125121
println!(
@@ -132,31 +128,27 @@ pub async fn run(amount: &str, asset: &str, json_out: bool) -> Result<()> {
132128
Ok(())
133129
}
134130

135-
async fn deposit_usdc(amount: &str, json_out: bool) -> Result<()> {
131+
async fn deposit_usdc(json_out: bool) -> Result<()> {
136132
let cfg = config::load_hl_config()?;
137133

138134
if json_out {
139135
let out = json!({
140136
"action": "deposit",
141137
"asset": "USDC",
142-
"amount": amount,
143138
"source_chain": "arbitrum",
144139
"destination": "hyperliquid",
145140
"hl_address": cfg.address,
146-
"instructions": format!(
147-
"Send {} USDC on Arbitrum to the Hyperliquid bridge contract. \
141+
"instructions": "Send USDC on Arbitrum to the Hyperliquid bridge contract. \
148142
Use the Hyperliquid web UI at https://app.hyperliquid.xyz or \
149143
the HL SDK's deposit method.",
150-
amount),
151144
"note": "USDC deposits use Hyperliquid's native Arbitrum bridge, not Unit.",
152145
});
153146
println!("{}", serde_json::to_string_pretty(&out)?);
154147
} else {
155148
println!("{}", "━".repeat(50).dimmed());
156149
println!(
157-
" {} {} {} → Hyperliquid",
150+
" {} {} → Hyperliquid",
158151
"Deposit".green().bold(),
159-
amount,
160152
"USDC".cyan()
161153
);
162154
println!("{}", "━".repeat(50).dimmed());

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async fn main() -> Result<()> {
126126
min_price,
127127
} => commands::predict::sell(&market, &side, &amount, min_price.as_deref(), json).await,
128128
},
129-
Commands::Deposit { amount, asset } => commands::deposit::run(&amount, &asset, json).await,
129+
Commands::Deposit { asset } => commands::deposit::run(&asset, json).await,
130130
Commands::Withdraw { amount, asset, to } => {
131131
commands::withdraw::run(&amount, &asset, to.as_deref(), json).await
132132
}

0 commit comments

Comments
 (0)