Giter Site home page Giter Site logo

novasanchez / etherscanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevnz/etherscanner

0.0 0.0 1.0 106 KB

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

JavaScript 97.76% HTML 2.24%

etherscanner's Introduction

EtherScanner

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

Installation

If you must.

npm install @nova47sanz/etherscanner

Usage

const EtherScanner = require('@nova47sanz/etherscanner');

const etherScanner = await EtherScanner(`http://localhost:6082`);
Get all transfers by transaction hash
const result = await etherScanner.scanTransaction('0xc475f8bf9d2721b17f7c09944c2aa32ea943f452cb54ee0aefcb98ead0735274');
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"
}]

in case of internal tx calling SC in BlockChain:

{
    "blockNumber": "",
    "blockHash": "",
    "to": "0xf53d56bf81d4ad997b9e70935270baba8efaefe7",
    "from": "0x3acf9c404fda9a69c559d1e816b9613145e89948",
    "value": 0.1,
    "hash": "0x21fbb3a548637bec8fdb7ebbe5fa2feaa6302e1872aef76a04de71e3ddb85e96",
    "type": "Token",
    "isSuicide": "none",
    "isInternal": true,
    "traceAddress": 1,
    "input": "0x23b872dd0000000000000000000000003acf9c404fda9a69c559d1e816b9613145e89948000000000000000000000000f53d56bf81d4ad997b9e70935270baba8efaefe700000000000000000000000000000000000000000000000000000000000186a0"
},
{
    "blockNumber": "",
    "blockHash": "",
    "to": "0xe0d0c4c35d30baa00a2c93004555db66b8ac7068",
    "from": "0x3acf9c404fda9a69c559d1e816b9613145e89948",
    "value": 1,
    "hash": "0x21fbb3a548637bec8fdb7ebbe5fa2feaa6302e1872aef76a04de71e3ddb85e96",
    "type": "Token",
    "isSuicide": "none",
    "isInternal": true,
    "traceAddress": 2,
    "input": "0x23b872dd0000000000000000000000003acf9c404fda9a69c559d1e816b9613145e89948000000000000000000000000e0d0c4c35d30baa00a2c93004555db66b8ac706800000000000000000000000000000000000000000000000000000000000f4240"
},..

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

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

etherscanner's People

Contributors

cryptoapi-project avatar kevnz avatar novasanchez avatar

Forkers

vpino

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.