-
Couldn't load subscription status.
- Fork 169
Description
New Bug Report
Checklist
- "['_requestId is required', '_consumer is required']"
Issue Description
When I use "useWeb3contract" function to call solidity contract, there have a error report about "['_requestId is required', '_consumer is required']"
Steps + code to reproduce
This is part of chainlink VRFCoordiantorMock.sol contract abi
{ "inputs": [ { "internalType": "uint256", "name": "_requestId", "type": "uint256" }, { "internalType": "address", "name": "_consumer", "type": "address" } ], "name": "fulfillRandomWords", "outputs": [], "stateMutability": "nonpayable", "type": "function" }
this is useWeb3Contract function body
const { runContractFunction: callFulfillRandomWords } = useWeb3Contract({ abi: VRFCoordinatorMock_abi, contractAddress: vrfCoordinatorAddress, functionName: "fulfillRandomWords", msgValue: "0", });
this is button function
`async function choseBtn() {
try {
const callParams = {
params: {
_requestId: "1",
_consumer: "0x51ccb6564Ec7B018288192c1Ed35E001842d74a6",
},
onSuccess: (tx) => {
console.log("✅ transaction success:", tx, requestId, raffleAddress);
},
onError: (error) => {
console.error("❌ transaction failed:", error, requestId, raffleAddress);
},
};
const tx = await callFulfillRandomWords(callParams);
console.log("choose finised ", tx);
} catch (error) {
console.log("call error:", error);
}
}); `
when I call createRaffleEventsListener function , It will display an error "['_requestId is required', '_consumer is required']"
Environment
Version Number
- moralis version:
2.27.2 - react-moralis version:
1.4.2 - react version:
18.0.0
Does anybody have a solution?