diff --git a/v4-client-py/dydx4/clients/helpers/request_helpers.py b/v4-client-py/dydx4/clients/helpers/request_helpers.py index 3644338e..59727b47 100644 --- a/v4-client-py/dydx4/clients/helpers/request_helpers.py +++ b/v4-client-py/dydx4/clients/helpers/request_helpers.py @@ -13,7 +13,8 @@ def generate_query_path(url, params): return url paramsString = '&'.join('{key}={value}'.format( - key=x[0], value=x[1]) for x in entries if x[1] is not None) + key=x[0], + value=str(x[1]).lower() if isinstance(x[1], bool) else x[1]) for x in entries if x[1] is not None) if paramsString: return url + '?' + paramsString diff --git a/v4-client-py/pyproject.toml b/v4-client-py/pyproject.toml index fc0539f0..a9f1fabf 100644 --- a/v4-client-py/pyproject.toml +++ b/v4-client-py/pyproject.toml @@ -5,7 +5,7 @@ package-dir = {"" = "dydx4"} [tool.poetry] name = "dydx4" -version = "0.2.2" +version = "0.2.3" description = "dYdX v4 Client" authors = ["John Huang "] license = "Proprietary" diff --git a/v4-client-py/tests/test_request_helpers.py b/v4-client-py/tests/test_request_helpers.py new file mode 100644 index 00000000..f11c99f2 --- /dev/null +++ b/v4-client-py/tests/test_request_helpers.py @@ -0,0 +1,5 @@ +from dydx4.clients.helpers.request_helpers import generate_query_path + +def test_generate_query_path(): + query_path = generate_query_path('https://google.com', {'a': True, 'b': False, 'c': 'TEST'}) + assert query_path == 'https://google.com?a=true&b=false&c=TEST'