platform.getTotalStake RPC Method
Parameters
This method does not accept any parameters
Returns
stake
integer
The total amount staked in the Flare chain
weight
integer
The total weight of the stake in the Flare chain
Request
curl --location --request POST https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/P \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc":"2.0", "id" :1, "method" :"platform.getTotalStake", "params": {} }'
import { ethers } from "ethers"; (async () => { const provider = new ethers.JsonRpcProvider( "https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/P" ); const params = {}; const result = await provider.send("platform.getTotalStake", params); console.log(result); })();
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/P')) params = {} request = w3.provider.make_request('platform.getTotalStake', [params]) print(request)
const myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); const raw = JSON.stringify({ "jsonrpc": "2.0", "id": 1, "method": "platform.getTotalStake", "params": {} }); const requestOptions = { method: "POST", headers: myHeaders, body: raw, redirect: "follow" }; fetch("https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/P", requestOptions) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.error(error));
import requests import json url = "https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/P" payload = json.dumps({ "jsonrpc": "2.0", "id": 1, "method": "platform.getTotalStake", "params": {} }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "json" require "net/http" url = URI("https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/P") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "platform.getTotalStake", "params": {} }) response = https.request(request) puts response.read_body
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free