-
-
Notifications
You must be signed in to change notification settings - Fork 263
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?
@@ -74,7 +74,15 @@ export const EstimatedGains = () => { | |||
id="TR_STAKING_YOUR_EARNINGS" | |||
values={{ | |||
a: chunks => ( | |||
<TrezorLink href={HELP_CENTER_ETH_STAKING}>{chunks}</TrezorLink> | |||
<TrezorLink |
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.
whole EstimatedGains
seems to be for ETH only. There are no estimations for SOL, it seems. If that is the case, can we have it renamed to smthng like EthEstimatedGains
or make it universal?
If the code used actually is universal, can we rename it not to use eth in it?
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.
As far as I know, we have EstimatedGains for Solana. Refactored component a bit to avoid this confusion 0c3a403
UNSTAKE_INTERCHANGES, | ||
WALLET_SDK_SOURCE, | ||
UNSTAKING_ETH_PERIOD, | ||
} from '@suite-common/wallet-constants'; | ||
import type { NetworkSymbol } from '@suite-common/wallet-config'; | ||
import { getEthereumEstimateFeeParams, isPending, sanitizeHex } from '@suite-common/wallet-utils'; | ||
import { |
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.
If this file is not related only to eth, can we have everything renamed not to use eth in it?
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.
I belive it is related to eth. Created a separate utils file for common staking functions. 0c3a403
@@ -127,10 +128,16 @@ export const AssetCard = ({ | |||
selectAssetAccountsThatStaked(state, stakingAccountsForAsset), | |||
); | |||
|
|||
// TODO: remove this logic when Solana staking is available |
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.
we can maybe have selector for this logic and reuse it
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.
added selector, 4460aff
@@ -30,7 +30,6 @@ export const EmptyStakingCard = () => { | |||
const { isStakingDisabled, stakingMessageContent } = useMessageSystemStaking(); | |||
|
|||
const ethApy = useSelector(state => selectPoolStatsApyData(state, account?.symbol)); |
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.
pls rename to apy or smthng like that, if there can be solapy as well
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.
done, 0c3a403
@@ -30,7 +30,6 @@ export const EmptyStakingCard = () => { | |||
const { isStakingDisabled, stakingMessageContent } = useMessageSystemStaking(); | |||
|
|||
const ethApy = useSelector(state => selectPoolStatsApyData(state, account?.symbol)); | |||
// TODO: calc solApy | |||
|
|||
const dispatch = useDispatch(); | |||
const openStakingEthInANutshellModal = () => { |
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.
should here be only eth and no sol?
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.
renamed as well, 0c3a403
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.
I dont see it renamed @dev-pvl
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? |
Description
Related Issue
Resolves #15231
Resolve #15266
Resolve #15233
Resolve #15229
Resolve #16036
Resolve #16037
Resolve #16038
Screenshots