ccxt 4.3.69 → 4.3.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.
- package/README.md +4 -4
- package/dist/ccxt.browser.min.js +5 -5
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/base/Exchange.js +6 -0
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/blofin.js +63 -6
- package/dist/cjs/src/bybit.js +1 -1
- package/dist/cjs/src/coinbaseinternational.js +168 -2
- package/dist/cjs/src/cryptocom.js +9 -1
- package/dist/cjs/src/hitbtc.js +1 -1
- package/dist/cjs/src/poloniex.js +1 -0
- package/dist/cjs/src/pro/blofin.js +665 -0
- package/dist/cjs/src/pro/coinbaseinternational.js +154 -9
- package/dist/cjs/src/pro/cryptocom.js +3 -1
- package/dist/cjs/src/pro/hitbtc.js +26 -8
- package/dist/cjs/src/pro/okx.js +7 -0
- package/dist/cjs/src/pro/poloniex.js +37 -12
- package/dist/cjs/src/pro/woo.js +5 -4
- package/js/ccxt.d.ts +4 -1
- package/js/ccxt.js +3 -1
- package/js/src/abstract/coinbaseinternational.d.ts +1 -1
- package/js/src/ascendex.js +1 -1
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +6 -0
- package/js/src/binance.js +1 -1
- package/js/src/blofin.d.ts +1 -1
- package/js/src/blofin.js +63 -6
- package/js/src/bybit.js +1 -1
- package/js/src/coinbaseinternational.d.ts +6 -1
- package/js/src/coinbaseinternational.js +168 -2
- package/js/src/cryptocom.js +10 -2
- package/js/src/hitbtc.js +1 -1
- package/js/src/poloniex.js +1 -0
- package/js/src/pro/blofin.d.ts +39 -0
- package/js/src/pro/blofin.js +668 -0
- package/js/src/pro/coinbaseinternational.d.ts +5 -1
- package/js/src/pro/coinbaseinternational.js +155 -10
- package/js/src/pro/cryptocom.js +4 -2
- package/js/src/pro/hitbtc.d.ts +1 -1
- package/js/src/pro/hitbtc.js +26 -8
- package/js/src/pro/okx.js +7 -0
- package/js/src/pro/poloniex.js +37 -12
- package/js/src/pro/woo.js +5 -4
- package/package.json +1 -1
package/js/src/blofin.js
CHANGED
|
@@ -23,6 +23,7 @@ export default class blofin extends Exchange {
|
|
|
23
23
|
'countries': ['US'],
|
|
24
24
|
'version': 'v1',
|
|
25
25
|
'rateLimit': 100,
|
|
26
|
+
'pro': true,
|
|
26
27
|
'has': {
|
|
27
28
|
'CORS': undefined,
|
|
28
29
|
'spot': false,
|
|
@@ -97,7 +98,7 @@ export default class blofin extends Exchange {
|
|
|
97
98
|
'fetchOpenInterestHistory': false,
|
|
98
99
|
'fetchOpenOrder': undefined,
|
|
99
100
|
'fetchOpenOrders': true,
|
|
100
|
-
'fetchOrder':
|
|
101
|
+
'fetchOrder': undefined,
|
|
101
102
|
'fetchOrderBook': true,
|
|
102
103
|
'fetchOrderBooks': false,
|
|
103
104
|
'fetchOrders': false,
|
|
@@ -147,11 +148,12 @@ export default class blofin extends Exchange {
|
|
|
147
148
|
'2h': '2H',
|
|
148
149
|
'4h': '4H',
|
|
149
150
|
'6h': '6H',
|
|
151
|
+
'8h': '8H',
|
|
150
152
|
'12h': '12H',
|
|
151
153
|
'1d': '1D',
|
|
154
|
+
'3d': '3D',
|
|
152
155
|
'1w': '1W',
|
|
153
156
|
'1M': '1M',
|
|
154
|
-
'3M': '3M',
|
|
155
157
|
},
|
|
156
158
|
'hostname': 'www.blofin.com',
|
|
157
159
|
'urls': {
|
|
@@ -492,6 +494,25 @@ export default class blofin extends Exchange {
|
|
|
492
494
|
return this.parseOrderBook(first, symbol, timestamp);
|
|
493
495
|
}
|
|
494
496
|
parseTicker(ticker, market = undefined) {
|
|
497
|
+
//
|
|
498
|
+
// response similar for REST & WS
|
|
499
|
+
//
|
|
500
|
+
// {
|
|
501
|
+
// instId: "ADA-USDT",
|
|
502
|
+
// ts: "1707736811486",
|
|
503
|
+
// last: "0.5315",
|
|
504
|
+
// lastSize: "4",
|
|
505
|
+
// askPrice: "0.5318",
|
|
506
|
+
// askSize: "248",
|
|
507
|
+
// bidPrice: "0.5315",
|
|
508
|
+
// bidSize: "63",
|
|
509
|
+
// open24h: "0.5555",
|
|
510
|
+
// high24h: "0.5563",
|
|
511
|
+
// low24h: "0.5315",
|
|
512
|
+
// volCurrency24h: "198560100",
|
|
513
|
+
// vol24h: "1985601",
|
|
514
|
+
// }
|
|
515
|
+
//
|
|
495
516
|
const timestamp = this.safeInteger(ticker, 'ts');
|
|
496
517
|
const marketId = this.safeString(ticker, 'instId');
|
|
497
518
|
market = this.safeMarket(marketId, market, '-');
|
|
@@ -564,7 +585,8 @@ export default class blofin extends Exchange {
|
|
|
564
585
|
}
|
|
565
586
|
parseTrade(trade, market = undefined) {
|
|
566
587
|
//
|
|
567
|
-
// fetch trades
|
|
588
|
+
// fetch trades (response similar for REST & WS)
|
|
589
|
+
//
|
|
568
590
|
// {
|
|
569
591
|
// "tradeId": "3263934920",
|
|
570
592
|
// "instId": "LTC-USDT",
|
|
@@ -573,6 +595,7 @@ export default class blofin extends Exchange {
|
|
|
573
595
|
// "side": "buy",
|
|
574
596
|
// "ts": "1707232020854"
|
|
575
597
|
// }
|
|
598
|
+
//
|
|
576
599
|
// my trades
|
|
577
600
|
// {
|
|
578
601
|
// "instId": "LTC-USDT",
|
|
@@ -851,10 +874,12 @@ export default class blofin extends Exchange {
|
|
|
851
874
|
return this.parseFundingBalance(response);
|
|
852
875
|
}
|
|
853
876
|
else {
|
|
854
|
-
return this.
|
|
877
|
+
return this.parseBalance(response);
|
|
855
878
|
}
|
|
856
879
|
}
|
|
857
|
-
|
|
880
|
+
parseBalance(response) {
|
|
881
|
+
//
|
|
882
|
+
// "data" similar for REST & WS
|
|
858
883
|
//
|
|
859
884
|
// {
|
|
860
885
|
// "code": "0",
|
|
@@ -876,7 +901,8 @@ export default class blofin extends Exchange {
|
|
|
876
901
|
// "orderFrozen": "14920.994472632597427761",
|
|
877
902
|
// "equityUsd": "10011254.077985990315787910",
|
|
878
903
|
// "isolatedUnrealizedPnl": "-22.151999999999999999952",
|
|
879
|
-
// "bonus": "0"
|
|
904
|
+
// "bonus": "0" // present only in REST
|
|
905
|
+
// "unrealizedPnl": "0" // present only in WS
|
|
880
906
|
// }
|
|
881
907
|
// ]
|
|
882
908
|
// }
|
|
@@ -1038,6 +1064,8 @@ export default class blofin extends Exchange {
|
|
|
1038
1064
|
return this.safeString(statuses, status, status);
|
|
1039
1065
|
}
|
|
1040
1066
|
parseOrder(order, market = undefined) {
|
|
1067
|
+
//
|
|
1068
|
+
// response similar for REST & WS
|
|
1041
1069
|
//
|
|
1042
1070
|
// {
|
|
1043
1071
|
// "orderId": "2075628533",
|
|
@@ -1066,6 +1094,9 @@ export default class blofin extends Exchange {
|
|
|
1066
1094
|
// "cancelSource": "not_canceled",
|
|
1067
1095
|
// "cancelSourceReason": null,
|
|
1068
1096
|
// "brokerId": "ec6dd3a7dd982d0b"
|
|
1097
|
+
// "filled_amount": "1.000000000000000000", // filledAmount in "ws" watchOrders
|
|
1098
|
+
// "cancelSource": "", // only in WS
|
|
1099
|
+
// "instType": "SWAP", // only in WS
|
|
1069
1100
|
// }
|
|
1070
1101
|
//
|
|
1071
1102
|
const id = this.safeString2(order, 'tpslId', 'orderId');
|
|
@@ -1815,6 +1846,32 @@ export default class blofin extends Exchange {
|
|
|
1815
1846
|
return this.filterByArrayPositions(result, 'symbol', symbols, false);
|
|
1816
1847
|
}
|
|
1817
1848
|
parsePosition(position, market = undefined) {
|
|
1849
|
+
//
|
|
1850
|
+
// response similar for REST & WS
|
|
1851
|
+
//
|
|
1852
|
+
// {
|
|
1853
|
+
// instType: 'SWAP',
|
|
1854
|
+
// instId: 'LTC-USDT',
|
|
1855
|
+
// marginMode: 'cross',
|
|
1856
|
+
// positionId: '644159',
|
|
1857
|
+
// positionSide: 'net',
|
|
1858
|
+
// positions: '1',
|
|
1859
|
+
// availablePositions: '1',
|
|
1860
|
+
// averagePrice: '68.16',
|
|
1861
|
+
// unrealizedPnl: '0.80631223',
|
|
1862
|
+
// unrealizedPnlRatio: '0.03548909463028169',
|
|
1863
|
+
// leverage: '3',
|
|
1864
|
+
// liquidationPrice: '10.116655172370356435',
|
|
1865
|
+
// markPrice: '68.96',
|
|
1866
|
+
// initialMargin: '22.988770743333333333',
|
|
1867
|
+
// margin: '', // this field might not exist in rest response
|
|
1868
|
+
// marginRatio: '152.523509620342499273',
|
|
1869
|
+
// maintenanceMargin: '0.34483156115',
|
|
1870
|
+
// adl: '4',
|
|
1871
|
+
// createTime: '1707235776528',
|
|
1872
|
+
// updateTime: '1707235776528'
|
|
1873
|
+
// }
|
|
1874
|
+
//
|
|
1818
1875
|
const marketId = this.safeString(position, 'instId');
|
|
1819
1876
|
market = this.safeMarket(marketId, market);
|
|
1820
1877
|
const symbol = market['symbol'];
|
package/js/src/bybit.js
CHANGED
|
@@ -8205,7 +8205,7 @@ export default class bybit extends Exchange {
|
|
|
8205
8205
|
const quoteValueString = Precise.stringMul(baseValueString, priceString);
|
|
8206
8206
|
return this.safeLiquidation({
|
|
8207
8207
|
'info': liquidation,
|
|
8208
|
-
'symbol': this.safeSymbol(marketId, market),
|
|
8208
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
|
|
8209
8209
|
'contracts': this.parseNumber(contractsString),
|
|
8210
8210
|
'contractSize': this.parseNumber(contractSizeString),
|
|
8211
8211
|
'price': this.parseNumber(priceString),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/coinbaseinternational.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Order, Trade, Ticker, Str, Transaction, Balances, Tickers, Strings, Market, Currency, TransferEntry, Position, FundingRateHistory, Currencies, Dict, int } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Order, Trade, Ticker, Str, Transaction, Balances, Tickers, Strings, Market, Currency, TransferEntry, Position, FundingRateHistory, Currencies, Dict, int, OHLCV } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class coinbaseinternational
|
|
5
5
|
* @augments Exchange
|
|
@@ -15,6 +15,8 @@ export default class coinbaseinternational extends Exchange {
|
|
|
15
15
|
code: any;
|
|
16
16
|
info: any;
|
|
17
17
|
};
|
|
18
|
+
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
19
|
+
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
18
20
|
fetchFundingRateHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
19
21
|
parseFundingRateHistory(info: any, market?: Market): FundingRateHistory;
|
|
20
22
|
parseFundingRate(contract: any, market?: Market): {
|
|
@@ -47,6 +49,9 @@ export default class coinbaseinternational extends Exchange {
|
|
|
47
49
|
amount: number;
|
|
48
50
|
rate: any;
|
|
49
51
|
};
|
|
52
|
+
fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<TransferEntry[]>;
|
|
53
|
+
parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
|
|
54
|
+
parseTransferStatus(status: Str): Str;
|
|
50
55
|
createDepositAddress(code: string, params?: {}): Promise<{
|
|
51
56
|
currency: string;
|
|
52
57
|
tag: string;
|
|
@@ -86,7 +86,7 @@ export default class coinbaseinternational extends Exchange {
|
|
|
86
86
|
'fetchMyBuys': true,
|
|
87
87
|
'fetchMySells': true,
|
|
88
88
|
'fetchMyTrades': true,
|
|
89
|
-
'fetchOHLCV':
|
|
89
|
+
'fetchOHLCV': true,
|
|
90
90
|
'fetchOpenInterestHistory': false,
|
|
91
91
|
'fetchOpenOrders': true,
|
|
92
92
|
'fetchOrder': true,
|
|
@@ -105,6 +105,7 @@ export default class coinbaseinternational extends Exchange {
|
|
|
105
105
|
'fetchTrades': false,
|
|
106
106
|
'fetchTradingFee': false,
|
|
107
107
|
'fetchTradingFees': false,
|
|
108
|
+
'fetchTransfers': true,
|
|
108
109
|
'fetchWithdrawals': true,
|
|
109
110
|
'reduceMargin': false,
|
|
110
111
|
'sandbox': true,
|
|
@@ -147,7 +148,7 @@ export default class coinbaseinternational extends Exchange {
|
|
|
147
148
|
'instruments/{instrument}',
|
|
148
149
|
'instruments/{instrument}/quote',
|
|
149
150
|
'instruments/{instrument}/funding',
|
|
150
|
-
'',
|
|
151
|
+
'instruments/{instrument}/candles',
|
|
151
152
|
],
|
|
152
153
|
},
|
|
153
154
|
'private': {
|
|
@@ -355,6 +356,81 @@ export default class coinbaseinternational extends Exchange {
|
|
|
355
356
|
'info': account,
|
|
356
357
|
};
|
|
357
358
|
}
|
|
359
|
+
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = 100, params = {}) {
|
|
360
|
+
/**
|
|
361
|
+
* @method
|
|
362
|
+
* @name coinbaseinternational#fetchOHLCV
|
|
363
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
364
|
+
* @see https://docs.cdp.coinbase.com/intx/reference/getinstrumentcandles
|
|
365
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
366
|
+
* @param {string} timeframe the length of time each candle represents
|
|
367
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
368
|
+
* @param {int} [limit] the maximum amount of candles to fetch, default 100 max 10000
|
|
369
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
370
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
371
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
372
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
373
|
+
*/
|
|
374
|
+
await this.loadMarkets();
|
|
375
|
+
let paginate = false;
|
|
376
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
377
|
+
if (paginate) {
|
|
378
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 10000);
|
|
379
|
+
}
|
|
380
|
+
const market = this.market(symbol);
|
|
381
|
+
const request = {
|
|
382
|
+
'instrument': market['id'],
|
|
383
|
+
'granularity': this.safeString(this.timeframes, timeframe, timeframe),
|
|
384
|
+
};
|
|
385
|
+
if (since !== undefined) {
|
|
386
|
+
request['start'] = this.iso8601(since);
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
throw new ArgumentsRequired(this.id + ' fetchOHLCV() requires a since argument');
|
|
390
|
+
}
|
|
391
|
+
const unitl = this.safeInteger(params, 'until');
|
|
392
|
+
if (unitl !== undefined) {
|
|
393
|
+
params = this.omit(params, 'until');
|
|
394
|
+
request['end'] = this.iso8601(unitl);
|
|
395
|
+
}
|
|
396
|
+
const response = await this.v1PublicGetInstrumentsInstrumentCandles(this.extend(request, params));
|
|
397
|
+
//
|
|
398
|
+
// {
|
|
399
|
+
// "aggregations": [
|
|
400
|
+
// {
|
|
401
|
+
// "start": "2024-04-23T00:00:00Z",
|
|
402
|
+
// "open": "62884.4",
|
|
403
|
+
// "high": "64710.6",
|
|
404
|
+
// "low": "62884.4",
|
|
405
|
+
// "close": "63508.4",
|
|
406
|
+
// "volume": "3253.9983"
|
|
407
|
+
// }
|
|
408
|
+
// ]
|
|
409
|
+
// }
|
|
410
|
+
//
|
|
411
|
+
const candles = this.safeList(response, 'aggregations', []);
|
|
412
|
+
return this.parseOHLCVs(candles, market, timeframe, since, limit);
|
|
413
|
+
}
|
|
414
|
+
parseOHLCV(ohlcv, market = undefined) {
|
|
415
|
+
//
|
|
416
|
+
// {
|
|
417
|
+
// "start": "2024-04-23T00:00:00Z",
|
|
418
|
+
// "open": "62884.4",
|
|
419
|
+
// "high": "64710.6",
|
|
420
|
+
// "low": "62884.4",
|
|
421
|
+
// "close": "63508.4",
|
|
422
|
+
// "volume": "3253.9983"
|
|
423
|
+
// }
|
|
424
|
+
//
|
|
425
|
+
return [
|
|
426
|
+
this.parse8601(this.safeString2(ohlcv, 'start', 'time')),
|
|
427
|
+
this.safeNumber(ohlcv, 'open'),
|
|
428
|
+
this.safeNumber(ohlcv, 'high'),
|
|
429
|
+
this.safeNumber(ohlcv, 'low'),
|
|
430
|
+
this.safeNumber(ohlcv, 'close'),
|
|
431
|
+
this.safeNumber(ohlcv, 'volume'),
|
|
432
|
+
];
|
|
433
|
+
}
|
|
358
434
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
359
435
|
/**
|
|
360
436
|
* @method
|
|
@@ -520,6 +596,96 @@ export default class coinbaseinternational extends Exchange {
|
|
|
520
596
|
'rate': undefined,
|
|
521
597
|
};
|
|
522
598
|
}
|
|
599
|
+
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
600
|
+
/**
|
|
601
|
+
* @method
|
|
602
|
+
* @name coinbaseinternational#fetchTransfers
|
|
603
|
+
* @description fetch a history of internal transfers made on an account
|
|
604
|
+
* @see https://docs.cdp.coinbase.com/intx/reference/gettransfers
|
|
605
|
+
* @param {string} code unified currency code of the currency transferred
|
|
606
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
607
|
+
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
608
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
609
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
610
|
+
*/
|
|
611
|
+
await this.loadMarkets();
|
|
612
|
+
const request = {
|
|
613
|
+
'type': 'INTERNAL',
|
|
614
|
+
};
|
|
615
|
+
let currency = undefined;
|
|
616
|
+
if (code !== undefined) {
|
|
617
|
+
currency = this.currency(code);
|
|
618
|
+
}
|
|
619
|
+
let portfolios = undefined;
|
|
620
|
+
[portfolios, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'portfolios');
|
|
621
|
+
if (portfolios !== undefined) {
|
|
622
|
+
request['portfolios'] = portfolios;
|
|
623
|
+
}
|
|
624
|
+
if (since !== undefined) {
|
|
625
|
+
request['time_from'] = this.iso8601(since);
|
|
626
|
+
}
|
|
627
|
+
if (limit !== undefined) {
|
|
628
|
+
request['result_limit'] = limit;
|
|
629
|
+
}
|
|
630
|
+
else {
|
|
631
|
+
request['result_limit'] = 100;
|
|
632
|
+
}
|
|
633
|
+
const response = await this.v1PrivateGetTransfers(this.extend(request, params));
|
|
634
|
+
const transfers = this.safeList(response, 'results', []);
|
|
635
|
+
return this.parseTransfers(transfers, currency, since, limit);
|
|
636
|
+
}
|
|
637
|
+
parseTransfer(transfer, currency = undefined) {
|
|
638
|
+
//
|
|
639
|
+
// {
|
|
640
|
+
// "amount":"0.0008",
|
|
641
|
+
// "asset":"USDC",
|
|
642
|
+
// "created_at":"2024-02-22T16:00:00Z",
|
|
643
|
+
// "from_portfolio":{
|
|
644
|
+
// "id":"13yuk1fs-1-0",
|
|
645
|
+
// "name":"Eng Test Portfolio - 2",
|
|
646
|
+
// "uuid":"018712f2-5ff9-7de3-9010-xxxxxxxxx"
|
|
647
|
+
// },
|
|
648
|
+
// "instrument_id":"149264164756389888",
|
|
649
|
+
// "instrument_symbol":"ETH-PERP",
|
|
650
|
+
// "position_id":"1xy4v51m-1-2",
|
|
651
|
+
// "status":"PROCESSED",
|
|
652
|
+
// "to_portfolio":{
|
|
653
|
+
// "name":"CB_FUND"
|
|
654
|
+
// },
|
|
655
|
+
// "transfer_type":"FUNDING",
|
|
656
|
+
// "transfer_uuid":"a6b708df-2c44-32c5-bb98-xxxxxxxxxx",
|
|
657
|
+
// "updated_at":"2024-02-22T16:00:00Z"
|
|
658
|
+
// }
|
|
659
|
+
//
|
|
660
|
+
const datetime = this.safeInteger(transfer, 'created_at');
|
|
661
|
+
const timestamp = this.parse8601(datetime);
|
|
662
|
+
const currencyId = this.safeString(transfer, 'asset');
|
|
663
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
664
|
+
const fromPorfolio = this.safeDict(transfer, 'from_portfolio', {});
|
|
665
|
+
const fromId = this.safeString(fromPorfolio, 'id');
|
|
666
|
+
const toPorfolio = this.safeDict(transfer, 'to_portfolio', {});
|
|
667
|
+
const toId = this.safeString(toPorfolio, 'id');
|
|
668
|
+
return {
|
|
669
|
+
'info': transfer,
|
|
670
|
+
'id': this.safeString(transfer, 'transfer_uuid'),
|
|
671
|
+
'timestamp': timestamp,
|
|
672
|
+
'datetime': this.iso8601(timestamp),
|
|
673
|
+
'currency': code,
|
|
674
|
+
'amount': this.safeNumber(transfer, 'amount'),
|
|
675
|
+
'fromAccount': fromId,
|
|
676
|
+
'toAccount': toId,
|
|
677
|
+
'status': this.parseTransferStatus(this.safeString(transfer, 'status')),
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
parseTransferStatus(status) {
|
|
681
|
+
const statuses = {
|
|
682
|
+
'FAILED': 'failed',
|
|
683
|
+
'PROCESSED': 'ok',
|
|
684
|
+
'NEW': 'pending',
|
|
685
|
+
'STARTED': 'pending',
|
|
686
|
+
};
|
|
687
|
+
return this.safeString(statuses, status, status);
|
|
688
|
+
}
|
|
523
689
|
async createDepositAddress(code, params = {}) {
|
|
524
690
|
/**
|
|
525
691
|
* @method
|
package/js/src/cryptocom.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/cryptocom.js';
|
|
9
9
|
import { Precise } from './base/Precise.js';
|
|
10
|
-
import { AuthenticationError, ArgumentsRequired, ExchangeError, InsufficientFunds, DDoSProtection, InvalidNonce, PermissionDenied, BadRequest, BadSymbol, NotSupported, AccountNotEnabled, OnMaintenance, InvalidOrder } from './base/errors.js';
|
|
10
|
+
import { AuthenticationError, ArgumentsRequired, ExchangeError, InsufficientFunds, DDoSProtection, InvalidNonce, PermissionDenied, BadRequest, BadSymbol, NotSupported, AccountNotEnabled, OnMaintenance, InvalidOrder, RequestTimeout, OrderNotFound, RateLimitExceeded } from './base/errors.js';
|
|
11
11
|
import { TICK_SIZE } from './base/functions/number.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
13
13
|
/**
|
|
@@ -389,7 +389,15 @@ export default class cryptocom extends Exchange {
|
|
|
389
389
|
'40006': BadRequest,
|
|
390
390
|
'40007': BadRequest,
|
|
391
391
|
'40101': AuthenticationError,
|
|
392
|
-
'
|
|
392
|
+
'40102': InvalidNonce,
|
|
393
|
+
'40103': AuthenticationError,
|
|
394
|
+
'40104': AuthenticationError,
|
|
395
|
+
'40107': BadRequest,
|
|
396
|
+
'40401': OrderNotFound,
|
|
397
|
+
'40801': RequestTimeout,
|
|
398
|
+
'42901': RateLimitExceeded,
|
|
399
|
+
'43005': InvalidOrder,
|
|
400
|
+
'50001': ExchangeError,
|
|
393
401
|
'9010001': OnMaintenance, // {"code":9010001,"message":"SYSTEM_MAINTENANCE","details":"Crypto.com Exchange is currently under maintenance. Please refer to https://status.crypto.com for more details."}
|
|
394
402
|
},
|
|
395
403
|
'broad': {},
|
package/js/src/hitbtc.js
CHANGED
|
@@ -2526,7 +2526,7 @@ export default class hitbtc extends Exchange {
|
|
|
2526
2526
|
async fetchMarginModes(symbols = undefined, params = {}) {
|
|
2527
2527
|
/**
|
|
2528
2528
|
* @method
|
|
2529
|
-
* @name hitbtc#
|
|
2529
|
+
* @name hitbtc#fetchMarginModes
|
|
2530
2530
|
* @description fetches margin mode of the user
|
|
2531
2531
|
* @see https://api.hitbtc.com/#get-margin-position-parameters
|
|
2532
2532
|
* @see https://api.hitbtc.com/#get-futures-position-parameters
|
package/js/src/poloniex.js
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import blofinRest from '../blofin.js';
|
|
2
|
+
import type { Int, Market, Trade, OrderBook, Strings, Ticker, Tickers, OHLCV, Balances, Str, Order, Position } from '../base/types.js';
|
|
3
|
+
import Client from '../base/ws/Client.js';
|
|
4
|
+
export default class blofin extends blofinRest {
|
|
5
|
+
describe(): any;
|
|
6
|
+
ping(client: any): string;
|
|
7
|
+
handlePong(client: Client, message: any): void;
|
|
8
|
+
watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
9
|
+
watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
10
|
+
handleTrades(client: Client, message: any): void;
|
|
11
|
+
parseWsTrade(trade: any, market?: Market): Trade;
|
|
12
|
+
watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
13
|
+
watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
|
|
14
|
+
handleOrderBook(client: Client, message: any): void;
|
|
15
|
+
watchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
16
|
+
watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
17
|
+
handleTicker(client: Client, message: any): void;
|
|
18
|
+
parseWsTicker(ticker: any, market?: Market): Ticker;
|
|
19
|
+
watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
20
|
+
watchOHLCVForSymbols(symbolsAndTimeframes: string[][], since?: Int, limit?: Int, params?: {}): Promise<import("../base/types.js").Dictionary<import("../base/types.js").Dictionary<OHLCV[]>>>;
|
|
21
|
+
handleOHLCV(client: Client, message: any): void;
|
|
22
|
+
watchBalance(params?: {}): Promise<Balances>;
|
|
23
|
+
handleBalance(client: Client, message: any): void;
|
|
24
|
+
parseWsBalance(message: any): Balances;
|
|
25
|
+
watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
26
|
+
watchOrdersForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
27
|
+
handleOrders(client: Client, message: any): void;
|
|
28
|
+
parseWsOrder(order: any, market?: Market): Order;
|
|
29
|
+
watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
|
30
|
+
handlePositions(client: Client, message: any): void;
|
|
31
|
+
parseWsPosition(position: any, market?: Market): Position;
|
|
32
|
+
watchMultipleWrapper(isPublic: boolean, channelName: string, callerMethodName: string, symbolsArray?: any[], params?: {}): Promise<any>;
|
|
33
|
+
getSubscriptionRequest(args: any): {
|
|
34
|
+
op: string;
|
|
35
|
+
args: any;
|
|
36
|
+
};
|
|
37
|
+
handleMessage(client: Client, message: any): void;
|
|
38
|
+
authenticate(params?: {}): Promise<void>;
|
|
39
|
+
}
|