-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: wallet connect * account subscribing and switching * fast dev * fix unmount * upgrade baseui and remove jotai provider * add auto connect wallet hook and fix some warnings * replace signer and remove useless code * clear assets after account changed * remove react-toastify * remove all legacy extension code * fix end-game style * remove unused components * fix style when has too many accounts * sort wallets
- Loading branch information
1 parent
1a21eac
commit 26c55e9
Showing
126 changed files
with
2,043 additions
and
2,606 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
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
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
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 |
---|---|---|
@@ -1,27 +1,18 @@ | ||
import axios from 'axios' | ||
import {useEffect, useState} from 'react' | ||
import {useQuery} from 'react-query' | ||
|
||
type PHAPriceResponse = { | ||
price: number | ||
} | ||
|
||
const usePHAPrice = (): number => { | ||
const [price, setPrice] = useState(0) | ||
|
||
// FIXME: use latest api | ||
useEffect(() => { | ||
const usePHAPrice = (): number | undefined => { | ||
return useQuery('PHAPrice', () => | ||
axios | ||
.get<PHAPriceResponse>( | ||
'https://app-misc-api.phala.network/coin_market_charts/PHA' | ||
) | ||
.then(({data}) => { | ||
if (data) { | ||
setPrice(data.price) | ||
} | ||
}) | ||
}, []) | ||
|
||
return price | ||
.then(({data}) => data.price) | ||
).data | ||
} | ||
|
||
export default usePHAPrice |
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
Oops, something went wrong.