def add_inputs(self, private_key=None, address=None, amount='<STR_LIT:all>', max_ins=None, password=None, services=None, **modes):
if private_key:<EOL><INDENT>if private_key.startswith('<STR_LIT>'):<EOL><INDENT>if not password:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>from .bip38 import Bip38EncryptedPrivateKey<EOL>private_key = Bip38EncryptedPrivateKey(self.crypto, private_key).decrypt(password)<EOL><DEDENT>address_from_priv = self.private_key_to_address(private_key)<EOL>if address and address != address_from_priv:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>address = address_from_priv<EOL>self.change_address = address<EOL><DEDENT>if not services:<EOL><INDENT>services = get_optimal_services(self.crypto, '<STR_LIT>')<EOL><DEDENT>total_added_satoshi = <NUM_LIT:0><EOL>ins = <NUM_LIT:0><EOL>for utxo in self._get_utxos(address, services, **modes):<EOL><INDENT>if max_ins and ins >= max_ins:<EOL><INDENT>break<EOL><DEDENT>if (amount == '<STR_LIT:all>' or total_added_satoshi < amount):<EOL><INDENT>ins += <NUM_LIT:1><EOL>self.ins.append(<EOL>dict(input=utxo, private_key=private_key)<EOL>)<EOL>total_added_satoshi += utxo['<STR_LIT>']<EOL><DEDENT><DEDENT>return total_added_satoshi, ins<EOL>
Make call to external service to get inputs from an address and/or private_key.
`amount` is the amount of [currency] worth of inputs (in satoshis) to add from
this address. Pass in 'all' (the default) to use *all* inputs found for this address.
 Returned is the number of units (in satoshis) that were added as inputs to this tx.