-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Transfer locked tokens] use hooks (#312)
* Use hooks * Use hooks
- Loading branch information
Showing
4 changed files
with
69 additions
and
149 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useQuery } from 'react-query' | ||
import { useStakeConnection } from './useStakeConnection' | ||
import { MainStakeAccount } from 'pages' | ||
|
||
export const SplitRequestQueryPrefix = 'split-request' | ||
|
||
export function useSplitRequest(mainStakeAccount: MainStakeAccount) { | ||
const { data: stakeConnection } = useStakeConnection() | ||
|
||
return useQuery( | ||
[SplitRequestQueryPrefix, mainStakeAccount], | ||
async () => { | ||
if (mainStakeAccount === 'NA') return undefined | ||
|
||
// only enabled when stakeConnection and mainStakeAccount is defined | ||
const splitRequest = await stakeConnection?.getSplitRequest( | ||
mainStakeAccount! | ||
) | ||
|
||
return splitRequest | ||
}, | ||
{ | ||
enabled: stakeConnection !== undefined && mainStakeAccount !== undefined, | ||
} | ||
) | ||
} |
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
733bd7b
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.
Successfully deployed to the following URLs:
staking-devnet – ./
staking-devnet-pyth-web.vercel.app
governance-nu.vercel.app
staking-devnet-git-main-pyth-web.vercel.app
733bd7b
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.
Successfully deployed to the following URLs:
staking – ./
staking-git-main-pyth-web.vercel.app
staking.pyth.network
staking-rho-nine.vercel.app
staking-pyth-web.vercel.app