Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@appliedblockchain/simple-block-explorer

Package Overview
Dependencies
Maintainers
27
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appliedblockchain/simple-block-explorer

A simple block explorer

  • 0.1.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
27
Created
Source

Summary

Small, simple library to get non-empty blocks/transactions.

It simply takes an instance of web3, an array of contract jsons for ABI injection and an optional middleware to modify TXs before being added.

Taken from Ed's blocks library in KLM.

Usage

Example Route:

Note: In my example, web3 and contract json's are injected via eth

const { BlockExplorer } = require('@appliedblockchain/simple-block-explorer')
const web3 = new Web3()
const componentJson = require('contracts/Components.json')
const contracts = [ componentJson ]

const txMiddleware = async (tx) => {
  tx.value = Number(tx.value)
  tx.extraProperty = 'testing'
  return tx
}

const handler = async (ctx) => {
  const blockExplorer = new BlockExplorer({
    web3,
    contracts,
    txMiddleware
  })

  ctx.body = await blockExplorer.getTransactions()
}

FAQs

Package last updated on 03 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc