Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

Commit

Permalink
Add notifications support
Browse files Browse the repository at this point in the history
  • Loading branch information
maksim-s committed Dec 31, 2015
1 parent d215b2e commit c29183b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions coinbase/wallet/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from coinbase.wallet.model import CurrentUser
from coinbase.wallet.model import Deposit
from coinbase.wallet.model import Merchant
from coinbase.wallet.model import Notification
from coinbase.wallet.model import PaymentMethod
from coinbase.wallet.model import Order
from coinbase.wallet.model import Sell
Expand Down Expand Up @@ -255,6 +256,18 @@ def delete_account(self, account_id, **params):
self._delete('v2', 'accounts', account_id, data=params)
return None

# Notifications API
# -----------------------------------------------------------
def get_notifications(self, **params):
"""https://developers.coinbase.com/api/v2#list-notifications"""
response = self._get('v2', 'notifications', data=params)
return self._make_api_object(response, Notification)

def get_notification(self, notification_id, **params):
"""https://developers.coinbase.com/api/v2#show-a-notification"""
response = self._get('v2', 'notifications', notification_id, data=params)
return self._make_api_object(response, Notification)

# Addresses API
# -----------------------------------------------------------
def get_addresses(self, account_id, **params):
Expand Down
2 changes: 2 additions & 0 deletions coinbase/wallet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def commit_withdrawal(self, withdrawal_id, **params):
"""https://developers.coinbase.com/api/v2#commit-a-withdrawal"""
return self.api_client.commit_withdrawal(self.id, withdrawal_id, **params)

class Notification(APIObject): pass

class Address(APIObject): pass

Expand Down Expand Up @@ -347,6 +348,7 @@ def modify(self, **params):
'checkout': Checkout,
'deposit': Transfer,
'merchant': Merchant,
'notification': Notification,
'order': Order,
'payment_method': PaymentMethod,
'sell': Sell,
Expand Down

0 comments on commit c29183b

Please sign in to comment.