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

Commit 6adfd10

Browse files
committed
Allow passing an option
1 parent 9ffcaac commit 6adfd10

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

coinbase/wallet/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from __future__ import unicode_literals
66

77
import base64
8+
import datetime
89
import os
910
import re
1011
import requests
@@ -64,11 +65,10 @@ class Client(object):
6465
VERIFY_SSL = True
6566

6667
BASE_API_URI = 'https://api.coinbase.com/'
67-
API_VERSION = '2015-06-16'
6868

6969
cached_callback_public_key = None
7070

71-
def __init__(self, api_key, api_secret, base_api_uri=None):
71+
def __init__(self, api_key, api_secret, base_api_uri=None, api_version=None):
7272
if not api_key:
7373
raise ValueError('Missing `api_key`.')
7474
if not api_secret:
@@ -77,6 +77,8 @@ def __init__(self, api_key, api_secret, base_api_uri=None):
7777
# Allow passing in a different API base.
7878
self.BASE_API_URI = check_uri_security(base_api_uri or self.BASE_API_URI)
7979

80+
self.API_VERSION = api_version or str(datetime.date.today())
81+
8082
# Set up a requests session for interacting with the API.
8183
self.session = self._build_session(HMACAuth, api_key, api_secret, self.API_VERSION)
8284

0 commit comments

Comments
 (0)