Changelog
SDK v2.3.0 - Domain-Level Primitives & V1 Removal
Major release that consolidates ~100 protocol-specific primitives into 33 domain-level primitives, removes the V1 compatibility layer, adds new type guards and utility functions, and eliminates the SSH key requirement for installation.
Changed: BREAKING: Primitives consolidated into domain categories. Protocol-specific primitives (e.g., AaveBorrowPrimitive, CompoundSupplyPrimitive) replaced by domain-level primitives (e.g., LendingBorrowPrimitive, LendingDepositPrimitive, PerpOpenPrimitive, StakingStakePrimitive, VaultDepositPrimitive). The Primitive union now contains 33 domain-level types instead of ~100 protocol-specific types. Each primitive uses a protocol field to identify the underlying venue.
Changed: BREAKING: Primitive constants and category helpers renamed to match the new domain model (e.g., PRIMITIVE_SUPPLY → PRIMITIVE_LENDING_DEPOSIT, PRIMITIVE_BORROW → PRIMITIVE_LENDING_BORROW, PRIMITIVE_STAKE → PRIMITIVE_STAKING_STAKE, PRIMITIVE_OPEN_POSITION → PRIMITIVE_PERP_OPEN, TYDRO_PRIMITIVES → VAULT_PRIMITIVES, LIQUIDITY_PRIMITIVES → PENDLE_PRIMITIVES)
Changed: BREAKING: Type guard functions renamed to match new primitives (e.g., isSupplyPrimitive() → isLendingDepositPrimitive(), isBorrowPrimitive() → isLendingBorrowPrimitive(), isStakePrimitive() → isStakingStakePrimitive(), isOpenPositionPrimitive() → isPerpOpenPrimitive()). isMintPrimitive(), isBurnPrimitive(), isRestakePrimitive(), and isApprovePrimitive() removed.
Changed: Installation no longer requires SSH key configuration. The contract types dependency is now distributed as a standard npm package.
Removed: BREAKING: V1 compatibility layer removed. The v1-to-v2 translation layer (translateBlock, translatePrimitive, translateStreamEvent, assembleChatCreateResponse) and V1 Zod schemas (V1BlockSchema, V1StreamEventSchema, etc.) are no longer available.
Removed: InterestRateMode type removed — now encapsulated within LendingBorrowParams and LendingRepayParams
Removed: V1 types and schemas: All v1 block schemas, stream types, and response types removed. The SDK exclusively uses v2 types.
Added: Primitive type guards for the full domain model — one per primitive type across lending, staking, perp, vault, and Pendle categories (e.g., isLendingBorrowPrimitive(), isPerpOpenPrimitive(), isVaultDepositPrimitive())
Added: Category arrays: PERP_PRIMITIVES, VAULT_PRIMITIVES, PENDLE_PRIMITIVES join the existing LENDING_PRIMITIVES, STAKING_PRIMITIVES, TRADING_PRIMITIVES, TRANSFER_PRIMITIVES
Added: extractFormBlocks() utility for extracting form blocks from a response, complementing extractActionBlocks(), extractTableBlocks(), etc.
Added: isFormBlock() type guard for narrowing a Block to FormBlock
Added: isAgentMessage(), isBlock(), and isBlockMessage() message type guards for narrowing ChaosSDKMessage variants at runtime
Added: BlockTypeCounts and RiskLevel types now exported for use in custom block analysis
SDK v2.3.2 - Streaming Connection Timeout Fix
Fixes an issue where streaming connections could hang indefinitely when the server was unreachable. Adds a 10-second connection timeout for initial TCP establishment, separate from the request-level timeout.
Fixed: Streaming connections could hang indefinitely: Added a 10-second connection timeout for initial TCP establishment, separate from the existing request-level timeout. Previously, if the server was unreachable, the SDK would wait the full request timeout (default 2 minutes) before failing. Now connection failures surface within 10 seconds while long-running streams remain unaffected.
SDK v2.0.0 - New Protocols & API Improvements
Major release with new protocol support, API path improvements, conversation serialization, and renamed block type guards for consistency. Adds Compound, Nado, Uniswap, Yieldbasis, and Tydro protocols. The API path changes from chat.create() to chat.responses.create().
Added: Compound protocol primitives: compound_borrow, compound_repay, compound_supply, compound_withdraw, compound_deposit
Added: Nado protocol primitives: nado_open_long, nado_open_short, nado_close_position, nado_increase_position, nado_decrease_position, nado_deposit, nado_withdraw, nado_set_leverage, nado_spot_swap
Added: Uniswap protocol primitive: uniswap_swap
Added: Yieldbasis protocol primitives: yieldbasis_deposit, yieldbasis_withdraw, yieldbasis_stake, yieldbasis_unstake, yieldbasis_claim_rewards
Added: Tydro protocol primitives: tydro_deposit, tydro_withdraw, tydro_borrow, tydro_repay
Added: Morpho repay primitive: morpho_repay
Added: Conversation serialization: toJSON() and Conversation.fromJSON() for persisting and restoring conversation state
Added: Conversation.fork() method to create a new conversation with the same history but a new session ID
Added: Conversation message manipulation: addUserMessage(), addAssistantMessage(), addSystemMessage(), clearHistory()
Added: Conversation.sessionId getter for accessing the current session ID
Added: isErrorBlock() type guard for ErrorBlock
Added: extractChartBlocks() helper for extracting all chart blocks (pie, bar, timeseries)
Added: Block statistics helpers: hasBlocks(), hasBlockType(), countBlocksByType()
Added: Zod validation schemas exported for all types
Added: Client methods: cancel() for cancelling in-flight requests, reset() for resetting client state
Changed: BREAKING: API path changed from chaos.create() to chaos.chat.responses.create()
Changed: BREAKING: isActionBlock() renamed to isTransactionActionBlock()
Changed: BREAKING: isAlertBlock() renamed to isInfoBlock()
Changed: BREAKING: extractActionBlocks() renamed to extractTransactionBlocks()
Changed: BREAKING: extractAlertBlocks() renamed to extractInfoBlocks()
Changed: BREAKING: findActionsByPrimitive() renamed to findTransactionsByPrimitive()
Changed: BREAKING: conversation.history renamed to conversation.messages
SDK v1.0.0 - Stable Release
The first stable release of the Chaos AI SDK for TypeScript. This release includes breaking changes from 0.x, adds 21 typed DeFi primitives, multi-wallet support, native HTTP streaming, the Conversation class, and comprehensive helper functions. See the migration guide for upgrading from 0.x.
Added: Multi-wallet support: Use wallets[] array in metadata for cross-chain portfolio queries (Ethereum, Base, Arbitrum, Optimism, Polygon, Solana, and more)
Added: 21 DeFi primitive types with typed parameters: swap, bridge, supply, withdraw, borrow, repay, stake, unstake, claim, restake, add_liquidity, remove_liquidity, deposit, open_position, close_position, mint, burn, approve, transfer, wrap, unwrap
Added: Primitive categories: ALL_PRIMITIVES, LENDING_PRIMITIVES, TRADING_PRIMITIVES, STAKING_PRIMITIVES, LIQUIDITY_PRIMITIVES, TRANSFER_PRIMITIVES
Added: Type guards for all 21 primitives: isSwapPrimitive(), isBridgePrimitive(), isSupplyPrimitive(), and more
Added: Conversation class for multi-turn dialog management with automatic history tracking
Added: Native HTTP streaming with useNativeHttp config option (enabled by default)
Added: InfoBlock and CodeBlock types for informational and code content
Added: Typed streaming messages as discriminated union with type-safe content access
Added: Block extraction helpers: extractTableBlocks(), extractChartBlocks(), extractTransactionBlocks(), extractMarkdownBlocks(), extractInteractiveBlocks(), extractInfoBlocks(), extractCodeBlocks()
Added: Block search functions: findTableByTitle(), findChartByTitle(), findTransactionsByPrimitive()
Added: Primitive extraction: extractPrimitives(), extractPrimitivesByType(), getPrimitiveTypes()
Added: Table utilities: tableToObjects(), getTableColumn(), findTableRow(), getTableDimensions()
Added: Chart utilities: getChartData(), getChartTotal(), getChartPercentages()
Added: Risk utilities: getAllWarnings(), getAllBlockers(), getHighestRiskLevel()
Added: Block statistics: countBlocksByType(), hasBlocks(), hasBlockType()
Added: Stream parsing: parseStreamLine(), parseStreamLines()
Added: Zod validation schemas for all types
Changed: BREAKING: API method changed from chat.create() to chat.responses.create()
Changed: BREAKING: Removed wallet_id from RequestMetadata - use wallets[] array instead
Changed: BREAKING: Block type field values aligned with backend (e.g., TransactionActionBlock uses type='action' with blockType='transaction_action')
Changed: BREAKING: ChartBlock split into PieChartBlock (chartType='pie') and TimeseriesChartBlock (chartType='timeseries')
Changed: BREAKING: TableBlock field changed from rows to tableRows
Changed: BREAKING: Risks.blockers and Risks.warnings changed from string[] to RiskInfoItem[]
Changed: Model constants updated: WALLET_MODEL='WALLET_MODEL', ASK_MODEL='ASK_MODEL'
Removed: Removed useLegacyFormat option
Removed: Removed previous_messages parameter - conversation history is managed via session_id