ccxt 4.3.63 → 4.3.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +1 -0
- package/dist/cjs/src/base/Exchange.js +3 -3
- package/dist/cjs/src/bingx.js +88 -0
- package/dist/cjs/src/bitfinex.js +1 -1
- package/dist/cjs/src/bitfinex2.js +1 -1
- package/dist/cjs/src/independentreserve.js +107 -0
- package/dist/cjs/src/kucoin.js +2 -0
- package/dist/cjs/src/pro/bitmart.js +3 -3
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/gemini.js +4 -2
- package/dist/cjs/src/pro/onetrading.js +3 -2
- package/dist/cjs/src/pro/vertex.js +3 -2
- package/dist/cjs/src/pro/woo.js +2 -1
- package/dist/cjs/src/pro/woofipro.js +2 -1
- package/dist/cjs/src/woo.js +31 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/kucoin.d.ts +1 -0
- package/js/src/abstract/kucoinfutures.d.ts +1 -0
- package/js/src/alpaca.js +1 -0
- package/js/src/base/Exchange.js +3 -3
- package/js/src/bingx.d.ts +3 -1
- package/js/src/bingx.js +88 -0
- package/js/src/bitfinex.js +1 -1
- package/js/src/bitfinex2.js +1 -1
- package/js/src/independentreserve.d.ts +3 -1
- package/js/src/independentreserve.js +106 -0
- package/js/src/kucoin.js +2 -0
- package/js/src/pro/bitmart.js +3 -3
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/gemini.js +4 -2
- package/js/src/pro/onetrading.js +3 -2
- package/js/src/pro/vertex.js +3 -2
- package/js/src/pro/woo.js +2 -1
- package/js/src/pro/woofipro.js +2 -1
- package/js/src/whitebit.d.ts +1 -1
- package/js/src/woo.d.ts +2 -2
- package/js/src/woo.js +31 -0
- package/js/src/zonda.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -191,7 +191,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
191
191
|
|
|
192
192
|
//-----------------------------------------------------------------------------
|
|
193
193
|
// this is updated by vss.js when building
|
|
194
|
-
const version = '4.3.
|
|
194
|
+
const version = '4.3.64';
|
|
195
195
|
Exchange["default"].ccxtVersion = version;
|
|
196
196
|
const exchanges = {
|
|
197
197
|
'ace': ace,
|
package/dist/cjs/src/alpaca.js
CHANGED
|
@@ -1096,6 +1096,7 @@ class alpaca extends alpaca$1 {
|
|
|
1096
1096
|
let url = this.implodeHostname(this.urls['api'][api[0]]);
|
|
1097
1097
|
headers = (headers !== undefined) ? headers : {};
|
|
1098
1098
|
if (api[1] === 'private') {
|
|
1099
|
+
this.checkRequiredCredentials();
|
|
1099
1100
|
headers['APCA-API-KEY-ID'] = this.apiKey;
|
|
1100
1101
|
headers['APCA-API-SECRET-KEY'] = this.secret;
|
|
1101
1102
|
}
|
|
@@ -4333,17 +4333,17 @@ class Exchange {
|
|
|
4333
4333
|
await this.loadMarkets();
|
|
4334
4334
|
const market = this.market(symbol);
|
|
4335
4335
|
symbol = market['symbol'];
|
|
4336
|
-
const tickers = await this.
|
|
4336
|
+
const tickers = await this.fetchTickersWs([symbol], params);
|
|
4337
4337
|
const ticker = this.safeDict(tickers, symbol);
|
|
4338
4338
|
if (ticker === undefined) {
|
|
4339
|
-
throw new errors.NullResponse(this.id + '
|
|
4339
|
+
throw new errors.NullResponse(this.id + ' fetchTickerWs() could not find a ticker for ' + symbol);
|
|
4340
4340
|
}
|
|
4341
4341
|
else {
|
|
4342
4342
|
return ticker;
|
|
4343
4343
|
}
|
|
4344
4344
|
}
|
|
4345
4345
|
else {
|
|
4346
|
-
throw new errors.NotSupported(this.id + '
|
|
4346
|
+
throw new errors.NotSupported(this.id + ' fetchTickerWs() is not supported yet');
|
|
4347
4347
|
}
|
|
4348
4348
|
}
|
|
4349
4349
|
async watchTicker(symbol, params = {}) {
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -80,6 +80,7 @@ class bingx extends bingx$1 {
|
|
|
80
80
|
'fetchTickers': true,
|
|
81
81
|
'fetchTime': true,
|
|
82
82
|
'fetchTrades': true,
|
|
83
|
+
'fetchTradingFee': true,
|
|
83
84
|
'fetchTransfers': true,
|
|
84
85
|
'fetchWithdrawals': true,
|
|
85
86
|
'reduceMargin': true,
|
|
@@ -5348,6 +5349,93 @@ class bingx extends bingx$1 {
|
|
|
5348
5349
|
'marginMode': marginType,
|
|
5349
5350
|
};
|
|
5350
5351
|
}
|
|
5352
|
+
async fetchTradingFee(symbol, params = {}) {
|
|
5353
|
+
/**
|
|
5354
|
+
* @method
|
|
5355
|
+
* @name bingx#fetchTradingFee
|
|
5356
|
+
* @description fetch the trading fees for a market
|
|
5357
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Trading%20Commission%20Rate
|
|
5358
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/account-api.html#Query%20Trading%20Commission%20Rate
|
|
5359
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Trade%20Commission%20Rate
|
|
5360
|
+
* @param {string} symbol unified market symbol
|
|
5361
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5362
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
5363
|
+
*/
|
|
5364
|
+
await this.loadMarkets();
|
|
5365
|
+
const market = this.market(symbol);
|
|
5366
|
+
const request = {
|
|
5367
|
+
'symbol': market['id'],
|
|
5368
|
+
};
|
|
5369
|
+
let response = undefined;
|
|
5370
|
+
let commission = {};
|
|
5371
|
+
const data = this.safeDict(response, 'data', {});
|
|
5372
|
+
if (market['spot']) {
|
|
5373
|
+
response = await this.spotV1PrivateGetUserCommissionRate(this.extend(request, params));
|
|
5374
|
+
//
|
|
5375
|
+
// {
|
|
5376
|
+
// "code": 0,
|
|
5377
|
+
// "msg": "",
|
|
5378
|
+
// "debugMsg": "",
|
|
5379
|
+
// "data": {
|
|
5380
|
+
// "takerCommissionRate": 0.001,
|
|
5381
|
+
// "makerCommissionRate": 0.001
|
|
5382
|
+
// }
|
|
5383
|
+
// }
|
|
5384
|
+
//
|
|
5385
|
+
commission = data;
|
|
5386
|
+
}
|
|
5387
|
+
else {
|
|
5388
|
+
if (market['inverse']) {
|
|
5389
|
+
response = await this.cswapV1PrivateGetUserCommissionRate(params);
|
|
5390
|
+
//
|
|
5391
|
+
// {
|
|
5392
|
+
// "code": 0,
|
|
5393
|
+
// "msg": "",
|
|
5394
|
+
// "timestamp": 1721365261438,
|
|
5395
|
+
// "data": {
|
|
5396
|
+
// "takerCommissionRate": "0.0005",
|
|
5397
|
+
// "makerCommissionRate": "0.0002"
|
|
5398
|
+
// }
|
|
5399
|
+
// }
|
|
5400
|
+
//
|
|
5401
|
+
commission = data;
|
|
5402
|
+
}
|
|
5403
|
+
else {
|
|
5404
|
+
response = await this.swapV2PrivateGetUserCommissionRate(params);
|
|
5405
|
+
//
|
|
5406
|
+
// {
|
|
5407
|
+
// "code": 0,
|
|
5408
|
+
// "msg": "",
|
|
5409
|
+
// "data": {
|
|
5410
|
+
// "commission": {
|
|
5411
|
+
// "takerCommissionRate": 0.0005,
|
|
5412
|
+
// "makerCommissionRate": 0.0002
|
|
5413
|
+
// }
|
|
5414
|
+
// }
|
|
5415
|
+
// }
|
|
5416
|
+
//
|
|
5417
|
+
commission = this.safeDict(data, 'commission', {});
|
|
5418
|
+
}
|
|
5419
|
+
}
|
|
5420
|
+
return this.parseTradingFee(commission, market);
|
|
5421
|
+
}
|
|
5422
|
+
parseTradingFee(fee, market = undefined) {
|
|
5423
|
+
//
|
|
5424
|
+
// {
|
|
5425
|
+
// "takerCommissionRate": 0.001,
|
|
5426
|
+
// "makerCommissionRate": 0.001
|
|
5427
|
+
// }
|
|
5428
|
+
//
|
|
5429
|
+
const symbol = (market !== undefined) ? market['symbol'] : undefined;
|
|
5430
|
+
return {
|
|
5431
|
+
'info': fee,
|
|
5432
|
+
'symbol': symbol,
|
|
5433
|
+
'maker': this.safeNumber(fee, 'makerCommissionRate'),
|
|
5434
|
+
'taker': this.safeNumber(fee, 'takerCommissionRate'),
|
|
5435
|
+
'percentage': false,
|
|
5436
|
+
'tierBased': false,
|
|
5437
|
+
};
|
|
5438
|
+
}
|
|
5351
5439
|
sign(path, section = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
5352
5440
|
const type = section[0];
|
|
5353
5441
|
const version = section[1];
|
package/dist/cjs/src/bitfinex.js
CHANGED
|
@@ -1638,7 +1638,7 @@ class bitfinex extends bitfinex$1 {
|
|
|
1638
1638
|
// ]
|
|
1639
1639
|
//
|
|
1640
1640
|
const response = this.safeValue(responses, 0, {});
|
|
1641
|
-
const id = this.
|
|
1641
|
+
const id = this.safeInteger(response, 'withdrawal_id');
|
|
1642
1642
|
const message = this.safeString(response, 'message');
|
|
1643
1643
|
const errorMessage = this.findBroadlyMatchedKey(this.exceptions['broad'], message);
|
|
1644
1644
|
if (id === 0) {
|
|
@@ -2357,7 +2357,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
2357
2357
|
feeCost = Precise["default"].stringAbs(feeCost);
|
|
2358
2358
|
}
|
|
2359
2359
|
amount = this.safeNumber(data, 5);
|
|
2360
|
-
id = this.
|
|
2360
|
+
id = this.safeInteger(data, 0);
|
|
2361
2361
|
status = 'ok';
|
|
2362
2362
|
if (id === 0) {
|
|
2363
2363
|
id = undefined;
|
|
@@ -4,6 +4,8 @@ var independentreserve$1 = require('./abstract/independentreserve.js');
|
|
|
4
4
|
var Precise = require('./base/Precise.js');
|
|
5
5
|
var number = require('./base/functions/number.js');
|
|
6
6
|
var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
7
|
+
require('../ccxt.js');
|
|
8
|
+
var errors = require('./base/errors.js');
|
|
7
9
|
|
|
8
10
|
// ---------------------------------------------------------------------------
|
|
9
11
|
// ---------------------------------------------------------------------------
|
|
@@ -77,6 +79,7 @@ class independentreserve extends independentreserve$1 {
|
|
|
77
79
|
'setLeverage': false,
|
|
78
80
|
'setMarginMode': false,
|
|
79
81
|
'setPositionMode': false,
|
|
82
|
+
'withdraw': true,
|
|
80
83
|
},
|
|
81
84
|
'urls': {
|
|
82
85
|
'logo': 'https://user-images.githubusercontent.com/51840849/87182090-1e9e9080-c2ec-11ea-8e49-563db9a38f37.jpg',
|
|
@@ -803,6 +806,110 @@ class independentreserve extends independentreserve$1 {
|
|
|
803
806
|
'network': undefined,
|
|
804
807
|
};
|
|
805
808
|
}
|
|
809
|
+
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
810
|
+
/**
|
|
811
|
+
* @method
|
|
812
|
+
* @name independentreserve#withdraw
|
|
813
|
+
* @description make a withdrawal
|
|
814
|
+
* @see https://www.independentreserve.com/features/api#WithdrawDigitalCurrency
|
|
815
|
+
* @param {string} code unified currency code
|
|
816
|
+
* @param {float} amount the amount to withdraw
|
|
817
|
+
* @param {string} address the address to withdraw to
|
|
818
|
+
* @param {string} tag
|
|
819
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
820
|
+
*
|
|
821
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
822
|
+
* @param {object} [params.comment] withdrawal comment, should not exceed 500 characters
|
|
823
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
824
|
+
*/
|
|
825
|
+
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
826
|
+
await this.loadMarkets();
|
|
827
|
+
const currency = this.currency(code);
|
|
828
|
+
const request = {
|
|
829
|
+
'primaryCurrencyCode': currency['id'],
|
|
830
|
+
'withdrawalAddress': address,
|
|
831
|
+
'amount': this.currencyToPrecision(code, amount),
|
|
832
|
+
};
|
|
833
|
+
if (tag !== undefined) {
|
|
834
|
+
request['destinationTag'] = tag;
|
|
835
|
+
}
|
|
836
|
+
let networkCode = undefined;
|
|
837
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
838
|
+
if (networkCode !== undefined) {
|
|
839
|
+
throw new errors.BadRequest(this.id + ' withdraw () does not accept params["networkCode"]');
|
|
840
|
+
}
|
|
841
|
+
const response = await this.privatePostWithdrawDigitalCurrency(this.extend(request, params));
|
|
842
|
+
//
|
|
843
|
+
// {
|
|
844
|
+
// "TransactionGuid": "dc932e19-562b-4c50-821e-a73fd048b93b",
|
|
845
|
+
// "PrimaryCurrencyCode": "Bch",
|
|
846
|
+
// "CreatedTimestampUtc": "2020-04-01T05:26:30.5093622+00:00",
|
|
847
|
+
// "Amount": {
|
|
848
|
+
// "Total": 0.1231,
|
|
849
|
+
// "Fee": 0.0001
|
|
850
|
+
// },
|
|
851
|
+
// "Destination": {
|
|
852
|
+
// "Address": "bc1qhpqxkjpvgkckw530yfmxyr53c94q8f4273a7ez",
|
|
853
|
+
// "Tag": null
|
|
854
|
+
// },
|
|
855
|
+
// "Status": "Pending",
|
|
856
|
+
// "Transaction": null
|
|
857
|
+
// }
|
|
858
|
+
//
|
|
859
|
+
return this.parseTransaction(response, currency);
|
|
860
|
+
}
|
|
861
|
+
parseTransaction(transaction, currency = undefined) {
|
|
862
|
+
//
|
|
863
|
+
// {
|
|
864
|
+
// "TransactionGuid": "dc932e19-562b-4c50-821e-a73fd048b93b",
|
|
865
|
+
// "PrimaryCurrencyCode": "Bch",
|
|
866
|
+
// "CreatedTimestampUtc": "2020-04-01T05:26:30.5093622+00:00",
|
|
867
|
+
// "Amount": {
|
|
868
|
+
// "Total": 0.1231,
|
|
869
|
+
// "Fee": 0.0001
|
|
870
|
+
// },
|
|
871
|
+
// "Destination": {
|
|
872
|
+
// "Address": "bc1qhpqxkjpvgkckw530yfmxyr53c94q8f4273a7ez",
|
|
873
|
+
// "Tag": null
|
|
874
|
+
// },
|
|
875
|
+
// "Status": "Pending",
|
|
876
|
+
// "Transaction": null
|
|
877
|
+
// }
|
|
878
|
+
//
|
|
879
|
+
const amount = this.safeDict(transaction, 'Amount');
|
|
880
|
+
const destination = this.safeDict(transaction, 'Destination');
|
|
881
|
+
const currencyId = this.safeString(transaction, 'PrimaryCurrencyCode');
|
|
882
|
+
const datetime = this.safeString(transaction, 'CreatedTimestampUtc');
|
|
883
|
+
const address = this.safeString(destination, 'Address');
|
|
884
|
+
const tag = this.safeString(destination, 'Tag');
|
|
885
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
886
|
+
return {
|
|
887
|
+
'info': transaction,
|
|
888
|
+
'id': this.safeString(transaction, 'TransactionGuid'),
|
|
889
|
+
'txid': undefined,
|
|
890
|
+
'type': 'withdraw',
|
|
891
|
+
'currency': code,
|
|
892
|
+
'network': undefined,
|
|
893
|
+
'amount': this.safeNumber(amount, 'Total'),
|
|
894
|
+
'status': this.safeString(transaction, 'Status'),
|
|
895
|
+
'timestamp': this.parse8601(datetime),
|
|
896
|
+
'datetime': datetime,
|
|
897
|
+
'address': address,
|
|
898
|
+
'addressFrom': undefined,
|
|
899
|
+
'addressTo': address,
|
|
900
|
+
'tag': tag,
|
|
901
|
+
'tagFrom': undefined,
|
|
902
|
+
'tagTo': tag,
|
|
903
|
+
'updated': undefined,
|
|
904
|
+
'comment': undefined,
|
|
905
|
+
'fee': {
|
|
906
|
+
'currency': code,
|
|
907
|
+
'cost': this.safeNumber(amount, 'Fee'),
|
|
908
|
+
'rate': undefined,
|
|
909
|
+
},
|
|
910
|
+
'internal': false,
|
|
911
|
+
};
|
|
912
|
+
}
|
|
806
913
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
807
914
|
let url = this.urls['api'][api] + '/' + path;
|
|
808
915
|
if (api === 'public') {
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -159,6 +159,7 @@ class kucoin extends kucoin$1 {
|
|
|
159
159
|
'status': 4.5,
|
|
160
160
|
// margin trading
|
|
161
161
|
'mark-price/{symbol}/current': 3,
|
|
162
|
+
'mark-price/all-symbols': 3,
|
|
162
163
|
'margin/config': 25, // 25SW
|
|
163
164
|
},
|
|
164
165
|
'post': {
|
|
@@ -644,6 +645,7 @@ class kucoin extends kucoin$1 {
|
|
|
644
645
|
'currencies': 'v3',
|
|
645
646
|
'currencies/{currency}': 'v3',
|
|
646
647
|
'symbols': 'v2',
|
|
648
|
+
'mark-price/all-symbols': 'v3',
|
|
647
649
|
},
|
|
648
650
|
},
|
|
649
651
|
'private': {
|
|
@@ -754,8 +754,8 @@ class bitmart extends bitmart$1 {
|
|
|
754
754
|
const symbol = market['symbol'];
|
|
755
755
|
const openTimestamp = this.safeInteger(position, 'create_time');
|
|
756
756
|
const timestamp = this.safeInteger(position, 'update_time');
|
|
757
|
-
const side = this.
|
|
758
|
-
const marginModeId = this.
|
|
757
|
+
const side = this.safeInteger(position, 'position_type');
|
|
758
|
+
const marginModeId = this.safeInteger(position, 'open_type');
|
|
759
759
|
return this.safePosition({
|
|
760
760
|
'info': position,
|
|
761
761
|
'id': undefined,
|
|
@@ -1319,7 +1319,7 @@ class bitmart extends bitmart$1 {
|
|
|
1319
1319
|
this.orderbooks[symbol] = ob;
|
|
1320
1320
|
}
|
|
1321
1321
|
const orderbook = this.orderbooks[symbol];
|
|
1322
|
-
const way = this.
|
|
1322
|
+
const way = this.safeInteger(data, 'way');
|
|
1323
1323
|
const side = (way === 1) ? 'bids' : 'asks';
|
|
1324
1324
|
if (way === 1) {
|
|
1325
1325
|
orderbook[side] = new OrderBookSide.Bids([], limit);
|
package/dist/cjs/src/pro/gate.js
CHANGED
|
@@ -1286,7 +1286,7 @@ class gate extends gate$1 {
|
|
|
1286
1286
|
else if (event === 'finish') {
|
|
1287
1287
|
const status = this.safeString(parsed, 'status');
|
|
1288
1288
|
if (status === undefined) {
|
|
1289
|
-
const left = this.
|
|
1289
|
+
const left = this.safeInteger(info, 'left');
|
|
1290
1290
|
parsed['status'] = (left === 0) ? 'closed' : 'canceled';
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
@@ -4,6 +4,7 @@ var gemini$1 = require('../gemini.js');
|
|
|
4
4
|
var Cache = require('../base/ws/Cache.js');
|
|
5
5
|
var errors = require('../base/errors.js');
|
|
6
6
|
var sha512 = require('../static_dependencies/noble-hashes/sha512.js');
|
|
7
|
+
var Precise = require('../base/Precise.js');
|
|
7
8
|
|
|
8
9
|
// ---------------------------------------------------------------------------
|
|
9
10
|
// ---------------------------------------------------------------------------
|
|
@@ -470,10 +471,11 @@ class gemini extends gemini$1 {
|
|
|
470
471
|
const entry = rawBidAskChanges[i];
|
|
471
472
|
const rawSide = this.safeString(entry, 'side');
|
|
472
473
|
const price = this.safeNumber(entry, 'price');
|
|
473
|
-
const
|
|
474
|
-
if (
|
|
474
|
+
const sizeString = this.safeString(entry, 'remaining');
|
|
475
|
+
if (Precise["default"].stringEq(sizeString, '0')) {
|
|
475
476
|
continue;
|
|
476
477
|
}
|
|
478
|
+
const size = this.parseNumber(sizeString);
|
|
477
479
|
if (rawSide === 'bid') {
|
|
478
480
|
currentBidAsk['bid'] = price;
|
|
479
481
|
currentBidAsk['bidVolume'] = size;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var onetrading$1 = require('../onetrading.js');
|
|
4
4
|
var errors = require('../base/errors.js');
|
|
5
5
|
var Cache = require('../base/ws/Cache.js');
|
|
6
|
+
var Precise = require('../base/Precise.js');
|
|
6
7
|
|
|
7
8
|
// ---------------------------------------------------------------------------
|
|
8
9
|
// ---------------------------------------------------------------------------
|
|
@@ -962,9 +963,9 @@ class onetrading extends onetrading$1 {
|
|
|
962
963
|
const previousOrderArray = this.filterByArray(this.orders, 'id', orderId, false);
|
|
963
964
|
const previousOrder = this.safeValue(previousOrderArray, 0, {});
|
|
964
965
|
symbol = previousOrder['symbol'];
|
|
965
|
-
const filled = this.
|
|
966
|
+
const filled = this.safeString(update, 'filled_amount');
|
|
966
967
|
let status = this.parseWsOrderStatus(updateType);
|
|
967
|
-
if (updateType === 'ORDER_CLOSED' && filled
|
|
968
|
+
if (updateType === 'ORDER_CLOSED' && Precise["default"].stringEq(filled, '0')) {
|
|
968
969
|
status = 'canceled';
|
|
969
970
|
}
|
|
970
971
|
const orderObject = {
|
|
@@ -842,9 +842,10 @@ class vertex extends vertex$1 {
|
|
|
842
842
|
//
|
|
843
843
|
const marketId = this.safeString(order, 'product_id');
|
|
844
844
|
const timestamp = this.parseToInt(Precise["default"].stringDiv(this.safeString(order, 'timestamp'), '1000000'));
|
|
845
|
-
const
|
|
845
|
+
const remainingString = this.convertFromX18(this.safeString(order, 'amount'));
|
|
846
|
+
const remaining = this.parseToNumeric(remainingString);
|
|
846
847
|
let status = this.parseWsOrderStatus(this.safeString(order, 'reason'));
|
|
847
|
-
if (
|
|
848
|
+
if (Precise["default"].stringEq(remainingString, '0') && status === 'open') {
|
|
848
849
|
status = 'closed';
|
|
849
850
|
}
|
|
850
851
|
market = this.safeMarket(marketId, market);
|
package/dist/cjs/src/pro/woo.js
CHANGED
|
@@ -662,9 +662,10 @@ class woo extends woo$1 {
|
|
|
662
662
|
'cost': this.safeString(order, 'totalFee'),
|
|
663
663
|
'currency': this.safeString(order, 'feeAsset'),
|
|
664
664
|
};
|
|
665
|
+
const priceString = this.safeString(order, 'price');
|
|
665
666
|
let price = this.safeNumber(order, 'price');
|
|
666
667
|
const avgPrice = this.safeNumber(order, 'avgPrice');
|
|
667
|
-
if ((
|
|
668
|
+
if (Precise["default"].stringEq(priceString, '0') && (avgPrice !== undefined)) {
|
|
668
669
|
price = avgPrice;
|
|
669
670
|
}
|
|
670
671
|
const amount = this.safeFloat(order, 'quantity');
|
|
@@ -714,9 +714,10 @@ class woofipro extends woofipro$1 {
|
|
|
714
714
|
'cost': this.safeString(order, 'totalFee'),
|
|
715
715
|
'currency': this.safeString(order, 'feeAsset'),
|
|
716
716
|
};
|
|
717
|
+
const priceString = this.safeString(order, 'price');
|
|
717
718
|
let price = this.safeNumber(order, 'price');
|
|
718
719
|
const avgPrice = this.safeNumber(order, 'avgPrice');
|
|
719
|
-
if ((
|
|
720
|
+
if (Precise["default"].stringEq(priceString, '0') && (avgPrice !== undefined)) {
|
|
720
721
|
price = avgPrice;
|
|
721
722
|
}
|
|
722
723
|
const amount = this.safeString(order, 'quantity');
|
package/dist/cjs/src/woo.js
CHANGED
|
@@ -2671,7 +2671,24 @@ class woo extends woo$1 {
|
|
|
2671
2671
|
};
|
|
2672
2672
|
}
|
|
2673
2673
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2674
|
+
/**
|
|
2675
|
+
* @method
|
|
2676
|
+
* @name woo#fetchFundingHistory
|
|
2677
|
+
* @description fetch the history of funding payments paid and received on this account
|
|
2678
|
+
* @see https://docs.woo.org/#get-funding-fee-history
|
|
2679
|
+
* @param {string} [symbol] unified market symbol
|
|
2680
|
+
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
2681
|
+
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
2682
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2683
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
2684
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
2685
|
+
*/
|
|
2674
2686
|
await this.loadMarkets();
|
|
2687
|
+
let paginate = false;
|
|
2688
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingHistory', 'paginate');
|
|
2689
|
+
if (paginate) {
|
|
2690
|
+
return await this.fetchPaginatedCallCursor('fetchFundingHistory', symbol, since, limit, params, 'page', 'page', 1, 500);
|
|
2691
|
+
}
|
|
2675
2692
|
const request = {};
|
|
2676
2693
|
let market = undefined;
|
|
2677
2694
|
if (symbol !== undefined) {
|
|
@@ -2681,6 +2698,12 @@ class woo extends woo$1 {
|
|
|
2681
2698
|
if (since !== undefined) {
|
|
2682
2699
|
request['start_t'] = since;
|
|
2683
2700
|
}
|
|
2701
|
+
if (limit !== undefined) {
|
|
2702
|
+
request['size'] = limit;
|
|
2703
|
+
}
|
|
2704
|
+
else {
|
|
2705
|
+
request['size'] = 5000;
|
|
2706
|
+
}
|
|
2684
2707
|
const response = await this.v1PrivateGetFundingFeeHistory(this.extend(request, params));
|
|
2685
2708
|
//
|
|
2686
2709
|
// {
|
|
@@ -2705,7 +2728,15 @@ class woo extends woo$1 {
|
|
|
2705
2728
|
// "success":true
|
|
2706
2729
|
// }
|
|
2707
2730
|
//
|
|
2731
|
+
const meta = this.safeDict(response, 'meta', {});
|
|
2732
|
+
const cursor = this.safeInteger(meta, 'current_page');
|
|
2708
2733
|
const result = this.safeList(response, 'rows', []);
|
|
2734
|
+
const resultLength = result.length;
|
|
2735
|
+
if (resultLength > 0) {
|
|
2736
|
+
const lastItem = result[resultLength - 1];
|
|
2737
|
+
lastItem['page'] = cursor;
|
|
2738
|
+
result[resultLength - 1] = lastItem;
|
|
2739
|
+
}
|
|
2709
2740
|
return this.parseIncomes(result, market, since, limit);
|
|
2710
2741
|
}
|
|
2711
2742
|
parseFundingRate(fundingRate, market = undefined) {
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, TransferEntries, LeverageTiers } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.3.
|
|
7
|
+
declare const version = "4.3.63";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.3.
|
|
41
|
+
const version = '4.3.64';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -17,6 +17,7 @@ interface Exchange {
|
|
|
17
17
|
publicGetTimestamp(params?: {}): Promise<implicitReturnType>;
|
|
18
18
|
publicGetStatus(params?: {}): Promise<implicitReturnType>;
|
|
19
19
|
publicGetMarkPriceSymbolCurrent(params?: {}): Promise<implicitReturnType>;
|
|
20
|
+
publicGetMarkPriceAllSymbols(params?: {}): Promise<implicitReturnType>;
|
|
20
21
|
publicGetMarginConfig(params?: {}): Promise<implicitReturnType>;
|
|
21
22
|
publicPostBulletPublic(params?: {}): Promise<implicitReturnType>;
|
|
22
23
|
privateGetUserInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -17,6 +17,7 @@ interface kucoin {
|
|
|
17
17
|
publicGetTimestamp(params?: {}): Promise<implicitReturnType>;
|
|
18
18
|
publicGetStatus(params?: {}): Promise<implicitReturnType>;
|
|
19
19
|
publicGetMarkPriceSymbolCurrent(params?: {}): Promise<implicitReturnType>;
|
|
20
|
+
publicGetMarkPriceAllSymbols(params?: {}): Promise<implicitReturnType>;
|
|
20
21
|
publicGetMarginConfig(params?: {}): Promise<implicitReturnType>;
|
|
21
22
|
publicPostBulletPublic(params?: {}): Promise<implicitReturnType>;
|
|
22
23
|
privateGetUserInfo(params?: {}): Promise<implicitReturnType>;
|
package/js/src/alpaca.js
CHANGED
|
@@ -1099,6 +1099,7 @@ export default class alpaca extends Exchange {
|
|
|
1099
1099
|
let url = this.implodeHostname(this.urls['api'][api[0]]);
|
|
1100
1100
|
headers = (headers !== undefined) ? headers : {};
|
|
1101
1101
|
if (api[1] === 'private') {
|
|
1102
|
+
this.checkRequiredCredentials();
|
|
1102
1103
|
headers['APCA-API-KEY-ID'] = this.apiKey;
|
|
1103
1104
|
headers['APCA-API-SECRET-KEY'] = this.secret;
|
|
1104
1105
|
}
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -4320,17 +4320,17 @@ export default class Exchange {
|
|
|
4320
4320
|
await this.loadMarkets();
|
|
4321
4321
|
const market = this.market(symbol);
|
|
4322
4322
|
symbol = market['symbol'];
|
|
4323
|
-
const tickers = await this.
|
|
4323
|
+
const tickers = await this.fetchTickersWs([symbol], params);
|
|
4324
4324
|
const ticker = this.safeDict(tickers, symbol);
|
|
4325
4325
|
if (ticker === undefined) {
|
|
4326
|
-
throw new NullResponse(this.id + '
|
|
4326
|
+
throw new NullResponse(this.id + ' fetchTickerWs() could not find a ticker for ' + symbol);
|
|
4327
4327
|
}
|
|
4328
4328
|
else {
|
|
4329
4329
|
return ticker;
|
|
4330
4330
|
}
|
|
4331
4331
|
}
|
|
4332
4332
|
else {
|
|
4333
|
-
throw new NotSupported(this.id + '
|
|
4333
|
+
throw new NotSupported(this.id + ' fetchTickerWs() is not supported yet');
|
|
4334
4334
|
}
|
|
4335
4335
|
}
|
|
4336
4336
|
async watchTicker(symbol, params = {}) {
|
package/js/src/bingx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bingx.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Dict, Leverage, MarginMode, Num, MarginModification, Currencies, TransferEntries, int } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Dict, Leverage, MarginMode, Num, MarginModification, Currencies, TransferEntries, int, TradingFeeInterface } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class bingx
|
|
5
5
|
* @augments Exchange
|
|
@@ -127,6 +127,8 @@ export default class bingx extends Exchange {
|
|
|
127
127
|
editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
|
|
128
128
|
fetchMarginMode(symbol: string, params?: {}): Promise<MarginMode>;
|
|
129
129
|
parseMarginMode(marginMode: Dict, market?: any): MarginMode;
|
|
130
|
+
fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
|
|
131
|
+
parseTradingFee(fee: Dict, market?: Market): TradingFeeInterface;
|
|
130
132
|
sign(path: any, section?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
131
133
|
url: string;
|
|
132
134
|
method: string;
|