@coinex-org/coinex
Version:
A lightweight, type-safe TypeScript HTTP client for the official CoinEx API v2, covering all major modules including Spot, Futures, Account, and Assets.
2 lines (1 loc) • 25.2 kB
JavaScript
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var Me=Object.defineProperty;var r=(n,e)=>Me(n,"name",{value:e,configurable:!0});var _deepmerge = require('deepmerge'); var _deepmerge2 = _interopRequireDefault(_deepmerge);var _ky = require('ky'); var _ky2 = _interopRequireDefault(_ky);var _crypto = require('crypto');function v(n,e,t,o,i){let a=`${n.toUpperCase()}${e}${t||""}${o}`,c=_crypto.createHmac.call(void 0, "sha256",i);return c.update(a),c.digest("hex").toLowerCase()}r(v,"signRequest");var f=class extends Error{static{r(this,"CoinExAPIError")}constructor(e,t){super(t),this.name="CoinExAPIError",this.code=e}};function s(n,e=!1){let t={};for(let o in n)n[o]!==void 0&&(e&&typeof n[o]=="object"&&n[o]!==null?t[o]=s(n[o],!0):t[o]=n[o]);return t}r(s,"noUndefined");var y=class{static{r(this,"Fees")}#e;constructor(e){this.#e=e}getAccountTradeFees(e,t={}){return this.#e.request("account/trade-fees",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}};var q=class{static{r(this,"Settings")}#e;constructor(e){this.#e=e}getFuturesMarketSettings(e={}){return this.#e.request("account/futures/settings",_deepmerge2.default.call(void 0, {method:"GET"},e))}modifyAccountSettings(e,t={}){return this.#e.request("account/settings",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}modifyFuturesMarketSettings(e,t={}){return this.#e.request("account/futures/settings",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}};var E=class{static{r(this,"SubAccount")}#e;constructor(e){this.#e=e}createSubAccount(e,t={}){return this.#e.request("account/subs",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}getSubAccountList(e={},t={}){return this.#e.request("account/subs",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}disableSubAccount(e,t={}){return this.#e.request("account/subs/frozen",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}enableSubAccount(e,t={}){return this.#e.request("account/subs/unfrozen",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}createSubAccountApiKey(e,t={}){return this.#e.request("account/subs/api",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}getSubAccountApiKeyDetail(e,t={}){return this.#e.request("account/subs/api-detail",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getSubAccountInfo(e={}){return this.#e.request("account/subs/info",_deepmerge2.default.call(void 0, {method:"GET"},e))}subAccountTransfer(e,t={}){return this.#e.request("account/subs/transfer",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}getSubAccountTransferHistory(e,t={}){return this.#e.request("account/subs/transfer-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getSubAccountApiKeyList(e,t={}){return this.#e.request("account/subs/api",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getSubAccountSpotBalance(e,t={}){return this.#e.request("account/subs/spot-balance",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}editSubAccountApiKey(e,t={}){return this.#e.request("account/subs/api",_deepmerge2.default.call(void 0, {method:"PUT",json:s(e)},t))}deleteSubAccountApiKey(e,t={}){return this.#e.request("account/subs/api",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}};var L=class{static{r(this,"Account")}#e;constructor(e){this.#e=e,this.subaccount=new E(e),this.fees=new y(e),this.settings=new q(e)}getAccountInfo(e={}){return this.#e.request("account/info",_deepmerge2.default.call(void 0, {method:"GET"},e))}};var C=class{static{r(this,"Amm")}#e;constructor(e){this.#e=e}addAMMLiquidity(e,t={}){return this.#e.request("assets/amm/liquidity",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}getAMMIncomeHistory(e,t={}){return this.#e.request("assets/amm/income-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getAMMLiquidityPool(e,t={}){return this.#e.request("assets/amm/liquidity-pool",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}removeAMMLiquidity(e,t={}){return this.#e.request("assets/amm/liquidity",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}};var G=class{static{r(this,"Balance")}#e;constructor(e){this.#e=e}getAMMLiquidity(e={},t={}){return this.#e.request("assets/amm-liquidity",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getCreditBalance(e={},t={}){return this.#e.request("assets/credit-balance",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getCreditInfo(e={},t={}){return this.#e.request("assets/credit-info",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getFinancialBalance(e={},t={}){return this.#e.request("assets/financial-balance",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getFuturesBalance(e={},t={}){return this.#e.request("assets/futures-balance",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getMarginBalance(e,t={}){return this.#e.request("assets/margin-balance",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getSpotBalance(e={},t={}){return this.#e.request("assets/spot-balance",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getSpotTransactionHistory(e={},t={}){return this.#e.request("assets/spot-transaction-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}};var T=class{static{r(this,"BorrowRepay")}#e;constructor(e){this.#e=e}getMarginBorrowHistory(e,t={}){return this.#e.request("assets/margin-borrow-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getMarginInterestLimit(e,t={}){return this.#e.request("assets/margin-interest-limit",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}marginBorrow(e,t={}){return this.#e.request("assets/margin-borrow",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}marginRepay(e,t={}){return this.#e.request("assets/margin-repay",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}};var g=class{static{r(this,"DepositWithdrawal")}#e;constructor(e){this.#e=e}cancelWithdrawal(e,t={}){return this.#e.request("assets/withdrawal/cancel",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}getDepositAddress(e,t={}){return this.#e.request("assets/deposit-address",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getDepositWithdrawalConfig(e,t={}){return this.#e.request("assets/deposit-withdraw-config",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getAllDepositWithdrawalConfig(e={}){return this.#e.request("assets/all-deposit-withdraw-config",_deepmerge2.default.call(void 0, {method:"GET"},e))}getAssetInfo(e,t={}){return this.#e.request("assets/info",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getDepositHistory(e,t={}){return this.#e.request("assets/deposit-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getWithdrawalHistory(e,t={}){return this.#e.request("assets/withdrawal-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}updateDepositAddress(e,t={}){return this.#e.request("assets/deposit-address",_deepmerge2.default.call(void 0, {method:"PUT",json:s(e)},t))}withdrawal(e,t={}){return this.#e.request("assets/withdrawal",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}};var x=class{static{r(this,"Transfer")}#e;constructor(e){this.#e=e}getAssetTransferHistory(e,t={}){return this.#e.request("assets/transfer-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}transfer(e,t={}){return this.#e.request("assets/transfer",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}};var k=class{static{r(this,"Assets")}constructor(e){this.amm=new C(e),this.balance=new G(e),this.borrowRepay=new T(e),this.depositWithdrawal=new g(e),this.transfer=new x(e)}};var b=class{static{r(this,"Maintain")}#e;constructor(e){this.#e=e}getMaintenanceInfo(e={}){return this.#e.request("maintain/info",{method:"GET",...e,context:{public:!0}})}};var I=class{static{r(this,"Deal")}#e;constructor(e){this.#e=e}listUserDeals(e,t={}){return this.#e.request("spot/user-deals",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listUserOrderDeals(e,t={}){return this.#e.request("spot/order-deals",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}};var D=class{static{r(this,"Market")}#e;constructor(e){this.#e=e}listMarket(e={},t={}){return this.#e.request("spot/market",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketTicker(e={},t={}){return this.#e.request("spot/ticker",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketDepth(e,t={}){return this.#e.request("spot/depth",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketKline(e,t={}){return this.#e.request("spot/kline",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketDeals(e,t={}){return this.#e.request("spot/deals",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketIndex(e={},t={}){return this.#e.request("spot/index",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}};var H=class{static{r(this,"SpotOrder")}#e;constructor(e){this.#e=e}putOrder(e,t={}){return this.#e.request("spot/order",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}putStopOrder(e,t={}){return this.#e.request("spot/stop-order",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}getOrderStatus(e,t={}){return this.#e.request("spot/order-status",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getMultiOrderStatus(e,t={}){return this.#e.request("spot/multi-order-status",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listPendingOrder(e,t={}){return this.#e.request("spot/pending-order",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listFinishedOrder(e,t={}){return this.#e.request("spot/finished-order",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listPendingStopOrder(e,t={}){return this.#e.request("spot/pending-stop-order",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listFinishedStopOrder(e,t={}){return this.#e.request("spot/finished-stop-order",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}editOrder(e,t={}){return this.#e.request("spot/order",_deepmerge2.default.call(void 0, {method:"PUT",json:s(e)},t))}editStopOrder(e,t={}){return this.#e.request("spot/stop-order",_deepmerge2.default.call(void 0, {method:"PUT",json:s(e)},t))}cancelOrder(e,t={}){return this.#e.request("spot/order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelOrderByClientId(e,t={}){return this.#e.request("spot/order/by-client-id",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelStopOrder(e,t={}){return this.#e.request("spot/stop-order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelStopOrderByClientId(e,t={}){return this.#e.request("spot/stop-order/by-client-id",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelAllOrder(e,t={}){return this.#e.request("spot/all-order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelBatchOrder(e,t={}){return this.#e.request("spot/batch-order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelBatchStopOrder(e,t={}){return this.#e.request("spot/batch-stop-order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}putMultiOrder(e,t={}){return this.#e.request("spot/multi-order",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}putMultiStopOrder(e,t={}){return this.#e.request("spot/multi-stop-order",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}};var F=class{static{r(this,"Spot")}constructor(e){this.market=new D(e),this.deal=new I(e),this.order=new H(e)}};var B=class{static{r(this,"Deal")}#e;constructor(e){this.#e=e}listUserDeals(e,t={}){return this.#e.request("futures/user-deals",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listUserOrderDeals(e,t={}){return this.#e.request("futures/order-deals",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}};var U=class{static{r(this,"Market")}#e;constructor(e){this.#e=e}listMarketBasisHistory(e,t={}){return this.#e.request("futures/basis-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketDeals(e,t={}){return this.#e.request("futures/deals",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketDepth(e,t={}){return this.#e.request("futures/depth",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketFundingRateHistory(e,t={}){return this.#e.request("futures/funding-rate-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketFundingRate(e,t={}){return this.#e.request("futures/funding-rate",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketIndex(e,t={}){return this.#e.request("futures/index",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketKline(e,t={}){return this.#e.request("futures/kline",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketLiquidationHistory(e,t={}){return this.#e.request("futures/liquidation-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketPositionLevel(e,t={}){return this.#e.request("futures/position-level",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketPremiumHistory(e,t={}){return this.#e.request("futures/premium-index-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarketTicker(e,t={}){return this.#e.request("futures/ticker",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}listMarket(e,t={}){return this.#e.request("futures/market",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e),context:{public:!0}},t))}};var w=class{static{r(this,"FuturesOrder")}#e;constructor(e){this.#e=e}putOrder(e,t={}){return this.#e.request("futures/order",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}putStopOrder(e,t={}){return this.#e.request("futures/stop-order",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}getOrderStatus(e,t={}){return this.#e.request("futures/order-status",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}getMultiOrderStatus(e,t={}){return this.#e.request("futures/multi-order-status",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listPendingOrder(e,t={}){return this.#e.request("futures/pending-order",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listFinishedOrder(e,t={}){return this.#e.request("futures/finished-order",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listPendingStopOrder(e,t={}){return this.#e.request("futures/pending-stop-order",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listFinishedStopOrder(e,t={}){return this.#e.request("futures/finished-stop-order",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}editOrder(e,t={}){return this.#e.request("futures/order",_deepmerge2.default.call(void 0, {method:"PUT",json:s(e)},t))}editStopOrder(e,t={}){return this.#e.request("futures/stop-order",_deepmerge2.default.call(void 0, {method:"PUT",json:s(e)},t))}cancelOrder(e,t={}){return this.#e.request("futures/order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelOrderByClientId(e,t={}){return this.#e.request("futures/order/by-client-id",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelStopOrder(e,t={}){return this.#e.request("futures/stop-order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelStopOrderByClientId(e,t={}){return this.#e.request("futures/stop-order/by-client-id",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelAllOrder(e,t={}){return this.#e.request("futures/all-order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelBatchOrder(e,t={}){return this.#e.request("futures/batch-order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}cancelBatchStopOrder(e,t={}){return this.#e.request("futures/batch-stop-order",_deepmerge2.default.call(void 0, {method:"DELETE",json:s(e)},t))}putMultiOrder(e,t={}){return this.#e.request("futures/multi-order",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}putMultiStopOrder(e,t={}){return this.#e.request("futures/multi-stop-order",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}};var _=class{static{r(this,"Position")}#e;constructor(e){this.#e=e}adjustPositionLeverage(e,t={}){return this.#e.request("futures/adjust-position-leverage",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}adjustPositionMargin(e,t={}){return this.#e.request("futures/adjust-position-margin",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}closePosition(e,t={}){return this.#e.request("futures/close-position",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}listFinishedPosition(e,t={}){return this.#e.request("futures/finished-position",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listPendingPosition(e,t={}){return this.#e.request("futures/pending-position",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listPositionAdlHistory(e,t={}){return this.#e.request("futures/adl-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listPositionFundingHistory(e,t={}){return this.#e.request("futures/position-funding-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listPositionMarginHistory(e,t={}){return this.#e.request("futures/position-margin-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}listPositionSettleHistory(e,t={}){return this.#e.request("futures/position-settle-history",_deepmerge2.default.call(void 0, {method:"GET",searchParams:s(e)},t))}setPositionStopLoss(e,t={}){return this.#e.request("futures/position-stop-loss",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}setPositionTakeProfit(e,t={}){return this.#e.request("futures/position-take-profit",_deepmerge2.default.call(void 0, {method:"POST",json:s(e)},t))}};var j=class{static{r(this,"Futures")}constructor(e){this.market=new U(e),this.deal=new B(e),this.order=new w(e),this.position=new _(e)}};var J=class{static{r(this,"CoinExClient")}#e;#t;#s;constructor(e){this.#e=e.apiKey,this.#t=e.secretKey;let t=r((o,i)=>{if(_optionalChain([i, 'access', _2 => _2.context, 'optionalAccess', _3 => _3.public]))return;let a=Date.now(),c=i.json?JSON.stringify(i.json):void 0,K=new URL(o.url),d=K.pathname+K.search,Le=v(o.method,d,c,a,this.#t);o.headers.set("X-COINEX-KEY",this.#e),o.headers.set("X-COINEX-SIGN",Le),o.headers.set("X-COINEX-TIMESTAMP",String(a)),c&&o.headers.set("Content-Type","application/json; charset=utf-8")},"beforeRequest");this.#s= exports.noUndefined =_ky2.default.create(_deepmerge2.default.call(void 0, {prefixUrl:"https://api.coinex.com/v2",timeout:1e4,hooks:{beforeRequest:[t],afterResponse:[async(o,i,a)=>{if(_optionalChain([a, 'access', _4 => _4.headers, 'access', _5 => _5.get, 'call', _6 => _6("content-type"), 'optionalAccess', _7 => _7.includes, 'call', _8 => _8("application/json")])){let d=await a.clone().json();if(d.code!==0)throw new f(d.code,d.message);return new Response(JSON.stringify(d.data),a)}return a}]}},e.kyOptions||{})),this.account=new L(this),this.assets=new k(this),this.maintain=new b(this),this.spot=new F(this),this.futures=new j(this)}request(e,t){let{responseType:o="json",...i}=t||{},a=this.#s(e,i);return o==="text"?a.text():a.json()}ping(e={}){return this.request("ping",_deepmerge2.default.call(void 0, {method:"GET",context:{public:!0}},e))}getSystemTime(e={}){return this.request("time",_deepmerge2.default.call(void 0, {method:"GET",context:{public:!0}},e))}};var Q=(o=>(o.SPOT="SPOT",o.MARGIN="MARGIN",o.FUTURES="FUTURES",o))(Q||{}),$= exports.MarketStatus =(o=>(o.BIDDING="bidding",o.COUNTING_DOWN="counting_down",o.ONLINE="online",o))($||{}),z= exports.OrderSide =(t=>(t.BUY="buy",t.SELL="sell",t))(z||{}),Z= exports.OrderType =(a=>(a.LIMIT="limit",a.MARKET="market",a.MAKER_ONLY="maker_only",a.IOC="ioc",a.FOK="fok",a))(Z||{}),ee= exports.StpMode =(o=>(o.CANCEL_TAKER="ct",o.CANCEL_MAKER="cm",o.CANCEL_BOTH="both",o))(ee||{}),te= exports.OrderEvent =(i=>(i.PUT="put",i.UPDATE="update",i.MODIFY="modify",i.FINISH="finish",i))(te||{}),se= exports.StopOrderEvent =(o=>(o.PUT="put",o.ACTIVE="active",o.CANCEL="cancel",o))(se||{}),re= exports.StopOrderStatus =(i=>(i.PUT="put",i.ACTIVE_SUCCESS="active_success",i.ACTIVE_FAIL="active_fail",i.CANCEL="cancel",i))(re||{}),oe= exports.TriggerDirection =(t=>(t.HIGHER="higher",t.LOWER="lower",t))(oe||{}),ie= exports.PositionEvent =(a=>(a.UPDATE="update",a.CLOSE="close",a.SYS_CLOSE="sys_close",a.ADL="adl",a.LIQ="liq",a))(ie||{}),ne= exports.Locale =(p=>(p.DE_DE="de-DE",p.EN_US="en-US",p.ES_AR="es-AR",p.ES_ES="es-ES",p.ES_MX="es-MX",p.FR_FR="fr-FR",p.KK_KZ="kk-KZ",p.ID_ID="id-ID",p.UK_UA="uk-UA",p.JA_JP="ja-JP",p.RU_RU="ru-RU",p.TH_TH="th-TH",p.PT_BR="pt-BR",p.TR_TR="tr-TR",p.VI_VN="vi-VN",p.ZH_TW="zh-TW",p.AR_SA="ar-SA",p.HI_IN="hi-IN",p.FIL_PH="fil-PH",p))(ne||{}),ae= exports.Permission =(i=>(i.FUTURES="FUTURES",i.MARGIN="MARGIN",i.AMM="AMM",i.API="API",i))(ae||{}),pe= exports.TransferDirection =(t=>(t.IN="in",t.OUT="out",t))(pe||{}),ue= exports.TransferStatus =(i=>(i.CREATED="created",i.DEDUCTED="deducted",i.FAILED="failed",i.FINISHED="finished",i))(ue||{}),me= exports.LoanStatus =(i=>(i.LOAN="loan",i.DEBT="debt",i.LIQUIDATED="liquidated",i.FINISH="finish",i))(me||{}),de= exports.DepositStatus =(c=>(c.PROCESSING="processing",c.CONFIRMING="confirming",c.CANCELLED="cancelled",c.FINISHED="finished",c.TOO_SMALL="too_small",c.EXCEPTION="exception",c))(de||{});var ce=(a=>(a.OPEN="open",a.PART_FILLED="part_filled",a.FILLED="filled",a.PART_CANCELED="part_canceled",a.CANCELED="canceled",a))(ce||{}),Pe= exports.ContractType =(t=>(t.LINEAR="linear",t.INVERSE="inverse",t))(Pe||{}),le= exports.MarginMode =(t=>(t.ISOLATED="isolated",t.CROSS="cross",t))(le||{}),he= exports.TakeProfitType =(t=>(t.LATEST_PRICE="latest_price",t.MARK_PRICE="mark_price",t))(he||{}),Re= exports.StopLossType =(t=>(t.LATEST_PRICE="latest_price",t.MARK_PRICE="mark_price",t))(Re||{}),Oe= exports.PositionSide =(t=>(t.SHORT="short",t.LONG="long",t))(Oe||{}),Se= exports.PositionFinishedType =(d=>(d.LIQ="liq",d.ADL="adl",d.SYS="sys",d.LIMIT="limit",d.MARKET="market",d.MARKET_CLOSE_ALL="market_close_all",d.TAKE_PROFIT="take_profit",d.STOP_LOSS="stop_loss",d))(Se||{}),fe= exports.TriggerPriceType =(o=>(o.LATEST_PRICE="latest_price",o.MARK_PRICE="mark_price",o.INDEX_PRICE="index_price",o))(fe||{}),ye= exports.TransactionType =(i=>(i.DEPOSIT="deposit",i.WITHDRAW="withdraw",i.TRADE="trade",i.MAKER_CASH_BACK="maker_cash_back",i))(ye||{}),qe= exports.AmmType =(t=>(t.INFINITE="infinite",t.FINITE="finite",t))(qe||{}),Ee= exports.UserType =(t=>(t.NORMAL="NORMAL",t.SUB_ACCOUNT="SUB_ACCOUNT",t))(Ee||{});exports.AmmType = qe; exports.CoinExAPIError = f; exports.CoinExClient = J; exports.ContractType = Pe; exports.DepositStatus = de; exports.LoanStatus = me; exports.Locale = ne; exports.MarginMode = le; exports.MarketStatus = $; exports.MarketType = Q; exports.OrderEvent = te; exports.OrderSide = z; exports.OrderStatus = ce; exports.OrderType = Z; exports.Permission = ae; exports.PositionEvent = ie; exports.PositionFinishedType = Se; exports.PositionSide = Oe; exports.StopLossType = Re; exports.StopOrderEvent = se; exports.StopOrderStatus = re; exports.StpMode = ee; exports.TakeProfitType = he; exports.TransactionType = ye; exports.TransferDirection = pe; exports.TransferStatus = ue; exports.TriggerDirection = oe; exports.TriggerPriceType = fe; exports.UserType = Ee; exports.noUndefined = s;