When I try to run a smart contract function I get the error:
Error: Dry run failed, could not automatically determine a budget: VMVerificationOrDeserializationError in command 0
This is my code:
async sendMail(sendMailDto) {
const { body, recipient } = sendMailDto
const tx = new Transaction()
tx.moveCall({
target: `${VITE_SUI_MAIL_PACKAGE_ID}::sui_mail::send_mail`,
arguments: [tx.pure.string(recipient), tx.pure.string(body)],
})
const keypair = await this.authService.getEd25519Keypair()
return await suiClient
.signAndExecuteTransaction({
signer: keypair,
transaction: tx,
options: {
showEffects: true,
},
})
.then((txRes) => {
const status = txRes.effects?.status?.status
if (status !== "success") {
throw new Error(`Could not send mail ${txRes.effects?.status?.error}`)
}
return txRes
})
.catch((err) => {
throw new Error(`Error thrown: Could not send mail!: ${err}`)
})
}
Please how do I solve this?