Gathering detailed insights and metrics for theta-data
Gathering detailed insights and metrics for theta-data
Gathering detailed insights and metrics for theta-data
Gathering detailed insights and metrics for theta-data
npm install theta-data
Typescript
Module System
Node Version
NPM Version
TypeScript (98.66%)
HTML (1.09%)
JavaScript (0.25%)
Total Downloads
17,165
Last Day
6
Last Week
8
Last Month
175
Last Year
1,997
4 Stars
152 Commits
1 Forks
2 Watchers
4 Branches
1 Contributors
Updated on Sep 09, 2023
Latest Version
0.1.63
Package Id
theta-data@0.1.63
Unpacked Size
7.85 MB
Size
2.09 MB
File Count
513
NPM Version
6.14.17
Node Version
14.21.2
Published on
Feb 14, 2023
Cumulative downloads
Total Downloads
Last Day
500%
6
Compared to previous day
Last Week
-55.6%
8
Compared to previous week
Last Month
775%
175
Compared to previous month
Last Year
47.4%
1,997
Compared to previous year
32
24
Theta Data is a Data Analytics Tool for The Theta Network. It collects data from Guardian Node, performs analysis and provides data and analysis result through convenient Graphql interfaces. Users can access the data with simple statements and queries.
We provide a simple GUI for basic queries. With box checking, you can look up the relevant data of your own interest. History queries will be saved so that you do not need to rewrite the statements.
Unlike traditional interface, Theta Data provides an efficient and concise way to retrieve on-chain data.
The below example shows the difference between a traditional interface and Theta Data API when you are collecting the block height, staking amount and the circulating supply of Theta token/Theta Fuel
1const provider = new thetajs.providers.HttpProvider() 2const blockHeight = await provider.getBlockNumber()
1// Request 2curl https://explorer.thetatoken.org:8443/api/stake/totalAmount 3 4// Result 5{ 6 "type":"stakeTotalAmout", 7 "body":{ 8 "totalAmount":"644011157483502419243726104", 9 "totalNodes":3457, 10 "type":"theta" 11 } 12}
1// Request 2curl https://explorer.thetatoken.org:8443/api/supply/theta 3 4// Result 5{ 6 "total_supply":1000000000, 7 "circulation_supply":1000000000 8}
1// Request 2curl https://explorer.thetatoken.org:8443/api/supply/tfuel 3 4// Result 5{ 6 "circulation_supply":5000000000 7}
We can see from above, in order to get the basic data, we need to call 4 different APIs. These APIs are from different source, which makes them difficult to maintain in our own program.
With Theta Data, all the data above can be retrieve with one single Graphql statement and one request.
Request:
1{ 2 MarketInformation { 3 Theta { 4 circulating_supply 5 total_supply 6 } 7 ThetaFuel { 8 circulating_supply 9 total_supply 10 } 11 } 12 StakeStatistics { 13 total_validator_node_number 14 total_guardian_node_number 15 total_elite_edge_node_number 16 } 17 ThetaRpc { 18 GetStatus { 19 current_height 20 } 21 } 22}
Response:
1{ 2 "data": { 3 "MarketInformation": { 4 "theta": { 5 "circulating_supply": 1000000000, 6 "total_supply": 1000000000 7 }, 8 "theta_fuel": { 9 "circulating_supply": 5301214400, 10 "total_supply": 5301214400 11 } 12 }, 13 "StakeStatistics": { 14 "total_validator_node_number": 16, 15 "total_guardian_node_number": 3441, 16 "total_elite_edge_node_number": 8436 17 }, 18 "ThetaRpc": { 19 "GetStatus": { 20 "current_height": "12806717" 21 } 22 } 23 } 24}
It is also worth mentioning that Theta Data only returns the data you specify in the query statement. No redundant fields will be returned.
1npm i theta-data
1const thetaData = require("theta-data"); 2thetaData.analyse();
1const thetaData = require("theta-data"); 2thetaData.serve();
After running the graphql api server.You can then open your web browser and navigate to http://localhost:3000 (host and port may vary depending on your configuration). You will then see the GraphQL playground.
Theta Data is licensed under the MIT License.
No vulnerabilities found.