ccxt 4.4.68 → 4.4.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/base/Exchange.js +0 -1
  5. package/dist/cjs/src/binance.js +20 -3
  6. package/dist/cjs/src/bitget.js +49 -335
  7. package/dist/cjs/src/bitstamp.js +2 -3
  8. package/dist/cjs/src/bybit.js +7 -0
  9. package/dist/cjs/src/coinbase.js +25 -9
  10. package/dist/cjs/src/cryptomus.js +214 -116
  11. package/dist/cjs/src/hyperliquid.js +19 -8
  12. package/dist/cjs/src/okx.js +4 -0
  13. package/dist/cjs/src/paradex.js +172 -4
  14. package/dist/cjs/src/phemex.js +2 -2
  15. package/dist/cjs/src/pro/bitget.js +40 -7
  16. package/dist/cjs/src/pro/bybit.js +86 -38
  17. package/dist/cjs/src/tradeogre.js +34 -11
  18. package/dist/cjs/src/whitebit.js +211 -1
  19. package/js/ccxt.d.ts +1 -1
  20. package/js/ccxt.js +1 -1
  21. package/js/src/abstract/bybit.d.ts +4 -0
  22. package/js/src/abstract/myokx.d.ts +3 -0
  23. package/js/src/abstract/okx.d.ts +3 -0
  24. package/js/src/abstract/paradex.d.ts +23 -0
  25. package/js/src/abstract/tradeogre.d.ts +2 -1
  26. package/js/src/base/Exchange.js +0 -1
  27. package/js/src/base/types.d.ts +2 -2
  28. package/js/src/binance.js +20 -3
  29. package/js/src/bitget.d.ts +0 -1
  30. package/js/src/bitget.js +49 -335
  31. package/js/src/bitstamp.js +2 -3
  32. package/js/src/bybit.js +7 -0
  33. package/js/src/coinbase.d.ts +0 -5
  34. package/js/src/coinbase.js +25 -9
  35. package/js/src/cryptomus.d.ts +127 -1
  36. package/js/src/cryptomus.js +214 -116
  37. package/js/src/hyperliquid.js +19 -8
  38. package/js/src/okx.d.ts +1 -0
  39. package/js/src/okx.js +4 -0
  40. package/js/src/paradex.d.ts +48 -1
  41. package/js/src/paradex.js +172 -4
  42. package/js/src/phemex.d.ts +1 -1
  43. package/js/src/phemex.js +2 -2
  44. package/js/src/pro/bitget.js +40 -7
  45. package/js/src/pro/bybit.d.ts +1 -0
  46. package/js/src/pro/bybit.js +86 -38
  47. package/js/src/tradeogre.d.ts +1 -0
  48. package/js/src/tradeogre.js +34 -11
  49. package/js/src/whitebit.d.ts +35 -1
  50. package/js/src/whitebit.js +211 -1
  51. package/package.json +1 -1
