NEAR transaction page: say what calls and events did, in words, instead of JSON #47

Closed
opened 2026-10-07 09:45:06 +00:00 by grenade · 0 comments
Owner

Why

The transaction page from #44 shows every function call's arguments and every event's payload as pretty-printed JSON. That is faithful, but it is not readable. In the bridge mint piPTXyoq…, mt_mint takes eleven lines of brackets to say "credited 0.05 QTC to 42d72e44… (deposit)". The ft_deposit memo, the part that matters most, is JSON escaped inside a JSON string.

Nearly every shape on the page is fixed by a standard:

  • Events name their standard, and it defines their fields:
    • NEP-141: ft_mint, ft_burn, ft_transfer.
    • NEP-245: mt_mint, mt_burn, mt_transfer.
    • dip4: ft_withdraw, transfer, token_diff, intents_executed.
  • Calls: the NEP-141 methods have fixed signatures:
    • ft_transfer, ft_transfer_call, ft_on_transfer, ft_resolve_transfer;
    • storage_deposit;
    • the bridge's ft_deposit on omft.near;
    • execute_intents, whose signed payload lists intents of known kinds.

What

Each call and each event entry gets a sentence: text with typed parts, meaning amounts in token units, accounts (linked when they are Intents accounts), and Quantus transactions and addresses (linked to this site). The bridge's memos become words: "bridged from Quantus tx 0xc4444afc… (block #180,029)", "to Quantus address qz…", "refund".

Fallback rule: a sentence is produced only when the formatter accounts for every field in the payload. Any of the following falls back to the JSON shown today:

  • an unknown method or event;
  • a missing or mistyped field;
  • a field the formatter does not know;
  • a msg in a format nobody wrote a case for (Ref swap instructions, for one).

So a sentence never quietly drops a field. Either it covers the payload, or the reader sees all of it.

Fields left out on purpose, such as signatures, public keys, nonces, deadlines and intent hashes, are listed as accounted for in the formatter, not left unknown. The raw JSON stays one click away behind every sentence, because it is the source.

The formatting is done in blackbeard-core::near_tx, where it can be tested against the captured fixtures. The frontend only renders the parts.

Related: #44.

## Why The transaction page from #44 shows every function call's arguments and every event's payload as pretty-printed JSON. That is faithful, but it is not readable. In the bridge mint `piPTXyoq…`, `mt_mint` takes eleven lines of brackets to say "credited 0.05 QTC to 42d72e44… (deposit)". The `ft_deposit` memo, the part that matters most, is JSON escaped inside a JSON string. Nearly every shape on the page is fixed by a standard: - **Events** name their standard, and it defines their fields: - **NEP-141:** `ft_mint`, `ft_burn`, `ft_transfer`. - **NEP-245:** `mt_mint`, `mt_burn`, `mt_transfer`. - **dip4:** `ft_withdraw`, `transfer`, `token_diff`, `intents_executed`. - **Calls:** the NEP-141 methods have fixed signatures: - `ft_transfer`, `ft_transfer_call`, `ft_on_transfer`, `ft_resolve_transfer`; - `storage_deposit`; - the bridge's `ft_deposit` on `omft.near`; - `execute_intents`, whose signed payload lists intents of known kinds. ## What Each call and each event entry gets a **sentence**: text with typed parts, meaning amounts in token units, accounts (linked when they are Intents accounts), and Quantus transactions and addresses (linked to this site). The bridge's memos become words: "bridged from Quantus tx 0xc4444afc… (block #180,029)", "to Quantus address qz…", "refund". **Fallback rule:** a sentence is produced only when the formatter accounts for **every** field in the payload. Any of the following falls back to the JSON shown today: - an unknown method or event; - a missing or mistyped field; - a field the formatter does not know; - a `msg` in a format nobody wrote a case for (Ref swap instructions, for one). So a sentence never quietly drops a field. Either it covers the payload, or the reader sees all of it. Fields left out on purpose, such as signatures, public keys, nonces, deadlines and intent hashes, are listed as accounted for in the formatter, not left unknown. The raw JSON stays one click away behind every sentence, because it is the source. The formatting is done in `blackbeard-core::near_tx`, where it can be tested against the captured fixtures. The frontend only renders the parts. Related: #44.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blackbeard/observer#47