Skip to content

fix: harden numeric JSON parsing for int/double payloads#336

Merged
CharlVS merged 1 commit intodevfrom
fix/harden-json-num-casts
Mar 23, 2026
Merged

fix: harden numeric JSON parsing for int/double payloads#336
CharlVS merged 1 commit intodevfrom
fix/harden-json-num-casts

Conversation

@CharlVS
Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS commented Mar 23, 2026

Summary

  • replace fragile as int / as int? JSON casts with num-aware parsing across SDK parsers
  • handle mixed numeric payloads (10 vs 10.0) in RPC, CEX market data, JS wrapper, and build-transformer models
  • prevent runtime type-cast failures like Type 'double' is not a subtype of type 'int?' in type cast

Scope

  • komodo_defi_rpc_methods: rational/history target/trade preimage numeric parsing
  • komodo_defi_types: fee-related model parsing
  • komodo_cex_market_data: Binance + CoinGecko numeric fields
  • komodo_defi_framework: web JS wrapper int return coercion
  • komodo_wallet_build_transformer: GitHub API model numeric fields

Notes

  • no behavior change intended besides robust numeric coercion during deserialization
  • touched files were formatted with dart format

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@CharlVS CharlVS merged commit ead35b0 into dev Mar 23, 2026
2 of 4 checks passed
@CharlVS CharlVS deleted the fix/harden-json-num-casts branch March 23, 2026 17:05
@github-actions
Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit 2ef9a78):

https://komodo-playground--pr336-fix-harden-json-num-aimmbi8m.web.app

(expires Mon, 30 Mar 2026 17:09:12 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2bfedd77fdea45b25ba7c784416e81f177aa5c47

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