import { IPairConstructor, Pair } from './Pair' import { BigNumberJS } from '../BigNumberJS' import { TokenType } from './TokenType' import { BaseToken } from './BaseToken' export interface IERC20Constructor { address: string name: string symbol: string image: string decimals: number price: string pair: IPairConstructor | null } export class ERC20 extends BaseToken { public readonly address: string public readonly name: string public readonly symbol: string public readonly image: string public readonly decimals: number public readonly price: BigNumberJS public readonly pair: Pair | null constructor({ address, name, symbol, image, decimals, price, pair, }: IERC20Constructor) { super(TokenType.ERC20) this.address = address this.name = name this.symbol = symbol this.image = image this.decimals = decimals this.price = new BigNumberJS(price) this.pair = pair ? new Pair(pair) : null } }