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