ccxt 4.1.75 → 4.1.76
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 +212 -225
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +2 -0
- package/dist/cjs/src/alpaca.js +2 -0
- package/dist/cjs/src/base/Exchange.js +8 -0
- package/dist/cjs/src/base/errors.js +7 -7
- package/dist/cjs/src/base/ws/Client.js +2 -0
- package/dist/cjs/src/binance.js +4 -0
- package/dist/cjs/src/binanceus.js +2 -0
- package/dist/cjs/src/bingx.js +78 -23
- package/dist/cjs/src/bit2c.js +2 -0
- package/dist/cjs/src/bitbank.js +2 -0
- package/dist/cjs/src/bithumb.js +2 -0
- package/dist/cjs/src/bitopro.js +2 -0
- package/dist/cjs/src/bitpanda.js +2 -0
- package/dist/cjs/src/bitso.js +2 -0
- package/dist/cjs/src/bitstamp.js +2 -0
- package/dist/cjs/src/bittrex.js +2 -0
- package/dist/cjs/src/bitvavo.js +2 -0
- package/dist/cjs/src/bl3p.js +2 -0
- package/dist/cjs/src/btcalpha.js +2 -0
- package/dist/cjs/src/btcbox.js +2 -0
- package/dist/cjs/src/btcmarkets.js +2 -0
- package/dist/cjs/src/btcturk.js +2 -0
- package/dist/cjs/src/bybit.js +2 -0
- package/dist/cjs/src/coinbase.js +2 -0
- package/dist/cjs/src/coincheck.js +2 -0
- package/dist/cjs/src/coinlist.js +2 -0
- package/dist/cjs/src/coinmate.js +2 -0
- package/dist/cjs/src/coinone.js +2 -0
- package/dist/cjs/src/coinsph.js +2 -0
- package/dist/cjs/src/coinspot.js +2 -0
- package/dist/cjs/src/cryptocom.js +2 -185
- package/dist/cjs/src/gemini.js +2 -0
- package/dist/cjs/src/idex.js +2 -0
- package/dist/cjs/src/independentreserve.js +2 -0
- package/dist/cjs/src/indodax.js +2 -0
- package/dist/cjs/src/kucoin.js +2 -0
- package/dist/cjs/src/kuna.js +2 -0
- package/dist/cjs/src/latoken.js +2 -0
- package/dist/cjs/src/luno.js +2 -0
- package/dist/cjs/src/mercado.js +2 -0
- package/dist/cjs/src/mexc.js +2 -0
- package/dist/cjs/src/ndax.js +2 -0
- package/dist/cjs/src/novadax.js +2 -0
- package/dist/cjs/src/okx.js +24 -9
- package/dist/cjs/src/p2b.js +2 -0
- package/dist/cjs/src/static_dependencies/proxies/http-proxy-agent/index.js +8 -11
- package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/index.js +5 -8
- package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +5 -12
- package/dist/cjs/src/wavesexchange.js +2 -0
- package/dist/cjs/src/wazirx.js +2 -0
- package/dist/cjs/src/woo.js +2 -0
- package/dist/cjs/src/yobit.js +2 -0
- package/dist/cjs/src/zonda.js +2 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- 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/abstract/okx.d.ts +14 -0
- package/js/src/ace.js +2 -0
- package/js/src/alpaca.js +2 -0
- package/js/src/base/Exchange.d.ts +4 -0
- package/js/src/base/Exchange.js +8 -0
- package/js/src/base/errors.d.ts +4 -4
- package/js/src/base/errors.js +7 -7
- package/js/src/base/ws/Client.js +2 -0
- package/js/src/binance.js +4 -0
- package/js/src/binanceus.js +2 -0
- package/js/src/bingx.d.ts +4 -3
- package/js/src/bingx.js +78 -23
- package/js/src/bit2c.js +2 -0
- package/js/src/bitbank.js +2 -0
- package/js/src/bithumb.js +2 -0
- package/js/src/bitopro.js +2 -0
- package/js/src/bitpanda.js +2 -0
- package/js/src/bitso.js +2 -0
- package/js/src/bitstamp.js +2 -0
- package/js/src/bittrex.js +2 -0
- package/js/src/bitvavo.js +2 -0
- package/js/src/bl3p.js +2 -0
- package/js/src/btcalpha.js +2 -0
- package/js/src/btcbox.js +2 -0
- package/js/src/btcmarkets.js +2 -0
- package/js/src/btcturk.js +2 -0
- package/js/src/bybit.js +2 -0
- package/js/src/coinbase.js +2 -0
- package/js/src/coincheck.js +2 -0
- package/js/src/coinlist.js +2 -0
- package/js/src/coinmate.js +2 -0
- package/js/src/coinone.js +2 -0
- package/js/src/coinsph.js +2 -0
- package/js/src/coinspot.js +2 -0
- package/js/src/cryptocom.d.ts +0 -24
- package/js/src/cryptocom.js +2 -185
- package/js/src/gemini.js +2 -0
- package/js/src/idex.js +2 -0
- package/js/src/independentreserve.js +2 -0
- package/js/src/indodax.js +2 -0
- package/js/src/kucoin.js +2 -0
- package/js/src/kuna.js +2 -0
- package/js/src/latoken.js +2 -0
- package/js/src/luno.js +2 -0
- package/js/src/mercado.js +2 -0
- package/js/src/mexc.js +2 -0
- package/js/src/ndax.js +2 -0
- package/js/src/novadax.js +2 -0
- package/js/src/okx.js +24 -9
- package/js/src/p2b.js +2 -0
- package/js/src/static_dependencies/proxies/http-proxy-agent/index.js +9 -8
- package/js/src/static_dependencies/proxies/https-proxy-agent/index.js +5 -7
- package/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +5 -7
- package/js/src/wavesexchange.js +2 -0
- package/js/src/wazirx.js +2 -0
- package/js/src/woo.js +2 -0
- package/js/src/yobit.js +2 -0
- package/js/src/zonda.js +2 -0
- package/package.json +1 -1
|
@@ -87,7 +87,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
87
87
|
'fetchTradingFees': false,
|
|
88
88
|
'fetchTransactionFees': false,
|
|
89
89
|
'fetchTransactions': false,
|
|
90
|
-
'fetchTransfers':
|
|
90
|
+
'fetchTransfers': false,
|
|
91
91
|
'fetchUnderlyingAssets': false,
|
|
92
92
|
'fetchVolatilityHistory': false,
|
|
93
93
|
'fetchWithdrawals': true,
|
|
@@ -96,7 +96,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
96
96
|
'setLeverage': false,
|
|
97
97
|
'setMarginMode': false,
|
|
98
98
|
'setPositionMode': false,
|
|
99
|
-
'transfer':
|
|
99
|
+
'transfer': false,
|
|
100
100
|
'withdraw': true,
|
|
101
101
|
},
|
|
102
102
|
'timeframes': {
|
|
@@ -1853,189 +1853,6 @@ class cryptocom extends cryptocom$1 {
|
|
|
1853
1853
|
const withdrawalList = this.safeValue(data, 'withdrawal_list', []);
|
|
1854
1854
|
return this.parseTransactions(withdrawalList, currency, since, limit);
|
|
1855
1855
|
}
|
|
1856
|
-
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
1857
|
-
/**
|
|
1858
|
-
* @method
|
|
1859
|
-
* @name cryptocom#transfer
|
|
1860
|
-
* @description transfer currency internally between wallets on the same account
|
|
1861
|
-
* @param {string} code unified currency code
|
|
1862
|
-
* @param {float} amount amount to transfer
|
|
1863
|
-
* @param {string} fromAccount account to transfer from
|
|
1864
|
-
* @param {string} toAccount account to transfer to
|
|
1865
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1866
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
1867
|
-
*/
|
|
1868
|
-
await this.loadMarkets();
|
|
1869
|
-
const currency = this.currency(code);
|
|
1870
|
-
fromAccount = fromAccount.toLowerCase();
|
|
1871
|
-
toAccount = toAccount.toLowerCase();
|
|
1872
|
-
const accountsById = this.safeValue(this.options, 'accountsById', {});
|
|
1873
|
-
const fromId = this.safeString(accountsById, fromAccount, fromAccount);
|
|
1874
|
-
const toId = this.safeString(accountsById, toAccount, toAccount);
|
|
1875
|
-
const request = {
|
|
1876
|
-
'currency': currency['id'],
|
|
1877
|
-
'amount': parseFloat(amount),
|
|
1878
|
-
'from': fromId,
|
|
1879
|
-
'to': toId,
|
|
1880
|
-
};
|
|
1881
|
-
let method = 'v2PrivatePostPrivateDerivTransfer';
|
|
1882
|
-
if ((fromAccount === 'margin') || (toAccount === 'margin')) {
|
|
1883
|
-
method = 'v2PrivatePostPrivateMarginTransfer';
|
|
1884
|
-
}
|
|
1885
|
-
const response = await this[method](this.extend(request, params));
|
|
1886
|
-
//
|
|
1887
|
-
// {
|
|
1888
|
-
// "id": 11,
|
|
1889
|
-
// "method": "private/deriv/transfer",
|
|
1890
|
-
// "code": 0
|
|
1891
|
-
// }
|
|
1892
|
-
//
|
|
1893
|
-
return this.parseTransfer(response, currency);
|
|
1894
|
-
}
|
|
1895
|
-
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1896
|
-
/**
|
|
1897
|
-
* @method
|
|
1898
|
-
* @name cryptocom#fetchTransfers
|
|
1899
|
-
* @description fetch a history of internal transfers made on an account
|
|
1900
|
-
* @param {string} code unified currency code of the currency transferred
|
|
1901
|
-
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
1902
|
-
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
1903
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1904
|
-
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
1905
|
-
*/
|
|
1906
|
-
if (!('direction' in params)) {
|
|
1907
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchTransfers() requires a direction param to be either "IN" or "OUT"');
|
|
1908
|
-
}
|
|
1909
|
-
await this.loadMarkets();
|
|
1910
|
-
let currency = undefined;
|
|
1911
|
-
const request = {
|
|
1912
|
-
'direction': 'OUT',
|
|
1913
|
-
};
|
|
1914
|
-
if (code !== undefined) {
|
|
1915
|
-
currency = this.currency(code);
|
|
1916
|
-
request['currency'] = currency['id'];
|
|
1917
|
-
}
|
|
1918
|
-
if (since !== undefined) {
|
|
1919
|
-
request['start_ts'] = since;
|
|
1920
|
-
}
|
|
1921
|
-
if (limit !== undefined) {
|
|
1922
|
-
request['page_size'] = limit;
|
|
1923
|
-
}
|
|
1924
|
-
let method = 'v2PrivatePostPrivateDerivGetTransferHistory';
|
|
1925
|
-
const [marginMode, query] = this.customHandleMarginModeAndParams('fetchTransfers', params);
|
|
1926
|
-
if (marginMode !== undefined) {
|
|
1927
|
-
method = 'v2PrivatePostPrivateMarginGetTransferHistory';
|
|
1928
|
-
}
|
|
1929
|
-
const response = await this[method](this.extend(request, query));
|
|
1930
|
-
//
|
|
1931
|
-
// {
|
|
1932
|
-
// "id": "1641032709328",
|
|
1933
|
-
// "method": "private/deriv/get-transfer-history",
|
|
1934
|
-
// "code": "0",
|
|
1935
|
-
// "result": {
|
|
1936
|
-
// "transfer_list": [
|
|
1937
|
-
// {
|
|
1938
|
-
// "direction": "IN",
|
|
1939
|
-
// "time": "1641025185223",
|
|
1940
|
-
// "amount": "109.56",
|
|
1941
|
-
// "status": "COMPLETED",
|
|
1942
|
-
// "information": "From Spot Wallet",
|
|
1943
|
-
// "currency": "USDC"
|
|
1944
|
-
// }
|
|
1945
|
-
// ]
|
|
1946
|
-
// }
|
|
1947
|
-
// }
|
|
1948
|
-
//
|
|
1949
|
-
const transfer = [];
|
|
1950
|
-
transfer.push({
|
|
1951
|
-
'response': response,
|
|
1952
|
-
});
|
|
1953
|
-
return this.parseTransfers(transfer, currency, since, limit, params);
|
|
1954
|
-
}
|
|
1955
|
-
parseTransferStatus(status) {
|
|
1956
|
-
const statuses = {
|
|
1957
|
-
'COMPLETED': 'ok',
|
|
1958
|
-
'PROCESSING': 'pending',
|
|
1959
|
-
};
|
|
1960
|
-
return this.safeString(statuses, status, status);
|
|
1961
|
-
}
|
|
1962
|
-
parseTransfer(transfer, currency = undefined) {
|
|
1963
|
-
//
|
|
1964
|
-
// {
|
|
1965
|
-
// "response": {
|
|
1966
|
-
// "id": "1641032709328",
|
|
1967
|
-
// "method": "private/deriv/get-transfer-history",
|
|
1968
|
-
// "code": "0",
|
|
1969
|
-
// "result": {
|
|
1970
|
-
// "transfer_list": [
|
|
1971
|
-
// {
|
|
1972
|
-
// "direction": "IN",
|
|
1973
|
-
// "time": "1641025185223",
|
|
1974
|
-
// "amount": "109.56",
|
|
1975
|
-
// "status": "COMPLETED",
|
|
1976
|
-
// "information": "From Spot Wallet",
|
|
1977
|
-
// "currency": "USDC"
|
|
1978
|
-
// }
|
|
1979
|
-
// ]
|
|
1980
|
-
// }
|
|
1981
|
-
// }
|
|
1982
|
-
// }
|
|
1983
|
-
//
|
|
1984
|
-
const response = this.safeValue(transfer, 'response', {});
|
|
1985
|
-
const result = this.safeValue(response, 'result', {});
|
|
1986
|
-
const transferList = this.safeValue(result, 'transfer_list', []);
|
|
1987
|
-
let timestamp = undefined;
|
|
1988
|
-
let amount = undefined;
|
|
1989
|
-
let code = undefined;
|
|
1990
|
-
let information = undefined;
|
|
1991
|
-
let status = undefined;
|
|
1992
|
-
for (let i = 0; i < transferList.length; i++) {
|
|
1993
|
-
const entry = transferList[i];
|
|
1994
|
-
timestamp = this.safeInteger(entry, 'time');
|
|
1995
|
-
amount = this.safeNumber(entry, 'amount');
|
|
1996
|
-
const currencyId = this.safeString(entry, 'currency');
|
|
1997
|
-
code = this.safeCurrencyCode(currencyId);
|
|
1998
|
-
information = this.safeString(entry, 'information');
|
|
1999
|
-
const rawStatus = this.safeString(entry, 'status');
|
|
2000
|
-
status = this.parseTransferStatus(rawStatus);
|
|
2001
|
-
}
|
|
2002
|
-
let fromAccount = undefined;
|
|
2003
|
-
let toAccount = undefined;
|
|
2004
|
-
if (information !== undefined) {
|
|
2005
|
-
const parts = information.split(' ');
|
|
2006
|
-
const direction = this.safeStringLower(parts, 0);
|
|
2007
|
-
const method = this.safeString(response, 'method');
|
|
2008
|
-
if (direction === 'from') {
|
|
2009
|
-
fromAccount = this.safeStringLower(parts, 1);
|
|
2010
|
-
if (method === 'private/margin/get-transfer-history') {
|
|
2011
|
-
toAccount = 'margin';
|
|
2012
|
-
}
|
|
2013
|
-
else {
|
|
2014
|
-
toAccount = 'derivative';
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
else if (direction === 'to') {
|
|
2018
|
-
toAccount = this.safeStringLower(parts, 1);
|
|
2019
|
-
if (method === 'private/margin/get-transfer-history') {
|
|
2020
|
-
fromAccount = 'margin';
|
|
2021
|
-
}
|
|
2022
|
-
else {
|
|
2023
|
-
fromAccount = 'derivative';
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
2027
|
-
return {
|
|
2028
|
-
'info': transferList,
|
|
2029
|
-
'id': this.safeString(response, 'id'),
|
|
2030
|
-
'timestamp': timestamp,
|
|
2031
|
-
'datetime': this.iso8601(timestamp),
|
|
2032
|
-
'currency': code,
|
|
2033
|
-
'amount': amount,
|
|
2034
|
-
'fromAccount': fromAccount,
|
|
2035
|
-
'toAccount': toAccount,
|
|
2036
|
-
'status': status,
|
|
2037
|
-
};
|
|
2038
|
-
}
|
|
2039
1856
|
parseTicker(ticker, market = undefined) {
|
|
2040
1857
|
//
|
|
2041
1858
|
// fetchTicker
|
package/dist/cjs/src/gemini.js
CHANGED
package/dist/cjs/src/idex.js
CHANGED
|
@@ -28,6 +28,8 @@ class independentreserve extends independentreserve$1 {
|
|
|
28
28
|
'option': false,
|
|
29
29
|
'addMargin': false,
|
|
30
30
|
'cancelOrder': true,
|
|
31
|
+
'closeAllPositions': false,
|
|
32
|
+
'closePosition': false,
|
|
31
33
|
'createOrder': true,
|
|
32
34
|
'createReduceOnlyOrder': false,
|
|
33
35
|
'createStopLimitOrder': false,
|
package/dist/cjs/src/indodax.js
CHANGED
|
@@ -31,6 +31,8 @@ class indodax extends indodax$1 {
|
|
|
31
31
|
'cancelAllOrders': false,
|
|
32
32
|
'cancelOrder': true,
|
|
33
33
|
'cancelOrders': false,
|
|
34
|
+
'closeAllPositions': false,
|
|
35
|
+
'closePosition': false,
|
|
34
36
|
'createDepositAddress': false,
|
|
35
37
|
'createOrder': true,
|
|
36
38
|
'createReduceOnlyOrder': false,
|
package/dist/cjs/src/kucoin.js
CHANGED
package/dist/cjs/src/kuna.js
CHANGED
package/dist/cjs/src/latoken.js
CHANGED
package/dist/cjs/src/luno.js
CHANGED
package/dist/cjs/src/mercado.js
CHANGED
package/dist/cjs/src/mexc.js
CHANGED
package/dist/cjs/src/ndax.js
CHANGED
package/dist/cjs/src/novadax.js
CHANGED
package/dist/cjs/src/okx.js
CHANGED
|
@@ -235,6 +235,13 @@ class okx extends okx$1 {
|
|
|
235
235
|
'finance/savings/lending-rate-history': 5 / 3,
|
|
236
236
|
// public broker
|
|
237
237
|
'finance/sfp/dcd/products': 2 / 3,
|
|
238
|
+
// copytrading
|
|
239
|
+
'copytrading/public-lead-traders': 4,
|
|
240
|
+
'copytrading/public-weekly-pnl': 4,
|
|
241
|
+
'copytrading/public-stats': 4,
|
|
242
|
+
'copytrading/public-preference-currency': 4,
|
|
243
|
+
'copytrading/public-current-subpositions': 4,
|
|
244
|
+
'copytrading/public-subpositions-history': 4,
|
|
238
245
|
},
|
|
239
246
|
},
|
|
240
247
|
'private': {
|
|
@@ -344,12 +351,16 @@ class okx extends okx$1 {
|
|
|
344
351
|
'finance/staking-defi/eth/balance': 5 / 3,
|
|
345
352
|
'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
|
|
346
353
|
// copytrading
|
|
347
|
-
'copytrading/current-subpositions':
|
|
348
|
-
'copytrading/subpositions-history':
|
|
349
|
-
'copytrading/instruments':
|
|
350
|
-
'copytrading/profit-sharing-details':
|
|
351
|
-
'copytrading/total-profit-sharing':
|
|
352
|
-
'copytrading/unrealized-profit-sharing-details':
|
|
354
|
+
'copytrading/current-subpositions': 1,
|
|
355
|
+
'copytrading/subpositions-history': 1,
|
|
356
|
+
'copytrading/instruments': 4,
|
|
357
|
+
'copytrading/profit-sharing-details': 4,
|
|
358
|
+
'copytrading/total-profit-sharing': 4,
|
|
359
|
+
'copytrading/unrealized-profit-sharing-details': 4,
|
|
360
|
+
'copytrading/copy-settings': 4,
|
|
361
|
+
'copytrading/batch-leverage-info': 4,
|
|
362
|
+
'copytrading/current-lead-traders': 4,
|
|
363
|
+
'copytrading/lead-traders-history': 4,
|
|
353
364
|
// broker
|
|
354
365
|
'broker/nd/info': 10,
|
|
355
366
|
'broker/nd/subaccount-info': 10,
|
|
@@ -454,9 +465,13 @@ class okx extends okx$1 {
|
|
|
454
465
|
'finance/staking-defi/eth/purchase': 5,
|
|
455
466
|
'finance/staking-defi/eth/redeem': 5,
|
|
456
467
|
// copytrading
|
|
457
|
-
'copytrading/algo-order':
|
|
458
|
-
'copytrading/close-subposition':
|
|
459
|
-
'copytrading/set-instruments':
|
|
468
|
+
'copytrading/algo-order': 1,
|
|
469
|
+
'copytrading/close-subposition': 1,
|
|
470
|
+
'copytrading/set-instruments': 4,
|
|
471
|
+
'copytrading/first-copy-settings': 4,
|
|
472
|
+
'copytrading/amend-copy-settings': 4,
|
|
473
|
+
'copytrading/stop-copy-trading': 4,
|
|
474
|
+
'copytrading/batch-set-leverage': 4,
|
|
460
475
|
// broker
|
|
461
476
|
'broker/nd/create-subaccount': 0.25,
|
|
462
477
|
'broker/nd/delete-subaccount': 1,
|
package/dist/cjs/src/p2b.js
CHANGED
|
@@ -4,12 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var net = require('net');
|
|
6
6
|
var tls = require('tls');
|
|
7
|
-
var createDebug = require('debug');
|
|
8
7
|
var events = require('events');
|
|
9
8
|
var index = require('../agent-base/index.js');
|
|
10
9
|
|
|
11
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
-
|
|
13
10
|
function _interopNamespace(e) {
|
|
14
11
|
if (e && e.__esModule) return e;
|
|
15
12
|
var n = Object.create(null);
|
|
@@ -30,9 +27,7 @@ function _interopNamespace(e) {
|
|
|
30
27
|
|
|
31
28
|
var net__namespace = /*#__PURE__*/_interopNamespace(net);
|
|
32
29
|
var tls__namespace = /*#__PURE__*/_interopNamespace(tls);
|
|
33
|
-
var createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
|
|
34
30
|
|
|
35
|
-
const debug = createDebug__default["default"]('http-proxy-agent');
|
|
36
31
|
function isHTTPS(protocol) {
|
|
37
32
|
return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;
|
|
38
33
|
}
|
|
@@ -45,7 +40,7 @@ class HttpProxyAgent extends index.Agent {
|
|
|
45
40
|
super(opts);
|
|
46
41
|
this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
|
|
47
42
|
this.proxyHeaders = opts?.headers ?? {};
|
|
48
|
-
debug('Creating new HttpProxyAgent instance: %o', this.proxy.href);
|
|
43
|
+
// debug('Creating new HttpProxyAgent instance: %o', this.proxy.href);
|
|
49
44
|
// Trim off the brackets from IPv6 addresses
|
|
50
45
|
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
|
|
51
46
|
const port = this.proxy.port
|
|
@@ -97,11 +92,11 @@ class HttpProxyAgent extends index.Agent {
|
|
|
97
92
|
// Create a socket connection to the proxy server.
|
|
98
93
|
let socket;
|
|
99
94
|
if (this.secureProxy) {
|
|
100
|
-
debug('Creating `tls.Socket`: %o', this.connectOpts);
|
|
95
|
+
// debug('Creating `tls.Socket`: %o', this.connectOpts);
|
|
101
96
|
socket = tls__namespace.connect(this.connectOpts);
|
|
102
97
|
}
|
|
103
98
|
else {
|
|
104
|
-
debug('Creating `net.Socket`: %o', this.connectOpts);
|
|
99
|
+
// debug('Creating `net.Socket`: %o', this.connectOpts);
|
|
105
100
|
socket = net__namespace.connect(this.connectOpts);
|
|
106
101
|
}
|
|
107
102
|
// At this point, the http ClientRequest's internal `_header` field
|
|
@@ -109,16 +104,18 @@ class HttpProxyAgent extends index.Agent {
|
|
|
109
104
|
// to re-generate the string since we just changed the `req.path`.
|
|
110
105
|
let first;
|
|
111
106
|
let endOfHeaders;
|
|
112
|
-
debug('Regenerating stored HTTP header string for request');
|
|
107
|
+
// debug('Regenerating stored HTTP header string for request');
|
|
113
108
|
req._implicitHeader();
|
|
114
109
|
if (req.outputData && req.outputData.length > 0) {
|
|
115
110
|
// Node >= 12
|
|
116
|
-
debug(
|
|
111
|
+
// debug(
|
|
112
|
+
// 'Patching connection write() output buffer with updated header'
|
|
113
|
+
// );
|
|
117
114
|
first = req.outputData[0].data;
|
|
118
115
|
endOfHeaders = first.indexOf('\r\n\r\n') + 4;
|
|
119
116
|
req.outputData[0].data =
|
|
120
117
|
req._header + first.substring(endOfHeaders);
|
|
121
|
-
debug('Output buffer: %o', req.outputData[0].data);
|
|
118
|
+
// debug('Output buffer: %o', req.outputData[0].data);
|
|
122
119
|
}
|
|
123
120
|
// Wait for the socket's `connect` event, so that this `callback()`
|
|
124
121
|
// function throws instead of the `http` request machinery. This is
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var net = require('net');
|
|
6
6
|
var tls = require('tls');
|
|
7
7
|
var assert = require('assert');
|
|
8
|
-
var createDebug = require('debug');
|
|
9
8
|
var index = require('../agent-base/index.js');
|
|
10
9
|
var parseProxyResponse = require('./parse-proxy-response.js');
|
|
11
10
|
|
|
@@ -32,9 +31,7 @@ function _interopNamespace(e) {
|
|
|
32
31
|
var net__namespace = /*#__PURE__*/_interopNamespace(net);
|
|
33
32
|
var tls__namespace = /*#__PURE__*/_interopNamespace(tls);
|
|
34
33
|
var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
|
|
35
|
-
var createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
|
|
36
34
|
|
|
37
|
-
const debug = createDebug__default["default"]('https-proxy-agent');
|
|
38
35
|
/**
|
|
39
36
|
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
|
|
40
37
|
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
|
|
@@ -53,7 +50,7 @@ class HttpsProxyAgent extends index.Agent {
|
|
|
53
50
|
this.options = { path: undefined };
|
|
54
51
|
this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
|
|
55
52
|
this.proxyHeaders = opts?.headers ?? {};
|
|
56
|
-
debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
|
|
53
|
+
// debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
|
|
57
54
|
// Trim off the brackets from IPv6 addresses
|
|
58
55
|
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
|
|
59
56
|
const port = this.proxy.port
|
|
@@ -84,11 +81,11 @@ class HttpsProxyAgent extends index.Agent {
|
|
|
84
81
|
// Create a socket connection to the proxy server.
|
|
85
82
|
let socket;
|
|
86
83
|
if (secureProxy) {
|
|
87
|
-
debug('Creating `tls.Socket`: %o', this.connectOpts);
|
|
84
|
+
// debug('Creating `tls.Socket`: %o', this.connectOpts);
|
|
88
85
|
socket = tls__namespace.connect(this.connectOpts);
|
|
89
86
|
}
|
|
90
87
|
else {
|
|
91
|
-
debug('Creating `net.Socket`: %o', this.connectOpts);
|
|
88
|
+
// debug('Creating `net.Socket`: %o', this.connectOpts);
|
|
92
89
|
socket = net__namespace.connect(this.connectOpts);
|
|
93
90
|
}
|
|
94
91
|
const headers = typeof this.proxyHeaders === 'function'
|
|
@@ -121,7 +118,7 @@ class HttpsProxyAgent extends index.Agent {
|
|
|
121
118
|
if (opts.secureEndpoint) {
|
|
122
119
|
// The proxy is connecting to a TLS server, so upgrade
|
|
123
120
|
// this socket connection to a TLS connection.
|
|
124
|
-
debug('Upgrading socket connection to TLS');
|
|
121
|
+
// debug('Upgrading socket connection to TLS');
|
|
125
122
|
const servername = opts.servername || opts.host;
|
|
126
123
|
return tls__namespace.connect({
|
|
127
124
|
...omit(opts, 'host', 'path', 'port'),
|
|
@@ -146,7 +143,7 @@ class HttpsProxyAgent extends index.Agent {
|
|
|
146
143
|
fakeSocket.readable = true;
|
|
147
144
|
// Need to wait for the "socket" event to re-play the "data" events.
|
|
148
145
|
req.once('socket', (s) => {
|
|
149
|
-
debug('Replaying proxy buffer for failed request');
|
|
146
|
+
// debug('Replaying proxy buffer for failed request');
|
|
150
147
|
assert__default["default"](s.listenerCount('data') > 0);
|
|
151
148
|
// Replay the "buffered" Buffer onto the fake `socket`, since at
|
|
152
149
|
// this point the HTTP module machinery has been hooked up for
|
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var createDebug = require('debug');
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var createDebug__default = /*#__PURE__*/_interopDefaultLegacy(createDebug);
|
|
10
|
-
|
|
11
|
-
const debug = createDebug__default["default"]('https-proxy-agent:parse-proxy-response');
|
|
12
5
|
function parseProxyResponse(socket) {
|
|
13
6
|
return new Promise((resolve, reject) => {
|
|
14
7
|
// we need to buffer any HTTP traffic that happens with the proxy before we get
|
|
@@ -31,14 +24,14 @@ function parseProxyResponse(socket) {
|
|
|
31
24
|
socket.removeListener('readable', read);
|
|
32
25
|
}
|
|
33
26
|
function onclose(err) {
|
|
34
|
-
debug('onclose had error %o', err);
|
|
27
|
+
// debug('onclose had error %o', err);
|
|
35
28
|
}
|
|
36
29
|
function onend() {
|
|
37
|
-
debug('onend');
|
|
30
|
+
// debug('onend');
|
|
38
31
|
}
|
|
39
32
|
function onerror(err) {
|
|
40
33
|
cleanup();
|
|
41
|
-
debug('onerror %o', err);
|
|
34
|
+
// debug('onerror %o', err);
|
|
42
35
|
reject(err);
|
|
43
36
|
}
|
|
44
37
|
function ondata(b) {
|
|
@@ -48,7 +41,7 @@ function parseProxyResponse(socket) {
|
|
|
48
41
|
const endOfHeaders = buffered.indexOf('\r\n\r\n');
|
|
49
42
|
if (endOfHeaders === -1) {
|
|
50
43
|
// keep buffering
|
|
51
|
-
debug('have not received end of HTTP headers yet...');
|
|
44
|
+
// debug('have not received end of HTTP headers yet...');
|
|
52
45
|
read();
|
|
53
46
|
return;
|
|
54
47
|
}
|
|
@@ -81,7 +74,7 @@ function parseProxyResponse(socket) {
|
|
|
81
74
|
headers[key] = value;
|
|
82
75
|
}
|
|
83
76
|
}
|
|
84
|
-
debug('got proxy server response: %o', firstLine);
|
|
77
|
+
// debug('got proxy server response: %o', firstLine);
|
|
85
78
|
cleanup();
|
|
86
79
|
resolve({
|
|
87
80
|
connect: {
|
package/dist/cjs/src/wazirx.js
CHANGED
package/dist/cjs/src/woo.js
CHANGED
package/dist/cjs/src/yobit.js
CHANGED
package/dist/cjs/src/zonda.js
CHANGED
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 { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
|
|
6
6
|
import { 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, NoChange } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.1.
|
|
7
|
+
declare const version = "4.1.75";
|
|
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, 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, NoChange } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.1.
|
|
41
|
+
const version = '4.1.76';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|