2525async def set_claim_type (
2626 wallet : Wallet ,
2727 subtensor : "SubtensorInterface" ,
28+ claim_type : Optional [str ] = None ,
2829 prompt : bool = True ,
2930 json_output : bool = False ,
3031) -> tuple [bool , str , Optional [str ]]:
@@ -38,6 +39,7 @@ async def set_claim_type(
3839 Args:
3940 wallet: Bittensor wallet object
4041 subtensor: SubtensorInterface object
42+ claim_type: Optional claim type ("Keep" or "Swap"). If None, user will be prompted.
4143 prompt: Whether to prompt for user confirmation
4244 json_output: Whether to output JSON
4345
@@ -76,9 +78,13 @@ async def set_claim_type(
7678 wallet .coldkeypub .ss58_address , f"[yellow]{ current_type } [/yellow]"
7779 )
7880 console .print (claim_table )
79- new_type = Prompt .ask (
80- "Select new root claim type" , choices = ["Swap" , "Keep" ], default = current_type
81- )
81+
82+ if claim_type is not None :
83+ new_type = claim_type
84+ else :
85+ new_type = Prompt .ask (
86+ "Select new root claim type" , choices = ["Swap" , "Keep" ], default = current_type
87+ )
8288 if new_type == current_type :
8389 msg = f"Root claim type is already set to '{ current_type } '. No change needed."
8490 console .print (f"[yellow]{ msg } [/yellow]" )
0 commit comments