ccxt 4.1.55 → 4.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/.git-templates/hooks/pre-push +2 -2
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +6 -6
  4. package/build.sh +30 -8
  5. package/dist/ccxt.browser.js +5592 -4907
  6. package/dist/ccxt.browser.min.js +13 -13
  7. package/dist/cjs/ccxt.js +1 -1
  8. package/dist/cjs/src/ace.js +17 -13
  9. package/dist/cjs/src/alpaca.js +6 -6
  10. package/dist/cjs/src/ascendex.js +35 -29
  11. package/dist/cjs/src/base/Exchange.js +39 -26
  12. package/dist/cjs/src/base/Precise.js +1 -3
  13. package/dist/cjs/src/bigone.js +24 -20
  14. package/dist/cjs/src/binance.js +97 -76
  15. package/dist/cjs/src/bingx.js +63 -44
  16. package/dist/cjs/src/bit2c.js +18 -15
  17. package/dist/cjs/src/bitbank.js +17 -15
  18. package/dist/cjs/src/bitbns.js +28 -18
  19. package/dist/cjs/src/bitfinex.js +23 -21
  20. package/dist/cjs/src/bitfinex2.js +32 -28
  21. package/dist/cjs/src/bitflyer.js +28 -20
  22. package/dist/cjs/src/bitforex.js +25 -18
  23. package/dist/cjs/src/bitget.js +184 -147
  24. package/dist/cjs/src/bithumb.js +23 -16
  25. package/dist/cjs/src/bitmart.js +129 -94
  26. package/dist/cjs/src/bitmex.js +104 -64
  27. package/dist/cjs/src/bitopro.js +38 -26
  28. package/dist/cjs/src/bitpanda.js +24 -23
  29. package/dist/cjs/src/bitrue.js +33 -24
  30. package/dist/cjs/src/bitso.js +24 -23
  31. package/dist/cjs/src/bitstamp.js +24 -23
  32. package/dist/cjs/src/bittrex.js +30 -29
  33. package/dist/cjs/src/bitvavo.js +38 -30
  34. package/dist/cjs/src/bl3p.js +11 -10
  35. package/dist/cjs/src/blockchaincom.js +20 -20
  36. package/dist/cjs/src/btcalpha.js +18 -17
  37. package/dist/cjs/src/btcbox.js +13 -12
  38. package/dist/cjs/src/btcmarkets.js +20 -19
  39. package/dist/cjs/src/btcturk.js +14 -13
  40. package/dist/cjs/src/bybit.js +84 -54
  41. package/dist/cjs/src/cex.js +16 -14
  42. package/dist/cjs/src/coinbase.js +29 -27
  43. package/dist/cjs/src/coinbasepro.js +27 -25
  44. package/dist/cjs/src/coincheck.js +15 -14
  45. package/dist/cjs/src/coinex.js +101 -78
  46. package/dist/cjs/src/coinlist.js +28 -27
  47. package/dist/cjs/src/coinmate.js +20 -17
  48. package/dist/cjs/src/coinone.js +21 -16
  49. package/dist/cjs/src/coinsph.js +37 -28
  50. package/dist/cjs/src/coinspot.js +12 -11
  51. package/dist/cjs/src/cryptocom.js +40 -202
  52. package/dist/cjs/src/currencycom.js +32 -25
  53. package/dist/cjs/src/delta.js +34 -28
  54. package/dist/cjs/src/deribit.js +39 -36
  55. package/dist/cjs/src/digifinex.js +64 -44
  56. package/dist/cjs/src/exmo.js +29 -27
  57. package/dist/cjs/src/gate.js +67 -53
  58. package/dist/cjs/src/gemini.js +23 -20
  59. package/dist/cjs/src/hitbtc.js +65 -56
  60. package/dist/cjs/src/hollaex.js +30 -27
  61. package/dist/cjs/src/htx.js +135 -143
  62. package/dist/cjs/src/huobijp.js +22 -20
  63. package/dist/cjs/src/idex.js +22 -21
  64. package/dist/cjs/src/independentreserve.js +15 -14
  65. package/dist/cjs/src/indodax.js +30 -26
  66. package/dist/cjs/src/kraken.js +29 -27
  67. package/dist/cjs/src/krakenfutures.js +29 -22
  68. package/dist/cjs/src/kucoin.js +48 -43
  69. package/dist/cjs/src/kucoinfutures.js +33 -28
  70. package/dist/cjs/src/kuna.js +25 -24
  71. package/dist/cjs/src/latoken.js +24 -22
  72. package/dist/cjs/src/lbank.js +45 -30
  73. package/dist/cjs/src/luno.js +22 -19
  74. package/dist/cjs/src/lykke.js +19 -17
  75. package/dist/cjs/src/mercado.js +30 -19
  76. package/dist/cjs/src/mexc.js +60 -49
  77. package/dist/cjs/src/ndax.js +23 -22
  78. package/dist/cjs/src/novadax.js +23 -22
  79. package/dist/cjs/src/oceanex.js +22 -19
  80. package/dist/cjs/src/okcoin.js +29 -23
  81. package/dist/cjs/src/okx.js +92 -84
  82. package/dist/cjs/src/p2b.js +80 -83
  83. package/dist/cjs/src/paymium.js +10 -10
  84. package/dist/cjs/src/phemex.js +63 -40
  85. package/dist/cjs/src/poloniex.js +22 -22
  86. package/dist/cjs/src/poloniexfutures.js +23 -19
  87. package/dist/cjs/src/pro/alpaca.js +5 -5
  88. package/dist/cjs/src/pro/ascendex.js +4 -4
  89. package/dist/cjs/src/pro/binance.js +16 -16
  90. package/dist/cjs/src/pro/bingx.js +1 -1
  91. package/dist/cjs/src/pro/bitfinex.js +4 -4
  92. package/dist/cjs/src/pro/bitfinex2.js +6 -6
  93. package/dist/cjs/src/pro/bitget.js +7 -7
  94. package/dist/cjs/src/pro/bitmart.js +7 -5
  95. package/dist/cjs/src/pro/bitmex.js +6 -6
  96. package/dist/cjs/src/pro/bitopro.js +4 -4
  97. package/dist/cjs/src/pro/bitpanda.js +6 -6
  98. package/dist/cjs/src/pro/bitrue.js +2 -2
  99. package/dist/cjs/src/pro/bitstamp.js +6 -4
  100. package/dist/cjs/src/pro/bittrex.js +6 -6
  101. package/dist/cjs/src/pro/bitvavo.js +11 -7
  102. package/dist/cjs/src/pro/blockchaincom.js +8 -8
  103. package/dist/cjs/src/pro/bybit.js +7 -7
  104. package/dist/cjs/src/pro/cex.js +13 -9
  105. package/dist/cjs/src/pro/coinbase.js +5 -5
  106. package/dist/cjs/src/pro/coinbasepro.js +11 -10
  107. package/dist/cjs/src/pro/coinex.js +7 -9
  108. package/dist/cjs/src/pro/cryptocom.js +9 -9
  109. package/dist/cjs/src/pro/currencycom.js +4 -4
  110. package/dist/cjs/src/pro/deribit.js +6 -6
  111. package/dist/cjs/src/pro/exmo.js +12 -14
  112. package/dist/cjs/src/pro/gate.js +7 -7
  113. package/dist/cjs/src/pro/gemini.js +3 -3
  114. package/dist/cjs/src/pro/hitbtc.js +263 -4
  115. package/dist/cjs/src/pro/hollaex.js +5 -5
  116. package/dist/cjs/src/pro/htx.js +6 -6
  117. package/dist/cjs/src/pro/huobijp.js +3 -3
  118. package/dist/cjs/src/pro/idex.js +4 -4
  119. package/dist/cjs/src/pro/independentreserve.js +2 -2
  120. package/dist/cjs/src/pro/kraken.js +10 -10
  121. package/dist/cjs/src/pro/krakenfutures.js +41 -17
  122. package/dist/cjs/src/pro/kucoin.js +7 -7
  123. package/dist/cjs/src/pro/kucoinfutures.js +8 -6
  124. package/dist/cjs/src/pro/luno.js +2 -2
  125. package/dist/cjs/src/pro/mexc.js +6 -6
  126. package/dist/cjs/src/pro/ndax.js +3 -3
  127. package/dist/cjs/src/pro/okcoin.js +5 -5
  128. package/dist/cjs/src/pro/okx.js +12 -12
  129. package/dist/cjs/src/pro/phemex.js +6 -6
  130. package/dist/cjs/src/pro/poloniex.js +7 -7
  131. package/dist/cjs/src/pro/poloniexfutures.js +5 -5
  132. package/dist/cjs/src/pro/probit.js +6 -6
  133. package/dist/cjs/src/pro/upbit.js +3 -3
  134. package/dist/cjs/src/pro/wazirx.js +8 -8
  135. package/dist/cjs/src/pro/whitebit.js +12 -8
  136. package/dist/cjs/src/pro/woo.js +1 -1
  137. package/dist/cjs/src/probit.js +28 -23
  138. package/dist/cjs/src/tidex.js +16 -15
  139. package/dist/cjs/src/timex.js +19 -18
  140. package/dist/cjs/src/tokocrypto.js +27 -22
  141. package/dist/cjs/src/upbit.js +19 -19
  142. package/dist/cjs/src/wavesexchange.js +22 -19
  143. package/dist/cjs/src/wazirx.js +24 -17
  144. package/dist/cjs/src/whitebit.js +33 -27
  145. package/dist/cjs/src/woo.js +44 -34
  146. package/dist/cjs/src/yobit.js +25 -20
  147. package/dist/cjs/src/zaif.js +9 -9
  148. package/dist/cjs/src/zonda.js +18 -17
  149. package/js/ccxt.d.ts +1 -1
  150. package/js/ccxt.js +1 -1
  151. package/js/src/abstract/bitbank.d.ts +1 -0
  152. package/js/src/abstract/bybit.d.ts +1 -0
  153. package/js/src/abstract/cryptocom.d.ts +0 -20
  154. package/js/src/abstract/htx.d.ts +3 -0
  155. package/js/src/abstract/huobi.d.ts +3 -0
  156. package/js/src/abstract/huobipro.d.ts +3 -0
  157. package/js/src/abstract/okex.d.ts +3 -1
  158. package/js/src/abstract/okex5.d.ts +3 -1
  159. package/js/src/abstract/okx.d.ts +3 -1
  160. package/js/src/ace.js +18 -14
  161. package/js/src/alpaca.js +6 -6
  162. package/js/src/ascendex.js +35 -29
  163. package/js/src/base/Exchange.d.ts +37 -34
  164. package/js/src/base/Exchange.js +39 -26
  165. package/js/src/base/Precise.d.ts +4 -4
  166. package/js/src/base/Precise.js +1 -3
  167. package/js/src/base/functions/type.d.ts +25 -25
  168. package/js/src/base/types.d.ts +21 -14
  169. package/js/src/bigone.js +25 -21
  170. package/js/src/binance.d.ts +2 -2
  171. package/js/src/binance.js +97 -76
  172. package/js/src/bingx.js +63 -44
  173. package/js/src/bit2c.js +19 -16
  174. package/js/src/bitbank.js +17 -15
  175. package/js/src/bitbns.js +28 -18
  176. package/js/src/bitfinex.js +23 -21
  177. package/js/src/bitfinex2.js +32 -28
  178. package/js/src/bitflyer.js +28 -20
  179. package/js/src/bitforex.js +26 -19
  180. package/js/src/bitget.d.ts +25 -3
  181. package/js/src/bitget.js +184 -147
  182. package/js/src/bithumb.js +23 -16
  183. package/js/src/bitmart.d.ts +1 -1
  184. package/js/src/bitmart.js +129 -94
  185. package/js/src/bitmex.d.ts +2 -2
  186. package/js/src/bitmex.js +104 -64
  187. package/js/src/bitopro.js +38 -26
  188. package/js/src/bitpanda.js +24 -23
  189. package/js/src/bitrue.js +33 -24
  190. package/js/src/bitso.js +24 -23
  191. package/js/src/bitstamp.d.ts +2 -2
  192. package/js/src/bitstamp.js +24 -23
  193. package/js/src/bittrex.js +30 -29
  194. package/js/src/bitvavo.js +38 -30
  195. package/js/src/bl3p.js +11 -10
  196. package/js/src/blockchaincom.js +20 -20
  197. package/js/src/btcalpha.js +18 -17
  198. package/js/src/btcbox.js +13 -12
  199. package/js/src/btcmarkets.js +20 -19
  200. package/js/src/btcturk.js +14 -13
  201. package/js/src/bybit.d.ts +1 -1
  202. package/js/src/bybit.js +84 -54
  203. package/js/src/cex.js +16 -14
  204. package/js/src/coinbase.js +29 -27
  205. package/js/src/coinbasepro.js +27 -25
  206. package/js/src/coincheck.js +15 -14
  207. package/js/src/coinex.d.ts +1 -1
  208. package/js/src/coinex.js +101 -78
  209. package/js/src/coinlist.js +28 -27
  210. package/js/src/coinmate.js +21 -18
  211. package/js/src/coinone.js +21 -16
  212. package/js/src/coinsph.js +37 -28
  213. package/js/src/coinspot.js +12 -11
  214. package/js/src/cryptocom.d.ts +0 -23
  215. package/js/src/cryptocom.js +40 -202
  216. package/js/src/currencycom.js +32 -25
  217. package/js/src/delta.js +35 -29
  218. package/js/src/deribit.js +39 -36
  219. package/js/src/digifinex.d.ts +2 -2
  220. package/js/src/digifinex.js +65 -45
  221. package/js/src/exmo.js +29 -27
  222. package/js/src/gate.d.ts +1 -1
  223. package/js/src/gate.js +67 -53
  224. package/js/src/gemini.js +23 -20
  225. package/js/src/hitbtc.d.ts +1 -0
  226. package/js/src/hitbtc.js +65 -56
  227. package/js/src/hollaex.js +30 -27
  228. package/js/src/htx.d.ts +11 -3
  229. package/js/src/htx.js +135 -143
  230. package/js/src/huobijp.js +23 -21
  231. package/js/src/idex.js +22 -21
  232. package/js/src/independentreserve.js +15 -14
  233. package/js/src/indodax.js +30 -26
  234. package/js/src/kraken.js +29 -27
  235. package/js/src/krakenfutures.js +29 -22
  236. package/js/src/kucoin.d.ts +1 -1
  237. package/js/src/kucoin.js +48 -43
  238. package/js/src/kucoinfutures.js +33 -28
  239. package/js/src/kuna.js +25 -24
  240. package/js/src/latoken.js +25 -23
  241. package/js/src/lbank.js +46 -31
  242. package/js/src/luno.js +22 -19
  243. package/js/src/lykke.js +19 -17
  244. package/js/src/mercado.js +30 -19
  245. package/js/src/mexc.d.ts +1 -1
  246. package/js/src/mexc.js +60 -49
  247. package/js/src/ndax.js +23 -22
  248. package/js/src/novadax.js +23 -22
  249. package/js/src/oceanex.js +22 -19
  250. package/js/src/okcoin.js +29 -23
  251. package/js/src/okx.d.ts +2 -2
  252. package/js/src/okx.js +92 -84
  253. package/js/src/p2b.d.ts +8 -7
  254. package/js/src/p2b.js +80 -82
  255. package/js/src/paymium.js +10 -10
  256. package/js/src/phemex.js +63 -40
  257. package/js/src/poloniex.js +22 -22
  258. package/js/src/poloniexfutures.js +23 -19
  259. package/js/src/pro/alpaca.js +5 -5
  260. package/js/src/pro/ascendex.js +4 -4
  261. package/js/src/pro/binance.js +16 -16
  262. package/js/src/pro/bingx.js +1 -1
  263. package/js/src/pro/bitfinex.js +4 -4
  264. package/js/src/pro/bitfinex2.d.ts +1 -1
  265. package/js/src/pro/bitfinex2.js +6 -6
  266. package/js/src/pro/bitget.js +7 -7
  267. package/js/src/pro/bitmart.js +7 -5
  268. package/js/src/pro/bitmex.js +6 -6
  269. package/js/src/pro/bitopro.js +4 -4
  270. package/js/src/pro/bitpanda.js +6 -6
  271. package/js/src/pro/bitrue.js +2 -2
  272. package/js/src/pro/bitstamp.js +7 -5
  273. package/js/src/pro/bittrex.js +6 -6
  274. package/js/src/pro/bitvavo.js +12 -8
  275. package/js/src/pro/blockchaincom.js +8 -8
  276. package/js/src/pro/bybit.js +7 -7
  277. package/js/src/pro/cex.js +14 -10
  278. package/js/src/pro/coinbase.js +5 -5
  279. package/js/src/pro/coinbasepro.js +12 -11
  280. package/js/src/pro/coinex.js +7 -9
  281. package/js/src/pro/cryptocom.js +9 -9
  282. package/js/src/pro/currencycom.js +4 -4
  283. package/js/src/pro/deribit.js +6 -6
  284. package/js/src/pro/exmo.js +12 -14
  285. package/js/src/pro/gate.js +7 -7
  286. package/js/src/pro/gemini.js +3 -3
  287. package/js/src/pro/hitbtc.d.ts +8 -1
  288. package/js/src/pro/hitbtc.js +264 -5
  289. package/js/src/pro/hollaex.js +5 -5
  290. package/js/src/pro/htx.js +6 -6
  291. package/js/src/pro/huobijp.js +3 -3
  292. package/js/src/pro/idex.js +4 -4
  293. package/js/src/pro/independentreserve.js +2 -2
  294. package/js/src/pro/kraken.js +10 -10
  295. package/js/src/pro/krakenfutures.d.ts +1 -0
  296. package/js/src/pro/krakenfutures.js +42 -18
  297. package/js/src/pro/kucoin.js +7 -7
  298. package/js/src/pro/kucoinfutures.js +8 -6
  299. package/js/src/pro/luno.js +2 -2
  300. package/js/src/pro/mexc.js +6 -6
  301. package/js/src/pro/ndax.js +3 -3
  302. package/js/src/pro/okcoin.js +5 -5
  303. package/js/src/pro/okx.js +12 -12
  304. package/js/src/pro/phemex.js +6 -6
  305. package/js/src/pro/poloniex.js +7 -7
  306. package/js/src/pro/poloniexfutures.js +5 -5
  307. package/js/src/pro/probit.js +6 -6
  308. package/js/src/pro/upbit.js +3 -3
  309. package/js/src/pro/wazirx.js +8 -8
  310. package/js/src/pro/whitebit.js +13 -9
  311. package/js/src/pro/woo.js +1 -1
  312. package/js/src/probit.js +29 -24
  313. package/js/src/tidex.js +16 -15
  314. package/js/src/timex.js +19 -18
  315. package/js/src/tokocrypto.js +28 -23
  316. package/js/src/upbit.js +19 -19
  317. package/js/src/wavesexchange.js +23 -20
  318. package/js/src/wazirx.js +25 -18
  319. package/js/src/whitebit.js +33 -27
  320. package/js/src/woo.js +45 -35
  321. package/js/src/yobit.js +25 -20
  322. package/js/src/zaif.js +9 -9
  323. package/js/src/zonda.js +18 -17
  324. package/package.json +2 -2
  325. package/js/src/bitstamp1.d.ts +0 -28
  326. package/js/src/bitstamp1.js +0 -430
  327. package/js/src/lbank2.d.ts +0 -90
  328. package/js/src/lbank2.js +0 -2779
