import { subscription } from '@aragon/connect-core' ; import { SubscriptionCallback , SubscriptionResult } from '@aragon/connect-types' ; import ERC20 from './ERC20' ; import { formatBn } from '../helpers' ; import { ArbitratorFeeData , IDisputableVotingConnector } from '../types' ; export default class ArbitratorFee { #connector : IDisputableVotingConnector ; readonly id : string ; readonly voteId : string ; readonly tokenId : string ; readonly tokenSymbol : string ; readonly tokenDecimals : string ; readonly amount : string ; constructor ( data , connector ) { this . #connector = connector ; this . id = data . id ; this . voteId = data . voteId ; this . tokenId = data . tokenId ; this . tokenSymbol = data . tokenSymbol ; this . tokenDecimals = data . tokenDecimals ; this . amount = data . amount ; } get formattedAmount ( ) : string { return formatBn ( this . amount , this . tokenDecimals ) ; } async token ( ) { return this . #connector . ERC20 ( this . tokenId ) ; } onToken ( callback ? ) { return subscription < ERC20 > ( callback , ( callback ) => this . #connector . onERC20 ( this . tokenId , callback ) ) ; } }