feat(dao): wire 8 dao_* MCP tools (Phase 1)
Tools added to WalletService:
DAO management (filesystem-only, no chain calls):
- dao_register — save a DaoConfig under \$ALDABRA_DATA/daos/<name>.json
- dao_list — show all registered DAO names + active marker
- dao_use — set active DAO; subsequent dao_* calls without
explicit `dao` arg target this one
- dao_remove — delete config; clears active if it was the active one
- dao_show — render full DaoConfig JSON for audit
DAO live-state reads (Koios-backed, decoded into typed Rust):
- dao_governor_state — singleton governor UTxO + thresholds + timing
+ nextProposalId + per-stake proposal cap
- dao_stake_list — all stakes for the DAO (filtered to gov-token
policy so the shared MLabs stakes addr doesn't
leak other DAOs into output). Renders pkh,
amount, locks, delegation per stake.
- dao_my_stake — filters dao_stake_list to just THIS wallet's
stake (matches wallet pkh against StakeDatum.owner).
Empty array if not staked yet.
Plumbing:
- WalletService::new gains data_dir param (for DaoStore root)
- WalletInner gains dao_store + dao_reader fields
- wallet_pkh() helper extracts the wallet's payment-credential hash from
bech32 for owner-match in dao_my_stake
- get_info() instructions advertise the new dao_* surface
- aldabra-mcp/Cargo.toml: aldabra-dao path dep + hex + pallas-addresses
This commit is contained in:
parent
0f5676dda7
commit
173abb9322
3 changed files with 344 additions and 2 deletions
|
|
@ -20,6 +20,15 @@ path = "src/main.rs"
|
|||
[dependencies]
|
||||
aldabra-core = { path = "../aldabra-core" }
|
||||
aldabra-chain = { path = "../aldabra-chain" }
|
||||
aldabra-dao = { path = "../aldabra-dao" }
|
||||
|
||||
# Used directly in tools.rs to decode the wallet's bech32 address into a
|
||||
# payment-credential hash (so `dao_my_stake` can match against StakeDatum.owner).
|
||||
# Comes in transitively via aldabra-core too; declared here for clarity.
|
||||
pallas-addresses = { workspace = true }
|
||||
|
||||
# `hex::encode` for rendering pkh/script-hash bytes in dao_* JSON output.
|
||||
hex = "0.4"
|
||||
|
||||
tokio = { workspace = true }
|
||||
anyhow = { workspace = true }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue