-
-
Notifications
You must be signed in to change notification settings - Fork 251
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/implement solana staking #15409
base: develop
Are you sure you want to change the base?
Conversation
5f0e506
to
47ceb8d
Compare
47ceb8d
to
e7afb45
Compare
@@ -25,7 +25,9 @@ export const WalletStaking = () => { | |||
case 'cardano': | |||
return <CardanoStakingDashboard selectedAccount={selectedAccount} />; | |||
case 'ethereum': | |||
return <EthStakingDashboard selectedAccount={selectedAccount} />; | |||
return <StakingDashboard selectedAccount={selectedAccount} />; |
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.
return <StakingDashboard selectedAccount={selectedAccount} />; |
@@ -5,21 +5,25 @@ import { WalletLayout } from 'src/components/wallet'; | |||
import { useSelector } from 'src/hooks/suite'; | |||
|
|||
import { EmptyStakingCard } from './components/EmptyStakingCard'; | |||
import { StakingDashboard } from './components/StakingDashboard'; | |||
import { StakingDashboard as EthStakingDashboard } from '../EthStakingDashboard/components/StakingDashboard'; |
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.
could you please call the file and component EthStakingDashboard?
@@ -8625,7 +8625,7 @@ const messages = defineMessagesWithTypeCheck({ | |||
TR_STAKE_STAKING_IS: { | |||
id: 'TR_STAKE_STAKING_IS', | |||
defaultMessage: | |||
"Staking involves temporarily locking your Ethereum assets to support the blockchain's operation. In return, you'll earn additional Ethereum as a reward.", | |||
"Staking involves temporarily locking your {network} assets to support the blockchain's operation. In return, you'll earn additional {network} as a reward.", |
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 say @jirih-stsh
earn additional ETH as a reward.
orearn additional Ethereum as a reward.
earn additional SOL as a reward.
orearn additional Solana as a reward.
@@ -18,6 +19,8 @@ export const ACCOUNT_TABS = [ | |||
]; | |||
|
|||
export const AccountNavigation = () => { | |||
const isDebugModeActive = useSelector(selectIsDebugModeActive); |
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.
could you please add all those is debug things into 1 separate commit or add some specific TODOs somewhere so that we easily find what we should remove before launch?
details: 'basic', | ||
suppressBackupWarning: true, | ||
}); | ||
const [basic, stakingAccounts] = await Promise.all([ |
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.
note: @tomasklim TODO check if ok
@@ -28,6 +29,10 @@ export const composeTransaction = | |||
return dispatch(stakeFormEthereumActions.composeTransaction(formValues, formState)); | |||
} | |||
|
|||
if (account.networkType === 'solana') { |
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.
use switch here
|
||
|
||
|
||
const calculate = ( |
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.
au, this file is really big copy-paste. can we try to avoid that, please
if (output.type === 'send-max' || output.type === 'send-max-noaddress') { | ||
const minEthBalanceForStakingWei = | ||
MIN_SOL_BALANCE_FOR_STAKING.multipliedBy(LAMPORTS_PER_SOL); | ||
const minAmountWithFeeWei = new BigNumber(minEthBalanceForStakingWei).plus(feeInLamports); |
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.
Please, do not use eth referencing name where it does not belong
return new BigNumber(amount).div(LAMPORTS_PER_SOL).toFixed(9); | ||
}; | ||
|
||
type SolhNetwork = 'devnet' | 'mainnet-beta'; |
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.
type SolhNetwork = 'devnet' | 'mainnet-beta'; | |
type SolNetwork = 'devnet' | 'mainnet-beta'; |
const totalAmount = accounts.reduce((acc, solAccount) => { | ||
const { account } = solAccount; | ||
|
||
return acc.plus(account?.data.parsed.info.stake.delegation.stake); |
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 probably does not include mev kickback and rent. Do we want to count those 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.
.
Description
Related Issue
Screenshots: