Skip to content

Conversation

@gbonumore
Copy link

@gbonumore gbonumore commented Oct 17, 2025

  • Added useApprovePreDepositToken hook for token approval process.
  • Implemented useExchangeRate hook to fetch token exchange rates from Binance.
  • Developed useMaxPreDepositValue hook to read maximum deposit amount for a user.
  • Introduced usePreDepositStateContext and usePreDepositStateMachine for managing pre-deposit state.
  • Created usePreDepositVault hook for depositing tokens into a vault.
  • Updated DashboardPage to include vault selection and pre-deposit modal.

closes #775

@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2025

🦋 Changeset detected

Latest commit: 016b7cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@status-im/status-network Patch
hub Patch
status.app Patch
status.network Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Oct 17, 2025

@gbonumore is attempting to deploy a commit to the Status Team on Vercel.

A member of the Team first needs to authorize it.

@felicio felicio requested review from a team, JulesFiliot, felicio, jinhojang6 and jkbktl October 18, 2025 01:25
const { name, apy, rewards, icon, onDeposit } = props
const apyValue = apy.endsWith('%') ? apy.slice(0, -1) : apy
const rewardsLine = rewards.join(', ')
const rewardsLine = rewards.map(reward => reward.name).join(', ')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are the chances that reward.name is not undefined?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is defined by us, since it's required this would not compile

Copy link
Contributor

@JulesFiliot JulesFiliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, just some magic numbers.

Also an open question but why don't we use SVGs for icons?

