availableRewards
view
Use this function in your app
const response = await fetch('https://api.thirdweb.com/v1/contracts/read', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-secret-key': '<YOUR_SECRET_KEY>'
},
body: JSON.stringify({
calls: [
{
contractAddress: "0x1ca7b6bf4eAC41b9E6035Cd99A485B1e5f7531dF",
method: "function availableRewards(address _staker) view returns (uint256)",
params: [_staker]
}
],
chainId: 56
})
});
const data = await response.json();