0

I wanna to check current rpc network is using Flashbot or Infura.

I know can using window.ethereum.networkVersion to get ChainID to check it is Mainnet or Goerli.

But I do not know how to check current rpc network is using Flashbot or Infura.

2 Answers 2

0

Not sure nor can check now but you can have the url of the rpc in some window.ethereumproperties.

0

Try this one:

provider.getNetwork()

It will return the following (as example):

{
    "name": "bnb",
    "chainId": 56,
    "ensAddress": null,
    "_defaultProvider": null
}
1
  • Thanks, I tried web3.currentProvider.getNetwork() but not work, it return me: web3.currentProvider.getNetwork is not a function
    – Moon soon
    Feb 16, 2023 at 0:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.