.with({ exchangeRate: P.nullish }, () => 0)
.with({ amountInputNumber: P.when(n => isNaN(n) || n <= 0) }, () => 0)
.with({ calculatedUSD: P.when(n => !isFinite(n)) }, () => null)
.with({ calculatedUSD: P.when(n => n > 1_000_000_000_000) }, () => null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There must be a good reason but why 1_000_000_000_000 specifically?

Copy link
Author

@gbonumore gbonumore Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to avoid insanely dollar values and do useless api calls, so this check might not be even here (this is more or less the same UX swap protocols offer when you try to input unreal money) feel free to change this number to a fair value that doesn't break UI or directly on the API call to prevent the call to be fired

enabled,
refetchInterval,
staleTime,
retry: 3,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic number

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed you might want to setup default retries on the queryclient config

options: Omit<FormatTokenOptions, 'tokenDecimals'> = {}
): string {
return formatTokenAmount(amount, 'ETH', {
decimals: 4, // Default to 4 decimals for ETH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic number

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file comes from #811 so you guys want to address these on that PR first

): string {
return formatTokenAmount(amount, 'KARMA', {
...options,
tokenDecimals: 0, // KARMA values are already in display units
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic number

): string {
const {
currency = 'USD',
tokenDecimals = 0, // Default to 0 for currency values (already in display units)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic number

Copy link
Contributor

@JulesFiliot JulesFiliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

App is not building anymore due to mismatching types names

@github-project-automation github-project-automation bot moved this from In Progress to ToDo in Web & User Interfaces Oct 22, 2025
@github-project-automation github-project-automation bot moved this from ToDo to Waiting in Web & User Interfaces Oct 23, 2025
@jinhojang6
Copy link
Contributor

jinhojang6 commented Oct 27, 2025

I can't build this branch yet with the following error:

wallet:build:  ERROR  [vite:define] The service was stopped: write EPIPE                                                                                
wallet:build:  ELIFECYCLE  Command failed with exit code 1.
wallet:build:  ELIFECYCLE  Command failed with exit code 1.
...
status.app#build: command (/Users/.../status-web/apps/status.app) /Users/jinhojang/Library/pnpm/.tools/@pnpm+macos-arm64/9.12.3/bin/pnpm run build exited (1)

@vercel
Copy link

vercel bot commented Oct 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
status-network-hub Error Error Nov 18, 2025 1:57pm

@JulesFiliot
Copy link
Contributor

I can't build this branch yet with the following error:

wallet:build:  ERROR  [vite:define] The service was stopped: write EPIPE                                                                                
wallet:build:  ELIFECYCLE  Command failed with exit code 1.
wallet:build:  ELIFECYCLE  Command failed with exit code 1.
...
status.app#build: command (/Users/.../status-web/apps/status.app) /Users/jinhojang/Library/pnpm/.tools/@pnpm+macos-arm64/9.12.3/bin/pnpm run build exited (1)

@jinhojang6 at the root this should work:

nvm use 20 && pnpm install && pnpm build
# even if the status.app & wallet builds fail, the command bellow should then work correctly
pnpm --filter "hub" dev

After that you can also check that the build of the hub passes by doing

pnpm -r --filter "...hub" build

@jinhojang6
Copy link
Contributor

jinhojang6 commented Oct 31, 2025

@JulesFiliot

I ran nvm use 20 && pnpm install && pnpm build but got the same error.

wallet:build:  ERROR  [vite:esbuild] The service was stopped                                                                                            5:41:55 PM
wallet:build: file: /Users/jinhojang/Desktop/work/status-web/apps/wallet/src/data/bitcoin/mempool.ts

...

wallet:build:  ERROR  Failed to build background, page                                                                                                  5:41:55 PM
wallet:build: 
wallet:build:     at buildEntrypoints
...

The build process itself is not working, although I retried it after removing node_modules.

But pnpm --filter "hub" dev definitely works

"clean": "rimraf .next .vercel/output node_modules"
},
"dependencies": {
"@radix-ui/react-dialog": "^1.1.1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkbktl jkbktl changed the base branch from feat/wallet-connect to main November 5, 2025 11:45
gbonumore and others added 5 commits November 5, 2025 13:47
- Added useApprovePreDepositToken hook for token approval process.
- Implemented useExchangeRate hook to fetch token exchange rates from Binance.
- Developed useMaxPreDepositValue hook to read maximum deposit amount for a user.
- Introduced usePreDepositStateContext and usePreDepositStateMachine for managing pre-deposit state.
- Created usePreDepositVault hook for depositing tokens into a vault.
- Updated DashboardPage to include vault selection and pre-deposit modal.
Co-authored-by: Onuwa Nnachi Isaac <matrix4u2002@gmail.com>
@jkbktl jkbktl force-pushed the feat/add-deposit-section branch from 67e527e to 15d2620 Compare November 5, 2025 12:53
@jkbktl jkbktl changed the base branch from main to release/hub November 5, 2025 12:55
Copy link
Contributor

@JulesFiliot JulesFiliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@felicio felicio changed the title feat: Add UI and hooks for pre-deposit functionality add deposit Nov 6, 2025
@status-im-auto
Copy link
Member

status-im-auto commented Nov 6, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ eea0d8d #14 2025-11-06 11:19:40 ~41 sec connector 📦zip
✔️ eea0d8d #14 2025-11-06 11:20:10 ~1 min wallet 📦zip

feat: add useDepositFlow hook for managing deposit actions and validations

feat: implement useMultipleExchangeRates hook for fetching multiple token exchange rates

feat: create useMultiplePreDepositTVL hook for reading total assets from multiple vaults

feat: add useMultiplePreDepositTVLInUSD hook for converting TVL to USD

feat: implement usePreDepositLimits hook for fetching deposit limits from vaults

feat: create usePreDepositTVL hook for reading total assets of a single vault

feat: add usePreDepositTVLInUSD hook for converting vault TVL to USD

fix: update usePreDepositVault hook to include chainId in deposit calls

feat: implement useVaultSharesValidation hook for validating deposit shares

refactor: update DashboardPage to pass vault object to VaultCard component
@gbonumore
Copy link
Author

Hey guys!

Just an heads up on this PR, I added all the vaults which are currently not active, if you want to test them you will need to fork Mainnet and Linea on a test environment and call advanceState(uint8 newState) with 1 as a parameter for every vault.
(the caller for this function at the moment should be 0x177fC5D8e0AF9f1708684Ae144805A34d691FfA4 on mainnet and 0xbE076969D1771E16d80e397Def794C85953629b5 on Linea which are the current admins, we should sync later for moving these roles to a multisig of your convenience).
I also added some utilities for TVL and TVL on USD as you guys requested, let me know if I can be helpful in any way.

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

Labels

None yet

Projects

Status: Waiting

Development

Successfully merging this pull request may close these issues.

add deposit section

7 participants