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

# API Reference

> Commands and responses for iframe communication

# API Reference

## Commands (Sent to Iframe)

### ADD\_WALLETS

Adds wallets to the whitelist.

```typescript theme={null}
interface AddWalletsMessage {
  type: 'ADD_WALLETS';
  wallets: (string | Wallet)[];
}
```

**Wallet Formats:**

* String: `"ABCD"` or `"ABCD:Label"`
* Object: `{ address: "ABCD", label: "Label" }`

**Example:**

```typescript theme={null}
// Using string format
sendMessage({
  type: 'ADD_WALLETS',
  wallets: ['XYZ1:DeFi Protocol', 'XYZ2:Market Maker', 'XYZ3']
});

// Using object format
sendMessage({
  type: 'ADD_WALLETS',
  wallets: [
    { address: 'ABCD', label: 'Whale Trader' },
    { address: 'EFGH', label: 'Smart Money' },
    { address: '1234' }
  ]
});
```

### CLEAR\_WALLETS

Removes all iframe-added wallets from the whitelist.

```typescript theme={null}
interface ClearWalletsMessage {
  type: 'CLEAR_WALLETS';
}
```

**Example:**

```typescript theme={null}
sendMessage({ type: 'CLEAR_WALLETS' });
```

### GET\_WALLETS

Retrieves current whitelist.

```typescript theme={null}
interface GetWalletsMessage {
  type: 'GET_WALLETS';
}
```

**Example:**

```typescript theme={null}
sendMessage({ type: 'GET_WALLETS' });
```

## Responses (Received from Iframe)

| Response Type             | Description                                            |
| ------------------------- | ------------------------------------------------------ |
| `IFRAME_READY`            | Sent when iframe is loaded and ready for communication |
| `WALLETS_ADDED`           | Confirms wallets were added successfully               |
| `WALLETS_CLEARED`         | Confirms iframe wallets were cleared                   |
| `CURRENT_WALLETS`         | Returns current whitelist data                         |
| `WHITELIST_TRADING_STATS` | Real-time trading statistics for whitelisted addresses |
| `SOL_PRICE_UPDATE`        | Real-time SOL price updates                            |
| `WHITELIST_TRADE`         | Individual trade events from whitelisted addresses     |
| `TOKEN_PRICE_UPDATE`      | Token price updates from all trading activity          |
