From 995345da28be5ee3ccdf30660564f11c239faf38 Mon Sep 17 00:00:00 2001 From: enenn Date: Mon, 12 Mar 2018 19:56:49 +0100 Subject: [PATCH] Add password and uid to config to support exchanges that require them --- config.json.example | 6 ++++-- docs/configuration.md | 2 ++ freqtrade/exchange/__init__.py | 2 ++ freqtrade/misc.py | 2 ++ freqtrade/tests/conftest.py | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/config.json.example b/config.json.example index 100111f8a..44d589402 100644 --- a/config.json.example +++ b/config.json.example @@ -10,8 +10,10 @@ }, "exchange": { "name": "binance", - "key": "your_echange_key", - "secret": "your_echange_secret", + "key": "your_exchange_key", + "secret": "your_exchange_secret", + "password": "your_exchange_password", + "uid": "your_exchange_uid", "pair_whitelist": [ "ETH/BTC", "LTC/BTC", diff --git a/docs/configuration.md b/docs/configuration.md index bbbfdedd4..376cfea59 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -27,6 +27,8 @@ The table below will list all configuration parameters. | `exchange.name` | bittrex | Yes | Name of the exchange class to use. | `exchange.key` | key | No | API key to use for the exchange. Only required when you are in production mode. | `exchange.secret` | secret | No | API secret to use for the exchange. Only required when you are in production mode. +| `exchange.password` | password | No | Password to use for the exchange. Only required when you are in production mode, and only by some exchanges. +| `exchange.uid` | uid | No | User ID to use for the exchange. Only required when you are in production mode, and only by some exchanges. | `exchange.pair_whitelist` | [] | No | List of currency to use by the bot. Can be overrided with `--dynamic-whitelist` param. | `exchange.pair_blacklist` | [] | No | List of currency the bot must avoid. Useful when using `--dynamic-whitelist` param. | `experimental.use_sell_signal` | false | No | Use your sell strategy in addition of the `minimal_roi`. diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index a2540f415..debf04eec 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -51,6 +51,8 @@ def init(config: dict) -> None: _API = getattr(ccxt, name.lower())({ 'apiKey': exchange_config.get('key'), 'secret': exchange_config.get('secret'), + 'password': exchange_config.get('password'), + 'uid': exchange_config.get('uid'), }) except KeyError: raise OperationalException('Exchange {} is not supported'.format(name)) diff --git a/freqtrade/misc.py b/freqtrade/misc.py index 0244e95a9..17fec8210 100644 --- a/freqtrade/misc.py +++ b/freqtrade/misc.py @@ -418,6 +418,8 @@ CONF_SCHEMA = { 'name': {'type': 'string'}, 'key': {'type': 'string'}, 'secret': {'type': 'string'}, + 'password': {'type': 'string'}, + 'uid': {'type': 'string'}, 'pair_whitelist': { 'type': 'array', 'items': { diff --git a/freqtrade/tests/conftest.py b/freqtrade/tests/conftest.py index 291150dc8..baedebf3c 100644 --- a/freqtrade/tests/conftest.py +++ b/freqtrade/tests/conftest.py @@ -48,6 +48,8 @@ def default_conf(): "enabled": True, "key": "key", "secret": "secret", + "password": "password", + "uid": "uid", "pair_whitelist": [ "ETH/BTC", "TKN/BTC",