> ## Documentation Index
> Fetch the complete documentation index at: https://docs.faremeter.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallet Setup

> Create and fund wallets for Solana devnet and EVM testnet development.

Before using faremeter, you need a wallet with funds on the network you plan to use. This guide covers creating wallets and funding them for development.

## Solana

### Creating a wallet

<Steps>
  <Step title="Install Solana CLI">
    ```bash theme={null}
    sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
    ```
  </Step>

  <Step title="Create a new keypair">
    ```bash theme={null}
    solana-keygen new --outfile ~/.config/solana/id.json
    ```

    Save the output address — you'll need it for funding.
  </Step>

  <Step title="Secure your keypair">
    Never commit keypair files to version control. Add them to your `.gitignore`:

    ```
    id.json
    *-keypair.json
    ```
  </Step>
</Steps>

If you already have a Solana wallet (Phantom, Solflare, etc.), export your private key and convert it to the keypair JSON format.

<Warning>
  Never share your private key or keypair file. Anyone with access can control your funds.
</Warning>

### Funding on devnet

Devnet tokens are free. Your wallet needs SOL for transaction fees and USDC for payments.

```bash theme={null}
# Airdrop SOL (free on devnet)
solana airdrop 2 --keypair ~/.config/solana/id.json --url devnet

# Verify balance
solana balance --keypair ~/.config/solana/id.json --url devnet
```

For devnet USDC, use the [SPL Token Faucet](https://spl-token-faucet.com/) or the Solana devnet faucet.

### Funding on mainnet

For production use, your wallet needs:

1. **SOL** — For transaction fees (\~0.000005 SOL per transaction). Purchase from an exchange (Coinbase, Kraken, etc.) and transfer to your wallet address. Start with 0.05–0.1 SOL.
2. **USDC** — For payments. Ensure you purchase **Solana USDC** (mint: `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`), not Ethereum USDC.

```bash theme={null}
# Verify SOL balance
solana balance --keypair ~/.config/solana/id.json

# Verify USDC balance
spl-token balance EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --owner ~/.config/solana/id.json
```

<Note>
  Start small. Begin with 1–10 USDC to test before funding larger amounts.
</Note>

## EVM

### Creating a wallet

Generate an EVM private key using any of these methods:

```bash theme={null}
# Using openssl
openssl rand -hex 32
```

Or use a wallet like MetaMask and export the private key. The key should be a 64-character hex string (prefix with `0x` in your `.env`).

### Funding on Base Sepolia

Base Sepolia is the recommended EVM testnet. You need:

1. **Sepolia ETH** — For gas fees. Use the [Base Sepolia Faucet](https://www.coinbase.com/faucets/base-ethereum-sepolia-faucet) or bridge from Sepolia ETH.
2. **Testnet USDC** — For payments. Available from faucets or bridging.

### EVM network identifiers

| Network      | Identifier     | Chain ID |
| ------------ | -------------- | -------- |
| Base         | `base`         | 8453     |
| Base Sepolia | `base-sepolia` | 84532    |

When configuring an EVM wallet, you pass the chain ID and name:

```typescript theme={null}
import { createLocalWallet } from "@faremeter/wallet-evm"

const wallet = await createLocalWallet(
  { id: 84532, name: "base-sepolia" },
  process.env.EVM_PRIVATE_KEY,
)
```

See [Networks & Assets](/concepts/networks-and-assets) for the full list of supported EVM networks.

## OWS (Open Wallet Standard)

If you prefer vault-backed key management over raw keypair files, you can use Open Wallet Standard. OWS encrypts private keys at rest and never exposes them to your application -- useful for production agents and shared environments.

### Installing OWS

```bash theme={null}
pnpm add @open-wallet-standard/core
```

### Importing an existing key

Import a Solana or EVM key into the OWS vault:

```typescript theme={null}
import { importWalletPrivateKey } from "@open-wallet-standard/core"

// Solana -- privateKeyHex is the 32-byte secret key as hex
importWalletPrivateKey("my-solana-wallet", privateKeyHex, "my-passphrase", undefined, "solana")

// EVM -- privateKeyHex is the 32-byte private key as hex (without 0x prefix)
importWalletPrivateKey("my-evm-wallet", privateKeyHex, "my-passphrase", undefined, "eip155")
```

The wallet name and passphrase are used later when creating a faremeter wallet adapter. See [Wallet Configuration](/client/wallet-configuration#ows-open-wallet-standard) for the next step.

<Note>
  OWS wallets use the same underlying keys as local keypairs. Funding instructions are identical -- see the Solana and EVM sections above.
</Note>

## Environment variables

Create a `.env` file in your project root:

```bash .env theme={null}
# Solana keypair file path
PAYER_KEYPAIR_PATH=$HOME/.config/solana/id.json

# EVM private key (hex string with 0x prefix)
EVM_PRIVATE_KEY=0x...

# Merchant addresses (for server-side)
MERCHANT_ADDRESS=7xKXwxRPMo2sUAT5...
EVM_MERCHANT_ADDRESS=0x1234...
```

Load it in your application:

```typescript theme={null}
import "dotenv/config"
```

### Security best practices

<Warning>
  * Never commit `.env` files to version control
  * Never expose keypairs in logs or error messages
  * Use different wallets for development and production
</Warning>

Add to your `.gitignore`:

```
.env
.env.*
client-wallet.json
```

## Next steps

* [Wallet Configuration](/client/wallet-configuration) — Code setup for each wallet adapter.
* [Quick Start](/quickstart) — Make your first payment.
* [Networks & Assets](/concepts/networks-and-assets) — Supported networks and tokens.
