<VersionWarning version="0.1" />

# signerToSimpleSmartAccount

Creates a SimpleAccount instance controlled by a `SmartAccountSigner`.

## Usage

:::code-group
```ts [example.ts]
import { signerToSimpleSmartAccount } from "permissionless/accounts"
import { publicClient } from "./publicClient"
import { signer } from "./signer"

const simpleAccount = await signerToSimpleSmartAccount(publicClient, {
    signer,
    factoryAddress: "0x9406Cc6185a346906296840746125a0E44976454",
    entryPoint: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
})
```

```ts [publicClient.ts]
import { createPublicClient, http } from "viem"

export const publicClient = createPublicClient({
	transport: http("https://sepolia.rpc.thirdweb.com"),
})
```

```ts [signer.ts]
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"

const privateKey = generatePrivateKey()

export const signer = privateKeyToAccount(privateKey)
```
:::

## Returns

* **Type:** `SimpleSmartAccount`

The smart account instance.

## Parameters

### signer

* **Type:** `SmartAccountSigner`

The signer that will be used to sign messages and user operations.

### factoryAddress

* **Type:** `Address`

The address of the simple account factory that will be used to deploy the smart account.

:::info
The canonical simple account factory for v0.6 of the EntryPoint is `0x9406Cc6185a346906296840746125a0E44976454`
:::

### entryPoint

* **Type:** `Address`

The address of the EntryPoint contract.

### index (optional)

* **Type:** `bigint`

It represents salt nonce that will be used to deploy the smart account. If not provided, `0` will be used.

### address (optional)

* **Type:** `Address`

:::warning
If you provide an address, the smart account can not be deployed. This should be used if you want to interact with an existing smart account.
:::

The address of the smart account. If not provided, the determinstic smart account address will be used.
