UNPKG

@kibisis/connect-kit

Version:

The UI kit to allow dApps to connect to the Kibisis wallets.

72 lines 2.34 kB
import { IAccount } from '@agoralabs-sh/avm-web-provider'; import { IConfig } from '../../types'; import { INewOptions } from './types'; export default class KibisisConnect { static readonly displayName = "KibisisConnect"; private _config; private _avmWebClient; private _avmWebClientListenerIDs; private _logger; private _timerIDs; constructor({ debug, genesisHash }: INewOptions); /** * private methods */ private _closeUI; private _onLaunchWeb; private _reset; /** * Convenience method to get the root element, where the UI us rendered, ID. * @returns {string} The root element ID. * @private */ private _rootElementID; /** * public methods */ /** * Gets the current configuration of */ config(): IConfig; /** * Launches the UI and allows the user to connect to the web extension or set up a connection using WalletConnect. If * the connection was successful, the allow accounts are returned and the connection object of the config will be * instantiated. * @returns {Promise<IAccount[]>} A promise that resolves the allowed accounts. * @throws {ARC0027UnknownError} If there is no `window` context or there was an error on the provider. * @throws {ARC0027MethodTimedOutError} If the user did not respond to the provider request. * @throws {ARC0027NetworkNotSupportedError} If the provided genesis hash is not supported. * @public */ connect(): Promise<IAccount[]>; /** * Sends a disconnect request. * @public */ disconnect(): Promise<void>; /** * Gets the Kibisis provider ID used to identity the provider (wallet). * @returns {string} The provider ID. * @public */ providerID(): string; /** * Sets the debug level in log. * @param {boolean} debug - Whether debug is enabled. * @public */ setDebug(debug: boolean): void; /** * Sets a new genesis hash. * @param {string} genesisHash - The new genesis hash. * @public */ setGenesisHash(genesisHash: string): void; /** * Gets the version of the connect kit. * @returns {string} The version of the connect kit. * @public */ version(): string; } //# sourceMappingURL=KibisisConnect.d.ts.map