feat: removed claimed status from boost query #190
Merged
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.
This PR makes the following changes -
claimed
field from theget_boost
query which returns the boost information based onid
. Since there are mulltiple winners, we don't have aclaimed
value as such since there is no single winner.pending_claims
query to support multiple winners. Currrently the query didn't support querying the correct pending claims by a user.Earlier approach -
but now - the winner per boost is multiple, so the searching query doesn't function the same way.
To tackle this, i unwind in the first step to make it similar to how the query used to run and then check for equality in the following steps on the following fields - claim boost
id
to the matching boost id ,winner
(the winner address) to the claiming winner address and_cursor.to
tonull
.the flow for the product looks something like this -
4)if nothing on localstorage , then we check from pending claims(this takes data from indexer and finds if user has claimed anything from contract for this boost id)
a) if winner -> show a disabled/enabled claim button depending on steps 3 and 4
b) if not winner -> show the
better luck next time
imageThe checks we make for enabled and disabled claim button -
Enabled (these both are AND conditions)
Disabled (these both are OR conditions)