Skip to content

Commit 2df5cda

Browse files
v1.0.13: Add email endpoints [BAC-1639] (#63)
* Add email endpoints * fix
1 parent c83a02b commit 2df5cda

4 files changed

Lines changed: 54 additions & 1 deletion

File tree

dydx3/modules/private.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,21 @@ def get_historical_pnl(
897897
},
898898
)
899899

900+
def send_verification_email(
901+
self,
902+
):
903+
'''
904+
Send verification email
905+
906+
:returns: Empty object
907+
908+
:raises: DydxAPIError
909+
'''
910+
return self._put(
911+
'emails/send-verification-email',
912+
{},
913+
)
914+
900915
# ============ Signing ============
901916

902917
def sign(

dydx3/modules/public.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ def _get(self, request_path, params={}):
1818
'get',
1919
)
2020

21+
def _put(self, endpoint, data):
22+
return request(
23+
self.host + '/v3/' + endpoint,
24+
'put',
25+
{},
26+
data,
27+
)
28+
2129
# ============ Requests ============
2230

2331
def check_if_user_exists(self, ethereum_address):
@@ -237,3 +245,24 @@ def get_time(self):
237245
'''
238246
uri = '/v3/time'
239247
return self._get(uri)
248+
249+
def verify_email(
250+
self,
251+
token,
252+
):
253+
'''
254+
Verify email with token
255+
256+
:param token: required
257+
:type token: string
258+
259+
:returns: empty object
260+
261+
:raises: DydxAPIError
262+
'''
263+
return self._put(
264+
'emails/verify-email',
265+
{
266+
'token': token,
267+
}
268+
)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
setup(
2121
name='dydx-v3-python',
22-
version='1.0.12',
22+
version='1.0.13',
2323
packages=find_packages(),
2424
package_data={
2525
'dydx3': [

tests/test_public.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,12 @@ def test_get_fast_withdrawal(self):
5959
public = Client(API_HOST).public
6060
json = public.get_fast_withdrawal()
6161
assert json != {}
62+
63+
def test_verify_email(self):
64+
try:
65+
public = Client(API_HOST).public
66+
public.verify_email('token')
67+
except Exception as e:
68+
# No userId gotten with token: token so no verification
69+
# has occurred
70+
assert e.status_code == 400

0 commit comments

Comments
 (0)