-
Notifications
You must be signed in to change notification settings - Fork 48
add deposit #816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/hub
Are you sure you want to change the base?
add deposit #816
Conversation
🦋 Changeset detectedLatest commit: 016b7cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
|
@gbonumore is attempting to deploy a commit to the Status Team on Vercel. A member of the Team first needs to authorize it. |
| 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(', ') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
JulesFiliot
left a comment
There was a problem hiding this 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic number
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic number
There was a problem hiding this comment.
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
apps/hub/src/utils/currency.ts
Outdated
| ): string { | ||
| return formatTokenAmount(amount, 'KARMA', { | ||
| ...options, | ||
| tokenDecimals: 0, // KARMA values are already in display units |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic number
JulesFiliot
left a comment
There was a problem hiding this 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
|
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)
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@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" devAfter that you can also check that the build of the pnpm -r --filter "...hub" build |
|
I ran The build process itself is not working, although I retried it after removing But |
| "clean": "rimraf .next .vercel/output node_modules" | ||
| }, | ||
| "dependencies": { | ||
| "@radix-ui/react-dialog": "^1.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: trigger dialog from sidebar's Deposit menu item as well https://www.figma.com/design/1XbZL2WrTG5DqJO8DovE0H/Website----status.network?node-id=5098-21598&m=dev
- 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>
67e527e to
15d2620
Compare
JulesFiliot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
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
|
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 |
closes #775