[Cashtab] [chronik utxo handling p5] Add support for caching token info to limit chronik API calls to unseen tokens
Summary:
T2447
Depends on D11942
Add support for cached token info.
The finalizeTokenArray function will accept an object, cachedTokenInfoById. This object is scanned to see what token info is already in cache. If token info is in this object, then Cashtab will not make an API call to get it.
cacheTokenInfoById will be added to local storage in a later diff on this stack. For now, the function will work even if it is not provided.
Test Plan:
Review unit tests and mocks.
npm start
Send a token tx and confirm tx history and wallet balance update appropriately
Receive a token tx and confirm tx history and wallet balance update appropriately
Reviewers: #bitcoin_abc, emack
Reviewed By: #bitcoin_abc, emack
Differential Revision: https://reviews.bitcoinabc.org/D11960