import { type Address } from "viem"; import type { Metadata, MidnightAuthorizationAction, Transaction } from "../../types/index.js"; /** Parameters for encoding a direct Midnight `setIsAuthorized` call. */ export interface MidnightSetIsAuthorizedParams { readonly chainId: number; readonly authorized: Address; readonly onBehalf: Address; readonly isAuthorized?: boolean; readonly metadata?: Metadata; } /** * Encodes `Midnight.setIsAuthorized` for a bundle spender or ratifier. * * Prefer requirement helpers or entity `getRequirements()` in app flows; they * read `isAuthorized` first and return this transaction only when needed. Use * this builder directly when the caller intentionally wants to set or revoke * authorization without reading state. * * @param params.chainId - Chain id used to resolve `Midnight`. * @param params.authorized - Supported operator receiving authorization, or any operator losing authorization. * @param params.onBehalf - Owner whose authorization mapping is updated. * @param params.isAuthorized - Optional target state; defaults to `true`. * @param params.metadata - Optional analytics metadata appended to calldata. * @returns A deep-frozen `Transaction` targeting `Midnight`. * @throws {UnsupportedMidnightAuthorizationTargetError} when granting authorization to an unsupported operator. * @example * ```ts * import { midnightSetIsAuthorized } from "@morpho-org/morpho-sdk"; * * const tx = midnightSetIsAuthorized({ * chainId: 8453, * authorized: midnightBundles, * onBehalf: user, * }); * ``` */ export declare const midnightSetIsAuthorized: (params: MidnightSetIsAuthorizedParams) => Readonly>;