-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d64d611
commit 451bb26
Showing
11 changed files
with
155 additions
and
84 deletions.
There are no files selected for viewing
42 changes: 5 additions & 37 deletions
42
apps/cow-amm-deployer/src/app/amms/[id]/(components)/BalancerPriceInformation.tsx
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
63 changes: 46 additions & 17 deletions
63
apps/cow-amm-deployer/src/app/amms/[id]/(components)/ChainlinkPriceInformation.tsx
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
26 changes: 23 additions & 3 deletions
26
apps/cow-amm-deployer/src/app/amms/[id]/(components)/PriceInformation.tsx
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
37 changes: 37 additions & 0 deletions
37
apps/cow-amm-deployer/src/hooks/useDecodedPriceOracleData.ts
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,37 @@ | ||
import { Address } from "@bleu/utils"; | ||
import { useEffect, useState } from "react"; | ||
|
||
import { decodePriceOracleWithData } from "#/lib/decodePriceOracle"; | ||
import { PRICE_ORACLES, PriceOracleData } from "#/lib/types"; | ||
import { ChainId } from "#/utils/chainsPublicClients"; | ||
|
||
type DecodedPriceOracleData = [PRICE_ORACLES, PriceOracleData]; | ||
|
||
interface UseDecodedPriceOracleWithDataState { | ||
isLoading: boolean; | ||
decodedData?: DecodedPriceOracleData; | ||
} | ||
|
||
export function useDecodedPriceOracleData({ | ||
priceOracleAddress, | ||
priceOracleData, | ||
chainId, | ||
}: { | ||
priceOracleAddress: Address; | ||
priceOracleData: Address; | ||
chainId: ChainId; | ||
}): UseDecodedPriceOracleWithDataState { | ||
const [state, setState] = useState<UseDecodedPriceOracleWithDataState>({ | ||
isLoading: true, | ||
}); | ||
|
||
useEffect(() => { | ||
decodePriceOracleWithData({ | ||
address: priceOracleAddress, | ||
priceOracleData, | ||
chainId, | ||
}).then((data) => setState({ isLoading: false, decodedData: data })); | ||
}, [priceOracleAddress, priceOracleData, chainId]); | ||
|
||
return state; | ||
} |
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.