UNPKG

@nfid/identitykit

Version:

A React library for adding wallet connections to dApps.

24 lines (23 loc) 1.39 kB
import { AccountsSignerClient, AccountsSignerClientOptions, DelegationSignerClient, DelegationSignerClientOptions } from "./signer-client"; import { InternetIdentity, OISY, Stoic } from "./signers"; export declare const IdentityKitAuthType: { readonly DELEGATION: "DELEGATION"; readonly ACCOUNTS: "ACCOUNTS"; }; export declare const IdentityKitCustomSignerAuthType: { [OISY.id]: "ACCOUNTS"; [InternetIdentity.id]: "DELEGATION"; [Stoic.id]: "DELEGATION"; }; type ObjectValuesType<T> = T[keyof T]; export type IdentityKitAuthType = ObjectValuesType<typeof IdentityKitAuthType>; export declare class IdentityKit<T extends IdentityKitAuthType = typeof IdentityKitAuthType.ACCOUNTS, TSignerClient = T extends typeof IdentityKitAuthType.DELEGATION ? DelegationSignerClient : AccountsSignerClient> { signerClient: TSignerClient; constructor(signerClient: TSignerClient); getIcpBalance(): Promise<number>; static create<T extends IdentityKitAuthType = typeof IdentityKitAuthType.ACCOUNTS, TSignerClientOptions = T extends typeof IdentityKitAuthType.DELEGATION ? DelegationSignerClientOptions : AccountsSignerClientOptions>({ signerClientOptions, authType }: { signerClientOptions: TSignerClientOptions; authType: T; }): Promise<IdentityKit<"ACCOUNTS", DelegationSignerClient> | IdentityKit<"ACCOUNTS", AccountsSignerClient>>; } export {};