getInflationGovernor RPC Method
參數
物件
物件
載入中...
commitment
字串
載入中...
已定案
字串
載入中...
confirmed
字串
載入中...
processed
字串
載入中...
退貨
結果
載入中...
foundation
載入中...
foundationTerm
載入中...
initial
載入中...
taper
載入中...
terminal
載入中...
請求
1curl https://docs-demo。solana-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"jsonrpc":"2.0","id":1, "method":"getInflationGovernor"}'
1curl https://docs-demo。solana-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"jsonrpc":"2.0","id":1, "method":"getInflationGovernor"}'
1需要 "uri"2require "json"3需要 "net/http"45網址 = URI("https://docs-demo.solana-mainnet.quiknode.pro/")67https = 網::HTTP.new(url.主機, 網址.port)8https.use_ssl = true910請求 = 淨額::HTTP::POST.新增(網址)11請求["Content-Type"] = "application/json"12請求。主體 = JSON.dump({13"jsonrpc": "2.0",14"id": 1,15"method": "getInflationGovernor"16})1718回應 = https.請求(請求)19puts 回應。read_body20
1需要 "uri"2require "json"3需要 "net/http"45網址 = URI("https://docs-demo.solana-mainnet.quiknode.pro/")67https = 網::HTTP.new(url.主機, 網址.port)8https.use_ssl = true910請求 = 淨額::HTTP::POST.新增(網址)11請求["Content-Type"] = "application/json"12請求。主體 = JSON.dump({13"jsonrpc": "2.0",14"id": 1,15"method": "getInflationGovernor"16})1718回應 = https.請求(請求)19puts 回應。read_body20
1import { createSolanaRpc } from "@solana/kit";23(async () => {4const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/");56try {7const inflationGovernor = await solanaRpc.getInflationGovernor().send();8console.log(inflationGovernor);9} catch (error) {10console.error("Error fetching inflation governor:", error);11}12})();
1import { createSolanaRpc } from "@solana/kit";23(async () => {4const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/");56try {7const inflationGovernor = await solanaRpc.getInflationGovernor().send();8console.log(inflationGovernor);9} catch (error) {10console.error("Error fetching inflation governor:", error);11}12})();
1const web3 = require("@solana/web3.js");2(async () => {3const solana = new web3.Connection("https://docs-demo.solana-mainnet.quiknode.pro/");4console.log(await solana.getInflationGovernor());5})();6
1const web3 = require("@solana/web3.js");2(async () => {3const solana = new web3.Connection("https://docs-demo.solana-mainnet.quiknode.pro/");4console.log(await solana.getInflationGovernor());5})();6
1from solana.rpc.api import Client2solana_client = Client("https://docs-demo.solana-mainnet.quiknode.pro/")3print(solana_client.get_inflation_governor())
1from solana.rpc.api import Client2solana_client = Client("https://docs-demo.solana-mainnet.quiknode.pro/")3print(solana_client.get_inflation_governor())
1使用 reqwest::標頭;2使用 reqwest::客戶端;3use std::error::Error;45#[tokio::main]6async fn main() -> Result<(), Box<dyn Error>> {7let mut headers = header::HeaderMap::new();8headers.insert("Content-Type", "application/json".parse().unwrap());910let client = Client::new();11let json_data = r#"12{13"jsonrpc": "2.0",14"id": 1,15"method": "getInflationGovernor"16}17"#;18let 回應 = client19.貼文(「https://docs-demo.solana-mainnet.quiknode.pro/」)20.標頭(標頭))21.正文(json_data)22.發送()23.await?;2425let body = response.text().await?;26println!("{}", body);2728好(())29}
1使用 reqwest::標頭;2使用 reqwest::客戶端;3use std::error::Error;45#[tokio::main]6async fn main() -> Result<(), Box<dyn Error>> {7let mut headers = header::HeaderMap::new();8headers.insert("Content-Type", "application/json".parse().unwrap());910let client = Client::new();11let json_data = r#"12{13"jsonrpc": "2.0",14"id": 1,15"method": "getInflationGovernor"16}17"#;18let 回應 = client19.貼文(「https://docs-demo.solana-mainnet.quiknode.pro/」)20.標頭(標頭))21.正文(json_data)22.發送()23.await?;2425let body = response.text().await?;26println!("{}", body);2728好(())29}
回應
1{2"jsonrpc": "2.0",3"result": {4"foundation": 0,5"foundationTerm": 0,6"initial": 0.08,7"taper": 0.15,8"terminal": 0.0159},10"id": 111}
1{2"jsonrpc": "2.0",3"result": {4"foundation": 0,5"foundationTerm": 0,6"initial": 0.08,7"taper": 0.15,8"terminal": 0.0159},10"id": 111}