xcm-tools icon indicating copy to clipboard operation
xcm-tools copied to clipboard

enhancement(playground): Connect query parameters to routing in XCM (issue-1325)

Open romispectrum opened this issue 1 month ago • 1 comments

🐞 Enchancement Pull Request

📌 Related Issue

Connect query parameters to routing in XCM Closes #1325


🛠️ Description of the Enhancement

  • Enhancement description: All form state with api type selection in now synced to and from the url using query parameters. For more complex objects such as multiple assets for XcmTransferForm was encoded as JSON objects using Base64 encoding to avoid dumping the whole json object to the url, this also makes the currency objects still compatible upon structure change. All form actions are synced to the url on change and the state is read from the url on each page refresh. implemented additional filtering and type checking when reading parameters from the url to avoid incorrect state where it was possible.
  • Possible issue: not supported api types can be selected when api type selection is disabled, should not be a problem as many times this value is not taken into account when the switch is disabled.
  • Isuue: In XcmTransferForm when we select the custom currency option the value is not loaded into text field, although it is correctly decoded from the url. This is probably related to how these forms load initial values. Other fields are fine.

✅ Checklist

  • [x] My code follows the project's code style.
  • [ ] I have added tests that prove my fix is effective (if applicable).
  • [ ] I have updated the documentation where necessary.
  • [x] I have verified the fix does not introduce new issues.

💸 Polkadot Asset Hub Address (for Reward)

Polkadot Asset Hub Address: 14gFEDzneNvzuGWgzaipgRSLAPo14F6DQ5Fmfz2LNBes99TH


🧩 Additional Notes (Optional)

romispectrum avatar Nov 26 '25 02:11 romispectrum

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests.

Flag Coverage Δ
assets 97.34% <ø> (ø)
pallets 100.00% <ø> (ø)
sdk-common 98.90% <ø> (ø)
visualizer-be 99.33% <ø> (ø)
xcm-analyser 96.70% <ø> (ø)
xcm-api 90.74% <ø> (ø)
xcm-router 92.76% <ø> (ø)
xcm-sdk 94.66% <ø> (ø)
xcm-sdk-core 92.75% <ø> (ø)
xcm-sdk-pjs 94.33% <ø> (ø)
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 26 '25 02:11 codecov[bot]

gm @michaeldev5, we made changes based on your feedback, so you can check again

romispectrum avatar Nov 30 '25 04:11 romispectrum

Hi @michaeldev5, thanks for the feedback! I have pushed a fix, which should resolve all the issues.

bartalos86 avatar Dec 01 '25 12:12 bartalos86

Your contribution has been rewarded!

https://assethub-polkadot.subscan.io/tx/0x4155e020d71a4da5d87efe88c7280a21f5a309897450f478b82f8e92b9e7eb6d

Thanks a lot for your help!

With kind regards, Team ParaSpell✨

dudo50 avatar Dec 01 '25 15:12 dudo50