Skip to content
Merged
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions packages/komodo_defi_sdk/lib/src/komodo_defi_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:developer';

import 'package:get_it/get_it.dart';
import 'package:komodo_coins/komodo_coins.dart' show KomodoAssetsUpdateManager;
import 'package:komodo_defi_framework/komodo_defi_framework.dart';
import 'package:komodo_defi_local_auth/komodo_defi_local_auth.dart';
import 'package:komodo_defi_sdk/komodo_defi_sdk.dart';
Expand Down Expand Up @@ -206,6 +207,19 @@ class KomodoDefiSdk with SecureRpcPasswordMixin {
/// Throws [StateError] if accessed before initialization.
AssetManager get assets => _assertSdkInitialized(_container<AssetManager>());

/// Deletes a persisted custom token from SDK-managed storage.
///
/// This removes the token from the custom-token store and the in-memory
/// asset registry, then invalidates the activated-assets cache so follow-up
/// activation checks do not continue resolving the deleted asset.
Future<void> deleteCustomToken(AssetId assetId) async {
_assertSdkInitialized(assets);
await _container<KomodoAssetsUpdateManager>().assets.deleteCustomToken(
assetId,
);
activatedAssetsCache.invalidate();
}

/// Cache of activated assets with per-instance TTL.
///
/// Useful for avoiding repeated activation RPC calls across features.
Expand Down
Loading