UNPKG

ccxt

Version:

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

1,021 lines (1,017 loc) • 546 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var kucoin$1 = require('./abstract/kucoin.js'); var errors = require('./base/errors.js'); var Precise = require('./base/Precise.js'); var number = require('./base/functions/number.js'); var sha256 = require('./static_dependencies/noble-hashes/sha256.js'); // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- /** * @class kucoin * @augments Exchange */ class kucoin extends kucoin$1["default"] { describe() { return this.deepExtend(super.describe(), { 'id': 'kucoin', 'name': 'KuCoin', 'countries': ['SC'], 'rateLimit': 7.5, 'version': 'v2', 'certified': true, 'pro': true, 'comment': 'Platform 2.0', 'quoteJsonNumbers': false, 'has': { 'CORS': undefined, 'spot': true, 'margin': true, 'swap': true, 'future': false, 'option': false, 'addMargin': true, 'borrowCrossMargin': true, 'borrowIsolatedMargin': true, 'cancelAllOrders': true, 'cancelOrder': true, 'cancelOrders': true, 'closeAllPositions': false, 'closePosition': true, 'createDepositAddress': true, 'createMarketBuyOrderWithCost': true, 'createMarketOrderWithCost': true, 'createMarketSellOrderWithCost': true, 'createOrder': true, 'createOrders': true, 'createOrderWithTakeProfitAndStopLoss': true, 'createPostOnlyOrder': true, 'createStopLimitOrder': true, 'createStopLossOrder': true, 'createStopMarketOrder': true, 'createStopOrder': true, 'createTakeProfitOrder': true, 'createTriggerOrder': true, 'editOrder': true, 'fetchAccounts': true, 'fetchBalance': true, 'fetchBorrowInterest': true, 'fetchBorrowRateHistories': true, 'fetchBorrowRateHistory': true, 'fetchClosedOrders': true, 'fetchCrossBorrowRate': true, 'fetchCrossBorrowRates': false, 'fetchCurrencies': true, 'fetchDepositAddress': true, 'fetchDepositAddresses': false, 'fetchDepositAddressesByNetwork': true, 'fetchDeposits': true, 'fetchDepositWithdrawFee': true, 'fetchDepositWithdrawFees': true, 'fetchFundingHistory': true, 'fetchFundingInterval': true, 'fetchFundingRate': true, 'fetchFundingRateHistory': true, 'fetchFundingRates': false, 'fetchIndexOHLCV': false, 'fetchIsolatedBorrowRate': false, 'fetchIsolatedBorrowRates': false, 'fetchL3OrderBook': true, 'fetchLedger': true, 'fetchLeverage': true, 'fetchLeverageTiers': false, 'fetchMarginAdjustmentHistory': false, 'fetchMarginMode': true, 'fetchMarketLeverageTiers': true, 'fetchMarkets': true, 'fetchMarkOHLCV': false, 'fetchMarkPrice': true, 'fetchMarkPrices': true, 'fetchMyTrades': true, 'fetchOHLCV': true, 'fetchOpenInterest': true, 'fetchOpenInterestHistory': true, 'fetchOpenInterests': true, 'fetchOpenOrders': true, 'fetchOrder': true, 'fetchOrderBook': true, 'fetchOrderBooks': false, 'fetchOrdersByStatus': true, 'fetchOrderTrades': true, 'fetchPosition': true, 'fetchPositionADLRank': true, 'fetchPositionHistory': true, 'fetchPositionMode': true, 'fetchPositions': true, 'fetchPositionsADLRank': true, 'fetchPositionsHistory': true, 'fetchPremiumIndexOHLCV': false, 'fetchStatus': true, 'fetchTicker': true, 'fetchTickers': true, 'fetchTime': true, 'fetchTrades': true, 'fetchTradingFee': true, 'fetchTradingFees': false, 'fetchTransactionFee': true, 'fetchTransfers': true, 'fetchWithdrawals': true, 'repayCrossMargin': true, 'repayIsolatedMargin': true, 'setLeverage': true, 'setMarginMode': true, 'setPositionMode': true, 'signIn': false, 'transfer': true, 'withdraw': true, }, 'urls': { 'logo': 'https://user-images.githubusercontent.com/51840849/87295558-132aaf80-c50e-11ea-9801-a2fb0c57c799.jpg', 'referral': 'https://www.kucoin.com/ucenter/signup?rcode=E5wkqe', 'api': { 'public': 'https://api.kucoin.com', 'private': 'https://api.kucoin.com', 'futuresPrivate': 'https://api-futures.kucoin.com', 'futuresPublic': 'https://api-futures.kucoin.com', 'webExchange': 'https://kucoin.com/_api', 'broker': 'https://api-broker.kucoin.com', 'earn': 'https://api.kucoin.com', 'uta': 'https://api.kucoin.com', 'utaPrivate': 'https://api.kucoin.com', }, 'www': 'https://www.kucoin.com', 'doc': [ 'https://docs.kucoin.com', ], }, 'requiredCredentials': { 'apiKey': true, 'secret': true, 'password': true, }, 'api': { // level VIP0 // Spot => 4000/30s // Weight = x // Pro, Futures, Management, Management, Earn, CopyTrading => 2000/30s // Weight = x*2 'public': { 'get': { // spot trading 'currencies': 3, 'currencies/{currency}': 3, 'symbols': 4, 'market/orderbook/level1': 2, 'market/allTickers': 15, 'market/stats': 15, 'markets': 3, 'market/orderbook/level{level}_{limit}': 4, 'market/orderbook/level2_20': 2, 'market/orderbook/level2_100': 4, 'market/histories': 3, 'market/candles': 3, 'prices': 3, 'timestamp': 3, 'status': 3, // margin trading 'mark-price/{symbol}/current': 2, 'mark-price/all-symbols': 10, 'margin/config': 25, 'announcements': 20, 'margin/collateralRatio': 10, // convert 'convert/symbol': 5, 'convert/currencies': 5, }, 'post': { // ws 'bullet-public': 10, }, }, 'private': { 'get': { // account 'user-info': 20, 'user/api-key': 20, 'accounts': 5, 'accounts/{accountId}': 5, 'accounts/ledgers': 2, 'hf/accounts/ledgers': 2, 'hf/margin/account/ledgers': 2, 'transaction-history': 2, 'sub/user': 20, 'sub-accounts/{subUserId}': 15, 'sub-accounts': 20, 'sub/api-key': 20, // funding 'margin/account': 40, 'margin/accounts': 15, 'isolated/accounts': 15, 'deposit-addresses': 5, 'deposits': 5, 'hist-deposits': 5, 'withdrawals': 20, 'hist-withdrawals': 20, 'withdrawals/quotas': 20, 'accounts/transferable': 20, 'transfer-list': 20, 'base-fee': 3, 'trade-fees': 3, // spot trading 'market/orderbook/level{level}': 3, 'market/orderbook/level2': 3, 'market/orderbook/level3': 3, 'hf/accounts/opened': 2, 'hf/orders/active': 2, 'hf/orders/active/symbols': 2, 'hf/margin/order/active/symbols': 2, 'hf/orders/done': 2, 'hf/orders/{orderId}': 2, 'hf/orders/client-order/{clientOid}': 2, 'hf/orders/dead-cancel-all/query': 2, 'hf/fills': 2, 'orders': 2, 'limit/orders': 3, 'orders/{orderId}': 2, 'order/client-order/{clientOid}': 2, 'fills': 10, 'limit/fills': 20, 'stop-order': 8, 'stop-order/{orderId}': 3, 'stop-order/queryOrderByClientOid': 3, 'oco/order/{orderId}': 2, 'oco/order/details/{orderId}': 2, 'oco/client-order/{clientOid}': 2, 'oco/orders': 2, // margin trading 'hf/margin/orders/active': 4, 'hf/margin/orders/done': 10, 'hf/margin/orders/{orderId}': 4, 'hf/margin/orders/client-order/{clientOid}': 5, 'hf/margin/fills': 5, 'hf/margin/stop-orders': 8, 'hf/margin/stop-order/orderId': 3, 'hf/margin/stop-order/clientOid': 3, 'hf/margin/oco-order/orderId': 2, 'hf/margin/oco-order/clientOid': 2, 'hf/margin/oco-order/detail/orderId': 2, 'hf/margin/oco-orders': 2, 'etf/info': 25, 'margin/currencies': 20, 'risk/limit/strategy': 20, 'isolated/symbols': 3, 'margin/symbols': 3, 'isolated/account/{symbol}': 50, 'margin/borrow': 15, 'margin/repay': 15, 'margin/interest': 20, 'project/list': 10, 'project/marketInterestRate': 5, 'redeem/orders': 10, 'purchase/orders': 10, // broker 'broker/api/rebase/download': 3, 'broker/queryMyCommission': 3, 'broker/queryUser': 3, 'broker/queryDetailByUid': 3, 'migrate/user/account/status': 3, // convert 'convert/quote': 20, 'convert/order/detail': 5, 'convert/order/history': 5, 'convert/limit/quote': 20, 'convert/limit/order/detail': 5, 'convert/limit/orders': 5, // affiliate 'affiliate/inviter/statistics': 30, }, 'post': { // account 'sub/user/created': 15, 'sub/api-key': 20, 'sub/api-key/update': 30, // funding 'deposit-addresses': 20, 'withdrawals': 5, 'accounts/universal-transfer': 4, 'accounts/sub-transfer': 30, 'accounts/inner-transfer': 15, 'transfer-out': 20, 'transfer-in': 20, // spot trading 'hf/orders': 1, 'hf/orders/test': 1, 'hf/orders/sync': 1, 'hf/orders/multi': 1, 'hf/orders/multi/sync': 1, 'hf/orders/alter': 1, 'hf/orders/dead-cancel-all': 2, 'orders': 2, 'orders/test': 2, 'orders/multi': 3, 'stop-order': 2, 'oco/order': 2, // margin trading 'hf/margin/order': 2, 'hf/margin/order/test': 2, 'hf/margin/stop-order': 3, 'margin/order': 5, 'margin/order/test': 5, 'hf/margin/oco-order': 2, 'margin/borrow': 15, 'margin/repay': 10, 'purchase': 15, 'redeem': 15, 'lend/purchase/update': 10, // convert 'convert/order': 20, 'convert/limit/order': 20, // ws 'bullet-private': 10, 'position/update-user-leverage': 5, 'deposit-address/create': 20, }, 'delete': { // account 'sub/api-key': 30, // funding 'withdrawals/{withdrawalId}': 20, // spot trading 'hf/orders/{orderId}': 1, 'hf/orders/sync/{orderId}': 1, 'hf/orders/client-order/{clientOid}': 1, 'hf/orders/sync/client-order/{clientOid}': 1, 'hf/orders/cancel/{orderId}': 1, 'hf/orders': 2, 'hf/orders/cancelAll': 30, 'orders/{orderId}': 3, 'order/client-order/{clientOid}': 5, 'orders': 20, 'stop-order/{orderId}': 3, 'stop-order/cancelOrderByClientOid': 5, 'stop-order/cancel': 3, 'oco/order/{orderId}': 3, 'oco/client-order/{clientOid}': 3, 'oco/orders': 3, // margin trading 'hf/margin/orders/{orderId}': 2, 'hf/margin/orders/client-order/{clientOid}': 2, 'hf/margin/orders': 5, 'hf/margin/stop-order/cancel-by-id': 3, 'hf/margin/stop-order/cancel-by-clientOid': 5, 'hf/margin/stop-order/cancel': 3, 'hf/margin/oco-order/cancel-by-id': 3, 'hf/margin/oco-order/cancel-by-clientOid': 3, 'hf/margin/oco-order/cancel': 3, // convert 'convert/limit/order/cancel': 5, }, }, 'futuresPublic': { 'get': { 'contracts/active': 6, 'contracts/{symbol}': 6, 'ticker': 4, 'allTickers': 10, 'level2/snapshot': 6, 'level2/depth20': 10, 'level2/depth100': 20, 'trade/history': 10, 'kline/query': 6, 'interest/query': 10, 'index/query': 4, 'mark-price/{symbol}/current': 6, 'premium/query': 6, 'trade-statistics': 6, 'funding-rate/{symbol}/current': 4, 'contract/funding-rates': 10, 'timestamp': 4, 'status': 8, // ? 'level2/message/query': 1.3953, 'contracts/risk-limit/{symbol}': 3, 'level3/message/query': 3, 'level3/snapshot': 3, // v2 }, 'post': { // ws 'bullet-public': 20, // 10PW }, }, 'futuresPrivate': { 'get': { // account 'transaction-history': 4, // funding 'account-overview': 10, 'account-overview-all': 12, 'transfer-list': 20, // futures 'orders': 4, 'stopOrders': 12, 'recentDoneOrders': 10, 'orders/{orderId}': 10, 'orders/byClientOid': 10, 'fills': 10, 'recentFills': 6, 'trade-fees': 6, 'openOrderStatistics': 20, 'position': 4, 'positions': 4, 'margin/maxWithdrawMargin': 20, 'contracts/risk-limit/{symbol}': 10, 'funding-history': 10, 'copy-trade/futures/get-max-open-size': 8, 'copy-trade/futures/position/margin/max-withdraw-margin': 20, 'history-positions': 4, 'position/getMarginMode': 4, 'position/getPositionMode': 4, 'deposit-address': 4, 'deposit-list': 4, 'withdrawals/quotas': 4, 'withdrawal-list': 4, 'sub/api-key': 4, 'trade-statistics': 4, 'getMaxOpenSize': 4, 'getCrossUserLeverage': 4, }, 'post': { // funding 'transfer-out': 20, 'transfer-in': 20, // futures 'orders': 4, 'st-orders': 4, 'orders/test': 4, 'orders/multi': 6, 'position/margin/auto-deposit-status': 8, 'margin/withdrawMargin': 10, 'position/margin/deposit-margin': 8, 'position/risk-limit-level/change': 8, 'copy-trade/futures/orders': 4, 'copy-trade/futures/orders/test': 4, 'copy-trade/futures/st-orders': 4, 'copy-trade/futures/position/margin/deposit-margin': 8, 'copy-trade/futures/position/margin/withdraw-margin': 20, 'copy-trade/futures/position/risk-limit-level/change': 4, 'copy-trade/futures/position/margin/auto-deposit-status': 8, 'copy-trade/futures/position/changeMarginMode': 4, 'copy-trade/futures/position/changeCrossUserLeverage': 4, 'copy-trade/getCrossModeMarginRequirement': 6, 'copy-trade/position/switchPositionMode': 4, 'changeCrossUserLeverage': 4, 'withdrawals': 4, 'sub/api-key': 4, 'sub/api-key/update': 4, 'position/changeMarginMode': 4, 'position/switchPositionMode': 4, // ws 'bullet-private': 20, // 10FW }, 'delete': { 'orders/{orderId}': 2, 'orders/client-order/{clientOid}': 2, 'orders': 20, 'stopOrders': 30, 'copy-trade/futures/orders': 1.5, 'copy-trade/futures/orders/client-order': 1.5, 'orders/multi-cancel': 40, 'withdrawals/{withdrawalId}': 10, 'cancel/transfer-out': 10, 'sub/api-key': 10, }, }, 'webExchange': { 'get': { 'currency/currency/chain-info': 1, 'contract/{symbol}/funding-rates': 2, }, }, 'broker': { 'get': { 'broker/nd/info': 4, 'broker/nd/account': 4, 'broker/nd/account/apikey': 4, 'broker/nd/rebase/download': 4, 'asset/ndbroker/deposit/list': 2, 'broker/nd/transfer/detail': 2, 'broker/nd/deposit/detail': 2, 'broker/nd/withdraw/detail': 2, }, 'post': { 'broker/nd/transfer': 2, 'broker/nd/account': 6, 'broker/nd/account/apikey': 6, 'broker/nd/account/update-apikey': 6, }, 'delete': { 'broker/nd/account/apikey': 6, }, }, 'earn': { 'get': { 'otc-loan/discount-rate-configs': 20, 'otc-loan/loan': 2, 'otc-loan/accounts': 2, 'earn/redeem-preview': 10, 'earn/saving/products': 10, 'earn/hold-assets': 10, 'earn/promotion/products': 10, 'earn/kcs-staking/products': 10, 'earn/staking/products': 10, 'earn/eth-staking/products': 10, 'struct-earn/dual/products': 6, 'struct-earn/orders': 10, }, 'post': { 'earn/orders': 10, 'struct-earn/orders': 10, }, 'delete': { 'earn/orders': 10, // 5EW }, }, 'uta': { 'get': { 'market/announcement': 40, 'market/currency': 6, 'asset/currencies': 6, 'market/instrument': 8, 'market/ticker': 30, 'market/trade': 6, 'market/kline': 6, 'market/funding-rate': 4, 'market/funding-rate-history': 10, 'market/cross-config': 50, 'market/collateral-discount-ratio': 20, 'market/index-price': 20, 'market/position-tiers': 40, 'market/open-interest': 20, 'server/status': 6, 'market/borrowable-currency': 30, }, }, 'utaPrivate': { 'get': { 'market/orderbook': 6, 'account/balance': 10, 'account/transfer-quota': 40, 'account/mode': 60, 'account/ledger': 4, 'account/interest-history': 30, 'asset/deposit/address': 10, 'account/deposit/address': 5, '{accountMode}/account/balance': 10, '{accountMode}/account/overview': 10, '{accountMode}/order/detail': 8, '{accountMode}/order/open-list': 8, '{accountMode}/order/history': 8, '{accountMode}/order/execution': 8, '{accountMode}/position/open-list': 6, '{accountMode}/position/history': 4, 'position/history': 4, '{accountMode}/position/tiers': 40, 'sub-account/balance': 10, 'user/fee-rate': 6, 'dcp/query': 4, 'unified/account/leverage': 20, 'position/funding-history': 30, 'account/interest-limits': 20, }, 'post': { 'account/transfer': 8, 'account/mode': 60, '{accountMode}/account/modify-leverage': 40, '{accountMode}/order/place': 2, '{accountMode}/order/place-batch': 8, '{accountMode}/order/cancel': 2, '{accountMode}/order/cancel-batch': 8, '{accountMode}/order/cancel-all': 40, 'sub-account/canTransferOut': 10, 'dcp/set': 4, '{accountMode}/account/modify-leverage-margin-cross': 40, }, }, }, 'timeframes': { '1m': '1min', '3m': '3min', '5m': '5min', '15m': '15min', '30m': '30min', '1h': '1hour', '2h': '2hour', '4h': '4hour', '6h': '6hour', '8h': '8hour', '12h': '12hour', '1d': '1day', '1w': '1week', '1M': '1month', }, 'precisionMode': number.TICK_SIZE, 'exceptions': { 'exact': { 'Order not exist or not allow to be cancelled': errors.OrderNotFound, 'The order does not exist.': errors.OrderNotFound, 'order not exist': errors.OrderNotFound, 'order not exist.': errors.OrderNotFound, 'order_not_exist': errors.OrderNotFound, 'order_not_exist_or_not_allow_to_cancel': errors.InvalidOrder, 'Order size below the minimum requirement.': errors.InvalidOrder, 'Order size increment invalid.': errors.InvalidOrder, 'The withdrawal amount is below the minimum requirement.': errors.ExchangeError, 'Unsuccessful! Exceeded the max. funds out-transfer limit': errors.InsufficientFunds, 'The amount increment is invalid.': errors.BadRequest, 'The quantity is below the minimum requirement.': errors.InvalidOrder, 'not in the given range!': errors.BadRequest, 'recAccountType not in the given range': errors.BadRequest, 'Unsupported trading pair.': errors.BadSymbol, '400': errors.BadRequest, '401': errors.AuthenticationError, '403': errors.NotSupported, '404': errors.NotSupported, '405': errors.NotSupported, '415': errors.NotSupported, '429': errors.RateLimitExceeded, '500': errors.ExchangeNotAvailable, '503': errors.ExchangeNotAvailable, '101030': errors.PermissionDenied, '103000': errors.InvalidOrder, '112010': errors.PermissionDenied, '130101': errors.BadRequest, '130102': errors.ExchangeError, '130103': errors.OrderNotFound, '130104': errors.ExchangeError, '130105': errors.InsufficientFunds, '130106': errors.NotSupported, '130107': errors.ExchangeError, '130108': errors.OrderNotFound, '130201': errors.PermissionDenied, '130202': errors.ExchangeError, '130203': errors.InsufficientFunds, '130204': errors.BadRequest, '130301': errors.InsufficientFunds, '130302': errors.PermissionDenied, '130303': errors.NotSupported, '130304': errors.NotSupported, '130305': errors.NotSupported, '130306': errors.NotSupported, '130307': errors.NotSupported, '130308': errors.InvalidOrder, '130309': errors.InvalidOrder, '130310': errors.ExchangeError, '130311': errors.InvalidOrder, '130312': errors.InvalidOrder, '130313': errors.InvalidOrder, '130314': errors.InvalidOrder, '130315': errors.NotSupported, '126000': errors.ExchangeError, '126001': errors.NotSupported, '126002': errors.ExchangeError, '126003': errors.InvalidOrder, '126004': errors.ExchangeError, '126005': errors.PermissionDenied, '126006': errors.ExchangeError, '126007': errors.ExchangeError, '126009': errors.ExchangeError, '126010': errors.ExchangeError, '126011': errors.ExchangeError, '126013': errors.InsufficientFunds, '126015': errors.ExchangeError, '126021': errors.NotSupported, '126022': errors.InvalidOrder, '126027': errors.InvalidOrder, '126028': errors.InvalidOrder, '126029': errors.InvalidOrder, '126030': errors.InvalidOrder, '126033': errors.InvalidOrder, '126034': errors.InvalidOrder, '126036': errors.InvalidOrder, '126037': errors.ExchangeError, '126038': errors.ExchangeError, '126039': errors.ExchangeError, '126041': errors.ExchangeError, '126042': errors.ExchangeError, '126043': errors.OrderNotFound, '126044': errors.InvalidOrder, '126045': errors.NotSupported, '126046': errors.NotSupported, '126047': errors.PermissionDenied, '126048': errors.PermissionDenied, '135005': errors.ExchangeError, '135018': errors.ExchangeError, '200004': errors.InsufficientFunds, '210014': errors.InvalidOrder, '210021': errors.InsufficientFunds, '230003': errors.InsufficientFunds, '260000': errors.InvalidAddress, '260100': errors.InsufficientFunds, '300000': errors.InvalidOrder, '400000': errors.BadSymbol, '400001': errors.AuthenticationError, '400002': errors.InvalidNonce, '400003': errors.AuthenticationError, '400004': errors.AuthenticationError, '400005': errors.AuthenticationError, '400006': errors.AuthenticationError, '400007': errors.AuthenticationError, '400008': errors.NotSupported, '400100': errors.BadRequest, '400200': errors.InvalidOrder, '400330': errors.InvalidOrder, '400350': errors.InvalidOrder, '400370': errors.InvalidOrder, '400400': errors.BadRequest, '400401': errors.AuthenticationError, '400500': errors.RestrictedLocation, '400600': errors.BadSymbol, '400760': errors.InvalidOrder, '401000': errors.BadRequest, '408000': errors.BadRequest, '411100': errors.AccountSuspended, '415000': errors.BadRequest, '400303': errors.PermissionDenied, '500000': errors.ExchangeNotAvailable, '260220': errors.InvalidAddress, '600100': errors.InsufficientFunds, '600101': errors.InvalidOrder, '900014': errors.BadRequest, // futures errors '330012': errors.InvalidOrder, '330005': errors.InvalidOrder, '100001': errors.OrderNotFound, '100004': errors.BadRequest, '300003': errors.InsufficientFunds, '300012': errors.InvalidOrder, '404000': errors.NotSupported, '300009': errors.InvalidOrder, '330008': errors.InsufficientFunds, // {"msg":"Your current margin and leverage have reached the maximum open limit. Please increase your margin or raise your leverage to open larger positions.","code":"330008"} }, 'broad': { 'pageSize should not greater than 500': errors.BadRequest, 'Exceeded the access frequency': errors.RateLimitExceeded, 'require more permission': errors.PermissionDenied, // futures errors 'Position does not exist': errors.OrderNotFound, // { "code":"200000", "msg":"Position does not exist" } }, }, 'fees': { 'trading': { 'tierBased': true, 'percentage': true, 'taker': this.parseNumber('0.001'), 'maker': this.parseNumber('0.001'), 'tiers': { 'taker': [ [this.parseNumber('0'), this.parseNumber('0.001')], [this.parseNumber('50'), this.parseNumber('0.001')], [this.parseNumber('200'), this.parseNumber('0.0009')], [this.parseNumber('500'), this.parseNumber('0.0008')], [this.parseNumber('1000'), this.parseNumber('0.0007')], [this.parseNumber('2000'), this.parseNumber('0.0007')], [this.parseNumber('4000'), this.parseNumber('0.0006')], [this.parseNumber('8000'), this.parseNumber('0.0005')], [this.parseNumber('15000'), this.parseNumber('0.00045')], [this.parseNumber('25000'), this.parseNumber('0.0004')], [this.parseNumber('40000'), this.parseNumber('0.00035')], [this.parseNumber('60000'), this.parseNumber('0.0003')], [this.parseNumber('80000'), this.parseNumber('0.00025')], ], 'maker': [ [this.parseNumber('0'), this.parseNumber('0.001')], [this.parseNumber('50'), this.parseNumber('0.0009')], [this.parseNumber('200'), this.parseNumber('0.0007')], [this.parseNumber('500'), this.parseNumber('0.0005')], [this.parseNumber('1000'), this.parseNumber('0.0003')], [this.parseNumber('2000'), this.parseNumber('0')], [this.parseNumber('4000'), this.parseNumber('0')], [this.parseNumber('8000'), this.parseNumber('0')], [this.parseNumber('15000'), this.parseNumber('-0.00005')], [this.parseNumber('25000'), this.parseNumber('-0.00005')], [this.parseNumber('40000'), this.parseNumber('-0.00005')], [this.parseNumber('60000'), this.parseNumber('-0.00005')], [this.parseNumber('80000'), this.parseNumber('-0.00005')], ], }, }, 'spot': { 'tierBased': true, 'percentage': true, 'taker': this.parseNumber('0.001'), 'maker': this.parseNumber('0.001'), 'tiers': { 'taker': [ [this.parseNumber('0'), this.parseNumber('0.001')], [this.parseNumber('50'), this.parseNumber('0.001')], [this.parseNumber('200'), this.parseNumber('0.0009')], [this.parseNumber('500'), this.parseNumber('0.0008')], [this.parseNumber('1000'), this.parseNumber('0.0007')], [this.parseNumber('2000'), this.parseNumber('0.0007')], [this.parseNumber('4000'), this.parseNumber('0.0006')], [this.parseNumber('8000'), this.parseNumber('0.0005')], [this.parseNumber('15000'), this.parseNumber('0.00045')], [this.parseNumber('25000'), this.parseNumber('0.0004')], [this.parseNumber('40000'), this.parseNumber('0.00035')], [this.parseNumber('60000'), this.parseNumber('0.0003')], [this.parseNumber('80000'), this.parseNumber('0.00025')], ], 'maker': [ [this.parseNumber('0'), this.parseNumber('0.001')], [this.parseNumber('50'), this.parseNumber('0.0009')], [this.parseNumber('200'), this.parseNumber('0.0007')], [this.parseNumber('500'), this.parseNumber('0.0005')], [this.parseNumber('1000'), this.parseNumber('0.0003')], [this.parseNumber('2000'), this.parseNumber('0')], [this.parseNumber('4000'), this.parseNumber('0')], [this.parseNumber('8000'), this.parseNumber('0')], [this.parseNumber('15000'), this.parseNumber('-0.00005')], [this.parseNumber('25000'), this.parseNumber('-0.00005')], [this.parseNumber('40000'), this.parseNumber('-0.00005')], [this.parseNumber('60000'), this.parseNumber('-0.00005')], [this.parseNumber('80000'), this.parseNumber('-0.00005')], ], }, }, 'contract': { 'tierBased': true, 'percentage': true, 'taker': this.parseNumber('0.0006'), 'maker': this.parseNumber('0.0002'), 'tiers': { 'taker': [ [this.parseNumber('0'), this.parseNumber('0.0006')], [this.parseNumber('50'), this.parseNumber('0.0006')], [this.parseNumber('200'), this.parseNumber('0.0006')], [this.parseNumber('500'), this.parseNumber('0.0005')], [this.parseNumber('1000'), this.parseNumber('0.0004')], [this.parseNumber('2000'), this.parseNumber('0.0004')], [this.parseNumber('4000'), this.parseNumber('0.00038')], [this.parseNumber('8000'), this.parseNumber('0.00035')], [this.parseNumber('15000'), this.parseNumber('0.00032')], [this.parseNumber('25000'), this.parseNumber('0.0003')], [this.parseNumber('40000'), this.parseNumber('0.0003')], [this.parseNumber('60000'), this.parseNumber('0.0003')], [this.parseNumber('80000'), this.parseNumber('0.0003')], ], 'maker': [ [this.parseNumber('0'), this.parseNumber('0.02')], [this.parseNumber('50'), this.parseNumber('0.015')], [this.parseNumber('200'), this.parseNumber('0.01')], [this.parseNumber('500'), this.parseNumber('0.01')], [this.parseNumber('1000'), this.parseNumber('0.01')], [this.parseNumber('2000'), this.parseNumber('0')], [this.parseNumber('4000'), this.parseNumber('0')], [this.parseNumber('8000'), this.parseNumber('0')], [this.parseNumber('15000'), this.parseNumber('-0.003')], [this.parseNumber('25000'), this.parseNumber('-0.006')], [this.parseNumber('40000'), this.parseNumber('-0.009')], [this.parseNumber('60000'), this.parseNumber('-0.012')], [this.parseNumber('80000'), this.parseNumber('-0.015')], ], }, }, 'funding': { 'tierBased': false, 'percentage': false, 'withdraw': {}, 'deposit': {}, }, }, 'commonCurrencies': { 'BIFI': 'BIFIF', 'VAI': 'VAIOT', 'WAX': 'WAXP', 'ALT': 'APTOSLAUNCHTOKEN', 'KALT': 'ALT', 'FUD': 'FTX Users\' Debt', }, 'options': { 'hf': undefined, 'uta': undefined, 'version': 'v1', 'symbolSeparator': '-', 'fetchMyTradesMethod': 'private_get_fills', 'timeDifference': 0, 'adjustForTimeDifference': false, 'fetchCurrencies': { 'brokenCurrencies': ['00', 'OPEN_ERROR', 'HUF', 'BDT'], // skip buggy entries: https://t.me/KuCoin_API/217798 }, 'fetchMarkets': { 'types': ['spot', 'swap', 'future', 'contract'], 'fetchTickersFees': true, }, 'withdraw': { 'includeFee': false, }, 'transfer': { 'fillResponseFromRequest': true, }, 'fetchBalance': { 'code': 'USDT', // for contract endpoint }, 'setLeverage': { 'code': 'USDT', // for uta margin endpoint }, 'timeInForce': { 'IOC': 'IOC', 'FOK': 'FOK', 'PO': 'PO', 'GTD': 'GTT', 'RPI': 'RPI', }, 'timeframes': { 'swap': { '1m': 1, '3m': undefined, '5m': 5, '15m': 15, '30m': 30, '1h': 60, '2h': 120, '4h': 240, '6h': undefined, '8h': 480, '12h': 720, '1d': 1440, '1w': 10080, }, }, // endpoint versions 'versions': { 'public': { 'GET': { // spot trading 'currencies': 'v3', 'currencies/{currency}': 'v3', 'symbols': 'v2', 'mark-price/all-symbols': 'v3', 'announcements': 'v3', }, }, 'private': { 'GET': { // account 'user-info': 'v2', 'hf/margin/account/ledgers': 'v3', 'sub/user': 'v2', 'sub-accounts': 'v2', // funding 'margin/accounts': 'v3', 'isolated/accounts': 'v3', // 'deposit-addresses': 'v2', 'deposit-addresses': 'v1', // spot trading 'market/orderbook/level2': 'v3', 'market/orderbook/level3': 'v3', 'market/orderbook/level{level}': 'v3', 'oco/order/{orderId}': 'v3', 'oco/order/details/{orderId}': 'v3', 'oco/client-order/{clientOid}': 'v3', 'oco/orders': 'v3', // margin trading 'hf/margin/orders/active': 'v3', 'hf/margin/order/active/symbols': 'v3', 'hf/margin/orders/done': 'v3', 'hf/margin/orders/{orderId}': 'v3', 'hf/margin/orders/client-order/{clientOid}': 'v3', 'hf/margin/fills': 'v3', 'hf/margin/stop-orders': 'v3', 'hf/margin/stop-order/orderId': 'v3', 'hf/margin/stop-order/clientOid': 'v3', 'hf/margin/oco-order/orderId': 'v3', 'hf/margin/oco-order/clientOid': 'v3', 'hf/margin/oco-order/detail/orderId': 'v3', 'hf/margin/oco-orders': 'v3', 'etf/info': 'v3', 'margin/currencies': 'v3', 'margin/borrow': 'v3', 'margin/repay': 'v3', 'margin/interest': 'v3', 'project/list': 'v3', 'project/marketInterestRate': 'v3', 'redeem/orders': 'v3', 'purchase/orders': 'v3', 'migrate/user/account/status': 'v3', 'margin/symbols': 'v3', 'affiliate/inviter/statistics': 'v2', 'asset/ndbroker/deposit/list': 'v1', }, 'POST': { // account 'sub/user/created': 'v2', // funding 'accounts/universal-transfer': 'v3', 'accounts/sub-transfer': 'v2', 'accounts/inner-transfer': 'v2', 'transfer-out': 'v3', 'deposit-address/create': 'v3', // spot trading 'oco/order': 'v3', // margin trading 'hf/margin/order': 'v3', 'hf/margin/order/test': 'v3', 'hf/margin/stop-order': 'v3', 'margin/borrow': 'v3', 'margin/repay': 'v3', 'hf/margin/oco-order': 'v3',