Trevo Docs
  • Introduction
  • OVERVIEW
    • Architecture
    • Tokenization Engine
    • Compliance Engine
    • Custody
    • Trevo Usage Modes
    • Streamlined Fintech Apps Developement
    • AI Integration
    • Free Transactions
    • Multimodal Token Transfers
    • Official Tokens
    • On-Ramp & Off-Ramp
    • Comprehensive Platform
    • Governance & Upgrades
    • Native Cross-Chain Interoperability
  • USE CASES
    • Introduction
    • Actions with Tokens on Trevo
    • Tokenizing SPVs
    • Tokenizing Bonds
    • Platform for Real Estate Tokenization
    • Lending Platform
    • RWAfi
    • Custom Compliance Provider
  • TREVO PLATFORM
    • Trevo Blockchain
    • Trevo Passport
    • Trevo Token Studio
    • Trevo Wallet
    • Trevo Vault
    • Trevo DataGate
      • DataGate API
      • Data consistency
    • Trevo ActionGate
    • Trevo Blockchain console
  • BLOCKCHAIN REFERENCE
    • Introduction
  • PROTOCOLS
    • Introduction
  • MISC
    • Introduction
Powered by GitBook
On this page
  • Introduction
  • Requests
  • Responses
  • Support for Keyless Addresses
  • Pagination
  1. TREVO PLATFORM
  2. Trevo DataGate

DataGate API

Introduction

DataGate API utilizes HTTP POST methods, handling requests and responses as structured JSON documents. All API endpoints are comprehensively documented, clearly detailing request parameters, response structures, field descriptions, and practical examples.

Requests

API requests are structured as JSON documents containing specific parameters for data selection. DataGate offers extensive flexibility for querying blockchain data:

  • Blockchain Entity Selection: Select records based on specific blockchain entities, such as block indices or transaction hashes.

  • On-Chain Value Filtering: Query records by particular on-chain values. For instance, selecting all token transfers above a certain amount.

Complex and precise blockchain data queries are supported through a range of powerful comparison operators ($eq, $ne, $gt, $gte, $lt, $lte, $in, $nin) and logical operators ($and, $not, $nor, $or). The request syntax closely resembles MongoDB query syntax, ensuring familiarity and ease of adoption. Examples and detailed explanations are provided on the DataGate API portal.

All requests undergo strict JSON validation. If a request contains errors, a 422 HTTP response code is returned, accompanied by a descriptive error message.

Responses

Responses are structured as JSON documents, consistently containing two main sections:

  • data: Holds the query results.

  • metadata: Includes additional context:

    • request_context: Maintains data consistency across multiple API requests. Refer to Data consistency.

    • blockchain_head: Indicates the most recent finalized blockchain block, providing insights into blockchain state.

    • pagination: Offers details for navigating paginated data results. See the Paginationsection below.

Support for Keyless Addresses

Keyless addresses are integral to Trevo's architecture, and DataGate provides comprehensive support for querying these addresses.

Requests can filter by blockchain addresses using keyless address identifiers. Examples include:

  • Match any transactional keyless address controlled by AppAgent 100:

    { "origin": { "app_agent_id": 100, "address_type": "transactional" } }
  • Match transactional keyless addresses within a specific range [1000, 1100] controlled by AppAgent 100:

    { "origin": { "app_agent_id": 100, "ta_id": {"min": 1000, "max": 1100} } }

API responses include detailed information for address fields, such as:

{
    "origin": {
        "address": "ttoRAiFEXDNLZ531FVRnDZmGTfW5Yamt6d8Ce3A8PK6CWJD3b",
        "account_id": "0x6400000002f906000033e4dc5903c8ef6355c8feb9b7cf744197feaf5c62f535",
        "address_type": "transactional",
        "app_agent_id": 100,
        "ta_id": 1785,
        "address_name": null
    }
}

More detailed examples are available on the DataGate API portal.

Pagination

Responses containing extensive records are automatically paginated. Each paginated response includes a metadata.pagination object:

{ "current_page": 0, "next_page_id": "6e582484-1c78-4dcd-984a-2037cfe48084" }

To retrieve subsequent pages, submit additional requests using the provided next_page_id:

{ "page_id": "6e582484-1c78-4dcd-984a-2037cfe48084" }
PreviousTrevo DataGateNextData consistency

Last updated 2 months ago