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/bigone.py
CHANGED
@@ -5,9 +5,10 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bigone import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Bool, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
8
|
+
from ccxt.base.types import Balances, Bool, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
|
+
from ccxt.base.errors import AuthenticationError
|
11
12
|
from ccxt.base.errors import PermissionDenied
|
12
13
|
from ccxt.base.errors import ArgumentsRequired
|
13
14
|
from ccxt.base.errors import BadRequest
|
@@ -16,7 +17,6 @@ from ccxt.base.errors import InsufficientFunds
|
|
16
17
|
from ccxt.base.errors import InvalidOrder
|
17
18
|
from ccxt.base.errors import NotSupported
|
18
19
|
from ccxt.base.errors import RateLimitExceeded
|
19
|
-
from ccxt.base.errors import AuthenticationError
|
20
20
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
21
21
|
from ccxt.base.precise import Precise
|
22
22
|
|
@@ -29,7 +29,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
29
29
|
'name': 'BigONE',
|
30
30
|
'countries': ['CN'],
|
31
31
|
'version': 'v3',
|
32
|
-
'rateLimit':
|
32
|
+
'rateLimit': 20, # 500 requests per 10 seconds
|
33
33
|
'has': {
|
34
34
|
'CORS': None,
|
35
35
|
'spot': True,
|
@@ -51,8 +51,13 @@ class bigone(Exchange, ImplicitAPI):
|
|
51
51
|
'fetchClosedOrders': True,
|
52
52
|
'fetchCurrencies': True,
|
53
53
|
'fetchDepositAddress': True,
|
54
|
+
'fetchDepositAddresses': False,
|
55
|
+
'fetchDepositAddressesByNetwork': False,
|
54
56
|
'fetchDeposits': True,
|
57
|
+
'fetchFundingHistory': False,
|
55
58
|
'fetchFundingRate': False,
|
59
|
+
'fetchFundingRateHistory': False,
|
60
|
+
'fetchFundingRates': False,
|
56
61
|
'fetchMarkets': True,
|
57
62
|
'fetchMyTrades': True,
|
58
63
|
'fetchOHLCV': True,
|
@@ -87,7 +92,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
87
92
|
},
|
88
93
|
'hostname': 'big.one', # or 'bigone.com'
|
89
94
|
'urls': {
|
90
|
-
'logo': 'https://
|
95
|
+
'logo': 'https://github.com/user-attachments/assets/4e5cfd53-98cc-4b90-92cd-0d7b512653d1',
|
91
96
|
'api': {
|
92
97
|
'public': 'https://{hostname}/api/v3',
|
93
98
|
'private': 'https://{hostname}/api/v3/viewer',
|
@@ -167,7 +172,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
167
172
|
},
|
168
173
|
'webExchange': {
|
169
174
|
'get': [
|
170
|
-
'
|
175
|
+
'v3/assets',
|
171
176
|
],
|
172
177
|
},
|
173
178
|
},
|
@@ -300,6 +305,105 @@ class bigone(Exchange, ImplicitAPI):
|
|
300
305
|
# undetermined: XinFin, YAS, Ycash
|
301
306
|
},
|
302
307
|
},
|
308
|
+
'features': {
|
309
|
+
'default': {
|
310
|
+
'sandbox': False,
|
311
|
+
'createOrder': {
|
312
|
+
'marginMode': False,
|
313
|
+
'triggerPrice': True,
|
314
|
+
'triggerPriceType': None,
|
315
|
+
'triggerDirection': True, # todo implement
|
316
|
+
'stopLossPrice': False, # todo by trigger
|
317
|
+
'takeProfitPrice': False, # todo by trigger
|
318
|
+
'attachedStopLossTakeProfit': None,
|
319
|
+
'timeInForce': {
|
320
|
+
'IOC': True,
|
321
|
+
'FOK': False,
|
322
|
+
'PO': True,
|
323
|
+
'GTD': False,
|
324
|
+
},
|
325
|
+
'hedged': False,
|
326
|
+
'trailing': False,
|
327
|
+
'leverage': False,
|
328
|
+
'marketBuyRequiresPrice': True,
|
329
|
+
'marketBuyByCost': True,
|
330
|
+
'selfTradePrevention': False,
|
331
|
+
'iceberg': False,
|
332
|
+
},
|
333
|
+
'createOrders': None, # todo: implement
|
334
|
+
'fetchMyTrades': {
|
335
|
+
'marginMode': False,
|
336
|
+
'limit': 200,
|
337
|
+
'daysBack': None,
|
338
|
+
'untilDays': None,
|
339
|
+
},
|
340
|
+
'fetchOrder': {
|
341
|
+
'marginMode': False,
|
342
|
+
'trigger': False,
|
343
|
+
'trailing': False,
|
344
|
+
},
|
345
|
+
'fetchOpenOrders': {
|
346
|
+
'marginMode': False,
|
347
|
+
'limit': 200,
|
348
|
+
'trigger': False,
|
349
|
+
'trailing': False,
|
350
|
+
},
|
351
|
+
'fetchOrders': {
|
352
|
+
'marginMode': False,
|
353
|
+
'limit': 200,
|
354
|
+
'daysBack': None,
|
355
|
+
'untilDays': None,
|
356
|
+
'trigger': False,
|
357
|
+
'trailing': False,
|
358
|
+
},
|
359
|
+
'fetchClosedOrders': {
|
360
|
+
'marginMode': False,
|
361
|
+
'limit': 200,
|
362
|
+
'daysBack': None,
|
363
|
+
'daysBackCanceled': None,
|
364
|
+
'untilDays': None,
|
365
|
+
'trigger': False,
|
366
|
+
'trailing': False,
|
367
|
+
},
|
368
|
+
'fetchOHLCV': {
|
369
|
+
'limit': 500,
|
370
|
+
},
|
371
|
+
},
|
372
|
+
'spot': {
|
373
|
+
'extends': 'default',
|
374
|
+
},
|
375
|
+
'forDerivatives': {
|
376
|
+
'extends': 'default',
|
377
|
+
'createOrder': {
|
378
|
+
# todo: implement
|
379
|
+
'triggerPriceType': {
|
380
|
+
'mark': True,
|
381
|
+
'index': True,
|
382
|
+
'last': True,
|
383
|
+
},
|
384
|
+
},
|
385
|
+
'fetchOrders': {
|
386
|
+
'daysBack': 100000,
|
387
|
+
'untilDays': 100000,
|
388
|
+
},
|
389
|
+
'fetchClosedOrders': {
|
390
|
+
'daysBack': 100000,
|
391
|
+
'untilDays': 100000,
|
392
|
+
},
|
393
|
+
},
|
394
|
+
'swap': {
|
395
|
+
'linear': {
|
396
|
+
'extends': 'forDerivatives',
|
397
|
+
},
|
398
|
+
'inverse': {
|
399
|
+
'extends': 'forDerivatives',
|
400
|
+
},
|
401
|
+
},
|
402
|
+
'future': {
|
403
|
+
'linear': None,
|
404
|
+
'inverse': None,
|
405
|
+
},
|
406
|
+
},
|
303
407
|
'precisionMode': TICK_SIZE,
|
304
408
|
'exceptions': {
|
305
409
|
'exact': {
|
@@ -339,14 +443,14 @@ class bigone(Exchange, ImplicitAPI):
|
|
339
443
|
},
|
340
444
|
})
|
341
445
|
|
342
|
-
def fetch_currencies(self, params={}):
|
446
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
343
447
|
"""
|
344
448
|
fetches all available currencies on an exchange
|
345
449
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
346
450
|
:returns dict: an associative dictionary of currencies
|
347
451
|
"""
|
348
452
|
# we use undocumented link(possible, less informative alternative is : https://big.one/api/uc/v3/assets/accounts)
|
349
|
-
data = self.fetch_web_endpoint('fetchCurrencies', '
|
453
|
+
data = self.fetch_web_endpoint('fetchCurrencies', 'webExchangeGetV3Assets', True)
|
350
454
|
if data is None:
|
351
455
|
return None
|
352
456
|
#
|
@@ -355,105 +459,54 @@ class bigone(Exchange, ImplicitAPI):
|
|
355
459
|
# "message": "",
|
356
460
|
# "data": [
|
357
461
|
# {
|
358
|
-
#
|
359
|
-
#
|
360
|
-
#
|
361
|
-
#
|
362
|
-
#
|
363
|
-
#
|
364
|
-
#
|
365
|
-
#
|
366
|
-
#
|
367
|
-
#
|
368
|
-
#
|
369
|
-
#
|
462
|
+
# "uuid": "17082d1c-0195-4fb6-8779-2cdbcb9eeb3c",
|
463
|
+
# "symbol": "USDT",
|
464
|
+
# "name": "TetherUS",
|
465
|
+
# "scale": 12,
|
466
|
+
# "is_fiat": False,
|
467
|
+
# "is_transfer_enabled": True,
|
468
|
+
# "transfer_scale": 12,
|
469
|
+
# "binding_gateways": [
|
470
|
+
# {
|
471
|
+
# "guid": "07efc37f-d1ec-4bc9-8339-a745256ea2ba",
|
472
|
+
# "is_deposit_enabled": True,
|
473
|
+
# "gateway_name": "Ethereum",
|
474
|
+
# "min_withdrawal_amount": "0.000001",
|
475
|
+
# "withdrawal_fee": "5.71",
|
476
|
+
# "is_withdrawal_enabled": True,
|
477
|
+
# "min_deposit_amount": "0.000001",
|
478
|
+
# "is_memo_required": False,
|
479
|
+
# "withdrawal_scale": 6,
|
480
|
+
# "scale": 12
|
481
|
+
# },
|
482
|
+
# {
|
483
|
+
# "guid": "4e387a9a-a480-40a3-b4ae-ed1773c2db5a",
|
484
|
+
# "is_deposit_enabled": True,
|
485
|
+
# "gateway_name": "BinanceSmartChain",
|
486
|
+
# "min_withdrawal_amount": "10",
|
487
|
+
# "withdrawal_fee": "5",
|
488
|
+
# "is_withdrawal_enabled": False,
|
489
|
+
# "min_deposit_amount": "1",
|
490
|
+
# "is_memo_required": False,
|
491
|
+
# "withdrawal_scale": 8,
|
492
|
+
# "scale": 12
|
493
|
+
# }
|
494
|
+
# ]
|
370
495
|
# },
|
371
|
-
# "info_link": null,
|
372
|
-
# "scale": "12",
|
373
|
-
# "default_gateway": ..., # one object from "gateways"
|
374
|
-
# "gateways": [
|
375
|
-
# {
|
376
|
-
# "uuid": "f0fa5a85-7f65-428a-b7b7-13aad55c2837",
|
377
|
-
# "name": "Mixin",
|
378
|
-
# "kind": "CHAIN",
|
379
|
-
# "required_confirmations": "0",
|
380
|
-
# },
|
381
|
-
# {
|
382
|
-
# "uuid": "b75446c6-1446-4c8d-b3d1-39f385b0a926",
|
383
|
-
# "name": "Ethereum",
|
384
|
-
# "kind": "CHAIN",
|
385
|
-
# "required_confirmations": "18",
|
386
|
-
# },
|
387
|
-
# {
|
388
|
-
# "uuid": "fe9b1b0b-e55c-4017-b5ce-16f524df5fc0",
|
389
|
-
# "name": "Tron",
|
390
|
-
# "kind": "CHAIN",
|
391
|
-
# "required_confirmations": "1",
|
392
|
-
# },
|
393
|
-
# ...
|
394
|
-
# ],
|
395
|
-
# "payments": [],
|
396
|
-
# "uuid": "17082d1c-0195-4fb6-8779-2cdbcb9eeb3c",
|
397
|
-
# "binding_gateways": [
|
398
|
-
# {
|
399
|
-
# "guid": "07efc37f-d1ec-4bc9-8339-a745256ea2ba",
|
400
|
-
# "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
401
|
-
# "is_deposit_enabled": True,
|
402
|
-
# "display_name": "Ethereum(ERC20)",
|
403
|
-
# "gateway_name": "Ethereum",
|
404
|
-
# "min_withdrawal_amount": "0.000001",
|
405
|
-
# "min_internal_withdrawal_amount": "0.00000001",
|
406
|
-
# "withdrawal_fee": "14",
|
407
|
-
# "is_withdrawal_enabled": True,
|
408
|
-
# "min_deposit_amount": "0.000001",
|
409
|
-
# "is_memo_required": False,
|
410
|
-
# "withdrawal_scale": "2",
|
411
|
-
# "gateway": {
|
412
|
-
# "uuid": "b75446c6-1446-4c8d-b3d1-39f385b0a926",
|
413
|
-
# "name": "Ethereum",
|
414
|
-
# "kind": "CHAIN",
|
415
|
-
# "required_confirmations": "18",
|
416
|
-
# },
|
417
|
-
# "scale": "12",
|
418
|
-
# },
|
419
|
-
# {
|
420
|
-
# "guid": "b80a4d13-cac7-4319-842d-b33c3bfab8ec",
|
421
|
-
# "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
|
422
|
-
# "is_deposit_enabled": True,
|
423
|
-
# "display_name": "Tron(TRC20)",
|
424
|
-
# "gateway_name": "Tron",
|
425
|
-
# "min_withdrawal_amount": "0.000001",
|
426
|
-
# "min_internal_withdrawal_amount": "0.00000001",
|
427
|
-
# "withdrawal_fee": "1",
|
428
|
-
# "is_withdrawal_enabled": True,
|
429
|
-
# "min_deposit_amount": "0.000001",
|
430
|
-
# "is_memo_required": False,
|
431
|
-
# "withdrawal_scale": "6",
|
432
|
-
# "gateway": {
|
433
|
-
# "uuid": "fe9b1b0b-e55c-4017-b5ce-16f524df5fc0",
|
434
|
-
# "name": "Tron",
|
435
|
-
# "kind": "CHAIN",
|
436
|
-
# "required_confirmations": "1",
|
437
|
-
# },
|
438
|
-
# "scale": "12",
|
439
|
-
# },
|
440
|
-
# ...
|
441
|
-
# ],
|
442
|
-
# },
|
443
496
|
# ...
|
444
497
|
# ],
|
445
498
|
# }
|
446
499
|
#
|
447
|
-
currenciesData = self.
|
448
|
-
result = {}
|
500
|
+
currenciesData = self.safe_list(data, 'data', [])
|
501
|
+
result: dict = {}
|
449
502
|
for i in range(0, len(currenciesData)):
|
450
503
|
currency = currenciesData[i]
|
451
504
|
id = self.safe_string(currency, 'symbol')
|
452
505
|
code = self.safe_currency_code(id)
|
453
506
|
name = self.safe_string(currency, 'name')
|
454
|
-
type = 'fiat' if self.
|
455
|
-
networks = {}
|
456
|
-
chains = self.
|
507
|
+
type = 'fiat' if self.safe_bool(currency, 'is_fiat') else 'crypto'
|
508
|
+
networks: dict = {}
|
509
|
+
chains = self.safe_list(currency, 'binding_gateways', [])
|
457
510
|
currencyMaxPrecision = self.parse_precision(self.safe_string_2(currency, 'withdrawal_scale', 'scale'))
|
458
511
|
currencyDepositEnabled: Bool = None
|
459
512
|
currencyWithdrawEnabled: Bool = None
|
@@ -461,8 +514,8 @@ class bigone(Exchange, ImplicitAPI):
|
|
461
514
|
chain = chains[j]
|
462
515
|
networkId = self.safe_string(chain, 'gateway_name')
|
463
516
|
networkCode = self.network_id_to_code(networkId)
|
464
|
-
deposit = self.
|
465
|
-
withdraw = self.
|
517
|
+
deposit = self.safe_bool(chain, 'is_deposit_enabled')
|
518
|
+
withdraw = self.safe_bool(chain, 'is_withdrawal_enabled')
|
466
519
|
isActive = (deposit and withdraw)
|
467
520
|
minDepositAmount = self.safe_string(chain, 'min_deposit_amount')
|
468
521
|
minWithdrawalAmount = self.safe_string(chain, 'min_withdrawal_amount')
|
@@ -518,10 +571,12 @@ class bigone(Exchange, ImplicitAPI):
|
|
518
571
|
}
|
519
572
|
return result
|
520
573
|
|
521
|
-
def fetch_markets(self, params={}):
|
574
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
522
575
|
"""
|
523
576
|
retrieves data on all markets for bigone
|
524
|
-
|
577
|
+
|
578
|
+
https://open.big.one/docs/spot_asset_pair.html
|
579
|
+
|
525
580
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
526
581
|
:returns dict[]: an array of objects representing market data
|
527
582
|
"""
|
@@ -581,12 +636,12 @@ class bigone(Exchange, ImplicitAPI):
|
|
581
636
|
# ...
|
582
637
|
# ]
|
583
638
|
#
|
584
|
-
markets = self.
|
639
|
+
markets = self.safe_list(response, 'data', [])
|
585
640
|
result = []
|
586
641
|
for i in range(0, len(markets)):
|
587
642
|
market = markets[i]
|
588
|
-
baseAsset = self.
|
589
|
-
quoteAsset = self.
|
643
|
+
baseAsset = self.safe_dict(market, 'base_asset', {})
|
644
|
+
quoteAsset = self.safe_dict(market, 'quote_asset', {})
|
590
645
|
baseId = self.safe_string(baseAsset, 'symbol')
|
591
646
|
quoteId = self.safe_string(quoteAsset, 'symbol')
|
592
647
|
base = self.safe_currency_code(baseId)
|
@@ -650,7 +705,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
650
705
|
base = self.safe_currency_code(baseId)
|
651
706
|
quote = self.safe_currency_code(quoteId)
|
652
707
|
settle = self.safe_currency_code(settleId)
|
653
|
-
inverse = self.
|
708
|
+
inverse = self.safe_bool(market, 'isInverse')
|
654
709
|
result.append(self.safe_market_structure({
|
655
710
|
'id': marketId,
|
656
711
|
'symbol': base + '/' + quote + ':' + settle,
|
@@ -666,7 +721,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
666
721
|
'swap': True,
|
667
722
|
'future': False,
|
668
723
|
'option': False,
|
669
|
-
'active': self.
|
724
|
+
'active': self.safe_bool(market, 'enable'),
|
670
725
|
'contract': True,
|
671
726
|
'linear': not inverse,
|
672
727
|
'inverse': inverse,
|
@@ -701,7 +756,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
701
756
|
}))
|
702
757
|
return result
|
703
758
|
|
704
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
759
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
705
760
|
#
|
706
761
|
# spot
|
707
762
|
#
|
@@ -752,8 +807,8 @@ class bigone(Exchange, ImplicitAPI):
|
|
752
807
|
marketId = self.safe_string_2(ticker, 'asset_pair_name', 'symbol')
|
753
808
|
symbol = self.safe_symbol(marketId, market, '-', marketType)
|
754
809
|
close = self.safe_string_2(ticker, 'close', 'latestPrice')
|
755
|
-
bid = self.
|
756
|
-
ask = self.
|
810
|
+
bid = self.safe_dict(ticker, 'bid', {})
|
811
|
+
ask = self.safe_dict(ticker, 'ask', {})
|
757
812
|
return self.safe_ticker({
|
758
813
|
'symbol': symbol,
|
759
814
|
'timestamp': None,
|
@@ -774,13 +829,17 @@ class bigone(Exchange, ImplicitAPI):
|
|
774
829
|
'average': None,
|
775
830
|
'baseVolume': self.safe_string_2(ticker, 'volume', 'volume24h'),
|
776
831
|
'quoteVolume': self.safe_string(ticker, 'volume24hInUsd'),
|
832
|
+
'markPrice': self.safe_string(ticker, 'markPrice'),
|
833
|
+
'indexPrice': self.safe_string(ticker, 'indexPrice'),
|
777
834
|
'info': ticker,
|
778
835
|
}, market)
|
779
836
|
|
780
837
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
781
838
|
"""
|
782
839
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
783
|
-
|
840
|
+
|
841
|
+
https://open.big.one/docs/spot_tickers.html
|
842
|
+
|
784
843
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
785
844
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
786
845
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -790,7 +849,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
790
849
|
type = None
|
791
850
|
type, params = self.handle_market_type_and_params('fetchTicker', market, params)
|
792
851
|
if type == 'spot':
|
793
|
-
request = {
|
852
|
+
request: dict = {
|
794
853
|
'asset_pair_name': market['id'],
|
795
854
|
}
|
796
855
|
response = self.publicGetAssetPairsAssetPairNameTicker(self.extend(request, params))
|
@@ -810,7 +869,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
810
869
|
# }
|
811
870
|
# }
|
812
871
|
#
|
813
|
-
ticker = self.
|
872
|
+
ticker = self.safe_dict(response, 'data', {})
|
814
873
|
return self.parse_ticker(ticker, market)
|
815
874
|
else:
|
816
875
|
tickers = self.fetch_tickers([symbol], params)
|
@@ -819,7 +878,9 @@ class bigone(Exchange, ImplicitAPI):
|
|
819
878
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
820
879
|
"""
|
821
880
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
822
|
-
|
881
|
+
|
882
|
+
https://open.big.one/docs/spot_tickers.html
|
883
|
+
|
823
884
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
824
885
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
825
886
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -832,7 +893,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
832
893
|
type = None
|
833
894
|
type, params = self.handle_market_type_and_params('fetchTickers', market, params)
|
834
895
|
isSpot = type == 'spot'
|
835
|
-
request = {}
|
896
|
+
request: dict = {}
|
836
897
|
symbols = self.market_symbols(symbols)
|
837
898
|
data = None
|
838
899
|
if isSpot:
|
@@ -867,7 +928,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
867
928
|
# ]
|
868
929
|
# }
|
869
930
|
#
|
870
|
-
data = self.
|
931
|
+
data = self.safe_list(response, 'data', [])
|
871
932
|
else:
|
872
933
|
data = self.contractPublicGetInstruments(params)
|
873
934
|
#
|
@@ -901,7 +962,9 @@ class bigone(Exchange, ImplicitAPI):
|
|
901
962
|
def fetch_time(self, params={}):
|
902
963
|
"""
|
903
964
|
fetches the current integer timestamp in milliseconds from the exchange server
|
904
|
-
|
965
|
+
|
966
|
+
https://open.big.one/docs/spot_ping.html
|
967
|
+
|
905
968
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
906
969
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
907
970
|
"""
|
@@ -913,14 +976,16 @@ class bigone(Exchange, ImplicitAPI):
|
|
913
976
|
# }
|
914
977
|
# }
|
915
978
|
#
|
916
|
-
data = self.
|
979
|
+
data = self.safe_dict(response, 'data', {})
|
917
980
|
timestamp = self.safe_integer(data, 'Timestamp')
|
918
981
|
return self.parse_to_int(timestamp / 1000000)
|
919
982
|
|
920
983
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
921
984
|
"""
|
922
985
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
923
|
-
|
986
|
+
|
987
|
+
https://open.big.one/docs/contract_misc.html#get-orderbook-snapshot
|
988
|
+
|
924
989
|
:param str symbol: unified symbol of the market to fetch the order book for
|
925
990
|
:param int [limit]: the maximum amount of order book entries to return
|
926
991
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -930,7 +995,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
930
995
|
market = self.market(symbol)
|
931
996
|
response = None
|
932
997
|
if market['contract']:
|
933
|
-
request = {
|
998
|
+
request: dict = {
|
934
999
|
'symbol': market['id'],
|
935
1000
|
}
|
936
1001
|
response = self.contractPublicGetDepthSymbolSnapshot(self.extend(request, params))
|
@@ -963,7 +1028,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
963
1028
|
#
|
964
1029
|
return self.parse_contract_order_book(response, market['symbol'], limit)
|
965
1030
|
else:
|
966
|
-
request = {
|
1031
|
+
request: dict = {
|
967
1032
|
'asset_pair_name': market['id'],
|
968
1033
|
}
|
969
1034
|
if limit is not None:
|
@@ -983,7 +1048,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
983
1048
|
# }
|
984
1049
|
# }
|
985
1050
|
#
|
986
|
-
orderbook = self.
|
1051
|
+
orderbook = self.safe_dict(response, 'data', {})
|
987
1052
|
return self.parse_order_book(orderbook, market['symbol'], None, 'bids', 'asks', 'price', 'quantity')
|
988
1053
|
|
989
1054
|
def parse_contract_bids_asks(self, bidsAsks):
|
@@ -1009,7 +1074,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1009
1074
|
'nonce': None,
|
1010
1075
|
}
|
1011
1076
|
|
1012
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1077
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
1013
1078
|
#
|
1014
1079
|
# fetchTrades(public)
|
1015
1080
|
#
|
@@ -1078,7 +1143,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1078
1143
|
elif takerOrderId is not None:
|
1079
1144
|
orderId = takerOrderId
|
1080
1145
|
id = self.safe_string(trade, 'id')
|
1081
|
-
result = {
|
1146
|
+
result: dict = {
|
1082
1147
|
'id': id,
|
1083
1148
|
'timestamp': timestamp,
|
1084
1149
|
'datetime': self.iso8601(timestamp),
|
@@ -1135,7 +1200,9 @@ class bigone(Exchange, ImplicitAPI):
|
|
1135
1200
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
1136
1201
|
"""
|
1137
1202
|
get the list of most recent trades for a particular symbol
|
1138
|
-
|
1203
|
+
|
1204
|
+
https://open.big.one/docs/spot_asset_pair_trade.html
|
1205
|
+
|
1139
1206
|
:param str symbol: unified symbol of the market to fetch trades for
|
1140
1207
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
1141
1208
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -1146,7 +1213,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1146
1213
|
market = self.market(symbol)
|
1147
1214
|
if market['contract']:
|
1148
1215
|
raise BadRequest(self.id + ' fetchTrades() can only fetch trades for spot markets')
|
1149
|
-
request = {
|
1216
|
+
request: dict = {
|
1150
1217
|
'asset_pair_name': market['id'],
|
1151
1218
|
}
|
1152
1219
|
response = self.publicGetAssetPairsAssetPairNameTrades(self.extend(request, params))
|
@@ -1171,7 +1238,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1171
1238
|
# ]
|
1172
1239
|
# }
|
1173
1240
|
#
|
1174
|
-
trades = self.
|
1241
|
+
trades = self.safe_list(response, 'data', [])
|
1175
1242
|
return self.parse_trades(trades, market, since, limit)
|
1176
1243
|
|
1177
1244
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -1197,30 +1264,42 @@ class bigone(Exchange, ImplicitAPI):
|
|
1197
1264
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
1198
1265
|
"""
|
1199
1266
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
1200
|
-
|
1267
|
+
|
1268
|
+
https://open.big.one/docs/spot_asset_pair_candle.html
|
1269
|
+
|
1201
1270
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
1202
1271
|
:param str timeframe: the length of time each candle represents
|
1203
1272
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
1204
1273
|
:param int [limit]: the maximum amount of candles to fetch
|
1205
1274
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1275
|
+
:param int [params.until]: timestamp in ms of the earliest candle to fetch
|
1206
1276
|
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
1207
1277
|
"""
|
1208
1278
|
self.load_markets()
|
1209
1279
|
market = self.market(symbol)
|
1210
1280
|
if market['contract']:
|
1211
1281
|
raise BadRequest(self.id + ' fetchOHLCV() can only fetch ohlcvs for spot markets')
|
1282
|
+
until = self.safe_integer(params, 'until')
|
1283
|
+
untilIsDefined = (until is not None)
|
1284
|
+
sinceIsDefined = (since is not None)
|
1212
1285
|
if limit is None:
|
1213
|
-
limit = 100 # default 100, max 500
|
1214
|
-
request = {
|
1286
|
+
limit = 500 if (sinceIsDefined and untilIsDefined) else 100 # default 100, max 500, if since and limit defined then fetch all the candles between them unless it exceeds the max of 500
|
1287
|
+
request: dict = {
|
1215
1288
|
'asset_pair_name': market['id'],
|
1216
1289
|
'period': self.safe_string(self.timeframes, timeframe, timeframe),
|
1217
1290
|
'limit': limit,
|
1218
1291
|
}
|
1219
|
-
if
|
1292
|
+
if sinceIsDefined:
|
1220
1293
|
# start = self.parse_to_int(since / 1000)
|
1221
1294
|
duration = self.parse_timeframe(timeframe)
|
1222
|
-
|
1223
|
-
|
1295
|
+
endByLimit = self.sum(since, limit * duration * 1000)
|
1296
|
+
if untilIsDefined:
|
1297
|
+
request['time'] = self.iso8601(min(endByLimit, until + 1))
|
1298
|
+
else:
|
1299
|
+
request['time'] = self.iso8601(endByLimit)
|
1300
|
+
elif untilIsDefined:
|
1301
|
+
request['time'] = self.iso8601(until + 1)
|
1302
|
+
params = self.omit(params, 'until')
|
1224
1303
|
response = self.publicGetAssetPairsAssetPairNameCandles(self.extend(request, params))
|
1225
1304
|
#
|
1226
1305
|
# {
|
@@ -1245,16 +1324,16 @@ class bigone(Exchange, ImplicitAPI):
|
|
1245
1324
|
# ]
|
1246
1325
|
# }
|
1247
1326
|
#
|
1248
|
-
data = self.
|
1327
|
+
data = self.safe_list(response, 'data', [])
|
1249
1328
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
1250
1329
|
|
1251
1330
|
def parse_balance(self, response) -> Balances:
|
1252
|
-
result = {
|
1331
|
+
result: dict = {
|
1253
1332
|
'info': response,
|
1254
1333
|
'timestamp': None,
|
1255
1334
|
'datetime': None,
|
1256
1335
|
}
|
1257
|
-
balances = self.
|
1336
|
+
balances = self.safe_list(response, 'data', [])
|
1258
1337
|
for i in range(0, len(balances)):
|
1259
1338
|
balance = balances[i]
|
1260
1339
|
symbol = self.safe_string(balance, 'asset_symbol')
|
@@ -1268,8 +1347,10 @@ class bigone(Exchange, ImplicitAPI):
|
|
1268
1347
|
def fetch_balance(self, params={}) -> Balances:
|
1269
1348
|
"""
|
1270
1349
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
1271
|
-
|
1272
|
-
|
1350
|
+
|
1351
|
+
https://open.big.one/docs/fund_accounts.html
|
1352
|
+
https://open.big.one/docs/spot_accounts.html
|
1353
|
+
|
1273
1354
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1274
1355
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
1275
1356
|
"""
|
@@ -1294,7 +1375,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1294
1375
|
return self.parse_balance(response)
|
1295
1376
|
|
1296
1377
|
def parse_type(self, type: str):
|
1297
|
-
types = {
|
1378
|
+
types: dict = {
|
1298
1379
|
'STOP_LIMIT': 'limit',
|
1299
1380
|
'STOP_MARKET': 'market',
|
1300
1381
|
'LIMIT': 'limit',
|
@@ -1302,7 +1383,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1302
1383
|
}
|
1303
1384
|
return self.safe_string(types, type, type)
|
1304
1385
|
|
1305
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1386
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1306
1387
|
#
|
1307
1388
|
# {
|
1308
1389
|
# "id": "42154072251",
|
@@ -1334,7 +1415,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1334
1415
|
triggerPrice = self.safe_string(order, 'stop_price')
|
1335
1416
|
if Precise.string_eq(triggerPrice, '0'):
|
1336
1417
|
triggerPrice = None
|
1337
|
-
immediateOrCancel = self.
|
1418
|
+
immediateOrCancel = self.safe_bool(order, 'immediate_or_cancel')
|
1338
1419
|
timeInForce = None
|
1339
1420
|
if immediateOrCancel:
|
1340
1421
|
timeInForce = 'IOC'
|
@@ -1358,10 +1439,9 @@ class bigone(Exchange, ImplicitAPI):
|
|
1358
1439
|
'symbol': symbol,
|
1359
1440
|
'type': type,
|
1360
1441
|
'timeInForce': timeInForce,
|
1361
|
-
'postOnly': self.
|
1442
|
+
'postOnly': self.safe_bool(order, 'post_only'),
|
1362
1443
|
'side': side,
|
1363
1444
|
'price': price,
|
1364
|
-
'stopPrice': triggerPrice,
|
1365
1445
|
'triggerPrice': triggerPrice,
|
1366
1446
|
'amount': amount,
|
1367
1447
|
'cost': cost,
|
@@ -1376,7 +1456,9 @@ class bigone(Exchange, ImplicitAPI):
|
|
1376
1456
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
1377
1457
|
"""
|
1378
1458
|
create a market buy order by providing the symbol and cost
|
1379
|
-
|
1459
|
+
|
1460
|
+
https://open.big.one/docs/spot_orders.html#create-order
|
1461
|
+
|
1380
1462
|
:param str symbol: unified symbol of the market to create an order in
|
1381
1463
|
:param float cost: how much you want to trade in units of the quote currency
|
1382
1464
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1392,21 +1474,23 @@ class bigone(Exchange, ImplicitAPI):
|
|
1392
1474
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1393
1475
|
"""
|
1394
1476
|
create a trade order
|
1395
|
-
|
1477
|
+
|
1478
|
+
https://open.big.one/docs/spot_orders.html#create-order
|
1479
|
+
|
1396
1480
|
:param str symbol: unified symbol of the market to create an order in
|
1397
1481
|
:param str type: 'market' or 'limit'
|
1398
1482
|
:param str side: 'buy' or 'sell'
|
1399
1483
|
:param float amount: how much of currency you want to trade in units of base currency
|
1400
|
-
:param float [price]: the price at which the order is to be
|
1484
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1401
1485
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1402
1486
|
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
1403
1487
|
:param bool [params.postOnly]: if True, the order will only be posted to the order book and not executed immediately
|
1404
1488
|
:param str [params.timeInForce]: "GTC", "IOC", or "PO"
|
1405
1489
|
:param float [params.cost]: *spot market buy only* the quote quantity that can be used alternative for the amount
|
1406
|
-
|
1407
|
-
|
1408
|
-
:param str operator: *stop order only* GTE or LTE(default)
|
1409
|
-
:param str client_order_id: must match ^[a-zA-Z0-9-_]{1,36}$ self regex. client_order_id is unique in 24 hours, If created 24 hours later and the order closed, it will be released and can be reused
|
1490
|
+
|
1491
|
+
EXCHANGE SPECIFIC PARAMETERS
|
1492
|
+
:param str [params.operator]: *stop order only* GTE or LTE(default)
|
1493
|
+
:param str [params.client_order_id]: must match ^[a-zA-Z0-9-_]{1,36}$ self regex. client_order_id is unique in 24 hours, If created 24 hours later and the order closed, it will be released and can be reused
|
1410
1494
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1411
1495
|
"""
|
1412
1496
|
self.load_markets()
|
@@ -1419,7 +1503,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1419
1503
|
postOnly = None
|
1420
1504
|
postOnly, params = self.handle_post_only((uppercaseType == 'MARKET'), exchangeSpecificParam, params)
|
1421
1505
|
triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'stop_price'])
|
1422
|
-
request = {
|
1506
|
+
request: dict = {
|
1423
1507
|
'asset_pair_name': market['id'], # asset pair name BTC-USDT, required
|
1424
1508
|
'side': requestSide, # order side one of "ASK"/"BID", required
|
1425
1509
|
'amount': self.amount_to_precision(symbol, amount), # order amount, string, required
|
@@ -1483,20 +1567,22 @@ class bigone(Exchange, ImplicitAPI):
|
|
1483
1567
|
# "updated_at":"2019-01-29T06:05:56Z"
|
1484
1568
|
# }
|
1485
1569
|
#
|
1486
|
-
order = self.
|
1570
|
+
order = self.safe_dict(response, 'data')
|
1487
1571
|
return self.parse_order(order, market)
|
1488
1572
|
|
1489
1573
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1490
1574
|
"""
|
1491
1575
|
cancels an open order
|
1492
|
-
|
1576
|
+
|
1577
|
+
https://open.big.one/docs/spot_orders.html#cancel-order
|
1578
|
+
|
1493
1579
|
:param str id: order id
|
1494
1580
|
:param str symbol: Not used by bigone cancelOrder()
|
1495
1581
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1496
1582
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1497
1583
|
"""
|
1498
1584
|
self.load_markets()
|
1499
|
-
request = {'id': id}
|
1585
|
+
request: dict = {'id': id}
|
1500
1586
|
response = self.privatePostOrdersIdCancel(self.extend(request, params))
|
1501
1587
|
# {
|
1502
1588
|
# "id": 10,
|
@@ -1510,20 +1596,22 @@ class bigone(Exchange, ImplicitAPI):
|
|
1510
1596
|
# "created_at":"2019-01-29T06:05:56Z",
|
1511
1597
|
# "updated_at":"2019-01-29T06:05:56Z"
|
1512
1598
|
# }
|
1513
|
-
order = self.
|
1599
|
+
order = self.safe_dict(response, 'data')
|
1514
1600
|
return self.parse_order(order)
|
1515
1601
|
|
1516
1602
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1517
1603
|
"""
|
1518
1604
|
cancel all open orders
|
1519
|
-
|
1605
|
+
|
1606
|
+
https://open.big.one/docs/spot_orders.html#cancel-all-orders
|
1607
|
+
|
1520
1608
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
1521
1609
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1522
1610
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1523
1611
|
"""
|
1524
1612
|
self.load_markets()
|
1525
1613
|
market = self.market(symbol)
|
1526
|
-
request = {
|
1614
|
+
request: dict = {
|
1527
1615
|
'asset_pair_name': market['id'],
|
1528
1616
|
}
|
1529
1617
|
response = self.privatePostOrdersCancel(self.extend(request, params))
|
@@ -1539,26 +1627,49 @@ class bigone(Exchange, ImplicitAPI):
|
|
1539
1627
|
# }
|
1540
1628
|
# }
|
1541
1629
|
#
|
1542
|
-
|
1630
|
+
data = self.safe_dict(response, 'data', {})
|
1631
|
+
cancelled = self.safe_list(data, 'cancelled', [])
|
1632
|
+
failed = self.safe_list(data, 'failed', [])
|
1633
|
+
result = []
|
1634
|
+
for i in range(0, len(cancelled)):
|
1635
|
+
orderId = cancelled[i]
|
1636
|
+
result.append(self.safe_order({
|
1637
|
+
'info': orderId,
|
1638
|
+
'id': orderId,
|
1639
|
+
'status': 'canceled',
|
1640
|
+
}))
|
1641
|
+
for i in range(0, len(failed)):
|
1642
|
+
orderId = failed[i]
|
1643
|
+
result.append(self.safe_order({
|
1644
|
+
'info': orderId,
|
1645
|
+
'id': orderId,
|
1646
|
+
'status': 'failed',
|
1647
|
+
}))
|
1648
|
+
return result
|
1543
1649
|
|
1544
1650
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1545
1651
|
"""
|
1546
1652
|
fetches information on an order made by the user
|
1547
|
-
|
1653
|
+
|
1654
|
+
https://open.big.one/docs/spot_orders.html#get-one-order
|
1655
|
+
|
1656
|
+
:param str id: the order id
|
1548
1657
|
:param str symbol: not used by bigone fetchOrder
|
1549
1658
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1550
1659
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1551
1660
|
"""
|
1552
1661
|
self.load_markets()
|
1553
|
-
request = {'id': id}
|
1662
|
+
request: dict = {'id': id}
|
1554
1663
|
response = self.privateGetOrdersId(self.extend(request, params))
|
1555
|
-
order = self.
|
1664
|
+
order = self.safe_dict(response, 'data', {})
|
1556
1665
|
return self.parse_order(order)
|
1557
1666
|
|
1558
1667
|
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1559
1668
|
"""
|
1560
1669
|
fetches information on multiple orders made by the user
|
1561
|
-
|
1670
|
+
|
1671
|
+
https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
|
1672
|
+
|
1562
1673
|
:param str symbol: unified market symbol of the market orders were made in
|
1563
1674
|
:param int [since]: the earliest time in ms to fetch orders for
|
1564
1675
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -1569,7 +1680,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1569
1680
|
raise ArgumentsRequired(self.id + ' fetchOrders() requires a symbol argument')
|
1570
1681
|
self.load_markets()
|
1571
1682
|
market = self.market(symbol)
|
1572
|
-
request = {
|
1683
|
+
request: dict = {
|
1573
1684
|
'asset_pair_name': market['id'],
|
1574
1685
|
# 'page_token': 'dxzef', # request page after self page token
|
1575
1686
|
# 'side': 'ASK', # 'ASK' or 'BID', optional
|
@@ -1599,13 +1710,15 @@ class bigone(Exchange, ImplicitAPI):
|
|
1599
1710
|
# "page_token":"dxzef",
|
1600
1711
|
# }
|
1601
1712
|
#
|
1602
|
-
orders = self.
|
1713
|
+
orders = self.safe_list(response, 'data', [])
|
1603
1714
|
return self.parse_orders(orders, market, since, limit)
|
1604
1715
|
|
1605
1716
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1606
1717
|
"""
|
1607
1718
|
fetch all trades made by the user
|
1608
|
-
|
1719
|
+
|
1720
|
+
https://open.big.one/docs/spot_trade.html#trades-of-user
|
1721
|
+
|
1609
1722
|
:param str symbol: unified market symbol
|
1610
1723
|
:param int [since]: the earliest time in ms to fetch trades for
|
1611
1724
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -1616,7 +1729,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1616
1729
|
raise ArgumentsRequired(self.id + ' fetchMyTrades() requires a symbol argument')
|
1617
1730
|
self.load_markets()
|
1618
1731
|
market = self.market(symbol)
|
1619
|
-
request = {
|
1732
|
+
request: dict = {
|
1620
1733
|
'asset_pair_name': market['id'],
|
1621
1734
|
# 'page_token': 'dxzef', # request page after self page token
|
1622
1735
|
}
|
@@ -1657,11 +1770,11 @@ class bigone(Exchange, ImplicitAPI):
|
|
1657
1770
|
# "page_token":"dxfv"
|
1658
1771
|
# }
|
1659
1772
|
#
|
1660
|
-
trades = self.
|
1773
|
+
trades = self.safe_list(response, 'data', [])
|
1661
1774
|
return self.parse_trades(trades, market, since, limit)
|
1662
1775
|
|
1663
|
-
def parse_order_status(self, status):
|
1664
|
-
statuses = {
|
1776
|
+
def parse_order_status(self, status: Str):
|
1777
|
+
statuses: dict = {
|
1665
1778
|
'PENDING': 'open',
|
1666
1779
|
'FILLED': 'closed',
|
1667
1780
|
'CANCELLED': 'canceled',
|
@@ -1671,14 +1784,16 @@ class bigone(Exchange, ImplicitAPI):
|
|
1671
1784
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1672
1785
|
"""
|
1673
1786
|
fetch all unfilled currently open orders
|
1674
|
-
|
1787
|
+
|
1788
|
+
https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
|
1789
|
+
|
1675
1790
|
:param str symbol: unified market symbol
|
1676
1791
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1677
1792
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
1678
1793
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1679
1794
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1680
1795
|
"""
|
1681
|
-
request = {
|
1796
|
+
request: dict = {
|
1682
1797
|
'state': 'PENDING',
|
1683
1798
|
}
|
1684
1799
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -1686,14 +1801,16 @@ class bigone(Exchange, ImplicitAPI):
|
|
1686
1801
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1687
1802
|
"""
|
1688
1803
|
fetches information on multiple closed orders made by the user
|
1689
|
-
|
1804
|
+
|
1805
|
+
https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair
|
1806
|
+
|
1690
1807
|
:param str symbol: unified market symbol of the market orders were made in
|
1691
1808
|
:param int [since]: the earliest time in ms to fetch orders for
|
1692
1809
|
:param int [limit]: the maximum number of order structures to retrieve
|
1693
1810
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1694
1811
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1695
1812
|
"""
|
1696
|
-
request = {
|
1813
|
+
request: dict = {
|
1697
1814
|
'state': 'FILLED',
|
1698
1815
|
}
|
1699
1816
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -1713,7 +1830,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1713
1830
|
else:
|
1714
1831
|
self.check_required_credentials()
|
1715
1832
|
nonce = str(self.nonce())
|
1716
|
-
request = {
|
1833
|
+
request: dict = {
|
1717
1834
|
'type': 'OpenAPIV2',
|
1718
1835
|
'sub': self.apiKey,
|
1719
1836
|
'nonce': nonce,
|
@@ -1730,17 +1847,19 @@ class bigone(Exchange, ImplicitAPI):
|
|
1730
1847
|
headers['User-Agent'] = 'ccxt/' + self.id + '-' + self.version
|
1731
1848
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
1732
1849
|
|
1733
|
-
def fetch_deposit_address(self, code: str, params={}):
|
1850
|
+
def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1734
1851
|
"""
|
1735
1852
|
fetch the deposit address for a currency associated with self account
|
1736
|
-
|
1853
|
+
|
1854
|
+
https://open.big.one/docs/spot_deposit.html#get-deposite-address-of-one-asset-of-user
|
1855
|
+
|
1737
1856
|
:param str code: unified currency code
|
1738
1857
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1739
1858
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
1740
1859
|
"""
|
1741
1860
|
self.load_markets()
|
1742
1861
|
currency = self.currency(code)
|
1743
|
-
request = {
|
1862
|
+
request: dict = {
|
1744
1863
|
'asset_symbol': currency['id'],
|
1745
1864
|
}
|
1746
1865
|
networkCode, paramsOmitted = self.handle_network_code_and_params(params)
|
@@ -1762,26 +1881,26 @@ class bigone(Exchange, ImplicitAPI):
|
|
1762
1881
|
# ]
|
1763
1882
|
# }
|
1764
1883
|
#
|
1765
|
-
data = self.
|
1884
|
+
data = self.safe_list(response, 'data', [])
|
1766
1885
|
dataLength = len(data)
|
1767
1886
|
if dataLength < 1:
|
1768
1887
|
raise ExchangeError(self.id + ' fetchDepositAddress() returned empty address response')
|
1769
1888
|
chainsIndexedById = self.index_by(data, 'chain')
|
1770
1889
|
selectedNetworkId = self.select_network_id_from_raw_networks(code, networkCode, chainsIndexedById)
|
1771
|
-
addressObject = self.
|
1890
|
+
addressObject = self.safe_dict(chainsIndexedById, selectedNetworkId, {})
|
1772
1891
|
address = self.safe_string(addressObject, 'value')
|
1773
1892
|
tag = self.safe_string(addressObject, 'memo')
|
1774
1893
|
self.check_address(address)
|
1775
1894
|
return {
|
1895
|
+
'info': response,
|
1776
1896
|
'currency': code,
|
1897
|
+
'network': self.network_id_to_code(selectedNetworkId),
|
1777
1898
|
'address': address,
|
1778
1899
|
'tag': tag,
|
1779
|
-
'network': self.network_id_to_code(selectedNetworkId),
|
1780
|
-
'info': response,
|
1781
1900
|
}
|
1782
1901
|
|
1783
|
-
def parse_transaction_status(self, status):
|
1784
|
-
statuses = {
|
1902
|
+
def parse_transaction_status(self, status: Str):
|
1903
|
+
statuses: dict = {
|
1785
1904
|
# what are other statuses here?
|
1786
1905
|
'WITHHOLD': 'ok', # deposits
|
1787
1906
|
'UNCONFIRMED': 'pending',
|
@@ -1791,7 +1910,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1791
1910
|
}
|
1792
1911
|
return self.safe_string(statuses, status, status)
|
1793
1912
|
|
1794
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1913
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1795
1914
|
#
|
1796
1915
|
# fetchDeposits
|
1797
1916
|
#
|
@@ -1854,7 +1973,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1854
1973
|
address = self.safe_string(transaction, 'target_address')
|
1855
1974
|
tag = self.safe_string(transaction, 'memo')
|
1856
1975
|
type = 'withdrawal' if ('customer_id' in transaction) else 'deposit'
|
1857
|
-
internal = self.
|
1976
|
+
internal = self.safe_bool(transaction, 'is_internal')
|
1858
1977
|
return {
|
1859
1978
|
'info': transaction,
|
1860
1979
|
'id': id,
|
@@ -1881,7 +2000,9 @@ class bigone(Exchange, ImplicitAPI):
|
|
1881
2000
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1882
2001
|
"""
|
1883
2002
|
fetch all deposits made to an account
|
1884
|
-
|
2003
|
+
|
2004
|
+
https://open.big.one/docs/spot_deposit.html#deposit-of-user
|
2005
|
+
|
1885
2006
|
:param str code: unified currency code
|
1886
2007
|
:param int [since]: the earliest time in ms to fetch deposits for
|
1887
2008
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -1889,7 +2010,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1889
2010
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
1890
2011
|
"""
|
1891
2012
|
self.load_markets()
|
1892
|
-
request = {
|
2013
|
+
request: dict = {
|
1893
2014
|
# 'page_token': 'dxzef', # request page after self page token
|
1894
2015
|
# 'limit': 50, # optional, default 50
|
1895
2016
|
# 'kind': 'string', # optional - air_drop, big_holder_dividend, default, eosc_to_eos, internal, equally_airdrop, referral_mining, one_holder_dividend, single_customer, snapshotted_airdrop, trade_mining
|
@@ -1923,13 +2044,15 @@ class bigone(Exchange, ImplicitAPI):
|
|
1923
2044
|
# ]
|
1924
2045
|
# }
|
1925
2046
|
#
|
1926
|
-
deposits = self.
|
2047
|
+
deposits = self.safe_list(response, 'data', [])
|
1927
2048
|
return self.parse_transactions(deposits, currency, since, limit)
|
1928
2049
|
|
1929
2050
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1930
2051
|
"""
|
1931
2052
|
fetch all withdrawals made from an account
|
1932
|
-
|
2053
|
+
|
2054
|
+
https://open.big.one/docs/spot_withdrawal.html#get-withdrawals-of-user
|
2055
|
+
|
1933
2056
|
:param str code: unified currency code
|
1934
2057
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
1935
2058
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -1937,7 +2060,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1937
2060
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
1938
2061
|
"""
|
1939
2062
|
self.load_markets()
|
1940
|
-
request = {
|
2063
|
+
request: dict = {
|
1941
2064
|
# 'page_token': 'dxzef', # request page after self page token
|
1942
2065
|
# 'limit': 50, # optional, default 50
|
1943
2066
|
# 'kind': 'string', # optional - air_drop, big_holder_dividend, default, eosc_to_eos, internal, equally_airdrop, referral_mining, one_holder_dividend, single_customer, snapshotted_airdrop, trade_mining
|
@@ -1971,13 +2094,15 @@ class bigone(Exchange, ImplicitAPI):
|
|
1971
2094
|
# "page_token":"dxvf"
|
1972
2095
|
# }
|
1973
2096
|
#
|
1974
|
-
withdrawals = self.
|
2097
|
+
withdrawals = self.safe_list(response, 'data', [])
|
1975
2098
|
return self.parse_transactions(withdrawals, currency, since, limit)
|
1976
2099
|
|
1977
2100
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1978
2101
|
"""
|
1979
2102
|
transfer currency internally between wallets on the same account
|
1980
|
-
|
2103
|
+
|
2104
|
+
https://open.big.one/docs/spot_transfer.html#transfer-of-user
|
2105
|
+
|
1981
2106
|
:param str code: unified currency code
|
1982
2107
|
:param float amount: amount to transfer
|
1983
2108
|
:param str fromAccount: 'SPOT', 'FUND', or 'CONTRACT'
|
@@ -1987,11 +2112,11 @@ class bigone(Exchange, ImplicitAPI):
|
|
1987
2112
|
"""
|
1988
2113
|
self.load_markets()
|
1989
2114
|
currency = self.currency(code)
|
1990
|
-
accountsByType = self.
|
2115
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
1991
2116
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
1992
2117
|
toId = self.safe_string(accountsByType, toAccount, toAccount)
|
1993
2118
|
guid = self.safe_string(params, 'guid', self.uuid())
|
1994
|
-
request = {
|
2119
|
+
request: dict = {
|
1995
2120
|
'symbol': currency['id'],
|
1996
2121
|
'amount': self.currency_to_precision(code, amount),
|
1997
2122
|
'from': fromId,
|
@@ -2008,7 +2133,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
2008
2133
|
# }
|
2009
2134
|
#
|
2010
2135
|
transfer = self.parse_transfer(response, currency)
|
2011
|
-
transferOptions = self.
|
2136
|
+
transferOptions = self.safe_dict(self.options, 'transfer', {})
|
2012
2137
|
fillResponseFromRequest = self.safe_bool(transferOptions, 'fillResponseFromRequest', True)
|
2013
2138
|
if fillResponseFromRequest:
|
2014
2139
|
transfer['fromAccount'] = fromAccount
|
@@ -2017,14 +2142,14 @@ class bigone(Exchange, ImplicitAPI):
|
|
2017
2142
|
transfer['id'] = guid
|
2018
2143
|
return transfer
|
2019
2144
|
|
2020
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
2145
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
2021
2146
|
#
|
2022
2147
|
# {
|
2023
2148
|
# "code": 0,
|
2024
2149
|
# "data": null
|
2025
2150
|
# }
|
2026
2151
|
#
|
2027
|
-
code = self.
|
2152
|
+
code = self.safe_string(transfer, 'code')
|
2028
2153
|
return {
|
2029
2154
|
'info': transfer,
|
2030
2155
|
'id': None,
|
@@ -2037,16 +2162,18 @@ class bigone(Exchange, ImplicitAPI):
|
|
2037
2162
|
'status': self.parse_transfer_status(code),
|
2038
2163
|
}
|
2039
2164
|
|
2040
|
-
def parse_transfer_status(self, status):
|
2041
|
-
statuses = {
|
2165
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
2166
|
+
statuses: dict = {
|
2042
2167
|
'0': 'ok',
|
2043
2168
|
}
|
2044
2169
|
return self.safe_string(statuses, status, 'failed')
|
2045
2170
|
|
2046
|
-
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2171
|
+
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2047
2172
|
"""
|
2048
2173
|
make a withdrawal
|
2049
|
-
|
2174
|
+
|
2175
|
+
https://open.big.one/docs/spot_withdrawal.html#create-withdrawal-of-user
|
2176
|
+
|
2050
2177
|
:param str code: unified currency code
|
2051
2178
|
:param float amount: the amount to withdraw
|
2052
2179
|
:param str address: the address to withdraw to
|
@@ -2057,7 +2184,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
2057
2184
|
tag, params = self.handle_withdraw_tag_and_params(tag, params)
|
2058
2185
|
self.load_markets()
|
2059
2186
|
currency = self.currency(code)
|
2060
|
-
request = {
|
2187
|
+
request: dict = {
|
2061
2188
|
'symbol': currency['id'],
|
2062
2189
|
'target_address': address,
|
2063
2190
|
'amount': self.currency_to_precision(code, amount),
|
@@ -2091,10 +2218,10 @@ class bigone(Exchange, ImplicitAPI):
|
|
2091
2218
|
# }
|
2092
2219
|
# }
|
2093
2220
|
#
|
2094
|
-
data = self.
|
2221
|
+
data = self.safe_dict(response, 'data', {})
|
2095
2222
|
return self.parse_transaction(data, currency)
|
2096
2223
|
|
2097
|
-
def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
2224
|
+
def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
|
2098
2225
|
if response is None:
|
2099
2226
|
return None # fallback to default error handler
|
2100
2227
|
#
|