def MoneyTransfer(self): data = {"Recipient": "0005-2070-2000-0006-0200", "Amount": "2"} sign = utils.prepare_tx(url, prKey, "MoneyTransfer", token, data) dataContract = {"time": sign['time'], "signature": sign["signature"]} self.client.post("/contract/" + sign["reqID"], dataContract, headers={"Authorization": token}, name="MoneyTransfer")
def NewContract(self): code, name = utils.generate_name_and_code("") data = {"Value": code, "ApplicationId": 1, "Conditions": "true"} sign = utils.prepare_tx(url, prKey, "NewContract", token, data) dataContract = {"time": sign['time'], "signature": sign["signature"]} self.client.post("/contract/" + sign["reqID"], dataContract, headers={"Authorization": token}, name="NewContract")
def NewLang(self): data = { "AppID": 1, "Name": "Lang_" + utils.generate_random_name(), "Trans": "{\"en\": \"false\", \"ru\" : \"true\"}", "ApplicationId": 1 } sign = utils.prepare_tx(url, prKey, "NewLang", token, data) dataContract = {"time": sign['time'], "signature": sign["signature"]} self.client.post("/contract/" + sign["reqID"], dataContract, headers={"Authorization": token}, name="NewLang")
def NewBlock(self): name = "Block_" + utils.generate_random_name() data = { "Name": name, "Value": "Hello page!", "ApplicationId": 1, "Conditions": "true" } sign = utils.prepare_tx(url, prKey, "NewBlock", token, data) dataContract = {"time": sign['time'], "signature": sign["signature"]} self.client.post("/contract/" + sign["reqID"], dataContract, headers={"Authorization": token}, name="NewBlock")
def NewTable(self): column = """[{"name":"MyName","type":"varchar", "index": "1", "conditions":"true"}]""" permission = """{"insert": "false", "update" : "true","new_column": "true"}""" data = { "Name": "Tab_" + utils.generate_random_name(), "Columns": column, "ApplicationId": 1, "Permissions": permission } sign = utils.prepare_tx(url, prKey, "NewTable", token, data) dataContract = {"time": sign['time'], "signature": sign["signature"]} self.client.post("/contract/" + sign["reqID"], dataContract, headers={"Authorization": token}, name="NewTable")