Skip to content

Commit 76d907b

Browse files
committed
update
1 parent 76f013e commit 76d907b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

apps/api-reference/src/components/EvmApi/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Label,
1111
} from "@headlessui/react";
1212
import { ArrowPathIcon } from "@heroicons/react/24/outline";
13-
import { getEvmContractAddress } from "@pythnetwork/contract-manager/utils/utils";
13+
import { getEvmPriceFeedContractAddress } from "@pythnetwork/contract-manager/utils/utils";
1414
import PythAbi from "@pythnetwork/pyth-sdk-solidity/abis/IPyth.json";
1515
import PythErrorsAbi from "@pythnetwork/pyth-sdk-solidity/abis/PythErrors.json";
1616
import { ChainIcon } from "connectkit";
@@ -251,7 +251,7 @@ export const EvmApi = <ParameterName extends string>({
251251
? {
252252
name: currentChain.name,
253253
rpcUrl: currentChain.rpcUrls.default.http[0] ?? "",
254-
contractAddress: getEvmContractAddress(chainId, "priceFeed"),
254+
contractAddress: getEvmPriceFeedContractAddress(chainId) ?? "",
255255
}
256256
: { name: "", rpcUrl: "", contractAddress: "" },
257257
paramValues,
@@ -294,7 +294,11 @@ const Example = <ParameterName extends string>({
294294
const updateValues = useCallback(() => {
295295
if (typeof example.parameters === "function") {
296296
setError(undefined);
297-
const address = getEvmContractAddress(config.state.chainId, "priceFeed");
297+
const address = getEvmPriceFeedContractAddress(config.state.chainId);
298+
if (!address) {
299+
setError("No contract address found for this chain");
300+
return;
301+
}
298302
const params = example.parameters({
299303
readContract: (functionName, args) =>
300304
readContract(config, { abi, address, functionName, args }),

apps/api-reference/src/components/EvmProvider/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { WagmiProvider, createConfig, http, useChainId } from "wagmi";
1111

1212
import { metadata } from "../../metadata";
1313

14-
const CHAINS = getAllEvmChainsIds().map((id) =>
14+
const CHAINS = getAllEvmChainsIds.map((id) =>
1515
Object.values(chains).find((chain) => chain.id === id),
1616
).filter((chain) => chain !== undefined) as unknown as readonly [
1717
chains.Chain,

0 commit comments

Comments
 (0)