예제 #1
0
        public SeedInfoTransaction GetSeedKey()
        {
            RpcClient rpcClient   = new RpcClient();
            string    queryString = "";

            rpcClient.SetServerInfo(CeremonyClientFinal.Core.Settings.Default.server_url);

            JObject requestParam = new JObject();

            requestParam["pubkey"] = MyInfo.MyWallet.GetPublicKey().ToString();

            JObject requestBody = new JObject();

            requestBody["method"] = "GetSeedKey";
            requestBody["params"] = requestParam;

            queryString = requestBody.ToString();

            try
            {
                string  response     = rpcClient.SendRequest(queryString);
                JObject responseBody = JObject.Parse(response);
                JObject result       = responseBody["result"];

                if (result["result"].AsString() == "true")
                {
                    SeedInfoTransaction tx = new SeedInfoTransaction();
                    tx.FromJson(result["data"]);
                    return(tx);
                }

                return(null);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }