Skip to content
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
2 changes: 1 addition & 1 deletion gdax/authenticated_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def coinbase_withdraw(self, amount="", currency="", coinbase_account_id=""):
"currency": currency,
"coinbase_account_id": coinbase_account_id
}
r = requests.post(self.url + "/withdrawals/coinbase", data=json.dumps(payload), auth=self.auth, timeout=self.timeout)
r = requests.post(self.url + "/withdrawals/coinbase-account", data=json.dumps(payload), auth=self.auth, timeout=self.timeout)
# r.raise_for_status()
return r.json()

Expand Down
7 changes: 5 additions & 2 deletions gdax/gdax_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ def __init__(self, api_key, secret_key, passphrase):

def __call__(self, request):
timestamp = str(time.time())
message = timestamp + request.method + request.path_url + (request.body or '')
request.headers.update(get_auth_headers(timestamp, message, self.api_key, self.secret_key,
message = ''.join([timestamp, request.method,
request.path_url, (request.body or '')])
request.headers.update(get_auth_headers(timestamp, message,
self.api_key,
self.secret_key,
self.passphrase))
return request

Expand Down
10 changes: 7 additions & 3 deletions tests/test_public_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pytest
import gdax
import time
import datetime
from dateutil.relativedelta import relativedelta


@pytest.fixture(scope='module')
Expand Down Expand Up @@ -46,9 +48,11 @@ def test_get_product_trades(self, client):
assert type(r) is list
assert 'trade_id' in r[0]

@pytest.mark.parametrize('start', ('2017-11-01', None))
@pytest.mark.parametrize('end', ('2017-11-30', None))
@pytest.mark.parametrize('granularity', (3600, None))
current_time = datetime.datetime.now()

@pytest.mark.parametrize('start,end,granularity',
[(current_time - relativedelta(months=1),
current_time, 10000)])
def test_get_historic_rates(self, client, start, end, granularity):
r = client.get_product_historic_rates('BTC-USD', start=start, end=end, granularity=granularity)
assert type(r) is list
Expand Down