-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wallet-dashboard): group and display timelocked stakes (#1779)
* feat(wallet-dashboard): fetch supply increase timelocked portfolio * feat(wallet-dashboard): add new route to vesting * feat(wallet-dashboard): update request timelocked objets to get all * feat(wallet-dashboard): improve the way to get timelock objects * fix(wallet-dashboard): remove testing constants * feat(wallet-dashboard): update filter in get timelocked objects * fix(wallet-dashboard): remove TESTING_SUPPLY_INCREASE_VESTING_LABEL reference * feat(wallet-dashboard): hook collect(unwrap) feature to dashboard WIP * refactor: revert prettier changes coming from last merge * fix(wallet-dashboard): remove debris * fix(wallet-dashboard): add current epoch ms to getVestingOverview * feat(wallet-dashboard): add stale time to get current epoch hook * feat(wallet-dashboard): add timelock stakes to vesting portfolio logic * feat(wallet-dashboard): add ptb to unlock all timelocked objects * fix(wallet-dashboard): improvements * fix(wallet-dashboard): improve filters to get timelocked objects * feat(wallet-dashboard): map timelocked staked iota response * fix(wallet-dashboard): update Date.now by current epoch * fix(wallet-dashboard): improve transaction to unlock timelocked objects * fix(wallet-dashboard): improve unlock timelocked objects transaction * fix(wallet-dashboard): improvements and rename variables * fix(wallet-dashboard): rename hook * feat(wallet-dashboard): use new endpoint to get staked timelocked objects * fix(wallet-dashboard): modify mapped data with the new response * refactor: separate vesting from timelock * fix(wallet-dashboard): create a util function to check if a timelocked object is unlocked * fix(wallet-dashboard): remove redundant "all" in unlockedTimelockedObjects * fix: mising files from refactor * fix(wallet-dashboard): remove unnecessary conversion * refactor: update iota-sdk name * fix(wallet-dashboard): update logic with new DelegatedTimelockedStake interface * fix(wallet-dashboard): update test logic with new DelegatedTimelockedStake interface * feat(wallet-dashboard): add hook to get validators info * feat(wallet-dashboard): group and display timelocked stakes * fix(wallet-dashboard): update delegated staked timelocked interface * fix(wallet-dashboard): rename timelocked staked object and modify the fall back validator name * fix(wallet-dashboard): group timelocked staked objects * fix(wallet-dashboard): add waitForTransactionBlock to collect function * fix(wallet-dashboard): move groupTimelockedStakedObjects to timelock util * fix(wallet-dashboard): rename useUnlockTimelockedObjects hook * fix(wallet-dashboard): rename isTimelockedUnlockable function * fix(wallet-dashboard): vesting tests * fix(wallet-dashboard): bad merge * fix(wallet-dashboard): improvement startEpoch value * fix(wallet-dashboard): rename startEpoch to stakeRequestEpoch in TimelockedStakedObjectsGrouped interface --------- Co-authored-by: Begoña Álvarez de la Cruz <[email protected]> Co-authored-by: Bran <[email protected]>
- Loading branch information
1 parent
f221389
commit 6bfce92
Showing
5 changed files
with
140 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2024 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { useIotaClient } from '@iota/dapp-kit'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
export function useGetActiveValidatorsInfo() { | ||
const client = useIotaClient(); | ||
return useQuery({ | ||
// eslint-disable-next-line @tanstack/query/exhaustive-deps | ||
queryKey: ['get-active-validators-info'], | ||
queryFn: async () => { | ||
const iotaSystemState = await client.getLatestIotaSystemState(); | ||
return iotaSystemState.activeValidators; | ||
}, | ||
staleTime: 10 * 60 * 1000, // 10 minutes | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters