ccxt 4.5.56 → 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.
Files changed (261) hide show
  1. package/README.md +10 -9
  2. package/dist/ccxt.browser.min.js +10 -10
  3. package/dist/cjs/ccxt.js +6 -11
  4. package/dist/cjs/src/apex.js +1 -1
  5. package/dist/cjs/src/arkham.js +3 -3
  6. package/dist/cjs/src/ascendex.js +2 -2
  7. package/dist/cjs/src/aster.js +7 -4
  8. package/dist/cjs/src/backpack.js +4 -4
  9. package/dist/cjs/src/base/Exchange.js +69 -32
  10. package/dist/cjs/src/base/functions/io.js +25 -0
  11. package/dist/cjs/src/base/functions.js +1 -0
  12. package/dist/cjs/src/bigone.js +3 -3
  13. package/dist/cjs/src/binance.js +192 -194
  14. package/dist/cjs/src/bingx.js +3 -3
  15. package/dist/cjs/src/bitfinex.js +71 -58
  16. package/dist/cjs/src/bitget.js +2 -2
  17. package/dist/cjs/src/bitmart.js +13 -6
  18. package/dist/cjs/src/bitmex.js +1 -1
  19. package/dist/cjs/src/bitopro.js +1 -1
  20. package/dist/cjs/src/bitrue.js +2 -2
  21. package/dist/cjs/src/bitso.js +1 -1
  22. package/dist/cjs/src/bitstamp.js +2 -1
  23. package/dist/cjs/src/bitteam.js +1 -1
  24. package/dist/cjs/src/bittrade.js +0 -1
  25. package/dist/cjs/src/bitvavo.js +457 -34
  26. package/dist/cjs/src/blofin.js +26 -3
  27. package/dist/cjs/src/bullish.js +6 -5
  28. package/dist/cjs/src/bydfi.js +1 -1
  29. package/dist/cjs/src/cex.js +3 -3
  30. package/dist/cjs/src/coinbase.js +75 -65
  31. package/dist/cjs/src/coinbaseexchange.js +2 -2
  32. package/dist/cjs/src/coinbaseinternational.js +2 -1
  33. package/dist/cjs/src/coinex.js +74 -74
  34. package/dist/cjs/src/coinmetro.js +1 -1
  35. package/dist/cjs/src/coinsph.js +1 -1
  36. package/dist/cjs/src/cryptocom.js +46 -48
  37. package/dist/cjs/src/cryptomus.js +43 -39
  38. package/dist/cjs/src/deepcoin.js +3 -2
  39. package/dist/cjs/src/delta.js +51 -52
  40. package/dist/cjs/src/deribit.js +31 -33
  41. package/dist/cjs/src/derive.js +26 -28
  42. package/dist/cjs/src/digifinex.js +43 -44
  43. package/dist/cjs/src/exmo.js +92 -83
  44. package/dist/cjs/src/extended.js +3497 -0
  45. package/dist/cjs/src/foxbit.js +71 -75
  46. package/dist/cjs/src/gate.js +53 -53
  47. package/dist/cjs/src/gemini.js +41 -43
  48. package/dist/cjs/src/grvt.js +4 -4
  49. package/dist/cjs/src/hashkey.js +52 -54
  50. package/dist/cjs/src/hitbtc.js +3 -13
  51. package/dist/cjs/src/hollaex.js +51 -54
  52. package/dist/cjs/src/htx.js +75 -67
  53. package/dist/cjs/src/hyperliquid.js +41 -42
  54. package/dist/cjs/src/indodax.js +2 -2
  55. package/dist/cjs/src/kraken.js +57 -58
  56. package/dist/cjs/src/kucoin.js +3 -2
  57. package/dist/cjs/src/latoken.js +30 -32
  58. package/dist/cjs/src/lbank.js +56 -56
  59. package/dist/cjs/src/lighter.js +35 -37
  60. package/dist/cjs/src/luno.js +35 -43
  61. package/dist/cjs/src/mexc.js +48 -49
  62. package/dist/cjs/src/modetrade.js +50 -52
  63. package/dist/cjs/src/ndax.js +35 -37
  64. package/dist/cjs/src/okx.js +17 -2
  65. package/dist/cjs/src/onetrading.js +21 -23
  66. package/dist/cjs/src/phemex.js +43 -45
  67. package/dist/cjs/src/poloniex.js +17 -12
  68. package/dist/cjs/src/pro/alpaca.js +1 -1
  69. package/dist/cjs/src/pro/apex.js +1 -1
  70. package/dist/cjs/src/pro/arkham.js +1 -1
  71. package/dist/cjs/src/pro/backpack.js +1 -1
  72. package/dist/cjs/src/pro/binance.js +3 -3
  73. package/dist/cjs/src/pro/bitget.js +1 -1
  74. package/dist/cjs/src/pro/bithumb.js +1 -1
  75. package/dist/cjs/src/pro/bitstamp.js +1 -1
  76. package/dist/cjs/src/pro/blockchaincom.js +1 -1
  77. package/dist/cjs/src/pro/bybit.js +1 -1
  78. package/dist/cjs/src/pro/cex.js +1 -1
  79. package/dist/cjs/src/pro/coinex.js +1 -1
  80. package/dist/cjs/src/pro/coinone.js +1 -1
  81. package/dist/cjs/src/pro/cryptocom.js +3 -1
  82. package/dist/cjs/src/pro/dydx.js +1 -1
  83. package/dist/cjs/src/pro/exmo.js +1 -1
  84. package/dist/cjs/src/pro/extended.js +865 -0
  85. package/dist/cjs/src/pro/gate.js +1 -1
  86. package/dist/cjs/src/pro/independentreserve.js +1 -1
  87. package/dist/cjs/src/pro/kucoin.js +1 -1
  88. package/dist/cjs/src/pro/luno.js +3 -3
  89. package/dist/cjs/src/pro/onetrading.js +1 -1
  90. package/dist/cjs/src/pro/toobit.js +1 -1
  91. package/dist/cjs/src/pro/weex.js +1 -1
  92. package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
  93. package/dist/cjs/src/tokocrypto.js +1 -1
  94. package/dist/cjs/src/toobit.js +2 -2
  95. package/dist/cjs/src/upbit.js +3 -3
  96. package/dist/cjs/src/weex.js +57 -62
  97. package/dist/cjs/src/whitebit.js +61 -63
  98. package/dist/cjs/src/woo.js +65 -54
  99. package/dist/cjs/src/woofipro.js +53 -47
  100. package/dist/cjs/src/xt.js +1 -1
  101. package/dist/cjs/src/zebpay.js +70 -72
  102. package/js/ccxt.d.ts +8 -14
  103. package/js/ccxt.js +6 -10
  104. package/js/src/abstract/bitvavo.d.ts +15 -7
  105. package/js/src/abstract/extended.d.ts +58 -0
  106. package/js/src/apex.js +1 -1
  107. package/js/src/arkham.js +3 -3
  108. package/js/src/ascendex.js +2 -2
  109. package/js/src/aster.js +7 -4
  110. package/js/src/backpack.js +4 -4
  111. package/js/src/base/Exchange.d.ts +10 -6
  112. package/js/src/base/Exchange.js +69 -32
  113. package/js/src/base/functions/io.d.ts +7 -0
  114. package/js/src/base/functions/io.js +24 -0
  115. package/js/src/bigone.js +3 -3
  116. package/js/src/binance.d.ts +2 -0
  117. package/js/src/binance.js +196 -198
  118. package/js/src/bingx.js +3 -3
  119. package/js/src/bitfinex.d.ts +2 -0
  120. package/js/src/bitfinex.js +71 -58
  121. package/js/src/bitget.js +2 -2
  122. package/js/src/bitmart.js +13 -6
  123. package/js/src/bitmex.js +1 -1
  124. package/js/src/bitopro.js +1 -1
  125. package/js/src/bitrue.js +2 -2
  126. package/js/src/bitso.js +1 -1
  127. package/js/src/bitstamp.js +2 -1
  128. package/js/src/bitteam.js +1 -1
  129. package/js/src/bittrade.js +0 -1
  130. package/js/src/bitvavo.d.ts +114 -21
  131. package/js/src/bitvavo.js +457 -34
  132. package/js/src/blofin.d.ts +1 -0
  133. package/js/src/blofin.js +26 -3
  134. package/js/src/bullish.js +6 -5
  135. package/js/src/bydfi.js +1 -1
  136. package/js/src/cex.js +3 -3
  137. package/js/src/coinbase.d.ts +63 -56
  138. package/js/src/coinbase.js +75 -65
  139. package/js/src/coinbaseexchange.js +2 -2
  140. package/js/src/coinbaseinternational.js +2 -1
  141. package/js/src/coinex.d.ts +1 -0
  142. package/js/src/coinex.js +74 -74
  143. package/js/src/coinmetro.d.ts +1 -1
  144. package/js/src/coinmetro.js +1 -1
  145. package/js/src/coinsph.js +1 -1
  146. package/js/src/cryptocom.d.ts +1 -0
  147. package/js/src/cryptocom.js +46 -48
  148. package/js/src/cryptomus.d.ts +2 -1
  149. package/js/src/cryptomus.js +43 -39
  150. package/js/src/deepcoin.js +3 -2
  151. package/js/src/delta.d.ts +1 -0
  152. package/js/src/delta.js +51 -52
  153. package/js/src/deribit.d.ts +1 -0
  154. package/js/src/deribit.js +31 -33
  155. package/js/src/derive.d.ts +1 -0
  156. package/js/src/derive.js +26 -28
  157. package/js/src/digifinex.d.ts +1 -0
  158. package/js/src/digifinex.js +43 -44
  159. package/js/src/exmo.d.ts +1 -0
  160. package/js/src/exmo.js +92 -83
  161. package/js/src/extended.d.ts +554 -0
  162. package/js/src/extended.js +3490 -0
  163. package/js/src/foxbit.d.ts +1 -0
  164. package/js/src/foxbit.js +71 -75
  165. package/js/src/gate.d.ts +1 -0
  166. package/js/src/gate.js +53 -53
  167. package/js/src/gemini.d.ts +2 -1
  168. package/js/src/gemini.js +41 -43
  169. package/js/src/grvt.js +4 -4
  170. package/js/src/hashkey.d.ts +1 -0
  171. package/js/src/hashkey.js +52 -54
  172. package/js/src/hitbtc.d.ts +0 -1
  173. package/js/src/hitbtc.js +3 -13
  174. package/js/src/hollaex.d.ts +1 -0
  175. package/js/src/hollaex.js +51 -54
  176. package/js/src/htx.d.ts +1 -0
  177. package/js/src/htx.js +75 -67
  178. package/js/src/hyperliquid.d.ts +1 -0
  179. package/js/src/hyperliquid.js +41 -42
  180. package/js/src/indodax.js +2 -2
  181. package/js/src/kraken.d.ts +2 -1
  182. package/js/src/kraken.js +57 -58
  183. package/js/src/kucoin.js +3 -2
  184. package/js/src/latoken.d.ts +1 -0
  185. package/js/src/latoken.js +30 -32
  186. package/js/src/lbank.d.ts +1 -0
  187. package/js/src/lbank.js +56 -56
  188. package/js/src/lighter.d.ts +1 -0
  189. package/js/src/lighter.js +35 -37
  190. package/js/src/luno.d.ts +1 -0
  191. package/js/src/luno.js +35 -43
  192. package/js/src/mexc.d.ts +2 -1
  193. package/js/src/mexc.js +48 -49
  194. package/js/src/modetrade.d.ts +1 -0
  195. package/js/src/modetrade.js +50 -52
  196. package/js/src/ndax.d.ts +1 -0
  197. package/js/src/ndax.js +35 -37
  198. package/js/src/okx.js +17 -2
  199. package/js/src/onetrading.d.ts +2 -1
  200. package/js/src/onetrading.js +21 -23
  201. package/js/src/phemex.d.ts +1 -0
  202. package/js/src/phemex.js +43 -45
  203. package/js/src/poloniex.js +17 -12
  204. package/js/src/pro/alpaca.js +1 -1
  205. package/js/src/pro/apex.js +1 -1
  206. package/js/src/pro/arkham.js +1 -1
  207. package/js/src/pro/backpack.js +1 -1
  208. package/js/src/pro/binance.js +3 -3
  209. package/js/src/pro/bitget.js +1 -1
  210. package/js/src/pro/bithumb.js +1 -1
  211. package/js/src/pro/bitstamp.js +1 -1
  212. package/js/src/pro/blockchaincom.js +1 -1
  213. package/js/src/pro/bybit.js +1 -1
  214. package/js/src/pro/cex.js +1 -1
  215. package/js/src/pro/coinex.js +1 -1
  216. package/js/src/pro/coinone.js +1 -1
  217. package/js/src/pro/cryptocom.js +3 -1
  218. package/js/src/pro/dydx.js +1 -1
  219. package/js/src/pro/exmo.js +1 -1
  220. package/js/src/pro/extended.d.ts +126 -0
  221. package/js/src/pro/extended.js +858 -0
  222. package/js/src/pro/gate.js +1 -1
  223. package/js/src/pro/independentreserve.js +1 -1
  224. package/js/src/pro/kucoin.js +1 -1
  225. package/js/src/pro/luno.d.ts +1 -1
  226. package/js/src/pro/luno.js +3 -3
  227. package/js/src/pro/onetrading.js +1 -1
  228. package/js/src/pro/toobit.js +1 -1
  229. package/js/src/pro/weex.js +1 -1
  230. package/js/src/tokocrypto.js +1 -1
  231. package/js/src/toobit.js +2 -2
  232. package/js/src/upbit.js +3 -3
  233. package/js/src/weex.d.ts +1 -0
  234. package/js/src/weex.js +57 -62
  235. package/js/src/whitebit.d.ts +1 -0
  236. package/js/src/whitebit.js +61 -63
  237. package/js/src/woo.d.ts +1 -0
  238. package/js/src/woo.js +65 -54
  239. package/js/src/woofipro.d.ts +1 -0
  240. package/js/src/woofipro.js +53 -47
  241. package/js/src/xt.js +1 -1
  242. package/js/src/zebpay.d.ts +2 -1
  243. package/js/src/zebpay.js +70 -72
  244. package/package.json +7 -7
  245. package/dist/cjs/src/gateio.js +0 -18
  246. package/dist/cjs/src/oxfun.js +0 -2933
  247. package/dist/cjs/src/pro/gateio.js +0 -18
  248. package/dist/cjs/src/pro/oxfun.js +0 -1113
  249. package/js/src/abstract/gateio.d.ts +0 -346
  250. package/js/src/abstract/gateio.js +0 -5
  251. package/js/src/abstract/oxfun.d.ts +0 -37
  252. package/js/src/gateio.d.ts +0 -4
  253. package/js/src/gateio.js +0 -11
  254. package/js/src/oxfun.d.ts +0 -442
  255. package/js/src/oxfun.js +0 -2926
  256. package/js/src/pro/gateio.d.ts +0 -4
  257. package/js/src/pro/gateio.js +0 -11
  258. package/js/src/pro/oxfun.d.ts +0 -234
  259. package/js/src/pro/oxfun.js +0 -1106
  260. /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
  261. /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
