UNPKG

@uprtcl/ethereum-provider

Version:

_Prtcl provider wrappers around web3

30 lines (29 loc) 1.08 kB
import { Connection, ConnectionOptions } from '@uprtcl/evees'; import { ethers } from 'ethers'; export interface EthereumConnectionOptions { provider: string | ethers.providers.JsonRpcProvider; } export declare class EthereumConnection extends Connection { protected ethOptions: EthereumConnectionOptions; provider: ethers.providers.JsonRpcProvider; signer: ethers.providers.JsonRpcSigner | undefined; account: string; private network; private networkId; constructor(ethOptions?: EthereumConnectionOptions, options?: ConnectionOptions); /** * @override */ connect(): Promise<void>; getLatestBlock(): Promise<number>; connectWallet(): Promise<void>; disconnectWallet(): Promise<void>; canSign(): boolean; /** * @returns the current used account for this ethereum connection */ getCurrentAccount(): string; getNetworkId(): string; signText(text: string, account: string): Promise<string>; verifySignature(message: string, signature: string): Promise<string>; }