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/coinbaseinternational.py
CHANGED
@@ -6,16 +6,16 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinbaseinternational import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Order, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from typing import Any
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
|
+
from ccxt.base.errors import AuthenticationError
|
13
14
|
from ccxt.base.errors import PermissionDenied
|
14
15
|
from ccxt.base.errors import ArgumentsRequired
|
15
16
|
from ccxt.base.errors import BadRequest
|
16
17
|
from ccxt.base.errors import InvalidOrder
|
17
18
|
from ccxt.base.errors import DuplicateOrderId
|
18
|
-
from ccxt.base.errors import AuthenticationError
|
19
19
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
20
20
|
from ccxt.base.precise import Precise
|
21
21
|
|
@@ -74,7 +74,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
74
74
|
'fetchCrossBorrowRates': False,
|
75
75
|
'fetchCurrencies': True,
|
76
76
|
'fetchDeposits': True,
|
77
|
-
'fetchFundingHistory':
|
77
|
+
'fetchFundingHistory': True,
|
78
78
|
'fetchFundingRate': False,
|
79
79
|
'fetchFundingRateHistory': True,
|
80
80
|
'fetchFundingRates': False,
|
@@ -85,21 +85,24 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
85
85
|
'fetchLedger': False,
|
86
86
|
'fetchLeverage': False,
|
87
87
|
'fetchLeverageTiers': False,
|
88
|
+
'fetchMarginAdjustmentHistory': False,
|
88
89
|
'fetchMarginMode': False,
|
89
90
|
'fetchMarkets': True,
|
90
91
|
'fetchMarkOHLCV': False,
|
91
92
|
'fetchMyBuys': True,
|
92
93
|
'fetchMySells': True,
|
93
94
|
'fetchMyTrades': True,
|
94
|
-
'fetchOHLCV':
|
95
|
+
'fetchOHLCV': True,
|
95
96
|
'fetchOpenInterestHistory': False,
|
96
97
|
'fetchOpenOrders': True,
|
97
98
|
'fetchOrder': True,
|
98
99
|
'fetchOrderBook': False,
|
99
100
|
'fetchOrders': False,
|
100
101
|
'fetchPosition': True,
|
102
|
+
'fetchPositionHistory': False,
|
101
103
|
'fetchPositionMode': False,
|
102
104
|
'fetchPositions': True,
|
105
|
+
'fetchPositionsHistory': False,
|
103
106
|
'fetchPositionsRisk': False,
|
104
107
|
'fetchPremiumIndexOHLCV': False,
|
105
108
|
'fetchTicker': True,
|
@@ -108,8 +111,10 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
108
111
|
'fetchTrades': False,
|
109
112
|
'fetchTradingFee': False,
|
110
113
|
'fetchTradingFees': False,
|
114
|
+
'fetchTransfers': True,
|
111
115
|
'fetchWithdrawals': True,
|
112
116
|
'reduceMargin': False,
|
117
|
+
'sandbox': True,
|
113
118
|
'setLeverage': False,
|
114
119
|
'setMargin': True,
|
115
120
|
'setMarginMode': False,
|
@@ -126,10 +131,10 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
126
131
|
},
|
127
132
|
'www': 'https://international.coinbase.com',
|
128
133
|
'doc': [
|
129
|
-
'https://docs.cloud.
|
134
|
+
'https://docs.cloud.coinbase.com/intx/docs',
|
130
135
|
],
|
131
136
|
'fees': [
|
132
|
-
'https://help.
|
137
|
+
'https://help.coinbase.com/en/international-exchange/trading-deposits-withdrawals/international-exchange-fees',
|
133
138
|
],
|
134
139
|
'referral': '',
|
135
140
|
},
|
@@ -149,7 +154,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
149
154
|
'instruments/{instrument}',
|
150
155
|
'instruments/{instrument}/quote',
|
151
156
|
'instruments/{instrument}/funding',
|
152
|
-
'',
|
157
|
+
'instruments/{instrument}/candles',
|
153
158
|
],
|
154
159
|
},
|
155
160
|
'private': {
|
@@ -259,6 +264,72 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
259
264
|
'bitcoin': 'BTC',
|
260
265
|
},
|
261
266
|
},
|
267
|
+
'features': {
|
268
|
+
'default': {
|
269
|
+
'sandbox': True,
|
270
|
+
'createOrder': {
|
271
|
+
'marginMode': False,
|
272
|
+
'triggerPrice': True,
|
273
|
+
'triggerPriceType': None,
|
274
|
+
'triggerDirection': True,
|
275
|
+
'stopLossPrice': False, # todo implementation
|
276
|
+
'takeProfitPrice': False, # todo implementation
|
277
|
+
'attachedStopLossTakeProfit': None,
|
278
|
+
'timeInForce': {
|
279
|
+
'IOC': True,
|
280
|
+
'FOK': True,
|
281
|
+
'PO': True,
|
282
|
+
'GTD': True,
|
283
|
+
'GTC': True, # has 30 days max
|
284
|
+
},
|
285
|
+
'hedged': False,
|
286
|
+
'trailing': False,
|
287
|
+
'leverage': False,
|
288
|
+
'marketBuyByCost': False,
|
289
|
+
'marketBuyRequiresPrice': True,
|
290
|
+
'selfTradePrevention': True, # todo: implement
|
291
|
+
'iceberg': False,
|
292
|
+
},
|
293
|
+
'createOrders': None,
|
294
|
+
'fetchMyTrades': {
|
295
|
+
'marginMode': False,
|
296
|
+
'limit': 100,
|
297
|
+
'daysBack': None,
|
298
|
+
'untilDays': 10000,
|
299
|
+
},
|
300
|
+
'fetchOrder': {
|
301
|
+
'marginMode': False,
|
302
|
+
'trigger': False,
|
303
|
+
'trailing': False,
|
304
|
+
},
|
305
|
+
'fetchOpenOrders': {
|
306
|
+
'marginMode': False,
|
307
|
+
'limit': 100,
|
308
|
+
'trigger': False,
|
309
|
+
'trailing': False,
|
310
|
+
},
|
311
|
+
'fetchOrders': None,
|
312
|
+
'fetchClosedOrders': None,
|
313
|
+
'fetchOHLCV': {
|
314
|
+
'limit': 300,
|
315
|
+
},
|
316
|
+
},
|
317
|
+
'spot': {
|
318
|
+
'extends': 'default',
|
319
|
+
},
|
320
|
+
'swap': {
|
321
|
+
'linear': {
|
322
|
+
'extends': 'default',
|
323
|
+
},
|
324
|
+
'inverse': {
|
325
|
+
'extends': 'default',
|
326
|
+
},
|
327
|
+
},
|
328
|
+
'future': {
|
329
|
+
'linear': None,
|
330
|
+
'inverse': None,
|
331
|
+
},
|
332
|
+
},
|
262
333
|
})
|
263
334
|
|
264
335
|
def handle_portfolio_and_params(self, methodName: str, params={}):
|
@@ -299,7 +370,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
299
370
|
def fetch_accounts(self, params={}):
|
300
371
|
"""
|
301
372
|
fetch all the accounts associated with a profile
|
302
|
-
|
373
|
+
|
374
|
+
https://docs.cloud.coinbase.com/intx/reference/getportfolios
|
375
|
+
|
303
376
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
304
377
|
:returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
|
305
378
|
"""
|
@@ -347,15 +420,89 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
347
420
|
'info': account,
|
348
421
|
}
|
349
422
|
|
423
|
+
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = 100, params={}) -> List[list]:
|
424
|
+
"""
|
425
|
+
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
426
|
+
|
427
|
+
https://docs.cdp.coinbase.com/intx/reference/getinstrumentcandles
|
428
|
+
|
429
|
+
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
430
|
+
:param str timeframe: the length of time each candle represents
|
431
|
+
:param int [since]: timestamp in ms of the earliest candle to fetch
|
432
|
+
:param int [limit]: the maximum amount of candles to fetch, default 100 max 10000
|
433
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
434
|
+
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
435
|
+
:param int [params.until]: timestamp in ms of the latest candle to fetch
|
436
|
+
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
437
|
+
"""
|
438
|
+
self.load_markets()
|
439
|
+
paginate = False
|
440
|
+
paginate, params = self.handle_option_and_params(params, 'fetchOHLCV', 'paginate')
|
441
|
+
if paginate:
|
442
|
+
return self.fetch_paginated_call_deterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 10000)
|
443
|
+
market = self.market(symbol)
|
444
|
+
request: dict = {
|
445
|
+
'instrument': market['id'],
|
446
|
+
'granularity': self.safe_string(self.timeframes, timeframe, timeframe),
|
447
|
+
}
|
448
|
+
if since is not None:
|
449
|
+
request['start'] = self.iso8601(since)
|
450
|
+
else:
|
451
|
+
raise ArgumentsRequired(self.id + ' fetchOHLCV() requires a since argument')
|
452
|
+
unitl = self.safe_integer(params, 'until')
|
453
|
+
if unitl is not None:
|
454
|
+
params = self.omit(params, 'until')
|
455
|
+
request['end'] = self.iso8601(unitl)
|
456
|
+
response = self.v1PublicGetInstrumentsInstrumentCandles(self.extend(request, params))
|
457
|
+
#
|
458
|
+
# {
|
459
|
+
# "aggregations": [
|
460
|
+
# {
|
461
|
+
# "start": "2024-04-23T00:00:00Z",
|
462
|
+
# "open": "62884.4",
|
463
|
+
# "high": "64710.6",
|
464
|
+
# "low": "62884.4",
|
465
|
+
# "close": "63508.4",
|
466
|
+
# "volume": "3253.9983"
|
467
|
+
# }
|
468
|
+
# ]
|
469
|
+
# }
|
470
|
+
#
|
471
|
+
candles = self.safe_list(response, 'aggregations', [])
|
472
|
+
return self.parse_ohlcvs(candles, market, timeframe, since, limit)
|
473
|
+
|
474
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
475
|
+
#
|
476
|
+
# {
|
477
|
+
# "start": "2024-04-23T00:00:00Z",
|
478
|
+
# "open": "62884.4",
|
479
|
+
# "high": "64710.6",
|
480
|
+
# "low": "62884.4",
|
481
|
+
# "close": "63508.4",
|
482
|
+
# "volume": "3253.9983"
|
483
|
+
# }
|
484
|
+
#
|
485
|
+
return [
|
486
|
+
self.parse8601(self.safe_string_2(ohlcv, 'start', 'time')),
|
487
|
+
self.safe_number(ohlcv, 'open'),
|
488
|
+
self.safe_number(ohlcv, 'high'),
|
489
|
+
self.safe_number(ohlcv, 'low'),
|
490
|
+
self.safe_number(ohlcv, 'close'),
|
491
|
+
self.safe_number(ohlcv, 'volume'),
|
492
|
+
]
|
493
|
+
|
350
494
|
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
351
495
|
"""
|
352
496
|
fetches historical funding rate prices
|
353
|
-
|
497
|
+
|
498
|
+
https://docs.cloud.coinbase.com/intx/reference/getinstrumentfunding
|
499
|
+
|
354
500
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
355
501
|
:param int [since]: timestamp in ms of the earliest funding rate to fetch
|
356
502
|
:param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
|
357
503
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
358
504
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
505
|
+
:returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
|
359
506
|
"""
|
360
507
|
if symbol is None:
|
361
508
|
raise ArgumentsRequired(self.id + ' fetchFundingRateHistory() requires a symbol argument')
|
@@ -369,7 +516,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
369
516
|
return self.fetch_paginated_call_incremental('fetchFundingRateHistory', symbol, since, limit, params, pageKey, maxEntriesPerRequest)
|
370
517
|
market = self.market(symbol)
|
371
518
|
page = self.safe_integer(params, pageKey, 1) - 1
|
372
|
-
request = {
|
519
|
+
request: dict = {
|
373
520
|
'instrument': market['id'],
|
374
521
|
'result_offset': self.safe_integer_2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
|
375
522
|
}
|
@@ -429,11 +576,171 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
429
576
|
'previousFundingDatetime': None,
|
430
577
|
}
|
431
578
|
|
579
|
+
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
580
|
+
"""
|
581
|
+
fetch the history of funding payments paid and received on self account
|
582
|
+
|
583
|
+
https://docs.cdp.coinbase.com/intx/reference/gettransfers
|
584
|
+
|
585
|
+
:param str [symbol]: unified market symbol
|
586
|
+
:param int [since]: the earliest time in ms to fetch funding history for
|
587
|
+
:param int [limit]: the maximum number of funding history structures to retrieve
|
588
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
589
|
+
:returns dict: a `funding history structure <https://docs.ccxt.com/#/?id=funding-history-structure>`
|
590
|
+
"""
|
591
|
+
self.load_markets()
|
592
|
+
request: dict = {
|
593
|
+
'type': 'FUNDING',
|
594
|
+
}
|
595
|
+
market: Market = None
|
596
|
+
if symbol is not None:
|
597
|
+
market = self.market(symbol)
|
598
|
+
portfolios = None
|
599
|
+
portfolios, params = self.handle_option_and_params(params, 'fetchFundingHistory', 'portfolios')
|
600
|
+
if portfolios is not None:
|
601
|
+
request['portfolios'] = portfolios
|
602
|
+
if since is not None:
|
603
|
+
request['time_from'] = self.iso8601(since)
|
604
|
+
if limit is not None:
|
605
|
+
request['result_limit'] = limit
|
606
|
+
else:
|
607
|
+
request['result_limit'] = 100
|
608
|
+
response = self.v1PrivateGetTransfers(self.extend(request, params))
|
609
|
+
fundings = self.safe_list(response, 'results', [])
|
610
|
+
return self.parse_incomes(fundings, market, since, limit)
|
611
|
+
|
612
|
+
def parse_income(self, income, market: Market = None):
|
613
|
+
#
|
614
|
+
# {
|
615
|
+
# "amount":"0.0008",
|
616
|
+
# "asset":"USDC",
|
617
|
+
# "created_at":"2024-02-22T16:00:00Z",
|
618
|
+
# "from_portfolio":{
|
619
|
+
# "id":"13yuk1fs-1-0",
|
620
|
+
# "name":"Eng Test Portfolio - 2",
|
621
|
+
# "uuid":"018712f2-5ff9-7de3-9010-xxxxxxxxx"
|
622
|
+
# },
|
623
|
+
# "instrument_id":"149264164756389888",
|
624
|
+
# "instrument_symbol":"ETH-PERP",
|
625
|
+
# "position_id":"1xy4v51m-1-2",
|
626
|
+
# "status":"PROCESSED",
|
627
|
+
# "to_portfolio":{
|
628
|
+
# "name":"CB_FUND"
|
629
|
+
# },
|
630
|
+
# "transfer_type":"FUNDING",
|
631
|
+
# "transfer_uuid":"a6b708df-2c44-32c5-bb98-xxxxxxxxxx",
|
632
|
+
# "updated_at":"2024-02-22T16:00:00Z"
|
633
|
+
# }
|
634
|
+
#
|
635
|
+
marketId = self.safe_string(income, 'symbol')
|
636
|
+
market = self.safe_market(marketId, market, None, 'contract')
|
637
|
+
datetime = self.safe_integer(income, 'created_at')
|
638
|
+
timestamp = self.parse8601(datetime)
|
639
|
+
currencyId = self.safe_string(income, 'asset')
|
640
|
+
code = self.safe_currency_code(currencyId)
|
641
|
+
return {
|
642
|
+
'info': income,
|
643
|
+
'symbol': market['symbol'],
|
644
|
+
'code': code,
|
645
|
+
'timestamp': timestamp,
|
646
|
+
'datetime': self.iso8601(timestamp),
|
647
|
+
'id': self.safe_string(income, 'transfer_uuid'),
|
648
|
+
'amount': self.safe_number(income, 'amount'),
|
649
|
+
'rate': None,
|
650
|
+
}
|
651
|
+
|
652
|
+
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[TransferEntry]:
|
653
|
+
"""
|
654
|
+
fetch a history of internal transfers made on an account
|
655
|
+
|
656
|
+
https://docs.cdp.coinbase.com/intx/reference/gettransfers
|
657
|
+
|
658
|
+
:param str code: unified currency code of the currency transferred
|
659
|
+
:param int [since]: the earliest time in ms to fetch transfers for
|
660
|
+
:param int [limit]: the maximum number of transfers structures to retrieve
|
661
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
662
|
+
:returns dict[]: a list of `transfer structures <https://docs.ccxt.com/#/?id=transfer-structure>`
|
663
|
+
"""
|
664
|
+
self.load_markets()
|
665
|
+
request: dict = {
|
666
|
+
'type': 'INTERNAL',
|
667
|
+
}
|
668
|
+
currency = None
|
669
|
+
if code is not None:
|
670
|
+
currency = self.currency(code)
|
671
|
+
portfolios = None
|
672
|
+
portfolios, params = self.handle_option_and_params(params, 'fetchTransfers', 'portfolios')
|
673
|
+
if portfolios is not None:
|
674
|
+
request['portfolios'] = portfolios
|
675
|
+
if since is not None:
|
676
|
+
request['time_from'] = self.iso8601(since)
|
677
|
+
if limit is not None:
|
678
|
+
request['result_limit'] = limit
|
679
|
+
else:
|
680
|
+
request['result_limit'] = 100
|
681
|
+
response = self.v1PrivateGetTransfers(self.extend(request, params))
|
682
|
+
transfers = self.safe_list(response, 'results', [])
|
683
|
+
return self.parse_transfers(transfers, currency, since, limit)
|
684
|
+
|
685
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
686
|
+
#
|
687
|
+
# {
|
688
|
+
# "amount":"0.0008",
|
689
|
+
# "asset":"USDC",
|
690
|
+
# "created_at":"2024-02-22T16:00:00Z",
|
691
|
+
# "from_portfolio":{
|
692
|
+
# "id":"13yuk1fs-1-0",
|
693
|
+
# "name":"Eng Test Portfolio - 2",
|
694
|
+
# "uuid":"018712f2-5ff9-7de3-9010-xxxxxxxxx"
|
695
|
+
# },
|
696
|
+
# "instrument_id":"149264164756389888",
|
697
|
+
# "instrument_symbol":"ETH-PERP",
|
698
|
+
# "position_id":"1xy4v51m-1-2",
|
699
|
+
# "status":"PROCESSED",
|
700
|
+
# "to_portfolio":{
|
701
|
+
# "name":"CB_FUND"
|
702
|
+
# },
|
703
|
+
# "transfer_type":"FUNDING",
|
704
|
+
# "transfer_uuid":"a6b708df-2c44-32c5-bb98-xxxxxxxxxx",
|
705
|
+
# "updated_at":"2024-02-22T16:00:00Z"
|
706
|
+
# }
|
707
|
+
#
|
708
|
+
datetime = self.safe_integer(transfer, 'created_at')
|
709
|
+
timestamp = self.parse8601(datetime)
|
710
|
+
currencyId = self.safe_string(transfer, 'asset')
|
711
|
+
code = self.safe_currency_code(currencyId)
|
712
|
+
fromPorfolio = self.safe_dict(transfer, 'from_portfolio', {})
|
713
|
+
fromId = self.safe_string(fromPorfolio, 'id')
|
714
|
+
toPorfolio = self.safe_dict(transfer, 'to_portfolio', {})
|
715
|
+
toId = self.safe_string(toPorfolio, 'id')
|
716
|
+
return {
|
717
|
+
'info': transfer,
|
718
|
+
'id': self.safe_string(transfer, 'transfer_uuid'),
|
719
|
+
'timestamp': timestamp,
|
720
|
+
'datetime': self.iso8601(timestamp),
|
721
|
+
'currency': code,
|
722
|
+
'amount': self.safe_number(transfer, 'amount'),
|
723
|
+
'fromAccount': fromId,
|
724
|
+
'toAccount': toId,
|
725
|
+
'status': self.parse_transfer_status(self.safe_string(transfer, 'status')),
|
726
|
+
}
|
727
|
+
|
728
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
729
|
+
statuses: dict = {
|
730
|
+
'FAILED': 'failed',
|
731
|
+
'PROCESSED': 'ok',
|
732
|
+
'NEW': 'pending',
|
733
|
+
'STARTED': 'pending',
|
734
|
+
}
|
735
|
+
return self.safe_string(statuses, status, status)
|
736
|
+
|
432
737
|
def create_deposit_address(self, code: str, params={}):
|
433
738
|
"""
|
434
739
|
create a currency deposit address
|
435
|
-
|
436
|
-
|
740
|
+
|
741
|
+
https://docs.cloud.coinbase.com/intx/reference/createaddress
|
742
|
+
https://docs.cloud.coinbase.com/intx/reference/createcounterpartyid
|
743
|
+
|
437
744
|
:param str code: unified currency code of the currency for the deposit address
|
438
745
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
439
746
|
:param str [params.network_arn_id]: Identifies the blockchain network(e.g., networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a) if not provided will pick default
|
@@ -445,7 +752,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
445
752
|
method, params = self.handle_option_and_params(params, 'createDepositAddress', 'method', 'v1PrivatePostTransfersAddress')
|
446
753
|
portfolio = None
|
447
754
|
portfolio, params = self.handle_portfolio_and_params('createDepositAddress', params)
|
448
|
-
request = {
|
755
|
+
request: dict = {
|
449
756
|
'portfolio': portfolio,
|
450
757
|
}
|
451
758
|
if method == 'v1PrivatePostTransfersAddress':
|
@@ -491,7 +798,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
491
798
|
networks = self.safe_dict(currency, 'networks')
|
492
799
|
if networks is not None:
|
493
800
|
return
|
494
|
-
request = {
|
801
|
+
request: dict = {
|
495
802
|
'asset': currency['id'],
|
496
803
|
}
|
497
804
|
rawNetworks = self.v1PublicGetAssetsAssetNetworks(request)
|
@@ -501,7 +808,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
501
808
|
# "asset_id" = self.parse_networks(rawNetworks)
|
502
809
|
|
503
810
|
def parse_networks(self, networks, params={}):
|
504
|
-
result = {}
|
811
|
+
result: dict = {}
|
505
812
|
for i in range(0, len(networks)):
|
506
813
|
network = self.extend(self.parse_network(networks[i]), params)
|
507
814
|
result[network['network']] = network
|
@@ -526,11 +833,12 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
526
833
|
currencyId = self.safe_string(network, 'asset_name')
|
527
834
|
currencyCode = self.safe_currency_code(currencyId)
|
528
835
|
networkId = self.safe_string(network, 'network_arn_id')
|
836
|
+
networkIdForCode = self.safe_string_n(network, ['network_name', 'display_name', 'network_arn_id'], '')
|
529
837
|
return self.safe_network({
|
530
838
|
'info': network,
|
531
839
|
'id': networkId,
|
532
840
|
'name': self.safe_string(network, 'display_name'),
|
533
|
-
'network': self.network_id_to_code(
|
841
|
+
'network': self.network_id_to_code(networkIdForCode, currencyCode),
|
534
842
|
'active': None,
|
535
843
|
'deposit': None,
|
536
844
|
'withdraw': None,
|
@@ -551,7 +859,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
551
859
|
def set_margin(self, symbol: str, amount: float, params={}) -> Any:
|
552
860
|
"""
|
553
861
|
Either adds or reduces margin in order to set the margin to a specific value
|
554
|
-
|
862
|
+
|
863
|
+
https://docs.cloud.coinbase.com/intx/reference/setportfoliomarginoverride
|
864
|
+
|
555
865
|
:param str symbol: unified market symbol of the market to set margin in
|
556
866
|
:param float amount: the amount to set the margin to
|
557
867
|
:param dict [params]: parameters specific to the exchange API endpoint
|
@@ -561,16 +871,18 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
561
871
|
portfolio, params = self.handle_portfolio_and_params('setMargin', params)
|
562
872
|
if symbol is not None:
|
563
873
|
raise BadRequest(self.id + ' setMargin() only allows setting margin to full portfolio')
|
564
|
-
request = {
|
874
|
+
request: dict = {
|
565
875
|
'portfolio': portfolio,
|
566
876
|
'margin_override': amount,
|
567
877
|
}
|
568
878
|
return self.v1PrivatePostPortfoliosMargin(self.extend(request, params))
|
569
879
|
|
570
|
-
def fetch_deposits_withdrawals(self, code:
|
880
|
+
def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
571
881
|
"""
|
572
882
|
fetch history of deposits and withdrawals
|
573
|
-
|
883
|
+
|
884
|
+
https://docs.cloud.coinbase.com/intx/reference/gettransfers
|
885
|
+
|
574
886
|
:param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
|
575
887
|
:param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
|
576
888
|
:param int [limit]: max number of deposit/withdrawals to return, default is None
|
@@ -591,7 +903,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
591
903
|
if paginate:
|
592
904
|
return self.fetch_paginated_call_incremental('fetchDepositsWithdrawals', code, since, limit, params, pageKey, maxEntriesPerRequest)
|
593
905
|
page = self.safe_integer(params, pageKey, 1) - 1
|
594
|
-
request = {
|
906
|
+
request: dict = {
|
595
907
|
'result_offset': self.safe_integer_2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
|
596
908
|
}
|
597
909
|
if since is not None:
|
@@ -639,7 +951,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
639
951
|
|
640
952
|
def fetch_position(self, symbol: str, params={}):
|
641
953
|
"""
|
642
|
-
|
954
|
+
|
955
|
+
https://docs.cloud.coinbase.com/intx/reference/getportfolioposition
|
956
|
+
|
643
957
|
fetch data on an open position
|
644
958
|
:param str symbol: unified market symbol of the market the position is held in
|
645
959
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -649,7 +963,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
649
963
|
symbol = self.symbol(symbol)
|
650
964
|
portfolio = None
|
651
965
|
portfolio, params = self.handle_portfolio_and_params('fetchPosition', params)
|
652
|
-
request = {
|
966
|
+
request: dict = {
|
653
967
|
'portfolio': portfolio,
|
654
968
|
'instrument': self.market_id(symbol),
|
655
969
|
}
|
@@ -671,7 +985,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
671
985
|
#
|
672
986
|
return self.parse_position(position)
|
673
987
|
|
674
|
-
def parse_position(self, position, market: Market = None):
|
988
|
+
def parse_position(self, position: dict, market: Market = None):
|
675
989
|
#
|
676
990
|
# {
|
677
991
|
# "symbol":"BTC-PERP",
|
@@ -722,17 +1036,18 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
722
1036
|
|
723
1037
|
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
724
1038
|
"""
|
725
|
-
|
1039
|
+
|
1040
|
+
https://docs.cloud.coinbase.com/intx/reference/getportfoliopositions
|
1041
|
+
|
726
1042
|
fetch all open positions
|
727
1043
|
:param str[] [symbols]: list of unified market symbols
|
728
1044
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
729
|
-
:param str [method]: method name to call, "positionRisk", "account" or "option", default is "positionRisk"
|
730
1045
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
731
1046
|
"""
|
732
1047
|
self.load_markets()
|
733
1048
|
portfolio = None
|
734
1049
|
portfolio, params = self.handle_portfolio_and_params('fetchPositions', params)
|
735
|
-
request = {
|
1050
|
+
request: dict = {
|
736
1051
|
'portfolio': portfolio,
|
737
1052
|
}
|
738
1053
|
response = self.v1PrivateGetPortfoliosPortfolioPositions(self.extend(request, params))
|
@@ -762,7 +1077,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
762
1077
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
763
1078
|
"""
|
764
1079
|
fetch all withdrawals made from an account
|
765
|
-
|
1080
|
+
|
1081
|
+
https://docs.cloud.coinbase.com/intx/reference/gettransfers
|
1082
|
+
|
766
1083
|
:param str code: unified currency code
|
767
1084
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
768
1085
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -796,8 +1113,8 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
796
1113
|
params['type'] = 'DEPOSIT'
|
797
1114
|
return self.fetch_deposits_withdrawals(code, since, limit, params)
|
798
1115
|
|
799
|
-
def parse_transaction_status(self, status):
|
800
|
-
statuses = {
|
1116
|
+
def parse_transaction_status(self, status: Str):
|
1117
|
+
statuses: dict = {
|
801
1118
|
'PROCESSED': 'ok',
|
802
1119
|
'NEW': 'pending',
|
803
1120
|
'STARTED': 'pending',
|
@@ -805,7 +1122,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
805
1122
|
}
|
806
1123
|
return self.safe_string(statuses, status, status)
|
807
1124
|
|
808
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1125
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
809
1126
|
#
|
810
1127
|
# {
|
811
1128
|
# "idem":"8e471d77-4208-45a8-9e5b-f3bd8a2c1fc3"
|
@@ -840,7 +1157,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
840
1157
|
},
|
841
1158
|
}
|
842
1159
|
|
843
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1160
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
844
1161
|
#
|
845
1162
|
# {
|
846
1163
|
# "portfolio_id":"1wp37qsc-1-0",
|
@@ -894,9 +1211,11 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
894
1211
|
},
|
895
1212
|
})
|
896
1213
|
|
897
|
-
def fetch_markets(self, params={}):
|
1214
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
898
1215
|
"""
|
899
|
-
|
1216
|
+
|
1217
|
+
https://docs.cloud.coinbase.com/intx/reference/getinstruments
|
1218
|
+
|
900
1219
|
retrieves data on all markets for coinbaseinternational
|
901
1220
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
902
1221
|
:returns dict[]: an array of objects representing market data
|
@@ -953,7 +1272,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
953
1272
|
#
|
954
1273
|
return self.parse_markets(response)
|
955
1274
|
|
956
|
-
def parse_market(self, market) -> Market:
|
1275
|
+
def parse_market(self, market: dict) -> Market:
|
957
1276
|
#
|
958
1277
|
# {
|
959
1278
|
# "instrument_id":"149264164756389888",
|
@@ -1065,10 +1384,12 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1065
1384
|
'created': None,
|
1066
1385
|
}
|
1067
1386
|
|
1068
|
-
def fetch_currencies(self, params={}) ->
|
1387
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
1069
1388
|
"""
|
1070
1389
|
fetches all available currencies on an exchange
|
1071
|
-
|
1390
|
+
|
1391
|
+
https://docs.cloud.coinbase.com/intx/reference/getassets
|
1392
|
+
|
1072
1393
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1073
1394
|
:returns dict: an associative dictionary of currencies
|
1074
1395
|
"""
|
@@ -1086,13 +1407,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1086
1407
|
# ...
|
1087
1408
|
# ]
|
1088
1409
|
#
|
1089
|
-
|
1090
|
-
for i in range(0, len(currencies)):
|
1091
|
-
currency = self.parse_currency(currencies[i])
|
1092
|
-
result[currency['code']] = currency
|
1093
|
-
return result
|
1410
|
+
return self.parse_currencies(currencies)
|
1094
1411
|
|
1095
|
-
def parse_currency(self, currency):
|
1412
|
+
def parse_currency(self, currency: dict) -> Currency:
|
1096
1413
|
#
|
1097
1414
|
# {
|
1098
1415
|
# "asset_id":"1",
|
@@ -1106,7 +1423,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1106
1423
|
id = self.safe_string(currency, 'asset_name')
|
1107
1424
|
code = self.safe_currency_code(id)
|
1108
1425
|
statusId = self.safe_string(currency, 'status')
|
1109
|
-
return {
|
1426
|
+
return self.safe_currency_structure({
|
1110
1427
|
'id': id,
|
1111
1428
|
'name': code,
|
1112
1429
|
'code': code,
|
@@ -1119,12 +1436,14 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1119
1436
|
'fee': None,
|
1120
1437
|
'fees': None,
|
1121
1438
|
'limits': self.limits,
|
1122
|
-
}
|
1439
|
+
})
|
1123
1440
|
|
1124
1441
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
1125
1442
|
"""
|
1126
1443
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
1127
|
-
|
1444
|
+
|
1445
|
+
https://docs.cloud.coinbase.com/intx/reference/getinstruments
|
1446
|
+
|
1128
1447
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
1129
1448
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1130
1449
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1132,7 +1451,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1132
1451
|
self.load_markets()
|
1133
1452
|
symbols = self.market_symbols(symbols)
|
1134
1453
|
instruments = self.v1PublicGetInstruments(params)
|
1135
|
-
tickers = {}
|
1454
|
+
tickers: dict = {}
|
1136
1455
|
for i in range(0, len(instruments)):
|
1137
1456
|
instrument = instruments[i]
|
1138
1457
|
marketId = self.safe_string(instrument, 'symbol')
|
@@ -1144,14 +1463,16 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1144
1463
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
1145
1464
|
"""
|
1146
1465
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
1147
|
-
|
1466
|
+
|
1467
|
+
https://docs.cloud.coinbase.com/intx/reference/getinstrumentquote
|
1468
|
+
|
1148
1469
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
1149
1470
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1150
1471
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
1151
1472
|
"""
|
1152
1473
|
self.load_markets()
|
1153
1474
|
market = self.market(symbol)
|
1154
|
-
request = {
|
1475
|
+
request: dict = {
|
1155
1476
|
'instrument': self.market_id(symbol),
|
1156
1477
|
}
|
1157
1478
|
ticker = self.v1PublicGetInstrumentsInstrumentQuote(self.extend(request, params))
|
@@ -1197,12 +1518,16 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1197
1518
|
'baseVolume': None,
|
1198
1519
|
'quoteVolume': None,
|
1199
1520
|
'previousClose': None,
|
1521
|
+
'markPrice': self.safe_number(ticker, 'mark_price'),
|
1522
|
+
'indexPrice': self.safe_number(ticker, 'index_price'),
|
1200
1523
|
})
|
1201
1524
|
|
1202
1525
|
def fetch_balance(self, params={}) -> Balances:
|
1203
1526
|
"""
|
1204
1527
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
1205
|
-
|
1528
|
+
|
1529
|
+
https://docs.cloud.coinbase.com/intx/reference/getportfoliobalances
|
1530
|
+
|
1206
1531
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1207
1532
|
:param boolean [params.v3]: default False, set True to use v3 api endpoint
|
1208
1533
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
@@ -1210,7 +1535,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1210
1535
|
self.load_markets()
|
1211
1536
|
portfolio = None
|
1212
1537
|
portfolio, params = self.handle_portfolio_and_params('fetchBalance', params)
|
1213
|
-
request = {
|
1538
|
+
request: dict = {
|
1214
1539
|
'portfolio': portfolio,
|
1215
1540
|
}
|
1216
1541
|
balances = self.v1PrivateGetPortfoliosPortfolioBalances(self.extend(request, params))
|
@@ -1249,7 +1574,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1249
1574
|
# "loan_collateral_requirement":"0.0"
|
1250
1575
|
# }
|
1251
1576
|
#
|
1252
|
-
result = {
|
1577
|
+
result: dict = {
|
1253
1578
|
'info': response,
|
1254
1579
|
}
|
1255
1580
|
for i in range(0, len(response)):
|
@@ -1265,7 +1590,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1265
1590
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
1266
1591
|
"""
|
1267
1592
|
Transfer an amount of asset from one portfolio to another.
|
1268
|
-
|
1593
|
+
|
1594
|
+
https://docs.cloud.coinbase.com/intx/reference/createportfolioassettransfer
|
1595
|
+
|
1269
1596
|
:param str code: unified currency code
|
1270
1597
|
:param float amount: amount to transfer
|
1271
1598
|
:param str fromAccount: account to transfer from
|
@@ -1275,7 +1602,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1275
1602
|
"""
|
1276
1603
|
self.load_markets()
|
1277
1604
|
currency = self.currency(code)
|
1278
|
-
request = {
|
1605
|
+
request: dict = {
|
1279
1606
|
'asset': currency['id'],
|
1280
1607
|
'ammount': amount,
|
1281
1608
|
'from': fromAccount,
|
@@ -1298,14 +1625,16 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1298
1625
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1299
1626
|
"""
|
1300
1627
|
create a trade order
|
1301
|
-
|
1628
|
+
|
1629
|
+
https://docs.cloud.coinbase.com/intx/reference/createorder
|
1630
|
+
|
1302
1631
|
:param str symbol: unified symbol of the market to create an order in
|
1303
1632
|
:param str type: 'market' or 'limit'
|
1304
1633
|
:param str side: 'buy' or 'sell'
|
1305
1634
|
:param float amount: how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders
|
1306
1635
|
:param float [price]: the price to fulfill the order, in units of the quote currency, ignored in market orders
|
1307
1636
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1308
|
-
:param float [params.stopPrice]:
|
1637
|
+
:param float [params.stopPrice]: alias for triggerPrice
|
1309
1638
|
:param float [params.triggerPrice]: price to trigger stop orders
|
1310
1639
|
:param float [params.stopLossPrice]: price to trigger stop-loss orders
|
1311
1640
|
:param bool [params.postOnly]: True or False
|
@@ -1317,22 +1646,22 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1317
1646
|
self.load_markets()
|
1318
1647
|
market = self.market(symbol)
|
1319
1648
|
typeId = type.upper()
|
1320
|
-
|
1649
|
+
triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop_price'])
|
1321
1650
|
clientOrderIdprefix = self.safe_string(self.options, 'brokerId', 'nfqkvdjp')
|
1322
1651
|
clientOrderId = clientOrderIdprefix + '-' + self.uuid()
|
1323
1652
|
clientOrderId = clientOrderId[0:17]
|
1324
|
-
request = {
|
1653
|
+
request: dict = {
|
1325
1654
|
'client_order_id': clientOrderId,
|
1326
1655
|
'side': side.upper(),
|
1327
1656
|
'instrument': market['id'],
|
1328
1657
|
'size': self.amount_to_precision(market['symbol'], amount),
|
1329
1658
|
}
|
1330
|
-
if
|
1659
|
+
if triggerPrice is not None:
|
1331
1660
|
if type == 'limit':
|
1332
1661
|
typeId = 'STOP_LIMIT'
|
1333
1662
|
else:
|
1334
1663
|
typeId = 'STOP'
|
1335
|
-
request['stop_price'] =
|
1664
|
+
request['stop_price'] = triggerPrice
|
1336
1665
|
request['type'] = typeId
|
1337
1666
|
if type == 'limit':
|
1338
1667
|
if price is None:
|
@@ -1381,7 +1710,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1381
1710
|
#
|
1382
1711
|
return self.parse_order(response, market)
|
1383
1712
|
|
1384
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1713
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1385
1714
|
#
|
1386
1715
|
# {
|
1387
1716
|
# "order_id":"1x96skvg-1-0",
|
@@ -1426,7 +1755,6 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1426
1755
|
'postOnly': None,
|
1427
1756
|
'side': self.safe_string_lower(order, 'side'),
|
1428
1757
|
'price': self.safe_string(order, 'price'),
|
1429
|
-
'stopPrice': self.safe_string(order, 'stop_price'),
|
1430
1758
|
'triggerPrice': self.safe_string(order, 'stop_price'),
|
1431
1759
|
'amount': self.safe_string(order, 'size'),
|
1432
1760
|
'filled': self.safe_string(order, 'exec_qty'),
|
@@ -1438,8 +1766,8 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1438
1766
|
'trades': None,
|
1439
1767
|
}, market)
|
1440
1768
|
|
1441
|
-
def parse_order_status(self, status):
|
1442
|
-
statuses = {
|
1769
|
+
def parse_order_status(self, status: Str):
|
1770
|
+
statuses: dict = {
|
1443
1771
|
'NEW': 'open',
|
1444
1772
|
'PARTIAL_FILLED': 'open',
|
1445
1773
|
'FILLED': 'closed',
|
@@ -1453,10 +1781,10 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1453
1781
|
}
|
1454
1782
|
return self.safe_string(statuses, status, status)
|
1455
1783
|
|
1456
|
-
def parse_order_type(self, type):
|
1784
|
+
def parse_order_type(self, type: Str):
|
1457
1785
|
if type == 'UNKNOWN_ORDER_TYPE':
|
1458
1786
|
return None
|
1459
|
-
types = {
|
1787
|
+
types: dict = {
|
1460
1788
|
'MARKET': 'market',
|
1461
1789
|
'LIMIT': 'limit',
|
1462
1790
|
'STOP': 'limit',
|
@@ -1467,7 +1795,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1467
1795
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1468
1796
|
"""
|
1469
1797
|
cancels an open order
|
1470
|
-
|
1798
|
+
|
1799
|
+
https://docs.cloud.coinbase.com/intx/reference/cancelorder
|
1800
|
+
|
1471
1801
|
:param str id: order id
|
1472
1802
|
:param str symbol: not used by coinbaseinternational cancelOrder()
|
1473
1803
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1476,7 +1806,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1476
1806
|
self.load_markets()
|
1477
1807
|
portfolio = None
|
1478
1808
|
portfolio, params = self.handle_portfolio_and_params('cancelOrder', params)
|
1479
|
-
request = {
|
1809
|
+
request: dict = {
|
1480
1810
|
'portfolio': portfolio,
|
1481
1811
|
'id': id,
|
1482
1812
|
}
|
@@ -1519,7 +1849,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1519
1849
|
self.load_markets()
|
1520
1850
|
portfolio = None
|
1521
1851
|
portfolio, params = self.handle_portfolio_and_params('cancelAllOrders', params)
|
1522
|
-
request = {
|
1852
|
+
request: dict = {
|
1523
1853
|
'portfolio': portfolio,
|
1524
1854
|
}
|
1525
1855
|
market = None
|
@@ -1532,20 +1862,22 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1532
1862
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float = None, price: float = None, params={}):
|
1533
1863
|
"""
|
1534
1864
|
edit a trade order
|
1535
|
-
|
1865
|
+
|
1866
|
+
https://docs.cloud.coinbase.com/intx/reference/modifyorder
|
1867
|
+
|
1536
1868
|
:param str id: cancel order id
|
1537
1869
|
:param str symbol: unified symbol of the market to create an order in
|
1538
1870
|
:param str type: 'market' or 'limit'
|
1539
1871
|
:param str side: 'buy' or 'sell'
|
1540
1872
|
:param float amount: how much of currency you want to trade in units of base currency
|
1541
|
-
:param float [price]: the price at which the order is to be
|
1873
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1542
1874
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1543
1875
|
:param str params['clientOrderId']: client order id
|
1544
1876
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1545
1877
|
"""
|
1546
1878
|
self.load_markets()
|
1547
1879
|
market = self.market(symbol)
|
1548
|
-
request = {
|
1880
|
+
request: dict = {
|
1549
1881
|
'id': id,
|
1550
1882
|
}
|
1551
1883
|
portfolio = None
|
@@ -1556,9 +1888,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1556
1888
|
request['size'] = self.amount_to_precision(symbol, amount)
|
1557
1889
|
if price is not None:
|
1558
1890
|
request['price'] = self.price_to_precision(symbol, price)
|
1559
|
-
|
1560
|
-
if
|
1561
|
-
request['stop_price'] =
|
1891
|
+
triggerPrice = self.safe_number_n(params, ['stopPrice', 'stop_price', 'triggerPrice'])
|
1892
|
+
if triggerPrice is not None:
|
1893
|
+
request['stop_price'] = triggerPrice
|
1562
1894
|
clientOrderId = self.safe_string_2(params, 'client_order_id', 'clientOrderId')
|
1563
1895
|
if clientOrderId is None:
|
1564
1896
|
raise BadRequest(self.id + ' editOrder() requires a clientOrderId parameter')
|
@@ -1569,7 +1901,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1569
1901
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1570
1902
|
"""
|
1571
1903
|
fetches information on an order made by the user
|
1572
|
-
|
1904
|
+
|
1905
|
+
https://docs.cloud.coinbase.com/intx/reference/modifyorder
|
1906
|
+
|
1573
1907
|
:param str id: the order id
|
1574
1908
|
:param str symbol: unified market symbol that the order was made in
|
1575
1909
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1581,7 +1915,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1581
1915
|
market = self.market(symbol)
|
1582
1916
|
portfolio = None
|
1583
1917
|
portfolio, params = self.handle_portfolio_and_params('fetchOrder', params)
|
1584
|
-
request = {
|
1918
|
+
request: dict = {
|
1585
1919
|
'id': id,
|
1586
1920
|
'portfolio': portfolio,
|
1587
1921
|
}
|
@@ -1616,7 +1950,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1616
1950
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1617
1951
|
"""
|
1618
1952
|
fetches information on all currently open orders
|
1619
|
-
|
1953
|
+
|
1954
|
+
https://docs.cloud.coinbase.com/intx/reference/getorders
|
1955
|
+
|
1620
1956
|
:param str symbol: unified market symbol of the orders
|
1621
1957
|
:param int [since]: timestamp in ms of the earliest order, default is None
|
1622
1958
|
:param int [limit]: the maximum number of open order structures to retrieve
|
@@ -1637,7 +1973,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1637
1973
|
if paginate:
|
1638
1974
|
return self.fetch_paginated_call_incremental('fetchOpenOrders', symbol, since, limit, params, pageKey, maxEntriesPerRequest)
|
1639
1975
|
page = self.safe_integer(params, pageKey, 1) - 1
|
1640
|
-
request = {
|
1976
|
+
request: dict = {
|
1641
1977
|
'portfolio': portfolio,
|
1642
1978
|
'result_offset': self.safe_integer_2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
|
1643
1979
|
}
|
@@ -1692,7 +2028,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1692
2028
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1693
2029
|
"""
|
1694
2030
|
fetch all trades made by the user
|
1695
|
-
|
2031
|
+
|
2032
|
+
https://docs.cloud.coinbase.com/intx/reference/getmultiportfoliofills
|
2033
|
+
|
1696
2034
|
:param str symbol: unified market symbol of the trades
|
1697
2035
|
:param int [since]: timestamp in ms of the earliest order, default is None
|
1698
2036
|
:param int [limit]: the maximum number of trade structures to fetch
|
@@ -1713,7 +2051,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1713
2051
|
if symbol is not None:
|
1714
2052
|
market = self.market(symbol)
|
1715
2053
|
page = self.safe_integer(params, pageKey, 1) - 1
|
1716
|
-
request = {
|
2054
|
+
request: dict = {
|
1717
2055
|
'result_offset': self.safe_integer_2(params, 'offset', 'result_offset', page * maxEntriesPerRequest),
|
1718
2056
|
}
|
1719
2057
|
if limit is not None:
|
@@ -1722,9 +2060,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1722
2060
|
request['result_limit'] = limit
|
1723
2061
|
if since is not None:
|
1724
2062
|
request['time_from'] = self.iso8601(since)
|
1725
|
-
until = self.safe_string_n(params, ['until'
|
2063
|
+
until = self.safe_string_n(params, ['until'])
|
1726
2064
|
if until is not None:
|
1727
|
-
params = self.omit(params, ['until'
|
2065
|
+
params = self.omit(params, ['until'])
|
1728
2066
|
request['ref_datetime'] = self.iso8601(until)
|
1729
2067
|
response = self.v1PrivateGetPortfoliosFills(self.extend(request, params))
|
1730
2068
|
#
|
@@ -1770,11 +2108,13 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1770
2108
|
trades = self.safe_list(response, 'results', [])
|
1771
2109
|
return self.parse_trades(trades, market, since, limit)
|
1772
2110
|
|
1773
|
-
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
2111
|
+
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1774
2112
|
"""
|
1775
2113
|
make a withdrawal
|
1776
|
-
|
1777
|
-
|
2114
|
+
|
2115
|
+
https://docs.cloud.coinbase.com/intx/reference/withdraw
|
2116
|
+
https://docs.cloud.coinbase.com/intx/reference/counterpartywithdraw
|
2117
|
+
|
1778
2118
|
:param str code: unified currency code
|
1779
2119
|
:param float amount: the amount to withdraw
|
1780
2120
|
:param str address: the address to withdraw to
|
@@ -1795,7 +2135,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1795
2135
|
method, params = self.handle_option_and_params(params, 'withdraw', 'method', 'v1PrivatePostTransfersWithdraw')
|
1796
2136
|
networkId = None
|
1797
2137
|
networkId, params = self.handle_network_id_and_params(code, 'withdraw', params)
|
1798
|
-
request = {
|
2138
|
+
request: dict = {
|
1799
2139
|
'portfolio': portfolio,
|
1800
2140
|
'type': 'send',
|
1801
2141
|
'asset': currency['id'],
|
@@ -1877,7 +2217,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
|
|
1877
2217
|
}
|
1878
2218
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
1879
2219
|
|
1880
|
-
def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
2220
|
+
def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
|
1881
2221
|
#
|
1882
2222
|
# {
|
1883
2223
|
# "title":"io.javalin.http.BadRequestResponse: Order rejected(DUPLICATE_CLIENT_ORDER_ID - duplicate client order id detected)",
|