Object literal may only specify known properties and 'vestingAccount' does not exist in type 'ResolvedAccounts<{ name: "signer"; writable: true; signer: true; } | { name: "vestingAccount"; writable: true; pda: { seeds: [{ kind: "arg"; path: "companyName"; }]; }; } | { name: "mint"; } | { name: "treasuryTokenAccount"; writable: true; pda: { ...; }; } | { ...; } | { ...; } | { ...; }>'.
The fix for this is just explicitly stating the account object but curious is there is a better solution:
const accounts = {
vestingAccount: vestingAccountAddress,
treasuryAccount: treasuryAccountAddress,
mint: new PublicKey(tokenMintAddress),
tokenProgram: token.TOKEN_PROGRAM_ID,
};
return program.methods
.createVestingAccount(companyName)
.accounts(accounts)
.rpc();