ccxt 4.1.32 → 4.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/build.sh +5 -2
- package/dist/ccxt.browser.js +237 -132
- package/dist/ccxt.browser.min.js +9 -9
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +4 -1
- package/dist/cjs/src/base/functions/misc.js +6 -0
- package/dist/cjs/src/binance.js +3 -3
- package/dist/cjs/src/bitforex.js +1 -1
- package/dist/cjs/src/bitmex.js +16 -22
- package/dist/cjs/src/digifinex.js +81 -1
- package/dist/cjs/src/krakenfutures.js +2 -2
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/hitbtc.js +4 -6
- package/dist/cjs/src/pro/huobi.js +3 -0
- package/dist/cjs/src/pro/woo.js +5 -2
- package/dist/cjs/src/upbit.js +8 -6
- package/dist/cjs/src/wavesexchange.js +6 -7
- package/dist/cjs/src/woo.js +16 -8
- package/dist/cjs/src/zonda.js +37 -30
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitbay.d.ts +2 -0
- package/js/src/abstract/digifinex.d.ts +14 -0
- package/js/src/abstract/zonda.d.ts +2 -0
- package/js/src/base/Exchange.d.ts +1 -1
- package/js/src/base/Exchange.js +7 -2
- package/js/src/base/errorHierarchy.d.ts +2 -0
- package/js/src/base/errorHierarchy.js +2 -0
- package/js/src/base/functions/misc.js +6 -0
- package/js/src/binance.js +3 -3
- package/js/src/bitforex.js +1 -1
- package/js/src/bitmex.js +16 -22
- package/js/src/digifinex.d.ts +10 -0
- package/js/src/digifinex.js +81 -1
- package/js/src/krakenfutures.js +2 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/coinex.js +1 -1
- package/js/src/pro/hitbtc.js +4 -6
- package/js/src/pro/huobi.js +3 -0
- package/js/src/pro/woo.js +5 -2
- package/js/src/upbit.js +8 -6
- package/js/src/wavesexchange.js +6 -7
- package/js/src/woo.d.ts +1 -0
- package/js/src/woo.js +16 -8
- package/js/src/zonda.js +37 -30
- package/package.json +4 -2
package/js/src/krakenfutures.js
CHANGED
|
@@ -1043,12 +1043,12 @@ export default class krakenfutures extends Exchange {
|
|
|
1043
1043
|
* @name krakenfutures#cancelOrders
|
|
1044
1044
|
* @description cancel multiple orders
|
|
1045
1045
|
* @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
|
|
1046
|
-
* @param {[
|
|
1046
|
+
* @param {string[]} ids order ids
|
|
1047
1047
|
* @param {string} [symbol] unified market symbol
|
|
1048
1048
|
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
1049
1049
|
*
|
|
1050
1050
|
* EXCHANGE SPECIFIC PARAMETERS
|
|
1051
|
-
* @param {[
|
|
1051
|
+
* @param {string[]} [params.clientOrderIds] max length 10 e.g. ["my_id_1","my_id_2"]
|
|
1052
1052
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1053
1053
|
*/
|
|
1054
1054
|
await this.loadMarkets();
|
package/js/src/pro/bitget.js
CHANGED
|
@@ -464,7 +464,7 @@ export default class bitget extends bitgetRest {
|
|
|
464
464
|
const instType = market['spot'] ? 'sp' : 'mc';
|
|
465
465
|
let channel = 'books';
|
|
466
466
|
let incrementalFeed = true;
|
|
467
|
-
if ((limit === 5) || (limit === 15)) {
|
|
467
|
+
if ((limit === 1) || (limit === 5) || (limit === 15)) {
|
|
468
468
|
channel += limit.toString();
|
|
469
469
|
incrementalFeed = false;
|
|
470
470
|
}
|
package/js/src/pro/coinex.js
CHANGED
|
@@ -589,7 +589,7 @@ export default class coinex extends coinexRest {
|
|
|
589
589
|
* @param {int|undefined} limit the maximum amount of candles to fetch
|
|
590
590
|
* @param {object} params extra parameters specific to the coinex api endpoint
|
|
591
591
|
* @param {int|undefined} params.end the end time for spot markets, this.seconds () is set as default
|
|
592
|
-
* @returns {[[
|
|
592
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
593
593
|
*/
|
|
594
594
|
await this.loadMarkets();
|
|
595
595
|
const market = this.market(symbol);
|
package/js/src/pro/hitbtc.js
CHANGED
|
@@ -113,9 +113,8 @@ export default class hitbtc extends hitbtcRest {
|
|
|
113
113
|
* @ignore
|
|
114
114
|
* @method
|
|
115
115
|
* @param {string} name websocket endpoint name
|
|
116
|
-
* @param {[
|
|
116
|
+
* @param {string[]} [symbols] unified CCXT symbol(s)
|
|
117
117
|
* @param {object} [params] extra parameters specific to the hitbtc api
|
|
118
|
-
* @returns
|
|
119
118
|
*/
|
|
120
119
|
await this.loadMarkets();
|
|
121
120
|
const url = this.urls['api']['ws']['public'];
|
|
@@ -138,7 +137,6 @@ export default class hitbtc extends hitbtcRest {
|
|
|
138
137
|
* @param {string} name websocket endpoint name
|
|
139
138
|
* @param {string} [symbol] unified CCXT symbol
|
|
140
139
|
* @param {object} [params] extra parameters specific to the hitbtc api
|
|
141
|
-
* @returns
|
|
142
140
|
*/
|
|
143
141
|
await this.loadMarkets();
|
|
144
142
|
await this.authenticate();
|
|
@@ -592,7 +590,7 @@ export default class hitbtc extends hitbtcRest {
|
|
|
592
590
|
* @param {int} [since] not used by hitbtc watchOHLCV
|
|
593
591
|
* @param {int} [limit] 0 – 1000, default value = 0 (no history returned)
|
|
594
592
|
* @param {object} [params] extra parameters specific to the hitbtc api endpoint
|
|
595
|
-
* @returns {[[
|
|
593
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
596
594
|
*/
|
|
597
595
|
const period = this.safeString(this.timeframes, timeframe, timeframe);
|
|
598
596
|
const name = 'candles/' + period;
|
|
@@ -704,7 +702,7 @@ export default class hitbtc extends hitbtcRest {
|
|
|
704
702
|
* @param {int} [since] timestamp in ms of the earliest order to fetch
|
|
705
703
|
* @param {int} [limit] the maximum amount of orders to fetch
|
|
706
704
|
* @param {object} [params] extra parameters specific to the hitbtc api endpoint
|
|
707
|
-
* @returns {[
|
|
705
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
|
|
708
706
|
*/
|
|
709
707
|
await this.loadMarkets();
|
|
710
708
|
let marketType = undefined;
|
|
@@ -936,7 +934,7 @@ export default class hitbtc extends hitbtcRest {
|
|
|
936
934
|
*
|
|
937
935
|
* EXCHANGE SPECIFIC PARAMETERS
|
|
938
936
|
* @param {string} [params.mode] 'updates' or 'batches' (default), 'updates' = messages arrive after balance updates, 'batches' = messages arrive at equal intervals if there were any updates
|
|
939
|
-
* @returns {[
|
|
937
|
+
* @returns {object[]} a list of [balance structures]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
940
938
|
*/
|
|
941
939
|
await this.loadMarkets();
|
|
942
940
|
let type = undefined;
|
package/js/src/pro/huobi.js
CHANGED
|
@@ -547,6 +547,9 @@ export default class huobi extends huobiRest {
|
|
|
547
547
|
orderbook.reset(snapshot);
|
|
548
548
|
orderbook['nonce'] = seqNum;
|
|
549
549
|
}
|
|
550
|
+
if (prevSeqNum !== undefined && prevSeqNum > orderbook['nonce']) {
|
|
551
|
+
throw new InvalidNonce(this.id + ' watchOrderBook() received a mesage out of order');
|
|
552
|
+
}
|
|
550
553
|
if ((prevSeqNum === undefined || prevSeqNum <= orderbook['nonce']) && (seqNum > orderbook['nonce'])) {
|
|
551
554
|
const asks = this.safeValue(tick, 'asks', []);
|
|
552
555
|
const bids = this.safeValue(tick, 'bids', []);
|
package/js/src/pro/woo.js
CHANGED
|
@@ -667,8 +667,11 @@ export default class woo extends wooRest {
|
|
|
667
667
|
const value = balances[key];
|
|
668
668
|
const code = this.safeCurrencyCode(key);
|
|
669
669
|
const account = (code in this.balance) ? this.balance[code] : this.account();
|
|
670
|
-
|
|
671
|
-
|
|
670
|
+
const total = this.safeString(value, 'holding');
|
|
671
|
+
const used = this.safeString(value, 'frozen');
|
|
672
|
+
account['total'] = total;
|
|
673
|
+
account['used'] = used;
|
|
674
|
+
account['free'] = Precise.stringSub(total, used);
|
|
672
675
|
this.balance[code] = account;
|
|
673
676
|
}
|
|
674
677
|
this.balance = this.safeBalance(this.balance);
|
package/js/src/upbit.js
CHANGED
|
@@ -976,17 +976,19 @@ export default class upbit extends Exchange {
|
|
|
976
976
|
'timeframe': timeframeValue,
|
|
977
977
|
'count': limit,
|
|
978
978
|
};
|
|
979
|
-
let
|
|
979
|
+
let response = undefined;
|
|
980
|
+
if (since !== undefined) {
|
|
981
|
+
// convert `since` to `to` value
|
|
982
|
+
request['to'] = this.iso8601(this.sum(since, timeframePeriod * limit * 1000));
|
|
983
|
+
}
|
|
980
984
|
if (timeframeValue === 'minutes') {
|
|
981
985
|
const numMinutes = Math.round(timeframePeriod / 60);
|
|
982
986
|
request['unit'] = numMinutes;
|
|
983
|
-
|
|
987
|
+
response = await this.publicGetCandlesTimeframeUnit(this.extend(request, params));
|
|
984
988
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
request['to'] = this.iso8601(this.sum(since, timeframePeriod * limit * 1000));
|
|
989
|
+
else {
|
|
990
|
+
response = await this.publicGetCandlesTimeframe(this.extend(request, params));
|
|
988
991
|
}
|
|
989
|
-
const response = await this[method](this.extend(request, params));
|
|
990
992
|
//
|
|
991
993
|
// [
|
|
992
994
|
// {
|
package/js/src/wavesexchange.js
CHANGED
|
@@ -9,7 +9,6 @@ import Exchange from './abstract/wavesexchange.js';
|
|
|
9
9
|
import { ArgumentsRequired, AuthenticationError, InsufficientFunds, InvalidOrder, AccountSuspended, ExchangeError, DuplicateOrderId, OrderNotFound, BadSymbol, ExchangeNotAvailable, BadRequest } from './base/errors.js';
|
|
10
10
|
import { Precise } from './base/Precise.js';
|
|
11
11
|
import { ed25519 } from './static_dependencies/noble-curves/ed25519.js';
|
|
12
|
-
import { axolotl } from './base/functions/crypto.js';
|
|
13
12
|
import { DECIMAL_PLACES } from './base/functions/number.js';
|
|
14
13
|
// ---------------------------------------------------------------------------
|
|
15
14
|
/**
|
|
@@ -755,7 +754,7 @@ export default class wavesexchange extends Exchange {
|
|
|
755
754
|
const messageHex = this.binaryToBase16(this.encode(message));
|
|
756
755
|
const payload = prefix + messageHex;
|
|
757
756
|
const hexKey = this.binaryToBase16(this.base58ToBinary(this.secret));
|
|
758
|
-
const signature = axolotl(payload, hexKey, ed25519);
|
|
757
|
+
const signature = this.axolotl(payload, hexKey, ed25519);
|
|
759
758
|
const request = {
|
|
760
759
|
'grant_type': 'password',
|
|
761
760
|
'scope': 'general',
|
|
@@ -1424,7 +1423,7 @@ export default class wavesexchange extends Exchange {
|
|
|
1424
1423
|
if ((serializedOrder[0] === '"') && (serializedOrder[(serializedOrder.length - 1)] === '"')) {
|
|
1425
1424
|
serializedOrder = serializedOrder.slice(1, serializedOrder.length - 1);
|
|
1426
1425
|
}
|
|
1427
|
-
const signature = axolotl(this.binaryToBase16(this.base58ToBinary(serializedOrder)), this.binaryToBase16(this.base58ToBinary(this.secret)), ed25519);
|
|
1426
|
+
const signature = this.axolotl(this.binaryToBase16(this.base58ToBinary(serializedOrder)), this.binaryToBase16(this.base58ToBinary(this.secret)), ed25519);
|
|
1428
1427
|
body['signature'] = signature;
|
|
1429
1428
|
//
|
|
1430
1429
|
// {
|
|
@@ -1539,7 +1538,7 @@ export default class wavesexchange extends Exchange {
|
|
|
1539
1538
|
];
|
|
1540
1539
|
const binary = this.binaryConcatArray(byteArray);
|
|
1541
1540
|
const hexSecret = this.binaryToBase16(this.base58ToBinary(this.secret));
|
|
1542
|
-
const signature = axolotl(this.binaryToBase16(binary), hexSecret, ed25519);
|
|
1541
|
+
const signature = this.axolotl(this.binaryToBase16(binary), hexSecret, ed25519);
|
|
1543
1542
|
const request = {
|
|
1544
1543
|
'Timestamp': timestamp.toString(),
|
|
1545
1544
|
'Signature': signature,
|
|
@@ -1574,7 +1573,7 @@ export default class wavesexchange extends Exchange {
|
|
|
1574
1573
|
];
|
|
1575
1574
|
const binary = this.binaryConcatArray(byteArray);
|
|
1576
1575
|
const hexSecret = this.binaryToBase16(this.base58ToBinary(this.secret));
|
|
1577
|
-
const signature = axolotl(this.binaryToBase16(binary), hexSecret, ed25519);
|
|
1576
|
+
const signature = this.axolotl(this.binaryToBase16(binary), hexSecret, ed25519);
|
|
1578
1577
|
const request = {
|
|
1579
1578
|
'Accept': 'application/json',
|
|
1580
1579
|
'Timestamp': timestamp.toString(),
|
|
@@ -1938,7 +1937,7 @@ export default class wavesexchange extends Exchange {
|
|
|
1938
1937
|
];
|
|
1939
1938
|
const binary = this.binaryConcatArray(byteArray);
|
|
1940
1939
|
const hexSecret = this.binaryToBase16(this.base58ToBinary(this.secret));
|
|
1941
|
-
const signature = axolotl(this.binaryToBase16(binary), hexSecret, ed25519);
|
|
1940
|
+
const signature = this.axolotl(this.binaryToBase16(binary), hexSecret, ed25519);
|
|
1942
1941
|
const matcherRequest = {
|
|
1943
1942
|
'publicKey': this.apiKey,
|
|
1944
1943
|
'signature': signature,
|
|
@@ -2536,7 +2535,7 @@ export default class wavesexchange extends Exchange {
|
|
|
2536
2535
|
];
|
|
2537
2536
|
const binary = this.binaryConcatArray(byteArray);
|
|
2538
2537
|
const hexSecret = this.binaryToBase16(this.base58ToBinary(this.secret));
|
|
2539
|
-
const signature = axolotl(this.binaryToBase16(binary), hexSecret, ed25519);
|
|
2538
|
+
const signature = this.axolotl(this.binaryToBase16(binary), hexSecret, ed25519);
|
|
2540
2539
|
const request = {
|
|
2541
2540
|
'senderPublicKey': this.apiKey,
|
|
2542
2541
|
'amount': amountInteger,
|
package/js/src/woo.d.ts
CHANGED
|
@@ -210,4 +210,5 @@ export default class woo extends Exchange {
|
|
|
210
210
|
fetchPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
211
211
|
parsePosition(position: any, market?: any): import("./base/types.js").Position;
|
|
212
212
|
defaultNetworkCodeForCurrency(code: any): any;
|
|
213
|
+
setSandboxMode(enable: any): void;
|
|
213
214
|
}
|
package/js/src/woo.js
CHANGED
|
@@ -246,6 +246,7 @@ export default class woo extends Exchange {
|
|
|
246
246
|
},
|
|
247
247
|
},
|
|
248
248
|
'options': {
|
|
249
|
+
'sandboxMode': false,
|
|
249
250
|
'createMarketBuyOrderRequiresPrice': true,
|
|
250
251
|
// these network aliases require manual mapping here
|
|
251
252
|
'network-aliases-for-tokens': {
|
|
@@ -2152,14 +2153,17 @@ export default class woo extends Exchange {
|
|
|
2152
2153
|
else {
|
|
2153
2154
|
this.checkRequiredCredentials();
|
|
2154
2155
|
if (method === 'POST' && (path === 'algo/order' || path === 'order')) {
|
|
2155
|
-
const
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2156
|
+
const isSandboxMode = this.safeValue(this.options, 'sandboxMode', false);
|
|
2157
|
+
if (!isSandboxMode) {
|
|
2158
|
+
const applicationId = 'bc830de7-50f3-460b-9ee0-f430f83f9dad';
|
|
2159
|
+
const brokerId = this.safeString(this.options, 'brokerId', applicationId);
|
|
2160
|
+
const isStop = path.indexOf('algo') > -1;
|
|
2161
|
+
if (isStop) {
|
|
2162
|
+
params['brokerId'] = brokerId;
|
|
2163
|
+
}
|
|
2164
|
+
else {
|
|
2165
|
+
params['broker_id'] = brokerId;
|
|
2166
|
+
}
|
|
2163
2167
|
}
|
|
2164
2168
|
params = this.keysort(params);
|
|
2165
2169
|
}
|
|
@@ -2615,4 +2619,8 @@ export default class woo extends Exchange {
|
|
|
2615
2619
|
// if it was not returned according to above options, then return the first network of currency
|
|
2616
2620
|
return this.safeValue(networkKeys, 0);
|
|
2617
2621
|
}
|
|
2622
|
+
setSandboxMode(enable) {
|
|
2623
|
+
super.setSandboxMode(enable);
|
|
2624
|
+
this.options['sandboxMode'] = enable;
|
|
2625
|
+
}
|
|
2618
2626
|
}
|
package/js/src/zonda.js
CHANGED
|
@@ -104,7 +104,7 @@ export default class zonda extends Exchange {
|
|
|
104
104
|
'3d': '259200',
|
|
105
105
|
'1w': '604800',
|
|
106
106
|
},
|
|
107
|
-
'hostname': '
|
|
107
|
+
'hostname': 'zondacrypto.exchange',
|
|
108
108
|
'urls': {
|
|
109
109
|
'referral': 'https://auth.zondaglobal.com/ref/jHlbB4mIkdS1',
|
|
110
110
|
'logo': 'https://user-images.githubusercontent.com/1294454/159202310-a0e38007-5e7c-4ba9-a32f-c8263a0291fe.jpg',
|
|
@@ -116,7 +116,7 @@ export default class zonda extends Exchange {
|
|
|
116
116
|
'v1_01Private': 'https://api.{hostname}/rest',
|
|
117
117
|
},
|
|
118
118
|
'doc': [
|
|
119
|
-
'https://docs.
|
|
119
|
+
'https://docs.zondacrypto.exchange/',
|
|
120
120
|
'https://github.com/BitBayNet/API',
|
|
121
121
|
],
|
|
122
122
|
'support': 'https://zondaglobal.com/en/helpdesk/zonda-exchange',
|
|
@@ -177,6 +177,8 @@ export default class zonda extends Exchange {
|
|
|
177
177
|
'balances/BITBAY/balance',
|
|
178
178
|
'balances/BITBAY/balance/transfer/{source}/{destination}',
|
|
179
179
|
'fiat_cantor/exchange',
|
|
180
|
+
'api_payments/withdrawals/crypto',
|
|
181
|
+
'api_payments/withdrawals/fiat',
|
|
180
182
|
],
|
|
181
183
|
'delete': [
|
|
182
184
|
'trading/offer/{symbol}/{id}/{side}/{price}',
|
|
@@ -285,6 +287,10 @@ export default class zonda extends Exchange {
|
|
|
285
287
|
'REQUEST_TIMESTAMP_TOO_OLD': InvalidNonce,
|
|
286
288
|
'PERMISSIONS_NOT_SUFFICIENT': PermissionDenied,
|
|
287
289
|
'INVALID_STOP_RATE': InvalidOrder,
|
|
290
|
+
'TIMEOUT': ExchangeError,
|
|
291
|
+
'RESPONSE_TIMEOUT': ExchangeError,
|
|
292
|
+
'ACTION_BLOCKED': PermissionDenied,
|
|
293
|
+
'INVALID_HASH_SIGNATURE': AuthenticationError,
|
|
288
294
|
},
|
|
289
295
|
'commonCurrencies': {
|
|
290
296
|
'GGC': 'Global Game Coin',
|
|
@@ -295,7 +301,7 @@ export default class zonda extends Exchange {
|
|
|
295
301
|
/**
|
|
296
302
|
* @method
|
|
297
303
|
* @name zonda#fetchMarkets
|
|
298
|
-
* @see https://docs.
|
|
304
|
+
* @see https://docs.zondacrypto.exchange/reference/ticker-1
|
|
299
305
|
* @description retrieves data on all markets for zonda
|
|
300
306
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
301
307
|
* @returns {object[]} an array of objects representing market data
|
|
@@ -398,7 +404,7 @@ export default class zonda extends Exchange {
|
|
|
398
404
|
/**
|
|
399
405
|
* @method
|
|
400
406
|
* @name zonda#fetchOpenOrders
|
|
401
|
-
* @see https://docs.
|
|
407
|
+
* @see https://docs.zondacrypto.exchange/reference/active-orders
|
|
402
408
|
* @description fetch all unfilled currently open orders
|
|
403
409
|
* @param {string} symbol not used by zonda fetchOpenOrders
|
|
404
410
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
@@ -466,7 +472,7 @@ export default class zonda extends Exchange {
|
|
|
466
472
|
/**
|
|
467
473
|
* @method
|
|
468
474
|
* @name zonda#fetchMyTrades
|
|
469
|
-
* @see https://docs.
|
|
475
|
+
* @see https://docs.zondacrypto.exchange/reference/transactions-history
|
|
470
476
|
* @description fetch all trades made by the user
|
|
471
477
|
* @param {string} symbol unified market symbol
|
|
472
478
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -531,7 +537,7 @@ export default class zonda extends Exchange {
|
|
|
531
537
|
/**
|
|
532
538
|
* @method
|
|
533
539
|
* @name zonda#fetchBalance
|
|
534
|
-
* @see https://docs.
|
|
540
|
+
* @see https://docs.zondacrypto.exchange/reference/list-of-wallets
|
|
535
541
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
536
542
|
* @param {object} [params] extra parameters specific to the zonda api endpoint
|
|
537
543
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
@@ -544,7 +550,7 @@ export default class zonda extends Exchange {
|
|
|
544
550
|
/**
|
|
545
551
|
* @method
|
|
546
552
|
* @name zonda#fetchOrderBook
|
|
547
|
-
* @see https://docs.
|
|
553
|
+
* @see https://docs.zondacrypto.exchange/reference/orderbook-2
|
|
548
554
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
549
555
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
550
556
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
@@ -657,7 +663,7 @@ export default class zonda extends Exchange {
|
|
|
657
663
|
* @method
|
|
658
664
|
* @name zonda#fetchTicker
|
|
659
665
|
* @description v1_01PublicGetTradingTickerSymbol retrieves timestamp, datetime, bid, ask, close, last, previousClose, v1_01PublicGetTradingStatsSymbol retrieves high, low, volume and opening price of an asset
|
|
660
|
-
* @see https://docs.
|
|
666
|
+
* @see https://docs.zondacrypto.exchange/reference/market-statistics
|
|
661
667
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
662
668
|
* @param {object} [params] extra parameters specific to the zonda api endpoint
|
|
663
669
|
* @param {string} [params.method] v1_01PublicGetTradingTickerSymbol (default) or v1_01PublicGetTradingStatsSymbol
|
|
@@ -730,7 +736,7 @@ export default class zonda extends Exchange {
|
|
|
730
736
|
* @method
|
|
731
737
|
* @name zonda#fetchTickersV2
|
|
732
738
|
* @description v1_01PublicGetTradingTicker retrieves timestamp, datetime, bid, ask, close, last, previousClose for each market, v1_01PublicGetTradingStats retrieves high, low, volume and opening price of each market
|
|
733
|
-
* @see https://docs.
|
|
739
|
+
* @see https://docs.zondacrypto.exchange/reference/market-statistics
|
|
734
740
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
735
741
|
* @param {object} [params] extra parameters specific to the zonda api endpoint
|
|
736
742
|
* @param {string} [params.method] v1_01PublicGetTradingTicker (default) or v1_01PublicGetTradingStats
|
|
@@ -803,7 +809,7 @@ export default class zonda extends Exchange {
|
|
|
803
809
|
/**
|
|
804
810
|
* @method
|
|
805
811
|
* @name zonda#fetchLedger
|
|
806
|
-
* @see https://docs.
|
|
812
|
+
* @see https://docs.zondacrypto.exchange/reference/operations-history
|
|
807
813
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
808
814
|
* @param {string} code unified currency code, default is undefined
|
|
809
815
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
@@ -1177,7 +1183,7 @@ export default class zonda extends Exchange {
|
|
|
1177
1183
|
/**
|
|
1178
1184
|
* @method
|
|
1179
1185
|
* @name zonda#fetchOHLCV
|
|
1180
|
-
* @see https://docs.
|
|
1186
|
+
* @see https://docs.zondacrypto.exchange/reference/candles-chart
|
|
1181
1187
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1182
1188
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1183
1189
|
* @param {string} timeframe the length of time each candle represents
|
|
@@ -1303,7 +1309,7 @@ export default class zonda extends Exchange {
|
|
|
1303
1309
|
/**
|
|
1304
1310
|
* @method
|
|
1305
1311
|
* @name zonda#fetchTrades
|
|
1306
|
-
* @see https://docs.
|
|
1312
|
+
* @see https://docs.zondacrypto.exchange/reference/last-transactions
|
|
1307
1313
|
* @description get the list of most recent trades for a particular symbol
|
|
1308
1314
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1309
1315
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
@@ -1356,7 +1362,6 @@ export default class zonda extends Exchange {
|
|
|
1356
1362
|
const isStopLimit = (type === 'stop-limit') || (isLimitOrder && isStopLossPrice);
|
|
1357
1363
|
const isStopMarket = type === 'stop-market' || (isMarketOrder && isStopLossPrice);
|
|
1358
1364
|
const isStopOrder = isStopLimit || isStopMarket;
|
|
1359
|
-
const method = isStopOrder ? 'v1_01PrivatePostTradingStopOfferSymbol' : 'v1_01PrivatePostTradingOfferSymbol';
|
|
1360
1365
|
if (isLimitOrder || isStopLimit) {
|
|
1361
1366
|
request['rate'] = this.priceToPrecision(symbol, price);
|
|
1362
1367
|
request['mode'] = isStopLimit ? 'stop-limit' : 'limit';
|
|
@@ -1367,14 +1372,18 @@ export default class zonda extends Exchange {
|
|
|
1367
1372
|
else {
|
|
1368
1373
|
throw new ExchangeError(this.id + ' createOrder() invalid type');
|
|
1369
1374
|
}
|
|
1375
|
+
params = this.omit(params, ['stopPrice', 'stopLossPrice']);
|
|
1376
|
+
let response = undefined;
|
|
1370
1377
|
if (isStopOrder) {
|
|
1371
1378
|
if (!isStopLossPrice) {
|
|
1372
1379
|
throw new ExchangeError(this.id + ' createOrder() zonda requires `triggerPrice` or `stopPrice` parameter for stop-limit or stop-market orders');
|
|
1373
1380
|
}
|
|
1374
1381
|
request['stopRate'] = this.priceToPrecision(symbol, stopLossPrice);
|
|
1382
|
+
response = await this.v1_01PrivatePostTradingStopOfferSymbol(this.extend(request, params));
|
|
1383
|
+
}
|
|
1384
|
+
else {
|
|
1385
|
+
response = await this.v1_01PrivatePostTradingOfferSymbol(this.extend(request, params));
|
|
1375
1386
|
}
|
|
1376
|
-
params = this.omit(params, ['stopPrice', 'stopLossPrice']);
|
|
1377
|
-
const response = await this[method](this.extend(request, params));
|
|
1378
1387
|
//
|
|
1379
1388
|
// unfilled (open order)
|
|
1380
1389
|
//
|
|
@@ -1458,7 +1467,7 @@ export default class zonda extends Exchange {
|
|
|
1458
1467
|
/**
|
|
1459
1468
|
* @method
|
|
1460
1469
|
* @name zonda#cancelOrder
|
|
1461
|
-
* @see https://docs.
|
|
1470
|
+
* @see https://docs.zondacrypto.exchange/reference/cancel-order
|
|
1462
1471
|
* @description cancels an open order
|
|
1463
1472
|
* @param {string} id order id
|
|
1464
1473
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
@@ -1519,7 +1528,7 @@ export default class zonda extends Exchange {
|
|
|
1519
1528
|
/**
|
|
1520
1529
|
* @method
|
|
1521
1530
|
* @name zonda#fetchDepositAddress
|
|
1522
|
-
* @see https://docs.
|
|
1531
|
+
* @see https://docs.zondacrypto.exchange/reference/deposit-addresses-for-crypto
|
|
1523
1532
|
* @description fetch the deposit address for a currency associated with this account
|
|
1524
1533
|
* @param {string} code unified currency code
|
|
1525
1534
|
* @param {object} [params] extra parameters specific to the zonda api endpoint
|
|
@@ -1553,7 +1562,7 @@ export default class zonda extends Exchange {
|
|
|
1553
1562
|
/**
|
|
1554
1563
|
* @method
|
|
1555
1564
|
* @name zonda#fetchDepositAddresses
|
|
1556
|
-
* @see https://docs.
|
|
1565
|
+
* @see https://docs.zondacrypto.exchange/reference/deposit-addresses-for-crypto
|
|
1557
1566
|
* @description fetch deposit addresses for multiple currencies and chain types
|
|
1558
1567
|
* @param {string[]|undefined} codes zonda does not support filtering filtering by multiple codes and will ignore this parameter.
|
|
1559
1568
|
* @param {object} [params] extra parameters specific to the zonda api endpoint
|
|
@@ -1581,7 +1590,7 @@ export default class zonda extends Exchange {
|
|
|
1581
1590
|
/**
|
|
1582
1591
|
* @method
|
|
1583
1592
|
* @name zonda#transfer
|
|
1584
|
-
* @see https://docs.
|
|
1593
|
+
* @see https://docs.zondacrypto.exchange/reference/internal-transfer
|
|
1585
1594
|
* @description transfer currency internally between wallets on the same account
|
|
1586
1595
|
* @param {string} code unified currency code
|
|
1587
1596
|
* @param {float} amount amount to transfer
|
|
@@ -1693,7 +1702,7 @@ export default class zonda extends Exchange {
|
|
|
1693
1702
|
/**
|
|
1694
1703
|
* @method
|
|
1695
1704
|
* @name zonda#withdraw
|
|
1696
|
-
* @see https://docs.
|
|
1705
|
+
* @see https://docs.zondacrypto.exchange/reference/crypto-withdrawal-1
|
|
1697
1706
|
* @description make a withdrawal
|
|
1698
1707
|
* @param {string} code unified currency code
|
|
1699
1708
|
* @param {float} amount the amount to withdraw
|
|
@@ -1705,26 +1714,24 @@ export default class zonda extends Exchange {
|
|
|
1705
1714
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
1706
1715
|
this.checkAddress(address);
|
|
1707
1716
|
await this.loadMarkets();
|
|
1708
|
-
let
|
|
1717
|
+
let response = undefined;
|
|
1709
1718
|
const currency = this.currency(code);
|
|
1710
1719
|
const request = {
|
|
1711
1720
|
'currency': currency['id'],
|
|
1712
|
-
'
|
|
1721
|
+
'amount': amount,
|
|
1722
|
+
'address': address,
|
|
1723
|
+
// request['balanceId'] = params['balanceId']; // Wallet id used for withdrawal. If not provided, any BITBAY wallet with sufficient funds is used. If BITBAYPAY wallet should be used parameter must be explicitly specified.
|
|
1713
1724
|
};
|
|
1714
1725
|
if (this.isFiat(code)) {
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
// request['express'] = params['express']; // whatever it means, they don't explain
|
|
1718
|
-
// request['bic'] = '';
|
|
1726
|
+
// request['swift'] = params['swift']; // Bank identifier, if required.
|
|
1727
|
+
response = await this.v1_01PrivatePostApiPaymentsWithdrawalsFiat(this.extend(request, params));
|
|
1719
1728
|
}
|
|
1720
1729
|
else {
|
|
1721
|
-
method = 'privatePostTransfer';
|
|
1722
1730
|
if (tag !== undefined) {
|
|
1723
|
-
|
|
1731
|
+
request['tag'] = tag;
|
|
1724
1732
|
}
|
|
1725
|
-
|
|
1733
|
+
response = await this.v1_01PrivatePostApiPaymentsWithdrawalsCrypto(this.extend(request, params));
|
|
1726
1734
|
}
|
|
1727
|
-
const response = await this[method](this.extend(request, params));
|
|
1728
1735
|
//
|
|
1729
1736
|
// {
|
|
1730
1737
|
// "status": "Ok",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccxt",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.34",
|
|
4
4
|
"description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 130+ exchanges",
|
|
5
5
|
"unpkg": "dist/ccxt.browser.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"docker": "docker-compose run --rm ccxt",
|
|
26
26
|
"fixTSBug": "node build/fixTSBug",
|
|
27
27
|
"build-docs": "node jsdoc2md.js",
|
|
28
|
+
"serve-docs": "docsify serve ./wiki",
|
|
28
29
|
"tsBuild": "tsc || true",
|
|
29
30
|
"tsBuildExamples": "tsc -p ./examples/tsconfig.json",
|
|
30
31
|
"emitAPI": "node build/generateImplicitAPI.js",
|
|
31
|
-
"build": "npm run pre-transpile && npm run transpile && npm run post-transpile && npm run update-badges",
|
|
32
|
+
"build": "npm run pre-transpile && npm run transpile && npm run post-transpile && npm run update-badges && npm run build-docs",
|
|
32
33
|
"force-build": "npm run pre-transpile && npm run force-transpile-fast && npm run post-transpile && npm run update-badges",
|
|
33
34
|
"force-build-slow": "npm run pre-transpile && npm run force-transpile && npm run post-transpile && npm run update-badges",
|
|
34
35
|
"pre-transpile": "npm run export-exchanges && npm run vss && npm run tsBuild && npm run emitAPI && npm run validate-types && npm run tsBuildExamples && npm run copy-python-files && npm run check-js-syntax && npm run bundle",
|
|
@@ -112,6 +113,7 @@
|
|
|
112
113
|
"asciichart": "^1.5.25",
|
|
113
114
|
"assert": "^2.0.0",
|
|
114
115
|
"ast-transpiler": "^0.0.24",
|
|
116
|
+
"docsify": "^4.13.1",
|
|
115
117
|
"eslint": "^8.8.0",
|
|
116
118
|
"eslint-config-airbnb-base": "15.0.0",
|
|
117
119
|
"eslint-plugin-import": "2.25.4",
|