-
Notifications
You must be signed in to change notification settings - Fork 7
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
Staking UI - escrow, grants, delegation actions and summary #205
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
export default function Delegate(props: { | ||
mpc: MetaportCore | ||
validator: IValidator | undefined | ||
si: StakingInfoMap |
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.
Suggest full name for easier updates in the future
async function stake() { | ||
setLoading(true) | ||
try { | ||
console.log(`Delegating SKL...`) |
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 debug log only
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.
replaced with log()
'delegation' | ||
) | ||
const res = await sendTransaction(delegationContract.delegate, [ | ||
props.validator?.id, |
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 this be left nullable? Maybe better to handle potential null value above and inform user accordingly
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.
handled missed validator
export default function DelegationTypeSelect(props: { | ||
delegationType: DelegationType | ||
handleChange: (event: any) => void | ||
si: StakingInfoMap |
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.
Suggest potentially making si full variable name to improve readiablity later
</p> | ||
</div> | ||
) : null} | ||
{/* <div className={cls(cmn.flexg)}></div> */} |
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.
Remove unused code
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.
removed
src/pages/StakeAmount.tsx
Outdated
// if (!currentValidator) { | ||
// return <Loader text="Loading validator info" /> | ||
// } | ||
|
||
// if (loaded && !available) { | ||
// return <div> | ||
// <Container maxWidth="md"> | ||
// <ErrorTile errorMsg="Delegation type is not available" setErrorMsg={setErrorMsg} /> | ||
// </Container> | ||
// </div> | ||
// } |
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, remove commented code
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.
removed
src/core/interfaces/Delegator.ts
Outdated
// export interface IDelegatorInfo { | ||
// balance: bigint | ||
// staked: bigint | ||
// rewards: bigint | ||
// } |
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, remove commented code
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.
removed
src/core/delegation/validators.ts
Outdated
// if (ESCROW_VALIDATORS.includes(a.id) !== ESCROW_VALIDATORS.includes(b.id)) { | ||
// return a.acceptNewRequests ? -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.
Please, remove commented code
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.
removed
This PR includes:
skale-contracts
library integration for all staking-related contract interactionsmetaport
library with improved transaction handling and additional wallet supportMainnet preview can be found on Vercel.
Tested manually on Testnet and Mainnet contracts, since there are no automated tests for
portal
repo.No performance changes.