package/js/src/p2b.d.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  import { Market } from '../ccxt.js';
2
2
  import Exchange from './abstract/p2b.js';
3
- import { Int, OHLCV, Order, OrderSide, OrderType, Strings, Ticker, Tickers } from './base/types.js';
3
+ import { Int, OHLCV, Order, OrderSide, OrderType, Str, Strings, Ticker, Tickers } from './base/types.js';
4
4
  /**
5
5
  * @class p2b
6
6
  * @extends Exchange
7
7
  */
8
8
  export default class p2b extends Exchange {
9
9
  describe(): any;
10
- fetchMarkets(params?: {}): Promise<any[]>;
10
+ fetchMarkets(params?: {}): Promise<import("./base/types.js").MarketInterface[]>;
11
+ parseMarket(market: any): Market;
11
12
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
12
13
  fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
13
14
  parseTicker(ticker: any, market?: Market): Ticker;
@@ -19,11 +20,11 @@ export default class p2b extends Exchange {
19
20
  fetchBalance(params?: {}): Promise<import("./base/types.js").Balances>;
20
21
  parseBalance(response: any): import("./base/types.js").Balances;
21
22
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<Order>;
22
- cancelOrder(id: string, symbol?: string, params?: {}): Promise<Order>;
23
- fetchOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
24
- fetchOrderTrades(id: string, symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
25
- fetchMyTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
26
- fetchClosedOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
23
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
24
+ fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
25
+ fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
26
+ fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
27
+ fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
27
28
  parseOrder(order: any, market?: Market): Order;
28
29
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
29
30
  url: string;
package/js/src/p2b.js CHANGED
@@ -5,7 +5,6 @@
5
5
  // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
6
 
7
7
  // ---------------------------------------------------------------------------
8
- import { Precise } from '../ccxt.js';
9
8
  import Exchange from './abstract/p2b.js';
10
9
  import { InsufficientFunds, AuthenticationError, BadRequest, ExchangeNotAvailable, ArgumentsRequired } from './base/errors.js';
11
10
  import { TICK_SIZE } from './base/functions/number.js';
@@ -46,11 +45,10 @@ export default class p2b extends Exchange {
46
45
  'fetchAccounts': false,
47
46
  'fetchBalance': true,
48
47
  'fetchBorrowInterest': false,
49
- 'fetchBorrowRate': false,
50
48
  'fetchBorrowRateHistory': false,
51
- 'fetchBorrowRates': false,
52
- 'fetchBorrowRatesPerSymbol': false,
53
49
  'fetchClosedOrders': true,
50
+ 'fetchCrossBorrowRate': false,
51
+ 'fetchCrossBorrowRates': false,
54
52
  'fetchDeposit': false,
55
53
  'fetchDepositAddress': false,
56
54
  'fetchDepositAddresses': false,
@@ -62,6 +60,8 @@ export default class p2b extends Exchange {
62
60
  'fetchFundingRateHistory': false,
63
61
  'fetchFundingRates': false,
64
62
  'fetchIndexOHLCV': false,
63
+ 'fetchIsolatedBorrowRate': false,
64
+ 'fetchIsolatedBorrowRates': false,
65
65
  'fetchLedger': false,
66
66
  'fetchLedgerEntry': false,
67
67
  'fetchLeverageTiers': false,
@@ -111,7 +111,7 @@ export default class p2b extends Exchange {
111
111
  'urls': {
112
112
  'extension': '.json',
113
113
  'referral': 'https://p2pb2b.com?referral=ee784c53',
114
- 'logo': 'https://cdn.worldvectorlogo.com/logos/p2b-1.svg',
114
+ 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/8da13a80-1f0a-49be-bb90-ff8b25164755',
115
115
  'api': {
116
116
  'public': 'https://api.p2pb2b.com/api/v2/public',
117
117
  'private': 'https://api.p2pb2b.com/api/v2',
@@ -268,72 +268,66 @@ export default class p2b extends Exchange {
268
268
  // }
269
269
  //
270
270
  const markets = this.safeValue(response, 'result', []);
271
- const result = [];
272
- for (let i = 0; i < markets.length; i++) {
273
- const market = markets[i];
274
- const marketId = this.safeString(market, 'name');
275
- const baseId = this.safeValue(market, 'stock');
276
- const quoteId = this.safeValue(market, 'money');
277
- const base = this.safeCurrencyCode(baseId);
278
- const quote = this.safeCurrencyCode(quoteId);
279
- const precision = this.safeValue(market, 'precision');
280
- const limits = this.safeValue(market, 'limits');
281
- const maxAmount = this.safeString(limits, 'max_amount');
282
- const maxPrice = this.safeString(limits, 'max_price');
283
- const entry = this.safeMarketStructure({
284
- 'id': marketId,
285
- 'symbol': base + '/' + quote,
286
- 'base': base,
287
- 'quote': quote,
288
- 'settle': undefined,
289
- 'baseId': baseId,
290
- 'quoteId': quoteId,
291
- 'settleId': undefined,
292
- 'type': 'spot',
293
- 'spot': true,
294
- 'margin': false,
295
- 'swap': false,
296
- 'future': false,
297
- 'option': false,
298
- 'active': true,
299
- 'contract': false,
300
- 'linear': undefined,
301
- 'inverse': undefined,
302
- 'contractSize': undefined,
303
- 'expiry': undefined,
304
- 'expiryDatetime': undefined,
305
- 'strike': undefined,
306
- 'optionType': undefined,
307
- 'precision': {
308
- 'amount': this.safeNumber(limits, 'step_size'),
309
- 'price': this.safeNumber(limits, 'tick_size'),
310
- 'base': this.parsePrecision(this.safeString(precision, 'stock')),
311
- 'quote': this.parsePrecision(this.safeString(precision, 'money')),
271
+ return this.parseMarkets(markets);
272
+ }
273
+ parseMarket(market) {
274
+ const marketId = this.safeString(market, 'name');
275
+ const baseId = this.safeString(market, 'stock');
276
+ const quoteId = this.safeString(market, 'money');
277
+ const base = this.safeCurrencyCode(baseId);
278
+ const quote = this.safeCurrencyCode(quoteId);
279
+ const limits = this.safeValue(market, 'limits');
280
+ const maxAmount = this.safeString(limits, 'max_amount');
281
+ const maxPrice = this.safeString(limits, 'max_price');
282
+ return {
283
+ 'id': marketId,
284
+ 'symbol': base + '/' + quote,
285
+ 'base': base,
286
+ 'quote': quote,
287
+ 'settle': undefined,
288
+ 'baseId': baseId,
289
+ 'quoteId': quoteId,
290
+ 'settleId': undefined,
291
+ 'type': 'spot',
292
+ 'spot': true,
293
+ 'margin': false,
294
+ 'swap': false,
295
+ 'future': false,
296
+ 'option': false,
297
+ 'active': true,
298
+ 'contract': false,
299
+ 'linear': undefined,
300
+ 'inverse': undefined,
301
+ 'contractSize': undefined,
302
+ 'expiry': undefined,
303
+ 'expiryDatetime': undefined,
304
+ 'strike': undefined,
305
+ 'optionType': undefined,
306
+ 'precision': {
307
+ 'amount': this.safeNumber(limits, 'step_size'),
308
+ 'price': this.safeNumber(limits, 'tick_size'),
309
+ },
310
+ 'limits': {
311
+ 'leverage': {
312
+ 'min': undefined,
313
+ 'max': undefined,
312
314
  },
313
- 'limits': {
314
- 'leverage': {
315
- 'min': undefined,
316
- 'max': undefined,
317
- },
318
- 'amount': {
319
- 'min': this.safeNumber(limits, 'min_amount'),
320
- 'max': Precise.stringEq(maxAmount, '0') ? undefined : this.parseNumber(maxAmount),
321
- },
322
- 'price': {
323
- 'min': this.safeString(limits, 'min_price'),
324
- 'max': Precise.stringEq(maxPrice, '0') ? undefined : this.parseNumber(maxPrice),
325
- },
326
- 'cost': {
327
- 'min': undefined,
328
- 'max': undefined,
329
- },
315
+ 'amount': {
316
+ 'min': this.safeNumber(limits, 'min_amount'),
317
+ 'max': this.parseNumber(this.omitZero(maxAmount)),
330
318
  },
331
- 'created': undefined,
332
- 'info': market,
333
- });
334
- result.push(entry);
335
- }
336
- return result;
319
+ 'price': {
320
+ 'min': this.safeNumber(limits, 'min_price'),
321
+ 'max': this.parseNumber(this.omitZero(maxPrice)),
322
+ },
323
+ 'cost': {
324
+ 'min': undefined,
325
+ 'max': undefined,
326
+ },
327
+ },
328
+ 'created': undefined,
329
+ 'info': market,
330
+ };
337
331
  }
338
332
  async fetchTickers(symbols = undefined, params = {}) {
339
333
  /**
@@ -343,7 +337,7 @@ export default class p2b extends Exchange {
343
337
  * @see https://futures-docs.poloniex.com/#get-real-time-ticker-of-all-symbols
344
338
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
345
339
  * @param {object} [params] extra parameters specific to the p2b api endpoint
346
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
340
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
347
341
  */
348
342
  await this.loadMarkets();
349
343
  const response = await this.publicGetTickers(params);
@@ -383,7 +377,7 @@ export default class p2b extends Exchange {
383
377
  * @see https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md#ticker
384
378
  * @param {string} symbol unified symbol of the market to fetch the ticker for
385
379
  * @param {object} [params] extra parameters specific to the p2b api endpoint
386
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
380
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
387
381
  */
388
382
  await this.loadMarkets();
389
383
  const market = this.market(symbol);
@@ -487,7 +481,7 @@ export default class p2b extends Exchange {
487
481
  *
488
482
  * EXCHANGE SPECIFIC PARAMETERS
489
483
  * @param {string} [params.interval] 0 (default), 0.00000001, 0.0000001, 0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1, 1
490
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
484
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
491
485
  */
492
486
  await this.loadMarkets();
493
487
  const market = this.market(symbol);
@@ -539,7 +533,7 @@ export default class p2b extends Exchange {
539
533
  * @param {object} [params] extra parameters specific to the p2b api endpoint
540
534
  *
541
535
  * @param {int} params.lastId order id
542
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
536
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
543
537
  */
544
538
  await this.loadMarkets();
545
539
  const lastId = this.safeInteger(params, 'lastId');
@@ -724,7 +718,7 @@ export default class p2b extends Exchange {
724
718
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
725
719
  * @see https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md#all-balances
726
720
  * @param {object} [params] extra parameters specific to the p2b api endpoint
727
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
721
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
728
722
  */
729
723
  await this.loadMarkets();
730
724
  const response = await this.privatePostAccountBalances(params);
@@ -791,7 +785,7 @@ export default class p2b extends Exchange {
791
785
  * @param {float} amount how much of currency you want to trade in units of base currency
792
786
  * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency
793
787
  * @param {object} [params] extra parameters specific to the p2b api endpoint
794
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
788
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
795
789
  */
796
790
  await this.loadMarkets();
797
791
  if (type === 'market') {
@@ -839,10 +833,12 @@ export default class p2b extends Exchange {
839
833
  * @param {string} id order id
840
834
  * @param {string} symbol unified symbol of the market the order was made in
841
835
  * @param {object} [params] extra parameters specific to the p2b api endpoint
842
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
836
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
843
837
  */
838
+ if (symbol === undefined) {
839
+ throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
840
+ }
844
841
  await this.loadMarkets();
845
- this.checkRequiredArgument('cancelOrder', symbol, 'symbol');
846
842
  const market = this.market(symbol);
847
843
  const request = {
848
844
  'market': market['id'],
@@ -887,7 +883,7 @@ export default class p2b extends Exchange {
887
883
  *
888
884
  * EXCHANGE SPECIFIC PARAMETERS
889
885
  * @param {int} [params.offset] 0-10000, default=0
890
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
886
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
891
887
  */
892
888
  if (symbol === undefined) {
893
889
  throw new ArgumentsRequired(this.id + ' fetchOpenOrders () requires the symbol argument');
@@ -943,7 +939,7 @@ export default class p2b extends Exchange {
943
939
  *
944
940
  * EXCHANGE SPECIFIC PARAMETERS
945
941
  * @param {int} [params.offset] 0-10000, default=0
946
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
942
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
947
943
  */
948
944
  await this.loadMarkets();
949
945
  const market = this.safeMarket(symbol);
@@ -995,12 +991,14 @@ export default class p2b extends Exchange {
995
991
  *
996
992
  * EXCHANGE SPECIFIC PARAMETERS
997
993
  * @param {int} [params.offset] 0-10000, default=0
998
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
994
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
999
995
  */
996
+ if (symbol === undefined) {
997
+ throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
998
+ }
1000
999
  await this.loadMarkets();
1001
1000
  let until = this.safeInteger(params, 'until');
1002
1001
  params = this.omit(params, 'until');
1003
- this.checkRequiredArgument('fetchMyTrades', symbol, 'symbol');
1004
1002
  if (until === undefined) {
1005
1003
  if (since === undefined) {
1006
1004
  until = this.milliseconds();
@@ -1069,7 +1067,7 @@ export default class p2b extends Exchange {
1069
1067
  *
1070
1068
  * EXCHANGE SPECIFIC PARAMETERS
1071
1069
  * @param {int} [params.offset] 0-10000, default=0
1072
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1070
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1073
1071
  */
1074
1072
  await this.loadMarkets();
1075
1073
  let until = this.safeInteger(params, 'until');
package/js/src/paymium.js CHANGED
@@ -140,7 +140,7 @@ export default class paymium extends Exchange {
140
140
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
141
141
  * @see https://paymium.github.io/api-documentation/#tag/User/paths/~1user/get
142
142
  * @param {object} [params] extra parameters specific to the paymium api endpoint
143
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
143
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
144
144
  */
145
145
  await this.loadMarkets();
146
146
  const response = await this.privateGetUser(params);
@@ -155,7 +155,7 @@ export default class paymium extends Exchange {
155
155
  * @param {string} symbol unified symbol of the market to fetch the order book for
156
156
  * @param {int} [limit] the maximum amount of order book entries to return
157
157
  * @param {object} [params] extra parameters specific to the paymium api endpoint
158
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
158
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
159
159
  */
160
160
  await this.loadMarkets();
161
161
  const market = this.market(symbol);
@@ -221,7 +221,7 @@ export default class paymium extends Exchange {
221
221
  * @see https://paymium.github.io/api-documentation/#tag/Public-data/paths/~1data~1%7Bcurrency%7D~1ticker/get
222
222
  * @param {string} symbol unified symbol of the market to fetch the ticker for
223
223
  * @param {object} [params] extra parameters specific to the paymium api endpoint
224
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
224
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
225
225
  */
226
226
  await this.loadMarkets();
227
227
  const market = this.market(symbol);
@@ -283,7 +283,7 @@ export default class paymium extends Exchange {
283
283
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
284
284
  * @param {int} [limit] the maximum amount of trades to fetch
285
285
  * @param {object} [params] extra parameters specific to the paymium api endpoint
286
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
286
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
287
287
  */
288
288
  await this.loadMarkets();
289
289
  const market = this.market(symbol);
@@ -301,7 +301,7 @@ export default class paymium extends Exchange {
301
301
  * @see https://paymium.github.io/api-documentation/#tag/User/paths/~1user~1addresses/post
302
302
  * @param {string} code unified currency code of the currency for the deposit address
303
303
  * @param {object} [params] extra parameters specific to the paymium api endpoint
304
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
304
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
305
305
  */
306
306
  await this.loadMarkets();
307
307
  const response = await this.privatePostUserAddresses(params);
@@ -323,7 +323,7 @@ export default class paymium extends Exchange {
323
323
  * @see https://paymium.github.io/api-documentation/#tag/User/paths/~1user~1addresses~1%7Baddress%7D/get
324
324
  * @param {string} code unified currency code
325
325
  * @param {object} [params] extra parameters specific to the paymium api endpoint
326
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
326
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
327
327
  */
328
328
  await this.loadMarkets();
329
329
  const request = {
@@ -348,7 +348,7 @@ export default class paymium extends Exchange {
348
348
  * @see https://paymium.github.io/api-documentation/#tag/User/paths/~1user~1addresses/get
349
349
  * @param {string[]|undefined} codes list of unified currency codes, default is undefined
350
350
  * @param {object} [params] extra parameters specific to the paymium api endpoint
351
- * @returns {object} a list of [address structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
351
+ * @returns {object} a list of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}
352
352
  */
353
353
  await this.loadMarkets();
354
354
  const response = await this.privateGetUserAddresses(params);
@@ -395,7 +395,7 @@ export default class paymium extends Exchange {
395
395
  * @param {float} amount how much of currency you want to trade in units of base currency
396
396
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
397
397
  * @param {object} [params] extra parameters specific to the paymium api endpoint
398
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
398
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
399
399
  */
400
400
  await this.loadMarkets();
401
401
  const market = this.market(symbol);
@@ -424,7 +424,7 @@ export default class paymium extends Exchange {
424
424
  * @param {string} id order id
425
425
  * @param {string} symbol not used by paymium cancelOrder ()
426
426
  * @param {object} [params] extra parameters specific to the paymium api endpoint
427
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
427
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
428
428
  */
429
429
  const request = {
430
430
  'uuid': id,
@@ -442,7 +442,7 @@ export default class paymium extends Exchange {
442
442
  * @param {string} fromAccount account to transfer from
443
443
  * @param {string} toAccount account to transfer to
444
444
  * @param {object} [params] extra parameters specific to the paymium api endpoint
445
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
445
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
446
446
  */
447
447
  await this.loadMarkets();
448
448
  const currency = this.currency(code);