noob-ethereum
Version:
A simple Ethereum library
14 lines (13 loc) • 727 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("../index");
const provider = index_1.Provider.init(process.env.INFURA_URL);
/* Get Ethereum block by number */
provider.getBlockByNumber(15447147, true).then(console.log);
/* Detect for Optimism batch publication from latest block */
provider.getLatestBlock(true).then((res) => {
const sequencer = '0x6887246668a3b87F54DeB3b94Ba47a6f63F32985'.toLowerCase();
const ctc = '0x5E4e65926BA27467555EB562121fac00D24E9dD2'.toLowerCase();
const batchTxs = index_1.Searcher.findTransactionInteraction(res, sequencer, ctc);
console.log(`batch tx hashes (from block ${index_1.utils.decimal(res.number)})`, batchTxs);
});
;