@@ -2357,45 +2357,42 @@ def wallet_check_ck_swap(
2357
2357
[green]$[/green] btcli wallet swap-check --all
2358
2358
2359
2359
Check specific wallet's swap:
2360
- [green]$[/green] btcli wallet swap-check --wallet. name my_wallet
2360
+ [green]$[/green] btcli wallet swap-check --wallet- name my_wallet
2361
2361
2362
2362
Check swap using SS58 address:
2363
- [green]$[/green] btcli wallet swap-check --ss58-address 5DkQ4...
2363
+ [green]$[/green] btcli wallet swap-check --ss58 5DkQ4...
2364
2364
2365
2365
Check swap details with block number:
2366
- [green]$[/green] btcli wallet swap-check --wallet. name my_wallet --block 12345
2366
+ [green]$[/green] btcli wallet swap-check --wallet- name my_wallet --block 12345
2367
2367
"""
2368
2368
self .verbosity_handler (quiet , verbose )
2369
2369
self .initialize_chain (network )
2370
2370
2371
- if not wallet_ss58_address :
2372
- wallet_or_ss58_address = Prompt .ask (
2373
- "Enter the [blue]SS58 address[/blue] or the [blue]wallet name[/blue]. [dim]Leave blank to check all pending swaps[/dim]"
2374
- )
2375
- if not wallet_or_ss58_address :
2376
- show_all = True
2377
- else :
2378
- if is_valid_ss58_address (wallet_or_ss58_address ):
2379
- return self ._run_command (
2380
- wallets .check_swap_status (
2381
- self .subtensor , wallet_or_ss58_address , scheduled_block
2382
- )
2383
- )
2384
- else :
2385
- wallet_name = wallet_or_ss58_address
2386
-
2387
2371
if show_all :
2388
2372
return self ._run_command (
2389
2373
wallets .check_swap_status (self .subtensor , None , None )
2390
2374
)
2391
2375
2392
- wallet = self .wallet_ask (
2393
- wallet_name ,
2394
- wallet_path ,
2395
- wallet_hotkey ,
2396
- ask_for = [WO .NAME , WO .PATH ],
2397
- validate = WV .WALLET ,
2398
- )
2376
+ if not wallet_ss58_address :
2377
+ wallet_ss58_address = Prompt .ask (
2378
+ "Enter [blue]wallet name[/blue] or [blue]SS58 address[/blue] [dim](leave blank to show all pending swaps)[/dim]"
2379
+ )
2380
+ if not wallet_ss58_address :
2381
+ return self ._run_command (
2382
+ wallets .check_swap_status (self .subtensor , None , None )
2383
+ )
2384
+
2385
+ if is_valid_ss58_address (wallet_ss58_address ):
2386
+ ss58_address = wallet_ss58_address
2387
+ else :
2388
+ wallet = self .wallet_ask (
2389
+ wallet_ss58_address ,
2390
+ wallet_path ,
2391
+ wallet_hotkey ,
2392
+ ask_for = [WO .NAME , WO .PATH ],
2393
+ validate = WV .WALLET ,
2394
+ )
2395
+ ss58_address = wallet .coldkeypub .ss58_address
2399
2396
2400
2397
if not scheduled_block :
2401
2398
block_input = Prompt .ask (
@@ -2406,14 +2403,11 @@ def wallet_check_ck_swap(
2406
2403
try :
2407
2404
scheduled_block = int (block_input )
2408
2405
except ValueError :
2409
- console .print (
2410
- "[red]Invalid block number. Skipping block check.[/red]"
2411
- )
2406
+ print_error ("Invalid block number" )
2407
+ raise typer .Exit ()
2412
2408
2413
2409
return self ._run_command (
2414
- wallets .check_swap_status (
2415
- self .subtensor , wallet .coldkeypub .ss58_address , scheduled_block
2416
- )
2410
+ wallets .check_swap_status (self .subtensor , ss58_address , scheduled_block )
2417
2411
)
2418
2412
2419
2413
def wallet_create_wallet (
0 commit comments