Skip to content

Viem

After instantiating the SDK (which is explained here), you’re allowed to use the following methods from viem.

void

Promise<LocalAccount> (see LocalAccount)

const user = await sdk.viem.toLocalAccount()

CurrentUserToLightSmartAccountParams object containing:

Promise<LightSmartAccount> (see LocalAccount)

import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
const client = createPublicClient({
chain: mainnet,
transport: http('YOUR_RPC_URL'),
})
const smartAccount = await sdk.viem.toSmartAccount({
owner: localAccount, // from `toLocalAccount()`
client,
})

void

Promise<PaymasterClient> (see PaymasterClient)

import { PaymasterClient } from 'viem/account-abstraction'
const paymasterClient: PaymasterClient = await sdk.viem.getPaymasterClient()