ccxt 4.1.55 → 4.1.57
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/.git-templates/hooks/pre-push +2 -2
- package/CONTRIBUTING.md +1 -1
- package/README.md +6 -6
- package/build.sh +30 -8
- package/dist/ccxt.browser.js +5592 -4907
- package/dist/ccxt.browser.min.js +13 -13
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +17 -13
- package/dist/cjs/src/alpaca.js +6 -6
- package/dist/cjs/src/ascendex.js +35 -29
- package/dist/cjs/src/base/Exchange.js +39 -26
- package/dist/cjs/src/base/Precise.js +1 -3
- package/dist/cjs/src/bigone.js +24 -20
- package/dist/cjs/src/binance.js +97 -76
- package/dist/cjs/src/bingx.js +63 -44
- package/dist/cjs/src/bit2c.js +18 -15
- package/dist/cjs/src/bitbank.js +17 -15
- package/dist/cjs/src/bitbns.js +28 -18
- package/dist/cjs/src/bitfinex.js +23 -21
- package/dist/cjs/src/bitfinex2.js +32 -28
- package/dist/cjs/src/bitflyer.js +28 -20
- package/dist/cjs/src/bitforex.js +25 -18
- package/dist/cjs/src/bitget.js +184 -147
- package/dist/cjs/src/bithumb.js +23 -16
- package/dist/cjs/src/bitmart.js +129 -94
- package/dist/cjs/src/bitmex.js +104 -64
- package/dist/cjs/src/bitopro.js +38 -26
- package/dist/cjs/src/bitpanda.js +24 -23
- package/dist/cjs/src/bitrue.js +33 -24
- package/dist/cjs/src/bitso.js +24 -23
- package/dist/cjs/src/bitstamp.js +24 -23
- package/dist/cjs/src/bittrex.js +30 -29
- package/dist/cjs/src/bitvavo.js +38 -30
- package/dist/cjs/src/bl3p.js +11 -10
- package/dist/cjs/src/blockchaincom.js +20 -20
- package/dist/cjs/src/btcalpha.js +18 -17
- package/dist/cjs/src/btcbox.js +13 -12
- package/dist/cjs/src/btcmarkets.js +20 -19
- package/dist/cjs/src/btcturk.js +14 -13
- package/dist/cjs/src/bybit.js +84 -54
- package/dist/cjs/src/cex.js +16 -14
- package/dist/cjs/src/coinbase.js +29 -27
- package/dist/cjs/src/coinbasepro.js +27 -25
- package/dist/cjs/src/coincheck.js +15 -14
- package/dist/cjs/src/coinex.js +101 -78
- package/dist/cjs/src/coinlist.js +28 -27
- package/dist/cjs/src/coinmate.js +20 -17
- package/dist/cjs/src/coinone.js +21 -16
- package/dist/cjs/src/coinsph.js +37 -28
- package/dist/cjs/src/coinspot.js +12 -11
- package/dist/cjs/src/cryptocom.js +40 -202
- package/dist/cjs/src/currencycom.js +32 -25
- package/dist/cjs/src/delta.js +34 -28
- package/dist/cjs/src/deribit.js +39 -36
- package/dist/cjs/src/digifinex.js +64 -44
- package/dist/cjs/src/exmo.js +29 -27
- package/dist/cjs/src/gate.js +67 -53
- package/dist/cjs/src/gemini.js +23 -20
- package/dist/cjs/src/hitbtc.js +65 -56
- package/dist/cjs/src/hollaex.js +30 -27
- package/dist/cjs/src/htx.js +135 -143
- package/dist/cjs/src/huobijp.js +22 -20
- package/dist/cjs/src/idex.js +22 -21
- package/dist/cjs/src/independentreserve.js +15 -14
- package/dist/cjs/src/indodax.js +30 -26
- package/dist/cjs/src/kraken.js +29 -27
- package/dist/cjs/src/krakenfutures.js +29 -22
- package/dist/cjs/src/kucoin.js +48 -43
- package/dist/cjs/src/kucoinfutures.js +33 -28
- package/dist/cjs/src/kuna.js +25 -24
- package/dist/cjs/src/latoken.js +24 -22
- package/dist/cjs/src/lbank.js +45 -30
- package/dist/cjs/src/luno.js +22 -19
- package/dist/cjs/src/lykke.js +19 -17
- package/dist/cjs/src/mercado.js +30 -19
- package/dist/cjs/src/mexc.js +60 -49
- package/dist/cjs/src/ndax.js +23 -22
- package/dist/cjs/src/novadax.js +23 -22
- package/dist/cjs/src/oceanex.js +22 -19
- package/dist/cjs/src/okcoin.js +29 -23
- package/dist/cjs/src/okx.js +92 -84
- package/dist/cjs/src/p2b.js +80 -83
- package/dist/cjs/src/paymium.js +10 -10
- package/dist/cjs/src/phemex.js +63 -40
- package/dist/cjs/src/poloniex.js +22 -22
- package/dist/cjs/src/poloniexfutures.js +23 -19
- package/dist/cjs/src/pro/alpaca.js +5 -5
- package/dist/cjs/src/pro/ascendex.js +4 -4
- package/dist/cjs/src/pro/binance.js +16 -16
- package/dist/cjs/src/pro/bingx.js +1 -1
- package/dist/cjs/src/pro/bitfinex.js +4 -4
- package/dist/cjs/src/pro/bitfinex2.js +6 -6
- package/dist/cjs/src/pro/bitget.js +7 -7
- package/dist/cjs/src/pro/bitmart.js +7 -5
- package/dist/cjs/src/pro/bitmex.js +6 -6
- package/dist/cjs/src/pro/bitopro.js +4 -4
- package/dist/cjs/src/pro/bitpanda.js +6 -6
- package/dist/cjs/src/pro/bitrue.js +2 -2
- package/dist/cjs/src/pro/bitstamp.js +6 -4
- package/dist/cjs/src/pro/bittrex.js +6 -6
- package/dist/cjs/src/pro/bitvavo.js +11 -7
- package/dist/cjs/src/pro/blockchaincom.js +8 -8
- package/dist/cjs/src/pro/bybit.js +7 -7
- package/dist/cjs/src/pro/cex.js +13 -9
- package/dist/cjs/src/pro/coinbase.js +5 -5
- package/dist/cjs/src/pro/coinbasepro.js +11 -10
- package/dist/cjs/src/pro/coinex.js +7 -9
- package/dist/cjs/src/pro/cryptocom.js +9 -9
- package/dist/cjs/src/pro/currencycom.js +4 -4
- package/dist/cjs/src/pro/deribit.js +6 -6
- package/dist/cjs/src/pro/exmo.js +12 -14
- package/dist/cjs/src/pro/gate.js +7 -7
- package/dist/cjs/src/pro/gemini.js +3 -3
- package/dist/cjs/src/pro/hitbtc.js +263 -4
- package/dist/cjs/src/pro/hollaex.js +5 -5
- package/dist/cjs/src/pro/htx.js +6 -6
- package/dist/cjs/src/pro/huobijp.js +3 -3
- package/dist/cjs/src/pro/idex.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +2 -2
- package/dist/cjs/src/pro/kraken.js +10 -10
- package/dist/cjs/src/pro/krakenfutures.js +41 -17
- package/dist/cjs/src/pro/kucoin.js +7 -7
- package/dist/cjs/src/pro/kucoinfutures.js +8 -6
- package/dist/cjs/src/pro/luno.js +2 -2
- package/dist/cjs/src/pro/mexc.js +6 -6
- package/dist/cjs/src/pro/ndax.js +3 -3
- package/dist/cjs/src/pro/okcoin.js +5 -5
- package/dist/cjs/src/pro/okx.js +12 -12
- package/dist/cjs/src/pro/phemex.js +6 -6
- package/dist/cjs/src/pro/poloniex.js +7 -7
- package/dist/cjs/src/pro/poloniexfutures.js +5 -5
- package/dist/cjs/src/pro/probit.js +6 -6
- package/dist/cjs/src/pro/upbit.js +3 -3
- package/dist/cjs/src/pro/wazirx.js +8 -8
- package/dist/cjs/src/pro/whitebit.js +12 -8
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/probit.js +28 -23
- package/dist/cjs/src/tidex.js +16 -15
- package/dist/cjs/src/timex.js +19 -18
- package/dist/cjs/src/tokocrypto.js +27 -22
- package/dist/cjs/src/upbit.js +19 -19
- package/dist/cjs/src/wavesexchange.js +22 -19
- package/dist/cjs/src/wazirx.js +24 -17
- package/dist/cjs/src/whitebit.js +33 -27
- package/dist/cjs/src/woo.js +44 -34
- package/dist/cjs/src/yobit.js +25 -20
- package/dist/cjs/src/zaif.js +9 -9
- package/dist/cjs/src/zonda.js +18 -17
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitbank.d.ts +1 -0
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/abstract/cryptocom.d.ts +0 -20
- package/js/src/abstract/htx.d.ts +3 -0
- package/js/src/abstract/huobi.d.ts +3 -0
- package/js/src/abstract/huobipro.d.ts +3 -0
- package/js/src/abstract/okex.d.ts +3 -1
- package/js/src/abstract/okex5.d.ts +3 -1
- package/js/src/abstract/okx.d.ts +3 -1
- package/js/src/ace.js +18 -14
- package/js/src/alpaca.js +6 -6
- package/js/src/ascendex.js +35 -29
- package/js/src/base/Exchange.d.ts +37 -34
- package/js/src/base/Exchange.js +39 -26
- package/js/src/base/Precise.d.ts +4 -4
- package/js/src/base/Precise.js +1 -3
- package/js/src/base/functions/type.d.ts +25 -25
- package/js/src/base/types.d.ts +21 -14
- package/js/src/bigone.js +25 -21
- package/js/src/binance.d.ts +2 -2
- package/js/src/binance.js +97 -76
- package/js/src/bingx.js +63 -44
- package/js/src/bit2c.js +19 -16
- package/js/src/bitbank.js +17 -15
- package/js/src/bitbns.js +28 -18
- package/js/src/bitfinex.js +23 -21
- package/js/src/bitfinex2.js +32 -28
- package/js/src/bitflyer.js +28 -20
- package/js/src/bitforex.js +26 -19
- package/js/src/bitget.d.ts +25 -3
- package/js/src/bitget.js +184 -147
- package/js/src/bithumb.js +23 -16
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmart.js +129 -94
- package/js/src/bitmex.d.ts +2 -2
- package/js/src/bitmex.js +104 -64
- package/js/src/bitopro.js +38 -26
- package/js/src/bitpanda.js +24 -23
- package/js/src/bitrue.js +33 -24
- package/js/src/bitso.js +24 -23
- package/js/src/bitstamp.d.ts +2 -2
- package/js/src/bitstamp.js +24 -23
- package/js/src/bittrex.js +30 -29
- package/js/src/bitvavo.js +38 -30
- package/js/src/bl3p.js +11 -10
- package/js/src/blockchaincom.js +20 -20
- package/js/src/btcalpha.js +18 -17
- package/js/src/btcbox.js +13 -12
- package/js/src/btcmarkets.js +20 -19
- package/js/src/btcturk.js +14 -13
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +84 -54
- package/js/src/cex.js +16 -14
- package/js/src/coinbase.js +29 -27
- package/js/src/coinbasepro.js +27 -25
- package/js/src/coincheck.js +15 -14
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +101 -78
- package/js/src/coinlist.js +28 -27
- package/js/src/coinmate.js +21 -18
- package/js/src/coinone.js +21 -16
- package/js/src/coinsph.js +37 -28
- package/js/src/coinspot.js +12 -11
- package/js/src/cryptocom.d.ts +0 -23
- package/js/src/cryptocom.js +40 -202
- package/js/src/currencycom.js +32 -25
- package/js/src/delta.js +35 -29
- package/js/src/deribit.js +39 -36
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/digifinex.js +65 -45
- package/js/src/exmo.js +29 -27
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +67 -53
- package/js/src/gemini.js +23 -20
- package/js/src/hitbtc.d.ts +1 -0
- package/js/src/hitbtc.js +65 -56
- package/js/src/hollaex.js +30 -27
- package/js/src/htx.d.ts +11 -3
- package/js/src/htx.js +135 -143
- package/js/src/huobijp.js +23 -21
- package/js/src/idex.js +22 -21
- package/js/src/independentreserve.js +15 -14
- package/js/src/indodax.js +30 -26
- package/js/src/kraken.js +29 -27
- package/js/src/krakenfutures.js +29 -22
- package/js/src/kucoin.d.ts +1 -1
- package/js/src/kucoin.js +48 -43
- package/js/src/kucoinfutures.js +33 -28
- package/js/src/kuna.js +25 -24
- package/js/src/latoken.js +25 -23
- package/js/src/lbank.js +46 -31
- package/js/src/luno.js +22 -19
- package/js/src/lykke.js +19 -17
- package/js/src/mercado.js +30 -19
- package/js/src/mexc.d.ts +1 -1
- package/js/src/mexc.js +60 -49
- package/js/src/ndax.js +23 -22
- package/js/src/novadax.js +23 -22
- package/js/src/oceanex.js +22 -19
- package/js/src/okcoin.js +29 -23
- package/js/src/okx.d.ts +2 -2
- package/js/src/okx.js +92 -84
- package/js/src/p2b.d.ts +8 -7
- package/js/src/p2b.js +80 -82
- package/js/src/paymium.js +10 -10
- package/js/src/phemex.js +63 -40
- package/js/src/poloniex.js +22 -22
- package/js/src/poloniexfutures.js +23 -19
- package/js/src/pro/alpaca.js +5 -5
- package/js/src/pro/ascendex.js +4 -4
- package/js/src/pro/binance.js +16 -16
- package/js/src/pro/bingx.js +1 -1
- package/js/src/pro/bitfinex.js +4 -4
- package/js/src/pro/bitfinex2.d.ts +1 -1
- package/js/src/pro/bitfinex2.js +6 -6
- package/js/src/pro/bitget.js +7 -7
- package/js/src/pro/bitmart.js +7 -5
- package/js/src/pro/bitmex.js +6 -6
- package/js/src/pro/bitopro.js +4 -4
- package/js/src/pro/bitpanda.js +6 -6
- package/js/src/pro/bitrue.js +2 -2
- package/js/src/pro/bitstamp.js +7 -5
- package/js/src/pro/bittrex.js +6 -6
- package/js/src/pro/bitvavo.js +12 -8
- package/js/src/pro/blockchaincom.js +8 -8
- package/js/src/pro/bybit.js +7 -7
- package/js/src/pro/cex.js +14 -10
- package/js/src/pro/coinbase.js +5 -5
- package/js/src/pro/coinbasepro.js +12 -11
- package/js/src/pro/coinex.js +7 -9
- package/js/src/pro/cryptocom.js +9 -9
- package/js/src/pro/currencycom.js +4 -4
- package/js/src/pro/deribit.js +6 -6
- package/js/src/pro/exmo.js +12 -14
- package/js/src/pro/gate.js +7 -7
- package/js/src/pro/gemini.js +3 -3
- package/js/src/pro/hitbtc.d.ts +8 -1
- package/js/src/pro/hitbtc.js +264 -5
- package/js/src/pro/hollaex.js +5 -5
- package/js/src/pro/htx.js +6 -6
- package/js/src/pro/huobijp.js +3 -3
- package/js/src/pro/idex.js +4 -4
- package/js/src/pro/independentreserve.js +2 -2
- package/js/src/pro/kraken.js +10 -10
- package/js/src/pro/krakenfutures.d.ts +1 -0
- package/js/src/pro/krakenfutures.js +42 -18
- package/js/src/pro/kucoin.js +7 -7
- package/js/src/pro/kucoinfutures.js +8 -6
- package/js/src/pro/luno.js +2 -2
- package/js/src/pro/mexc.js +6 -6
- package/js/src/pro/ndax.js +3 -3
- package/js/src/pro/okcoin.js +5 -5
- package/js/src/pro/okx.js +12 -12
- package/js/src/pro/phemex.js +6 -6
- package/js/src/pro/poloniex.js +7 -7
- package/js/src/pro/poloniexfutures.js +5 -5
- package/js/src/pro/probit.js +6 -6
- package/js/src/pro/upbit.js +3 -3
- package/js/src/pro/wazirx.js +8 -8
- package/js/src/pro/whitebit.js +13 -9
- package/js/src/pro/woo.js +1 -1
- package/js/src/probit.js +29 -24
- package/js/src/tidex.js +16 -15
- package/js/src/timex.js +19 -18
- package/js/src/tokocrypto.js +28 -23
- package/js/src/upbit.js +19 -19
- package/js/src/wavesexchange.js +23 -20
- package/js/src/wazirx.js +25 -18
- package/js/src/whitebit.js +33 -27
- package/js/src/woo.js +45 -35
- package/js/src/yobit.js +25 -20
- package/js/src/zaif.js +9 -9
- package/js/src/zonda.js +18 -17
- package/package.json +2 -2
- package/js/src/bitstamp1.d.ts +0 -28
- package/js/src/bitstamp1.js +0 -430
- package/js/src/lbank2.d.ts +0 -90
- package/js/src/lbank2.js +0 -2779
package/dist/cjs/src/cex.js
CHANGED
|
@@ -465,7 +465,7 @@ class cex extends cex$1 {
|
|
|
465
465
|
* @name cex#fetchBalance
|
|
466
466
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
467
467
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
468
|
-
* @returns {object} a [balance structure]{@link https://
|
|
468
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
469
469
|
*/
|
|
470
470
|
await this.loadMarkets();
|
|
471
471
|
const response = await this.privatePostBalance(params);
|
|
@@ -479,7 +479,7 @@ class cex extends cex$1 {
|
|
|
479
479
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
480
480
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
481
481
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
482
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
482
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
483
483
|
*/
|
|
484
484
|
await this.loadMarkets();
|
|
485
485
|
const market = this.market(symbol);
|
|
@@ -598,7 +598,7 @@ class cex extends cex$1 {
|
|
|
598
598
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
599
599
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
600
600
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
601
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
601
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
602
602
|
*/
|
|
603
603
|
await this.loadMarkets();
|
|
604
604
|
symbols = this.marketSymbols(symbols);
|
|
@@ -625,7 +625,7 @@ class cex extends cex$1 {
|
|
|
625
625
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
626
626
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
627
627
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
628
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
628
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
629
629
|
*/
|
|
630
630
|
await this.loadMarkets();
|
|
631
631
|
const market = this.market(symbol);
|
|
@@ -679,7 +679,7 @@ class cex extends cex$1 {
|
|
|
679
679
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
680
680
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
681
681
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
682
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
682
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
683
683
|
*/
|
|
684
684
|
await this.loadMarkets();
|
|
685
685
|
const market = this.market(symbol);
|
|
@@ -695,7 +695,7 @@ class cex extends cex$1 {
|
|
|
695
695
|
* @name cex#fetchTradingFees
|
|
696
696
|
* @description fetch the trading fees for multiple markets
|
|
697
697
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
698
|
-
* @returns {object} a dictionary of [fee structures]{@link https://
|
|
698
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
699
699
|
*/
|
|
700
700
|
await this.loadMarkets();
|
|
701
701
|
const response = await this.privatePostGetMyfee(params);
|
|
@@ -742,7 +742,7 @@ class cex extends cex$1 {
|
|
|
742
742
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
743
743
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
744
744
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
745
|
-
* @returns {object} an [order structure]{@link https://
|
|
745
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
746
746
|
*/
|
|
747
747
|
// for market buy it requires the amount of quote currency to spend
|
|
748
748
|
if ((type === 'market') && (side === 'buy')) {
|
|
@@ -821,7 +821,7 @@ class cex extends cex$1 {
|
|
|
821
821
|
* @param {string} id order id
|
|
822
822
|
* @param {string} symbol not used by cex cancelOrder ()
|
|
823
823
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
824
|
-
* @returns {object} An [order structure]{@link https://
|
|
824
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
825
825
|
*/
|
|
826
826
|
await this.loadMarkets();
|
|
827
827
|
const request = {
|
|
@@ -1106,7 +1106,7 @@ class cex extends cex$1 {
|
|
|
1106
1106
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1107
1107
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1108
1108
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
1109
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
1109
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1110
1110
|
*/
|
|
1111
1111
|
await this.loadMarkets();
|
|
1112
1112
|
const request = {};
|
|
@@ -1132,9 +1132,11 @@ class cex extends cex$1 {
|
|
|
1132
1132
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1133
1133
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1134
1134
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
1135
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
1135
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1136
1136
|
*/
|
|
1137
|
-
|
|
1137
|
+
if (symbol === undefined) {
|
|
1138
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
1139
|
+
}
|
|
1138
1140
|
await this.loadMarkets();
|
|
1139
1141
|
const method = 'privatePostArchivedOrdersPair';
|
|
1140
1142
|
const market = this.market(symbol);
|
|
@@ -1149,7 +1151,7 @@ class cex extends cex$1 {
|
|
|
1149
1151
|
* @description fetches information on an order made by the user
|
|
1150
1152
|
* @param {string} symbol not used by cex fetchOrder
|
|
1151
1153
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
1152
|
-
* @returns {object} An [order structure]{@link https://
|
|
1154
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1153
1155
|
*/
|
|
1154
1156
|
await this.loadMarkets();
|
|
1155
1157
|
const request = {
|
|
@@ -1268,7 +1270,7 @@ class cex extends cex$1 {
|
|
|
1268
1270
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1269
1271
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
1270
1272
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
1271
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
1273
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1272
1274
|
*/
|
|
1273
1275
|
await this.loadMarkets();
|
|
1274
1276
|
const market = this.market(symbol);
|
|
@@ -1511,7 +1513,7 @@ class cex extends cex$1 {
|
|
|
1511
1513
|
* @description fetch the deposit address for a currency associated with this account
|
|
1512
1514
|
* @param {string} code unified currency code
|
|
1513
1515
|
* @param {object} [params] extra parameters specific to the cex api endpoint
|
|
1514
|
-
* @returns {object} an [address structure]{@link https://
|
|
1516
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
1515
1517
|
*/
|
|
1516
1518
|
await this.loadMarkets();
|
|
1517
1519
|
const currency = this.currency(code);
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -50,13 +50,12 @@ class coinbase extends coinbase$1 {
|
|
|
50
50
|
'fetchAccounts': true,
|
|
51
51
|
'fetchBalance': true,
|
|
52
52
|
'fetchBidsAsks': true,
|
|
53
|
-
'fetchBorrowRate': false,
|
|
54
53
|
'fetchBorrowRateHistories': false,
|
|
55
54
|
'fetchBorrowRateHistory': false,
|
|
56
|
-
'fetchBorrowRates': false,
|
|
57
|
-
'fetchBorrowRatesPerSymbol': false,
|
|
58
55
|
'fetchCanceledOrders': true,
|
|
59
56
|
'fetchClosedOrders': true,
|
|
57
|
+
'fetchCrossBorrowRate': false,
|
|
58
|
+
'fetchCrossBorrowRates': false,
|
|
60
59
|
'fetchCurrencies': true,
|
|
61
60
|
'fetchDeposits': true,
|
|
62
61
|
'fetchFundingHistory': false,
|
|
@@ -64,6 +63,8 @@ class coinbase extends coinbase$1 {
|
|
|
64
63
|
'fetchFundingRateHistory': false,
|
|
65
64
|
'fetchFundingRates': false,
|
|
66
65
|
'fetchIndexOHLCV': false,
|
|
66
|
+
'fetchIsolatedBorrowRate': false,
|
|
67
|
+
'fetchIsolatedBorrowRates': false,
|
|
67
68
|
'fetchL2OrderBook': false,
|
|
68
69
|
'fetchLedger': true,
|
|
69
70
|
'fetchLeverage': false,
|
|
@@ -323,7 +324,7 @@ class coinbase extends coinbase$1 {
|
|
|
323
324
|
* @description fetch all the accounts associated with a profile
|
|
324
325
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
325
326
|
* @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)
|
|
326
|
-
* @returns {object} a dictionary of [account structures]{@link https://
|
|
327
|
+
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
327
328
|
*/
|
|
328
329
|
const method = this.safeString(this.options, 'fetchAccounts', 'fetchAccountsV3');
|
|
329
330
|
if (method === 'fetchAccountsV3') {
|
|
@@ -526,7 +527,7 @@ class coinbase extends coinbase$1 {
|
|
|
526
527
|
* @description create a currency deposit address
|
|
527
528
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
528
529
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
529
|
-
* @returns {object} an [address structure]{@link https://
|
|
530
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
530
531
|
*/
|
|
531
532
|
let accountId = this.safeString(params, 'account_id');
|
|
532
533
|
params = this.omit(params, 'account_id');
|
|
@@ -602,7 +603,7 @@ class coinbase extends coinbase$1 {
|
|
|
602
603
|
* @param {int} [since] timestamp in ms of the earliest sell, default is undefined
|
|
603
604
|
* @param {int} [limit] max number of sells to return, default is undefined
|
|
604
605
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
605
|
-
* @returns {object} a [list of order structures]{@link https://
|
|
606
|
+
* @returns {object} a [list of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
606
607
|
*/
|
|
607
608
|
// v2 did't have an endpoint for all historical trades
|
|
608
609
|
const request = this.prepareAccountRequest(limit, params);
|
|
@@ -620,7 +621,7 @@ class coinbase extends coinbase$1 {
|
|
|
620
621
|
* @param {int} [since] timestamp in ms of the earliest buy, default is undefined
|
|
621
622
|
* @param {int} [limit] max number of buys to return, default is undefined
|
|
622
623
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
623
|
-
* @returns {object} a list of [order structures]{@link https://
|
|
624
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
624
625
|
*/
|
|
625
626
|
// v2 did't have an endpoint for all historical trades
|
|
626
627
|
const request = this.prepareAccountRequest(limit, params);
|
|
@@ -645,7 +646,7 @@ class coinbase extends coinbase$1 {
|
|
|
645
646
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
646
647
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
647
648
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
648
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
649
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
649
650
|
*/
|
|
650
651
|
// fiat only, for crypto transactions use fetchLedger
|
|
651
652
|
return await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdWithdrawals', code, since, limit, params);
|
|
@@ -659,7 +660,7 @@ class coinbase extends coinbase$1 {
|
|
|
659
660
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
660
661
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
661
662
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
662
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
663
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
663
664
|
*/
|
|
664
665
|
// fiat only, for crypto transactions use fetchLedger
|
|
665
666
|
return await this.fetchTransactionsWithMethod('v2PrivateGetAccountsAccountIdDeposits', code, since, limit, params);
|
|
@@ -912,6 +913,7 @@ class coinbase extends coinbase$1 {
|
|
|
912
913
|
/**
|
|
913
914
|
* @method
|
|
914
915
|
* @name coinbase#fetchMarkets
|
|
916
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getproducts
|
|
915
917
|
* @description retrieves data on all markets for coinbase
|
|
916
918
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
917
919
|
* @returns {object[]} an array of objects representing market data
|
|
@@ -1088,7 +1090,7 @@ class coinbase extends coinbase$1 {
|
|
|
1088
1090
|
'optionType': undefined,
|
|
1089
1091
|
'precision': {
|
|
1090
1092
|
'amount': this.safeNumber(market, 'base_increment'),
|
|
1091
|
-
'price': this.
|
|
1093
|
+
'price': this.safeNumber2(market, 'price_increment', 'quote_increment'),
|
|
1092
1094
|
},
|
|
1093
1095
|
'limits': {
|
|
1094
1096
|
'leverage': {
|
|
@@ -1212,7 +1214,7 @@ class coinbase extends coinbase$1 {
|
|
|
1212
1214
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
1213
1215
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1214
1216
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
1215
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
1217
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1216
1218
|
*/
|
|
1217
1219
|
const method = this.safeString(this.options, 'fetchTickers', 'fetchTickersV3');
|
|
1218
1220
|
if (method === 'fetchTickersV3') {
|
|
@@ -1313,7 +1315,7 @@ class coinbase extends coinbase$1 {
|
|
|
1313
1315
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1314
1316
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1315
1317
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
1316
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
1318
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1317
1319
|
*/
|
|
1318
1320
|
const method = this.safeString(this.options, 'fetchTicker', 'fetchTickerV3');
|
|
1319
1321
|
if (method === 'fetchTickerV3') {
|
|
@@ -1536,7 +1538,7 @@ class coinbase extends coinbase$1 {
|
|
|
1536
1538
|
* @name coinbase#fetchBalance
|
|
1537
1539
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1538
1540
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
1539
|
-
* @returns {object} a [balance structure]{@link https://
|
|
1541
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1540
1542
|
*/
|
|
1541
1543
|
await this.loadMarkets();
|
|
1542
1544
|
const request = {
|
|
@@ -1594,7 +1596,7 @@ class coinbase extends coinbase$1 {
|
|
|
1594
1596
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1595
1597
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
1596
1598
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
1597
|
-
* @returns {object} a [ledger structure]{@link https://
|
|
1599
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
1598
1600
|
*/
|
|
1599
1601
|
await this.loadMarkets();
|
|
1600
1602
|
let currency = undefined;
|
|
@@ -2001,7 +2003,7 @@ class coinbase extends coinbase$1 {
|
|
|
2001
2003
|
* @param {string} [params.timeInForce] 'GTC', 'IOC', 'GTD' or 'PO'
|
|
2002
2004
|
* @param {string} [params.stop_direction] 'UNKNOWN_STOP_DIRECTION', 'STOP_DIRECTION_STOP_UP', 'STOP_DIRECTION_STOP_DOWN' the direction the stopPrice is triggered from
|
|
2003
2005
|
* @param {string} [params.end_time] '2023-05-25T17:01:05.092Z' for 'GTD' orders
|
|
2004
|
-
* @returns {object} an [order structure]{@link https://
|
|
2006
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2005
2007
|
*/
|
|
2006
2008
|
await this.loadMarkets();
|
|
2007
2009
|
const market = this.market(symbol);
|
|
@@ -2317,7 +2319,7 @@ class coinbase extends coinbase$1 {
|
|
|
2317
2319
|
* @param {string} id order id
|
|
2318
2320
|
* @param {string} symbol not used by coinbase cancelOrder()
|
|
2319
2321
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2320
|
-
* @returns {object} An [order structure]{@link https://
|
|
2322
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2321
2323
|
*/
|
|
2322
2324
|
await this.loadMarkets();
|
|
2323
2325
|
const orders = await this.cancelOrders([id], symbol, params);
|
|
@@ -2332,7 +2334,7 @@ class coinbase extends coinbase$1 {
|
|
|
2332
2334
|
* @param {string[]} ids order ids
|
|
2333
2335
|
* @param {string} symbol not used by coinbase cancelOrders()
|
|
2334
2336
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2335
|
-
* @returns {object} a list of [order structures]{@link https://
|
|
2337
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2336
2338
|
*/
|
|
2337
2339
|
await this.loadMarkets();
|
|
2338
2340
|
let market = undefined;
|
|
@@ -2377,7 +2379,7 @@ class coinbase extends coinbase$1 {
|
|
|
2377
2379
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
|
|
2378
2380
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2379
2381
|
* @param {boolean} [params.preview] default to false, wether to use the test/preview endpoint or not
|
|
2380
|
-
* @returns {object} an [order structure]{@link https://
|
|
2382
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2381
2383
|
*/
|
|
2382
2384
|
await this.loadMarkets();
|
|
2383
2385
|
const market = this.market(symbol);
|
|
@@ -2419,7 +2421,7 @@ class coinbase extends coinbase$1 {
|
|
|
2419
2421
|
* @param {string} id the order id
|
|
2420
2422
|
* @param {string} symbol unified market symbol that the order was made in
|
|
2421
2423
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2422
|
-
* @returns {object} An [order structure]{@link https://
|
|
2424
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2423
2425
|
*/
|
|
2424
2426
|
await this.loadMarkets();
|
|
2425
2427
|
let market = undefined;
|
|
@@ -2484,7 +2486,7 @@ class coinbase extends coinbase$1 {
|
|
|
2484
2486
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2485
2487
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
2486
2488
|
* @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)
|
|
2487
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
2489
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2488
2490
|
*/
|
|
2489
2491
|
await this.loadMarkets();
|
|
2490
2492
|
let paginate = false;
|
|
@@ -2651,7 +2653,7 @@ class coinbase extends coinbase$1 {
|
|
|
2651
2653
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2652
2654
|
* @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)
|
|
2653
2655
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
2654
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
2656
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2655
2657
|
*/
|
|
2656
2658
|
await this.loadMarkets();
|
|
2657
2659
|
let paginate = false;
|
|
@@ -2673,7 +2675,7 @@ class coinbase extends coinbase$1 {
|
|
|
2673
2675
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2674
2676
|
* @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)
|
|
2675
2677
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
2676
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
2678
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2677
2679
|
*/
|
|
2678
2680
|
await this.loadMarkets();
|
|
2679
2681
|
let paginate = false;
|
|
@@ -2693,7 +2695,7 @@ class coinbase extends coinbase$1 {
|
|
|
2693
2695
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
2694
2696
|
* @param {int} [limit] the maximum number of canceled order structures to retrieve
|
|
2695
2697
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2696
|
-
* @returns {object} a list of [order structures]{@link https://
|
|
2698
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2697
2699
|
*/
|
|
2698
2700
|
return await this.fetchOrdersByStatus('CANCELLED', symbol, since, limit, params);
|
|
2699
2701
|
}
|
|
@@ -2792,7 +2794,7 @@ class coinbase extends coinbase$1 {
|
|
|
2792
2794
|
* @param {int} [since] not used by coinbase fetchTrades
|
|
2793
2795
|
* @param {int} [limit] the maximum number of trade structures to fetch
|
|
2794
2796
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2795
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
2797
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2796
2798
|
*/
|
|
2797
2799
|
await this.loadMarkets();
|
|
2798
2800
|
const market = this.market(symbol);
|
|
@@ -2834,7 +2836,7 @@ class coinbase extends coinbase$1 {
|
|
|
2834
2836
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2835
2837
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
2836
2838
|
* @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)
|
|
2837
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
2839
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
2838
2840
|
*/
|
|
2839
2841
|
await this.loadMarkets();
|
|
2840
2842
|
let paginate = false;
|
|
@@ -2903,7 +2905,7 @@ class coinbase extends coinbase$1 {
|
|
|
2903
2905
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2904
2906
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
2905
2907
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2906
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
2908
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
2907
2909
|
*/
|
|
2908
2910
|
await this.loadMarkets();
|
|
2909
2911
|
const market = this.market(symbol);
|
|
@@ -2947,7 +2949,7 @@ class coinbase extends coinbase$1 {
|
|
|
2947
2949
|
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getbestbidask
|
|
2948
2950
|
* @param {string[]} [symbols] unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
2949
2951
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2950
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
2952
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2951
2953
|
*/
|
|
2952
2954
|
await this.loadMarkets();
|
|
2953
2955
|
symbols = this.marketSymbols(symbols);
|
|
@@ -422,7 +422,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
422
422
|
* @name coinbasepro#fetchAccounts
|
|
423
423
|
* @description fetch all the accounts associated with a profile
|
|
424
424
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
425
|
-
* @returns {object} a dictionary of [account structures]{@link https://
|
|
425
|
+
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
426
426
|
*/
|
|
427
427
|
await this.loadMarkets();
|
|
428
428
|
const response = await this.privateGetAccounts(params);
|
|
@@ -487,7 +487,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
487
487
|
* @name coinbasepro#fetchBalance
|
|
488
488
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
489
489
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
490
|
-
* @returns {object} a [balance structure]{@link https://
|
|
490
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
491
491
|
*/
|
|
492
492
|
await this.loadMarkets();
|
|
493
493
|
const response = await this.privateGetAccounts(params);
|
|
@@ -502,7 +502,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
502
502
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
503
503
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
504
504
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
505
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
505
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
506
506
|
*/
|
|
507
507
|
await this.loadMarkets();
|
|
508
508
|
// level 1 - only the best bid and ask
|
|
@@ -620,7 +620,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
620
620
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
621
621
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
622
622
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
623
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
623
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
624
624
|
*/
|
|
625
625
|
await this.loadMarkets();
|
|
626
626
|
symbols = this.marketSymbols(symbols);
|
|
@@ -667,7 +667,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
667
667
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
668
668
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
669
669
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
670
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
670
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
671
671
|
*/
|
|
672
672
|
await this.loadMarkets();
|
|
673
673
|
const market = this.market(symbol);
|
|
@@ -785,9 +785,11 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
785
785
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
786
786
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
787
787
|
* @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)
|
|
788
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
788
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
789
789
|
*/
|
|
790
|
-
|
|
790
|
+
if (symbol === undefined) {
|
|
791
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
792
|
+
}
|
|
791
793
|
let paginate = false;
|
|
792
794
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
793
795
|
if (paginate) {
|
|
@@ -822,7 +824,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
822
824
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
823
825
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
824
826
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
825
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
827
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
826
828
|
*/
|
|
827
829
|
await this.loadMarkets();
|
|
828
830
|
const market = this.market(symbol);
|
|
@@ -852,7 +854,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
852
854
|
* @name coinbasepro#fetchTradingFees
|
|
853
855
|
* @description fetch the trading fees for multiple markets
|
|
854
856
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
855
|
-
* @returns {object} a dictionary of [fee structures]{@link https://
|
|
857
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
856
858
|
*/
|
|
857
859
|
await this.loadMarkets();
|
|
858
860
|
const response = await this.privateGetFees(params);
|
|
@@ -944,7 +946,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
944
946
|
}
|
|
945
947
|
if (until === undefined) {
|
|
946
948
|
const parsedTimeframeMilliseconds = parsedTimeframe * 1000;
|
|
947
|
-
if (since % parsedTimeframeMilliseconds
|
|
949
|
+
if (this.isRoundNumber(since % parsedTimeframeMilliseconds)) {
|
|
948
950
|
request['end'] = this.iso8601(this.sum((limit - 1) * parsedTimeframeMilliseconds, since));
|
|
949
951
|
}
|
|
950
952
|
else {
|
|
@@ -1076,7 +1078,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1076
1078
|
* @description fetches information on an order made by the user
|
|
1077
1079
|
* @param {string} symbol not used by coinbasepro fetchOrder
|
|
1078
1080
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1079
|
-
* @returns {object} An [order structure]{@link https://
|
|
1081
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1080
1082
|
*/
|
|
1081
1083
|
await this.loadMarkets();
|
|
1082
1084
|
const request = {};
|
|
@@ -1104,7 +1106,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1104
1106
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1105
1107
|
* @param {int} [limit] the maximum number of trades to retrieve
|
|
1106
1108
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1107
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
1109
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
1108
1110
|
*/
|
|
1109
1111
|
await this.loadMarkets();
|
|
1110
1112
|
let market = undefined;
|
|
@@ -1128,7 +1130,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1128
1130
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
1129
1131
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1130
1132
|
* @param {int} [params.until] the latest time in ms to fetch open orders for
|
|
1131
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
1133
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1132
1134
|
*/
|
|
1133
1135
|
const request = {
|
|
1134
1136
|
'status': 'all',
|
|
@@ -1147,7 +1149,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1147
1149
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1148
1150
|
* @param {int} [params.until] the latest time in ms to fetch open orders for
|
|
1149
1151
|
* @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)
|
|
1150
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
1152
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1151
1153
|
*/
|
|
1152
1154
|
await this.loadMarkets();
|
|
1153
1155
|
let paginate = false;
|
|
@@ -1186,7 +1188,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1186
1188
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
1187
1189
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1188
1190
|
* @param {int} [params.until] the latest time in ms to fetch open orders for
|
|
1189
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
1191
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1190
1192
|
*/
|
|
1191
1193
|
const request = {
|
|
1192
1194
|
'status': 'done',
|
|
@@ -1205,7 +1207,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1205
1207
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1206
1208
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
1207
1209
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1208
|
-
* @returns {object} an [order structure]{@link https://
|
|
1210
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1209
1211
|
*/
|
|
1210
1212
|
await this.loadMarkets();
|
|
1211
1213
|
const market = this.market(symbol);
|
|
@@ -1298,7 +1300,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1298
1300
|
* @param {string} id order id
|
|
1299
1301
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1300
1302
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1301
|
-
* @returns {object} An [order structure]{@link https://
|
|
1303
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1302
1304
|
*/
|
|
1303
1305
|
await this.loadMarkets();
|
|
1304
1306
|
const request = {
|
|
@@ -1330,7 +1332,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1330
1332
|
* @description cancel all open orders
|
|
1331
1333
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1332
1334
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1333
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
1335
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1334
1336
|
*/
|
|
1335
1337
|
await this.loadMarkets();
|
|
1336
1338
|
const request = {};
|
|
@@ -1353,7 +1355,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1353
1355
|
* @param {float} amount The amount of currency to send in the deposit (e.g. `20`)
|
|
1354
1356
|
* @param {string} address Not used by coinbasepro
|
|
1355
1357
|
* @param {object} [params] Parameters specific to the exchange API endpoint (e.g. `{"network": "TRX"}`)
|
|
1356
|
-
* @returns a [transaction structure]{@link https://
|
|
1358
|
+
* @returns a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1357
1359
|
*/
|
|
1358
1360
|
await this.loadMarkets();
|
|
1359
1361
|
const currency = this.currency(code);
|
|
@@ -1395,7 +1397,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1395
1397
|
* @param {string} address the address to withdraw to
|
|
1396
1398
|
* @param {string} tag
|
|
1397
1399
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1398
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
1400
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1399
1401
|
*/
|
|
1400
1402
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
1401
1403
|
this.checkAddress(address);
|
|
@@ -1520,7 +1522,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1520
1522
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
1521
1523
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1522
1524
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
1523
|
-
* @returns {object} a [ledger structure]{@link https://
|
|
1525
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
1524
1526
|
*/
|
|
1525
1527
|
// https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
|
|
1526
1528
|
if (code === undefined) {
|
|
@@ -1572,7 +1574,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1572
1574
|
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
1573
1575
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1574
1576
|
* @param {string} [params.id] account id, when defined, the endpoint used is '/accounts/{account_id}/transfers/' instead of '/transfers/'
|
|
1575
|
-
* @returns {object} a list of [transaction structure]{@link https://
|
|
1577
|
+
* @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1576
1578
|
*/
|
|
1577
1579
|
await this.loadMarkets();
|
|
1578
1580
|
await this.loadAccounts();
|
|
@@ -1677,7 +1679,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1677
1679
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
1678
1680
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
1679
1681
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1680
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
1682
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1681
1683
|
*/
|
|
1682
1684
|
return await this.fetchDepositsWithdrawals(code, since, limit, this.extend({ 'type': 'deposit' }, params));
|
|
1683
1685
|
}
|
|
@@ -1690,7 +1692,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1690
1692
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
1691
1693
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
1692
1694
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1693
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
1695
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1694
1696
|
*/
|
|
1695
1697
|
return await this.fetchDepositsWithdrawals(code, since, limit, this.extend({ 'type': 'withdraw' }, params));
|
|
1696
1698
|
}
|
|
@@ -1798,7 +1800,7 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1798
1800
|
* @description create a currency deposit address
|
|
1799
1801
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
1800
1802
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1801
|
-
* @returns {object} an [address structure]{@link https://
|
|
1803
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
1802
1804
|
*/
|
|
1803
1805
|
await this.loadMarkets();
|
|
1804
1806
|
const currency = this.currency(code);
|