diff --git a/packages/suite/src/storage/CHANGELOG.md b/packages/suite/src/storage/CHANGELOG.md index 90027c4218d7..c4dfc3bd4dce 100644 --- a/packages/suite/src/storage/CHANGELOG.md +++ b/packages/suite/src/storage/CHANGELOG.md @@ -1,5 +1,9 @@ # Storage changelog +## 52 + +- saved ripple network type txs are removed to be fetched again and obtain internal transfers and token transfer contract and standard + ## 51 - Changed `metadata.key` on non-eth EVM networks accounts to be `descriptor-chainId` diff --git a/packages/suite/src/storage/migrations/index.ts b/packages/suite/src/storage/migrations/index.ts index 66c21faeb98a..96447f894959 100644 --- a/packages/suite/src/storage/migrations/index.ts +++ b/packages/suite/src/storage/migrations/index.ts @@ -1176,4 +1176,27 @@ export const migrate: OnUpgradeFunc = async ( return account; }); } + + if (oldVersion < 52) { + const accountsToUpdate = ['xrp', 'txrp']; + + // remove ripple network transactions + await updateAll<'txs', DBWalletAccountTransactionCompatible>(transaction, 'txs', tx => { + if (accountsToUpdate.includes(tx.tx.symbol)) { + return null; + } + tx.tx.internalTransfers = []; + + return tx; + }); + + // force to fetch ripple network transactions again + await updateAll(transaction, 'accounts', account => { + if (accountsToUpdate.includes(account.symbol)) { + account.history = { total: 0, unconfirmed: 0, tokens: 0 }; + + return account; + } + }); + } };