-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
feat(suite): solana staking dashboard implementation #16027
base: develop
Are you sure you want to change the base?
feat(suite): solana staking dashboard implementation #16027
Conversation
2949fa0
to
7e7e26f
Compare
packages/suite/src/components/wallet/WalletLayout/AccountsMenu/AccountSection.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/views/wallet/staking/components/StakingDashboard/StakingDashboard.tsx
Show resolved
Hide resolved
7e7e26f
to
7ce2999
Compare
When staking on an account for the first time. After stake, can we show staking dashboard faster? It takes user back to the |
|
|
We can display the staking dashboard more quickly when transactions are supported. Currently, checking for Solana staking relies on the existence of staking accounts. This serves as a temporary solution, but eventually, we should base the check on the transactions themselves. Once we have transactions, we can probably show the dashboard faster. |
misc = { | ||
owner: accountInfo?.owner, | ||
rent: Number(rent), | ||
solStakingAccounts: [], | ||
solStakingAccounts: stakingData?.stakingAccounts, | ||
solEpoch: stakingData?.epoch, |
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.
it feels odd to have blockchain related info (network epoch) with account related data 🤔
const { result: stakingAccounts } = delegations; | ||
|
||
return stakingAccounts; | ||
const epochInfo = await solanaClient.getEpochInfo(); |
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 will be called for each account instead of fetching that info only once for the whole network - imo this should not be fetched nor stored with account data
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.
You're right. Where do you think it should be fetched/stored instead?
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 do you think @martykan ? Where should we store this info?
...ents/suite/modals/ReduxModal/UserContextModal/StakeModal/StakingInfoCards/EstimatedGains.tsx
Show resolved
Hide resolved
...s/suite/src/views/wallet/staking/components/StakingDashboard/components/EmptyStakingCard.tsx
Outdated
Show resolved
Hide resolved
...s/suite/src/views/wallet/staking/components/StakingDashboard/components/EmptyStakingCard.tsx
Outdated
Show resolved
Hide resolved
74cd1b0
to
bf16abe
Compare
I believe the useStakeEthForm, useUnstakeEthForm, and useClaimEthForm hooks, as well as Ethereum-specific components, should be refactored to support both Ethereum and Solana. However, this would likely require significant work, so it might be better to address it in a separate PR. For now, prioritizing feature support seems more practical, as we discussed previously. Wdyt, @tomasklim? |
4460aff
to
b9f7e1c
Compare
b9f7e1c
to
320ea32
Compare
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.
Wdyt, @tomasklim?
I agree, let's merge this asap.
I've rebased and done some small fixes related to symbols. We are now using getNetworkDisplaySymbol
In UI we use it instead of pure account.symbol
to support L2s (Base -> ETH symbol)
btw I dont see staking accounts now. Do you know why? @dev-pvl
320ea32
to
fe44017
Compare
solPendingStakeBalance: balances[StakeState.activating], | ||
solPendingUnstakeBalance: balances[StakeState.deactivating], | ||
canClaimSol: new BigNumber(balances[StakeState.deactivated]).gt(0), | ||
canUnstakeSol: new BigNumber(balances[StakeState.active]).gt(0), |
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.
one more thing:
When user stakes SOL -> creates stake account -> delegates and sets stake to activating state, he can still technically get the SOL right away in case he changed his mind. If I see correctly, based on how solClaimableBalance
and canUnstakeSol
are defined, we wont allow this in Suite.
It just takes to deactivate the stake account and withdraw. No need to wait 2 epochs for activating and deactivating the account again.
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.
Do we want to cover this edgecase @tomasklim ?
Description
Related Issue
Resolve #15231
Resolve #15266
Resolve #15233
Resolve #15229
Resolve #16036
Resolve #16037
Resolve #16038
Screenshots