msgValue property

I just want to know the right place to add the: msgValue property
buyOptions.params = {
tokenSale: {
token: bnbAddress,
amount: ethers.utils.parseUnits(amountToApprove, “ether”).toString(),
referrer: refCode,
refCode: genCode
},
msgValue: ethers.utils.parseUnits(amountToApprove, “ether”).toString(),
};

const tx = await runContractFunction({
params: buyOptions,
onError: (error) => {
console.log(error)
dispatch({
type: “error”,
message: error.data.message,
title: “presale”,
position: “topR”
})
},

1 Like

Hi @zoe619

If it related to the question in the below post, then you will have to use ether.js for calling the payable functions.

1 Like