import { Contract as IContract } from "./interfaces/contract" ; import { Contract } from "web3-eth-contract" ; import { TransactionConfig as SendOptions } from "web3-core" ; import { EthApi } from "@joincivil/ethapi" ; export interface ContractConfiguration { estimationMultiplier : number ; txDefaults : Partial < SendOptions > ; } const DEFAULT_CONFIG = { estimationMultiplier : 1.5 , txDefaults : { } , } ; export class BaseContract implements IContract { protected configuration : ContractConfiguration ; protected instance : Contract ; protected ethApi : EthApi ; constructor ( instance , ethApi , config = { } ) { this . instance = instance ; this . configuration = { ... DEFAULT_CONFIG , ... config , } ; this . ethApi = ethApi ; } public get address ( ) : string { return this . instance . options . address ; } }