F
F
fantazy5462020-07-31 19:43:44
Python
fantazy546, 2020-07-31 19:43:44

Why does the getBalance method in the web3.py library not work?

Error with balance = web3.eth.getBalance(k) Shortened
as best I could.
web3.py version 5.12.0

import web3
from web3 import Web3
w3 = Web3(Web3.IPCProvider())
balance = web3.eth.getBalance(k)

Traceback (most recent call last):
  File "C:/Users/user/Desktop/storage.py", line 26, in <module>
    class check():
  File "C:/Users/user/Desktop/storage.py", line 54, in check
    balance = web3.eth.getBalance(k)
AttributeError: module 'web3.eth' has no attribute 'getBalance'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Ternick, 2020-07-31
@fantazy546

There is no getBalance method in eth...
Funny... * BUTT *

S
soremix, 2020-07-31
@SoreMix

w3.eth.getBalance(k)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question