import BN from 'bn.js' ; import { DirectBuy } from '.' ; import { IOrder } from './IOrder' ; export class Trade { constructor ( public readonly bid , public readonly ask , volume , public readonly price ) { if ( volume . isZero ( ) || volume . isNeg ( ) ) { throw new Error ( 'Negative or zero trade volume' ) ; } this . created = new Date ( ) ; this . volume = new BN ( volume ) ; } public readonly created : Date ; public readonly volume : BN ; }