ccxt 4.2.76__py2.py3-none-any.whl → 4.4.48__py2.py3-none-any.whl

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 (546) hide show
  1. ccxt/__init__.py +36 -14
  2. ccxt/abstract/alpaca.py +4 -0
  3. ccxt/abstract/bigone.py +1 -1
  4. ccxt/abstract/binance.py +112 -48
  5. ccxt/abstract/binancecoinm.py +112 -48
  6. ccxt/abstract/binanceus.py +147 -83
  7. ccxt/abstract/binanceusdm.py +112 -48
  8. ccxt/abstract/bingx.py +133 -78
  9. ccxt/abstract/bitbank.py +5 -0
  10. ccxt/abstract/bitfinex.py +136 -65
  11. ccxt/abstract/bitfinex1.py +69 -0
  12. ccxt/abstract/bitflyer.py +1 -0
  13. ccxt/abstract/bitget.py +8 -1
  14. ccxt/abstract/bitmart.py +13 -1
  15. ccxt/abstract/bitopro.py +1 -0
  16. ccxt/abstract/bitpanda.py +0 -12
  17. ccxt/abstract/bitrue.py +3 -3
  18. ccxt/abstract/bitstamp.py +26 -3
  19. ccxt/abstract/blofin.py +24 -0
  20. ccxt/abstract/btcbox.py +1 -0
  21. ccxt/abstract/bybit.py +29 -14
  22. ccxt/abstract/cex.py +28 -29
  23. ccxt/abstract/coinbase.py +6 -0
  24. ccxt/abstract/coinbaseadvanced.py +94 -0
  25. ccxt/abstract/{coinbasepro.py → coinbaseexchange.py} +1 -0
  26. ccxt/abstract/coinbaseinternational.py +1 -1
  27. ccxt/abstract/coincatch.py +94 -0
  28. ccxt/abstract/coinex.py +233 -123
  29. ccxt/abstract/coinmetro.py +1 -0
  30. ccxt/abstract/cryptocom.py +14 -0
  31. ccxt/abstract/defx.py +69 -0
  32. ccxt/abstract/deribit.py +1 -0
  33. ccxt/abstract/digifinex.py +1 -0
  34. ccxt/abstract/ellipx.py +25 -0
  35. ccxt/abstract/gate.py +20 -0
  36. ccxt/abstract/gateio.py +20 -0
  37. ccxt/abstract/gemini.py +1 -0
  38. ccxt/abstract/hashkey.py +67 -0
  39. ccxt/abstract/hyperliquid.py +1 -1
  40. ccxt/abstract/independentreserve.py +6 -0
  41. ccxt/abstract/kraken.py +4 -3
  42. ccxt/abstract/krakenfutures.py +4 -0
  43. ccxt/abstract/kucoin.py +25 -0
  44. ccxt/abstract/kucoinfutures.py +35 -0
  45. ccxt/abstract/luno.py +2 -0
  46. ccxt/abstract/mexc.py +4 -0
  47. ccxt/abstract/myokx.py +340 -0
  48. ccxt/abstract/oceanex.py +5 -0
  49. ccxt/abstract/okx.py +30 -0
  50. ccxt/abstract/onetrading.py +0 -12
  51. ccxt/abstract/oxfun.py +34 -0
  52. ccxt/abstract/paradex.py +40 -0
  53. ccxt/abstract/phemex.py +1 -0
  54. ccxt/abstract/upbit.py +4 -0
  55. ccxt/abstract/vertex.py +19 -0
  56. ccxt/abstract/whitebit.py +31 -1
  57. ccxt/abstract/woo.py +6 -2
  58. ccxt/abstract/woofipro.py +119 -0
  59. ccxt/abstract/xt.py +153 -0
  60. ccxt/abstract/zonda.py +6 -0
  61. ccxt/ace.py +164 -60
  62. ccxt/alpaca.py +727 -63
  63. ccxt/ascendex.py +395 -249
  64. ccxt/async_support/__init__.py +36 -14
  65. ccxt/async_support/ace.py +164 -60
  66. ccxt/async_support/alpaca.py +727 -63
  67. ccxt/async_support/ascendex.py +396 -249
  68. ccxt/async_support/base/exchange.py +531 -155
  69. ccxt/async_support/base/ws/aiohttp_client.py +28 -5
  70. ccxt/async_support/base/ws/cache.py +3 -2
  71. ccxt/async_support/base/ws/client.py +26 -5
  72. ccxt/async_support/base/ws/fast_client.py +4 -3
  73. ccxt/async_support/base/ws/functions.py +1 -1
  74. ccxt/async_support/base/ws/future.py +40 -31
  75. ccxt/async_support/base/ws/order_book_side.py +3 -0
  76. ccxt/async_support/bequant.py +1 -1
  77. ccxt/async_support/bigone.py +329 -202
  78. ccxt/async_support/binance.py +3513 -1511
  79. ccxt/async_support/binancecoinm.py +2 -1
  80. ccxt/async_support/binanceus.py +12 -1
  81. ccxt/async_support/binanceusdm.py +3 -1
  82. ccxt/async_support/bingx.py +3105 -881
  83. ccxt/async_support/bit2c.py +119 -38
  84. ccxt/async_support/bitbank.py +215 -76
  85. ccxt/async_support/bitbns.py +124 -53
  86. ccxt/async_support/bitfinex.py +3236 -1078
  87. ccxt/async_support/bitfinex1.py +1711 -0
  88. ccxt/async_support/bitflyer.py +239 -50
  89. ccxt/async_support/bitget.py +1513 -563
  90. ccxt/async_support/bithumb.py +201 -67
  91. ccxt/async_support/bitmart.py +1320 -435
  92. ccxt/async_support/bitmex.py +308 -111
  93. ccxt/async_support/bitopro.py +256 -96
  94. ccxt/async_support/bitrue.py +365 -233
  95. ccxt/async_support/bitso.py +201 -89
  96. ccxt/async_support/bitstamp.py +438 -269
  97. ccxt/async_support/bitteam.py +179 -73
  98. ccxt/async_support/bitvavo.py +180 -70
  99. ccxt/async_support/bl3p.py +92 -25
  100. ccxt/async_support/blockchaincom.py +193 -79
  101. ccxt/async_support/blofin.py +403 -150
  102. ccxt/async_support/btcalpha.py +161 -55
  103. ccxt/async_support/btcbox.py +250 -34
  104. ccxt/async_support/btcmarkets.py +232 -85
  105. ccxt/async_support/btcturk.py +159 -60
  106. ccxt/async_support/bybit.py +2326 -1255
  107. ccxt/async_support/cex.py +1409 -1329
  108. ccxt/async_support/coinbase.py +1455 -288
  109. ccxt/async_support/coinbaseadvanced.py +17 -0
  110. ccxt/async_support/{coinbasepro.py → coinbaseexchange.py} +233 -99
  111. ccxt/async_support/coinbaseinternational.py +428 -88
  112. ccxt/async_support/coincatch.py +5152 -0
  113. ccxt/async_support/coincheck.py +121 -38
  114. ccxt/async_support/coinex.py +4020 -3339
  115. ccxt/async_support/coinlist.py +273 -116
  116. ccxt/async_support/coinmate.py +204 -97
  117. ccxt/async_support/coinmetro.py +203 -110
  118. ccxt/async_support/coinone.py +142 -68
  119. ccxt/async_support/coinsph.py +206 -89
  120. ccxt/async_support/coinspot.py +137 -62
  121. ccxt/async_support/cryptocom.py +515 -185
  122. ccxt/async_support/currencycom.py +203 -85
  123. ccxt/async_support/defx.py +2066 -0
  124. ccxt/async_support/delta.py +467 -158
  125. ccxt/async_support/deribit.py +558 -324
  126. ccxt/async_support/digifinex.py +340 -223
  127. ccxt/async_support/ellipx.py +1826 -0
  128. ccxt/async_support/exmo.py +259 -128
  129. ccxt/async_support/gate.py +1473 -464
  130. ccxt/async_support/gemini.py +206 -84
  131. ccxt/async_support/hashkey.py +4164 -0
  132. ccxt/async_support/hitbtc.py +334 -178
  133. ccxt/async_support/hollaex.py +134 -83
  134. ccxt/async_support/htx.py +1095 -563
  135. ccxt/async_support/huobijp.py +105 -56
  136. ccxt/async_support/hyperliquid.py +1634 -269
  137. ccxt/async_support/idex.py +148 -95
  138. ccxt/async_support/independentreserve.py +236 -31
  139. ccxt/async_support/indodax.py +165 -62
  140. ccxt/async_support/kraken.py +871 -354
  141. ccxt/async_support/krakenfutures.py +324 -100
  142. ccxt/async_support/kucoin.py +1050 -355
  143. ccxt/async_support/kucoinfutures.py +1004 -149
  144. ccxt/async_support/kuna.py +138 -106
  145. ccxt/async_support/latoken.py +135 -79
  146. ccxt/async_support/lbank.py +290 -113
  147. ccxt/async_support/luno.py +112 -62
  148. ccxt/async_support/lykke.py +104 -55
  149. ccxt/async_support/mercado.py +36 -29
  150. ccxt/async_support/mexc.py +995 -429
  151. ccxt/async_support/myokx.py +43 -0
  152. ccxt/async_support/ndax.py +163 -82
  153. ccxt/async_support/novadax.py +121 -75
  154. ccxt/async_support/oceanex.py +175 -59
  155. ccxt/async_support/okcoin.py +222 -163
  156. ccxt/async_support/okx.py +1777 -455
  157. ccxt/async_support/onetrading.py +132 -414
  158. ccxt/async_support/oxfun.py +2832 -0
  159. ccxt/async_support/p2b.py +79 -51
  160. ccxt/async_support/paradex.py +2017 -0
  161. ccxt/async_support/paymium.py +56 -32
  162. ccxt/async_support/phemex.py +572 -196
  163. ccxt/async_support/poloniex.py +218 -95
  164. ccxt/async_support/poloniexfutures.py +260 -92
  165. ccxt/async_support/probit.py +143 -110
  166. ccxt/async_support/timex.py +123 -70
  167. ccxt/async_support/tokocrypto.py +129 -93
  168. ccxt/async_support/tradeogre.py +39 -25
  169. ccxt/async_support/upbit.py +322 -113
  170. ccxt/async_support/vertex.py +2983 -0
  171. ccxt/async_support/wavesexchange.py +227 -173
  172. ccxt/async_support/wazirx.py +145 -65
  173. ccxt/async_support/whitebit.py +533 -138
  174. ccxt/async_support/woo.py +1155 -295
  175. ccxt/async_support/woofipro.py +2716 -0
  176. ccxt/async_support/xt.py +4628 -0
  177. ccxt/async_support/yobit.py +160 -92
  178. ccxt/async_support/zaif.py +80 -33
  179. ccxt/async_support/zonda.py +140 -69
  180. ccxt/base/errors.py +51 -20
  181. ccxt/base/exchange.py +1729 -482
  182. ccxt/base/precise.py +10 -0
  183. ccxt/base/types.py +223 -4
  184. ccxt/bequant.py +1 -1
  185. ccxt/bigone.py +329 -202
  186. ccxt/binance.py +3513 -1511
  187. ccxt/binancecoinm.py +2 -1
  188. ccxt/binanceus.py +12 -1
  189. ccxt/binanceusdm.py +3 -1
  190. ccxt/bingx.py +3105 -881
  191. ccxt/bit2c.py +119 -38
  192. ccxt/bitbank.py +215 -76
  193. ccxt/bitbns.py +124 -53
  194. ccxt/bitfinex.py +3235 -1078
  195. ccxt/bitfinex1.py +1710 -0
  196. ccxt/bitflyer.py +239 -50
  197. ccxt/bitget.py +1513 -563
  198. ccxt/bithumb.py +200 -67
  199. ccxt/bitmart.py +1320 -435
  200. ccxt/bitmex.py +308 -111
  201. ccxt/bitopro.py +256 -96
  202. ccxt/bitrue.py +365 -233
  203. ccxt/bitso.py +201 -89
  204. ccxt/bitstamp.py +438 -269
  205. ccxt/bitteam.py +179 -73
  206. ccxt/bitvavo.py +180 -70
  207. ccxt/bl3p.py +92 -25
  208. ccxt/blockchaincom.py +193 -79
  209. ccxt/blofin.py +403 -150
  210. ccxt/btcalpha.py +161 -55
  211. ccxt/btcbox.py +250 -34
  212. ccxt/btcmarkets.py +232 -85
  213. ccxt/btcturk.py +159 -60
  214. ccxt/bybit.py +2326 -1255
  215. ccxt/cex.py +1408 -1329
  216. ccxt/coinbase.py +1455 -288
  217. ccxt/coinbaseadvanced.py +17 -0
  218. ccxt/{coinbasepro.py → coinbaseexchange.py} +233 -99
  219. ccxt/coinbaseinternational.py +428 -88
  220. ccxt/coincatch.py +5152 -0
  221. ccxt/coincheck.py +121 -38
  222. ccxt/coinex.py +4020 -3339
  223. ccxt/coinlist.py +273 -116
  224. ccxt/coinmate.py +204 -97
  225. ccxt/coinmetro.py +203 -110
  226. ccxt/coinone.py +142 -68
  227. ccxt/coinsph.py +206 -89
  228. ccxt/coinspot.py +137 -62
  229. ccxt/cryptocom.py +515 -185
  230. ccxt/currencycom.py +203 -85
  231. ccxt/defx.py +2065 -0
  232. ccxt/delta.py +467 -158
  233. ccxt/deribit.py +558 -324
  234. ccxt/digifinex.py +340 -223
  235. ccxt/ellipx.py +1826 -0
  236. ccxt/exmo.py +259 -128
  237. ccxt/gate.py +1473 -464
  238. ccxt/gemini.py +206 -84
  239. ccxt/hashkey.py +4164 -0
  240. ccxt/hitbtc.py +334 -178
  241. ccxt/hollaex.py +134 -83
  242. ccxt/htx.py +1095 -563
  243. ccxt/huobijp.py +105 -56
  244. ccxt/hyperliquid.py +1633 -269
  245. ccxt/idex.py +148 -95
  246. ccxt/independentreserve.py +235 -31
  247. ccxt/indodax.py +165 -62
  248. ccxt/kraken.py +871 -354
  249. ccxt/krakenfutures.py +324 -100
  250. ccxt/kucoin.py +1050 -355
  251. ccxt/kucoinfutures.py +1004 -149
  252. ccxt/kuna.py +138 -106
  253. ccxt/latoken.py +135 -79
  254. ccxt/lbank.py +290 -113
  255. ccxt/luno.py +112 -62
  256. ccxt/lykke.py +104 -55
  257. ccxt/mercado.py +36 -29
  258. ccxt/mexc.py +994 -429
  259. ccxt/myokx.py +43 -0
  260. ccxt/ndax.py +163 -82
  261. ccxt/novadax.py +121 -75
  262. ccxt/oceanex.py +175 -59
  263. ccxt/okcoin.py +222 -163
  264. ccxt/okx.py +1777 -455
  265. ccxt/onetrading.py +132 -414
  266. ccxt/oxfun.py +2831 -0
  267. ccxt/p2b.py +79 -51
  268. ccxt/paradex.py +2017 -0
  269. ccxt/paymium.py +56 -32
  270. ccxt/phemex.py +572 -196
  271. ccxt/poloniex.py +218 -95
  272. ccxt/poloniexfutures.py +260 -92
  273. ccxt/pro/__init__.py +29 -5
  274. ccxt/pro/alpaca.py +32 -17
  275. ccxt/pro/ascendex.py +63 -15
  276. ccxt/pro/bequant.py +4 -0
  277. ccxt/pro/binance.py +1596 -329
  278. ccxt/pro/binancecoinm.py +1 -0
  279. ccxt/pro/binanceus.py +2 -9
  280. ccxt/pro/binanceusdm.py +2 -0
  281. ccxt/pro/bingx.py +527 -134
  282. ccxt/pro/bitcoincom.py +4 -1
  283. ccxt/pro/bitfinex.py +731 -266
  284. ccxt/pro/bitfinex1.py +635 -0
  285. ccxt/pro/bitget.py +726 -357
  286. ccxt/pro/bithumb.py +380 -0
  287. ccxt/pro/bitmart.py +138 -39
  288. ccxt/pro/bitmex.py +199 -40
  289. ccxt/pro/bitopro.py +25 -13
  290. ccxt/pro/bitrue.py +31 -32
  291. ccxt/pro/bitstamp.py +7 -6
  292. ccxt/pro/bitvavo.py +204 -82
  293. ccxt/pro/blockchaincom.py +30 -17
  294. ccxt/pro/blofin.py +692 -0
  295. ccxt/pro/bybit.py +791 -82
  296. ccxt/pro/cex.py +99 -51
  297. ccxt/pro/coinbase.py +220 -30
  298. ccxt/{async_support/hitbtc3.py → pro/coinbaseadvanced.py} +5 -5
  299. ccxt/pro/{coinbasepro.py → coinbaseexchange.py} +19 -19
  300. ccxt/pro/coinbaseinternational.py +193 -30
  301. ccxt/pro/coincatch.py +1464 -0
  302. ccxt/pro/coincheck.py +11 -6
  303. ccxt/pro/coinex.py +967 -661
  304. ccxt/pro/coinone.py +17 -10
  305. ccxt/pro/cryptocom.py +446 -66
  306. ccxt/pro/currencycom.py +11 -10
  307. ccxt/pro/defx.py +832 -0
  308. ccxt/pro/deribit.py +168 -32
  309. ccxt/pro/exmo.py +253 -21
  310. ccxt/pro/gate.py +729 -64
  311. ccxt/pro/gemini.py +44 -26
  312. ccxt/pro/hashkey.py +802 -0
  313. ccxt/pro/hitbtc.py +208 -103
  314. ccxt/pro/hollaex.py +25 -9
  315. ccxt/pro/htx.py +83 -39
  316. ccxt/pro/huobijp.py +17 -16
  317. ccxt/pro/hyperliquid.py +502 -31
  318. ccxt/pro/idex.py +28 -13
  319. ccxt/pro/independentreserve.py +21 -16
  320. ccxt/pro/kraken.py +298 -51
  321. ccxt/pro/krakenfutures.py +166 -75
  322. ccxt/pro/kucoin.py +395 -77
  323. ccxt/pro/kucoinfutures.py +400 -99
  324. ccxt/pro/lbank.py +52 -31
  325. ccxt/pro/luno.py +12 -10
  326. ccxt/pro/mexc.py +400 -50
  327. ccxt/pro/myokx.py +28 -0
  328. ccxt/pro/ndax.py +25 -12
  329. ccxt/pro/okcoin.py +28 -9
  330. ccxt/pro/okx.py +935 -124
  331. ccxt/pro/onetrading.py +41 -24
  332. ccxt/pro/oxfun.py +1054 -0
  333. ccxt/pro/p2b.py +100 -24
  334. ccxt/pro/paradex.py +352 -0
  335. ccxt/pro/phemex.py +93 -34
  336. ccxt/pro/poloniex.py +129 -50
  337. ccxt/pro/poloniexfutures.py +53 -32
  338. ccxt/pro/probit.py +93 -86
  339. ccxt/pro/upbit.py +401 -8
  340. ccxt/pro/vertex.py +943 -0
  341. ccxt/pro/wazirx.py +46 -28
  342. ccxt/pro/whitebit.py +65 -12
  343. ccxt/pro/woo.py +486 -70
  344. ccxt/pro/woofipro.py +1271 -0
  345. ccxt/pro/xt.py +1067 -0
  346. ccxt/probit.py +143 -110
  347. ccxt/static_dependencies/__init__.py +1 -1
  348. ccxt/static_dependencies/lark/__init__.py +38 -0
  349. ccxt/static_dependencies/lark/__pyinstaller/__init__.py +6 -0
  350. ccxt/static_dependencies/lark/__pyinstaller/hook-lark.py +14 -0
  351. ccxt/static_dependencies/lark/ast_utils.py +59 -0
  352. ccxt/static_dependencies/lark/common.py +86 -0
  353. ccxt/static_dependencies/lark/exceptions.py +292 -0
  354. ccxt/static_dependencies/lark/grammar.py +130 -0
  355. ccxt/static_dependencies/lark/grammars/__init__.py +0 -0
  356. ccxt/static_dependencies/lark/indenter.py +143 -0
  357. ccxt/static_dependencies/lark/lark.py +658 -0
  358. ccxt/static_dependencies/lark/lexer.py +678 -0
  359. ccxt/static_dependencies/lark/load_grammar.py +1428 -0
  360. ccxt/static_dependencies/lark/parse_tree_builder.py +391 -0
  361. ccxt/static_dependencies/lark/parser_frontends.py +257 -0
  362. ccxt/static_dependencies/lark/parsers/__init__.py +0 -0
  363. ccxt/static_dependencies/lark/parsers/cyk.py +340 -0
  364. ccxt/static_dependencies/lark/parsers/earley.py +314 -0
  365. ccxt/static_dependencies/lark/parsers/earley_common.py +42 -0
  366. ccxt/static_dependencies/lark/parsers/earley_forest.py +801 -0
  367. ccxt/static_dependencies/lark/parsers/grammar_analysis.py +203 -0
  368. ccxt/static_dependencies/lark/parsers/lalr_analysis.py +332 -0
  369. ccxt/static_dependencies/lark/parsers/lalr_interactive_parser.py +158 -0
  370. ccxt/static_dependencies/lark/parsers/lalr_parser.py +122 -0
  371. ccxt/static_dependencies/lark/parsers/lalr_parser_state.py +110 -0
  372. ccxt/static_dependencies/lark/parsers/xearley.py +165 -0
  373. ccxt/static_dependencies/lark/py.typed +0 -0
  374. ccxt/static_dependencies/lark/reconstruct.py +107 -0
  375. ccxt/static_dependencies/lark/tools/__init__.py +70 -0
  376. ccxt/static_dependencies/lark/tools/nearley.py +202 -0
  377. ccxt/static_dependencies/lark/tools/serialize.py +32 -0
  378. ccxt/static_dependencies/lark/tools/standalone.py +196 -0
  379. ccxt/static_dependencies/lark/tree.py +267 -0
  380. ccxt/static_dependencies/lark/tree_matcher.py +186 -0
  381. ccxt/static_dependencies/lark/tree_templates.py +180 -0
  382. ccxt/static_dependencies/lark/utils.py +343 -0
  383. ccxt/static_dependencies/lark/visitors.py +596 -0
  384. ccxt/static_dependencies/marshmallow/__init__.py +81 -0
  385. ccxt/static_dependencies/marshmallow/base.py +65 -0
  386. ccxt/static_dependencies/marshmallow/class_registry.py +94 -0
  387. ccxt/static_dependencies/marshmallow/decorators.py +231 -0
  388. ccxt/static_dependencies/marshmallow/error_store.py +60 -0
  389. ccxt/static_dependencies/marshmallow/exceptions.py +71 -0
  390. ccxt/static_dependencies/marshmallow/fields.py +2114 -0
  391. ccxt/static_dependencies/marshmallow/orderedset.py +89 -0
  392. ccxt/static_dependencies/marshmallow/py.typed +0 -0
  393. ccxt/static_dependencies/marshmallow/schema.py +1228 -0
  394. ccxt/static_dependencies/marshmallow/types.py +12 -0
  395. ccxt/static_dependencies/marshmallow/utils.py +378 -0
  396. ccxt/static_dependencies/marshmallow/validate.py +678 -0
  397. ccxt/static_dependencies/marshmallow/warnings.py +2 -0
  398. ccxt/static_dependencies/marshmallow_dataclass/__init__.py +1047 -0
  399. ccxt/static_dependencies/marshmallow_dataclass/collection_field.py +51 -0
  400. ccxt/static_dependencies/marshmallow_dataclass/lazy_class_attribute.py +45 -0
  401. ccxt/static_dependencies/marshmallow_dataclass/mypy.py +71 -0
  402. ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
  403. ccxt/static_dependencies/marshmallow_dataclass/typing.py +14 -0
  404. ccxt/static_dependencies/marshmallow_dataclass/union_field.py +82 -0
  405. ccxt/static_dependencies/marshmallow_oneofschema/__init__.py +1 -0
  406. ccxt/static_dependencies/marshmallow_oneofschema/one_of_schema.py +193 -0
  407. ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
  408. ccxt/static_dependencies/starknet/__init__.py +0 -0
  409. ccxt/static_dependencies/starknet/cairo/__init__.py +0 -0
  410. ccxt/static_dependencies/starknet/cairo/data_types.py +123 -0
  411. ccxt/static_dependencies/starknet/cairo/deprecated_parse/__init__.py +0 -0
  412. ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py +77 -0
  413. ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser.py +46 -0
  414. ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py +138 -0
  415. ccxt/static_dependencies/starknet/cairo/felt.py +64 -0
  416. ccxt/static_dependencies/starknet/cairo/type_parser.py +121 -0
  417. ccxt/static_dependencies/starknet/cairo/v1/__init__.py +0 -0
  418. ccxt/static_dependencies/starknet/cairo/v1/type_parser.py +59 -0
  419. ccxt/static_dependencies/starknet/cairo/v2/__init__.py +0 -0
  420. ccxt/static_dependencies/starknet/cairo/v2/type_parser.py +77 -0
  421. ccxt/static_dependencies/starknet/ccxt_utils.py +7 -0
  422. ccxt/static_dependencies/starknet/common.py +15 -0
  423. ccxt/static_dependencies/starknet/constants.py +39 -0
  424. ccxt/static_dependencies/starknet/hash/__init__.py +0 -0
  425. ccxt/static_dependencies/starknet/hash/address.py +79 -0
  426. ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py +111 -0
  427. ccxt/static_dependencies/starknet/hash/selector.py +16 -0
  428. ccxt/static_dependencies/starknet/hash/storage.py +12 -0
  429. ccxt/static_dependencies/starknet/hash/utils.py +78 -0
  430. ccxt/static_dependencies/starknet/models/__init__.py +0 -0
  431. ccxt/static_dependencies/starknet/models/typed_data.py +45 -0
  432. ccxt/static_dependencies/starknet/serialization/__init__.py +24 -0
  433. ccxt/static_dependencies/starknet/serialization/_calldata_reader.py +40 -0
  434. ccxt/static_dependencies/starknet/serialization/_context.py +142 -0
  435. ccxt/static_dependencies/starknet/serialization/data_serializers/__init__.py +10 -0
  436. ccxt/static_dependencies/starknet/serialization/data_serializers/_common.py +82 -0
  437. ccxt/static_dependencies/starknet/serialization/data_serializers/array_serializer.py +43 -0
  438. ccxt/static_dependencies/starknet/serialization/data_serializers/bool_serializer.py +37 -0
  439. ccxt/static_dependencies/starknet/serialization/data_serializers/byte_array_serializer.py +66 -0
  440. ccxt/static_dependencies/starknet/serialization/data_serializers/cairo_data_serializer.py +71 -0
  441. ccxt/static_dependencies/starknet/serialization/data_serializers/enum_serializer.py +71 -0
  442. ccxt/static_dependencies/starknet/serialization/data_serializers/felt_serializer.py +50 -0
  443. ccxt/static_dependencies/starknet/serialization/data_serializers/named_tuple_serializer.py +58 -0
  444. ccxt/static_dependencies/starknet/serialization/data_serializers/option_serializer.py +43 -0
  445. ccxt/static_dependencies/starknet/serialization/data_serializers/output_serializer.py +40 -0
  446. ccxt/static_dependencies/starknet/serialization/data_serializers/payload_serializer.py +72 -0
  447. ccxt/static_dependencies/starknet/serialization/data_serializers/struct_serializer.py +36 -0
  448. ccxt/static_dependencies/starknet/serialization/data_serializers/tuple_serializer.py +36 -0
  449. ccxt/static_dependencies/starknet/serialization/data_serializers/uint256_serializer.py +76 -0
  450. ccxt/static_dependencies/starknet/serialization/data_serializers/uint_serializer.py +100 -0
  451. ccxt/static_dependencies/starknet/serialization/data_serializers/unit_serializer.py +32 -0
  452. ccxt/static_dependencies/starknet/serialization/errors.py +10 -0
  453. ccxt/static_dependencies/starknet/serialization/factory.py +229 -0
  454. ccxt/static_dependencies/starknet/serialization/function_serialization_adapter.py +110 -0
  455. ccxt/static_dependencies/starknet/serialization/tuple_dataclass.py +59 -0
  456. ccxt/static_dependencies/starknet/utils/__init__.py +0 -0
  457. ccxt/static_dependencies/starknet/utils/constructor_args_translator.py +86 -0
  458. ccxt/static_dependencies/starknet/utils/iterable.py +13 -0
  459. ccxt/static_dependencies/starknet/utils/schema.py +13 -0
  460. ccxt/static_dependencies/starknet/utils/typed_data.py +182 -0
  461. ccxt/static_dependencies/starkware/__init__.py +0 -0
  462. ccxt/static_dependencies/starkware/crypto/__init__.py +0 -0
  463. ccxt/static_dependencies/starkware/crypto/fast_pedersen_hash.py +50 -0
  464. ccxt/static_dependencies/starkware/crypto/math_utils.py +78 -0
  465. ccxt/static_dependencies/starkware/crypto/signature.py +2344 -0
  466. ccxt/static_dependencies/starkware/crypto/utils.py +63 -0
  467. ccxt/static_dependencies/sympy/__init__.py +0 -0
  468. ccxt/static_dependencies/sympy/core/__init__.py +0 -0
  469. ccxt/static_dependencies/sympy/core/intfunc.py +35 -0
  470. ccxt/static_dependencies/sympy/external/__init__.py +0 -0
  471. ccxt/static_dependencies/sympy/external/gmpy.py +345 -0
  472. ccxt/static_dependencies/sympy/external/importtools.py +187 -0
  473. ccxt/static_dependencies/sympy/external/ntheory.py +637 -0
  474. ccxt/static_dependencies/sympy/external/pythonmpq.py +341 -0
  475. ccxt/static_dependencies/typing_inspect/__init__.py +0 -0
  476. ccxt/static_dependencies/typing_inspect/typing_inspect.py +851 -0
  477. ccxt/test/{test_async.py → tests_async.py} +465 -407
  478. ccxt/test/tests_helpers.py +285 -0
  479. ccxt/test/tests_init.py +39 -0
  480. ccxt/test/{test_sync.py → tests_sync.py} +465 -409
  481. ccxt/timex.py +123 -70
  482. ccxt/tokocrypto.py +129 -93
  483. ccxt/tradeogre.py +39 -25
  484. ccxt/upbit.py +322 -113
  485. ccxt/vertex.py +2983 -0
  486. ccxt/wavesexchange.py +227 -173
  487. ccxt/wazirx.py +145 -65
  488. ccxt/whitebit.py +533 -138
  489. ccxt/woo.py +1155 -295
  490. ccxt/woofipro.py +2716 -0
  491. ccxt/xt.py +4627 -0
  492. ccxt/yobit.py +159 -92
  493. ccxt/zaif.py +80 -33
  494. ccxt/zonda.py +140 -69
  495. ccxt-4.4.48.dist-info/LICENSE.txt +21 -0
  496. ccxt-4.4.48.dist-info/METADATA +646 -0
  497. ccxt-4.4.48.dist-info/RECORD +669 -0
  498. {ccxt-4.2.76.dist-info → ccxt-4.4.48.dist-info}/WHEEL +1 -1
  499. ccxt/abstract/bitbay.py +0 -47
  500. ccxt/abstract/bitfinex2.py +0 -139
  501. ccxt/abstract/hitbtc3.py +0 -115
  502. ccxt/async_support/bitbay.py +0 -17
  503. ccxt/async_support/bitfinex2.py +0 -3496
  504. ccxt/async_support/flowbtc.py +0 -34
  505. ccxt/bitbay.py +0 -17
  506. ccxt/bitfinex2.py +0 -3496
  507. ccxt/flowbtc.py +0 -34
  508. ccxt/hitbtc3.py +0 -16
  509. ccxt/pro/bitfinex2.py +0 -1081
  510. ccxt/test/base/__init__.py +0 -28
  511. ccxt/test/base/test_account.py +0 -26
  512. ccxt/test/base/test_balance.py +0 -56
  513. ccxt/test/base/test_borrow_interest.py +0 -35
  514. ccxt/test/base/test_borrow_rate.py +0 -32
  515. ccxt/test/base/test_calculate_fee.py +0 -51
  516. ccxt/test/base/test_crypto.py +0 -127
  517. ccxt/test/base/test_currency.py +0 -76
  518. ccxt/test/base/test_datetime.py +0 -103
  519. ccxt/test/base/test_decimal_to_precision.py +0 -392
  520. ccxt/test/base/test_deep_extend.py +0 -68
  521. ccxt/test/base/test_deposit_withdrawal.py +0 -50
  522. ccxt/test/base/test_exchange_datetime_functions.py +0 -76
  523. ccxt/test/base/test_funding_rate_history.py +0 -29
  524. ccxt/test/base/test_last_price.py +0 -32
  525. ccxt/test/base/test_ledger_entry.py +0 -45
  526. ccxt/test/base/test_ledger_item.py +0 -48
  527. ccxt/test/base/test_leverage_tier.py +0 -33
  528. ccxt/test/base/test_margin_mode.py +0 -24
  529. ccxt/test/base/test_margin_modification.py +0 -35
  530. ccxt/test/base/test_market.py +0 -190
  531. ccxt/test/base/test_number.py +0 -411
  532. ccxt/test/base/test_ohlcv.py +0 -32
  533. ccxt/test/base/test_open_interest.py +0 -32
  534. ccxt/test/base/test_order.py +0 -64
  535. ccxt/test/base/test_order_book.py +0 -63
  536. ccxt/test/base/test_position.py +0 -60
  537. ccxt/test/base/test_shared_methods.py +0 -345
  538. ccxt/test/base/test_status.py +0 -24
  539. ccxt/test/base/test_throttle.py +0 -126
  540. ccxt/test/base/test_ticker.py +0 -86
  541. ccxt/test/base/test_trade.py +0 -47
  542. ccxt/test/base/test_trading_fee.py +0 -26
  543. ccxt/test/base/test_transaction.py +0 -39
  544. ccxt-4.2.76.dist-info/METADATA +0 -626
  545. ccxt-4.2.76.dist-info/RECORD +0 -534
  546. {ccxt-4.2.76.dist-info → ccxt-4.4.48.dist-info}/top_level.txt +0 -0
