Greeting, I use Moralis with Unity for WebGL app. I was trying to call smart contract function as that described in that video (Youtube video)
How could I get any response from smart contract call due to new self hosting server stuff?
Hi @honeycake
You can find a unity example code on how to call and get the response from the smart contract.
https://v1docs.moralis.io/moralis-dapp/web3-api/native
Thats cool, but how could I add value and gas parameters, such as in Moralis.ExecuteContractFunction
?
Also Iām getting this error while using this method
string _resp = await Moralis.Web3Api.Native.RunContractFunction<string>(CONTRACT_ADDRESS, "mint", _rcd, ChainList.polygon_testnet);
Error: HTTP/1.1 400 Bad Request
{"code":141,"error":"[C0005] Request contains unknown parameter: function_name. This operation supports the following parameters: address, chain, functionName, providerUrl, subdomain, abi, params"}
ApiException: Error calling GetContractEvents: {"code":141,"error":"[C0005] Request contains unknown parameter: function_name. This operation supports the following parameters: address, chain, functionName, providerUrl, subdomain, abi, params"}
try with the param name as functionName
instead of function_name
. For you adding gas uses the following parma names. Example can be found here.
HexBigInteger gas = new HexBigInteger("800000");
HexBigInteger gasprice = new HexBigInteger("230000");
Please note that unity v1 SDK will be deprecated and will not receive any new updates. So we recommend other packages like Nethereum for interacting with wallets or for calling smart contract to write functions.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.