Report

Simple Data Toolkit - Tutorial - Ethereum via Etherscan - Python

November 07, 2023 at 6:54 PM PST
This post has no media.
Profile picture
Franklin Powers

Simple Data Toolkit provides an unofficial API for reading Ethereum transactions from the Etherscan API. (At the time of this writing, the release of this is pending for complete support, but it is coming soon)

To retrieve all Ethereum transactions for a particular address we can do the following:


from sdtk import com_sdtk_api_EtherscanAPI

def printer(data, reader):
print(reader.toArrayOfNativeMaps(None))

com_sdtk_api_EtherscanAPI.transactionsAPI().retrieveData({"address": "0xAddress"}, printer)


Replace 0xAddress with the address you wish to search on.

Additionally, we can convert the transactions to our standard internal event interface like so:


from sdtk import com_sdtk_api_EtherscanAPI,com_sdtk_calendar_EtherscanFormat

def printerEvents(data, reader):
etherScan = com_sdtk_calendar_EtherscanFormat.instance()
for event in reader.toArrayOfNativeMaps(None):
ci = etherScan.read(event)
print(ci.start.toString())

com_sdtk_api_EtherscanAPI.transactionsAPI().retrieveData({"address": "0xAddress"}, printerEvents)


Replace 0xAddress with the address you wish to search on.

Any thoughts on Franklin's post?

To comment or reply, you need an Ortingo account.

Sign in or sign up

Here's what Ortingoers think of Franklin's post.

There are no comments on this post.