Overview
What's Inside
Module
Purpose
Architecture
YoClient (entry point)
├── publicClient (viem) — On-chain reads
├── walletClient (viem) — Transaction signing
└── apiClient (fetch) — REST API callsQuick 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
Chain
Chain ID
Status