Command Palette

Search for a command to run...

Назад к скиллам
скилл № 27846

tres-tx-story

Analyze a blockchain transaction by its hash using TRES Finance MCP and generate a visual flow diagram showing all asset movements, followed by a…

БесплатноБез исполняемых скриптов
anthropicsот anthropics★ 4 977 звёзд на GitHub

Установить tres-tx-story в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

TRES Transaction Story

Fetch a transaction by hash from TRES Finance, render a flow diagram of all asset movements, and explain in plain English what happened.

MCP Server

All calls use the TRES Finance MCP server (URL: https://ai.tres.finance/mcp).


Step 1 — Authenticate

Call get_viewer (no arguments) to verify the session.


Step 2 — Fetch the Transaction

Query the transaction using its hash as the identifier:

query GetTransactionByHash($hash: String!, $currency: String) {
  transaction(identifier: $hash, currency: $currency, limit: 1) {
    results {
      id
      identifier
      platform
      timestamp
      success
      decodedFunctionName
      methodId
      fromAddress { identifier displayName isInternal customAccountName }
      toAddress   { identifier displayName isInternal customAccountName }
      contract    { identifier contractName protocols applications }
      classification { activity action functionName }
      ledgerSummary
      applications
      protocols
      internalAccounts { id name }
      children {
        id
        amount
        balanceFactor
        platform
        type
        fiatValue
        nonTaxableType
        isInternalTransfer
        financialActionGroup
        belongsTo { id name identifier }
        sender    { identifier displayName isInternal customAccountName }
        recipient { identifier displayName isInternal customAccountName }
        asset {
          identifier
          symbol: key
          assetClass { id symbol verificationStatus }
        }
      }
    }
  }
}

Variables: { "hash": "<user_provided_hash>", "currency": "usd" }

Fallback: If identifier returns 0 results, retry with identifier_Contains using the last 20 characters of the hash. Hashes on some chains may be stored without the 0x prefix — strip it and retry if still empty.


Step 3 — Parse the Data

From the result, extract:

Field Purpose
identifier The tx hash
platform Blockchain (ETHEREUM, SOLANA, etc.)
timestamp Date/time
success Did it succeed?
decodedFunctionName What smart-contract function was called
fromAddress / toAddress Top-level sender → receiver
contract.contractName Smart contract involved (if any)
classification.activity + .action TRES classification label
children[] Each sub-transaction (individual token movement)

For each child sub-transaction, extract:

  • asset.assetClass.symbol — the token symbol (e.g. ETH, USDC)
  • amount — quantity moved
  • fiatValue — USD equivalent
  • balanceFactor — 1 = inflow, -1 = outflow
  • belongsTo.name — which internal wallet this belongs to
  • sender.identifier / recipient.identifier — counterparties
  • type — GAS, TOKEN_TRANSFER, etc.

Step 4 — Render the Diagram

Use the show_widget tool (Visualizer) to render an HTML widget containing an inline SVG diagram.


PRE-RENDER CHECKLIST — do this before writing a single SVG element

A. Prepare all label strings first

For every arrow label (token amount + symbol), apply these formatting rules:

  1. Format the amount:
    • amount ≥ 1,000,000 → "1.2M" style (1 decimal)
    • amount ≥ 1,000 → "264K" or "12,233" (comma-separated integer)
    • amount ≥ 1 → round to 2 decimal places max
    • amount < 1 → keep up to 4 significant figures (e.g. "0.033")
  2. Truncate the symbol:
    • symbol ≤ 6 chars → use as-is (ETH, USDC, DAI, CRV)
    • symbol 7–10 chars → use as-is only if the full label fits (see step 3)
    • symbol > 10 chars OR contains + OR is a compound LP token → replace with "LP tokens"
  3. Measure the full label: label = amount + " " + symbol. Count characters. Multiply by 7. That's the pixel width.
  4. The available space for a label = the arrow's x-span minus 20px safety margin.
    • Left gap (wallet→contract): x goes from 136 to 248 → span = 112px → max label = 13 chars
    • Right gap (contract→wallet): x goes from 408 to 504 → span = 96px → max label = 11 chars
  5. If label_px_width > available_space, shorten further: abbreviate amount to 1 sig fig, or use symbol-only if still too wide.

B. Count the arrows and calculate SVG height

  • Count non-gas arrows (outflows + inflows). Call this N.
  • Each arrow row occupies 34px of vertical space.
  • Base node centre Y = 50 + (N × 34) / 2 (so arrows fan symmetrically around the node centre).
  • Gas arrow hangs 60px below the bottom of the left wallet circle.
  • SVG height = node_centre_y + node_radius + 80 (gas arrow + label + padding).
  • Minimum SVG height = 230px.

C. Lay out arrow Y positions

  • Space arrows evenly, 34px apart, centred on node_centre_y.
  • First arrow y = node_centre_y - ((N-1) × 34) / 2
  • Each subsequent arrow y += 34
  • Outflow arrows (wallet → contract) use left half of diagram.
  • Inflow arrows (contract → wallet) use right half.
  • If there is exactly 1 inflow and multiple outflows, centre the inflow a
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл tres-tx-story?

Analyze a blockchain transaction by its hash using TRES Finance MCP and generate a visual flow diagram showing all asset movements, followed by a plain-language explanation of what happened. Use this skill whenever the user provides a transaction hash and asks to "analyze", "explain", "visualize", "diagram", "show me what happened in", or "tell the story of" a transaction. Also trigger when the user pastes a tx hash (long hex string starting with 0x) and asks anything about it. Always use this skill for transaction hash analysis — do not attempt to answer from memory alone.

Как установить скилл tres-tx-story?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл tres-tx-story запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить tres-tx-story с