@@ -6,16 +6,16 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinbaseinternational import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from typing import Any
12
12
  from ccxt.base.errors import ExchangeError
13
+ from ccxt.base.errors import AuthenticationError
13
14
  from ccxt.base.errors import PermissionDenied
14
15
  from ccxt.base.errors import ArgumentsRequired
15
16
  from ccxt.base.errors import BadRequest
16
17
  from ccxt.base.errors import InvalidOrder
17
18
  from ccxt.base.errors import DuplicateOrderId
18
- from ccxt.base.errors import AuthenticationError
19
19
  from ccxt.base.decimal_to_precision import TICK_SIZE
20
20
  from ccxt.base.precise import Precise
21
21
 
@@ -74,7 +74,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
74
74
  'fetchCrossBorrowRates': False,
75
75
  'fetchCurrencies': True,
76
76
  'fetchDeposits': True,
77
- 'fetchFundingHistory': False,
77
+ 'fetchFundingHistory': True,
78
78
  'fetchFundingRate': False,
79
79
  'fetchFundingRateHistory': True,
80
80
  'fetchFundingRates': False,
@@ -85,21 +85,24 @@ class coinbaseinternational(Exchange, ImplicitAPI):
85
85
  'fetchLedger': False,
86
86
  'fetchLeverage': False,
