ccxt 4.0.102 → 4.0.104
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 +585 -290
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +2 -1
- package/dist/cjs/src/base/errors.js +2 -1
- package/dist/cjs/src/binance.js +2 -0
- package/dist/cjs/src/bingx.js +70 -0
- package/dist/cjs/src/bitbank.js +14 -0
- package/dist/cjs/src/bitfinex2.js +54 -17
- package/dist/cjs/src/bitget.js +3 -0
- package/dist/cjs/src/bitmart.js +202 -46
- package/dist/cjs/src/bitrue.js +7 -0
- package/dist/cjs/src/bybit.js +6 -6
- package/dist/cjs/src/gate.js +221 -218
- package/dist/cjs/src/wavesexchange.js +2 -1
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +3 -3
- package/js/src/abstract/binance.d.ts +2 -0
- package/js/src/abstract/binancecoinm.d.ts +2 -0
- package/js/src/abstract/binanceus.d.ts +2 -0
- package/js/src/abstract/binanceusdm.d.ts +2 -0
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +2 -1
- package/js/src/base/errors.js +2 -2
- package/js/src/binance.js +2 -0
- package/js/src/bingx.d.ts +8 -0
- package/js/src/bingx.js +70 -0
- package/js/src/bitbank.js +14 -0
- package/js/src/bitfinex2.js +54 -17
- package/js/src/bitget.js +3 -0
- package/js/src/bitmart.d.ts +8 -5
- package/js/src/bitmart.js +202 -46
- package/js/src/bitrue.js +7 -0
- package/js/src/bybit.js +7 -7
- package/js/src/gate.js +221 -218
- package/js/src/wavesexchange.js +2 -1
- package/package.json +1 -1
- package/skip-tests.json +2 -0
package/dist/cjs/ccxt.js
CHANGED
|
@@ -179,7 +179,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
179
179
|
|
|
180
180
|
//-----------------------------------------------------------------------------
|
|
181
181
|
// this is updated by vss.js when building
|
|
182
|
-
const version = '4.0.
|
|
182
|
+
const version = '4.0.104';
|
|
183
183
|
Exchange["default"].ccxtVersion = version;
|
|
184
184
|
const exchanges = {
|
|
185
185
|
'ace': ace,
|
|
@@ -378,6 +378,7 @@ exports.InvalidNonce = errors.InvalidNonce;
|
|
|
378
378
|
exports.InvalidOrder = errors.InvalidOrder;
|
|
379
379
|
exports.MarginModeAlreadySet = errors.MarginModeAlreadySet;
|
|
380
380
|
exports.NetworkError = errors.NetworkError;
|
|
381
|
+
exports.NoChange = errors.NoChange;
|
|
381
382
|
exports.NotSupported = errors.NotSupported;
|
|
382
383
|
exports.NullResponse = errors.NullResponse;
|
|
383
384
|
exports.OnMaintenance = errors.OnMaintenance;
|
|
@@ -234,7 +234,7 @@ class RequestTimeout extends NetworkError {
|
|
|
234
234
|
// // Derived class hierarchy
|
|
235
235
|
// errorHierarchy
|
|
236
236
|
// )
|
|
237
|
-
const errors = { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, ContractUnavailable };
|
|
237
|
+
const errors = { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, ContractUnavailable, NoChange };
|
|
238
238
|
|
|
239
239
|
exports.AccountNotEnabled = AccountNotEnabled;
|
|
240
240
|
exports.AccountSuspended = AccountSuspended;
|
|
@@ -257,6 +257,7 @@ exports.InvalidNonce = InvalidNonce;
|
|
|
257
257
|
exports.InvalidOrder = InvalidOrder;
|
|
258
258
|
exports.MarginModeAlreadySet = MarginModeAlreadySet;
|
|
259
259
|
exports.NetworkError = NetworkError;
|
|
260
|
+
exports.NoChange = NoChange;
|
|
260
261
|
exports.NotSupported = NotSupported;
|
|
261
262
|
exports.NullResponse = NullResponse;
|
|
262
263
|
exports.OnMaintenance = OnMaintenance;
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -209,6 +209,8 @@ class binance extends binance$1 {
|
|
|
209
209
|
'asset/tradeFee': 0.1,
|
|
210
210
|
'asset/ledger-transfer/cloud-mining/queryByPage': 4.0002,
|
|
211
211
|
'asset/convert-transfer/queryByPage': 0.033335,
|
|
212
|
+
'asset/wallet/balance': 6,
|
|
213
|
+
'asset/custody/transfer-history': 6,
|
|
212
214
|
'margin/loan': 1,
|
|
213
215
|
'margin/repay': 1,
|
|
214
216
|
'margin/account': 1,
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -33,6 +33,7 @@ class bingx extends bingx$1 {
|
|
|
33
33
|
'fetchBalance': true,
|
|
34
34
|
'fetchClosedOrders': true,
|
|
35
35
|
'fetchCurrencies': true,
|
|
36
|
+
'fetchDepositAddress': true,
|
|
36
37
|
'fetchDeposits': true,
|
|
37
38
|
'fetchDepositWithdrawFee': 'emulated',
|
|
38
39
|
'fetchDepositWithdrawFees': true,
|
|
@@ -319,6 +320,7 @@ class bingx extends bingx$1 {
|
|
|
319
320
|
'PFUTURES': 'swap',
|
|
320
321
|
'SFUTURES': 'future',
|
|
321
322
|
},
|
|
323
|
+
'recvWindow': 5 * 1000, // 5 sec
|
|
322
324
|
},
|
|
323
325
|
});
|
|
324
326
|
}
|
|
@@ -2379,6 +2381,74 @@ class bingx extends bingx$1 {
|
|
|
2379
2381
|
'status': status,
|
|
2380
2382
|
};
|
|
2381
2383
|
}
|
|
2384
|
+
async fetchDepositAddress(code, params = {}) {
|
|
2385
|
+
/**
|
|
2386
|
+
* @method
|
|
2387
|
+
* @name bingx#fetchDepositAddress
|
|
2388
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
2389
|
+
* @see https://bingx-api.github.io/docs/#/common/sub-account#Query%20Main%20Account%20Deposit%20Address
|
|
2390
|
+
* @param {string} code unified currency code
|
|
2391
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
2392
|
+
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
2393
|
+
*/
|
|
2394
|
+
await this.loadMarkets();
|
|
2395
|
+
const currency = this.currency(code);
|
|
2396
|
+
const defaultRecvWindow = this.safeInteger(this.options, 'recvWindow');
|
|
2397
|
+
const recvWindow = this.safeInteger(this.parseParams, 'recvWindow', defaultRecvWindow);
|
|
2398
|
+
const request = {
|
|
2399
|
+
'coin': currency['id'],
|
|
2400
|
+
'offset': 0,
|
|
2401
|
+
'limit': 1000,
|
|
2402
|
+
'recvWindow': recvWindow,
|
|
2403
|
+
};
|
|
2404
|
+
const response = await this.walletsV1PrivateGetCapitalDepositAddress(this.extend(request, params));
|
|
2405
|
+
//
|
|
2406
|
+
// {
|
|
2407
|
+
// code: '0',
|
|
2408
|
+
// timestamp: '1695200226859',
|
|
2409
|
+
// data: {
|
|
2410
|
+
// data: [
|
|
2411
|
+
// {
|
|
2412
|
+
// coinId: '799',
|
|
2413
|
+
// coin: 'USDT',
|
|
2414
|
+
// network: 'BEP20',
|
|
2415
|
+
// address: '6a7eda2817462dabb6493277a2cfe0f5c3f2550b',
|
|
2416
|
+
// tag: ''
|
|
2417
|
+
// }
|
|
2418
|
+
// ],
|
|
2419
|
+
// total: '1'
|
|
2420
|
+
// }
|
|
2421
|
+
// }
|
|
2422
|
+
//
|
|
2423
|
+
const data = this.safeValue(this.safeValue(response, 'data'), 'data');
|
|
2424
|
+
const parsed = this.parseDepositAddresses(data, [currency['code']], false);
|
|
2425
|
+
return this.indexBy(parsed, 'network');
|
|
2426
|
+
}
|
|
2427
|
+
parseDepositAddress(depositAddress, currency = undefined) {
|
|
2428
|
+
//
|
|
2429
|
+
// {
|
|
2430
|
+
// coinId: '799',
|
|
2431
|
+
// coin: 'USDT',
|
|
2432
|
+
// network: 'BEP20',
|
|
2433
|
+
// address: '6a7eda2817462dabb6493277a2cfe0f5c3f2550b',
|
|
2434
|
+
// tag: ''
|
|
2435
|
+
// }
|
|
2436
|
+
//
|
|
2437
|
+
const address = this.safeString(depositAddress, 'address');
|
|
2438
|
+
const tag = this.safeString(depositAddress, 'tag');
|
|
2439
|
+
const currencyId = this.safeString(depositAddress, 'coin');
|
|
2440
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
2441
|
+
const code = currency['code'];
|
|
2442
|
+
const network = this.safeString(depositAddress, 'network');
|
|
2443
|
+
this.checkAddress(address);
|
|
2444
|
+
return {
|
|
2445
|
+
'currency': code,
|
|
2446
|
+
'address': address,
|
|
2447
|
+
'tag': tag,
|
|
2448
|
+
'network': network,
|
|
2449
|
+
'info': depositAddress,
|
|
2450
|
+
};
|
|
2451
|
+
}
|
|
2382
2452
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2383
2453
|
/**
|
|
2384
2454
|
* @method
|
package/dist/cjs/src/bitbank.js
CHANGED
|
@@ -156,6 +156,7 @@ class bitbank extends bitbank$1 {
|
|
|
156
156
|
* @method
|
|
157
157
|
* @name bitbank#fetchMarkets
|
|
158
158
|
* @description retrieves data on all markets for bitbank
|
|
159
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#get-all-pairs-info
|
|
159
160
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
160
161
|
* @returns {object[]} an array of objects representing market data
|
|
161
162
|
*/
|
|
@@ -282,6 +283,7 @@ class bitbank extends bitbank$1 {
|
|
|
282
283
|
* @method
|
|
283
284
|
* @name bitbank#fetchTicker
|
|
284
285
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
286
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/public-api.md#ticker
|
|
285
287
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
286
288
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
287
289
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -300,6 +302,7 @@ class bitbank extends bitbank$1 {
|
|
|
300
302
|
* @method
|
|
301
303
|
* @name bitbank#fetchOrderBook
|
|
302
304
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
305
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/public-api.md#depth
|
|
303
306
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
304
307
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
305
308
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
@@ -365,6 +368,7 @@ class bitbank extends bitbank$1 {
|
|
|
365
368
|
* @method
|
|
366
369
|
* @name bitbank#fetchTrades
|
|
367
370
|
* @description get the list of most recent trades for a particular symbol
|
|
371
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/public-api.md#transactions
|
|
368
372
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
369
373
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
370
374
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -386,6 +390,7 @@ class bitbank extends bitbank$1 {
|
|
|
386
390
|
* @method
|
|
387
391
|
* @name bitbank#fetchTradingFees
|
|
388
392
|
* @description fetch the trading fees for multiple markets
|
|
393
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#get-all-pairs-info
|
|
389
394
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
390
395
|
* @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
|
|
391
396
|
*/
|
|
@@ -463,6 +468,7 @@ class bitbank extends bitbank$1 {
|
|
|
463
468
|
* @method
|
|
464
469
|
* @name bitbank#fetchOHLCV
|
|
465
470
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
471
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/public-api.md#candlestick
|
|
466
472
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
467
473
|
* @param {string} timeframe the length of time each candle represents
|
|
468
474
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -534,6 +540,7 @@ class bitbank extends bitbank$1 {
|
|
|
534
540
|
* @method
|
|
535
541
|
* @name bitbank#fetchBalance
|
|
536
542
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
543
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#assets
|
|
537
544
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
538
545
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
539
546
|
*/
|
|
@@ -627,6 +634,7 @@ class bitbank extends bitbank$1 {
|
|
|
627
634
|
* @method
|
|
628
635
|
* @name bitbank#createOrder
|
|
629
636
|
* @description create a trade order
|
|
637
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#create-new-order
|
|
630
638
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
631
639
|
* @param {string} type 'market' or 'limit'
|
|
632
640
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -655,6 +663,7 @@ class bitbank extends bitbank$1 {
|
|
|
655
663
|
* @method
|
|
656
664
|
* @name bitbank#cancelOrder
|
|
657
665
|
* @description cancels an open order
|
|
666
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#cancel-order
|
|
658
667
|
* @param {string} id order id
|
|
659
668
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
660
669
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
@@ -675,6 +684,7 @@ class bitbank extends bitbank$1 {
|
|
|
675
684
|
* @method
|
|
676
685
|
* @name bitbank#fetchOrder
|
|
677
686
|
* @description fetches information on an order made by the user
|
|
687
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#fetch-order-information
|
|
678
688
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
679
689
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
680
690
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -694,6 +704,7 @@ class bitbank extends bitbank$1 {
|
|
|
694
704
|
* @method
|
|
695
705
|
* @name bitbank#fetchOpenOrders
|
|
696
706
|
* @description fetch all unfilled currently open orders
|
|
707
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#fetch-active-orders
|
|
697
708
|
* @param {string} symbol unified market symbol
|
|
698
709
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
699
710
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -721,6 +732,7 @@ class bitbank extends bitbank$1 {
|
|
|
721
732
|
* @method
|
|
722
733
|
* @name bitbank#fetchMyTrades
|
|
723
734
|
* @description fetch all trades made by the user
|
|
735
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#fetch-trade-history
|
|
724
736
|
* @param {string} symbol unified market symbol
|
|
725
737
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
726
738
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -750,6 +762,7 @@ class bitbank extends bitbank$1 {
|
|
|
750
762
|
* @method
|
|
751
763
|
* @name bitbank#fetchDepositAddress
|
|
752
764
|
* @description fetch the deposit address for a currency associated with this account
|
|
765
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#get-withdrawal-accounts
|
|
753
766
|
* @param {string} code unified currency code
|
|
754
767
|
* @param {object} [params] extra parameters specific to the bitbank api endpoint
|
|
755
768
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -778,6 +791,7 @@ class bitbank extends bitbank$1 {
|
|
|
778
791
|
* @method
|
|
779
792
|
* @name bitbank#withdraw
|
|
780
793
|
* @description make a withdrawal
|
|
794
|
+
* @see https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#new-withdrawal-request
|
|
781
795
|
* @param {string} code unified currency code
|
|
782
796
|
* @param {float} amount the amount to withdraw
|
|
783
797
|
* @param {string} address the address to withdraw to
|
|
@@ -431,6 +431,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
431
431
|
* @method
|
|
432
432
|
* @name bitfinex2#fetchStatus
|
|
433
433
|
* @description the latest known information on the availability of the exchange API
|
|
434
|
+
* @see https://docs.bitfinex.com/reference/rest-public-platform-status
|
|
434
435
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
435
436
|
* @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
|
|
436
437
|
*/
|
|
@@ -453,6 +454,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
453
454
|
* @method
|
|
454
455
|
* @name bitfinex2#fetchMarkets
|
|
455
456
|
* @description retrieves data on all markets for bitfinex2
|
|
457
|
+
* @see https://docs.bitfinex.com/reference/rest-public-conf
|
|
456
458
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
457
459
|
* @returns {object[]} an array of objects representing market data
|
|
458
460
|
*/
|
|
@@ -581,6 +583,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
581
583
|
* @method
|
|
582
584
|
* @name bitfinex2#fetchCurrencies
|
|
583
585
|
* @description fetches all available currencies on an exchange
|
|
586
|
+
* @see https://docs.bitfinex.com/reference/rest-public-conf
|
|
584
587
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
585
588
|
* @returns {object} an associative dictionary of currencies
|
|
586
589
|
*/
|
|
@@ -791,6 +794,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
791
794
|
* @method
|
|
792
795
|
* @name bitfinex2#fetchBalance
|
|
793
796
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
797
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-wallets
|
|
794
798
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
795
799
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
796
800
|
*/
|
|
@@ -831,6 +835,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
831
835
|
* @method
|
|
832
836
|
* @name bitfinex2#transfer
|
|
833
837
|
* @description transfer currency internally between wallets on the same account
|
|
838
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-transfer
|
|
834
839
|
* @param {string} code unified currency code
|
|
835
840
|
* @param {float} amount amount to transfer
|
|
836
841
|
* @param {string} fromAccount account to transfer from
|
|
@@ -976,6 +981,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
976
981
|
* @method
|
|
977
982
|
* @name bitfinex2#fetchOrderBook
|
|
978
983
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
984
|
+
* @see https://docs.bitfinex.com/reference/rest-public-book
|
|
979
985
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
980
986
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
981
987
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
@@ -1088,6 +1094,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1088
1094
|
* @method
|
|
1089
1095
|
* @name bitfinex2#fetchTickers
|
|
1090
1096
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
1097
|
+
* @see https://docs.bitfinex.com/reference/rest-public-tickers
|
|
1091
1098
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1092
1099
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
1093
1100
|
* @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -1157,6 +1164,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1157
1164
|
* @method
|
|
1158
1165
|
* @name bitfinex2#fetchTicker
|
|
1159
1166
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1167
|
+
* @see https://docs.bitfinex.com/reference/rest-public-ticker
|
|
1160
1168
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1161
1169
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
1162
1170
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -1257,6 +1265,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1257
1265
|
* @method
|
|
1258
1266
|
* @name bitfinex2#fetchTrades
|
|
1259
1267
|
* @description get the list of most recent trades for a particular symbol
|
|
1268
|
+
* @see https://docs.bitfinex.com/reference/rest-public-tickers-history
|
|
1260
1269
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1261
1270
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1262
1271
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -1296,6 +1305,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1296
1305
|
* @method
|
|
1297
1306
|
* @name bitfinex2#fetchOHLCV
|
|
1298
1307
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1308
|
+
* @see https://docs.bitfinex.com/reference/rest-public-candles
|
|
1299
1309
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1300
1310
|
* @param {string} timeframe the length of time each candle represents
|
|
1301
1311
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -1462,6 +1472,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1462
1472
|
* @method
|
|
1463
1473
|
* @name bitfinex2#createOrder
|
|
1464
1474
|
* @description Create an order on the exchange
|
|
1475
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-submit-order
|
|
1465
1476
|
* @param {string} symbol Unified CCXT market symbol
|
|
1466
1477
|
* @param {string} type 'limit' or 'market'
|
|
1467
1478
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -1626,6 +1637,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1626
1637
|
* @method
|
|
1627
1638
|
* @name bitfinex2#cancelAllOrders
|
|
1628
1639
|
* @description cancel all open orders
|
|
1640
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-cancel-orders-multiple
|
|
1629
1641
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1630
1642
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
1631
1643
|
* @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -1642,6 +1654,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1642
1654
|
* @method
|
|
1643
1655
|
* @name bitfinex2#cancelOrder
|
|
1644
1656
|
* @description cancels an open order
|
|
1657
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-cancel-order
|
|
1645
1658
|
* @param {string} id order id
|
|
1646
1659
|
* @param {string} symbol Not used by bitfinex2 cancelOrder ()
|
|
1647
1660
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
@@ -1674,6 +1687,8 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1674
1687
|
* @method
|
|
1675
1688
|
* @name bitfinex2#fetchOpenOrder
|
|
1676
1689
|
* @description fetch an open order by it's id
|
|
1690
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
|
|
1691
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
|
|
1677
1692
|
* @param {string} id order id
|
|
1678
1693
|
* @param {string} symbol unified market symbol, default is undefined
|
|
1679
1694
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
@@ -1694,6 +1709,8 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1694
1709
|
* @method
|
|
1695
1710
|
* @name bitfinex2#fetchClosedOrder
|
|
1696
1711
|
* @description fetch an open order by it's id
|
|
1712
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
|
|
1713
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
|
|
1697
1714
|
* @param {string} id order id
|
|
1698
1715
|
* @param {string} symbol unified market symbol, default is undefined
|
|
1699
1716
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
@@ -1714,6 +1731,8 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1714
1731
|
* @method
|
|
1715
1732
|
* @name bitfinex2#fetchOpenOrders
|
|
1716
1733
|
* @description fetch all unfilled currently open orders
|
|
1734
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
|
|
1735
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
|
|
1717
1736
|
* @param {string} symbol unified market symbol
|
|
1718
1737
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1719
1738
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -1777,6 +1796,8 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1777
1796
|
* @method
|
|
1778
1797
|
* @name bitfinex2#fetchClosedOrders
|
|
1779
1798
|
* @description fetches information on multiple closed orders made by the user
|
|
1799
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders
|
|
1800
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-retrieve-orders-by-symbol
|
|
1780
1801
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1781
1802
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1782
1803
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -1847,6 +1868,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1847
1868
|
* @method
|
|
1848
1869
|
* @name bitfinex2#fetchOrderTrades
|
|
1849
1870
|
* @description fetch all the trades made from a single order
|
|
1871
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-order-trades
|
|
1850
1872
|
* @param {string} id order id
|
|
1851
1873
|
* @param {string} symbol unified market symbol
|
|
1852
1874
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -1873,6 +1895,8 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1873
1895
|
* @method
|
|
1874
1896
|
* @name bitfinex2#fetchMyTrades
|
|
1875
1897
|
* @description fetch all trades made by the user
|
|
1898
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-trades
|
|
1899
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-trades-by-symbol
|
|
1876
1900
|
* @param {string} symbol unified market symbol
|
|
1877
1901
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1878
1902
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1890,13 +1914,15 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1890
1914
|
if (limit !== undefined) {
|
|
1891
1915
|
request['limit'] = limit; // default 25, max 1000
|
|
1892
1916
|
}
|
|
1893
|
-
let
|
|
1917
|
+
let response = undefined;
|
|
1894
1918
|
if (symbol !== undefined) {
|
|
1895
1919
|
market = this.market(symbol);
|
|
1896
1920
|
request['symbol'] = market['id'];
|
|
1897
|
-
|
|
1921
|
+
response = await this.privatePostAuthRTradesSymbolHist(this.extend(request, params));
|
|
1922
|
+
}
|
|
1923
|
+
else {
|
|
1924
|
+
response = await this.privatePostAuthRTradesHist(this.extend(request, params));
|
|
1898
1925
|
}
|
|
1899
|
-
const response = await this[method](this.extend(request, params));
|
|
1900
1926
|
return this.parseTrades(response, market, since, limit);
|
|
1901
1927
|
}
|
|
1902
1928
|
async createDepositAddress(code, params = {}) {
|
|
@@ -1904,6 +1930,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1904
1930
|
* @method
|
|
1905
1931
|
* @name bitfinex2#createDepositAddress
|
|
1906
1932
|
* @description create a currency deposit address
|
|
1933
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-deposit-address
|
|
1907
1934
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
1908
1935
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
1909
1936
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -1919,6 +1946,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1919
1946
|
* @method
|
|
1920
1947
|
* @name bitfinex2#fetchDepositAddress
|
|
1921
1948
|
* @description fetch the deposit address for a currency associated with this account
|
|
1949
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-deposit-address
|
|
1922
1950
|
* @param {string} code unified currency code
|
|
1923
1951
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
1924
1952
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -2133,6 +2161,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
2133
2161
|
* @method
|
|
2134
2162
|
* @name bitfinex2#fetchTradingFees
|
|
2135
2163
|
* @description fetch the trading fees for multiple markets
|
|
2164
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-summary
|
|
2136
2165
|
* @param {object} [params] extra parameters specific to the bitfinex2 api endpoint
|
|
2137
2166
|
* @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
|
|
2138
2167
|
*/
|
|
@@ -2246,6 +2275,8 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
2246
2275
|
* @method
|
|
2247
2276
|
* @name bitfinex2#fetchDepositsWithdrawals
|
|
2248
2277
|
* @description fetch history of deposits and withdrawals
|
|
2278
|
+
* @see https://docs.bitfinex.com/reference/movement-info
|
|
2279
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-movements
|
|
2249
2280
|
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
2250
2281
|
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
2251
2282
|
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
@@ -2255,19 +2286,21 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
2255
2286
|
await this.loadMarkets();
|
|
2256
2287
|
let currency = undefined;
|
|
2257
2288
|
const request = {};
|
|
2258
|
-
let method = 'privatePostAuthRMovementsHist';
|
|
2259
|
-
if (code !== undefined) {
|
|
2260
|
-
currency = this.currency(code);
|
|
2261
|
-
request['currency'] = currency['uppercaseId'];
|
|
2262
|
-
method = 'privatePostAuthRMovementsCurrencyHist';
|
|
2263
|
-
}
|
|
2264
2289
|
if (since !== undefined) {
|
|
2265
2290
|
request['start'] = since;
|
|
2266
2291
|
}
|
|
2267
2292
|
if (limit !== undefined) {
|
|
2268
2293
|
request['limit'] = limit; // max 1000
|
|
2269
2294
|
}
|
|
2270
|
-
|
|
2295
|
+
let response = undefined;
|
|
2296
|
+
if (code !== undefined) {
|
|
2297
|
+
currency = this.currency(code);
|
|
2298
|
+
request['currency'] = currency['uppercaseId'];
|
|
2299
|
+
response = await this.privatePostAuthRMovementsCurrencyHist(this.extend(request, params));
|
|
2300
|
+
}
|
|
2301
|
+
else {
|
|
2302
|
+
response = await this.privatePostAuthRMovementsHist(this.extend(request, params));
|
|
2303
|
+
}
|
|
2271
2304
|
//
|
|
2272
2305
|
// [
|
|
2273
2306
|
// [
|
|
@@ -2303,6 +2336,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
2303
2336
|
* @method
|
|
2304
2337
|
* @name bitfinex2#withdraw
|
|
2305
2338
|
* @description make a withdrawal
|
|
2339
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-withdraw
|
|
2306
2340
|
* @param {string} code unified currency code
|
|
2307
2341
|
* @param {float} amount the amount to withdraw
|
|
2308
2342
|
* @param {string} address the address to withdraw to
|
|
@@ -2641,6 +2675,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
2641
2675
|
* @method
|
|
2642
2676
|
* @name bitfinex2#fetchLedger
|
|
2643
2677
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
2678
|
+
* @see https://docs.bitfinex.com/reference/rest-auth-ledgers
|
|
2644
2679
|
* @param {string} code unified currency code, default is undefined
|
|
2645
2680
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
2646
2681
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
@@ -2651,19 +2686,21 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
2651
2686
|
await this.loadMarkets();
|
|
2652
2687
|
let currency = undefined;
|
|
2653
2688
|
const request = {};
|
|
2654
|
-
let method = 'privatePostAuthRLedgersHist';
|
|
2655
|
-
if (code !== undefined) {
|
|
2656
|
-
currency = this.currency(code);
|
|
2657
|
-
request['currency'] = currency['uppercaseId'];
|
|
2658
|
-
method = 'privatePostAuthRLedgersCurrencyHist';
|
|
2659
|
-
}
|
|
2660
2689
|
if (since !== undefined) {
|
|
2661
2690
|
request['start'] = since;
|
|
2662
2691
|
}
|
|
2663
2692
|
if (limit !== undefined) {
|
|
2664
2693
|
request['limit'] = limit; // max 2500
|
|
2665
2694
|
}
|
|
2666
|
-
|
|
2695
|
+
let response = undefined;
|
|
2696
|
+
if (code !== undefined) {
|
|
2697
|
+
currency = this.currency(code);
|
|
2698
|
+
request['currency'] = currency['uppercaseId'];
|
|
2699
|
+
response = await this.privatePostAuthRLedgersCurrencyHist(this.extend(request, params));
|
|
2700
|
+
}
|
|
2701
|
+
else {
|
|
2702
|
+
response = await this.privatePostAuthRLedgersHist(this.extend(request, params));
|
|
2703
|
+
}
|
|
2667
2704
|
//
|
|
2668
2705
|
// [
|
|
2669
2706
|
// [
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -2566,6 +2566,9 @@ class bitget extends bitget$1 {
|
|
|
2566
2566
|
response = await this.publicMixGetMarketHistoryCandles(this.extend(request, params));
|
|
2567
2567
|
}
|
|
2568
2568
|
}
|
|
2569
|
+
if (response === '') {
|
|
2570
|
+
return []; // happens when a new token is listed
|
|
2571
|
+
}
|
|
2569
2572
|
// [ ["1645911960000","39406","39407","39374.5","39379","35.526","1399132.341"] ]
|
|
2570
2573
|
const data = this.safeValue(response, 'data', response);
|
|
2571
2574
|
return this.parseOHLCVs(data, market, timeframe, since, limit);
|