These are chat archives for Nethereum/Nethereum

19th
Jul 2018
Juan Blanco
@juanfranblanco
Jul 19 2018 06:12
@tmyngu11 on the original to work on unity the "Async tasks" use yield to await, also all the requests uses the UnityWebRequest so it is compatible with areas like webgl.
On net461, you can use vanilla Nethereum
on that issue i would use named parameters or an object[] for the params object
tmyngu11
@tmyngu11
Jul 19 2018 06:15
it still gives me the error when I tried that
@juanfranblanco
Juan Blanco
@juanfranblanco
Jul 19 2018 06:16
what are you using? net351 or net461
tmyngu11
@tmyngu11
Jul 19 2018 06:16
351
Juan Blanco
@juanfranblanco
Jul 19 2018 06:18
what is your abi like?
also what version of Nethereum are you using? the one from dev?
tmyngu11
@tmyngu11
Jul 19 2018 06:21
oh you know what, I think it was my mistake, I was trying to go off of the generated vscode but the abi only has one input lol
thanks for the help haha
tmyngu11
@tmyngu11
Jul 19 2018 08:42
does it auto estimate the gas, or do i have to do that myself
Esteban Gallardo
@EstebanGameDevelopment
Jul 19 2018 10:43
Hi. I'm developing a project in Unity where I'm trying to give the option to the developer to choose between NEthereum and NBitcoin. My main problem right now is that NBitcoin needs Newtonsoft.Json.dll (Version 11.0.2). Meanwhile NEthereum needs Newtonsoft.Json.dll (Version 9.0.1). I tried to make the whole thing work with (Version 11.0.2) but NEthereum doesn't accept that DLL. Has anyone faced this problem before? Any solution available out there? Thanks for your support!
Juan Blanco
@juanfranblanco
Jul 19 2018 12:18
@tmyngu11 depends what function you are using
"function" handler
if you are targetting NBitcoin and net461 @EstebanGameDevelopment use vanilla Nethereum
Eleonora Muller
@EleonoraMuller
Jul 19 2018 15:18
Hello, I have followed the Integrating Unity3D with the Ethereum blockchain [PART 3] — Events & Tokens tutorial and am getting the error: unable to convert the result to type nethereum.rpc.eth.dtos.transaction
when I for example uncomment ping(); and try to have it send ether.
The same error occurs when I have my own smart contract and try to run it through unity (just a simple contract which sends ether from an account to another) and I just modified the code provided in the tutorial to fit my own functions and events. I am using ganache as my private blockchain and myetherwallet to deploy on ganache. It does create the transaction on ganache but there is no transfer of money whatsoever.
I have googled the problem but I still don't know what I need to change for it to work. I'm also quite new to smart contracts and Unity.
What should I do to solve it?
Juan Blanco
@juanfranblanco
Jul 19 2018 16:30
For the people insterested in Unity there is now packaging for net35, net461 and net461 aot (using json.net for unity3d)
these are dev so use at your own pleasure
@AvocadoPassion can you post a snippet (of your code) I don't know what tutorial you are following
Eleonora Muller
@EleonoraMuller
Jul 19 2018 16:47
Here is the github repo where I have the codes: https://github.com/AvocadoPassion/ethereum:
Basically, the MyToken code is attached to a a game object. ConversationContract creates the different functions. When I run Unity with for example sendDrinkOrder(); it does create the transaction on the ganache blockchain but doesn't transfer eth and returns the error as mentioned before.
I think the error could be due to these two lines as it does say it is unable to call nethereum.rpc which come from ConversationContract:
public NewFilterInput CreateTransferInput() {
var evt = TransferEvent ();
return evt.CreateFilterInput (Nethereum.RPC.Eth.DTOs.BlockParameter.CreateEarliest (), Nethereum.RPC.Eth.DTOs.BlockParameter.CreateLatest ());
}
public NewFilterInput CreateOrderInput() {
    var evt = OrderEvent ();
    return evt.CreateFilterInput (Nethereum.RPC.Eth.DTOs.BlockParameter.CreateEarliest (), Nethereum.RPC.Eth.DTOs.BlockParameter.CreateLatest ());
}
Juan Blanco
@juanfranblanco
Jul 19 2018 16:48
what error you get?
seen it: unable to convert the result to type nethereum.rpc.eth.dtos.transaction
Eleonora Muller
@EleonoraMuller
Jul 19 2018 16:49
Screen Shot 2018-07-19 at 5.48.40 PM.png
And I got the code to connect with unity from here: https://blog.e11.io/integrating-unity3d-with-the-ethereum-blockchain-part-3-events-tokens-232a340c3477 and just modified it to fit my remix code.
Juan Blanco
@juanfranblanco
Jul 19 2018 16:50
yeah I have not created that blog post
but where did you see the event part?
Eleonora Muller
@EleonoraMuller
Jul 19 2018 16:54
From that tutorial?
Juan Blanco
@juanfranblanco
Jul 19 2018 16:54
no i mean i cannot see anything about events in neither your code or the tutorial
from the transactionReceipt you can decode the Event
but you need to use the EventDTO specific to that contract
let me put an example using the latest dev version
for you.. give me 15 minutes
(might be more ... :) )
Eleonora Muller
@EleonoraMuller
Jul 19 2018 16:59
Ok. Thanks a lot!
Juan Blanco
@juanfranblanco
Jul 19 2018 16:59
ill do a token one.. that everyone knows it.. as we don't have one already
Eleonora Muller
@EleonoraMuller
Jul 19 2018 17:01
Ok great.
Juan Blanco
@juanfranblanco
Jul 19 2018 18:03
@AvocadoPassion find a updated sample including deployment, transfer, query balance, decode logs, get logs using newfilterinput
the dlls are the latest dev
included in Assets or as comments above
Eleonora Muller
@EleonoraMuller
Jul 19 2018 18:15
Ok thanks. I'll try it out right now