balanceOf
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: "0x665de15F50e027BF98715502b38C0bB9Bf43704d",
method: "function balanceOf(address account, uint256 id) view returns (uint256)",
params: [account, id]
}
],
chainId: 1
})
});
const data = await response.json();