import type { InstrumentationConfig } from '../../services/instrumentation/instrumentation.types';
import type { LogLevel } from '../../services/logger';
import type { NetworkData } from '../../modules/wallets/networks/networkProvider/networkProvider.types';
import type { DynamicCoreConfig } from '../core/types';
/**
 * All available options to configure the Dynamic client.
 */
export type DynamicClientConfig = {
    /**
     * Whether to automatically initialize the client.
     *
     * If disabled, the client will be uninitialized and you will need to call
     * `initializeClient` with it manually.
     *
     * @defaultValue `true`
     */
    autoInitialize?: boolean;
    /**
     * Available options for internal configuration of the Dynamic SDK client.
     * Ignore unless you know what you are doing.
     */
    coreConfig?: DynamicCoreConfig;
    /**
     * The environment ID of the Dynamic app.
     */
    environmentId: string;
    /**
     * Configuration for SDK instrumentation (telemetry and observability).
     */
    instrumentation?: Partial<InstrumentationConfig>;
    /**
     * The log level to use for the logger.
     */
    logLevel?: LogLevel;
    /**
     * Metadata relating to your app.
     */
    metadata?: {
        /**
         * The URL of the icon of your app.
         */
        iconUrl?: string;
        /**
         * The name of your app.
         */
        name?: string;
        /**
         * Native deep link for your app (e.g., "myapp://").
         * Used for app-to-app communication on mobile devices.
         */
        nativeLink?: string;
        /**
         * The official domain/URL of your app (e.g., "https://myapp.com").
         *
         * This serves as both:
         * - The universal link for deep link redirects (web URLs that can intelligently route to either the app or web version)
         * - The official domain used in message signatures (appears as the `domain` and `uri` fields in sign-in messages)
         *
         * @defaultValue `window.location.origin` (in browser environments)
         */
        universalLink?: string;
    };
    /**
     * Callbacks that transform SDK data before use, applied centrally for consistency.
     *
     * @example
     * Override RPC URLs for specific networks:
     * ```typescript
     * createDynamicClient({
     *   environmentId: 'YOUR_ID',
     *   transformers: {
     *     networkData: (network) => {
     *       if (network.networkId === 'evm-1') {
     *         return {
     *           ...network,
     *           rpcUrls: { http: ['https://eth-mainnet.g.alchemy.com/v2/KEY'] },
     *         };
     *       }
     *       return network;
     *     },
     *   },
     * });
     * ```
     *
     * @example
     * Restrict the SDK to a single custom network and make it the default:
     * ```typescript
     * transformers: {
     *   // The first network of a chain is the default for fresh installs,
     *   // so filtering (or reordering) also controls the default network.
     *   networksData: (networksData) =>
     *     networksData.filter((network) => network.networkId === '988'),
     * }
     * ```
     *
     * @example
     * Add fallback RPC URLs:
     * ```typescript
     * transformers: {
     *   networksData: (networksData) =>
     *     networksData.map((network) => ({
     *       ...network,
     *       rpcUrls: {
     *         http: ['https://my-rpc.com', ...network.rpcUrls.http],
     *       },
     *     })),
     * }
     * ```
     */
    transformers?: {
        /**
         * Transform network data before it's used. Called for each network in your project.
         * Affects all operations: balance fetching, transactions, RPC client creation, etc.
         *
         * @deprecated Use {@link DynamicClientConfig.transformers.networksData} instead.
         * Note that the two hooks compose: `networkData` is applied to each network
         * first, then `networksData` receives the resulting full list.
         *
         * @param networkData - Original network configuration from project settings
         * @returns Transformed network data (must maintain valid NetworkData structure)
         */
        networkData?: (networkData: NetworkData) => NetworkData;
        /**
         * Transform the full network list before it's used. Called with the flattened
         * list of all networks from your project settings; the returned list is
         * authoritative for the SDK: you can rewrite, filter, reorder, or add networks.
         *
         * Note the one-letter difference from the deprecated per-network
         * {@link DynamicClientConfig.transformers.networkData} hook: `networksData`
         * (plural) receives and returns the whole `NetworkData[]` list, whereas
         * `networkData` (singular) is called once per network with a single item.
         *
         * The first network of a chain acts as the default network for wallets that
         * have no persisted network selection, so ordering controls the fresh-install
         * default.
         *
         * The callback must be pure and synchronous. Its output is validated at
         * runtime, but validation never blocks: returning malformed network data
         * logs an error while the returned list is still used, and a callback
         * that throws logs an error and falls back to the untransformed list
         * (which restores the untransformed default network). Extra properties on
         * returned networks beyond the `NetworkData` shape are accepted and
         * preserved.
         *
         * Failures are reported through the client's logger at `error` level — if
         * you provide a custom logger, forward `error` calls to see them. The
         * error is logged on every network read while the transformer stays
         * broken, starting with the first one after project settings load.
         *
         * @param networksData - Full network list derived from project settings
         * @returns The network list the SDK should use
         */
        networksData?: (networksData: NetworkData[]) => NetworkData[];
    };
    /**
     * Options for Wallet-as-a-Service (embedded wallet / MPC) behavior.
     */
    waas?: {
        /**
         * Extra origins allowed when the WaaS iframe validates `postMessage` sources
         * (for example, when your app is embedded in another trusted origin).
         */
        additionalTrustedOrigins?: string[];
        /**
         * Per-attempt timeout in milliseconds for loading the embedded wallet's
         * secure container. Forwarded to the wallet client's load tuning. Must be
         * a number between 1,000 and 60,000; values outside that range are
         * rejected with an `InvalidParamError` at client creation.
         *
         * Lower this (together with
         * {@link DynamicClientConfig.waas.maxLoadRetries | maxLoadRetries}) to
         * fail fast and drive your own retry cadence on a caught
         * `WaasLoadFailedError`. The worst-case time until that error is
         * `(maxLoadRetries + 1) * loadTimeoutMs + maxLoadRetries * 1000` for the
         * first load cycle. After an exhausted cycle the underlying client
         * doubles the effective timeout for subsequent cycles (capped at
         * 60,000 ms) and never resets it back down for the page's lifetime.
         *
         * The tuning applies process-wide: all chains — and all Dynamic clients
         * on the same page — share one container, and the value is written to
         * shared state whenever a client with an explicit override is
         * constructed. A later client without an override inherits the last
         * explicitly-set value, not the default.
         *
         * @defaultValue `20000`
         */
        loadTimeoutMs?: number;
        /**
         * Extra load attempts (after the first) for the embedded wallet's secure
         * container before it gives up and wallet operations reject with
         * `WaasLoadFailedError`. Must be an integer between 0 and 10; values
         * outside that range are rejected with an `InvalidParamError` at client
         * creation. Shares the process-wide semantics of
         * {@link DynamicClientConfig.waas.loadTimeoutMs | loadTimeoutMs}.
         *
         * @defaultValue `1`
         */
        maxLoadRetries?: number;
    };
};
//# sourceMappingURL=DynamicClientConfig.d.ts.map