Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Created type for price fn names (#2205)
Browse files Browse the repository at this point in the history
Co-authored-by: Leandro <[email protected]>
  • Loading branch information
alfetopito and Leandro authored Jan 19, 2022
1 parent 7751865 commit a657285
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/custom/state/claim/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,12 @@ export function useUsdcPrice(): string | null {
return _useVCowPriceForToken('usdcPrice')
}

type VCowPriceFnNames = 'nativeTokenPrice' | 'gnoPrice' | 'usdcPrice'

/**
* Generic hook for fetching contract value for the many prices
*/
function _useVCowPriceForToken(priceFnName: 'nativeTokenPrice' | 'gnoPrice' | 'usdcPrice'): string | null {
function _useVCowPriceForToken(priceFnName: VCowPriceFnNames): string | null {
const { chainId } = useActiveWeb3React()
const vCowContract = useVCowContract()

Expand Down

0 comments on commit a657285

Please sign in to comment.