The contract has a struct which is used in an mapping. The blockchain explorers "code read" section allows to receive the result by providing a wallet address.
Solidity Code
struct Share {
uint256 amount;
uint256 totalExcluded;
uint256 totalRealised;
}
mapping (address => Share) public shares;
I'm trying to receive the struct for one wallet like below
var contract = new ethers.Contract(contractCA, abi, provider)
walletSharesRealized = await contract.shares(account);
The error output I receive is as below
Uncaught (in promise) TypeError: no matching function (argument="key", value="shares", code=INVALID_ARGUMENT, version=6.4.0)
What am I doing wrong here?