Files
aitbc/cli/commands/staking.py
aitbc 149fbb0abe
Some checks failed
CLI Tests / test-cli (push) Failing after 11s
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 10s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 2m38s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Node Failover Simulation / failover-test (push) Successful in 2s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 27s
Security Scanning / security-scan (push) Has been cancelled
Package Tests / Python package - aitbc-core (push) Successful in 13s
Package Tests / Python package - aitbc-crypto (push) Successful in 9s
Package Tests / Python package - aitbc-sdk (push) Successful in 11s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 27s
Python Tests / test-python (push) Failing after 1m25s
Delegate Click commands to click_cli and add agent subcommands
- Route Click commands (agent, ipfs, oracle, etc.) to click_cli module
- Add zk, knowledge, bounty, dispute subcommands to agent group
- Add AI test submission, power trading, and reputation commands
- Add cross-chain transfer and listing commands
- Add monitor start/stop/status/alerts commands
- Add swarm create/discover/add/distribute/status commands
- Update main() to check command type and delegate appropriately
- Fix genesis CLI
2026-05-08 10:43:53 +02:00

42 lines
1.1 KiB
Python

"""Staking commands for AITBC CLI"""
import click
import json
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": []
})