https://eth.blockscout.com/api/v2/transactions/transaction_hash/summary
The Interpreter API is currently in development. This REST API service will provide human-readable information regarding transactions, addresses and more.
How It Works
The Transactions Interpreter Service is designed to process blockchain transactions by extracting and analyzing relevant information to generate a summary of the transaction. The process follows several distinct phases:- Transaction Hash Reception : The service receives a transaction hash, which triggers the processing pipeline.
- Data Retrieval : The service automatically retrieves necessary transaction data from the blockchain using the provided transaction hash.
- Initial Validation : The input data undergoes validation to ensure authenticity and correctness before further processing.
-
Data Processing : The retrieved transaction data is processed, involving multiple phases:
- Pre-LLM Phase : During this phase, the service attempts to classify and interpret the on-chain actions using predefined algorithms. This step includes determining the type of action (e.g., transfer, minting, etc.) based on the transaction data.
- LLM Phase : If the type of action cannot be determined algorithmically in the Pre-LLM phase, the service leverages a Language Learning Model (LLM) to infer the type of on-chain action.
- Transaction Summary Generation : After the classification, the service generates a summary of the transaction, which is returned as the response. The summary includes key details about the transaction and is structured according to a specific template.
Response Structure
The response from the Transactions Interpreter Service is structured as follows (will vary depending on the specific case):Success Response
Response Variable Types
The response from the service can contain the following types of data:-
number
: Numerical values. -
string
: Textual data. -
array
: An array of items. -
currency
: Represents a monetary value. -
token
: Information related to a cryptocurrency or token. -
address
: Blockchain address information. -
timestamp
: A date and time representation. -
domain
: Domain name data. -
code
: Code snippets or encoded data.
Error Handling
If the service encounters an error, it returns a structured error response:- Error Response:
Attributes of the Error Object
-
id
: A unique identifier for the error, used for debugging purposes. -
code
: A code representing the type of error. -
message
: A user-friendly message that can be displayed on the front end. -
error_data
: An array containing details about the invalid parameters.