fix(sdk-coin-flr): auto-detect atomic export txs in explainTransaction#9112
Merged
ArunBala-Bitgo merged 1 commit intoJun 25, 2026
Merged
Conversation
When the FLR wallet platform calls explainTransaction for a cross-chain export without setting crossChainType, the method falls through to the EVM explain path which cannot parse atomic transaction hex, causing the recipient P-chain address to be missing from the result. Avalanche/Flare atomic transactions are identified by their codec prefix (0x00000000). Add auto-detection: if the tx hex starts with '0000' (after stripping any 0x prefix), route to explainAtomicTransaction even when crossChainType is not supplied. This ensures the P-chain recipient address always appears in outputs[0].address for export transactions, regardless of whether the caller sets crossChainType explicitly. Add regression tests in both sdk-coin-flr and sdk-coin-flrp that verify outputs[0].address is non-empty for C-chain export transactions. Ticket: CECHO-1445 Session-Id: 9552a57f-ade5-43df-b67b-d19aa62e6e32 Task-Id: 1785a314-e5c6-4b30-b86e-46e56c9206ed
2de4b27 to
d3a368a
Compare
ArunBala-Bitgo
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Flr.explainTransaction, auto-detect Avalanche/Flare atomic transactions by their codec prefix (0x00000000) and route them toexplainAtomicTransactioneven whencrossChainTypeis not explicitly set by the caller.sdk-coin-flrverifying that explaining an atomic export tx withoutcrossChainTypereturns the P-chain recipient address.sdk-coin-flrpverifying thatexplainTransactionon a C-chain export returns a non-empty P-chain recipient address inoutputs[0].address.Why
explainTransactionon the FLR coin for a cross-chain export transaction without passingcrossChainType, the method falls through to the EVM explain path. The EVMTransactionBuildercannot parse atomic transaction hex and fails, leaving the P-chain recipient address missing from the explain result. The UI then displays a blank "Recipient address" field.0000) that distinguishes them from EVM RLP-encoded transactions (which start withf8). Using this prefix for auto-detection makes the routing robust regardless of whether the caller setscrossChainType.Test plan
sdk-coin-flrunit tests: 61 passing — new test confirmsoutputs[0].addressis set to the P-chain destination when explaining an atomic export withoutcrossChainType.sdk-coin-flrpunit tests: 361 passing — new test confirmsoutputs[0].addressis non-empty and P-chain-prefixed for a C-chain export explain.Ticket: CECHO-1445