Repository navigation
feat(history): show muxed contract (W) destinations - #3049
Conversation
|
PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-470f9a1bc2e02a4eb057 |
ad4774f to
f3cfc7c
Compare
a9ee912 to
6d03ec6
Compare
The mux-id rebuild is keyed on W only, and a test pins that (pre-existing for M)Low — not a regression and not a merge blocker. A question about scope, plus one test I'd change. TL;DR: Horizon reports a SAC transfer to any muxed destination the same way: the bare base address in Detailed explanation (for agents)Horizon shape: The guard: The test that pins it: Where M-via-SAC comes from: not Freighter's own send flow (XLM or a classic asset to an M goes classic). It comes from a dApp or another wallet invoking the SAC Suggested fix: branch on the base type. |
One malformed mux id takes down the whole history loadMedium — the failure mode is "no history at all", the same class the soroban.ts change in this PR is guarding against. Merge blocker only if the backend-v2 history path can feed this code; otherwise a cheap guard. TL;DR: The SDK's muxed-contract encoder throws on any id that is not a decimal string of at most 22 digits, and the call is not wrapped. If a balance change ever carries an id as a JSON number, an empty string, or anything non-numeric, the throw escapes section building and the whole fetch fails. One bad record should degrade to showing the bare address, not blank the tab. Steps to reproduce:
Detailed explanation (for agents)The unguarded call: What the SDK enforces ( Suggested fixes (in increasing order of depth):
Whichever guard lands should also cover the account-base branch if the previous comment's fix is taken. |
The new catch hides fee-bumped Soroban ops instead of decoding them (pre-existing break)Medium — before this PR a fee-bumped Soroban transfer broke the whole history load; after it, the same record is silently misrendered and reported to Sentry on every load. Not a merge blocker, but the real fix is a known three-line unwrap, so I'd take it here. TL;DR: The envelope decoder returns a fee-bump transaction for fee-bump envelopes, and that object has no operations list. The code indexes the first operation directly, so it throws. That throw used to fail the entire history fetch. With the new catch it returns nothing, so a fee-bumped token transfer shows as a generic contract interaction instead of Sent or Received, drops out of the asset's history, and fires a Sentry event. The background already has the correct unwrap for this exact case. Steps to reproduce:
Detailed explanation (for agents)The decode and index: freighter/extension/src/popup/helpers/soroban.ts Lines 477 to 493 in 6d03ec6
The existing unwrap to reuse: freighter/extension/src/background/helpers/transactionInfo.ts Lines 19 to 29 in 6d03ec6 Two related things worth tightening while here:
Suggested fix: unwrap with |
|
Addressed all three. M rebuild: good catch. Now branches on the base: contract → W, account → M via Bad mux id: fixed. The encode is wrapped, falls back to the base address and reports to Sentry with the op id as extra. Fee bump: @piyalbasu I checked this one. |
dec3f32 to
14d176a
Compare
What
History shows a SAC transfer to a muxed contract (
W…) address as sent to thatWaddress. Before this, the row and the transaction detail showed the bareC.AssetBalanceChangegains the optionaldestination_muxed_idfield, matching the SDK's HorizonBalanceChangetype.processAssetBalanceChangesrebuilds theWwithencodeMuxedContractAddressfor the displayed counterparty. Matching the user's own balance changes stays on the baseC, so a smart wallet still sees its credits.To WA7Q…AWWCand no memo row, the same way anMdestination is shown today.getAttrsFromSorobanHorizonOpcatches decode errors and returnsnull. One undecodable envelope no longer breaks the whole history load.Why
Closes stellar/wallet-eng-monorepo#106.
Screenshots / video
These are generated from e2e stub, since testnet is on protocol 29 and no W transfer exists on chain, I can't take screenshots on a real network.
Checklist