caver 클래스를 어떻게 생성하신지 모르겠습니다만
아래와 같은 방법으로 컨트랙트 함수를 실행할 수 있습니다.
const CONTRACT_ADDRESS = '0x0';
const [address] = await window.klaytn.enable();
const caver = new Caver(window.klaytn);
const contract = caver.contract.create(abi, CONTRACT_ADDRESS);
caver.klay.sendTransaction({
type: 'SMART_CONTRACT_EXECUTION',
from: address,
to: CONTRACT_ADDRESS,
data: contract.methods.mint(params).encodeABI(),
value: '1000000000000000000',
gas: '800000',
})
.on('transactionHash', (hash) => {
})
.on('receipt', (receipt) => {
// success
})
.on('error', (e) => {
// failed
});