ccxt 4.5.55 → 4.5.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/README.md +215 -10
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/aftermath.js +10 -5
- package/dist/cjs/src/alpaca.js +2 -2
- package/dist/cjs/src/apex.js +26 -17
- package/dist/cjs/src/arkham.js +10 -7
- package/dist/cjs/src/ascendex.js +8 -5
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +72 -35
- package/dist/cjs/src/base/functions/io.js +25 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/bigone.js +10 -7
- package/dist/cjs/src/binance.js +196 -198
- package/dist/cjs/src/bingx.js +7 -7
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitflyer.js +2 -1
- package/dist/cjs/src/bitget.js +16 -5
- package/dist/cjs/src/bitmart.js +18 -10
- package/dist/cjs/src/bitmex.js +8 -5
- package/dist/cjs/src/bitopro.js +2 -2
- package/dist/cjs/src/bitrue.js +4 -3
- package/dist/cjs/src/bitso.js +7 -4
- package/dist/cjs/src/bitstamp.js +7 -4
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +2 -2
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +28 -4
- package/dist/cjs/src/bullish.js +6 -5
- package/dist/cjs/src/bybit.js +19 -17
- package/dist/cjs/src/bybiteu.js +1 -0
- package/dist/cjs/src/bydfi.js +1 -1
- package/dist/cjs/src/cex.js +3 -3
- package/dist/cjs/src/coinbase.js +75 -65
- package/dist/cjs/src/coinbaseexchange.js +4 -3
- package/dist/cjs/src/coinbaseinternational.js +17 -10
- package/dist/cjs/src/coinex.js +79 -77
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +5 -5
- package/dist/cjs/src/cryptocom.js +52 -54
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +9 -5
- package/dist/cjs/src/delta.js +53 -53
- package/dist/cjs/src/deribit.js +35 -35
- package/dist/cjs/src/derive.js +31 -31
- package/dist/cjs/src/digifinex.js +45 -45
- package/dist/cjs/src/exmo.js +104 -122
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +72 -76
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +45 -45
- package/dist/cjs/src/grvt.js +17 -11
- package/dist/cjs/src/hashkey.js +56 -58
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hitbtc.js +5 -14
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +84 -72
- package/dist/cjs/src/hyperliquid.js +60 -55
- package/dist/cjs/src/indodax.js +4 -3
- package/dist/cjs/src/kraken.js +71 -71
- package/dist/cjs/src/krakenfutures.js +2 -1
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +64 -60
- package/dist/cjs/src/lighter.js +36 -38
- package/dist/cjs/src/luno.js +36 -44
- package/dist/cjs/src/mercado.js +2 -1
- package/dist/cjs/src/mexc.js +72 -63
- package/dist/cjs/src/modetrade.js +51 -53
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +23 -5
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/p2b.js +8 -4
- package/dist/cjs/src/paradex.js +3 -2
- package/dist/cjs/src/phemex.js +47 -47
- package/dist/cjs/src/poloniex.js +19 -13
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +11 -2
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/aster.js +10 -9
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +6 -6
- package/dist/cjs/src/pro/bingx.js +7 -2
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +10 -0
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +3 -1
- package/dist/cjs/src/pro/dydx.js +1 -1
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/dist/cjs/src/pro/extended.js +865 -0
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/grvt.js +8 -0
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/krakenfutures.js +16 -4
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- package/dist/cjs/src/pro/modetrade.js +3 -3
- package/dist/cjs/src/pro/okx.js +4 -4
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/toobit.js +1 -1
- package/dist/cjs/src/pro/weex.js +1 -1
- package/dist/cjs/src/pro/woo.js +4 -4
- package/dist/cjs/src/pro/woofipro.js +3 -3
- package/dist/cjs/src/pro/xt.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
- package/dist/cjs/src/tokocrypto.js +1 -1
- package/dist/cjs/src/toobit.js +3 -3
- package/dist/cjs/src/upbit.js +3 -3
- package/dist/cjs/src/weex.js +57 -62
- package/dist/cjs/src/whitebit.js +61 -63
- package/dist/cjs/src/woo.js +66 -55
- package/dist/cjs/src/woofipro.js +54 -48
- package/dist/cjs/src/xt.js +3 -2
- package/dist/cjs/src/yobit.js +4 -2
- package/dist/cjs/src/zebpay.js +73 -75
- package/js/ccxt.d.ts +8 -14
- package/js/ccxt.js +6 -10
- package/js/src/abstract/bitvavo.d.ts +15 -7
- package/js/src/abstract/extended.d.ts +58 -0
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/aftermath.js +10 -5
- package/js/src/alpaca.js +2 -2
- package/js/src/apex.d.ts +1 -1
- package/js/src/apex.js +26 -17
- package/js/src/arkham.js +10 -7
- package/js/src/ascendex.js +8 -5
- package/js/src/aster.js +7 -4
- package/js/src/backpack.js +4 -4
- package/js/src/base/Exchange.d.ts +10 -6
- package/js/src/base/Exchange.js +72 -35
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +10 -7
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +200 -202
- package/js/src/bingx.js +7 -7
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitflyer.js +2 -1
- package/js/src/bitget.js +16 -5
- package/js/src/bitmart.js +18 -10
- package/js/src/bitmex.js +8 -5
- package/js/src/bitopro.js +2 -2
- package/js/src/bitrue.js +4 -3
- package/js/src/bitso.js +7 -4
- package/js/src/bitstamp.js +7 -4
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +2 -2
- package/js/src/bitvavo.d.ts +114 -21
- package/js/src/bitvavo.js +457 -34
- package/js/src/blofin.d.ts +1 -0
- package/js/src/blofin.js +28 -4
- package/js/src/bullish.js +6 -5
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +19 -17
- package/js/src/bybiteu.js +1 -0
- package/js/src/bydfi.js +1 -1
- package/js/src/cex.js +3 -3
- package/js/src/coinbase.d.ts +63 -56
- package/js/src/coinbase.js +75 -65
- package/js/src/coinbaseexchange.js +4 -3
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +17 -10
- package/js/src/coinex.d.ts +2 -1
- package/js/src/coinex.js +79 -77
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +5 -5
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +52 -54
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +9 -5
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +53 -53
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +35 -35
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +31 -31
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +45 -45
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +104 -122
- package/js/src/extended.d.ts +554 -0
- package/js/src/extended.js +3490 -0
- package/js/src/foxbit.d.ts +1 -0
- package/js/src/foxbit.js +72 -76
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +53 -53
- package/js/src/gemini.d.ts +2 -1
- package/js/src/gemini.js +45 -45
- package/js/src/grvt.d.ts +1 -1
- package/js/src/grvt.js +17 -11
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +56 -58
- package/js/src/hibachi.d.ts +1 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +5 -14
- package/js/src/hollaex.d.ts +1 -0
- package/js/src/hollaex.js +51 -54
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +84 -72
- package/js/src/hyperliquid.d.ts +5 -4
- package/js/src/hyperliquid.js +60 -55
- package/js/src/indodax.js +4 -3
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +71 -71
- package/js/src/krakenfutures.js +2 -1
- package/js/src/kucoin.js +3 -2
- package/js/src/latoken.d.ts +1 -0
- package/js/src/latoken.js +30 -32
- package/js/src/lbank.d.ts +1 -0
- package/js/src/lbank.js +64 -60
- package/js/src/lighter.d.ts +2 -1
- package/js/src/lighter.js +36 -38
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +36 -44
- package/js/src/mercado.js +2 -1
- package/js/src/mexc.d.ts +4 -3
- package/js/src/mexc.js +72 -63
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +51 -53
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +23 -5
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/p2b.js +8 -4
- package/js/src/paradex.js +3 -2
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +47 -47
- package/js/src/poloniex.js +19 -13
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +11 -2
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/aster.js +10 -9
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.d.ts +1 -1
- package/js/src/pro/binance.js +6 -6
- package/js/src/pro/bingx.js +7 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitmart.js +10 -0
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/blockchaincom.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/coinex.js +1 -1
- package/js/src/pro/coinone.js +1 -1
- package/js/src/pro/cryptocom.js +3 -1
- package/js/src/pro/dydx.js +1 -1
- package/js/src/pro/exmo.js +1 -1
- package/js/src/pro/extended.d.ts +126 -0
- package/js/src/pro/extended.js +858 -0
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/grvt.js +8 -0
- package/js/src/pro/htx.d.ts +4 -4
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/krakenfutures.d.ts +4 -4
- package/js/src/pro/krakenfutures.js +16 -4
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/luno.d.ts +1 -1
- package/js/src/pro/luno.js +3 -3
- package/js/src/pro/modetrade.d.ts +3 -3
- package/js/src/pro/modetrade.js +3 -3
- package/js/src/pro/okx.d.ts +4 -4
- package/js/src/pro/okx.js +4 -4
- package/js/src/pro/onetrading.js +1 -1
- package/js/src/pro/toobit.js +1 -1
- package/js/src/pro/weex.js +1 -1
- package/js/src/pro/woo.d.ts +4 -4
- package/js/src/pro/woo.js +4 -4
- package/js/src/pro/woofipro.d.ts +3 -3
- package/js/src/pro/woofipro.js +3 -3
- package/js/src/pro/xt.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.d.ts +1 -1
- package/js/src/toobit.js +3 -3
- package/js/src/upbit.js +3 -3
- package/js/src/weex.d.ts +1 -0
- package/js/src/weex.js +57 -62
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +61 -63
- package/js/src/woo.d.ts +1 -0
- package/js/src/woo.js +66 -55
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +54 -48
- package/js/src/xt.js +3 -2
- package/js/src/yobit.js +4 -2
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +73 -75
- package/package.json +25 -11
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2931
- package/dist/cjs/src/pro/gateio.js +0 -18
- package/dist/cjs/src/pro/oxfun.js +0 -1113
- package/js/src/abstract/gateio.d.ts +0 -346
- package/js/src/abstract/gateio.js +0 -5
- package/js/src/abstract/oxfun.d.ts +0 -37
- package/js/src/gateio.d.ts +0 -4
- package/js/src/gateio.js +0 -11
- package/js/src/oxfun.d.ts +0 -442
- package/js/src/oxfun.js +0 -2924
- package/js/src/pro/gateio.d.ts +0 -4
- package/js/src/pro/gateio.js +0 -11
- package/js/src/pro/oxfun.d.ts +0 -234
- package/js/src/pro/oxfun.js +0 -1106
- /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
- /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
package/js/src/bitvavo.js
CHANGED
|
@@ -31,18 +31,23 @@ export default class bitvavo extends Exchange {
|
|
|
31
31
|
'borrowIsolatedMargin': false,
|
|
32
32
|
'borrowMargin': false,
|
|
33
33
|
'cancelAllOrders': true,
|
|
34
|
+
'cancelAllOrdersAfter': true,
|
|
34
35
|
'cancelOrder': true,
|
|
35
36
|
'closeAllPositions': false,
|
|
36
37
|
'closePosition': false,
|
|
38
|
+
'createLimitOrder': true,
|
|
39
|
+
'createMarketOrder': true,
|
|
40
|
+
'createMarketOrderWithCost': true,
|
|
37
41
|
'createOrder': true,
|
|
38
42
|
'createOrderWithTakeProfitAndStopLoss': false,
|
|
39
43
|
'createOrderWithTakeProfitAndStopLossWs': false,
|
|
40
|
-
'createPostOnlyOrder':
|
|
44
|
+
'createPostOnlyOrder': true,
|
|
41
45
|
'createReduceOnlyOrder': false,
|
|
42
46
|
'createStopLimitOrder': true,
|
|
43
47
|
'createStopMarketOrder': true,
|
|
44
48
|
'createStopOrder': true,
|
|
45
49
|
'editOrder': true,
|
|
50
|
+
'fetchAccounts': true,
|
|
46
51
|
'fetchBalance': true,
|
|
47
52
|
'fetchBorrowInterest': false,
|
|
48
53
|
'fetchBorrowRate': false,
|
|
@@ -70,6 +75,8 @@ export default class bitvavo extends Exchange {
|
|
|
70
75
|
'fetchIsolatedBorrowRate': false,
|
|
71
76
|
'fetchIsolatedBorrowRates': false,
|
|
72
77
|
'fetchIsolatedPositions': false,
|
|
78
|
+
'fetchLedger': true,
|
|
79
|
+
'fetchLedgerEntry': false,
|
|
73
80
|
'fetchLeverage': false,
|
|
74
81
|
'fetchLeverages': false,
|
|
75
82
|
'fetchLeverageTiers': false,
|
|
@@ -109,10 +116,11 @@ export default class bitvavo extends Exchange {
|
|
|
109
116
|
'fetchTickers': true,
|
|
110
117
|
'fetchTime': true,
|
|
111
118
|
'fetchTrades': true,
|
|
112
|
-
'fetchTradingFee':
|
|
119
|
+
'fetchTradingFee': true,
|
|
113
120
|
'fetchTradingFees': true,
|
|
114
|
-
'
|
|
115
|
-
'
|
|
121
|
+
'fetchTransactions': false,
|
|
122
|
+
'fetchTransfer': true,
|
|
123
|
+
'fetchTransfers': true,
|
|
116
124
|
'fetchVolatilityHistory': false,
|
|
117
125
|
'fetchWithdrawals': true,
|
|
118
126
|
'reduceMargin': false,
|
|
@@ -123,7 +131,7 @@ export default class bitvavo extends Exchange {
|
|
|
123
131
|
'setMargin': false,
|
|
124
132
|
'setMarginMode': false,
|
|
125
133
|
'setPositionMode': false,
|
|
126
|
-
'transfer':
|
|
134
|
+
'transfer': true,
|
|
127
135
|
'withdraw': true,
|
|
128
136
|
},
|
|
129
137
|
'timeframes': {
|
|
@@ -153,38 +161,45 @@ export default class bitvavo extends Exchange {
|
|
|
153
161
|
'api': {
|
|
154
162
|
'public': {
|
|
155
163
|
'get': {
|
|
156
|
-
'time': 1,
|
|
157
|
-
'markets': 1,
|
|
158
|
-
'assets': 1,
|
|
159
164
|
'{market}/book': 1,
|
|
165
|
+
'report/{market}/book': 1,
|
|
160
166
|
'{market}/trades': 5,
|
|
161
|
-
'{market}/
|
|
167
|
+
'report/{market}/trades': 5,
|
|
162
168
|
'ticker/price': 1,
|
|
163
169
|
'ticker/book': 1,
|
|
170
|
+
'{market}/candles': 1,
|
|
164
171
|
'ticker/24h': { 'cost': 1, 'noMarket': 25 },
|
|
172
|
+
'time': 1,
|
|
173
|
+
'markets': 1,
|
|
174
|
+
'assets': 1,
|
|
165
175
|
},
|
|
166
176
|
},
|
|
167
177
|
'private': {
|
|
168
178
|
'get': {
|
|
169
|
-
'account': 1,
|
|
170
179
|
'order': 1,
|
|
171
|
-
'orders': 5,
|
|
172
180
|
'ordersOpen': { 'cost': 5, 'noMarket': 100 },
|
|
173
181
|
'trades': 5,
|
|
174
|
-
'
|
|
182
|
+
'orders': 5,
|
|
175
183
|
'deposit': 1,
|
|
176
184
|
'depositHistory': 5,
|
|
177
185
|
'withdrawalHistory': 5,
|
|
186
|
+
'account': 1,
|
|
187
|
+
'balance': 5,
|
|
188
|
+
'stakingBalance': 1,
|
|
189
|
+
'account/fees': 1,
|
|
190
|
+
'account/history': 1,
|
|
178
191
|
'subaccounts': 5,
|
|
179
192
|
'subaccounts/transfers': 5,
|
|
180
193
|
'subaccounts/transfers/{transferId}': 5,
|
|
181
194
|
'institutional/subaccounts/balance': 5,
|
|
182
195
|
'institutional/subaccounts/history': 5,
|
|
183
|
-
'institutional/subaccounts/orders/open': { 'cost':
|
|
196
|
+
'institutional/subaccounts/orders/open': { 'cost': 5, 'noMarket': 100 },
|
|
184
197
|
},
|
|
185
198
|
'post': {
|
|
186
199
|
'order': 1,
|
|
200
|
+
'cancelOrdersAfter': 5,
|
|
187
201
|
'withdrawal': 1,
|
|
202
|
+
'crypto/withdrawal': 25,
|
|
188
203
|
'subaccounts': 5,
|
|
189
204
|
'subaccounts/transfers': 5,
|
|
190
205
|
},
|
|
@@ -194,6 +209,7 @@ export default class bitvavo extends Exchange {
|
|
|
194
209
|
'delete': {
|
|
195
210
|
'order': 1,
|
|
196
211
|
'orders': { 'cost': 25, 'noMarket': 100 },
|
|
212
|
+
'atomic/orders': 100,
|
|
197
213
|
'institutional/subaccounts/order': 1,
|
|
198
214
|
'institutional/subaccounts/orders': { 'cost': 25, 'noMarket': 100 },
|
|
199
215
|
},
|
|
@@ -402,6 +418,7 @@ export default class bitvavo extends Exchange {
|
|
|
402
418
|
/**
|
|
403
419
|
* @method
|
|
404
420
|
* @name bitvavo#fetchTime
|
|
421
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-server-time/
|
|
405
422
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
406
423
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
407
424
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
@@ -416,7 +433,7 @@ export default class bitvavo extends Exchange {
|
|
|
416
433
|
/**
|
|
417
434
|
* @method
|
|
418
435
|
* @name bitvavo#fetchMarkets
|
|
419
|
-
* @see https://docs.bitvavo.com
|
|
436
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-markets/
|
|
420
437
|
* @description retrieves data on all markets for bitvavo
|
|
421
438
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
422
439
|
* @returns {object[]} an array of objects representing market data
|
|
@@ -513,7 +530,7 @@ export default class bitvavo extends Exchange {
|
|
|
513
530
|
/**
|
|
514
531
|
* @method
|
|
515
532
|
* @name bitvavo#fetchCurrencies
|
|
516
|
-
* @see https://docs.bitvavo.com
|
|
533
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-asset-data/
|
|
517
534
|
* @description fetches all available currencies on an exchange
|
|
518
535
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
519
536
|
* @returns {object} an associative dictionary of currencies
|
|
@@ -604,7 +621,7 @@ export default class bitvavo extends Exchange {
|
|
|
604
621
|
// btw, absolutely all of them have 1 network atm
|
|
605
622
|
for (let j = 0; j < networksArray.length; j++) {
|
|
606
623
|
const networkId = networksArray[j];
|
|
607
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
624
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
608
625
|
networks[networkCode] = {
|
|
609
626
|
'info': rawCurrency,
|
|
610
627
|
'id': networkId,
|
|
@@ -653,7 +670,7 @@ export default class bitvavo extends Exchange {
|
|
|
653
670
|
/**
|
|
654
671
|
* @method
|
|
655
672
|
* @name bitvavo#fetchTicker
|
|
656
|
-
* @see https://docs.bitvavo.com
|
|
673
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-candlestick-data-24-h/
|
|
657
674
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
658
675
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
659
676
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -736,6 +753,7 @@ export default class bitvavo extends Exchange {
|
|
|
736
753
|
/**
|
|
737
754
|
* @method
|
|
738
755
|
* @name bitvavo#fetchTickers
|
|
756
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-candlestick-data-24-h/
|
|
739
757
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
740
758
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
741
759
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -767,7 +785,7 @@ export default class bitvavo extends Exchange {
|
|
|
767
785
|
/**
|
|
768
786
|
* @method
|
|
769
787
|
* @name bitvavo#fetchTrades
|
|
770
|
-
* @see https://docs.bitvavo.com
|
|
788
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-trades/
|
|
771
789
|
* @description get the list of most recent trades for a particular symbol
|
|
772
790
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
773
791
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
@@ -913,7 +931,7 @@ export default class bitvavo extends Exchange {
|
|
|
913
931
|
/**
|
|
914
932
|
* @method
|
|
915
933
|
* @name bitvavo#fetchTradingFees
|
|
916
|
-
* @see https://docs.bitvavo.com
|
|
934
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-account-fees/
|
|
917
935
|
* @description fetch the trading fees for multiple markets
|
|
918
936
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
919
937
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure} indexed by market symbols
|
|
@@ -959,10 +977,46 @@ export default class bitvavo extends Exchange {
|
|
|
959
977
|
}
|
|
960
978
|
return result;
|
|
961
979
|
}
|
|
980
|
+
/**
|
|
981
|
+
* @method
|
|
982
|
+
* @name bitvavo#fetchTradingFee
|
|
983
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-market-fees/
|
|
984
|
+
* @description fetch the trading fees for a market
|
|
985
|
+
* @param {string} symbol unified market symbol
|
|
986
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
987
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/?id=fee-structure}
|
|
988
|
+
*/
|
|
989
|
+
async fetchTradingFee(symbol, params = {}) {
|
|
990
|
+
await this.loadMarkets();
|
|
991
|
+
const market = this.market(symbol);
|
|
992
|
+
const request = {
|
|
993
|
+
'market': market['id'],
|
|
994
|
+
};
|
|
995
|
+
const response = await this.privateGetAccountFees(this.extend(request, params));
|
|
996
|
+
//
|
|
997
|
+
// {
|
|
998
|
+
// "tier": "0",
|
|
999
|
+
// "volume": "10000.00",
|
|
1000
|
+
// "taker": "0.0025",
|
|
1001
|
+
// "maker": "0.0015"
|
|
1002
|
+
// }
|
|
1003
|
+
//
|
|
1004
|
+
return this.parseTradingFee(response, market);
|
|
1005
|
+
}
|
|
1006
|
+
parseTradingFee(fee, market = undefined) {
|
|
1007
|
+
return {
|
|
1008
|
+
'info': fee,
|
|
1009
|
+
'symbol': this.safeSymbol(undefined, market),
|
|
1010
|
+
'maker': this.safeNumber(fee, 'maker'),
|
|
1011
|
+
'taker': this.safeNumber(fee, 'taker'),
|
|
1012
|
+
'percentage': true,
|
|
1013
|
+
'tierBased': true,
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
962
1016
|
/**
|
|
963
1017
|
* @method
|
|
964
1018
|
* @name bitvavo#fetchOrderBook
|
|
965
|
-
* @see https://docs.bitvavo.com
|
|
1019
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-order-book/
|
|
966
1020
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
967
1021
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
968
1022
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
@@ -1049,7 +1103,7 @@ export default class bitvavo extends Exchange {
|
|
|
1049
1103
|
/**
|
|
1050
1104
|
* @method
|
|
1051
1105
|
* @name bitvavo#fetchOHLCV
|
|
1052
|
-
* @see https://docs.bitvavo.com
|
|
1106
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-candlestick-data/
|
|
1053
1107
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1054
1108
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1055
1109
|
* @param {string} timeframe the length of time each candle represents
|
|
@@ -1099,7 +1153,7 @@ export default class bitvavo extends Exchange {
|
|
|
1099
1153
|
/**
|
|
1100
1154
|
* @method
|
|
1101
1155
|
* @name bitvavo#fetchBalance
|
|
1102
|
-
* @see https://docs.bitvavo.com
|
|
1156
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-account-balance/
|
|
1103
1157
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1104
1158
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1105
1159
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
|
|
@@ -1118,9 +1172,237 @@ export default class bitvavo extends Exchange {
|
|
|
1118
1172
|
//
|
|
1119
1173
|
return this.parseBalance(response);
|
|
1120
1174
|
}
|
|
1175
|
+
/**
|
|
1176
|
+
* @method
|
|
1177
|
+
* @name bitvavo#fetchAccounts
|
|
1178
|
+
* @see https://docs.bitvavo.com/docs/institutional-api/get-subaccounts/
|
|
1179
|
+
* @description fetch all the accounts associated with a profile
|
|
1180
|
+
* @param {object} [params] extra parameters specific to the bitvavo api endpoint
|
|
1181
|
+
* @returns {object[]} a list of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure}
|
|
1182
|
+
*/
|
|
1183
|
+
async fetchAccounts(params = {}) {
|
|
1184
|
+
await this.loadMarkets();
|
|
1185
|
+
const response = await this.privateGetSubaccounts(params);
|
|
1186
|
+
//
|
|
1187
|
+
// {
|
|
1188
|
+
// "items": [
|
|
1189
|
+
// {
|
|
1190
|
+
// "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1191
|
+
// "type": "spot",
|
|
1192
|
+
// "status": "open",
|
|
1193
|
+
// "label": "string"
|
|
1194
|
+
// }
|
|
1195
|
+
// ],
|
|
1196
|
+
// "currentPage": 0,
|
|
1197
|
+
// "totalPages": 0,
|
|
1198
|
+
// "maxItems": 0
|
|
1199
|
+
// }
|
|
1200
|
+
//
|
|
1201
|
+
const accounts = this.safeList(response, 'items', []);
|
|
1202
|
+
return this.parseAccounts(accounts);
|
|
1203
|
+
}
|
|
1204
|
+
parseAccount(account) {
|
|
1205
|
+
return {
|
|
1206
|
+
'id': this.safeString(account, 'id'),
|
|
1207
|
+
'type': this.safeString(account, 'type'),
|
|
1208
|
+
'code': undefined,
|
|
1209
|
+
'info': account,
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* @method
|
|
1214
|
+
* @name bitvavo#transfer
|
|
1215
|
+
* @see https://docs.bitvavo.com/docs/institutional-api/create-transfer/
|
|
1216
|
+
* @description transfer currency internally between the master account and a subaccount
|
|
1217
|
+
* @param {string} code unified currency code
|
|
1218
|
+
* @param {float} amount amount to transfer
|
|
1219
|
+
* @param {string} fromAccount account to transfer from, either 'master' or the subaccount id
|
|
1220
|
+
* @param {string} toAccount account to transfer to, either 'master' or the subaccount id
|
|
1221
|
+
* @param {object} [params] extra parameters specific to the bitvavo api endpoint
|
|
1222
|
+
* @param {string} [params.subaccountId] the unique identifier for the subaccount
|
|
1223
|
+
* @param {string} [params.clientRequestId] client defined unique id
|
|
1224
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
1225
|
+
*/
|
|
1226
|
+
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
1227
|
+
await this.loadMarkets();
|
|
1228
|
+
const currency = this.currency(code);
|
|
1229
|
+
let subaccountId = this.safeString(params, 'subaccountId');
|
|
1230
|
+
params = this.omit(params, 'subaccountId');
|
|
1231
|
+
let direction = undefined;
|
|
1232
|
+
if ((fromAccount === 'master') && (toAccount === 'master')) {
|
|
1233
|
+
throw new ArgumentsRequired(this.id + ' transfer() requires fromAccount and toAccount to be different (one master and one subaccount id)');
|
|
1234
|
+
}
|
|
1235
|
+
else if (fromAccount === 'master') {
|
|
1236
|
+
direction = 'masterToSub';
|
|
1237
|
+
if (subaccountId === undefined) {
|
|
1238
|
+
subaccountId = toAccount;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
else if (toAccount === 'master') {
|
|
1242
|
+
direction = 'subToMaster';
|
|
1243
|
+
if (subaccountId === undefined) {
|
|
1244
|
+
subaccountId = fromAccount;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
else {
|
|
1248
|
+
throw new ArgumentsRequired(this.id + ' transfer() requires either fromAccount or toAccount to be master');
|
|
1249
|
+
}
|
|
1250
|
+
if (subaccountId === undefined) {
|
|
1251
|
+
throw new ArgumentsRequired(this.id + ' transfer() requires a subaccount id (provide it as fromAccount/toAccount or params.subaccountId)');
|
|
1252
|
+
}
|
|
1253
|
+
const request = {
|
|
1254
|
+
'subaccountId': subaccountId,
|
|
1255
|
+
'direction': direction,
|
|
1256
|
+
'symbol': currency['id'],
|
|
1257
|
+
'amount': this.currencyToPrecision(code, amount),
|
|
1258
|
+
};
|
|
1259
|
+
const response = await this.privatePostSubaccountsTransfers(this.extend(request, params));
|
|
1260
|
+
//
|
|
1261
|
+
// {
|
|
1262
|
+
// "transferId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1263
|
+
// "clientRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1264
|
+
// "subaccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1265
|
+
// "direction": "masterToSub",
|
|
1266
|
+
// "symbol": "BTC",
|
|
1267
|
+
// "amount": "0.1",
|
|
1268
|
+
// "status": "completed",
|
|
1269
|
+
// "createdAt": "1700000000000"
|
|
1270
|
+
// }
|
|
1271
|
+
//
|
|
1272
|
+
return this.parseTransfer(response, currency);
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* @method
|
|
1276
|
+
* @name bitvavo#fetchTransfers
|
|
1277
|
+
* @see https://docs.bitvavo.com/docs/institutional-api/get-transfers/
|
|
1278
|
+
* @description fetch a history of internal transfers made on an account
|
|
1279
|
+
* @param {string} [code] unified currency code of the currency transferred
|
|
1280
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
1281
|
+
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
1282
|
+
* @param {object} [params] extra parameters specific to the bitvavo api endpoint
|
|
1283
|
+
* @param {string} [params.subaccountId] the unique identifier for the subaccount
|
|
1284
|
+
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
1285
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
1286
|
+
*/
|
|
1287
|
+
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1288
|
+
await this.loadMarkets();
|
|
1289
|
+
let request = {};
|
|
1290
|
+
let currency = undefined;
|
|
1291
|
+
if (code !== undefined) {
|
|
1292
|
+
currency = this.currency(code);
|
|
1293
|
+
request['symbol'] = currency['id'];
|
|
1294
|
+
}
|
|
1295
|
+
const subaccountId = this.safeString(params, 'subaccountId');
|
|
1296
|
+
if (subaccountId === undefined) {
|
|
1297
|
+
throw new ArgumentsRequired(this.id + ' fetchTransfers() requires a subaccountId parameter');
|
|
1298
|
+
}
|
|
1299
|
+
if (since !== undefined) {
|
|
1300
|
+
request['start'] = since;
|
|
1301
|
+
}
|
|
1302
|
+
if (limit !== undefined) {
|
|
1303
|
+
request['limit'] = limit;
|
|
1304
|
+
}
|
|
1305
|
+
[request, params] = this.handleUntilOption('end', request, params);
|
|
1306
|
+
const response = await this.privateGetSubaccountsTransfers(this.extend(request, params));
|
|
1307
|
+
//
|
|
1308
|
+
// {
|
|
1309
|
+
// "items": [
|
|
1310
|
+
// {
|
|
1311
|
+
// "transferId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1312
|
+
// "clientRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1313
|
+
// "subaccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1314
|
+
// "direction": "masterToSub",
|
|
1315
|
+
// "symbol": "BTC",
|
|
1316
|
+
// "amount": "0.1",
|
|
1317
|
+
// "status": "completed",
|
|
1318
|
+
// "createdAt": "1700000000000"
|
|
1319
|
+
// }
|
|
1320
|
+
// ],
|
|
1321
|
+
// "start": 0,
|
|
1322
|
+
// "end": 0,
|
|
1323
|
+
// "limit": 25
|
|
1324
|
+
// }
|
|
1325
|
+
//
|
|
1326
|
+
const items = this.safeList(response, 'items', []);
|
|
1327
|
+
return this.parseTransfers(items, currency, since, limit);
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* @method
|
|
1331
|
+
* @name bitvavo#fetchTransfer
|
|
1332
|
+
* @see https://docs.bitvavo.com/docs/institutional-api/get-transfer/
|
|
1333
|
+
* @description fetches a transfer
|
|
1334
|
+
* @param {string} id transfer id
|
|
1335
|
+
* @param {string} [code] unified currency code of the currency transferred
|
|
1336
|
+
* @param {object} [params] extra parameters specific to the bitvavo api endpoint
|
|
1337
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
1338
|
+
*/
|
|
1339
|
+
async fetchTransfer(id, code = undefined, params = {}) {
|
|
1340
|
+
await this.loadMarkets();
|
|
1341
|
+
let currency = undefined;
|
|
1342
|
+
if (code !== undefined) {
|
|
1343
|
+
currency = this.currency(code);
|
|
1344
|
+
}
|
|
1345
|
+
const request = {
|
|
1346
|
+
'transferId': id,
|
|
1347
|
+
};
|
|
1348
|
+
const response = await this.privateGetSubaccountsTransfersTransferId(this.extend(request, params));
|
|
1349
|
+
//
|
|
1350
|
+
// {
|
|
1351
|
+
// "transferId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1352
|
+
// "clientRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1353
|
+
// "subaccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
1354
|
+
// "direction": "masterToSub",
|
|
1355
|
+
// "symbol": "BTC",
|
|
1356
|
+
// "amount": "0.1",
|
|
1357
|
+
// "status": "completed",
|
|
1358
|
+
// "createdAt": "1700000000000"
|
|
1359
|
+
// }
|
|
1360
|
+
//
|
|
1361
|
+
return this.parseTransfer(response, currency);
|
|
1362
|
+
}
|
|
1363
|
+
parseTransferStatus(status) {
|
|
1364
|
+
const statuses = {
|
|
1365
|
+
'completed': 'ok',
|
|
1366
|
+
'pending': 'pending',
|
|
1367
|
+
'failed': 'failed',
|
|
1368
|
+
};
|
|
1369
|
+
return this.safeString(statuses, status, status);
|
|
1370
|
+
}
|
|
1371
|
+
parseTransfer(transfer, currency = undefined) {
|
|
1372
|
+
const currencyId = this.safeString(transfer, 'symbol');
|
|
1373
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
1374
|
+
const subaccountId = this.safeString(transfer, 'subaccountId');
|
|
1375
|
+
const direction = this.safeString(transfer, 'direction');
|
|
1376
|
+
let fromAccount = undefined;
|
|
1377
|
+
let toAccount = undefined;
|
|
1378
|
+
if (direction === 'masterToSub') {
|
|
1379
|
+
fromAccount = 'master';
|
|
1380
|
+
toAccount = subaccountId;
|
|
1381
|
+
}
|
|
1382
|
+
else if (direction === 'subToMaster') {
|
|
1383
|
+
fromAccount = subaccountId;
|
|
1384
|
+
toAccount = 'master';
|
|
1385
|
+
}
|
|
1386
|
+
let timestamp = this.safeInteger(transfer, 'createdAt');
|
|
1387
|
+
if (timestamp === undefined) {
|
|
1388
|
+
timestamp = this.parse8601(this.safeString(transfer, 'createdAt'));
|
|
1389
|
+
}
|
|
1390
|
+
return {
|
|
1391
|
+
'info': transfer,
|
|
1392
|
+
'id': this.safeString(transfer, 'transferId'),
|
|
1393
|
+
'timestamp': timestamp,
|
|
1394
|
+
'datetime': this.iso8601(timestamp),
|
|
1395
|
+
'currency': code,
|
|
1396
|
+
'amount': this.safeNumber(transfer, 'amount'),
|
|
1397
|
+
'fromAccount': fromAccount,
|
|
1398
|
+
'toAccount': toAccount,
|
|
1399
|
+
'status': this.parseTransferStatus(this.safeString(transfer, 'status')),
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1121
1402
|
/**
|
|
1122
1403
|
* @method
|
|
1123
1404
|
* @name bitvavo#fetchDepositAddress
|
|
1405
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-deposit-data/
|
|
1124
1406
|
* @description fetch the deposit address for a currency associated with this account
|
|
1125
1407
|
* @param {string} code unified currency code
|
|
1126
1408
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1238,7 +1520,7 @@ export default class bitvavo extends Exchange {
|
|
|
1238
1520
|
* @method
|
|
1239
1521
|
* @name bitvavo#createOrder
|
|
1240
1522
|
* @description create a trade order
|
|
1241
|
-
* @see https://docs.bitvavo.com
|
|
1523
|
+
* @see https://docs.bitvavo.com/docs/rest-api/create-order/
|
|
1242
1524
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1243
1525
|
* @param {string} type 'market' or 'limit'
|
|
1244
1526
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -1346,7 +1628,7 @@ export default class bitvavo extends Exchange {
|
|
|
1346
1628
|
* @method
|
|
1347
1629
|
* @name bitvavo#editOrder
|
|
1348
1630
|
* @description edit a trade order
|
|
1349
|
-
* @see https://docs.bitvavo.com
|
|
1631
|
+
* @see https://docs.bitvavo.com/docs/rest-api/update-order/
|
|
1350
1632
|
* @param {string} id cancel order id
|
|
1351
1633
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
1352
1634
|
* @param {string} type 'market' or 'limit'
|
|
@@ -1388,9 +1670,8 @@ export default class bitvavo extends Exchange {
|
|
|
1388
1670
|
/**
|
|
1389
1671
|
* @method
|
|
1390
1672
|
* @name bitvavo#cancelOrder
|
|
1391
|
-
* @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/delete
|
|
1392
1673
|
* @description cancels an open order
|
|
1393
|
-
* @see https://docs.bitvavo.com
|
|
1674
|
+
* @see https://docs.bitvavo.com/docs/rest-api/cancel-order/
|
|
1394
1675
|
* @param {string} id order id
|
|
1395
1676
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1396
1677
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1411,7 +1692,7 @@ export default class bitvavo extends Exchange {
|
|
|
1411
1692
|
/**
|
|
1412
1693
|
* @method
|
|
1413
1694
|
* @name bitvavo#cancelAllOrders
|
|
1414
|
-
* @see https://docs.bitvavo.com
|
|
1695
|
+
* @see https://docs.bitvavo.com/docs/rest-api/cancel-orders/
|
|
1415
1696
|
* @description cancel all open orders
|
|
1416
1697
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1417
1698
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1443,11 +1724,44 @@ export default class bitvavo extends Exchange {
|
|
|
1443
1724
|
//
|
|
1444
1725
|
return this.parseOrders(response, market);
|
|
1445
1726
|
}
|
|
1727
|
+
/**
|
|
1728
|
+
* @method
|
|
1729
|
+
* @name bitvavo#cancelAllOrdersAfter
|
|
1730
|
+
* @description dead man's switch, cancel all orders after the given timeout
|
|
1731
|
+
* @see https://docs.bitvavo.com/docs/rest-api/cancel-orders-after/
|
|
1732
|
+
* @param {number} timeout time in milliseconds, 0 represents cancel the timer
|
|
1733
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1734
|
+
* @param {int} [params.codGroupId] your identifier for a group of orders, default is 1
|
|
1735
|
+
* @returns {object} the api result
|
|
1736
|
+
*/
|
|
1737
|
+
async cancelAllOrdersAfter(timeout, params = {}) {
|
|
1738
|
+
if (timeout > 300000) {
|
|
1739
|
+
throw new BadRequest(this.id + ' cancelAllOrdersAfter() timeout should be less than or equal to 300000 milliseconds');
|
|
1740
|
+
}
|
|
1741
|
+
if ((timeout > 0) && (timeout < 10000)) {
|
|
1742
|
+
throw new BadRequest(this.id + ' cancelAllOrdersAfter() timeout should be 0 or greater than or equal to 10000 milliseconds');
|
|
1743
|
+
}
|
|
1744
|
+
await this.loadMarkets();
|
|
1745
|
+
let codGroupId = undefined;
|
|
1746
|
+
[codGroupId, params] = this.handleOptionAndParams(params, 'cancelAllOrdersAfter', 'codGroupId', 1);
|
|
1747
|
+
const request = {
|
|
1748
|
+
'codGroupId': codGroupId,
|
|
1749
|
+
'expiryAfterSeconds': (timeout > 0) ? this.parseToInt(timeout / 1000) : 0,
|
|
1750
|
+
};
|
|
1751
|
+
const response = await this.privatePostCancelOrdersAfter(this.extend(request, params));
|
|
1752
|
+
//
|
|
1753
|
+
// {
|
|
1754
|
+
// "codGroupId": 1,
|
|
1755
|
+
// "timeOfExpirySeconds": 17202139111
|
|
1756
|
+
// }
|
|
1757
|
+
//
|
|
1758
|
+
return response;
|
|
1759
|
+
}
|
|
1446
1760
|
/**
|
|
1447
1761
|
* @method
|
|
1448
1762
|
* @name bitvavo#fetchOrder
|
|
1449
1763
|
* @description fetches information on an order made by the user
|
|
1450
|
-
* @see https://docs.bitvavo.com
|
|
1764
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-order/
|
|
1451
1765
|
* @param {string} id the order id
|
|
1452
1766
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1453
1767
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1525,7 +1839,7 @@ export default class bitvavo extends Exchange {
|
|
|
1525
1839
|
/**
|
|
1526
1840
|
* @method
|
|
1527
1841
|
* @name bitvavo#fetchOrders
|
|
1528
|
-
* @see https://docs.bitvavo.com
|
|
1842
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-orders/
|
|
1529
1843
|
* @description fetches information on multiple orders made by the user
|
|
1530
1844
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1531
1845
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -1589,7 +1903,7 @@ export default class bitvavo extends Exchange {
|
|
|
1589
1903
|
/**
|
|
1590
1904
|
* @method
|
|
1591
1905
|
* @name bitvavo#fetchOpenOrders
|
|
1592
|
-
* @see https://docs.bitvavo.com
|
|
1906
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-open-orders/
|
|
1593
1907
|
* @description fetch all unfilled currently open orders
|
|
1594
1908
|
* @param {string} symbol unified market symbol
|
|
1595
1909
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
@@ -1788,7 +2102,7 @@ export default class bitvavo extends Exchange {
|
|
|
1788
2102
|
/**
|
|
1789
2103
|
* @method
|
|
1790
2104
|
* @name bitvavo#fetchMyTrades
|
|
1791
|
-
* @see https://docs.bitvavo.com
|
|
2105
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-trade-history/
|
|
1792
2106
|
* @description fetch all trades made by the user
|
|
1793
2107
|
* @param {string} symbol unified market symbol
|
|
1794
2108
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -1830,6 +2144,114 @@ export default class bitvavo extends Exchange {
|
|
|
1830
2144
|
//
|
|
1831
2145
|
return this.parseTrades(response, market, since, limit);
|
|
1832
2146
|
}
|
|
2147
|
+
/**
|
|
2148
|
+
* @method
|
|
2149
|
+
* @name bitvavo#fetchLedger
|
|
2150
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-transaction-history/
|
|
2151
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2152
|
+
* @param {string} [code] unified currency code
|
|
2153
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
2154
|
+
* @param {int} [limit] max number of ledger entries to return
|
|
2155
|
+
* @param {object} [params] extra parameters specific to the bitvavo api endpoint
|
|
2156
|
+
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
2157
|
+
* @param {int} [params.page] the page number for the transaction history
|
|
2158
|
+
* @returns {object[]} a list of [ledger structures]{@link https://docs.ccxt.com/?id=ledger}
|
|
2159
|
+
*/
|
|
2160
|
+
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2161
|
+
await this.loadMarkets();
|
|
2162
|
+
let request = {};
|
|
2163
|
+
let currency = undefined;
|
|
2164
|
+
if (code !== undefined) {
|
|
2165
|
+
currency = this.currency(code);
|
|
2166
|
+
}
|
|
2167
|
+
if (since !== undefined) {
|
|
2168
|
+
request['fromDate'] = since;
|
|
2169
|
+
}
|
|
2170
|
+
if (limit !== undefined) {
|
|
2171
|
+
request['maxItems'] = Math.min(limit, 100);
|
|
2172
|
+
}
|
|
2173
|
+
[request, params] = this.handleUntilOption('toDate', request, params);
|
|
2174
|
+
const response = await this.privateGetAccountHistory(this.extend(request, params));
|
|
2175
|
+
//
|
|
2176
|
+
// {
|
|
2177
|
+
// "items": [
|
|
2178
|
+
// {
|
|
2179
|
+
// "transactionId": "5f5e7b3b-4f5b-4b2d-8b2f-4f2b5b3f5e5f",
|
|
2180
|
+
// "executedAt": "2021-01-01T00:00:00.000Z",
|
|
2181
|
+
// "type": "sell",
|
|
2182
|
+
// "priceCurrency": "EUR",
|
|
2183
|
+
// "priceAmount": "1000.00",
|
|
2184
|
+
// "sentCurrency": "EUR",
|
|
2185
|
+
// "sentAmount": "0.1",
|
|
2186
|
+
// "receivedCurrency": "BTC",
|
|
2187
|
+
// "receivedAmount": "0.0001",
|
|
2188
|
+
// "feesCurrency": "EUR",
|
|
2189
|
+
// "feesAmount": "0.01",
|
|
2190
|
+
// "address": "string"
|
|
2191
|
+
// }
|
|
2192
|
+
// ],
|
|
2193
|
+
// "currentPage": 1,
|
|
2194
|
+
// "totalPages": 1,
|
|
2195
|
+
// "maxItems": 100
|
|
2196
|
+
// }
|
|
2197
|
+
//
|
|
2198
|
+
const items = this.safeList(response, 'items', []);
|
|
2199
|
+
return this.parseLedger(items, currency, since, limit);
|
|
2200
|
+
}
|
|
2201
|
+
parseLedgerEntryType(type) {
|
|
2202
|
+
const types = {
|
|
2203
|
+
'buy': 'trade',
|
|
2204
|
+
'sell': 'trade',
|
|
2205
|
+
'deposit': 'transaction',
|
|
2206
|
+
'withdrawal': 'transaction',
|
|
2207
|
+
'withdrawal_cancelled': 'transaction',
|
|
2208
|
+
'internal_transfer': 'transaction',
|
|
2209
|
+
'external_transferred_funds': 'transaction',
|
|
2210
|
+
};
|
|
2211
|
+
return this.safeString(types, type, type);
|
|
2212
|
+
}
|
|
2213
|
+
parseLedgerEntry(item, currency = undefined) {
|
|
2214
|
+
const rawType = this.safeString(item, 'type');
|
|
2215
|
+
const type = this.parseLedgerEntryType(rawType);
|
|
2216
|
+
let currencyId = this.safeString(item, 'receivedCurrency');
|
|
2217
|
+
let amount = this.safeString(item, 'receivedAmount');
|
|
2218
|
+
let direction = 'in';
|
|
2219
|
+
if (amount === undefined) {
|
|
2220
|
+
currencyId = this.safeString(item, 'sentCurrency');
|
|
2221
|
+
amount = this.safeString(item, 'sentAmount');
|
|
2222
|
+
direction = 'out';
|
|
2223
|
+
}
|
|
2224
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
2225
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
2226
|
+
const timestamp = this.parse8601(this.safeString(item, 'executedAt'));
|
|
2227
|
+
let fee = undefined;
|
|
2228
|
+
const feeCost = this.safeString(item, 'feesAmount');
|
|
2229
|
+
if (feeCost !== undefined) {
|
|
2230
|
+
const feeCurrencyId = this.safeString(item, 'feesCurrency');
|
|
2231
|
+
const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId);
|
|
2232
|
+
fee = {
|
|
2233
|
+
'cost': feeCost,
|
|
2234
|
+
'currency': feeCurrencyCode,
|
|
2235
|
+
};
|
|
2236
|
+
}
|
|
2237
|
+
return this.safeLedgerEntry({
|
|
2238
|
+
'info': item,
|
|
2239
|
+
'id': this.safeString(item, 'transactionId'),
|
|
2240
|
+
'direction': direction,
|
|
2241
|
+
'account': undefined,
|
|
2242
|
+
'referenceId': this.safeString(item, 'transactionId'),
|
|
2243
|
+
'referenceAccount': this.safeString(item, 'address'),
|
|
2244
|
+
'type': type,
|
|
2245
|
+
'currency': code,
|
|
2246
|
+
'amount': amount,
|
|
2247
|
+
'timestamp': timestamp,
|
|
2248
|
+
'datetime': this.iso8601(timestamp),
|
|
2249
|
+
'before': undefined,
|
|
2250
|
+
'after': undefined,
|
|
2251
|
+
'status': 'ok',
|
|
2252
|
+
'fee': fee,
|
|
2253
|
+
}, currency);
|
|
2254
|
+
}
|
|
1833
2255
|
withdrawRequest(code, amount, address, tag = undefined, params = {}) {
|
|
1834
2256
|
const currency = this.currency(code);
|
|
1835
2257
|
const request = {
|
|
@@ -1847,6 +2269,7 @@ export default class bitvavo extends Exchange {
|
|
|
1847
2269
|
/**
|
|
1848
2270
|
* @method
|
|
1849
2271
|
* @name bitvavo#withdraw
|
|
2272
|
+
* @see https://docs.bitvavo.com/docs/rest-api/withdraw-assets/
|
|
1850
2273
|
* @description make a withdrawal
|
|
1851
2274
|
* @param {string} code unified currency code
|
|
1852
2275
|
* @param {float} amount the amount to withdraw
|
|
@@ -1894,7 +2317,7 @@ export default class bitvavo extends Exchange {
|
|
|
1894
2317
|
/**
|
|
1895
2318
|
* @method
|
|
1896
2319
|
* @name bitvavo#fetchWithdrawals
|
|
1897
|
-
* @see https://docs.bitvavo.com
|
|
2320
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-withdrawal-history/
|
|
1898
2321
|
* @description fetch all withdrawals made from an account
|
|
1899
2322
|
* @param {string} code unified currency code
|
|
1900
2323
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
@@ -1949,7 +2372,7 @@ export default class bitvavo extends Exchange {
|
|
|
1949
2372
|
/**
|
|
1950
2373
|
* @method
|
|
1951
2374
|
* @name bitvavo#fetchDeposits
|
|
1952
|
-
* @see https://docs.bitvavo.com
|
|
2375
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-deposit-history/
|
|
1953
2376
|
* @description fetch all deposits made to an account
|
|
1954
2377
|
* @param {string} code unified currency code
|
|
1955
2378
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
@@ -2121,7 +2544,7 @@ export default class bitvavo extends Exchange {
|
|
|
2121
2544
|
* @method
|
|
2122
2545
|
* @name bitvavo#fetchDepositWithdrawFees
|
|
2123
2546
|
* @description fetch deposit and withdraw fees
|
|
2124
|
-
* @see https://docs.bitvavo.com
|
|
2547
|
+
* @see https://docs.bitvavo.com/docs/rest-api/get-asset-data/
|
|
2125
2548
|
* @param {string[]|undefined} codes list of unified currency codes
|
|
2126
2549
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2127
2550
|
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}
|