diff --git a/cw_solana/lib/solana_wallet.dart b/cw_solana/lib/solana_wallet.dart index dba04a9df..e9d89d0f6 100644 --- a/cw_solana/lib/solana_wallet.dart +++ b/cw_solana/lib/solana_wallet.dart @@ -645,7 +645,9 @@ abstract class SolanaWalletBase } Future deleteSPLToken(SPLToken token) async { - await token.delete(); + if (splTokensBox.isOpen) { + await splTokensBox.delete(token.mintAddress); + } balance.remove(token); await _removeTokenTransactionsInHistory(token); diff --git a/cw_tron/lib/tron_wallet.dart b/cw_tron/lib/tron_wallet.dart index 393c8ff97..c8d9fb929 100644 --- a/cw_tron/lib/tron_wallet.dart +++ b/cw_tron/lib/tron_wallet.dart @@ -313,13 +313,12 @@ abstract class TronWalletBase final hasMultiDestination = outputs.length > 1; final transactionCurrency = balance.keys.firstWhere( - (currency) => - currency.title == tronCredentials.currency.title && + (currency) => + currency.title == tronCredentials.currency.title && currency.tag == tronCredentials.currency.tag, orElse: () => throw Exception( 'Currency ${tronCredentials.currency.title} ${tronCredentials.currency.tag} is not accessible in the wallet, try to enable it first.')); - final walletBalanceForCurrency = balance[transactionCurrency]!.balance; BigInt totalAmount = BigInt.zero; @@ -590,7 +589,9 @@ abstract class TronWalletBase } Future deleteTronToken(TronToken token) async { - await token.delete(); + if (tronTokensBox.isOpen) { + await tronTokensBox.delete(token.contractAddress); + } balance.remove(token); await _removeTokenTransactionsInHistory(token);