ccxt 4.2.76__py2.py3-none-any.whl → 4.4.48__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +25 -0
- ccxt/abstract/kucoinfutures.py +35 -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 +3513 -1511
- 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 +3105 -881
- 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 +239 -50
- ccxt/async_support/bitget.py +1513 -563
- ccxt/async_support/bithumb.py +201 -67
- 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 +403 -150
- 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 +2326 -1255
- ccxt/async_support/cex.py +1409 -1329
- ccxt/async_support/coinbase.py +1455 -288
- 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 +206 -89
- 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 +467 -158
- ccxt/async_support/deribit.py +558 -324
- ccxt/async_support/digifinex.py +340 -223
- ccxt/async_support/ellipx.py +1826 -0
- ccxt/async_support/exmo.py +259 -128
- ccxt/async_support/gate.py +1473 -464
- ccxt/async_support/gemini.py +206 -84
- ccxt/async_support/hashkey.py +4164 -0
- ccxt/async_support/hitbtc.py +334 -178
- ccxt/async_support/hollaex.py +134 -83
- ccxt/async_support/htx.py +1095 -563
- ccxt/async_support/huobijp.py +105 -56
- ccxt/async_support/hyperliquid.py +1634 -269
- ccxt/async_support/idex.py +148 -95
- ccxt/async_support/independentreserve.py +236 -31
- ccxt/async_support/indodax.py +165 -62
- ccxt/async_support/kraken.py +871 -354
- ccxt/async_support/krakenfutures.py +324 -100
- ccxt/async_support/kucoin.py +1050 -355
- ccxt/async_support/kucoinfutures.py +1004 -149
- ccxt/async_support/kuna.py +138 -106
- ccxt/async_support/latoken.py +135 -79
- ccxt/async_support/lbank.py +290 -113
- ccxt/async_support/luno.py +112 -62
- ccxt/async_support/lykke.py +104 -55
- ccxt/async_support/mercado.py +36 -29
- ccxt/async_support/mexc.py +995 -429
- ccxt/async_support/myokx.py +43 -0
- ccxt/async_support/ndax.py +163 -82
- ccxt/async_support/novadax.py +121 -75
- ccxt/async_support/oceanex.py +175 -59
- ccxt/async_support/okcoin.py +222 -163
- ccxt/async_support/okx.py +1777 -455
- ccxt/async_support/onetrading.py +132 -414
- ccxt/async_support/oxfun.py +2832 -0
- ccxt/async_support/p2b.py +79 -51
- ccxt/async_support/paradex.py +2017 -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 +1155 -295
- 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 +1729 -482
- 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 +3513 -1511
- ccxt/binancecoinm.py +2 -1
- ccxt/binanceus.py +12 -1
- ccxt/binanceusdm.py +3 -1
- ccxt/bingx.py +3105 -881
- 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 +239 -50
- ccxt/bitget.py +1513 -563
- ccxt/bithumb.py +200 -67
- 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 +403 -150
- ccxt/btcalpha.py +161 -55
- ccxt/btcbox.py +250 -34
- ccxt/btcmarkets.py +232 -85
- ccxt/btcturk.py +159 -60
- ccxt/bybit.py +2326 -1255
- ccxt/cex.py +1408 -1329
- ccxt/coinbase.py +1455 -288
- 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 +206 -89
- ccxt/coinspot.py +137 -62
- ccxt/cryptocom.py +515 -185
- ccxt/currencycom.py +203 -85
- ccxt/defx.py +2065 -0
- ccxt/delta.py +467 -158
- ccxt/deribit.py +558 -324
- ccxt/digifinex.py +340 -223
- ccxt/ellipx.py +1826 -0
- ccxt/exmo.py +259 -128
- ccxt/gate.py +1473 -464
- ccxt/gemini.py +206 -84
- ccxt/hashkey.py +4164 -0
- ccxt/hitbtc.py +334 -178
- ccxt/hollaex.py +134 -83
- ccxt/htx.py +1095 -563
- ccxt/huobijp.py +105 -56
- ccxt/hyperliquid.py +1633 -269
- ccxt/idex.py +148 -95
- ccxt/independentreserve.py +235 -31
- ccxt/indodax.py +165 -62
- ccxt/kraken.py +871 -354
- ccxt/krakenfutures.py +324 -100
- ccxt/kucoin.py +1050 -355
- ccxt/kucoinfutures.py +1004 -149
- ccxt/kuna.py +138 -106
- ccxt/latoken.py +135 -79
- ccxt/lbank.py +290 -113
- ccxt/luno.py +112 -62
- ccxt/lykke.py +104 -55
- ccxt/mercado.py +36 -29
- ccxt/mexc.py +994 -429
- ccxt/myokx.py +43 -0
- ccxt/ndax.py +163 -82
- ccxt/novadax.py +121 -75
- ccxt/oceanex.py +175 -59
- ccxt/okcoin.py +222 -163
- ccxt/okx.py +1777 -455
- ccxt/onetrading.py +132 -414
- ccxt/oxfun.py +2831 -0
- ccxt/p2b.py +79 -51
- ccxt/paradex.py +2017 -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 +63 -15
- 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 +138 -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 +204 -82
- 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 +967 -661
- 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 +168 -32
- ccxt/pro/exmo.py +253 -21
- 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 +93 -34
- ccxt/pro/poloniex.py +129 -50
- ccxt/pro/poloniexfutures.py +53 -32
- ccxt/pro/probit.py +93 -86
- 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 +486 -70
- 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} +465 -407
- ccxt/test/tests_helpers.py +285 -0
- ccxt/test/tests_init.py +39 -0
- ccxt/test/{test_sync.py → tests_sync.py} +465 -409
- 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 +1155 -295
- 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.48.dist-info/LICENSE.txt +21 -0
- ccxt-4.4.48.dist-info/METADATA +646 -0
- ccxt-4.4.48.dist-info/RECORD +669 -0
- {ccxt-4.2.76.dist-info → ccxt-4.4.48.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.76.dist-info/METADATA +0 -626
- ccxt-4.2.76.dist-info/RECORD +0 -534
- {ccxt-4.2.76.dist-info → ccxt-4.4.48.dist-info}/top_level.txt +0 -0
ccxt/lbank.py
CHANGED
@@ -6,9 +6,10 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.lbank import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
+
from ccxt.base.errors import AuthenticationError
|
12
13
|
from ccxt.base.errors import PermissionDenied
|
13
14
|
from ccxt.base.errors import ArgumentsRequired
|
14
15
|
from ccxt.base.errors import BadRequest
|
@@ -20,7 +21,6 @@ from ccxt.base.errors import DuplicateOrderId
|
|
20
21
|
from ccxt.base.errors import NotSupported
|
21
22
|
from ccxt.base.errors import RateLimitExceeded
|
22
23
|
from ccxt.base.errors import InvalidNonce
|
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
|
|
@@ -62,12 +62,14 @@ class lbank(Exchange, ImplicitAPI):
|
|
62
62
|
'fetchCrossBorrowRate': False,
|
63
63
|
'fetchCrossBorrowRates': False,
|
64
64
|
'fetchDepositAddress': True,
|
65
|
+
'fetchDepositAddresses': False,
|
66
|
+
'fetchDepositAddressesByNetwork': False,
|
65
67
|
'fetchDepositWithdrawFee': 'emulated',
|
66
68
|
'fetchDepositWithdrawFees': True,
|
67
69
|
'fetchFundingHistory': False,
|
68
70
|
'fetchFundingRate': False,
|
69
71
|
'fetchFundingRateHistory': False,
|
70
|
-
'fetchFundingRates':
|
72
|
+
'fetchFundingRates': True,
|
71
73
|
'fetchIndexOHLCV': False,
|
72
74
|
'fetchIsolatedBorrowRate': False,
|
73
75
|
'fetchIsolatedBorrowRates': False,
|
@@ -219,6 +221,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
219
221
|
},
|
220
222
|
},
|
221
223
|
'commonCurrencies': {
|
224
|
+
'HIT': 'Hiver',
|
222
225
|
'VET_ERC20': 'VEN',
|
223
226
|
'PNT': 'Penta',
|
224
227
|
},
|
@@ -310,8 +313,10 @@ class lbank(Exchange, ImplicitAPI):
|
|
310
313
|
def fetch_time(self, params={}):
|
311
314
|
"""
|
312
315
|
fetches the current integer timestamp in milliseconds from the exchange server
|
313
|
-
|
314
|
-
|
316
|
+
|
317
|
+
https://www.lbank.com/en-US/docs/index.html#get-timestamp
|
318
|
+
https://www.lbank.com/en-US/docs/contract.html#get-the-current-time
|
319
|
+
|
315
320
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
316
321
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
317
322
|
"""
|
@@ -344,11 +349,13 @@ class lbank(Exchange, ImplicitAPI):
|
|
344
349
|
#
|
345
350
|
return self.safe_integer(response, 'data')
|
346
351
|
|
347
|
-
def fetch_markets(self, params={}):
|
352
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
348
353
|
"""
|
349
354
|
retrieves data on all markets for lbank
|
350
|
-
|
351
|
-
|
355
|
+
|
356
|
+
https://www.lbank.com/en-US/docs/index.html#trading-pairs
|
357
|
+
https://www.lbank.com/en-US/docs/contract.html#query-contract-information-list
|
358
|
+
|
352
359
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
353
360
|
:returns dict[]: an array of objects representing market data
|
354
361
|
"""
|
@@ -439,7 +446,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
439
446
|
return result
|
440
447
|
|
441
448
|
def fetch_swap_markets(self, params={}):
|
442
|
-
request = {
|
449
|
+
request: dict = {
|
443
450
|
'productGroup': 'SwapU',
|
444
451
|
}
|
445
452
|
response = self.contractPublicGetCfdOpenApiV1PubInstrument(self.extend(request, params))
|
@@ -534,7 +541,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
534
541
|
})
|
535
542
|
return result
|
536
543
|
|
537
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
544
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
538
545
|
#
|
539
546
|
# spot: fetchTicker, fetchTickers
|
540
547
|
#
|
@@ -597,7 +604,9 @@ class lbank(Exchange, ImplicitAPI):
|
|
597
604
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
598
605
|
"""
|
599
606
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
600
|
-
|
607
|
+
|
608
|
+
https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
|
609
|
+
|
601
610
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
602
611
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
603
612
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -607,7 +616,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
607
616
|
if market['swap']:
|
608
617
|
responseForSwap = self.fetch_tickers([market['symbol']], params)
|
609
618
|
return self.safe_value(responseForSwap, market['symbol'])
|
610
|
-
request = {
|
619
|
+
request: dict = {
|
611
620
|
'symbol': market['id'],
|
612
621
|
}
|
613
622
|
response = self.spotPublicGetTicker24hr(self.extend(request, params))
|
@@ -633,14 +642,16 @@ class lbank(Exchange, ImplicitAPI):
|
|
633
642
|
# }
|
634
643
|
#
|
635
644
|
data = self.safe_value(response, 'data', [])
|
636
|
-
first = self.
|
645
|
+
first = self.safe_dict(data, 0, {})
|
637
646
|
return self.parse_ticker(first, market)
|
638
647
|
|
639
648
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
640
649
|
"""
|
641
650
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
642
|
-
|
643
|
-
|
651
|
+
|
652
|
+
https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
|
653
|
+
https://www.lbank.com/en-US/docs/contract.html#query-contract-market-list
|
654
|
+
|
644
655
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
645
656
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
646
657
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -652,7 +663,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
652
663
|
symbolsLength = len(symbols)
|
653
664
|
if symbolsLength > 0:
|
654
665
|
market = self.market(symbols[0])
|
655
|
-
request = {}
|
666
|
+
request: dict = {}
|
656
667
|
type = None
|
657
668
|
type, params = self.handle_market_type_and_params('fetchTickers', market, params)
|
658
669
|
response = None
|
@@ -707,14 +718,16 @@ class lbank(Exchange, ImplicitAPI):
|
|
707
718
|
# "success": True
|
708
719
|
# }
|
709
720
|
#
|
710
|
-
data = self.
|
721
|
+
data = self.safe_list(response, 'data', [])
|
711
722
|
return self.parse_tickers(data, symbols)
|
712
723
|
|
713
724
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
714
725
|
"""
|
715
726
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
716
|
-
|
717
|
-
|
727
|
+
|
728
|
+
https://www.lbank.com/en-US/docs/index.html#query-market-depth
|
729
|
+
https://www.lbank.com/en-US/docs/contract.html#get-handicap
|
730
|
+
|
718
731
|
:param str symbol: unified symbol of the market to fetch the order book for
|
719
732
|
:param int [limit]: the maximum amount of order book entries to return
|
720
733
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -724,7 +737,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
724
737
|
market = self.market(symbol)
|
725
738
|
if limit is None:
|
726
739
|
limit = 60
|
727
|
-
request = {
|
740
|
+
request: dict = {
|
728
741
|
'symbol': market['id'],
|
729
742
|
}
|
730
743
|
type = None
|
@@ -790,7 +803,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
790
803
|
return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks', 'price', 'volume')
|
791
804
|
return self.parse_order_book(orderbook, market['symbol'], timestamp)
|
792
805
|
|
793
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
806
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
794
807
|
#
|
795
808
|
# fetchTrades(old) spotPublicGetTrades
|
796
809
|
#
|
@@ -886,8 +899,10 @@ class lbank(Exchange, ImplicitAPI):
|
|
886
899
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
887
900
|
"""
|
888
901
|
get the list of most recent trades for a particular symbol
|
889
|
-
|
890
|
-
|
902
|
+
|
903
|
+
https://www.lbank.com/en-US/docs/index.html#query-historical-transactions
|
904
|
+
https://www.lbank.com/en-US/docs/index.html#recent-transactions-list
|
905
|
+
|
891
906
|
:param str symbol: unified symbol of the market to fetch trades for
|
892
907
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
893
908
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -896,7 +911,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
896
911
|
"""
|
897
912
|
self.load_markets()
|
898
913
|
market = self.market(symbol)
|
899
|
-
request = {
|
914
|
+
request: dict = {
|
900
915
|
'symbol': market['id'],
|
901
916
|
}
|
902
917
|
if since is not None:
|
@@ -930,7 +945,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
930
945
|
# "ts":1647021999308
|
931
946
|
# }
|
932
947
|
#
|
933
|
-
trades = self.
|
948
|
+
trades = self.safe_list(response, 'data', [])
|
934
949
|
return self.parse_trades(trades, market, since, limit)
|
935
950
|
|
936
951
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -956,7 +971,9 @@ class lbank(Exchange, ImplicitAPI):
|
|
956
971
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
957
972
|
"""
|
958
973
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
959
|
-
|
974
|
+
|
975
|
+
https://www.lbank.com/en-US/docs/index.html#query-k-bar-data
|
976
|
+
|
960
977
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
961
978
|
:param str timeframe: the length of time each candle represents
|
962
979
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -969,17 +986,19 @@ class lbank(Exchange, ImplicitAPI):
|
|
969
986
|
market = self.market(symbol)
|
970
987
|
if limit is None:
|
971
988
|
limit = 100
|
989
|
+
else:
|
990
|
+
limit = min(limit, 2000)
|
972
991
|
if since is None:
|
973
992
|
duration = self.parse_timeframe(timeframe)
|
974
|
-
since = self.milliseconds() - duration * 1000 * limit
|
975
|
-
request = {
|
993
|
+
since = self.milliseconds() - (duration * 1000 * limit)
|
994
|
+
request: dict = {
|
976
995
|
'symbol': market['id'],
|
977
996
|
'type': self.safe_string(self.timeframes, timeframe, timeframe),
|
978
997
|
'time': self.parse_to_int(since / 1000),
|
979
|
-
'size': limit, # max 2000
|
998
|
+
'size': min(limit + 1, 2000), # max 2000
|
980
999
|
}
|
981
1000
|
response = self.spotPublicGetKline(self.extend(request, params))
|
982
|
-
ohlcvs = self.
|
1001
|
+
ohlcvs = self.safe_list(response, 'data', [])
|
983
1002
|
#
|
984
1003
|
#
|
985
1004
|
# [
|
@@ -1082,7 +1101,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1082
1101
|
# ]
|
1083
1102
|
#
|
1084
1103
|
timestamp = self.safe_integer(response, 'ts')
|
1085
|
-
result = {
|
1104
|
+
result: dict = {
|
1086
1105
|
'info': response,
|
1087
1106
|
'timestamp': timestamp,
|
1088
1107
|
'datetime': self.iso8601(timestamp),
|
@@ -1128,12 +1147,117 @@ class lbank(Exchange, ImplicitAPI):
|
|
1128
1147
|
return self.safe_balance(result)
|
1129
1148
|
return None
|
1130
1149
|
|
1150
|
+
def parse_funding_rate(self, ticker, market: Market = None) -> FundingRate:
|
1151
|
+
# {
|
1152
|
+
# "symbol": "BTCUSDT",
|
1153
|
+
# "highestPrice": "69495.5",
|
1154
|
+
# "underlyingPrice": "68455.904",
|
1155
|
+
# "lowestPrice": "68182.1",
|
1156
|
+
# "openPrice": "68762.4",
|
1157
|
+
# "positionFeeRate": "0.0001",
|
1158
|
+
# "volume": "33534.2858",
|
1159
|
+
# "markedPrice": "68434.1",
|
1160
|
+
# "turnover": "1200636218.210558",
|
1161
|
+
# "positionFeeTime": "28800",
|
1162
|
+
# "lastPrice": "68427.3",
|
1163
|
+
# "nextFeeTime": "1730736000000",
|
1164
|
+
# "fundingRate": "0.0001",
|
1165
|
+
# }
|
1166
|
+
marketId = self.safe_string(ticker, 'symbol')
|
1167
|
+
symbol = self.safe_symbol(marketId, market)
|
1168
|
+
markPrice = self.safe_number(ticker, 'markedPrice')
|
1169
|
+
indexPrice = self.safe_number(ticker, 'underlyingPrice')
|
1170
|
+
fundingRate = self.safe_number(ticker, 'fundingRate')
|
1171
|
+
fundingTime = self.safe_integer(ticker, 'nextFeeTime')
|
1172
|
+
positionFeeTime = self.safe_integer(ticker, 'positionFeeTime')
|
1173
|
+
intervalString = None
|
1174
|
+
if positionFeeTime is not None:
|
1175
|
+
interval = self.parse_to_int(positionFeeTime / 60 / 60)
|
1176
|
+
intervalString = str(interval) + 'h'
|
1177
|
+
return {
|
1178
|
+
'info': ticker,
|
1179
|
+
'symbol': symbol,
|
1180
|
+
'markPrice': markPrice,
|
1181
|
+
'indexPrice': indexPrice,
|
1182
|
+
'fundingRate': fundingRate,
|
1183
|
+
'fundingTimestamp': fundingTime,
|
1184
|
+
'fundingDatetime': self.iso8601(fundingTime),
|
1185
|
+
'timestamp': None,
|
1186
|
+
'datetime': None,
|
1187
|
+
'nextFundingRate': None,
|
1188
|
+
'nextFundingTimestamp': None,
|
1189
|
+
'nextFundingDatetime': None,
|
1190
|
+
'previousFundingRate': None,
|
1191
|
+
'previousFundingTimestamp': None,
|
1192
|
+
'previousFundingDatetime': None,
|
1193
|
+
'interval': intervalString,
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
1197
|
+
"""
|
1198
|
+
fetch the current funding rate
|
1199
|
+
|
1200
|
+
https://www.lbank.com/en-US/docs/contract.html#query-contract-market-list
|
1201
|
+
|
1202
|
+
:param str symbol: unified market symbol
|
1203
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1204
|
+
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
1205
|
+
"""
|
1206
|
+
self.load_markets()
|
1207
|
+
market = self.market(symbol)
|
1208
|
+
responseForSwap = self.fetch_funding_rates([market['symbol']], params)
|
1209
|
+
return self.safe_value(responseForSwap, market['symbol'])
|
1210
|
+
|
1211
|
+
def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
1212
|
+
"""
|
1213
|
+
fetch the funding rate for multiple markets
|
1214
|
+
|
1215
|
+
https://www.lbank.com/en-US/docs/contract.html#query-contract-market-list
|
1216
|
+
|
1217
|
+
:param str[]|None symbols: list of unified market symbols
|
1218
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1219
|
+
:returns dict: a dictionary of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexed by market symbols
|
1220
|
+
"""
|
1221
|
+
self.load_markets()
|
1222
|
+
symbols = self.market_symbols(symbols)
|
1223
|
+
request: dict = {
|
1224
|
+
'productGroup': 'SwapU',
|
1225
|
+
}
|
1226
|
+
response = self.contractPublicGetCfdOpenApiV1PubMarketData(self.extend(request, params))
|
1227
|
+
# {
|
1228
|
+
# "data": [
|
1229
|
+
# {
|
1230
|
+
# "symbol": "BTCUSDT",
|
1231
|
+
# "highestPrice": "69495.5",
|
1232
|
+
# "underlyingPrice": "68455.904",
|
1233
|
+
# "lowestPrice": "68182.1",
|
1234
|
+
# "openPrice": "68762.4",
|
1235
|
+
# "positionFeeRate": "0.0001",
|
1236
|
+
# "volume": "33534.2858",
|
1237
|
+
# "markedPrice": "68434.1",
|
1238
|
+
# "turnover": "1200636218.210558",
|
1239
|
+
# "positionFeeTime": "28800",
|
1240
|
+
# "lastPrice": "68427.3",
|
1241
|
+
# "nextFeeTime": "1730736000000",
|
1242
|
+
# "fundingRate": "0.0001",
|
1243
|
+
# }
|
1244
|
+
# ],
|
1245
|
+
# "error_code": "0",
|
1246
|
+
# "msg": "Success",
|
1247
|
+
# "result": "true",
|
1248
|
+
# "success": True,
|
1249
|
+
# }
|
1250
|
+
data = self.safe_list(response, 'data', [])
|
1251
|
+
return self.parse_funding_rates(data, symbols)
|
1252
|
+
|
1131
1253
|
def fetch_balance(self, params={}) -> Balances:
|
1132
1254
|
"""
|
1133
1255
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1256
|
+
|
1257
|
+
https://www.lbank.com/en-US/docs/index.html#asset-information
|
1258
|
+
https://www.lbank.com/en-US/docs/index.html#account-information
|
1259
|
+
https://www.lbank.com/en-US/docs/index.html#get-all-coins-information
|
1260
|
+
|
1137
1261
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1138
1262
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
1139
1263
|
"""
|
@@ -1180,7 +1304,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1180
1304
|
#
|
1181
1305
|
return self.parse_balance(response)
|
1182
1306
|
|
1183
|
-
def parse_trading_fee(self, fee, market: Market = None):
|
1307
|
+
def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
|
1184
1308
|
#
|
1185
1309
|
# {
|
1186
1310
|
# "symbol":"skt_usdt",
|
@@ -1195,32 +1319,38 @@ class lbank(Exchange, ImplicitAPI):
|
|
1195
1319
|
'symbol': symbol,
|
1196
1320
|
'maker': self.safe_number(fee, 'makerCommission'),
|
1197
1321
|
'taker': self.safe_number(fee, 'takerCommission'),
|
1322
|
+
'percentage': None,
|
1323
|
+
'tierBased': None,
|
1198
1324
|
}
|
1199
1325
|
|
1200
|
-
def fetch_trading_fee(self, symbol: str, params={}):
|
1326
|
+
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
1201
1327
|
"""
|
1202
1328
|
fetch the trading fees for a market
|
1203
|
-
|
1329
|
+
|
1330
|
+
https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
|
1331
|
+
|
1204
1332
|
:param str symbol: unified market symbol
|
1205
1333
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1206
1334
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
1207
1335
|
"""
|
1208
1336
|
market = self.market(symbol)
|
1209
1337
|
result = self.fetch_trading_fees(self.extend(params, {'category': market['id']}))
|
1210
|
-
return result
|
1338
|
+
return self.safe_dict(result, symbol)
|
1211
1339
|
|
1212
|
-
def fetch_trading_fees(self, params={}):
|
1340
|
+
def fetch_trading_fees(self, params={}) -> TradingFees:
|
1213
1341
|
"""
|
1214
1342
|
fetch the trading fees for multiple markets
|
1215
|
-
|
1343
|
+
|
1344
|
+
https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
|
1345
|
+
|
1216
1346
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1217
1347
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
1218
1348
|
"""
|
1219
1349
|
self.load_markets()
|
1220
|
-
request = {}
|
1350
|
+
request: dict = {}
|
1221
1351
|
response = self.spotPrivatePostSupplementCustomerTradeFee(self.extend(request, params))
|
1222
1352
|
fees = self.safe_value(response, 'data', [])
|
1223
|
-
result = {}
|
1353
|
+
result: dict = {}
|
1224
1354
|
for i in range(0, len(fees)):
|
1225
1355
|
fee = self.parse_trading_fee(fees[i])
|
1226
1356
|
symbol = fee['symbol']
|
@@ -1230,8 +1360,10 @@ class lbank(Exchange, ImplicitAPI):
|
|
1230
1360
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
1231
1361
|
"""
|
1232
1362
|
create a market buy order by providing the symbol and cost
|
1233
|
-
|
1234
|
-
|
1363
|
+
|
1364
|
+
https://www.lbank.com/en-US/docs/index.html#place-order
|
1365
|
+
https://www.lbank.com/en-US/docs/index.html#place-an-order
|
1366
|
+
|
1235
1367
|
:param str symbol: unified symbol of the market to create an order in
|
1236
1368
|
:param float cost: how much you want to trade in units of the quote currency
|
1237
1369
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1247,13 +1379,15 @@ class lbank(Exchange, ImplicitAPI):
|
|
1247
1379
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1248
1380
|
"""
|
1249
1381
|
create a trade order
|
1250
|
-
|
1251
|
-
|
1382
|
+
|
1383
|
+
https://www.lbank.com/en-US/docs/index.html#place-order
|
1384
|
+
https://www.lbank.com/en-US/docs/index.html#place-an-order
|
1385
|
+
|
1252
1386
|
:param str symbol: unified symbol of the market to create an order in
|
1253
1387
|
:param str type: 'market' or 'limit'
|
1254
1388
|
:param str side: 'buy' or 'sell'
|
1255
1389
|
:param float amount: how much of currency you want to trade in units of base currency
|
1256
|
-
:param float [price]: the price at which the order is to be
|
1390
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1257
1391
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1258
1392
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1259
1393
|
"""
|
@@ -1263,7 +1397,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1263
1397
|
postOnly = self.safe_bool(params, 'postOnly', False)
|
1264
1398
|
timeInForce = self.safe_string_upper(params, 'timeInForce')
|
1265
1399
|
params = self.omit(params, ['custom_id', 'clientOrderId', 'timeInForce', 'postOnly'])
|
1266
|
-
request = {
|
1400
|
+
request: dict = {
|
1267
1401
|
'symbol': market['id'],
|
1268
1402
|
}
|
1269
1403
|
ioc = (timeInForce == 'IOC')
|
@@ -1334,8 +1468,8 @@ class lbank(Exchange, ImplicitAPI):
|
|
1334
1468
|
'info': result,
|
1335
1469
|
}, market)
|
1336
1470
|
|
1337
|
-
def parse_order_status(self, status):
|
1338
|
-
statuses = {
|
1471
|
+
def parse_order_status(self, status: Str):
|
1472
|
+
statuses: dict = {
|
1339
1473
|
'-1': 'canceled', # canceled
|
1340
1474
|
'0': 'open', # not traded
|
1341
1475
|
'1': 'open', # partial deal
|
@@ -1345,7 +1479,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1345
1479
|
}
|
1346
1480
|
return self.safe_string(statuses, status, status)
|
1347
1481
|
|
1348
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1482
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1349
1483
|
#
|
1350
1484
|
# fetchOrderSupplement(private)
|
1351
1485
|
#
|
@@ -1412,6 +1546,27 @@ class lbank(Exchange, ImplicitAPI):
|
|
1412
1546
|
# "status":-1
|
1413
1547
|
# }
|
1414
1548
|
#
|
1549
|
+
# cancelOrder
|
1550
|
+
#
|
1551
|
+
# {
|
1552
|
+
# "executedQty":0.0,
|
1553
|
+
# "price":0.05,
|
1554
|
+
# "origQty":100.0,
|
1555
|
+
# "tradeType":"buy",
|
1556
|
+
# "status":0
|
1557
|
+
# }
|
1558
|
+
#
|
1559
|
+
# cancelAllOrders
|
1560
|
+
#
|
1561
|
+
# {
|
1562
|
+
# "executedQty":0.00000000000000000000,
|
1563
|
+
# "orderId":"293ef71b-3e67-4962-af93-aa06990a045f",
|
1564
|
+
# "price":0.05000000000000000000,
|
1565
|
+
# "origQty":100.00000000000000000000,
|
1566
|
+
# "tradeType":"buy",
|
1567
|
+
# "status":0
|
1568
|
+
# }
|
1569
|
+
#
|
1415
1570
|
id = self.safe_string_2(order, 'orderId', 'order_id')
|
1416
1571
|
clientOrderId = self.safe_string_2(order, 'clientOrderId', 'custom_id')
|
1417
1572
|
timestamp = self.safe_integer_2(order, 'time', 'create_time')
|
@@ -1421,7 +1576,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1421
1576
|
timeInForce = None
|
1422
1577
|
postOnly = False
|
1423
1578
|
type = 'limit'
|
1424
|
-
rawType = self.
|
1579
|
+
rawType = self.safe_string_2(order, 'type', 'tradeType') # buy, sell, buy_market, sell_market, buy_maker,sell_maker,buy_ioc,sell_ioc, buy_fok, sell_fok
|
1425
1580
|
parts = rawType.split('_')
|
1426
1581
|
side = self.safe_string(parts, 0)
|
1427
1582
|
typePart = self.safe_string(parts, 1) # market, maker, ioc, fok or None(limit)
|
@@ -1453,7 +1608,6 @@ class lbank(Exchange, ImplicitAPI):
|
|
1453
1608
|
'postOnly': postOnly,
|
1454
1609
|
'side': side,
|
1455
1610
|
'price': price,
|
1456
|
-
'stopPrice': None,
|
1457
1611
|
'triggerPrice': None,
|
1458
1612
|
'cost': costString,
|
1459
1613
|
'amount': amountString,
|
@@ -1468,8 +1622,11 @@ class lbank(Exchange, ImplicitAPI):
|
|
1468
1622
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1469
1623
|
"""
|
1470
1624
|
fetches information on an order made by the user
|
1471
|
-
|
1472
|
-
|
1625
|
+
|
1626
|
+
https://www.lbank.com/en-US/docs/index.html#query-order
|
1627
|
+
https://www.lbank.com/en-US/docs/index.html#query-order-new
|
1628
|
+
|
1629
|
+
:param str id: order id
|
1473
1630
|
:param str symbol: unified symbol of the market the order was made in
|
1474
1631
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1475
1632
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -1488,7 +1645,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1488
1645
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
1489
1646
|
self.load_markets()
|
1490
1647
|
market = self.market(symbol)
|
1491
|
-
request = {
|
1648
|
+
request: dict = {
|
1492
1649
|
'symbol': market['id'],
|
1493
1650
|
'orderId': id,
|
1494
1651
|
}
|
@@ -1514,7 +1671,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1514
1671
|
# "ts":1648164471827
|
1515
1672
|
# }
|
1516
1673
|
#
|
1517
|
-
result = self.
|
1674
|
+
result = self.safe_dict(response, 'data', {})
|
1518
1675
|
return self.parse_order(result)
|
1519
1676
|
|
1520
1677
|
def fetch_order_default(self, id: str, symbol: Str = None, params={}):
|
@@ -1523,7 +1680,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1523
1680
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
1524
1681
|
self.load_markets()
|
1525
1682
|
market = self.market(symbol)
|
1526
|
-
request = {
|
1683
|
+
request: dict = {
|
1527
1684
|
'symbol': market['id'],
|
1528
1685
|
'order_id': id,
|
1529
1686
|
}
|
@@ -1564,7 +1721,9 @@ class lbank(Exchange, ImplicitAPI):
|
|
1564
1721
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1565
1722
|
"""
|
1566
1723
|
fetch all trades made by the user
|
1567
|
-
|
1724
|
+
|
1725
|
+
https://www.lbank.com/en-US/docs/index.html#past-transaction-details
|
1726
|
+
|
1568
1727
|
:param str symbol: unified market symbol
|
1569
1728
|
:param int [since]: the earliest time in ms to fetch trades for
|
1570
1729
|
:param int [limit]: the maximum number of trade structures to retrieve
|
@@ -1577,7 +1736,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1577
1736
|
market = self.market(symbol)
|
1578
1737
|
since = self.safe_value(params, 'start_date', since)
|
1579
1738
|
params = self.omit(params, 'start_date')
|
1580
|
-
request = {
|
1739
|
+
request: dict = {
|
1581
1740
|
'symbol': market['id'],
|
1582
1741
|
# 'start_date' Start time yyyy-mm-dd, the maximum is today, the default is yesterday
|
1583
1742
|
# 'end_date' Finish time yyyy-mm-dd, the maximum is today, the default is today
|
@@ -1612,13 +1771,15 @@ class lbank(Exchange, ImplicitAPI):
|
|
1612
1771
|
# "ts":1648509742164
|
1613
1772
|
# }
|
1614
1773
|
#
|
1615
|
-
trades = self.
|
1774
|
+
trades = self.safe_list(response, 'data', [])
|
1616
1775
|
return self.parse_trades(trades, market, since, limit)
|
1617
1776
|
|
1618
1777
|
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1619
1778
|
"""
|
1620
1779
|
fetches information on multiple orders made by the user
|
1621
|
-
|
1780
|
+
|
1781
|
+
https://www.lbank.com/en-US/docs/index.html#query-all-orders
|
1782
|
+
|
1622
1783
|
:param str symbol: unified market symbol of the market orders were made in
|
1623
1784
|
:param int [since]: the earliest time in ms to fetch orders for
|
1624
1785
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -1633,7 +1794,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1633
1794
|
market = self.market(symbol)
|
1634
1795
|
if limit is None:
|
1635
1796
|
limit = 100
|
1636
|
-
request = {
|
1797
|
+
request: dict = {
|
1637
1798
|
'symbol': market['id'],
|
1638
1799
|
'current_page': 1,
|
1639
1800
|
'page_length': limit,
|
@@ -1668,13 +1829,15 @@ class lbank(Exchange, ImplicitAPI):
|
|
1668
1829
|
# }
|
1669
1830
|
#
|
1670
1831
|
result = self.safe_value(response, 'data', {})
|
1671
|
-
orders = self.
|
1832
|
+
orders = self.safe_list(result, 'orders', [])
|
1672
1833
|
return self.parse_orders(orders, market, since, limit)
|
1673
1834
|
|
1674
1835
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1675
1836
|
"""
|
1676
1837
|
fetch all unfilled currently open orders
|
1677
|
-
|
1838
|
+
|
1839
|
+
https://www.lbank.com/en-US/docs/index.html#current-pending-order
|
1840
|
+
|
1678
1841
|
:param str symbol: unified market symbol
|
1679
1842
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1680
1843
|
:param int [limit]: the maximum number of open order structures to retrieve
|
@@ -1687,7 +1850,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1687
1850
|
market = self.market(symbol)
|
1688
1851
|
if limit is None:
|
1689
1852
|
limit = 100
|
1690
|
-
request = {
|
1853
|
+
request: dict = {
|
1691
1854
|
'symbol': market['id'],
|
1692
1855
|
'current_page': 1,
|
1693
1856
|
'page_length': limit,
|
@@ -1721,13 +1884,15 @@ class lbank(Exchange, ImplicitAPI):
|
|
1721
1884
|
# }
|
1722
1885
|
#
|
1723
1886
|
result = self.safe_value(response, 'data', {})
|
1724
|
-
orders = self.
|
1887
|
+
orders = self.safe_list(result, 'orders', [])
|
1725
1888
|
return self.parse_orders(orders, market, since, limit)
|
1726
1889
|
|
1727
1890
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1728
1891
|
"""
|
1729
1892
|
cancels an open order
|
1730
|
-
|
1893
|
+
|
1894
|
+
https://www.lbank.com/en-US/docs/index.html#cancel-order-new
|
1895
|
+
|
1731
1896
|
:param str id: order id
|
1732
1897
|
:param str symbol: unified symbol of the market the order was made in
|
1733
1898
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1739,7 +1904,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1739
1904
|
clientOrderId = self.safe_string_2(params, 'origClientOrderId', 'clientOrderId')
|
1740
1905
|
params = self.omit(params, ['origClientOrderId', 'clientOrderId'])
|
1741
1906
|
market = self.market(symbol)
|
1742
|
-
request = {
|
1907
|
+
request: dict = {
|
1743
1908
|
'symbol': market['id'],
|
1744
1909
|
'orderId': id,
|
1745
1910
|
}
|
@@ -1755,17 +1920,19 @@ class lbank(Exchange, ImplicitAPI):
|
|
1755
1920
|
# "origQty":100.0,
|
1756
1921
|
# "tradeType":"buy",
|
1757
1922
|
# "status":0
|
1758
|
-
#
|
1923
|
+
# },
|
1759
1924
|
# "error_code":0,
|
1760
1925
|
# "ts":1648501286196
|
1761
1926
|
# }
|
1762
|
-
|
1763
|
-
return
|
1927
|
+
data = self.safe_dict(response, 'data', {})
|
1928
|
+
return self.parse_order(data)
|
1764
1929
|
|
1765
1930
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1766
1931
|
"""
|
1767
1932
|
cancel all open orders in a market
|
1768
|
-
|
1933
|
+
|
1934
|
+
https://www.lbank.com/en-US/docs/index.html#cancel-all-pending-orders-for-a-single-trading-pair
|
1935
|
+
|
1769
1936
|
:param str symbol: unified market symbol of the market to cancel orders in
|
1770
1937
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1771
1938
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -1774,7 +1941,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1774
1941
|
raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol argument')
|
1775
1942
|
self.load_markets()
|
1776
1943
|
market = self.market(symbol)
|
1777
|
-
request = {
|
1944
|
+
request: dict = {
|
1778
1945
|
'symbol': market['id'],
|
1779
1946
|
}
|
1780
1947
|
response = self.spotPrivatePostSupplementCancelOrderBySymbol(self.extend(request, params))
|
@@ -1795,8 +1962,8 @@ class lbank(Exchange, ImplicitAPI):
|
|
1795
1962
|
# "ts":1648506641469
|
1796
1963
|
# }
|
1797
1964
|
#
|
1798
|
-
|
1799
|
-
return
|
1965
|
+
data = self.safe_list(response, 'data', [])
|
1966
|
+
return self.parse_orders(data)
|
1800
1967
|
|
1801
1968
|
def get_network_code_for_currency(self, currencyCode, params):
|
1802
1969
|
defaultNetworks = self.safe_value(self.options, 'defaultNetworks')
|
@@ -1806,11 +1973,13 @@ class lbank(Exchange, ImplicitAPI):
|
|
1806
1973
|
network = self.safe_string(networks, network, network) # handle ERC20>ETH alias
|
1807
1974
|
return network
|
1808
1975
|
|
1809
|
-
def fetch_deposit_address(self, code: str, params={}):
|
1976
|
+
def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1810
1977
|
"""
|
1811
1978
|
fetch the deposit address for a currency associated with self account
|
1812
|
-
|
1813
|
-
|
1979
|
+
|
1980
|
+
https://www.lbank.com/en-US/docs/index.html#get-deposit-address
|
1981
|
+
https://www.lbank.com/en-US/docs/index.html#the-user-obtains-the-deposit-address
|
1982
|
+
|
1814
1983
|
:param str code: unified currency code
|
1815
1984
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1816
1985
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
@@ -1827,10 +1996,10 @@ class lbank(Exchange, ImplicitAPI):
|
|
1827
1996
|
response = self.fetch_deposit_address_default(code, params)
|
1828
1997
|
return response
|
1829
1998
|
|
1830
|
-
def fetch_deposit_address_default(self, code: str, params={}):
|
1999
|
+
def fetch_deposit_address_default(self, code: str, params={}) -> DepositAddress:
|
1831
2000
|
self.load_markets()
|
1832
2001
|
currency = self.currency(code)
|
1833
|
-
request = {
|
2002
|
+
request: dict = {
|
1834
2003
|
'assetCode': currency['id'],
|
1835
2004
|
}
|
1836
2005
|
network = self.get_network_code_for_currency(code, params)
|
@@ -1858,18 +2027,18 @@ class lbank(Exchange, ImplicitAPI):
|
|
1858
2027
|
inverseNetworks = self.safe_value(self.options, 'inverse-networks', {})
|
1859
2028
|
networkCode = self.safe_string_upper(inverseNetworks, networkId, networkId)
|
1860
2029
|
return {
|
2030
|
+
'info': response,
|
1861
2031
|
'currency': code,
|
2032
|
+
'network': networkCode,
|
1862
2033
|
'address': address,
|
1863
2034
|
'tag': tag,
|
1864
|
-
'network': networkCode,
|
1865
|
-
'info': response,
|
1866
2035
|
}
|
1867
2036
|
|
1868
|
-
def fetch_deposit_address_supplement(self, code: str, params={}):
|
2037
|
+
def fetch_deposit_address_supplement(self, code: str, params={}) -> DepositAddress:
|
1869
2038
|
# returns the address for whatever the default network is...
|
1870
2039
|
self.load_markets()
|
1871
2040
|
currency = self.currency(code)
|
1872
|
-
request = {
|
2041
|
+
request: dict = {
|
1873
2042
|
'coin': currency['id'],
|
1874
2043
|
}
|
1875
2044
|
networks = self.safe_value(self.options, 'networks')
|
@@ -1897,17 +2066,19 @@ class lbank(Exchange, ImplicitAPI):
|
|
1897
2066
|
inverseNetworks = self.safe_value(self.options, 'inverse-networks', {})
|
1898
2067
|
networkCode = self.safe_string_upper(inverseNetworks, network, network)
|
1899
2068
|
return {
|
2069
|
+
'info': response,
|
1900
2070
|
'currency': code,
|
2071
|
+
'network': networkCode, # will be None if not specified in request
|
1901
2072
|
'address': address,
|
1902
2073
|
'tag': tag,
|
1903
|
-
'network': networkCode, # will be None if not specified in request
|
1904
|
-
'info': response,
|
1905
2074
|
}
|
1906
2075
|
|
1907
|
-
def withdraw(self, code: str, amount: float, address, tag=None, params={}) -> Transaction:
|
2076
|
+
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1908
2077
|
"""
|
1909
2078
|
make a withdrawal
|
1910
|
-
|
2079
|
+
|
2080
|
+
https://www.lbank.com/en-US/docs/index.html#withdrawal
|
2081
|
+
|
1911
2082
|
:param str code: unified currency code
|
1912
2083
|
:param float amount: the amount to withdraw
|
1913
2084
|
:param str address: the address to withdraw to
|
@@ -1923,7 +2094,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1923
2094
|
# The relevant coin network fee can be found by calling fetchDepositWithdrawFees(), note: if no network param is supplied then the default network will be used, self can also be found in fetchDepositWithdrawFees().
|
1924
2095
|
self.check_required_argument('withdraw', fee, 'fee')
|
1925
2096
|
currency = self.currency(code)
|
1926
|
-
request = {
|
2097
|
+
request: dict = {
|
1927
2098
|
'address': address,
|
1928
2099
|
'coin': currency['id'],
|
1929
2100
|
'amount': amount,
|
@@ -1962,7 +2133,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1962
2133
|
}
|
1963
2134
|
|
1964
2135
|
def parse_transaction_status(self, status, type):
|
1965
|
-
statuses = {
|
2136
|
+
statuses: dict = {
|
1966
2137
|
'deposit': {
|
1967
2138
|
'1': 'pending',
|
1968
2139
|
'2': 'ok',
|
@@ -1979,7 +2150,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
1979
2150
|
}
|
1980
2151
|
return self.safe_string(self.safe_value(statuses, type, {}), status, status)
|
1981
2152
|
|
1982
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
2153
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1983
2154
|
#
|
1984
2155
|
# fetchDeposits(private)
|
1985
2156
|
#
|
@@ -2064,7 +2235,9 @@ class lbank(Exchange, ImplicitAPI):
|
|
2064
2235
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
2065
2236
|
"""
|
2066
2237
|
fetch all deposits made to an account
|
2067
|
-
|
2238
|
+
|
2239
|
+
https://www.lbank.com/en-US/docs/index.html#get-recharge-history
|
2240
|
+
|
2068
2241
|
:param str code: unified currency code
|
2069
2242
|
:param int [since]: the earliest time in ms to fetch deposits for
|
2070
2243
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -2072,7 +2245,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
2072
2245
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
2073
2246
|
"""
|
2074
2247
|
self.load_markets()
|
2075
|
-
request = {
|
2248
|
+
request: dict = {
|
2076
2249
|
# 'status': Recharge status: ("1","Applying"),("2","Recharge successful"),("3","Recharge failed"),("4","Already Cancel"),("5", "Transfer")
|
2077
2250
|
# 'endTime': end time, timestamp in milliseconds, default now
|
2078
2251
|
}
|
@@ -2107,13 +2280,15 @@ class lbank(Exchange, ImplicitAPI):
|
|
2107
2280
|
# }
|
2108
2281
|
#
|
2109
2282
|
data = self.safe_value(response, 'data', {})
|
2110
|
-
deposits = self.
|
2283
|
+
deposits = self.safe_list(data, 'depositOrders', [])
|
2111
2284
|
return self.parse_transactions(deposits, currency, since, limit)
|
2112
2285
|
|
2113
2286
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
2114
2287
|
"""
|
2115
2288
|
fetch all withdrawals made from an account
|
2116
|
-
|
2289
|
+
|
2290
|
+
https://www.lbank.com/en-US/docs/index.html#get-withdrawal-history
|
2291
|
+
|
2117
2292
|
:param str code: unified currency code
|
2118
2293
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
2119
2294
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -2121,7 +2296,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
2121
2296
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
2122
2297
|
"""
|
2123
2298
|
self.load_markets()
|
2124
|
-
request = {
|
2299
|
+
request: dict = {
|
2125
2300
|
# 'status': Recharge status: ("1","Applying"),("2","Recharge successful"),("3","Recharge failed"),("4","Already Cancel"),("5", "Transfer")
|
2126
2301
|
# 'endTime': end time, timestamp in milliseconds, default now
|
2127
2302
|
# 'withdrawOrderId': Custom withdrawal id
|
@@ -2160,12 +2335,12 @@ class lbank(Exchange, ImplicitAPI):
|
|
2160
2335
|
# }
|
2161
2336
|
#
|
2162
2337
|
data = self.safe_value(response, 'data', {})
|
2163
|
-
withdraws = self.
|
2338
|
+
withdraws = self.safe_list(data, 'withdraws', [])
|
2164
2339
|
return self.parse_transactions(withdraws, currency, since, limit)
|
2165
2340
|
|
2166
|
-
def fetch_transaction_fees(self, codes:
|
2341
|
+
def fetch_transaction_fees(self, codes: Strings = None, params={}):
|
2167
2342
|
"""
|
2168
|
-
|
2343
|
+
@deprecated
|
2169
2344
|
please use fetchDepositWithdrawFees instead
|
2170
2345
|
:param str[]|None codes: not used by lbank fetchTransactionFees()
|
2171
2346
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2224,7 +2399,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
2224
2399
|
# }
|
2225
2400
|
#
|
2226
2401
|
result = self.safe_value(response, 'data', [])
|
2227
|
-
withdrawFees = {}
|
2402
|
+
withdrawFees: dict = {}
|
2228
2403
|
for i in range(0, len(result)):
|
2229
2404
|
entry = result[i]
|
2230
2405
|
currencyId = self.safe_string(entry, 'coin')
|
@@ -2250,7 +2425,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
2250
2425
|
self.load_markets()
|
2251
2426
|
code = self.safe_string_2(params, 'coin', 'assetCode')
|
2252
2427
|
params = self.omit(params, ['coin', 'assetCode'])
|
2253
|
-
request = {}
|
2428
|
+
request: dict = {}
|
2254
2429
|
if code is not None:
|
2255
2430
|
currency = self.currency(code)
|
2256
2431
|
request['assetCode'] = currency['id']
|
@@ -2277,7 +2452,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
2277
2452
|
# }
|
2278
2453
|
#
|
2279
2454
|
result = self.safe_value(response, 'data', [])
|
2280
|
-
withdrawFees = {}
|
2455
|
+
withdrawFees: dict = {}
|
2281
2456
|
for i in range(0, len(result)):
|
2282
2457
|
item = result[i]
|
2283
2458
|
canWithdraw = self.safe_value(item, 'canWithDraw')
|
@@ -2301,9 +2476,11 @@ class lbank(Exchange, ImplicitAPI):
|
|
2301
2476
|
def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
2302
2477
|
"""
|
2303
2478
|
when using private endpoint, only returns information for currencies with non-zero balance, use public method by specifying self.options['fetchDepositWithdrawFees']['method'] = 'fetchPublicDepositWithdrawFees'
|
2304
|
-
|
2305
|
-
|
2306
|
-
|
2479
|
+
|
2480
|
+
https://www.lbank.com/en-US/docs/index.html#get-all-coins-information
|
2481
|
+
https://www.lbank.com/en-US/docs/index.html#withdrawal-configurations
|
2482
|
+
|
2483
|
+
:param str[] [codes]: array of unified currency codes
|
2307
2484
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2308
2485
|
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
2309
2486
|
"""
|
@@ -2316,11 +2493,11 @@ class lbank(Exchange, ImplicitAPI):
|
|
2316
2493
|
method = self.safe_string(params, 'method', defaultMethod)
|
2317
2494
|
params = self.omit(params, 'method')
|
2318
2495
|
if method == 'fetchPublicDepositWithdrawFees':
|
2319
|
-
self.fetch_public_deposit_withdraw_fees(codes, params)
|
2496
|
+
response = self.fetch_public_deposit_withdraw_fees(codes, params)
|
2320
2497
|
else:
|
2321
|
-
self.fetch_private_deposit_withdraw_fees(codes, params)
|
2498
|
+
response = self.fetch_private_deposit_withdraw_fees(codes, params)
|
2322
2499
|
else:
|
2323
|
-
self.fetch_public_deposit_withdraw_fees(codes, params)
|
2500
|
+
response = self.fetch_public_deposit_withdraw_fees(codes, params)
|
2324
2501
|
return response
|
2325
2502
|
|
2326
2503
|
def fetch_private_deposit_withdraw_fees(self, codes=None, params={}):
|
@@ -2358,14 +2535,14 @@ class lbank(Exchange, ImplicitAPI):
|
|
2358
2535
|
# "code": 0
|
2359
2536
|
# }
|
2360
2537
|
#
|
2361
|
-
data = self.
|
2538
|
+
data = self.safe_list(response, 'data', [])
|
2362
2539
|
return self.parse_deposit_withdraw_fees(data, codes, 'coin')
|
2363
2540
|
|
2364
2541
|
def fetch_public_deposit_withdraw_fees(self, codes=None, params={}):
|
2365
2542
|
# extremely incomplete response
|
2366
2543
|
# vast majority fees None
|
2367
2544
|
self.load_markets()
|
2368
|
-
request = {}
|
2545
|
+
request: dict = {}
|
2369
2546
|
response = self.spotPublicGetWithdrawConfigs(self.extend(request, params))
|
2370
2547
|
#
|
2371
2548
|
# {
|
@@ -2408,7 +2585,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
2408
2585
|
# ...
|
2409
2586
|
# ]
|
2410
2587
|
#
|
2411
|
-
result = {}
|
2588
|
+
result: dict = {}
|
2412
2589
|
for i in range(0, len(response)):
|
2413
2590
|
fee = response[i]
|
2414
2591
|
canWithdraw = self.safe_value(fee, 'canWithDraw')
|
@@ -2563,7 +2740,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
2563
2740
|
pem += self.secret[start:end] + "\n" # eslint-disable-line
|
2564
2741
|
return pem + '-----END PRIVATE KEY-----'
|
2565
2742
|
|
2566
|
-
def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
2743
|
+
def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
|
2567
2744
|
if response is None:
|
2568
2745
|
return None
|
2569
2746
|
success = self.safe_value(response, 'result')
|