JSON RPC Polygon

I am a total beginner with RPC/curl
in docs you can find this example:

# Request
curl -X POST --data '{
    "id": 1337,
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [{
        "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",
        "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
        "gas": "0x76c0",
        "gasPrice": "0x9184e72a000",
        "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "value": "0x9184e72a"
    }]
}' https://mainnet.infura.io/v3/{projectId}

# Response
{
    "id": 1337,
    "jsonrpc": "2.0",
    "result": "0x"
}

if I run this it returns:
{
“id”: 1337,
“jsonrpc”: “2.0”,
“result”: “0x”
}

My aim is to read a contract on Polygon.
Here is the contract address:
0xd0f3121A190d85dE0AB6131f2bCEcdbfcfB38891
([https://polygonscan.com/address/0xd0f3121a190d85de0ab6131f2bcecdbfcfb38891#readContract]
I want to get totalSupply. What would the ‘Request’ and ‘Response’ look like?
Any help is very welcomed! cheers

If there is another way than using RPC that would be good to have as well.

1 Like

you’re querying the ethereum mainnet (check out your url) as far as I am aware, polygon mainnet RPC is not supported yet.

1 Like