public static string EmailVerifyResponseUrl() { UInt160 scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash); ApplicationEngine engine = SmartContractHelper.LocalExec(scriptHash, "emailVerifyRespUrl"); return(System.Text.Encoding.UTF8.GetString(engine.EvaluationStack.Peek().GetByteArray())); }
public static bool Grant(string email, string owner) { UInt160 scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash); byte[] ownerScriptHash = Wallet.ToScriptHash(owner).ToArray(); return(SmartContractHelper.Exec(plugin_profile.api.CurrentWallet, plugin_profile.api.LocalNode, scriptHash, null, "grant", email, ownerScriptHash, new byte[0])); }
public static byte[] ContractOwnerPublicKey() { UInt160 scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash); ApplicationEngine engine = SmartContractHelper.LocalExec(scriptHash, "contractOwner"); return(engine.EvaluationStack.Peek().GetByteArray()); }
public static bool Register(string profile, string owner) { UInt160 scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash); UInt160 ownerAddress = Wallet.ToScriptHash(owner); byte[] ownerScriptHash = ownerAddress.ToArray(); return(SmartContractHelper.Exec(plugin_profile.api.CurrentWallet, plugin_profile.api.LocalNode, scriptHash, ownerAddress, "register", profile, ownerScriptHash)); }
public static JObject Query(string email) { UInt160 scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash); ApplicationEngine engine = SmartContractHelper.LocalExec(scriptHash, "query", email); string result = System.Text.Encoding.UTF8.GetString(engine.EvaluationStack.Peek().GetByteArray()); return(ParseProfile(result)); }
public static JObject QueryByAccount(string owner) { UInt160 scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash); byte[] ownerScriptHash = Wallet.ToScriptHash(owner).ToArray(); ApplicationEngine engine = SmartContractHelper.LocalExec(scriptHash, "queryByAccount", ownerScriptHash); string result = System.Text.Encoding.UTF8.GetString(engine.EvaluationStack.Peek().GetByteArray()); return(ParseProfile(result)); }
public static string QueryOwner(string email) { UInt160 scriptHash = UInt160.Parse(plugin_profile.ContractScriptHash); ApplicationEngine engine = SmartContractHelper.LocalExec(scriptHash, "queryOwner", email); byte[] owner = engine.EvaluationStack.Peek().GetByteArray(); try { UInt160 ownerScriptHash = new UInt160(owner); return(Wallet.ToAddress(ownerScriptHash)); } catch (Exception) { return(""); } }