L2 Explorer API

The L2 (TrueConnect) Explorer API is designed to provide comprehensive access to all information stored on Layer 2 (L2) blockchain. To facilitate fast and efficient data retrieval, this information will be duplicated in a relational database. The database will store the entire graph of relationships (i.e., who invited whom into the project), associations between names and addresses, as well as the earnings of each user.

The purpose of the L2 Explorer is to offer easy-to-use interfaces (REST API, WebSocket) to retrieve information exclusively built on blockchain data. Below are the specific details of the data model and functionalities provided by the L2 Explorer.

Data Stored in the L2 Explorer

  • Transactions Involving Names:

    • Purchase, Sale, Transfer of Name: The explorer maintains a history of transactions involving the purchase, sale, or transfer of names.

  • Wallet Information:

    • MainWallet and SecondWallet: Stores the main wallet and secondary wallet information.

    • Linking and Unlinking History: Keeps a history of associations and disassociations of the SecondWallet.

  • Token Balances and Transactions:

    • Token Balances: Keeps track of token balances associated with names.

    • Token Transactions: Records the history of token issuance and withdrawal for each name.

    • Referral Name History: Maintains the name that was used as a referral at the time of the initial issuance.

  • Graph of Relationships:

    • Graph Data: The backend stores a constructed graph that shows the relationship between names in all directions and displays this graph clearly.

  • Contract Interactions:

    • External Contract Data: The explorer can query separate contracts to simplify how data from specific services like reputation service, TrustLink service, and TrustDoc service are displayed.

    • Name Visibility: Ensures data linked with names are visible.

Features

  • Wallet Address Information:

    • Name History By Address: Clicking on a wallet address will show all names that have ever been associated with the wallet and the entire transaction history on the main contract.

  • Search Functionality:

    • Explorer Search: The explorer provides a search function that dynamically retrieves the entire interaction history with TNS based on wallet address, name, or transaction.

  • Future Enhancements:

    • Additional Analytics: Additional analytics and associations involving names will be incrementally added to enhance the explorer as it evolves.

Interfaces

  • REST API: Allows fetching data using standard HTTP methods (GET, POST, PUT, DELETE).

  • WebSocket: Provides real-time updates and notifications for specific events or data changes.

Usage and Endpoints

To facilitate developers, detailed API documentation with specifications for each endpoint, including query parameters, request structures, and response formats, will be continuously maintained and updated.

Example Endpoints

  • GET /wallets/{walletId}/names: Retrieve names associated with a specific wallet.

  • GET /names/{nameId}/history: Retrieve transaction history for a specific name.

  • GET /graph/relationships: Fetch the graph depicting relationships among the names.

  • POST /contracts/query: Interact with and fetch data from specified contracts.

Last updated