87
87
  'fetchLeverageTiers': False,
88
+ 'fetchMarginAdjustmentHistory': False,
88
89
  'fetchMarginMode': False,
89
90
  'fetchMarkets': True,
90
91
  'fetchMarkOHLCV': False,
91
92
  'fetchMyBuys': True,
92
93
  'fetchMySells': True,
93
94
  'fetchMyTrades': True,
94
- 'fetchOHLCV': False,
95
+ 'fetchOHLCV': True,
95
96
  'fetchOpenInterestHistory': False,
96
97
  'fetchOpenOrders': True,
97
98
  'fetchOrder': True,
98
99
  'fetchOrderBook': False,
99
100
  'fetchOrders': False,
100
101
  'fetchPosition': True,
102
+ 'fetchPositionHistory': False,
101
103
  'fetchPositionMode': False,
102
104
  'fetchPositions': True,
105
+ 'fetchPositionsHistory': False,
103
106
  'fetchPositionsRisk': False,
104
107
  'fetchPremiumIndexOHLCV': False,
105
108
  'fetchTicker': True,
@@ -108,8 +111,10 @@ class coinbaseinternational(Exchange, ImplicitAPI):
108
111
  'fetchTrades': False,
109
112
  'fetchTradingFee': False,
110
113
  'fetchTradingFees': False,
