text: 'use strict'
  function t(t) {
    return t && 'object' == typeof t && 'default' in t ? t.default : t
  }
  Object.defineProperty(exports, '__esModule', { value: !0 })
  var r,
    e,
    n = t(require('jsbi')),
    i = t(require('tiny-invariant')),
    o = t(require('decimal.js-light')),
    a = t(require('big.js')),
    u = t(require('toformat')),
    s = require('@ethersproject/address')
  ;((r = exports.TradeType || (exports.TradeType = {}))[(r.EXACT_INPUT = 0)] = 'EXACT_INPUT'),
    (r[(r.EXACT_OUTPUT = 1)] = 'EXACT_OUTPUT'),
    ((e = exports.Rounding || (exports.Rounding = {}))[(e.ROUND_DOWN = 0)] = 'ROUND_DOWN'),
    (e[(e.ROUND_HALF_UP = 1)] = 'ROUND_HALF_UP'),
    (e[(e.ROUND_UP = 2)] = 'ROUND_UP')
  var c,
    d,
    f = n.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')
  function l(t, r) {
    for (var e = 0; e < r.length; e++) {
      var n = r[e]
      ;(n.enumerable = n.enumerable || !1),
        (n.configurable = !0),
        'value' in n && (n.writable = !0),
        Object.defineProperty(t, n.key, n)
    }
  }
  function p(t, r, e) {
    return r && l(t.prototype, r), e && l(t, e), t
  }
  function m(t, r) {
    ;(t.prototype = Object.create(r.prototype)), (t.prototype.constructor = t), (t.__proto__ = r)
  }
  var h = u(o),
    y = u(a),
    v =
      (((c = {})[exports.Rounding.ROUND_DOWN] = h.ROUND_DOWN),
      (c[exports.Rounding.ROUND_HALF_UP] = h.ROUND_HALF_UP),
      (c[exports.Rounding.ROUND_UP] = h.ROUND_UP),
      c),
    g =
      (((d = {})[exports.Rounding.ROUND_DOWN] = 0),
      (d[exports.Rounding.ROUND_HALF_UP] = 1),
      (d[exports.Rounding.ROUND_UP] = 3),
      d),
    x = (function() {
      function t(t, r) {
        void 0 === r && (r = n.BigInt(1)), (this.numerator = n.BigInt(t)), (this.denominator = n.BigInt(r))
      }
      t.tryParseFraction = function(r) {
        if (r instanceof n || 'number' == typeof r || 'string' == typeof r) return new t(r)
        if ('numerator' in r && 'denominator' in r) return r
        throw new Error('Could not parse fraction')
      }
      var r = t.prototype
      return (
        (r.invert = function() {
          return new t(this.denominator, this.numerator)
        }),
        (r.add = function(r) {
          var e = t.tryParseFraction(r)
          return n.equal(this.denominator, e.denominator)
            ? new t(n.add(this.numerator, e.numerator), this.denominator)
            : new t(
                n.add(n.multiply(this.numerator, e.denominator), n.multiply(e.numerator, this.denominator)),
                n.multiply(this.denominator, e.denominator)
              )
        }),
        (r.subtract = function(r) {
          var e = t.tryParseFraction(r)
          return n.equal(this.denominator, e.denominator)
            ? new t(n.subtract(this.numerator, e.numerator), this.denominator)
            : new t(
                n.subtract(n.multiply(this.numerator, e.denominator), n.multiply(e.numerator, this.denominator)),
                n.multiply(this.denominator, e.denominator)
              )
        }),
        (r.lessThan = function(r) {
          var e = t.tryParseFraction(r)
          return n.lessThan(n.multiply(this.numerator, e.denominator), n.multiply(e.numerator, this.denominator))
        }),
        (r.equalTo = function(r) {
          var e = t.tryParseFraction(r)
          return n.equal(n.multiply(this.numerator, e.denominator), n.multiply(e.numerator, this.denominator))
        }),
        (r.greaterThan = function(r) {
          var e = t.tryParseFraction(r)
          return n.greaterThan(n.multiply(this.numerator, e.denominator), n.multiply(e.numerator, this.denominator))
        }),
        (r.multiply = function(r) {
          var e = t.tryParseFraction(r)
          return new t(n.multiply(this.numerator, e.numerator), n.multiply(this.denominator, e.denominator))
        }),
        (r.divide = function(r) {
          var e = t.tryParseFraction(r)
          return new t(n.multiply(this.numerator, e.denominator), n.multiply(this.denominator, e.numerator))
        }),
        (r.toSignificant = function(t, r, e) {
          void 0 === r && (r = { groupSeparator: '' }),
            void 0 === e && (e = exports.Rounding.ROUND_HALF_UP),
            Number.isInteger(t) || i(!1),
            t > 0 || i(!1),
            h.set({ precision: t + 1, rounding: v[e] })
          var n = new h(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(t)
          return n.toFormat(n.decimalPlaces(), r)
        }),
        (r.toFixed = function(t, r, e) {
          return (
            void 0 === r && (r = { groupSeparator: '' }),
            void 0 === e && (e = exports.Rounding.ROUND_HALF_UP),
            Number.isInteger(t) || i(!1),
            t >= 0 || i(!1),
            (y.DP = t),
            (y.RM = g[e]),
            new y(this.numerator.toString()).div(this.denominator.toString()).toFormat(t, r)
          )
        }),
        p(t, [
          {
            key: 'quotient',
            get: function() {
              return n.divide(this.numerator, this.denominator)
            }
          },
          {
            key: 'remainder',
            get: function() {
              return new t(n.remainder(this.numerator, this.denominator), this.denominator)
            }
          },
          {
            key: 'asFraction',
            get: function() {
              return new t(this.numerator, this.denominator)
            }
          }
        ]),
        t
      )
    })(),
    F = u(a),
    b = (function(t) {
      function r(r, e, o) {
        var a
        return (
          (a = t.call(this, e, o) || this),
          n.lessThanOrEqual(a.quotient, f) || i(!1),
          (a.currency = r),
          (a.decimalScale = n.exponentiate(n.BigInt(10), n.BigInt(r.decimals))),
          a
        )
      }
      m(r, t),
        (r.fromRawAmount = function(t, e) {
          return new r(t, e)
        }),
        (r.fromFractionalAmount = function(t, e, n) {
          return new r(t, e, n)
        })
      var e = r.prototype
      return (
        (e.add = function(e) {
          this.currency.equals(e.currency) || i(!1)
          var n = t.prototype.add.call(this, e)
          return r.fromFractionalAmount(this.currency, n.numerator, n.denominator)
        }),
        (e.subtract = function(e) {
          this.currency.equals(e.currency) || i(!1)
          var n = t.prototype.subtract.call(this, e)
          return r.fromFractionalAmount(this.currency, n.numerator, n.denominator)
        }),
        (e.multiply = function(e) {
          var n = t.prototype.multiply.call(this, e)
          return r.fromFractionalAmount(this.currency, n.numerator, n.denominator)
        }),
        (e.divide = function(e) {
          var n = t.prototype.divide.call(this, e)
          return r.fromFractionalAmount(this.currency, n.numerator, n.denominator)
        }),
        (e.toSignificant = function(r, e, n) {
          return (
            void 0 === r && (r = 6),
            void 0 === n && (n = exports.Rounding.ROUND_DOWN),
            t.prototype.divide.call(this, this.decimalScale).toSignificant(r, e, n)
          )
        }),
        (e.toFixed = function(r, e, n) {
          return (
            void 0 === r && (r = this.currency.decimals),
            void 0 === n && (n = exports.Rounding.ROUND_DOWN),
            r <= this.currency.decimals || i(!1),
            t.prototype.divide.call(this, this.decimalScale).toFixed(r, e, n)
          )
        }),
        (e.toExact = function(t) {
          return (
            void 0 === t && (t = { groupSeparator: '' }),
            (F.DP = this.currency.decimals),
            new F(this.quotient.toString()).div(this.decimalScale.toString()).toFormat(t)
          )
        }),
        p(r, [
          {
            key: 'wrapped',
            get: function() {
              return this.currency.isToken
                ? this
                : r.fromFractionalAmount(this.currency.wrapped, this.numerator, this.denominator)
            }
          }
        ]),
        r
      )
    })(x),
    N = new x(n.BigInt(100))
  function w(t) {
    return new _(t.numerator, t.denominator)
  }
  var _ = (function(t) {
      function r() {
        var r
        return ((r = t.apply(this, arguments) || this).isPercent = !0), r
      }
      m(r, t)
      var e = r.prototype
      return (
        (e.add = function(r) {
          return w(t.prototype.add.call(this, r))
        }),
        (e.subtract = function(r) {
          return w(t.prototype.subtract.call(this, r))
        }),
        (e.multiply = function(r) {
          return w(t.prototype.multiply.call(this, r))
        }),
        (e.divide = function(r) {
          return w(t.prototype.divide.call(this, r))
        }),
        (e.toSignificant = function(r, e, n) {
          return void 0 === r && (r = 5), t.prototype.multiply.call(this, N).toSignificant(r, e, n)
        }),
        (e.toFixed = function(r, e, n) {
          return void 0 === r && (r = 2), t.prototype.multiply.call(this, N).toFixed(r, e, n)
        }),
        r
      )
    })(x),
    A = (function(t) {
      function r() {
        for (var r, e, i, o, a, u = arguments.length, s = new Array(u), c = 0; c < u; c++) s[c] = arguments[c]
        if (4 === s.length) (e = s[0]), (i = s[1]), (o = s[2]), (a = s[3])
        else {
          var d = s[0].quoteAmount.divide(s[0].baseAmount),
            f = [s[0].baseAmount.currency, s[0].quoteAmount.currency, d.denominator, d.numerator]
          ;(e = f[0]), (i = f[1]), (o = f[2]), (a = f[3])
        }
        return (
          ((r = t.call(this, a, o) || this).baseCurrency = e),
          (r.quoteCurrency = i),
          (r.scalar = new x(
            n.exponentiate(n.BigInt(10), n.BigInt(e.decimals)),
            n.exponentiate(n.BigInt(10), n.BigInt(i.decimals))
          )),
          r
        )
      }
      m(r, t)
      var e = r.prototype
      return (
        (e.invert = function() {
          return new r(this.quoteCurrency, this.baseCurrency, this.numerator, this.denominator)
        }),
        (e.multiply = function(e) {
          this.quoteCurrency.equals(e.baseCurrency) || i(!1)
          var n = t.prototype.multiply.call(this, e)
          return new r(this.baseCurrency, e.quoteCurrency, n.denominator, n.numerator)
        }),
        (e.quote = function(r) {
          r.currency.equals(this.baseCurrency) || i(!1)
          var e = t.prototype.multiply.call(this, r)
          return b.fromFractionalAmount(this.quoteCurrency, e.numerator, e.denominator)
        }),
        (e.toSignificant = function(t, r, e) {
          return void 0 === t && (t = 6), this.adjustedForDecimals.toSignificant(t, r, e)
        }),
        (e.toFixed = function(t, r, e) {
          return void 0 === t && (t = 4), this.adjustedForDecimals.toFixed(t, r, e)
        }),
        p(r, [
          {
            key: 'adjustedForDecimals',
            get: function() {
              return t.prototype.multiply.call(this, this.scalar)
            }
          }
        ]),
        r
      )
    })(x),
    T = function(t, r, e, n) {
      Number.isSafeInteger(t) || i(!1),
        (r >= 0 && r < 255 && Number.isInteger(r)) || i(!1),
        (this.chainId = t),
        (this.decimals = r),
        (this.symbol = e),
        (this.name = n)
    },
    E = (function(t) {
      function r() {
        var r
        return ((r = t.apply(this, arguments) || this).isNative = !0), (r.isToken = !1), r
      }
      return m(r, t), r
    })(T)
  function B(t) {
    try {
      return s.getAddress(t)
    } catch (r) {
      throw new Error(t + ' is not a valid address.')
    }
  }
  var D,
    I = (function(t) {
      function r(r, e, n, i, o) {
        var a
        return ((a = t.call(this, r, n, i, o) || this).isNative = !1), (a.isToken = !0), (a.address = B(e)), a
      }
      m(r, t)
      var e = r.prototype
      return (
        (e.equals = function(t) {
          return t.isToken && this.chainId === t.chainId && this.address === t.address
        }),
        (e.sortsBefore = function(t) {
          return (
            this.chainId !== t.chainId && i(!1),
            this.address === t.address && i(!1),
            this.address.toLowerCase() < t.address.toLowerCase()
          )
        }),
        p(r, [
          {
            key: 'wrapped',
            get: function() {
              return this
            }
          }
        ]),
        r
      )
    })(T),
    O =
      (((D = {})[1] = new I(1, '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 18, 'WETH', 'Wrapped Ether')),
      (D[3] = new I(3, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH', 'Wrapped Ether')),
      (D[4] = new I(4, '0xc778417E063141139Fce010982780140Aa0cD5Ab', 18, 'WETH', 'Wrapped Ether')),
      (D[5] = new I(5, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH', 'Wrapped Ether')),
      (D[42] = new I(42, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH', 'Wrapped Ether')),
      (D[56] = new I(56, '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', 18, 'WBNB', 'Wrapped BNB')),
      (D[97] = new I(97, '0xaE8E19eFB41e7b96815649A6a60785e1fbA84C1e', 18, 'WBNB', 'Wrapped BNB')),
      (D[66] = new I(66, '0x8f8526dbfd6e38e3d8307702ca8469bae6c56c15', 18, 'WOKT', 'Wrapped OKT')),
      (D[10] = new I(10, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether')),
      (D[69] = new I(69, '0x4200000000000000000000000000000000000006', 18, 'WETH', 'Wrapped Ether')),
      (D[42161] = new I(42161, '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', 18, 'WETH', 'Wrapped Ether')),
      (D[421611] = new I(421611, '0xB47e6A5f8b33b3F17603C83a0535A9dcD7E32681', 18, 'WETH', 'Wrapped Ether')),
      D),
    U = (function(t) {
      function r(r) {
        var e
        return (
          ((e =
            t.call(
              this,
              r,
              18,
              [1, 3, 4, 5, 42, 10, 69, 42161, 421611].includes(r)
                ? 'ETH'
                : [56, 97].includes(r)
                ? 'BNB'
                : [66, 65].includes(r)
                ? 'OKT'
                : '',
              [1, 3, 4, 5, 42, 10, 69, 42161, 421611].includes(r)
                ? 'Ether'
                : [56, 97].includes(r)
                ? 'BNB'
                : [66, 65].includes(r)
                ? 'OKT'
                : ''
            ) || this).ETHER_CHAIN_IDS = [1, 3, 4, 5, 42, 10, 69, 42161, 421611]),
          (e.BNB_CHAIN_IDS = [56, 97]),
          (e.OKT_CHAIN_IDS = [66, 65]),
          e
        )
      }
      return (
        m(r, t),
        (r.onChain = function(t) {
          var e
          return null != (e = this._etherCache[t]) ? e : (this._etherCache[t] = new r(t))
        }),
        (r.prototype.equals = function(t) {
          return t.isNative && t.chainId === this.chainId
        }),
        p(r, [
          {
            key: 'wrapped',
            get: function() {
              var t = O[this.chainId]
              return t || i(!1), t
            }
          }
        ]),
        r
      )
    })(E)
  U._etherCache = {}
  var C = n.BigInt(Number.MAX_SAFE_INTEGER),
    R = n.BigInt(0),
    P = n.BigInt(1),
    q = n.BigInt(2)
  ;(exports.CurrencyAmount = b),
    (exports.Ether = U),
    (exports.Fraction = x),
    (exports.MaxUint256 = f),
    (exports.NativeCurrency = E),
    (exports.Percent = _),
    (exports.Price = A),
    (exports.Token = I),
    (exports.WETH9 = O),
    (exports.computePriceImpact = function(t, r, e) {
      var n = t.quote(r),
        i = n.subtract(e).divide(n)
      return new _(i.numerator, i.denominator)
    }),
    (exports.sortedInsert = function(t, r, e, n) {
      if ((e > 0 || i(!1), t.length <= e || i(!1), 0 === t.length)) return t.push(r), null
      var o = t.length === e
      if (o && n(t[t.length - 1], r) <= 0) return r
      for (var a = 0, u = t.length; a < u; ) {
        var s = (a + u) >>> 1
        n(t[s], r) <= 0 ? (a = s + 1) : (u = s)
      }
      return t.splice(a, 0, r), o ? t.pop() : null
    }),
    (exports.sqrt = function(t) {
      if ((n.greaterThanOrEqual(t, R) || i(!1), n.lessThan(t, C))) return n.BigInt(Math.floor(Math.sqrt(n.toNumber(t))))
      var r, e
      for (r = t, e = n.add(n.divide(t, q), P); n.lessThan(e, r); ) (r = e), (e = n.divide(n.add(n.divide(t, e), e), q))
      return r
    }),
    (exports.validateAndParseAddress = B)
  //# sourceMappingURL=sdk-core.cjs.production.min.js.map
  