Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/commands/approve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::auth;
use crate::output::OutputFormat;
use crate::output::approve::{ApprovalStatus, print_approval_status, print_tx_result};

/// Must match `USDC_ADDRESS_STR` in commands/mod.rs.
const USDC_ADDRESS: Address = address!("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174");

sol! {
Expand Down Expand Up @@ -39,7 +40,7 @@ pub enum ApproveCommand {
/// Check current contract approvals for a wallet
Check {
/// Wallet address to check (defaults to configured wallet)
address: Option<String>,
address: Option<Address>,
},
/// Approve all required contracts for trading (sends on-chain transactions)
Set,
Expand Down Expand Up @@ -82,18 +83,18 @@ pub async fn execute(
private_key: Option<&str>,
) -> Result<()> {
match args.command {
ApproveCommand::Check { address } => check(address.as_deref(), private_key, output).await,
ApproveCommand::Check { address } => check(address, private_key, output).await,
ApproveCommand::Set => set(private_key, output).await,
}
}

async fn check(
address_arg: Option<&str>,
address_arg: Option<Address>,
private_key: Option<&str>,
output: OutputFormat,
) -> Result<()> {
let owner: Address = if let Some(addr) = address_arg {
super::parse_address(addr)?
addr
} else {
let signer = auth::resolve_signer(private_key)?;
polymarket_client_sdk::auth::Signer::address(&signer)
Expand Down
5 changes: 2 additions & 3 deletions src/commands/bridge.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use super::parse_address;
use crate::output::OutputFormat;
use crate::output::bridge::{print_deposit, print_status, print_supported_assets};
use anyhow::Result;
Expand All @@ -19,7 +18,7 @@ pub enum BridgeCommand {
/// Get deposit addresses for a wallet (EVM, Solana, Bitcoin)
Deposit {
/// Polymarket wallet address (0x...)
address: String,
address: polymarket_client_sdk::types::Address,
},

/// List supported chains and tokens for deposits
Expand All @@ -40,7 +39,7 @@ pub async fn execute(
match args.command {
BridgeCommand::Deposit { address } => {
let request = DepositRequest::builder()
.address(parse_address(&address)?)
.address(address)
.build();

let response = client.deposit(&request).await?;
Expand Down
Loading
Loading