Some checks failed
CLI Tests / test-cli (push) Has started running
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s
Deploy to Testnet / deploy-testnet (push) Successful in 1m9s
Documentation Validation / validate-docs (push) Failing after 9s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Multi-Node Stress Testing / stress-test (push) Successful in 3s
Node Failover Simulation / failover-test (push) Successful in 2s
Security Scanning / security-scan (push) Successful in 29s
- Update all command module docstrings to consistent format ending with "for AITBC CLI" - Remove unused imports (json, httpx, pydantic) from multiple command modules - Reorder imports to group utils imports together - Change sys.path in click_cli.py from /opt/aitbc to /opt/aitbc/cli - Fix relative imports in cross_chain.py and ipfs.py to use .config
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
"""Staking and validator management commands for AITBC CLI"""
|
|
|
|
import click
|
|
from utils import output, error, success, warning
|
|
|
|
|
|
@click.group()
|
|
def staking():
|
|
"""Staking and validator management commands"""
|
|
pass
|
|
|
|
|
|
@staking.command()
|
|
@click.option("--action", required=True, type=click.Choice(["add-stake", "remove-stake", "delegate", "undelegate"]), help="Staking action")
|
|
@click.option("--amount", type=float, help="Amount to stake/unstake")
|
|
@click.option("--validator-id", help="Validator ID")
|
|
@click.option("--wallet", help="Wallet address")
|
|
def manage(action: str, amount: float, validator_id: str, wallet: str):
|
|
"""Manage staking operations"""
|
|
import uuid
|
|
output({
|
|
"stake_id": f"stake_{uuid.uuid4().hex[:16]}",
|
|
"action": action,
|
|
"amount": amount or 0.0,
|
|
"validator_id": validator_id or "",
|
|
"wallet": wallet or "",
|
|
"status": "completed"
|
|
})
|
|
|
|
|
|
@staking.command()
|
|
@click.option("--wallet", help="Wallet address")
|
|
def status(wallet: str):
|
|
"""Get staking status"""
|
|
output({
|
|
"wallet": wallet or "",
|
|
"total_staked": 0.0,
|
|
"rewards": 0.0,
|
|
"validators": []
|
|
})
|