Skip to content
Open
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
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
API_KEY = MOCK_API_KEY
SECRET_KEY=MOCK_SECRET_KEY
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dmypy.json
# Cython debug symbols
cython_debug/

# Environment variables
.env

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Generate **API KEY** and **Secret Key** from Wazirx website [here](https://wazir
pip3 install -r requirements.txt
```

### Configuration
Update the `.env` file with your actual API and Secret keys.


## Features

#### Current
Expand Down
2 changes: 1 addition & 1 deletion wazirx_sapi_client/rest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

if int(sys.version[0]) < 3 or int(sys.version[2]) < 7:
if sys.version_info < (3, 7):
raise BaseException("Python>=3.7 required")

from wazirx_sapi_client.rest.client import Client
4 changes: 2 additions & 2 deletions wazirx_sapi_client/rest/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class BaseClient(object):
API_URL = 'https://api.wazirx.com/sapi/'

def __init__(
self, api_key="", secret_key=""
self, api_key=os.getenv('API_KEY'), secret_key=os.getenv('SECRET_KEY')
):
self.api_key = api_key
self.secret_key = secret_key
Expand All @@ -24,7 +24,7 @@ def __init__(

class Client(BaseClient):
def __init__(
self, api_key="", secret_key=""
self, api_key=os.getenv('API_KEY'), secret_key=os.getenv('SECRET_KEY')
):
super(Client, self).__init__(api_key, secret_key)

Expand Down
4 changes: 2 additions & 2 deletions wazirx_sapi_client/rest/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from wazirx_sapi_client.rest import Client

# Keys for private events
api_key = "test_api_key"
secret_key = "test_secret_key"
api_key = os.getenv('API_KEY')
secret_key = os.getenv('SECRET_KEY')

# public
c = Client()
Expand Down
2 changes: 1 addition & 1 deletion wazirx_sapi_client/websocket/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys

if int(sys.version[0]) < 3 or int(sys.version[2]) < 7:
if sys.version_info < (3, 7):
raise BaseException("Python>=3.7 required")

from wazirx_sapi_client.websocket.websocket_client import WebsocketClient
4 changes: 2 additions & 2 deletions wazirx_sapi_client/websocket/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ async def main():

"""
# Keys for private events
api_key = "test_api_key"
secret_key = "test_secret_key"
api_key = os.getenv('API_KEY')
secret_key = os.getenv('SECRET_KEY')

ws_client = WebsocketClient(api_key=api_key, secret_key=secret_key)

Expand Down
4 changes: 2 additions & 2 deletions wazirx_sapi_client/websocket/websocket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class BaseWebsocketClient:
"""Wazirx Websocket client implementation"""

def __init__(self, api_key="", secret_key=""):
def __init__(self, api_key=os.getenv('API_KEY'), secret_key=os.getenv('SECRET_KEY')):
"""
Initialize the object.
Arguments:
Expand All @@ -27,7 +27,7 @@ def __init__(self, api_key="", secret_key=""):


class WebsocketClient(BaseWebsocketClient):
def __init__(self, api_key="", secret_key=""):
def __init__(self, api_key=os.getenv('API_KEY'), secret_key=os.getenv('SECRET_KEY')):
super(WebsocketClient, self).__init__(api_key, secret_key)

def get_auth_token(self):
Expand Down