{"version":3,"file":"poloniex.cjs","names":["_axios","_interopRequireDefault","require","_cryptoJs","_debug","_foreverWebsocket","obj","__esModule","default","dbg_rest","Debug","dbg_wsPub","dbg_wsAuth","Poloniex","baseUrl","rest","wsPrivate","wsPublic","apiRateLimitsEndpointsSets","nriPriv","riPriv","nriPub","riPub","apiRateLimits","apiCallTimeStamps","apiKey","apiSecret","constructor","makeRegexp","set","map","item","regex","replace","RegExp","k","Object","keys","key","apiCallRates","defineProperty","get","removeExpiredTimestamps","length","value","n","Array","fill","Date","now","splice","#removeExpiredTimestamps","timestampsArray","oneMinuteAgo","index","classifyApiCall","#classifyApiCall","method","path","endpoint","setName","entries","j","test","cloneObjectExceptKeys","#cloneObjectExceptKeys","src","excludeKeys","cloned","includes","customErrorMessage","#customErrorMessage","err","message","messageArr","response","status","push","statusText","join","data","code","requestPub","#requestPub","params","body","getApiCallRateInfo","apiCallRateLimits","Promise","resolve","reject","url","axios","then","res","catch","errData","error","Error","getRequestHeaders","#getRequestHeaders","timestamp","composeParamString","values","forEach","v","encodeURIComponent","sort","composeBodyString","JSON","stringify","sign","requestString","payload","hmacData","CryptoJS","HmacSHA256","enc","Base64","signature","requestAuth","#requestAuth","headers","getSymbols","requestParameters","symbol","filter","p","getCurrencies","currency","getTimestamp","getPrices","getMarkPrice","getMarkPriceComponents","getOrderBook","getCandles","getTrades","getTicker","getCollateralInfo","getBorrowRatesInfo","getAccountsInfo","getAccountsBalances","id","getAccountsActivity","accountsTransfer","getAccountsTransferRecords","getFeeInfo","getSubaccountsInfo","getSubaccountsBalances","subaccountsTransfer","getSubaccountsTransferRecords","getDepositAddresses","getWalletsActivityRecords","createNewCurrencyAddress","withdrawCurrency","getMarginAccountInfo","getMarginBorrowStatus","getMarginMaxSize","createOrder","createBatchOrders","replaceOrder","getOpenOrders","getOrderDetails","cancelOrder","cancelBatchOrders","cancelAllOrders","setKillSwitch","getKillSwitchStatus","createSmartOrder","replaceSmartOrder","getSmartOpenOrders","getSmartOrderDetails","cancelSmartOrder","cancelBatchSmartOrders","cancelAllSmartOrders","getOrdersHistory","getSmartOrdersHistory","getTradesHistory","getOrderTrades","newPublicWebSocket","options","automaticOpen","undefined","reconnect","timeout","ping","interval","event","ws","ForeverWebSocket","enabled","send","prototype","call","on","toString","reason","newAuthenticatedWebSocket","channel","signTimestamp","exports","module"],"sources":["../../lib/poloniex.mjs"],"sourcesContent":["import axios from 'axios'\nimport CryptoJS from 'crypto-js'\nimport Debug from 'debug'\nimport { ForeverWebSocket } from 'forever-websocket'\n\nconst dbg_rest = Debug('plx:rest')\nconst dbg_wsPub = Debug('plx:ws:pub')\nconst dbg_wsAuth = Debug('plx:ws:auth')\n\n/**\n * Creates a new Poloniex object\n * @class Poloniex\n * @param {String} [apiKey]\n * @param {String} [apiSecret]\n * @returns this\n */\nexport default class Poloniex {\n  // API endpoints\n  static #baseUrl = {\n    rest: 'https://api.poloniex.com',\n    wsPrivate: 'wss://ws.poloniex.com/ws/private',\n    wsPublic: 'wss://ws.poloniex.com/ws/public',\n  }\n\n  // API endpoints sets (for rate limits)\n  #apiRateLimitsEndpointsSets = {\n    // non-resource intensive private endpoints\n    nriPriv: [\n      'GET/accounts',\n      'GET/accounts/balances',\n      'GET/accounts/{id}/balances',\n      'POST/accounts/transfer',\n      'GET/accounts/transfer/{id}',\n      'GET/subaccounts',\n      'GET/subaccounts/{id}/balances',\n      'GET/subaccounts/transfer/{id}',\n      'GET/margin/accountMargin',\n      'GET/margin/borrowStatus',\n      'GET/margin/maxSize',\n      'POST/orders',\n      'GET/orders/{id}',\n      'DELETE/orders/{id}',\n      'GET/orders/{id}/trades',\n      'POST/orders/killSwitch',\n      'GET/orders/killSwitchStatus',\n      'POST/smartorders',\n      'GET/smartorders/{id}',\n      'DELETE/smartorders/{id}',\n    ],\n    // resource intensive private endpoints\n    riPriv: [\n      'GET/accounts/transfer',\n      'GET/accounts/activity',\n      'GET/subaccounts/balances',\n      'GET/subaccounts/transfer',\n      'POST/subaccounts/transfer',\n      'GET/feeinfo',\n      'GET/wallets/addresses',\n      'GET/wallets/addresses/{currency}',\n      'POST/wallets/address',\n      'POST/wallets/withdraw',\n      'GET/wallets/activity',\n      'GET/orders',\n      'POST/orders/batch',\n      'PUT/orders',\n      'DELETE/orders/cancelByIds',\n      'DELETE/orders',\n      'GET/orders/history',\n      'GET/smartorders',\n      'PUT/smartorders',\n      'DELETE/smartorders/cancelByIds',\n      'DELETE/smartorders',\n      'GET/smartorders/history',\n      'GET/trades',\n    ],\n    // non-resource intensive public endpoints\n    nriPub: [\n      \"GET/markets/{symbol}\",\n      \"GET/markets/price\",\n      \"GET/markets/{symbol}/price\",\n      \"GET/markets/markPrice\",\n      \"GET/markets/{symbol}/markPrice\",\n      \"GET/markets/{symbol}/markPriceComponents\",\n      \"GET/markets/{symbol}/orderBook\",\n      \"GET/markets/{symbol}/candles\",\n      \"GET/timestamp\",\n      \"GET/markets/collateralInfo\",\n      \"GET/markets/{currency}/collateralInfo\",\n      \"GET/markets/borrowRatesInfo\"\n    ],\n    // resource intensive public endpoints\n    riPub: [\n      \"GET/markets\",\n      \"GET/markets/{symbol}/trades\",\n      \"GET/markets/ticker24h\",\n      \"GET/markets/{symbol}/ticker24h\",\n      \"GET/currencies\",\n      \"GET/currencies/{currency}\"\n    ]\n  }\n\n  // API rate limits for endpoints sets\n  #apiRateLimits = { riPub: 10, nriPub: 200, nriPriv: 50, riPriv: 10 }\n  // timestamps of all API calls \n  #apiCallTimeStamps = {}\n\n  #apiKey\n  #apiSecret\n\n  constructor({ apiKey = '', apiSecret = '' } = {}) {\n    this.#apiKey = apiKey\n    this.#apiSecret = apiSecret\n\n    // makes the regexp sets from endpoint sets\n    const makeRegexp = function makeRegexp(set) {\n      return set.map((item) => {\n        const regex = item.replace(/{([a-zA-Z0-9_]+)}/g, \"[a-zA-Z0-9_]+\");\n        return new RegExp(\"^\" + regex + \"$\");\n      })\n    }\n\n    //convert endpoint sets to regexp sets\n    for (const k of Object.keys(this.#apiRateLimitsEndpointsSets)) {\n      this.#apiRateLimitsEndpointsSets[k] = makeRegexp(this.#apiRateLimitsEndpointsSets[k])\n    }\n\n    // define setters and getters which are storing API calls timestamps in appropriate arrays\n    for (const key of Object.keys(this.apiCallRates)) {\n      this.#apiCallTimeStamps[key] = []\n      Object.defineProperty(this.apiCallRates, key, {\n        get: () => {\n          this.#removeExpiredTimestamps(key)\n          return this.#apiCallTimeStamps[key].length\n        },\n        set: (value) => {\n          this.#removeExpiredTimestamps(key)\n          const n = value - this.#apiCallTimeStamps[key].length\n          if (n > 0) {\n            // add n elements to the array, with value Date.now()\n            this.#apiCallTimeStamps[key] = [...this.#apiCallTimeStamps[key], ...Array(n).fill(Date.now())]\n          } else {\n            // remove -n elements from the array\n            this.#apiCallTimeStamps[key].splice(0, -n)\n          }\n        }\n      })\n    }\n  }\n\n  // remove timestamps older than one second from API call timestamp array\n  #removeExpiredTimestamps(key) {\n    const timestampsArray = this.#apiCallTimeStamps[key]\n    const now = Date.now()\n    const oneMinuteAgo = now - 1000\n    let index = 0\n    while (index < timestampsArray.length && timestampsArray[index] <= oneMinuteAgo) {\n      index += 1\n    }\n\n    timestampsArray.splice(0, index)\n  }\n\n  // Classifies the API call based on endpoint sets, returns the set name\n  #classifyApiCall(method, path) {\n    const endpoint = method + path\n    for (const [setName, set] of Object.entries(this.#apiRateLimitsEndpointsSets)) {\n      for (let j = 0; j < set.length; j += 1)\n        if (set[j].test(endpoint)) {\n          return setName\n        }\n    }\n  }\n\n// Copies all keys from src object to a destination object, except excludeKeys. It returns the destination object.\n  static #cloneObjectExceptKeys(src = {}, excludeKeys = []) {\n    const cloned = {}\n    for (const key in src) {\n      if (!excludeKeys.includes(key)) {\n        cloned[key] = src[key]\n      }\n    }\n\n    return cloned\n  }\n\n  #customErrorMessage(err) {\n    let message\n    let messageArr = []\n    if (err.response?.status) messageArr.push(err.response.status)\n    if (err.response?.statusText) messageArr.push(err.response.statusText)\n    if (messageArr.length > 0) messageArr = [messageArr.join(' ') + ':']\n    if (err.response?.data?.message) messageArr.push(err.response.data.message)\n    if (messageArr.length > 0) {\n      message = messageArr.join(' ')\n    } else {\n      message = err.message\n    }\n\n    const code = err.response?.data?.code || err.code\n    return { message, code }\n  }\n\n  /**\n   * Makes a request to a public API endpoint (no authentication is necessary)\n   * \n   * @private\n   * @param method\n   * @param path\n   * @param params\n   * @param body\n   * @param getApiCallRateInfo\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - returns either Poloniex result or API call rate information\n   */\n  #requestPub(method, path, params, body, getApiCallRateInfo) {\n    if (getApiCallRateInfo) {\n      const key = this.#classifyApiCall(method, path)\n      return [key, this.apiCallRates[key], this.apiCallRateLimits[key]]\n    }\n\n    return new Promise((resolve, reject) => {\n      const url = Poloniex.#baseUrl.rest + path\n      axios({ method, url, params, data: body })\n        .then((res) => resolve (res.data))\n        .then((res) => resolve (res.data))\n        .catch((err) => {\n          const errData = this.#customErrorMessage(err)\n          const error = new Error(errData.message)\n          error.code = errData.code\n          reject(error)\n        })\n    })\n  }\n\n  // Generates signed request headers\n  static #getRequestHeaders(method, path, params, body, apiKey, apiSecret) {\n    const timestamp = Date.now()\n    // Composes the parameters string: the timestamp parameter and the list of parameters, sorted by ASCII order and delimited by &. All parameters are URL/UTF-8 encoded (i.e. space is encoded as \"%20\").\n    const composeParamString = function (params, timestamp) {\n      const values = [`signTimestamp=${timestamp}`]\n      Object.entries(params).forEach(([k, v]) => values.push(`${k}=${encodeURIComponent(v)}`))\n      return values.sort().join(\"&\")\n    }\n\n    // Composes the body string. signTimestamp needs to be added, even if there is no body\n    const composeBodyString = function (body, timestamp) {\n      if (Object.keys(body).length > 0) {\n        return `requestBody=${JSON.stringify(body)}` + `&signTimestamp=${timestamp}`\n      } else {\n        return `signTimestamp=${timestamp}`\n      }\n    }\n\n    // Generates the digital signature\n    const sign = function sign(method, path, requestString, apiSecret) {\n      const payload = method + \"\\n\" + path + \"\\n\" + requestString\n      const hmacData = CryptoJS.HmacSHA256(payload, apiSecret)\n      return CryptoJS.enc.Base64.stringify(hmacData)\n    }\n\n    let requestString\n    if (method === 'DELETE' || method === 'POST' || method === 'PUT') {\n      requestString = composeBodyString(body, timestamp)\n    } else {\n      requestString = composeParamString(params, timestamp)\n    }\n\n    const signature = sign(method, path, requestString, apiSecret, timestamp)\n    return {\n      \"Content-Type\": \"application/json\",\n      \"key\": apiKey,\n      'signatureMethod': 'HmacSHA256',\n      \"signature\": signature,\n      \"signTimestamp\": timestamp\n    }\n  }\n\n  /**\n   * Makes a request to an authenticated API endpoint (API signature is required)\n   * \n   * @private\n   * @param method\n   * @param path\n   * @param params\n   * @param body\n   * @param getApiCallRateInfo\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - returns either Poloniex result or API call rate information\n   */\n  #requestAuth(method, path, params, body, getApiCallRateInfo) {\n    if (getApiCallRateInfo) {\n      const key = this.#classifyApiCall(method, path)\n      return [key, this.apiCallRates[key], this.apiCallRateLimits[key]]\n    }\n\n    return new Promise((resolve, reject) => {\n      const headers = Poloniex.#getRequestHeaders(method, path, params, body, this.#apiKey, this.#apiSecret)\n      const url = Poloniex.#baseUrl.rest + path\n      axios({ method, url, headers, params, data: body })\n        .then((res) => resolve (res.data))\n        .catch((err) => {\n          const errData = this.#customErrorMessage(err)\n          const error = new Error(errData.message)\n          error.code = errData.code\n          reject(error)\n        })\n    })\n  }\n\n  /**\n   * API call rate limits for endpoints sets\n   * @type {{riPriv: number, riPub: number, nriPub: number, nriPriv: number}}\n   */\n  apiCallRateLimits = {\n    riPub: 10,\n    nriPub: 200,\n    nriPriv: 50,\n    riPriv: 10\n  }\n\n  /**\n   * Current call rate for resource-intensive and non-resource-intensive private and public API calls\n   *\n   * @type {{riPriv: number, riPub: number, nriPub: number, nriPriv: number}}\n   */\n  apiCallRates = {\n      nriPub: 0,\n      riPub: 0,\n      nriPriv: 0,\n      riPriv: 0,\n    }\n\n  /**\n   * Get symbols and their trade info.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.symbol] - a single symbol name\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getSymbols(requestParameters) {\n    const path = ['/markets', requestParameters?.symbol].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['symbol', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get supported currencies.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.currency] - a single currency\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getCurrencies(requestParameters) {\n    const path = ['/currencies', requestParameters?.currency].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['currency', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get current server time.\n   *\n   * @param {Object} [requestParameters]\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getTimestamp(requestParameters) {\n    const path = '/timestamp'\n    return this.#requestPub('GET', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get the latest trade price for symbols.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.symbol] - a single symbol\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getPrices(requestParameters) {\n    const path = ['/markets', requestParameters?.symbol, 'price'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['symbol', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get the latest mark price for cross margin symbols.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.symbol] - a single symbol\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getMarkPrice(requestParameters) {\n    const path = ['/markets', requestParameters?.symbol, 'markPrice'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['symbol', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get components of the mark price for a given symbol.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.symbol - a single symbol\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getMarkPriceComponents(requestParameters) {\n    const path = ['/markets', requestParameters?.symbol, 'markPriceComponents'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['symbol', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get the order book for a given symbol.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.symbol - a single symbol\n   * @param {String} [requestParameters.scale] - controls aggregation by price\n   * @param {Number} [requestParameters.limit] - controls aggregation by price\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getOrderBook(requestParameters) {\n    const path = ['/markets', requestParameters?.symbol, 'orderBook'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['orderBook', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Returns OHLC for a symbol at given timeframe (interval).\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.symbol - a single symbol\n   * @param {\"MINUTE_1\"|\"MINUTE_5\"|\"MINUTE_10\"|\"MINUTE_15\"|\"MINUTE_30\"|\"HOUR_1\"|\"HOUR_2\"|\"HOUR_4\"|\"HOUR_6\"|\"HOUR_12\"|\"DAY_1\"|\"DAY_3\"|\"WEEK_1\"|\"MONTH_1\"} requestParameters.interval - the unit of time to aggregate data by\n   * @param {Number} [requestParameters.limit] - maximum number of records returned\n   * @param {Number} [requestParameters.startTime] - filters by time\n   * @param {Number} [requestParameters.endTime] - filters by time\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getCandles(requestParameters) {\n    const path = ['/markets', requestParameters?.symbol, 'candles'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['candles', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Returns a list of recent trades.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.symbol - a single symbol\n   * @param {Number} [requestParameters.limit] - maximum number of records returned\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getTrades(requestParameters) {\n    const path = ['/markets', requestParameters?.symbol, 'trades'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['trades', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Returns ticker in last 24 hours for all symbols.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.symbol] - a single symbol\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getTicker(requestParameters) {\n    const path = ['/markets', requestParameters?.symbol, 'ticker24h'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['symbol', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get collateral information for currencies.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.currency] - a single currency\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getCollateralInfo(requestParameters) {\n    const path = ['/markets', requestParameters?.currency, 'collateralInfo'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['currency', 'getApiCallRateInfo'])\n    return this.#requestPub('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get borrow rates information for all tiers and currencies.\n   *\n   * @param {Object} [requestParameters]\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getBorrowRatesInfo(requestParameters) {\n    const path = '/markets/borrowRatesInfo'\n    return this.#requestPub('GET', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  // Authenticated Methods\n\n  /**\n   * Get a list of all accounts of a use.\n   *\n   * @param {Object} [requestParameters]\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getAccountsInfo(requestParameters) {\n    const path = '/accounts'\n    return this.#requestAuth('GET', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of accounts of a user with each account’s id, type and balances.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.id] - a single account\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getAccountsBalances(requestParameters) {\n    const path = ['/accounts', requestParameters?.id, 'balances'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['id', 'getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of activities such as airdrop, rebates, staking, credit/debit adjustments, and other (historical adjustments).\n   *\n   * @param {Object} [requestParameters]\n   * @param {Number} [requestParameters.startTime] - trades filled before startTime will not be retrieved\n   * @param {Number} [requestParameters.endTime] - trades filled after endTime will not be retrieved\n   * @param {Number} [requestParameters.activityType] - type of activity\n   * @param {Number} [requestParameters.limit] -  max number of records\n   * @param {Number} [requestParameters.from] - it is 'id'. The query begin at ‘from', and the default is 0\n   * @param {\"PRE\"|\"NEXT\"} [requestParameters.direction] - PRE, NEXT, default is NEXT\n   * @param {String} [requestParameters.currency] - transferred currency\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getAccountsActivity(requestParameters) {\n    const path = '/accounts/activity'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Transfer amount of currency from an account to another account for a user.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.currency - currency to transfer\n   * @param {String} requestParameters.amount - amount to transfer\n   * @param {String} requestParameters.fromAccount - account from which the currency is transferred\n   * @param {String} requestParameters.toAccount - account to which the currency is transferred\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  accountsTransfer(requestParameters) {\n    const path = '/accounts/transfer'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('POST', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of transfer records of a user.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.id] - get a single transfer record corresponding to the transferId\n   * @param {Number} [requestParameters.limit] - a single account\n   * @param {Number} [requestParameters.from] - It is 'transferId'. The query begin at ‘from', and the default is 0\n   * @param {\"PRE\"|\"NEXT\"} [requestParameters.direction] - PRE, NEXT, default is NEXT\n   * @param {String} [requestParameters.currency] - transferred currency\n   * @param {Number} [requestParameters.startTime] - transfers before start time will not be retrieved\n   * @param {Number} [requestParameters.endTime] - transfers after end time will not be retrieved\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getAccountsTransferRecords(requestParameters) {\n    const path = ['/accounts/transfer', requestParameters?.id].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['id', 'getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get fee rate.\n   *\n   * @param {Object} [requestParameters]\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getFeeInfo(requestParameters) {\n    const path = '/feeinfo'\n    return this.#requestAuth('GET', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of all the accounts within an Account Group for a user.\n   *\n   * @param {Object} [requestParameters]\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getSubaccountsInfo(requestParameters) {\n    const path = '/subaccounts'\n    return this.#requestAuth('GET', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get balances information by currency and account type.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.id] - a single account\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getSubaccountsBalances(requestParameters) {\n    const path = ['/subaccounts', requestParameters?.id, 'balances'].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['id', 'getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Transfer amount of currency from an account and account type to another account and account type among the accounts in the account group.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.currency - currency to transfer\n   * @param {String} requestParameters.amount - amount to transfer\n   * @param {String} requestParameters.fromAccountId - external UID of the from account\n   * @param {\"SPOT\"|\"FUTURES\"} requestParameters.fromAccountType - from account type\n   * @param {String} requestParameters.toAccountId - external UID of the to account\n   * @param {\"SPOT\"|\"FUTURES\"} requestParameters.toAccountType - to account type\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  subaccountsTransfer(requestParameters) {\n    const path = '/subaccounts/transfer'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('POST', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of transfer records of a user.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.id] - get a single transfer record corresponding to the transferId\n   * @param {Number} [requestParameters.limit] - max number of records\n   * @param {Number} [requestParameters.from] - it is 'transferId'. The query begin at ‘from', and the default is 0\n   * @param {\"PRE\"|\"NEXT\"} [requestParameters.direction] - PRE, NEXT, default is NEXT\n   * @param {String} [requestParameters.currency] -  transferred currency\n   * @param {String} [requestParameters.fromAccountId] - external UID of the from account\n   * @param {\"SPOT\"|\"FUTURES\"} [requestParameters.fromAccountType] - from account type\n   * @param {String} [requestParameters.toAccountId] - external UID of the to account\n   * @param {\"SPOT\"|\"FUTURES\"} [requestParameters.toAccountType] - to account type\n   * @param {Number} [requestParameters.startTime] - transfers before start time will not be retrieved\n   * @param {Number} [requestParameters.endTime] - transfers after end time will not be retrieved\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getSubaccountsTransferRecords(requestParameters) {\n    const path = ['/subaccounts/transfer', requestParameters?.id].filter(p => p).join('/')\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['id', 'getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get deposit addresses for a user.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.currency] - for a single the currency\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getDepositAddresses(requestParameters) {\n    const path = '/wallets/addresses'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get deposit and withdrawal activity history.\n   *\n   * @param {Object} requestParameters\n   * @param {Number} requestParameters.start - records before start time will not be retrieved\n   * @param {Number} requestParameters.end - records after end time will not be retrieved\n   * @param {\"deposits\"|\"withdrawals\"} [requestParameters.activityType] - type of activity\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getWalletsActivityRecords(requestParameters) {\n    const path = '/wallets/activity'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Create a new address for a currency.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.currency - the currency to use for the deposit address\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  createNewCurrencyAddress(requestParameters) {\n    const path = '/wallets/address'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('POST', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Immediately places a withdrawal for a given currency.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.currency - currency name\n   * @param {String} requestParameters.amount - withdrawal amount\n   * @param {String} requestParameters.address - withdrawal address\n   * @param {String} [requestParameters.paymentId] - paymentId for currencies that use a command deposit address\n   * @param {String} [requestParameters.allowBorrow] - allow to transfer borrowed funds\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  withdrawCurrency(requestParameters) {\n    const path = '/wallets/withdraw'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('POST', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get account margin information.\n   *\n   * @param {Object} [requestParameters]\n   * @param {\"SPOT\"} [requestParameters.accountType] - account type. Currently only SPOT is supported\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getMarginAccountInfo(requestParameters) {\n    const path = '/margin/accountMargin'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get borrow status of currencies.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.currency] - currency name\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getMarginBorrowStatus(requestParameters) {\n    const path = '/margin/borrowStatus'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get maximum and available buy/sell amount for a given symbol.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.symbol - symbol name\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getMarginMaxSize(requestParameters) {\n    const path = '/margin/maxSize'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Create an order for an account.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.symbol - symbol to trade\n   * @param {\"BUY\"|\"SELL\"} requestParameters.side - BUY, SELL\n   * @param {\"GTC\"|\"IOC\"|\"FOK\"} [requestParameters.timeInForce] - GTC, IOC, FOK\n   * @param {\"MARKET\"|\"LIMIT\"|\"LIMIT_MAKER\"} [requestParameters.type] - MARKET, LIMIT, LIMIT_MAKER (for placing post only orders)\n   * @param {\"SPOT\"} [requestParameters.accountType] - SPOT is the default and only supported one\n   * @param {String} [requestParameters.price] - price is required for non-market orders\n   * @param {String} [requestParameters.quantity] - base units for the order. Quantity is required for MARKET SELL or any LIMIT orders\n   * @param {String} [requestParameters.amount] - quote units for the order. Amount is required for MARKET BUY order\n   * @param {String} [requestParameters.clientOrderId] - maximum 64-character length\n   * @param {Boolean} [requestParameters.allowBorrow] - allow order to be placed by borrowing funds\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  createOrder(requestParameters) {\n    const path = '/orders'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('POST', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Create multiple orders via a single request.\n   *\n   * @param {Object} requestParameters\n   * @param {Array<{\n   *    symbol: String,\n   *    side: \"BUY\"|\"SELL\",\n   *    timeInForce: \"GTC\"|\"IOC\"|\"FOK\",\n   *    type: \"MARKET\"|\"LIMIT\"|\"LIMIT_MAKER\",\n   *    accountType: \"SPOT\",\n   *    price: String,\n   *    quantity: String,\n   *    amount: String,\n   *    clientOrderId: String,\n   * }>} requestParameters.orders - array of json objects with order details\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call   *\n   */\n  createBatchOrders(requestParameters) {\n    const path = '/orders/batch'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('POST', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Cancel an existing active order, new or partially filled, and place a new order.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.id - specify the existing order id. If id is a clientOrderId, prefix with cid: e.g. cid:myId-1\n   * @param {String} [requestParameters.clientOrderId] - clientOrderId of the new order\n   * @param {String} [requestParameters.price] - amended price\n   * @param {String} [requestParameters.quantity] - amended quantity\n   * @param {String} [requestParameters.amount] - amended amount (needed for MARKET buy)\n   * @param {\"MARKET\"|\"LIMIT\"|\"LIMIT_MAKER\"} [requestParameters.type] - MARKET, LIMIT, LIMIT_MAKER (for placing post only orders)\n   * @param {\"GTC\"|\"IOC\"|\"FOK\"} [requestParameters.timeInForce] - GTC, IOC, FOK\n   * @param {Boolean} [requestParameters.allowBorrow] - allow order to be placed by borrowing funds\n   * @param {Boolean} [requestParameters.proceedOnFailure] - new order should be placed if cancellation of the existing order fails\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  replaceOrder(requestParameters) {\n    const path = ['/orders', requestParameters.id].filter(p => p).join('/')\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['id', 'getApiCallRateInfo'])\n    return this.#requestAuth('PUT', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of active orders for an account.\n   *\n   * @param {Object} [requestParameters]\n   * @param {String} [requestParameters.symbol] -  symbol to trade\n   * @param {\"BUY\"|\"SELL\"} [requestParameters.side] - BUY, SELL\n   * @param {String} [requestParameters.from] - it is 'orderId'. The query begin at ‘from', and it is 0 when you first query\n   * @param {\"PRE\"|\"NEXT\"} [requestParameters.direction] - PRE, NEXT\n   * @param {Number} [requestParameters.limit] - max number of records to return\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getOpenOrders(requestParameters) {\n    const path = '/orders'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get an order’s status.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.id - either orderId or clientOrderId (prefix with cid: )\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getOrderDetails(requestParameters) {\n    const path = `/orders/${requestParameters.id}`\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Cancel an active order.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.id - order's id or its clientOrderId (prefix with cid: )\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  cancelOrder(requestParameters) {\n    const path = `/orders/${requestParameters.id}`\n    return this.#requestAuth('DELETE', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Batch cancel one or many active orders in an account by IDs.\n   *\n   * @param {Object} requestParameters\n   * @param {Array<String>} [requestParameters.orderIds] - array of order ids. Required if clientOrderIds is null or empty\n   * @param {Array<String>} [requestParameters.clientOrderIds] - array of order clientOrderIds. Required if orderIds is null or empty\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  cancelBatchOrders(requestParameters) {\n    const path = '/orders/cancelByIds'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('DELETE', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Cancel all orders in an account.\n   *\n   * @param {Object} [requestParameters]\n   * @param {Array<String>} [requestParameters.symbols] - if specified, only orders with those symbols are canceled\n   * @param {Array<\"SPOT\">} [requestParameters.accountTypes] - SPOT is the default and only supported one\n   * @required\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  cancelAllOrders(requestParameters) {\n    const path = '/orders'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('DELETE', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Set a timer that cancels all regular and smartorders after the timeout has expired.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.timeout - timer value in seconds\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  setKillSwitch(requestParameters) {\n    const path = '/orders/killSwitch'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('POST', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get status of kill switch.\n   *\n   * @param {Object} requestParameters\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getKillSwitchStatus(requestParameters) {\n    const path = '/orders/killSwitchStatus'\n    return this.#requestAuth('GET', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Create a smart order for an account.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.symbol - symbol to trade\n   * @param {\"BUY\"|\"SELL\"} requestParameters.side - BUY, SELL\n   * @param {\"GTC\"|\"IOC\"|\"FOK\"} [requestParameters.timeInForce] - GTC, IOC, FOK\n   * @param {\"STOP\"|\"STOP_LIMIT\"} [requestParameters.type] - STOP, STOP_LIMIT\n   * @param {\"SPOT\"} [requestParameters.accountType] - SPOT is the default and only supported one\n   * @param {String} [requestParameters.price] - price is required for non-market orders\n   * @param {String} [requestParameters.stopPrice] - price at which order is triggered\n   * @param {String} [requestParameters.quantity] - base units for the order\n   * @param {String} [requestParameters.amount] - quote units for the order\n   * @param {String} [requestParameters.clientOrderId] - maximum 64-character length\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  createSmartOrder(requestParameters) {\n    const path = '/smartorders'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('POST', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Cancel an existing untriggered smart order and place a new smart order.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.id - specify the existing order id. If id is a clientOrderId, prefix with cid: e.g. cid:myId-1\n   * @param {String} [requestParameters.clientOrderId] - clientOrderId of the new order\n   * @param {String} [requestParameters.price] - amended price\n   * @param {String} [requestParameters.stopPrice] - amended price at which order is triggered\n   * @param {String} [requestParameters.quantity] - amended quantity\n   * @param {String} [requestParameters.amount] - amended amount (needed for MARKET buy)\n   * @param {\"STOP\"|\"STOP_LIMIT\"} [requestParameters.type] - amended type; STOP, STOP_LIMIT\n   * @param {\"GTC\"|\"IOC\"|\"FOK\"} [requestParameters.timeInForce] - amended timeInForce; GTC, IOC, FOK\n   * @param {Boolean} [requestParameters.proceedOnFailure] - new order should be placed if cancellation of the existing order fails\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  replaceSmartOrder(requestParameters) {\n    const path = ['/smartorders', requestParameters.id].filter(p => p).join('/')\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['id', 'getApiCallRateInfo'])\n    return this.#requestAuth('PUT', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of (pending) smart orders for an account.\n   *\n   * @param {Object} [requestParameters]\n   * @param {Number} [requestParameters.limit] - max number of records to return\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getSmartOpenOrders(requestParameters) {\n    const path = '/smartorders'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a smart order’s status.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.id - smart order's id or its clientOrderId (prefix with cid: )\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getSmartOrderDetails(requestParameters) {\n    const path = `/orders/${requestParameters.id}`\n    return this.#requestAuth('GET', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Cancel a smart order.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.id - order's id or its clientOrderId (prefix with cid: )\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  cancelSmartOrder(requestParameters) {\n    const path = `/smartorders/${requestParameters.id}`\n    return this.#requestAuth('DELETE', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Batch cancel one or many smart orders in an account by IDs.\n   *\n   * @param {Object} requestParameters\n   * @param {Array<String>} [requestParameters.orderIds] - array of order ids. Required if clientOrderIds is null or empty\n   * @param {Array<String>} [requestParameters.clientOrderIds] - array of order clientOrderIds. Required if orderIds is null or empty\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @required\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  cancelBatchSmartOrders(requestParameters) {\n    const path = '/smartorders/cancelByIds'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('DELETE', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Batch cancel all smart orders in an account.\n   *\n   * @param {Object} [requestParameters]\n   * @param {Array<String>} [requestParameters.symbols] - if specified, only orders with those symbols are canceled\n   * @param {Array<\"SPOT\">} [requestParameters.accountTypes] - SPOT is the default and only supported one\n   * @required\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call \n   */\n  cancelAllSmartOrders(requestParameters) {\n    const path = '/smartorders'\n    const body = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('DELETE', path, {}, body, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of historical orders in an account.\n   *\n   * @param {Object} [requestParameters]\n   * @param {\"SPOT\"} requestParameters.accountType - SPOT is the default and only supported one\n   * @param {\"MARKET\"|\"LIMIT\",\"LIMIT_MAKER\"} [requestParameters.type] - MARKET, LIMIT, LIMIT_MAKER\n   * @param {\"BUY\"|\"SELL\"} requestParameters.side - BUY, SELL\n   * @param {String} requestParameters.symbol - any supported symbol\n   * @param {\"Number\"} [requestParameters.from] - an 'orderId'. The query begins at ‘from'\n   * @param {\"PRE\"|\"NEXT\"} [requestParameters.direction] - PRE, NEXT The direction before or after ‘from'\n   * @param {\"String\"} [requestParameters.states] - FAILED, FILLED, CANCELED, PARTIALLY_CANCELED. Multiple states can be specified and separated with comma\n   * @param {\"Number\"} [requestParameters.limit] - max number of orders to return\n   * @param {\"Boolean\"} [requestParameters.hideCancel] - whether canceled orders should not be retrieved\n   * @param {\"Number\"} [requestParameters.startTime] - orders updated before startTime will not be retrieved\n   * @param {\"Number\"} [requestParameters.endTime] - orders updated after endTime will not be retrieved\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getOrdersHistory(requestParameters) {\n    const path = '/orders/history'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of historical smart orders in an account.\n   *\n   * @param {Object} [requestParameters]\n   * @param {\"SPOT\"} requestParameters.accountType - SPOT is the default and only supported one\n   * @param {\"STOP\"|\"STOP_LIMIT\"} [requestParameters.type] - STOP, STOP_LIMIT\n   * @param {\"BUY\"|\"SELL\"} requestParameters.side - BUY, SELL\n   * @param {String} requestParameters.symbol - any supported symbol\n   * @param {\"Number\"} [requestParameters.from] - an 'smart orderId'. The query begins at ‘from'.\n   * @param {\"PRE\"|\"NEXT\"} [requestParameters.direction] - PRE, NEXT The direction before or after ‘from'\n   * @param {\"String\"} [requestParameters.states] - FAILED, FILLED, CANCELED, PARTIALLY_CANCELED. Multiple states can be specified and separated with comma\n   * @param {\"Number\"} [requestParameters.limit] - max number of orders to return\n   * @param {\"Boolean\"} [requestParameters.hideCancel] - whether canceled smart orders should not be retrieved\n   * @param {\"Number\"} [requestParameters.startTime] - orders updated before startTime will not be retrieved\n   * @param {\"Number\"} [requestParameters.endTime] - orders updated after endTime will not be retrieved\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getSmartOrdersHistory(requestParameters) {\n    const path = '/smartorders/history'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of all trades for an account.\n   *\n   * @param {Object} [requestParameters]\n   * @param {\"Number\"} [requestParameters.limit] - max number of orders to return\n   * @param {\"Number\"} [requestParameters.startTime] - trades filled before startTime will not be retrieved\n   * @param {\"Number\"} [requestParameters.endTime] - trades filled after endTime will not be retrieved\n   * @param {\"Number\"} [requestParameters.from] - globally unique tradeid (use pageId value from response)\n   * @param {\"PRE\"|\"NEXT\"} [requestParameters.direction] - PRE, NEXT The direction before or after ‘from'\n   * @param {String} [requestParameters.symbols] - one or multiple symbols separated by comma\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getTradesHistory(requestParameters) {\n    const path = '/trades'\n    const params = Poloniex.#cloneObjectExceptKeys(requestParameters, ['getApiCallRateInfo'])\n    return this.#requestAuth('GET', path, params, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Get a list of all trades for an order specified by its orderId.\n   *\n   * @param {Object} requestParameters\n   * @param {String} requestParameters.id - the associated order's id (order's clientOrderId is not supported)\n   * @param {Boolean} [requestParameters.getApiCallRateInfo=false] - if api call rate info should be returned, instead of executing the API call\n   * @returns {Promise<*>|[\"riPub\"|\"nriPub\"|\"riPriv\"|\"nriPriv\",number, number]} - Poloniex response or rate and rate limit for the API call\n   */\n  getOrderTrades(requestParameters) {\n    const path = `/orders/${requestParameters.id}/trades`\n    return this.#requestAuth('GET', path, {}, {}, requestParameters?.getApiCallRateInfo)\n  }\n\n  /**\n   * Creates a new WebSocket for public channels.\n   *\n   * @param {Object} options\n   * @param {object} [options.reconnect] - Optional parameter for reconnecting. If parameter property is missing or `null`, no reconnection will reoccur\n   * @param {number} [options.reconnect.factor=1.5] - Multiplicative factor for exponential backoff strategy.\n   * @param {number} [options.reconnect.initialDelay=50] - Defaults to 50 ms\n   * @param {number} [options.reconnect.maxDelay=10000] - Defaults to 10000 ms\n   * @param {boolean} [options.reconnect.randomizeDelay=false] - Range of randomness and must be between 0 and 1. By default, no randomisation is applied\n   * @param {number} [options.timeout] - timeout in milliseconds after which the websockets reconnects when no messages are received. Defaults to no timeout.\n   * @returns {ForeverWebSocket} - a WebSocket\n   */\n  newPublicWebSocket(options= {}) {\n    const automaticOpen = options.automaticOpen === undefined || options.automaticOpen\n    const reconnect = options.reconnect === undefined ? {} : options.reconnect\n    const timeout = options.timeout\n    const ping = options.ping || {\n      interval: 30000,\n      data: { event: 'ping' }\n    }\n\n    const ws = new ForeverWebSocket(Poloniex.#baseUrl.wsPublic, undefined, { automaticOpen, reconnect, timeout, ping })\n\n    if (dbg_wsPub.enabled) {\n      ws.send = function (data) {\n        dbg_wsPub('send: ', data)\n        ForeverWebSocket.prototype.send.call(this, data)\n      }\n\n      ws.on('open', (data) => {\n        dbg_wsPub(`open`)\n      })\n\n      ws.on('message', (data) => {\n        dbg_wsPub('message: ', data.toString())\n      })\n\n      ws.on('error', (data) => {\n        dbg_wsPub('error: ', data.toString())\n      })\n\n      ws.on('close', (code, reason) => {\n        dbg_wsPub('close: ', code, reason.toString())\n      })\n    }\n\n    return ws\n  }\n\n  /**\n   * Creates a new WebSocket for authenticated channels.\n   *\n   * @param {Object} options\n   * @param {object} [options.reconnect] - Optional parameter for reconnecting. If parameter property is missing or `null`, no reconnection will reoccur\n   * @param {number} [options.reconnect.factor=1.5] - Multiplicative factor for exponential backoff strategy.\n   * @param {number} [options.reconnect.initialDelay=50] - Defaults to 50 ms\n   * @param {number} [options.reconnect.maxDelay=10000] - Defaults to 10000 ms\n   * @param {boolean} [options.reconnect.randomizeDelay=false] - Range of randomness and must be between 0 and 1. By default, no randomisation is applied\n   * @param {number} [options.timeout] - timeout in milliseconds after which the websockets reconnects when no messages are received. Defaults to no timeout.\n   * @returns {ForeverWebSocket} - a WebSocket\n   */\n  newAuthenticatedWebSocket(options = {}) {\n    const automaticOpen = options.automaticOpen === undefined || options.automaticOpen\n    const reconnect = options.reconnect === undefined ? {} : options.reconnect\n    const timeout = options.timeout\n    const ping = options.ping || {\n      interval: 30000,\n      data: { event: 'ping' }\n    }\n\n    const ws = new ForeverWebSocket(Poloniex.#baseUrl.wsPrivate, undefined, { automaticOpen, reconnect, timeout, ping })\n\n    if (dbg_wsAuth.enabled) {\n      ws.send = function (data) {\n        dbg_wsAuth('send: ', data)\n        ForeverWebSocket.prototype.send.call(this, data)\n      }\n\n      ws.on('open', (data) => {\n        dbg_wsAuth(`open`)\n      })\n\n      ws.on('message', (data) => {\n        dbg_wsAuth('message: ', data.toString())\n      })\n\n      ws.on('error', (data) => {\n        dbg_wsAuth('error: ', data.toString())\n      })\n\n      ws.on('close', (code, reason) => {\n        dbg_wsAuth('close: ', code, reason.toString())\n      })\n    }\n\n    ws.on('open', () => {\n      const headers = Poloniex.#getRequestHeaders('GET', '/ws', {}, null, this.#apiKey, this.#apiSecret)\n      ws.send({\n        event: \"subscribe\",\n        channel: [\"auth\"],\n        params: {\n          key: headers.key,\n          signTimestamp: headers.signTimestamp,\n          signature: headers.signature\n        }\n      })\n    })\n\n    return ws\n  }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAAoD,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpD,MAAMG,QAAQ,GAAG,IAAAC,cAAK,EAAC,UAAU,CAAC;AAClC,MAAMC,SAAS,GAAG,IAAAD,cAAK,EAAC,YAAY,CAAC;AACrC,MAAME,UAAU,GAAG,IAAAF,cAAK,EAAC,aAAa,CAAC;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMG,QAAQ,CAAC;EAC5B;EACA,OAAO,CAACC,OAAO,GAAG;IAChBC,IAAI,EAAE,0BAA0B;IAChCC,SAAS,EAAE,kCAAkC;IAC7CC,QAAQ,EAAE;EACZ,CAAC;;EAED;EACA,CAACC,0BAA0B,GAA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