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

# @atxp/base

> API reference for the @atxp/base package

## Overview

The `@atxp/base` package provides a `BaseAppAccount` implementation for using ATXP with Base Mini Apps. This package handles wallet management, spend permissions, and payment processing specifically for the Base ecosystem.

## Installation

```bash theme={null}
npm install @atxp/base
```

## BaseAppAccount

The main class for managing Base Mini App accounts with ATXP.

### Functions

#### initialize

```typescript theme={null}
initialize({
    walletAddress: string,
    apiKey: string,
    appName: string,
    allowance?: bigint,
    periodInDays?: number,
    useEphemeralWallet?: boolean
}): Promise<BaseAppAccount>
```

Creates and initializes a new BaseAppAccount instance for use with Base Mini Apps.

**Arguments**

<Expandable title="initialize arguments">
  <ParamField path="walletAddress" type="string" required>
    The user's wallet address from wagmi or similar wallet connection library.
  </ParamField>

  <ParamField path="apiKey" type="string" required>
    Base mini app API key from the [Coinbase Developer Platform](https://portal.cdp.coinbase.com/).
  </ParamField>

  <ParamField path="appName" type="string" required>
    Display name for your mini app, shown to users during permission flows.
  </ParamField>

  <ParamField path="allowance" type="bigint" optional>
    Maximum USDC amount the ephemeral wallet can spend on behalf of the user. Specified in wei (1 USDC = 10^6 wei).
  </ParamField>

  <ParamField path="periodInDays" type="number" optional>
    Duration in days for which the spend permission remains valid.
  </ParamField>

  <ParamField path="useEphemeralWallet" type="boolean" default="true">
    Whether to use ephemeral wallet mode. Set to `false` to use the user's main wallet directly (with degraded UX).
  </ParamField>

  <ParamField path="storage" type="IStorage<string>" optional>
    Storage mechanism to use for storing the account data in non-browser environments.
  </ParamField>
</Expandable>

**Returns**

<ResponseField name="BaseAppAccount" type="Promise<BaseAppAccount>">
  Returns a configured BaseAppAccount instance ready for use with ATXP clients.
</ResponseField>

#### clearAllStoredData

```typescript theme={null}
clearAllStoredData({
    userWalletAddress: string,
    storage?: IStorage<string>
}): Promise<void>
```

Clears all stored data for a specific wallet address.

**Arguments**

<Expandable title="clearAllStoredData arguments">
  <ParamField path="userWalletAddress" type="string" required>
    Wallet address to clear stored data for.
  </ParamField>
</Expandable>

**Returns**

<ResponseField name="void" type="Promise<void>">
  Returns a promise that resolves when the data has been cleared.
</ResponseField>
