TypeScript SDK
context-markets wraps the Context API, signs EIP-712 orders, and exposes markets, orders, portfolio, account, and question-submission modules.
Install
The SDK requires Node.js 18+ and is published as
context-markets.Quick start
Read market data
Place an order
Onboard and fund
Modules
| Module | Purpose |
|---|---|
ctx.markets | Market lists, quotes, orderbooks, simulation, oracle data, activity |
ctx.orders | Limit orders, market orders, cancels, bulk operations, order queries |
ctx.portfolio | Portfolio summaries, positions, balances, settlement balances, stats |
ctx.account | Setup, deposits, withdrawals, approvals, gasless flows, complete sets |
ctx.questions | Question submission, polling, and market-creation workflows |
ctx.migration | Migration status, fund transfers, order restoration (V1 → V2) |
Top-level exports
Pricing conventions
| Value | Format | Example |
|---|---|---|
| Prices | Cents | 45 = 45 cents |
| Sizes | Contracts | 10 = 10 shares |
| Outcomes | String literals | "yes" or "no" |
yes = 1 and no = 0.
Networks
The SDK defaults to Base mainnet and resolves the right addresses fromchain.
- Mainnet
- Testnet
Settlement:
0x00000000008c286A2aaa99c6Be3b3D405A929500Holdings: 0x0000000000CcA5bC44912C63d63e1673FeE923f6USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913Best practices
Signer setup, pagination, error handling, and gotchas
API reference
Exact method signatures, return types, and key exports