Hello, thanks for your help. Iâm trying to get the confirmation status for transactions in python and Iâm not sure which endpoint to use. I tried the /{address} endpoint while calling âreceipt_statusâ and it doesnât work. Bscscan api works but it keeps confirming failed transactions as though they were successful. Idk if Iâm missing something hereâŚpls advise⌠code and error below.
Code:
txHash = "Insert any txn hash"
chain = "bsc"
checkStatus = 'https://deep-index.moralis.io/api/v2/' + txHash + '?chain=' + chain
statusResponse = requests.request("GET", checkStatus, headers=config.moralisAPI)
txStatus = statusResponse.json()['result']['receipt_status']
print(txStatus) ```
Error:
C:/Users/Owner/Documents/BlockchainPy/Scripts/python.exe c:/Users/Owner/Documents/BlockchainPy/MyCodes/scratchTest.py
Traceback (most recent call last):
File âc:/Users/Owner/Documents/BlockchainPy/MyCodes/scratchTest.pyâ, line 27, in
statusResponse = requests.request(âGETâ, checkStatus, headers=config.moralisAPI)
File âC:\Users\Owner\Documents\BlockchainPy\lib\site-packages\requests\api.pyâ, line 61, in request
return session.request(method=method, url=url, **kwargs)
File âC:\Users\Owner\Documents\BlockchainPy\lib\site-packages\requests\sessions.pyâ, line 528, in request
prep = self.prepare_request(req)
File âC:\Users\Owner\Documents\BlockchainPy\lib\site-packages\requests\sessions.pyâ, line 456, in prepare_request
p.prepare(
File âC:\Users\Owner\Documents\BlockchainPy\lib\site-packages\requests\models.pyâ, line 317, in prepare
self.prepare_headers(headers)
File âC:\Users\Owner\Documents\BlockchainPy\lib\site-packages\requests\models.pyâ, line 449, in prepare_headers
for header in headers.items():
AttributeError: âsetâ object has no attribute âitemsâ
(BlockchainPy)```
Thanks in advance!