114
+ 'fetchTransfers': True,
111
115
  'fetchWithdrawals': True,
112
116
  'reduceMargin': False,
117
+ 'sandbox': True,
113
118
  'setLeverage': False,
114
119
  'setMargin': True,
115
120
  'setMarginMode': False,
@@ -126,10 +131,10 @@ class coinbaseinternational(Exchange, ImplicitAPI):
126
131
  },
127
132
  'www': 'https://international.coinbase.com',
128
133
  'doc': [
129
- 'https://docs.cloud.coinbaseinternational.com/intx/docs',
134
+ 'https://docs.cloud.coinbase.com/intx/docs',
130
135
  ],
131
136
  'fees': [
132
- 'https://help.coinbaseinternational.com/en/international-exchange/trading-deposits-withdrawals/international-exchange-fees',
137
+ 'https://help.coinbase.com/en/international-exchange/trading-deposits-withdrawals/international-exchange-fees',
133
138
  ],
134
139
  'referral': '',
135
140
  },
@@ -149,7 +154,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
149
154
  'instruments/{instrument}',
150
155
  'instruments/{instrument}/quote',
151
156
  'instruments/{instrument}/funding',
152
- '',
157
+ 'instruments/{instrument}/candles',
153
158
  ],
154
159
  },
155
160
  'private': {
@@ -259,6 +264,72 @@ class coinbaseinternational(Exchange, ImplicitAPI):
259
264
  'bitcoin': 'BTC',
260
265
  },
261
266
  },
267
+ 'features': {
268
+ 'default': {
269
+ 'sandbox': True,
270
+ 'createOrder': {
271
+ 'marginMode': False,
272
+ 'triggerPrice': True,
273
+ 'triggerPriceType': None,
274
+ 'triggerDirection': True,
275
+ 'stopLossPrice': False, # todo implementation
276
+ 'takeProfitPrice': False, # todo implementation
277
+ 'attachedStopLossTakeProfit': None,
278
+ 'timeInForce': {
279
+ 'IOC': True,
280
+ 'FOK': True,
281
+ 'PO': True,
282
+ 'GTD': True,
283
+ 'GTC': True, # has 30 days max
284
+ },
285
+ 'hedged': False,
286
+ 'trailing': False,
287
+ 'leverage': False,
288
+ 'marketBuyByCost': False,
289
+ 'marketBuyRequiresPrice': True,
290
+ 'selfTradePrevention': True, # todo: implement
291
+ 'iceberg': False,
292
+ },
293
+ 'createOrders': None,
294
+ 'fetchMyTrades': {
295
+ 'marginMode': False,
296
+ 'limit': 100,
297
+ 'daysBack': None,
298
+ 'untilDays': 10000,
299
+ },
300
+ 'fetchOrder': {
301
+ 'marginMode': False,
302
+ 'trigger': False,
303
+ 'trailing': False,
304
+ },
305
+ 'fetchOpenOrders': {
306
+ 'marginMode': False,
307
+ 'limit': 100,
308
+ 'trigger': False,
309
+ 'trailing': False,
310
+ },
311
+ 'fetchOrders': None,
312
+ 'fetchClosedOrders': None,
313
+ 'fetchOHLCV': {
314
+ 'limit': 300,
315
+ },
316
+ },
317
+ 'spot': {
318
+ 'extends': 'default',
319
+ },
320
+ 'swap': {
321
+ 'linear': {
322
+ 'extends': 'default',
323
+ },
324
+ 'inverse': {
325
+ 'extends': 'default',
326
+ },
327
+ },
328
+ 'future': {
329
+ 'linear': None,
330
+ 'inverse': None,
331
+ },
332
+ },
262
333
  })