@@ -36,18 +36,23 @@ class bitvavo extends bitvavo$1["default"] {
36
36
  'borrowIsolatedMargin': false,
37
37
  'borrowMargin': false,
38
38
  'cancelAllOrders': true,
39
+ 'cancelAllOrdersAfter': true,
39
40
  'cancelOrder': true,
40
41
  'closeAllPositions': false,
41
42
  'closePosition': false,
43
+ 'createLimitOrder': true,
44
+ 'createMarketOrder': true,
45
+ 'createMarketOrderWithCost': true,
42
46
  'createOrder': true,
43
47
  'createOrderWithTakeProfitAndStopLoss': false,
44
48
  'createOrderWithTakeProfitAndStopLossWs': false,
45
- 'createPostOnlyOrder': false,
49
+ 'createPostOnlyOrder': true,
46
50
  'createReduceOnlyOrder': false,
47
51
  'createStopLimitOrder': true,
48
52
  'createStopMarketOrder': true,
49
53
  'createStopOrder': true,
50
54
  'editOrder': true,
55
+ 'fetchAccounts': true,
51
56
  'fetchBalance': true,
52
57
  'fetchBorrowInterest': false,
53
58
  'fetchBorrowRate': false,
@@ -75,6 +80,8 @@ class bitvavo extends bitvavo$1["default"] {
75
80
  'fetchIsolatedBorrowRate': false,
76
81
  'fetchIsolatedBorrowRates': false,
77
82
  'fetchIsolatedPositions': false,
83
+ 'fetchLedger': true,
84
+ 'fetchLedgerEntry': false,
78
85
  'fetchLeverage': false,
79
86
  'fetchLeverages': false,
80
87
  'fetchLeverageTiers': false,
@@ -114,10 +121,11 @@ class bitvavo extends bitvavo$1["default"] {
114
121
  'fetchTickers': true,
115
122
  'fetchTime': true,
116
123
  'fetchTrades': true,
117
- 'fetchTradingFee': false,
124
+ 'fetchTradingFee': true,
118
125
  'fetchTradingFees': true,
119
- 'fetchTransfer': false,
120
- 'fetchTransfers': false,
126
+ 'fetchTransactions': false,
127
+ 'fetchTransfer': true,
128
+ 'fetchTransfers': true,
121
129
  'fetchVolatilityHistory': false,
122
130
  'fetchWithdrawals': true,
123
131
  'reduceMargin': false,
@@ -128,7 +136,7 @@ class bitvavo extends bitvavo$1["default"] {
128
136
  'setMargin': false,
129
137
  'setMarginMode': false,
130
138
  'setPositionMode': false,
131
- 'transfer': false,
139
+ 'transfer': true,
132
140
  'withdraw': true,
133
141
  },
134
142
  'timeframes': {
@@ -158,38 +166,45 @@ class bitvavo extends bitvavo$1["default"] {
158
166
  'api': {
159
167
  'public': {
160
168
  'get': {
161
- 'time': 1,
162
- 'markets': 1,
163
- 'assets': 1,
164
169
  '{market}/book': 1,
170
+ 'report/{market}/book': 1,
165
171
  '{market}/trades': 5,
166
- '{market}/candles': 1,
172
+ 'report/{market}/trades': 5,
167
173
  'ticker/price': 1,
168
174
  'ticker/book': 1,
175
+ '{market}/candles': 1,
169
176
  'ticker/24h': { 'cost': 1, 'noMarket': 25 },
177
+ 'time': 1,
178
+ 'markets': 1,
179
+ 'assets': 1,
170
180
  },
171
181
  },
172
182
  'private': {
173
183
  'get': {
174
- 'account': 1,
175
184
  'order': 1,
176
- 'orders': 5,
177
185
  'ordersOpen': { 'cost': 5, 'noMarket': 100 },
178
186
  'trades': 5,
179
- 'balance': 5,
187
+ 'orders': 5,
180
188
  'deposit': 1,
181
189
  'depositHistory': 5,
182
190
  'withdrawalHistory': 5,
191
+ 'account': 1,
192
+ 'balance': 5,
193
+ 'stakingBalance': 1,
194
+ 'account/fees': 1,
195
+ 'account/history': 1,
183
196
  'subaccounts': 5,
184
197
  'subaccounts/transfers': 5,
185
198
  'subaccounts/transfers/{transferId}': 5,
186
199
  'institutional/subaccounts/balance': 5,
187
200
  'institutional/subaccounts/history': 5,
188
- 'institutional/subaccounts/orders/open': { 'cost': 1, 'noMarket': 25 },
201
+ 'institutional/subaccounts/orders/open': { 'cost': 5, 'noMarket': 100 },
189
202
  },
190
203
  'post': {
191
204
  'order': 1,
205
+ 'cancelOrdersAfter': 5,
192
206
  'withdrawal': 1,
207
+ 'crypto/withdrawal': 25,
193
208
  'subaccounts': 5,
194
209
  'subaccounts/transfers': 5,
195
210
  },
@@ -199,6 +214,7 @@ class bitvavo extends bitvavo$1["default"] {
199
214
  'delete': {
200
215
  'order': 1,
201
216
  'orders': { 'cost': 25, 'noMarket': 100 },
217
+ 'atomic/orders': 100,
202
218
  'institutional/subaccounts/order': 1,
203
219
  'institutional/subaccounts/orders': { 'cost': 25, 'noMarket': 100 },
204
220
  },
@@ -407,6 +423,7 @@ class bitvavo extends bitvavo$1["default"] {
407
423
  /**
408
424
  * @method
409
425
  * @name bitvavo#fetchTime
426
+ * @see https://docs.bitvavo.com/docs/rest-api/get-server-time/
410
427
  * @description fetches the current integer timestamp in milliseconds from the exchange server
411
428
  * @param {object} [params] extra parameters specific to the exchange API endpoint
412
429
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
@@ -421,7 +438,7 @@ class bitvavo extends bitvavo$1["default"] {
421
438
  /**
422
439
  * @method
423
440
  * @name bitvavo#fetchMarkets
424
- * @see https://docs.bitvavo.com/#tag/General/paths/~1markets/get
441
+ * @see https://docs.bitvavo.com/docs/rest-api/get-markets/
425
442
  * @description retrieves data on all markets for bitvavo
426
443
  * @param {object} [params] extra parameters specific to the exchange API endpoint
427
444
  * @returns {object[]} an array of objects representing market data
@@ -518,7 +535,7 @@ class bitvavo extends bitvavo$1["default"] {
518
535
  /**
519
536
  * @method
520
537
  * @name bitvavo#fetchCurrencies
521
- * @see https://docs.bitvavo.com/#tag/General/paths/~1assets/get
538
+ * @see https://docs.bitvavo.com/docs/rest-api/get-asset-data/
522
539
  * @description fetches all available currencies on an exchange
523
540
  * @param {object} [params] extra parameters specific to the exchange API endpoint
524
541
  * @returns {object} an associative dictionary of currencies
@@ -609,7 +626,7 @@ class bitvavo extends bitvavo$1["default"] {
609
626
  // btw, absolutely all of them have 1 network atm
610
627
  for (let j = 0; j < networksArray.length; j++) {
611
628
  const networkId = networksArray[j];
612
- const networkCode = this.networkIdToCode(networkId);
629
+ const networkCode = this.networkIdToCode(networkId, code);
613
630
  networks[networkCode] = {
614
631
  'info': rawCurrency,
615
632
  'id': networkId,
@@ -658,7 +675,7 @@ class bitvavo extends bitvavo$1["default"] {
658
675
  /**
659
676
  * @method
660
677
  * @name bitvavo#fetchTicker
661
- * @see https://docs.bitvavo.com/#tag/Market-Data/paths/~1ticker~124h/get
678
+ * @see https://docs.bitvavo.com/docs/rest-api/get-candlestick-data-24-h/
662
679
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
663
680
  * @param {string} symbol unified symbol of the market to fetch the ticker for
664
681
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -741,6 +758,7 @@ class bitvavo extends bitvavo$1["default"] {
741
758
  /**
742
759
  * @method
743
760
  * @name bitvavo#fetchTickers
761
+ * @see https://docs.bitvavo.com/docs/rest-api/get-candlestick-data-24-h/
744
762
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
745
763
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
746
764
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -772,7 +790,7 @@ class bitvavo extends bitvavo$1["default"] {
772
790
  /**
773
791
  * @method
774
792
  * @name bitvavo#fetchTrades
775
- * @see https://docs.bitvavo.com/#tag/Market-Data/paths/~1{market}~1trades/get
793
+ * @see https://docs.bitvavo.com/docs/rest-api/get-trades/
776
794
  * @description get the list of most recent trades for a particular symbol
777
795
  * @param {string} symbol unified symbol of the market to fetch trades for
778
796
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
@@ -918,7 +936,7 @@ class bitvavo extends bitvavo$1["default"] {
918
936
  /**
919
937
  * @method
920
938
  * @name bitvavo#fetchTradingFees
921
- * @see https://docs.bitvavo.com/#tag/Account/paths/~1account/get
939
+ * @see https://docs.bitvavo.com/docs/rest-api/get-account-fees/
922
940
  * @description fetch the trading fees for multiple markets
923
941
  * @param {object} [params] extra parameters specific to the exchange API endpoint
924
942
  * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure} indexed by market symbols
@@ -964,10 +982,46 @@ class bitvavo extends bitvavo$1["default"] {
964
982
  }
965
983
  return result;
966
984
  }
985
+ /**
986
+ * @method
987
+ * @name bitvavo#fetchTradingFee
988
+ * @see https://docs.bitvavo.com/docs/rest-api/get-market-fees/
989
+ * @description fetch the trading fees for a market
990
+ * @param {string} symbol unified market symbol
991
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
992
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/?id=fee-structure}
993
+ */
994
+ async fetchTradingFee(symbol, params = {}) {
995
+ await this.loadMarkets();
996
+ const market = this.market(symbol);
997
+ const request = {
998
+ 'market': market['id'],
999
+ };
1000
+ const response = await this.privateGetAccountFees(this.extend(request, params));
1001
+ //
1002
+ // {
1003
+ // "tier": "0",
1004
+ // "volume": "10000.00",
1005
+ // "taker": "0.0025",
1006
+ // "maker": "0.0015"
1007
+ // }
1008
+ //
1009
+ return this.parseTradingFee(response, market);
1010
+ }
1011
+ parseTradingFee(fee, market = undefined) {
1012
+ return {
1013
+ 'info': fee,
1014
+ 'symbol': this.safeSymbol(undefined, market),
1015
+ 'maker': this.safeNumber(fee, 'maker'),
1016
+ 'taker': this.safeNumber(fee, 'taker'),
1017
+ 'percentage': true,
1018
+ 'tierBased': true,
1019
+ };
1020
+ }
967
1021
  /**
968
1022
  * @method
969
1023
  * @name bitvavo#fetchOrderBook
970
- * @see https://docs.bitvavo.com/#tag/Market-Data/paths/~1{market}~1book/get
1024
+ * @see https://docs.bitvavo.com/docs/rest-api/get-order-book/
971
1025
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
972
1026
  * @param {string} symbol unified symbol of the market to fetch the order book for
973
1027
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -1054,7 +1108,7 @@ class bitvavo extends bitvavo$1["default"] {
1054
1108
  /**
1055
1109
  * @method
1056
1110
  * @name bitvavo#fetchOHLCV
1057
- * @see https://docs.bitvavo.com/#tag/Market-Data/paths/~1{market}~1candles/get
1111
+ * @see https://docs.bitvavo.com/docs/rest-api/get-candlestick-data/
1058
1112
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1059
1113
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1060
1114
  * @param {string} timeframe the length of time each candle represents
@@ -1104,7 +1158,7 @@ class bitvavo extends bitvavo$1["default"] {
1104
1158
  /**
1105
1159
  * @method
1106
1160
  * @name bitvavo#fetchBalance
1107
- * @see https://docs.bitvavo.com/#tag/Account/paths/~1balance/get
1161
+ * @see https://docs.bitvavo.com/docs/rest-api/get-account-balance/
1108
1162
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
1109
1163
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1110
1164
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
@@ -1123,9 +1177,237 @@ class bitvavo extends bitvavo$1["default"] {
1123
1177
  //
1124
1178
  return this.parseBalance(response);
1125
1179
  }
1180
+ /**
1181
+ * @method
1182
+ * @name bitvavo#fetchAccounts
1183
+ * @see https://docs.bitvavo.com/docs/institutional-api/get-subaccounts/
1184
+ * @description fetch all the accounts associated with a profile
1185
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
1186
+ * @returns {object[]} a list of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure}
1187
+ */
1188
+ async fetchAccounts(params = {}) {
1189
+ await this.loadMarkets();
1190
+ const response = await this.privateGetSubaccounts(params);
1191
+ //
1192
+ // {
1193
+ // "items": [
1194
+ // {
1195
+ // "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1196
+ // "type": "spot",
1197
+ // "status": "open",
1198
+ // "label": "string"
1199
+ // }
1200
+ // ],
1201
+ // "currentPage": 0,
1202
+ // "totalPages": 0,
1203
+ // "maxItems": 0
1204
+ // }
1205
+ //
1206
+ const accounts = this.safeList(response, 'items', []);
1207
+ return this.parseAccounts(accounts);
1208
+ }
1209
+ parseAccount(account) {
1210
+ return {
1211
+ 'id': this.safeString(account, 'id'),
1212
+ 'type': this.safeString(account, 'type'),
1213
+ 'code': undefined,
1214
+ 'info': account,
1215
+ };
1216
+ }
1217
+ /**
1218
+ * @method
1219
+ * @name bitvavo#transfer
1220
+ * @see https://docs.bitvavo.com/docs/institutional-api/create-transfer/
1221
+ * @description transfer currency internally between the master account and a subaccount
1222
+ * @param {string} code unified currency code
1223
+ * @param {float} amount amount to transfer
1224
+ * @param {string} fromAccount account to transfer from, either 'master' or the subaccount id
1225
+ * @param {string} toAccount account to transfer to, either 'master' or the subaccount id
1226
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
1227
+ * @param {string} [params.subaccountId] the unique identifier for the subaccount
1228
+ * @param {string} [params.clientRequestId] client defined unique id
1229
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
1230
+ */
1231
+ async transfer(code, amount, fromAccount, toAccount, params = {}) {
1232
+ await this.loadMarkets();
1233
+ const currency = this.currency(code);
1234
+ let subaccountId = this.safeString(params, 'subaccountId');
1235
+ params = this.omit(params, 'subaccountId');
1236
+ let direction = undefined;
1237
+ if ((fromAccount === 'master') && (toAccount === 'master')) {
1238
+ throw new errors.ArgumentsRequired(this.id + ' transfer() requires fromAccount and toAccount to be different (one master and one subaccount id)');
1239
+ }
1240
+ else if (fromAccount === 'master') {
1241
+ direction = 'masterToSub';
1242
+ if (subaccountId === undefined) {
1243
+ subaccountId = toAccount;
1244
+ }
1245
+ }
1246
+ else if (toAccount === 'master') {
1247
+ direction = 'subToMaster';
1248
+ if (subaccountId === undefined) {
1249
+ subaccountId = fromAccount;
1250
+ }
1251
+ }
1252
+ else {
1253
+ throw new errors.ArgumentsRequired(this.id + ' transfer() requires either fromAccount or toAccount to be master');
1254
+ }
1255
+ if (subaccountId === undefined) {
1256
+ throw new errors.ArgumentsRequired(this.id + ' transfer() requires a subaccount id (provide it as fromAccount/toAccount or params.subaccountId)');
1257
+ }
1258
+ const request = {
1259
+ 'subaccountId': subaccountId,
1260
+ 'direction': direction,
1261
+ 'symbol': currency['id'],
1262
+ 'amount': this.currencyToPrecision(code, amount),
1263
+ };
1264
+ const response = await this.privatePostSubaccountsTransfers(this.extend(request, params));
1265
+ //
1266
+ // {
1267
+ // "transferId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1268
+ // "clientRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1269
+ // "subaccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1270
+ // "direction": "masterToSub",
1271
+ // "symbol": "BTC",
1272
+ // "amount": "0.1",
1273
+ // "status": "completed",
1274
+ // "createdAt": "1700000000000"
1275
+ // }
1276
+ //
1277
+ return this.parseTransfer(response, currency);
1278
+ }
1279
+ /**
1280
+ * @method
1281
+ * @name bitvavo#fetchTransfers
1282
+ * @see https://docs.bitvavo.com/docs/institutional-api/get-transfers/
1283
+ * @description fetch a history of internal transfers made on an account
1284
+ * @param {string} [code] unified currency code of the currency transferred
1285
+ * @param {int} [since] the earliest time in ms to fetch transfers for
1286
+ * @param {int} [limit] the maximum number of transfers structures to retrieve
1287
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
1288
+ * @param {string} [params.subaccountId] the unique identifier for the subaccount
1289
+ * @param {int} [params.until] the latest time in ms to fetch transfers for
1290
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
1291
+ */
1292
+ async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
1293
+ await this.loadMarkets();
1294
+ let request = {};
1295
+ let currency = undefined;
1296
+ if (code !== undefined) {
1297
+ currency = this.currency(code);
1298
+ request['symbol'] = currency['id'];
1299
+ }
1300
+ const subaccountId = this.safeString(params, 'subaccountId');
1301
+ if (subaccountId === undefined) {
1302
+ throw new errors.ArgumentsRequired(this.id + ' fetchTransfers() requires a subaccountId parameter');
1303
+ }
1304
+ if (since !== undefined) {
1305
+ request['start'] = since;
1306
+ }
1307
+ if (limit !== undefined) {
1308
+ request['limit'] = limit;
1309
+ }
1310
+ [request, params] = this.handleUntilOption('end', request, params);
1311
+ const response = await this.privateGetSubaccountsTransfers(this.extend(request, params));
1312
+ //
1313
+ // {
1314
+ // "items": [
1315
+ // {
1316
+ // "transferId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1317
+ // "clientRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1318
+ // "subaccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1319
+ // "direction": "masterToSub",
1320
+ // "symbol": "BTC",
1321
+ // "amount": "0.1",
1322
+ // "status": "completed",
1323
+ // "createdAt": "1700000000000"
1324
+ // }
1325
+ // ],
1326
+ // "start": 0,
1327
+ // "end": 0,
1328
+ // "limit": 25
1329
+ // }
1330
+ //
1331
+ const items = this.safeList(response, 'items', []);
1332
+ return this.parseTransfers(items, currency, since, limit);
1333
+ }
1334
+ /**
1335
+ * @method
1336
+ * @name bitvavo#fetchTransfer
1337
+ * @see https://docs.bitvavo.com/docs/institutional-api/get-transfer/
1338
+ * @description fetches a transfer
1339
+ * @param {string} id transfer id
1340
+ * @param {string} [code] unified currency code of the currency transferred
1341
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
1342
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
1343
+ */
1344
+ async fetchTransfer(id, code = undefined, params = {}) {
1345
+ await this.loadMarkets();
1346
+ let currency = undefined;
1347
+ if (code !== undefined) {
1348
+ currency = this.currency(code);
1349
+ }
1350
+ const request = {
1351
+ 'transferId': id,
1352
+ };
1353
+ const response = await this.privateGetSubaccountsTransfersTransferId(this.extend(request, params));
1354
+ //
1355
+ // {
1356
+ // "transferId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1357
+ // "clientRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1358
+ // "subaccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1359
+ // "direction": "masterToSub",
1360
+ // "symbol": "BTC",
1361
+ // "amount": "0.1",
1362
+ // "status": "completed",
1363
+ // "createdAt": "1700000000000"
1364
+ // }
1365
+ //
1366
+ return this.parseTransfer(response, currency);
1367
+ }
1368
+ parseTransferStatus(status) {
1369
+ const statuses = {
1370
+ 'completed': 'ok',
1371
+ 'pending': 'pending',
1372
+ 'failed': 'failed',
1373
+ };
1374
+ return this.safeString(statuses, status, status);
1375
+ }
1376
+ parseTransfer(transfer, currency = undefined) {
1377
+ const currencyId = this.safeString(transfer, 'symbol');
1378
+ const code = this.safeCurrencyCode(currencyId, currency);
1379
+ const subaccountId = this.safeString(transfer, 'subaccountId');
1380
+ const direction = this.safeString(transfer, 'direction');
1381
+ let fromAccount = undefined;
1382
+ let toAccount = undefined;
1383
+ if (direction === 'masterToSub') {
1384
+ fromAccount = 'master';
1385
+ toAccount = subaccountId;
1386
+ }
1387
+ else if (direction === 'subToMaster') {
1388
+ fromAccount = subaccountId;
1389
+ toAccount = 'master';
1390
+ }
1391
+ let timestamp = this.safeInteger(transfer, 'createdAt');
1392
+ if (timestamp === undefined) {
1393
+ timestamp = this.parse8601(this.safeString(transfer, 'createdAt'));
1394
+ }
1395
+ return {
1396
+ 'info': transfer,
1397
+ 'id': this.safeString(transfer, 'transferId'),
1398
+ 'timestamp': timestamp,
1399
+ 'datetime': this.iso8601(timestamp),
1400
+ 'currency': code,
1401
+ 'amount': this.safeNumber(transfer, 'amount'),
1402
+ 'fromAccount': fromAccount,
1403
+ 'toAccount': toAccount,
1404
+ 'status': this.parseTransferStatus(this.safeString(transfer, 'status')),
1405
+ };
1406
+ }
1126
1407
  /**
1127
1408
  * @method
1128
1409
  * @name bitvavo#fetchDepositAddress
1410
+ * @see https://docs.bitvavo.com/docs/rest-api/get-deposit-data/
1129
1411
  * @description fetch the deposit address for a currency associated with this account
1130
1412
  * @param {string} code unified currency code
1131
1413
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1243,7 +1525,7 @@ class bitvavo extends bitvavo$1["default"] {
1243
1525
  * @method
1244
1526
  * @name bitvavo#createOrder
1245
1527
  * @description create a trade order
1246
- * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/post
1528
+ * @see https://docs.bitvavo.com/docs/rest-api/create-order/
1247
1529
  * @param {string} symbol unified symbol of the market to create an order in
1248
1530
  * @param {string} type 'market' or 'limit'
1249
1531
  * @param {string} side 'buy' or 'sell'
@@ -1351,7 +1633,7 @@ class bitvavo extends bitvavo$1["default"] {
1351
1633
  * @method
1352
1634
  * @name bitvavo#editOrder
1353
1635
  * @description edit a trade order
1354
- * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/put
1636
+ * @see https://docs.bitvavo.com/docs/rest-api/update-order/
1355
1637
  * @param {string} id cancel order id
1356
1638
  * @param {string} symbol unified symbol of the market to create an order in
1357
1639
  * @param {string} type 'market' or 'limit'
@@ -1393,9 +1675,8 @@ class bitvavo extends bitvavo$1["default"] {
1393
1675
  /**
1394
1676
  * @method
1395
1677
  * @name bitvavo#cancelOrder
1396
- * @see https://docs.bitvavo.com/#tag/Orders/paths/~1order/delete
1397
1678
  * @description cancels an open order
1398
- * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/delete
1679
+ * @see https://docs.bitvavo.com/docs/rest-api/cancel-order/
1399
1680
  * @param {string} id order id
1400
1681
  * @param {string} symbol unified symbol of the market the order was made in
1401
1682
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1416,7 +1697,7 @@ class bitvavo extends bitvavo$1["default"] {
1416
1697
  /**
1417
1698
  * @method
1418
1699
  * @name bitvavo#cancelAllOrders
1419
- * @see https://docs.bitvavo.com/#tag/Orders/paths/~1orders/delete
1700
+ * @see https://docs.bitvavo.com/docs/rest-api/cancel-orders/
1420
1701
  * @description cancel all open orders
1421
1702
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1422
1703
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1448,11 +1729,44 @@ class bitvavo extends bitvavo$1["default"] {
1448
1729
  //
1449
1730
  return this.parseOrders(response, market);
1450
1731
  }
1732
+ /**
1733
+ * @method
1734
+ * @name bitvavo#cancelAllOrdersAfter
1735
+ * @description dead man's switch, cancel all orders after the given timeout
1736
+ * @see https://docs.bitvavo.com/docs/rest-api/cancel-orders-after/
1737
+ * @param {number} timeout time in milliseconds, 0 represents cancel the timer
1738
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1739
+ * @param {int} [params.codGroupId] your identifier for a group of orders, default is 1
1740
+ * @returns {object} the api result
1741
+ */
1742
+ async cancelAllOrdersAfter(timeout, params = {}) {
1743
+ if (timeout > 300000) {
1744
+ throw new errors.BadRequest(this.id + ' cancelAllOrdersAfter() timeout should be less than or equal to 300000 milliseconds');
1745
+ }
1746
+ if ((timeout > 0) && (timeout < 10000)) {
1747
+ throw new errors.BadRequest(this.id + ' cancelAllOrdersAfter() timeout should be 0 or greater than or equal to 10000 milliseconds');
1748
+ }
1749
+ await this.loadMarkets();
1750
+ let codGroupId = undefined;
1751
+ [codGroupId, params] = this.handleOptionAndParams(params, 'cancelAllOrdersAfter', 'codGroupId', 1);
1752
+ const request = {
1753
+ 'codGroupId': codGroupId,
1754
+ 'expiryAfterSeconds': (timeout > 0) ? this.parseToInt(timeout / 1000) : 0,
1755
+ };
1756
+ const response = await this.privatePostCancelOrdersAfter(this.extend(request, params));
1757
+ //
1758
+ // {
1759
+ // "codGroupId": 1,
1760
+ // "timeOfExpirySeconds": 17202139111
1761
+ // }
1762
+ //
1763
+ return response;
1764
+ }
1451
1765
  /**
1452
1766
  * @method
1453
1767
  * @name bitvavo#fetchOrder
1454
1768
  * @description fetches information on an order made by the user
1455
- * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/get
1769
+ * @see https://docs.bitvavo.com/docs/rest-api/get-order/
1456
1770
  * @param {string} id the order id
1457
1771
  * @param {string} symbol unified symbol of the market the order was made in
1458
1772
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1530,7 +1844,7 @@ class bitvavo extends bitvavo$1["default"] {
1530
1844
  /**
1531
1845
  * @method
1532
1846
  * @name bitvavo#fetchOrders
1533
- * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1orders/get
1847
+ * @see https://docs.bitvavo.com/docs/rest-api/get-orders/
1534
1848
  * @description fetches information on multiple orders made by the user
1535
1849
  * @param {string} symbol unified market symbol of the market orders were made in
1536
1850
  * @param {int} [since] the earliest time in ms to fetch orders for
@@ -1594,7 +1908,7 @@ class bitvavo extends bitvavo$1["default"] {
1594
1908
  /**
1595
1909
  * @method
1596
1910
  * @name bitvavo#fetchOpenOrders
1597
- * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1ordersOpen/get
1911
+ * @see https://docs.bitvavo.com/docs/rest-api/get-open-orders/
1598
1912
  * @description fetch all unfilled currently open orders
1599
1913
  * @param {string} symbol unified market symbol
1600
1914
  * @param {int} [since] the earliest time in ms to fetch open orders for
@@ -1793,7 +2107,7 @@ class bitvavo extends bitvavo$1["default"] {
1793
2107
  /**
1794
2108
  * @method
1795
2109
  * @name bitvavo#fetchMyTrades
1796
- * @see https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1trades/get
2110
+ * @see https://docs.bitvavo.com/docs/rest-api/get-trade-history/
1797
2111
  * @description fetch all trades made by the user
1798
2112
  * @param {string} symbol unified market symbol
1799
2113
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -1835,6 +2149,114 @@ class bitvavo extends bitvavo$1["default"] {
1835
2149
  //
1836
2150
  return this.parseTrades(response, market, since, limit);
1837
2151
  }
2152
+ /**
2153
+ * @method
2154
+ * @name bitvavo#fetchLedger
2155
+ * @see https://docs.bitvavo.com/docs/rest-api/get-transaction-history/
2156
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
2157
+ * @param {string} [code] unified currency code
2158
+ * @param {int} [since] timestamp in ms of the earliest ledger entry
2159
+ * @param {int} [limit] max number of ledger entries to return
2160
+ * @param {object} [params] extra parameters specific to the bitvavo api endpoint
2161
+ * @param {int} [params.until] timestamp in ms of the latest ledger entry
2162
+ * @param {int} [params.page] the page number for the transaction history
2163
+ * @returns {object[]} a list of [ledger structures]{@link https://docs.ccxt.com/?id=ledger}
2164
+ */
2165
+ async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
2166
+ await this.loadMarkets();
2167
+ let request = {};
2168
+ let currency = undefined;
2169
+ if (code !== undefined) {
2170
+ currency = this.currency(code);
2171
+ }
2172
+ if (since !== undefined) {
2173
+ request['fromDate'] = since;
2174
+ }
2175
+ if (limit !== undefined) {
2176
+ request['maxItems'] = Math.min(limit, 100);
2177
+ }
2178
+ [request, params] = this.handleUntilOption('toDate', request, params);
2179
+ const response = await this.privateGetAccountHistory(this.extend(request, params));
2180
+ //
2181
+ // {
2182
+ // "items": [
2183
+ // {
2184
+ // "transactionId": "5f5e7b3b-4f5b-4b2d-8b2f-4f2b5b3f5e5f",
2185
+ // "executedAt": "2021-01-01T00:00:00.000Z",
2186
+ // "type": "sell",
2187
+ // "priceCurrency": "EUR",
2188
+ // "priceAmount": "1000.00",
2189
+ // "sentCurrency": "EUR",
2190
+ // "sentAmount": "0.1",
2191
+ // "receivedCurrency": "BTC",
2192
+ // "receivedAmount": "0.0001",
2193
+ // "feesCurrency": "EUR",
2194
+ // "feesAmount": "0.01",
2195
+ // "address": "string"
2196
+ // }
2197
+ // ],
2198
+ // "currentPage": 1,
2199
+ // "totalPages": 1,
2200
+ // "maxItems": 100
2201
+ // }
2202
+ //
2203
+ const items = this.safeList(response, 'items', []);
2204
+ return this.parseLedger(items, currency, since, limit);
2205
+ }
2206
+ parseLedgerEntryType(type) {
2207
+ const types = {
2208
+ 'buy': 'trade',
2209
+ 'sell': 'trade',
2210
+ 'deposit': 'transaction',
2211
+ 'withdrawal': 'transaction',
2212
+ 'withdrawal_cancelled': 'transaction',
2213
+ 'internal_transfer': 'transaction',
2214
+ 'external_transferred_funds': 'transaction',
2215
+ };
2216
+ return this.safeString(types, type, type);
2217
+ }
2218
+ parseLedgerEntry(item, currency = undefined) {
2219
+ const rawType = this.safeString(item, 'type');
2220
+ const type = this.parseLedgerEntryType(rawType);
2221
+ let currencyId = this.safeString(item, 'receivedCurrency');
2222
+ let amount = this.safeString(item, 'receivedAmount');
2223
+ let direction = 'in';
2224
+ if (amount === undefined) {
2225
+ currencyId = this.safeString(item, 'sentCurrency');
2226
+ amount = this.safeString(item, 'sentAmount');
2227
+ direction = 'out';
2228
+ }
2229
+ const code = this.safeCurrencyCode(currencyId);
2230
+ currency = this.safeCurrency(currencyId, currency);
2231
+ const timestamp = this.parse8601(this.safeString(item, 'executedAt'));
2232
+ let fee = undefined;
2233
+ const feeCost = this.safeString(item, 'feesAmount');
2234
+ if (feeCost !== undefined) {
2235
+ const feeCurrencyId = this.safeString(item, 'feesCurrency');
2236
+ const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId);
2237
+ fee = {
2238
+ 'cost': feeCost,
2239
+ 'currency': feeCurrencyCode,
2240
+ };
2241
+ }
2242
+ return this.safeLedgerEntry({
2243
+ 'info': item,
2244
+ 'id': this.safeString(item, 'transactionId'),
2245
+ 'direction': direction,
2246
+ 'account': undefined,
2247
+ 'referenceId': this.safeString(item, 'transactionId'),
2248
+ 'referenceAccount': this.safeString(item, 'address'),
2249
+ 'type': type,
2250
+ 'currency': code,
2251
+ 'amount': amount,
2252
+ 'timestamp': timestamp,
2253
+ 'datetime': this.iso8601(timestamp),
2254
+ 'before': undefined,
2255
+ 'after': undefined,
2256
+ 'status': 'ok',
2257
+ 'fee': fee,
2258
+ }, currency);
2259
+ }
1838
2260
  withdrawRequest(code, amount, address, tag = undefined, params = {}) {
1839
2261
  const currency = this.currency(code);
1840
2262
  const request = {
@@ -1852,6 +2274,7 @@ class bitvavo extends bitvavo$1["default"] {
1852
2274
  /**
1853
2275
  * @method
1854
2276
  * @name bitvavo#withdraw
2277
+ * @see https://docs.bitvavo.com/docs/rest-api/withdraw-assets/
1855
2278
  * @description make a withdrawal
1856
2279
  * @param {string} code unified currency code
1857
2280
  * @param {float} amount the amount to withdraw
@@ -1899,7 +2322,7 @@ class bitvavo extends bitvavo$1["default"] {
1899
2322
  /**
1900
2323
  * @method
1901
2324
  * @name bitvavo#fetchWithdrawals
1902
- * @see https://docs.bitvavo.com/#tag/Account/paths/~1withdrawalHistory/get
2325
+ * @see https://docs.bitvavo.com/docs/rest-api/get-withdrawal-history/
1903
2326
  * @description fetch all withdrawals made from an account
1904
2327
  * @param {string} code unified currency code
1905
2328
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
@@ -1954,7 +2377,7 @@ class bitvavo extends bitvavo$1["default"] {
1954
2377
  /**
1955
2378
  * @method
1956
2379
  * @name bitvavo#fetchDeposits
1957
- * @see https://docs.bitvavo.com/#tag/Account/paths/~1depositHistory/get
2380
+ * @see https://docs.bitvavo.com/docs/rest-api/get-deposit-history/
1958
2381
  * @description fetch all deposits made to an account
1959
2382
  * @param {string} code unified currency code
1960
2383
  * @param {int} [since] the earliest time in ms to fetch deposits for
@@ -2126,7 +2549,7 @@ class bitvavo extends bitvavo$1["default"] {
2126
2549
  * @method
2127
2550
  * @name bitvavo#fetchDepositWithdrawFees
2128
2551
  * @description fetch deposit and withdraw fees
2129
- * @see https://docs.bitvavo.com/#tag/General/paths/~1assets/get
2552
+ * @see https://docs.bitvavo.com/docs/rest-api/get-asset-data/
2130
2553
  * @param {string[]|undefined} codes list of unified currency codes
2131
2554
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2132
2555
  * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}