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★ 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
identifierreturns 0 results, retry withidentifier_Containsusing the last 20 characters of the hash. Hashes on some chains may be stored without the0xprefix — 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 movedfiatValue— USD equivalentbalanceFactor—1= inflow,-1= outflowbelongsTo.name— which internal wallet this belongs tosender.identifier/recipient.identifier— counterpartiestype— 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:
- 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")
- amount ≥ 1,000,000 →
- 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"
- Measure the full label:
label = amount + " " + symbol. Count characters. Multiply by 7. That's the pixel width. - 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
- 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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
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), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…