263
334
 
264
335
  async def handle_portfolio_and_params(self, methodName: str, params={}):
@@ -299,7 +370,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
299
370
  async def fetch_accounts(self, params={}):
300
371
  """
301
372
  fetch all the accounts associated with a profile
302
- :see: https://docs.cloud.coinbase.com/intx/reference/getportfolios
373
+
374
+ https://docs.cloud.coinbase.com/intx/reference/getportfolios
375
+
303
376
  :param dict [params]: extra parameters specific to the exchange API endpoint
304
377
  :returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
305
378
  """
@@ -347,15 +420,89 @@ class coinbaseinternational(Exchange, ImplicitAPI):
347
420
  'info': account,
348
421
  }
349
422
 
423
+ async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = 100, params={}) -> List[list]:
424
+ """
425
+ fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
426
+
427
+ https://docs.cdp.coinbase.com/intx/reference/getinstrumentcandles
428
+
429
+ :param str symbol: unified symbol of the market to fetch OHLCV data for
430
+ :param str timeframe: the length of time each candle represents
431
+ :param int [since]: timestamp in ms of the earliest candle to fetch
432
+ :param int [limit]: the maximum amount of candles to fetch, default 100 max 10000
433
+ :param dict [params]: extra parameters specific to the exchange API endpoint
434
+ :returns int[][]: A list of candles ordered, open, high, low, close, volume
435
+ :param int [params.until]: timestamp in ms of the latest candle to fetch
436
+ :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
437
+ """
438
+ await self.load_markets()
439
+ paginate = False
440
+ paginate, params = self.handle_option_and_params(params, 'fetchOHLCV', 'paginate')
441
+ if paginate:
442
+ return await self.fetch_paginated_call_deterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 10000)
443
+ market = self.market(symbol)
444
+ request: dict = {
445
+ 'instrument': market['id'],
446
+ 'granularity': self.safe_string(self.timeframes, timeframe, timeframe),
447
+ }
448
+ if since is not None:
449
+ request['start'] = self.iso8601(since)
450
+ else:
451
+ raise ArgumentsRequired(self.id + ' fetchOHLCV() requires a since argument')
452
+ unitl = self.safe_integer(params, 'until')
453
+ if unitl is not None:
454
+ params = self.omit(params, 'until')
455
+ request['end'] = self.iso8601(unitl)
456
+ response = await self.v1PublicGetInstrumentsInstrumentCandles(self.extend(request, params))
457
+ #
458
+ # {
459
+ # "aggregations": [
460
+ # {
461
+ # "start": "2024-04-23T00:00:00Z",
462
+ # "open": "62884.4",
463
+ # "high": "64710.6",
464
+ # "low": "62884.4",
465
+ # "close": "63508.4",
466
+ # "volume": "3253.9983"
467
+ # }
468
+ # ]
469
+ # }
470
+ #
471
+ candles = self.safe_list(response, 'aggregations', [])
472
+ return self.parse_ohlcvs(candles, market, timeframe, since, limit)
473
+
474
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
475
+ #
476
+ # {
477
+ # "start": "2024-04-23T00:00:00Z",
478
+ # "open": "62884.4",
479
+ # "high": "64710.6",
480
+ # "low": "62884.4",
481
+ # "close": "63508.4",
482
+ # "volume": "3253.9983"
483
+ # }
484
+ #
485
+ return [
486
+ self.parse8601(self.safe_string_2(ohlcv, 'start', 'time')),
487
+ self.safe_number(ohlcv, 'open'),
488
+ self.safe_number(ohlcv, 'high'),
489
+ self.safe_number(ohlcv, 'low'),
490
+ self.safe_number(ohlcv, 'close'),
491
+ self.safe_number(ohlcv, 'volume'),
492
+ ]
493
+
350
494
  async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
351
495
  """
352
496
  fetches historical funding rate prices
353
- :see: https://docs.cloud.coinbase.com/intx/reference/getinstrumentfunding
497
+
498
+ https://docs.cloud.coinbase.com/intx/reference/getinstrumentfunding
499
+
354
500
  :param str symbol: unified symbol of the market to fetch the funding rate history for
355
501
  :param int [since]: timestamp in ms of the earliest funding rate to fetch
356
502
  :param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
357
503
  :param dict [params]: extra parameters specific to the exchange API endpoint
358
504
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
505
+ :returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
359
506
  """
360
507
  if symbol is None:
361
508
  raise ArgumentsRequired(self.id + ' fetchFundingRateHistory() requires a symbol argument')
@@ -369,7 +516,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
369
516
  return await self.fetch_paginated_call_incremental('fetchFundingRateHistory', symbol, since, limit, params, pageKey, maxEntriesPerRequest)
370
517
  market = self.market(symbol)
371
518
  page = self.safe_integer(params, pageKey, 1) - 1
372
- request = {
519
+ request: dict = {
373
520
  'instrument': market['id'],
374
521
  'result_offset': self.safe_integer_2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
375
522
  }
@@ -429,11 +576,171 @@ class coinbaseinternational(Exchange, ImplicitAPI):
429
576
  'previousFundingDatetime': None,
430
577
  }
431
578
 
579
+ async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
580
+ """
581
+ fetch the history of funding payments paid and received on self account
582
+
583
+ https://docs.cdp.coinbase.com/intx/reference/gettransfers
584
+
585
+ :param str [symbol]: unified market symbol
586
+ :param int [since]: the earliest time in ms to fetch funding history for
587
+ :param int [limit]: the maximum number of funding history structures to retrieve
588
+ :param dict [params]: extra parameters specific to the exchange API endpoint
589
+ :returns dict: a `funding history structure <https://docs.ccxt.com/#/?id=funding-history-structure>`
590
+ """
591
+ await self.load_markets()
592
+ request: dict = {
593
+ 'type': 'FUNDING',
594
+ }
595
+ market: Market = None
596
+ if symbol is not None:
597
+ market = self.market(symbol)
598
+ portfolios = None
599
+ portfolios, params = self.handle_option_and_params(params, 'fetchFundingHistory', 'portfolios')
600
+ if portfolios is not None:
601
+ request['portfolios'] = portfolios
602
+ if since is not None:
603
+ request['time_from'] = self.iso8601(since)
604
+ if limit is not None:
605
+ request['result_limit'] = limit
606
+ else:
607
+ request['result_limit'] = 100
608
+ response = await self.v1PrivateGetTransfers(self.extend(request, params))
609
+ fundings = self.safe_list(response, 'results', [])
610
+ return self.parse_incomes(fundings, market, since, limit)
611
+
612
+ def parse_income(self, income, market: Market = None):
613
+ #
614
+ # {
615
+ # "amount":"0.0008",
616
+ # "asset":"USDC",
617
+ # "created_at":"2024-02-22T16:00:00Z",
618
+ # "from_portfolio":{
619
+ # "id":"13yuk1fs-1-0",
620
+ # "name":"Eng Test Portfolio - 2",
621
+ # "uuid":"018712f2-5ff9-7de3-9010-xxxxxxxxx"
622
+ # },
623
+ # "instrument_id":"149264164756389888",
624
+ # "instrument_symbol":"ETH-PERP",
625
+ # "position_id":"1xy4v51m-1-2",
626
+ # "status":"PROCESSED",
627
+ # "to_portfolio":{
628
+ # "name":"CB_FUND"
629
+ # },
630
+ # "transfer_type":"FUNDING",
631
+ # "transfer_uuid":"a6b708df-2c44-32c5-bb98-xxxxxxxxxx",
632
+ # "updated_at":"2024-02-22T16:00:00Z"
633
+ # }
634
+ #
635
+ marketId = self.safe_string(income, 'symbol')
636
+ market = self.safe_market(marketId, market, None, 'contract')
637
+ datetime = self.safe_integer(income, 'created_at')
638
+ timestamp = self.parse8601(datetime)
639
+ currencyId = self.safe_string(income, 'asset')
640
+ code = self.safe_currency_code(currencyId)
641
+ return {
642
+ 'info': income,
643
+ 'symbol': market['symbol'],
644
+ 'code': code,
645
+ 'timestamp': timestamp,
646
+ 'datetime': self.iso8601(timestamp),
647
+ 'id': self.safe_string(income, 'transfer_uuid'),
648
+ 'amount': self.safe_number(income, 'amount'),
649
+ 'rate': None,
650
+ }
651
+
652
+ async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
653
+ """
654
+ fetch a history of internal transfers made on an account
655
+
656
+ https://docs.cdp.coinbase.com/intx/reference/gettransfers
657
+
658
+ :param str code: unified currency code of the currency transferred
659
+ :param int [since]: the earliest time in ms to fetch transfers for
660
+ :param int [limit]: the maximum number of transfers structures to retrieve
661
+ :param dict [params]: extra parameters specific to the exchange API endpoint
662
+ :returns dict[]: a list of `transfer structures <https://docs.ccxt.com/#/?id=transfer-structure>`
663
+ """
664
+ await self.load_markets()
665
+ request: dict = {
666
+ 'type': 'INTERNAL',
667
+ }
668
+ currency = None
669
+ if code is not None:
670
+ currency = self.currency(code)
671
+ portfolios = None
672
+ portfolios, params = self.handle_option_and_params(params, 'fetchTransfers', 'portfolios')
673
+ if portfolios is not None:
674
+ request['portfolios'] = portfolios
675
+ if since is not None:
676
+ request['time_from'] = self.iso8601(since)
677
+ if limit is not None:
678
+ request['result_limit'] = limit
679
+ else:
680
+ request['result_limit'] = 100
681
+ response = await self.v1PrivateGetTransfers(self.extend(request, params))
682
+ transfers = self.safe_list(response, 'results', [])
683
+ return self.parse_transfers(transfers, currency, since, limit)
684
+
685
+ def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
686
+ #
687
+ # {
688
+ # "amount":"0.0008",
689
+ # "asset":"USDC",
690
+ # "created_at":"2024-02-22T16:00:00Z",
691
+ # "from_portfolio":{
692
+ # "id":"13yuk1fs-1-0",
693
+ # "name":"Eng Test Portfolio - 2",
694
+ # "uuid":"018712f2-5ff9-7de3-9010-xxxxxxxxx"
695
+ # },
696
+ # "instrument_id":"149264164756389888",
697
+ # "instrument_symbol":"ETH-PERP",
698
+ # "position_id":"1xy4v51m-1-2",
699
+ # "status":"PROCESSED",
700
+ # "to_portfolio":{
701
+ # "name":"CB_FUND"
702
+ # },
703
+ # "transfer_type":"FUNDING",
704
+ # "transfer_uuid":"a6b708df-2c44-32c5-bb98-xxxxxxxxxx",
705
+ # "updated_at":"2024-02-22T16:00:00Z"
706
+ # }
707
+ #
708
+ datetime = self.safe_integer(transfer, 'created_at')
709
+ timestamp = self.parse8601(datetime)
710
+ currencyId = self.safe_string(transfer, 'asset')
711
+ code = self.safe_currency_code(currencyId)
712
+ fromPorfolio = self.safe_dict(transfer, 'from_portfolio', {})
713
+ fromId = self.safe_string(fromPorfolio, 'id')
714
+ toPorfolio = self.safe_dict(transfer, 'to_portfolio', {})
715
+ toId = self.safe_string(toPorfolio, 'id')
716
+ return {
717
+ 'info': transfer,
718
+ 'id': self.safe_string(transfer, 'transfer_uuid'),
719
+ 'timestamp': timestamp,
720
+ 'datetime': self.iso8601(timestamp),
721
+ 'currency': code,
722
+ 'amount': self.safe_number(transfer, 'amount'),
723
+ 'fromAccount': fromId,
724
+ 'toAccount': toId,
725
+ 'status': self.parse_transfer_status(self.safe_string(transfer, 'status')),
726
+ }
727
+
728
+ def parse_transfer_status(self, status: Str) -> Str:
729
+ statuses: dict = {
730
+ 'FAILED': 'failed',
731
+ 'PROCESSED': 'ok',
732
+ 'NEW': 'pending',
733
+ 'STARTED': 'pending',
734
+ }
735
+ return self.safe_string(statuses, status, status)
736
+
432
737
  async def create_deposit_address(self, code: str, params={}):
