99 readJSONCache ,
1010 writeJSONCache ,
1111} from '@bgd-labs/js-utils' ;
12- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13- // @ts -expect-error
14- import { ChainList , getRPCUrl , SupportedChainIds } from '@bgd-labs/rpc-env' ;
12+ import { ChainList , getRPCUrl , SupportedChainIds } from '@bgd-labs/toolbox' ;
1513import { Address , getContract , Hex } from 'viem' ;
1614import { getBlock , getBlockNumber } from 'viem/actions' ;
1715
@@ -74,7 +72,7 @@ async function updatePayloadsEvents(
7472 bookKeepingCache : BookKeepingCache ,
7573) {
7674 const client = createViemClient ( {
77- chain : ChainList [ chainId as SupportedChainIds ] ,
75+ chain : ChainList [ chainId as SupportedChainIds ] as any ,
7876 rpcUrl : getRPCUrl ( chainId as SupportedChainIds , {
7977 alchemyKey : process . env . ALCHEMY_API_KEY ,
8078 } ) ,
@@ -129,7 +127,7 @@ async function updatePayloadsData(
129127 readJSONCache < PayloadsCache > ( payloadsPath , controller ) || { } ;
130128
131129 const client = createViemClient ( {
132- chain : ChainList [ chainId as SupportedChainIds ] ,
130+ chain : ChainList [ chainId as SupportedChainIds ] as any ,
133131 rpcUrl : getRPCUrl ( chainId as SupportedChainIds , {
134132 alchemyKey : process . env . ALCHEMY_API_KEY ,
135133 } ) ,
@@ -181,7 +179,7 @@ async function updateGovCoreEvents(
181179 const eventsPath = `${ Number ( govCoreChainId ) } /events` ;
182180
183181 const client = createViemClient ( {
184- chain : ChainList [ govCoreChainId as SupportedChainIds ] ,
182+ chain : ChainList [ govCoreChainId as SupportedChainIds ] as any ,
185183 rpcUrl : getRPCUrl ( govCoreChainId as SupportedChainIds , {
186184 alchemyKey : process . env . ALCHEMY_API_KEY ,
187185 } ) ,
@@ -238,7 +236,7 @@ async function updateVMEvents(
238236 const portalContract = getContract ( {
239237 abi : IVotingPortal_ABI ,
240238 client : createViemClient ( {
241- chain : ChainList [ govCoreChainId as SupportedChainIds ] ,
239+ chain : ChainList [ govCoreChainId as SupportedChainIds ] as any ,
242240 rpcUrl : getRPCUrl ( govCoreChainId as SupportedChainIds ) ,
243241 } ) ,
244242 address : portal ,
@@ -255,7 +253,7 @@ async function updateVMEvents(
255253 const path = `${ chainId } /events` ;
256254 const address = machine ;
257255 const client = createViemClient ( {
258- chain : ChainList [ chainId as SupportedChainIds ] ,
256+ chain : ChainList [ chainId as SupportedChainIds ] as any ,
259257 rpcUrl : getRPCUrl ( chainId as SupportedChainIds , {
260258 alchemyKey : process . env . ALCHEMY_API_KEY ,
261259 } ) ,
@@ -316,7 +314,7 @@ export async function updateCache({
316314 { } ;
317315 // initialize contracts
318316 const govCoreClient = createViemClient ( {
319- chain : ChainList [ govCoreChainId as SupportedChainIds ] ,
317+ chain : ChainList [ govCoreChainId as SupportedChainIds ] as any ,
320318 rpcUrl : getRPCUrl ( govCoreChainId as SupportedChainIds , {
321319 alchemyKey : process . env . ALCHEMY_API_KEY ,
322320 } ) ,
0 commit comments