Skip to content

feat(hypecli): add HIP-4 outcome commands - #78

Merged
ifdario merged 1 commit into
mainfrom
outcome-commands
Jul 15, 2026
Merged

feat(hypecli): add HIP-4 outcome commands#78
ifdario merged 1 commit into
mainfrom
outcome-commands

Conversation

@ifdario

@ifdario ifdario commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Adds a new hypecli outcome command group for HIP-4 outcome tokens:

  • outcome list [--chain]: prints outcomes (ID, name, sides, description) and questions (ID, name, outcome IDs, settled IDs, fallback) from the outcomeMeta info endpoint, so users can discover the integer IDs the write commands need.
  • outcome split --outcome --amount: split the quote token into one share of each side.
  • outcome merge --outcome [--amount]: merge matching shares back into the quote token; omitting --amount merges the maximum available.
  • outcome merge-question --question [--amount]: merge a full set of mutually-exclusive outcomes within a question.
  • outcome negate --question --outcome --amount: convert shares of one outcome into the complementary basket.

Write commands reuse the shared SignerArgs and follow the vault.rs pattern (find_signer_sync + HttpClient + NonceHandler), passing None for vault_address/expires_after like the other write commands. Since userOutcome is an L1 agent-signed action, agent (API wallet) keys work out of the box; this is now documented in --agent-help and the --private-key flag help.

Verified: clean build, no new clippy warnings, help output for all subcommands, and outcome list against live mainnet and testnet. Write paths are thin wrappers over the SDK methods exercised by examples/hypercore/split_merge_outcome.rs; not yet exercised with a funded key from the CLI.

@ifdario
ifdario merged commit fd378b8 into main Jul 15, 2026
1 check passed
@ifdario
ifdario deleted the outcome-commands branch July 15, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant