Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Fix for the issue #12: replaced the dependency "gdax" with "cbpro" #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pypi"
bintrees = "==2.0.7"
coinbase = "==2.1.0"
fdfgen = "==0.16.1"
gdax = "==1.0.6"
cbpro = "==1.1.4"
geminipy = "==0.0.3"
python-dateutil = "==2.7.2"
requests = "==2.13.0"
Expand Down
128 changes: 107 additions & 21 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 14 additions & 15 deletions exchanges/gdax_reader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime
from dateutil import parser as date_parser
import gdax
import cbpro as gdax
from exchanges import Exchange


Expand Down Expand Up @@ -29,20 +29,19 @@ def get_order_ids(self, history, ignore_products=[]):
:param ignore_products:
:return:
"""
order_ids = []
for history_group in history:
for transaction in history_group:
if 'order_id' in transaction['details'] and 'product_id' in transaction['details']:
if transaction['details']['order_id'] not in order_ids and \
transaction['details']['product_id'] not in ignore_products:
order_ids.append(transaction['details']['order_id'])
elif 'source' in transaction['details'] and transaction['details']['source'] == 'fork':
# this was a forked coin deposit
print(transaction['amount'] + transaction['details']['ticker'] + " obtained from a fork.")
elif 'transfer_id' not in transaction['details']:
print("No order_id or transfer_id in details for the following order (WEIRD!)")
print(transaction)
return order_ids
order_ids = {}
for transaction in history:
if 'order_id' in transaction['details'] and 'product_id' in transaction['details']:
if transaction['details']['order_id'] not in order_ids and \
transaction['details']['product_id'] not in ignore_products:
order_ids[transaction['details']['order_id']] = 1
elif 'source' in transaction['details'] and transaction['details']['source'] == 'fork':
# this was a forked coin deposit
print(transaction['amount'] + transaction['details']['ticker'] + " obtained from a fork.")
elif 'transfer_id' not in transaction['details']:
print("No order_id or transfer_id in details for the following order (WEIRD!)")
print(transaction)
return list(order_ids.keys())

def parse_order(self, order):
"""
Expand Down