getBlockTime RPC Method
매개변수
u64
정수
필수
로딩 중...
반품
결과
로딩 중...
i64
로딩 중...
null
로딩 중...
요청
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":"getBlockTime","params":[94101948]}'
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":"getBlockTime","params":[94101948]}'
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.solana-mainnet.quiknode.pro/")67https = Net::HTTP.new(url.호스트, url.포트)8https.use_ssl = true910요청 = 순::HTTP::POST.새(URL)11요청["Content-Type"] = "application/json"12요청.본문 = JSON.dump({13"jsonrpc": "2.0",14"id": 1,15"method": "getBlockTime",16"params": [179410194818]19})2021답변 = https.요청(요청)22응답을 넣습니다.read_body23
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.solana-mainnet.quiknode.pro/")67https = Net::HTTP.new(url.호스트, url.포트)8https.use_ssl = true910요청 = 순::HTTP::POST.새(URL)11요청["Content-Type"] = "application/json"12요청.본문 = JSON.dump({13"jsonrpc": "2.0",14"id": 1,15"method": "getBlockTime",16"params": [179410194818]19})2021답변 = https.요청(요청)22응답을 넣습니다.read_body23
1import { createSolanaRpc } from "@solana/kit";23(async () => {4const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/");56시도해 보세요 {7const blockTime = await solanaRpc.getBlockTime(BigInt(94101948)).send();8console.log("Block time:", blockTime);9} catch (error) {10console.error("Error fetching block time:", error);11}12})();
1import { createSolanaRpc } from "@solana/kit";23(async () => {4const solanaRpc = createSolanaRpc("https://docs-demo.solana-mainnet.quiknode.pro/");56시도해 보세요 {7const blockTime = await solanaRpc.getBlockTime(BigInt(94101948)).send();8console.log("Block time:", blockTime);9} catch (error) {10console.error("Error fetching block time:", error);11}12})();
1const web3 = require("@solana/web3.js");2(async () => {3const 솔라나 = new web3.연결("https://docs-demo.solana-mainnet.quiknode.pro/");4console.log(await solana.getBlockTime(94101948));5})();6
1const web3 = require("@solana/web3.js");2(async () => {3const 솔라나 = new web3.연결("https://docs-demo.solana-mainnet.quiknode.pro/");4console.log(await solana.getBlockTime(94101948));5})();6
1출처: 솔라나.rpc.api import Client2solana_client = 클라이언트("https://docs-demo.solana-mainnet.quiknode.pro/")3print(solana_client.get_block_time(94101948))
1출처: 솔라나.rpc.api import Client2solana_client = 클라이언트("https://docs-demo.solana-mainnet.quiknode.pro/")3print(solana_client.get_block_time(94101948))
1사용 reqwest::헤더;2사용 reqwest::클라이언트;3사용 std::error::오류;45#[tokio::main]6async fn main() -> Result<(), Box<dyn Error>> {7let mut 헤더 = header::헤더맵::새();8헤더.삽입("Content-Type", "application/json".parse().unwrap());910let 클라이언트 client = Client::new();11let json_data = r#"12{13"jsonrpc": "2.0",14"id": 1,15"method": "getBlockTime",16"params": [179410194818]19}20"#;21let 응답 = client22.게시물("https://docs-demo.solana-mainnet.quiknode.pro/")23.헤더(헤더))24.본문(json_data)25.보내기()26.await?;2728let 본문 = response.text().await?;29println!("{}", body);3031알겠습니다(())32}33
1사용 reqwest::헤더;2사용 reqwest::클라이언트;3사용 std::error::오류;45#[tokio::main]6async fn main() -> Result<(), Box<dyn Error>> {7let mut 헤더 = header::헤더맵::새();8헤더.삽입("Content-Type", "application/json".parse().unwrap());910let 클라이언트 client = Client::new();11let json_data = r#"12{13"jsonrpc": "2.0",14"id": 1,15"method": "getBlockTime",16"params": [179410194818]19}20"#;21let 응답 = client22.게시물("https://docs-demo.solana-mainnet.quiknode.pro/")23.헤더(헤더))24.본문(json_data)25.보내기()26.await?;2728let 본문 = response.text().await?;29println!("{}", body);3031알겠습니다(())32}33
답변
1{2"jsonrpc": "2.0",3"result": 1630351521,4"id": 15}
1{2"jsonrpc": "2.0",3"result": 1630351521,4"id": 15}