fortmatic
Version:
Fortmatic Javascript SDK
50 lines (49 loc) • 1.75 kB
TypeScript
import { PhantomUser } from '../modules/phantom-mode/phantom-user';
import { TransactionsModule } from '../modules/widget-mode/transactions-module';
import { UserModule } from '../modules/widget-mode/user-module';
import { LoginWithMagicLinkConfiguration, WidgetModeConfiguration } from '../types';
import { FmProvider } from './fm-provider';
import { QueryParameters } from '../util/query-params';
/**
* Base class for Fortmatic SDKs
*/
export declare abstract class SDK {
private static __provider__;
readonly endpoint: string;
readonly encodedQueryParams: string;
readonly apiKey: string;
constructor(options: {
apiKey: string;
ethNetwork?: QueryParameters['ETH_NETWORK'];
endpoint: string;
});
/**
* Gets a Web3-compatible provider.
*/
getProvider(): FmProvider;
}
/**
* The entry-point to whitelabeled, headless Fortmatic APIs.
*/
export declare class PhantomMode extends SDK {
readonly user: PhantomUser;
constructor(apiKey: string, ethNetwork?: QueryParameters['ETH_NETWORK']);
/**
* Initiate the "magic link" login flow for a user.
*/
loginWithMagicLink(configuration: LoginWithMagicLinkConfiguration): Promise<PhantomUser>;
}
/**
* The entry-point to core Fortmatic APIs.
*/
export declare class WidgetMode extends SDK {
static readonly Phantom: typeof PhantomMode;
readonly transactions: TransactionsModule;
readonly user: UserModule;
constructor(apiKey: string, ethNetwork?: QueryParameters['ETH_NETWORK']);
/**
* Apply configuration to customize Fortmatic's Ethereum functionality.
*/
configure(configuration?: WidgetModeConfiguration): Promise<boolean>;
}
export declare const Fortmatic: typeof WidgetMode;