ccxt 4.2.46 → 4.2.48
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/CHANGELOG.md +2307 -0
- package/README.md +3 -3
- package/change.sh +1 -1
- package/dist/ccxt.browser.js +747 -60
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +3 -1
- package/dist/cjs/src/bybit.js +185 -2
- package/dist/cjs/src/coinsph.js +32 -1
- package/dist/cjs/src/currencycom.js +22 -0
- package/dist/cjs/src/deribit.js +34 -1
- package/dist/cjs/src/exmo.js +22 -0
- package/dist/cjs/src/gemini.js +15 -0
- package/dist/cjs/src/hollaex.js +27 -1
- package/dist/cjs/src/idex.js +52 -1
- package/dist/cjs/src/indodax.js +226 -20
- package/dist/cjs/src/okx.js +32 -5
- package/dist/cjs/src/pro/hitbtc.js +6 -11
- package/dist/cjs/src/upbit.js +90 -16
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/hollaex.d.ts +3 -0
- package/js/src/abstract/indodax.d.ts +9 -8
- package/js/src/binance.js +3 -1
- package/js/src/bybit.d.ts +2 -0
- package/js/src/bybit.js +185 -2
- package/js/src/coinsph.js +32 -1
- package/js/src/currencycom.js +22 -0
- package/js/src/deribit.js +34 -1
- package/js/src/exmo.js +22 -0
- package/js/src/gemini.js +15 -0
- package/js/src/hollaex.js +27 -1
- package/js/src/idex.d.ts +7 -0
- package/js/src/idex.js +52 -1
- package/js/src/indodax.d.ts +6 -1
- package/js/src/indodax.js +226 -20
- package/js/src/okx.js +32 -5
- package/js/src/pro/hitbtc.js +6 -11
- package/js/src/upbit.d.ts +2 -0
- package/js/src/upbit.js +90 -16
- package/package.json +1 -1
- package/skip-tests.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -177,7 +177,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
177
177
|
|
|
178
178
|
//-----------------------------------------------------------------------------
|
|
179
179
|
// this is updated by vss.js when building
|
|
180
|
-
const version = '4.2.
|
|
180
|
+
const version = '4.2.48';
|
|
181
181
|
Exchange["default"].ccxtVersion = version;
|
|
182
182
|
const exchanges = {
|
|
183
183
|
'ace': ace,
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -5771,12 +5771,14 @@ class binance extends binance$1 {
|
|
|
5771
5771
|
const trailingDelta = this.safeString(params, 'trailingDelta');
|
|
5772
5772
|
const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activationPrice', this.numberToString(price));
|
|
5773
5773
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRate');
|
|
5774
|
+
const priceMatch = this.safeString(params, 'priceMatch');
|
|
5774
5775
|
const isTrailingPercentOrder = trailingPercent !== undefined;
|
|
5775
5776
|
const isStopLoss = stopLossPrice !== undefined || trailingDelta !== undefined;
|
|
5776
5777
|
const isTakeProfit = takeProfitPrice !== undefined;
|
|
5777
5778
|
const isTriggerOrder = triggerPrice !== undefined;
|
|
5778
5779
|
const isConditional = isTriggerOrder || isTrailingPercentOrder || isStopLoss || isTakeProfit;
|
|
5779
5780
|
const isPortfolioMarginConditional = (isPortfolioMargin && isConditional);
|
|
5781
|
+
const isPriceMatch = priceMatch !== undefined;
|
|
5780
5782
|
let uppercaseType = type.toUpperCase();
|
|
5781
5783
|
let stopPrice = undefined;
|
|
5782
5784
|
if (isTrailingPercentOrder) {
|
|
@@ -5957,7 +5959,7 @@ class binance extends binance$1 {
|
|
|
5957
5959
|
request['quantity'] = this.amountToPrecision(symbol, amount);
|
|
5958
5960
|
}
|
|
5959
5961
|
}
|
|
5960
|
-
if (priceIsRequired) {
|
|
5962
|
+
if (priceIsRequired && !isPriceMatch) {
|
|
5961
5963
|
if (price === undefined) {
|
|
5962
5964
|
throw new errors.InvalidOrder(this.id + ' createOrder() requires a price argument for a ' + type + ' order');
|
|
5963
5965
|
}
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -4479,11 +4479,194 @@ class bybit extends bybit$1 {
|
|
|
4479
4479
|
const data = this.safeValue(result, 'dataList', []);
|
|
4480
4480
|
return this.parseOrders(data, market, since, limit);
|
|
4481
4481
|
}
|
|
4482
|
+
async fetchOrderClassic(id, symbol = undefined, params = {}) {
|
|
4483
|
+
/**
|
|
4484
|
+
* @method
|
|
4485
|
+
* @name bybit#fetchOrderClassic
|
|
4486
|
+
* @description fetches information on an order made by the user *classic accounts only*
|
|
4487
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4488
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4489
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4490
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4491
|
+
*/
|
|
4492
|
+
if (symbol === undefined) {
|
|
4493
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
4494
|
+
}
|
|
4495
|
+
await this.loadMarkets();
|
|
4496
|
+
const market = this.market(symbol);
|
|
4497
|
+
if (market['spot']) {
|
|
4498
|
+
throw new errors.NotSupported(this.id + ' fetchOrder() is not supported for spot markets');
|
|
4499
|
+
}
|
|
4500
|
+
const request = {
|
|
4501
|
+
'orderId': id,
|
|
4502
|
+
};
|
|
4503
|
+
const result = await this.fetchOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
4504
|
+
const length = result.length;
|
|
4505
|
+
if (length === 0) {
|
|
4506
|
+
const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
4507
|
+
const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
|
|
4508
|
+
throw new errors.OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
|
|
4509
|
+
}
|
|
4510
|
+
if (length > 1) {
|
|
4511
|
+
throw new errors.InvalidOrder(this.id + ' returned more than one order');
|
|
4512
|
+
}
|
|
4513
|
+
return this.safeValue(result, 0);
|
|
4514
|
+
}
|
|
4482
4515
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
4483
|
-
|
|
4516
|
+
/**
|
|
4517
|
+
* @method
|
|
4518
|
+
* @name bybit#fetchOrderClassic
|
|
4519
|
+
* @description *classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
|
|
4520
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4521
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4522
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4523
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4524
|
+
*/
|
|
4525
|
+
const res = await this.isUnifiedEnabled();
|
|
4526
|
+
const enableUnifiedAccount = this.safeBool(res, 1);
|
|
4527
|
+
if (enableUnifiedAccount) {
|
|
4528
|
+
throw new errors.NotSupported(this.id + ' fetchOrder() is not supported after the 5/02 update for UTA accounts, please use fetchOpenOrder or fetchClosedOrder');
|
|
4529
|
+
}
|
|
4530
|
+
return await this.fetchOrderClassic(id, symbol, params);
|
|
4484
4531
|
}
|
|
4485
4532
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4486
|
-
|
|
4533
|
+
const res = await this.isUnifiedEnabled();
|
|
4534
|
+
/**
|
|
4535
|
+
* @method
|
|
4536
|
+
* @name bybit#fetchOrders
|
|
4537
|
+
* @description *classic accounts only/ spot not supported* fetches information on multiple orders made by the user *classic accounts only/ spot not supported*
|
|
4538
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4539
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4540
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4541
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4542
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4543
|
+
* @param {boolean} [params.stop] true if stop order
|
|
4544
|
+
* @param {string} [params.type] market type, ['swap', 'option']
|
|
4545
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4546
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4547
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4548
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4549
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4550
|
+
*/
|
|
4551
|
+
const enableUnifiedAccount = this.safeBool(res, 1);
|
|
4552
|
+
if (enableUnifiedAccount) {
|
|
4553
|
+
throw new errors.NotSupported(this.id + ' fetchOrders() is not supported after the 5/02 update for UTA accounts, please use fetchOpenOrders, fetchClosedOrders or fetchCanceledOrders');
|
|
4554
|
+
}
|
|
4555
|
+
return await this.fetchOrdersClassic(symbol, since, limit, params);
|
|
4556
|
+
}
|
|
4557
|
+
async fetchOrdersClassic(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4558
|
+
/**
|
|
4559
|
+
* @method
|
|
4560
|
+
* @name bybit#fetchOrders
|
|
4561
|
+
* @description fetches information on multiple orders made by the user *classic accounts only*
|
|
4562
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4563
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4564
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4565
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4566
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4567
|
+
* @param {boolean} [params.stop] true if stop order
|
|
4568
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4569
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4570
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4571
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4572
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4573
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4574
|
+
*/
|
|
4575
|
+
await this.loadMarkets();
|
|
4576
|
+
let paginate = false;
|
|
4577
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
|
|
4578
|
+
if (paginate) {
|
|
4579
|
+
return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
|
|
4580
|
+
}
|
|
4581
|
+
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4582
|
+
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
4583
|
+
const request = {};
|
|
4584
|
+
let market = undefined;
|
|
4585
|
+
let isUsdcSettled = false;
|
|
4586
|
+
if (symbol !== undefined) {
|
|
4587
|
+
market = this.market(symbol);
|
|
4588
|
+
isUsdcSettled = market['settle'] === 'USDC';
|
|
4589
|
+
request['symbol'] = market['id'];
|
|
4590
|
+
}
|
|
4591
|
+
let type = undefined;
|
|
4592
|
+
[type, params] = this.getBybitType('fetchOrders', market, params);
|
|
4593
|
+
if (((type === 'option') || isUsdcSettled) && !isUnifiedAccount) {
|
|
4594
|
+
return await this.fetchUsdcOrders(symbol, since, limit, params);
|
|
4595
|
+
}
|
|
4596
|
+
if (type === 'spot') {
|
|
4597
|
+
throw new errors.NotSupported(this.id + ' fetchOrders() is not supported for spot markets');
|
|
4598
|
+
}
|
|
4599
|
+
request['category'] = type;
|
|
4600
|
+
const isStop = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
4601
|
+
params = this.omit(params, ['trigger', 'stop']);
|
|
4602
|
+
if (isStop) {
|
|
4603
|
+
request['orderFilter'] = 'StopOrder';
|
|
4604
|
+
}
|
|
4605
|
+
if (limit !== undefined) {
|
|
4606
|
+
request['limit'] = limit;
|
|
4607
|
+
}
|
|
4608
|
+
if (since !== undefined) {
|
|
4609
|
+
request['startTime'] = since;
|
|
4610
|
+
}
|
|
4611
|
+
const until = this.safeInteger2(params, 'until', 'till'); // unified in milliseconds
|
|
4612
|
+
const endTime = this.safeInteger(params, 'endTime', until); // exchange-specific in milliseconds
|
|
4613
|
+
params = this.omit(params, ['endTime', 'till', 'until']);
|
|
4614
|
+
if (endTime !== undefined) {
|
|
4615
|
+
request['endTime'] = endTime;
|
|
4616
|
+
}
|
|
4617
|
+
const response = await this.privateGetV5OrderHistory(this.extend(request, params));
|
|
4618
|
+
//
|
|
4619
|
+
// {
|
|
4620
|
+
// "retCode": 0,
|
|
4621
|
+
// "retMsg": "OK",
|
|
4622
|
+
// "result": {
|
|
4623
|
+
// "nextPageCursor": "03234de9-1332-41eb-b805-4a9f42c136a3%3A1672220109387%2C03234de9-1332-41eb-b805-4a9f42c136a3%3A1672220109387",
|
|
4624
|
+
// "category": "linear",
|
|
4625
|
+
// "list": [
|
|
4626
|
+
// {
|
|
4627
|
+
// "symbol": "BTCUSDT",
|
|
4628
|
+
// "orderType": "Limit",
|
|
4629
|
+
// "orderLinkId": "test-001",
|
|
4630
|
+
// "orderId": "03234de9-1332-41eb-b805-4a9f42c136a3",
|
|
4631
|
+
// "cancelType": "CancelByUser",
|
|
4632
|
+
// "avgPrice": "0",
|
|
4633
|
+
// "stopOrderType": "UNKNOWN",
|
|
4634
|
+
// "lastPriceOnCreated": "16656.5",
|
|
4635
|
+
// "orderStatus": "Cancelled",
|
|
4636
|
+
// "takeProfit": "",
|
|
4637
|
+
// "cumExecValue": "0",
|
|
4638
|
+
// "triggerDirection": 0,
|
|
4639
|
+
// "blockTradeId": "",
|
|
4640
|
+
// "rejectReason": "EC_PerCancelRequest",
|
|
4641
|
+
// "isLeverage": "",
|
|
4642
|
+
// "price": "18000",
|
|
4643
|
+
// "orderIv": "",
|
|
4644
|
+
// "createdTime": "1672220109387",
|
|
4645
|
+
// "tpTriggerBy": "UNKNOWN",
|
|
4646
|
+
// "positionIdx": 0,
|
|
4647
|
+
// "timeInForce": "GoodTillCancel",
|
|
4648
|
+
// "leavesValue": "0",
|
|
4649
|
+
// "updatedTime": "1672220114123",
|
|
4650
|
+
// "side": "Sell",
|
|
4651
|
+
// "triggerPrice": "",
|
|
4652
|
+
// "cumExecFee": "0",
|
|
4653
|
+
// "slTriggerBy": "UNKNOWN",
|
|
4654
|
+
// "leavesQty": "0",
|
|
4655
|
+
// "closeOnTrigger": false,
|
|
4656
|
+
// "cumExecQty": "0",
|
|
4657
|
+
// "reduceOnly": false,
|
|
4658
|
+
// "qty": "0.1",
|
|
4659
|
+
// "stopLoss": "",
|
|
4660
|
+
// "triggerBy": "UNKNOWN"
|
|
4661
|
+
// }
|
|
4662
|
+
// ]
|
|
4663
|
+
// },
|
|
4664
|
+
// "retExtInfo": {},
|
|
4665
|
+
// "time": 1672221263862
|
|
4666
|
+
// }
|
|
4667
|
+
//
|
|
4668
|
+
const data = this.addPaginationCursorToResult(response);
|
|
4669
|
+
return this.parseOrders(data, market, since, limit);
|
|
4487
4670
|
}
|
|
4488
4671
|
async fetchClosedOrder(id, symbol = undefined, params = {}) {
|
|
4489
4672
|
/**
|
package/dist/cjs/src/coinsph.js
CHANGED
|
@@ -443,6 +443,7 @@ class coinsph extends coinsph$1 {
|
|
|
443
443
|
* @method
|
|
444
444
|
* @name coinsph#fetchStatus
|
|
445
445
|
* @description the latest known information on the availability of the exchange API
|
|
446
|
+
* @see https://coins-docs.github.io/rest-api/#test-connectivity
|
|
446
447
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
447
448
|
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
448
449
|
*/
|
|
@@ -460,6 +461,7 @@ class coinsph extends coinsph$1 {
|
|
|
460
461
|
* @method
|
|
461
462
|
* @name coinsph#fetchTime
|
|
462
463
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
464
|
+
* @see https://coins-docs.github.io/rest-api/#check-server-time
|
|
463
465
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
464
466
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
465
467
|
*/
|
|
@@ -474,6 +476,7 @@ class coinsph extends coinsph$1 {
|
|
|
474
476
|
* @method
|
|
475
477
|
* @name coinsph#fetchMarkets
|
|
476
478
|
* @description retrieves data on all markets for coinsph
|
|
479
|
+
* @see https://coins-docs.github.io/rest-api/#exchange-information
|
|
477
480
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
478
481
|
* @returns {object[]} an array of objects representing market data
|
|
479
482
|
*/
|
|
@@ -610,6 +613,9 @@ class coinsph extends coinsph$1 {
|
|
|
610
613
|
* @method
|
|
611
614
|
* @name coinsph#fetchTickers
|
|
612
615
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
616
|
+
* @see https://coins-docs.github.io/rest-api/#24hr-ticker-price-change-statistics
|
|
617
|
+
* @see https://coins-docs.github.io/rest-api/#symbol-price-ticker
|
|
618
|
+
* @see https://coins-docs.github.io/rest-api/#symbol-order-book-ticker
|
|
613
619
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
614
620
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
615
621
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -645,6 +651,9 @@ class coinsph extends coinsph$1 {
|
|
|
645
651
|
* @method
|
|
646
652
|
* @name coinsph#fetchTicker
|
|
647
653
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
654
|
+
* @see https://coins-docs.github.io/rest-api/#24hr-ticker-price-change-statistics
|
|
655
|
+
* @see https://coins-docs.github.io/rest-api/#symbol-price-ticker
|
|
656
|
+
* @see https://coins-docs.github.io/rest-api/#symbol-order-book-ticker
|
|
648
657
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
649
658
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
650
659
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -752,6 +761,7 @@ class coinsph extends coinsph$1 {
|
|
|
752
761
|
* @method
|
|
753
762
|
* @name coinsph#fetchOrderBook
|
|
754
763
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
764
|
+
* @see https://coins-docs.github.io/rest-api/#order-book
|
|
755
765
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
756
766
|
* @param {int} [limit] the maximum amount of order book entries to return (default 100, max 200)
|
|
757
767
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -788,6 +798,7 @@ class coinsph extends coinsph$1 {
|
|
|
788
798
|
* @method
|
|
789
799
|
* @name coinsph#fetchOHLCV
|
|
790
800
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
801
|
+
* @see https://coins-docs.github.io/rest-api/#klinecandlestick-data
|
|
791
802
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
792
803
|
* @param {string} timeframe the length of time each candle represents
|
|
793
804
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -854,6 +865,7 @@ class coinsph extends coinsph$1 {
|
|
|
854
865
|
* @method
|
|
855
866
|
* @name coinsph#fetchTrades
|
|
856
867
|
* @description get the list of most recent trades for a particular symbol
|
|
868
|
+
* @see https://coins-docs.github.io/rest-api/#recent-trades-list
|
|
857
869
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
858
870
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
859
871
|
* @param {int} [limit] the maximum amount of trades to fetch (default 500, max 1000)
|
|
@@ -895,6 +907,7 @@ class coinsph extends coinsph$1 {
|
|
|
895
907
|
* @method
|
|
896
908
|
* @name coinsph#fetchMyTrades
|
|
897
909
|
* @description fetch all trades made by the user
|
|
910
|
+
* @see https://coins-docs.github.io/rest-api/#account-trade-list-user_data
|
|
898
911
|
* @param {string} symbol unified market symbol
|
|
899
912
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
900
913
|
* @param {int} [limit] the maximum number of trades structures to retrieve (default 500, max 1000)
|
|
@@ -925,6 +938,7 @@ class coinsph extends coinsph$1 {
|
|
|
925
938
|
* @method
|
|
926
939
|
* @name coinsph#fetchOrderTrades
|
|
927
940
|
* @description fetch all the trades made from a single order
|
|
941
|
+
* @see https://coins-docs.github.io/rest-api/#account-trade-list-user_data
|
|
928
942
|
* @param {string} id order id
|
|
929
943
|
* @param {string} symbol unified market symbol
|
|
930
944
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -1031,6 +1045,7 @@ class coinsph extends coinsph$1 {
|
|
|
1031
1045
|
* @method
|
|
1032
1046
|
* @name coinsph#fetchBalance
|
|
1033
1047
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1048
|
+
* @see https://coins-docs.github.io/rest-api/#accept-the-quote
|
|
1034
1049
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1035
1050
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1036
1051
|
*/
|
|
@@ -1090,11 +1105,14 @@ class coinsph extends coinsph$1 {
|
|
|
1090
1105
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
1091
1106
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1092
1107
|
* @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
|
|
1108
|
+
* @param {bool} [params.test] set to true to test an order, no order will be created but the request will be validated
|
|
1093
1109
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1094
1110
|
*/
|
|
1095
1111
|
// todo: add test order low priority
|
|
1096
1112
|
await this.loadMarkets();
|
|
1097
1113
|
const market = this.market(symbol);
|
|
1114
|
+
const testOrder = this.safeBool(params, 'test', false);
|
|
1115
|
+
params = this.omit(params, 'test');
|
|
1098
1116
|
let orderType = this.safeString(params, 'type', type);
|
|
1099
1117
|
orderType = this.encodeOrderType(orderType);
|
|
1100
1118
|
params = this.omit(params, 'type');
|
|
@@ -1159,7 +1177,13 @@ class coinsph extends coinsph$1 {
|
|
|
1159
1177
|
}
|
|
1160
1178
|
request['newOrderRespType'] = newOrderRespType;
|
|
1161
1179
|
params = this.omit(params, 'price', 'stopPrice', 'triggerPrice', 'quantity', 'quoteOrderQty');
|
|
1162
|
-
|
|
1180
|
+
let response = undefined;
|
|
1181
|
+
if (testOrder) {
|
|
1182
|
+
response = await this.privatePostOpenapiV1OrderTest(this.extend(request, params));
|
|
1183
|
+
}
|
|
1184
|
+
else {
|
|
1185
|
+
response = await this.privatePostOpenapiV1Order(this.extend(request, params));
|
|
1186
|
+
}
|
|
1163
1187
|
//
|
|
1164
1188
|
// {
|
|
1165
1189
|
// "symbol": "ETHUSDT",
|
|
@@ -1194,6 +1218,7 @@ class coinsph extends coinsph$1 {
|
|
|
1194
1218
|
* @method
|
|
1195
1219
|
* @name coinsph#fetchOrder
|
|
1196
1220
|
* @description fetches information on an order made by the user
|
|
1221
|
+
* @see https://coins-docs.github.io/rest-api/#query-order-user_data
|
|
1197
1222
|
* @param {int|string} id order id
|
|
1198
1223
|
* @param {string} symbol not used by coinsph fetchOrder ()
|
|
1199
1224
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1217,6 +1242,7 @@ class coinsph extends coinsph$1 {
|
|
|
1217
1242
|
* @method
|
|
1218
1243
|
* @name coinsph#fetchOpenOrders
|
|
1219
1244
|
* @description fetch all unfilled currently open orders
|
|
1245
|
+
* @see https://coins-docs.github.io/rest-api/#query-order-user_data
|
|
1220
1246
|
* @param {string} symbol unified market symbol
|
|
1221
1247
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1222
1248
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -1238,6 +1264,7 @@ class coinsph extends coinsph$1 {
|
|
|
1238
1264
|
* @method
|
|
1239
1265
|
* @name coinsph#fetchClosedOrders
|
|
1240
1266
|
* @description fetches information on multiple closed orders made by the user
|
|
1267
|
+
* @see https://coins-docs.github.io/rest-api/#history-orders-user_data
|
|
1241
1268
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1242
1269
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1243
1270
|
* @param {int} [limit] the maximum number of order structures to retrieve (default 500, max 1000)
|
|
@@ -1268,6 +1295,7 @@ class coinsph extends coinsph$1 {
|
|
|
1268
1295
|
* @method
|
|
1269
1296
|
* @name coinsph#cancelOrder
|
|
1270
1297
|
* @description cancels an open order
|
|
1298
|
+
* @see https://coins-docs.github.io/rest-api/#cancel-order-trade
|
|
1271
1299
|
* @param {string} id order id
|
|
1272
1300
|
* @param {string} symbol not used by coinsph cancelOrder ()
|
|
1273
1301
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1291,6 +1319,7 @@ class coinsph extends coinsph$1 {
|
|
|
1291
1319
|
* @method
|
|
1292
1320
|
* @name coinsph#cancelAllOrders
|
|
1293
1321
|
* @description cancel open orders of market
|
|
1322
|
+
* @see https://coins-docs.github.io/rest-api/#cancel-all-open-orders-on-a-symbol-trade
|
|
1294
1323
|
* @param {string} symbol unified market symbol
|
|
1295
1324
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1296
1325
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -1473,6 +1502,7 @@ class coinsph extends coinsph$1 {
|
|
|
1473
1502
|
* @method
|
|
1474
1503
|
* @name coinsph#fetchTradingFee
|
|
1475
1504
|
* @description fetch the trading fees for a market
|
|
1505
|
+
* @see https://coins-docs.github.io/rest-api/#trade-fee-user_data
|
|
1476
1506
|
* @param {string} symbol unified market symbol
|
|
1477
1507
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1478
1508
|
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
@@ -1500,6 +1530,7 @@ class coinsph extends coinsph$1 {
|
|
|
1500
1530
|
* @method
|
|
1501
1531
|
* @name coinsph#fetchTradingFees
|
|
1502
1532
|
* @description fetch the trading fees for multiple markets
|
|
1533
|
+
* @see https://coins-docs.github.io/rest-api/#trade-fee-user_data
|
|
1503
1534
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1504
1535
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
1505
1536
|
*/
|
|
@@ -303,6 +303,7 @@ class currencycom extends currencycom$1 {
|
|
|
303
303
|
* @method
|
|
304
304
|
* @name currencycom#fetchTime
|
|
305
305
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
306
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/timeUsingGET
|
|
306
307
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
307
308
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
308
309
|
*/
|
|
@@ -319,6 +320,7 @@ class currencycom extends currencycom$1 {
|
|
|
319
320
|
* @method
|
|
320
321
|
* @name currencycom#fetchCurrencies
|
|
321
322
|
* @description fetches all available currencies on an exchange
|
|
323
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getCurrenciesUsingGET
|
|
322
324
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
323
325
|
* @returns {object} an associative dictionary of currencies
|
|
324
326
|
*/
|
|
@@ -391,6 +393,7 @@ class currencycom extends currencycom$1 {
|
|
|
391
393
|
* @method
|
|
392
394
|
* @name currencycom#fetchMarkets
|
|
393
395
|
* @description retrieves data on all markets for currencycom
|
|
396
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/exchangeInfoUsingGET
|
|
394
397
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
395
398
|
* @returns {object[]} an array of objects representing market data
|
|
396
399
|
*/
|
|
@@ -579,6 +582,7 @@ class currencycom extends currencycom$1 {
|
|
|
579
582
|
* @method
|
|
580
583
|
* @name currencycom#fetchAccounts
|
|
581
584
|
* @description fetch all the accounts associated with a profile
|
|
585
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/accountUsingGET
|
|
582
586
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
583
587
|
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
584
588
|
*/
|
|
@@ -635,6 +639,7 @@ class currencycom extends currencycom$1 {
|
|
|
635
639
|
* @method
|
|
636
640
|
* @name currencycom#fetchTradingFees
|
|
637
641
|
* @description fetch the trading fees for multiple markets
|
|
642
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/accountUsingGET
|
|
638
643
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
639
644
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
640
645
|
*/
|
|
@@ -711,6 +716,7 @@ class currencycom extends currencycom$1 {
|
|
|
711
716
|
* @method
|
|
712
717
|
* @name currencycom#fetchBalance
|
|
713
718
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
719
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/accountUsingGET
|
|
714
720
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
715
721
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
716
722
|
*/
|
|
@@ -754,6 +760,7 @@ class currencycom extends currencycom$1 {
|
|
|
754
760
|
* @method
|
|
755
761
|
* @name currencycom#fetchOrderBook
|
|
756
762
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
763
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/depthUsingGET
|
|
757
764
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
758
765
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
759
766
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -870,6 +877,7 @@ class currencycom extends currencycom$1 {
|
|
|
870
877
|
* @method
|
|
871
878
|
* @name currencycom#fetchTicker
|
|
872
879
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
880
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/ticker_24hrUsingGET
|
|
873
881
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
874
882
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
875
883
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -907,6 +915,7 @@ class currencycom extends currencycom$1 {
|
|
|
907
915
|
* @method
|
|
908
916
|
* @name currencycom#fetchTickers
|
|
909
917
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
918
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/ticker_24hrUsingGET
|
|
910
919
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
911
920
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
912
921
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -958,6 +967,7 @@ class currencycom extends currencycom$1 {
|
|
|
958
967
|
* @method
|
|
959
968
|
* @name currencycom#fetchOHLCV
|
|
960
969
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
970
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/klinesUsingGET
|
|
961
971
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
962
972
|
* @param {string} timeframe the length of time each candle represents
|
|
963
973
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -1070,6 +1080,7 @@ class currencycom extends currencycom$1 {
|
|
|
1070
1080
|
* @method
|
|
1071
1081
|
* @name currencycom#fetchTrades
|
|
1072
1082
|
* @description get the list of most recent trades for a particular symbol
|
|
1083
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/aggTradesUsingGET
|
|
1073
1084
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1074
1085
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1075
1086
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -1254,6 +1265,7 @@ class currencycom extends currencycom$1 {
|
|
|
1254
1265
|
* @method
|
|
1255
1266
|
* @name currencycom#createOrder
|
|
1256
1267
|
* @description create a trade order
|
|
1268
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/orderUsingPOST
|
|
1257
1269
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1258
1270
|
* @param {string} type 'market' or 'limit'
|
|
1259
1271
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -1394,6 +1406,7 @@ class currencycom extends currencycom$1 {
|
|
|
1394
1406
|
* @method
|
|
1395
1407
|
* @name currencycom#fetchOpenOrders
|
|
1396
1408
|
* @description fetch all unfilled currently open orders
|
|
1409
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/openOrdersUsingGET
|
|
1397
1410
|
* @param {string} symbol unified market symbol
|
|
1398
1411
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1399
1412
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -1440,6 +1453,7 @@ class currencycom extends currencycom$1 {
|
|
|
1440
1453
|
* @method
|
|
1441
1454
|
* @name currencycom#cancelOrder
|
|
1442
1455
|
* @description cancels an open order
|
|
1456
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/cancelOrderUsingDELETE
|
|
1443
1457
|
* @param {string} id order id
|
|
1444
1458
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1445
1459
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1483,6 +1497,7 @@ class currencycom extends currencycom$1 {
|
|
|
1483
1497
|
* @method
|
|
1484
1498
|
* @name currencycom#fetchMyTrades
|
|
1485
1499
|
* @description fetch all trades made by the user
|
|
1500
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/myTradesUsingGET
|
|
1486
1501
|
* @param {string} symbol unified market symbol
|
|
1487
1502
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1488
1503
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -1526,6 +1541,7 @@ class currencycom extends currencycom$1 {
|
|
|
1526
1541
|
* @method
|
|
1527
1542
|
* @name currencycom#fetchDeposits
|
|
1528
1543
|
* @description fetch all deposits made to an account
|
|
1544
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getDepositsUsingGET
|
|
1529
1545
|
* @param {string} code unified currency code
|
|
1530
1546
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
1531
1547
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -1539,6 +1555,7 @@ class currencycom extends currencycom$1 {
|
|
|
1539
1555
|
* @method
|
|
1540
1556
|
* @name currencycom#fetchWithdrawals
|
|
1541
1557
|
* @description fetch all withdrawals made from an account
|
|
1558
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getWithdrawalsUsingGET
|
|
1542
1559
|
* @param {string} code unified currency code
|
|
1543
1560
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
1544
1561
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -1552,6 +1569,7 @@ class currencycom extends currencycom$1 {
|
|
|
1552
1569
|
* @method
|
|
1553
1570
|
* @name currencycom#fetchDepositsWithdrawals
|
|
1554
1571
|
* @description fetch history of deposits and withdrawals
|
|
1572
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getTransactionsUsingGET
|
|
1555
1573
|
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
1556
1574
|
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
1557
1575
|
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
@@ -1674,6 +1692,7 @@ class currencycom extends currencycom$1 {
|
|
|
1674
1692
|
* @method
|
|
1675
1693
|
* @name currencycom#fetchLedger
|
|
1676
1694
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
1695
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getLedgerUsingGET
|
|
1677
1696
|
* @param {string} code unified currency code, default is undefined
|
|
1678
1697
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1679
1698
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
@@ -1775,6 +1794,7 @@ class currencycom extends currencycom$1 {
|
|
|
1775
1794
|
* @method
|
|
1776
1795
|
* @name currencycom#fetchLeverage
|
|
1777
1796
|
* @description fetch the set leverage for a market
|
|
1797
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/leverageSettingsUsingGET
|
|
1778
1798
|
* @param {string} symbol unified market symbol
|
|
1779
1799
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1780
1800
|
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
@@ -1798,6 +1818,7 @@ class currencycom extends currencycom$1 {
|
|
|
1798
1818
|
* @method
|
|
1799
1819
|
* @name currencycom#fetchDepositAddress
|
|
1800
1820
|
* @description fetch the deposit address for a currency associated with this account
|
|
1821
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getDepositAddressUsingGET
|
|
1801
1822
|
* @param {string} code unified currency code
|
|
1802
1823
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1803
1824
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -1864,6 +1885,7 @@ class currencycom extends currencycom$1 {
|
|
|
1864
1885
|
* @method
|
|
1865
1886
|
* @name currencycom#fetchPositions
|
|
1866
1887
|
* @description fetch all open positions
|
|
1888
|
+
* @see https://apitradedoc.currency.com/swagger-ui.html#/rest-api/tradingPositionsUsingGET
|
|
1867
1889
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1868
1890
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1869
1891
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|