@@ -10,7 +10,7 @@ import {
1010 Label ,
1111} from "@headlessui/react" ;
1212import { ArrowPathIcon } from "@heroicons/react/24/outline" ;
13- import { getEvmContractAddress } from "@pythnetwork/contract-manager/utils/utils" ;
13+ import { getEvmPriceFeedContractAddress } from "@pythnetwork/contract-manager/utils/utils" ;
1414import PythAbi from "@pythnetwork/pyth-sdk-solidity/abis/IPyth.json" ;
1515import PythErrorsAbi from "@pythnetwork/pyth-sdk-solidity/abis/PythErrors.json" ;
1616import { 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 } ) ,
0 commit comments