xyizko commited on
Commit
e099787
·
verified ·
1 Parent(s): c035890

Update app.py

Browse files

- fix mult iaddress

Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -38,7 +38,7 @@ def infer_chain(address, hf_token):
38
  def check_flagged_address(address: str, hf_token: str):
39
  """Check if a cryptocurrency address is flagged in the Bybit hack database."""
40
 
41
- # Normalize the input address (lowercase)
42
  normalized_address = address.strip().lower()
43
 
44
  # Infer the chain of the address
@@ -60,16 +60,16 @@ def check_flagged_address(address: str, hf_token: str):
60
 
61
  # Format the response
62
  if flagged:
63
- return f"Address {address} is Flagged ✅\nChain: {chain}\nStatus: Present in Bybit Blocked List"
64
  else:
65
- return f"Address {address} is Not Flagged ❌\nChain: {chain}\nStatus: Not present in Bybit Blocked List"
66
 
67
  # Function to handle multiple addresses input
68
  def handle_multiple_addresses(user_input, hf_token):
69
  """Process multiple addresses separated by commas."""
70
  results = []
71
 
72
- # Split input into multiple addresses
73
  addresses = [addr.strip() for addr in user_input.split(",")]
74
 
75
  # Process each address individually
@@ -110,8 +110,8 @@ def chat_with_agent(user_input, chat_history, hf_token):
110
  return chat_history, ""
111
 
112
  # Create the Gradio interface with tabs
113
- with gr.Blocks(title="Bybit Blocked Address Check") as demo:
114
- gr.Markdown("# Bybit Blocked Address Check")
115
 
116
  with gr.Tabs():
117
  # Tab 1: Address Checker UI
 
38
  def check_flagged_address(address: str, hf_token: str):
39
  """Check if a cryptocurrency address is flagged in the Bybit hack database."""
40
 
41
+ # Normalize the input address (lowercase and stripped of whitespace)
42
  normalized_address = address.strip().lower()
43
 
44
  # Infer the chain of the address
 
60
 
61
  # Format the response
62
  if flagged:
63
+ return f"Address {address} is Flagged ✅\nChain: {chain}\nStatus: Present in Bybit hack database"
64
  else:
65
+ return f"Address {address} is Not Flagged ❌\nChain: {chain}\nStatus: Not present in Bybit hack database"
66
 
67
  # Function to handle multiple addresses input
68
  def handle_multiple_addresses(user_input, hf_token):
69
  """Process multiple addresses separated by commas."""
70
  results = []
71
 
72
+ # Split input into multiple addresses by commas and strip any whitespace
73
  addresses = [addr.strip() for addr in user_input.split(",")]
74
 
75
  # Process each address individually
 
110
  return chat_history, ""
111
 
112
  # Create the Gradio interface with tabs
113
+ with gr.Blocks(title="Bybit Hack Address Checker") as demo:
114
+ gr.Markdown("# Bybit Hack Address Checker")
115
 
116
  with gr.Tabs():
117
  # Tab 1: Address Checker UI