@uprtcl/ethereum-provider
Version:
_Prtcl provider wrappers around web3
34 lines (33 loc) • 1.12 kB
TypeScript
import { ethers, ContractInterface } from 'ethers';
import { Logger } from '@uprtcl/evees';
import { EthereumConnection } from './ethereum.connection';
export interface EthereumContractOptions {
contract: {
abi: ContractInterface;
networks: {
[key: string]: {
address: string;
};
};
};
contractAddress?: string;
}
export declare class EthereumContract {
protected options: EthereumContractOptions;
connection: EthereumConnection;
logger: Logger;
contractAddress: string;
constructor(options: EthereumContractOptions, connection: EthereumConnection);
get userId(): string;
/** must be created everytime to have the up to date signer */
get contractInstance(): ethers.Contract;
ready(): Promise<void>;
/**
* Calls a method of the holding contract and resolves only when confirmed
*/
send(funcName: string, pars: any[]): Promise<any>;
/**
* Simple call function for the holding contract
*/
call(funcName: string, pars: any[]): Promise<any>;
}