ccxt
Version:
904 lines (902 loc) • 444 kB
JavaScript
// ----------------------------------------------------------------------------
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
// ---------------------------------------------------------------------------
import Exchange from './abstract/bitget.js';
import { ExchangeError, ExchangeNotAvailable, NotSupported, OnMaintenance, ArgumentsRequired, BadRequest, AccountSuspended, InvalidAddress, PermissionDenied, DDoSProtection, InsufficientFunds, InvalidNonce, CancelPending, InvalidOrder, OrderNotFound, AuthenticationError, RequestTimeout, BadSymbol, RateLimitExceeded } from './base/errors.js';
import { Precise } from './base/Precise.js';
import { TICK_SIZE } from './base/functions/number.js';
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
// ---------------------------------------------------------------------------
/**
* @class bitget
* @augments Exchange
*/
export default class bitget extends Exchange {
describe() {
return this.deepExtend(super.describe(), {
'id': 'bitget',
'name': 'Bitget',
'countries': ['SG'],
'version': 'v2',
'rateLimit': 50,
'certified': true,
'pro': true,
'has': {
'CORS': undefined,
'spot': true,
'margin': true,
'swap': true,
'future': true,
'option': false,
'addMargin': true,
'borrowCrossMargin': true,
'borrowIsolatedMargin': true,
'cancelAllOrders': true,
'cancelOrder': true,
'cancelOrders': true,
'closeAllPositions': true,
'closePosition': true,
'createConvertTrade': true,
'createDepositAddress': false,
'createMarketBuyOrderWithCost': true,
'createMarketOrderWithCost': false,
'createMarketSellOrderWithCost': false,
'createOrder': true,
'createOrders': true,
'createOrderWithTakeProfitAndStopLoss': true,
'createPostOnlyOrder': true,
'createReduceOnlyOrder': false,
'createStopLimitOrder': true,
'createStopLossOrder': true,
'createStopMarketOrder': true,
'createStopOrder': true,
'createTakeProfitOrder': true,
'createTrailingAmountOrder': false,
'createTrailingPercentOrder': true,
'createTriggerOrder': true,
'editOrder': true,
'fetchAccounts': false,
'fetchBalance': true,
'fetchBorrowInterest': true,
'fetchBorrowRateHistories': false,
'fetchBorrowRateHistory': false,
'fetchCanceledAndClosedOrders': true,
'fetchCanceledOrders': true,
'fetchClosedOrders': true,
'fetchConvertCurrencies': true,
'fetchConvertQuote': true,
'fetchConvertTrade': false,
'fetchConvertTradeHistory': true,
'fetchCrossBorrowRate': true,
'fetchCrossBorrowRates': false,
'fetchCurrencies': true,
'fetchDeposit': false,
'fetchDepositAddress': true,
'fetchDepositAddresses': false,
'fetchDepositAddressesByNetwork': false,
'fetchDeposits': true,
'fetchDepositsWithdrawals': false,
'fetchDepositWithdrawFee': 'emulated',
'fetchDepositWithdrawFees': true,
'fetchFundingHistory': true,
'fetchFundingInterval': true,
'fetchFundingIntervals': false,
'fetchFundingRate': true,
'fetchFundingRateHistory': true,
'fetchFundingRates': true,
'fetchIndexOHLCV': true,
'fetchIsolatedBorrowRate': true,
'fetchIsolatedBorrowRates': false,
'fetchLedger': true,
'fetchLeverage': true,
'fetchLeverageTiers': false,
'fetchLiquidations': false,
'fetchLongShortRatio': false,
'fetchLongShortRatioHistory': true,
'fetchMarginAdjustmentHistory': false,
'fetchMarginMode': true,
'fetchMarketLeverageTiers': true,
'fetchMarkets': true,
'fetchMarkOHLCV': true,
'fetchMarkPrice': true,
'fetchMyLiquidations': true,
'fetchMyTrades': true,
'fetchOHLCV': true,
'fetchOpenInterest': true,
'fetchOpenInterestHistory': false,
'fetchOpenOrders': true,
'fetchOrder': true,
'fetchOrderBook': true,
'fetchOrderBooks': false,
'fetchOrders': false,
'fetchOrderTrades': false,
'fetchPosition': true,
'fetchPositionHistory': 'emulated',
'fetchPositionMode': false,
'fetchPositions': true,
'fetchPositionsHistory': true,
'fetchPositionsRisk': false,
'fetchPremiumIndexOHLCV': false,
'fetchStatus': false,
'fetchTicker': true,
'fetchTickers': true,
'fetchTime': true,
'fetchTrades': true,
'fetchTradingFee': true,
'fetchTradingFees': true,
'fetchTransactions': false,
'fetchTransfer': false,
'fetchTransfers': true,
'fetchWithdrawAddresses': false,
'fetchWithdrawal': false,
'fetchWithdrawals': true,
'reduceMargin': true,
'repayCrossMargin': true,
'repayIsolatedMargin': true,
'setLeverage': true,
'setMargin': false,
'setMarginMode': true,
'setPositionMode': true,
'signIn': false,
'transfer': true,
'withdraw': true,
},
'timeframes': {
'1m': '1m',
'3m': '3m',
'5m': '5m',
'15m': '15m',
'30m': '30m',
'1h': '1h',
'2h': '2h',
'4h': '4h',
'6h': '6h',
'12h': '12h',
'1d': '1d',
'3d': '3d',
'1w': '1w',
'1M': '1m',
},
'hostname': 'bitget.com',
'urls': {
'logo': 'https://github.com/user-attachments/assets/fbaa10cc-a277-441d-a5b7-997dd9a87658',
'api': {
'spot': 'https://api.{hostname}',
'mix': 'https://api.{hostname}',
'user': 'https://api.{hostname}',
'p2p': 'https://api.{hostname}',
'broker': 'https://api.{hostname}',
'margin': 'https://api.{hostname}',
'common': 'https://api.{hostname}',
'tax': 'https://api.{hostname}',
'convert': 'https://api.{hostname}',
'copy': 'https://api.{hostname}',
'earn': 'https://api.{hostname}',
'uta': 'https://api.{hostname}',
},
'www': 'https://www.bitget.com',
'doc': [
'https://www.bitget.com/api-doc/common/intro',
'https://www.bitget.com/api-doc/spot/intro',
'https://www.bitget.com/api-doc/contract/intro',
'https://www.bitget.com/api-doc/broker/intro',
'https://www.bitget.com/api-doc/margin/intro',
'https://www.bitget.com/api-doc/copytrading/intro',
'https://www.bitget.com/api-doc/earn/intro',
'https://bitgetlimited.github.io/apidoc/en/mix',
'https://bitgetlimited.github.io/apidoc/en/spot',
'https://bitgetlimited.github.io/apidoc/en/broker',
'https://bitgetlimited.github.io/apidoc/en/margin',
],
'fees': 'https://www.bitget.cc/zh-CN/rate?tab=1',
'referral': 'https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j',
},
'api': {
'public': {
'common': {
'get': {
'v2/public/annoucements': 1,
'v2/public/time': 1,
},
},
'spot': {
'get': {
'spot/v1/notice/queryAllNotices': 1,
'spot/v1/public/time': 1,
'spot/v1/public/currencies': 6.6667,
'spot/v1/public/products': 1,
'spot/v1/public/product': 1,
'spot/v1/market/ticker': 1,
'spot/v1/market/tickers': 1,
'spot/v1/market/fills': 2,
'spot/v1/market/fills-history': 2,
'spot/v1/market/candles': 1,
'spot/v1/market/depth': 1,
'spot/v1/market/spot-vip-level': 2,
'spot/v1/market/merge-depth': 1,
'spot/v1/market/history-candles': 1,
'spot/v1/public/loan/coinInfos': 2,
'spot/v1/public/loan/hour-interest': 2,
'v2/spot/public/coins': 6.6667,
'v2/spot/public/symbols': 1,
'v2/spot/market/vip-fee-rate': 2,
'v2/spot/market/tickers': 1,
'v2/spot/market/merge-depth': 1,
'v2/spot/market/orderbook': 1,
'v2/spot/market/candles': 1,
'v2/spot/market/history-candles': 1,
'v2/spot/market/fills': 2,
'v2/spot/market/fills-history': 2,
},
},
'mix': {
'get': {
'mix/v1/market/contracts': 1,
'mix/v1/market/depth': 1,
'mix/v1/market/ticker': 1,
'mix/v1/market/tickers': 1,
'mix/v1/market/contract-vip-level': 2,
'mix/v1/market/fills': 1,
'mix/v1/market/fills-history': 2,
'mix/v1/market/candles': 1,
'mix/v1/market/index': 1,
'mix/v1/market/funding-time': 1,
'mix/v1/market/history-fundRate': 1,
'mix/v1/market/current-fundRate': 1,
'mix/v1/market/open-interest': 1,
'mix/v1/market/mark-price': 1,
'mix/v1/market/symbol-leverage': 1,
'mix/v1/market/queryPositionLever': 1,
'mix/v1/market/open-limit': 1,
'mix/v1/market/history-candles': 1,
'mix/v1/market/history-index-candles': 1,
'mix/v1/market/history-mark-candles': 1,
'mix/v1/market/merge-depth': 1,
'v2/mix/market/vip-fee-rate': 2,
'v2/mix/market/merge-depth': 1,
'v2/mix/market/ticker': 1,
'v2/mix/market/tickers': 1,
'v2/mix/market/fills': 1,
'v2/mix/market/fills-history': 2,
'v2/mix/market/candles': 1,
'v2/mix/market/history-candles': 1,
'v2/mix/market/history-index-candles': 1,
'v2/mix/market/history-mark-candles': 1,
'v2/mix/market/open-interest': 1,
'v2/mix/market/funding-time': 1,
'v2/mix/market/symbol-price': 1,
'v2/mix/market/history-fund-rate': 1,
'v2/mix/market/current-fund-rate': 1,
'v2/mix/market/contracts': 1,
'v2/mix/market/query-position-lever': 2,
'v2/mix/market/account-long-short': 20,
},
},
'margin': {
'get': {
'margin/v1/cross/public/interestRateAndLimit': 2,
'margin/v1/isolated/public/interestRateAndLimit': 2,
'margin/v1/cross/public/tierData': 2,
'margin/v1/isolated/public/tierData': 2,
'margin/v1/public/currencies': 1,
'v2/margin/currencies': 2,
'v2/margin/market/long-short-ratio': 20,
},
},
'earn': {
'get': {
'v2/earn/loan/public/coinInfos': 2,
'v2/earn/loan/public/hour-interest': 2,
},
},
'uta': {
'get': {
'v3/market/instruments': 1,
'v3/market/tickers': 1,
'v3/market/orderbook': 1,
'v3/market/fills': 1,
'v3/market/open-interest': 1,
'v3/market/candles': 1,
'v3/market/history-candles': 1,
'v3/market/current-fund-rate': 1,
'v3/market/history-fund-rate': 1,
'v3/market/risk-reserve': 1,
'v3/market/discount-rate': 1,
'v3/market/margin-loans': 1,
'v3/market/position-tier': 1,
'v3/market/oi-limit': 2,
},
},
},
'private': {
'spot': {
'get': {
'spot/v1/wallet/deposit-address': 4,
'spot/v1/wallet/withdrawal-list': 1,
'spot/v1/wallet/deposit-list': 1,
'spot/v1/account/getInfo': 20,
'spot/v1/account/assets': 2,
'spot/v1/account/assets-lite': 2,
'spot/v1/account/transferRecords': 1,
'spot/v1/convert/currencies': 2,
'spot/v1/convert/convert-record': 2,
'spot/v1/loan/ongoing-orders': 2,
'spot/v1/loan/repay-history': 2,
'spot/v1/loan/revise-history': 2,
'spot/v1/loan/borrow-history': 2,
'spot/v1/loan/debts': 2,
'v2/spot/trade/orderInfo': 1,
'v2/spot/trade/unfilled-orders': 1,
'v2/spot/trade/history-orders': 1,
'v2/spot/trade/fills': 2,
'v2/spot/trade/current-plan-order': 1,
'v2/spot/trade/history-plan-order': 1,
'v2/spot/account/info': 20,
'v2/spot/account/assets': 2,
'v2/spot/account/subaccount-assets': 2,
'v2/spot/account/bills': 2,
'v2/spot/account/transferRecords': 1,
'v2/account/funding-assets': 2,
'v2/account/bot-assets': 2,
'v2/account/all-account-balance': 20,
'v2/spot/wallet/deposit-address': 2,
'v2/spot/wallet/deposit-records': 2,
'v2/spot/wallet/withdrawal-records': 2,
},
'post': {
'spot/v1/wallet/transfer': 4,
'spot/v1/wallet/transfer-v2': 4,
'spot/v1/wallet/subTransfer': 10,
'spot/v1/wallet/withdrawal': 4,
'spot/v1/wallet/withdrawal-v2': 4,
'spot/v1/wallet/withdrawal-inner': 4,
'spot/v1/wallet/withdrawal-inner-v2': 4,
'spot/v1/account/sub-account-spot-assets': 200,
'spot/v1/account/bills': 2,
'spot/v1/trade/orders': 2,
'spot/v1/trade/batch-orders': 4,
'spot/v1/trade/cancel-order': 2,
'spot/v1/trade/cancel-order-v2': 2,
'spot/v1/trade/cancel-symbol-order': 2,
'spot/v1/trade/cancel-batch-orders': 4,
'spot/v1/trade/cancel-batch-orders-v2': 4,
'spot/v1/trade/orderInfo': 1,
'spot/v1/trade/open-orders': 1,
'spot/v1/trade/history': 1,
'spot/v1/trade/fills': 1,
'spot/v1/plan/placePlan': 1,
'spot/v1/plan/modifyPlan': 1,
'spot/v1/plan/cancelPlan': 1,
'spot/v1/plan/currentPlan': 1,
'spot/v1/plan/historyPlan': 1,
'spot/v1/plan/batchCancelPlan': 2,
'spot/v1/convert/quoted-price': 4,
'spot/v1/convert/trade': 4,
'spot/v1/loan/borrow': 2,
'spot/v1/loan/repay': 2,
'spot/v1/loan/revise-pledge': 2,
'spot/v1/trace/order/orderCurrentList': 2,
'spot/v1/trace/order/orderHistoryList': 2,
'spot/v1/trace/order/closeTrackingOrder': 2,
'spot/v1/trace/order/updateTpsl': 2,
'spot/v1/trace/order/followerEndOrder': 2,
'spot/v1/trace/order/spotInfoList': 2,
'spot/v1/trace/config/getTraderSettings': 2,
'spot/v1/trace/config/getFollowerSettings': 2,
'spot/v1/trace/user/myTraders': 2,
'spot/v1/trace/config/setFollowerConfig': 2,
'spot/v1/trace/user/myFollowers': 2,
'spot/v1/trace/config/setProductCode': 2,
'spot/v1/trace/user/removeTrader': 2,
'spot/v1/trace/getRemovableFollower': 2,
'spot/v1/trace/user/removeFollower': 2,
'spot/v1/trace/profit/totalProfitInfo': 2,
'spot/v1/trace/profit/totalProfitList': 2,
'spot/v1/trace/profit/profitHisList': 2,
'spot/v1/trace/profit/profitHisDetailList': 2,
'spot/v1/trace/profit/waitProfitDetailList': 2,
'spot/v1/trace/user/getTraderInfo': 2,
'v2/spot/trade/place-order': 2,
'v2/spot/trade/cancel-order': 2,
'v2/spot/trade/batch-orders': 20,
'v2/spot/trade/batch-cancel-order': 2,
'v2/spot/trade/cancel-symbol-order': 4,
'v2/spot/trade/place-plan-order': 1,
'v2/spot/trade/modify-plan-order': 1,
'v2/spot/trade/cancel-plan-order': 1,
'v2/spot/trade/batch-cancel-plan-order': 2,
'v2/spot/wallet/transfer': 2,
'v2/spot/wallet/subaccount-transfer': 2,
'v2/spot/wallet/withdrawal': 2,
'v2/spot/wallet/cancel-withdrawal': 2,
'v2/spot/wallet/modify-deposit-account': 2,
},
},
'mix': {
'get': {
'mix/v1/account/account': 2,
'mix/v1/account/accounts': 2,
'mix/v1/position/singlePosition': 2,
'mix/v1/position/singlePosition-v2': 2,
'mix/v1/position/allPosition': 4,
'mix/v1/position/allPosition-v2': 4,
'mix/v1/position/history-position': 1,
'mix/v1/account/accountBill': 2,
'mix/v1/account/accountBusinessBill': 4,
'mix/v1/order/current': 1,
'mix/v1/order/marginCoinCurrent': 1,
'mix/v1/order/history': 2,
'mix/v1/order/historyProductType': 4,
'mix/v1/order/detail': 2,
'mix/v1/order/fills': 2,
'mix/v1/order/allFills': 2,
'mix/v1/plan/currentPlan': 1,
'mix/v1/plan/historyPlan': 2,
'mix/v1/trace/currentTrack': 2,
'mix/v1/trace/followerOrder': 2,
'mix/v1/trace/followerHistoryOrders': 2,
'mix/v1/trace/historyTrack': 2,
'mix/v1/trace/summary': 1,
'mix/v1/trace/profitSettleTokenIdGroup': 1,
'mix/v1/trace/profitDateGroupList': 1,
'mix/v1/trade/profitDateList': 2,
'mix/v1/trace/waitProfitDateList': 1,
'mix/v1/trace/traderSymbols': 1,
'mix/v1/trace/traderList': 2,
'mix/v1/trace/traderDetail': 2,
'mix/v1/trace/queryTraceConfig': 2,
'v2/mix/account/account': 2,
'v2/mix/account/accounts': 2,
'v2/mix/account/sub-account-assets': 200,
'v2/mix/account/open-count': 2,
'v2/mix/account/bill': 2,
'v2/mix/market/query-position-lever': 2,
'v2/mix/position/single-position': 2,
'v2/mix/position/all-position': 4,
'v2/mix/position/history-position': 1,
'v2/mix/order/detail': 2,
'v2/mix/order/fills': 2,
'v2/mix/order/fill-history': 2,
'v2/mix/order/orders-pending': 2,
'v2/mix/order/orders-history': 2,
'v2/mix/order/orders-plan-pending': 2,
'v2/mix/order/orders-plan-history': 2,
'v2/mix/market/position-long-short': 20,
},
'post': {
'mix/v1/account/sub-account-contract-assets': 200,
'mix/v1/account/open-count': 1,
'mix/v1/account/setLeverage': 4,
'mix/v1/account/setMargin': 4,
'mix/v1/account/setMarginMode': 4,
'mix/v1/account/setPositionMode': 4,
'mix/v1/order/placeOrder': 2,
'mix/v1/order/batch-orders': 2,
'mix/v1/order/cancel-order': 2,
'mix/v1/order/cancel-batch-orders': 2,
'mix/v1/order/modifyOrder': 2,
'mix/v1/order/cancel-symbol-orders': 2,
'mix/v1/order/cancel-all-orders': 2,
'mix/v1/order/close-all-positions': 20,
'mix/v1/plan/placePlan': 2,
'mix/v1/plan/modifyPlan': 2,
'mix/v1/plan/modifyPlanPreset': 2,
'mix/v1/plan/placeTPSL': 2,
'mix/v1/plan/placeTrailStop': 2,
'mix/v1/plan/placePositionsTPSL': 2,
'mix/v1/plan/modifyTPSLPlan': 2,
'mix/v1/plan/cancelPlan': 2,
'mix/v1/plan/cancelSymbolPlan': 2,
'mix/v1/plan/cancelAllPlan': 2,
'mix/v1/trace/closeTrackOrder': 2,
'mix/v1/trace/modifyTPSL': 2,
'mix/v1/trace/closeTrackOrderBySymbol': 2,
'mix/v1/trace/setUpCopySymbols': 2,
'mix/v1/trace/followerSetBatchTraceConfig': 2,
'mix/v1/trace/followerCloseByTrackingNo': 2,
'mix/v1/trace/followerCloseByAll': 2,
'mix/v1/trace/followerSetTpsl': 2,
'mix/v1/trace/cancelCopyTrader': 4,
'mix/v1/trace/traderUpdateConfig': 2,
'mix/v1/trace/myTraderList': 2,
'mix/v1/trace/myFollowerList': 2,
'mix/v1/trace/removeFollower': 2,
'mix/v1/trace/public/getFollowerConfig': 2,
'mix/v1/trace/report/order/historyList': 2,
'mix/v1/trace/report/order/currentList': 2,
'mix/v1/trace/queryTraderTpslRatioConfig': 2,
'mix/v1/trace/traderUpdateTpslRatioConfig': 2,
'v2/mix/account/set-leverage': 4,
'v2/mix/account/set-margin': 4,
'v2/mix/account/set-margin-mode': 4,
'v2/mix/account/set-position-mode': 4,
'v2/mix/order/place-order': 2,
'v2/mix/order/click-backhand': 20,
'v2/mix/order/batch-place-order': 20,
'v2/mix/order/modify-order': 2,
'v2/mix/order/cancel-order': 2,
'v2/mix/order/batch-cancel-orders': 2,
'v2/mix/order/close-positions': 20,
'v2/mix/order/place-tpsl-order': 2,
'v2/mix/order/place-plan-order': 2,
'v2/mix/order/modify-tpsl-order': 2,
'v2/mix/order/modify-plan-order': 2,
'v2/mix/order/cancel-plan-order': 2,
},
},
'user': {
'get': {
'user/v1/fee/query': 2,
'user/v1/sub/virtual-list': 2,
'user/v1/sub/virtual-api-list': 2,
'user/v1/tax/spot-record': 1,
'user/v1/tax/future-record': 1,
'user/v1/tax/margin-record': 1,
'user/v1/tax/p2p-record': 1,
'v2/user/virtual-subaccount-list': 2,
'v2/user/virtual-subaccount-apikey-list': 2,
},
'post': {
'user/v1/sub/virtual-create': 4,
'user/v1/sub/virtual-modify': 4,
'user/v1/sub/virtual-api-batch-create': 20,
'user/v1/sub/virtual-api-create': 4,
'user/v1/sub/virtual-api-modify': 4,
'v2/user/create-virtual-subaccount': 4,
'v2/user/modify-virtual-subaccount': 4,
'v2/user/batch-create-subaccount-and-apikey': 20,
'v2/user/create-virtual-subaccount-apikey': 4,
'v2/user/modify-virtual-subaccount-apikey': 4,
},
},
'p2p': {
'get': {
'p2p/v1/merchant/merchantList': 2,
'p2p/v1/merchant/merchantInfo': 2,
'p2p/v1/merchant/advList': 2,
'p2p/v1/merchant/orderList': 2,
'v2/p2p/merchantList': 2,
'v2/p2p/merchantInfo': 2,
'v2/p2p/orderList': 2,
'v2/p2p/advList': 2,
},
},
'broker': {
'get': {
'broker/v1/account/info': 2,
'broker/v1/account/sub-list': 20,
'broker/v1/account/sub-email': 20,
'broker/v1/account/sub-spot-assets': 2,
'broker/v1/account/sub-future-assets': 2,
'broker/v1/account/subaccount-transfer': 1,
'broker/v1/account/subaccount-deposit': 1,
'broker/v1/account/subaccount-withdrawal': 1,
'broker/v1/account/sub-api-list': 2,
'v2/broker/account/info': 2,
'v2/broker/account/subaccount-list': 20,
'v2/broker/account/subaccount-email': 2,
'v2/broker/account/subaccount-spot-assets': 2,
'v2/broker/account/subaccount-future-assets': 2,
'v2/broker/manage/subaccount-apikey-list': 2,
},
'post': {
'broker/v1/account/sub-create': 20,
'broker/v1/account/sub-modify': 20,
'broker/v1/account/sub-modify-email': 20,
'broker/v1/account/sub-address': 2,
'broker/v1/account/sub-withdrawal': 2,
'broker/v1/account/sub-auto-transfer': 4,
'broker/v1/account/sub-api-create': 2,
'broker/v1/account/sub-api-modify': 2,
'v2/broker/account/modify-subaccount-email': 2,
'v2/broker/account/create-subaccount': 20,
'v2/broker/account/modify-subaccount': 20,
'v2/broker/account/subaccount-address': 2,
'v2/broker/account/subaccount-withdrawal': 2,
'v2/broker/account/set-subaccount-autotransfer': 2,
'v2/broker/manage/create-subaccount-apikey': 2,
'v2/broker/manage/modify-subaccount-apikey': 2,
},
},
'margin': {
'get': {
'margin/v1/cross/account/riskRate': 2,
'margin/v1/cross/account/maxTransferOutAmount': 2,
'margin/v1/isolated/account/maxTransferOutAmount': 2,
'margin/v1/isolated/order/openOrders': 2,
'margin/v1/isolated/order/history': 2,
'margin/v1/isolated/order/fills': 2,
'margin/v1/isolated/loan/list': 2,
'margin/v1/isolated/repay/list': 2,
'margin/v1/isolated/interest/list': 2,
'margin/v1/isolated/liquidation/list': 2,
'margin/v1/isolated/fin/list': 2,
'margin/v1/cross/order/openOrders': 2,
'margin/v1/cross/order/history': 2,
'margin/v1/cross/order/fills': 2,
'margin/v1/cross/loan/list': 2,
'margin/v1/cross/repay/list': 2,
'margin/v1/cross/interest/list': 2,
'margin/v1/cross/liquidation/list': 2,
'margin/v1/cross/fin/list': 2,
'margin/v1/cross/account/assets': 2,
'margin/v1/isolated/account/assets': 2,
'v2/margin/crossed/borrow-history': 2,
'v2/margin/crossed/repay-history': 2,
'v2/margin/crossed/interest-history': 2,
'v2/margin/crossed/liquidation-history': 2,
'v2/margin/crossed/financial-records': 2,
'v2/margin/crossed/account/assets': 2,
'v2/margin/crossed/account/risk-rate': 2,
'v2/margin/crossed/account/max-borrowable-amount': 2,
'v2/margin/crossed/account/max-transfer-out-amount': 2,
'v2/margin/crossed/interest-rate-and-limit': 2,
'v2/margin/crossed/tier-data': 2,
'v2/margin/crossed/open-orders': 2,
'v2/margin/crossed/history-orders': 2,
'v2/margin/crossed/fills': 2,
'v2/margin/isolated/borrow-history': 2,
'v2/margin/isolated/repay-history': 2,
'v2/margin/isolated/interest-history': 2,
'v2/margin/isolated/liquidation-history': 2,
'v2/margin/isolated/financial-records': 2,
'v2/margin/isolated/account/assets': 2,
'v2/margin/isolated/account/risk-rate': 2,
'v2/margin/isolated/account/max-borrowable-amount': 2,
'v2/margin/isolated/account/max-transfer-out-amount': 2,
'v2/margin/isolated/interest-rate-and-limit': 2,
'v2/margin/isolated/tier-data': 2,
'v2/margin/isolated/open-orders': 2,
'v2/margin/isolated/history-orders': 2,
'v2/margin/isolated/fills': 2,
},
'post': {
'margin/v1/cross/account/borrow': 2,
'margin/v1/isolated/account/borrow': 2,
'margin/v1/cross/account/repay': 2,
'margin/v1/isolated/account/repay': 2,
'margin/v1/isolated/account/riskRate': 2,
'margin/v1/cross/account/maxBorrowableAmount': 2,
'margin/v1/isolated/account/maxBorrowableAmount': 2,
'margin/v1/isolated/account/flashRepay': 2,
'margin/v1/isolated/account/queryFlashRepayStatus': 2,
'margin/v1/cross/account/flashRepay': 2,
'margin/v1/cross/account/queryFlashRepayStatus': 2,
'margin/v1/isolated/order/placeOrder': 4,
'margin/v1/isolated/order/batchPlaceOrder': 4,
'margin/v1/isolated/order/cancelOrder': 2,
'margin/v1/isolated/order/batchCancelOrder': 2,
'margin/v1/cross/order/placeOrder': 2,
'margin/v1/cross/order/batchPlaceOrder': 2,
'margin/v1/cross/order/cancelOrder': 2,
'margin/v1/cross/order/batchCancelOrder': 2,
'v2/margin/crossed/account/borrow': 2,
'v2/margin/crossed/account/repay': 2,
'v2/margin/crossed/account/flash-repay': 2,
'v2/margin/crossed/account/query-flash-repay-status': 2,
'v2/margin/crossed/place-order': 2,
'v2/margin/crossed/batch-place-order': 2,
'v2/margin/crossed/cancel-order': 2,
'v2/margin/crossed/batch-cancel-order': 2,
'v2/margin/isolated/account/borrow': 2,
'v2/margin/isolated/account/repay': 2,
'v2/margin/isolated/account/flash-repay': 2,
'v2/margin/isolated/account/query-flash-repay-status': 2,
'v2/margin/isolated/place-order': 2,
'v2/margin/isolated/batch-place-order': 2,
'v2/margin/isolated/cancel-order': 2,
'v2/margin/isolated/batch-cancel-order': 2,
},
},
'copy': {
'get': {
'v2/copy/mix-trader/order-current-track': 2,
'v2/copy/mix-trader/order-history-track': 2,
'v2/copy/mix-trader/order-total-detail': 2,
'v2/copy/mix-trader/profit-history-summarys': 1,
'v2/copy/mix-trader/profit-history-details': 1,
'v2/copy/mix-trader/profit-details': 1,
'v2/copy/mix-trader/profits-group-coin-date': 1,
'v2/copy/mix-trader/config-query-symbols': 1,
'v2/copy/mix-trader/config-query-followers': 2,
'v2/copy/mix-follower/query-current-orders': 2,
'v2/copy/mix-follower/query-history-orders': 1,
'v2/copy/mix-follower/query-settings': 2,
'v2/copy/mix-follower/query-traders': 2,
'v2/copy/mix-follower/query-quantity-limit': 2,
'v2/copy/mix-broker/query-traders': 2,
'v2/copy/mix-broker/query-history-traces': 2,
'v2/copy/mix-broker/query-current-traces': 2,
'v2/copy/spot-trader/profit-summarys': 2,
'v2/copy/spot-trader/profit-history-details': 2,
'v2/copy/spot-trader/profit-details': 2,
'v2/copy/spot-trader/order-total-detail': 2,
'v2/copy/spot-trader/order-history-track': 2,
'v2/copy/spot-trader/order-current-track': 2,
'v2/copy/spot-trader/config-query-settings': 2,
'v2/copy/spot-trader/config-query-followers': 2,
'v2/copy/spot-follower/query-traders': 2,
'v2/copy/spot-follower/query-trader-symbols': 2,
'v2/copy/spot-follower/query-settings': 2,
'v2/copy/spot-follower/query-history-orders': 2,
'v2/copy/spot-follower/query-current-orders': 2,
},
'post': {
'v2/copy/mix-trader/order-modify-tpsl': 2,
'v2/copy/mix-trader/order-close-positions': 2,
'v2/copy/mix-trader/config-setting-symbols': 2,
'v2/copy/mix-trader/config-setting-base': 2,
'v2/copy/mix-trader/config-remove-follower': 2,
'v2/copy/mix-follower/setting-tpsl': 1,
'v2/copy/mix-follower/settings': 2,
'v2/copy/mix-follower/close-positions': 2,
'v2/copy/mix-follower/cancel-trader': 4,
'v2/copy/spot-trader/order-modify-tpsl': 2,
'v2/copy/spot-trader/order-close-tracking': 2,
'v2/copy/spot-trader/config-setting-symbols': 2,
'v2/copy/spot-trader/config-remove-follower': 2,
'v2/copy/spot-follower/stop-order': 2,
'v2/copy/spot-follower/settings': 2,
'v2/copy/spot-follower/setting-tpsl': 2,
'v2/copy/spot-follower/order-close-tracking': 2,
'v2/copy/spot-follower/cancel-trader': 2,
},
},
'tax': {
'get': {
'v2/tax/spot-record': 20,
'v2/tax/future-record': 20,
'v2/tax/margin-record': 20,
'v2/tax/p2p-record': 20,
},
},
'convert': {
'get': {
'v2/convert/currencies': 2,
'v2/convert/quoted-price': 2,
'v2/convert/convert-record': 2,
'v2/convert/bgb-convert-coin-list': 2,
'v2/convert/bgb-convert-records': 2,
},
'post': {
'v2/convert/trade': 2,
'v2/convert/bgb-convert': 2,
},
},
'earn': {
'get': {
'v2/earn/savings/product': 2,
'v2/earn/savings/account': 2,
'v2/earn/savings/assets': 2,
'v2/earn/savings/records': 2,
'v2/earn/savings/subscribe-info': 2,
'v2/earn/savings/subscribe-result': 2,
'v2/earn/savings/redeem-result': 2,
'v2/earn/sharkfin/product': 2,
'v2/earn/sharkfin/account': 2,
'v2/earn/sharkfin/assets': 2,
'v2/earn/sharkfin/records': 2,
'v2/earn/sharkfin/subscribe-info': 2,
'v2/earn/sharkfin/subscribe-result': 4,
'v2/earn/loan/ongoing-orders': 2,
'v2/earn/loan/repay-history': 2,
'v2/earn/loan/revise-history': 2,
'v2/earn/loan/borrow-history': 2,
'v2/earn/loan/debts': 2,
'v2/earn/loan/reduces': 2,
'v2/earn/account/assets': 2,
},
'post': {
'v2/earn/savings/subscribe': 2,
'v2/earn/savings/redeem': 2,
'v2/earn/sharkfin/subscribe': 2,
'v2/earn/loan/borrow': 2,
'v2/earn/loan/repay': 2,
'v2/earn/loan/revise-pledge': 2,
},
},
'common': {
'get': {
'v2/common/trade-rate': 2,
},
},
'uta': {
'get': {
'v3/account/assets': 1,
'v3/account/settings': 1,
'v3/account/financial-records': 1,
'v3/account/repayable-coins': 2,
'v3/account/payment-coins': 2,
'v3/account/convert-records': 1,
'v3/account/transferable-coins': 2,
'v3/account/sub-transfer-record': 4,
'v3/ins-loan/transfered': 6.6667,
'v3/ins-loan/symbols': 6.6667,
'v3/ins-loan/risk-unit': 6.6667,
'v3/ins-loan/repaid-history': 6.6667,
'v3/ins-loan/product-infos': 6.6667,
'v3/ins-loan/loan-order': 6.6667,
'v3/ins-loan/ltv-convert': 6.6667,
'v3/ins-loan/ensure-coins-convert': 6.6667,
'v3/position/current-position': 1,
'v3/position/history-position': 1,
'v3/trade/order-info': 1,
'v3/trade/unfilled-orders': 1,
'v3/trade/history-orders': 1,
'v3/trade/fills': 1,
'v3/user/sub-list': 2,
'v3/user/sub-api-list': 2,
},
'post': {
'v3/account/set-leverage': 2,
'v3/account/set-hold-mode': 2,
'v3/account/repay': 4,
'v3/account/transfer': 4,
'v3/account/sub-transfer': 4,
'v3/account/max-open-available': 4,
'v3/ins-loan/bind-uid': 6.6667,
'v3/trade/place-order': 2,
'v3/trade/modify-order': 2,
'v3/trade/cancel-order': 2,
'v3/trade/place-batch': 4,
'v3/trade/batch-modify-order': 2,
'v3/trade/cancel-batch': 4,
'v3/trade/cancel-symbol-order': 4,
'v3/trade/close-positions': 4,
'v3/user/create-sub': 2,
'v3/user/freeze-sub': 2,
'v3/user/create-sub-api': 2,
'v3/user/update-sub-api': 2,
'v3/user/delete-sub-api': 2,
},
},
},
},
'fees': {
'spot': {
'taker': this.parseNumber('0.002'),
'maker': this.parseNumber('0.002'),
},
'swap': {
'taker': this.parseNumber('0.0006'),
'maker': this.parseNumber('0.0004'),
},
},
'requiredCredentials': {
'apiKey': true,
'secret': true,
'password': true,
},
'exceptions': {
// http error codes
// 400 Bad Request — Invalid request format
// 401 Unauthorized — Invalid API Key
// 403 Forbidden — You do not have access to the requested resource
// 404 Not Found
// 500 Internal Server Error — We had a problem with our server
'exact': {
'1': ExchangeError,
// undocumented
'failure to get a peer from the ring-balancer': ExchangeNotAvailable,
'4010': PermissionDenied,
// common
// '0': ExchangeError, // 200 successful,when the order placement / cancellation / operation is successful
'4001': ExchangeError,
'4002': ExchangeError,
// --------------------------------------------------------
'30001': AuthenticationError,
'30002': AuthenticationError,
'30003': AuthenticationError,
'30004': AuthenticationError,
'30005': InvalidNonce,
'30006': AuthenticationError,
'30007': BadRequest,
'30008': RequestTimeout,
'30009': ExchangeError,
'30010': AuthenticationError,
'30011': PermissionDenied,
'30012': AuthenticationError,
'30013': AuthenticationError,
'30