From e9029758ea4d7129dc01c63adec76be80ce75102 Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Fri, 27 Oct 2017 17:55:46 -0400 Subject: [PATCH 01/13] added function for the public endpoint pubticker --- geminipy/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/geminipy/__init__.py b/geminipy/__init__.py index 4800e1e..6a378e0 100644 --- a/geminipy/__init__.py +++ b/geminipy/__init__.py @@ -47,6 +47,12 @@ def symbols(self): return requests.get(url) + def pubticker(self, symbol='btcusd'): + """Send a request for latest ticker info, return the response""" + url = self.base_url + '/v1/pubticker/' + symbol + + return requests.get(url) + def book(self, symbol='btcusd', limit_bids=0, limit_asks=0): """ Send a request to get the public order book, return the response. From 6b323fb3409dbf7add0b16d33156efb50589deb1 Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Fri, 27 Oct 2017 18:13:26 -0400 Subject: [PATCH 02/13] added function for the auction endpoint --- geminipy/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/geminipy/__init__.py b/geminipy/__init__.py index 6a378e0..13ce73b 100644 --- a/geminipy/__init__.py +++ b/geminipy/__init__.py @@ -90,6 +90,12 @@ def trades(self, symbol='btcusd', since=0, limit_trades=50, return requests.get(url, params) + def auction(self, symbol='btcusd'): + """Send a request for latest auction info, return the response""" + url = self.base_url + '/v1/auction/' + symbol + + return requests.get(url) + # authenticated requests def new_order(self, amount, price, side, client_order_id=None, symbol='btcusd', type='exchange limit', options=None): From 3e648ec657b6029560a6db31f64bc322006c7e39 Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Fri, 27 Oct 2017 18:30:09 -0400 Subject: [PATCH 03/13] added function for the auction_history endpoint --- geminipy/__init__.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/geminipy/__init__.py b/geminipy/__init__.py index 13ce73b..843f6d3 100644 --- a/geminipy/__init__.py +++ b/geminipy/__init__.py @@ -48,7 +48,7 @@ def symbols(self): return requests.get(url) def pubticker(self, symbol='btcusd'): - """Send a request for latest ticker info, return the response""" + """Send a request for latest ticker info, return the response.""" url = self.base_url + '/v1/pubticker/' + symbol return requests.get(url) @@ -91,11 +91,33 @@ def trades(self, symbol='btcusd', since=0, limit_trades=50, return requests.get(url, params) def auction(self, symbol='btcusd'): - """Send a request for latest auction info, return the response""" + """Send a request for latest auction info, return the response.""" url = self.base_url + '/v1/auction/' + symbol return requests.get(url) + def auction_history(self, symbol='btcusd', since=0, + limit_auction_results=50, include_indicative=1): + """ + Send a request for auction history info, return the response. + + Arguments: + symbol -- currency symbol (default 'btcusd') + since -- only return auction events after this timestamp (default 0) + limit_auction_results -- maximum number of auction events to return + (default 50). + include_indicative -- whether to include publication of indicative + prices and quantities. (default True) + """ + url = self.base_url + '/v1/auction/' + symbol + '/history' + params = { + 'since': since, + 'limit_auction_results': limit_auction_results, + 'include_indicative': include_indicative + } + + return requests.get(url, params) + # authenticated requests def new_order(self, amount, price, side, client_order_id=None, symbol='btcusd', type='exchange limit', options=None): From bfb4e87a4e15d38a082718dbe3ab73ba6dc24ce3 Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Fri, 27 Oct 2017 19:43:10 -0400 Subject: [PATCH 04/13] started a changelog --- changelog | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..d09655b --- /dev/null +++ b/changelog @@ -0,0 +1,9 @@ +# Geminipy Changelog + +# v0.0.3 +Added a function for the public ticker "pubticker" API endpoint +Added functions for auction data (including history) + +# v0.0.2 +Changed project layout to make it compatible with PyPi (pip) +Added an "options" argument to the "new_order" function From 65b6bb5474706526344d3cb4a6609ddb8457bd5f Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Fri, 27 Oct 2017 20:39:39 -0400 Subject: [PATCH 05/13] added a tradeolume function and updated changelog --- changelog | 5 +++-- geminipy/__init__.py | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/changelog b/changelog index d09655b..86e18ff 100644 --- a/changelog +++ b/changelog @@ -1,8 +1,9 @@ # Geminipy Changelog # v0.0.3 -Added a function for the public ticker "pubticker" API endpoint -Added functions for auction data (including history) +Added "pubticker" function for the public ticker API endpoint +Added "auction" and "auction_history" functions for auction data +Added "tradevolume" function to get user trade volume # v0.0.2 Changed project layout to make it compatible with PyPi (pip) diff --git a/geminipy/__init__.py b/geminipy/__init__.py index 843f6d3..bacf307 100644 --- a/geminipy/__init__.py +++ b/geminipy/__init__.py @@ -240,6 +240,17 @@ def past_trades(self, symbol='btcusd', limit_trades=50, timestamp=0): return requests.post(url, headers=self.prepare(params)) + def tradevolume(self): + """Send a request to get your trade volume, return the response.""" + request = '/v1/tradevolume' + url = self.base_url + request + params = { + 'request': request, + 'nonce': self.get_nonce() + } + + return requests.post(url, headers=self.prepare(params)) + def balances(self): """Send an account balance request, return the response.""" request = '/v1/balances' From dbc2f20907f542d0ec054c52b510f929a9b3b86e Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Fri, 27 Oct 2017 21:18:24 -0400 Subject: [PATCH 06/13] added a newAddress function --- geminipy/__init__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/geminipy/__init__.py b/geminipy/__init__.py index bacf307..93a1c19 100644 --- a/geminipy/__init__.py +++ b/geminipy/__init__.py @@ -262,6 +262,27 @@ def balances(self): return requests.post(url, headers=self.prepare(params)) + def newAddress(self, currency='btc', label=''): + """ + Send a request for a new cryptocurrency deposit address + with an optional label. Return the response. + + Arguements: + currency -- a Gemini supported cryptocurrency (btc, eth) + label -- optional label for the deposit address + """ + request = '/v1/deposit/' + currency + '/newAddress' + url = self.base_url + request + params = { + 'request': request, + 'nonce': self.get_nonce() + } + + if label != '': + params['label'] = label + + return requests.post(url, headers=self.prepare(params)) + def heartbeat(self): """Send a heartbeat message, return the response.""" request = '/v1/heartbeat' From 4e4f77ef61a0a65e37e08daec8fe3b572158bc7e Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Fri, 27 Oct 2017 21:19:22 -0400 Subject: [PATCH 07/13] updated changelog with newaddress details --- changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog b/changelog index 86e18ff..7d531d3 100644 --- a/changelog +++ b/changelog @@ -4,6 +4,7 @@ Added "pubticker" function for the public ticker API endpoint Added "auction" and "auction_history" functions for auction data Added "tradevolume" function to get user trade volume +Added "newAddress" function to get a new cryptocurrency deposit address # v0.0.2 Changed project layout to make it compatible with PyPi (pip) From 0d83fe225b746ac4c8bb800aa6091e1b606231e8 Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Fri, 27 Oct 2017 21:31:30 -0400 Subject: [PATCH 08/13] update version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6de423b..384b9ce 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='geminipy', - version='0.0.2', + version='0.0.3', packages=['geminipy'], url='https://github.com/geminipy/geminipy', license='GNU GPL', From 0572d972a2e98bf71daa57522052b4fe4d6102af Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Fri, 27 Oct 2017 21:42:01 -0400 Subject: [PATCH 09/13] setup for v0.0.4 --- changelog | 2 ++ setup.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog b/changelog index 7d531d3..1d080d1 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,7 @@ # Geminipy Changelog +# v0.0.4 + # v0.0.3 Added "pubticker" function for the public ticker API endpoint Added "auction" and "auction_history" functions for auction data diff --git a/setup.py b/setup.py index 384b9ce..e0eb96d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='geminipy', - version='0.0.3', + version='0.0.4', packages=['geminipy'], url='https://github.com/geminipy/geminipy', license='GNU GPL', From 77f8fa21f4f72e4e88857ffdb01878550e3eec13 Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Tue, 1 Oct 2019 11:56:52 -0400 Subject: [PATCH 10/13] added api call for fees --- geminipy/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/geminipy/__init__.py b/geminipy/__init__.py index 93a1c19..bb0373f 100644 --- a/geminipy/__init__.py +++ b/geminipy/__init__.py @@ -283,6 +283,17 @@ def newAddress(self, currency='btc', label=''): return requests.post(url, headers=self.prepare(params)) + def fees(self): + """Send a request to get your trade volume, return the response.""" + request = '/v1/notionalvolume' + url = self.base_url + request + params = { + 'request': request, + 'nonce': self.get_nonce() + } + + return requests.post(url, headers=self.prepare(params)) + def heartbeat(self): """Send a heartbeat message, return the response.""" request = '/v1/heartbeat' From 72d8acb6366ff967180ab1f0b269ca013d2b81ea Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Tue, 1 Oct 2019 12:07:52 -0400 Subject: [PATCH 11/13] fixed comments for new fee api call --- geminipy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geminipy/__init__.py b/geminipy/__init__.py index bb0373f..20c0a3c 100644 --- a/geminipy/__init__.py +++ b/geminipy/__init__.py @@ -284,7 +284,7 @@ def newAddress(self, currency='btc', label=''): return requests.post(url, headers=self.prepare(params)) def fees(self): - """Send a request to get your trade volume, return the response.""" + """Send a request to get fee and notional volume, return the response.""" request = '/v1/notionalvolume' url = self.base_url + request params = { From 399213fa29bc7211f3f9a3a96b72f0075353dd12 Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Tue, 1 Oct 2019 12:23:10 -0400 Subject: [PATCH 12/13] change version info and changelog for v0.0.4 --- changelog | 3 +++ setup.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog b/changelog index 7d531d3..274a0ad 100644 --- a/changelog +++ b/changelog @@ -1,5 +1,8 @@ # Geminipy Changelog +# v0.0.4 +Added "fees" function for the fee and notional volume API endpoint + # v0.0.3 Added "pubticker" function for the public ticker API endpoint Added "auction" and "auction_history" functions for auction data diff --git a/setup.py b/setup.py index 6de423b..e0eb96d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='geminipy', - version='0.0.2', + version='0.0.4', packages=['geminipy'], url='https://github.com/geminipy/geminipy', license='GNU GPL', From 92b49fbb4a5b29abb04b98ce4740593a8068bae5 Mon Sep 17 00:00:00 2001 From: Mike Marzigliano Date: Tue, 1 Oct 2019 13:56:39 -0400 Subject: [PATCH 13/13] twine didn't like the triple tick-mark in the README file, so I'm removing it when uploading to pypi --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e0eb96d..c9d0387 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup with open('README.md') as f: - readme = f.read() + readme = f.read().replace('```', '') setup( name='geminipy',