1.9.2 • Published 1 year ago

txpool-explorer v1.9.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

txpool-explorer

Nodejs Ethereum transactions pool explorer.

Installation

Install txpool-explorer with npm

  npm install txpool-explorer

Before Starting

Make sure to whitelist the txpool namespace as described in the Official Go implementation of the Ethereum protocol .

geth --ws --ws.api eth,net,web3,txpool

Getting Started

 import TxpoolExplorer, { Transaction } from "txpool-explorer";

 const host : string = 'http://127.0.0.1:8546' // Provider Websocket Endpoint 

 const explorer = new TxpoolExplorer({ host });

API Reference

Get Transaction Pool Content :

  console.log(await explorer.getPoolContent());

Returns :

Promise<{pending:Transaction[];queued:Transaction[];}>

Subscribe to the transactions pool updates :

  let pool: "pending" | "queued" = "pending";
  let filter = (transaction: Transaction) => transaction.to == "0x7D0556D55ca1a92708681e2e231733EBd922597D";
  
  explorer.watch({ pool, filter }, (transactions: Transaction[]) => {
    console.log(transactions);
  });

Parameters

ParameterTypeDescription
poolstringRequired. "pending" or "queued"
filter(transaction: Transaction) => booleanOptional. Filter callback called with the argument transaction of type Transaction
1.9.1

1 year ago

1.9.2

1 year ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago