These are chat archives for Nethereum/Nethereum

18th
Jul 2018
Juan Blanco
@juanfranblanco
Jul 18 2018 06:34
@DangNghia123_twitter please post a sample thanks
:)
George T.
@CryptonAdmin
Jul 18 2018 09:19
What is the difrerence between "SendRequestAndWaitForReceiptAsync|" and "SendRequest"?
Juan Blanco
@juanfranblanco
Jul 18 2018 09:20
one does a poll for the receipt
that can take a 12 seconds on mainnet
but on private it is normally nearly instant
(WaitForReceipt ^^^)
Just SendRequest
gives you the transactionHash
George T.
@CryptonAdmin
Jul 18 2018 09:21
Reciept, this is when txId pushed into blockchain?
Juan Blanco
@juanfranblanco
Jul 18 2018 09:21
yeah
George T.
@CryptonAdmin
Jul 18 2018 09:22
SendRequestAndWaitForReciept is safe, when we do multiple functions
Juan Blanco
@juanfranblanco
Jul 18 2018 09:22
So SendRequest the transaction is put in the queue and not mined
George T.
@CryptonAdmin
Jul 18 2018 09:22
so it can fail, right?
Juan Blanco
@juanfranblanco
Jul 18 2018 09:22
the other you are waiting to be mined and you get the receipt
yeah
it can fail
George T.
@CryptonAdmin
Jul 18 2018 09:23
And i still have txId, but which is never come into blockchain
Juan Blanco
@juanfranblanco
Jul 18 2018 09:23
but normally once you have send it with enough gas to be included in the chain
George T.
@CryptonAdmin
Jul 18 2018 09:23
but, with WaitForReciept it will be 100% or fail
Juan Blanco
@juanfranblanco
Jul 18 2018 09:23
it will be processed
once is mined
your contract
George T.
@CryptonAdmin
Jul 18 2018 09:23
Without Wait for Reciepe i'm blind
Juan Blanco
@juanfranblanco
Jul 18 2018 09:23
might have failed
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:24
@DangNghia123_twitter please post a sample thanks
George T.
@CryptonAdmin
Jul 18 2018 09:24
@juanfranblanco Which is best way to search for "Transfer" Event?
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:24
Web3 web3=new Web3(new Account(private_key));
            var input = new TransactionInput()
            {
                To = TO_ADDRESS,
                From = ac.Address,
                Gas = new HexBigInteger(BigInteger.Parse("21000")),
                Value = new HexBigInteger(AMOUNT),
                GasPrice = new HexBigInteger(Web3.Convert.toWei(fee))
            };
            var sign = await web3.Eth.TransactionManager.SignTransactionAsync(input);
            var send = await web3.Eth.Transactions.SendRawTransaction.SendRequestAsync(sign);
George T.
@CryptonAdmin
Jul 18 2018 09:24
And to search for previous transactions
Juan Blanco
@juanfranblanco
Jul 18 2018 09:25
for Events you create filters
or you can check each transaction receipt log if is included thre
previous transactions depending what you want
if you look for accounts ether transfer
George T.
@CryptonAdmin
Jul 18 2018 09:26
No, only token
Juan Blanco
@juanfranblanco
Jul 18 2018 09:27
ah ok you can either create a filter (if only interested in a contract address )
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:27
@DangNghia123_twitter please post a sample thanks
George T.
@CryptonAdmin
Jul 18 2018 09:27
Filter is just mark from which block to read information, right
?
So i can just paste current block number as parameter for filter when project starts?
Juan Blanco
@juanfranblanco
Jul 18 2018 09:27
two tisks
ticks / seconds
George T.
@CryptonAdmin
Jul 18 2018 09:28
What does it mean?
George T.
@CryptonAdmin
Jul 18 2018 09:28
Thank you
Juan Blanco
@juanfranblanco
Jul 18 2018 09:28
2 seconds til i get a sample :)
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:30
@juanfranblanco hi please help me
Juan Blanco
@juanfranblanco
Jul 18 2018 09:30
@DangNghia123_twitter
you can do as simple as
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:31
Web3 web3=new Web3(new Account(private_key));
            var input = new TransactionInput()
            {
                To = TO_ADDRESS,
                From = ac.Address,
                Gas = new HexBigInteger(BigInteger.Parse("21000")),
                Value = new HexBigInteger(AMOUNT),
                GasPrice = new HexBigInteger(Web3.Convert.toWei(fee))
            };
            var sign = await web3.Eth.TransactionManager.SignTransactionAsync(input);
            var send = await web3.Eth.Transactions.SendRawTransaction.SendRequestAsync(sign);
this is my sample code
Juan Blanco
@juanfranblanco
Jul 18 2018 09:32
await web3.TransactionManager.SendTransactionAsync
no need to sign it and and sendRaw
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:33
i was asking you how to make transaction from an address to tranfer ether to multiple addresses at same time
Juan Blanco
@juanfranblanco
Jul 18 2018 09:34
var web3 = new Web3(new Account(private_key));
var input = new TransactionInput() {...};
var txn = await web3.Eth.TransactionManager.SendTransactionAsync(input);
George T.
@CryptonAdmin
Jul 18 2018 09:34

