import type { Account, Address, Hex } from 'viem'; import type { RhinestoneAccountConfig, RhinestoneConfig } from '../config/account.js'; import { walletClientToAccount, wrapParaAccount } from '../signing/signers/compatibility.js'; /** * Compute the v0 (legacy) initialization data for an account configuration. * * Use this to reconstruct the `initData` for an account originally created with * the Rhinestone SDK v0, then pass it back into `createAccount`. * @param config Account configuration * @returns The account address, factory, factory data, and whether the intent executor is installed * @example * ```ts * import { experimental_getV0InitData } from '@rhinestone/sdk/utils' * * const initData = experimental_getV0InitData({ * owners: { type: 'ecdsa', accounts: [owner] }, * }) * * const account = await sdk.createAccount({ * owners: { type: 'ecdsa', accounts: [owner] }, * initData, * }) * ``` */ declare function experimental_getV0InitData(config: RhinestoneAccountConfig): { address: Address; factory: Address; factoryData: Hex; intentExecutorInstalled: boolean; }; /** * Compute the Rhinestone initialization data for an account configuration. * * Use this to reconstruct the `initData` for an account originally created with * the Rhinestone SDK, then pass it back into `createAccount` instead of * providing the factory and factory data manually. * @param config Account configuration * @returns The account address, plus factory data when the account is not yet deployed * @example * ```ts * import { experimental_getRhinestoneInitData } from '@rhinestone/sdk/utils' * * const initData = experimental_getRhinestoneInitData({ * owners: { type: 'ecdsa', accounts: [owner] }, * }) * * const account = await sdk.createAccount({ * owners: { type: 'ecdsa', accounts: [owner] }, * initData, * }) * ``` */ declare function experimental_getRhinestoneInitData(config: RhinestoneAccountConfig): { address: Address; factory: Address; factoryData: Hex; intentExecutorInstalled: boolean; } | { address: Address; }; /** * Create a view-only viem `Account` for an address. Any signing operation throws. * * 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. * @param address Address to wrap * @returns A viem account that can be read from but not signed with * @example * ```ts * import { toViewOnlyAccount } from '@rhinestone/sdk/utils' * * const account = await sdk.createAccount({ * owners: { type: 'ecdsa', accounts: [toViewOnlyAccount(userAddress)] }, * }) * ``` */ declare function toViewOnlyAccount(address: Address): Account; /** * Compute the ERC-7579 module setup for an account configuration. * @param config Account and module configuration * @returns Validators, executors, hooks, and fallbacks to install */ declare function getSetup(config: RhinestoneConfig): import("../modules/legacy-core.js").ModeleSetup; export { experimental_getV0InitData, getSetup as experimental_getModuleSetup, experimental_getRhinestoneInitData, toViewOnlyAccount, walletClientToAccount, wrapParaAccount, }; //# sourceMappingURL=index.d.ts.map