TypeScript SDK

One typed source preview for Omni data, x402, MCP, and agent examples.

The public SDK source includes typed clients, validation, bounded retries, settlement checks, no-spend live tests, and runnable examples for research, Coinbase Advanced Trade, and Robinhood Crypto. It is intentionally source-first until the npm release is published.

At a glance

x402
9 methods Every paid HTTP product has a validated client method and receipt check.
MCP
5 tools One free catalog plus four paid research tools through Streamable HTTP.
Examples
7 commands REST, two WebSockets, x402, MCP, Coinbase, and Robinhood, plus a shared research helper.

Why It Matters

What traders and researchers should take away

  • Typed methods reduce route, parameter, and schema mistakes before a payment or downstream decision.
  • The public-boundary tests make it explicit which calls use Omni and which call Hyperliquid directly.
  • Broker examples demonstrate a safe research/execution split instead of handing order authority to a data seller.

How it works

What the product uses behind the scenes

  • Node.js 20 or newer is required by the package; the root Omni web application uses its own Node version policy.
  • OmniClient covers keyed REST, OmniWebSocketClient covers ticketed AI News, and HyperliquidPublicClient/HyperliquidWebSocketClient call public Hyperliquid directly.
  • OmniX402Client validates inputs before payment and verifies service/schema discriminants plus PAYMENT-RESPONSE after settlement.
  • OmniMcpClient denies paid calls by default and requires an approvePayment callback in addition to the independent per-call cap.

Notes

Things to know

  • npm install @omni-terminal/sdk will not work until registry publication; use the repository package today.
  • test:live is no-spend, but RUN_PAID_EXAMPLES=true authorizes the example purchase set when a funded EVM_PRIVATE_KEY is present.
  • Broker examples require broker credentials even in dry-run where an authenticated preview or signed payload is produced.
  • LIVE_TRADING=true changes broker behavior and must remain absent during initial setup.

Install and verify the source preview

Build the exact package and examples currently reviewed in the public repository.

bash
git clone https://github.com/InTheta/omni-universe-sdks.git
cd omni-universe-sdks/packages/typescript
npm ci
npm run typecheck
npm test
npm run build
npm run test:boundary
npm run test:live
  • Copy .env.example to .env only when you are ready to add credentials locally.
  • The boundary check rejects private hosts and credentials embedded in the distributable package.
  • The live suite verifies public contracts and unpaid challenges without setting RUN_PAID_EXAMPLES.

Client map

Choose the narrow client that owns the resource you need.

  • HyperliquidPublicClient and HyperliquidWebSocketClient: direct public Hyperliquid instruments, candles, mids, trades, and books; no Omni key.
  • OmniClient and OmniWebSocketClient: Omni-owned AI News, Ask Omni, and ticketed public WebSocket products; Omni API key where documented.
  • OmniX402Client: nine pay-per-request HTTP products with official x402 v2 signing and receipt validation.
  • OmniMcpClient: free discovery and four paid native tools with application-owned payment approval.
  • CoinbaseAdvancedTradeClient and RobinhoodCryptoClient: optional broker adapters kept separate from Omni research.

Environment and spending controls

Start with no secrets, then add one authority at a time.

dotenv
OMNI_APP_URL=https://omniterminal.app
OMNI_MCP_URL=https://omniterminal.app/api/x402/mcp
X402_MAX_PAYMENT_USD=0.003
RUN_PAID_EXAMPLES=false
LIVE_TRADING=false

# Add only when deliberately testing paid research:
# EVM_PRIVATE_KEY=0x...

# Add broker credentials only for the matching broker example.
  • Use a dedicated low-balance EVM wallet for paid research, separate from broker and trading wallets.
  • Set RUN_PAID_EXAMPLES=true only for the command you intend to fund, then unset it.
  • The all-routes HTTP example buys nine results with a current list-price total of 0.016 USDC; the four paid native MCP tools total 0.006 USDC when each is called once.
  • X402_MAX_PAYMENT_USD caps each call, not the total process budget.

Runnable example index

Each example is committed next to the package it imports.

bash
npm run example:rest
npm run example:ws
npm run example:news-ws
npm run example:x402
npm run example:mcp
npm run example:coinbase
npm run example:robinhood
  • examples/x402-all-routes.ts and examples/mcp-all-tools.ts default to free/no-spend behavior.
  • examples/agents/research.ts lets both broker examples select x402 REST or native MCP research.
  • Coinbase performs authenticated preview before any live submission.
  • Robinhood dry-run returns the exact signed order payload without transmitting it.

References

Implementation references

  • SDK README

    https://github.com/InTheta/omni-universe-sdks/blob/main/packages/typescript/README.md

    Canonical source-preview installation, client map, examples, and verification commands.

  • SDK package manifest

    https://github.com/InTheta/omni-universe-sdks/blob/main/packages/typescript/package.json

    Defines package version, scripts, engines, exports, and locked dependencies.

  • SDK tests

    https://github.com/InTheta/omni-universe-sdks/tree/main/packages/typescript/test

    Covers inputs, response contracts, payment boundaries, MCP, WebSockets, and brokers.