Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Coinbase authentication #492

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ Options:
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-key TEXT Your Coinbase Advanced Trade API key
--coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
Expand Down Expand Up @@ -345,8 +346,9 @@ Options:
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-key TEXT Your Coinbase Advanced Trade API key
--coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
Expand Down Expand Up @@ -841,8 +843,9 @@ Options:
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-key TEXT Your Coinbase Advanced Trade API key
--coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
Expand Down Expand Up @@ -1265,8 +1268,9 @@ Options:
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-key TEXT Your Coinbase Advanced Trade API key
--coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
Expand Down Expand Up @@ -1710,8 +1714,9 @@ Options:
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-key TEXT Your Coinbase Advanced Trade API key
--coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
Expand Down Expand Up @@ -1881,8 +1886,9 @@ Options:
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-key TEXT Your Coinbase Advanced Trade API key
--coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
Expand Down
9 changes: 8 additions & 1 deletion lean/models/json_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,14 @@ def get_settings(self) -> Dict[str, str]:
for key, value in configuration._value.items():
settings[key] = str(value)
else:
settings[configuration._id] = str(configuration._value).replace("\\", "/")
# Replace escaped newline characters and backslashes in the configuration value.
# When reading the JSON configuration through Python, newline characters ('\n') and backslashes ('\')
# may be escaped, causing issues in scenarios where these characters are expected to be interpreted
# literally (e.g., file paths, multi-line strings). This replace operation ensures that:
# 1. Escaped newline characters ('\\n') are correctly interpreted as actual newlines ('\n').
# 2. Backslashes ('\\') in file paths are converted to forward slashes ('/'), making paths
# more consistent across different operating systems.
settings[configuration._id] = str(configuration._value).replace("\\n", "\n").replace("\\", "/")

return settings

Expand Down
Loading