> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimism.io/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                                              |
| --------------------------------------------------- | -------------------------------------------------------- |
| **[hostedWalletProvider()](#hostedwalletprovider)** | Get direct access to the hosted wallet provider          |
| **[smartWalletProvider()](#smartwalletprovider)**   | Get direct access to the smart wallet provider           |
| **[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      |

#### `hostedWalletProvider()`

Get direct access to the hosted wallet provider

**Returns:** Promise resolving to the configured hosted wallet provider instance

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

***

#### `smartWalletProvider()`

Get direct access to the smart wallet provider

**Returns:** Promise resolving to the configured smart wallet provider instance

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

***

#### `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

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.4.0/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L120)</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.4.0/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L136)</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.4.0/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L151)</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

<sub>[<Icon icon="github" /> Source ↗](https://github.com/ethereum-optimism/actions/blob/@eth-optimism/actions-sdk@0.4.0/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L173)</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 |
| `swap`    | `WalletSwapNamespace` | Swap namespace with all swap 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.4.0/packages/sdk/src/wallet/core/wallets/abstract/Wallet.ts#L89)</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.4.0/packages/sdk/src/wallet/core/wallets/abstract/Wallet.ts#L150)</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.4.0/packages/sdk/src/wallet/core/wallets/abstract/Wallet.ts#L162)</sub>

***
