mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-14 05:14:28 -08:00
deploy: leporello-js/app@a6e3f1b36f
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import {ethers} from 'https://unpkg.com/ethers@5.7.2/dist/ethers.esm.js'
|
||||
import { ethers } from "ethers"
|
||||
|
||||
const URL = 'https://rpc.ankr.com/eth_goerli'
|
||||
const URL = "https://eth-mainnet.public.blastapi.io"
|
||||
|
||||
const p = ethers.getDefaultProvider(URL)
|
||||
|
||||
const latest = await p.getBlock()
|
||||
|
||||
const txs = await Promise.all(latest.transactions.map(t =>
|
||||
p.getTransactionReceipt(t)
|
||||
))
|
||||
const txs = await Promise.all(
|
||||
latest.transactions.map(t => p.getTransactionReceipt(t)),
|
||||
)
|
||||
|
||||
const totalGas = txs
|
||||
.filter(tx => tx != null)
|
||||
.reduce((gas,tx) => gas.add(tx.gasUsed), ethers.BigNumber.from(0))
|
||||
.reduce((gas, tx) => gas.add(tx.gasUsed), ethers.BigNumber.from(0))
|
||||
|
||||
Reference in New Issue
Block a user