# Account Adapters

The SDK requires two types of blockchain connections:

## Public Providers

[Public providers](https://docs.manifold.xyz/client-sdk/sdk/public-provider-adapters) enable read-only blockchain operations like fetching balances, estimating gas, and reading contracts. They are **required** when initializing the Manifold Client.

* [Viem Public Provider](https://docs.manifold.xyz/client-sdk/sdk/public-provider-adapters/viem) - For Viem users
* [Ethers v5 Public Provider](https://docs.manifold.xyz/client-sdk/sdk/public-provider-adapters/ethersv5) - For Ethers v5 users

## Account Adapters

An [account](https://docs.manifold.xyz/client-sdk/reference/account) is required to execute on-chain transactions.\
Both [**purchase**](https://docs.manifold.xyz/client-sdk/sdk/product/common/purchase) and [**execute**](https://docs.manifold.xyz/client-sdk/sdk/transaction-steps/execute) operations require an account, as they involve triggering transactions on the user's behalf.\
The SDK provides convenient methods for creating an account using popular Web3 libraries:

* [**Viem**](https://docs.manifold.xyz/client-sdk/sdk/account-adapters/viem) - Modern, TypeScript-first library
* [**Ethers v5**](https://docs.manifold.xyz/client-sdk/sdk/account-adapters/ethersv5) - Popular, battle-tested library

## Quick Start

```typescript
import { createClient, createPublicProviderViem, createAccountViem } from '@manifoldxyz/client-sdk';
import { createPublicClient, createWalletClient, http } from 'viem';
import { mainnet } from 'viem/chains';

// 1. Create public provider for blockchain reads
const publicClient = createPublicClient({
  chain: mainnet,
  transport: http('YOUR_RPC_URL')
});
const publicProvider = createPublicProviderViem({ 1: publicClient });

// 2. Initialize Manifold client
const client = createClient({ publicProvider });

// 3. Create account for transactions (when needed)
const walletClient = createWalletClient({ /* ... */ });
const account = createAccountViem({ walletClient });
```
