import { Chain } from "../types/chain.js"; import { Address } from "../types/address.js"; import { BitcoinRpcMethods } from "../types/rpc.js"; import { Prettify } from "../types/utils.js"; import { Account } from "../types/account.js"; import { ErrorType } from "../errors/utils.js"; import { BtcRpcRequestFn, RpcSchema } from "../types/request.js"; import { Transport } from "../types/transport.js"; //#region src/factories/createClient.d.ts type ClientConfig = { /** The Account to use for the Client. This will be used for Actions that require an account as an argument. */account?: accountOrAddress | Account | Address | undefined; /** Flags for batch settings. */ batch?: { /** Toggle to enable `eth_call` multicall aggregation. */multicall?: boolean | Prettify | undefined; } | undefined; /** * Time (in ms) that cached data will remain in memory. * @default 4_000 */ cacheTime?: number | undefined; /** Chain for the client. */ chain?: Chain | undefined | chain; /** A key for the client. */ key?: string | undefined; /** A name for the client. */ name?: string | undefined; /** * Frequency (in ms) for polling enabled actions & events. * @default 4_000 */ pollingInterval?: number | undefined; /** * Typed JSON-RPC schema for the client. */ rpcSchema?: rpcSchema | undefined; /** The RPC transport */ transport: transport; /** The type of client. */ type?: string | undefined; }; type Client = Client_Base & (extended extends Extended ? extended : unknown) & { extend: (fn: (client: Client) => client) => Client & (extended extends Extended ? extended : unknown)>; }; type Client_Base = { /** The Account of the Client. */account: account; /** Time (in ms) that cached data will remain in memory. */ cacheTime: number; /** Chain for the client. */ chain: chain; /** A key for the client. */ key: string; /** A name for the client. */ name: string; /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */ pollingInterval: number; /** Request function wrapped with friendly error handling */ request: BtcRpcRequestFn; /** The RPC transport */ transport: ReturnType["config"] & ReturnType["value"]; /** The type of client. */ type: string; /** A unique ID for the client. */ uid: string; }; type Extended = Prettify<{ [_ in keyof Client_Base]?: undefined } & { [key: string]: unknown; }>; type MulticallBatchOptions = { /** The maximum size (in bytes) for each calldata chunk. @default 1_024 */batchSize?: number | undefined; /** The maximum number of milliseconds to wait before sending a batch. @default 0 */ wait?: number | undefined; }; type CreateClientErrorType = ErrorType; declare function createClient(parameters: ClientConfig): Prettify : accountOrAddress, rpcSchema>>; /** * Defines a typed JSON-RPC schema for the client. * Note: This is a runtime noop function. */ declare function rpcSchema(): rpcSchema; //#endregion export { Client, ClientConfig, CreateClientErrorType, MulticallBatchOptions, createClient, rpcSchema }; //# sourceMappingURL=createClient.d.ts.map