@@ -384,7 +384,8 @@ def request(self, from_email, amount, notes=''):
384
384
return CoinbaseTransaction \
385
385
.from_coinbase_dict (response_parsed ['transaction' ])
386
386
387
- def send (self , to_address , amount , notes = '' , user_fee = None , idem = None ):
387
+ def send (self , to_address , amount , notes = '' , user_fee = None , idem = None ,
388
+ token_2fa = None ):
388
389
"""
389
390
Send BitCoin from this account to either an email address or a BTC
390
391
address
@@ -398,6 +399,8 @@ def send(self, to_address, amount, notes='', user_fee=None, idem=None):
398
399
transaction with the same idem parameter already exists for this
399
400
sender, that previous transaction will be returned and a new one will
400
401
not be created. Max length 100 characters.
402
+ :param token_2fa: Optional two factor token which might be necessary
403
+ depending on user permissions
401
404
:return: CoinbaseTransaction with status and details
402
405
:raise: CoinbaseError with the error list received from Coinbase on
403
406
failure
@@ -426,6 +429,9 @@ def send(self, to_address, amount, notes='', user_fee=None, idem=None):
426
429
if idem is not None :
427
430
request_data ['transaction' ]['idem' ] = str (idem )
428
431
432
+ if token_2fa is not None :
433
+ self .session .headers .update ({'CB-2FA-Token' : token_2fa })
434
+
429
435
response = self .session .post (url = url , data = json .dumps (request_data ))
430
436
response_parsed = response .json ()
431
437
0 commit comments