Skip to main content

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.

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

Configuration

Bundler

Pass a bundler config when initialising the SDK:
const rhinestone = new RhinestoneSDK({
  apiKey: rhinestoneApiKey,
  bundler: {
    type: 'pimlico',
    apiKey: pimlicoApiKey,
  },
})

Paymaster

Optionally add a paymaster to sponsor gas on UserOperations:
const rhinestone = new RhinestoneSDK({
  apiKey: rhinestoneApiKey,
  bundler: { type: 'pimlico', apiKey: pimlicoApiKey },
  paymaster: { type: 'pimlico', apiKey: pimlicoApiKey },
})
Need support for another ERC-4337 provider? Open an issue.

Usage

ERC-4337 has a separate transaction API. Use it when a module requires the user-op flow — intent flows continue to use prepareTransaction.
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)