Skip to content

Commit c04aff9

Browse files
committed
Updated JSON Parsing to PublicClient for testing per issue danpaquin#8
1 parent d8960fd commit c04aff9

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

GDAX/PublicClient.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ def getProducts(self):
1919

2020
def getProductOrderBook(self, json=None, level=2, product=''):
2121
if type(json) is dict:
22-
product = json['product'] or self.productId
23-
level = json['level'] or '1'
22+
if "product" in json: product = json["product"]
23+
if "level" in json: level = json['level']
2424
response = requests.get(self.url + '/products/%s/book?level=%s' % (product or self.productId, str(level)))
2525
return response.json()
2626

2727
def getProductTicker(self, json=None, product=''):
2828
if type(json) is dict:
29-
product = json['product'] or self.productId
29+
if "product" in json: product = json["product"]
3030
response = requests.get(self.url + '/products/%s/ticker' % (product or self.productId))
3131
return response.json()
3232

3333
def getProductTrades(self, json=None, product=''):
3434
if type(json) is dict:
35-
product = json['product'] or self.productId
35+
if "product" in json: product = json["product"]
3636
response = requests.get(self.url + '/products/%s/trades' % (product or self.productId))
3737
return response.json()
3838

@@ -50,7 +50,7 @@ def getProductHistoricRates(self, json=None, product='', start='', end='', granu
5050

5151
def getProduct24HrStats(self, json=None, product=''):
5252
if type(json) is dict:
53-
product = json['product'] or self.productId
53+
if "product" in json: product = json["product"]
5454
response = requests.get(self.url + '/products/%s/stats' % (product or self.productId))
5555
return response.json()
5656

0 commit comments

Comments
 (0)