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

## 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 or local account 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.8.1/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L119)</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.8.1/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L136)</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.8.1/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L158)</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.8.1/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L174)</sub>

***

#### `toActionsWallet()`

Convert a hosted wallet or local account to an Actions wallet

| Parameter | Type                                                       | Description                            |
| --------- | ---------------------------------------------------------- | -------------------------------------- |
| `params`  | `ToActionsWalletParam<THostedProviderType, TToActionsMap>` | Provider params or a viem LocalAccount |

**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.8.1/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L190)</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.8.1/packages/sdk/src/wallet/core/namespace/WalletNamespace.ts#L223)</sub>

***

## Wallet

Base actions wallet class

### Namespaces

| Namespace | Type                    | Description                                 |
| --------- | ----------------------- | ------------------------------------------- |
| `lend`    | `WalletLendNamespace`   | Lend namespace with all lending operations  |
| `borrow`  | `WalletBorrowNamespace` | Borrow namespace with all borrow 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                                                                                                                                                                     |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **[has()](#has)**               | Check whether a wallet namespace (`lend`, `swap`, `borrow`) is configured on this wallet. Useful for callers that branch on capability instead of catching a `TypeError` later. |
| **[getBalance()](#getbalance)** | Get asset balances across the requested chains (or all supported chains).                                                                                                       |
| **[send()](#send)**             | Send a transaction using this actions wallet                                                                                                                                    |
| **[sendBatch()](#sendbatch)**   | Send a batch of transactions using this actions wallet                                                                                                                          |

#### `has()`

Check whether a wallet namespace (`lend`, `swap`, `borrow`) is
configured on this wallet. Useful for callers that branch on
capability instead of catching a `TypeError` later.

| Parameter   | Type         | Description                     |
| ----------- | ------------ | ------------------------------- |
| `namespace` | `ActionName` | Wallet namespace name to probe. |

**Returns:** `true` when the namespace is configured.

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

***

#### `getBalance()`

Get asset balances across the requested chains (or all supported chains).

| Parameter | Type                  | Description                |
| --------- | --------------------- | -------------------------- |
| `options` | `BalanceFetchOptions` | Optional `chainIds` filter |

**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.8.1/packages/sdk/src/wallet/core/wallets/abstract/Wallet.ts#L121)</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.8.1/packages/sdk/src/wallet/core/wallets/abstract/Wallet.ts#L183)</sub>

***

#### `sendBatch()`

Send a batch of transactions using this actions wallet

| Parameter         | Type                         | Description                     |
| ----------------- | ---------------------------- | ------------------------------- |
| `transactionData` | `readonly 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.8.1/packages/sdk/src/wallet/core/wallets/abstract/Wallet.ts#L195)</sub>

***
