These are chat archives for Nethereum/Nethereum

30th
Sep 2017
Lucas Cullen
@bitcoinbrisbane
Sep 30 2017 01:29
new release is good. works with .net core 2.0 and xunit
well done mate
Juan Blanco
@juanfranblanco
Sep 30 2017 06:17
thanks @bitcoinbrisbane :D
kai
@kaista82_twitter
Sep 30 2017 11:00
hey Juan, this new sexy decmial stuff you did for larger numbers, is that built into fromwei?
Juan Blanco
@juanfranblanco
Sep 30 2017 11:09
yes
@kaista82_twitter ^
kai
@kaista82_twitter
Sep 30 2017 11:10
<3
you are the man
I owe you beers again
Juan Blanco
@juanfranblanco
Sep 30 2017 11:11
lol we are going to get mortal
kai
@kaista82_twitter
Sep 30 2017 11:11
HAHAHAHA
yes
Juan Blanco
@juanfranblanco
Sep 30 2017 12:39
@tcsekhar check the overloads of await contract.GetFunction("getName").CallAsync<string>();
kai
@kaista82_twitter
Sep 30 2017 15:14
Juan, is there an easy way to get private key from an account mate? I usual use private key or the keystore json and decrypt, but I cant for the life of me find a way to use the account itself (its already loaded and ready to go in the app)
basically need offline signing with an account
_account.TransactionManager.SendTransactionAsync
may do it actually
Juan Blanco
@juanfranblanco
Sep 30 2017 15:16
yes that is what you use to send transactions offline
"offline"
still gets the nonce in the background and of course sends it
so if you want to send some ether that will do it
kai
@kaista82_twitter
Sep 30 2017 15:16
hm the nonce, im using pending tx's so i can send more than one per block
Juan Blanco
@juanfranblanco
Sep 30 2017 15:17
ah ok
kai
@kaista82_twitter
Sep 30 2017 15:17
so im getting tx's from before + pending
= nonce
Juan Blanco
@juanfranblanco
Sep 30 2017 15:17
the transaction manager does that for you
kai
@kaista82_twitter
Sep 30 2017 15:17
ohhh
ok
Juan Blanco
@juanfranblanco
Sep 30 2017 15:17
well kind of
it keeps tracks of the nonces
kai
@kaista82_twitter
Sep 30 2017 15:17
nice
Juan Blanco
@juanfranblanco
Sep 30 2017 15:17
if bigger than the current one it uses that
but yes pending transactions that is also a good approach
less dependent on a single object
kai
@kaista82_twitter
Sep 30 2017 15:19
ok
kai
@kaista82_twitter
Sep 30 2017 15:20
hmm
the amount on sendtransactionasync
i shouldnt to wei?
Juan Blanco
@juanfranblanco
Sep 30 2017 15:21
yes you need to
kai
@kaista82_twitter
Sep 30 2017 15:21
var _txId = await account.TransactionManager.SendTransactionAsync(account.Address, receiver, UnitConversion.Convert.ToWei(amount));
not playing ball
cus of unitconversion.convert.towei
Juan Blanco
@juanfranblanco
Sep 30 2017 15:23
you need a hexbiginteger
kai
@kaista82_twitter
Sep 30 2017 15:23
var _txId = await account.TransactionManager.SendTransactionAsync(account.Address, receiver, new HexBigInteger(UnitConversion.Convert.ToWei(amount)));]boom
Juan Blanco
@juanfranblanco
Sep 30 2017 15:24
yep
kai
@kaista82_twitter
Sep 30 2017 15:24
<3
anyway to change gas etc on this one
with the account
Juan Blanco
@juanfranblanco
Sep 30 2017 15:25
well you can create your own TransactionInput
which includes all the parameters
or you can change the Default values
kai
@kaista82_twitter
Sep 30 2017 15:26
yeah i am creating a new tx input now and filling that
for more control
Juan Blanco
@juanfranblanco
Sep 30 2017 15:26
exactly
kai
@kaista82_twitter
Sep 30 2017 15:28
perfect
hmm
being a noob here
adding two hexbitints together?
Juan Blanco
@juanfranblanco
Sep 30 2017 15:31
you can do hexbigint.Value
kai
@kaista82_twitter
Sep 30 2017 15:31
        _transactionInput.Nonce = new HexBigInteger(_previousTransactions.Value + _pendingTransactions.Value);
Juan Blanco
@juanfranblanco
Sep 30 2017 15:31
which is the bigInteger
yes
kai
@kaista82_twitter
Sep 30 2017 15:31
perfet
your library is wonderful i know ive said it before
but gj
Juan Blanco
@juanfranblanco
Sep 30 2017 15:31
thanks :)
kai
@kaista82_twitter
Sep 30 2017 15:32
final block:
var _previousTransactions = await _web3.Eth.Transactions.GetTransactionCount.SendRequestAsync(account.Address);
var _pendingTransactions = await GetPendingTransactionCount();
        var _transactionInput = new TransactionInput();
        _transactionInput.From = account.Address;
        _transactionInput.To = receiver;
        _transactionInput.Nonce = new HexBigInteger(_previousTransactions.Value + _pendingTransactions.Value);
        _transactionInput.Value = new HexBigInteger(UnitConversion.Convert.ToWei(amount));

        var _txId = await account.TransactionManager.SendTransactionAsync(_transactionInput);
        return _txId;
did you say you had a good way to estimate gas
price/limit
Juan Blanco
@juanfranblanco
Sep 30 2017 15:33
at the moment my tests
kai
@kaista82_twitter
Sep 30 2017 15:33
i can get the last block and pull it form there i suppose
Juan Blanco
@juanfranblanco
Sep 30 2017 15:33
oh you mean an average
yes that is mainly it
get 10 previous blocks and do an average
kai
@kaista82_twitter
Sep 30 2017 15:33
ill give them a slider
normal/fast
so i need to know min gas to get it sent
basically
Juan Blanco
@juanfranblanco
Sep 30 2017 15:34
yep
kai
@kaista82_twitter
Sep 30 2017 15:34
so just average last blocks
ok cheers mate
right cartoon time with little un before he goes to bed then more coding later! woop
speak soo Juan
we must discuss more of that voting system one day soon
Juan Blanco
@juanfranblanco
Sep 30 2017 15:35
sure ! :D