code: function bnToString(objInput, baseInput, hexPrefixed) {
    var obj = objInput; // eslint-disable-line
    const base = baseInput || 10;
  
    // obj is an array
    if (typeof obj === 'object' && obj !== null) {
      if (Array.isArray(obj)) {
        // convert items in array
        obj = obj.map((item) => bnToString(item, base, hexPrefixed));
      } else {
        if (obj.toString && (obj.lessThan || obj.dividedToIntegerBy || obj.isBN || obj.toTwos)) {
          return hexPrefixed ? `0x${ethUtil.padToEven(obj.toString(16))}` : obj.toString(base);
        } else { // eslint-disable-line
          // recurively converty item
          Object.keys(obj).forEach((key) => {
            obj[key] = bnToString(obj[key], base, hexPrefixed);
          });
        }
      }
    }
  
    return obj;
  }
docs: recursively converts all BN or BigNumber instances into string 
  Converts all BigNumber and BN instances to string, even nested deep in Arrays or Objects.
  
  @method bnToString
  @param {Optional} objInput optional input type, bypasses most
  @param {Number} baseInput the base number (usually either 10 or 16).
  @param {Boolean} hexPrefixed hex prefix the output
  @return {Optional} output returns optional type output with converted bn's.