Ejemplo n.º 1
0
        public HttpResponseMessage Post([FromBody] DeployControllerPattern req)
        {
            object contractReceipt;

            Crypto.DecryptTwoStringsAndGetContractFunctions(out string senderAddress, req.Sender, out string password, req.Password, req.PassPhrase, out ContractFunctions contractFunctions);
            try
            {
                contractReceipt = contractFunctions.DeployContract(senderAddress, password, req.Gas).Result;
            }
            catch (Exception e)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.OK, new HttpError(e, true)));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, contractReceipt));
        }
Ejemplo n.º 2
0
 public JsonResult GetApiFromContractAddress([FromForm] DeployControllerPattern req)
 {
     Globals.GetInstance().ContractFunctions.ContractAddress = req.Address;
     return(Json(new { Status = "OK!" }));
 }
Ejemplo n.º 3
0
 public static string GetApiFromContractAddress(DeployControllerPattern req)
 {
     Globals.GetInstance().ContractFunctions.ContractAddress = req.Address;
     return(JsonConvert.SerializeObject(new { Status = "OK!" }));
 }