Skip to content

Commit

Permalink
Update Version 1.1.7.0
Browse files Browse the repository at this point in the history
Update Version 1.1.7.0
  • Loading branch information
uJhin committed Feb 20, 2021
1 parent 56f905b commit 2070861
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion upbit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
__all__ = ['client', 'websocket']
__module_name__ = 'upbit-client'

__version__ = '1.1.6.30'
__version__ = '1.1.7.0'
__released_version__ = Version.get_versions(__module_name__)
__latest_version__ = __released_version__[0]

Expand Down
19 changes: 11 additions & 8 deletions upbit/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
import jwt
import hashlib
import uuid

from urllib.parse import urlencode

from bravado.requests_client import Authenticator


QUOTATION_PARAMS = ['uuids', 'txids', 'identifiers']


class APIKeyAuthenticator(Authenticator):

def __init__(self, host, access_key, secret_key):
Expand Down Expand Up @@ -51,19 +55,18 @@ def generate_payload(self, request):
return authorize_token

def generate_query(self, params):
quotation_params = ['uuids', 'txids', 'identifiers']
query = urlencode({
k: v
for k, v in params.items()
if k not in quotation_params
if k not in QUOTATION_PARAMS
})
for q_param in quotation_params:
if params.get(q_param):
param = params.pop(q_param)
params[f"{q_param}[]"] = param
for quotation in QUOTATION_PARAMS:
if params.get(quotation):
param = params.pop(quotation)
params[f"{quotation}[]"] = param
query_params = '&'.join([
f"{q_param}[]={q}"
for q in q_param
f"{quotation}[]={q}"
for q in quotation
])
query = f"{query}&{query_params}" if query else query_params
return query
2 changes: 1 addition & 1 deletion upbit/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from upbit.models import *
from .models import *


class Upbit:
Expand Down
7 changes: 5 additions & 2 deletions upbit/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from bravado.requests_client import RequestsClient as rc
from bravado.client import SwaggerClient as sc

from upbit.authentication import APIKeyAuthenticator
from upbit.utils import HTTPFutureExtractor
from .authentication import APIKeyAuthenticator
from .utils import HTTPFutureExtractor


HOST = "https://api.upbit.com"
Expand Down Expand Up @@ -531,6 +531,9 @@ def Trade_ticks(self, **kwargs) -> dict:


class Withdraw:
"""
출금
"""

def __init__(self, client):
self.__client = client
Expand Down

0 comments on commit 2070861

Please sign in to comment.