Skip to content

Commit

Permalink
immediately display wallets, then fetch utxos
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-zwets committed May 24, 2024
1 parent 113a16e commit cd60bea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Wallets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ const WalletInfo: React.FC<Props> = ({network, setShowWallets, wallets, setWall
if (localStorageData !== null) {
const newWallets = JSON.parse(localStorageData);
for (const wallet of newWallets){
const walletUtxos = await new ElectrumNetworkProvider(network).getUtxos(wallet.address);
wallet.privKey = new Uint8Array(Object.values( wallet.privKey))
}
setWallets(newWallets);
// fetch UTXOs
const networkProvider = new ElectrumNetworkProvider(network)
for (const wallet of newWallets){
const walletUtxos = await networkProvider.getUtxos(wallet.address);
wallet.utxos = walletUtxos
}
setWallets(newWallets);
Expand Down

0 comments on commit cd60bea

Please sign in to comment.