Skip to main content
Useful as an account owner when signing happens elsewhere (e.g. a server-held session signer), so the SDK can read from the account without holding a key.

Import

import { toViewOnlyAccount } from '@rhinestone/sdk/utils'

Usage

import { toViewOnlyAccount } from '@rhinestone/sdk/utils'

const account = await sdk.createAccount({
  owners: { type: 'ecdsa', accounts: [toViewOnlyAccount(userAddress)] },
})

Parameters

address
`0x${string}`
required
Address to wrap

Returns

account
Account
A viem account that can be read from but not signed with