import { JsonRpcProvider } from '@ethersproject/providers'; /** * Refer to our documentation at https://docs.manifold.xyz/v/manifold-for-developers/resources/apps/grant-types#signature-grant to learn more about Grant Type */ export declare enum OAuthGrantType { TOKEN = "token", SIGNATURE = "signature", SIWE = "siwe" } /** * @dev OAuthConfig is the basic configuration you need to get an OAuth Token * @param grantType The grant type to use for OAuth * @param appName The name of the app for auth * @param clientId The client id of the app for auth */ export interface OAuthConfig { grantType: OAuthGrantType; clientId: string; appName: string; } /** * @dev OAuthOptions are the options that can be passed to OAuth to determine the behavior * @param message (signature grant type) A message displayed to the user during signing * (siwe grant type) The signed siwe message * @param signature (siwe grant type) The signature of the siwe message * @param strictAuth If true, the authenticated address must match the * provider connected address. Default true. * @param delayAuth If true, will not automatically request a signature * from the user to auth upon wallet connection. Default false. * @param userCallback Set if you want to handle the signing of message yourself */ export interface OAuthOptions { message?: string; signature?: string; strictAuth?: boolean; delayAuth?: boolean; userCallback?: (message: string) => Promise; } export interface IOAuthSignatureHandler { getOneTimeUseCode(): Promise; formatMessage(oneTimeUseCode: string): string; getAccessToken(message: string, signature: string, chainId: number, oneTimeUseCode?: string): Promise; signMessage(message: string, provider: JsonRpcProvider): Promise; }