Overview
The framework-agnostic TypeScript SDK for the Yo yield protocol. Use it in any environment — Node.js, serverless functions, scripts, or the browser.
What's Inside
YoClient
Main entry point — wraps reads, actions, and API calls in a single interface
Vault reads
On-chain state queries: vault state, balances, allowances, conversion previews
Actions
Transaction builders: deposit via gateway, request withdrawal, redeem, approve
API client
REST client for off-chain data: snapshots, APY/TVL timeseries, user history
Constants
Vault addresses, chain configs, contract ABIs
Architecture
YoClient (entry point)
├── publicClient (viem) — On-chain reads
├── walletClient (viem) — Transaction signing
└── apiClient (fetch) — REST API callsThe client is initialized with a chainId and optional viem clients. If no publicClient is provided, one is created automatically via http() transport.
Quick Example
import { createYoClient, VAULTS } from '@yo-protocol/core'
// 1 — Create a client targeting Base
const client = createYoClient({ chainId: 8453 })
// 2 — Read on-chain vault state
const state = await client.getVaultState(VAULTS.yoETH.address)
console.log(state.name, state.totalAssets)
// 3 — Fetch off-chain snapshot (TVL, APY, pools)
const snapshot = await client.getVaultSnapshot(VAULTS.yoETH.address)
console.log(`APY: ${snapshot.apy}%`, `TVL: $${snapshot.tvl}`)Chains
Ethereum
1
Supported
Base
8453
Supported
Next Steps
Client — Creating and configuring YoClient
Vault Reads — Querying on-chain vault state
Actions — Building deposit, withdraw, and approve transactions
API Client — Fetching snapshots, timeseries, and user history
Constants — Vault addresses and chain configs
Types — Full type reference