8000 V0.0.3 by marzig76 · Pull Request #16 · geminipy/geminipy · GitHub
[go: up one dir, main page]

Skip to content
Merged
8000
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
1 change: 1 addition & 0 deletions changelog
8000
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 21 additions & 0 deletions geminipy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
0