Skip to content

feat(sdk): add outcome market reads#51

Merged
sumfxn merged 1 commit into
mainfrom
feat/outcome-market-reads-v2
May 10, 2026
Merged

feat(sdk): add outcome market reads#51
sumfxn merged 1 commit into
mainfrom
feat/outcome-market-reads-v2

Conversation

@sumfxn
Copy link
Copy Markdown
Owner

@sumfxn sumfxn commented May 10, 2026

What

Track 2 of docs/roadmap.md. Adds experimental read-only outcome market support to the SDK:

  • kit.listOutcomeMarkets()
  • kit.getOutcomeMarket({ outcome })
  • kit.getOutcomeBook({ outcome, side, nSigFigs? })
  • kit.getOutcomeMids()
  • exported outcome helpers/types for encoded #<encoding> side coins and asset ids
  • InfoClient.outcomeMeta() with runtime validation

Safety

  • Read-only only: no outcome order placement, cancel, or write path.
  • Outcome support is documented as experimental.
  • Docs do not claim USDH settlement/denomination beyond exposing current Hyperliquid outcome metadata/books.
  • Outcome ids are clamped so encoded coin ids and asset ids remain safe JS integers.
  • Malformed outcomeMeta, malformed questions, malformed side specs, invalid sides, unsafe ids, and invalid books reject with typed SDK errors.

Tests

Local after rebasing on #52:

  • pnpm install --frozen-lockfile --ignore-scripts
  • pnpm lint
  • pnpm build
  • pnpm typecheck
  • pnpm test
  • git diff --check
  • pnpm changeset status --since=origin/main
    • SDK minor
    • widget patch
    • no major releases

Live read-only probes:

  • mainnet outcomeMeta() validates
  • testnet outcomeMeta() validates
  • mainnet/testnet getOutcomeBook() returns valid L2 book shapes
  • getOutcomeMids() returns only #... outcome keys
  • invalid outcome ids/sides reject before transport
  • nonexistent outcome books reject as NetworkError

Release

No npm release from this PR. The release workflow is gated behind RELEASES_ENABLED == 'true', and the generated release output still needs manual audit before any publish.

@sumfxn sumfxn force-pushed the feat/outcome-market-reads-v2 branch from 68d15b2 to 8fe4e1e Compare May 10, 2026 18:09
@sumfxn sumfxn merged commit ebb0029 into main May 10, 2026
4 checks passed
@sumfxn sumfxn deleted the feat/outcome-market-reads-v2 branch May 10, 2026 18:12
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