@signumjs/wallets
Version:
Wallets communication package for DApps in the Signum Network
38 lines (37 loc) • 1.7 kB
TypeScript
/**
* Original work Copyright (c) 2022 Signum Network
*/
import { ExtensionAdapter } from './extensionAdapter';
import { ExtensionListener } from './extensionListener';
import { ExtensionNotificationHandler } from './extensionNotificationHandler';
/**
* Wallet Connection object returned from {@link ExtensionWallet.connect}
* You can use this to listen to events in the wallet, i.e. network changes, or permission removals
*/
export declare class ExtensionWalletConnection {
accountId: string;
publicKey: string;
watchOnly: boolean;
availableNodeHosts: string[];
currentNodeHost: string;
private readonly adapter;
private notificationListener;
/**
* @param accountId The connected account
* @param publicKey The accounts public key
* @param watchOnly Indicates whether this account is watch only, or not. Watch Only accounts cannot sign messages.
* @param availableNodeHosts The available nodeHosts for given network, which are registered in the wallet.
* @param currentNodeHost The currently selected nodeHost in the wallet
* @param adapter the extension adapter with its internal implementation
*/
constructor(accountId: string, publicKey: string, watchOnly: boolean, availableNodeHosts: string[], currentNodeHost: string, adapter: ExtensionAdapter);
/**
* Listens to changes in the wallet
*
* Only one listener instance is allowed, previous listener will be removed/overwritten
*
* @param notificationHandler The object with the event handler
* @return The listener instance, needed to unlisten
*/
listen(notificationHandler: ExtensionNotificationHandler): ExtensionListener;
}