async auth (calc, dms) {
    this._authOnReconnect = true
    if (!this._isOpen) {
      throw new Error('not open')
    }

    if (this._isAuthenticated) {
      throw new Error('already authenticated')
    }

    const authNonce = nonce()
    const authPayload = `AUTH${authNonce}${authNonce}`
    const { sig } = genAuthSig(this._authArgs.apiSecret, authPayload)
    const authArgs = { ...this._authArgs }

    if (_isFinite(calc)) authArgs.calc = calc
    if (_isFinite(dms)) authArgs.dms = dms

    return new Promise((resolve) => {
      this.once('auth', () => {
        debug('authenticated')
        resolve()
      })

      this.send({
        event: 'auth',
        apiKey: this._authArgs.apiKey,
        authSig: sig,
        authPayload,
        authNonce,
        ...authArgs
      })
    })
  }
Generates & sends an authentication packet to the server; if already
authenticated, rejects with an error, resolves on success.

If a DMS flag of 4 is provided, all open orders are cancelled when the
connection terminates.

@param {number?} calc - optional, default is 0
@param {number?} dms - optional dead man switch flag, active 4
@returns {Promise} p