433
738
  """
434
739
  create a currency deposit address
435
- :see: https://docs.cloud.coinbase.com/intx/reference/createaddress
436
- :see: https://docs.cloud.coinbase.com/intx/reference/createcounterpartyid
740
+
741
+ https://docs.cloud.coinbase.com/intx/reference/createaddress
742
+ https://docs.cloud.coinbase.com/intx/reference/createcounterpartyid
743
+
437
744
  :param str code: unified currency code of the currency for the deposit address
438
745
  :param dict [params]: extra parameters specific to the exchange API endpoint
439
746
  :param str [params.network_arn_id]: Identifies the blockchain network(e.g., networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a) if not provided will pick default
@@ -445,7 +752,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
445
752
  method, params = self.handle_option_and_params(params, 'createDepositAddress', 'method', 'v1PrivatePostTransfersAddress')
446
753
  portfolio = None
447
754
  portfolio, params = await self.handle_portfolio_and_params('createDepositAddress', params)
448
- request = {
755
+ request: dict = {
449
756
  'portfolio': portfolio,
450
757
  }
451
758
  if method == 'v1PrivatePostTransfersAddress':
@@ -491,7 +798,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
491
798
  networks = self.safe_dict(currency, 'networks')
492
799
  if networks is not None:
493
800
  return
494
- request = {
801
+ request: dict = {
495
802
  'asset': currency['id'],
496
803
  }
497
804
  rawNetworks = await self.v1PublicGetAssetsAssetNetworks(request)
@@ -501,7 +808,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
501
808
  # "asset_id" = self.parse_networks(rawNetworks)
502
809
 
503
810
  def parse_networks(self, networks, params={}):
504
- result = {}
811
+ result: dict = {}
505
812
  for i in range(0, len(networks)):
506
813
  network = self.extend(self.parse_network(networks[i]), params)
507
814
  result[network['network']] = network
@@ -526,11 +833,12 @@ class coinbaseinternational(Exchange, ImplicitAPI):
526
833
  currencyId = self.safe_string(network, 'asset_name')
527
834
  currencyCode = self.safe_currency_code(currencyId)
528
835
  networkId = self.safe_string(network, 'network_arn_id')
836
+ networkIdForCode = self.safe_string_n(network, ['network_name', 'display_name', 'network_arn_id'], '')
529
837
  return self.safe_network({
530
838
  'info': network,
531
839
  'id': networkId,
532
840
  'name': self.safe_string(network, 'display_name'),
533
- 'network': self.network_id_to_code(self.safe_string_n(network, ['network_name', 'display_name', 'network_arn_id'], ''), currencyCode),
841
+ 'network': self.network_id_to_code(networkIdForCode, currencyCode),
534
842
  'active': None,
535
843
  'deposit': None,
536
844
  'withdraw': None,
@@ -551,7 +859,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
551
859
  async def set_margin(self, symbol: str, amount: float, params={}) -> Any:
552
860
  """
553
861
  Either adds or reduces margin in order to set the margin to a specific value
554
- :see: https://docs.cloud.coinbase.com/intx/reference/setportfoliomarginoverride
862
+
863
+ https://docs.cloud.coinbase.com/intx/reference/setportfoliomarginoverride
864
+
555
865
  :param str symbol: unified market symbol of the market to set margin in
556
866
  :param float amount: the amount to set the margin to
557
867
  :param dict [params]: parameters specific to the exchange API endpoint
@@ -561,16 +871,18 @@ class coinbaseinternational(Exchange, ImplicitAPI):
561
871
  portfolio, params = await self.handle_portfolio_and_params('setMargin', params)
562
872
  if symbol is not None:
563
873
  raise BadRequest(self.id + ' setMargin() only allows setting margin to full portfolio')
