Skip to content

Commit 46713c2

Browse files
authored
Merge pull request #75 from JeremyTheintz/develop
Update documentation
2 parents 468cb91 + 36f1a4b commit 46713c2

File tree

33 files changed

+270
-60
lines changed

33 files changed

+270
-60
lines changed

packages/api/rest/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ Return monthly chart data for the blockchain
268268
| today_transaction_count | integer | _Example:_ `1928493` | Yes |
269269
| address_count | integer | _Example:_ `192849345` | Yes |
270270
| today_address_count | integer | _Example:_ `1928493` | Yes |
271+
| today_user_count | integer | _Example:_ `28493` | Yes |
272+
| today_contract_count | integer | _Example:_ `19283` | Yes |
271273
| total_value_locked | integer | _Example:_ `192849308903` | Yes |
272274

273275
#### Metadata

packages/api/rest/swagger.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ paths:
3737
schema:
3838
type: string
3939
enum: [
40-
name
40+
name,
41+
score
4142
node_count,
4243
testnet_node_count,
4344
single_node_power_consumption,
@@ -51,7 +52,9 @@ paths:
5152
consensus,
5253
today_transaction_count,
5354
address_count,
54-
today_address_count
55+
today_address_count,
56+
today_user_count,
57+
today_contract_count
5558
]
5659
- in: query
5760
name: limit
@@ -447,6 +450,9 @@ components:
447450
name:
448451
type: string
449452
example: Ethereum
453+
score:
454+
type: integer
455+
example: 42
450456
node_count:
451457
type: integer
452458
example: 5000
@@ -489,6 +495,12 @@ components:
489495
today_address_count:
490496
type: integer
491497
example: 1928493
498+
today_user_count:
499+
type: integer
500+
example: 19284
501+
today_contract_count:
502+
type: integer
503+
example: 267893
492504
total_value_locked:
493505
type: integer
494506
example: 192849308903

packages/api/rest/utils/fetch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const getBlockchains = async (pool, params) => {
77
try {
88
const { desc, sortBy, limit, offset } = params;
99

10-
let queryPrefix = `SELECT id, name, score, node_count, testnet_node_count, single_node_power_consumption, blockchain_power_consumption, hashrate, difficulty, last_block_timestamp, token_count, transaction_count, gas_price, consensus, today_transaction_count, address_count, today_address_count, total_value_locked FROM blockchain`;
10+
let queryPrefix = `SELECT id, name, score, node_count, testnet_node_count, single_node_power_consumption, blockchain_power_consumption, hashrate, difficulty, last_block_timestamp, token_count, transaction_count, gas_price, consensus, today_transaction_count, address_count, today_address_count, total_value_locked, today_user_count, today_contract_count FROM blockchain`;
1111

1212
// don't take care of none value
1313
// queryPrefix += ` AND ${params.sortByField} IS NOT NULL`;
@@ -31,7 +31,7 @@ export const getBlockchains = async (pool, params) => {
3131

3232
export const getBlockchainById = async (pool, id) => {
3333
try {
34-
let query = `SELECT id, name, score, node_count, testnet_node_count, single_node_power_consumption, blockchain_power_consumption, hashrate, difficulty, last_block_timestamp, token_count, transaction_count, gas_price, consensus, today_transaction_count, address_count, today_address_count, total_value_locked FROM blockchain WHERE id = '${id}'`;
34+
let query = `SELECT id, name, score, node_count, testnet_node_count, single_node_power_consumption, blockchain_power_consumption, hashrate, difficulty, last_block_timestamp, token_count, transaction_count, gas_price, consensus, today_transaction_count, address_count, today_address_count, total_value_locked, today_user_count, today_contract_count FROM blockchain WHERE id = '${id}'`;
3535

3636
const res = await pool.query(query);
3737

packages/api/ws/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ The subscribe/unsubscribe messages should be built according to the following st
6969
| ----------------------------- | ------------- | ------------------------------ |
7070
| id | string (uuid) | _Example:_ `"ethereum"` |
7171
| name | string | _Example:_ `"Ethereum"` |
72+
| score | integer | _Example:_ `50` |
7273
| reliability | integer | _Example:_ `79` |
7374
| node_count | integer | _Example:_ `5000` |
7475
| testnet_node_count | integer | _Example:_ `100` |
@@ -84,6 +85,8 @@ The subscribe/unsubscribe messages should be built according to the following st
8485
| today_transaction_count | integer | _Example:_ `1928493` |
8586
| address_count | integer | _Example:_ `192849345` |
8687
| today_address_count | integer | _Example:_ `1928493` |
88+
| today_user_count | integer | _Example:_ `19284` |
89+
| today_contract_count | integer | _Example:_ `975451` |
8790
| total_value_locked | integer | _Example:_ `192849308903.3464` |
8891

8992
---
@@ -118,7 +121,8 @@ The subscribe/unsubscribe messages should be built according to the following st
118121
| blockchain_power_consumption | number | _Example:_ `100000` |
119122
| token_count | integer | _Example:_ `4890` |
120123
| gas_price | number | _Example:_ `250000000` |
121-
| rank | string | _Example:_ `"B+"` |
124+
| score | integer | _Example:_ `52` |
125+
| rank | string | _Example:_ `"C+"` |
122126

123127
---
124128

@@ -159,6 +163,7 @@ Available blockchains id
159163
| ----------------------------- | ------------- | ------------------------------ |
160164
| id | string (uuid) | _Example:_ `"ethereum"` |
161165
| name | string | _Example:_ `"Ethereum"` |
166+
| score | integer | _Example:_ `50` |
162167
| reliability | integer | _Example:_ `79` |
163168
| node_count | integer | _Example:_ `5000` |
164169
| testnet_node_count | integer | _Example:_ `100` |
@@ -174,6 +179,8 @@ Available blockchains id
174179
| today_transaction_count | integer | _Example:_ `1928493` |
175180
| address_count | integer | _Example:_ `192849345` |
176181
| today_address_count | integer | _Example:_ `1928493` |
182+
| today_user_count | integer | _Example:_ `19284` |
183+
| today_contract_count | integer | _Example:_ `975451` |
177184
| total_value_locked | integer | _Example:_ `192849308903.3464` |
178185

179186
---

packages/api/ws/utils/fetch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const getBlockchainById = async (con, params) => {
7575
try {
7676
const { id } = params;
7777

78-
let query = `SELECT id, name, node_count, testnet_node_count, reliability, single_node_power_consumption, blockchain_power_consumption, hashrate, difficulty, last_block_timestamp, token_count, transaction_count, gas_price, consensus, today_transaction_count, address_count, today_address_count, total_value_locked FROM blockchain WHERE id = '${id}'`;
78+
let query = `SELECT id, name, score, node_count, testnet_node_count, reliability, single_node_power_consumption, blockchain_power_consumption, hashrate, difficulty, last_block_timestamp, token_count, transaction_count, gas_price, consensus, today_transaction_count, address_count, today_address_count, total_value_locked, today_user_count, today_contract_count FROM blockchain WHERE id = '${id}'`;
7979

8080
const res = await con.query(query);
8181

0 commit comments

Comments
 (0)