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 update = () => { | |
// can not be within 5 seconds of each other. | |
if (account.getLastUpdate() - new Date().getTime() < 5000) { | |
return; | |
} | |
// update account then reset the state so it updates! | |
account.update().then((returnedScope: any) => { | |
let currentTime = new Date().getTime(); | |
setAccount(returnedScope); // update account data! |
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 [ account, setAccount ] = useState<AccountData>(); | |
const [ startUpdater, setStartUpdater ] = useState<boolean>(false); | |
const [ activeTimer, setActiveTimer ] = useState<any>(null); | |
// export this in your context to make a refresh button also. just call it. | |
// hence the 5 second throttle. lol. could possibly do some refining here on an edge case | |
// of where the auto-refresh comes close to the manual refesh. | |
const update = () => { | |
// can not be within 5 seconds of each other. | |
if (account.getLastUpdate() - new Date().getTime() < 5000) { |
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
/** | |
* Transparency Notice: | |
* This snippet was stripped and modified from the actual bot in a way | |
* so it's easier to explain. The bot functions the same. -OGKingFox | |
*/ | |
// this will sync all of the people that have ever touched glow to a database. | |
// once stored, we can then select a random one. BscScan limits to 10,000 entries so | |
// if you're an old token, you're gonna need to run this first a few times... |
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 web3 = new Web3(new Web3.providers.HttpProvider("https://bsc-dataseed1.binance.org:443")); | |
const mini_abi = [{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]; | |
const aggregator = [{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalTyp |