@particle-network/connectkit
Version:
25 lines (24 loc) • 1.16 kB
TypeScript
import type { ConnectWithEmailParam, ConnectWithPhoneParam, ConnectWithProvider } from '@particle-network/auth-core';
import { type BaseErrorType, type Connector, type ConnectorAlreadyConnectedErrorType, type ErrorType } from '@particle-network/connector-core';
import type { Config } from '../createConfig';
import type { SocialAuthType } from '../utils/social';
export type ConnectWithSocialParam = {
socialType: SocialAuthType;
prompt?: 'none' | 'consent' | 'select_account';
};
export type AuthConnectParams = Required<ConnectWithPhoneParam> | Required<ConnectWithEmailParam> | ConnectWithProvider | ConnectWithSocialParam;
export type PasskeyParams = {
isRegistering?: boolean;
};
export type ConnectParameters = {
connector: Connector;
chainId?: number;
authParams?: AuthConnectParams;
passkeyParams?: PasskeyParams;
};
export type ConnectReturnType = {
accounts: readonly [string, ...string[]];
chainId: number;
};
export type ConnectErrorType = ConnectorAlreadyConnectedErrorType | BaseErrorType | ErrorType;
export declare function connect(config: Config, parameters: ConnectParameters): Promise<ConnectReturnType>;