docs: def add_inputs(self, private_key=None, address=None, amount='all', max_ins=None, password=None, services=None, **modes):
          """
          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.
          """
          if private_key:
              if private_key.startswith('6P'):
                  if not password:
                      raise Exception("Password required for BIP38 encoded private keys")
                  from .bip38 import Bip38EncryptedPrivateKey
                  private_key = Bip38EncryptedPrivateKey(self.crypto, private_key).decrypt(password)
  
              address_from_priv = self.private_key_to_address(private_key)
              if address and address != address_from_priv:
                  raise Exception("Invalid Private key")
              address = address_from_priv
              self.change_address = address
  
          if not services:
              services = get_optimal_services(self.crypto, 'unspent_outputs')
  
          total_added_satoshi = 0
          ins = 0
          for utxo in self._get_utxos(address, services, **modes):
              if max_ins and ins >= max_ins:
                  break
              if (amount == 'all' or total_added_satoshi < amount):
                  ins += 1
                  self.ins.append(
                      dict(input=utxo, private_key=private_key)
                  )
                  total_added_satoshi += utxo['amount']
  
          return total_added_satoshi, ins