コード例 #1
0
        public IEnumerator SendRequest(Nethereum.RPC.Eth.DTOs.TransactionInput input)
        {
            var request = _ethSendTransaction.BuildRequest(input);

            if (this.network == "ganache")
            {
                Debug.Log("Using ganache, just forwarding request on...");
                yield return(base.SendRequest(request));

                yield break;
            }

            var requestFormatted = new RpcModel.RpcRequest(request.Id, request.Method, request.RawParameters);
            var rpcRequestJson   = JsonConvert.SerializeObject(requestFormatted, JsonSerializerSettings);

            Debug.Log(rpcRequestJson);
            this.authProvider.SendTransaction(this.network, request.Method, rpcRequestJson, SendRequestCallback);

            var waitCount = 0;

            while (this.Result == null && this.Exception == null)
            {
                if (waitCount > 100)
                {
                    break;
                }
                waitCount++;
                yield return(new WaitForSeconds((float)0.1));
            }
        }
コード例 #2
0
        public IEnumerator SendRequest(Nethereum.RPC.Eth.DTOs.TransactionInput input)
        {
            var request = _ethSendTransaction.BuildRequest(input);

            yield return(SendRequest(request));
        }