[Earn] strategy – rework requests #799
Open
+224
−187
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.
Description
This pull request refactors and improves the handling of deposit requests in the STG vault feature. The main changes include a shift from using the legacy
useDepositRequestData
hook to a new, more robust system for managing and displaying deposit requests. This includes updates to the Collector contract ABI, new hooks for accessing deposit requests, and a restructuring of UI components to better distinguish between pending and claimable requests.Deposit Request Data Model and Hooks
useDepositRequests
anduseDepositRequest
hooks, which provide a unified and simplified way to access deposit request data for each token. The new model distinguishes between pending and claimable requests based on theeta
field from the Collector contract. (features/earn/vault-stg/deposit/hooks/use-stg-deposit-requests.ts
,features/earn/vault-stg/deposit/hooks/use-deposit-request.ts
) [1] [2]useDepositRequestData
hook, which previously combined data from multiple contracts and was more complex. (features/earn/vault-stg/deposit/hooks/use-stg-deposit-request-data.ts
)Collector Contract ABI Updates
timestamp
field in theRequest
struct, allowing for more accurate tracking of deposit request creation times. (features/earn/vault-stg/contracts/abi/stg-collector.ts
) [1] [2] [3] [4] [5] [6]UI Component Refactoring
Request
component toSTGRequest
, and split pending and claimable request UIs for clarity. Pending requests now useSTGDepositPendingRequest
, while claimable requests useSTGDepositClaimableRequest
. (features/earn/vault-stg/components/request/stg-request.tsx
,features/earn/vault-stg/deposit/stg-deposit-requests/stg-deposit-pending-request.tsx
,features/earn/vault-stg/deposit/stg-deposit-requests/stg-deposit-claimable-request.tsx
) [1] [2] [3] [4] [5] [6]Deposit Form Context and Usage
features/earn/vault-stg/deposit/form-context/stg-deposit-form-context.tsx
) [1] [2] [3]Token-Specific Pending Request Components
features/earn/vault-stg/deposit/stg-deposit-requests/stg-deposit-pending-request-eth.tsx
,features/earn/vault-stg/deposit/stg-deposit-requests/stg-deposit-pending-request-wsteth.tsx
) [1] [2]Checklist: