diff --git a/README.md b/README.md index 0fd5187..8483f8c 100644 --- a/README.md +++ b/README.md @@ -72,9 +72,9 @@ def example(): ) # Retrieve API secret information from environment variables - key = os.getenv("API_KEY") - secret = os.getenv("API_SECRET") - passphrase = os.getenv("API_PASSPHRASE") + key = os.getenv("API_KEY", "") + secret = os.getenv("API_SECRET", "") + passphrase = os.getenv("API_PASSPHRASE", "") # Set specific options, others will fall back to default values http_transport_option = ( diff --git a/sdk/python/README.md b/sdk/python/README.md index 17e411b..35caf58 100644 --- a/sdk/python/README.md +++ b/sdk/python/README.md @@ -36,9 +36,9 @@ def example(): ) # Retrieve API secret information from environment variables - key = os.getenv("API_KEY") - secret = os.getenv("API_SECRET") - passphrase = os.getenv("API_PASSPHRASE") + key = os.getenv("API_KEY", "") + secret = os.getenv("API_SECRET", "") + passphrase = os.getenv("API_PASSPHRASE", "") # Set specific options, others will fall back to default values http_transport_option = ( diff --git a/sdk/python/example/example_api.py b/sdk/python/example/example_api.py index a17eac6..edebfaa 100644 --- a/sdk/python/example/example_api.py +++ b/sdk/python/example/example_api.py @@ -27,9 +27,9 @@ def rest_example(): ) # Retrieve API secret information from environment variables - key = os.getenv("API_KEY") - secret = os.getenv("API_SECRET") - passphrase = os.getenv("API_PASSPHRASE") + key = os.getenv("API_KEY", "") + secret = os.getenv("API_SECRET", "") + passphrase = os.getenv("API_PASSPHRASE", "") # Optional: Retrieve broker secret information from environment variables; applicable for broker API only broker_name = os.getenv("BROKER_NAME") diff --git a/sdk/python/example/example_get_started.py b/sdk/python/example/example_get_started.py index 124e558..15dd5c4 100644 --- a/sdk/python/example/example_get_started.py +++ b/sdk/python/example/example_get_started.py @@ -17,9 +17,9 @@ def example(): ) # Retrieve API secret information from environment variables - key = os.getenv("API_KEY") - secret = os.getenv("API_SECRET") - passphrase = os.getenv("API_PASSPHRASE") + key = os.getenv("API_KEY", "") + secret = os.getenv("API_SECRET", "") + passphrase = os.getenv("API_PASSPHRASE", "") # Set specific options, others will fall back to default values http_transport_option = ( diff --git a/sdk/python/example/example_ws.py b/sdk/python/example/example_ws.py index 0eb310d..52e7959 100644 --- a/sdk/python/example/example_ws.py +++ b/sdk/python/example/example_ws.py @@ -21,9 +21,9 @@ def ws_example(): ) # Retrieve API secret information from environment variables - key = os.getenv("API_KEY") - secret = os.getenv("API_SECRET") - passphrase = os.getenv("API_PASSPHRASE") + key = os.getenv("API_KEY", "") + secret = os.getenv("API_SECRET", "") + passphrase = os.getenv("API_PASSPHRASE", "") # Set specific options, others will fall back to default values ws_client_option = ( diff --git a/sdk/python/kucoin_universal_sdk/internal/infra/default_ws_service.py b/sdk/python/kucoin_universal_sdk/internal/infra/default_ws_service.py index 104315b..4686b5a 100644 --- a/sdk/python/kucoin_universal_sdk/internal/infra/default_ws_service.py +++ b/sdk/python/kucoin_universal_sdk/internal/infra/default_ws_service.py @@ -17,8 +17,8 @@ from ..util.sub import SubInfo class DefaultWsService(WebSocketService): - def __init__(self, client_option: ClientOption, domain: DomainType, private: bool): - self.token_transport = DefaultTransport(client_option) + def __init__(self, client_option: ClientOption, domain: DomainType, private: bool, sdk_version:str): + self.token_transport = DefaultTransport(client_option, sdk_version) ws_option = client_option.websocket_client_option self.client = WebSocketClient(DefaultWsTokenProvider(self.token_transport, domain, private), ws_option) diff --git a/sdk/python/kucoin_universal_sdk/internal/infra/default_ws_token_provider.py b/sdk/python/kucoin_universal_sdk/internal/infra/default_ws_token_provider.py index fe92554..f43204a 100644 --- a/sdk/python/kucoin_universal_sdk/internal/infra/default_ws_token_provider.py +++ b/sdk/python/kucoin_universal_sdk/internal/infra/default_ws_token_provider.py @@ -7,13 +7,13 @@ from kucoin_universal_sdk.model.common import RestResponse from kucoin_universal_sdk.model.constants import DomainType from .default_transport import DefaultTransport -from ..interfaces.websocket import WsToken +from ..interfaces.websocket import WsToken, WsTokenProvider PATH_PRIVATE = "/api/v1/bullet-private" PATH_PUBLIC = "/api/v1/bullet-public" -class DefaultWsTokenProvider: +class DefaultWsTokenProvider(WsTokenProvider): def __init__(self, transport: DefaultTransport, domain: DomainType, private: bool): self.transport = transport self.domain = domain diff --git a/sdk/python/setup.py b/sdk/python/setup.py index f7900ec..da0fb0e 100644 --- a/sdk/python/setup.py +++ b/sdk/python/setup.py @@ -2,7 +2,7 @@ setup( name="kucoin-universal-sdk", - version="0.1.0a1", + version="0.1.0a2", description="Official KuCoin Universal SDK", author="KuCoin", author_email="api@kucoin.com",