code: def new_add_attribute_transaction(self, ont_id: str, pub_key: str or bytes, attributes: Attribute,
                                        b58_payer_address: str, gas_limit: int, gas_price: int):
          
          if isinstance(pub_key, str):
              bytes_pub_key = bytes.fromhex(pub_key)
          elif isinstance(pub_key, bytes):
              bytes_pub_key = pub_key
          else:
              raise SDKException(ErrorCode.params_type_error('a bytes or str type of public key is required.'))
          bytes_ont_id = ont_id.encode('utf-8')
          args = dict(ontid=bytes_ont_id)
          attrib_dict = attributes.to_dict()
          args = dict(**args, **attrib_dict)
          args['pubkey'] = bytes_pub_key
          tx = self.__generate_transaction('addAttributes', args, b58_payer_address, gas_limit, gas_price)
          return tx
docs: This interface is used to generate a Transaction object which is used to add attribute.
  
          :param ont_id: OntId.
          :param pub_key: the hexadecimal public key in the form of string.
          :param attributes: a list of attributes we want to add.
          :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.
          :return: a Transaction object which is used to add attribute.