fix(swaps): accept single import payloads#3491
Draft
CharlVS wants to merge 1 commit into
Draft
Conversation
|
Visit the preview URL for this PR (updated for commit 8fc00ba): https://walletrc--pull-3491-merge-hpfs2zm4.web.app (expires Fri, 19 Jun 2026 19:06:39 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
cipig
reviewed
Jun 12, 2026
| if (decoded.containsKey('result')) { | ||
| final dynamic result = decoded['result']; | ||
| if (result is Map) { | ||
| final dynamic swaps = result['swaps']; |
Collaborator
There was a problem hiding this comment.
isn't this called "swap" and not "swaps"?
in my output from https://komodoplatform.com/en/docs/komodo-defi-framework/api/v20/swaps_and_orders/recreate_swap_data/ it was called "swap"... it was just one swap though, but i assume that it's a list of "swap"s
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.
Summary
import_swapsRPC.{"swap": {...}},{"swaps": [...]}, and{"result": {"swaps": [...]}}.Root cause
Single-swap export can produce a
my_swap_statusresponse shaped as{"swap": {...}}, while the import screen previously cast pasted JSON directly toList, causing a raw Dart type error before the RPC call.Validation
dart format lib/views/settings/widgets/general_settings/import_swaps.dartgit diff --check -- lib/views/settings/widgets/general_settings/import_swaps.dartflutter analyze --no-pub lib/views/settings/widgets/general_settings/import_swaps.dartFull repository
flutter analyzewas attempted earlier and is still blocked by existing generated/build and SDK analysis issues unrelated to this change.