This is the function i’m calling
const amountToTransfer = bn.parseUnits('0.000001');
const transferAndRecord = async () => {
if (identityInput) {
try {
if (!instance) {
throw new Error("Instance is not defined");
}
if (!amountToTransfer) {
throw new Error("Amount to transfer is not defined");
}
if (!vaultID) {
throw new Error("Vault ID is not defined");
}
const gasPrice = 1;
const gasLimit = 1000000;
const maxFee = gasPrice * gasLimit;
const baseAssetId = instance.provider.getBaseAssetId();
const { waitForResult } = await instance.functions
.deposit(identityInput, vaultID)
.callParams({
forward: [amountToTransfer, baseAssetId],
gasLimit: gasLimit,
})
.txParams({
maxFee: bn(maxFee),
})
.call();
const { value } = await waitForResult();
console.log("Asset Depoisted successful, value returned:", value);
} catch (error) {
if (error instanceof FuelError) {
console.error("Detailed error during transfer:", error);
} else {
console.error("Error during transfer:", error);
}
}
} else {
console.log("no identity input");
}
};
The error i got