Skip to content

Conversation

alx-khramov
Copy link
Contributor

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

  • Introduced the useDepositRequests and useDepositRequest 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 the eta 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]
  • Removed the legacy 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

  • Updated the Collector contract ABI to include a timestamp field in the Request 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

  • Refactored the request display components: renamed and updated the Request component to STGRequest, and split pending and claimable request UIs for clarity. Pending requests now use STGDepositPendingRequest, while claimable requests use STGDepositClaimableRequest. (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

  • Updated the deposit form context to use the new hooks and data model, improving how the UI determines if a deposit is locked (based on claimability rather than vault push status). (features/earn/vault-stg/deposit/form-context/stg-deposit-form-context.tsx) [1] [2] [3]

Token-Specific Pending Request Components

  • Added new components for handling pending requests for ETH and wstETH tokens, correctly fetching USD values for each. (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:

  • Checked the changes locally.
  • Created / updated analytics events.
  • Created / updated the technical documentation (README.md / docs / etc.).
  • Affects / requires changes in other services (Matomo / Sentry / CloudFlare / etc.).

@alx-khramov alx-khramov self-assigned this Oct 8, 2025
@alx-khramov alx-khramov requested a review from a team as a code owner October 8, 2025 09:58
@preview-stands
Copy link

preview-stands bot commented Oct 8, 2025

Preview stand status

Preview stand available on staging-critical

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant