#IEnumeratorAwaitExtensions.GetAwaiter
1 messages · Page 1 of 1 (latest)
@wind marlin Please 🙏
Our Getawaiter is deep inside of our core solution I think. Cna check on Monday.
I'll wait until Monday then, thanks
Hey @remote bluff which version of our sdk are you using?
it's inside the source code, yes
I download it directly from git, from here: https://github.com/ChainSafe/web3.unity.git?path=/Packages/io.chainsafe.web3-unity
Ah okay, can you show me the error you're getting
Library\PackageCache\io.chainsafe.web3-unity@5bb56f0e81\Runtime\Scripts\WalletConnect\Dialog\LocalWalletButton.cs(54,17): error CS0121: The call is ambiguous between the following methods or properties: 'IEnumeratorAwaitExtensions.GetAwaiter(UnityEngine.AsyncOperation)' and 'IEnumeratorAwaitExtensions.GetAwaiter(UnityEngine.AsyncOperation)'
I'll investigate this more tomorrow. This looks like it's an issue in the package but we never had it on our end.
Thanks @remote bluff
Thank you very much, maybe the problem is because I use another library that also seems to have declared GetAwaiter the same as you, that's probably why this hasn't happened to anyone else, thank you very much anyway.
Tamarin - It is to use firebase with WebGL
I need chainSafe to communicate with the contract and firebase to use the database
Ahh it’s probably using this async.utilities as well. Can you go to package manager and remove the async.utilities that we have? It should resolve your issue
Hi guys, in order not to complicate things for you and to be able to use the library as it is, I looked for another solution for Firebase, thank you very much and sorry for wasting your time.
Now I need another query since you are helping me.
How do I sign the transaction directly? I am using this method to make the transaction:
var contract = Web3Accessor.Web3.ContractBuilder.Build(DataContract.instance.AbiContract, DataContract.instance.Contract);
var data = await contract.SendWithReceipt(method, args);
In the old version I signed it like this. But now I changed.
string transaction = await EVM.CreateTransaction(dataContract.Chain, dataContract.Network, account, dataContract.Contract, value, data, gasPrice, gasLimit, rpc);
string signature = Web3PrivateKey.SignTransaction(privateKey, transaction, chainId);
Oh now we have made it super easy. Go here, fill out the necessary details (like contract name you want to use, location where you wanna save it, and also the ABI). In the place where you decided to save the file, you'll get a new CS file with the name you have provided.
Then simply just in the class where you previously had contract and data. do the following
private CustomContractName _contract;
async void Awake(){
_contract = await Web3Unity.Instance.BuildContract<CustomContractName>(contractAddress);
}
async void OnDestroy(){
await _contract.DisposeAsync();
}```
This will create your custom contract. Then from where you wanted to send the transaction just call
var data = await _contract.MethodNameWithReceipt(args)
Let me know if you need more help @remote bluff
There will be upcoming tutorials on this tool soon ™️
I'm going to try it right now, if there's anything I'll check back
You're the best, thank you very much
Web3Unity not found 😬
Did you add the web3unity asmdef as a reference to your asmdef? Maybe that is causing the issue
are you on latest version? 3.0.0?
i mean latest is 3.0.3 technically
Yes
I don't know what this is, I think I didn't do anything about it
Can you try to import the web3unity with the using statement? Not sure what our namespace is since i am ooo, but probably it is Chainsafe.Gaming.
Can you make sure that you also dont have any other compiler errors or any other errors?
Can you also try to search for web3unity prefab in the project (make sure that search is set to all or in packages)
I deleted everything and reimported it and it worked in the end, thanks!
@wind marlin
Another question, because I now need to be able to call a function but have it signed by the user, which would be to add money, and another one, which is to withdraw the money, which I sign directly. I want to add money and it gives me this error:
ChainSafe.Gaming.Web3.Core.ServiceNotBoundWeb3Exception`1[ChainSafe.Gaming.Evm.Signers.ISigner]: ISigner service is not bound.
at ChainSafe.Gaming.Evm.Contracts.Contract.AssetServiceIsAccessible[T]
I have already done everything you told me above and it works because I use it to make a query and it works well!
async void Awake()
{
if (Web3Unity.Web3 == null)
await Web3Unity.Instance.Initialize(false);
_contract = await Web3Unity.Instance.BuildContract<CCW>(contractAddress);
}
async private void addMoney(string _amount)
{
value = UnitConversions.instance.ToWei(_amount);
BigInteger valueBigInt = BigInteger.Parse(value);
HexBigInteger valueHex = new HexBigInteger(valueBigInt);
try
{
TransactionRequest transactionRequest = new TransactionRequest
{
Value = valueHex
};
print(valueHex);
var data = await _contract.AddMoneyWithReceipt(transactionRequest);
bool isSuccess = ConvertHexBigIntegerToBool(data.Status);
if (isSuccess)
CheckStatusTransaction(method, true);
else
CheckStatusTransaction(method, false);
}
catch (Exception e)
{
print(e);
// CheckStatusTransaction(method, false);
}
}
Are you actually connected to a wallet when trying to send the tx?
Yes, I connect to metamask, as I told you, I connect and call this function as an example and it works perfectly.
var data = await _contract.GetLatestPrice();
But I want to call addMoney and it doesn't even open metamask to sign it.
GetLatestPrice seems like a read call. Read calls don’t require any connections to the blockchain from the wallets perspective.
Are you calling that Web3Unity.Instance.Initialize anywhere else?
What I would recommend you is to register for an event inside of the Web3Unity called Web3Initialized
And check the islightweight boolean
Please let me know how it goes
https://drive.google.com/file/d/18bSbJnv5wvvtfXFCFtRgOW_a9r-kA-ZS/view?usp=drivesdk
here is a tutorial that will come in the next week about the wallet connection
Sending you early since you have been our loyal customer 😄
Thank you very much.
I'm trying what you told me.
I'll check out the tutorial now. ❤️
I've been trying and it doesn't matter to me like you in the video, it gives me false when it connects and true when I disconnect, and it still gives me the same error
If you are still using your script that has that Web3unity.instance.initialize(false)
Can you delete that line?
Good morning friend, I just tried deleting that and it still gives me that error:
ChainSafe.Gaming.Web3.Core.ServiceNotBoundWeb3Exception`1[ChainSafe.Gaming.Evm.Signers.ISigner]: ISigner service is not bound.
at ChainSafe.Gaming.Evm.Contracts.Contract.AssetServiceIsAccessible[T] (T instance) [0x00000] in <00000000000000000000000000000000>:0
--- End of stack trace from previous location where exception was thrown ---
I even tried calling this direct function which is obsolete but I think it was the one I used before and it gave me the same error
Can you zip me the project so that I can take a look? Will be able to take a look in a couple of hours
I'll prepare an empty project and send it to you, otherwise it will weigh a lot.
Did you send me a friend request? Or is someone impersonating you?