How to pass struct to Moralis.ExecuteContractFuction in unity

I want to pass a struct a to a contract method that takes struct as a parameter. please how do I do it

1 Like

Did you try passing the params as shown in this docs?
https://v1docs.moralis.io/moralis-dapp/web3/blockchain-interactions-unity#execute-smart-contract-function

1 Like

Yes I was passing it in this format

{β€œid”:[1],β€œname”:β€œjohn does”}

can you try directly in swagger interface to see if you can call it there:

https://deep-index.moralis.io/api-docs-2.1/#/Utils/runContractFunction

This is only for read but what am trying to do is really send a transaction

if you have access to ethers or web3 instance you can use directly that instance to send a transaction, at least that is how it works in javascript

Yes but am trying it with C#

Can you post a complete example of your ExecuteContractFunction code - including contract address, chain, function, etc.