> For the complete documentation index, see [llms.txt](https://docs.yo.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yo.xyz/integrations/integration-guides/sdk/core/types.md).

# Types

All TypeScript types exported from `@yo-protocol/core`.

## Client Config

```ts
interface YoClientConfig {
  chainId: SupportedChainId  // 1 | 8453
  publicClient?: PublicClient
  walletClient?: WalletClient
  partnerId?: number          // Gateway partner attribution ID (default: 0)
}
```

## Vault Types

```ts
interface VaultState {
  address: Address
  name: string
  symbol: string
  decimals: number
  totalAssets: bigint
  totalSupply: bigint
  asset: Address
  assetDecimals: number
  exchangeRate: bigint
}

interface VaultConfig {
  address: Address
  name: string
  symbol: VaultId
  underlying: {
    symbol: string
    decimals: number
    address: Record<number, Address>
  }
  chains: readonly number[]
}

type VaultId = 'yoETH' | 'yoBTC' | 'yoUSD' | 'yoEUR' | 'yoGOLD' | 'yoUSDT'
```

## User Types

```ts
interface UserVaultPosition {
  shares: bigint
  assets: bigint
}

interface TokenBalance {
  token: Address
  balance: bigint
  decimals: number
}

interface TokenAllowance {
  token: Address
  owner: Address
  spender: Address
  allowance: bigint
}
```

## Action Results

```ts
interface DepositResult {
  hash: Hash
  shares: bigint
}

interface RedeemResult {
  hash: Hash
  assets: bigint
}

interface ApproveResult {
  hash: Hash
}

interface DepositWithApprovalResult {
  approveHash?: Hash    // undefined if approval wasn't needed
  depositHash: Hash
  shares: bigint
}

interface RedeemReceipt {
  hash: Hash
  status: 'success' | 'reverted'
  instant: boolean               // true if redeemed instantly
  assetsOrRequestId: bigint      // assets returned or pending request ID
  shares: bigint
  blockNumber: bigint
}

interface TransactionReceipt {
  hash: Hash
  status: 'success' | 'reverted'
  blockNumber: bigint
  gasUsed: bigint
}

interface PreparedTransaction {
  to: Address
  data: Hex
  value: bigint
}
```

## Action Params

```ts
interface DepositParams {
  vault: Address
  amount: bigint
  recipient?: Address
  minShares?: bigint
}

interface RedeemParams {
  vault: Address
  shares: bigint
  recipient?: Address
  minAssetsOut?: bigint
  slippageBps?: number
}
```

## API Types

```ts
type Network = 'base' | 'ethereum' | 'unichain' | 'arbitrum' | 'tac' | 'plasma' | 'hyperevm'

interface FormattedValue {
  raw: number | string
  formatted: string
}

interface VaultSnapshot {
  address: string
  name: string
  symbol: string
  tvl: FormattedValue
  apy: number
  underlying: { address: string; symbol: string; decimals: number }
  pools?: { name: string; allocation: number; apy: number }[]
}

interface TimeseriesPoint {
  timestamp: number
  value: number
}

interface UserHistoryItem {
  type: 'deposit' | 'withdraw' | 'redeem'
  timestamp: number
  assets: FormattedValue
  shares: FormattedValue
  txHash: string
}

interface UserPoints {
  totalPoints: number
  rank?: number
  activities?: { type: string; points: number; timestamp: number }[]
}

interface PendingRedeem {
  assets?: FormattedValue
  shares?: FormattedValue
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yo.xyz/integrations/integration-guides/sdk/core/types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
