Questions tagged [nethereum]

Questions related to the C# .NET Ethereum Web3 RPC Client Library, named nethereum

Questions related to the C# .NET Ethereum Web3 RPC Client Library, named nethereum

141 questions
4
votes
3 answers

Nethereum. Analog for web3.eth.filter('latest').watch()

I need to watch changes in blockchain. For web3.js it was simle. web3.eth.filter('latest').watch(function () { //some code }); How implement this in Nethereum?
Artem
  • 687
  • 1
  • 5
  • 12
3
votes
1 answer

Nethereum get Last Block Number

I would like to get something similar to solidity block.number - 1 using Nethereum BlockParameter.CreateLatest() Is latest here mean the Last BlockNumber been mined? Or do I need to minus 1?
s k
  • 886
  • 1
  • 10
  • 22
2
votes
1 answer

How to get the Error Message from revert and require on a solidity contract with Nethereum

Is there a way on Nethereum to get the string messages returned from arevert or require are executed on solidity contract?
elranu
  • 121
  • 3
2
votes
0 answers

Getting return data from a transaction hash using Nethereum

I'm using Nethereum to call a non-view/non-constant function of a smart contract that modifies the state of the smart contract and returns a boolean value. The result of submitting this transaction is a transaction hash. Is there a way in Nethereum…
Cornelius
  • 183
  • 6
2
votes
1 answer

Blockchain information from Nethereum

How can I get the latest block, coinbase and other information using Nethereum?
DottoreM
  • 191
  • 13
2
votes
1 answer

Create new address in Ethereum using Nethereum

I try to create new account. var web3 = new Nethereum.Geth.Web3Geth(); var ecKey = Nethereum.Signer.EthECKey.GenerateKey(); var privateKey = ecKey.GetPrivateKeyAsBytes().ToHex(); var account = new Account(privateKey); in account i recived…
2
votes
1 answer

How to get 'defaultAccount' by Nethereum?

I'm using Chrome with Metamask extension. When I change the account, eth.coinbase value is always set to current one, so I can do the assign in JS code: web3.eth.defaultAccount = web3.eth.coinbase; But when I create a Web3 object in C# code and…
2
votes
1 answer

Function.SendTransactionAsync() What value to pass to the param "value"?

I am running a private blockchain node using geth as a client and nethereum to interface to a .net application. In order to mine a function call I am currently using the function Function.SendTransactionAsync() like below: var transactionHash =…
vitoscalleta
  • 195
  • 1
  • 9
1
vote
0 answers

Getting 403 Access Denied after several hours of execution

I have an application that executes fine for several hours but after a while I start seeing 403 exceptions from the RPC client, usually on internal TranasactionManager calls like "Estimate Gas". Any suggestions on why this is happening or how I can…
Ofek
  • 111
  • 1
1
vote
0 answers

Why I can't get any status from Nethereum TransactionReceipt?

Sample code below (simplified for illustrative purposes only): var a = new ManagedAccount(mOwner, mOwnerPwd); var w = new Web3(a, mNodeUrl); w.TransactionManager.DefaultGas = mGasLimit; w.TransactionManager.DefaultGasPrice = mGasPrice; Contract c =…
s k
  • 886
  • 1
  • 10
  • 22
1
vote
1 answer

Nethereum: How to get the list of pending transactions (haven't mined to a block yet)

Currently I'm using GetBlockWithTransactionsByNumber by looping into the latest 200 blocks to get the transactions sent to my address. I can actually get my transaction through the block number but what about the pending transaction which has no…
doohder
  • 23
  • 4
1
vote
1 answer

Nethereum struct size

I have this simple contract pragma solidity ^0.4.10; contract test { int _multiplier; struct MyCustomData { bool exists; string Name1; } mapping(string => MyCustomData) myData; event Multiplied(int indexed a, address indexed…
1
vote
1 answer

Nethereum 2.0.0-rc5 Miner

In the previous version of Nethereum (1.0.6), I was able to do something like this: var miningResult = await web3.Miner.Start.SendRequestAsync(200); Assert.IsTrue(miningResult); In 2.0.0-rc5 I get an error: Web3 does not contain a definition of…
1
vote
0 answers

How does one poll for transfer events using Nethereum?

I have a contract deployed on Goerli test network, given the code below, I never see any event changes when I transfer tokens. public static async Task PollForEvents(JObject pixelBlock) { try { var…
1
vote
0 answers

How to call a contract's function in Nethereum?

I'm trying to call a contract's function but get an error "Function not found". I've made a test contract from this topic https://docs.nethereum.com/en/latest/contracts/calling-transactions-events/ on bsc testnet, and it works good - I can call a…
Xed
  • 11
  • 2
1
2