Closed odcheung closed 1 year ago
Thanks @yugure-orca.
I've made the following amendments:
ttl
to maxAge
refreshAll
from the interfaceI think the ability to fetch multiple types at once is a reasonable responsibility for this class. Of course, since this class depends on the account-request utilities layer, that layer would have to support it as well. Can you elaborate more on the "some accounts may be updated more recently"? I'd imagine if only accounts that exceeds the maxAge
will be filtered, fetched and updated. We'll reconstruct the result purely based off of cached values just like we do for getAccounts
/ getAccountsAsArray
today.
Also, I think given this PR is more for porting and no new feature depends on the get multiple types in 1 request
just yet, I think that new feature should be left in a separate PR. what do you think?
gotcha. Yeah that edge case would be an issue even for the current getAccounts calls. I'll leave a comment in the code.
An efficient solution is also not exactly clear if we must enforce all gMA calls to be returned on a consistent slot. But the good thing is this use-case isn't present (yet) for the UI, so we still have some time to figure it out.
AccountFetcher
to allow easy fetching / caching of on-chain accountsVerification