Skip to content

[explorer] feat: display transfer messages in transaction details view#2383

Draft
cryptoBeliever wants to merge 3 commits into
devfrom
explorer/feat-display-transfer-messages-with-boolean-isPlain
Draft

[explorer] feat: display transfer messages in transaction details view#2383
cryptoBeliever wants to merge 3 commits into
devfrom
explorer/feat-display-transfer-messages-with-boolean-isPlain

Conversation

@cryptoBeliever

@cryptoBeliever cryptoBeliever commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Display NEM transfer messages correctly in the transaction details view (plain text, hex-prefixed, encrypted).
  • Update tests and fixtures to use numeric message type

Motivation

Transfer message presentation depends on whether a message is plain or encrypted. The REST API exposes type as a numeric; the frontend applies formatting rules:

  • type=1, no fe prefix → decode hex payload to UTF-8
  • type=1, fe prefix → show as HEX: <payload>
  • type=2 → show encrypted payload as-is with a dedicated label

Depends on

  • lightapi PR merged and published

Issue: #2352

SQL migration

BEGIN;

UPDATE transactions
SET payload = jsonb_set(
	payload::jsonb,
	'{message}',
	((payload::jsonb->'message')::jsonb - 'is_plain'::text)
	|| jsonb_build_object('type', (payload::jsonb->'message'->'is_plain')::jsonb),
	true
)
WHERE payload IS NOT NULL
	AND (payload::jsonb ? 'message')
	AND ((payload::jsonb->'message')::jsonb ? 'is_plain')
	AND NOT ((payload::jsonb->'message')::jsonb ? 'type');

-- Remove legacy key when both are present.
UPDATE transactions
SET payload = jsonb_set(
	payload::jsonb,
	'{message}',
	(payload::jsonb->'message')::jsonb - 'is_plain'::text,
	true
)
WHERE payload IS NOT NULL
	AND (payload::jsonb ? 'message')
	AND ((payload::jsonb->'message')::jsonb ? 'is_plain')
	AND ((payload::jsonb->'message')::jsonb ? 'type');

COMMIT;

Add frontend message formatting for plain, hex-prefixed, and encrypted
transfer messages. Update tests and fixtures to use boolean isPlain.
Add frontend message formatting for plain, hex-prefixed, and encrypted
transfer messages. Update tests and fixtures to use boolean isPlain.
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.95%. Comparing base (bbe0fe4) to head (7889a96).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #2383      +/-   ##
==========================================
+ Coverage   95.44%   96.95%   +1.51%     
==========================================
  Files         657      276     -381     
  Lines       51116    21313   -29803     
  Branches     1359      206    -1153     
==========================================
- Hits        48786    20664   -28122     
+ Misses       2282      643    -1639     
+ Partials       48        6      -42     
Flag Coverage Δ
explorer-frontend 94.93% <100.00%> (+0.05%) ⬆️
explorer-puller ?
explorer-rest ?
wallet-mobile-symbol ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
explorer/frontend/api/transactions.js 100.00% <100.00%> (ø)
explorer/frontend/utils/common.js 99.73% <100.00%> (+0.56%) ⬆️

... and 381 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

… field

Update explorer transfer message parsing to use `message.type` from lightapi instead of `isPlain`/`is_plain`, and align puller/rest payload mapping and tests with the new schema.
@cryptoBeliever cryptoBeliever changed the title [explorer] feat: display transfer messages with boolean isPlain [explorer] feat: display transfer messages in transaction details view Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant