Introducing Decoder API: Open-Source REST API server to Decode EVM Transactions
The Decoder API is a simple, open-source REST API server designed to decode any EVM transaction into a human-readable format.
How Does It Work?
The service offers two main API endpoints:
Decoding Endpoint -
/decode/:chain/:hash
This endpoint provides detailed information about a transaction, including:
Decoded transaction data
Event logs and transaction traces
Error messages, if any
Additional context such as token transfers and metadata for all addresses involved in the transaction
Interpreting Endpoint -
/interpret/:chain/:hash
This endpoint translates the decoded transaction into a more accessible, human-readable format.
Example Transactions
Here’s an example of a decoded and interpreted transaction from the Blur NFT marketplace:
Note: The live version of the Decoder API (available at decoder-api.3loop.io) currently supports Ethereum Mainnet transactions. It is available for demonstration purposes only and is not equipped to handle high traffic.
Key Features of Decoder API
Open-source: The Decoder API is fully open-source, customizable, and does not rely on proprietary services for the decoding.
Minimal external dependencies: Only requires an RPC URL and an SQLite database for caching. If the database is empty, public contract data can be resolved using external APIs by providing them as strategies. See supported strategies in the Loop Decoder documentation.
Swagger Interface: Provides an OPEN API interface at
/swagger
for easy interaction with the service.SQLite database with popular contracts: Includes metadata and ABIs for widely used contracts on Ethereum. Contact us on X for a database file.
OpenTelemetry: Built-in support for monitoring and observability.
Ready for deployment: Can be easily deployed to platforms like Fly.io.
Getting Started
Clone the repository from GitHub: Decoder API Repository
Set the required
.env
variables.Follow the instructions in the README to run the project.
Deploy the API, for instance, using the
fly deploy
command on Fly.io.
Links
Live Demo decoder-api.3loop.io
Swagger decoder-api.3loop.io/swagger and request example
Looking for Feedback
We are constantly improving our libraries and open-source tools for decoding EVM transactions. If you have any feedback, please reach us out. Explore our GitHub repositories and if you found it useful, give us a star on GitHub and follow us on X for updates.