Exemplo n.º 1
0
 def post(self):
     nem = NEMConnect()
     validator_obj = Validator(namespace_schema)
     data = json.loads(request.data)
     validate = validator_obj.validate(data)
     response = {}
     if (validate):
         transation = data.get("transaction")
         if transation is not None:
             timestamp = utils.get_timestamp()
             transation["timeStamp"] = timestamp
             transation["deadline"] = utils.get_deadline(timestamp)
             transation["rentalFee"] = CONFIG["CreateNameSpace"].get(
                 "rentalFee")
             transation["fee"] = CONFIG["CreateNameSpace"].get("fee")
             transation["type"] = CONFIG["CreateNameSpace"].get("type")
             transation["version"] = CONFIG.get("version")
         response = nem.initiate_transaction(data)
     else:
         response['Errors'] = validator_obj.errors
     return response
Exemplo n.º 2
0
    def post(self):
        nem = NEMConnect()
        data = json.loads(request.data)
        transation = data.get("transaction")
        if transation is not None:
            timestamp = utils.get_timestamp()
            transation["timeStamp"] = timestamp
            transation["deadline"] = utils.get_deadline(timestamp)
            transation["fee"] = CONFIG["InitiateMultiSignTransaction"].get(
                "fee")
            transation["type"] = CONFIG["InitiateMultiSignTransaction"].get(
                "type")
            transation["version"] = CONFIG.get("version")
            if transation.get("otherTrans") is not None:
                transation["otherTrans"]["fee"] = CONFIG[
                    "InitiateMultiSignTransaction"]["otherTrans"].get("fee")
                transation["otherTrans"]["type"] = CONFIG[
                    "InitiateMultiSignTransaction"]["otherTrans"].get("type")
                transation["otherTrans"]["timeStamp"] = transation["timeStamp"]
                transation["otherTrans"]["deadline"] = transation["deadline"]
                transation["otherTrans"]["version"] = CONFIG.get("version")

        response = nem.initiate_transaction(data)
        return response
Exemplo n.º 3
0
 def get(self):
     nem = NEMConnect()
     address = request.headers.get('Address')
     response = nem.get_account_detail(address)
     return response
Exemplo n.º 4
0
 def get(self):
     nem = NEMConnect()
     response = nem.get_heartbeat()
     return response