These are chat archives for Nethereum/Nethereum

16th
Aug 2018
RevVivek
@RevVivek
Aug 16 2018 04:21

@juanfranblanco

TransferFunction transferFunction = new TransferFunction();
transferFunction.FromAddress = fromAddress;
transferFunction.GasPrice = gasPrice.Value;
transferFunction.To = toAddress;
transferFunction.Value = _amount.Value;

            var transactionHash = standarErc20Service.TransferAsync(transferFunction).GetAwaiter().GetResult();

The above function was working fine. But from last couple of days the transaction gets fail due to low gas.

Can you please tell what else I can add to it
RevVivek
@RevVivek
Aug 16 2018 04:29
image.png
This is the error .
Trycoder
@Trycoder
Aug 16 2018 06:27
hi ,Is there any watch like event handler to get a notification ,when i receive ether on my ethereum address?
i mean do we have any handler in nethereum?
Enigmatic
@EnigmaticUnreal_twitter
Aug 16 2018 07:42

@RevVivek - You might want to bump up the gas cost for token transfers, noticed the transaction was given 23k gas only.... Tried EstimateGasAsync?

https://github.com/Nethereum/Nethereum.Workbooks/blob/master/docs/nethereum-estimating-gas.workbook

Though I am curious why was it working before. It would work for ETH transfers, but gas allocation definitely isn't enough for ERC20.

@Trycoder - Ooh interesting. I was planning to implement one but it's a service which queries Eth.GetBalance every 10 seconds or so...
Trần Huy Duẫn
@DuanTranHuy
Aug 16 2018 07:44
@Trycoder I'm doing the one like this but i query every block
Trycoder
@Trycoder
Aug 16 2018 07:47
@EnigmaticUnreal_twitter even i plan to implement one alike.but i dont know querying every 10sec is good ,if i have around 20 address ,just like a wallet
Trycoder
@Trycoder
Aug 16 2018 07:57
Do we have a function for this in web3?
Psilon
@Pzixel
Aug 16 2018 12:38
Hey @juanfranblanco
i'd like to ask if it's possible to restore password if I know private key?
I'm talking about DecryptKeyStoreFromJson
Enigmatic
@EnigmaticUnreal_twitter
Aug 16 2018 14:28

@Pzixel - Hmmmmmm. In that case, maybe just recreate the JSON file from that private key?

@Trycode - Like what @DuanTranHuy has said, you could filter based on the latest blocks (something like filter = web3.eth.filter("latest") for web3js) and watch that filter.

(answer is assuming you're asking about web3js)

Psilon
@Pzixel
Aug 16 2018 14:28
@EnigmaticUnreal_twitter so you think I could just recreate json and it will work?
Enigmatic
@EnigmaticUnreal_twitter
Aug 16 2018 14:29
If you have the private key yea, you can recreate the json.
Psilon
@Pzixel
Aug 16 2018 14:29
hmm
Enigmatic
@EnigmaticUnreal_twitter
Aug 16 2018 14:29
Unless I am missing something?
Psilon
@Pzixel
Aug 16 2018 14:29
interesting idea
so I could use different passwords in different nodes
and it will work unless token decryption gives different results?
Enigmatic
@EnigmaticUnreal_twitter
Aug 16 2018 14:29
That's true. Well what is important to create the web3 object is really the private key, and the json file standard just offers an additional encryption layer on top.
Ultimately decrypting the json returns the private key which creates the Account object for web3.
Psilon
@Pzixel
Aug 16 2018 14:30
e.g. I have my key Key. I encrypt it with PassA and save this JSON on NodeA. then I encrypt it with PassB and save on NodeB. Now I could use PassA to create txs on NodeA and passB for Nodeb?
it doesn't make much sense but I wonder if it's possiblwe
Enigmatic
@EnigmaticUnreal_twitter
Aug 16 2018 14:34
Oh yea that's most certainly possible. I have done something similar before.
As long as you're passing the corresponding password with the JSON file, you'll get the same privKey
Psilon
@Pzixel
Aug 16 2018 14:50
cool
thank you