@web3auth/ws-embed
Version:
Embed script
27 lines (26 loc) • 1.24 kB
TypeScript
import { BUILD_ENV_TYPE, JRPCMiddlewareV2, JRPCRequest, Json, SafeEventEmitter, WEB3AUTH_NETWORK_TYPE } from "@web3auth/auth";
import { ProjectConfig } from "./interfaces";
/**
* json-rpc-engine middleware that logs RPC errors and and validates req.method.
*
* @param log - The logging API to use.
* @returns json-rpc-engine middleware function
*/
export declare function createErrorMiddleware(): JRPCMiddlewareV2<JRPCRequest<unknown>, Json>;
/**
* Logs a stream disconnection error. Emits an 'error' if given an
* EventEmitter that has listeners for the 'error' event.
*
* @param log - The logging API to use.
* @param remoteLabel - The label of the disconnected stream.
* @param error - The associated error to log.
* @param emitter - The logging API to use.
*/
export declare function logStreamDisconnectWarning(remoteLabel: string, error: Error, emitter: SafeEventEmitter): void;
export declare const EMITTED_NOTIFICATIONS: string[];
export declare const signerHost: (buildEnv?: BUILD_ENV_TYPE) => string;
export declare const fetchProjectConfig: ({ clientId, web3AuthNetwork, buildEnv, }: {
clientId: string;
web3AuthNetwork: WEB3AUTH_NETWORK_TYPE;
buildEnv?: BUILD_ENV_TYPE;
}) => Promise<ProjectConfig>;