JSON-RPC methods
XRP RPC
You can review the official XRP RPC documentation HERE
Example RPC
curl https://api.chainup.net/xrp/mainnet/<YOUR_API_KEY> \
-X POST \
-H 'content-type: application/json' \
-H "CONSISTENT-HASH: true" \
---data '{"jsonrpc":"2.0","method":"getblock","params":[],"id":1}' const axios = require('axios');
//npm install axios if you don have the module installed`
let options = {
url: "https://api.chainup.net/xrp/mainnet/<YOUR_API_KEY>",
method: "post",
headers:
{
"content-type": "application/json"
},
body: JSON.stringify({"jsonrpc":"2.0","method":"getblock","params":[],"id":1})
};
axios(options)
.then(response => {
console.log('Post successful: response:', response.data);
})
.catch(error => {
console.error('An error has occurred:', error);
});Was this helpful?