| … | … | @@ -1870,7 +1870,11 @@ const routes = { |
| 1870 | 1870 | |
| 1871 | 1871 | // Sync Bitcoin transactions using Blockstream API |
| 1872 | 1872 | try { |
| 1873 | const btcAccount = await wdk.getAccount('bitcoin', 0) | |
| 1873 | // Get current Bitcoin address index from storage | |
| 1874 | const currentBtcAddr = await getCurrentAddress('bitcoin') | |
| 1875 | const btcAccountIndex = currentBtcAddr ? currentBtcAddr.index : 0 | |
| 1876 | ||
| 1877 | const btcAccount = await wdk.getAccount('bitcoin', btcAccountIndex) // FIX: Use stored index | |
| 1874 | 1878 | const btcAddress = await btcAccount.getAddress() |
| 1875 | 1879 | |
| 1876 | 1880 | const response = await fetch(`https://blockstream.info/testnet/api/address/${btcAddress}/txs`) |