> For the complete documentation index, see [llms.txt](https://pingpay.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pingpay.gitbook.io/docs/pingpay-cli/wallet.md).

# Wallet

Ping CLI integrates with [Frames](https://frames.ag/) to give your agent a crypto wallet it can use to send payments directly from the terminal.

> **Note:** Wallet payments currently support **USDC on Base** only.

### Create a wallet

Create a new AgentWallet with email verification:

```bash
ping-cli wallet create --email you@example.com
```

This sends a 6-digit OTP to your email. Enter it when prompted:

```
Verification code sent to you@example.com
Enter 6-digit code: 123456
```

You can also pass the OTP directly (useful for automation):

```bash
ping-cli wallet create --email you@example.com --otp 123456
```

**Output:**

```json
{
  "success": true,
  "username": "agent_a1b2c3",
  "evmAddress": "0x1234...abcd",
  "solanaAddress": "ABC...xyz",
  "fundingUrl": "https://frames.ag/u/agent_a1b2c3"
}
```

After creation, fund your wallet by visiting the `fundingUrl` or sending USDC on Base directly to your `evmAddress`.

#### Flags

| Flag      | Required | Description                                 |
| --------- | -------- | ------------------------------------------- |
| `--email` | Yes      | Email address for OTP verification          |
| `--otp`   | No       | 6-digit OTP code (skips interactive prompt) |

### Connect an existing wallet

If you already have an AgentWallet, connect it to Ping CLI:

```bash
ping-cli wallet connect \
  --token mf_your_token \
  --username agent_a1b2c3 \
  --evm-address 0x1234...abcd
```

If AgentWallet is already configured on your machine (`~/.agentwallet/config.json`), the CLI will auto-detect your credentials:

```bash
ping-cli wallet connect
```

The CLI validates your token by checking your balance before saving.

**Output:**

```json
{
  "success": true,
  "username": "agent_a1b2c3",
  "evmAddress": "0x1234...abcd"
}
```

#### Flags

| Flag            | Required | Description                      |
| --------------- | -------- | -------------------------------- |
| `--token`       | No       | AgentWallet API token (`mf_...`) |
| `--username`    | No       | AgentWallet username             |
| `--evm-address` | No       | EVM wallet address               |

All flags are optional if AgentWallet is already configured locally.

### Check balance

View your wallet balances across chains:

```bash
ping-cli wallet balance
```

**Output:**

```json
{
  "username": "agent_a1b2c3",
  "evmAddress": "0x1234...abcd",
  "solanaAddress": "ABC...xyz",
  "balances": [
    {
      "chain": "base",
      "asset": "USDC",
      "rawValue": "5000000",
      "decimals": 6,
      "displayValues": {
        "USDC": "5.0"
      }
    }
  ]
}
```

`rawValue` is the amount in smallest units (6 decimals for USDC, so `1000000` = 1 USDC).
