This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JSON API --- https://hexdailystats.com/fulldata | |
// JSON API --- https://hexdailystats.com/livedata | |
// https://codeakk.medium.com/hex-development-data-a1b1822446fa | |
// https://togosh.medium.com/hex-developer-guide-3b018a943a55 | |
// NOTE: New rows of historical full data usually get added into database about 20 minutes after 00:00:00 UTC every day | |
// NOTE: Live data updates every 1 minute | |
// TEST: Copy and run code with online javascript compiler --- https://jsfiddle.net/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Web3 = require('web3'); | |
const compiledContractABI = require('./HEX.abi.json'); | |
const hexAddr = "0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39"; | |
const findStakeAndIndex = async (addr, stakeId) => { | |
let stakes = await hex.stakeList(addr); | |
for(let i = 0; i < stakes.length; i++){ | |
if(stakes[i].stakeId === stakeId){ |