JSON-RPC methods
Polkadot RPC
You can review the official Polkadot RPC documentation HERE
Example RPC
curl https://api.chainup.net/polkadot/mainnet/<YOUR_API_KEY> \
-X POST \
-H 'content-type: application/json' \
-H "CONSISTENT-HASH: true" \
--data '{"jsonrpc":"2.0","method":"chain_getBlock","params":[],"id":32}'const request = require('request');
let options = {
url: "https://api.chainup.net/polkadot/mainnet/<YOUR_API_KEY>",
method: "post",
headers:
{
"content-type": "application/json"
},
body: JSON.stringify({"jsonrpc":"2.0","method":"chain_getBlock","params":[],"id":32})
};
request(options, (error, response, body) => {
if (error) {
console.error('An error has occurred: ', error);
} else {
console.log('Post successful: response: ', body);
}
});Last updated
Was this helpful?