ccxt 4.1.74 → 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 +620 -342
- 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 +14 -2
- package/dist/cjs/src/base/errors.js +7 -7
- package/dist/cjs/src/base/ws/Client.js +13 -14
- package/dist/cjs/src/bigone.js +38 -9
- package/dist/cjs/src/binance.js +4 -0
- package/dist/cjs/src/binanceus.js +2 -0
- package/dist/cjs/src/bingx.js +134 -40
- 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/bitmart.js +33 -11
- 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/gate.js +1 -0
- package/dist/cjs/src/gemini.js +23 -19
- 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/kraken.js +154 -11
- 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/poloniex.js +27 -25
- package/dist/cjs/src/pro/binance.js +60 -8
- package/dist/cjs/src/pro/coinbasepro.js +1 -1
- 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 +14 -2
- package/js/src/base/errors.d.ts +4 -4
- package/js/src/base/errors.js +7 -7
- package/js/src/base/ws/Client.js +13 -14
- package/js/src/bigone.d.ts +1 -0
- package/js/src/bigone.js +38 -9
- package/js/src/binance.js +4 -0
- package/js/src/binanceus.js +2 -0
- package/js/src/bingx.d.ts +7 -3
- package/js/src/bingx.js +135 -41
- package/js/src/bit2c.js +2 -0
- package/js/src/bitbank.js +2 -0
- package/js/src/bithumb.js +2 -0
- package/js/src/bitmart.d.ts +1 -0
- package/js/src/bitmart.js +33 -11
- 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/gate.js +1 -0
- package/js/src/gemini.js +23 -19
- package/js/src/idex.js +2 -0
- package/js/src/independentreserve.js +2 -0
- package/js/src/indodax.js +2 -0
- package/js/src/kraken.d.ts +2 -0
- package/js/src/kraken.js +154 -11
- 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/poloniex.js +27 -25
- package/js/src/pro/binance.d.ts +1 -0
- package/js/src/pro/binance.js +61 -9
- package/js/src/pro/coinbasepro.js +1 -1
- package/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
|
@@ -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';
|
|
@@ -552,6 +552,7 @@ interface Exchange {
|
|
|
552
552
|
publicGetUiKlines(params?: {}): Promise<implicitReturnType>;
|
|
553
553
|
publicGetTicker24hr(params?: {}): Promise<implicitReturnType>;
|
|
554
554
|
publicGetTicker(params?: {}): Promise<implicitReturnType>;
|
|
555
|
+
publicGetTickerTradingDay(params?: {}): Promise<implicitReturnType>;
|
|
555
556
|
publicGetTickerPrice(params?: {}): Promise<implicitReturnType>;
|
|
556
557
|
publicGetTickerBookTicker(params?: {}): Promise<implicitReturnType>;
|
|
557
558
|
publicGetExchangeInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -570,6 +571,7 @@ interface Exchange {
|
|
|
570
571
|
privateGetRateLimitOrder(params?: {}): Promise<implicitReturnType>;
|
|
571
572
|
privateGetMyPreventedMatches(params?: {}): Promise<implicitReturnType>;
|
|
572
573
|
privateGetMyAllocations(params?: {}): Promise<implicitReturnType>;
|
|
574
|
+
privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
|
|
573
575
|
privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
|
|
574
576
|
privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
|
|
575
577
|
privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
|
|
@@ -552,6 +552,7 @@ interface binance {
|
|
|
552
552
|
publicGetUiKlines(params?: {}): Promise<implicitReturnType>;
|
|
553
553
|
publicGetTicker24hr(params?: {}): Promise<implicitReturnType>;
|
|
554
554
|
publicGetTicker(params?: {}): Promise<implicitReturnType>;
|
|
555
|
+
publicGetTickerTradingDay(params?: {}): Promise<implicitReturnType>;
|
|
555
556
|
publicGetTickerPrice(params?: {}): Promise<implicitReturnType>;
|
|
556
557
|
publicGetTickerBookTicker(params?: {}): Promise<implicitReturnType>;
|
|
557
558
|
publicGetExchangeInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -570,6 +571,7 @@ interface binance {
|
|
|
570
571
|
privateGetRateLimitOrder(params?: {}): Promise<implicitReturnType>;
|
|
571
572
|
privateGetMyPreventedMatches(params?: {}): Promise<implicitReturnType>;
|
|
572
573
|
privateGetMyAllocations(params?: {}): Promise<implicitReturnType>;
|
|
574
|
+
privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
|
|
573
575
|
privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
|
|
574
576
|
privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
|
|
575
577
|
privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
|
|
@@ -552,6 +552,7 @@ interface binance {
|
|
|
552
552
|
publicGetUiKlines(params?: {}): Promise<implicitReturnType>;
|
|
553
553
|
publicGetTicker24hr(params?: {}): Promise<implicitReturnType>;
|
|
554
554
|
publicGetTicker(params?: {}): Promise<implicitReturnType>;
|
|
555
|
+
publicGetTickerTradingDay(params?: {}): Promise<implicitReturnType>;
|
|
555
556
|
publicGetTickerPrice(params?: {}): Promise<implicitReturnType>;
|
|
556
557
|
publicGetTickerBookTicker(params?: {}): Promise<implicitReturnType>;
|
|
557
558
|
publicGetExchangeInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -570,6 +571,7 @@ interface binance {
|
|
|
570
571
|
privateGetRateLimitOrder(params?: {}): Promise<implicitReturnType>;
|
|
571
572
|
privateGetMyPreventedMatches(params?: {}): Promise<implicitReturnType>;
|
|
572
573
|
privateGetMyAllocations(params?: {}): Promise<implicitReturnType>;
|
|
574
|
+
privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
|
|
573
575
|
privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
|
|
574
576
|
privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
|
|
575
577
|
privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
|
|
@@ -552,6 +552,7 @@ interface binance {
|
|
|
552
552
|
publicGetUiKlines(params?: {}): Promise<implicitReturnType>;
|
|
553
553
|
publicGetTicker24hr(params?: {}): Promise<implicitReturnType>;
|
|
554
554
|
publicGetTicker(params?: {}): Promise<implicitReturnType>;
|
|
555
|
+
publicGetTickerTradingDay(params?: {}): Promise<implicitReturnType>;
|
|
555
556
|
publicGetTickerPrice(params?: {}): Promise<implicitReturnType>;
|
|
556
557
|
publicGetTickerBookTicker(params?: {}): Promise<implicitReturnType>;
|
|
557
558
|
publicGetExchangeInfo(params?: {}): Promise<implicitReturnType>;
|
|
@@ -570,6 +571,7 @@ interface binance {
|
|
|
570
571
|
privateGetRateLimitOrder(params?: {}): Promise<implicitReturnType>;
|
|
571
572
|
privateGetMyPreventedMatches(params?: {}): Promise<implicitReturnType>;
|
|
572
573
|
privateGetMyAllocations(params?: {}): Promise<implicitReturnType>;
|
|
574
|
+
privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
|
|
573
575
|
privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
|
|
574
576
|
privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
|
|
575
577
|
privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
|
package/js/src/abstract/okx.d.ts
CHANGED
|
@@ -65,6 +65,12 @@ interface Exchange {
|
|
|
65
65
|
publicGetFinanceSavingsLendingRateSummary(params?: {}): Promise<implicitReturnType>;
|
|
66
66
|
publicGetFinanceSavingsLendingRateHistory(params?: {}): Promise<implicitReturnType>;
|
|
67
67
|
publicGetFinanceSfpDcdProducts(params?: {}): Promise<implicitReturnType>;
|
|
68
|
+
publicGetCopytradingPublicLeadTraders(params?: {}): Promise<implicitReturnType>;
|
|
69
|
+
publicGetCopytradingPublicWeeklyPnl(params?: {}): Promise<implicitReturnType>;
|
|
70
|
+
publicGetCopytradingPublicStats(params?: {}): Promise<implicitReturnType>;
|
|
71
|
+
publicGetCopytradingPublicPreferenceCurrency(params?: {}): Promise<implicitReturnType>;
|
|
72
|
+
publicGetCopytradingPublicCurrentSubpositions(params?: {}): Promise<implicitReturnType>;
|
|
73
|
+
publicGetCopytradingPublicSubpositionsHistory(params?: {}): Promise<implicitReturnType>;
|
|
68
74
|
privateGetRfqCounterparties(params?: {}): Promise<implicitReturnType>;
|
|
69
75
|
privateGetRfqMakerInstrumentSettings(params?: {}): Promise<implicitReturnType>;
|
|
70
76
|
privateGetRfqRfqs(params?: {}): Promise<implicitReturnType>;
|
|
@@ -166,6 +172,10 @@ interface Exchange {
|
|
|
166
172
|
privateGetCopytradingProfitSharingDetails(params?: {}): Promise<implicitReturnType>;
|
|
167
173
|
privateGetCopytradingTotalProfitSharing(params?: {}): Promise<implicitReturnType>;
|
|
168
174
|
privateGetCopytradingUnrealizedProfitSharingDetails(params?: {}): Promise<implicitReturnType>;
|
|
175
|
+
privateGetCopytradingCopySettings(params?: {}): Promise<implicitReturnType>;
|
|
176
|
+
privateGetCopytradingBatchLeverageInfo(params?: {}): Promise<implicitReturnType>;
|
|
177
|
+
privateGetCopytradingCurrentLeadTraders(params?: {}): Promise<implicitReturnType>;
|
|
178
|
+
privateGetCopytradingLeadTradersHistory(params?: {}): Promise<implicitReturnType>;
|
|
169
179
|
privateGetBrokerNdInfo(params?: {}): Promise<implicitReturnType>;
|
|
170
180
|
privateGetBrokerNdSubaccountInfo(params?: {}): Promise<implicitReturnType>;
|
|
171
181
|
privateGetBrokerNdSubaccountApikey(params?: {}): Promise<implicitReturnType>;
|
|
@@ -259,6 +269,10 @@ interface Exchange {
|
|
|
259
269
|
privatePostCopytradingAlgoOrder(params?: {}): Promise<implicitReturnType>;
|
|
260
270
|
privatePostCopytradingCloseSubposition(params?: {}): Promise<implicitReturnType>;
|
|
261
271
|
privatePostCopytradingSetInstruments(params?: {}): Promise<implicitReturnType>;
|
|
272
|
+
privatePostCopytradingFirstCopySettings(params?: {}): Promise<implicitReturnType>;
|
|
273
|
+
privatePostCopytradingAmendCopySettings(params?: {}): Promise<implicitReturnType>;
|
|
274
|
+
privatePostCopytradingStopCopyTrading(params?: {}): Promise<implicitReturnType>;
|
|
275
|
+
privatePostCopytradingBatchSetLeverage(params?: {}): Promise<implicitReturnType>;
|
|
262
276
|
privatePostBrokerNdCreateSubaccount(params?: {}): Promise<implicitReturnType>;
|
|
263
277
|
privatePostBrokerNdDeleteSubaccount(params?: {}): Promise<implicitReturnType>;
|
|
264
278
|
privatePostBrokerNdSubaccountApikey(params?: {}): Promise<implicitReturnType>;
|
package/js/src/ace.js
CHANGED
package/js/src/alpaca.js
CHANGED
|
@@ -291,6 +291,8 @@ export default class Exchange {
|
|
|
291
291
|
cancelAllOrders: any;
|
|
292
292
|
cancelOrder: boolean;
|
|
293
293
|
cancelOrders: any;
|
|
294
|
+
closeAllPositions: any;
|
|
295
|
+
closePosition: any;
|
|
294
296
|
createDepositAddress: any;
|
|
295
297
|
createLimitOrder: boolean;
|
|
296
298
|
createMarketOrder: boolean;
|
|
@@ -790,6 +792,8 @@ export default class Exchange {
|
|
|
790
792
|
fetchOpenInterest(symbol: string, params?: {}): Promise<OpenInterest>;
|
|
791
793
|
fetchFundingRateHistory(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
792
794
|
fetchFundingHistory(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<FundingHistory[]>;
|
|
795
|
+
closePosition(symbol: string, side?: OrderSide, marginMode?: string, params?: {}): Promise<Position>;
|
|
796
|
+
closeAllPositions(params?: {}): Promise<Position[]>;
|
|
793
797
|
parseLastPrice(price: any, market?: Market): any;
|
|
794
798
|
fetchDepositAddress(code: string, params?: {}): Promise<any>;
|
|
795
799
|
account(): Account;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -349,6 +349,8 @@ export default class Exchange {
|
|
|
349
349
|
'cancelAllOrders': undefined,
|
|
350
350
|
'cancelOrder': true,
|
|
351
351
|
'cancelOrders': undefined,
|
|
352
|
+
'closeAllPositions': undefined,
|
|
353
|
+
'closePosition': undefined,
|
|
352
354
|
'createDepositAddress': undefined,
|
|
353
355
|
'createLimitOrder': true,
|
|
354
356
|
'createMarketOrder': true,
|
|
@@ -3694,6 +3696,12 @@ export default class Exchange {
|
|
|
3694
3696
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3695
3697
|
throw new NotSupported(this.id + ' fetchFundingHistory() is not supported yet');
|
|
3696
3698
|
}
|
|
3699
|
+
async closePosition(symbol, side = undefined, marginMode = undefined, params = {}) {
|
|
3700
|
+
throw new NotSupported(this.id + ' closePositions() is not supported yet');
|
|
3701
|
+
}
|
|
3702
|
+
async closeAllPositions(params = {}) {
|
|
3703
|
+
throw new NotSupported(this.id + ' closeAllPositions() is not supported yet');
|
|
3704
|
+
}
|
|
3697
3705
|
parseLastPrice(price, market = undefined) {
|
|
3698
3706
|
throw new NotSupported(this.id + ' parseLastPrice() is not supported yet');
|
|
3699
3707
|
}
|
|
@@ -4685,6 +4693,10 @@ export default class Exchange {
|
|
|
4685
4693
|
if (cursorValue === undefined) {
|
|
4686
4694
|
break;
|
|
4687
4695
|
}
|
|
4696
|
+
const lastTimestamp = this.safeInteger(last, 'timestamp');
|
|
4697
|
+
if (lastTimestamp !== undefined && lastTimestamp < since) {
|
|
4698
|
+
break;
|
|
4699
|
+
}
|
|
4688
4700
|
}
|
|
4689
4701
|
catch (e) {
|
|
4690
4702
|
errors += 1;
|
|
@@ -4737,10 +4749,10 @@ export default class Exchange {
|
|
|
4737
4749
|
const first = this.safeValue(result, 0);
|
|
4738
4750
|
if (first !== undefined) {
|
|
4739
4751
|
if ('timestamp' in first) {
|
|
4740
|
-
return this.sortBy(result, 'timestamp');
|
|
4752
|
+
return this.sortBy(result, 'timestamp', true);
|
|
4741
4753
|
}
|
|
4742
4754
|
if ('id' in first) {
|
|
4743
|
-
return this.sortBy(result, 'id');
|
|
4755
|
+
return this.sortBy(result, 'id', true);
|
|
4744
4756
|
}
|
|
4745
4757
|
}
|
|
4746
4758
|
return result;
|
package/js/src/base/errors.d.ts
CHANGED
|
@@ -76,7 +76,10 @@ declare class DuplicateOrderId extends InvalidOrder {
|
|
|
76
76
|
declare class NotSupported extends ExchangeError {
|
|
77
77
|
constructor(message: any);
|
|
78
78
|
}
|
|
79
|
-
declare class
|
|
79
|
+
declare class OperationFailed extends BaseError {
|
|
80
|
+
constructor(message: any);
|
|
81
|
+
}
|
|
82
|
+
declare class NetworkError extends OperationFailed {
|
|
80
83
|
constructor(message: any);
|
|
81
84
|
}
|
|
82
85
|
declare class DDoSProtection extends NetworkError {
|
|
@@ -97,9 +100,6 @@ declare class InvalidNonce extends NetworkError {
|
|
|
97
100
|
declare class RequestTimeout extends NetworkError {
|
|
98
101
|
constructor(message: any);
|
|
99
102
|
}
|
|
100
|
-
declare class OperationFailed extends BaseError {
|
|
101
|
-
constructor(message: any);
|
|
102
|
-
}
|
|
103
103
|
declare const errors: {
|
|
104
104
|
BaseError: typeof BaseError;
|
|
105
105
|
ExchangeError: typeof ExchangeError;
|
package/js/src/base/errors.js
CHANGED
|
@@ -192,8 +192,14 @@ class NotSupported extends ExchangeError {
|
|
|
192
192
|
this.name = 'NotSupported';
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
+
class OperationFailed extends BaseError {
|
|
196
|
+
constructor(message) {
|
|
197
|
+
super(message);
|
|
198
|
+
this.name = 'OperationFailed';
|
|
199
|
+
}
|
|
200
|
+
}
|
|
195
201
|
// Network error
|
|
196
|
-
class NetworkError extends
|
|
202
|
+
class NetworkError extends OperationFailed {
|
|
197
203
|
constructor(message) {
|
|
198
204
|
super(message);
|
|
199
205
|
this.name = 'NetworkError';
|
|
@@ -235,12 +241,6 @@ class RequestTimeout extends NetworkError {
|
|
|
235
241
|
this.name = 'RequestTimeout';
|
|
236
242
|
}
|
|
237
243
|
}
|
|
238
|
-
class OperationFailed extends BaseError {
|
|
239
|
-
constructor(message) {
|
|
240
|
-
super(message);
|
|
241
|
-
this.name = 'OperationFailed';
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
244
|
/* ------------------------------------------------------------------------ */
|
|
245
245
|
// export default subclass (
|
|
246
246
|
// // Root class
|
package/js/src/base/ws/Client.js
CHANGED
|
@@ -199,6 +199,7 @@ export default class Client {
|
|
|
199
199
|
this.reset(this.error);
|
|
200
200
|
this.onErrorCallback(this, this.error);
|
|
201
201
|
}
|
|
202
|
+
/* eslint-disable no-shadow */
|
|
202
203
|
onClose(event) {
|
|
203
204
|
if (this.verbose) {
|
|
204
205
|
this.log(new Date(), 'onClose', event);
|
|
@@ -226,6 +227,7 @@ export default class Client {
|
|
|
226
227
|
message = (typeof message === 'string') ? message : JSON.stringify(message);
|
|
227
228
|
const future = createFuture();
|
|
228
229
|
if (isNode) {
|
|
230
|
+
/* eslint-disable no-inner-declarations */
|
|
229
231
|
function onSendComplete(error) {
|
|
230
232
|
if (error) {
|
|
231
233
|
future.reject(error);
|
|
@@ -250,23 +252,20 @@ export default class Client {
|
|
|
250
252
|
// MessageEvent {isTrusted: true, data: "{"e":"depthUpdate","E":1581358737706,"s":"ETHBTC",…"0.06200000"]],"a":[["0.02261300","0.00000000"]]}", origin: "wss://stream.binance.com:9443", lastEventId: "", source: null, …}
|
|
251
253
|
let message = messageEvent.data;
|
|
252
254
|
let arrayBuffer;
|
|
253
|
-
if (
|
|
254
|
-
if (
|
|
255
|
-
arrayBuffer = utf8.decode(message);
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
255
|
+
if (typeof message !== 'string') {
|
|
256
|
+
if (this.gunzip || this.inflate) {
|
|
258
257
|
arrayBuffer = new Uint8Array(message.buffer.slice(message.byteOffset, message.byteOffset + message.byteLength));
|
|
258
|
+
if (this.gunzip) {
|
|
259
|
+
arrayBuffer = gunzipSync(arrayBuffer);
|
|
260
|
+
}
|
|
261
|
+
else if (this.inflate) {
|
|
262
|
+
arrayBuffer = inflateSync(arrayBuffer);
|
|
263
|
+
}
|
|
264
|
+
message = utf8.encode(arrayBuffer);
|
|
259
265
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
else if (this.inflate) {
|
|
264
|
-
arrayBuffer = inflateSync(arrayBuffer);
|
|
266
|
+
else {
|
|
267
|
+
message = message.toString();
|
|
265
268
|
}
|
|
266
|
-
message = utf8.encode(arrayBuffer);
|
|
267
|
-
}
|
|
268
|
-
if (typeof message !== 'string') {
|
|
269
|
-
message = message.toString();
|
|
270
269
|
}
|
|
271
270
|
try {
|
|
272
271
|
if (isJsonEncodedObject(message)) {
|
package/js/src/bigone.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export default class bigone extends Exchange {
|
|
|
22
22
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
23
23
|
parseType(type: string): string;
|
|
24
24
|
parseOrder(order: any, market?: Market): Order;
|
|
25
|
+
createMarketBuyOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
|
|
25
26
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<Order>;
|
|
26
27
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
27
28
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
package/js/src/bigone.js
CHANGED
|
@@ -33,6 +33,8 @@ export default class bigone extends Exchange {
|
|
|
33
33
|
'option': undefined,
|
|
34
34
|
'cancelAllOrders': true,
|
|
35
35
|
'cancelOrder': true,
|
|
36
|
+
'createMarketBuyOrderWithCost': true,
|
|
37
|
+
'createMarketSellOrderWithCost': false,
|
|
36
38
|
'createOrder': true,
|
|
37
39
|
'createPostOnlyOrder': true,
|
|
38
40
|
'createStopLimitOrder': true,
|
|
@@ -1155,6 +1157,20 @@ export default class bigone extends Exchange {
|
|
|
1155
1157
|
'trades': undefined,
|
|
1156
1158
|
}, market);
|
|
1157
1159
|
}
|
|
1160
|
+
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
1161
|
+
/**
|
|
1162
|
+
* @method
|
|
1163
|
+
* @name bigone#createMarketBuyOrderWithCost
|
|
1164
|
+
* @see https://open.big.one/docs/spot_orders.html#create-order
|
|
1165
|
+
* @description create a market buy order by providing the symbol and cost
|
|
1166
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
1167
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
1168
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1169
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1170
|
+
*/
|
|
1171
|
+
params['createMarketBuyOrderRequiresPrice'] = false;
|
|
1172
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
1173
|
+
}
|
|
1158
1174
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1159
1175
|
/**
|
|
1160
1176
|
* @method
|
|
@@ -1182,7 +1198,7 @@ export default class bigone extends Exchange {
|
|
|
1182
1198
|
const requestSide = isBuy ? 'BID' : 'ASK';
|
|
1183
1199
|
let uppercaseType = type.toUpperCase();
|
|
1184
1200
|
const isLimit = uppercaseType === 'LIMIT';
|
|
1185
|
-
const exchangeSpecificParam = this.safeValue(params, 'post_only');
|
|
1201
|
+
const exchangeSpecificParam = this.safeValue(params, 'post_only', false);
|
|
1186
1202
|
let postOnly = undefined;
|
|
1187
1203
|
[postOnly, params] = this.handlePostOnly((uppercaseType === 'MARKET'), exchangeSpecificParam, params);
|
|
1188
1204
|
const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'stop_price']);
|
|
@@ -1206,21 +1222,34 @@ export default class bigone extends Exchange {
|
|
|
1206
1222
|
request['post_only'] = true;
|
|
1207
1223
|
}
|
|
1208
1224
|
}
|
|
1225
|
+
request['amount'] = this.amountToPrecision(symbol, amount);
|
|
1209
1226
|
}
|
|
1210
1227
|
else {
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1228
|
+
if (isBuy) {
|
|
1229
|
+
let createMarketBuyOrderRequiresPrice = true;
|
|
1230
|
+
[createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
|
|
1231
|
+
const cost = this.safeNumber(params, 'cost');
|
|
1232
|
+
params = this.omit(params, 'cost');
|
|
1233
|
+
if (createMarketBuyOrderRequiresPrice) {
|
|
1234
|
+
if ((price === undefined) && (cost === undefined)) {
|
|
1235
|
+
throw new InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
|
|
1236
|
+
}
|
|
1237
|
+
else {
|
|
1238
|
+
const amountString = this.numberToString(amount);
|
|
1239
|
+
const priceString = this.numberToString(price);
|
|
1240
|
+
const quoteAmount = this.parseToNumeric(Precise.stringMul(amountString, priceString));
|
|
1241
|
+
const costRequest = (cost !== undefined) ? cost : quoteAmount;
|
|
1242
|
+
request['amount'] = this.costToPrecision(symbol, costRequest);
|
|
1243
|
+
}
|
|
1215
1244
|
}
|
|
1216
1245
|
else {
|
|
1217
|
-
|
|
1218
|
-
const priceString = this.numberToString(price);
|
|
1219
|
-
amount = this.parseNumber(Precise.stringMul(amountString, priceString));
|
|
1246
|
+
request['amount'] = this.costToPrecision(symbol, amount);
|
|
1220
1247
|
}
|
|
1221
1248
|
}
|
|
1249
|
+
else {
|
|
1250
|
+
request['amount'] = this.amountToPrecision(symbol, amount);
|
|
1251
|
+
}
|
|
1222
1252
|
}
|
|
1223
|
-
request['amount'] = this.amountToPrecision(symbol, amount);
|
|
1224
1253
|
if (triggerPrice !== undefined) {
|
|
1225
1254
|
request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1226
1255
|
request['operator'] = isBuy ? 'GTE' : 'LTE';
|
package/js/src/binance.js
CHANGED
|
@@ -41,6 +41,8 @@ export default class binance extends Exchange {
|
|
|
41
41
|
'cancelAllOrders': true,
|
|
42
42
|
'cancelOrder': true,
|
|
43
43
|
'cancelOrders': true,
|
|
44
|
+
'closeAllPositions': false,
|
|
45
|
+
'closePosition': false,
|
|
44
46
|
'createDepositAddress': false,
|
|
45
47
|
'createOrder': true,
|
|
46
48
|
'createOrders': true,
|
|
@@ -877,6 +879,7 @@ export default class binance extends Exchange {
|
|
|
877
879
|
'uiKlines': 0.4,
|
|
878
880
|
'ticker/24hr': { 'cost': 0.4, 'noSymbol': 16 },
|
|
879
881
|
'ticker': { 'cost': 0.4, 'noSymbol': 16 },
|
|
882
|
+
'ticker/tradingDay': 0.8,
|
|
880
883
|
'ticker/price': { 'cost': 0.4, 'noSymbol': 0.8 },
|
|
881
884
|
'ticker/bookTicker': { 'cost': 0.4, 'noSymbol': 0.8 },
|
|
882
885
|
'exchangeInfo': 4,
|
|
@@ -905,6 +908,7 @@ export default class binance extends Exchange {
|
|
|
905
908
|
'rateLimit/order': 8,
|
|
906
909
|
'myPreventedMatches': 4,
|
|
907
910
|
'myAllocations': 4,
|
|
911
|
+
'account/commission': 4,
|
|
908
912
|
},
|
|
909
913
|
'post': {
|
|
910
914
|
'order/oco': 0.2,
|
package/js/src/binanceus.js
CHANGED
|
@@ -51,6 +51,8 @@ export default class binanceus extends binance {
|
|
|
51
51
|
'option': false,
|
|
52
52
|
'addMargin': false,
|
|
53
53
|
'borrowMargin': false,
|
|
54
|
+
'closeAllPositions': false,
|
|
55
|
+
'closePosition': false,
|
|
54
56
|
'createReduceOnlyOrder': false,
|
|
55
57
|
'fetchBorrowInterest': false,
|
|
56
58
|
'fetchBorrowRate': false,
|
package/js/src/bingx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/bingx.js';
|
|
2
|
-
import { Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency } from './base/types.js';
|
|
2
|
+
import { Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position } from './base/types.js';
|
|
3
3
|
export default class bingx extends Exchange {
|
|
4
4
|
describe(): any;
|
|
5
5
|
fetchTime(params?: {}): Promise<number>;
|
|
@@ -59,8 +59,11 @@ export default class bingx extends Exchange {
|
|
|
59
59
|
parseTicker(ticker: any, market?: Market): Ticker;
|
|
60
60
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
61
61
|
parseBalance(response: any): Balances;
|
|
62
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
63
|
-
parsePosition(position: any, market?: Market):
|
|
62
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
63
|
+
parsePosition(position: any, market?: Market): Position;
|
|
64
|
+
createMarketOrderWithCost(symbol: string, side: OrderSide, cost: any, params?: {}): Promise<Order>;
|
|
65
|
+
createMarketBuyOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
|
|
66
|
+
createMarketSellOrderWithCost(symbol: string, cost: any, params?: {}): Promise<Order>;
|
|
64
67
|
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): any;
|
|
65
68
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<Order>;
|
|
66
69
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
@@ -130,6 +133,7 @@ export default class bingx extends Exchange {
|
|
|
130
133
|
parseParams(params: any): {};
|
|
131
134
|
fetchMyLiquidations(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Liquidation[]>;
|
|
132
135
|
parseLiquidation(liquidation: any, market?: Market): import("./base/types.js").Liquidation;
|
|
136
|
+
closeAllPositions(params?: {}): Promise<Position[]>;
|
|
133
137
|
sign(path: any, section?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
134
138
|
url: any;
|
|
135
139
|
method: string;
|