Skip to content

Commit 92c4670

Browse files
committed
fix: auto-refresh wallet when new block height
1 parent de50f90 commit 92c4670

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

BDKSwiftExampleWallet/View Model/WalletViewModel.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ class WalletViewModel {
117117
) { [weak self] notification in
118118
if let height = notification.userInfo?["height"] as? UInt32 {
119119
self?.currentBlockHeight = height
120+
// Auto-refresh wallet data when Kyoto receives new blocks
121+
self?.getBalance()
122+
self?.getTransactions()
123+
Task {
124+
await self?.getPrices()
125+
}
120126
}
121127
}
122128
}

0 commit comments

Comments
 (0)