564
- request = {
874
+ request: dict = {
565
875
  'portfolio': portfolio,
566
876
  'margin_override': amount,
567
877
  }
568
878
  return await self.v1PrivatePostPortfoliosMargin(self.extend(request, params))
569
879
 
570
- async def fetch_deposits_withdrawals(self, code: str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
880
+ async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
571
881
  """
572
882
  fetch history of deposits and withdrawals
573
- :see: https://docs.cloud.coinbase.com/intx/reference/gettransfers
883
+
884
+ https://docs.cloud.coinbase.com/intx/reference/gettransfers
885
+
574
886
  :param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
575
887
  :param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
576
888
  :param int [limit]: max number of deposit/withdrawals to return, default is None
@@ -591,7 +903,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
591
903
  if paginate:
592
904
  return await self.fetch_paginated_call_incremental('fetchDepositsWithdrawals', code, since, limit, params, pageKey, maxEntriesPerRequest)
593
905
  page = self.safe_integer(params, pageKey, 1) - 1
594
- request = {
906
+ request: dict = {
595
907
  'result_offset': self.safe_integer_2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
596
908
  }
597
909
  if since is not None:
@@ -639,7 +951,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
639
951
 
640
952
  async def fetch_position(self, symbol: str, params={}):
641
953
  """
642
- :see: https://docs.cloud.coinbase.com/intx/reference/getportfolioposition
954
+
955
+ https://docs.cloud.coinbase.com/intx/reference/getportfolioposition
956
+
643
957
  fetch data on an open position
644
958
  :param str symbol: unified market symbol of the market the position is held in
645
959
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -649,7 +963,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
649
963
  symbol = self.symbol(symbol)
650
964
  portfolio = None
651
965
  portfolio, params = await self.handle_portfolio_and_params('fetchPosition', params)
652
- request = {
966
+ request: dict = {
653
967
  'portfolio': portfolio,
654
968
  'instrument': self.market_id(symbol),
655
969
  }
@@ -671,7 +985,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
671
985
  #
672
986
  return self.parse_position(position)
673
987
 
674
- def parse_position(self, position, market: Market = None):
988
+ def parse_position(self, position: dict, market: Market = None):
675
989
  #
676
990
  # {
677
991
  # "symbol":"BTC-PERP",
@@ -722,17 +1036,18 @@ class coinbaseinternational(Exchange, ImplicitAPI):
722
1036
 
723
1037
  async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
724
1038
  """
725
- :see: https://docs.cloud.coinbase.com/intx/reference/getportfoliopositions
1039
+
1040
+ https://docs.cloud.coinbase.com/intx/reference/getportfoliopositions
1041
+
726
1042
  fetch all open positions
727
1043
  :param str[] [symbols]: list of unified market symbols
728
1044
  :param dict [params]: extra parameters specific to the exchange API endpoint
729
- :param str [method]: method name to call, "positionRisk", "account" or "option", default is "positionRisk"
730
1045
  :returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
731
1046
  """
732
1047
  await self.load_markets()
733
1048
  portfolio = None
734
1049
  portfolio, params = await self.handle_portfolio_and_params('fetchPositions', params)
735
- request = {
1050
+ request: dict = {
736
1051
  'portfolio': portfolio,
737
1052
  }
738
1053
  response = await self.v1PrivateGetPortfoliosPortfolioPositions(self.extend(request, params))
@@ -762,7 +1077,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
762
1077
  async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
763
1078
  """
764
1079
  fetch all withdrawals made from an account
765
- :see: https://docs.cloud.coinbase.com/intx/reference/gettransfers
1080
+
1081
+ https://docs.cloud.coinbase.com/intx/reference/gettransfers
1082
+
766
1083
  :param str code: unified currency code
767
1084
  :param int [since]: the earliest time in ms to fetch withdrawals for
768
1085
  :param int [limit]: the maximum number of withdrawals structures to retrieve
@@ -796,8 +1113,8 @@ class coinbaseinternational(Exchange, ImplicitAPI):
796
1113
  params['type'] = 'DEPOSIT'
797
1114
  return await self.fetch_deposits_withdrawals(code, since, limit, params)
798
1115
 
799
- def parse_transaction_status(self, status):
800
- statuses = {
1116
+ def parse_transaction_status(self, status: Str):
1117
+ statuses: dict = {
801
1118
  'PROCESSED': 'ok',
802
1119
  'NEW': 'pending',
803
1120
  'STARTED': 'pending',
@@ -805,7 +1122,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
805
1122
  }
806
1123
  return self.safe_string(statuses, status, status)
807
1124
 
808
- def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
1125
+ def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
809
1126
  #
810
1127
  # {
811
1128
  # "idem":"8e471d77-4208-45a8-9e5b-f3bd8a2c1fc3"
@@ -840,7 +1157,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
840
1157
  },
841
1158
  }
842
1159
 
843
- def parse_trade(self, trade, market: Market = None) -> Trade:
1160
+ def parse_trade(self, trade: dict, market: Market = None) -> Trade:
844
1161
  #
845
1162
  # {
846
1163
  # "portfolio_id":"1wp37qsc-1-0",
@@ -894,9 +1211,11 @@ class coinbaseinternational(Exchange, ImplicitAPI):
894
1211
  },
895
1212
  })
896
1213
 
897
- async def fetch_markets(self, params={}):
1214
+ async def fetch_markets(self, params={}) -> List[Market]:
898
1215
  """
899
- :see: https://docs.cloud.coinbase.com/intx/reference/getinstruments
1216
+
1217
+ https://docs.cloud.coinbase.com/intx/reference/getinstruments
1218
+
900
1219
  retrieves data on all markets for coinbaseinternational
901
1220
  :param dict [params]: extra parameters specific to the exchange API endpoint
902
1221
  :returns dict[]: an array of objects representing market data
@@ -953,7 +1272,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
953
1272
  #
954
1273
  return self.parse_markets(response)
955
1274
 
956
- def parse_market(self, market) -> Market:
1275
+ def parse_market(self, market: dict) -> Market:
957
1276
  #
958
1277
  # {
959
1278
  # "instrument_id":"149264164756389888",
@@ -1065,10 +1384,12 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1065
1384
  'created': None,
1066
1385
  }
1067
1386
 
1068
- async def fetch_currencies(self, params={}) -> Any:
1387
+ async def fetch_currencies(self, params={}) -> Currencies:
1069
1388
  """
1070
1389
  fetches all available currencies on an exchange
1071
- :see: https://docs.cloud.coinbase.com/intx/reference/getassets
1390
+
1391
+ https://docs.cloud.coinbase.com/intx/reference/getassets
1392
+
1072
1393
  :param dict [params]: extra parameters specific to the exchange API endpoint
1073
1394
  :returns dict: an associative dictionary of currencies
1074
1395
  """
@@ -1086,13 +1407,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1086
1407
  # ...
1087
1408
  # ]
1088
1409
  #
1089
- result = {}
1090
- for i in range(0, len(currencies)):
1091
- currency = self.parse_currency(currencies[i])
1092
- result[currency['code']] = currency
1093
- return result
1410
+ return self.parse_currencies(currencies)
1094
1411
 
1095
- def parse_currency(self, currency):
1412
+ def parse_currency(self, currency: dict) -> Currency:
1096
1413
  #
1097
1414
  # {
1098
1415
  # "asset_id":"1",
@@ -1106,7 +1423,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1106
1423
  id = self.safe_string(currency, 'asset_name')
1107
1424
  code = self.safe_currency_code(id)
1108
1425
  statusId = self.safe_string(currency, 'status')
1109
- return {
1426
+ return self.safe_currency_structure({
1110
1427
  'id': id,
1111
1428
  'name': code,
1112
1429
  'code': code,
@@ -1119,12 +1436,14 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1119
1436
  'fee': None,
1120
1437
  'fees': None,
1121
1438
  'limits': self.limits,
1122
- }
1439
+ })
1123
1440
 
1124
1441
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
1125
1442
  """
1126
1443
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
1127
- :see: https://docs.cloud.coinbase.com/intx/reference/getinstruments
1444
+
1445
+ https://docs.cloud.coinbase.com/intx/reference/getinstruments
1446
+
1128
1447
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1129
1448
  :param dict [params]: extra parameters specific to the exchange API endpoint
1130
1449
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -1132,7 +1451,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1132
1451
  await self.load_markets()
1133
1452
  symbols = self.market_symbols(symbols)
1134
1453
  instruments = await self.v1PublicGetInstruments(params)
1135
- tickers = {}
1454
+ tickers: dict = {}
1136
1455
  for i in range(0, len(instruments)):
1137
1456
  instrument = instruments[i]
1138
1457
  marketId = self.safe_string(instrument, 'symbol')
@@ -1144,14 +1463,16 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1144
1463
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
1145
1464
  """
1146
1465
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1147
- :see: https://docs.cloud.coinbase.com/intx/reference/getinstrumentquote
1466
+
1467
+ https://docs.cloud.coinbase.com/intx/reference/getinstrumentquote
1468
+
1148
1469
  :param str symbol: unified symbol of the market to fetch the ticker for
1149
1470
  :param dict [params]: extra parameters specific to the exchange API endpoint
1150
1471
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
1151
1472
  """
1152
1473
  await self.load_markets()
1153
1474
  market = self.market(symbol)
1154
- request = {
1475
+ request: dict = {
1155
1476
  'instrument': self.market_id(symbol),
1156
1477
  }
1157
1478
  ticker = await self.v1PublicGetInstrumentsInstrumentQuote(self.extend(request, params))
@@ -1197,12 +1518,16 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1197
1518
  'baseVolume': None,
1198
1519
  'quoteVolume': None,
1199
1520
  'previousClose': None,
1521
+ 'markPrice': self.safe_number(ticker, 'mark_price'),
1522
+ 'indexPrice': self.safe_number(ticker, 'index_price'),
1200
1523
  })
1201
1524
 
1202
1525
  async def fetch_balance(self, params={}) -> Balances:
1203
1526
  """
1204
1527
  query for balance and get the amount of funds available for trading or funds locked in orders
1205
- :see: https://docs.cloud.coinbase.com/intx/reference/getportfoliobalances
1528
+
1529
+ https://docs.cloud.coinbase.com/intx/reference/getportfoliobalances
1530
+
1206
1531
  :param dict [params]: extra parameters specific to the exchange API endpoint
1207
1532
  :param boolean [params.v3]: default False, set True to use v3 api endpoint
1208
1533
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
@@ -1210,7 +1535,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1210
1535
  await self.load_markets()
1211
1536
  portfolio = None
1212
1537
  portfolio, params = await self.handle_portfolio_and_params('fetchBalance', params)
1213
- request = {
1538
+ request: dict = {
1214
1539
  'portfolio': portfolio,
1215
1540
  }
1216
1541
  balances = await self.v1PrivateGetPortfoliosPortfolioBalances(self.extend(request, params))
@@ -1249,7 +1574,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1249
1574
  # "loan_collateral_requirement":"0.0"
1250
1575
  # }
1251
1576
  #
1252
- result = {
1577
+ result: dict = {
1253
1578
  'info': response,
1254
1579
  }
1255
1580
  for i in range(0, len(response)):
@@ -1265,7 +1590,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1265
1590
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
1266
1591
  """
1267
1592
  Transfer an amount of asset from one portfolio to another.
1268
- :see: https://docs.cloud.coinbase.com/intx/reference/createportfolioassettransfer
1593
+
1594
+ https://docs.cloud.coinbase.com/intx/reference/createportfolioassettransfer
1595
+
1269
1596
  :param str code: unified currency code
1270
1597
  :param float amount: amount to transfer
1271
1598
  :param str fromAccount: account to transfer from
@@ -1275,7 +1602,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1275
1602
  """
1276
1603
  await self.load_markets()
1277
1604
  currency = self.currency(code)
1278
- request = {
1605
+ request: dict = {
1279
1606
  'asset': currency['id'],
1280
1607
  'ammount': amount,
1281
1608
  'from': fromAccount,
@@ -1298,14 +1625,16 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1298
1625
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1299
1626
  """
1300
1627
  create a trade order
1301
- :see: https://docs.cloud.coinbase.com/intx/reference/createorder
1628
+
1629
+ https://docs.cloud.coinbase.com/intx/reference/createorder
1630
+
1302
1631
  :param str symbol: unified symbol of the market to create an order in
1303
1632
  :param str type: 'market' or 'limit'
1304
1633
  :param str side: 'buy' or 'sell'
1305
1634
  :param float amount: how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders
1306
1635
  :param float [price]: the price to fulfill the order, in units of the quote currency, ignored in market orders
1307
1636
  :param dict [params]: extra parameters specific to the exchange API endpoint
1308
- :param float [params.stopPrice]: price to trigger stop orders
1637
+ :param float [params.stopPrice]: alias for triggerPrice
1309
1638
  :param float [params.triggerPrice]: price to trigger stop orders
1310
1639
  :param float [params.stopLossPrice]: price to trigger stop-loss orders
1311
1640
  :param bool [params.postOnly]: True or False
@@ -1317,22 +1646,22 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1317
1646
  await self.load_markets()
1318
1647
  market = self.market(symbol)
1319
1648
  typeId = type.upper()
1320
- stopPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop_price'])
1649
+ triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop_price'])
1321
1650
  clientOrderIdprefix = self.safe_string(self.options, 'brokerId', 'nfqkvdjp')
1322
1651
  clientOrderId = clientOrderIdprefix + '-' + self.uuid()
1323
1652
  clientOrderId = clientOrderId[0:17]
1324
- request = {
1653
+ request: dict = {
1325
1654
  'client_order_id': clientOrderId,
1326
1655
  'side': side.upper(),
1327
1656
  'instrument': market['id'],
1328
1657
  'size': self.amount_to_precision(market['symbol'], amount),
1329
1658
  }
1330
- if stopPrice is not None:
1659
+ if triggerPrice is not None:
1331
1660
  if type == 'limit':
1332
1661
  typeId = 'STOP_LIMIT'
1333
1662
  else:
1334
1663
  typeId = 'STOP'
1335
- request['stop_price'] = stopPrice
1664
+ request['stop_price'] = triggerPrice
1336
1665
  request['type'] = typeId
1337
1666
  if type == 'limit':
1338
1667
  if price is None:
@@ -1381,7 +1710,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1381
1710
  #
1382
1711
  return self.parse_order(response, market)
1383
1712
 
1384
- def parse_order(self, order, market: Market = None) -> Order:
1713
+ def parse_order(self, order: dict, market: Market = None) -> Order:
1385
1714
  #
1386
1715
  # {
1387
1716
  # "order_id":"1x96skvg-1-0",
@@ -1426,7 +1755,6 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1426
1755
  'postOnly': None,
1427
1756
  'side': self.safe_string_lower(order, 'side'),
1428
1757
  'price': self.safe_string(order, 'price'),
1429
- 'stopPrice': self.safe_string(order, 'stop_price'),
1430
1758
  'triggerPrice': self.safe_string(order, 'stop_price'),
1431
1759
  'amount': self.safe_string(order, 'size'),
1432
1760
  'filled': self.safe_string(order, 'exec_qty'),
@@ -1438,8 +1766,8 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1438
1766
  'trades': None,
1439
1767
  }, market)
1440
1768
 
1441
- def parse_order_status(self, status):
1442
- statuses = {
1769
+ def parse_order_status(self, status: Str):
1770
+ statuses: dict = {
1443
1771
  'NEW': 'open',
1444
1772
  'PARTIAL_FILLED': 'open',
1445
1773
  'FILLED': 'closed',
@@ -1453,10 +1781,10 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1453
1781
  }
1454
1782
  return self.safe_string(statuses, status, status)
1455
1783
 
1456
- def parse_order_type(self, type):
1784
+ def parse_order_type(self, type: Str):
1457
1785
  if type == 'UNKNOWN_ORDER_TYPE':
1458
1786
  return None
1459
- types = {
1787
+ types: dict = {
1460
1788
  'MARKET': 'market',
1461
1789
  'LIMIT': 'limit',
1462
1790
  'STOP': 'limit',
@@ -1467,7 +1795,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1467
1795
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
1468
1796
  """
1469
1797
  cancels an open order
1470
- :see: https://docs.cloud.coinbase.com/intx/reference/cancelorder
1798
+
1799
+ https://docs.cloud.coinbase.com/intx/reference/cancelorder
1800
+
1471
1801
  :param str id: order id
1472
1802
  :param str symbol: not used by coinbaseinternational cancelOrder()
1473
1803
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1476,7 +1806,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1476
1806
  await self.load_markets()
1477
1807
  portfolio = None
1478
1808
  portfolio, params = await self.handle_portfolio_and_params('cancelOrder', params)
1479
- request = {
1809
+ request: dict = {
1480
1810
  'portfolio': portfolio,
1481
1811
  'id': id,
1482
1812
  }
@@ -1519,7 +1849,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1519
1849
  await self.load_markets()
1520
1850
  portfolio = None
1521
1851
  portfolio, params = await self.handle_portfolio_and_params('cancelAllOrders', params)
1522
- request = {
1852
+ request: dict = {
1523
1853
  'portfolio': portfolio,
1524
1854
  }
1525
1855
  market = None
@@ -1532,20 +1862,22 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1532
1862
  async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float = None, price: float = None, params={}):
1533
1863
  """
1534
1864
  edit a trade order
1535
- :see: https://docs.cloud.coinbase.com/intx/reference/modifyorder
1865
+
1866
+ https://docs.cloud.coinbase.com/intx/reference/modifyorder
1867
+
1536
1868
  :param str id: cancel order id
1537
1869
  :param str symbol: unified symbol of the market to create an order in
1538
1870
  :param str type: 'market' or 'limit'
1539
1871
  :param str side: 'buy' or 'sell'
1540
1872
  :param float amount: how much of currency you want to trade in units of base currency
1541
- :param float [price]: the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
1873
+ :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1542
1874
  :param dict [params]: extra parameters specific to the exchange API endpoint
1543
1875
  :param str params['clientOrderId']: client order id
1544
1876
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1545
1877
  """
1546
1878
  await self.load_markets()
1547
1879
  market = self.market(symbol)
1548
- request = {
1880
+ request: dict = {
1549
1881
  'id': id,
1550
1882
  }
1551
1883
  portfolio = None
@@ -1556,9 +1888,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1556
1888
  request['size'] = self.amount_to_precision(symbol, amount)
1557
1889
  if price is not None:
1558
1890
  request['price'] = self.price_to_precision(symbol, price)
1559
- stopPrice = self.safe_number_n(params, ['stopPrice', 'stop_price', 'triggerPrice'])
1560
- if stopPrice is not None:
1561
- request['stop_price'] = stopPrice
1891
+ triggerPrice = self.safe_number_n(params, ['stopPrice', 'stop_price', 'triggerPrice'])
1892
+ if triggerPrice is not None:
1893
+ request['stop_price'] = triggerPrice
1562
1894
  clientOrderId = self.safe_string_2(params, 'client_order_id', 'clientOrderId')
1563
1895
  if clientOrderId is None:
1564
1896
  raise BadRequest(self.id + ' editOrder() requires a clientOrderId parameter')
@@ -1569,7 +1901,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1569
1901
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
1570
1902
  """
1571
1903
  fetches information on an order made by the user
1572
- :see: https://docs.cloud.coinbase.com/intx/reference/modifyorder
1904
+
1905
+ https://docs.cloud.coinbase.com/intx/reference/modifyorder
1906
+
1573
1907
  :param str id: the order id
1574
1908
  :param str symbol: unified market symbol that the order was made in
1575
1909
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1581,7 +1915,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1581
1915
  market = self.market(symbol)
1582
1916
  portfolio = None
1583
1917
  portfolio, params = await self.handle_portfolio_and_params('fetchOrder', params)
1584
- request = {
1918
+ request: dict = {
1585
1919
  'id': id,
1586
1920
  'portfolio': portfolio,
1587
1921
  }
@@ -1616,7 +1950,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1616
1950
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1617
1951
  """
1618
1952
  fetches information on all currently open orders
1619
- :see: https://docs.cloud.coinbase.com/intx/reference/getorders
1953
+
1954
+ https://docs.cloud.coinbase.com/intx/reference/getorders
1955
+
1620
1956
  :param str symbol: unified market symbol of the orders
1621
1957
  :param int [since]: timestamp in ms of the earliest order, default is None
1622
1958
  :param int [limit]: the maximum number of open order structures to retrieve
@@ -1637,7 +1973,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1637
1973
  if paginate:
1638
1974
  return await self.fetch_paginated_call_incremental('fetchOpenOrders', symbol, since, limit, params, pageKey, maxEntriesPerRequest)
1639
1975
  page = self.safe_integer(params, pageKey, 1) - 1
1640
- request = {
1976
+ request: dict = {
1641
1977
  'portfolio': portfolio,
1642
1978
  'result_offset': self.safe_integer_2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
1643
1979
  }
@@ -1692,7 +2028,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1692
2028
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1693
2029
  """
1694
2030
  fetch all trades made by the user
1695
- :see: https://docs.cloud.coinbase.com/intx/reference/getmultiportfoliofills
2031
+
2032
+ https://docs.cloud.coinbase.com/intx/reference/getmultiportfoliofills
2033
+
1696
2034
  :param str symbol: unified market symbol of the trades
1697
2035
  :param int [since]: timestamp in ms of the earliest order, default is None
1698
2036
  :param int [limit]: the maximum number of trade structures to fetch
@@ -1713,7 +2051,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1713
2051
  if symbol is not None:
1714
2052
  market = self.market(symbol)
1715
2053
  page = self.safe_integer(params, pageKey, 1) - 1
1716
- request = {
2054
+ request: dict = {
1717
2055
  'result_offset': self.safe_integer_2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
1718
2056
  }
1719
2057
  if limit is not None:
@@ -1722,9 +2060,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1722
2060
  request['result_limit'] = limit
1723
2061
  if since is not None:
1724
2062
  request['time_from'] = self.iso8601(since)
1725
- until = self.safe_string_n(params, ['until', 'till'])
2063
+ until = self.safe_string_n(params, ['until'])
1726
2064
  if until is not None:
1727
- params = self.omit(params, ['until', 'till'])
2065
+ params = self.omit(params, ['until'])
1728
2066
  request['ref_datetime'] = self.iso8601(until)
1729
2067
  response = await self.v1PrivateGetPortfoliosFills(self.extend(request, params))
1730
2068
  #
@@ -1770,11 +2108,13 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1770
2108
  trades = self.safe_list(response, 'results', [])
1771
2109
  return self.parse_trades(trades, market, since, limit)
1772
2110
 
1773
- async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
2111
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1774
2112
  """
1775
2113
  make a withdrawal
1776
- :see: https://docs.cloud.coinbase.com/intx/reference/withdraw
1777
- :see: https://docs.cloud.coinbase.com/intx/reference/counterpartywithdraw
2114
+
2115
+ https://docs.cloud.coinbase.com/intx/reference/withdraw
2116
+ https://docs.cloud.coinbase.com/intx/reference/counterpartywithdraw
2117
+
1778
2118
  :param str code: unified currency code
1779
2119
  :param float amount: the amount to withdraw
1780
2120
  :param str address: the address to withdraw to
@@ -1795,7 +2135,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1795
2135
  method, params = self.handle_option_and_params(params, 'withdraw', 'method', 'v1PrivatePostTransfersWithdraw')
1796
2136
  networkId = None
1797
2137
  networkId, params = await self.handle_network_id_and_params(code, 'withdraw', params)
1798
- request = {
2138
+ request: dict = {
1799
2139
  'portfolio': portfolio,
1800
2140
  'type': 'send',
1801
2141
  'asset': currency['id'],
@@ -1877,7 +2217,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1877
2217
  }
1878
2218
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1879
2219
 
1880
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
2220
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1881
2221
  #
1882
2222
  # {
1883
2223
  # "title":"io.javalin.http.BadRequestResponse: Order rejected(DUPLICATE_CLIENT_ORDER_ID - duplicate client order id detected)",