Skip to content
TRES Finance Help Center home
TRES Finance Help Center home

API-Based Stateless Transaction

Stateless Transaction Lookup API

Query any on-chain transaction by its hash — without persisting anything to the database. The API fetches the transaction directly from the blockchain RPC, parses it into a structured format with sub-transactions, balance changes, and enriched asset metadata, and returns it in a single GraphQL call.

GraphQL Endpoint

POST /graphql

Query

query GetStatelessTransaction($txHash: String!, $platform: Platform!) { getStatelessTransaction(txHash: $txHash, platform: $platform) { identifier platform fromAddress toAddress blockNumber timestamp success methodId decodedFunctionName subTransactions { typeId sender recipient assetIdentifier asset { identifier symbol name decimals } amount type balanceFactor timestamp } balanceChanges { account assetIdentifier asset { identifier symbol name decimals } balanceBefore balanceAfter diff } } }

Variables

Variable

Type

Required

Description

txHash

String

Yes

The transaction hash (e.g. 0x1a2c...206030)

platform

Platform

Yes

The blockchain network enum (e.g. ETHEREUM, POLYGON)

Example Request

{ "query": "query($txHash: String!, $platform: Platform!) { getStatelessTransaction(txHash: $txHash, platform: $platform) { identifier platform fromAddress toAddress blockNumber timestamp success methodId decodedFunctionName subTransactions { typeId sender recipient assetIdentifier asset { identifier symbol name decimals } amount type balanceFactor } balanceChanges { account assetIdentifier asset { identifier symbol name decimals } balanceBefore balanceAfter diff } } }", "variables": { "txHash": "0x1a2c1d615f1812def157f57cbe2a050ea0b610d60b27bad0ea60e3e47d206030", "platform": "ETHEREUM" } }

Example Response

{ "data": { "getStatelessTransaction": { "identifier": "0x1a2c1d615f1812def157f57cbe2a050ea0b610d60b27bad0ea60e3e47d206030", "platform": "ETHEREUM", "fromAddress": "0xabc...123", "toAddress": "0xdef...456", "blockNumber": 18500000, "timestamp": "2024-10-28T12:34:56+00:00", "success": true, "methodId": "0xa9059cbb", "decodedFunctionName": "transfer", "subTransactions": [ { "typeId": "log_0", "sender": "0xabc...123", "recipient": "0xdef...456", "assetIdentifier": "0xdac17f958d2ee523a2206206994597c13d831ec7", "asset": { "identifier": "0xdac17f958d2ee523a2206206994597c13d831ec7", "symbol": "USDT", "name": "Tether USD", "decimals": 6 }, "amount": "1000.50", "type": "TOKEN_TRANSFER", "balanceFactor": -1 }, { "typeId": "gas", "sender": "0xabc...123", "recipient": "0x0000000000000000000000000000000000000000", "assetIdentifier": "native", "asset": { "identifier": "native", "symbol": "ETH", "name": null, "decimals": 18 }, "amount": "0.002145", "type": "GAS", "balanceFactor": -1 } ], "balanceChanges": [ { "account": "0xabc...123", "assetIdentifier": "0xdac17f958d2ee523a2206206994597c13d831ec7", "asset": { "identifier": "0xdac17f958d2ee523a2206206994597c13d831ec7", "symbol": "USDT", "name": "Tether USD", "decimals": 6 }, "balanceBefore": "5000.00", "balanceAfter": "3999.50", "diff": "-1000.50" } ] } } }

Response Fields

Transaction (top level)

Field

Type

Description

identifier

String

The transaction hash

platform

String

The blockchain network

fromAddress

String

Transaction sender address

toAddress

String

Transaction recipient / contract address

blockNumber

Int

Block number the transaction was included in

timestamp

DateTime

Block timestamp (UTC)

success

Boolean

Whether the transaction succeeded (reverted = false)

methodId

String?

First 4 bytes of the input data (e.g. 0xa9059cbb). null for simple ETH transfers

decodedFunctionName

String?

Human-readable function name (e.g. transfer, swap). Resolved from the contract ABI or a signature database. null if unknown

subTransactions

[SubTransaction]

Parsed value movements within the transaction

balanceChanges

[BalanceChange]

On-chain balance snapshots before and after the transaction

SubTransaction

Each sub-transaction represents a single value movement (native transfer, token transfer, or gas fee).

Field

Type

Description

typeId

String

Identifier: basic (native transfer), gas, or log_N (Nth log event)

sender

String

Address sending the value

recipient

String

Address receiving the value

assetIdentifier

String

native for the chain's native currency, or the token contract address

asset

AssetInfo?

Enriched asset metadata (see below)

amount

Decimal

Transfer amount, adjusted by decimals (human-readable units)

type

String

One of: NATIVE_TRANSFER, TOKEN_TRANSFER, GAS

balanceFactor

Int

-1 (outflow) or 1 (inflow), relative to the transaction sender

BalanceChange

Shows the on-chain balance of each account+asset pair immediately before and after the transaction.

Field

Type

Description

account

String

Wallet address

assetIdentifier

String

native or token contract address

asset

AssetInfo?

Enriched asset metadata

balanceBefore

Decimal

Balance at blockNumber - 1 (raw, not decimal-adjusted)

balanceAfter

Decimal

Balance at blockNumber (raw, not decimal-adjusted)

