Méthode RPC « getdifficulty »
Paramètres
Cette méthode n'accepte aucun paramètre
Retours
résultat
entier
Chargement en cours...
erreur
chaîne de caractères
Chargement en cours...
Demande
1curl -X POST "https://docs-demo.zec-mainnet.quiknode.pro/" \2-H « Content-Type : application/json » \3-d '{4« jsonrpc » : « 2.0 »,5"méthode" : "getdifficulty",6"params" : [],7« id » : 18}'
1curl -X POST "https://docs-demo.zec-mainnet.quiknode.pro/" \2-H « Content-Type : application/json » \3-d '{4« jsonrpc » : « 2.0 »,5"méthode" : "getdifficulty",6"params" : [],7« id » : 18}'
1const corps = {2jsonrpc: '2.0',3méthode: « getdifficulty »,4paramètres: [],5id: 16}78async fonction main() {9const response = await fetch('https://docs-demo.zec-mainnet.quiknode.pro/', {10méthode: « POST »,11headers: {'Content-Type': 'application/json'},12corps: JSON.convertir(body)13})14const données = await réponse.json()15console.journal(données)16}1718Accueil()
1const corps = {2jsonrpc: '2.0',3méthode: « getdifficulty »,4paramètres: [],5id: 16}78async fonction main() {9const response = await fetch('https://docs-demo.zec-mainnet.quiknode.pro/', {10méthode: « POST »,11headers: {'Content-Type': 'application/json'},12corps: JSON.convertir(body)13})14const données = await réponse.json()15console.journal(données)16}1718Accueil()
1import demandes2import json34url = "https://docs-demo.zec-mainnet.quiknode.pro/"56charge utile = json.dumps({7« jsonrpc »: « 2.0 »,8« méthode »: « getdifficulty »,9« params »: [],10« id »: 111})12en-têtes = {13« Content-Type »: 'application/json'14}1516réponse = demandes.demande(« POST », url, en-têtes=en-têtes, données=charge utile)1718imprimer(réponse.texte)
1import demandes2import json34url = "https://docs-demo.zec-mainnet.quiknode.pro/"56charge utile = json.dumps({7« jsonrpc »: « 2.0 »,8« méthode »: « getdifficulty »,9« params »: [],10« id »: 111})12en-têtes = {13« Content-Type »: 'application/json'14}1516réponse = demandes.demande(« POST », url, en-têtes=en-têtes, données=charge utile)1718imprimer(réponse.texte)
1nécessite « uri »2require « json »3nécessite « net/http »45uri = URI("https://docs-demo.zec-mainnet.quiknode.pro/")67charge utile = {8jsonrpc: « 2.0 »,9id: 1,10méthode: « getdifficulty »,11params: []12}1314demande = Net::HTTP::POST.nouveau(URI)15demande[« Content-Type »] = « application/json »16demande.corps = JSON.générer(payload)1718réponse = Net::HTTP.début(uri.hôte, uri.port, use_ssl: true) faire |http|19http.requête(demande)20fin2122affiche la réponse.corps
1nécessite « uri »2require « json »3nécessite « net/http »45uri = URI("https://docs-demo.zec-mainnet.quiknode.pro/")67charge utile = {8jsonrpc: « 2.0 »,9id: 1,10méthode: « getdifficulty »,11params: []12}1314demande = Net::HTTP::POST.nouveau(URI)15demande[« Content-Type »] = « application/json »16demande.corps = JSON.générer(payload)1718réponse = Net::HTTP.début(uri.hôte, uri.port, use_ssl: true) faire |http|19http.requête(demande)20fin2122affiche la réponse.corps
Réponse
1{2« jsonrpc »: « 2.0 »,3« id »: 1,4"result": 127318833.427301815}
1{2« jsonrpc »: « 2.0 »,3« id »: 1,4"result": 127318833.427301815}
Vous n'avez pas encore de compte ?
Créez votreendpoint Quicknode endpoint quelques secondes et commencez à développer
Commencez gratuitement