import { miniMeAbi } from '@aragon/connect-core' ; import { BigNumber , Contract , providers as ethersProviders } from 'ethers' ; import { ERC20Data } from '../types' ; export default class ERC20 { #ethersProvider : ethersProviders . Provider ; readonly id : string ; readonly name : string ; readonly symbol : string ; readonly decimals : string ; constructor ( data , ethersProvider ) { this . #ethersProvider = ethersProvider ; this . id = data . id ; this . name = data . name ; this . symbol = data . symbol ; this . decimals = data . decimals ; } async balance ( address ) { return this . _contract ( ) . balanceOf ( address ) ; } async balanceAt ( address , block ) { return this . _contract ( ) . balanceOfAt ( address , block ) ; } _contract ( ) { return new Contract ( this . id , miniMeAbi , this . #ethersProvider ) ; } }