Historical User Adoption/Growth

node v10.24.1
version: 2.0.0
const Web3Data = require("web3data-js@0.6.1") // Create the Web3Data instances passing in your API Key (Get one! -> amberdata.io/onboarding) // If you're signed in and have an api key it will get autopopulated here! const w3d = new Web3Data(process.env.API_KEY) // Need profressional key to work const profKeyError = e => console.log('Need Professional API Key') // We'll get the adoption and usage statistics of our address which will give us an idea of // how our user base is doing const getGrowthMetrics = async (address) => { const config = { timeFrame: '30d', timeFormat: 'iso' } const [adoption, usage] = await Promise.all( [w3d.address.getAdoption(address, config).catch(profKeyError), w3d.address.getUsage(address, config).catch(profKeyError)]) return {adoption, usage} } // We're using cryptokitties as an example but this would be the main contract address of dApp you are monitoring const cryptoKittiesContract = "0x06012c8cf97bead5deae237070f9587f8e7a266d" console.log(await getGrowthMetrics(cryptoKittiesContract))

no comments

    sign in to comment