/**
 * Wallet material factory.
 *
 * Resolves a WalletSessions row into the WalletMaterial shape that
 * TransactionSubmitter and the provider bundle consume:
 *   - looks up the active session and decrypts its viewing key
 *   - derives a deterministic accountId + private-state storage password from
 *     the viewing key, so the same key maps to the same encrypted state across
 *     reconnects
 *   - builds a wallet adapter sized to what the session carries: a real
 *     signing-capable adapter when an encryptedSeedKey is present, otherwise a
 *     read-only adapter whose signing methods throw.
 */
import { type WalletFacadeBuildArgs } from './wallet-facade-builder';
import type { WalletMaterial, PrivateStateBackend } from '../midnight/providers';
export declare class SessionNotFoundError extends Error {
    constructor(sessionId: string);
}
/**
 * Thrown by the wallet adapter's signing/balancing methods when the session
 * carries a viewing key only. Not thrown by `buildWalletMaterialForSession`
 * itself, which returns successfully and lets the SDK call surface the error
 * through TransactionSubmitter's classification.
 */
export declare class WalletSigningNotAvailable extends Error {
    constructor(method: string);
}
export declare class WalletMaterialUnavailable extends Error {
    constructor(reason: string);
}
export interface BuildWalletMaterialOptions {
    sessionId: string;
    privateStateBackend?: PrivateStateBackend;
    /** Test seam; defaults to cds.connect.to('db'). */
    db?: any;
    /** Test seam; defaults to the process-scoped key from srv/utils/crypto.ts. */
    encryptionKey?: Buffer;
    /**
     * Optional facade-build configuration. When provided AND the session
     * carries an encryptedSeedKey, the wallet adapter wires through a real
     * WalletFacade and balanceTx/submitTx work. When omitted, the adapter
     * returns real pubkeys from the seed but balanceTx/submitTx throw.
     */
    facadeConfig?: Omit<WalletFacadeBuildArgs, 'seedHex'>;
}
/**
 * Returns a fully-typed `WalletMaterial`. The wallet adapter's signing
 * methods throw `WalletSigningNotAvailable`; deterministic identifiers
 * (accountId) and the storage password work.
 */
export declare function buildWalletMaterialForSession(opts: BuildWalletMaterialOptions): Promise<WalletMaterial>;
/**
 * `accountId` is opaque storage scope; it just needs to be deterministic per
 * viewing key. We use HMAC-SHA256 with a domain-separation label and hex-encode.
 * 64 chars is well within the 200-char DB column.
 */
export declare function deriveAccountId(viewingKey: string): string;
/**
 * Storage password for the CAP-DB private state provider. 64-char hex
 * (= 256 bits of entropy), well over the 16-char minimum. Distinct
 * domain-separation label from the accountId so the two values cannot collide.
 */
export declare function deriveStoragePassword(viewingKey: string): string;
