> ## Documentation Index
> Fetch the complete documentation index at: https://optimism-373f39ad-feat-swap-documentation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallet Documentation

> API reference for Actions SDK wallet classes, functions, and parameters.

{/*
⚠️ WARNING: DO NOT EDIT THIS FILE DIRECTLY ⚠️

This file is auto-generated from the Actions SDK source code.

To update this documentation:
1. Bump the SDK version in package.json: pnpm add @eth-optimism/actions-sdk@latest
2. Run the generation script: pnpm prebuild

Any manual edits will be overwritten on the next generation.
*/}

## WalletNamespace

Wallet namespace that provides unified wallet operations

### Methods

| Function                                      | Description                                              |
| --------------------------------------------- | -------------------------------------------------------- |
| **[createSmartWallet()](#createsmartwallet)** | Create a new smart wallet                                |
| **[createSigner()](#createsigner)**           | Create a viem LocalAccount signer from the hosted wallet |
| **[toActionsWallet()](#toactionswallet)**     | Convert a hosted wallet to an Actions wallet             |
| **[getSmartWallet()](#getsmartwallet)**       | Get an existing smart wallet with a provided signer      |

#### `createSmartWallet()`

Create a new smart wallet

| Parameter                   | Type                       | Description                                                                                                       |
| --------------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `params`                    | `CreateSmartWalletOptions` | Smart wallet creation parameters                                                                                  |
| `params.signer`             | `LocalAccount`             | Primary local account used for signing transactions                                                               |
| `params.signers`            | `Signer[]`                 | Optional array of additional signers for the smart wallet                                                         |
| `params.nonce`              | `bigint`                   | Optional nonce for smart wallet address generation (defaults to 0)                                                |
| `params.deploymentChainIds` | `SupportedChainId[]`       | Optional chain IDs to deploy the wallet to. If not provided, the wallet will be deployed to all supported chains. |

**Returns:** Promise resolving to deployment result containing:

* `wallet`: The created SmartWallet instance
* `deployments`: Array of deployment results with chainId, receipt, success flag, and error

**Throws:** Error if signer is not included in the signers array

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.1.0/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L72)</sub>

***

#### `createSigner()`

Create a viem LocalAccount signer from the hosted wallet

| Parameter | Type                                 | Description                  |
| --------- | ------------------------------------ | ---------------------------- |
| `params`  | `TToActionsMap[THostedProviderType]` | Configuration for the signer |

**Returns:** Promise resolving to a viem `LocalAccount` with the hosted wallet as the signer backend

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.1.0/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L87)</sub>

***

#### `toActionsWallet()`

Convert a hosted wallet to an Actions wallet

| Parameter         | Type                                 | Description                                                    |
| ----------------- | ------------------------------------ | -------------------------------------------------------------- |
| `params`          | `TToActionsMap[THostedProviderType]` | Parameters for converting a hosted wallet to an Actions wallet |
| `params.walletId` |                                      | Unique identifier for the hosted wallet                        |
| `params.address`  |                                      | Ethereum address of the hosted wallet                          |

**Returns:** Promise resolving to the Actions wallet instance

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.1.0/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L101)</sub>

***

#### `getSmartWallet()`

Get an existing smart wallet with a provided signer

| Parameter                  | Type                    | Description                                                        |
| -------------------------- | ----------------------- | ------------------------------------------------------------------ |
| `params`                   | `GetSmartWalletOptions` | Wallet retrieval parameters                                        |
| `params.signer`            | `LocalAccount`          | Local account to use for signing transactions on the smart wallet  |
| `params.signers`           | `Signer[]`              | Optional array of additional signers for the smart wallet          |
| `params.deploymentSigners` | `Signer[]`              | Optional array of signers used during wallet deployment            |
| `params.walletAddress`     | `Address`               | Optional explicit smart wallet address (skips address calculation) |
| `params.nonce`             | `bigint`                | Optional nonce used during smart wallet creation                   |

**Returns:** Promise resolving to the smart wallet instance with the provided signer

**Throws:** Error if neither walletAddress nor deploymentSigners provided

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.1.0/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L122)</sub>

***

{/*
⚠️ WARNING: DO NOT EDIT THIS FILE DIRECTLY ⚠️

This file is auto-generated from the Actions SDK source code.

To update this documentation:
1. Bump the SDK version in package.json: pnpm add @eth-optimism/actions-sdk@latest
2. Run the generation script: pnpm prebuild

Any manual edits will be overwritten on the next generation.
*/}

## Wallet

Base actions wallet class

### Namespaces

| Namespace | Type                  | Description                                |
| --------- | --------------------- | ------------------------------------------ |
| `lend`    | `WalletLendNamespace` | Lend namespace with all lending operations |

### Properties

| Property  | Type           | Description                            |
| --------- | -------------- | -------------------------------------- |
| `address` | `Address`      | Get the address of this actions wallet |
| `signer`  | `LocalAccount` | Get a signer for this actions wallet   |

### Methods

| Function                        | Description                                            |
| ------------------------------- | ------------------------------------------------------ |
| **[getBalance()](#getbalance)** | Get asset balances across all supported chains         |
| **[send()](#send)**             | Send a transaction using this actions wallet           |
| **[sendBatch()](#sendbatch)**   | Send a batch of transactions using this actions wallet |

#### `getBalance()`

Get asset balances across all supported chains

**Returns:** Promise resolving to array of token balances with chain breakdown

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.1.0/packages/sdk/src/wallet/core/wallets/abstract/Wallet.ts#L80)</sub>

***

#### `send()`

Send a transaction using this actions wallet

| Parameter         | Type               | Description                     |
| ----------------- | ------------------ | ------------------------------- |
| `transactionData` | `TransactionData`  | The transaction data to execute |
| `chainId`         | `SupportedChainId` | Target blockchain chain ID      |

**Returns:** Promise resolving to the transaction hash

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.1.0/packages/sdk/src/wallet/core/wallets/abstract/Wallet.ts#L141)</sub>

***

#### `sendBatch()`

Send a batch of transactions using this actions wallet

| Parameter         | Type                | Description                     |
| ----------------- | ------------------- | ------------------------------- |
| `transactionData` | `TransactionData[]` | The transaction data to execute |
| `chainId`         | `SupportedChainId`  | Target blockchain chain ID      |

**Returns:** Promise resolving to the transaction hash

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.1.0/packages/sdk/src/wallet/core/wallets/abstract/Wallet.ts#L153)</sub>

***
