text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  const bignumber_js_1 = require("bignumber.js");
  class Ar {
      constructor() {
          // Configure and assign the constructor function for the bignumber library.
          this.BigNum = (value, decimals) => {
              let instance = bignumber_js_1.BigNumber.clone({ DECIMAL_PLACES: decimals });
              return new instance(value);
          };
      }
      winstonToAr(winstonString, { formatted = false, decimals = 12, trim = true } = {}) {
          let number = this.stringToBigNum(winstonString, decimals).shiftedBy(-12);
          return formatted ? number.toFormat(decimals) : number.toFixed(decimals);
      }
      arToWinston(arString, { formatted = false } = {}) {
          let number = this.stringToBigNum(arString).shiftedBy(12);
          return formatted ? number.toFormat() : number.toFixed(0);
      }
      compare(winstonStringA, winstonStringB) {
          let a = this.stringToBigNum(winstonStringA);
          let b = this.stringToBigNum(winstonStringB);
          return a.comparedTo(b);
      }
      isEqual(winstonStringA, winstonStringB) {
          return this.compare(winstonStringA, winstonStringB) === 0;
      }
      isLessThan(winstonStringA, winstonStringB) {
          let a = this.stringToBigNum(winstonStringA);
          let b = this.stringToBigNum(winstonStringB);
          return a.isLessThan(b);
      }
      isGreaterThan(winstonStringA, winstonStringB) {
          let a = this.stringToBigNum(winstonStringA);
          let b = this.stringToBigNum(winstonStringB);
          return a.isGreaterThan(b);
      }
      add(winstonStringA, winstonStringB) {
          let a = this.stringToBigNum(winstonStringA);
          let b = this.stringToBigNum(winstonStringB);
          return a.plus(winstonStringB).toFixed(0);
      }
      sub(winstonStringA, winstonStringB) {
          let a = this.stringToBigNum(winstonStringA);
          let b = this.stringToBigNum(winstonStringB);
          return a.minus(winstonStringB).toFixed(0);
      }
      stringToBigNum(stringValue, decimalPlaces = 12) {
          return this.BigNum(stringValue, decimalPlaces);
      }
  }
  exports.default = Ar;
  //# sourceMappingURL=ar.js.map