<commit_before>class Registrant {

  
  constructor( eth, eos = "", balance = 0 ){
    // let {unclaimed, wallet, recovered} = balances
    this.eth      = eth
    this.eos      = eos
    this.balance  = typeof balance == 'object' ? balance : new Balance()
  }

  set( key, value ){
    this[ key ] = value;
  }


}

class RejectedRegistrant extends Registrant {
  constructor( error, registrant ) {
    
    const { eth, eos, balance } = registrant
    
    super( registrant.eth, registrant.eos, registrant.balance )
    
    this.error             = error
  
  }
}

class Balance {

  constructor(){
    this.wallet    = web3.toBigNumber(0)
    this.unclaimed = web3.toBigNumber(0)
    this.reclaimed = web3.toBigNumber(0)
    this.total     = web3.toBigNumber(0)
  }

  update( type, balance ){
    this[ type ] = balance
    return this //chaining
  }

  add( type, balance ){
    this['type'].plus( balance )
  }

  readable( type = 'total' ){
    this[ type ] = formatEOS( this[ type ] )
  }

  exists( type ){
    return (typeof this[ type ] !== "undefined" && this[type].gt( 0 ))
  }

  get( type ){
    return (typeof this[ type ] !== "undefined" && this[type].gt( 0 )) ? this[type] : false;
  }

  sum(){
    this.total = this.wallet.plus(this.unclaimed).plus(this.reclaimed)
  }
} <commit_msg>add Transaction class, remove RejectedRegistrant<commit_after>class Registrant {

  constructor( eth, eos = "", balance = 0 ){
    // let {unclaimed, wallet, recovered} = balances
    this.eth      = eth
    this.eos      = eos
    this.balance  = typeof balance == 'object' ? balance : new Balance()
    this.accepted = null
    this.error    = false
  }

  accept ( callback ) {
    this.accepted = true
  }

  reject ( error ) {
    if(!error) return;
    this.error    = error
    this.accepted = false
  }

  is_accepted () {
    return this.accepted === true 
  }

}

class Transaction {

  constructor( eth, tx, type = "transfer", amount ) {
    this.eth     = eth
    this.hash    = tx
    this.amount  = amount
    this.claimed = false
    this.type    = type
  } 

  claim( eth ) {
    return ( eth == this.eth ) 
      ? this.claimed = true
      : log("error", `${eth} should't be claiming ${this.eth}'s transaction`)
  }

}

class RejectedRegistrant extends Registrant {
  constructor( error, registrant ) {
    
    const { eth, eos, balance } = registrant
    
    super( registrant.eth, registrant.eos, registrant.balance )
    
    this.error             = error
  
  }
}

class Balance {

  constructor(){
    this.wallet    = web3.toBigNumber(0)
    this.unclaimed = web3.toBigNumber(0)
    this.reclaimed = web3.toBigNumber(0)
    this.total     = web3.toBigNumber(0)
  }

  set( type, balance ){
    this[ type ] = balance
    return this //chaining
  }

  add( type, balance ){
    this['type'].plus( balance )
  }

  readable( type = 'total' ){
    this[ type ] = formatEOS( this[ type ] )
  }

  exists( type ){
    return (typeof this[ type ] !== "undefined" && this[type].gt( 0 ))
  }

  get( type ){
    return (typeof this[ type ] !== "undefined" && this[type].gt( 0 )) ? this[type] : false;
  }

  sum(){
    this.total = this.wallet.plus(this.unclaimed).plus(this.reclaimed)
  }
} 
{'fraction_non_alphanumeric': 0.13961442786069653, 'fraction_numerical': 0.006840796019900498, 'mean_word_length': 2.3863157894736844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2209248', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1075, 'n_words': 256}