import { Address, Chain, Transport, Hex } from 'viem'; import { T as ThemeConfig, S as SponsorshipConfig, W as WebAuthnSignature } from './types-BN6cCuAd.mjs'; /** * Configuration for creating a passkey-enabled WalletClient */ interface PasskeyWalletClientConfig { /** User's smart account address — the sole signer identity. */ accountAddress: Address; /** Base URL of the auth API (defaults to https://passkey.1auth.app) */ providerUrl?: string; /** Client identifier for this application */ clientId: string; /** Optional URL of the dialog UI */ dialogUrl?: string; /** Theme configuration for the signing dialog */ theme?: ThemeConfig; /** * Control whether the 1auth signing review iframe is hidden. * * Blind signing is the SDK default. Set `blind_signing: false` to opt this * wallet-client factory into 1auth's visible review UI globally; individual * methods still use the internal OneAuthClient defaults. */ blind_signing?: boolean; /** When true, operate on testnet chains only. Default: false */ testnets?: boolean; /** Chain configuration */ chain: Chain; /** Transport (e.g., http(), webSocket()) */ transport: Transport; /** Wait for a transaction hash before resolving send calls. */ waitForHash?: boolean; /** Maximum time to wait for a transaction hash in ms. */ hashTimeoutMs?: number; /** Poll interval for transaction hash in ms. */ hashIntervalMs?: number; /** Sponsorship configuration for app-sponsored intents */ sponsorship?: SponsorshipConfig; } /** * A single call in a batch transaction */ interface TransactionCall { /** Target contract address */ to: Address; /** Calldata to send */ data?: Hex; /** Value in wei to send */ value?: bigint; /** Optional label for the transaction review UI (e.g., "Swap ETH for USDC") */ label?: string; /** Optional sublabel for additional context (e.g., "1 ETH → 2,500 USDC") */ sublabel?: string; /** * Optional icon shown in the sign dialog's action card. Falls back to the * built-in token icon if 1auth can resolve one for this call. SVG / square * PNG URL, or a `data:image/svg+xml,...` URL. */ icon?: string; /** * Optional ABI for unverified human-readable decoding of `data` in the * sign dialog. App-supplied — rendered with an "Unverified" badge. * Decoding is best-effort; failures are silently dropped. */ abi?: readonly unknown[]; } /** * Parameters for sendCalls (batched transactions) */ interface SendCallsParams { /** Array of calls to execute */ calls: TransactionCall[]; /** Optional chain id override */ chainId?: number; /** Optional token requests for orchestrator output (what tokens/amounts to deliver) */ tokenRequests?: { token: string; amount: bigint; }[]; /** Constrain which tokens the orchestrator can use as input/payment */ sourceAssets?: string[]; /** Which chain to look for source assets on */ sourceChainId?: number; } /** * Encode a WebAuthn signature for ERC-1271 verification on-chain * * @param sig - The WebAuthn signature from the passkey * @returns ABI-encoded signature bytes */ declare function encodeWebAuthnSignature(sig: WebAuthnSignature): Hex; /** * Hash an array of transaction calls for signing * * @param calls - Array of transaction calls * @returns keccak256 hash of the encoded calls */ declare function hashCalls(calls: TransactionCall[]): Hex; /** * @file Chain and token registry for the 1auth SDK. * * Wraps `@rhinestone/shared-configs` chain/token data and combines it with * viem's chain definitions to expose a filtered, testnet-aware registry. * Consumers can look up supported chains and tokens, resolve token addresses * by symbol, and retrieve chain metadata such as explorer URLs and default RPC * endpoints. * * Testnet inclusion is controlled by the `includeTestnets` option on each * function or, as a project-wide default, by the environment variables * `NEXT_PUBLIC_ORCHESTRATOR_USE_TESTNETS` or `ORCHESTRATOR_USE_TESTNETS`. */ type TokenConfig = { symbol: string; address: Address; decimals: number; }; type ChainFilterOptions = { includeTestnets?: boolean; chainIds?: number[]; }; declare function getSupportedChainIds(options?: ChainFilterOptions): number[]; declare function getSupportedChains(options?: ChainFilterOptions): Chain[]; declare function getAllSupportedChainsAndTokens(options?: ChainFilterOptions): Array<{ chainId: number; tokens: TokenConfig[]; }>; declare function getChainById(chainId: number): Chain; declare function getChainExplorerUrl(chainId: number): string | undefined; declare function getChainRpcUrl(chainId: number): string | undefined; declare function getSupportedTokens(chainId: number): TokenConfig[]; declare function getSupportedTokenSymbols(chainId: number): string[]; declare function getTokenAddress(symbolOrAddress: string, chainId: number): Address; declare function getTokenDecimals(symbolOrAddress: string, chainId: number): number; declare function resolveTokenAddress(token: string, chainId: number): Address; declare function isTestnet(chainId: number): boolean; declare function getTokenSymbol(tokenAddress: Address, chainId: number): string; declare function isTokenAddressSupported(tokenAddress: Address, chainId: number): boolean; /** * The EIP-191 prefix used for personal message signing. * This is the standard Ethereum message prefix for `personal_sign`. */ declare const ETHEREUM_MESSAGE_PREFIX = "\u0019Ethereum Signed Message:\n"; /** * Hash a message with the EIP-191 Ethereum prefix. * * This is the same hashing function used by the passkey sign dialog. * Use this to verify that the `signedHash` returned from `signMessage()` * matches your original message. * * Format: keccak256("\x19Ethereum Signed Message:\n" + len + message) * * @example * ```typescript * const message = "Sign in to MyApp\nTimestamp: 1234567890"; * const result = await client.signMessage({ accountAddress: '0x...', message }); * * // Verify the hash matches * const expectedHash = hashMessage(message); * if (result.signedHash === expectedHash) { * console.log('Hash matches - signature is for this message'); * } * ``` */ declare function hashMessage(message: string): `0x${string}`; /** * Verify that a signedHash matches the expected message. * * This is a convenience wrapper around `hashMessage()` that returns * a boolean. For full cryptographic verification of the P256 signature, * use on-chain verification via the WebAuthn.sol contract. * * @example * ```typescript * const result = await client.signMessage({ accountAddress: '0x...', message }); * * if (result.success && verifyMessageHash(message, result.signedHash)) { * // The signature is for this exact message * // For full verification, verify the P256 signature on-chain or server-side * } * ``` */ declare function verifyMessageHash(message: string, signedHash: string | undefined): boolean; export { type ChainFilterOptions as C, ETHEREUM_MESSAGE_PREFIX as E, type PasskeyWalletClientConfig as P, type SendCallsParams as S, type TransactionCall as T, getSupportedChains as a, getAllSupportedChainsAndTokens as b, getSupportedTokens as c, getSupportedTokenSymbols as d, encodeWebAuthnSignature as e, getChainById as f, getSupportedChainIds as g, hashCalls as h, getChainExplorerUrl as i, getChainRpcUrl as j, isTestnet as k, getTokenAddress as l, getTokenSymbol as m, getTokenDecimals as n, isTokenAddressSupported as o, type TokenConfig as p, hashMessage as q, resolveTokenAddress as r, verifyMessageHash as v };