/// <summary> /// Connects to blockchain using the JsonRpc client and performs a handshake /// </summary> /// <returns>String return infromation received from client</returns> public async Task <string> Connect() { string verStr = null; string codeStr = null; try { var ver = new Nethereum.RPC.Web3.Web3ClientVersion(web.Client); verStr = await ver.SendRequestAsync(); //check if game contract exists var code = new Nethereum.RPC.Eth.EthGetCode(web.Client); codeStr = await code.SendRequestAsync(gameCenter.Address); } catch (Exception ex) { throw new Exception(ex.ToString(), ex); } if (string.IsNullOrEmpty(codeStr) || (codeStr == "0x")) { throw new HoardException("Could not find Game Center contract at address: " + gameCenter.Address); } return(verStr); }
public Web3ClientVersionUnityRequest(string url, JsonSerializerSettings jsonSerializerSettings = null) : base(url, jsonSerializerSettings) { _web3ClientVersion = new Nethereum.RPC.Web3.Web3ClientVersion(null); }
public Web3ClientVersionUnityRequest(string network = "mainnet", AuthProvider authProvider = null, JsonSerializerSettings jsonSerializerSettings = null) : base(network, authProvider, jsonSerializerSettings) { _web3ClientVersion = new Nethereum.RPC.Web3.Web3ClientVersion(null); }