Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6105c80
feat(sdk): typed error handling, trading streams, and activation refa…
CharlVS Mar 12, 2026
6cb1711
fix(web): complete wasm-safe sdk interop cleanup (#313)
CharlVS Mar 12, 2026
54e1420
feat(sdk): add high-level balance/transaction manager interfaces (#314)
CharlVS Mar 12, 2026
9388a40
fix(web): improve wasm JS interop bindings (#315)
CharlVS Mar 16, 2026
ab4e7f1
chore: upgrade KDF to 3.0.0-beta preview (#317)
CharlVS Mar 18, 2026
cd5b45d
feat(coins): Add TRON and TRC20 support (#316)
CharlVS Mar 18, 2026
ce60e66
fix(startup): handle 6133 seed fallback and invalid configs (#318)
CharlVS Mar 18, 2026
b563bdf
feat(sdk): add token safety and fee support helpers (#319)
CharlVS Mar 18, 2026
3d1b231
fix(sdk): expose custom token cleanup (#321)
CharlVS Mar 18, 2026
7a3f409
feat(sdk): add SIA activation and withdrawal support (#320)
CharlVS Mar 18, 2026
482ca5f
fix(withdrawals): remove duplicate executeWithdrawal method (#322)
CharlVS Mar 18, 2026
3b4f492
fix(ui): detect asset icon precache failures (#326)
CharlVS Mar 21, 2026
67193af
chore(build): format config updates consistently (#325)
CharlVS Mar 21, 2026
9532870
fix(auth): add mutex-protected atomic metadata updates (#328)
CharlVS Mar 21, 2026
317719d
fix(types): use reified generics in JSON traversal for wasm/minified …
CharlVS Mar 23, 2026
c70beed
fix(test): add missing updateActiveUserMetadataKey to fake auth servi…
CharlVS Mar 23, 2026
869dd00
chore(framework): bump bundled coins repo commit (#331)
CharlVS Mar 23, 2026
b4ad5c0
fix(streaming): gate enable_* calls on real SSE first-byte event (#332)
CharlVS Mar 23, 2026
0f5b76d
chore(release): publish packages
CharlVS Mar 23, 2026
4edb1c6
chore: update v0.9.4 changelog (#333)
CharlVS Mar 23, 2026
b5626fd
chore(build): update coins build config (#334)
CharlVS Mar 23, 2026
bee3cc6
fix(komodo_defi_sdk): keep last-known spot prices across cache rotati…
CharlVS Mar 23, 2026
ead35b0
fix: harden numeric JSON parsing for num/int compatibility (#336)
CharlVS Mar 23, 2026
ec8e714
fix(komodo_defi_types): support TRON explorer URLs (#338)
CharlVS Mar 24, 2026
39dd1fc
feat(komodo_defi_sdk): add Tronscan transaction history strategy (#339)
CharlVS Mar 24, 2026
877bb57
fix(sdk): restore TRX market data and coordinate activation (#340)
CharlVS Mar 25, 2026
1912489
feat(sdk): balance recovery mode and fee info improvements (#341)
CharlVS Mar 27, 2026
b8555f1
fix(rpc_methods): pass RPC method hint for ambiguous KDF error parsin…
CharlVS Mar 27, 2026
3cb147b
feat(sia)!: harden activation and withdrawal handling (#343)
CharlVS Mar 30, 2026
6dddeee
fix(ui): correct TRC20 badge icon mapping (#344)
CharlVS Mar 30, 2026
682a0b9
fix(ui): avoid duplicate icon precache requests (#345)
CharlVS Mar 30, 2026
ed300b1
fix(market-data): add CoinGecko failure cooldown and harden icon prec…
CharlVS Mar 30, 2026
dbc1472
chore(build): update KDF to v3.0.0-beta (d56a7bc) and coins to master
DeckerSU Apr 1, 2026
0f61dfb
feat(migration): scaffold legacy wallet migration package
CharlVS Apr 2, 2026
ef0008c
feat(sdk): add legacy wallet migration
CharlVS Apr 13, 2026
4da15a6
fix(migration): replace dargon2_flutter with pointycastle for WASM co…
CharlVS Apr 13, 2026
4a17aec
fix(auth,migration): harden RPC readiness probe and platform guard
CharlVS Apr 13, 2026
a4eb19b
chore(release): prepare SDK 0.6.0
CharlVS May 2, 2026
798b538
fix(pub): resolve publish dry-run warnings (#349)
CharlVS May 4, 2026
90e8a56
revert analysis options changes (#351)
CharlVS May 4, 2026
aa694fb
Merge branch 'main' into dev
CharlVS May 4, 2026
6dc43a3
Merge branch 'dev' of https://github.com/KomodoPlatform/komodo-defi-s…
CharlVS May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,105 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2026-05-02

### Changes

---

Packages with breaking changes:

- [`komodo_defi_rpc_methods` - `v0.5.0`](#komodo_defi_rpc_methods---v050)
- [`komodo_defi_sdk` - `v0.6.0`](#komodo_defi_sdk---v060)

Packages with other changes:

- [`komodo_cex_market_data` - `v0.1.0+1`](#komodo_cex_market_data---v0101)
- [`komodo_defi_framework` - `v0.4.1`](#komodo_defi_framework---v041)
- [`komodo_defi_local_auth` - `v0.4.1`](#komodo_defi_local_auth---v041)
- [`komodo_defi_types` - `v0.4.1`](#komodo_defi_types---v041)
- [`komodo_legacy_wallet_migration` - `v0.1.0`](#komodo_legacy_wallet_migration---v010)
- [`komodo_ui` - `v0.3.2`](#komodo_ui---v032)
- [`komodo_wallet_build_transformer` - `v0.4.2`](#komodo_wallet_build_transformer---v042)
- [`komodo_wallet_cli` - `v0.5.1`](#komodo_wallet_cli---v051)
- [`komodo_coins` - `v0.3.2+1`](#komodo_coins---v0321)
- [`komodo_coin_updates` - `v2.0.1`](#komodo_coin_updates---v201)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.

- `komodo_coins` - `v0.3.2+1`
- `komodo_coin_updates` - `v2.0.1`

---

#### `komodo_defi_rpc_methods` - `v0.5.0`

- **FIX**(errors): preserve RPC method hints when parsing ambiguous KDF error responses (#342).
- **FIX**(models): accept numeric JSON values encoded as either `int` or `num` across RPC models (#336).
- **FEAT**(auth): add the RPC request and activation parameter support needed by legacy wallet migration.
- **BREAKING** **FEAT**(sia): move SIA withdrawal handling onto hardened SIA-specific RPC models and namespace methods (#343).

#### `komodo_defi_sdk` - `v0.6.0`

- **FIX**(activation): restore coordinated TRX activation and market-data lookup (#340).
- **FIX**(explorers): support TRON explorer URL templates in SDK transaction flows (#338).
- **FIX**(market-data): keep last-known spot prices available while rotating cache snapshots (#335).
- **FEAT**(migration): add SDK integration for legacy wallet discovery, verification, import, and cleanup.
- **FEAT**(balances): add balance recovery mode and richer fee information plumbing (#341).
- **FEAT**(transaction-history): add a Tronscan strategy with address, cursor, and fixed-scale amount codecs (#339).
- **BREAKING** **FEAT**(sia): route SIA activation and withdrawals through the hardened SIA strategy and RPC namespace (#343).

#### `komodo_legacy_wallet_migration` - `v0.1.0`

- **FEAT**(migration): add legacy wallet discovery, metadata parsing, password verification, import, and cleanup utilities.
- **FIX**(migration): use a PointyCastle-based Argon2 verifier for WASM compatibility.
- **FIX**(migration): guard unsupported platforms and wait for KDF RPC readiness before migration work.

#### `komodo_cex_market_data` - `v0.1.0+1`

- **FIX**(coingecko): add a failure cooldown to avoid repeated failing requests (#346).
- **FIX**(tron): restore TRX market-data ID resolution and repository fallback behaviour (#340).
- **FIX**(models): accept numeric API values encoded as either `int` or `num` (#336).

#### `komodo_defi_framework` - `v0.4.1`

- **CHORE**(build): update bundled KDF to staging commit `52ba4f9` and use the TRON coins source for release builds.
- **FIX**(config): carry TRON explorer URL support through bundled build configuration (#338).
- **FIX**(web): harden numeric JS interop parsing for KDF responses (#336).
- **FEAT**(migration): expose the framework hooks needed for legacy wallet migration.
- **FEAT**(build): align build configuration with the balance recovery and fee-info release inputs (#341).

#### `komodo_defi_local_auth` - `v0.4.1`

- **FIX**(auth,migration): wait for KDF RPC readiness and guard unsupported platforms during migration.
- **FEAT**(migration): add local-auth integration for legacy wallet verification and import flows.

#### `komodo_defi_types` - `v0.4.1`

- **FIX**(tron): support TRON explorer URL templates and correct TRC20 badge classification (#338, #344).
- **FIX**(models): accept numeric JSON values encoded as either `int` or `num` (#336).
- **FEAT**(migration): add auth error and wallet metadata types used by legacy wallet migration.
- **FEAT**(fees): expose richer fee information for balance recovery flows (#341).
- **FEAT**(transaction-history): add strategy metadata needed by the Tronscan history provider (#339).

#### `komodo_ui` - `v0.3.2`

- **FIX**(asset-icons): avoid duplicate icon precache requests (#345).
- **FIX**(asset-icons): show the correct TRC20 chain badge (#344).
- **FEAT**(fees): display richer fee information from SDK balance recovery flows (#341).

#### `komodo_wallet_build_transformer` - `v0.4.2`

- **FIX**(github): accept numeric GitHub API values encoded as either `int` or `num` (#336).
- **FEAT**(build): support the build inputs needed by balance recovery and fee-info updates (#341).

#### `komodo_wallet_cli` - `v0.5.1`

- **FEAT**(build): update API config tooling for the balance recovery and fee-info release inputs (#341).


## 2026-03-23

### Changes
Expand Down
6 changes: 6 additions & 0 deletions packages/komodo_cex_market_data/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.1.0+1

- **FIX**(coingecko): add a failure cooldown to avoid repeated failing requests (#346).
- **FIX**(tron): restore TRX market-data ID resolution and repository fallback behaviour (#340).
- **FIX**(models): accept numeric API values encoded as either `int` or `num` (#336).

## 0.1.0

> Note: This release has breaking changes.
Expand Down
4 changes: 2 additions & 2 deletions packages/komodo_cex_market_data/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: komodo_cex_market_data
description: CEX market data repositories and strategies with fallbacks for Komodo SDK apps.
version: 0.1.0
version: 0.1.0+1
repository: https://github.com/GLEECBTC/komodo-defi-sdk-flutter

environment:
Expand All @@ -17,7 +17,7 @@ dependencies:
freezed_annotation: ^3.0.0
json_annotation: ^4.9.0

komodo_defi_types: ^0.4.0
komodo_defi_types: ^0.4.1

# Approved via https://github.com/GLEECBTC/gleec-wallet/pull/1106
hive_ce: ^2.2.3+ce # Changed from hive to hive_ce for Hive CE compatibility
Expand Down
4 changes: 4 additions & 0 deletions packages/komodo_coin_updates/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.1

- Update a dependency to the latest release.

## 2.0.0

> Note: This release has breaking changes.
Expand Down
4 changes: 2 additions & 2 deletions packages/komodo_coin_updates/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: komodo_coin_updates
description: Runtime coin config update coin updates.
version: 2.0.0
version: 2.0.1
repository: https://github.com/GLEECBTC/komodo-defi-sdk-flutter

environment:
Expand All @@ -21,7 +21,7 @@ dependencies:
hive_ce_flutter: ^2.2.3+ce
http: ^1.4.0
json_annotation: ^4.9.0
komodo_defi_types: ^0.4.0
komodo_defi_types: ^0.4.1
logging: ^1.3.0

dev_dependencies:
Expand Down
4 changes: 4 additions & 0 deletions packages/komodo_coins/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.2+1

- Update a dependency to the latest release.

## 0.3.2

- **PERF**(logs): reduce market metrics log verbosity and duplication (#223).
Expand Down
6 changes: 3 additions & 3 deletions packages/komodo_coins/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: komodo_coins
description: "A package for fetching managing Komodo Platform coin configuration data storage, runtime updates, and queries."
version: 0.3.2
version: 0.3.2+1
homepage: "https://komodoplatform.com"
repository: "https://github.com/GLEECBTC/komodo-defi-sdk-flutter"

Expand All @@ -16,8 +16,8 @@ dependencies:
sdk: flutter
hive_ce: ^2.11.3
http: ^1.4.0
komodo_coin_updates: ^2.0.0
komodo_defi_types: ^0.4.0
komodo_coin_updates: ^2.0.1
komodo_defi_types: ^0.4.1
logging: ^1.3.0
path: ^1.9.1
path_provider: ^2.1.5
Expand Down
8 changes: 8 additions & 0 deletions packages/komodo_defi_framework/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.4.1

- **CHORE**(build): update bundled KDF to staging commit `52ba4f9` and use the TRON coins source for release builds.
- **FIX**(config): carry TRON explorer URL support through bundled build configuration (#338).
- **FIX**(web): harden numeric JS interop parsing for KDF responses (#336).
- **FEAT**(migration): expose the framework hooks needed for legacy wallet migration.
- **FEAT**(build): align build configuration with the balance recovery and fee-info release inputs (#341).

## 0.4.0

> Note: This release has breaking changes.
Expand Down
2 changes: 1 addition & 1 deletion packages/komodo_defi_framework/app_build/build_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"coins": {
"fetch_at_build_enabled": true,
"update_commit_on_build": true,
"bundled_coins_repo_commit": "1d2a5c9c4d23416df2fa1c5e2f263a244a09704d",
"bundled_coins_repo_commit": "883f1863cc71ad5f7a04878e4b7073d5f9f98dcf",
"coins_repo_api_url": "https://api.github.com/repos/GLEECBTC/coins",
"coins_repo_content_url": "https://raw.githubusercontent.com/GLEECBTC/coins",
"coins_repo_branch": "master",
Expand Down
101 changes: 72 additions & 29 deletions packages/komodo_defi_framework/lib/komodo_defi_framework.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export 'package:komodo_defi_framework/src/streaming/events/kdf_event.dart';
export 'src/operations/kdf_operations_interface.dart';

class KomodoDefiFramework implements ApiClient {
static const Duration _versionProbeTimeout = Duration(seconds: 2);
static const Duration _stopPollInterval = Duration(milliseconds: 250);
static const Duration _stopSettleDelay = Duration(milliseconds: 250);

factory KomodoDefiFramework.create({
required IKdfHostConfig hostConfig,
void Function(String)? externalLogger,
Expand Down Expand Up @@ -162,24 +166,44 @@ class KomodoDefiFramework implements ApiClient {
_log('Stopping KDF...');
final result = await _kdfOperations.kdfStop();
_log('KDF stop result: $result');
// Await a max of 5 seconds for KDF to stop. Check every 500ms.
for (var i = 0; i < 10; i++) {
await Future<void>.delayed(const Duration(milliseconds: 500));
if (!await isRunning()) {
break;
}
if (i == 9) {
throw Exception('Error stopping KDF: KDF did not stop in time.');

// Drop any stale keep-alive socket before verifying shutdown. Otherwise,
// the post-stop version() fallback can hang on Android while the native
// thread is already tearing down.
resetHttpClient();

// Wait for native status to settle without probing RPC over HTTP.
for (var i = 0; i < 20; i++) {
await Future<void>.delayed(_stopPollInterval);
final stillRunning = await isRunning(allowVersionFallback: false);
if (!stillRunning) {
await Future<void>.delayed(_stopSettleDelay);
if (!await isRunning(allowVersionFallback: false)) {
return result;
}
}
}

return result;
throw Exception('Error stopping KDF: KDF did not stop in time.');
}

Future<bool> isRunning() async {
Future<bool> isRunning({bool allowVersionFallback = true}) async {
final nativeRunning = await _kdfOperations.isRunning();
if (nativeRunning) {
return true;
}

if (!allowVersionFallback) {
_log('KDF is not running.');
return false;
}

final running =
await _kdfOperations.isRunning() ||
await _kdfOperations.version() != null;
await _kdfOperations.version().timeout(
_versionProbeTimeout,
onTimeout: () => null,
) !=
null;
if (!running) {
_log('KDF is not running.');
}
Expand All @@ -188,15 +212,23 @@ class KomodoDefiFramework implements ApiClient {

Future<String?> version() async {
final stopwatch = Stopwatch()..start();
_log('version(): Starting version RPC call via ${_kdfOperations.operationsName}');
_log(
'version(): Starting version RPC call via ${_kdfOperations.operationsName}',
);
try {
final version = await _kdfOperations.version();
final version = await _kdfOperations.version().timeout(
_versionProbeTimeout,
);
stopwatch.stop();
_log('version(): Completed in ${stopwatch.elapsedMilliseconds}ms, result=$version');
_log(
'version(): Completed in ${stopwatch.elapsedMilliseconds}ms, result=$version',
);
return version;
} catch (e) {
stopwatch.stop();
_log('version(): Failed after ${stopwatch.elapsedMilliseconds}ms with error: $e');
_log(
'version(): Failed after ${stopwatch.elapsedMilliseconds}ms with error: $e',
);
rethrow;
}
}
Expand All @@ -205,7 +237,7 @@ class KomodoDefiFramework implements ApiClient {
/// Returns true if KDF is running and responsive, false otherwise.
/// This is useful for detecting when KDF has become unavailable, especially
/// on mobile platforms after app backgrounding.
///
///
/// IMPORTANT: This method ONLY relies on actual RPC verification (version() call)
/// to avoid false positives where native status reports "running" but HTTP listener
/// is not accepting connections (common after iOS backgrounding).
Expand All @@ -217,7 +249,7 @@ class KomodoDefiFramework implements ApiClient {
_log('KDF health check failed: version call returned null');
return false;
}

_log('KDF health check passed: version=$versionCheck');
return true;
} catch (e) {
Expand Down Expand Up @@ -279,26 +311,37 @@ class KomodoDefiFramework implements ApiClient {
return response;
} catch (e) {
stopwatch.stop();

// Detect transport-fatal SocketExceptions that indicate KDF is down/dying
// errno 32 (EPIPE): Broken pipe - writing to socket whose peer closed
// errno 54 (ECONNRESET): Connection reset by peer
// errno 60 (ETIMEDOUT): Operation timed out
// errno 61 (ECONNREFUSED): Connection refused - no listener on port
final errorString = e.toString().toLowerCase();
final isSocketException = errorString.contains('socketexception');
final isFatalTransportError = isSocketException && (
errorString.contains('broken pipe') || errorString.contains('errno = 32') ||
errorString.contains('connection reset') || errorString.contains('errno = 54') ||
errorString.contains('operation timed out') || errorString.contains('errno = 60') ||
errorString.contains('connection refused') || errorString.contains('errno = 61')
);
final isFatalTransportError =
isSocketException &&
(errorString.contains('broken pipe') ||
errorString.contains('errno = 32') ||
errorString.contains('connection reset') ||
errorString.contains('errno = 54') ||
errorString.contains('operation timed out') ||
errorString.contains('errno = 60') ||
errorString.contains('connection refused') ||
errorString.contains('errno = 61'));

if (isFatalTransportError) {
final errorType = errorString.contains('errno = 32') || errorString.contains('broken pipe') ? 'EPIPE (32)' :
errorString.contains('errno = 54') || errorString.contains('connection reset') ? 'ECONNRESET (54)' :
errorString.contains('errno = 60') || errorString.contains('operation timed out') ? 'ETIMEDOUT (60)' :
'ECONNREFUSED (61)';
final errorType =
errorString.contains('errno = 32') ||
errorString.contains('broken pipe')
? 'EPIPE (32)'
: errorString.contains('errno = 54') ||
errorString.contains('connection reset')
? 'ECONNRESET (54)'
: errorString.contains('errno = 60') ||
errorString.contains('operation timed out')
? 'ETIMEDOUT (60)'
: 'ECONNREFUSED (61)';
_logger.severe(
'[RPC] ${method ?? 'unknown'} failed: KDF transport error $errorType. '
'Resetting HTTP client to drop stale connections.',
Expand Down
10 changes: 5 additions & 5 deletions packages/komodo_defi_framework/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: komodo_defi_framework
description: "A Flutter plugin for the Komodo DeFi Framework, supporting both
native (FFI) and web (WASM) platforms."
version: 0.4.0
version: 0.4.1
homepage: https://komodoplatform.com

repository: https://github.com/GLEECBTC/komodo-defi-sdk-flutter
Expand All @@ -23,10 +23,10 @@ dependencies:
flutter_web_plugins:
sdk: flutter
http: ^1.4.0
komodo_coin_updates: ^2.0.0
komodo_coins: ^0.3.2
komodo_defi_types: ^0.4.0
komodo_wallet_build_transformer: ^0.4.1
komodo_coin_updates: ^2.0.1
komodo_coins: ^0.3.2+1
komodo_defi_types: ^0.4.1
komodo_wallet_build_transformer: ^0.4.2
logging: ^1.3.0
mutex: ^3.1.0
path: ^1.9.1
Expand Down
Loading
Loading