Repository navigation
Derive the unshield claim summary from the list and decrypt queries - #474
Draft
alexshchur wants to merge 2 commits into
Draft
alexshchur wants to merge 2 commits into
alexshchur wants to merge 2 commits into
Conversation
|
Contributor
|
Vercel previews (commit
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Placeholder for a refactor of
useCofheTokenClaimableanduseCofheTokensClaimable. Blocked on #452.Why
The claim summary today is computed inside its own query: it reads the claim list from chain, decrypts each pending claim imperatively through the client builder, and caches the reduced totals. That bypasses the per-handle decrypt queries the rest of
@cofhe/reactuses, so the plaintexts are not shared, and the summary has to carry the active ACP in its own key to stay correct (#435).Plan
useCofheDecryptForViewList(feat:useCofheDecryptFn,useCofheDecryptForTxand a configurable decrypt timeout #452), which already keys and caches per handle and per ACP.UnshieldClaimsSummaryin auseMemo; the multi-token hook flattens all handles into one decrypt list and regroups by token.data,isFetching,refetch);isFetchingwill also cover the decrypts.Transaction invalidation is unchanged: it already targets the list key prefix, and a handle's plaintext never needs invalidating.