UNPKG

@portis/web3

Version:

Portis Web3 SDK

56 lines (55 loc) 1.93 kB
import { INetwork, IOptions, BTCSignTxSDKInput, ISDKConfig, IWidget } from './interfaces'; import WidgetManager from './widget/widgetManager'; import Web3Manager from './web3/web3Manager'; declare class Portis { private _widgetManagerInstance?; private _web3ManagerInstance?; private _config?; constructor(dappId: string, network: string | INetwork, options?: IOptions); readonly _widgetManager: WidgetManager; readonly _web3Manager: Web3Manager; readonly config: ISDKConfig; private _clearProviderSession; private _getWidgetCommunication; readonly web3Provider: any; readonly provider: any; changeNetwork(network: string | INetwork, gasRelay?: boolean): void; setDefaultEmail(email: string): void; getWidget(): Promise<IWidget>; onLogin(callback: (walletAddress: string, email?: string, reputation?: string) => void): void; onLogout(callback: () => void): void; onActiveWalletChanged(callback: (walletAddress: string) => void): void; onError(callback: (error: Error) => void): void; showPortis(): Promise<void>; getCampaignInfo(campaignId: string): Promise<{ error: string; result: any; }>; claimVoucher(voucherId: string): Promise<{ error: string; result: any; }>; logout(): Promise<{ error: string; result: boolean; }>; getExtendedPublicKey(path?: string, coin?: string): Promise<{ error: string; result: string; }>; importWallet(mnemonicOrPrivateKey: string): Promise<void>; isLoggedIn(): Promise<{ error: string; result: boolean; }>; signBitcoinTransaction(params: BTCSignTxSDKInput): Promise<{ error: string; result: { serializedTx: string; txid: string; }; }>; showBitcoinWallet(path?: string): Promise<void>; private _validateParams; } export default Portis;