diff

Decimal

balanceAfter - balanceBefore

AssetInfo

Field

Type

Description

identifier

String

native or token contract address

symbol

String?

Token symbol (e.g. USDT, ETH). null if not found in our database

name

String?

Token name (e.g. Tether USD). null if not found

decimals

Int

Token decimals (fetched from DB, or from RPC if unavailable)

Supported Networks

All EVM-compatible blockchains are supported. Pass the network name as the platform variable.

Network

Platform Value

Network

Platform Value

Ethereum

ETHEREUM

Polygon

POLYGON

Arbitrum

ARBITRUM

Optimism

OPTIMISM

Base

BASE

Avalanche C-Chain

AVAX

BNB Smart Chain

BINANCE

zkSync Era

ZKSYNC_ERA

Linea

LINEA

Scroll

SCROLL

Fantom

FANTOM

Gnosis Chain

GNOSIS_CHAIN

Cronos

CRONOS

Celo

CELO

Moonbeam

MOONBEAM

Mantle

MANTLE

Blast

BLAST

Mode

MODE

Manta Pacific

MANTA_PACIFIC

Polygon zkEVM

ZK_EVM

Ronin

RONIN

Sonic

SONIC

Berachain

BERACHAIN

Unichain

UNICHAIN

Story

STORY

World Chain

WORLD_CHAIN

Soneium

SONEIUM

Fraxtal

FRAXTAL

Flare

FLARE

Kaia

KAIA

Immutable zkEVM

IMMUTABLE_ZKEVM

Ink

INK

Abstract

ABSTRACT

Hyperliquid

HYPERLIQUID

The full list includes 100+ EVM networks. Any chain listed under the Platform enum with EVM support will work. If a network is missing, contact us.

How It Works

  1. Fetch — The transaction and its receipt are fetched from the chain's RPC node.

  2. Parse — Native transfers, ERC-20 token transfers (from event logs), and gas fees are extracted into sub-transactions.

  3. Balance snapshots — For each account+asset involved, the on-chain balance is queried at blockNumber - 1 (before) and blockNumber (after).

  4. Asset enrichment — Each asset is enriched with symbol, name, and decimals from our database. If an asset is unknown, decimals are fetched directly from the token contract's RPC.

  5. Function decoding — The method ID is resolved to a human-readable function name using the contract's ABI (if available) or a signature database.

Limitations

Limitation

Details

EVM only

Non-EVM chains (Solana, Bitcoin, Cosmos, Substrate, etc.) are not yet supported.

Read-only

The transaction is not persisted to the database. Each call fetches fresh data from the RPC.

No internal transactions

Internal (trace-level) calls are not parsed. Only top-level native transfers and ERC-20/ERC-721 Transfer events from logs are included.

Balance changes depend on the onchain service

If the onchain balance service is unavailable or the token is not indexed, balanceChanges may be empty.

Balance changes are raw values

balanceBefore, balanceAfter, and diff are returned as raw blockchain values (not divided by decimals). Use the asset.decimals field to convert to human-readable amounts.

Asset metadata may be partial

If a token is not in our database, symbol and name will be null. Decimals will still be fetched from the RPC.

decodedFunctionName may be null

Function decoding relies on known contract ABIs and a signature database. Uncommon or custom functions may not be decoded.

Timeout

The query has a 100-second timeout. Complex transactions with many balance-change lookups may approach this limit.

Authentication required

A valid JWT Bearer token is required in the Authorization header.

Error Handling

Scenario

Response

Invalid or non-existent tx hash

getStatelessTransaction returns null

Unsupported platform (non-EVM)

getStatelessTransaction returns null

RPC unreachable or rate-limited

getStatelessTransaction returns null

Timeout (>100s)

getStatelessTransaction returns null

Missing auth token

HTTP 401 with {"errors": [{"message": "Authentication required"}]}

All errors are logged server-side. If you consistently get null for a valid transaction, contact support.

Testing with cURL

curl -X POST https://<your-bff-host>/graphql \\\\ -H "Content-Type: application/json" \\\\ -H "Authorization: Bearer <your-jwt-token>" \\\\ -d '{ "query": "query($txHash: String!, $platform: Platform!) { getStatelessTransaction(txHash: $txHash, platform: $platform) { identifier platform fromAddress toAddress blockNumber timestamp success methodId decodedFunctionName subTransactions { typeId sender recipient assetIdentifier asset { identifier symbol name decimals } amount type balanceFactor } balanceChanges { account assetIdentifier asset { identifier symbol name decimals } balanceBefore balanceAfter diff } } }", "variables": { "txHash": "0x1a2c1d615f1812def157f57cbe2a050ea0b610d60b27bad0ea60e3e47d206030", "platform": "ETHEREUM" } }'

Testing with Postman

  1. Set the request to POST https://<your-bff-host>/graphql

  2. Under Headers, add:

    • Content-Type: application/json

    • Authorization: Bearer <your-jwt-token>

  3. Under Body (raw JSON), paste the query and variables from the example above

  4. Click Send

Testing with GraphiQL

If you have access to the BFF's GraphiQL interface (/graphql in a browser), you can paste the query directly and provide the variables in the Variables panel. Note that GraphiQL requests from localhost may bypass authentication for introspection, but the actual query still requires a valid token in the Authorization header.