@@ -25,7 +25,7 @@ class whitebit extends whitebit$1 {
25
25
  'CORS': undefined,
26
26
  'spot': true,
27
27
  'margin': true,
28
- 'swap': false,
28
+ 'swap': true,
29
29
  'future': false,
30
30
  'option': false,
31
31
  'cancelAllOrders': true,
@@ -75,7 +75,10 @@ class whitebit extends whitebit$1 {
75
75
  'fetchOpenOrders': true,
76
76
  'fetchOrderBook': true,
77
77
  'fetchOrderTrades': true,
78
+ 'fetchPosition': true,
79
+ 'fetchPositionHistory': true,
78
80
  'fetchPositionMode': false,
81
+ 'fetchPositions': true,
79
82
  'fetchPremiumIndexOHLCV': false,
80
83
  'fetchStatus': true,
81
84
  'fetchTicker': true,
@@ -2961,6 +2964,213 @@ class whitebit extends whitebit$1 {
2961
2964
  'fee': undefined,
2962
2965
  };
2963
2966
  }
2967
+ /**
2968
+ * @method
2969
+ * @name whitebit#fetchPositionHistory
2970
+ * @description fetches historical positions
2971
+ * @see https://docs.whitebit.com/private/http-trade-v4/#positions-history
2972
+ * @param {string} symbol unified contract symbol
2973
+ * @param {int} [since] the earliest time in ms to fetch positions for
2974
+ * @param {int} [limit] the maximum amount of records to fetch
2975
+ * @param {object} [params] extra parameters specific to the exchange api endpoint
2976
+ * @param {int} [params.positionId] the id of the requested position
2977
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
2978
+ */
2979
+ async fetchPositionHistory(symbol, since = undefined, limit = undefined, params = {}) {
2980
+ await this.loadMarkets();
2981
+ const market = this.market(symbol);
2982
+ let request = {
2983
+ 'market': market['id'],
2984
+ };
2985
+ if (since !== undefined) {
2986
+ request['startDate'] = since;
2987
+ }
2988
+ if (limit !== undefined) {
2989
+ request['limit'] = since;
2990
+ }
2991
+ [request, params] = this.handleUntilOption('endDate', request, params);
2992
+ const response = await this.v4PrivatePostCollateralAccountPositionsHistory(this.extend(request, params));
2993
+ //
2994
+ // [
2995
+ // {
2996
+ // "positionId": 479975679,
2997
+ // "market": "BTC_PERP",
2998
+ // "openDate": 1741941025.309887,
2999
+ // "modifyDate": 1741941025.309887,
3000
+ // "amount": "0.001",
3001
+ // "basePrice": "82498.7",
3002
+ // "realizedFunding": "0",
3003
+ // "liquidationPrice": "0",
3004
+ // "liquidationState": null,
3005
+ // "orderDetail": {
3006
+ // "id": 1224727949521,
3007
+ // "tradeAmount": "0.001",
3008
+ // "price": "82498.7",
3009
+ // "tradeFee": "0.028874545",
3010
+ // "fundingFee": "0",
3011
+ // "realizedPnl": "-0.028874545"
3012
+ // }
3013
+ // }
3014
+ // ]
3015
+ //
3016
+ const positions = this.parsePositions(response);
3017
+ return this.filterBySymbolSinceLimit(positions, symbol, since, limit);
3018
+ }
3019
+ /**
3020
+ * @method
3021
+ * @name whitebit#fetchPositions
3022
+ * @description fetch all open positions
3023
+ * @see https://docs.whitebit.com/private/http-trade-v4/#open-positions
3024
+ * @param {string[]} [symbols] list of unified market symbols
3025
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3026
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
3027
+ */
3028
+ async fetchPositions(symbols = undefined, params = {}) {
3029
+ await this.loadMarkets();
3030
+ symbols = this.marketSymbols(symbols);
3031
+ const response = await this.v4PrivatePostCollateralAccountPositionsOpen(params);
3032
+ //
3033
+ // [
3034
+ // {
3035
+ // "positionId": 479975679,
3036
+ // "market": "BTC_PERP",
3037
+ // "openDate": 1741941025.3098869,
3038
+ // "modifyDate": 1741941025.3098869,
3039
+ // "amount": "0.001",
3040
+ // "basePrice": "82498.7",
3041
+ // "liquidationPrice": "70177.2",
3042
+ // "pnl": "0",
3043
+ // "pnlPercent": "0.00",
3044
+ // "margin": "4.2",
3045
+ // "freeMargin": "9.9",
3046
+ // "funding": "0",
3047
+ // "unrealizedFunding": "0",
3048
+ // "liquidationState": null,
3049
+ // "tpsl": null
3050
+ // }
3051
+ // ]
3052
+ //
3053
+ return this.parsePositions(response, symbols);
3054
+ }
3055
+ /**
3056
+ * @method
3057
+ * @name whitebit#fetchPosition
3058
+ * @description fetch data on a single open contract trade position
3059
+ * @see https://docs.whitebit.com/private/http-trade-v4/#open-positions
3060
+ * @param {string} symbol unified market symbol of the market the position is held in
3061
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3062
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
3063
+ */
3064
+ async fetchPosition(symbol, params = {}) {
3065
+ await this.loadMarkets();
3066
+ const market = this.market(symbol);
3067
+ const request = {
3068
+ 'symbol': market['id'],
3069
+ };
3070
+ const response = await this.v4PrivatePostCollateralAccountPositionsOpen(this.extend(request, params));
3071
+ //
3072
+ // [
3073
+ // {
3074
+ // "positionId": 479975679,
3075
+ // "market": "BTC_PERP",
3076
+ // "openDate": 1741941025.3098869,
3077
+ // "modifyDate": 1741941025.3098869,
3078
+ // "amount": "0.001",
3079
+ // "basePrice": "82498.7",
3080
+ // "liquidationPrice": "70177.2",
3081
+ // "pnl": "0",
3082
+ // "pnlPercent": "0.00",
3083
+ // "margin": "4.2",
3084
+ // "freeMargin": "9.9",
3085
+ // "funding": "0",
3086
+ // "unrealizedFunding": "0",
3087
+ // "liquidationState": null,
3088
+ // "tpsl": null
3089
+ // }
3090
+ // ]
3091
+ //
3092
+ const data = this.safeDict(response, 0, {});
3093
+ return this.parsePosition(data, market);
3094
+ }
3095
+ parsePosition(position, market = undefined) {
3096
+ //
3097
+ // fetchPosition, fetchPositions
3098
+ //
3099
+ // {
3100
+ // "positionId": 479975679,
3101
+ // "market": "BTC_PERP",
3102
+ // "openDate": 1741941025.3098869,
3103
+ // "modifyDate": 1741941025.3098869,
3104
+ // "amount": "0.001",
3105
+ // "basePrice": "82498.7",
3106
+ // "liquidationPrice": "70177.2",
3107
+ // "pnl": "0",
3108
+ // "pnlPercent": "0.00",
3109
+ // "margin": "4.2",
3110
+ // "freeMargin": "9.9",
3111
+ // "funding": "0",
3112
+ // "unrealizedFunding": "0",
3113
+ // "liquidationState": null,
3114
+ // "tpsl": null
3115
+ // }
3116
+ //
3117
+ // fetchPositionHistory
3118
+ //
3119
+ // {
3120
+ // "positionId": 479975679,
3121
+ // "market": "BTC_PERP",
3122
+ // "openDate": 1741941025.309887,
3123
+ // "modifyDate": 1741941025.309887,
3124
+ // "amount": "0.001",
3125
+ // "basePrice": "82498.7",
3126
+ // "realizedFunding": "0",
3127
+ // "liquidationPrice": "0",
3128
+ // "liquidationState": null,
3129
+ // "orderDetail": {
3130
+ // "id": 1224727949521,
3131
+ // "tradeAmount": "0.001",
3132
+ // "price": "82498.7",
3133
+ // "tradeFee": "0.028874545",
3134
+ // "fundingFee": "0",
3135
+ // "realizedPnl": "-0.028874545"
3136
+ // }
3137
+ // }
3138
+ //
3139
+ const marketId = this.safeString(position, 'market');
3140
+ const timestamp = this.safeTimestamp(position, 'openDate');
3141
+ const tpsl = this.safeDict(position, 'tpsl', {});
3142
+ const orderDetail = this.safeDict(position, 'orderDetail', {});
3143
+ return this.safePosition({
3144
+ 'info': position,
3145
+ 'id': this.safeString(position, 'positionId'),
3146
+ 'symbol': this.safeSymbol(marketId, market),
3147
+ 'notional': undefined,
3148
+ 'marginMode': undefined,
3149
+ 'liquidationPrice': this.safeNumber(position, 'liquidationPrice'),
3150
+ 'entryPrice': this.safeNumber(position, 'basePrice'),
3151
+ 'unrealizedPnl': this.safeNumber(position, 'pnl'),
3152
+ 'realizedPnl': this.safeNumber(orderDetail, 'realizedPnl'),
3153
+ 'percentage': this.safeNumber(position, 'pnlPercent'),
3154
+ 'contracts': undefined,
3155
+ 'contractSize': undefined,
3156
+ 'markPrice': undefined,
3157
+ 'lastPrice': undefined,
3158
+ 'side': undefined,
3159
+ 'hedged': undefined,
3160
+ 'timestamp': timestamp,
3161
+ 'datetime': this.iso8601(timestamp),
3162
+ 'lastUpdateTimestamp': this.safeTimestamp(position, 'modifyDate'),
3163
+ 'maintenanceMargin': undefined,
3164
+ 'maintenanceMarginPercentage': undefined,
3165
+ 'collateral': this.safeNumber(position, 'margin'),
3166
+ 'initialMargin': undefined,
3167
+ 'initialMarginPercentage': undefined,
3168
+ 'leverage': undefined,
3169
+ 'marginRatio': undefined,
3170
+ 'stopLossPrice': this.safeNumber(tpsl, 'stopLoss'),
3171
+ 'takeProfitPrice': this.safeNumber(tpsl, 'takeProfit'),
3172
+ });
3173
+ }
2964
3174
  isFiat(currency) {
2965
3175
  const fiatCurrencies = this.safeValue(this.options, 'fiatCurrencies', []);
2966
3176
  return this.inArray(currency, fiatCurrencies);
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OrderBooks, OpenInterests } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
- declare const version = "4.4.67";
7
+ declare const version = "4.4.69";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -32,7 +32,7 @@ import * as errors from './src/base/errors.js';
32
32
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
33
33
  //-----------------------------------------------------------------------------
34
34
  // this is updated by vss.js when building
35
- const version = '4.4.68';
35
+ const version = '4.4.70';
36
36
  Exchange.ccxtVersion = version;
37
37
  //-----------------------------------------------------------------------------
38
38
  import ace from './src/ace.js';
@@ -55,6 +55,7 @@ interface Exchange {
55
55
  publicGetV5CryptoLoanLoanableData(params?: {}): Promise<implicitReturnType>;
56
56
  publicGetV5InsLoanProductInfos(params?: {}): Promise<implicitReturnType>;
57
57
  publicGetV5InsLoanEnsureTokensConvert(params?: {}): Promise<implicitReturnType>;
58
+ publicGetV5EarnProduct(params?: {}): Promise<implicitReturnType>;
58
59
  privateGetV5MarketInstrumentsInfo(params?: {}): Promise<implicitReturnType>;
59
60
  privateGetV2PrivateWalletFundRecords(params?: {}): Promise<implicitReturnType>;
60
61
  privateGetSpotV3PrivateOrder(params?: {}): Promise<implicitReturnType>;
@@ -191,6 +192,8 @@ interface Exchange {
191
192
  privateGetV5BrokerEarningsInfo(params?: {}): Promise<implicitReturnType>;
192
193
  privateGetV5BrokerAccountInfo(params?: {}): Promise<implicitReturnType>;
193
194
  privateGetV5BrokerAssetQuerySubMemberDepositRecord(params?: {}): Promise<implicitReturnType>;
195
+ privateGetV5EarnOrder(params?: {}): Promise<implicitReturnType>;
196
+ privateGetV5EarnPosition(params?: {}): Promise<implicitReturnType>;
194
197
  privatePostSpotV3PrivateOrder(params?: {}): Promise<implicitReturnType>;
195
198
  privatePostSpotV3PrivateCancelOrder(params?: {}): Promise<implicitReturnType>;
196
199
  privatePostSpotV3PrivateCancelOrders(params?: {}): Promise<implicitReturnType>;
@@ -306,6 +309,7 @@ interface Exchange {
306
309
  privatePostV5BrokerAwardInfo(params?: {}): Promise<implicitReturnType>;
307
310
  privatePostV5BrokerAwardDistributeAward(params?: {}): Promise<implicitReturnType>;
308
311
  privatePostV5BrokerAwardDistributionRecord(params?: {}): Promise<implicitReturnType>;
312
+ privatePostV5EarnPlaceOrder(params?: {}): Promise<implicitReturnType>;
309
313
  }
310
314
  declare abstract class Exchange extends _Exchange {
311
315
  }
@@ -106,7 +106,9 @@ interface okx {
106
106
  privateGetTradeEasyConvertCurrencyList(params?: {}): Promise<implicitReturnType>;
107
107
  privateGetTradeEasyConvertHistory(params?: {}): Promise<implicitReturnType>;
108
108
  privateGetTradeOneClickRepayCurrencyList(params?: {}): Promise<implicitReturnType>;
109
+ privateGetTradeOneClickRepayCurrencyListV2(params?: {}): Promise<implicitReturnType>;
109
110
  privateGetTradeOneClickRepayHistory(params?: {}): Promise<implicitReturnType>;
111
+ privateGetTradeOneClickRepayHistoryV2(params?: {}): Promise<implicitReturnType>;
110
112
  privateGetTradeAccountRateLimit(params?: {}): Promise<implicitReturnType>;
111
113
  privateGetAssetCurrencies(params?: {}): Promise<implicitReturnType>;
112
114
  privateGetAssetBalances(params?: {}): Promise<implicitReturnType>;
@@ -249,6 +251,7 @@ interface okx {
249
251
  privatePostTradeCancelAdvanceAlgos(params?: {}): Promise<implicitReturnType>;
250
252
  privatePostTradeEasyConvert(params?: {}): Promise<implicitReturnType>;
251
253
  privatePostTradeOneClickRepay(params?: {}): Promise<implicitReturnType>;
254
+ privatePostTradeOneClickRepayV2(params?: {}): Promise<implicitReturnType>;
252
255
  privatePostTradeMassCancel(params?: {}): Promise<implicitReturnType>;
253
256
  privatePostTradeCancelAllAfter(params?: {}): Promise<implicitReturnType>;
254
257
  privatePostAssetTransfer(params?: {}): Promise<implicitReturnType>;
@@ -106,7 +106,9 @@ interface Exchange {
106
106
  privateGetTradeEasyConvertCurrencyList(params?: {}): Promise<implicitReturnType>;
107
107
  privateGetTradeEasyConvertHistory(params?: {}): Promise<implicitReturnType>;
108
108
  privateGetTradeOneClickRepayCurrencyList(params?: {}): Promise<implicitReturnType>;
109
+ privateGetTradeOneClickRepayCurrencyListV2(params?: {}): Promise<implicitReturnType>;
109
110
  privateGetTradeOneClickRepayHistory(params?: {}): Promise<implicitReturnType>;
111
+ privateGetTradeOneClickRepayHistoryV2(params?: {}): Promise<implicitReturnType>;
110
112
  privateGetTradeAccountRateLimit(params?: {}): Promise<implicitReturnType>;
111
113
  privateGetAssetCurrencies(params?: {}): Promise<implicitReturnType>;
112
114
  privateGetAssetBalances(params?: {}): Promise<implicitReturnType>;
@@ -249,6 +251,7 @@ interface Exchange {
249
251
  privatePostTradeCancelAdvanceAlgos(params?: {}): Promise<implicitReturnType>;
250
252
  privatePostTradeEasyConvert(params?: {}): Promise<implicitReturnType>;
251
253
  privatePostTradeOneClickRepay(params?: {}): Promise<implicitReturnType>;
254
+ privatePostTradeOneClickRepayV2(params?: {}): Promise<implicitReturnType>;
252
255
  privatePostTradeMassCancel(params?: {}): Promise<implicitReturnType>;
253
256
  privatePostTradeCancelAllAfter(params?: {}): Promise<implicitReturnType>;
254
257
  privatePostAssetTransfer(params?: {}): Promise<implicitReturnType>;
@@ -13,8 +13,19 @@ interface Exchange {
13
13
  publicGetSystemState(params?: {}): Promise<implicitReturnType>;
14
14
  publicGetSystemTime(params?: {}): Promise<implicitReturnType>;
15
15
  publicGetTrades(params?: {}): Promise<implicitReturnType>;
16
+ publicGetVaults(params?: {}): Promise<implicitReturnType>;
17
+ publicGetVaultsBalance(params?: {}): Promise<implicitReturnType>;
18
+ publicGetVaultsConfig(params?: {}): Promise<implicitReturnType>;
19
+ publicGetVaultsHistory(params?: {}): Promise<implicitReturnType>;
20
+ publicGetVaultsPositions(params?: {}): Promise<implicitReturnType>;
21
+ publicGetVaultsSummary(params?: {}): Promise<implicitReturnType>;
22
+ publicGetVaultsTransfers(params?: {}): Promise<implicitReturnType>;
16
23
  privateGetAccount(params?: {}): Promise<implicitReturnType>;
24
+ privateGetAccountInfo(params?: {}): Promise<implicitReturnType>;
25
+ privateGetAccountHistory(params?: {}): Promise<implicitReturnType>;
26
+ privateGetAccountMargin(params?: {}): Promise<implicitReturnType>;
17
27
  privateGetAccountProfile(params?: {}): Promise<implicitReturnType>;
28
+ privateGetAccountSubaccounts(params?: {}): Promise<implicitReturnType>;
18
29
  privateGetBalance(params?: {}): Promise<implicitReturnType>;
19
30
  privateGetFills(params?: {}): Promise<implicitReturnType>;
20
31
  privateGetFundingPayments(params?: {}): Promise<implicitReturnType>;
@@ -27,16 +38,28 @@ interface Exchange {
27
38
  privateGetOrdersByClientIdClientId(params?: {}): Promise<implicitReturnType>;
28
39
  privateGetOrdersOrderId(params?: {}): Promise<implicitReturnType>;
29
40
  privateGetPointsDataMarketProgram(params?: {}): Promise<implicitReturnType>;
41
+ privateGetReferralsQrCode(params?: {}): Promise<implicitReturnType>;
30
42
  privateGetReferralsSummary(params?: {}): Promise<implicitReturnType>;
31
43
  privateGetTransfers(params?: {}): Promise<implicitReturnType>;
44
+ privateGetAlgoOrders(params?: {}): Promise<implicitReturnType>;
45
+ privateGetAlgoOrdersHistory(params?: {}): Promise<implicitReturnType>;
46
+ privateGetAlgoOrdersAlgoId(params?: {}): Promise<implicitReturnType>;
47
+ privateGetVaultsAccountSummary(params?: {}): Promise<implicitReturnType>;
48
+ privatePostAccountMarginMarket(params?: {}): Promise<implicitReturnType>;
49
+ privatePostAccountProfileMaxSlippage(params?: {}): Promise<implicitReturnType>;
32
50
  privatePostAccountProfileReferralCode(params?: {}): Promise<implicitReturnType>;
33
51
  privatePostAccountProfileUsername(params?: {}): Promise<implicitReturnType>;
34
52
  privatePostAuth(params?: {}): Promise<implicitReturnType>;
35
53
  privatePostOnboarding(params?: {}): Promise<implicitReturnType>;
36
54
  privatePostOrders(params?: {}): Promise<implicitReturnType>;
55
+ privatePostOrdersBatch(params?: {}): Promise<implicitReturnType>;
56
+ privatePostAlgoOrders(params?: {}): Promise<implicitReturnType>;
57
+ privatePostVaults(params?: {}): Promise<implicitReturnType>;
58
+ privatePutOrdersOrderId(params?: {}): Promise<implicitReturnType>;
37
59
  privateDeleteOrders(params?: {}): Promise<implicitReturnType>;
38
60
  privateDeleteOrdersByClientIdClientId(params?: {}): Promise<implicitReturnType>;
39
61
  privateDeleteOrdersOrderId(params?: {}): Promise<implicitReturnType>;
62
+ privateDeleteAlgoOrdersAlgoId(params?: {}): Promise<implicitReturnType>;
40
63
  }
41
64
  declare abstract class Exchange extends _Exchange {
42
65
  }
@@ -5,8 +5,8 @@ interface Exchange {
5
5
  publicGetOrdersMarket(params?: {}): Promise<implicitReturnType>;
6
6
  publicGetTickerMarket(params?: {}): Promise<implicitReturnType>;
7
7
  publicGetHistoryMarket(params?: {}): Promise<implicitReturnType>;
8
+ publicGetChartIntervalMarketTimestamp(params?: {}): Promise<implicitReturnType>;
8
9
  publicGetChartIntervalMarket(params?: {}): Promise<implicitReturnType>;
9
- privateGetAccountBalance(params?: {}): Promise<implicitReturnType>;
10
10
  privateGetAccountBalances(params?: {}): Promise<implicitReturnType>;
11
11
  privateGetAccountOrderUuid(params?: {}): Promise<implicitReturnType>;
12
12
  privatePostOrderBuy(params?: {}): Promise<implicitReturnType>;
@@ -14,6 +14,7 @@ interface Exchange {
14
14
  privatePostOrderCancel(params?: {}): Promise<implicitReturnType>;
15
15
  privatePostOrders(params?: {}): Promise<implicitReturnType>;
16
16
  privatePostAccountOrders(params?: {}): Promise<implicitReturnType>;
17
+ privatePostAccountBalance(params?: {}): Promise<implicitReturnType>;
17
18
  }
18
19
  declare abstract class Exchange extends _Exchange {
19
20
  }
@@ -1568,7 +1568,6 @@ export default class Exchange {
1568
1568
  },
1569
1569
  'commonCurrencies': {
1570
1570
  'XBT': 'BTC',
1571
- 'BCC': 'BCH',
1572
1571
  'BCHSV': 'BSV',
1573
1572
  },
1574
1573
  'precisionMode': TICK_SIZE,
@@ -542,9 +542,9 @@ export interface MarginModes extends Dictionary<MarginMode> {
542
542
  }
543
543
  export interface OptionChain extends Dictionary<Option> {
544
544
  }
545
- export interface IsolatedBorrowRates extends Dictionary<IsolatedBorrowRates> {
545
+ export interface IsolatedBorrowRates extends Dictionary<IsolatedBorrowRate> {
546
546
  }
547
- export interface CrossBorrowRates extends Dictionary<CrossBorrowRates> {
547
+ export interface CrossBorrowRates extends Dictionary<CrossBorrowRate> {
548
548
  }
549
549
  export interface LeverageTiers extends Dictionary<LeverageTier[]> {
550
550
  }
package/js/src/binance.js CHANGED
@@ -8792,7 +8792,7 @@ export default class binance extends Exchange {
8792
8792
  const internalInteger = this.safeInteger(transaction, 'transferType');
8793
8793
  let internal = undefined;
8794
8794
  if (internalInteger !== undefined) {
8795
- internal = internalInteger ? true : false;
8795
+ internal = (internalInteger !== 0) ? true : false;
8796
8796
  }
8797
8797
  const network = this.safeString(transaction, 'network');
8798
8798
  return {
@@ -12113,8 +12113,25 @@ export default class binance extends Exchange {
12113
12113
  let query = undefined;
12114
12114
  // handle batchOrders
12115
12115
  if ((path === 'batchOrders') && ((method === 'POST') || (method === 'PUT'))) {
12116
- const batchOrders = this.safeValue(params, 'batchOrders');
12117
- const queryBatch = (this.json(batchOrders));
12116
+ const batchOrders = this.safeList(params, 'batchOrders');
12117
+ let checkedBatchOrders = batchOrders;
12118
+ if (method === 'POST' && api === 'fapiPrivate') {
12119
+ // check broker id if batchOrders are called with fapiPrivatePostBatchOrders
12120
+ checkedBatchOrders = [];
12121
+ for (let i = 0; i < batchOrders.length; i++) {
12122
+ const batchOrder = batchOrders[i];
12123
+ let newClientOrderId = this.safeString(batchOrder, 'newClientOrderId');
12124
+ if (newClientOrderId === undefined) {
12125
+ const defaultId = 'x-xcKtGhcu'; // batchOrders can not be spot or margin
12126
+ const broker = this.safeDict(this.options, 'broker', {});
12127
+ const brokerId = this.safeString(broker, 'future', defaultId);
12128
+ newClientOrderId = brokerId + this.uuid22();
12129
+ batchOrder['newClientOrderId'] = newClientOrderId;
12130
+ }
12131
+ checkedBatchOrders.push(batchOrder);
12132
+ }
12133
+ }
12134
+ const queryBatch = (this.json(checkedBatchOrders));
12118
12135
  params['batchOrders'] = queryBatch;
12119
12136
  }
12120
12137
  const defaultRecvWindow = this.safeInteger(this.options, 'recvWindow');
@@ -7,7 +7,6 @@ import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory
7
7
  export default class bitget extends Exchange {
8
8
  describe(): any;
9
9
  setSandboxMode(enabled: any): void;
10
- convertSymbolForSandbox(symbol: any): any;
11
10
  handleProductTypeAndParams(market?: any, params?: {}): {}[];
12
11
  /**
13
12
  * @method