help to call Web3 smart contract payable function, with ethers.js

Job ID: 31064908

Budget: $10 – $30 USD

function buy() public payable {
uint weiValue = msg.value;
_transfer(wallet, _msgSender(), amount);
Address.sendValue(payable(wallet), weiValue);
}

Call from ethers.js.
Related categories: JavaScript Blockchain Solidity