🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

etherscanner

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

etherscanner

Receive all the ethereum transactions that have been included in the block, including 'internal' transactions

0.2.9
latest
Source
npm
Version published
Maintainers
1
Created
Source

EtherScanner

Module for parse ethereum transactions or block and get from them all Eth transfers (normal and "internal")

Warning

To work the module need this correction - https://github.com/ethereum/go-ethereum/pull/15297. So you must use geth version 1.7.3 or higher

NPM version

Installation

npm install etherscanner

Usage

const EtherScanner = require('etherscanner');
const Web3 = require('web3');

let web3Provider = new Web3.providers.HttpProvider(`http://localhost:6082`);
// or if web3 initialized before
let web3Provider = web3.currentProvider;

let etherScanner = EtherScanner(web3Provider);

Get all transfers by transaction hash
etherScanner.scanTransaction('0xc475f8bf9d2721b17f7c09944c2aa32ea943f452cb54ee0aefcb98ead0735274', (err, result) => {
	console.log(result);
});

result:

[{
	"hash": "0xc475f8bf9d2721b17f7c09944c2aa32ea943f452cb54ee0aefcb98ead0735274",
	"from": "0x1617d6e2dca84fec5c17f37d4141d2c4ec5c6d05",
	"to": "0xd1a2511bc222f38f463c62c9254faf7b710835e4",
	"value": 10000000000000000,
	"blockNumber": 1818075,
	"blockHash": "0x402a1df2fe61dcc83bec29c1202938e2fd739d97e614dbab351561dc04b01cd3",
	"isInternal": false,
	"type": ""
}, {
	"hash": "0xc475f8bf9d2721b17f7c09944c2aa32ea943f452cb54ee0aefcb98ead0735274",
	"from": "0xd1a2511bc222f38f463c62c9254faf7b710835e4",
	"to": "0x1617d6e2dca84fec5c17f37d4141d2c4ec5c6d05",
	"value": 12468329110548072,
	"blockNumber": 1818075,
	"blockHash": "0x402a1df2fe61dcc83bec29c1202938e2fd739d97e614dbab351561dc04b01cd3",
	"isInternal": true,
	"type": "CALL"
}]

type - "" || CALL || CREATION || SELFDESTRUCT

Get all transfers by block number
etherScanner.scanBlock(1822433, (err, result) => {
	console.log(result);
});

Keywords

ethereum

FAQs

Package last updated on 18 Jul 2019

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