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/async_support/coinlist.py
CHANGED
@@ -7,9 +7,10 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.coinlist import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import math
|
10
|
-
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
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 PermissionDenied
|
14
15
|
from ccxt.base.errors import ArgumentsRequired
|
15
16
|
from ccxt.base.errors import BadRequest
|
@@ -20,7 +21,6 @@ from ccxt.base.errors import InvalidOrder
|
|
20
21
|
from ccxt.base.errors import OrderNotFound
|
21
22
|
from ccxt.base.errors import NotSupported
|
22
23
|
from ccxt.base.errors import OnMaintenance
|
23
|
-
from ccxt.base.errors import AuthenticationError
|
24
24
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
25
25
|
from ccxt.base.precise import Precise
|
26
26
|
|
@@ -103,7 +103,11 @@ class coinlist(Exchange, ImplicitAPI):
|
|
103
103
|
'fetchOrders': True,
|
104
104
|
'fetchOrderTrades': True,
|
105
105
|
'fetchPosition': False,
|
106
|
+
'fetchPositionHistory': False,
|
107
|
+
'fetchPositionMode': False,
|
106
108
|
'fetchPositions': False,
|
109
|
+
'fetchPositionsForSymbol': False,
|
110
|
+
'fetchPositionsHistory': False,
|
107
111
|
'fetchPositionsRisk': False,
|
108
112
|
'fetchPremiumIndexOHLCV': False,
|
109
113
|
'fetchStatus': False,
|
@@ -216,6 +220,83 @@ class coinlist(Exchange, ImplicitAPI):
|
|
216
220
|
},
|
217
221
|
},
|
218
222
|
},
|
223
|
+
'features': {
|
224
|
+
'default': {
|
225
|
+
'sandbox': False,
|
226
|
+
'createOrder': {
|
227
|
+
'marginMode': False,
|
228
|
+
'triggerPrice': True,
|
229
|
+
'triggerPriceType': {
|
230
|
+
'last': True,
|
231
|
+
'mark': True,
|
232
|
+
'index': True,
|
233
|
+
},
|
234
|
+
'triggerDirection': False,
|
235
|
+
'stopLossPrice': False, # todo
|
236
|
+
'takeProfitPrice': False, # todo
|
237
|
+
'attachedStopLossTakeProfit': None,
|
238
|
+
'timeInForce': {
|
239
|
+
'IOC': False,
|
240
|
+
'FOK': False,
|
241
|
+
'PO': True,
|
242
|
+
'GTD': False,
|
243
|
+
},
|
244
|
+
'hedged': False,
|
245
|
+
'trailing': True, # todo implement
|
246
|
+
'leverage': False,
|
247
|
+
'marketBuyByCost': False,
|
248
|
+
'marketBuyRequiresPrice': False,
|
249
|
+
'selfTradePrevention': True, # todo implement
|
250
|
+
'iceberg': False,
|
251
|
+
},
|
252
|
+
'createOrders': None,
|
253
|
+
'fetchMyTrades': {
|
254
|
+
'marginMode': False,
|
255
|
+
'limit': 500,
|
256
|
+
'daysBack': 100000,
|
257
|
+
'untilDays': 100000,
|
258
|
+
},
|
259
|
+
'fetchOrder': {
|
260
|
+
'marginMode': False,
|
261
|
+
'trigger': False,
|
262
|
+
'trailing': False,
|
263
|
+
},
|
264
|
+
'fetchOpenOrders': {
|
265
|
+
'marginMode': False,
|
266
|
+
'limit': 500,
|
267
|
+
'trigger': False,
|
268
|
+
'trailing': False,
|
269
|
+
},
|
270
|
+
'fetchOrders': {
|
271
|
+
'marginMode': False,
|
272
|
+
'limit': 500,
|
273
|
+
'daysBack': 100000,
|
274
|
+
'untilDays': 100000,
|
275
|
+
'trigger': False,
|
276
|
+
'trailing': False,
|
277
|
+
},
|
278
|
+
'fetchClosedOrders': {
|
279
|
+
'marginMode': False,
|
280
|
+
'limit': 500,
|
281
|
+
'daysBack': 100000,
|
282
|
+
'daysBackCanceled': None,
|
283
|
+
'untilDays': 100000,
|
284
|
+
'trigger': False,
|
285
|
+
'trailing': False,
|
286
|
+
},
|
287
|
+
'fetchOHLCV': {
|
288
|
+
'limit': 300,
|
289
|
+
},
|
290
|
+
},
|
291
|
+
'swap': {
|
292
|
+
'linear': None,
|
293
|
+
'inverse': None,
|
294
|
+
},
|
295
|
+
'future': {
|
296
|
+
'linear': None,
|
297
|
+
'inverse': None,
|
298
|
+
},
|
299
|
+
},
|
219
300
|
'fees': {
|
220
301
|
'trading': {
|
221
302
|
'feeSide': 'get',
|
@@ -322,7 +403,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
322
403
|
async def fetch_time(self, params={}):
|
323
404
|
"""
|
324
405
|
fetches the current integer timestamp in milliseconds from the exchange server
|
325
|
-
|
406
|
+
|
407
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#get-system-time
|
408
|
+
|
326
409
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
327
410
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
328
411
|
"""
|
@@ -336,10 +419,12 @@ class coinlist(Exchange, ImplicitAPI):
|
|
336
419
|
string = self.safe_string(response, 'iso')
|
337
420
|
return self.parse8601(string)
|
338
421
|
|
339
|
-
async def fetch_currencies(self, params={}):
|
422
|
+
async def fetch_currencies(self, params={}) -> Currencies:
|
340
423
|
"""
|
341
424
|
fetches all available currencies on an exchange
|
342
|
-
|
425
|
+
|
426
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-supported-assets
|
427
|
+
|
343
428
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
344
429
|
:returns dict: an associative dictionary of currencies
|
345
430
|
"""
|
@@ -367,7 +452,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
367
452
|
# }
|
368
453
|
#
|
369
454
|
currencies = self.safe_value(response, 'assets', [])
|
370
|
-
result = {}
|
455
|
+
result: dict = {}
|
371
456
|
for i in range(0, len(currencies)):
|
372
457
|
currency = currencies[i]
|
373
458
|
id = self.safe_string(currency, 'asset')
|
@@ -397,10 +482,12 @@ class coinlist(Exchange, ImplicitAPI):
|
|
397
482
|
}
|
398
483
|
return result
|
399
484
|
|
400
|
-
async def fetch_markets(self, params={}):
|
485
|
+
async def fetch_markets(self, params={}) -> List[Market]:
|
401
486
|
"""
|
402
487
|
retrieves data on all markets for coinlist
|
403
|
-
|
488
|
+
|
489
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-symbols
|
490
|
+
|
404
491
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
405
492
|
:returns dict[]: an array of objects representing market data
|
406
493
|
"""
|
@@ -433,7 +520,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
433
520
|
markets = self.safe_value(response, 'symbols', [])
|
434
521
|
return self.parse_markets(markets)
|
435
522
|
|
436
|
-
def parse_market(self, market) -> Market:
|
523
|
+
def parse_market(self, market: dict) -> Market:
|
437
524
|
id = self.safe_string(market, 'symbol')
|
438
525
|
baseId = self.safe_string(market, 'base_currency')
|
439
526
|
quoteId = self.safe_string(market, 'quote_currency')
|
@@ -495,13 +582,15 @@ class coinlist(Exchange, ImplicitAPI):
|
|
495
582
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
496
583
|
"""
|
497
584
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
498
|
-
|
585
|
+
|
586
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#get-symbol-summaries
|
587
|
+
|
499
588
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
500
589
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
501
590
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
502
591
|
"""
|
503
592
|
await self.load_markets()
|
504
|
-
request = {}
|
593
|
+
request: dict = {}
|
505
594
|
tickers = await self.publicGetV1SymbolsSummary(self.extend(request, params))
|
506
595
|
#
|
507
596
|
# {
|
@@ -530,14 +619,16 @@ class coinlist(Exchange, ImplicitAPI):
|
|
530
619
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
531
620
|
"""
|
532
621
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
533
|
-
|
622
|
+
|
623
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#get-market-summary
|
624
|
+
|
534
625
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
535
626
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
536
627
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
537
628
|
"""
|
538
629
|
await self.load_markets()
|
539
630
|
market = self.market(symbol)
|
540
|
-
request = {
|
631
|
+
request: dict = {
|
541
632
|
'symbol': market['id'],
|
542
633
|
}
|
543
634
|
ticker = await self.publicGetV1SymbolsSymbolSummary(self.extend(request, params))
|
@@ -563,7 +654,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
563
654
|
#
|
564
655
|
return self.parse_ticker(ticker, market)
|
565
656
|
|
566
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
657
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
567
658
|
#
|
568
659
|
# {
|
569
660
|
# "type":"spot",
|
@@ -619,7 +710,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
619
710
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
620
711
|
"""
|
621
712
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
622
|
-
|
713
|
+
|
714
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#get-order-book-level-2
|
715
|
+
|
623
716
|
:param str symbol: unified symbol of the market to fetch the order book for
|
624
717
|
:param int [limit]: the maximum amount of order book entries to return(default 100, max 200)
|
625
718
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -627,7 +720,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
627
720
|
"""
|
628
721
|
await self.load_markets()
|
629
722
|
market = self.market(symbol)
|
630
|
-
request = {
|
723
|
+
request: dict = {
|
631
724
|
'symbol': market['id'],
|
632
725
|
}
|
633
726
|
response = await self.publicGetV1SymbolsSymbolBook(self.extend(request, params))
|
@@ -656,7 +749,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
656
749
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
657
750
|
"""
|
658
751
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
659
|
-
|
752
|
+
|
753
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#get-candles
|
754
|
+
|
660
755
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
661
756
|
:param str timeframe: the length of time each candle represents
|
662
757
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -668,7 +763,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
668
763
|
await self.load_markets()
|
669
764
|
market = self.market(symbol)
|
670
765
|
granularity = self.safe_string(self.timeframes, timeframe)
|
671
|
-
request = {
|
766
|
+
request: dict = {
|
672
767
|
'symbol': market['id'],
|
673
768
|
'granularity': granularity,
|
674
769
|
}
|
@@ -679,9 +774,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
679
774
|
request['end_time'] = self.iso8601(self.sum(since, duration * (limit)))
|
680
775
|
else:
|
681
776
|
request['end_time'] = self.iso8601(self.milliseconds())
|
682
|
-
until = self.
|
777
|
+
until = self.safe_integer(params, 'until')
|
683
778
|
if until is not None:
|
684
|
-
params = self.omit(params, ['
|
779
|
+
params = self.omit(params, ['until'])
|
685
780
|
request['end_time'] = self.iso8601(until)
|
686
781
|
response = await self.publicGetV1SymbolsSymbolCandles(self.extend(request, params))
|
687
782
|
#
|
@@ -708,7 +803,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
708
803
|
# ]
|
709
804
|
# }
|
710
805
|
#
|
711
|
-
candles = self.
|
806
|
+
candles = self.safe_list(response, 'candles', [])
|
712
807
|
return self.parse_ohlcvs(candles, market, timeframe, since, limit)
|
713
808
|
|
714
809
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -735,7 +830,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
735
830
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
736
831
|
"""
|
737
832
|
get the list of most recent trades for a particular symbol
|
738
|
-
|
833
|
+
|
834
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-auctions
|
835
|
+
|
739
836
|
:param str symbol: unified symbol of the market to fetch trades for
|
740
837
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
741
838
|
:param int [limit]: the maximum amount of trades to fetch(default 200, max 500)
|
@@ -745,16 +842,16 @@ class coinlist(Exchange, ImplicitAPI):
|
|
745
842
|
"""
|
746
843
|
await self.load_markets()
|
747
844
|
market = self.market(symbol)
|
748
|
-
request = {
|
845
|
+
request: dict = {
|
749
846
|
'symbol': market['id'],
|
750
847
|
}
|
751
848
|
if since is not None:
|
752
849
|
request['start_time'] = self.iso8601(since)
|
753
850
|
if limit is not None:
|
754
851
|
request['count'] = min(limit, 500)
|
755
|
-
until = self.
|
852
|
+
until = self.safe_integer(params, 'until')
|
756
853
|
if until is not None:
|
757
|
-
params = self.omit(params, ['
|
854
|
+
params = self.omit(params, ['until'])
|
758
855
|
request['end_time'] = self.iso8601(until)
|
759
856
|
response = await self.publicGetV1SymbolsSymbolAuctions(self.extend(request, params))
|
760
857
|
#
|
@@ -781,10 +878,10 @@ class coinlist(Exchange, ImplicitAPI):
|
|
781
878
|
# ]
|
782
879
|
# }
|
783
880
|
#
|
784
|
-
auctions = self.
|
881
|
+
auctions = self.safe_list(response, 'auctions', [])
|
785
882
|
return self.parse_trades(auctions, market, since, limit)
|
786
883
|
|
787
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
884
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
788
885
|
#
|
789
886
|
# fetchTrades
|
790
887
|
# {
|
@@ -856,10 +953,12 @@ class coinlist(Exchange, ImplicitAPI):
|
|
856
953
|
'info': trade,
|
857
954
|
}, market)
|
858
955
|
|
859
|
-
async def fetch_trading_fees(self, params={}):
|
956
|
+
async def fetch_trading_fees(self, params={}) -> TradingFees:
|
860
957
|
"""
|
861
958
|
fetch the trading fees for multiple markets
|
862
|
-
|
959
|
+
|
960
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-fees
|
961
|
+
|
863
962
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
864
963
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
865
964
|
"""
|
@@ -922,7 +1021,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
922
1021
|
# }
|
923
1022
|
#
|
924
1023
|
fees = self.safe_value(response, 'fees_by_symbols', {})
|
925
|
-
result = {}
|
1024
|
+
result: dict = {}
|
926
1025
|
groupsOfSymbols = list(fees.keys())
|
927
1026
|
for i in range(0, len(groupsOfSymbols)):
|
928
1027
|
group = groupsOfSymbols[i]
|
@@ -935,7 +1034,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
935
1034
|
id = ids[j]
|
936
1035
|
market = self.safe_market(id)
|
937
1036
|
symbol = market['symbol']
|
938
|
-
info = {}
|
1037
|
+
info: dict = {}
|
939
1038
|
info[group] = feeTiers
|
940
1039
|
result[symbol] = {
|
941
1040
|
'info': info,
|
@@ -1034,7 +1133,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1034
1133
|
async def fetch_accounts(self, params={}) -> List[Account]:
|
1035
1134
|
"""
|
1036
1135
|
fetch all the accounts associated with a profile
|
1037
|
-
|
1136
|
+
|
1137
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-accounts
|
1138
|
+
|
1038
1139
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1039
1140
|
:returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
|
1040
1141
|
"""
|
@@ -1070,7 +1171,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1070
1171
|
async def fetch_balance(self, params={}) -> Balances:
|
1071
1172
|
"""
|
1072
1173
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
1073
|
-
|
1174
|
+
|
1175
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-balances
|
1176
|
+
|
1074
1177
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1075
1178
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
1076
1179
|
"""
|
@@ -1092,7 +1195,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1092
1195
|
# "net_liquidation_value_usd": "string"
|
1093
1196
|
# }
|
1094
1197
|
#
|
1095
|
-
result = {
|
1198
|
+
result: dict = {
|
1096
1199
|
'info': response,
|
1097
1200
|
'timestamp': None,
|
1098
1201
|
'datetime': None,
|
@@ -1112,7 +1215,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1112
1215
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1113
1216
|
"""
|
1114
1217
|
fetch all trades made by the user
|
1115
|
-
|
1218
|
+
|
1219
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-fills
|
1220
|
+
|
1116
1221
|
:param str symbol: unified market symbol
|
1117
1222
|
:param int [since]: the earliest time in ms to fetch trades for
|
1118
1223
|
:param int [limit]: the maximum number of trades structures to retrieve(default 200, max 500)
|
@@ -1121,7 +1226,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1121
1226
|
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
1122
1227
|
"""
|
1123
1228
|
await self.load_markets()
|
1124
|
-
request = {}
|
1229
|
+
request: dict = {}
|
1125
1230
|
market = None
|
1126
1231
|
if symbol is not None:
|
1127
1232
|
market = self.market(symbol)
|
@@ -1130,9 +1235,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1130
1235
|
request['start_time'] = self.iso8601(since)
|
1131
1236
|
if limit is not None:
|
1132
1237
|
request['count'] = limit
|
1133
|
-
until = self.
|
1238
|
+
until = self.safe_integer(params, 'until')
|
1134
1239
|
if until is not None:
|
1135
|
-
params = self.omit(params, ['
|
1240
|
+
params = self.omit(params, ['until'])
|
1136
1241
|
request['end_time'] = self.iso8601(until)
|
1137
1242
|
response = await self.privateGetV1Fills(self.extend(request, params))
|
1138
1243
|
#
|
@@ -1163,13 +1268,15 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1163
1268
|
# ]
|
1164
1269
|
# }
|
1165
1270
|
#
|
1166
|
-
fills = self.
|
1271
|
+
fills = self.safe_list(response, 'fills', [])
|
1167
1272
|
return self.parse_trades(fills, market, since, limit)
|
1168
1273
|
|
1169
1274
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
1170
1275
|
"""
|
1171
1276
|
fetch all the trades made from a single order
|
1172
|
-
|
1277
|
+
|
1278
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-fills
|
1279
|
+
|
1173
1280
|
:param str id: order id
|
1174
1281
|
:param str symbol: unified market symbol
|
1175
1282
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -1177,7 +1284,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1177
1284
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1178
1285
|
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
1179
1286
|
"""
|
1180
|
-
request = {
|
1287
|
+
request: dict = {
|
1181
1288
|
'order_id': id,
|
1182
1289
|
}
|
1183
1290
|
return await self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
|
@@ -1185,7 +1292,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1185
1292
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1186
1293
|
"""
|
1187
1294
|
fetches information on multiple orders made by the user
|
1188
|
-
|
1295
|
+
|
1296
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
|
1297
|
+
|
1189
1298
|
:param str symbol: unified market symbol of the market orders were made in
|
1190
1299
|
:param int [since]: the earliest time in ms to fetch orders for
|
1191
1300
|
:param int [limit]: the maximum number of order structures to retrieve(default 200, max 500)
|
@@ -1198,7 +1307,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1198
1307
|
status = self.safe_string(params, 'status')
|
1199
1308
|
if status is None:
|
1200
1309
|
status = ['accepted', 'done', 'canceled', 'rejected', 'pending']
|
1201
|
-
request = {
|
1310
|
+
request: dict = {
|
1202
1311
|
'status': status,
|
1203
1312
|
}
|
1204
1313
|
market = None
|
@@ -1209,9 +1318,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1209
1318
|
request['start_time'] = self.iso8601(since)
|
1210
1319
|
if limit is not None:
|
1211
1320
|
request['count'] = limit
|
1212
|
-
until = self.
|
1321
|
+
until = self.safe_integer(params, 'until')
|
1213
1322
|
if until is not None:
|
1214
|
-
params = self.omit(params, ['
|
1323
|
+
params = self.omit(params, ['until'])
|
1215
1324
|
request['end_time'] = self.iso8601(until)
|
1216
1325
|
response = await self.privateGetV1Orders(self.extend(request, params))
|
1217
1326
|
#
|
@@ -1240,20 +1349,22 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1240
1349
|
# ]
|
1241
1350
|
# }
|
1242
1351
|
#
|
1243
|
-
orders = self.
|
1352
|
+
orders = self.safe_list(response, 'orders', [])
|
1244
1353
|
return self.parse_orders(orders, market, since, limit)
|
1245
1354
|
|
1246
1355
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1247
1356
|
"""
|
1248
1357
|
fetches information on an order made by the user
|
1249
|
-
|
1358
|
+
|
1359
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#get-specific-order-by-id
|
1360
|
+
|
1250
1361
|
:param int|str id: order id
|
1251
1362
|
:param str symbol: not used by coinlist fetchOrder()
|
1252
1363
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1253
1364
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1254
1365
|
"""
|
1255
1366
|
await self.load_markets()
|
1256
|
-
request = {
|
1367
|
+
request: dict = {
|
1257
1368
|
'order_id': id,
|
1258
1369
|
}
|
1259
1370
|
response = await self.privateGetV1OrdersOrderId(self.extend(request, params))
|
@@ -1286,7 +1397,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1286
1397
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1287
1398
|
"""
|
1288
1399
|
fetch all unfilled currently open orders
|
1289
|
-
|
1400
|
+
|
1401
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
|
1402
|
+
|
1290
1403
|
:param str symbol: unified market symbol
|
1291
1404
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1292
1405
|
:param int [limit]: the maximum number of open order structures to retrieve(default 200, max 500)
|
@@ -1295,7 +1408,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1295
1408
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1296
1409
|
"""
|
1297
1410
|
await self.load_markets()
|
1298
|
-
request = {
|
1411
|
+
request: dict = {
|
1299
1412
|
'status': 'accepted',
|
1300
1413
|
}
|
1301
1414
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -1303,7 +1416,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1303
1416
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1304
1417
|
"""
|
1305
1418
|
fetches information on multiple closed orders made by the user
|
1306
|
-
|
1419
|
+
|
1420
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
|
1421
|
+
|
1307
1422
|
:param str symbol: unified market symbol of the market orders were made in
|
1308
1423
|
:param int [since]: the earliest time in ms to fetch orders for
|
1309
1424
|
:param int [limit]: the maximum number of closed order structures to retrieve(default 200, max 500)
|
@@ -1312,7 +1427,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1312
1427
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1313
1428
|
"""
|
1314
1429
|
await self.load_markets()
|
1315
|
-
request = {
|
1430
|
+
request: dict = {
|
1316
1431
|
'status': 'done',
|
1317
1432
|
}
|
1318
1433
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -1320,7 +1435,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1320
1435
|
async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1321
1436
|
"""
|
1322
1437
|
fetches information on multiple canceled orders made by the user
|
1323
|
-
|
1438
|
+
|
1439
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
|
1440
|
+
|
1324
1441
|
:param str symbol: unified market symbol of the market orders were made in
|
1325
1442
|
:param int [since]: the earliest time in ms to fetch orders for
|
1326
1443
|
:param int [limit]: the maximum number of canceled order structures to retrieve(default 200, max 500)
|
@@ -1329,7 +1446,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1329
1446
|
:returns dict: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1330
1447
|
"""
|
1331
1448
|
await self.load_markets()
|
1332
|
-
request = {
|
1449
|
+
request: dict = {
|
1333
1450
|
'status': 'canceled',
|
1334
1451
|
}
|
1335
1452
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -1337,14 +1454,16 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1337
1454
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
1338
1455
|
"""
|
1339
1456
|
cancel open orders of market
|
1340
|
-
|
1457
|
+
|
1458
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#cancel-all-orders
|
1459
|
+
|
1341
1460
|
:param str symbol: unified market symbol
|
1342
1461
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1343
1462
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1344
1463
|
"""
|
1345
1464
|
await self.load_markets()
|
1346
1465
|
market = None
|
1347
|
-
request = {}
|
1466
|
+
request: dict = {}
|
1348
1467
|
if symbol is not None:
|
1349
1468
|
market = self.market(symbol)
|
1350
1469
|
request['symbol'] = market['id']
|
@@ -1361,14 +1480,16 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1361
1480
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1362
1481
|
"""
|
1363
1482
|
cancels an open order
|
1364
|
-
|
1483
|
+
|
1484
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#cancel-specific-order-by-id
|
1485
|
+
|
1365
1486
|
:param str id: order id
|
1366
1487
|
:param str symbol: not used by coinlist cancelOrder()
|
1367
1488
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1368
1489
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1369
1490
|
"""
|
1370
1491
|
await self.load_markets()
|
1371
|
-
request = {
|
1492
|
+
request: dict = {
|
1372
1493
|
'order_id': id,
|
1373
1494
|
}
|
1374
1495
|
response = await self.privateDeleteV1OrdersOrderId(self.extend(request, params))
|
@@ -1384,7 +1505,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1384
1505
|
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
1385
1506
|
"""
|
1386
1507
|
cancel multiple orders
|
1387
|
-
|
1508
|
+
|
1509
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#cancel-specific-orders
|
1510
|
+
|
1388
1511
|
:param str[] ids: order ids
|
1389
1512
|
:param str symbol: not used by coinlist cancelOrders()
|
1390
1513
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1393,17 +1516,37 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1393
1516
|
await self.load_markets()
|
1394
1517
|
params = ids
|
1395
1518
|
response = await self.privateDeleteV1OrdersBulk(params)
|
1396
|
-
|
1519
|
+
#
|
1520
|
+
# {
|
1521
|
+
# "message": "Cancel order requests received.",
|
1522
|
+
# "order_ids": [
|
1523
|
+
# "ff132955-43bc-4fe5-9d9c-5ba226cc89a0"
|
1524
|
+
# ],
|
1525
|
+
# "timestamp": "2024-06-01T02:32:30.305Z"
|
1526
|
+
# }
|
1527
|
+
#
|
1528
|
+
orderIds = self.safe_list(response, 'order_ids', [])
|
1529
|
+
orders = []
|
1530
|
+
datetime = self.safe_string(response, 'timestamp')
|
1531
|
+
for i in range(0, len(orderIds)):
|
1532
|
+
orders.append(self.safe_order({
|
1533
|
+
'info': orderIds[i],
|
1534
|
+
'id': orderIds[i],
|
1535
|
+
'lastUpdateTimestamp': self.parse8601(datetime),
|
1536
|
+
}))
|
1537
|
+
return orders
|
1397
1538
|
|
1398
1539
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1399
1540
|
"""
|
1400
1541
|
create a trade order
|
1401
|
-
|
1542
|
+
|
1543
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#create-new-order
|
1544
|
+
|
1402
1545
|
:param str symbol: unified symbol of the market to create an order in
|
1403
1546
|
:param str type: 'market' or 'limit' or 'stop_market' or 'stop_limit' or 'take_market' or 'take_limit'
|
1404
1547
|
:param str side: 'buy' or 'sell'
|
1405
1548
|
:param float amount: how much of currency you want to trade in units of base currency
|
1406
|
-
:param float [price]: the price at which the order is to be
|
1549
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1407
1550
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1408
1551
|
:param bool [params.postOnly]: if True, the order will only be posted to the order book and not executed immediately(default False)
|
1409
1552
|
:param float [params.triggerPrice]: only for the 'stop_market', 'stop_limit', 'take_market' or 'take_limit' orders(the price at which an order is triggered)
|
@@ -1412,7 +1555,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1412
1555
|
"""
|
1413
1556
|
await self.load_markets()
|
1414
1557
|
market = self.market(symbol)
|
1415
|
-
request = {
|
1558
|
+
request: dict = {
|
1416
1559
|
'symbol': market['id'],
|
1417
1560
|
'type': type,
|
1418
1561
|
'side': side,
|
@@ -1438,7 +1581,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1438
1581
|
elif type == 'limit':
|
1439
1582
|
request['type'] = 'stop_limit'
|
1440
1583
|
elif (type == 'stop_market') or (type == 'stop_limit') or (type == 'take_market') or (type == 'take_limit'):
|
1441
|
-
raise ArgumentsRequired(self.id + ' createOrder() requires a
|
1584
|
+
raise ArgumentsRequired(self.id + ' createOrder() requires a triggerPrice parameter for stop-loss and take-profit orders')
|
1442
1585
|
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'client_id')
|
1443
1586
|
if clientOrderId is not None:
|
1444
1587
|
request['client_id'] = clientOrderId
|
@@ -1458,18 +1601,21 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1458
1601
|
# "timestamp": "2023-10-26T11:30:55.376Z"
|
1459
1602
|
# }
|
1460
1603
|
#
|
1461
|
-
order = self.
|
1604
|
+
order = self.safe_dict(response, 'order', {})
|
1462
1605
|
return self.parse_order(order, market)
|
1463
1606
|
|
1464
1607
|
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
1465
1608
|
"""
|
1466
1609
|
create a trade order
|
1467
|
-
|
1610
|
+
|
1611
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#modify-existing-order
|
1612
|
+
|
1613
|
+
:param str id: order id
|
1468
1614
|
:param str symbol: unified symbol of the market to create an order in
|
1469
1615
|
:param str type: 'market' or 'limit' or 'stop_market' or 'stop_limit' or 'take_market' or 'take_limit'
|
1470
1616
|
:param str side: 'buy' or 'sell'
|
1471
1617
|
:param float amount: how much of currency you want to trade in units of base currency
|
1472
|
-
:param float [price]: the price at which the order is to be
|
1618
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1473
1619
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1474
1620
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1475
1621
|
"""
|
@@ -1477,7 +1623,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1477
1623
|
if amount is None:
|
1478
1624
|
raise ArgumentsRequired(self.id + ' editOrder() requires an amount argument')
|
1479
1625
|
market = self.market(symbol)
|
1480
|
-
request = {
|
1626
|
+
request: dict = {
|
1481
1627
|
'order_id': id,
|
1482
1628
|
'type': type,
|
1483
1629
|
'side': side,
|
@@ -1488,7 +1634,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1488
1634
|
response = await self.privatePatchV1OrdersOrderId(self.extend(request, params))
|
1489
1635
|
return self.parse_order(response, market)
|
1490
1636
|
|
1491
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1637
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1492
1638
|
#
|
1493
1639
|
# fetchOrder
|
1494
1640
|
# {
|
@@ -1574,7 +1720,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1574
1720
|
type = self.parse_order_type(self.safe_string(order, 'type'))
|
1575
1721
|
side = self.safe_string(order, 'side')
|
1576
1722
|
price = self.safe_string(order, 'price')
|
1577
|
-
|
1723
|
+
triggerPrice = self.safe_string(order, 'stop_price')
|
1578
1724
|
average = self.safe_string(order, 'average_fill_price') # from documentation
|
1579
1725
|
amount = self.safe_string(order, 'size')
|
1580
1726
|
filled = self.safe_string(order, 'size_filled')
|
@@ -1599,8 +1745,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1599
1745
|
'timeInForce': 'GTC',
|
1600
1746
|
'side': side,
|
1601
1747
|
'price': price,
|
1602
|
-
'
|
1603
|
-
'triggerPrice': stopPrice,
|
1748
|
+
'triggerPrice': triggerPrice,
|
1604
1749
|
'average': average,
|
1605
1750
|
'amount': amount,
|
1606
1751
|
'cost': None,
|
@@ -1612,8 +1757,8 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1612
1757
|
'postOnly': postOnly,
|
1613
1758
|
}, market)
|
1614
1759
|
|
1615
|
-
def parse_order_status(self, status):
|
1616
|
-
statuses = {
|
1760
|
+
def parse_order_status(self, status: Str):
|
1761
|
+
statuses: dict = {
|
1617
1762
|
'pending': 'open',
|
1618
1763
|
'accepted': 'open',
|
1619
1764
|
'rejected': 'rejected',
|
@@ -1623,7 +1768,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1623
1768
|
return self.safe_string(statuses, status, status)
|
1624
1769
|
|
1625
1770
|
def parse_order_type(self, status):
|
1626
|
-
statuses = {
|
1771
|
+
statuses: dict = {
|
1627
1772
|
'market': 'market',
|
1628
1773
|
'limit': 'limit',
|
1629
1774
|
'stop_market': 'market',
|
@@ -1636,9 +1781,11 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1636
1781
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1637
1782
|
"""
|
1638
1783
|
transfer currency internally between wallets on the same account
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1784
|
+
|
1785
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#transfer-funds-between-entities
|
1786
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#transfer-funds-from-wallet-to-pro
|
1787
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#transfer-funds-from-pro-to-wallet
|
1788
|
+
|
1642
1789
|
:param str code: unified currency code
|
1643
1790
|
:param float amount: amount to transfer
|
1644
1791
|
:param str fromAccount: account to transfer from
|
@@ -1648,10 +1795,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1648
1795
|
"""
|
1649
1796
|
await self.load_markets()
|
1650
1797
|
currency = self.currency(code)
|
1651
|
-
|
1652
|
-
request = {
|
1798
|
+
request: dict = {
|
1653
1799
|
'asset': currency['id'],
|
1654
|
-
'amount': amount,
|
1800
|
+
'amount': self.currency_to_precision(code, amount),
|
1655
1801
|
}
|
1656
1802
|
accountsByType = self.safe_value(self.options, 'accountsByType', {})
|
1657
1803
|
fromAcc = self.safe_string(accountsByType, fromAccount, fromAccount)
|
@@ -1682,10 +1828,12 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1682
1828
|
transfer = self.parse_transfer(response, currency)
|
1683
1829
|
return transfer
|
1684
1830
|
|
1685
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
1831
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
1686
1832
|
"""
|
1687
1833
|
fetch a history of internal transfers between CoinList.co and CoinList Pro. It does not return external deposits or withdrawals
|
1688
|
-
|
1834
|
+
|
1835
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#list-transfers
|
1836
|
+
|
1689
1837
|
:param str code: unified currency code
|
1690
1838
|
:param int [since]: the earliest time in ms to fetch transfers for
|
1691
1839
|
:param int [limit]: the maximum number of transfer structures to retrieve(default 200, max 500)
|
@@ -1697,14 +1845,14 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1697
1845
|
currency = None
|
1698
1846
|
if code is not None:
|
1699
1847
|
currency = self.currency(code)
|
1700
|
-
request = {}
|
1848
|
+
request: dict = {}
|
1701
1849
|
if since is not None:
|
1702
1850
|
request['start_time'] = self.iso8601(since)
|
1703
1851
|
if limit is not None:
|
1704
1852
|
request['count'] = limit
|
1705
|
-
until = self.
|
1853
|
+
until = self.safe_integer(params, 'until')
|
1706
1854
|
if until is not None:
|
1707
|
-
params = self.omit(params, ['
|
1855
|
+
params = self.omit(params, ['until'])
|
1708
1856
|
request['end_time'] = self.iso8601(until)
|
1709
1857
|
response = await self.privateGetV1Transfers(self.extend(request, params))
|
1710
1858
|
#
|
@@ -1729,10 +1877,10 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1729
1877
|
# ]
|
1730
1878
|
# }
|
1731
1879
|
#
|
1732
|
-
transfers = self.
|
1880
|
+
transfers = self.safe_list(response, 'transfers', [])
|
1733
1881
|
return self.parse_transfers(transfers, currency, since, limit)
|
1734
1882
|
|
1735
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
1883
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
1736
1884
|
#
|
1737
1885
|
# fetchTransfers
|
1738
1886
|
# {
|
@@ -1787,8 +1935,8 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1787
1935
|
'status': self.parse_transfer_status(status),
|
1788
1936
|
}
|
1789
1937
|
|
1790
|
-
def parse_transfer_status(self, status):
|
1791
|
-
statuses = {
|
1938
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
1939
|
+
statuses: dict = {
|
1792
1940
|
'confirmed': 'ok',
|
1793
1941
|
}
|
1794
1942
|
return self.safe_string(statuses, status, status)
|
@@ -1796,7 +1944,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1796
1944
|
async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1797
1945
|
"""
|
1798
1946
|
fetch history of deposits and withdrawals from external wallets and between CoinList Pro trading account and CoinList wallet
|
1799
|
-
|
1947
|
+
|
1948
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#get-coinlist-wallet-ledger
|
1949
|
+
|
1800
1950
|
:param str [code]: unified currency code for the currency of the deposit/withdrawals
|
1801
1951
|
:param int [since]: timestamp in ms of the earliest deposit/withdrawal
|
1802
1952
|
:param int [limit]: max number of deposit/withdrawals to return(default 200, max 500)
|
@@ -1810,7 +1960,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1810
1960
|
raise ArgumentsRequired(self.id + ' fetchDepositsWithdrawals() requires a traderId argument in the params')
|
1811
1961
|
await self.load_markets()
|
1812
1962
|
currency = self.currency(code)
|
1813
|
-
request = {
|
1963
|
+
request: dict = {
|
1814
1964
|
'asset': currency['id'],
|
1815
1965
|
'trader_id': traderId,
|
1816
1966
|
}
|
@@ -1865,10 +2015,12 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1865
2015
|
# coinlist returns both internal transfers and blockchain transactions
|
1866
2016
|
return self.parse_transactions(response, currency, since, limit)
|
1867
2017
|
|
1868
|
-
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2018
|
+
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1869
2019
|
"""
|
1870
2020
|
request a withdrawal from CoinList wallet.(Disabled by default. Contact CoinList to apply for an exception.)
|
1871
|
-
|
2021
|
+
|
2022
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#request-withdrawal-from-wallet
|
2023
|
+
|
1872
2024
|
:param str code: unified currency code
|
1873
2025
|
:param float amount: the amount to withdraw
|
1874
2026
|
:param str address: the address to withdraw to
|
@@ -1878,7 +2030,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1878
2030
|
"""
|
1879
2031
|
await self.load_markets()
|
1880
2032
|
currency = self.currency(code)
|
1881
|
-
request = {
|
2033
|
+
request: dict = {
|
1882
2034
|
'asset': currency['id'],
|
1883
2035
|
'amount': self.currency_to_precision(code, amount),
|
1884
2036
|
'destination_address': address,
|
@@ -1889,10 +2041,10 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1889
2041
|
# "transfer_id": "d4a2d8dd-7def-4545-a062-761683b9aa05"
|
1890
2042
|
# }
|
1891
2043
|
#
|
1892
|
-
data = self.
|
2044
|
+
data = self.safe_dict(response, 'data', {})
|
1893
2045
|
return self.parse_transaction(data, currency)
|
1894
2046
|
|
1895
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
2047
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1896
2048
|
# withdraw
|
1897
2049
|
#
|
1898
2050
|
# {
|
@@ -1952,29 +2104,31 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1952
2104
|
}
|
1953
2105
|
|
1954
2106
|
def parse_transaction_type(self, type):
|
1955
|
-
types = {
|
2107
|
+
types: dict = {
|
1956
2108
|
'CRYPTO_DEPOSIT': 'deposit',
|
1957
2109
|
'CRYPTO_WITHDRAWAL': 'withdrawal',
|
1958
2110
|
'PRO_TRANSFER': 'transfer',
|
1959
2111
|
}
|
1960
2112
|
return self.safe_string(types, type, type)
|
1961
2113
|
|
1962
|
-
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2114
|
+
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
1963
2115
|
"""
|
1964
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
1965
|
-
|
1966
|
-
|
2116
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
2117
|
+
|
2118
|
+
https://trade-docs.coinlist.co/?javascript--nodejs#get-account-history
|
2119
|
+
|
2120
|
+
:param str [code]: unified currency code, default is None
|
1967
2121
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
1968
|
-
:param int [limit]: max number of ledger
|
2122
|
+
:param int [limit]: max number of ledger entries to return(default 200, max 500)
|
1969
2123
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1970
2124
|
:param int [params.until]: the latest time in ms to fetch entries for
|
1971
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2125
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1972
2126
|
"""
|
1973
2127
|
traderId = self.safe_string_2(params, 'trader_id', 'traderId')
|
1974
2128
|
if traderId is None:
|
1975
2129
|
raise ArgumentsRequired(self.id + ' fetchLedger() requires a traderId argument in the params')
|
1976
2130
|
await self.load_markets()
|
1977
|
-
request = {
|
2131
|
+
request: dict = {
|
1978
2132
|
'trader_id': traderId,
|
1979
2133
|
}
|
1980
2134
|
currency = None
|
@@ -1984,9 +2138,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1984
2138
|
request['start_time'] = self.iso8601(since)
|
1985
2139
|
if limit is not None:
|
1986
2140
|
request['count'] = limit
|
1987
|
-
until = self.
|
2141
|
+
until = self.safe_integer(params, 'until')
|
1988
2142
|
if until is not None:
|
1989
|
-
params = self.omit(params, ['
|
2143
|
+
params = self.omit(params, ['until'])
|
1990
2144
|
request['end_time'] = self.iso8601(until)
|
1991
2145
|
params = self.omit(params, ['trader_id', 'traderId'])
|
1992
2146
|
response = await self.privateGetV1AccountsTraderIdLedger(self.extend(request, params))
|
@@ -2058,7 +2212,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
2058
2212
|
ledger = self.safe_value(response, 'transactions', [])
|
2059
2213
|
return self.parse_ledger(ledger, currency, since, limit)
|
2060
2214
|
|
2061
|
-
def parse_ledger_entry(self, item, currency: Currency = None):
|
2215
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
2062
2216
|
#
|
2063
2217
|
# deposit transaction from wallet(funding) to pro(trading)
|
2064
2218
|
# {
|
@@ -2142,8 +2296,9 @@ class coinlist(Exchange, ImplicitAPI):
|
|
2142
2296
|
direction = 'in'
|
2143
2297
|
currencyId = self.safe_string(item, 'asset')
|
2144
2298
|
code = self.safe_currency_code(currencyId, currency)
|
2299
|
+
currency = self.safe_currency(currencyId, currency)
|
2145
2300
|
type = self.parse_ledger_entry_type(self.safe_string(item, 'type'))
|
2146
|
-
return {
|
2301
|
+
return self.safe_ledger_entry({
|
2147
2302
|
'info': item,
|
2148
2303
|
'id': id,
|
2149
2304
|
'timestamp': timestamp,
|
@@ -2159,10 +2314,10 @@ class coinlist(Exchange, ImplicitAPI):
|
|
2159
2314
|
'after': None,
|
2160
2315
|
'status': 'ok',
|
2161
2316
|
'fee': None,
|
2162
|
-
}
|
2317
|
+
}, currency)
|
2163
2318
|
|
2164
2319
|
def parse_ledger_entry_type(self, type):
|
2165
|
-
types = {
|
2320
|
+
types: dict = {
|
2166
2321
|
'atomic token swap': 'trade',
|
2167
2322
|
'fee': 'fee',
|
2168
2323
|
'deposit': 'transfer',
|
@@ -2174,16 +2329,18 @@ class coinlist(Exchange, ImplicitAPI):
|
|
2174
2329
|
request = self.omit(params, self.extract_params(path))
|
2175
2330
|
endpoint = '/' + self.implode_params(path, params)
|
2176
2331
|
url = self.urls['api'][api] + endpoint
|
2177
|
-
|
2332
|
+
isBulk = isinstance(params, list)
|
2333
|
+
query: Str = None
|
2334
|
+
if not isBulk:
|
2335
|
+
query = self.urlencode(request)
|
2178
2336
|
if api == 'private':
|
2179
2337
|
self.check_required_credentials()
|
2180
2338
|
timestamp = str(self.seconds())
|
2181
2339
|
auth = timestamp + method + endpoint
|
2182
|
-
isBulk = isinstance(params, list)
|
2183
2340
|
if (method == 'POST') or (method == 'PATCH') or isBulk:
|
2184
2341
|
body = self.json(request)
|
2185
2342
|
auth += body
|
2186
|
-
elif len(query) != 0:
|
2343
|
+
elif query is not None and len(query) != 0:
|
2187
2344
|
auth += '?' + query
|
2188
2345
|
url += '?' + query
|
2189
2346
|
signature = self.hmac(self.encode(auth), self.base64_to_binary(self.secret), hashlib.sha256, 'base64')
|
@@ -2193,11 +2350,11 @@ class coinlist(Exchange, ImplicitAPI):
|
|
2193
2350
|
'CL-ACCESS-TIMESTAMP': timestamp,
|
2194
2351
|
'Content-Type': 'application/json',
|
2195
2352
|
}
|
2196
|
-
elif len(query) != 0:
|
2353
|
+
elif query is not None and len(query) != 0:
|
2197
2354
|
url += '?' + query
|
2198
2355
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
2199
2356
|
|
2200
|
-
def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
2357
|
+
def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
|
2201
2358
|
if response is None:
|
2202
2359
|
# In some cases the exchange returns 202 Accepted for bad orders.
|
2203
2360
|
# The body of that response contains order_id of the order.
|