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

# ERC-4337

> Configure and use ERC-4337 with the Rhinestone SDK.

Rhinestone uses its own intent infrastructure for most transactions, but some modules require ERC-4337 UserOperations: [Social Recovery](./recovery) and legacy [Smart Sessions](../smart-sessions/overview). This guide covers how to configure and use ERC-4337 with the SDK.

## Configuration

### Bundler

Pass a `bundler` config when initialising the SDK:

<Tabs>
  <Tab title="Pimlico">
    ```ts theme={null}
    const rhinestone = new RhinestoneSDK({
      apiKey: rhinestoneApiKey,
      bundler: {
        type: 'pimlico',
        apiKey: pimlicoApiKey,
      },
    })
    ```
  </Tab>

  <Tab title="Biconomy">
    ```ts theme={null}
    const rhinestone = new RhinestoneSDK({
      apiKey: rhinestoneApiKey,
      bundler: {
        type: 'biconomy',
        apiKey: biconomyApiKey,
      },
    })
    ```
  </Tab>
</Tabs>

### Paymaster

Optionally add a `paymaster` to sponsor gas on UserOperations:

<Tabs>
  <Tab title="Pimlico">
    ```ts theme={null}
    const rhinestone = new RhinestoneSDK({
      apiKey: rhinestoneApiKey,
      bundler: { type: 'pimlico', apiKey: pimlicoApiKey },
      paymaster: { type: 'pimlico', apiKey: pimlicoApiKey },
    })
    ```
  </Tab>

  <Tab title="Biconomy">
    ```ts theme={null}
    const rhinestone = new RhinestoneSDK({
      apiKey: rhinestoneApiKey,
      bundler: { type: 'biconomy', apiKey: biconomyApiKey },
      paymaster: { type: 'biconomy', apiKey: biconomyApiKey },
    })
    ```
  </Tab>
</Tabs>

<Note>Need support for another ERC-4337 provider? [Open an issue](https://github.com/rhinestonewtf/sdk/issues).</Note>

## Usage

ERC-4337 has a separate transaction API. Use it when a module requires the user-op flow — intent flows continue to use `prepareTransaction`.

```ts theme={null}
const prepared = await rhinestoneAccount.prepareUserOperation({
  chain: base,
  calls: [
    {
      to: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045',
      value: 0n,
      data: '0xdeadbeef',
    },
  ],
})
const signed = await rhinestoneAccount.signUserOperation(prepared)
const result = await rhinestoneAccount.submitUserOperation(signed)

const status = await rhinestoneAccount.waitForExecution(result)
```
