Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.outcome.xyz/llms.txt

Use this file to discover all available pages before exploring further.

The SDK is published to npm as @outcome.xyz/hip4. It ships with full TypeScript types, supports both ESM and CommonJS, and has no runtime dependencies beyond your own project’s dependencies.

Install

pnpm add @outcome.xyz/hip4
Current version: 1.0.0-beta

Entry points

The package exposes two entry points:
Entry pointUse when
@outcome.xyz/hip4Importing the adapter, utility functions, and types in the same file
@outcome.xyz/hip4/typesImporting types only, without pulling in any runtime code
// Main entry - adapter, utilities, and types
import { createHIP4Adapter, formatPrice, getMinShares } from "@outcome.xyz/hip4";
import type { DefaultBinaryMarket, PredictionOrderResult } from "@outcome.xyz/hip4";

// Types-only entry - useful in shared type packages or when tree-shaking matters
import type { HIP4Market, MarketType } from "@outcome.xyz/hip4/types";

TypeScript requirements

The SDK targets ES2020 and uses features such as optional chaining, nullish coalescing, and BigInt. Strict mode is recommended:
tsconfig.json
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true
  }
}
The SDK has zero runtime dependencies. Installing it will not add any third-party packages to your node_modules.

Module format support

The package ships both ESM (.js) and CommonJS (.cjs) builds. Your bundler or runtime will pick the right format automatically based on your project’s "type" field and import syntax. No additional configuration is required.