ccxt 4.0.111 → 4.1.1
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 +89 -0
- package/README.md +3 -3
- package/dist/ccxt.browser.js +224 -61
- package/dist/ccxt.browser.min.js +9 -9
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bybit.js +5 -6
- package/dist/cjs/src/coinbasepro.js +52 -8
- package/dist/cjs/src/kucoin.js +31 -1
- package/dist/cjs/src/latoken.js +133 -43
- package/dist/cjs/src/pro/okx.js +2 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/bybit.js +5 -6
- package/js/src/coinbasepro.js +52 -8
- package/js/src/kucoin.js +31 -1
- package/js/src/latoken.js +134 -44
- package/js/src/pro/okx.js +2 -2
- package/package.json +1 -1
package/dist/ccxt.browser.js
CHANGED
|
@@ -74681,16 +74681,16 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
74681
74681
|
triggerPrice = isStopLossTriggerOrder ? stopLossTriggerPrice : takeProfitTriggerPrice;
|
|
74682
74682
|
}
|
|
74683
74683
|
if (triggerPrice !== undefined) {
|
|
74684
|
-
request['triggerPrice'] =
|
|
74684
|
+
request['triggerPrice'] = triggerPrice;
|
|
74685
74685
|
}
|
|
74686
74686
|
if (isStopLoss || isTakeProfit) {
|
|
74687
74687
|
if (isStopLoss) {
|
|
74688
74688
|
const slTriggerPrice = this.safeValue2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
|
|
74689
|
-
request['stopLoss'] =
|
|
74689
|
+
request['stopLoss'] = slTriggerPrice;
|
|
74690
74690
|
}
|
|
74691
74691
|
if (isTakeProfit) {
|
|
74692
74692
|
const tpTriggerPrice = this.safeValue2(takeProfit, 'triggerPrice', 'stopPrice', takeProfit);
|
|
74693
|
-
request['takeProfit'] =
|
|
74693
|
+
request['takeProfit'] = tpTriggerPrice;
|
|
74694
74694
|
}
|
|
74695
74695
|
}
|
|
74696
74696
|
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
@@ -77237,9 +77237,8 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
77237
77237
|
// "time": 1670988271677
|
|
77238
77238
|
// }
|
|
77239
77239
|
//
|
|
77240
|
-
const data = this.
|
|
77241
|
-
|
|
77242
|
-
return this.parseTransfers(transfers, currency, since, limit);
|
|
77240
|
+
const data = this.addPaginationCursorToResult(response);
|
|
77241
|
+
return this.parseTransfers(data, currency, since, limit);
|
|
77243
77242
|
}
|
|
77244
77243
|
async borrowMargin(code, amount, symbol = undefined, params = {}) {
|
|
77245
77244
|
/**
|
|
@@ -83187,6 +83186,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83187
83186
|
/**
|
|
83188
83187
|
* @method
|
|
83189
83188
|
* @name coinbasepro#fetchOrderBook
|
|
83189
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductbook
|
|
83190
83190
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
83191
83191
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
83192
83192
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
@@ -83352,6 +83352,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83352
83352
|
/**
|
|
83353
83353
|
* @method
|
|
83354
83354
|
* @name coinbasepro#fetchTicker
|
|
83355
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductticker
|
|
83355
83356
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
83356
83357
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
83357
83358
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
@@ -83465,17 +83466,16 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83465
83466
|
/**
|
|
83466
83467
|
* @method
|
|
83467
83468
|
* @name coinbasepro#fetchMyTrades
|
|
83469
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfills
|
|
83468
83470
|
* @description fetch all trades made by the user
|
|
83469
83471
|
* @param {string} symbol unified market symbol
|
|
83470
83472
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
83471
83473
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
83472
83474
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
83475
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
83473
83476
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
83474
83477
|
*/
|
|
83475
|
-
|
|
83476
|
-
if (symbol === undefined) {
|
|
83477
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
83478
|
-
}
|
|
83478
|
+
this.checkRequiredSymbol('fetchMyTrades', symbol);
|
|
83479
83479
|
await this.loadMarkets();
|
|
83480
83480
|
const market = this.market(symbol);
|
|
83481
83481
|
const request = {
|
|
@@ -83484,6 +83484,14 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83484
83484
|
if (limit !== undefined) {
|
|
83485
83485
|
request['limit'] = limit;
|
|
83486
83486
|
}
|
|
83487
|
+
if (since !== undefined) {
|
|
83488
|
+
request['start_date'] = this.iso8601(since);
|
|
83489
|
+
}
|
|
83490
|
+
const until = this.safeValue2(params, 'until', 'end_date');
|
|
83491
|
+
if (until !== undefined) {
|
|
83492
|
+
params = this.omit(params, ['until']);
|
|
83493
|
+
request['end_date'] = this.iso8601(until);
|
|
83494
|
+
}
|
|
83487
83495
|
const response = await this.privateGetFills(this.extend(request, params));
|
|
83488
83496
|
return this.parseTrades(response, market, since, limit);
|
|
83489
83497
|
}
|
|
@@ -83491,6 +83499,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83491
83499
|
/**
|
|
83492
83500
|
* @method
|
|
83493
83501
|
* @name coinbasepro#fetchTrades
|
|
83502
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducttrades
|
|
83494
83503
|
* @description get the list of most recent trades for a particular symbol
|
|
83495
83504
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
83496
83505
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
@@ -83577,12 +83586,14 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83577
83586
|
/**
|
|
83578
83587
|
* @method
|
|
83579
83588
|
* @name coinbasepro#fetchOHLCV
|
|
83589
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductcandles
|
|
83580
83590
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
83581
83591
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
83582
83592
|
* @param {string} timeframe the length of time each candle represents
|
|
83583
83593
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
83584
83594
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
83585
83595
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
83596
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
83586
83597
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
83587
83598
|
*/
|
|
83588
83599
|
await this.loadMarkets();
|
|
@@ -83597,6 +83608,8 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83597
83608
|
else {
|
|
83598
83609
|
request['granularity'] = timeframe;
|
|
83599
83610
|
}
|
|
83611
|
+
const until = this.safeValue2(params, 'until', 'end');
|
|
83612
|
+
params = this.omit(params, ['until']);
|
|
83600
83613
|
if (since !== undefined) {
|
|
83601
83614
|
request['start'] = this.iso8601(since);
|
|
83602
83615
|
if (limit === undefined) {
|
|
@@ -83606,12 +83619,17 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83606
83619
|
else {
|
|
83607
83620
|
limit = Math.min(300, limit);
|
|
83608
83621
|
}
|
|
83609
|
-
|
|
83610
|
-
|
|
83611
|
-
|
|
83622
|
+
if (until === undefined) {
|
|
83623
|
+
const parsedTimeframeMilliseconds = parsedTimeframe * 1000;
|
|
83624
|
+
if (since % parsedTimeframeMilliseconds === 0) {
|
|
83625
|
+
request['end'] = this.iso8601(this.sum((limit - 1) * parsedTimeframeMilliseconds, since));
|
|
83626
|
+
}
|
|
83627
|
+
else {
|
|
83628
|
+
request['end'] = this.iso8601(this.sum(limit * parsedTimeframeMilliseconds, since));
|
|
83629
|
+
}
|
|
83612
83630
|
}
|
|
83613
83631
|
else {
|
|
83614
|
-
request['end'] = this.iso8601(
|
|
83632
|
+
request['end'] = this.iso8601(until);
|
|
83615
83633
|
}
|
|
83616
83634
|
}
|
|
83617
83635
|
const response = await this.publicGetProductsIdCandles(this.extend(request, params));
|
|
@@ -83731,6 +83749,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83731
83749
|
/**
|
|
83732
83750
|
* @method
|
|
83733
83751
|
* @name coinbasepro#fetchOrder
|
|
83752
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorder
|
|
83734
83753
|
* @description fetches information on an order made by the user
|
|
83735
83754
|
* @param {string} symbol not used by coinbasepro fetchOrder
|
|
83736
83755
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
@@ -83779,11 +83798,13 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83779
83798
|
/**
|
|
83780
83799
|
* @method
|
|
83781
83800
|
* @name coinbasepro#fetchOrders
|
|
83801
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
|
|
83782
83802
|
* @description fetches information on multiple orders made by the user
|
|
83783
83803
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
83784
83804
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
83785
83805
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
83786
83806
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
83807
|
+
* @param {int} [params.until] the latest time in ms to fetch open orders for
|
|
83787
83808
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
83788
83809
|
*/
|
|
83789
83810
|
const request = {
|
|
@@ -83795,11 +83816,13 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83795
83816
|
/**
|
|
83796
83817
|
* @method
|
|
83797
83818
|
* @name coinbasepro#fetchOpenOrders
|
|
83819
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
|
|
83798
83820
|
* @description fetch all unfilled currently open orders
|
|
83799
83821
|
* @param {string} symbol unified market symbol
|
|
83800
83822
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
83801
83823
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
83802
83824
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
83825
|
+
* @param {int} [params.until] the latest time in ms to fetch open orders for
|
|
83803
83826
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
83804
83827
|
*/
|
|
83805
83828
|
await this.loadMarkets();
|
|
@@ -83812,6 +83835,14 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83812
83835
|
if (limit !== undefined) {
|
|
83813
83836
|
request['limit'] = limit; // default 100
|
|
83814
83837
|
}
|
|
83838
|
+
if (since !== undefined) {
|
|
83839
|
+
request['start_date'] = this.iso8601(since);
|
|
83840
|
+
}
|
|
83841
|
+
const until = this.safeValue2(params, 'until', 'end_date');
|
|
83842
|
+
if (until !== undefined) {
|
|
83843
|
+
params = this.omit(params, ['until']);
|
|
83844
|
+
request['end_date'] = this.iso8601(until);
|
|
83845
|
+
}
|
|
83815
83846
|
const response = await this.privateGetOrders(this.extend(request, params));
|
|
83816
83847
|
return this.parseOrders(response, market, since, limit);
|
|
83817
83848
|
}
|
|
@@ -83819,11 +83850,13 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83819
83850
|
/**
|
|
83820
83851
|
* @method
|
|
83821
83852
|
* @name coinbasepro#fetchClosedOrders
|
|
83853
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
|
|
83822
83854
|
* @description fetches information on multiple closed orders made by the user
|
|
83823
83855
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
83824
83856
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
83825
83857
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
83826
83858
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
83859
|
+
* @param {int} [params.until] the latest time in ms to fetch open orders for
|
|
83827
83860
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
83828
83861
|
*/
|
|
83829
83862
|
const request = {
|
|
@@ -83835,6 +83868,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83835
83868
|
/**
|
|
83836
83869
|
* @method
|
|
83837
83870
|
* @name coinbasepro#createOrder
|
|
83871
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders
|
|
83838
83872
|
* @description create a trade order
|
|
83839
83873
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
83840
83874
|
* @param {string} type 'market' or 'limit'
|
|
@@ -83930,6 +83964,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83930
83964
|
/**
|
|
83931
83965
|
* @method
|
|
83932
83966
|
* @name coinbasepro#cancelOrder
|
|
83967
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorder
|
|
83933
83968
|
* @description cancels an open order
|
|
83934
83969
|
* @param {string} id order id
|
|
83935
83970
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
@@ -83962,6 +83997,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
83962
83997
|
/**
|
|
83963
83998
|
* @method
|
|
83964
83999
|
* @name coinbasepro#cancelAllOrders
|
|
84000
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorders
|
|
83965
84001
|
* @description cancel all open orders
|
|
83966
84002
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
83967
84003
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
@@ -84148,11 +84184,13 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
84148
84184
|
/**
|
|
84149
84185
|
* @method
|
|
84150
84186
|
* @name coinbasepro#fetchLedger
|
|
84187
|
+
* @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
|
|
84151
84188
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
84152
84189
|
* @param {string} code unified currency code, default is undefined
|
|
84153
84190
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
84154
84191
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
84155
84192
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
84193
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
84156
84194
|
* @returns {object} a [ledger structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ledger-structure}
|
|
84157
84195
|
*/
|
|
84158
84196
|
// https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
|
|
@@ -84182,6 +84220,11 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
|
|
|
84182
84220
|
if (limit !== undefined) {
|
|
84183
84221
|
request['limit'] = limit; // default 100
|
|
84184
84222
|
}
|
|
84223
|
+
const until = this.safeValue2(params, 'until', 'end_date');
|
|
84224
|
+
if (until !== undefined) {
|
|
84225
|
+
params = this.omit(params, ['until']);
|
|
84226
|
+
request['end_date'] = this.iso8601(until);
|
|
84227
|
+
}
|
|
84185
84228
|
const response = await this.privateGetAccountsIdLedger(this.extend(request, params));
|
|
84186
84229
|
for (let i = 0; i < response.length; i++) {
|
|
84187
84230
|
response[i]['currency'] = code;
|
|
@@ -145756,6 +145799,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
145756
145799
|
* @method
|
|
145757
145800
|
* @name kucoin#fetchTime
|
|
145758
145801
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
145802
|
+
* @see https://docs.kucoin.com/#server-time
|
|
145759
145803
|
* @param {object} [params] extra parameters specific to the kucoin api endpoint
|
|
145760
145804
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
145761
145805
|
*/
|
|
@@ -145774,6 +145818,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
145774
145818
|
* @method
|
|
145775
145819
|
* @name kucoin#fetchStatus
|
|
145776
145820
|
* @description the latest known information on the availability of the exchange API
|
|
145821
|
+
* @see https://docs.kucoin.com/#service-status
|
|
145777
145822
|
* @param {object} [params] extra parameters specific to the kucoin api endpoint
|
|
145778
145823
|
* @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
|
|
145779
145824
|
*/
|
|
@@ -145802,6 +145847,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
145802
145847
|
* @method
|
|
145803
145848
|
* @name kucoin#fetchMarkets
|
|
145804
145849
|
* @description retrieves data on all markets for kucoin
|
|
145850
|
+
* @see https://docs.kucoin.com/#get-symbols-list-deprecated
|
|
145851
|
+
* @see https://docs.kucoin.com/#get-all-tickers
|
|
145805
145852
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
145806
145853
|
* @returns {object[]} an array of objects representing market data
|
|
145807
145854
|
*/
|
|
@@ -145940,6 +145987,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
145940
145987
|
* @method
|
|
145941
145988
|
* @name kucoin#fetchCurrencies
|
|
145942
145989
|
* @description fetches all available currencies on an exchange
|
|
145990
|
+
* @see https://docs.kucoin.com/#get-currencies
|
|
145943
145991
|
* @param {object} params extra parameters specific to the kucoin api endpoint
|
|
145944
145992
|
* @returns {object} an associative dictionary of currencies
|
|
145945
145993
|
*/
|
|
@@ -146037,7 +146085,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
146037
146085
|
}
|
|
146038
146086
|
for (let j = 0; j < chainsLength; j++) {
|
|
146039
146087
|
const chain = chains[j];
|
|
146040
|
-
const chainId = this.safeString(chain, '
|
|
146088
|
+
const chainId = this.safeString(chain, 'chainId');
|
|
146041
146089
|
const networkCode = this.networkIdToCode(chainId);
|
|
146042
146090
|
const chainWithdrawEnabled = this.safeValue(chain, 'isWithdrawEnabled', false);
|
|
146043
146091
|
if (isWithdrawEnabled === undefined) {
|
|
@@ -146100,6 +146148,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
146100
146148
|
* @method
|
|
146101
146149
|
* @name kucoin#fetchAccounts
|
|
146102
146150
|
* @description fetch all the accounts associated with a profile
|
|
146151
|
+
* @see https://docs.kucoin.com/#list-accounts
|
|
146103
146152
|
* @param {object} [params] extra parameters specific to the kucoin api endpoint
|
|
146104
146153
|
* @returns {object} a dictionary of [account structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#account-structure} indexed by the account type
|
|
146105
146154
|
*/
|
|
@@ -146377,6 +146426,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
146377
146426
|
* @method
|
|
146378
146427
|
* @name kucoin#fetchTickers
|
|
146379
146428
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
146429
|
+
* @see https://docs.kucoin.com/#get-all-tickers
|
|
146380
146430
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
146381
146431
|
* @param {object} [params] extra parameters specific to the kucoin api endpoint
|
|
146382
146432
|
* @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -146431,6 +146481,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
146431
146481
|
* @method
|
|
146432
146482
|
* @name kucoin#fetchTicker
|
|
146433
146483
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
146484
|
+
* @see https://docs.kucoin.com/#get-24hr-stats
|
|
146434
146485
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
146435
146486
|
* @param {object} [params] extra parameters specific to the kucoin api endpoint
|
|
146436
146487
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -146492,6 +146543,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
146492
146543
|
* @method
|
|
146493
146544
|
* @name kucoin#fetchOHLCV
|
|
146494
146545
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
146546
|
+
* @see https://docs.kucoin.com/#get-klines
|
|
146495
146547
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
146496
146548
|
* @param {string} timeframe the length of time each candle represents
|
|
146497
146549
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -146571,6 +146623,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
146571
146623
|
* @method
|
|
146572
146624
|
* @name kucoin#fetchDepositAddress
|
|
146573
146625
|
* @description fetch the deposit address for a currency associated with this account
|
|
146626
|
+
* @see https://docs.kucoin.com/#get-deposit-addresses-v2
|
|
146574
146627
|
* @param {string} code unified currency code
|
|
146575
146628
|
* @param {object} [params] extra parameters specific to the kucoin api endpoint
|
|
146576
146629
|
* @param {string} [params.network] the blockchain network name
|
|
@@ -146668,6 +146721,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
146668
146721
|
* @method
|
|
146669
146722
|
* @name kucoin#fetchOrderBook
|
|
146670
146723
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
146724
|
+
* @see https://docs.kucoin.com/#get-part-order-book-aggregated
|
|
146725
|
+
* @see https://docs.kucoin.com/#get-full-order-book-aggregated
|
|
146671
146726
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
146672
146727
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
146673
146728
|
* @param {object} [params] extra parameters specific to the kucoin api endpoint
|
|
@@ -147138,6 +147193,10 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
147138
147193
|
* @method
|
|
147139
147194
|
* @name kucoin#fetchClosedOrders
|
|
147140
147195
|
* @description fetches information on multiple closed orders made by the user
|
|
147196
|
+
* @see https://docs.kucoin.com/spot#list-orders
|
|
147197
|
+
* @see https://docs.kucoin.com/spot#list-stop-orders
|
|
147198
|
+
* @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
|
|
147199
|
+
* @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
|
|
147141
147200
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
147142
147201
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
147143
147202
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -147157,6 +147216,10 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
147157
147216
|
* @method
|
|
147158
147217
|
* @name kucoin#fetchOpenOrders
|
|
147159
147218
|
* @description fetch all unfilled currently open orders
|
|
147219
|
+
* @see https://docs.kucoin.com/spot#list-orders
|
|
147220
|
+
* @see https://docs.kucoin.com/spot#list-stop-orders
|
|
147221
|
+
* @see https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
|
|
147222
|
+
* @see https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
|
|
147160
147223
|
* @param {string} symbol unified market symbol
|
|
147161
147224
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
147162
147225
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -147433,6 +147496,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
147433
147496
|
* @method
|
|
147434
147497
|
* @name kucoin#fetchOrderTrades
|
|
147435
147498
|
* @description fetch all the trades made from a single order
|
|
147499
|
+
* @see https://docs.kucoin.com/#list-fills
|
|
147500
|
+
* @see https://docs.kucoin.com/spot-hf/#transaction-details
|
|
147436
147501
|
* @param {string} id order id
|
|
147437
147502
|
* @param {string} symbol unified market symbol
|
|
147438
147503
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -147558,6 +147623,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
147558
147623
|
* @method
|
|
147559
147624
|
* @name kucoin#fetchTrades
|
|
147560
147625
|
* @description get the list of most recent trades for a particular symbol
|
|
147626
|
+
* @see https://docs.kucoin.com/#get-trade-histories
|
|
147561
147627
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
147562
147628
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
147563
147629
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -147730,6 +147796,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
147730
147796
|
* @method
|
|
147731
147797
|
* @name kucoin#fetchTradingFee
|
|
147732
147798
|
* @description fetch the trading fees for a market
|
|
147799
|
+
* @see https://docs.kucoin.com/#actual-fee-rate-of-the-trading-pair
|
|
147733
147800
|
* @param {string} symbol unified market symbol
|
|
147734
147801
|
* @param {object} [params] extra parameters specific to the kucoin api endpoint
|
|
147735
147802
|
* @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
|
|
@@ -147769,6 +147836,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
147769
147836
|
* @method
|
|
147770
147837
|
* @name kucoin#withdraw
|
|
147771
147838
|
* @description make a withdrawal
|
|
147839
|
+
* @see https://docs.kucoin.com/#apply-withdraw-2
|
|
147772
147840
|
* @param {string} code unified currency code
|
|
147773
147841
|
* @param {float} amount the amount to withdraw
|
|
147774
147842
|
* @param {string} address the address to withdraw to
|
|
@@ -147941,6 +148009,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
147941
148009
|
* @method
|
|
147942
148010
|
* @name kucoin#fetchDeposits
|
|
147943
148011
|
* @description fetch all deposits made to an account
|
|
148012
|
+
* @see https://docs.kucoin.com/#get-deposit-list
|
|
148013
|
+
* @see https://docs.kucoin.com/#get-v1-historical-deposits-list
|
|
147944
148014
|
* @param {string} code unified currency code
|
|
147945
148015
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
147946
148016
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -148015,6 +148085,8 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
148015
148085
|
* @method
|
|
148016
148086
|
* @name kucoin#fetchWithdrawals
|
|
148017
148087
|
* @description fetch all withdrawals made from an account
|
|
148088
|
+
* @see https://docs.kucoin.com/#get-withdrawals-list
|
|
148089
|
+
* @see https://docs.kucoin.com/#get-v1-historical-withdrawals-list
|
|
148018
148090
|
* @param {string} code unified currency code
|
|
148019
148091
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
148020
148092
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -148529,6 +148601,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
148529
148601
|
* @method
|
|
148530
148602
|
* @name kucoin#fetchLedger
|
|
148531
148603
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
148604
|
+
* @see https://docs.kucoin.com/#get-account-ledgers
|
|
148532
148605
|
* @param {string} code unified currency code, default is undefined
|
|
148533
148606
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
148534
148607
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
@@ -152432,6 +152505,10 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
152432
152505
|
'cancelAllOrders': true,
|
|
152433
152506
|
'cancelOrder': true,
|
|
152434
152507
|
'createOrder': true,
|
|
152508
|
+
'createPostOnlyOrder': false,
|
|
152509
|
+
'createStopLimitOrder': true,
|
|
152510
|
+
'createStopMarketOrder': false,
|
|
152511
|
+
'createStopOrder': true,
|
|
152435
152512
|
'fetchBalance': true,
|
|
152436
152513
|
'fetchBorrowRate': false,
|
|
152437
152514
|
'fetchBorrowRateHistories': false,
|
|
@@ -153354,16 +153431,16 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153354
153431
|
//
|
|
153355
153432
|
// createOrder
|
|
153356
153433
|
//
|
|
153357
|
-
//
|
|
153358
|
-
//
|
|
153359
|
-
//
|
|
153360
|
-
//
|
|
153361
|
-
//
|
|
153362
|
-
//
|
|
153363
|
-
//
|
|
153364
|
-
//
|
|
153365
|
-
//
|
|
153366
|
-
//
|
|
153434
|
+
// {
|
|
153435
|
+
// "baseCurrency": "f7dac554-8139-4ff6-841f-0e586a5984a0",
|
|
153436
|
+
// "quoteCurrency": "a5a7a7a9-e2a3-43f9-8754-29a02f6b709b",
|
|
153437
|
+
// "side": "BID",
|
|
153438
|
+
// "clientOrderId": "my-wonderful-order-number-71566",
|
|
153439
|
+
// "price": "10103.19",
|
|
153440
|
+
// "stopPrice": "10103.19",
|
|
153441
|
+
// "quantity": "3.21",
|
|
153442
|
+
// "timestamp": 1568185507
|
|
153443
|
+
// }
|
|
153367
153444
|
//
|
|
153368
153445
|
// fetchOrder, fetchOpenOrders, fetchOrders
|
|
153369
153446
|
//
|
|
@@ -153431,6 +153508,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153431
153508
|
}
|
|
153432
153509
|
const clientOrderId = this.safeString(order, 'clientOrderId');
|
|
153433
153510
|
const timeInForce = this.parseTimeInForce(this.safeString(order, 'condition'));
|
|
153511
|
+
const triggerPrice = this.safeString(order, 'stopPrice');
|
|
153434
153512
|
return this.safeOrder({
|
|
153435
153513
|
'id': id,
|
|
153436
153514
|
'clientOrderId': clientOrderId,
|
|
@@ -153445,8 +153523,8 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153445
153523
|
'postOnly': undefined,
|
|
153446
153524
|
'side': side,
|
|
153447
153525
|
'price': price,
|
|
153448
|
-
'stopPrice':
|
|
153449
|
-
'triggerPrice':
|
|
153526
|
+
'stopPrice': triggerPrice,
|
|
153527
|
+
'triggerPrice': triggerPrice,
|
|
153450
153528
|
'cost': cost,
|
|
153451
153529
|
'amount': amount,
|
|
153452
153530
|
'filled': filled,
|
|
@@ -153461,22 +153539,33 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153461
153539
|
* @method
|
|
153462
153540
|
* @name latoken#fetchOpenOrders
|
|
153463
153541
|
* @description fetch all unfilled currently open orders
|
|
153542
|
+
* @see https://api.latoken.com/doc/v2/#tag/Order/operation/getMyActiveOrdersByPair
|
|
153543
|
+
* @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/getMyActiveStopOrdersByPair // stop
|
|
153464
153544
|
* @param {string} symbol unified market symbol
|
|
153465
153545
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
153466
153546
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
153467
153547
|
* @param {object} [params] extra parameters specific to the latoken api endpoint
|
|
153548
|
+
* @param {boolean} [params.trigger] true if fetching trigger orders
|
|
153468
153549
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
153469
|
-
|
|
153470
|
-
if (symbol === undefined) {
|
|
153471
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
|
|
153472
|
-
}
|
|
153550
|
+
*/
|
|
153473
153551
|
await this.loadMarkets();
|
|
153474
|
-
|
|
153552
|
+
let response = undefined;
|
|
153553
|
+
let market = undefined;
|
|
153554
|
+
const isTrigger = this.safeValue2(params, 'trigger', 'stop');
|
|
153555
|
+
params = this.omit(params, 'stop');
|
|
153556
|
+
this.checkRequiredSymbol('fetchOpenOrders', symbol);
|
|
153557
|
+
// privateGetAuthOrderActive doesn't work even though its listed at https://api.latoken.com/doc/v2/#tag/Order/operation/getMyActiveOrders
|
|
153558
|
+
market = this.market(symbol);
|
|
153475
153559
|
const request = {
|
|
153476
153560
|
'currency': market['baseId'],
|
|
153477
153561
|
'quote': market['quoteId'],
|
|
153478
153562
|
};
|
|
153479
|
-
|
|
153563
|
+
if (isTrigger) {
|
|
153564
|
+
response = await this.privateGetAuthStopOrderPairCurrencyQuoteActive(this.extend(request, params));
|
|
153565
|
+
}
|
|
153566
|
+
else {
|
|
153567
|
+
response = await this.privateGetAuthOrderPairCurrencyQuoteActive(this.extend(request, params));
|
|
153568
|
+
}
|
|
153480
153569
|
//
|
|
153481
153570
|
// [
|
|
153482
153571
|
// {
|
|
@@ -153506,10 +153595,15 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153506
153595
|
* @method
|
|
153507
153596
|
* @name latoken#fetchOrders
|
|
153508
153597
|
* @description fetches information on multiple orders made by the user
|
|
153598
|
+
* @see https://api.latoken.com/doc/v2/#tag/Order/operation/getMyOrders
|
|
153599
|
+
* @see https://api.latoken.com/doc/v2/#tag/Order/operation/getMyOrdersByPair
|
|
153600
|
+
* @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/getMyStopOrders // stop
|
|
153601
|
+
* @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/getMyStopOrdersByPair // stop
|
|
153509
153602
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
153510
153603
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
153511
153604
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
153512
153605
|
* @param {object} [params] extra parameters specific to the latoken api endpoint
|
|
153606
|
+
* @param {boolean} [params.trigger] true if fetching trigger orders
|
|
153513
153607
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
153514
153608
|
*/
|
|
153515
153609
|
await this.loadMarkets();
|
|
@@ -153519,18 +153613,32 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153519
153613
|
// 'from': this.milliseconds (),
|
|
153520
153614
|
// 'limit': limit, // default '100'
|
|
153521
153615
|
};
|
|
153522
|
-
let method = 'privateGetAuthOrder';
|
|
153523
153616
|
let market = undefined;
|
|
153617
|
+
const isTrigger = this.safeValue2(params, 'trigger', 'stop');
|
|
153618
|
+
params = this.omit(params, ['stop', 'trigger']);
|
|
153619
|
+
if (limit !== undefined) {
|
|
153620
|
+
request['limit'] = limit; // default 100
|
|
153621
|
+
}
|
|
153622
|
+
let response = undefined;
|
|
153524
153623
|
if (symbol !== undefined) {
|
|
153525
153624
|
market = this.market(symbol);
|
|
153526
153625
|
request['currency'] = market['baseId'];
|
|
153527
153626
|
request['quote'] = market['quoteId'];
|
|
153528
|
-
|
|
153627
|
+
if (isTrigger) {
|
|
153628
|
+
response = await this.privateGetAuthStopOrderPairCurrencyQuote(this.extend(request, params));
|
|
153629
|
+
}
|
|
153630
|
+
else {
|
|
153631
|
+
response = await this.privateGetAuthOrderPairCurrencyQuote(this.extend(request, params));
|
|
153632
|
+
}
|
|
153529
153633
|
}
|
|
153530
|
-
|
|
153531
|
-
|
|
153634
|
+
else {
|
|
153635
|
+
if (isTrigger) {
|
|
153636
|
+
response = await this.privateGetAuthStopOrder(this.extend(request, params));
|
|
153637
|
+
}
|
|
153638
|
+
else {
|
|
153639
|
+
response = await this.privateGetAuthOrder(this.extend(request, params));
|
|
153640
|
+
}
|
|
153532
153641
|
}
|
|
153533
|
-
const response = await this[method](this.extend(request, params));
|
|
153534
153642
|
//
|
|
153535
153643
|
// [
|
|
153536
153644
|
// {
|
|
@@ -153560,15 +153668,26 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153560
153668
|
* @method
|
|
153561
153669
|
* @name latoken#fetchOrder
|
|
153562
153670
|
* @description fetches information on an order made by the user
|
|
153563
|
-
* @
|
|
153671
|
+
* @see https://api.latoken.com/doc/v2/#tag/Order/operation/getOrderById
|
|
153672
|
+
* @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/getStopOrderById
|
|
153673
|
+
* @param {string} [symbol] not used by latoken fetchOrder
|
|
153564
153674
|
* @param {object} [params] extra parameters specific to the latoken api endpoint
|
|
153675
|
+
* @param {boolean} [params.trigger] true if fetching a trigger order
|
|
153565
153676
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
153566
153677
|
*/
|
|
153567
153678
|
await this.loadMarkets();
|
|
153568
153679
|
const request = {
|
|
153569
153680
|
'id': id,
|
|
153570
153681
|
};
|
|
153571
|
-
const
|
|
153682
|
+
const isTrigger = this.safeValue2(params, 'trigger', 'stop');
|
|
153683
|
+
params = this.omit(params, ['stop', 'trigger']);
|
|
153684
|
+
let response = undefined;
|
|
153685
|
+
if (isTrigger) {
|
|
153686
|
+
response = await this.privateGetAuthStopOrderGetOrderId(this.extend(request, params));
|
|
153687
|
+
}
|
|
153688
|
+
else {
|
|
153689
|
+
response = await this.privateGetAuthOrderGetOrderId(this.extend(request, params));
|
|
153690
|
+
}
|
|
153572
153691
|
//
|
|
153573
153692
|
// {
|
|
153574
153693
|
// "id":"a76bd262-3560-4bfb-98ac-1cedd394f4fc",
|
|
@@ -153596,12 +153715,19 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153596
153715
|
* @method
|
|
153597
153716
|
* @name latoken#createOrder
|
|
153598
153717
|
* @description create a trade order
|
|
153718
|
+
* @see https://api.latoken.com/doc/v2/#tag/Order/operation/placeOrder
|
|
153719
|
+
* @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/placeStopOrder // stop
|
|
153599
153720
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
153600
153721
|
* @param {string} type 'market' or 'limit'
|
|
153601
153722
|
* @param {string} side 'buy' or 'sell'
|
|
153602
153723
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
153603
153724
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
153604
153725
|
* @param {object} [params] extra parameters specific to the latoken api endpoint
|
|
153726
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
153727
|
+
*
|
|
153728
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
153729
|
+
* @param {string} [params.condition] "GTC", "IOC", or "FOK"
|
|
153730
|
+
* @param {string} [params.clientOrderId] [ 0 .. 50 ] characters, client's custom order id (free field for your convenience)
|
|
153605
153731
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
153606
153732
|
*/
|
|
153607
153733
|
await this.loadMarkets();
|
|
@@ -153613,27 +153739,36 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153613
153739
|
'side': side.toUpperCase(),
|
|
153614
153740
|
'condition': 'GTC',
|
|
153615
153741
|
'type': uppercaseType,
|
|
153616
|
-
'clientOrderId': this.uuid(),
|
|
153742
|
+
'clientOrderId': this.uuid(),
|
|
153617
153743
|
// 'price': this.priceToPrecision (symbol, price),
|
|
153618
153744
|
// 'quantity': this.amountToPrecision (symbol, amount),
|
|
153745
|
+
'quantity': this.amountToPrecision(symbol, amount),
|
|
153746
|
+
'timestamp': this.seconds(),
|
|
153619
153747
|
};
|
|
153620
153748
|
if (uppercaseType === 'LIMIT') {
|
|
153621
153749
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
153622
153750
|
}
|
|
153623
|
-
|
|
153624
|
-
|
|
153625
|
-
|
|
153751
|
+
const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
|
|
153752
|
+
params = this.omit(params, ['triggerPrice', 'stopPrice']);
|
|
153753
|
+
let response = undefined;
|
|
153754
|
+
if (triggerPrice !== undefined) {
|
|
153755
|
+
request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
153756
|
+
response = await this.privatePostAuthStopOrderPlace(this.extend(request, params));
|
|
153757
|
+
}
|
|
153758
|
+
else {
|
|
153759
|
+
response = await this.privatePostAuthOrderPlace(this.extend(request, params));
|
|
153760
|
+
}
|
|
153626
153761
|
//
|
|
153627
|
-
//
|
|
153628
|
-
//
|
|
153629
|
-
//
|
|
153630
|
-
//
|
|
153631
|
-
//
|
|
153632
|
-
//
|
|
153633
|
-
//
|
|
153634
|
-
//
|
|
153635
|
-
//
|
|
153636
|
-
//
|
|
153762
|
+
// {
|
|
153763
|
+
// "baseCurrency": "f7dac554-8139-4ff6-841f-0e586a5984a0",
|
|
153764
|
+
// "quoteCurrency": "a5a7a7a9-e2a3-43f9-8754-29a02f6b709b",
|
|
153765
|
+
// "side": "BID",
|
|
153766
|
+
// "clientOrderId": "my-wonderful-order-number-71566",
|
|
153767
|
+
// "price": "10103.19",
|
|
153768
|
+
// "stopPrice": "10103.19",
|
|
153769
|
+
// "quantity": "3.21",
|
|
153770
|
+
// "timestamp": 1568185507
|
|
153771
|
+
// }
|
|
153637
153772
|
//
|
|
153638
153773
|
return this.parseOrder(response, market);
|
|
153639
153774
|
}
|
|
@@ -153642,16 +153777,27 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153642
153777
|
* @method
|
|
153643
153778
|
* @name latoken#cancelOrder
|
|
153644
153779
|
* @description cancels an open order
|
|
153780
|
+
* @see https://api.latoken.com/doc/v2/#tag/Order/operation/cancelOrder
|
|
153781
|
+
* @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/cancelStopOrder // stop
|
|
153645
153782
|
* @param {string} id order id
|
|
153646
153783
|
* @param {string} symbol not used by latoken cancelOrder ()
|
|
153647
153784
|
* @param {object} [params] extra parameters specific to the latoken api endpoint
|
|
153785
|
+
* @param {boolean} [params.trigger] true if cancelling a trigger order
|
|
153648
153786
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
153649
153787
|
*/
|
|
153650
153788
|
await this.loadMarkets();
|
|
153651
153789
|
const request = {
|
|
153652
153790
|
'id': id,
|
|
153653
153791
|
};
|
|
153654
|
-
const
|
|
153792
|
+
const isTrigger = this.safeValue2(params, 'trigger', 'stop');
|
|
153793
|
+
params = this.omit(params, ['stop', 'trigger']);
|
|
153794
|
+
let response = undefined;
|
|
153795
|
+
if (isTrigger) {
|
|
153796
|
+
response = await this.privatePostAuthStopOrderCancel(this.extend(request, params));
|
|
153797
|
+
}
|
|
153798
|
+
else {
|
|
153799
|
+
response = await this.privatePostAuthOrderCancel(this.extend(request, params));
|
|
153800
|
+
}
|
|
153655
153801
|
//
|
|
153656
153802
|
// {
|
|
153657
153803
|
// "id": "12345678-1234-1244-1244-123456789012",
|
|
@@ -153668,8 +153814,11 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153668
153814
|
* @method
|
|
153669
153815
|
* @name latoken#cancelAllOrders
|
|
153670
153816
|
* @description cancel all open orders in a market
|
|
153817
|
+
* @see https://api.latoken.com/doc/v2/#tag/Order/operation/cancelAllOrders
|
|
153818
|
+
* @see https://api.latoken.com/doc/v2/#tag/Order/operation/cancelAllOrdersByPair
|
|
153671
153819
|
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
153672
153820
|
* @param {object} [params] extra parameters specific to the latoken api endpoint
|
|
153821
|
+
* @param {boolean} [params.trigger] true if cancelling trigger orders
|
|
153673
153822
|
* @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
153674
153823
|
*/
|
|
153675
153824
|
await this.loadMarkets();
|
|
@@ -153677,15 +153826,29 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
153677
153826
|
// 'currency': market['baseId'],
|
|
153678
153827
|
// 'quote': market['quoteId'],
|
|
153679
153828
|
};
|
|
153680
|
-
let method = 'privatePostAuthOrderCancelAll';
|
|
153681
153829
|
let market = undefined;
|
|
153830
|
+
const isTrigger = this.safeValue2(params, 'trigger', 'stop');
|
|
153831
|
+
params = this.omit(params, ['stop', 'trigger']);
|
|
153832
|
+
let response = undefined;
|
|
153682
153833
|
if (symbol !== undefined) {
|
|
153683
153834
|
market = this.market(symbol);
|
|
153684
153835
|
request['currency'] = market['baseId'];
|
|
153685
153836
|
request['quote'] = market['quoteId'];
|
|
153686
|
-
|
|
153837
|
+
if (isTrigger) {
|
|
153838
|
+
response = await this.privatePostAuthStopOrderCancelAllCurrencyQuote(this.extend(request, params));
|
|
153839
|
+
}
|
|
153840
|
+
else {
|
|
153841
|
+
response = await this.privatePostAuthOrderCancelAllCurrencyQuote(this.extend(request, params));
|
|
153842
|
+
}
|
|
153843
|
+
}
|
|
153844
|
+
else {
|
|
153845
|
+
if (isTrigger) {
|
|
153846
|
+
response = await this.privatePostAuthStopOrderCancelAll(this.extend(request, params));
|
|
153847
|
+
}
|
|
153848
|
+
else {
|
|
153849
|
+
response = await this.privatePostAuthOrderCancelAll(this.extend(request, params));
|
|
153850
|
+
}
|
|
153687
153851
|
}
|
|
153688
|
-
const response = await this[method](this.extend(request, params));
|
|
153689
153852
|
//
|
|
153690
153853
|
// {
|
|
153691
153854
|
// "message":"cancellation request successfully submitted",
|
|
@@ -230365,8 +230528,8 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
230365
230528
|
// filter orders with no last trade id
|
|
230366
230529
|
for (let i = 0; i < rawOrders.length; i++) {
|
|
230367
230530
|
const rawOrder = rawOrders[i];
|
|
230368
|
-
const tradeId = this.safeString(rawOrder, 'tradeId');
|
|
230369
|
-
if (
|
|
230531
|
+
const tradeId = this.safeString(rawOrder, 'tradeId', '');
|
|
230532
|
+
if (tradeId.length > 0) {
|
|
230370
230533
|
const order = this.parseOrder(rawOrder);
|
|
230371
230534
|
filteredOrders.push(order);
|
|
230372
230535
|
}
|
|
@@ -273444,7 +273607,7 @@ SOFTWARE.
|
|
|
273444
273607
|
|
|
273445
273608
|
//-----------------------------------------------------------------------------
|
|
273446
273609
|
// this is updated by vss.js when building
|
|
273447
|
-
const version = '4.
|
|
273610
|
+
const version = '4.1.1';
|
|
273448
273611
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
|
|
273449
273612
|
//-----------------------------------------------------------------------------
|
|
273450
273613
|
|