.CreateFilterInput(new BlockParameter(addBidReceipt.BlockNumber), BlockParameter.CreateLatest());

In this case, BlockParameter.CreateLatest() us a dynamic value, which always match latest block in blockchain? Or latest block on time of first execution at filtercreate?

Juan Blanco
@juanfranblanco
Jul 18 2018 09:35
@DangNghia123_twitter you cannot do that
only one at a time
you could have a contract holding all your Ether and that contract can then send to many addresses at a time a specific value
@CryptonAdmin on the blockchain
George T.
@CryptonAdmin
Jul 18 2018 09:37
So, it's always latest block?
Juan Blanco
@juanfranblanco
Jul 18 2018 09:37
yes, so you can GetChanges
George T.
@CryptonAdmin
Jul 18 2018 09:37
Thank you
Juan Blanco
@juanfranblanco
Jul 18 2018 09:37
but note
when a filter is created
it is based on that creation time
so you want get previous stuff
and when executed (GetFilterChanges)
you will only get those changes up until now
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:38
you could have a contract holding all your Ether and that contract can then send to many addresses at a time a specific value
Juan Blanco
@juanfranblanco
Jul 18 2018 09:38
and later on from the last execution til now, and s on
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:38
do you have any code examples?
George T.
@CryptonAdmin
Jul 18 2018 09:39
So, if i set blockFrom = 1, and blockTo = latest
Juan Blanco
@juanfranblanco
Jul 18 2018 09:39
@DangNghia123_twitter no i don't
for Nethereum
George T.
@CryptonAdmin
Jul 18 2018 09:39
And getEvent("Transfer"), i 'll not get events?
Juan Blanco
@juanfranblanco
Jul 18 2018 09:39
you are getting the EventHandler
George T.
@CryptonAdmin
Jul 18 2018 09:39
If i save filterHexValue, can i use it without recreation?
Juan Blanco
@juanfranblanco
Jul 18 2018 09:40
yep
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:40
@juanfranblanco i be confused with smart contract, i dont know how to create contract with nethereum
George T.
@CryptonAdmin
Jul 18 2018 09:40
So it will have time past-past away from real filter creation time
Juan Blanco
@juanfranblanco
Jul 18 2018 09:40
note that public nodes don't support it
like Infura
so you need to use GetLogs
George T.
@CryptonAdmin
Jul 18 2018 09:40
I have my geth node
with --fast
It's ok for Logs and Events?
Juan Blanco
@juanfranblanco
Jul 18 2018 09:40
@DangNghia123_twitter that will be a normal solidity smart contract
but if you don't know how to create smart contracts
i would just send a transaction at a time
George T.
@CryptonAdmin
Jul 18 2018 09:41
Ok, time to code
Thank you, Juan
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:51
@juanfranblanco i tried metamask, it does very well, i use fiddler to captures all traffics from metamask and compare with tools code by nethreum, in metamask traffic the id will increased one unit with every eth_sendRawTransaction requuest but with nethereum it always =1
Truong Dang Nghia
@DangNghia123_twitter
Jul 18 2018 09:56
{
"id":6585177203687,
"jsonrpc":"2.0",
"method":"eth_sendRawTransaction",
"params":["0xf8690284b4018b0082520894e00ff75ba71b40c2f25955fe707733f259999999865af3107a40008026a051200e4755158a2c46deb8a484f8bf6876a4fc2ee1f112c9b6deb9d31ed102f5a058e1d3eafe227f96f99b0a40c7445456525239b3d8d927b506ea93a50ea2f3be"]
}
25yuanzijian
@25yuanzijian
Jul 18 2018 10:54
Is there an example of an operation for transferring a Token?
25yuanzijian
@25yuanzijian
Jul 18 2018 12:25
image.png
Juan Blanco
@juanfranblanco
Jul 18 2018 12:58
The nonce is calculated by the transaction manager and signed
@DangNghia123_twitter
the nonce service does that
IF you set the nonce
then Nethereum will ignore it
@25yuanzijian just look at this sample
tmyngu11
@tmyngu11
Jul 18 2018 21:39
is there an example for sending a function transaction in the new nethereum for unity?
also whats the difference in nethereum net461 and the original
tmyngu11
@tmyngu11
Jul 18 2018 22:02
    public TransactionInput Bid(string addressFrom, int valueAmount, int _tokenId)
    {
        var a = new EthSendTransactionUnityRequest(url);
        var function = contract.GetFunction("bid");
        var transInput = function.CreateTransactionInput(addressFrom, valueAmount, _tokenId); // gives the error
        return transInput;
    }

When I try to do this, it gives an error

Exception: Too many arguments: 2 > 1
Nethereum.ABI.FunctionEncoding.ParametersEncoder.EncodeParameters (Nethereum.ABI.Model.Parameter[] parameters, System.Object[] values)
Nethereum.ABI.FunctionEncoding.FunctionCallEncoder.EncodeRequest (System.String sha3Signature, Nethereum.ABI.Model.Parameter[] parameters, System.Object[] values)
Nethereum.Contracts.FunctionBuilder.GetData (System.Object[] functionInput)
Nethereum.Contracts.FunctionBuilder.CreateTransactionInput (System.String from, System.Object[] functionInput)

Am I doing it wrong?