Viem
After instantiating the SDK (which is explained here), you’re allowed to use the following methods from viem.
toLocalAccount()
Section titled “toLocalAccount()”Parameters
Section titled “Parameters”void
Returns
Section titled “Returns”Promise<LocalAccount> (see LocalAccount)
Example
Section titled “Example”const user = await sdk.viem.toLocalAccount()toSmartAccount()
Section titled “toSmartAccount()”Parameters
Section titled “Parameters”CurrentUserToLightSmartAccountParams object containing:
owner:LocalAccountclient:Client
Returns
Section titled “Returns”Promise<LightSmartAccount> (see LocalAccount)
Example
Section titled “Example”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,})getPaymasterClient()
Section titled “getPaymasterClient()”Parameters
Section titled “Parameters”void
Returns
Section titled “Returns”Promise<PaymasterClient> (see PaymasterClient)
Example
Section titled “Example”import { PaymasterClient } from 'viem/account-abstraction'
const paymasterClient: PaymasterClient = await sdk.viem.getPaymasterClient()