npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ethblockart-humanizer

v1.0.6

Published

**Transaction Types** * `erc20`, `nft`, `transfer`, `unrecognized`

Downloads

13

Readme

Transforms Ethereum block's metadata

to a humanized view.

 

Transaction Types

  • erc20, nft, transfer, unrecognized

Transaction Value, Gas

  • average, minimum, maximum, median, summ value/gas in transactions array

Block Season

  • winter, sprint, summer, autumn

Daytime

  • night, morning, day, afterday, evening in UTC

 

This package uses block data structure via EthBlock.Art.

If you want to use this package outside of EthBlock.Art development boilerplate, you need to be sure if the block data structure from your API are prepared to this package structure based on useDApp's (and EthBlock.Art) block metadata response.

Different APIs are gives different 'block metadata'.

For example, web3 node module has input instead of data property in transactions array item.

 

Install & Use

npm i ethblockart-humanizer
import { getBlockHumanized } from 'ethblockart-humanizer';

// ...
const humanizedBlock = getBlockHumanized(block);
// ...

Result:

{
    "number": 13596479,
    "season": "autumn",
    "daytime": "evening",
    "time": "2021-11-11T18:20:00.000Z",
    "transactions": {
        "total": 294,
        "types": {
            "erc20": 93,
            "nft": 0,
            "transfer": 144,
            "unrecognized": 57
        },
        "values": {
            "value": {
                "avgValue": 0.3343366122304634,
                "minValue": 0,
                "medianValue": 0,
                "maxValue": 21.995,
                "sumValue": 98.29496399575623
            },
            "gas": {
                "avgGas": 0.035442864392160454,
                "medianGas": 0.017042417914345,
                "minGas": 0.0031647,
                "maxGas": 1.2892222294735,
                "sumGas": 10.420202131295174
            },
            "data": [
                {
                    "hash": "0xb41984c70cd05687fbc5d721c6bb2c02ee8158201c1749f8bb9645ea5899d7d7",
                    "type": "unrecognized",
                    "value": 0,
                    "gas": 0.07462853334800001
                },
                // ...
            ]
        }
    }
}

 

Created for EthBlockArt Humanizer

https://zashi.art/ebah

EthBlockArt is about facing a mirror towards the chain we use and data we create.

EthBlockArt Humanizer extends that, surfacing the connection between data and visual.

  Example

 

Functions

  • getBlockHumanized(block), — get humanized metadata. block is Ethereum block metadata object. You can use only this function.

 

  • getTransactionsHumanized(transaction), — get only { values, types } result. transaction is Ethereum block transaction object.

  • getTransactionHumanizedTypeName(transaction) — get only calculated transaction's type.

  • getBlockHumanizedSeason(block) — get calculated season name.

  • getBlockHumanizedDaytime(block) — just get timestamp property in UTC format.

   

2021, MIT License, Zashi Frovano