1- import path from " path"
1+ import path from ' path'
22import { argv , chdir , exit } from 'node:process'
33
44import { SupportedChainId } from '@cowprotocol/cow-sdk'
5- import { fetchPermitInfo } from " ./fetchPermitInfo"
5+ import { fetchPermitInfo } from ' ./fetchPermitInfo'
66
77function fetchPermitInfoByChain ( ) {
8- const [ , scriptPath , chainId , forceRecheck ] = argv
9-
10- if ( ! chainId ) {
11- console . error ( 'ChainId is missing. Invoke the script with the chainId as the first parameter.' )
12- exit ( 1 )
13- }
14-
15- // Change to script dir so relative paths work properly
16- chdir ( path . dirname ( scriptPath ) )
17-
18- // Execute the script
19- fetchPermitInfo ( {
20- chainId : + chainId as SupportedChainId ,
21- tokenListPath : undefined ,
22- rpcUrl : undefined ,
23- recheckUnsupported : false ,
24- forceRecheck : forceRecheck === 'true' ,
25- } ) . then ( ( ) => console . info ( `Done 🏁` ) )
8+ const [ , scriptPath , chainId , tokenListPath , rpcUrl , recheckUnsupported , forceRecheck ] = argv
9+
10+ if ( ! chainId ) {
11+ console . error ( 'ChainId is missing. Invoke the script with the chainId as the first parameter.' )
12+ exit ( 1 )
2613 }
27-
28- fetchPermitInfoByChain ( )
14+
15+ // Change to script dir so relative paths work properly
16+ chdir ( path . dirname ( scriptPath ) )
17+
18+ // Execute the script
19+ fetchPermitInfo ( {
20+ chainId : + chainId as SupportedChainId ,
21+ tokenListPath,
22+ rpcUrl,
23+ recheckUnsupported : recheckUnsupported === 'true' ,
24+ forceRecheck : forceRecheck === 'true' ,
25+ } ) . then ( ( ) => console . info ( `Done 🏁` ) )
26+ }
27+
28+ fetchPermitInfoByChain ( )
0 commit comments