@@ -384,7 +384,8 @@ def request(self, from_email, amount, notes=''):
384384 return CoinbaseTransaction \
385385 .from_coinbase_dict (response_parsed ['transaction' ])
386386
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 ):
388389 """
389390 Send BitCoin from this account to either an email address or a BTC
390391 address
@@ -398,6 +399,8 @@ def send(self, to_address, amount, notes='', user_fee=None, idem=None):
398399 transaction with the same idem parameter already exists for this
399400 sender, that previous transaction will be returned and a new one will
400401 not be created. Max length 100 characters.
402+ :param token_2fa: Optional two factor token which might be necessary
403+ depending on user permissions
401404 :return: CoinbaseTransaction with status and details
402405 :raise: CoinbaseError with the error list received from Coinbase on
403406 failure
@@ -426,6 +429,9 @@ def send(self, to_address, amount, notes='', user_fee=None, idem=None):
426429 if idem is not None :
427430 request_data ['transaction' ]['idem' ] = str (idem )
428431
432+ if token_2fa is not None :
433+ self .session .headers .update ({'CB-2FA-Token' : token_2fa })
434+
429435 response = self .session .post (url = url , data = json .dumps (request_data ))
430436 response_parsed = response .json ()
431437
0 commit comments