← ClaudeAtlas

yo-protocol-react-sdklisted

ALWAYS use this skill when the user is working with React components or hooks that interact with Yo Protocol vaults, or imports from `@yo-protocol/react`. This skill covers the full React SDK: YieldProvider setup, query hooks (useVaultState, useVaultSnapshot, useUserPosition, useTokenBalance, useShareBalance, useAllowance, useMerklRewards, useLeaderboard, usePrices, etc.), action hooks (useDeposit, useRedeem, useApprove, useClaimMerklRewards), and migration from the old API (useVault→useVaultState, useUserBalance→useUserPosition, inputToken→token, account→owner, partnerId string→number, publicClient→publicClients). Trigger whenever the user mentions yo protocol React hooks, vault dashboard components, deposit/redeem UI flows, YieldProvider, useYoClient, @yo-protocol/react, yo-kit, or asks to build React components for yoETH, yoUSD, yoBTC, yoEUR, yoGOLD, or yoUSDT vaults. Also trigger when the user has broken imports or API changes after upgrading @yo-protocol/react. Do NOT use for CLI shell commands (use yo-p
yoprotocol/yo-protocol-skills · ★ 1 · Web & Frontend · score 71
Install: claude install-skill yoprotocol/yo-protocol-skills
Official Yo Protocol skill. Canonical repository: https://github.com/yoprotocol/yo-protocol-skills # @yo-protocol/react SDK ## Architecture Three layers: 1. **Provider** — `YieldProvider` wraps app, provides config. `useYoClient()` creates `YoClient` from `@yo-protocol/core` 1. **Query hooks** (32) — Read data via `useQuery` + `client.getX()`. Return `{ data, isLoading, isError, error, refetch }` 1. **Action hooks** (4) — Mutate via `client.prepareX()` + wagmi `sendTransactionAsync()`. Return `{ mutate, step, hash, reset }` Core only prepares transactions (`PreparedTransaction { to, data, value }`). React sends them via wagmi. No `walletClient` needed. ## Quick Start ```tsx // Provider setup <WagmiProvider config={wagmiConfig}> <QueryClientProvider client={queryClient}> <YieldProvider partnerId={9999} defaultSlippageBps={50}> <App /> </YieldProvider> </QueryClientProvider> </WagmiProvider> // Read vault state const { vaultState } = useVaultState("yoUSD") // Read user position const { position } = useUserPosition("yoUSD") // auto-uses connected wallet // Deposit with auto-approval and chain switching const { deposit, step } = useDeposit({ vault: "yoUSD", slippageBps: 50 }) await deposit({ token: usdcAddress, amount: 1_000_000n, chainId: 8453 }) // Redeem with auto-approval const { redeem, instant, assetsOrRequestId } = useRedeem({ vault: "yoUSD" }) await redeem(500_000n) ``` ## Migration When encountering code using the old API, consult [referenc