Skip to content

fix: skip unrecognized chains/currencies instead of throwing#152

Merged
badjer merged 1 commit intomainfrom
fix/lenient-chain-validation
Apr 7, 2026
Merged

fix: skip unrecognized chains/currencies instead of throwing#152
badjer merged 1 commit intomainfrom
fix/lenient-chain-validation

Conversation

@badjer
Copy link
Copy Markdown
Contributor

@badjer badjer commented Apr 7, 2026

Summary

  • ATXPDestinationMaker.parseDestinationsResponse now skips destinations with unrecognized chains or currencies instead of throwing
  • Logs a warning for each skipped destination so issues are visible without crashing
  • Ensures server-side chain additions (e.g. tempo) don't break older deployed SDK clients

Context

Adding tempo to the accounts service caused atxp-music (and potentially other services) to crash because the deployed SDK version didn't recognize the chain and threw:

Error: Invalid destination at index 5: chain "tempo" is not a valid chain.

This is a forward-compatibility fix — the SDK should gracefully handle chains it doesn't know about yet.

Test plan

  • New test: skips unrecognized chains, returns only valid ones, logs warning
  • New test: skips unrecognized currencies, returns only valid ones, logs warning
  • New test: still throws on malformed objects (missing fields)
  • New test: still throws on invalid amounts
  • New test: still throws on invalid response structure
  • New test: handles all destinations unrecognized gracefully (empty result)
  • New test: valid destinations parse correctly
  • New test: non-atxp network returns empty without fetching
  • Full atxp-client suite passes (208 tests)

🤖 Generated with Claude Code

ATXPDestinationMaker.parseDestinationsResponse now filters out
destinations with chains or currencies this SDK version doesn't
recognize, instead of throwing. This ensures server-side chain
additions don't break older SDK clients.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@badjer badjer merged commit ee00c69 into main Apr 7, 2026
1 check passed
@badjer badjer deleted the fix/lenient-chain-validation branch April 7, 2026 20:42
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