Skip to content

Commit

Permalink
Cleanup miningStatus and added print() to each python example for cla…
Browse files Browse the repository at this point in the history
…rity
  • Loading branch information
fr1t2 committed Jan 6, 2024
1 parent 44ef8f0 commit e94b5f3
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions docs/API/explorer-api.md
Expand Up @@ -100,7 +100,7 @@ def getblockByNumber(block_number):
jsonResponse = getBlockResp
return(jsonResponse)

getblockByNumber("34556")
print(getblockByNumber("34556"))
```


Expand Down Expand Up @@ -149,7 +149,7 @@ def getTransactionByHash(tx_hash):
jsonResponse = getTXResp
return(jsonResponse)

getTransactionByHash("c9656d989bce2000c794314b73882b0ebb99fa1fe58e7a466a8a64e7b851a4c6")
print(getTransactionByHash("c9656d989bce2000c794314b73882b0ebb99fa1fe58e7a466a8a64e7b851a4c6"))
```

## Address
Expand Down Expand Up @@ -194,7 +194,7 @@ def getAddress(address):
jsonResponse = getAddressResp
return(jsonResponse)

getAddress("Q01040007a591a62c23ed27adfe3df8eb812ee5e4b73e47fb8471e8d78ecd9b4cadc325ca36d86e")
print(getAddress("Q01040007a591a62c23ed27adfe3df8eb812ee5e4b73e47fb8471e8d78ecd9b4cadc325ca36d86e"))
```


Expand Down Expand Up @@ -240,7 +240,7 @@ def getEmission():
return(jsonResponse)


getEmission()
print(getEmission())
```


Expand Down Expand Up @@ -284,7 +284,7 @@ def getEmissionText():
return(jsonResponse)


getEmissionText()
print(getEmissionText())
```

## Reward
Expand Down Expand Up @@ -329,7 +329,7 @@ def getReward():
return(jsonResponse)


getReward()
print(getReward())
```

## Reward Text
Expand Down Expand Up @@ -370,7 +370,7 @@ def getRewardText():
return(jsonResponse)


getRewardText()
print(getRewardText())
```

## RewardShor
Expand Down Expand Up @@ -413,7 +413,7 @@ def getRewardShor():
return(jsonResponse)


getRewardShor()
print(getRewardShor())
```

## RewardShor Text
Expand Down Expand Up @@ -454,7 +454,7 @@ def getRewardShorText():
return(jsonResponse)


getRewardShorText()
print(getRewardShorText())
```


Expand Down Expand Up @@ -502,7 +502,7 @@ def getBlockheight():
return(jsonResponse)


getBlockheight()
print(getBlockheight())
```


Expand Down Expand Up @@ -544,8 +544,7 @@ def getBlockheightText():
jsonResponse = getBlockheightTextResp
return(jsonResponse)


getBlockheightText()
print(getBlockheightText())
```


Expand Down Expand Up @@ -594,7 +593,7 @@ def getStatus():
return(json.dumps(jsonResponse, indent=4, sort_keys=True))


getStatus()
print(getStatus())
```


Expand All @@ -618,30 +617,29 @@ Get the mining status information for the current QRL block.


:::info
`/api/status` requests will only return in JSON format.
`/api/miningstats` requests will only return in JSON format.
Parse the response using json tools in a language of your choice.
:::


**cURL Example**

```bash
curl -XGET https://explorer.theqrl.org/api/status
curl -XGET https://explorer.theqrl.org/api/miningstats
```

**Python Example**

```python
def getStatus():
def getMiningStats():
import requests
import json
request = requests.get("https://explorer.theqrl.org/api/status")
request = requests.get("https://explorer.theqrl.org/api/miningstats")
response = request.text
getStatusResp = json.loads(response)
jsonResponse = getStatusResp
#return(jsonResponse)
return(json.dumps(jsonResponse, indent=4, sort_keys=True))


getStatus()
print(getMiningStats())
```

0 comments on commit e94b5f3

Please sign in to comment.