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!