public EthApiService(IClient client, ITransactionManager transactionManager) : base(client)
        {
            Client = client;

            ChainId         = new EthChainId(client);
            Accounts        = new EthAccounts(client);
            CoinBase        = new EthCoinBase(client);
            GasPrice        = new EthGasPrice(client);
            GetBalance      = new EthGetBalance(client);
            GetCode         = new EthGetCode(client);
            GetStorageAt    = new EthGetStorageAt(client);
            ProtocolVersion = new EthProtocolVersion(client);
            Sign            = new EthSign(client);
            Syncing         = new EthSyncing(client);

            Transactions = new EthApiTransactionsService(client);
            Filters      = new EthApiFilterService(client);
            Blocks       = new EthApiBlockService(client);
            Uncles       = new EthApiUncleService(client);
            Mining       = new EthApiMiningService(client);
            Compile      = new EthApiCompilerService(client);

            DefaultBlock              = BlockParameter.CreateLatest();
            TransactionManager        = transactionManager;
            TransactionManager.Client = client; //Ensure is the same
        }
Example #2
0
        public Eth(RpcClient client) : base(client)
        {
            this.Client = client;



            DeployContract = new DeployContract(client);

            Accounts        = new EthAccounts(client);
            CoinBase        = new EthCoinBase(client);
            GasPrice        = new EthGasPrice(client);
            GetBalance      = new EthGetBalance(client);
            GetCode         = new EthGetCode(client);
            GetStorageAt    = new EthGetStorageAt(client);
            ProtocolVersion = new EthProtocolVersion(client);
            Sign            = new EthSign(client);
            Syncing         = new EthSyncing(client);

            Transactions = new EthTransactionsService(client);
            Filters      = new EthFilterService(client);
            Blocks       = new EthBlockService(client);
            Uncles       = new EthUncleService(client);
            Mining       = new EthMiningService(client);
            Compile      = new EthCompilerService(client);

            this.DefaultBlock = BlockParameter.CreateLatest();
        }
Example #3
0
        public Eth(RpcClient client):base(client)
        {
            this.Client = client;
           
           

            DeployContract = new DeployContract(client);

            Accounts = new EthAccounts(client);
            CoinBase = new EthCoinBase(client);
            GasPrice = new EthGasPrice(client);
            GetBalance = new EthGetBalance(client);
            GetCode = new EthGetCode(client);
            GetStorageAt = new EthGetStorageAt(client);       
            ProtocolVersion = new EthProtocolVersion(client);
            Sign = new EthSign(client);
            Syncing = new EthSyncing(client);

            Transactions = new EthTransactionsService(client);
            Filters = new EthFilterService(client);
            Blocks = new EthBlockService(client);
            Uncles = new EthUncleService(client);
            Mining = new EthMiningService(client);
            Compile = new EthCompilerService(client);

            this.DefaultBlock = BlockParameter.CreateLatest();

        }
Example #4
0
 public async Task <bool> SendRequestAsync(EthCoinBase coinbaseRequest, string passPhrase,
                                           HexBigInteger durationInSeconds,
                                           object id = null)
 {
     return
         (await
          base.SendRequestAsync(id, await coinbaseRequest.SendRequestAsync(), passPhrase, durationInSeconds)
          .ConfigureAwait(false));
 }
Example #5
0
 public async Task <bool> SendRequestAsync(EthCoinBase coinbaseRequest, string passPhrase,
                                           object id = null, CancellationToken cancellationToken = default(CancellationToken))
 {
     if (coinbaseRequest == null)
     {
         throw new ArgumentNullException(nameof(coinbaseRequest));
     }
     if (passPhrase == null)
     {
         throw new ArgumentNullException(nameof(passPhrase));
     }
     return
         (await
          base.SendRequestAsync(id, cancellationToken, await coinbaseRequest.SendRequestAsync(cancellationToken), passPhrase)
          .ConfigureAwait(false));
 }
Example #6
0
 public async Task <bool> SendRequestAsync(EthCoinBase coinbaseRequest, string passPhrase,
                                           HexBigInteger durationInSeconds,
                                           object id = null)
 {
     if (coinbaseRequest == null)
     {
         throw new ArgumentNullException(nameof(coinbaseRequest));
     }
     if (passPhrase == null)
     {
         throw new ArgumentNullException(nameof(passPhrase));
     }
     return
         (await
          base.SendRequestAsync(id, await coinbaseRequest.SendRequestAsync(), passPhrase, durationInSeconds)
          .ConfigureAwait(false));
 }
Example #7
0
        async static Task <string> DeployAsync(string server, string binFileName)
        {
            var web3 = new Web3(server);

            var coinbase = new EthCoinBase(web3.Client);
            await web3.Personal.UnlockAccount.SendRequestAsync(coinbase, DeployAccountPass);

            var bin = ReadFileContent(binFileName);

            var fromAddress = await web3.Eth.CoinBase.SendRequestAsync();

            var gas = new HexBigInteger(2000000);

            var receipt = await web3.Eth.DeployContract.SendRequestAndWaitForReceiptAsync(bin, fromAddress, gas);

            return(receipt.ContractAddress);
        }
Example #8
0
        public async Task <dynamic> ExecuteTestAsync(RpcClient client)
        {
            var ethCoinBase = new EthCoinBase(client);

            return(await ethCoinBase.SendRequestAsync());
        }
Example #9
0
        public async Task <object> ExecuteTestAsync(IClient client)
        {
            var ethCoinBase = new EthCoinBase(client);

            return(await ethCoinBase.SendRequestAsync());
        }
Example #10
0
 public async Task<dynamic> ExecuteTestAsync(RpcClient client)
 {
     var ethCoinBase = new EthCoinBase(client);
     return await ethCoinBase.SendRequestAsync();
 }
        public override async Task <string> ExecuteAsync(IClient client)
        {
            var ethCoinBase = new EthCoinBase(client);

            return(await ethCoinBase.SendRequestAsync());
        }