code: def new_add_public_key_transaction(self, ont_id: str, bytes_operator: bytes, new_pub_key: str or bytes,
                                         b58_payer_address: str, gas_limit: int, gas_price: int,
                                         is_recovery: bool = False):
          
          if isinstance(new_pub_key, str):
              bytes_new_pub_key = bytes.fromhex(new_pub_key)
          elif isinstance(new_pub_key, bytes):
              bytes_new_pub_key = new_pub_key
          else:
              raise SDKException(ErrorCode.params_type_error('a bytes or str type of public key is required.'))
          if is_recovery:
              args = dict(ontid=ont_id, pk=bytes_new_pub_key, operator=bytes_operator)
          else:
              args = dict(ontid=ont_id, pk=bytes_new_pub_key, operator=bytes_operator)
          tx = self.__generate_transaction('addKey', args, b58_payer_address, gas_limit, gas_price)
          return tx
docs: This interface is used to send a Transaction object which is used to add public key.
  
          :param ont_id: OntId.
          :param bytes_operator: operator args in from of bytes.
          :param new_pub_key: the new hexadecimal public key in the form of string.
          :param b58_payer_address: a base58 encode address which indicate who will pay for the transaction.
          :param gas_limit: an int value that indicate the gas limit.
          :param gas_price: an int value that indicate the gas price.
          :param is_recovery: indicate whether ctrl account is a recovery account.
          :return: a Transaction object which is used to add public key.