ccxt 4.5.45 → 4.5.46
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.
- package/README.md +3 -3
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +3 -0
- package/dist/cjs/src/binance.js +11 -2
- package/dist/cjs/src/bitget.js +3 -1
- package/dist/cjs/src/bitmart.js +144 -21
- package/dist/cjs/src/bybit.js +58 -56
- package/dist/cjs/src/bydfi.js +102 -100
- package/dist/cjs/src/gate.js +37 -2
- package/dist/cjs/src/kraken.js +2 -0
- package/dist/cjs/src/kucoin.js +4 -2
- package/dist/cjs/src/okx.js +75 -57
- package/dist/cjs/src/paradex.js +2 -6
- package/dist/cjs/src/pro/bydfi.js +19 -19
- package/dist/cjs/src/pro/gate.js +79 -54
- package/dist/cjs/src/pro/grvt.js +5 -3
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/okx.js +1 -1
- package/index.d.cts +2 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitmart.d.ts +7 -0
- package/js/src/abstract/bydfi.d.ts +29 -29
- package/js/src/abstract/kraken.d.ts +1 -0
- package/js/src/abstract/kucoin.d.ts +1 -0
- package/js/src/abstract/kucoinfutures.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +3 -0
- package/js/src/binance.js +11 -2
- package/js/src/bitget.js +3 -1
- package/js/src/bitmart.d.ts +18 -4
- package/js/src/bitmart.js +144 -21
- package/js/src/bybit.d.ts +1 -0
- package/js/src/bybit.js +58 -56
- package/js/src/bydfi.d.ts +31 -31
- package/js/src/bydfi.js +102 -100
- package/js/src/gate.js +37 -2
- package/js/src/kraken.js +2 -0
- package/js/src/kucoin.js +4 -2
- package/js/src/okx.d.ts +1 -0
- package/js/src/okx.js +75 -57
- package/js/src/paradex.d.ts +0 -1
- package/js/src/paradex.js +2 -6
- package/js/src/pro/bydfi.d.ts +18 -18
- package/js/src/pro/bydfi.js +19 -19
- package/js/src/pro/gate.d.ts +2 -2
- package/js/src/pro/gate.js +79 -54
- package/js/src/pro/grvt.js +5 -3
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/okx.js +1 -1
- package/package.json +2 -2
package/dist/cjs/src/pro/gate.js
CHANGED
|
@@ -51,6 +51,19 @@ class gate extends gate$1["default"] {
|
|
|
51
51
|
'watchMyLiquidations': true,
|
|
52
52
|
'watchMyLiquidationsForSymbols': true,
|
|
53
53
|
'watchPositions': true,
|
|
54
|
+
'unWatchTicker': false,
|
|
55
|
+
'unWatchTickers': false,
|
|
56
|
+
'unWatchOHLCV': false,
|
|
57
|
+
'unWatchOHLCVForSymbols': false,
|
|
58
|
+
'unWatchOrderBook': true,
|
|
59
|
+
'unWatchOrderBookForSymbols': false,
|
|
60
|
+
'unWatchTrades': true,
|
|
61
|
+
'unWatchTradesForSymbols': true,
|
|
62
|
+
'unWatchMyTrades': false,
|
|
63
|
+
'unWatchOrders': false,
|
|
64
|
+
'unWatchPositions': false,
|
|
65
|
+
'unWatchMarkPrices': false,
|
|
66
|
+
'unWatchMarkPrice': false,
|
|
54
67
|
},
|
|
55
68
|
'urls': {
|
|
56
69
|
'api': {
|
|
@@ -1033,11 +1046,11 @@ class gate extends gate$1["default"] {
|
|
|
1033
1046
|
/**
|
|
1034
1047
|
* @method
|
|
1035
1048
|
* @name gate#watchBalance
|
|
1049
|
+
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
1036
1050
|
* @see https://www.gate.com/docs/developers/apiv4/ws/en/#spot-balance-channel
|
|
1037
1051
|
* @see https://www.gate.com/docs/developers/futures/ws/en/#balances-api
|
|
1038
1052
|
* @see https://www.gate.com/docs/developers/delivery/ws/en/#balances-api
|
|
1039
1053
|
* @see https://www.gate.com/docs/developers/options/ws/en/#balances-channel
|
|
1040
|
-
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
1041
1054
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1042
1055
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
|
|
1043
1056
|
*/
|
|
@@ -1065,22 +1078,26 @@ class gate extends gate$1["default"] {
|
|
|
1065
1078
|
handleBalance(client, message) {
|
|
1066
1079
|
//
|
|
1067
1080
|
// spot order fill
|
|
1068
|
-
//
|
|
1069
|
-
//
|
|
1070
|
-
//
|
|
1071
|
-
//
|
|
1072
|
-
//
|
|
1073
|
-
//
|
|
1074
|
-
//
|
|
1075
|
-
//
|
|
1076
|
-
//
|
|
1077
|
-
//
|
|
1078
|
-
//
|
|
1079
|
-
//
|
|
1080
|
-
//
|
|
1081
|
-
//
|
|
1082
|
-
//
|
|
1083
|
-
//
|
|
1081
|
+
// {
|
|
1082
|
+
// "time": 1653664351,
|
|
1083
|
+
// "time_ms": 1605248616763,
|
|
1084
|
+
// "channel": "spot.balances",
|
|
1085
|
+
// "event": "update",
|
|
1086
|
+
// "result": [
|
|
1087
|
+
// {
|
|
1088
|
+
// "timestamp": "1667556323",
|
|
1089
|
+
// "timestamp_ms": "1667556323730",
|
|
1090
|
+
// "user": "1000001",
|
|
1091
|
+
// "currency": "USDT",
|
|
1092
|
+
// "change": "0",
|
|
1093
|
+
// "total": "222244.3827652",
|
|
1094
|
+
// "available": "222244.3827",
|
|
1095
|
+
// "freeze": "5",
|
|
1096
|
+
// "freeze_change": "5.000000",
|
|
1097
|
+
// "change_type": "order-create"
|
|
1098
|
+
// }
|
|
1099
|
+
// ]
|
|
1100
|
+
// }
|
|
1084
1101
|
//
|
|
1085
1102
|
// account transfer
|
|
1086
1103
|
//
|
|
@@ -1124,15 +1141,16 @@ class gate extends gate$1["default"] {
|
|
|
1124
1141
|
// }
|
|
1125
1142
|
//
|
|
1126
1143
|
const result = this.safeValue(message, 'result', []);
|
|
1127
|
-
const timestamp = this.safeInteger(message, 'time_ms');
|
|
1128
1144
|
this.balance['info'] = result;
|
|
1129
|
-
this.balance['timestamp'] = timestamp;
|
|
1130
|
-
this.balance['datetime'] = this.iso8601(timestamp);
|
|
1131
1145
|
for (let i = 0; i < result.length; i++) {
|
|
1132
1146
|
const rawBalance = result[i];
|
|
1133
1147
|
const account = this.account();
|
|
1134
1148
|
const currencyId = this.safeString(rawBalance, 'currency', 'USDT'); // when not present it is USDT
|
|
1135
1149
|
const code = this.safeCurrencyCode(currencyId);
|
|
1150
|
+
const timestamp = this.safeInteger2(rawBalance, 'time_ms', 'timestamp_ms');
|
|
1151
|
+
this.balance['timestamp'] = timestamp;
|
|
1152
|
+
this.balance['datetime'] = this.iso8601(timestamp);
|
|
1153
|
+
account['used'] = this.safeString(rawBalance, 'freeze');
|
|
1136
1154
|
account['free'] = this.safeString(rawBalance, 'available');
|
|
1137
1155
|
account['total'] = this.safeString2(rawBalance, 'total', 'balance');
|
|
1138
1156
|
this.balance[code] = account;
|
|
@@ -1323,11 +1341,11 @@ class gate extends gate$1["default"] {
|
|
|
1323
1341
|
/**
|
|
1324
1342
|
* @method
|
|
1325
1343
|
* @name gate#watchOrders
|
|
1344
|
+
* @description watches information on multiple orders made by the user
|
|
1326
1345
|
* @see https://www.gate.com/docs/developers/apiv4/ws/en/#orders-channel
|
|
1327
1346
|
* @see https://www.gate.com/docs/developers/futures/ws/en/#orders-api
|
|
1328
1347
|
* @see https://www.gate.com/docs/developers/delivery/ws/en/#orders-api
|
|
1329
1348
|
* @see https://www.gate.com/docs/developers/options/ws/en/#orders-channel
|
|
1330
|
-
* @description watches information on multiple orders made by the user
|
|
1331
1349
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1332
1350
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1333
1351
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1374,39 +1392,46 @@ class gate extends gate$1["default"] {
|
|
|
1374
1392
|
}
|
|
1375
1393
|
handleOrder(client, message) {
|
|
1376
1394
|
//
|
|
1377
|
-
//
|
|
1378
|
-
//
|
|
1379
|
-
//
|
|
1380
|
-
//
|
|
1381
|
-
//
|
|
1382
|
-
//
|
|
1383
|
-
//
|
|
1384
|
-
//
|
|
1385
|
-
//
|
|
1386
|
-
//
|
|
1387
|
-
//
|
|
1388
|
-
//
|
|
1389
|
-
//
|
|
1390
|
-
//
|
|
1391
|
-
//
|
|
1392
|
-
//
|
|
1393
|
-
//
|
|
1394
|
-
//
|
|
1395
|
-
//
|
|
1396
|
-
//
|
|
1397
|
-
//
|
|
1398
|
-
//
|
|
1399
|
-
//
|
|
1400
|
-
//
|
|
1401
|
-
//
|
|
1402
|
-
//
|
|
1403
|
-
//
|
|
1404
|
-
//
|
|
1405
|
-
//
|
|
1406
|
-
//
|
|
1407
|
-
//
|
|
1408
|
-
//
|
|
1409
|
-
//
|
|
1395
|
+
// {
|
|
1396
|
+
// "time": 1774613210,
|
|
1397
|
+
// "time_ms": 1774613210392,
|
|
1398
|
+
// "channel": "spot.orders",
|
|
1399
|
+
// "event": "update",
|
|
1400
|
+
// "result": [
|
|
1401
|
+
// {
|
|
1402
|
+
// "id": "1036717689726",
|
|
1403
|
+
// "text": "apiv4",
|
|
1404
|
+
// "create_time": "1774613210",
|
|
1405
|
+
// "update_time": "1774613210",
|
|
1406
|
+
// "currency_pair": "BTC_USDT",
|
|
1407
|
+
// "type": "limit",
|
|
1408
|
+
// "account": "unified",
|
|
1409
|
+
// "side": "buy",
|
|
1410
|
+
// "amount": "0.1",
|
|
1411
|
+
// "price": "200",
|
|
1412
|
+
// "time_in_force": "gtc",
|
|
1413
|
+
// "left": "0.1",
|
|
1414
|
+
// "filled_amount": "0",
|
|
1415
|
+
// "filled_total": "0",
|
|
1416
|
+
// "avg_deal_price": "0",
|
|
1417
|
+
// "fee": "0",
|
|
1418
|
+
// "fee_currency": "BTC",
|
|
1419
|
+
// "point_fee": "0",
|
|
1420
|
+
// "gt_fee": "0",
|
|
1421
|
+
// "rebated_fee": "0",
|
|
1422
|
+
// "rebated_fee_currency": "BTC",
|
|
1423
|
+
// "create_time_ms": "1774613210391",
|
|
1424
|
+
// "update_time_ms": "1774613210391",
|
|
1425
|
+
// "user": 10406147,
|
|
1426
|
+
// "event": "put",
|
|
1427
|
+
// "stp_id": 0,
|
|
1428
|
+
// "stp_act": "-",
|
|
1429
|
+
// "finish_as": "open",
|
|
1430
|
+
// "biz_info": "ch:ccxt",
|
|
1431
|
+
// "amend_text": "-"
|
|
1432
|
+
// }
|
|
1433
|
+
// ]
|
|
1434
|
+
// }
|
|
1410
1435
|
//
|
|
1411
1436
|
const orders = this.safeValue(message, 'result', []);
|
|
1412
1437
|
const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
|
package/dist/cjs/src/pro/grvt.js
CHANGED
|
@@ -40,7 +40,8 @@ class grvt extends grvt$1["default"] {
|
|
|
40
40
|
'channel': 'v1.book.s', // v1.book.s | v1.book.d
|
|
41
41
|
},
|
|
42
42
|
'watchTickers': {
|
|
43
|
-
'channel': 'v1.ticker.s',
|
|
43
|
+
'channel': 'v1.ticker.s',
|
|
44
|
+
'interval': 500, // raw, 50, 100, 200, 500, 1000, 5000
|
|
44
45
|
},
|
|
45
46
|
},
|
|
46
47
|
'streaming': {
|
|
@@ -154,6 +155,8 @@ class grvt extends grvt$1["default"] {
|
|
|
154
155
|
}
|
|
155
156
|
let channel = undefined;
|
|
156
157
|
[channel, params] = this.handleOptionAndParams(params, 'watchTickers', 'channel', 'v1.ticker.s');
|
|
158
|
+
let interval = undefined;
|
|
159
|
+
[interval, params] = this.handleOptionAndParams(params, 'watchTickers', 'interval', 500);
|
|
157
160
|
await this.loadMarkets();
|
|
158
161
|
symbols = this.marketSymbols(symbols);
|
|
159
162
|
const rawHashes = [];
|
|
@@ -162,8 +165,7 @@ class grvt extends grvt$1["default"] {
|
|
|
162
165
|
const symbol = symbols[i];
|
|
163
166
|
const market = this.market(symbol);
|
|
164
167
|
const marketId = market['id'];
|
|
165
|
-
|
|
166
|
-
rawHashes.push(marketId + '@' + interval);
|
|
168
|
+
rawHashes.push(marketId + '@' + interval.toString());
|
|
167
169
|
messageHashes.push('ticker::' + market['symbol']);
|
|
168
170
|
}
|
|
169
171
|
const request = {
|
package/dist/cjs/src/pro/htx.js
CHANGED
|
@@ -32,10 +32,10 @@ class htx extends htx$1["default"] {
|
|
|
32
32
|
'watchMyTrades': true,
|
|
33
33
|
'watchBalance': true,
|
|
34
34
|
'watchOHLCV': true,
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
35
|
+
'unWatchTicker': true,
|
|
36
|
+
'unWatchOHLCV': true,
|
|
37
|
+
'unWatchTrades': true,
|
|
38
|
+
'unWatchOrderBook': true,
|
|
39
39
|
},
|
|
40
40
|
'urls': {
|
|
41
41
|
'api': {
|
package/dist/cjs/src/pro/okx.js
CHANGED
|
@@ -2377,7 +2377,7 @@ class okx extends okx$1["default"] {
|
|
|
2377
2377
|
if (errorCode !== undefined) {
|
|
2378
2378
|
this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);
|
|
2379
2379
|
}
|
|
2380
|
-
messageString = this.safeValue(
|
|
2380
|
+
messageString = this.safeValue(d, 'sMsg');
|
|
2381
2381
|
if (messageString !== undefined) {
|
|
2382
2382
|
this.throwBroadlyMatchedException(this.exceptions['broad'], messageString, feedback);
|
|
2383
2383
|
}
|
package/index.d.cts
ADDED
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, 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, ConstructorArgs, ADL } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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.5.
|
|
7
|
+
declare const version = "4.5.45";
|
|
8
8
|
import aftermath from './src/aftermath.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import apex from './src/apex.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, RestrictedLocation, 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.5.
|
|
35
|
+
const version = '4.5.45';
|
|
36
36
|
Exchange.ccxtVersion = version;
|
|
37
37
|
//-----------------------------------------------------------------------------
|
|
38
38
|
import aftermath from './src/aftermath.js';
|
|
@@ -91,6 +91,13 @@ interface Exchange {
|
|
|
91
91
|
privatePostSpotV4CancelOrders(params?: {}): Promise<implicitReturnType>;
|
|
92
92
|
privatePostSpotV4CancelAll(params?: {}): Promise<implicitReturnType>;
|
|
93
93
|
privatePostSpotV4BatchOrders(params?: {}): Promise<implicitReturnType>;
|
|
94
|
+
privatePostSpotV4AlgoSubmitOrder(params?: {}): Promise<implicitReturnType>;
|
|
95
|
+
privatePostSpotV4AlgoCancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
96
|
+
privatePostSpotV4AlgoCancelAll(params?: {}): Promise<implicitReturnType>;
|
|
97
|
+
privatePostSpotV4QueryAlgoOrder(params?: {}): Promise<implicitReturnType>;
|
|
98
|
+
privatePostSpotV4QueryAlgoClientOrder(params?: {}): Promise<implicitReturnType>;
|
|
99
|
+
privatePostSpotV4QueryAlgoOpenOrders(params?: {}): Promise<implicitReturnType>;
|
|
100
|
+
privatePostSpotV4QueryAlgoHistoryOrders(params?: {}): Promise<implicitReturnType>;
|
|
94
101
|
privatePostSpotV3CancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
95
102
|
privatePostSpotV2BatchOrders(params?: {}): Promise<implicitReturnType>;
|
|
96
103
|
privatePostSpotV2SubmitOrder(params?: {}): Promise<implicitReturnType>;
|
|
@@ -2,30 +2,30 @@ import { implicitReturnType } from '../base/types.js';
|
|
|
2
2
|
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
3
|
interface Exchange {
|
|
4
4
|
publicGetV1PublicApiLimits(params?: {}): Promise<implicitReturnType>;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
publicGetV1FapiMarketExchangeInfo(params?: {}): Promise<implicitReturnType>;
|
|
6
|
+
publicGetV1FapiMarketDepth(params?: {}): Promise<implicitReturnType>;
|
|
7
|
+
publicGetV1FapiMarketTrades(params?: {}): Promise<implicitReturnType>;
|
|
8
|
+
publicGetV1FapiMarketKlines(params?: {}): Promise<implicitReturnType>;
|
|
9
|
+
publicGetV1FapiMarketTicker24hr(params?: {}): Promise<implicitReturnType>;
|
|
10
|
+
publicGetV1FapiMarketTickerPrice(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
publicGetV1FapiMarketMarkPrice(params?: {}): Promise<implicitReturnType>;
|
|
12
|
+
publicGetV1FapiMarketFundingRate(params?: {}): Promise<implicitReturnType>;
|
|
13
|
+
publicGetV1FapiMarketFundingRateHistory(params?: {}): Promise<implicitReturnType>;
|
|
14
|
+
publicGetV1FapiMarketRiskLimit(params?: {}): Promise<implicitReturnType>;
|
|
15
15
|
privateGetV1AccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
16
16
|
privateGetV1AccountTransferRecords(params?: {}): Promise<implicitReturnType>;
|
|
17
17
|
privateGetV1SpotDepositRecords(params?: {}): Promise<implicitReturnType>;
|
|
18
18
|
privateGetV1SpotWithdrawRecords(params?: {}): Promise<implicitReturnType>;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
privateGetV1FapiTradeOpenOrder(params?: {}): Promise<implicitReturnType>;
|
|
20
|
+
privateGetV1FapiTradePlanOrder(params?: {}): Promise<implicitReturnType>;
|
|
21
|
+
privateGetV1FapiTradeLeverage(params?: {}): Promise<implicitReturnType>;
|
|
22
|
+
privateGetV1FapiTradeHistoryOrder(params?: {}): Promise<implicitReturnType>;
|
|
23
|
+
privateGetV1FapiTradeHistoryTrade(params?: {}): Promise<implicitReturnType>;
|
|
24
|
+
privateGetV1FapiTradePositionHistory(params?: {}): Promise<implicitReturnType>;
|
|
25
|
+
privateGetV1FapiTradePositions(params?: {}): Promise<implicitReturnType>;
|
|
26
|
+
privateGetV1FapiAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
27
|
+
privateGetV1FapiUserDataAssetsMargin(params?: {}): Promise<implicitReturnType>;
|
|
28
|
+
privateGetV1FapiUserDataPositionSideDual(params?: {}): Promise<implicitReturnType>;
|
|
29
29
|
privateGetV1AgentTeams(params?: {}): Promise<implicitReturnType>;
|
|
30
30
|
privateGetV1AgentAgentLinks(params?: {}): Promise<implicitReturnType>;
|
|
31
31
|
privateGetV1AgentRegularOverview(params?: {}): Promise<implicitReturnType>;
|
|
@@ -36,15 +36,15 @@ interface Exchange {
|
|
|
36
36
|
privateGetV1AgentAffiliateCommission(params?: {}): Promise<implicitReturnType>;
|
|
37
37
|
privateGetV1AgentInternalWithdrawalStatus(params?: {}): Promise<implicitReturnType>;
|
|
38
38
|
privatePostV1AccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
privatePostV1FapiTradePlaceOrder(params?: {}): Promise<implicitReturnType>;
|
|
40
|
+
privatePostV1FapiTradeBatchPlaceOrder(params?: {}): Promise<implicitReturnType>;
|
|
41
|
+
privatePostV1FapiTradeEditOrder(params?: {}): Promise<implicitReturnType>;
|
|
42
|
+
privatePostV1FapiTradeBatchEditOrder(params?: {}): Promise<implicitReturnType>;
|
|
43
|
+
privatePostV1FapiTradeCancelAllOrder(params?: {}): Promise<implicitReturnType>;
|
|
44
|
+
privatePostV1FapiTradeLeverage(params?: {}): Promise<implicitReturnType>;
|
|
45
|
+
privatePostV1FapiTradeBatchLeverageMargin(params?: {}): Promise<implicitReturnType>;
|
|
46
|
+
privatePostV1FapiUserDataMarginType(params?: {}): Promise<implicitReturnType>;
|
|
47
|
+
privatePostV1FapiUserDataPositionSideDual(params?: {}): Promise<implicitReturnType>;
|
|
48
48
|
privatePostV1AgentInternalWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
49
49
|
}
|
|
50
50
|
declare abstract class Exchange extends _Exchange {
|
|
@@ -47,6 +47,7 @@ interface Exchange {
|
|
|
47
47
|
privatePostWithdrawAddresses(params?: {}): Promise<implicitReturnType>;
|
|
48
48
|
privatePostWithdrawStatus(params?: {}): Promise<implicitReturnType>;
|
|
49
49
|
privatePostWalletTransfer(params?: {}): Promise<implicitReturnType>;
|
|
50
|
+
privatePostGetApiKeyInfo(params?: {}): Promise<implicitReturnType>;
|
|
50
51
|
privatePostCreateSubaccount(params?: {}): Promise<implicitReturnType>;
|
|
51
52
|
privatePostAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
52
53
|
privatePostEarnAllocate(params?: {}): Promise<implicitReturnType>;
|
|
@@ -25,6 +25,7 @@ interface Exchange {
|
|
|
25
25
|
publicGetConvertCurrencies(params?: {}): Promise<implicitReturnType>;
|
|
26
26
|
publicPostBulletPublic(params?: {}): Promise<implicitReturnType>;
|
|
27
27
|
privateGetUserInfo(params?: {}): Promise<implicitReturnType>;
|
|
28
|
+
privateGetUserApiKey(params?: {}): Promise<implicitReturnType>;
|
|
28
29
|
privateGetAccounts(params?: {}): Promise<implicitReturnType>;
|
|
29
30
|
privateGetAccountsAccountId(params?: {}): Promise<implicitReturnType>;
|
|
30
31
|
privateGetAccountsLedgers(params?: {}): Promise<implicitReturnType>;
|
|
@@ -25,6 +25,7 @@ interface kucoin {
|
|
|
25
25
|
publicGetConvertCurrencies(params?: {}): Promise<implicitReturnType>;
|
|
26
26
|
publicPostBulletPublic(params?: {}): Promise<implicitReturnType>;
|
|
27
27
|
privateGetUserInfo(params?: {}): Promise<implicitReturnType>;
|
|
28
|
+
privateGetUserApiKey(params?: {}): Promise<implicitReturnType>;
|
|
28
29
|
privateGetAccounts(params?: {}): Promise<implicitReturnType>;
|
|
29
30
|
privateGetAccountsAccountId(params?: {}): Promise<implicitReturnType>;
|
|
30
31
|
privateGetAccountsLedgers(params?: {}): Promise<implicitReturnType>;
|
|
@@ -622,6 +622,7 @@ export default class Exchange {
|
|
|
622
622
|
parseFeeNumeric(fee: any): any;
|
|
623
623
|
findNearestCeiling(arr: number[], providedValue: number): number;
|
|
624
624
|
invertFlatStringDictionary(dict: any): {};
|
|
625
|
+
stringToBase16(str: any): string;
|
|
625
626
|
reduceFeesByCurrency(fees: any): any[];
|
|
626
627
|
safeTicker(ticker: Dict, market?: Market): Ticker;
|
|
627
628
|
fetchBorrowRate(code: string, amount: number, params?: {}): Promise<{}>;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -4056,6 +4056,9 @@ export default class Exchange {
|
|
|
4056
4056
|
}
|
|
4057
4057
|
return reversed;
|
|
4058
4058
|
}
|
|
4059
|
+
stringToBase16(str) {
|
|
4060
|
+
return '0x' + this.binaryToBase16(this.base64ToBinary(this.stringToBase64(str)));
|
|
4061
|
+
}
|
|
4059
4062
|
reduceFeesByCurrency(fees) {
|
|
4060
4063
|
//
|
|
4061
4064
|
// this function takes a list of fee structures having the following format
|
package/js/src/binance.js
CHANGED
|
@@ -1379,8 +1379,11 @@ export default class binance extends Exchange {
|
|
|
1379
1379
|
},
|
|
1380
1380
|
'networks': {
|
|
1381
1381
|
'ERC20': 'ETH',
|
|
1382
|
+
'ETH': 'ETH',
|
|
1382
1383
|
'TRC20': 'TRX',
|
|
1384
|
+
'TRX': 'TRX',
|
|
1383
1385
|
'BEP2': 'BNB',
|
|
1386
|
+
'BSC': 'BSC',
|
|
1384
1387
|
'BEP20': 'BSC',
|
|
1385
1388
|
'EOS': 'EOS',
|
|
1386
1389
|
'SPL': 'SOL',
|
|
@@ -1393,6 +1396,7 @@ export default class binance extends Exchange {
|
|
|
1393
1396
|
'MATIC': 'MATIC',
|
|
1394
1397
|
'BASE': 'BASE',
|
|
1395
1398
|
'SUI': 'SUI',
|
|
1399
|
+
'OP': 'OPTIMISM',
|
|
1396
1400
|
'OPTIMISM': 'OPTIMISM',
|
|
1397
1401
|
'NEAR': 'NEAR',
|
|
1398
1402
|
'APT': 'APT',
|
|
@@ -1438,7 +1442,11 @@ export default class binance extends Exchange {
|
|
|
1438
1442
|
'ONT': 'ONT', // ontology
|
|
1439
1443
|
},
|
|
1440
1444
|
'networksById': {
|
|
1441
|
-
'
|
|
1445
|
+
'TRX': 'TRC20',
|
|
1446
|
+
'BSC': 'BEP20',
|
|
1447
|
+
'ETH': 'ERC20',
|
|
1448
|
+
'SOL': 'SOL',
|
|
1449
|
+
'OPTIMISM': 'OP',
|
|
1442
1450
|
},
|
|
1443
1451
|
'impliedNetworks': {
|
|
1444
1452
|
'ETH': { 'ERC20': 'ETH' },
|
|
@@ -8959,7 +8967,8 @@ export default class binance extends Exchange {
|
|
|
8959
8967
|
if (internalInteger !== undefined) {
|
|
8960
8968
|
internal = (internalInteger !== 0) ? true : false;
|
|
8961
8969
|
}
|
|
8962
|
-
const
|
|
8970
|
+
const networkId = this.safeString(transaction, 'network');
|
|
8971
|
+
const network = this.networkIdToCode(networkId, code);
|
|
8963
8972
|
return {
|
|
8964
8973
|
'info': transaction,
|
|
8965
8974
|
'id': id,
|
package/js/src/bitget.js
CHANGED
|
@@ -1452,7 +1452,9 @@ export default class bitget extends Exchange {
|
|
|
1452
1452
|
'20003': ExchangeError,
|
|
1453
1453
|
'01001': ExchangeError,
|
|
1454
1454
|
'40024': RestrictedLocation,
|
|
1455
|
-
'
|
|
1455
|
+
'41117': InvalidOrder,
|
|
1456
|
+
'43111': PermissionDenied,
|
|
1457
|
+
'45113': InvalidOrder, // {"code":"45113","msg":"Maximum order value limit triggered","requestTime":1774884278712,"data":null}
|
|
1456
1458
|
},
|
|
1457
1459
|
'broad': {
|
|
1458
1460
|
'invalid size, valid range': ExchangeError,
|
package/js/src/bitmart.d.ts
CHANGED
|
@@ -234,6 +234,7 @@ export default class bitmart extends Exchange {
|
|
|
234
234
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#submit-plan-order-signed
|
|
235
235
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#submit-tp-sl-order-signed
|
|
236
236
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#submit-trail-order-signed
|
|
237
|
+
* @see https://developer-pro.bitmart.com/en/spot/#new-algo-order-v4-signed
|
|
237
238
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
238
239
|
* @param {string} type 'market', 'limit' or 'trailing' for swap markets only
|
|
239
240
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -280,12 +281,14 @@ export default class bitmart extends Exchange {
|
|
|
280
281
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#cancel-plan-order-signed
|
|
281
282
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#cancel-order-signed
|
|
282
283
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#cancel-trail-order-signed
|
|
284
|
+
* @see https://developer-pro.bitmart.com/en/spot/#cancel-algo-order-v4-signed
|
|
283
285
|
* @param {string} id order id
|
|
284
286
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
285
287
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
286
288
|
* @param {string} [params.clientOrderId] *spot only* the client order id of the order to cancel
|
|
287
|
-
* @param {boolean} [params.trigger] *swap only* whether the order is a trigger order
|
|
288
289
|
* @param {boolean} [params.trailing] *swap only* whether the order is a stop order
|
|
290
|
+
* @param {boolean} [params.trigger] whether the order is a trigger order
|
|
291
|
+
* @param {boolean} [params.stopLossTakeProfit] whether the order is a stopLossPrice or takeProfitPrice order
|
|
289
292
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
290
293
|
*/
|
|
291
294
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
@@ -307,9 +310,12 @@ export default class bitmart extends Exchange {
|
|
|
307
310
|
* @description cancel all open orders in a market
|
|
308
311
|
* @see https://developer-pro.bitmart.com/en/spot/#cancel-all-order-v4-signed
|
|
309
312
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#cancel-all-orders-signed
|
|
313
|
+
* @see https://developer-pro.bitmart.com/en/spot/#cancel-all-algo-order-v4-signed
|
|
310
314
|
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
311
315
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
312
316
|
* @param {string} [params.side] *spot only* 'buy' or 'sell'
|
|
317
|
+
* @param {boolean} [params.trigger] whether the orders are trigger orders
|
|
318
|
+
* @param {boolean} [params.stopLossTakeProfit] whether the orders are stopLossPrice or takeProfitPrice orders
|
|
313
319
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
314
320
|
*/
|
|
315
321
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
|
|
@@ -317,10 +323,11 @@ export default class bitmart extends Exchange {
|
|
|
317
323
|
/**
|
|
318
324
|
* @method
|
|
319
325
|
* @name bitmart#fetchOpenOrders
|
|
326
|
+
* @description fetch all unfilled currently open orders
|
|
320
327
|
* @see https://developer-pro.bitmart.com/en/spot/#current-open-orders-v4-signed
|
|
321
328
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#get-all-open-orders-keyed
|
|
322
329
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#get-all-current-plan-orders-keyed
|
|
323
|
-
* @
|
|
330
|
+
* @see https://developer-pro.bitmart.com/en/spot/#current-algo-open-orders-v4-signed
|
|
324
331
|
* @param {string} symbol unified market symbol
|
|
325
332
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
326
333
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
@@ -331,7 +338,8 @@ export default class bitmart extends Exchange {
|
|
|
331
338
|
* @param {string} [params.order_state] *swap* the order state, 'all' or 'partially_filled', default is 'all'
|
|
332
339
|
* @param {string} [params.orderType] *swap only* 'limit', 'market', or 'trailing'
|
|
333
340
|
* @param {boolean} [params.trailing] *swap only* set to true if you want to fetch trailing orders
|
|
334
|
-
* @param {boolean} [params.trigger]
|
|
341
|
+
* @param {boolean} [params.trigger] set to true if you want to fetch trigger orders
|
|
342
|
+
* @param {boolean} [params.stopLossTakeProfit] set to true if you want to fetch stopLossPrice or takeProfitPrice orders
|
|
335
343
|
* @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
|
|
336
344
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
337
345
|
*/
|
|
@@ -339,9 +347,10 @@ export default class bitmart extends Exchange {
|
|
|
339
347
|
/**
|
|
340
348
|
* @method
|
|
341
349
|
* @name bitmart#fetchClosedOrders
|
|
350
|
+
* @description fetches information on multiple closed orders made by the user
|
|
342
351
|
* @see https://developer-pro.bitmart.com/en/spot/#account-orders-v4-signed
|
|
343
352
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#get-order-history-keyed
|
|
344
|
-
* @
|
|
353
|
+
* @see https://developer-pro.bitmart.com/en/spot/#account-algo-orders-v4-signed
|
|
345
354
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
346
355
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
347
356
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -349,6 +358,8 @@ export default class bitmart extends Exchange {
|
|
|
349
358
|
* @param {int} [params.until] timestamp in ms of the latest entry
|
|
350
359
|
* @param {string} [params.marginMode] *spot only* 'cross' or 'isolated', for margin trading
|
|
351
360
|
* @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
|
|
361
|
+
* @param {boolean} [params.trigger] set to true if you want to fetch trigger orders
|
|
362
|
+
* @param {boolean} [params.stopLossTakeProfit] set to true if you want to fetch stopLossPrice or takeProfitPrice orders
|
|
352
363
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
353
364
|
*/
|
|
354
365
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
@@ -370,6 +381,8 @@ export default class bitmart extends Exchange {
|
|
|
370
381
|
* @see https://developer-pro.bitmart.com/en/spot/#query-order-by-id-v4-signed
|
|
371
382
|
* @see https://developer-pro.bitmart.com/en/spot/#query-order-by-clientorderid-v4-signed
|
|
372
383
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#get-order-detail-keyed
|
|
384
|
+
* @see https://developer-pro.bitmart.com/en/spot/#query-algo-order-by-id-v4-signed
|
|
385
|
+
* @see https://developer-pro.bitmart.com/en/spot/#query-algo-order-by-clientorderid-v4-signed
|
|
373
386
|
* @param {string} id the id of the order
|
|
374
387
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
375
388
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -377,6 +390,7 @@ export default class bitmart extends Exchange {
|
|
|
377
390
|
* @param {string} [params.orderType] *swap only* 'limit', 'market', 'liquidate', 'bankruptcy', 'adl' or 'trailing'
|
|
378
391
|
* @param {boolean} [params.trailing] *swap only* set to true if you want to fetch a trailing order
|
|
379
392
|
* @param {string} [params.stpMode] self-trade prevention only for spot, defaults to none, ['none', 'cancel_maker', 'cancel_taker', 'cancel_both']
|
|
393
|
+
* @param {boolean} [params.trigger] whether the orders is a trigger, stopLossPrice or takeProfitPrice order
|
|
380
394
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
381
395
|
*/
|
|
382
396
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|