Fix CLI wallet balance to query blockchain database and add RPC account endpoint
This commit is contained in:
@@ -673,7 +673,7 @@ def get_balance(wallet_name: str, rpc_url: str = DEFAULT_RPC_URL) -> Optional[Di
|
||||
address = wallet_data["address"]
|
||||
|
||||
# Get account info from RPC
|
||||
response = requests.get(f"{rpc_url}/rpc/accounts/{address}")
|
||||
response = requests.get(f"{rpc_url}/rpc/account/{address}?chain_id=ait-testnet")
|
||||
if response.status_code == 200:
|
||||
account_info = response.json()
|
||||
return {
|
||||
|
||||
@@ -966,7 +966,7 @@ def balance(ctx, address, chain_id, all_chains):
|
||||
for chain in chains:
|
||||
try:
|
||||
response = client.get(
|
||||
f"{_get_node_endpoint(ctx)}/rpc/getBalance/{address}?chain_id={chain}",
|
||||
f"{_get_node_endpoint(ctx)}/rpc/account/{address}?chain_id={chain}",
|
||||
timeout=5
|
||||
)
|
||||
if response.status_code == 200:
|
||||
|
||||
@@ -240,7 +240,6 @@ def ollama_task(ctx, gpu_id: str, model: str, prompt: str, temperature: float, m
|
||||
else:
|
||||
error(f"Failed to submit Ollama task: {response.status_code} {response.text}")
|
||||
except Exception as e:
|
||||
error(f"Ollama task submission failed: {e}")
|
||||
|
||||
|
||||
@gpu.command(name="pay")
|
||||
|
||||
Reference in New Issue
Block a user