mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
record io
This commit is contained in:
@@ -3,12 +3,29 @@ import {ethers} from 'https://unpkg.com/ethers/dist/ethers.esm.js'
|
||||
const URL = 'https://ethereum-goerli-rpc.allthatnode.com'
|
||||
|
||||
const p = ethers.getDefaultProvider(URL)
|
||||
await p._networkPromise
|
||||
|
||||
const latest = await p.getBlock()
|
||||
latest
|
||||
|
||||
|
||||
const txs = await Promise.all(latest.transactions.map(t =>
|
||||
p.getTransactionReceipt(t)
|
||||
))
|
||||
|
||||
|
||||
|
||||
const totalGas = txs.reduce((gas,tx) =>
|
||||
gas.add(tx.gasUsed), ethers.BigNumber.from(0))
|
||||
|
||||
totalGas.add(25)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user