Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/hooks/useWallet.js
Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | const update = async ({ wallet }) => { | ||||
txHistoryUpdatedTokenInfoById, | txHistoryUpdatedTokenInfoById, | ||||
txHistoryNewTokensToCache, | txHistoryNewTokensToCache, | ||||
} = await getTxHistoryChronik( | } = await getTxHistoryChronik( | ||||
chronik, | chronik, | ||||
BCH, | BCH, | ||||
wallet, | wallet, | ||||
updatedTokenInfoById, | updatedTokenInfoById, | ||||
); | ); | ||||
console.log( | |||||
`chronikTxHistory as flattened array, sorted by blockheight and time first seen, with parse info, and partial legacy parse info`, | |||||
chronikTxHistory, | |||||
); | |||||
if (txHistoryNewTokensToCache) { | if (txHistoryNewTokensToCache) { | ||||
console.log( | console.log( | ||||
`Uncached token info found in tx history, adding to cache`, | `Uncached token info found in tx history, adding to cache`, | ||||
); | ); | ||||
console.log( | |||||
`txHistoryUpdatedTokenInfoById`, | |||||
txHistoryUpdatedTokenInfoById, | |||||
); | |||||
writeTokenInfoByIdToCache(txHistoryUpdatedTokenInfoById); | writeTokenInfoByIdToCache(txHistoryUpdatedTokenInfoById); | ||||
// Update the tokenInfoById key in cashtabCache | // Update the tokenInfoById key in cashtabCache | ||||
setCashtabCache({ | setCashtabCache({ | ||||
...cashtabCache, | ...cashtabCache, | ||||
tokenInfoById: txHistoryUpdatedTokenInfoById, | tokenInfoById: txHistoryUpdatedTokenInfoById, | ||||
}); | }); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,247 Lines • Show Last 20 Lines |