import type { Address, PublicClient } from "viem"; import type { NetworkType } from "../chain/index.js"; import type { ILogger } from "../index.js"; import type { OnchainSDK } from "../OnchainSDK.js"; /** * Convenience base class for {@link IOnchainSDKPlugin} implementations. * * Handles the SDK attachment lifecycle, logger setup, and provides * common accessors (`network`, `client`). Subclasses only need to * implement {@link load} to supply their domain-specific state. * * @typeParam TState - Plugin-specific state shape. **/ export declare abstract class BasePlugin = {}> { #private; protected logger?: ILogger; /** * Plugin state version for hydration compatibility checks. * @default 1 **/ readonly version: number; /** * When `true`, state is fetched eagerly during the `attach` phase * rather than waiting for an explicit `load` call. **/ readonly loadOnAttach: boolean; constructor(loadOnAttach?: boolean); /** * Reference to the parent SDK instance. * @throws Error if the SDK has not been attached yet. **/ get sdk(): OnchainSDK; /** * @internal * Set the SDK instance. Called by the SDK constructor. * @param sdk - The SDK instance. * @throws Error if the SDK is already attached. */ set sdk(sdk: OnchainSDK); /** * {@inheritDoc IOnchainSDKPlugin.attach} **/ attach(): Promise; /** * {@inheritDoc IOnchainSDKPlugin.syncState} **/ syncState(): Promise; /** * Loads or refreshes the plugin state. * * @param force - When `true`, re-fetch even if state is already loaded. * @returns The loaded plugin state. **/ abstract load(force?: boolean): Promise; /** * Network type of the connected chain (e.g. `"Mainnet"`, `"Arbitrum"`). **/ get network(): NetworkType; /** * Viem public client for read-only chain interactions. **/ get client(): PublicClient; protected labelAddress(address: Address): string; }