ccxt 4.1.74 → 4.1.75
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.js +410 -119
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +6 -2
- package/dist/cjs/src/base/ws/Client.js +11 -14
- package/dist/cjs/src/bigone.js +38 -9
- package/dist/cjs/src/bingx.js +57 -18
- package/dist/cjs/src/bitmart.js +33 -11
- package/dist/cjs/src/gate.js +1 -0
- package/dist/cjs/src/gemini.js +21 -19
- package/dist/cjs/src/kraken.js +154 -11
- package/dist/cjs/src/poloniex.js +27 -25
- package/dist/cjs/src/pro/binance.js +60 -8
- package/dist/cjs/src/pro/coinbasepro.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.js +6 -2
- package/js/src/base/ws/Client.js +11 -14
- package/js/src/bigone.d.ts +1 -0
- package/js/src/bigone.js +38 -9
- package/js/src/bingx.d.ts +3 -0
- package/js/src/bingx.js +58 -19
- package/js/src/bitmart.d.ts +1 -0
- package/js/src/bitmart.js +33 -11
- package/js/src/gate.js +1 -0
- package/js/src/gemini.js +21 -19
- package/js/src/kraken.d.ts +2 -0
- package/js/src/kraken.js +154 -11
- package/js/src/poloniex.js +27 -25
- package/js/src/pro/binance.d.ts +1 -0
- package/js/src/pro/binance.js +61 -9
- package/js/src/pro/coinbasepro.js +1 -1
- package/package.json +1 -1
package/js/src/kraken.d.ts
CHANGED
|
@@ -79,11 +79,13 @@ export default class kraken extends Exchange {
|
|
|
79
79
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
80
80
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
81
81
|
parseTransactionStatus(status: any): string;
|
|
82
|
+
parseNetwork(network: any): string;
|
|
82
83
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
83
84
|
parseTransactionsByType(type: any, transactions: any, code?: Str, since?: Int, limit?: Int): any;
|
|
84
85
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
85
86
|
fetchTime(params?: {}): Promise<number>;
|
|
86
87
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
88
|
+
addPaginationCursorToResult(result: any): any;
|
|
87
89
|
createDepositAddress(code: string, params?: {}): Promise<{
|
|
88
90
|
currency: string;
|
|
89
91
|
address: string;
|
package/js/src/kraken.js
CHANGED
|
@@ -328,6 +328,91 @@ export default class kraken extends Exchange {
|
|
|
328
328
|
'ZEC': 'Zcash (Transparent)',
|
|
329
329
|
'ZRX': '0x (ZRX)',
|
|
330
330
|
},
|
|
331
|
+
'withdrawMethods': {
|
|
332
|
+
'Lightning': 'Lightning',
|
|
333
|
+
'Bitcoin': 'BTC',
|
|
334
|
+
'Ripple': 'XRP',
|
|
335
|
+
'Litecoin': 'LTC',
|
|
336
|
+
'Dogecoin': 'DOGE',
|
|
337
|
+
'Stellar': 'XLM',
|
|
338
|
+
'Ethereum': 'ERC20',
|
|
339
|
+
'Arbitrum One': 'Arbitrum',
|
|
340
|
+
'Polygon': 'MATIC',
|
|
341
|
+
'Arbitrum Nova': 'Arbitrum',
|
|
342
|
+
'Optimism': 'Optimism',
|
|
343
|
+
'zkSync Era': 'zkSync',
|
|
344
|
+
'Ethereum Classic': 'ETC',
|
|
345
|
+
'Zcash': 'ZEC',
|
|
346
|
+
'Monero': 'XMR',
|
|
347
|
+
'Tron': 'TRC20',
|
|
348
|
+
'Solana': 'SOL',
|
|
349
|
+
'EOS': 'EOS',
|
|
350
|
+
'Bitcoin Cash': 'BCH',
|
|
351
|
+
'Cardano': 'ADA',
|
|
352
|
+
'Qtum': 'QTUM',
|
|
353
|
+
'Tezos': 'XTZ',
|
|
354
|
+
'Cosmos': 'ATOM',
|
|
355
|
+
'Nano': 'NANO',
|
|
356
|
+
'Siacoin': 'SC',
|
|
357
|
+
'Lisk': 'LSK',
|
|
358
|
+
'Waves': 'WAVES',
|
|
359
|
+
'ICON': 'ICX',
|
|
360
|
+
'Algorand': 'ALGO',
|
|
361
|
+
'Polygon - USDC.e': 'MATIC',
|
|
362
|
+
'Arbitrum One - USDC.e': 'Arbitrum',
|
|
363
|
+
'Polkadot': 'DOT',
|
|
364
|
+
'Kava': 'KAVA',
|
|
365
|
+
'Filecoin': 'FIL',
|
|
366
|
+
'Kusama': 'KSM',
|
|
367
|
+
'Flow': 'FLOW',
|
|
368
|
+
'Energy Web': 'EW',
|
|
369
|
+
'Mina': 'MINA',
|
|
370
|
+
'Centrifuge': 'CFG',
|
|
371
|
+
'Karura': 'KAR',
|
|
372
|
+
'Moonriver': 'MOVR',
|
|
373
|
+
'Shiden': 'SDN',
|
|
374
|
+
'Khala': 'PHA',
|
|
375
|
+
'Bifrost Kusama': 'BNC',
|
|
376
|
+
'Songbird': 'SGB',
|
|
377
|
+
'Terra classic': 'LUNC',
|
|
378
|
+
'KILT': 'KILT',
|
|
379
|
+
'Basilisk': 'BSX',
|
|
380
|
+
'Flare': 'FLR',
|
|
381
|
+
'Avalanche C-Chain': 'AVAX',
|
|
382
|
+
'Kintsugi': 'KINT',
|
|
383
|
+
'Altair': 'AIR',
|
|
384
|
+
'Moonbeam': 'GLMR',
|
|
385
|
+
'Acala': 'ACA',
|
|
386
|
+
'Astar': 'ASTR',
|
|
387
|
+
'Akash': 'AKT',
|
|
388
|
+
'Robonomics': 'XRT',
|
|
389
|
+
'Fantom': 'FTM',
|
|
390
|
+
'Elrond': 'EGLD',
|
|
391
|
+
'THORchain': 'RUNE',
|
|
392
|
+
'Secret': 'SCRT',
|
|
393
|
+
'Near': 'NEAR',
|
|
394
|
+
'Internet Computer Protocol': 'ICP',
|
|
395
|
+
'Picasso': 'PICA',
|
|
396
|
+
'Crust Shadow': 'CSM',
|
|
397
|
+
'Integritee': 'TEER',
|
|
398
|
+
'Parallel Finance': 'PARA',
|
|
399
|
+
'HydraDX': 'HDX',
|
|
400
|
+
'Interlay': 'INTR',
|
|
401
|
+
'Fetch.ai': 'FET',
|
|
402
|
+
'NYM': 'NYM',
|
|
403
|
+
'Terra 2.0': 'LUNA2',
|
|
404
|
+
'Juno': 'JUNO',
|
|
405
|
+
'Nodle': 'NODL',
|
|
406
|
+
'Stacks': 'STX',
|
|
407
|
+
'Ethereum PoW': 'ETHW',
|
|
408
|
+
'Aptos': 'APT',
|
|
409
|
+
'Sui': 'SUI',
|
|
410
|
+
'Genshiro': 'GENS',
|
|
411
|
+
'Aventus': 'AVT',
|
|
412
|
+
'Sei': 'SEI',
|
|
413
|
+
'OriginTrail': 'OTP',
|
|
414
|
+
'Celestia': 'TIA',
|
|
415
|
+
},
|
|
331
416
|
},
|
|
332
417
|
'precisionMode': TICK_SIZE,
|
|
333
418
|
'exceptions': {
|
|
@@ -2074,6 +2159,10 @@ export default class kraken extends Exchange {
|
|
|
2074
2159
|
};
|
|
2075
2160
|
return this.safeString(statuses, status, status);
|
|
2076
2161
|
}
|
|
2162
|
+
parseNetwork(network) {
|
|
2163
|
+
const withdrawMethods = this.safeValue(this.options, 'withdrawMethods', {});
|
|
2164
|
+
return this.safeString(withdrawMethods, network, network);
|
|
2165
|
+
}
|
|
2077
2166
|
parseTransaction(transaction, currency = undefined) {
|
|
2078
2167
|
//
|
|
2079
2168
|
// fetchDeposits
|
|
@@ -2124,6 +2213,8 @@ export default class kraken extends Exchange {
|
|
|
2124
2213
|
// "fee": "0.0050000000",
|
|
2125
2214
|
// "time": 1530481750,
|
|
2126
2215
|
// "status": "Success"
|
|
2216
|
+
// "key":"Huobi wallet",
|
|
2217
|
+
// "network":"Tron"
|
|
2127
2218
|
// status-prop: 'on-hold' // this field might not be present in some cases
|
|
2128
2219
|
// }
|
|
2129
2220
|
//
|
|
@@ -2160,7 +2251,7 @@ export default class kraken extends Exchange {
|
|
|
2160
2251
|
'id': id,
|
|
2161
2252
|
'currency': code,
|
|
2162
2253
|
'amount': amount,
|
|
2163
|
-
'network':
|
|
2254
|
+
'network': this.parseNetwork(this.safeString(transaction, 'network')),
|
|
2164
2255
|
'address': address,
|
|
2165
2256
|
'addressTo': undefined,
|
|
2166
2257
|
'addressFrom': undefined,
|
|
@@ -2264,19 +2355,28 @@ export default class kraken extends Exchange {
|
|
|
2264
2355
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2265
2356
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
2266
2357
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2358
|
+
* @param {object} [params.end] End timestamp, withdrawals created strictly after will be not be included in the response
|
|
2359
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times
|
|
2267
2360
|
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2268
|
-
|
|
2269
|
-
// https://www.kraken.com/en-us/help/api#withdraw-status
|
|
2270
|
-
if (code === undefined) {
|
|
2271
|
-
throw new ArgumentsRequired(this.id + ' fetchWithdrawals() requires a currency code argument');
|
|
2272
|
-
}
|
|
2361
|
+
*/
|
|
2273
2362
|
await this.loadMarkets();
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2363
|
+
let paginate = false;
|
|
2364
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
2365
|
+
if (paginate) {
|
|
2366
|
+
params['cursor'] = true;
|
|
2367
|
+
return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'next_cursor', 'cursor');
|
|
2368
|
+
}
|
|
2369
|
+
const request = {};
|
|
2370
|
+
if (code !== undefined) {
|
|
2371
|
+
const currency = this.currency(code);
|
|
2372
|
+
request['asset'] = currency['id'];
|
|
2373
|
+
}
|
|
2374
|
+
if (since !== undefined) {
|
|
2375
|
+
request['since'] = since.toString();
|
|
2376
|
+
}
|
|
2278
2377
|
const response = await this.privatePostWithdrawStatus(this.extend(request, params));
|
|
2279
2378
|
//
|
|
2379
|
+
// with no pagination
|
|
2280
2380
|
// { error: [],
|
|
2281
2381
|
// "result": [ { "method": "Ether",
|
|
2282
2382
|
// "aclass": "currency",
|
|
@@ -2288,8 +2388,51 @@ export default class kraken extends Exchange {
|
|
|
2288
2388
|
// "fee": "0.0050000000",
|
|
2289
2389
|
// "time": 1530481750,
|
|
2290
2390
|
// "status": "Success" } ] }
|
|
2391
|
+
// with pagination
|
|
2392
|
+
// {
|
|
2393
|
+
// "error":[],
|
|
2394
|
+
// "result":{
|
|
2395
|
+
// "withdrawals":[
|
|
2396
|
+
// {
|
|
2397
|
+
// "method":"Tether USD (TRC20)",
|
|
2398
|
+
// "aclass":"currency",
|
|
2399
|
+
// "asset":"USDT",
|
|
2400
|
+
// "refid":"BSNFZU2-MEFN4G-J3NEZV",
|
|
2401
|
+
// "txid":"1c7a642fb7387bbc2c6a2c509fd1ae146937f4cf793b4079a4f0715e3a02615a",
|
|
2402
|
+
// "info":"TQmdxSuC16EhFg8FZWtYgrfFRosoRF7bCp",
|
|
2403
|
+
// "amount":"1996.50000000",
|
|
2404
|
+
// "fee":"2.50000000",
|
|
2405
|
+
// "time":1669126657,
|
|
2406
|
+
// "status":"Success",
|
|
2407
|
+
// "key":"poloniex",
|
|
2408
|
+
// "network":"Tron"
|
|
2409
|
+
// },
|
|
2410
|
+
// ...
|
|
2411
|
+
// ],
|
|
2412
|
+
// "next_cursor":"HgAAAAAAAABGVFRSd3k1LVF4Y0JQY05Gd0xRY0NxenFndHpybkwBAQH2AwEBAAAAAQAAAAAAAAABAAAAAAAZAAAAAAAAAA=="
|
|
2413
|
+
// }
|
|
2414
|
+
// }
|
|
2291
2415
|
//
|
|
2292
|
-
|
|
2416
|
+
let rawWithdrawals = undefined;
|
|
2417
|
+
const result = this.safeValue(response, 'result');
|
|
2418
|
+
if (!Array.isArray(result)) {
|
|
2419
|
+
rawWithdrawals = this.addPaginationCursorToResult(result);
|
|
2420
|
+
}
|
|
2421
|
+
else {
|
|
2422
|
+
rawWithdrawals = result;
|
|
2423
|
+
}
|
|
2424
|
+
return this.parseTransactionsByType('withdrawal', rawWithdrawals, code, since, limit);
|
|
2425
|
+
}
|
|
2426
|
+
addPaginationCursorToResult(result) {
|
|
2427
|
+
const cursor = this.safeString(result, 'next_cursor');
|
|
2428
|
+
const data = this.safeValue(result, 'withdrawals');
|
|
2429
|
+
const dataLength = data.length;
|
|
2430
|
+
if (cursor !== undefined && dataLength > 0) {
|
|
2431
|
+
const last = data[dataLength - 1];
|
|
2432
|
+
last['next_cursor'] = cursor;
|
|
2433
|
+
data[dataLength - 1] = last;
|
|
2434
|
+
}
|
|
2435
|
+
return data;
|
|
2293
2436
|
}
|
|
2294
2437
|
async createDepositAddress(code, params = {}) {
|
|
2295
2438
|
/**
|
package/js/src/poloniex.js
CHANGED
|
@@ -755,32 +755,34 @@ export default class poloniex extends Exchange {
|
|
|
755
755
|
let withdrawAvailable = this.safeValue(result[code], 'withdraw');
|
|
756
756
|
withdrawAvailable = (withdrawEnabled) ? withdrawEnabled : withdrawAvailable;
|
|
757
757
|
const networks = this.safeValue(result[code], 'networks', {});
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
'
|
|
771
|
-
'
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
'
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
'
|
|
780
|
-
|
|
758
|
+
if (networkCode !== undefined) {
|
|
759
|
+
networks[networkCode] = {
|
|
760
|
+
'info': currency,
|
|
761
|
+
'id': networkId,
|
|
762
|
+
'network': networkCode,
|
|
763
|
+
'currencyId': id,
|
|
764
|
+
'numericId': numericId,
|
|
765
|
+
'deposit': depositEnabled,
|
|
766
|
+
'withdraw': withdrawEnabled,
|
|
767
|
+
'active': active,
|
|
768
|
+
'fee': this.parseNumber(feeString),
|
|
769
|
+
'precision': undefined,
|
|
770
|
+
'limits': {
|
|
771
|
+
'amount': {
|
|
772
|
+
'min': undefined,
|
|
773
|
+
'max': undefined,
|
|
774
|
+
},
|
|
775
|
+
'withdraw': {
|
|
776
|
+
'min': undefined,
|
|
777
|
+
'max': undefined,
|
|
778
|
+
},
|
|
779
|
+
'deposit': {
|
|
780
|
+
'min': undefined,
|
|
781
|
+
'max': undefined,
|
|
782
|
+
},
|
|
781
783
|
},
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
+
};
|
|
785
|
+
}
|
|
784
786
|
result[code]['networks'] = networks;
|
|
785
787
|
const info = this.safeValue(result[code], 'info', []);
|
|
786
788
|
const rawInfo = {};
|
package/js/src/pro/binance.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export default class binance extends binanceRest {
|
|
|
68
68
|
fetchOrdersWs(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
69
69
|
fetchOpenOrdersWs(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
70
70
|
watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
71
|
+
watchOrdersForSymbols(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
71
72
|
parseWsOrder(order: any, market?: any): import("../base/types.js").Order;
|
|
72
73
|
handleOrderUpdate(client: Client, message: any): void;
|
|
73
74
|
watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
package/js/src/pro/binance.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
8
8
|
import binanceRest from '../binance.js';
|
|
9
9
|
import { Precise } from '../base/Precise.js';
|
|
10
|
-
import { ExchangeError, ArgumentsRequired, BadRequest } from '../base/errors.js';
|
|
10
|
+
import { ExchangeError, ArgumentsRequired, BadRequest, NotSupported } from '../base/errors.js';
|
|
11
11
|
import { ArrayCache, ArrayCacheByTimestamp, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide } from '../base/ws/Cache.js';
|
|
12
12
|
import { sha256 } from '../static_dependencies/noble-hashes/sha256.js';
|
|
13
13
|
import { rsa } from '../base/functions/rsa.js';
|
|
@@ -26,6 +26,7 @@ export default class binance extends binanceRest {
|
|
|
26
26
|
'watchOrderBook': true,
|
|
27
27
|
'watchOrderBookForSymbols': true,
|
|
28
28
|
'watchOrders': true,
|
|
29
|
+
'watchOrdersForSymbols': true,
|
|
29
30
|
'watchPositions': true,
|
|
30
31
|
'watchTicker': true,
|
|
31
32
|
'watchTickers': true,
|
|
@@ -2065,6 +2066,7 @@ export default class binance extends binanceRest {
|
|
|
2065
2066
|
/**
|
|
2066
2067
|
* @method
|
|
2067
2068
|
* @name binance#watchOrders
|
|
2069
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#payload-order-update
|
|
2068
2070
|
* @description watches information on multiple orders made by the user
|
|
2069
2071
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2070
2072
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -2078,7 +2080,7 @@ export default class binance extends binanceRest {
|
|
|
2078
2080
|
if (symbol !== undefined) {
|
|
2079
2081
|
market = this.market(symbol);
|
|
2080
2082
|
symbol = market['symbol'];
|
|
2081
|
-
messageHash += '
|
|
2083
|
+
messageHash += '::' + symbol;
|
|
2082
2084
|
}
|
|
2083
2085
|
let type = undefined;
|
|
2084
2086
|
[type, params] = this.handleMarketTypeAndParams('watchOrders', market, params);
|
|
@@ -2101,11 +2103,63 @@ export default class binance extends binanceRest {
|
|
|
2101
2103
|
this.setBalanceCache(client, type);
|
|
2102
2104
|
this.setPositionsCache(client, type);
|
|
2103
2105
|
const message = undefined;
|
|
2104
|
-
const
|
|
2106
|
+
const newOrder = await this.watch(url, messageHash, message, type);
|
|
2105
2107
|
if (this.newUpdates) {
|
|
2106
|
-
|
|
2108
|
+
return newOrder;
|
|
2107
2109
|
}
|
|
2108
|
-
return this.filterBySymbolSinceLimit(orders, symbol, since, limit, true);
|
|
2110
|
+
return this.filterBySymbolSinceLimit(this.orders, symbol, since, limit, true);
|
|
2111
|
+
}
|
|
2112
|
+
async watchOrdersForSymbols(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2113
|
+
/**
|
|
2114
|
+
* @method
|
|
2115
|
+
* @name binance#watchOrdersForSymbols
|
|
2116
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#payload-order-update
|
|
2117
|
+
* @description watches information on multiple orders made by the user
|
|
2118
|
+
* @param {string[]} symbols unified symbol of the market to fetch orders for
|
|
2119
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2120
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
2121
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2122
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2123
|
+
*/
|
|
2124
|
+
let marginMode = undefined;
|
|
2125
|
+
[marginMode, params] = this.handleMarginModeAndParams('authenticate', params);
|
|
2126
|
+
const isIsolatedMargin = (marginMode === 'isolated');
|
|
2127
|
+
if (isIsolatedMargin) {
|
|
2128
|
+
throw new NotSupported(this.id + ' watchOrdersForSymbols does not support isolated margin markets, use watchOrders instead');
|
|
2129
|
+
}
|
|
2130
|
+
await this.loadMarkets();
|
|
2131
|
+
let type = undefined;
|
|
2132
|
+
const market = this.getMarketFromSymbols(symbols);
|
|
2133
|
+
[type, params] = this.handleMarketTypeAndParams('watchOrdersForSymbols', market, params);
|
|
2134
|
+
symbols = this.marketSymbols(symbols, type, true, true, true);
|
|
2135
|
+
let messageHash = 'orders';
|
|
2136
|
+
if (symbols !== undefined) {
|
|
2137
|
+
messageHash = messageHash + '::' + symbols.join(',');
|
|
2138
|
+
}
|
|
2139
|
+
let subType = undefined;
|
|
2140
|
+
[subType, params] = this.handleSubTypeAndParams('watchOrdersForSymbols', market, params);
|
|
2141
|
+
if (this.isLinear(type, subType)) {
|
|
2142
|
+
type = 'future';
|
|
2143
|
+
}
|
|
2144
|
+
else if (this.isInverse(type, subType)) {
|
|
2145
|
+
type = 'delivery';
|
|
2146
|
+
}
|
|
2147
|
+
params = this.extend(params, { 'type': type });
|
|
2148
|
+
await this.authenticate(params);
|
|
2149
|
+
let urlType = type;
|
|
2150
|
+
if (type === 'margin') {
|
|
2151
|
+
urlType = 'spot'; // spot-margin shares the same stream as regular spot
|
|
2152
|
+
}
|
|
2153
|
+
const url = this.urls['api']['ws'][urlType] + '/' + this.options[type]['listenKey'];
|
|
2154
|
+
const client = this.client(url);
|
|
2155
|
+
this.setBalanceCache(client, type);
|
|
2156
|
+
this.setPositionsCache(client, type);
|
|
2157
|
+
const message = undefined;
|
|
2158
|
+
const newOrders = await this.watch(url, messageHash, message, type);
|
|
2159
|
+
if (this.newUpdates) {
|
|
2160
|
+
return newOrders;
|
|
2161
|
+
}
|
|
2162
|
+
return this.filterBySymbolsSinceLimit(this.orders, symbols, since, limit, true);
|
|
2109
2163
|
}
|
|
2110
2164
|
parseWsOrder(order, market = undefined) {
|
|
2111
2165
|
//
|
|
@@ -2736,7 +2790,6 @@ export default class binance extends binanceRest {
|
|
|
2736
2790
|
}
|
|
2737
2791
|
}
|
|
2738
2792
|
handleOrder(client, message) {
|
|
2739
|
-
const messageHash = 'orders';
|
|
2740
2793
|
const parsed = this.parseWsOrder(message);
|
|
2741
2794
|
const symbol = this.safeString(parsed, 'symbol');
|
|
2742
2795
|
const orderId = this.safeString(parsed, 'id');
|
|
@@ -2765,9 +2818,8 @@ export default class binance extends binanceRest {
|
|
|
2765
2818
|
}
|
|
2766
2819
|
}
|
|
2767
2820
|
cachedOrders.append(parsed);
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
client.resolve(this.orders, messageHashSymbol);
|
|
2821
|
+
this.resolvePromiseIfMessagehashMatches(client, 'orders::', symbol, parsed);
|
|
2822
|
+
client.resolve(parsed, 'orders');
|
|
2771
2823
|
}
|
|
2772
2824
|
}
|
|
2773
2825
|
handleAcountUpdate(client, message) {
|
|
@@ -251,8 +251,8 @@ export default class coinbasepro extends coinbaseproRest {
|
|
|
251
251
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
252
252
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
253
253
|
*/
|
|
254
|
-
symbols = this.marketSymbols(symbols, undefined, false);
|
|
255
254
|
await this.loadMarkets();
|
|
255
|
+
symbols = this.marketSymbols(symbols, undefined, false);
|
|
256
256
|
const name = 'user';
|
|
257
257
|
const messageHash = 'multipleOrders::';
|
|
258
258
|
const authentication = this.authenticate();
|
package/package.json
CHANGED