Skip to content

chore(release): komodo_defi_sdk v0.5.0 - TRON/TRC20, SIA, and runtime hardening#337

Merged
CharlVS merged 33 commits intomainfrom
dev
Apr 1, 2026
Merged

chore(release): komodo_defi_sdk v0.5.0 - TRON/TRC20, SIA, and runtime hardening#337
CharlVS merged 33 commits intomainfrom
dev

Conversation

@CharlVS
Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS commented Mar 23, 2026

Release Overview

This PR is the release candidate merge from dev into main for the current SDK release line.

This cycle is anchored by the SDK/runtime work that landed in #262, then layered with new protocol support, higher-level SDK APIs, KDF/framework upgrades, and a broad round of web/startup/auth hardening. The result is a materially stronger SDK stack with new asset coverage, better streaming behavior, and cleaner package boundaries for the next public release.

Major Changes

RPC, caching, and streaming foundations

  • Introduce the breaking RPC/runtime refactor from #262 across the core SDK stack, minimizing RPC usage and adding comprehensive caching and streaming support.
  • Gate enable_* calls on a real SSE first-byte event so stream registration no longer races KDF startup (#332).
  • Preserve last-known spot prices across cache rotation for better live-price continuity (#335).
  • Harden numeric JSON parsing for num / int compatibility in minified and mixed-runtime paths (#336).

New protocol and asset support

  • Add TRON and TRC20 support across config, activation, routing, storage handling, and withdrawals (#316).
  • Add SIA activation and withdrawal support (#320).
  • Add token safety checks, fee helpers, custom-token cleanup hooks, and custom-token coin-config support (#319, #321, #225).
  • Add ETH-BASE and derived-asset support (#254).

SDK and platform hardening

  • Add typed error plumbing, trading-stream foundations, and activation / withdrawal refactoring (#312).
  • Add higher-level asset, balance, and transaction manager interfaces (#314).
  • Fix WASM-safe SDK interop and JS bindings for web builds (#313, #315).
  • Fix startup fallback handling for seed error 6133 and invalid configs (#318).
  • Add mutex-protected atomic auth metadata updates (#328).

Framework, tooling, and build pipeline

  • Upgrade the bundled KDF / framework inputs for the 3.0.0-beta preview and latest bundled coins roll (#317, #331).
  • Refresh the build-transform pipeline and GitHub asset download plumbing for the current SDK generation flow.
  • Keep zcash params aligned to official z.cash sources and normalize build-source inputs (#301).

Published Packages

Breaking package releases

  • komodo_cex_market_data v0.1.0
  • komodo_coin_updates v2.0.0
  • komodo_defi_framework v0.4.0
  • komodo_defi_local_auth v0.4.0
  • komodo_defi_rpc_methods v0.4.0
  • komodo_defi_sdk v0.5.0
  • komodo_defi_types v0.4.0
  • komodo_wallet_cli v0.5.0

Other package releases

  • dragon_charts_flutter v0.1.1-dev.4
  • dragon_logs v2.0.1
  • komodo_coins v0.3.2
  • komodo_ui v0.3.1
  • komodo_wallet_build_transformer v0.4.1

Changelog Highlights

Core SDK stack

  • komodo_defi_sdk v0.5.0

    • Adds SIA activation and withdrawal support.
    • Adds token safety checks, fee helpers, asset / balance / tx manager interfaces, and typed error + trading manager foundations.
    • Fixes streaming readiness, duplicate withdrawal paths, custom-token cleanup exposure, zcash build inputs, and spot-price cache retention.
    • Carries the breaking RPC caching / streaming changes from #262.
  • komodo_defi_framework v0.4.0

    • Upgrades bundled KDF / coins references for the 3.0.0-beta preview.
    • Fixes SSE readiness gating, auth metadata updates, startup config fallback, and WASM-safe SDK interop.
    • Carries the breaking RPC/runtime changes from #262.
  • komodo_defi_rpc_methods v0.4.0

    • Adds richer MM2 exception models, expanded wallet / message-signing shapes, and TRON / TRC20 RPC support.
    • Carries the breaking RPC/runtime changes from #262.
  • komodo_defi_types v0.4.0

    • Fixes JSON traversal with reified generics for WASM / minified builds.
    • Carries the breaking RPC/runtime changes from #262.
  • komodo_defi_local_auth v0.4.0

    • Adds test coverage for metadata updates and fixes atomic auth writes.
    • Carries the breaking RPC/runtime changes from #262.

Coins and market data

  • komodo_coin_updates v2.0.0

    • Adds TRON / TRC20-aware config and storage handling.
    • Adds token-safety helper support and keeps startup/config parsing resilient.
    • Carries the breaking RPC/runtime changes from #262.
  • komodo_cex_market_data v0.1.0

    • Adds CoinPaprika as a fallback provider.
    • Carries the breaking RPC/runtime changes from #262.
  • komodo_coins v0.3.2

    • Adds custom-token coin-config support.
    • Reduces market-metrics log noise.

UI and build tooling

  • komodo_ui v0.3.1

    • Detects asset icon precache failures.
    • Brings TRON / TRC20 support and typed-error / trading-stream foundations into the UI layer.
  • komodo_wallet_build_transformer v0.4.1

    • Refreshes GitHub asset downloading and typed build-transform plumbing.
    • Renames the transformer marker to assets/transformer_invoker.txt and aligns source inputs.
  • dragon_logs v2.0.1

    • Improves WASM JS interop bindings.
  • dragon_charts_flutter v0.1.1-dev.4

    • Adds a configurable sparkline baseline.

Changelog

  • CHANGELOG.md contains the full package-by-package release notes for 2026-03-23 and should be treated as the authoritative release record for this PR.
  • Compare: main...dev

Validation

  • Repo-level flutter analyze packages --no-pub is not green in this checkout because package tests reference missing dev-only dependencies such as mocktail, and several packages include external very_good_analysis files that are not present here.
  • Scoped library analysis across the published packages completed with 0 errors, 28 warnings, and 60 infos using:
    • flutter analyze packages/dragon_charts_flutter/lib packages/dragon_logs/lib packages/komodo_cex_market_data/lib packages/komodo_coin_updates/lib packages/komodo_coins/lib packages/komodo_defi_framework/lib packages/komodo_defi_local_auth/lib packages/komodo_defi_rpc_methods/lib packages/komodo_defi_sdk/lib packages/komodo_defi_types/lib packages/komodo_ui/lib packages/komodo_wallet_build_transformer/lib --no-pub

Consumer Coordination

  • The currently opened wallet app RC GLEECBTC/gleec-wallet#3461 pins SDK commit b5626fdc1d507172a8b37e79d6120423343ff6af, which includes this release line through #334.
  • This SDK PR's current dev head also includes #335 and #336, so those two fixes are present here but are not yet rolled into the app submodule.

Review Focus

  • Breaking API and behavioral changes from #262 across the SDK stack.
  • TRON / TRC20 and SIA activation / withdrawal flows.
  • Web / WASM compatibility and SSE connection readiness.
  • Build-transformer and framework asset-resolution behavior for packaged binaries.

Diff Snapshot

  • 23 commits ahead of main
  • 184 files changed
  • 37,725 insertions / 2,032 deletions

Full package-by-package detail is in CHANGELOG.md.

CharlVS and others added 23 commits March 12, 2026 12:34
…ctoring (#312)

* feat: add polish foundation support in sdk

* fix: export typed rpc error models

* test(auth): cover delete wallet general error mapping

* test(auth): cover generalized wallet rpc errors

* fix: harden KDF error parsing against malformed responses

- Wrap KdfErrorRegistry.tryParse parser invocation in try/catch to
  gracefully fall back to GeneralErrorResponse on malformed error_data
- Make _intFromJson and _doubleFromJson null-safe (return 0 instead of
  throwing ArgumentError)
- Make Mm2Duration.fromJson handle null input (return Duration.zero)
- Apply same fixes to the generator script so regenerated code stays
  consistent
- Refine doc comments on delete_wallet and change_mnemonic_password

* fix: harden stream controller lifecycle and refactor fee guard

- Add isCancelled flag with canEmit/tearDownResources helpers to
  orderbook and swap-status stream controllers to prevent race
  conditions where events could be emitted after cancellation
- Extract _throwIfFeeEstimationDisabled helper in FeeManager to
  remove duplicated guard logic across ETH, UTXO and Tendermint paths
- Update bundled coins repo commit hash
* feat(sdk): add high-level balance and tx manager interfaces

* fix(sdk): address pr review cancellation and ordering bugs
* feat(sdk): add TRON and TRC20 support

* chore(sdk): remove generated whitespace

* fix(sdk): align config parsing and KDF compatibility
* refactor(withdrawals): enforce preview-then-execute workflow to prevent duplicate signing

- Add executeWithdrawal() method to broadcast pre-signed transactions
- Deprecate withdraw() method in favor of two-step preview-execute flow
- Update example app to use new executeWithdrawal() method
- Prevents transactions from being signed multiple times
- Ensures users always review transaction details before broadcast

Breaking Changes:
- withdraw() is now deprecated (still functional but not recommended)
- Recommended flow: previewWithdrawal() → executeWithdrawal()

* Update packages/komodo_defi_sdk/lib/src/withdrawals/withdrawal_manager.dart

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* use latest KDF commit  in `sia-rc-cleanup`

* migrate SIA updates from old branch

* fix wallet build errors

* fix sia activation param

* chore: update generated code

chore: update generated code by running `melos run prepare` (requires Dart `melos` tool to be installed)

* fix: fix broken sia RPC method test

fix broken sia RPC method test. NB! Only fixing static analysis errors - the functionality of the test itself remains unchanged

* clean task loop exit

* implement SIA withdrawals

* exclude SIA coins from pk export

* fix(sia): explicitly remove support for tx streaming for sia

* test(sia): add test case to confirm that tx history streaming is not supported for sia

* chore(deps): bump kdf to 85d354d

* update kdf commit

* updates kdf commit

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: smk762 <smk@komodoplatform.com>
Co-authored-by: Francois <takenagain@users.noreply.github.com>
The squash merge of the SIA branch into dev left a duplicate
executeWithdrawal method in LegacyWithdrawalManager. Remove the
second copy which also inconsistently used WithdrawalException
directly instead of the _mapError helper.
Add a dedicated metadata mutex to serialise read-modify-write cycles
on user metadata, preventing concurrent coin activations from
overwriting each other's state. Introduces updateActiveUserMetadataKey
for atomic single-key transforms and migrates setOrRemoveActiveUserKeyValue
to use it.

Also updates bundled coins config to master branch (aceacfb).
…builds (#329)

Replace T.toString() parsing for List/Map handling with compile-time type
checks so dart2js and dart2wasm (including minification) behave correctly.

Add unit tests for value/valueOrNull list and map paths.
…ce (#330)

The IAuthService interface gained updateActiveUserMetadataKey in #328
but the _FakeAuthService in the Trezor auth tests was not updated,
causing a compilation error.
Update bundled_coins_repo_commit to 32a0cdc2e9ab5927a571cb1c85fc4be080567e70.
The streaming manager previously fell through to enable_* calls after a
short 2-second timeout even when no first byte had been received from the
SSE / SharedWorker connection. KDF responds with UnknownClient when the
client is not yet registered, causing all three retry attempts to fail
and leaving orderbook (and other) streams permanently broken for the
session.

Changes:
- Increase the first-byte wait to 30s per attempt (3 attempts with
  reconnect between each) so we never call enable_* before KDF has
  actually registered the SSE client.
- Abort with an exception instead of proceeding without readiness; the
  fallback RPC + polling path in OrderbookBloc handles this gracefully.
- On UnknownClient retries, re-run the full first-byte readiness gate
  instead of a fixed 3s sleep.
- Always reset the first-byte Completer on disconnect(), even if it was
  never completed, so subsequent sessions don't block on a stale future.
 - dragon_charts_flutter@0.1.1-dev.4
 - dragon_logs@2.0.1
 - komodo_cex_market_data@0.1.0
 - komodo_coin_updates@2.0.0
 - komodo_coins@0.3.2
 - komodo_defi_framework@0.4.0
 - komodo_defi_local_auth@0.4.0
 - komodo_defi_rpc_methods@0.4.0
 - komodo_defi_sdk@0.5.0
 - komodo_defi_types@0.4.0
 - komodo_ui@0.3.1
 - komodo_wallet_build_transformer@0.4.1
 - komodo_wallet_cli@0.5.0
…on (#335)

Add a secondary cache for current (non-historical) prices so priceIfKnown
does not return null during periodic live-cache clears. Document streaming
tech debt and cover behaviour with unit tests.
@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 changed the title chore(release): prepare next release from dev chore(release): prepare 2026-03-23 workspace release from dev Mar 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 23, 2026

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

https://komodo-playground--pr337-dev-yphndsuf.web.app

(expires Wed, 08 Apr 2026 17:18:25 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2bfedd77fdea45b25ba7c784416e81f177aa5c47

@CharlVS CharlVS changed the title chore(release): prepare 2026-03-23 workspace release from dev chore(release): komodo_defi_sdk v0.5.0 - TRON/TRC20, SIA, and runtime hardening Mar 23, 2026
@CharlVS CharlVS requested a review from DeckerSU March 23, 2026 20:20
* fix(komodo_defi_types): support TRON explorer URLs

* chore(sdk): commit pending SDK updates
CharlVS and others added 9 commits March 25, 2026 00:43
* feat(komodo_defi_sdk): add Tronscan transaction history strategy

Implement TronscanTransactionStrategy for fetching transaction history
from the Tronscan HTTP API for TRX native and TRC-20 token assets.

- Support mainnet (apilist.tronscanapi.com) and Nile testnet endpoints
- Fetch TRX transfers via /api/transfer, TRC-20 via /api/token_trc20/transfers
- Two-layer pagination: server-side batching with client-side aggregation
- Retry on 429/503 with Retry-After header and exponential backoff with jitter
- Optional TRON-PRO-API-KEY header for improved rate limits
- Merge duplicate TransactionInfo across multiple pubkey addresses
- Wire through TransactionHistoryStrategyFactory, Manager, and bootstrap
- Add KomodoDefiSdkConfig.tronProApiKey configuration field
- Update tests for TRX/TRC-20 asset selection, ordering, and retry behavior

* feat(transaction-history): migrate TRON history to TRONGrid
Prevent CoinGecko support checks from poisoning repository selection and add TRX fallback IDs so price history can resolve. Deduplicate shared asset activation so already-active assets stop failing into polling fallbacks.
- Add recovery watchers in BalanceManager when activation fails at
  startup so callers do not need to re-subscribe after races
- Refactor balance polling into reusable fetchLatestBalance helper
- Improve FeeInfo types and freezed codegen in komodo_defi_types
- Add fee_info_display widget in komodo_ui
- Update build_config, dev_builds_artefact_downloader, and
  update_api_config CLI
- Add balance_manager_recovery_test and fee_info_test
#342)

NotSufficientBalance is shared across RPC namespaces; KdfErrorRegistry
previously returned null for all ambiguous types, causing withdraw status
errors to fall back to GenericErrorResponse.

- Thread rpcMethodHint from ApiClient.post and BaseRequest.parseResponse
- Extend GeneralErrorResponse.toTypedException with optional hint
- When hint matches withdraw task methods, parse withdraw-specific balance errors
- enforce single-terminal SIA activation progress semantics\n- add first-terminal-wins guard in activation manager\n- validate and reject SIA withdraw source selection (from)\n- route SIA preview/execute/one-shot withdraw through legacy flow\n- remove SIA-specific withdraw RPC surface and tests; use generic withdraw parsing\n- add SIA activation, withdrawal, and tx-history strategy coverage

BREAKING CHANGE: removed withdrawSia(), SiaWithdrawRequest, and SiaWithdrawResponse. Migrate to generic withdraw()/WithdrawStatusResponse + WithdrawResult.
* fix(ui): avoid duplicate icon precache requests

* fix(ui): retry CDN icon loads after transient failures

* fix(ui): harden icon precache fallback and manifest caching
…ache (#346)

* fix(ui): avoid duplicate icon precache requests

* fix(ui): retry CDN icon loads after transient failures

* fix(ui): harden icon precache fallback and manifest caching

* fix(market-data): add failure cooldown to CoinGecko coin list fetching

When getCoinList() failed, _cachedCoinList stayed null and every
subsequent price request re-triggered the API call via supports(),
creating a request storm that exhausted rate limits. Add a 5-minute
cooldown after failures to prevent retry spam, matching the existing
RepositoryFallbackMixin backoff duration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Bump api_commit_hash to d56a7bc5028f10b9c1bb8370bb2ee16444796a23 (branch: main)
- Update all platform checksums from v3.0.0-beta release
- Add libkdf-macos-universal2-* pattern to macOS matching_pattern
- Switch coins_repo_branch from feat/add-tron-coins to master
@CharlVS CharlVS merged commit e7dfde0 into main Apr 1, 2026
5 of 8 checks passed
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.

2 participants