Skip to content

Commit

Permalink
New layout (#47)
Browse files Browse the repository at this point in the history
* New Layout

* New Layout

Changing layout based on new design

* trunk

* Update extra.css

* Update extra.css
  • Loading branch information
ziaddarwishcreoshift authored Sep 11, 2024
1 parent 9dae930 commit feebc4e
Show file tree
Hide file tree
Showing 35 changed files with 2,482 additions and 30 deletions.
58 changes: 58 additions & 0 deletions zq2/docs/apis/1123f1a7/api/erigon/erigon_getHeaderByNumber.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
id: APIs/1123f1a7/api/erigon/erigon_getHeaderByNumber
title: erigon_getHeaderByNumber
keywords: erigon,header,number
---

---

Returns the erigon headers for a given block number

### Example Request

=== "cURL"

```shell
curl -d '{
"id": "1",
"jsonrpc": "2.0",
"method": "erigon_getHeaderByNumber",
"params": [ 1000 ]
}' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com"
```

### Example response

```json
{
"jsonrpc": "2.0",
"result": {
"number": "0x3e8",
"hash": "0x7dbeae485c26511423301be854c6cdec6b07170427f3270ac1748782f4fe4a8f",
"parentHash": "0x71d2d959e0eb73b429686c0c1107e4183f04c0a54752d4fe519a1f0c54ab7cdb",
"nonce": "0x0000000000000000",
"sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot": "0xd639a448087e7d087fb2d0fef4a1bd95237a965277dcbf7ee33344384491d409",
"receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x768af8c0b4792ed2948186857f1122f3cd6a695d",
"difficulty": "0x0",
"totalDifficulty": "0x0",
"extraData": "0x",
"size": "0x0",
"gasLimit": "0x501bd00",
"gasUsed": "0x0",
"timestamp": "0x6602d4bc",
"transactions": [],
"uncles": []
},
"id": "1"
}
```

### Arguments

| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ------------------------- |
| `block` | number | Required | The block number to query |
34 changes: 34 additions & 0 deletions zq2/docs/apis/1123f1a7/api/ots/ots_getApiLevel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
id: APIs/1123f1a7/api/ots/ots_getApiLevel
title: ots_getApiLevel
keywords: ots
---

---

Returns the Otterscan API level

### Example Request

=== "cURL"

```shell
curl -d '{
"id": "1",
"jsonrpc": "2.0",
"method": "ots_getApiLevel",
"params": [ ]
}' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com"
```

### Example response

```json
{
"jsonrpc": "2.0",
"result": 8,
"id": "1"
}
```

### Arguments
66 changes: 66 additions & 0 deletions zq2/docs/apis/1123f1a7/api/ots/ots_getBlockDetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
id: APIs/1123f1a7/api/ots/ots_getBlockDetails
title: ots_getBlockDetails
keywords: ots,details,block
---

---

Returns details of a numbered block for otterscan

### Example Request

=== "cURL"

```shell
curl -d '{
"id": "1",
"jsonrpc": "2.0",
"method": "ots_getBlockDetails",
"params": [ 1000 ]
}' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com"
```

### Example response

```json
{
"jsonrpc": "2.0",
"result": {
"block": {
"number": "0x3e8",
"hash": "0x7dbeae485c26511423301be854c6cdec6b07170427f3270ac1748782f4fe4a8f",
"parentHash": "0x71d2d959e0eb73b429686c0c1107e4183f04c0a54752d4fe519a1f0c54ab7cdb",
"nonce": "0x0",
"sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot": "0xd639a448087e7d087fb2d0fef4a1bd95237a965277dcbf7ee33344384491d409",
"receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x768af8c0b4792ed2948186857f1122f3cd6a695d",
"difficulty": "0x0",
"totalDifficulty": "0x0",
"extraData": "0x",
"size": "0x0",
"gasLimit": "0x1",
"gasUsed": "0x0",
"timestamp": "0x6602d4bc",
"transactionCount": 0,
"uncles": [],
"baseFeePerGas": "0x0"
},
"issuance": {
"blockReward": "0x0",
"uncleReward": "0x0",
"issuance": "0x0"
},
"totalFees": "0x0"
},
"id": "1"
}
```

### Arguments

| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ------------------------- |
| `block` | number | Required | The block number to query |
66 changes: 66 additions & 0 deletions zq2/docs/apis/1123f1a7/api/ots/ots_getBlockDetailsByHash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
id: APIs/1123f1a7/api/ots/ots_getBlockDetailsByHash
title: ots_getBlockDetailsByHash
keywords: ots,api,hash,block,details
---

---

Returns details of a block for otterscan by hash

### Example Request

=== "cURL"

```shell
curl -d '{
"id": "1",
"jsonrpc": "2.0",
"method": "ots_getBlockDetailsByHash",
"params": [ "0x7dbeae485c26511423301be854c6cdec6b07170427f3270ac1748782f4fe4a8f" ]
}' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com"
```

### Example response

```json
{
"jsonrpc": "2.0",
"result": {
"block": {
"number": "0x3e8",
"hash": "0x7dbeae485c26511423301be854c6cdec6b07170427f3270ac1748782f4fe4a8f",
"parentHash": "0x71d2d959e0eb73b429686c0c1107e4183f04c0a54752d4fe519a1f0c54ab7cdb",
"nonce": "0x0",
"sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"stateRoot": "0xd639a448087e7d087fb2d0fef4a1bd95237a965277dcbf7ee33344384491d409",
"receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x768af8c0b4792ed2948186857f1122f3cd6a695d",
"difficulty": "0x0",
"totalDifficulty": "0x0",
"extraData": "0x",
"size": "0x0",
"gasLimit": "0x1",
"gasUsed": "0x0",
"timestamp": "0x6602d4bc",
"transactionCount": 0,
"uncles": [],
"baseFeePerGas": "0x0"
},
"issuance": {
"blockReward": "0x0",
"uncleReward": "0x0",
"issuance": "0x0"
},
"totalFees": "0x0"
},
"id": "1"
}
```

### Arguments

| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ----------------------- |
| `hash` | string | Required | The block hash to query |
129 changes: 129 additions & 0 deletions zq2/docs/apis/1123f1a7/api/zilliqa/DSBlockListing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
id: APIs/1123f1a7/api/zilliqa/DSBlockListing
title: DSBlockListing
keywords: ds,block,listing
---

---

!!! warning

This API is not yet implemented in this version of Zilliqa 2.0

Returns a paginated list of up to **10** Directory Service (DS) blocks and their
block hashes for a specified page. The `maxPages` variable that specifies the
maximum number of pages available is also returned.

### Example Request

=== "cURL"

```shell
curl -d '{
"id": "1",
"jsonrpc": "2.0",
"method": "DSBlockListing",
"params": [1]
}' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com"
```

=== "node.js"

```js
const dsBlockListing = await zilliqa.blockchain.getDSBlockListing(1);
console.log(dsBlockListing.result);
```

=== "java"

```java
public class App {
public static void main(String[] args) throws IOException {
HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com");
Rep<BlockList> blockListing = client.getDSBlockListing(1);
System.out.println(new Gson().toJson(blockListing));
}
}
```

=== "python"

```python
from pyzil.zilliqa import chain
chain.set_active_chain(chain.MainNet)
print(chain.active_chain.api.DSBlockListing(1))
```

=== "go"

```go
func DSBlockListing() {
provider := NewProvider("https://api.zq2-devnet.zilliqa.com")
response := provider.DSBlockListing(1)
result, _ := json.Marshal(response)
fmt.Println(string(result))
}
```

### Example response

```json
{
"id": "1",
"jsonrpc": "2.0",
"result": {
"data": [
{
"BlockNum": 5898,
"Hash": "4DEED80AFDCC89D5B691DCB54CCB846AD9D823D448A56ACAC4DBE5E1213244C7"
},
{
"BlockNum": 5897,
"Hash": "968E2E7820A3795DE8C8A7A2E94379CC10F50ADA5EA6F90C03C4E61E22EE83B5"
},
{
"BlockNum": 5896,
"Hash": "A52D113357910ADECEFA713D89A667030F521FFB153EEFA97A0D9E7E4AA5230B"
},
{
"BlockNum": 5895,
"Hash": "8d49d4b18b441dc0da6ca580f468c9e83278c47f0f54fe342e1fe1425c39044f"
},
{
"BlockNum": 5894,
"Hash": "b966c36557480a35a36a0d1c33723fd9bac8538588dea6716b4dfb2a05815458"
},
{
"BlockNum": 5893,
"Hash": "fc20118eec0f14fdc089fcfee528276337dcf403a308153485f24f2856998613"
},
{
"BlockNum": 5892,
"Hash": "4ed593d66b1ea5fa9a77cc1bb119baf90029c249bf5507b01079bc2fbf45aec7"
},
{
"BlockNum": 5891,
"Hash": "1385bf48e584ebb82cf11a9064d99b5e0b4ae560866a92efe9b78604e08fc821"
},
{
"BlockNum": 5890,
"Hash": "05d6d24a8f5411ff70fe58a09f38fd4b49ec4122b7c26817964a4a8b8a089c1f"
},
{
"BlockNum": 5889,
"Hash": "137e56be8966eba0c04138d79faa1515997fc790ccf5213c00bb13a3550cca39"
}
],
"maxPages": 590
}
}
```

### Arguments

| Parameter | Type | Required | Description |
| --------- | ------ | -------- | ---------------------------------------------------------- |
| `id` | string | Required | `"1"` |
| `jsonrpc` | string | Required | `"2.0"` |
| `method` | string | Required | `"DSBlockListing"` |
| `params` | number | Required | Specifed page of DS blocks listing to return. Example: `1` |
Loading

0 comments on commit feebc4e

Please sign in to comment.