I am struggling to figure out how to actually call a function (using React) in a contract that takes a struct as an argument (which also has another struct in it) ?
The contract function looks like this:
function createCampaign(CampaignInput calldata input_) external {
//code here
}
The structs that are involved are:
struct ItemInput {
string name;
uint256 value;
uint256 supply;
}
struct CampaignInput {
string name;
uint256 campaignType;
ItemInput[] items;
}
I have loaded the contract using Ethers.js in React and I am trying to call it using this code, which is obviously very wrong:
contract.createCampaign({"name",0,[]})
Other methods, that do not have a struct as an argument, work just fine using the method above.
My question is what do I need to write in the line above so that I can pass the proper arguments to the contract.