ccxt 4.5.30 → 4.5.31
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 +5 -6
- package/dist/ccxt.browser.min.js +18 -18
- package/dist/cjs/ccxt.js +1 -4
- package/dist/cjs/src/base/Exchange.js +16 -1
- package/dist/cjs/src/base/ws/WsClient.js +1 -0
- package/dist/cjs/src/gate.js +52 -6
- package/dist/cjs/src/hyperliquid.js +9 -1
- package/dist/cjs/src/kucoin.js +63 -64
- package/dist/cjs/src/pro/apex.js +2 -2
- package/dist/cjs/src/pro/ascendex.js +1 -1
- package/dist/cjs/src/pro/bingx.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +1 -1
- package/dist/cjs/src/pro/htx.js +1 -1
- package/dist/cjs/src/pro/hyperliquid.js +1 -1
- package/dist/cjs/src/pro/p2b.js +1 -1
- package/dist/cjs/src/pro/toobit.js +1 -1
- package/js/ccxt.d.ts +2 -5
- package/js/ccxt.js +2 -4
- package/js/src/abstract/kucoin.d.ts +2 -0
- package/js/src/abstract/kucoinfutures.d.ts +2 -0
- package/js/src/base/Exchange.d.ts +3 -0
- package/js/src/base/Exchange.js +16 -1
- package/js/src/base/ws/WsClient.js +1 -0
- package/js/src/binance.d.ts +1 -1
- package/js/src/exmo.d.ts +1 -1
- package/js/src/gate.js +52 -6
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +9 -1
- package/js/src/kucoin.d.ts +5 -3
- package/js/src/kucoin.js +63 -64
- package/js/src/pro/apex.js +2 -2
- package/js/src/pro/ascendex.js +1 -1
- package/js/src/pro/bingx.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/cryptocom.js +1 -1
- package/js/src/pro/htx.js +1 -1
- package/js/src/pro/hyperliquid.js +1 -1
- package/js/src/pro/p2b.js +1 -1
- package/js/src/pro/toobit.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/src/abstract/oceanex.js +0 -11
- package/dist/cjs/src/oceanex.js +0 -1125
- package/js/src/abstract/oceanex.d.ts +0 -30
- package/js/src/abstract/oceanex.js +0 -11
- package/js/src/oceanex.d.ts +0 -231
- package/js/src/oceanex.js +0 -1124
package/js/src/base/Exchange.js
CHANGED
|
@@ -597,12 +597,16 @@ export default class Exchange {
|
|
|
597
597
|
return undefined;
|
|
598
598
|
}
|
|
599
599
|
isBinaryMessage(msg) {
|
|
600
|
-
return msg instanceof Uint8Array;
|
|
600
|
+
return msg instanceof Uint8Array || msg instanceof ArrayBuffer;
|
|
601
601
|
}
|
|
602
602
|
decodeProtoMsg(data) {
|
|
603
603
|
if (!protobufMexc) {
|
|
604
604
|
throw new NotSupported(this.id + ' requires protobuf to decode messages, please install it with `npm install protobufjs`');
|
|
605
605
|
}
|
|
606
|
+
if (data instanceof ArrayBuffer) {
|
|
607
|
+
// browser case
|
|
608
|
+
data = new Uint8Array(data);
|
|
609
|
+
}
|
|
606
610
|
if (data instanceof Uint8Array) {
|
|
607
611
|
const decoded = protobufMexc.default.PushDataV3ApiWrapper.decode(data);
|
|
608
612
|
const dict = decoded.toJSON();
|
|
@@ -1275,6 +1279,11 @@ export default class Exchange {
|
|
|
1275
1279
|
setProperty(obj, property, defaultValue = undefined) {
|
|
1276
1280
|
obj[property] = defaultValue;
|
|
1277
1281
|
}
|
|
1282
|
+
exceptionMessage(exc, includeStack = true) {
|
|
1283
|
+
const message = '[' + exc.constructor.name + '] ' + (!includeStack ? exc.message : exc.stack);
|
|
1284
|
+
const length = Math.min(100000, message.length);
|
|
1285
|
+
return message.slice(0, length);
|
|
1286
|
+
}
|
|
1278
1287
|
axolotl(payload, hexKey, ed25519) {
|
|
1279
1288
|
return axolotl(payload, hexKey, ed25519);
|
|
1280
1289
|
}
|
|
@@ -5967,6 +5976,9 @@ export default class Exchange {
|
|
|
5967
5976
|
}
|
|
5968
5977
|
throw new NotSupported(this.id + ' fetchClosedOrders() is not supported yet');
|
|
5969
5978
|
}
|
|
5979
|
+
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5980
|
+
throw new NotSupported(this.id + ' fetchCanceledOrders() is not supported yet');
|
|
5981
|
+
}
|
|
5970
5982
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5971
5983
|
throw new NotSupported(this.id + ' fetchCanceledAndClosedOrders() is not supported yet');
|
|
5972
5984
|
}
|
|
@@ -7717,6 +7729,9 @@ export default class Exchange {
|
|
|
7717
7729
|
throw new NotSupported(this.id + ' fetchPositionHistory () is not supported yet');
|
|
7718
7730
|
}
|
|
7719
7731
|
}
|
|
7732
|
+
async loadMarketsAndSignIn() {
|
|
7733
|
+
await Promise.all([this.loadMarkets(), this.signIn()]);
|
|
7734
|
+
}
|
|
7720
7735
|
async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7721
7736
|
/**
|
|
7722
7737
|
* @method
|
|
@@ -42,6 +42,7 @@ export default class WsClient extends Client {
|
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
44
|
this.connection = new WebSocketPlatform(this.url, this.protocols);
|
|
45
|
+
this.connection.binaryType = "arraybuffer"; // for browsers not to use blob by default
|
|
45
46
|
}
|
|
46
47
|
this.connection.onopen = this.onOpen.bind(this);
|
|
47
48
|
this.connection.onmessage = this.onMessage.bind(this);
|
package/js/src/binance.d.ts
CHANGED
|
@@ -553,7 +553,7 @@ export default class binance extends Exchange {
|
|
|
553
553
|
* @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders
|
|
554
554
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
555
555
|
*/
|
|
556
|
-
fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
556
|
+
fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
557
557
|
/**
|
|
558
558
|
* @method
|
|
559
559
|
* @name binance#fetchCanceledAndClosedOrders
|
package/js/src/exmo.d.ts
CHANGED
|
@@ -308,7 +308,7 @@ export default class exmo extends Exchange {
|
|
|
308
308
|
* @param {string} [params.marginMode] set to "isolated" for margin orders
|
|
309
309
|
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
310
310
|
*/
|
|
311
|
-
fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
311
|
+
fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
312
312
|
/**
|
|
313
313
|
* @method
|
|
314
314
|
* @name exmo#editOrder
|
package/js/src/gate.js
CHANGED
|
@@ -4973,6 +4973,24 @@ export default class gate extends Exchange {
|
|
|
4973
4973
|
//
|
|
4974
4974
|
// {"user_id":10406147,"id":"id","succeeded":false,"message":"INVALID_PROTOCOL","label":"INVALID_PROTOCOL"}
|
|
4975
4975
|
//
|
|
4976
|
+
// cancel trigger order returns timestamps in ms
|
|
4977
|
+
// id: '2007047737421336576',
|
|
4978
|
+
// id_string: '2007047737421336576',
|
|
4979
|
+
// trigger_time: '0',
|
|
4980
|
+
// trade_id: '0',
|
|
4981
|
+
// trade_id_string: '',
|
|
4982
|
+
// status: 'finished',
|
|
4983
|
+
// finish_as: 'cancelled',
|
|
4984
|
+
// reason: '',
|
|
4985
|
+
// create_time: '1767352444402496'
|
|
4986
|
+
// finish_time: '1767352509535790',
|
|
4987
|
+
// is_stop_order: false,
|
|
4988
|
+
// stop_trigger: { rule: '0', trigger_price: '', order_price: '' },
|
|
4989
|
+
// me_order_id: '0',
|
|
4990
|
+
// me_order_id_string: '',
|
|
4991
|
+
// order_type: '',
|
|
4992
|
+
// in_dual_mode: false,
|
|
4993
|
+
// parent_id: '0',
|
|
4976
4994
|
const succeeded = this.safeBool(order, 'succeeded', true);
|
|
4977
4995
|
if (!succeeded) {
|
|
4978
4996
|
// cancelOrders response
|
|
@@ -5015,13 +5033,33 @@ export default class gate extends Exchange {
|
|
|
5015
5033
|
side = Precise.stringGt(amount, '0') ? 'buy' : 'sell';
|
|
5016
5034
|
}
|
|
5017
5035
|
const rawStatus = this.safeStringN(order, ['finish_as', 'status', 'open']);
|
|
5018
|
-
let
|
|
5019
|
-
if (
|
|
5020
|
-
|
|
5036
|
+
let timestampStr = this.safeString(order, 'create_time_ms');
|
|
5037
|
+
if (timestampStr === undefined) {
|
|
5038
|
+
timestampStr = this.safeString2(order, 'create_time', 'ctime');
|
|
5039
|
+
if (timestampStr !== undefined) {
|
|
5040
|
+
if (timestampStr.length === 10 || timestampStr.indexOf('.') >= 0) {
|
|
5041
|
+
// ts in seconds, multiply to ms
|
|
5042
|
+
timestampStr = Precise.stringMul(timestampStr, '1000');
|
|
5043
|
+
}
|
|
5044
|
+
else if (timestampStr.length === 16) {
|
|
5045
|
+
// ts in microseconds, divide to ms
|
|
5046
|
+
timestampStr = Precise.stringDiv(timestampStr, '1000');
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5021
5049
|
}
|
|
5022
|
-
let
|
|
5023
|
-
if (
|
|
5024
|
-
|
|
5050
|
+
let lastTradeTimestampStr = this.safeString(order, 'update_time_ms');
|
|
5051
|
+
if (lastTradeTimestampStr === undefined) {
|
|
5052
|
+
lastTradeTimestampStr = this.safeString2(order, 'update_time', 'finish_time');
|
|
5053
|
+
if (lastTradeTimestampStr !== undefined) {
|
|
5054
|
+
if (lastTradeTimestampStr.length === 10 || lastTradeTimestampStr.indexOf('.') >= 0) {
|
|
5055
|
+
// ts in seconds, multiply to ms
|
|
5056
|
+
lastTradeTimestampStr = Precise.stringMul(lastTradeTimestampStr, '1000');
|
|
5057
|
+
}
|
|
5058
|
+
else if (lastTradeTimestampStr.length === 16) {
|
|
5059
|
+
// ts in microseconds, divide to ms
|
|
5060
|
+
lastTradeTimestampStr = Precise.stringDiv(lastTradeTimestampStr, '1000');
|
|
5061
|
+
}
|
|
5062
|
+
}
|
|
5025
5063
|
}
|
|
5026
5064
|
let marketType = 'contract';
|
|
5027
5065
|
if (('currency_pair' in order) || ('market' in order)) {
|
|
@@ -5068,6 +5106,14 @@ export default class gate extends Exchange {
|
|
|
5068
5106
|
amount = Precise.stringDiv(amount, averageString);
|
|
5069
5107
|
}
|
|
5070
5108
|
}
|
|
5109
|
+
let timestamp = undefined;
|
|
5110
|
+
let lastTradeTimestamp = undefined;
|
|
5111
|
+
if (timestampStr !== undefined) {
|
|
5112
|
+
timestamp = this.parseToInt(timestampStr);
|
|
5113
|
+
}
|
|
5114
|
+
if (lastTradeTimestampStr !== undefined) {
|
|
5115
|
+
lastTradeTimestamp = this.parseToInt(lastTradeTimestampStr);
|
|
5116
|
+
}
|
|
5071
5117
|
return this.safeOrder({
|
|
5072
5118
|
'id': this.safeString(order, 'id'),
|
|
5073
5119
|
'clientOrderId': this.safeString(order, 'text'),
|
package/js/src/hyperliquid.d.ts
CHANGED
package/js/src/hyperliquid.js
CHANGED
|
@@ -1063,6 +1063,13 @@ export default class hyperliquid extends Exchange {
|
|
|
1063
1063
|
'info': market,
|
|
1064
1064
|
});
|
|
1065
1065
|
}
|
|
1066
|
+
updateSpotCurrencyCode(code) {
|
|
1067
|
+
if (code === undefined) {
|
|
1068
|
+
return code;
|
|
1069
|
+
}
|
|
1070
|
+
const spotCurrencyMapping = this.safeDict(this.options, 'spotCurrencyMapping', {});
|
|
1071
|
+
return this.safeString(spotCurrencyMapping, code, code);
|
|
1072
|
+
}
|
|
1066
1073
|
/**
|
|
1067
1074
|
* @method
|
|
1068
1075
|
* @name hyperliquid#fetchBalance
|
|
@@ -1130,7 +1137,8 @@ export default class hyperliquid extends Exchange {
|
|
|
1130
1137
|
const spotBalances = { 'info': response };
|
|
1131
1138
|
for (let i = 0; i < balances.length; i++) {
|
|
1132
1139
|
const balance = balances[i];
|
|
1133
|
-
const
|
|
1140
|
+
const unifiedCode = this.safeCurrencyCode(this.safeString(balance, 'coin'));
|
|
1141
|
+
const code = isSpot ? this.updateSpotCurrencyCode(unifiedCode) : unifiedCode;
|
|
1134
1142
|
const account = this.account();
|
|
1135
1143
|
const total = this.safeString(balance, 'total');
|
|
1136
1144
|
const used = this.safeString(balance, 'hold');
|
package/js/src/kucoin.d.ts
CHANGED
|
@@ -569,17 +569,19 @@ export default class kucoin extends Exchange {
|
|
|
569
569
|
* @method
|
|
570
570
|
* @name kucoin#transfer
|
|
571
571
|
* @description transfer currency internally between wallets on the same account
|
|
572
|
-
* @see https://www.kucoin.com/docs/rest/
|
|
573
|
-
* @see https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
|
|
574
|
-
* @see https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
|
|
572
|
+
* @see https://www.kucoin.com/docs-new/rest/account-info/transfer/flex-transfer?lang=en_US&
|
|
575
573
|
* @param {string} code unified currency code
|
|
576
574
|
* @param {float} amount amount to transfer
|
|
577
575
|
* @param {string} fromAccount account to transfer from
|
|
578
576
|
* @param {string} toAccount account to transfer to
|
|
579
577
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
578
|
+
* @param {string} [params.transferType] INTERNAL, PARENT_TO_SUB, SUB_TO_PARENT (default is INTERNAL)
|
|
579
|
+
* @param {string} [params.fromUserId] required if transferType is SUB_TO_PARENT
|
|
580
|
+
* @param {string} [params.toUserId] required if transferType is PARENT_TO_SUB
|
|
580
581
|
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/?id=transfer-structure}
|
|
581
582
|
*/
|
|
582
583
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
584
|
+
isHfOrMining(fromId: Str, toId: Str): boolean;
|
|
583
585
|
parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
|
|
584
586
|
parseTransferStatus(status: Str): Str;
|
|
585
587
|
parseLedgerEntryType(type: any): string;
|
package/js/src/kucoin.js
CHANGED
|
@@ -183,6 +183,7 @@ export default class kucoin extends Exchange {
|
|
|
183
183
|
'get': {
|
|
184
184
|
// account
|
|
185
185
|
'user-info': 30,
|
|
186
|
+
'user/api-key': 30,
|
|
186
187
|
'accounts': 7.5,
|
|
187
188
|
'accounts/{accountId}': 7.5,
|
|
188
189
|
'accounts/ledgers': 3,
|
|
@@ -267,6 +268,8 @@ export default class kucoin extends Exchange {
|
|
|
267
268
|
'convert/limit/orders': 5,
|
|
268
269
|
// affiliate
|
|
269
270
|
'affiliate/inviter/statistics': 30,
|
|
271
|
+
// earn
|
|
272
|
+
'earn/redeem-preview': 5, // 5EW
|
|
270
273
|
},
|
|
271
274
|
'post': {
|
|
272
275
|
// account
|
|
@@ -714,6 +717,9 @@ export default class kucoin extends Exchange {
|
|
|
714
717
|
'withdraw': {
|
|
715
718
|
'includeFee': false,
|
|
716
719
|
},
|
|
720
|
+
'transfer': {
|
|
721
|
+
'fillResponseFromRequest': true,
|
|
722
|
+
},
|
|
717
723
|
// endpoint versions
|
|
718
724
|
'versions': {
|
|
719
725
|
'public': {
|
|
@@ -4584,96 +4590,89 @@ export default class kucoin extends Exchange {
|
|
|
4584
4590
|
* @method
|
|
4585
4591
|
* @name kucoin#transfer
|
|
4586
4592
|
* @description transfer currency internally between wallets on the same account
|
|
4587
|
-
* @see https://www.kucoin.com/docs/rest/
|
|
4588
|
-
* @see https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
|
|
4589
|
-
* @see https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
|
|
4593
|
+
* @see https://www.kucoin.com/docs-new/rest/account-info/transfer/flex-transfer?lang=en_US&
|
|
4590
4594
|
* @param {string} code unified currency code
|
|
4591
4595
|
* @param {float} amount amount to transfer
|
|
4592
4596
|
* @param {string} fromAccount account to transfer from
|
|
4593
4597
|
* @param {string} toAccount account to transfer to
|
|
4594
4598
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4599
|
+
* @param {string} [params.transferType] INTERNAL, PARENT_TO_SUB, SUB_TO_PARENT (default is INTERNAL)
|
|
4600
|
+
* @param {string} [params.fromUserId] required if transferType is SUB_TO_PARENT
|
|
4601
|
+
* @param {string} [params.toUserId] required if transferType is PARENT_TO_SUB
|
|
4595
4602
|
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/?id=transfer-structure}
|
|
4596
4603
|
*/
|
|
4597
4604
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
4598
4605
|
await this.loadMarkets();
|
|
4599
4606
|
const currency = this.currency(code);
|
|
4600
4607
|
const requestedAmount = this.currencyToPrecision(code, amount);
|
|
4608
|
+
const request = {
|
|
4609
|
+
'currency': currency['id'],
|
|
4610
|
+
'amount': requestedAmount,
|
|
4611
|
+
};
|
|
4612
|
+
let transferType = 'INTERNAL';
|
|
4613
|
+
[transferType, params] = this.handleParamString2(params, 'transferType', 'type', transferType);
|
|
4614
|
+
if (transferType === 'PARENT_TO_SUB') {
|
|
4615
|
+
if (!('toUserId' in params)) {
|
|
4616
|
+
throw new ExchangeError(this.id + ' transfer() requires a toUserId param for PARENT_TO_SUB transfers');
|
|
4617
|
+
}
|
|
4618
|
+
}
|
|
4619
|
+
else if (transferType === 'SUB_TO_PARENT') {
|
|
4620
|
+
if (!('fromUserId' in params)) {
|
|
4621
|
+
throw new ExchangeError(this.id + ' transfer() requires a fromUserId param for SUB_TO_PARENT transfers');
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4624
|
+
if (!('clientOid' in params)) {
|
|
4625
|
+
request['clientOid'] = this.uuid();
|
|
4626
|
+
}
|
|
4601
4627
|
let fromId = this.convertTypeToAccount(fromAccount);
|
|
4602
4628
|
let toId = this.convertTypeToAccount(toAccount);
|
|
4603
4629
|
const fromIsolated = this.inArray(fromId, this.ids);
|
|
4604
4630
|
const toIsolated = this.inArray(toId, this.ids);
|
|
4605
|
-
if (
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
}
|
|
4609
|
-
const request = {
|
|
4610
|
-
'currency': currency['id'],
|
|
4611
|
-
'amount': requestedAmount,
|
|
4612
|
-
};
|
|
4613
|
-
if (!('bizNo' in params)) {
|
|
4614
|
-
// it doesn't like more than 24 characters
|
|
4615
|
-
request['bizNo'] = this.uuid22();
|
|
4616
|
-
}
|
|
4617
|
-
const response = await this.futuresPrivatePostTransferOut(this.extend(request, params));
|
|
4618
|
-
//
|
|
4619
|
-
// {
|
|
4620
|
-
// "code": "200000",
|
|
4621
|
-
// "data": {
|
|
4622
|
-
// "applyId": "605a87217dff1500063d485d",
|
|
4623
|
-
// "bizNo": "bcd6e5e1291f4905af84dc",
|
|
4624
|
-
// "payAccountType": "CONTRACT",
|
|
4625
|
-
// "payTag": "DEFAULT",
|
|
4626
|
-
// "remark": '',
|
|
4627
|
-
// "recAccountType": "MAIN",
|
|
4628
|
-
// "recTag": "DEFAULT",
|
|
4629
|
-
// "recRemark": '',
|
|
4630
|
-
// "recSystem": "KUCOIN",
|
|
4631
|
-
// "status": "PROCESSING",
|
|
4632
|
-
// "currency": "XBT",
|
|
4633
|
-
// "amount": "0.00001",
|
|
4634
|
-
// "fee": "0",
|
|
4635
|
-
// "sn": "573688685663948",
|
|
4636
|
-
// "reason": '',
|
|
4637
|
-
// "createdAt": 1616545569000,
|
|
4638
|
-
// "updatedAt": 1616545569000
|
|
4639
|
-
// }
|
|
4640
|
-
// }
|
|
4641
|
-
//
|
|
4642
|
-
const data = this.safeDict(response, 'data');
|
|
4643
|
-
return this.parseTransfer(data, currency);
|
|
4631
|
+
if (fromIsolated) {
|
|
4632
|
+
request['fromAccountTag'] = fromId;
|
|
4633
|
+
fromId = 'isolated';
|
|
4644
4634
|
}
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
}
|
|
4655
|
-
if (this.inArray(toId, this.ids)) {
|
|
4656
|
-
request['toTag'] = toId;
|
|
4657
|
-
toId = 'isolated';
|
|
4658
|
-
}
|
|
4659
|
-
}
|
|
4635
|
+
if (toIsolated) {
|
|
4636
|
+
request['toAccountTag'] = toId;
|
|
4637
|
+
toId = 'isolated';
|
|
4638
|
+
}
|
|
4639
|
+
const hfOrMining = this.isHfOrMining(fromId, toId);
|
|
4640
|
+
let response = undefined;
|
|
4641
|
+
if (hfOrMining) {
|
|
4642
|
+
// new endpoint does not support hf and mining transfers
|
|
4643
|
+
// use old endpoint for hf and mining transfers
|
|
4660
4644
|
request['from'] = fromId;
|
|
4661
4645
|
request['to'] = toId;
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4646
|
+
response = await this.privatePostAccountsInnerTransfer(this.extend(request, params));
|
|
4647
|
+
}
|
|
4648
|
+
else {
|
|
4649
|
+
request['type'] = transferType;
|
|
4650
|
+
request['fromAccountType'] = fromId.toUpperCase();
|
|
4651
|
+
request['toAccountType'] = toId.toUpperCase();
|
|
4666
4652
|
//
|
|
4667
4653
|
// {
|
|
4668
4654
|
// "code": "200000",
|
|
4669
4655
|
// "data": {
|
|
4670
|
-
//
|
|
4656
|
+
// "orderId": "694fcb5b08bb1600015cda75"
|
|
4671
4657
|
// }
|
|
4672
4658
|
// }
|
|
4673
4659
|
//
|
|
4674
|
-
|
|
4675
|
-
return this.parseTransfer(data, currency);
|
|
4660
|
+
response = await this.privatePostAccountsUniversalTransfer(this.extend(request, params));
|
|
4676
4661
|
}
|
|
4662
|
+
const data = this.safeDict(response, 'data');
|
|
4663
|
+
const transfer = this.parseTransfer(data, currency);
|
|
4664
|
+
const transferOptions = this.safeDict(this.options, 'transfer', {});
|
|
4665
|
+
const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
|
|
4666
|
+
if (fillResponseFromRequest) {
|
|
4667
|
+
transfer['amount'] = amount;
|
|
4668
|
+
transfer['fromAccount'] = fromAccount;
|
|
4669
|
+
transfer['toAccount'] = toAccount;
|
|
4670
|
+
transfer['status'] = 'ok';
|
|
4671
|
+
}
|
|
4672
|
+
return transfer;
|
|
4673
|
+
}
|
|
4674
|
+
isHfOrMining(fromId, toId) {
|
|
4675
|
+
return (fromId === 'trade_hf' || toId === 'trade_hf' || fromId === 'pool' || toId === 'pool');
|
|
4677
4676
|
}
|
|
4678
4677
|
parseTransfer(transfer, currency = undefined) {
|
|
4679
4678
|
//
|
package/js/src/pro/apex.js
CHANGED
|
@@ -986,7 +986,7 @@ export default class apex extends apexRest {
|
|
|
986
986
|
await client.send({ 'args': [timeStamp.toString()], 'op': 'pong' });
|
|
987
987
|
}
|
|
988
988
|
catch (e) {
|
|
989
|
-
const error = new NetworkError(this.id + ' handlePing failed with error ' + this.
|
|
989
|
+
const error = new NetworkError(this.id + ' handlePing failed with error ' + this.exceptionMessage(e));
|
|
990
990
|
client.reset(error);
|
|
991
991
|
}
|
|
992
992
|
}
|
|
@@ -1001,7 +1001,7 @@ export default class apex extends apexRest {
|
|
|
1001
1001
|
//
|
|
1002
1002
|
// { pong: 1653296711335 }
|
|
1003
1003
|
//
|
|
1004
|
-
client.lastPong = this.safeInteger(message, 'pong');
|
|
1004
|
+
client.lastPong = this.safeInteger(message, 'pong', this.milliseconds());
|
|
1005
1005
|
return message;
|
|
1006
1006
|
}
|
|
1007
1007
|
handlePing(client, message) {
|
package/js/src/pro/ascendex.js
CHANGED
|
@@ -976,7 +976,7 @@ export default class ascendex extends ascendexRest {
|
|
|
976
976
|
await client.send({ 'op': 'pong', 'hp': this.safeInteger(message, 'hp') });
|
|
977
977
|
}
|
|
978
978
|
catch (e) {
|
|
979
|
-
const error = new NetworkError(this.id + ' handlePing failed with error ' + this.
|
|
979
|
+
const error = new NetworkError(this.id + ' handlePing failed with error ' + this.exceptionMessage(e));
|
|
980
980
|
client.reset(error);
|
|
981
981
|
}
|
|
982
982
|
}
|
package/js/src/pro/bingx.js
CHANGED
|
@@ -1227,7 +1227,7 @@ export default class bingx extends bingxRest {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
1229
|
catch (e) {
|
|
1230
|
-
const error = new NetworkError(this.id + ' pong failed with error ' + this.
|
|
1230
|
+
const error = new NetworkError(this.id + ' pong failed with error ' + this.exceptionMessage(e));
|
|
1231
1231
|
client.reset(error);
|
|
1232
1232
|
}
|
|
1233
1233
|
}
|
package/js/src/pro/bybit.js
CHANGED
|
@@ -2481,7 +2481,7 @@ export default class bybit extends bybitRest {
|
|
|
2481
2481
|
// "conn_id": "d266o6hqo29sqmnq4vk0-1yus1"
|
|
2482
2482
|
// }
|
|
2483
2483
|
//
|
|
2484
|
-
client.lastPong = this.safeInteger(message, 'pong');
|
|
2484
|
+
client.lastPong = this.safeInteger(message, 'pong', this.milliseconds());
|
|
2485
2485
|
return message;
|
|
2486
2486
|
}
|
|
2487
2487
|
handleAuthenticate(client, message) {
|
package/js/src/pro/cryptocom.js
CHANGED
|
@@ -66,7 +66,7 @@ export default class cryptocom extends cryptocomRest {
|
|
|
66
66
|
await client.send({ 'id': this.safeInteger(message, 'id'), 'method': 'public/respond-heartbeat' });
|
|
67
67
|
}
|
|
68
68
|
catch (e) {
|
|
69
|
-
const error = new NetworkError(this.id + ' pong failed with error ' + this.
|
|
69
|
+
const error = new NetworkError(this.id + ' pong failed with error ' + this.exceptionMessage(e));
|
|
70
70
|
client.reset(error);
|
|
71
71
|
}
|
|
72
72
|
}
|
package/js/src/pro/htx.js
CHANGED
|
@@ -2034,7 +2034,7 @@ export default class htx extends htxRest {
|
|
|
2034
2034
|
}
|
|
2035
2035
|
}
|
|
2036
2036
|
catch (e) {
|
|
2037
|
-
const error = new NetworkError(this.id + ' pong failed ' + this.
|
|
2037
|
+
const error = new NetworkError(this.id + ' pong failed ' + this.exceptionMessage(e));
|
|
2038
2038
|
client.reset(error);
|
|
2039
2039
|
}
|
|
2040
2040
|
}
|
|
@@ -1262,7 +1262,7 @@ export default class hyperliquid extends hyperliquidRest {
|
|
|
1262
1262
|
// "channel": "pong"
|
|
1263
1263
|
// }
|
|
1264
1264
|
//
|
|
1265
|
-
client.lastPong = this.safeInteger(message, 'pong');
|
|
1265
|
+
client.lastPong = this.safeInteger(message, 'pong', this.milliseconds());
|
|
1266
1266
|
return message;
|
|
1267
1267
|
}
|
|
1268
1268
|
requestId() {
|
package/js/src/pro/p2b.js
CHANGED
|
@@ -492,7 +492,7 @@ export default class p2b extends p2bRest {
|
|
|
492
492
|
// id: 1706539608030
|
|
493
493
|
// }
|
|
494
494
|
//
|
|
495
|
-
client.lastPong = this.safeInteger(message, 'id');
|
|
495
|
+
client.lastPong = this.safeInteger(message, 'id', this.milliseconds());
|
|
496
496
|
return message;
|
|
497
497
|
}
|
|
498
498
|
onError(client, error) {
|
package/js/src/pro/toobit.js
CHANGED
|
@@ -1112,7 +1112,7 @@ export default class toobit extends toobitRest {
|
|
|
1112
1112
|
this.delay(listenKeyRefreshRate, this.keepAliveListenKey, params);
|
|
1113
1113
|
}
|
|
1114
1114
|
catch (e) {
|
|
1115
|
-
const err = new AuthenticationError(this.id + ' ' + this.
|
|
1115
|
+
const err = new AuthenticationError(this.id + ' ' + this.exceptionMessage(e));
|
|
1116
1116
|
client.reject(err, messageHash);
|
|
1117
1117
|
if (messageHash in client.subscriptions) {
|
|
1118
1118
|
delete client.subscriptions[messageHash];
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var Exchange$1 = require('../base/Exchange.js');
|
|
6
|
-
|
|
7
|
-
// ----------------------------------------------------------------------------
|
|
8
|
-
class Exchange extends Exchange$1["default"] {
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
exports["default"] = Exchange;
|