We're currently making several calls to status-go functions IsCurrencyFiat and GetFiatCurrencyMinorUnit, which simply perform a lookup on a static table. Fetch the whole table and keep it in memory on the Nim side instead.
Add method to status-go for fetching the complete FiatSymbol -> DecimalPlaces Table.
Retrieve that table and cache it in the Currency service during application startup (the table is static, it will only change with a new version of the iso4217 library, so we are able to do this only once for the lifetime of the application)
Move functions isCurrencyFiat and getFiatDisplayDecimals from the utils to the service and make sure they use the cached table instead of calls to the backend.
Description
We're currently making several calls to
status-go
functionsIsCurrencyFiat
andGetFiatCurrencyMinorUnit
, which simply perform a lookup on a static table. Fetch the whole table and keep it in memory on the Nim side instead.status-go
for fetching the completeFiatSymbol -> DecimalPlaces
Table.isCurrencyFiat
andgetFiatDisplayDecimals
from theutils
to theservice
and make sure they use the cached table instead of calls to the backend.