ccxt 4.2.77__py2.py3-none-any.whl → 4.4.49__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.
- ccxt/__init__.py +36 -14
- ccxt/abstract/alpaca.py +4 -0
- ccxt/abstract/bigone.py +1 -1
- ccxt/abstract/binance.py +112 -48
- ccxt/abstract/binancecoinm.py +112 -48
- ccxt/abstract/binanceus.py +147 -83
- ccxt/abstract/binanceusdm.py +112 -48
- ccxt/abstract/bingx.py +133 -78
- ccxt/abstract/bitbank.py +5 -0
- ccxt/abstract/bitfinex.py +136 -65
- ccxt/abstract/bitfinex1.py +69 -0
- ccxt/abstract/bitflyer.py +1 -0
- ccxt/abstract/bitget.py +8 -1
- ccxt/abstract/bitmart.py +13 -1
- ccxt/abstract/bitopro.py +1 -0
- ccxt/abstract/bitpanda.py +0 -12
- ccxt/abstract/bitrue.py +3 -3
- ccxt/abstract/bitstamp.py +26 -3
- ccxt/abstract/blofin.py +24 -0
- ccxt/abstract/btcbox.py +1 -0
- ccxt/abstract/bybit.py +29 -14
- ccxt/abstract/cex.py +28 -29
- ccxt/abstract/coinbase.py +6 -0
- ccxt/abstract/coinbaseadvanced.py +94 -0
- ccxt/abstract/{coinbasepro.py → coinbaseexchange.py} +1 -0
- ccxt/abstract/coinbaseinternational.py +1 -1
- ccxt/abstract/coincatch.py +94 -0
- ccxt/abstract/coinex.py +233 -123
- ccxt/abstract/coinmetro.py +1 -0
- ccxt/abstract/cryptocom.py +14 -0
- ccxt/abstract/defx.py +69 -0
- ccxt/abstract/deribit.py +1 -0
- ccxt/abstract/digifinex.py +1 -0
- ccxt/abstract/ellipx.py +25 -0
- ccxt/abstract/gate.py +20 -0
- ccxt/abstract/gateio.py +20 -0
- ccxt/abstract/gemini.py +1 -0
- ccxt/abstract/hashkey.py +67 -0
- ccxt/abstract/hyperliquid.py +1 -1
- ccxt/abstract/independentreserve.py +6 -0
- ccxt/abstract/kraken.py +4 -3
- ccxt/abstract/krakenfutures.py +4 -0
- ccxt/abstract/kucoin.py +24 -0
- ccxt/abstract/kucoinfutures.py +34 -0
- ccxt/abstract/luno.py +2 -0
- ccxt/abstract/mexc.py +4 -0
- ccxt/abstract/myokx.py +340 -0
- ccxt/abstract/oceanex.py +5 -0
- ccxt/abstract/okx.py +30 -0
- ccxt/abstract/onetrading.py +0 -12
- ccxt/abstract/oxfun.py +34 -0
- ccxt/abstract/paradex.py +40 -0
- ccxt/abstract/phemex.py +1 -0
- ccxt/abstract/upbit.py +4 -0
- ccxt/abstract/vertex.py +19 -0
- ccxt/abstract/whitebit.py +31 -1
- ccxt/abstract/woo.py +6 -2
- ccxt/abstract/woofipro.py +119 -0
- ccxt/abstract/xt.py +153 -0
- ccxt/abstract/zonda.py +6 -0
- ccxt/ace.py +164 -60
- ccxt/alpaca.py +727 -63
- ccxt/ascendex.py +395 -249
- ccxt/async_support/__init__.py +36 -14
- ccxt/async_support/ace.py +164 -60
- ccxt/async_support/alpaca.py +727 -63
- ccxt/async_support/ascendex.py +396 -249
- ccxt/async_support/base/exchange.py +531 -155
- ccxt/async_support/base/ws/aiohttp_client.py +28 -5
- ccxt/async_support/base/ws/cache.py +3 -2
- ccxt/async_support/base/ws/client.py +26 -5
- ccxt/async_support/base/ws/fast_client.py +4 -3
- ccxt/async_support/base/ws/functions.py +1 -1
- ccxt/async_support/base/ws/future.py +40 -31
- ccxt/async_support/base/ws/order_book_side.py +3 -0
- ccxt/async_support/bequant.py +1 -1
- ccxt/async_support/bigone.py +329 -202
- ccxt/async_support/binance.py +3030 -1087
- ccxt/async_support/binancecoinm.py +2 -1
- ccxt/async_support/binanceus.py +12 -1
- ccxt/async_support/binanceusdm.py +3 -1
- ccxt/async_support/bingx.py +3205 -937
- ccxt/async_support/bit2c.py +119 -38
- ccxt/async_support/bitbank.py +215 -76
- ccxt/async_support/bitbns.py +124 -53
- ccxt/async_support/bitfinex.py +3236 -1078
- ccxt/async_support/bitfinex1.py +1711 -0
- ccxt/async_support/bitflyer.py +238 -49
- ccxt/async_support/bitget.py +1525 -573
- ccxt/async_support/bithumb.py +199 -65
- ccxt/async_support/bitmart.py +1320 -435
- ccxt/async_support/bitmex.py +308 -111
- ccxt/async_support/bitopro.py +256 -96
- ccxt/async_support/bitrue.py +365 -233
- ccxt/async_support/bitso.py +201 -89
- ccxt/async_support/bitstamp.py +438 -269
- ccxt/async_support/bitteam.py +179 -73
- ccxt/async_support/bitvavo.py +180 -70
- ccxt/async_support/bl3p.py +92 -25
- ccxt/async_support/blockchaincom.py +193 -79
- ccxt/async_support/blofin.py +392 -148
- ccxt/async_support/btcalpha.py +161 -55
- ccxt/async_support/btcbox.py +250 -34
- ccxt/async_support/btcmarkets.py +232 -85
- ccxt/async_support/btcturk.py +159 -60
- ccxt/async_support/bybit.py +2231 -1193
- ccxt/async_support/cex.py +1409 -1329
- ccxt/async_support/coinbase.py +1454 -287
- ccxt/async_support/coinbaseadvanced.py +17 -0
- ccxt/async_support/{coinbasepro.py → coinbaseexchange.py} +233 -99
- ccxt/async_support/coinbaseinternational.py +428 -88
- ccxt/async_support/coincatch.py +5152 -0
- ccxt/async_support/coincheck.py +121 -38
- ccxt/async_support/coinex.py +4020 -3339
- ccxt/async_support/coinlist.py +273 -116
- ccxt/async_support/coinmate.py +204 -97
- ccxt/async_support/coinmetro.py +203 -110
- ccxt/async_support/coinone.py +142 -68
- ccxt/async_support/coinsph.py +223 -97
- ccxt/async_support/coinspot.py +137 -62
- ccxt/async_support/cryptocom.py +515 -185
- ccxt/async_support/currencycom.py +203 -85
- ccxt/async_support/defx.py +2066 -0
- ccxt/async_support/delta.py +404 -109
- ccxt/async_support/deribit.py +639 -323
- ccxt/async_support/digifinex.py +465 -233
- ccxt/async_support/ellipx.py +1887 -0
- ccxt/async_support/exmo.py +317 -128
- ccxt/async_support/gate.py +1472 -463
- ccxt/async_support/gemini.py +206 -84
- ccxt/async_support/hashkey.py +4164 -0
- ccxt/async_support/hitbtc.py +433 -178
- ccxt/async_support/hollaex.py +207 -83
- ccxt/async_support/htx.py +1095 -563
- ccxt/async_support/huobijp.py +178 -56
- ccxt/async_support/hyperliquid.py +1678 -292
- ccxt/async_support/idex.py +219 -95
- ccxt/async_support/independentreserve.py +300 -31
- ccxt/async_support/indodax.py +226 -62
- ccxt/async_support/kraken.py +871 -354
- ccxt/async_support/krakenfutures.py +324 -100
- ccxt/async_support/kucoin.py +917 -357
- ccxt/async_support/kucoinfutures.py +1004 -149
- ccxt/async_support/kuna.py +198 -107
- ccxt/async_support/latoken.py +199 -79
- ccxt/async_support/lbank.py +360 -113
- ccxt/async_support/luno.py +185 -62
- ccxt/async_support/lykke.py +168 -55
- ccxt/async_support/mercado.py +101 -29
- ccxt/async_support/mexc.py +995 -429
- ccxt/async_support/myokx.py +53 -0
- ccxt/async_support/ndax.py +234 -82
- ccxt/async_support/novadax.py +195 -75
- ccxt/async_support/oceanex.py +244 -59
- ccxt/async_support/okcoin.py +301 -165
- ccxt/async_support/okx.py +1776 -454
- ccxt/async_support/onetrading.py +198 -414
- ccxt/async_support/oxfun.py +2898 -0
- ccxt/async_support/p2b.py +142 -52
- ccxt/async_support/paradex.py +2085 -0
- ccxt/async_support/paymium.py +56 -32
- ccxt/async_support/phemex.py +572 -196
- ccxt/async_support/poloniex.py +218 -95
- ccxt/async_support/poloniexfutures.py +260 -92
- ccxt/async_support/probit.py +143 -110
- ccxt/async_support/timex.py +123 -70
- ccxt/async_support/tokocrypto.py +129 -93
- ccxt/async_support/tradeogre.py +39 -25
- ccxt/async_support/upbit.py +322 -113
- ccxt/async_support/vertex.py +2983 -0
- ccxt/async_support/wavesexchange.py +227 -173
- ccxt/async_support/wazirx.py +145 -65
- ccxt/async_support/whitebit.py +533 -138
- ccxt/async_support/woo.py +1137 -296
- ccxt/async_support/woofipro.py +2716 -0
- ccxt/async_support/xt.py +4628 -0
- ccxt/async_support/yobit.py +160 -92
- ccxt/async_support/zaif.py +80 -33
- ccxt/async_support/zonda.py +140 -69
- ccxt/base/errors.py +51 -20
- ccxt/base/exchange.py +1722 -480
- ccxt/base/precise.py +10 -0
- ccxt/base/types.py +223 -4
- ccxt/bequant.py +1 -1
- ccxt/bigone.py +329 -202
- ccxt/binance.py +3030 -1087
- ccxt/binancecoinm.py +2 -1
- ccxt/binanceus.py +12 -1
- ccxt/binanceusdm.py +3 -1
- ccxt/bingx.py +3205 -937
- ccxt/bit2c.py +119 -38
- ccxt/bitbank.py +215 -76
- ccxt/bitbns.py +124 -53
- ccxt/bitfinex.py +3235 -1078
- ccxt/bitfinex1.py +1710 -0
- ccxt/bitflyer.py +238 -49
- ccxt/bitget.py +1525 -573
- ccxt/bithumb.py +198 -65
- ccxt/bitmart.py +1320 -435
- ccxt/bitmex.py +308 -111
- ccxt/bitopro.py +256 -96
- ccxt/bitrue.py +365 -233
- ccxt/bitso.py +201 -89
- ccxt/bitstamp.py +438 -269
- ccxt/bitteam.py +179 -73
- ccxt/bitvavo.py +180 -70
- ccxt/bl3p.py +92 -25
- ccxt/blockchaincom.py +193 -79
- ccxt/blofin.py +392 -148
- ccxt/btcalpha.py +161 -55
- ccxt/btcbox.py +250 -34
- ccxt/btcmarkets.py +232 -85
- ccxt/btcturk.py +159 -60
- ccxt/bybit.py +2231 -1193
- ccxt/cex.py +1408 -1329
- ccxt/coinbase.py +1454 -287
- ccxt/coinbaseadvanced.py +17 -0
- ccxt/{coinbasepro.py → coinbaseexchange.py} +233 -99
- ccxt/coinbaseinternational.py +428 -88
- ccxt/coincatch.py +5152 -0
- ccxt/coincheck.py +121 -38
- ccxt/coinex.py +4020 -3339
- ccxt/coinlist.py +273 -116
- ccxt/coinmate.py +204 -97
- ccxt/coinmetro.py +203 -110
- ccxt/coinone.py +142 -68
- ccxt/coinsph.py +223 -97
- ccxt/coinspot.py +137 -62
- ccxt/cryptocom.py +515 -185
- ccxt/currencycom.py +203 -85
- ccxt/defx.py +2065 -0
- ccxt/delta.py +404 -109
- ccxt/deribit.py +639 -323
- ccxt/digifinex.py +465 -233
- ccxt/ellipx.py +1887 -0
- ccxt/exmo.py +317 -128
- ccxt/gate.py +1472 -463
- ccxt/gemini.py +206 -84
- ccxt/hashkey.py +4164 -0
- ccxt/hitbtc.py +433 -178
- ccxt/hollaex.py +207 -83
- ccxt/htx.py +1095 -563
- ccxt/huobijp.py +178 -56
- ccxt/hyperliquid.py +1677 -292
- ccxt/idex.py +219 -95
- ccxt/independentreserve.py +299 -31
- ccxt/indodax.py +226 -62
- ccxt/kraken.py +871 -354
- ccxt/krakenfutures.py +324 -100
- ccxt/kucoin.py +917 -357
- ccxt/kucoinfutures.py +1004 -149
- ccxt/kuna.py +198 -107
- ccxt/latoken.py +199 -79
- ccxt/lbank.py +360 -113
- ccxt/luno.py +185 -62
- ccxt/lykke.py +168 -55
- ccxt/mercado.py +101 -29
- ccxt/mexc.py +994 -429
- ccxt/myokx.py +53 -0
- ccxt/ndax.py +234 -82
- ccxt/novadax.py +195 -75
- ccxt/oceanex.py +244 -59
- ccxt/okcoin.py +301 -165
- ccxt/okx.py +1776 -454
- ccxt/onetrading.py +198 -414
- ccxt/oxfun.py +2897 -0
- ccxt/p2b.py +142 -52
- ccxt/paradex.py +2085 -0
- ccxt/paymium.py +56 -32
- ccxt/phemex.py +572 -196
- ccxt/poloniex.py +218 -95
- ccxt/poloniexfutures.py +260 -92
- ccxt/pro/__init__.py +29 -5
- ccxt/pro/alpaca.py +32 -17
- ccxt/pro/ascendex.py +62 -14
- ccxt/pro/bequant.py +4 -0
- ccxt/pro/binance.py +1596 -329
- ccxt/pro/binancecoinm.py +1 -0
- ccxt/pro/binanceus.py +2 -9
- ccxt/pro/binanceusdm.py +2 -0
- ccxt/pro/bingx.py +527 -134
- ccxt/pro/bitcoincom.py +4 -1
- ccxt/pro/bitfinex.py +731 -266
- ccxt/pro/bitfinex1.py +635 -0
- ccxt/pro/bitget.py +726 -357
- ccxt/pro/bithumb.py +380 -0
- ccxt/pro/bitmart.py +143 -39
- ccxt/pro/bitmex.py +199 -40
- ccxt/pro/bitopro.py +25 -13
- ccxt/pro/bitrue.py +31 -32
- ccxt/pro/bitstamp.py +7 -6
- ccxt/pro/bitvavo.py +203 -81
- ccxt/pro/blockchaincom.py +30 -17
- ccxt/pro/blofin.py +692 -0
- ccxt/pro/bybit.py +791 -82
- ccxt/pro/cex.py +99 -51
- ccxt/pro/coinbase.py +220 -30
- ccxt/{async_support/hitbtc3.py → pro/coinbaseadvanced.py} +5 -5
- ccxt/pro/{coinbasepro.py → coinbaseexchange.py} +19 -19
- ccxt/pro/coinbaseinternational.py +193 -30
- ccxt/pro/coincatch.py +1464 -0
- ccxt/pro/coincheck.py +11 -6
- ccxt/pro/coinex.py +965 -665
- ccxt/pro/coinone.py +17 -10
- ccxt/pro/cryptocom.py +446 -66
- ccxt/pro/currencycom.py +11 -10
- ccxt/pro/defx.py +832 -0
- ccxt/pro/deribit.py +167 -31
- ccxt/pro/exmo.py +252 -20
- ccxt/pro/gate.py +729 -64
- ccxt/pro/gemini.py +44 -26
- ccxt/pro/hashkey.py +802 -0
- ccxt/pro/hitbtc.py +208 -103
- ccxt/pro/hollaex.py +25 -9
- ccxt/pro/htx.py +83 -39
- ccxt/pro/huobijp.py +17 -16
- ccxt/pro/hyperliquid.py +502 -31
- ccxt/pro/idex.py +28 -13
- ccxt/pro/independentreserve.py +21 -16
- ccxt/pro/kraken.py +298 -51
- ccxt/pro/krakenfutures.py +166 -75
- ccxt/pro/kucoin.py +395 -77
- ccxt/pro/kucoinfutures.py +400 -99
- ccxt/pro/lbank.py +52 -31
- ccxt/pro/luno.py +12 -10
- ccxt/pro/mexc.py +400 -50
- ccxt/pro/myokx.py +28 -0
- ccxt/pro/ndax.py +25 -12
- ccxt/pro/okcoin.py +28 -9
- ccxt/pro/okx.py +935 -124
- ccxt/pro/onetrading.py +41 -24
- ccxt/pro/oxfun.py +1054 -0
- ccxt/pro/p2b.py +100 -24
- ccxt/pro/paradex.py +352 -0
- ccxt/pro/phemex.py +92 -33
- ccxt/pro/poloniex.py +128 -49
- ccxt/pro/poloniexfutures.py +53 -32
- ccxt/pro/probit.py +92 -85
- ccxt/pro/upbit.py +401 -8
- ccxt/pro/vertex.py +943 -0
- ccxt/pro/wazirx.py +46 -28
- ccxt/pro/whitebit.py +65 -12
- ccxt/pro/woo.py +437 -65
- ccxt/pro/woofipro.py +1271 -0
- ccxt/pro/xt.py +1067 -0
- ccxt/probit.py +143 -110
- ccxt/static_dependencies/__init__.py +1 -1
- ccxt/static_dependencies/lark/__init__.py +38 -0
- ccxt/static_dependencies/lark/__pyinstaller/__init__.py +6 -0
- ccxt/static_dependencies/lark/__pyinstaller/hook-lark.py +14 -0
- ccxt/static_dependencies/lark/ast_utils.py +59 -0
- ccxt/static_dependencies/lark/common.py +86 -0
- ccxt/static_dependencies/lark/exceptions.py +292 -0
- ccxt/static_dependencies/lark/grammar.py +130 -0
- ccxt/static_dependencies/lark/grammars/__init__.py +0 -0
- ccxt/static_dependencies/lark/indenter.py +143 -0
- ccxt/static_dependencies/lark/lark.py +658 -0
- ccxt/static_dependencies/lark/lexer.py +678 -0
- ccxt/static_dependencies/lark/load_grammar.py +1428 -0
- ccxt/static_dependencies/lark/parse_tree_builder.py +391 -0
- ccxt/static_dependencies/lark/parser_frontends.py +257 -0
- ccxt/static_dependencies/lark/parsers/__init__.py +0 -0
- ccxt/static_dependencies/lark/parsers/cyk.py +340 -0
- ccxt/static_dependencies/lark/parsers/earley.py +314 -0
- ccxt/static_dependencies/lark/parsers/earley_common.py +42 -0
- ccxt/static_dependencies/lark/parsers/earley_forest.py +801 -0
- ccxt/static_dependencies/lark/parsers/grammar_analysis.py +203 -0
- ccxt/static_dependencies/lark/parsers/lalr_analysis.py +332 -0
- ccxt/static_dependencies/lark/parsers/lalr_interactive_parser.py +158 -0
- ccxt/static_dependencies/lark/parsers/lalr_parser.py +122 -0
- ccxt/static_dependencies/lark/parsers/lalr_parser_state.py +110 -0
- ccxt/static_dependencies/lark/parsers/xearley.py +165 -0
- ccxt/static_dependencies/lark/py.typed +0 -0
- ccxt/static_dependencies/lark/reconstruct.py +107 -0
- ccxt/static_dependencies/lark/tools/__init__.py +70 -0
- ccxt/static_dependencies/lark/tools/nearley.py +202 -0
- ccxt/static_dependencies/lark/tools/serialize.py +32 -0
- ccxt/static_dependencies/lark/tools/standalone.py +196 -0
- ccxt/static_dependencies/lark/tree.py +267 -0
- ccxt/static_dependencies/lark/tree_matcher.py +186 -0
- ccxt/static_dependencies/lark/tree_templates.py +180 -0
- ccxt/static_dependencies/lark/utils.py +343 -0
- ccxt/static_dependencies/lark/visitors.py +596 -0
- ccxt/static_dependencies/marshmallow/__init__.py +81 -0
- ccxt/static_dependencies/marshmallow/base.py +65 -0
- ccxt/static_dependencies/marshmallow/class_registry.py +94 -0
- ccxt/static_dependencies/marshmallow/decorators.py +231 -0
- ccxt/static_dependencies/marshmallow/error_store.py +60 -0
- ccxt/static_dependencies/marshmallow/exceptions.py +71 -0
- ccxt/static_dependencies/marshmallow/fields.py +2114 -0
- ccxt/static_dependencies/marshmallow/orderedset.py +89 -0
- ccxt/static_dependencies/marshmallow/py.typed +0 -0
- ccxt/static_dependencies/marshmallow/schema.py +1228 -0
- ccxt/static_dependencies/marshmallow/types.py +12 -0
- ccxt/static_dependencies/marshmallow/utils.py +378 -0
- ccxt/static_dependencies/marshmallow/validate.py +678 -0
- ccxt/static_dependencies/marshmallow/warnings.py +2 -0
- ccxt/static_dependencies/marshmallow_dataclass/__init__.py +1047 -0
- ccxt/static_dependencies/marshmallow_dataclass/collection_field.py +51 -0
- ccxt/static_dependencies/marshmallow_dataclass/lazy_class_attribute.py +45 -0
- ccxt/static_dependencies/marshmallow_dataclass/mypy.py +71 -0
- ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
- ccxt/static_dependencies/marshmallow_dataclass/typing.py +14 -0
- ccxt/static_dependencies/marshmallow_dataclass/union_field.py +82 -0
- ccxt/static_dependencies/marshmallow_oneofschema/__init__.py +1 -0
- ccxt/static_dependencies/marshmallow_oneofschema/one_of_schema.py +193 -0
- ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
- ccxt/static_dependencies/starknet/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/data_types.py +123 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py +77 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser.py +46 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py +138 -0
- ccxt/static_dependencies/starknet/cairo/felt.py +64 -0
- ccxt/static_dependencies/starknet/cairo/type_parser.py +121 -0
- ccxt/static_dependencies/starknet/cairo/v1/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/v1/type_parser.py +59 -0
- ccxt/static_dependencies/starknet/cairo/v2/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/v2/type_parser.py +77 -0
- ccxt/static_dependencies/starknet/ccxt_utils.py +7 -0
- ccxt/static_dependencies/starknet/common.py +15 -0
- ccxt/static_dependencies/starknet/constants.py +39 -0
- ccxt/static_dependencies/starknet/hash/__init__.py +0 -0
- ccxt/static_dependencies/starknet/hash/address.py +79 -0
- ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py +111 -0
- ccxt/static_dependencies/starknet/hash/selector.py +16 -0
- ccxt/static_dependencies/starknet/hash/storage.py +12 -0
- ccxt/static_dependencies/starknet/hash/utils.py +78 -0
- ccxt/static_dependencies/starknet/models/__init__.py +0 -0
- ccxt/static_dependencies/starknet/models/typed_data.py +45 -0
- ccxt/static_dependencies/starknet/serialization/__init__.py +24 -0
- ccxt/static_dependencies/starknet/serialization/_calldata_reader.py +40 -0
- ccxt/static_dependencies/starknet/serialization/_context.py +142 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/__init__.py +10 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/_common.py +82 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/array_serializer.py +43 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/bool_serializer.py +37 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/byte_array_serializer.py +66 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/cairo_data_serializer.py +71 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/enum_serializer.py +71 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/felt_serializer.py +50 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/named_tuple_serializer.py +58 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/option_serializer.py +43 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/output_serializer.py +40 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/payload_serializer.py +72 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/struct_serializer.py +36 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/tuple_serializer.py +36 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/uint256_serializer.py +76 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/uint_serializer.py +100 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/unit_serializer.py +32 -0
- ccxt/static_dependencies/starknet/serialization/errors.py +10 -0
- ccxt/static_dependencies/starknet/serialization/factory.py +229 -0
- ccxt/static_dependencies/starknet/serialization/function_serialization_adapter.py +110 -0
- ccxt/static_dependencies/starknet/serialization/tuple_dataclass.py +59 -0
- ccxt/static_dependencies/starknet/utils/__init__.py +0 -0
- ccxt/static_dependencies/starknet/utils/constructor_args_translator.py +86 -0
- ccxt/static_dependencies/starknet/utils/iterable.py +13 -0
- ccxt/static_dependencies/starknet/utils/schema.py +13 -0
- ccxt/static_dependencies/starknet/utils/typed_data.py +182 -0
- ccxt/static_dependencies/starkware/__init__.py +0 -0
- ccxt/static_dependencies/starkware/crypto/__init__.py +0 -0
- ccxt/static_dependencies/starkware/crypto/fast_pedersen_hash.py +50 -0
- ccxt/static_dependencies/starkware/crypto/math_utils.py +78 -0
- ccxt/static_dependencies/starkware/crypto/signature.py +2344 -0
- ccxt/static_dependencies/starkware/crypto/utils.py +63 -0
- ccxt/static_dependencies/sympy/__init__.py +0 -0
- ccxt/static_dependencies/sympy/core/__init__.py +0 -0
- ccxt/static_dependencies/sympy/core/intfunc.py +35 -0
- ccxt/static_dependencies/sympy/external/__init__.py +0 -0
- ccxt/static_dependencies/sympy/external/gmpy.py +345 -0
- ccxt/static_dependencies/sympy/external/importtools.py +187 -0
- ccxt/static_dependencies/sympy/external/ntheory.py +637 -0
- ccxt/static_dependencies/sympy/external/pythonmpq.py +341 -0
- ccxt/static_dependencies/typing_inspect/__init__.py +0 -0
- ccxt/static_dependencies/typing_inspect/typing_inspect.py +851 -0
- ccxt/test/{test_async.py → tests_async.py} +456 -391
- ccxt/test/tests_helpers.py +285 -0
- ccxt/test/tests_init.py +39 -0
- ccxt/test/{test_sync.py → tests_sync.py} +456 -393
- ccxt/timex.py +123 -70
- ccxt/tokocrypto.py +129 -93
- ccxt/tradeogre.py +39 -25
- ccxt/upbit.py +322 -113
- ccxt/vertex.py +2983 -0
- ccxt/wavesexchange.py +227 -173
- ccxt/wazirx.py +145 -65
- ccxt/whitebit.py +533 -138
- ccxt/woo.py +1137 -296
- ccxt/woofipro.py +2716 -0
- ccxt/xt.py +4627 -0
- ccxt/yobit.py +159 -92
- ccxt/zaif.py +80 -33
- ccxt/zonda.py +140 -69
- ccxt-4.4.49.dist-info/LICENSE.txt +21 -0
- ccxt-4.4.49.dist-info/METADATA +646 -0
- ccxt-4.4.49.dist-info/RECORD +669 -0
- {ccxt-4.2.77.dist-info → ccxt-4.4.49.dist-info}/WHEEL +1 -1
- ccxt/abstract/bitbay.py +0 -47
- ccxt/abstract/bitfinex2.py +0 -139
- ccxt/abstract/hitbtc3.py +0 -115
- ccxt/async_support/bitbay.py +0 -17
- ccxt/async_support/bitfinex2.py +0 -3496
- ccxt/async_support/flowbtc.py +0 -34
- ccxt/bitbay.py +0 -17
- ccxt/bitfinex2.py +0 -3496
- ccxt/flowbtc.py +0 -34
- ccxt/hitbtc3.py +0 -16
- ccxt/pro/bitfinex2.py +0 -1081
- ccxt/test/base/__init__.py +0 -28
- ccxt/test/base/test_account.py +0 -26
- ccxt/test/base/test_balance.py +0 -56
- ccxt/test/base/test_borrow_interest.py +0 -35
- ccxt/test/base/test_borrow_rate.py +0 -32
- ccxt/test/base/test_calculate_fee.py +0 -51
- ccxt/test/base/test_crypto.py +0 -127
- ccxt/test/base/test_currency.py +0 -76
- ccxt/test/base/test_datetime.py +0 -103
- ccxt/test/base/test_decimal_to_precision.py +0 -392
- ccxt/test/base/test_deep_extend.py +0 -68
- ccxt/test/base/test_deposit_withdrawal.py +0 -50
- ccxt/test/base/test_exchange_datetime_functions.py +0 -76
- ccxt/test/base/test_funding_rate_history.py +0 -29
- ccxt/test/base/test_last_price.py +0 -32
- ccxt/test/base/test_ledger_entry.py +0 -45
- ccxt/test/base/test_ledger_item.py +0 -48
- ccxt/test/base/test_leverage_tier.py +0 -33
- ccxt/test/base/test_margin_mode.py +0 -24
- ccxt/test/base/test_margin_modification.py +0 -35
- ccxt/test/base/test_market.py +0 -190
- ccxt/test/base/test_number.py +0 -411
- ccxt/test/base/test_ohlcv.py +0 -32
- ccxt/test/base/test_open_interest.py +0 -32
- ccxt/test/base/test_order.py +0 -64
- ccxt/test/base/test_order_book.py +0 -63
- ccxt/test/base/test_position.py +0 -60
- ccxt/test/base/test_shared_methods.py +0 -345
- ccxt/test/base/test_status.py +0 -24
- ccxt/test/base/test_throttle.py +0 -126
- ccxt/test/base/test_ticker.py +0 -86
- ccxt/test/base/test_trade.py +0 -47
- ccxt/test/base/test_trading_fee.py +0 -26
- ccxt/test/base/test_transaction.py +0 -39
- ccxt-4.2.77.dist-info/METADATA +0 -626
- ccxt-4.2.77.dist-info/RECORD +0 -534
- {ccxt-4.2.77.dist-info → ccxt-4.4.49.dist-info}/top_level.txt +0 -0
ccxt/bitopro.py
CHANGED
@@ -7,14 +7,14 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.bitopro import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import math
|
10
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
|
+
from ccxt.base.errors import AuthenticationError
|
13
14
|
from ccxt.base.errors import ArgumentsRequired
|
14
15
|
from ccxt.base.errors import BadRequest
|
15
16
|
from ccxt.base.errors import InsufficientFunds
|
16
17
|
from ccxt.base.errors import InvalidOrder
|
17
|
-
from ccxt.base.errors import AuthenticationError
|
18
18
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
19
19
|
from ccxt.base.precise import Precise
|
20
20
|
|
@@ -42,6 +42,8 @@ class bitopro(Exchange, ImplicitAPI):
|
|
42
42
|
'closeAllPositions': False,
|
43
43
|
'closePosition': False,
|
44
44
|
'createOrder': True,
|
45
|
+
'createStopOrder': True,
|
46
|
+
'createTriggerOrder': True,
|
45
47
|
'editOrder': False,
|
46
48
|
'fetchBalance': True,
|
47
49
|
'fetchBorrowRateHistories': False,
|
@@ -73,8 +75,13 @@ class bitopro(Exchange, ImplicitAPI):
|
|
73
75
|
'fetchOrderBook': True,
|
74
76
|
'fetchOrders': False,
|
75
77
|
'fetchOrderTrades': False,
|
78
|
+
'fetchPosition': False,
|
79
|
+
'fetchPositionHistory': False,
|
76
80
|
'fetchPositionMode': False,
|
77
81
|
'fetchPositions': False,
|
82
|
+
'fetchPositionsForSymbol': False,
|
83
|
+
'fetchPositionsHistory': False,
|
84
|
+
'fetchPositionsRisk': False,
|
78
85
|
'fetchPremiumIndexOHLCV': False,
|
79
86
|
'fetchTicker': True,
|
80
87
|
'fetchTickers': True,
|
@@ -107,7 +114,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
107
114
|
'1M': '1M',
|
108
115
|
},
|
109
116
|
'urls': {
|
110
|
-
'logo': 'https://
|
117
|
+
'logo': 'https://github.com/user-attachments/assets/affc6337-b95a-44bf-aacd-04f9722364f6',
|
111
118
|
'api': {
|
112
119
|
'rest': 'https://api.bitopro.com/v3',
|
113
120
|
},
|
@@ -146,6 +153,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
146
153
|
'wallet/withdraw/{currency}/id/{id}': 1,
|
147
154
|
'wallet/depositHistory/{currency}': 1,
|
148
155
|
'wallet/withdrawHistory/{currency}': 1,
|
156
|
+
'orders/open': 1,
|
149
157
|
},
|
150
158
|
'post': {
|
151
159
|
'orders/{pair}': 1 / 2, # 1200/m => 20/s => 10/20 = 1/2
|
@@ -200,6 +208,80 @@ class bitopro(Exchange, ImplicitAPI):
|
|
200
208
|
'BSC': 'BSC',
|
201
209
|
},
|
202
210
|
},
|
211
|
+
'features': {
|
212
|
+
'spot': {
|
213
|
+
'sandbox': False,
|
214
|
+
'createOrder': {
|
215
|
+
'marginMode': False,
|
216
|
+
'triggerPrice': True,
|
217
|
+
'triggerPriceType': None,
|
218
|
+
'triggerDirection': True, # todo implement
|
219
|
+
'stopLossPrice': False,
|
220
|
+
'takeProfitPrice': False,
|
221
|
+
'attachedStopLossTakeProfit': None,
|
222
|
+
'timeInForce': {
|
223
|
+
'IOC': False,
|
224
|
+
'FOK': False,
|
225
|
+
'PO': True,
|
226
|
+
'GTD': False,
|
227
|
+
},
|
228
|
+
'hedged': False,
|
229
|
+
'trailing': False,
|
230
|
+
'leverage': False,
|
231
|
+
'marketBuyRequiresPrice': False,
|
232
|
+
'marketBuyByCost': False,
|
233
|
+
'selfTradePrevention': False,
|
234
|
+
'iceberg': False,
|
235
|
+
},
|
236
|
+
'createOrders': None,
|
237
|
+
'fetchMyTrades': {
|
238
|
+
'marginMode': False,
|
239
|
+
'limit': 1000,
|
240
|
+
'daysBack': 100000,
|
241
|
+
'untilDays': 100000,
|
242
|
+
},
|
243
|
+
'fetchOrder': {
|
244
|
+
'marginMode': False,
|
245
|
+
'trigger': False,
|
246
|
+
'trailing': False,
|
247
|
+
},
|
248
|
+
# todo: implement through fetchOrders
|
249
|
+
'fetchOpenOrders': {
|
250
|
+
'marginMode': False,
|
251
|
+
'limit': None,
|
252
|
+
'trigger': False,
|
253
|
+
'trailing': False,
|
254
|
+
},
|
255
|
+
'fetchOrders': {
|
256
|
+
'marginMode': False,
|
257
|
+
'limit': 1000,
|
258
|
+
'daysBack': 100000,
|
259
|
+
'untilDays': 100000,
|
260
|
+
'trigger': False,
|
261
|
+
'trailing': False,
|
262
|
+
},
|
263
|
+
'fetchClosedOrders': {
|
264
|
+
'marginMode': False,
|
265
|
+
'limit': 1000,
|
266
|
+
'daysBack': 100000,
|
267
|
+
'daysBackCanceled': 1,
|
268
|
+
'untilDays': 10000,
|
269
|
+
'trigger': False,
|
270
|
+
'trailing': False,
|
271
|
+
},
|
272
|
+
'fetchOHLCV': {
|
273
|
+
'limit': 1000,
|
274
|
+
},
|
275
|
+
},
|
276
|
+
'swap': {
|
277
|
+
'linear': None,
|
278
|
+
'inverse': None,
|
279
|
+
},
|
280
|
+
'future': {
|
281
|
+
'linear': None,
|
282
|
+
'inverse': None,
|
283
|
+
},
|
284
|
+
},
|
203
285
|
'precisionMode': TICK_SIZE,
|
204
286
|
'exceptions': {
|
205
287
|
'exact': {
|
@@ -220,15 +302,17 @@ class bitopro(Exchange, ImplicitAPI):
|
|
220
302
|
},
|
221
303
|
})
|
222
304
|
|
223
|
-
def fetch_currencies(self, params={}):
|
305
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
224
306
|
"""
|
225
307
|
fetches all available currencies on an exchange
|
226
|
-
|
308
|
+
|
309
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_currency_info.md
|
310
|
+
|
227
311
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
228
312
|
:returns dict: an associative dictionary of currencies
|
229
313
|
"""
|
230
314
|
response = self.publicGetProvisioningCurrencies(params)
|
231
|
-
currencies = self.
|
315
|
+
currencies = self.safe_list(response, 'data', [])
|
232
316
|
#
|
233
317
|
# {
|
234
318
|
# "data":[
|
@@ -245,17 +329,17 @@ class bitopro(Exchange, ImplicitAPI):
|
|
245
329
|
# ]
|
246
330
|
# }
|
247
331
|
#
|
248
|
-
result = {}
|
332
|
+
result: dict = {}
|
249
333
|
for i in range(0, len(currencies)):
|
250
334
|
currency = currencies[i]
|
251
335
|
currencyId = self.safe_string(currency, 'currency')
|
252
336
|
code = self.safe_currency_code(currencyId)
|
253
|
-
deposit = self.
|
254
|
-
withdraw = self.
|
337
|
+
deposit = self.safe_bool(currency, 'deposit')
|
338
|
+
withdraw = self.safe_bool(currency, 'withdraw')
|
255
339
|
fee = self.safe_number(currency, 'withdrawFee')
|
256
340
|
withdrawMin = self.safe_number(currency, 'minWithdraw')
|
257
341
|
withdrawMax = self.safe_number(currency, 'maxWithdraw')
|
258
|
-
limits = {
|
342
|
+
limits: dict = {
|
259
343
|
'withdraw': {
|
260
344
|
'min': withdrawMin,
|
261
345
|
'max': withdrawMax,
|
@@ -280,15 +364,17 @@ class bitopro(Exchange, ImplicitAPI):
|
|
280
364
|
}
|
281
365
|
return result
|
282
366
|
|
283
|
-
def fetch_markets(self, params={}):
|
367
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
284
368
|
"""
|
285
369
|
retrieves data on all markets for bitopro
|
286
|
-
|
370
|
+
|
371
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_trading_pair_info.md
|
372
|
+
|
287
373
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
288
374
|
:returns dict[]: an array of objects representing market data
|
289
375
|
"""
|
290
376
|
response = self.publicGetProvisioningTradingPairs()
|
291
|
-
markets = self.
|
377
|
+
markets = self.safe_list(response, 'data', [])
|
292
378
|
#
|
293
379
|
# {
|
294
380
|
# "data":[
|
@@ -311,8 +397,8 @@ class bitopro(Exchange, ImplicitAPI):
|
|
311
397
|
#
|
312
398
|
return self.parse_markets(markets)
|
313
399
|
|
314
|
-
def parse_market(self, market) -> Market:
|
315
|
-
active = not self.
|
400
|
+
def parse_market(self, market: dict) -> Market:
|
401
|
+
active = not self.safe_bool(market, 'maintain')
|
316
402
|
id = self.safe_string(market, 'pair')
|
317
403
|
uppercaseId = id.upper()
|
318
404
|
baseId = self.safe_string(market, 'base')
|
@@ -320,7 +406,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
320
406
|
base = self.safe_currency_code(baseId)
|
321
407
|
quote = self.safe_currency_code(quoteId)
|
322
408
|
symbol = base + '/' + quote
|
323
|
-
limits = {
|
409
|
+
limits: dict = {
|
324
410
|
'amount': {
|
325
411
|
'min': self.safe_number(market, 'minLimitBaseAmount'),
|
326
412
|
'max': self.safe_number(market, 'maxLimitBaseAmount'),
|
@@ -372,7 +458,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
372
458
|
'info': market,
|
373
459
|
}
|
374
460
|
|
375
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
461
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
376
462
|
#
|
377
463
|
# {
|
378
464
|
# "pair":"btc_twd",
|
@@ -413,18 +499,20 @@ class bitopro(Exchange, ImplicitAPI):
|
|
413
499
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
414
500
|
"""
|
415
501
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
416
|
-
|
502
|
+
|
503
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_ticker_data.md
|
504
|
+
|
417
505
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
418
506
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
419
507
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
420
508
|
"""
|
421
509
|
self.load_markets()
|
422
510
|
market = self.market(symbol)
|
423
|
-
request = {
|
511
|
+
request: dict = {
|
424
512
|
'pair': market['id'],
|
425
513
|
}
|
426
514
|
response = self.publicGetTickersPair(self.extend(request, params))
|
427
|
-
ticker = self.
|
515
|
+
ticker = self.safe_dict(response, 'data', {})
|
428
516
|
#
|
429
517
|
# {
|
430
518
|
# "data":{
|
@@ -443,14 +531,16 @@ class bitopro(Exchange, ImplicitAPI):
|
|
443
531
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
444
532
|
"""
|
445
533
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
446
|
-
|
534
|
+
|
535
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_ticker_data.md
|
536
|
+
|
447
537
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
448
538
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
449
539
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
450
540
|
"""
|
451
541
|
self.load_markets()
|
452
542
|
response = self.publicGetTickers()
|
453
|
-
tickers = self.
|
543
|
+
tickers = self.safe_list(response, 'data', [])
|
454
544
|
#
|
455
545
|
# {
|
456
546
|
# "data":[
|
@@ -471,7 +561,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
471
561
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
472
562
|
"""
|
473
563
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
474
|
-
|
564
|
+
|
565
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_orderbook_data.md
|
566
|
+
|
475
567
|
:param str symbol: unified symbol of the market to fetch the order book for
|
476
568
|
:param int [limit]: the maximum amount of order book entries to return
|
477
569
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -479,7 +571,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
479
571
|
"""
|
480
572
|
self.load_markets()
|
481
573
|
market = self.market(symbol)
|
482
|
-
request = {
|
574
|
+
request: dict = {
|
483
575
|
'pair': market['id'],
|
484
576
|
}
|
485
577
|
if limit is not None:
|
@@ -507,7 +599,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
507
599
|
#
|
508
600
|
return self.parse_order_book(response, market['symbol'], None, 'bids', 'asks', 'price', 'amount')
|
509
601
|
|
510
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
602
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
511
603
|
#
|
512
604
|
# fetchTrades
|
513
605
|
# {
|
@@ -546,7 +638,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
546
638
|
type = self.safe_string_lower(trade, 'type')
|
547
639
|
side = self.safe_string_lower(trade, 'action')
|
548
640
|
if side is None:
|
549
|
-
isBuyer = self.
|
641
|
+
isBuyer = self.safe_bool(trade, 'isBuyer')
|
550
642
|
if isBuyer:
|
551
643
|
side = 'buy'
|
552
644
|
else:
|
@@ -563,7 +655,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
563
655
|
'currency': feeSymbol,
|
564
656
|
'rate': None,
|
565
657
|
}
|
566
|
-
isTaker = self.
|
658
|
+
isTaker = self.safe_bool(trade, 'isTaker')
|
567
659
|
takerOrMaker = None
|
568
660
|
if isTaker is not None:
|
569
661
|
if isTaker:
|
@@ -589,7 +681,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
589
681
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
590
682
|
"""
|
591
683
|
get the list of most recent trades for a particular symbol
|
592
|
-
|
684
|
+
|
685
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_trades_data.md
|
686
|
+
|
593
687
|
:param str symbol: unified symbol of the market to fetch trades for
|
594
688
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
595
689
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -598,11 +692,11 @@ class bitopro(Exchange, ImplicitAPI):
|
|
598
692
|
"""
|
599
693
|
self.load_markets()
|
600
694
|
market = self.market(symbol)
|
601
|
-
request = {
|
695
|
+
request: dict = {
|
602
696
|
'pair': market['id'],
|
603
697
|
}
|
604
698
|
response = self.publicGetTradesPair(self.extend(request, params))
|
605
|
-
trades = self.
|
699
|
+
trades = self.safe_list(response, 'data', [])
|
606
700
|
#
|
607
701
|
# {
|
608
702
|
# "data":[
|
@@ -617,16 +711,18 @@ class bitopro(Exchange, ImplicitAPI):
|
|
617
711
|
#
|
618
712
|
return self.parse_trades(trades, market, since, limit)
|
619
713
|
|
620
|
-
def fetch_trading_fees(self, params={}):
|
714
|
+
def fetch_trading_fees(self, params={}) -> TradingFees:
|
621
715
|
"""
|
622
716
|
fetch the trading fees for multiple markets
|
623
|
-
|
717
|
+
|
718
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_limitations_and_fees.md
|
719
|
+
|
624
720
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
625
721
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
626
722
|
"""
|
627
723
|
self.load_markets()
|
628
724
|
response = self.publicGetProvisioningLimitationsAndFees(params)
|
629
|
-
tradingFeeRate = self.
|
725
|
+
tradingFeeRate = self.safe_dict(response, 'tradingFeeRate', {})
|
630
726
|
first = self.safe_value(tradingFeeRate, 0)
|
631
727
|
#
|
632
728
|
# {
|
@@ -689,7 +785,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
689
785
|
# ]
|
690
786
|
# }
|
691
787
|
#
|
692
|
-
result = {}
|
788
|
+
result: dict = {}
|
693
789
|
maker = self.safe_number(first, 'makerFee')
|
694
790
|
taker = self.safe_number(first, 'takerFee')
|
695
791
|
for i in range(0, len(self.symbols)):
|
@@ -717,7 +813,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
717
813
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
718
814
|
"""
|
719
815
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
720
|
-
|
816
|
+
|
817
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_ohlc_data.md
|
818
|
+
|
721
819
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
722
820
|
:param str timeframe: the length of time each candle represents
|
723
821
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -728,13 +826,15 @@ class bitopro(Exchange, ImplicitAPI):
|
|
728
826
|
self.load_markets()
|
729
827
|
market = self.market(symbol)
|
730
828
|
resolution = self.safe_string(self.timeframes, timeframe, timeframe)
|
731
|
-
request = {
|
829
|
+
request: dict = {
|
732
830
|
'pair': market['id'],
|
733
831
|
'resolution': resolution,
|
734
832
|
}
|
735
833
|
# we need to have a limit argument because "to" and "from" are required
|
736
834
|
if limit is None:
|
737
835
|
limit = 500
|
836
|
+
else:
|
837
|
+
limit = min(limit, 75000) # supports slightly more than 75k candles atm, but limit here to avoid errors
|
738
838
|
timeframeInSeconds = self.parse_timeframe(timeframe)
|
739
839
|
alignedSince = None
|
740
840
|
if since is None:
|
@@ -746,7 +846,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
746
846
|
request['from'] = int(math.floor(since / 1000))
|
747
847
|
request['to'] = self.sum(request['from'], limit * timeframeInSeconds)
|
748
848
|
response = self.publicGetTradingHistoryPair(self.extend(request, params))
|
749
|
-
data = self.
|
849
|
+
data = self.safe_list(response, 'data', [])
|
750
850
|
#
|
751
851
|
# {
|
752
852
|
# "data":[
|
@@ -809,7 +909,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
809
909
|
# "tradable":true
|
810
910
|
# }]
|
811
911
|
#
|
812
|
-
result = {
|
912
|
+
result: dict = {
|
813
913
|
'info': response,
|
814
914
|
}
|
815
915
|
for i in range(0, len(response)):
|
@@ -818,7 +918,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
818
918
|
code = self.safe_currency_code(currencyId)
|
819
919
|
amount = self.safe_string(balance, 'amount')
|
820
920
|
available = self.safe_string(balance, 'available')
|
821
|
-
account = {
|
921
|
+
account: dict = {
|
822
922
|
'free': available,
|
823
923
|
'total': amount,
|
824
924
|
}
|
@@ -828,13 +928,15 @@ class bitopro(Exchange, ImplicitAPI):
|
|
828
928
|
def fetch_balance(self, params={}) -> Balances:
|
829
929
|
"""
|
830
930
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
831
|
-
|
931
|
+
|
932
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_account_balance.md
|
933
|
+
|
832
934
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
833
935
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
834
936
|
"""
|
835
937
|
self.load_markets()
|
836
938
|
response = self.privateGetAccountsBalance(params)
|
837
|
-
balances = self.
|
939
|
+
balances = self.safe_list(response, 'data', [])
|
838
940
|
#
|
839
941
|
# {
|
840
942
|
# "data":[
|
@@ -850,8 +952,8 @@ class bitopro(Exchange, ImplicitAPI):
|
|
850
952
|
#
|
851
953
|
return self.parse_balance(balances)
|
852
954
|
|
853
|
-
def parse_order_status(self, status):
|
854
|
-
statuses = {
|
955
|
+
def parse_order_status(self, status: Str):
|
956
|
+
statuses: dict = {
|
855
957
|
'-1': 'open',
|
856
958
|
'0': 'open',
|
857
959
|
'1': 'open',
|
@@ -862,7 +964,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
862
964
|
}
|
863
965
|
return self.safe_string(statuses, status, None)
|
864
966
|
|
865
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
967
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
866
968
|
#
|
867
969
|
# createOrder
|
868
970
|
# {
|
@@ -936,7 +1038,6 @@ class bitopro(Exchange, ImplicitAPI):
|
|
936
1038
|
'postOnly': postOnly,
|
937
1039
|
'side': side,
|
938
1040
|
'price': price,
|
939
|
-
'stopPrice': None,
|
940
1041
|
'triggerPrice': None,
|
941
1042
|
'amount': amount,
|
942
1043
|
'cost': None,
|
@@ -952,18 +1053,21 @@ class bitopro(Exchange, ImplicitAPI):
|
|
952
1053
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
953
1054
|
"""
|
954
1055
|
create a trade order
|
955
|
-
|
1056
|
+
|
1057
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/create_an_order.md
|
1058
|
+
|
956
1059
|
:param str symbol: unified symbol of the market to create an order in
|
957
1060
|
:param str type: 'market' or 'limit'
|
958
1061
|
:param str side: 'buy' or 'sell'
|
959
1062
|
:param float amount: how much of currency you want to trade in units of base currency
|
960
|
-
:param float [price]: the price at which the order is to be
|
1063
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
961
1064
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1065
|
+
:param dict [params.triggerPrice]: the price at which a trigger order is triggered at
|
962
1066
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
963
1067
|
"""
|
964
1068
|
self.load_markets()
|
965
1069
|
market = self.market(symbol)
|
966
|
-
request = {
|
1070
|
+
request: dict = {
|
967
1071
|
'type': type,
|
968
1072
|
'pair': market['id'],
|
969
1073
|
'action': side,
|
@@ -975,12 +1079,12 @@ class bitopro(Exchange, ImplicitAPI):
|
|
975
1079
|
request['price'] = self.price_to_precision(symbol, price)
|
976
1080
|
if orderType == 'STOP_LIMIT':
|
977
1081
|
request['price'] = self.price_to_precision(symbol, price)
|
978
|
-
|
1082
|
+
triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
|
979
1083
|
params = self.omit(params, ['triggerPrice', 'stopPrice'])
|
980
|
-
if
|
981
|
-
raise InvalidOrder(self.id + ' createOrder() requires a
|
1084
|
+
if triggerPrice is None:
|
1085
|
+
raise InvalidOrder(self.id + ' createOrder() requires a triggerPrice parameter for ' + orderType + ' orders')
|
982
1086
|
else:
|
983
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
1087
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
984
1088
|
condition = self.safe_string(params, 'condition')
|
985
1089
|
if condition is None:
|
986
1090
|
raise InvalidOrder(self.id + ' createOrder() requires a condition parameter for ' + orderType + ' orders')
|
@@ -1005,7 +1109,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1005
1109
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1006
1110
|
"""
|
1007
1111
|
cancels an open order
|
1008
|
-
|
1112
|
+
|
1113
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/cancel_an_order.md
|
1114
|
+
|
1009
1115
|
:param str id: order id
|
1010
1116
|
:param str symbol: unified symbol of the market the order was made in
|
1011
1117
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1015,7 +1121,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1015
1121
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
1016
1122
|
self.load_markets()
|
1017
1123
|
market = self.market(symbol)
|
1018
|
-
request = {
|
1124
|
+
request: dict = {
|
1019
1125
|
'id': id,
|
1020
1126
|
'pair': market['id'],
|
1021
1127
|
}
|
@@ -1031,10 +1137,26 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1031
1137
|
#
|
1032
1138
|
return self.parse_order(response, market)
|
1033
1139
|
|
1140
|
+
def parse_cancel_orders(self, data):
|
1141
|
+
dataKeys = list(data.keys())
|
1142
|
+
orders = []
|
1143
|
+
for i in range(0, len(dataKeys)):
|
1144
|
+
marketId = dataKeys[i]
|
1145
|
+
orderIds = data[marketId]
|
1146
|
+
for j in range(0, len(orderIds)):
|
1147
|
+
orders.append(self.safe_order({
|
1148
|
+
'info': orderIds[j],
|
1149
|
+
'id': orderIds[j],
|
1150
|
+
'symbol': self.safe_symbol(marketId),
|
1151
|
+
}))
|
1152
|
+
return orders
|
1153
|
+
|
1034
1154
|
def cancel_orders(self, ids, symbol: Str = None, params={}):
|
1035
1155
|
"""
|
1036
1156
|
cancel multiple orders
|
1037
|
-
|
1157
|
+
|
1158
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/cancel_batch_orders.md
|
1159
|
+
|
1038
1160
|
:param str[] ids: order ids
|
1039
1161
|
:param str symbol: unified market symbol
|
1040
1162
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1045,7 +1167,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1045
1167
|
self.load_markets()
|
1046
1168
|
market = self.market(symbol)
|
1047
1169
|
id = market['uppercaseId']
|
1048
|
-
request = {}
|
1170
|
+
request: dict = {}
|
1049
1171
|
request[id] = ids
|
1050
1172
|
response = self.privatePutOrders(self.extend(request, params))
|
1051
1173
|
#
|
@@ -1058,18 +1180,21 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1058
1180
|
# }
|
1059
1181
|
# }
|
1060
1182
|
#
|
1061
|
-
|
1183
|
+
data = self.safe_dict(response, 'data')
|
1184
|
+
return self.parse_cancel_orders(data)
|
1062
1185
|
|
1063
1186
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1064
1187
|
"""
|
1065
1188
|
cancel all open orders
|
1066
|
-
|
1189
|
+
|
1190
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/cancel_all_orders.md
|
1191
|
+
|
1067
1192
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
1068
1193
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1069
1194
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1070
1195
|
"""
|
1071
1196
|
self.load_markets()
|
1072
|
-
request = {
|
1197
|
+
request: dict = {
|
1073
1198
|
# 'pair': market['id'], # optional
|
1074
1199
|
}
|
1075
1200
|
response = None
|
@@ -1079,7 +1204,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1079
1204
|
response = self.privateDeleteOrdersPair(self.extend(request, params))
|
1080
1205
|
else:
|
1081
1206
|
response = self.privateDeleteOrdersAll(self.extend(request, params))
|
1082
|
-
|
1207
|
+
data = self.safe_dict(response, 'data', {})
|
1083
1208
|
#
|
1084
1209
|
# {
|
1085
1210
|
# "data":{
|
@@ -1090,12 +1215,15 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1090
1215
|
# }
|
1091
1216
|
# }
|
1092
1217
|
#
|
1093
|
-
return
|
1218
|
+
return self.parse_cancel_orders(data)
|
1094
1219
|
|
1095
1220
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1096
1221
|
"""
|
1097
1222
|
fetches information on an order made by the user
|
1098
|
-
|
1223
|
+
|
1224
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_an_order_data.md
|
1225
|
+
|
1226
|
+
:param str id: the order id
|
1099
1227
|
:param str symbol: unified symbol of the market the order was made in
|
1100
1228
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1101
1229
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -1104,7 +1232,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1104
1232
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
1105
1233
|
self.load_markets()
|
1106
1234
|
market = self.market(symbol)
|
1107
|
-
request = {
|
1235
|
+
request: dict = {
|
1108
1236
|
'orderId': id,
|
1109
1237
|
'pair': market['id'],
|
1110
1238
|
}
|
@@ -1137,7 +1265,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1137
1265
|
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1138
1266
|
"""
|
1139
1267
|
fetches information on multiple orders made by the user
|
1140
|
-
|
1268
|
+
|
1269
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_orders_data.md
|
1270
|
+
|
1141
1271
|
:param str symbol: unified market symbol of the market orders were made in
|
1142
1272
|
:param int [since]: the earliest time in ms to fetch orders for
|
1143
1273
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -1148,7 +1278,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1148
1278
|
raise ArgumentsRequired(self.id + ' fetchOrders() requires a symbol argument')
|
1149
1279
|
self.load_markets()
|
1150
1280
|
market = self.market(symbol)
|
1151
|
-
request = {
|
1281
|
+
request: dict = {
|
1152
1282
|
'pair': market['id'],
|
1153
1283
|
# 'startTimestamp': 0,
|
1154
1284
|
# 'endTimestamp': 0,
|
@@ -1160,7 +1290,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1160
1290
|
if limit is not None:
|
1161
1291
|
request['limit'] = limit
|
1162
1292
|
response = self.privateGetOrdersAllPair(self.extend(request, params))
|
1163
|
-
orders = self.
|
1293
|
+
orders = self.safe_list(response, 'data', [])
|
1164
1294
|
if orders is None:
|
1165
1295
|
orders = []
|
1166
1296
|
#
|
@@ -1192,22 +1322,40 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1192
1322
|
return self.parse_orders(orders, market, since, limit)
|
1193
1323
|
|
1194
1324
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1325
|
+
"""
|
1326
|
+
fetch all unfilled currently open orders
|
1327
|
+
|
1328
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_open_orders_data.md
|
1329
|
+
|
1330
|
+
:param str symbol: unified market symbol
|
1331
|
+
:param int [since]: the earliest time in ms to fetch open orders for
|
1332
|
+
:param int [limit]: the maximum number of open orders structures to retrieve
|
1333
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1334
|
+
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1335
|
+
"""
|
1336
|
+
self.load_markets()
|
1337
|
+
request: dict = {}
|
1338
|
+
market = None
|
1339
|
+
if symbol is not None:
|
1340
|
+
market = self.market(symbol)
|
1341
|
+
request['pair'] = market['id']
|
1342
|
+
response = self.privateGetOrdersOpen(self.extend(request, params))
|
1343
|
+
orders = self.safe_list(response, 'data', [])
|
1344
|
+
return self.parse_orders(orders, market, since, limit)
|
1199
1345
|
|
1200
1346
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1201
1347
|
"""
|
1202
1348
|
fetches information on multiple closed orders made by the user
|
1203
|
-
|
1349
|
+
|
1350
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_orders_data.md
|
1351
|
+
|
1204
1352
|
:param str symbol: unified market symbol of the market orders were made in
|
1205
1353
|
:param int [since]: the earliest time in ms to fetch orders for
|
1206
1354
|
:param int [limit]: the maximum number of order structures to retrieve
|
1207
1355
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1208
1356
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1209
1357
|
"""
|
1210
|
-
request = {
|
1358
|
+
request: dict = {
|
1211
1359
|
'statusKind': 'DONE',
|
1212
1360
|
}
|
1213
1361
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -1215,7 +1363,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1215
1363
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1216
1364
|
"""
|
1217
1365
|
fetch all trades made by the user
|
1218
|
-
|
1366
|
+
|
1367
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_trades_data.md
|
1368
|
+
|
1219
1369
|
:param str symbol: unified market symbol
|
1220
1370
|
:param int [since]: the earliest time in ms to fetch trades for
|
1221
1371
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -1226,11 +1376,11 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1226
1376
|
raise ArgumentsRequired(self.id + ' fetchMyTrades() requires a symbol argument')
|
1227
1377
|
self.load_markets()
|
1228
1378
|
market = self.market(symbol)
|
1229
|
-
request = {
|
1379
|
+
request: dict = {
|
1230
1380
|
'pair': market['id'],
|
1231
1381
|
}
|
1232
1382
|
response = self.privateGetOrdersTradesPair(self.extend(request, params))
|
1233
|
-
trades = self.
|
1383
|
+
trades = self.safe_list(response, 'data', [])
|
1234
1384
|
#
|
1235
1385
|
# {
|
1236
1386
|
# "data":[
|
@@ -1252,8 +1402,8 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1252
1402
|
#
|
1253
1403
|
return self.parse_trades(trades, market, since, limit)
|
1254
1404
|
|
1255
|
-
def parse_transaction_status(self, status):
|
1256
|
-
states = {
|
1405
|
+
def parse_transaction_status(self, status: Str):
|
1406
|
+
states: dict = {
|
1257
1407
|
'COMPLETE': 'ok',
|
1258
1408
|
'INVALID': 'failed',
|
1259
1409
|
'PROCESSING': 'pending',
|
@@ -1266,7 +1416,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1266
1416
|
}
|
1267
1417
|
return self.safe_string(states, status, status)
|
1268
1418
|
|
1269
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1419
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1270
1420
|
#
|
1271
1421
|
# fetchDeposits
|
1272
1422
|
#
|
@@ -1350,7 +1500,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1350
1500
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1351
1501
|
"""
|
1352
1502
|
fetch all deposits made to an account
|
1353
|
-
|
1503
|
+
|
1504
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_deposit_invoices_data.md
|
1505
|
+
|
1354
1506
|
:param str code: unified currency code
|
1355
1507
|
:param int [since]: the earliest time in ms to fetch deposits for
|
1356
1508
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -1361,7 +1513,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1361
1513
|
raise ArgumentsRequired(self.id + ' fetchDeposits() requires the code argument')
|
1362
1514
|
self.load_markets()
|
1363
1515
|
currency = self.safe_currency(code)
|
1364
|
-
request = {
|
1516
|
+
request: dict = {
|
1365
1517
|
'currency': currency['id'],
|
1366
1518
|
# 'endTimestamp': 0,
|
1367
1519
|
# 'id': '',
|
@@ -1372,7 +1524,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1372
1524
|
if limit is not None:
|
1373
1525
|
request['limit'] = limit
|
1374
1526
|
response = self.privateGetWalletDepositHistoryCurrency(self.extend(request, params))
|
1375
|
-
result = self.
|
1527
|
+
result = self.safe_list(response, 'data', [])
|
1376
1528
|
#
|
1377
1529
|
# {
|
1378
1530
|
# "data":[
|
@@ -1397,7 +1549,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1397
1549
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1398
1550
|
"""
|
1399
1551
|
fetch all withdrawals made from an account
|
1400
|
-
|
1552
|
+
|
1553
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_withdraw_invoices_data.md
|
1554
|
+
|
1401
1555
|
:param str code: unified currency code
|
1402
1556
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
1403
1557
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -1408,7 +1562,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1408
1562
|
raise ArgumentsRequired(self.id + ' fetchWithdrawals() requires the code argument')
|
1409
1563
|
self.load_markets()
|
1410
1564
|
currency = self.safe_currency(code)
|
1411
|
-
request = {
|
1565
|
+
request: dict = {
|
1412
1566
|
'currency': currency['id'],
|
1413
1567
|
# 'endTimestamp': 0,
|
1414
1568
|
# 'id': '',
|
@@ -1419,7 +1573,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1419
1573
|
if limit is not None:
|
1420
1574
|
request['limit'] = limit
|
1421
1575
|
response = self.privateGetWalletWithdrawHistoryCurrency(self.extend(request, params))
|
1422
|
-
result = self.
|
1576
|
+
result = self.safe_list(response, 'data', [])
|
1423
1577
|
#
|
1424
1578
|
# {
|
1425
1579
|
# "data":[
|
@@ -1443,7 +1597,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1443
1597
|
def fetch_withdrawal(self, id: str, code: Str = None, params={}):
|
1444
1598
|
"""
|
1445
1599
|
fetch data on a currency withdrawal via the withdrawal id
|
1446
|
-
|
1600
|
+
|
1601
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_an_withdraw_invoice_data.md
|
1602
|
+
|
1447
1603
|
:param str id: withdrawal id
|
1448
1604
|
:param str code: unified currency code of the currency withdrawn, default is None
|
1449
1605
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1453,12 +1609,12 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1453
1609
|
raise ArgumentsRequired(self.id + ' fetchWithdrawal() requires the code argument')
|
1454
1610
|
self.load_markets()
|
1455
1611
|
currency = self.safe_currency(code)
|
1456
|
-
request = {
|
1612
|
+
request: dict = {
|
1457
1613
|
'serial': id,
|
1458
1614
|
'currency': currency['id'],
|
1459
1615
|
}
|
1460
1616
|
response = self.privateGetWalletWithdrawCurrencySerial(self.extend(request, params))
|
1461
|
-
result = self.
|
1617
|
+
result = self.safe_dict(response, 'data', {})
|
1462
1618
|
#
|
1463
1619
|
# {
|
1464
1620
|
# "data":{
|
@@ -1477,10 +1633,12 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1477
1633
|
#
|
1478
1634
|
return self.parse_transaction(result, currency)
|
1479
1635
|
|
1480
|
-
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1636
|
+
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1481
1637
|
"""
|
1482
1638
|
make a withdrawal
|
1483
|
-
|
1639
|
+
|
1640
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/create_an_withdraw_invoice.md
|
1641
|
+
|
1484
1642
|
:param str code: unified currency code
|
1485
1643
|
:param float amount: the amount to withdraw
|
1486
1644
|
:param str address: the address to withdraw to
|
@@ -1492,13 +1650,13 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1492
1650
|
self.load_markets()
|
1493
1651
|
self.check_address(address)
|
1494
1652
|
currency = self.currency(code)
|
1495
|
-
request = {
|
1653
|
+
request: dict = {
|
1496
1654
|
'currency': currency['id'],
|
1497
1655
|
'amount': self.number_to_string(amount),
|
1498
1656
|
'address': address,
|
1499
1657
|
}
|
1500
1658
|
if 'network' in params:
|
1501
|
-
networks = self.
|
1659
|
+
networks = self.safe_dict(self.options, 'networks', {})
|
1502
1660
|
requestedNetwork = self.safe_string_upper(params, 'network')
|
1503
1661
|
params = self.omit(params, ['network'])
|
1504
1662
|
networkId = self.safe_string(networks, requestedNetwork)
|
@@ -1508,7 +1666,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1508
1666
|
if tag is not None:
|
1509
1667
|
request['message'] = tag
|
1510
1668
|
response = self.privatePostWalletWithdrawCurrency(self.extend(request, params))
|
1511
|
-
result = self.
|
1669
|
+
result = self.safe_dict(response, 'data', {})
|
1512
1670
|
#
|
1513
1671
|
# {
|
1514
1672
|
# "data":{
|
@@ -1551,7 +1709,9 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1551
1709
|
def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
1552
1710
|
"""
|
1553
1711
|
fetch deposit and withdraw fees
|
1554
|
-
|
1712
|
+
|
1713
|
+
https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/public/get_currency_info.md
|
1714
|
+
|
1555
1715
|
:param str[]|None codes: list of unified currency codes
|
1556
1716
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1557
1717
|
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -1574,7 +1734,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1574
1734
|
# ]
|
1575
1735
|
# }
|
1576
1736
|
#
|
1577
|
-
data = self.
|
1737
|
+
data = self.safe_list(response, 'data', [])
|
1578
1738
|
return self.parse_deposit_withdraw_fees(data, codes, 'currency')
|
1579
1739
|
|
1580
1740
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
@@ -1596,7 +1756,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1596
1756
|
if query:
|
1597
1757
|
url += '?' + self.urlencode(query)
|
1598
1758
|
nonce = self.milliseconds()
|
1599
|
-
rawData = {
|
1759
|
+
rawData: dict = {
|
1600
1760
|
'nonce': nonce,
|
1601
1761
|
}
|
1602
1762
|
data = self.json(rawData)
|
@@ -1611,7 +1771,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1611
1771
|
url = self.urls['api']['rest'] + url
|
1612
1772
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
1613
1773
|
|
1614
|
-
def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
1774
|
+
def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
|
1615
1775
|
if response is None:
|
1616
1776
|
return None # fallback to the default error handler
|
1617
1777
|
if code >= 200 and code < 300:
|