Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/permitInfo/fetchPermitInfoByChain.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import path from "path"
import path from 'path'
import { argv, chdir, exit } from 'node:process'

import { SupportedChainId } from '@cowprotocol/cow-sdk'
import { fetchPermitInfo } from "./fetchPermitInfo"
import { fetchPermitInfo } from './fetchPermitInfo'

function fetchPermitInfoByChain() {
const [, scriptPath, chainId, forceRecheck] = argv

if (!chainId) {
console.error('ChainId is missing. Invoke the script with the chainId as the first parameter.')
exit(1)
}

// Change to script dir so relative paths work properly
chdir(path.dirname(scriptPath))

// Execute the script
fetchPermitInfo({
chainId: +chainId as SupportedChainId,
tokenListPath: undefined,
rpcUrl: undefined,
recheckUnsupported: false,
forceRecheck: forceRecheck === 'true',
}).then(() => console.info(`Done 🏁`))
const [, scriptPath, chainId, tokenListPath, rpcUrl, recheckUnsupported, forceRecheck] = argv

if (!chainId) {
console.error('ChainId is missing. Invoke the script with the chainId as the first parameter.')
exit(1)
}

fetchPermitInfoByChain()

// Change to script dir so relative paths work properly
chdir(path.dirname(scriptPath))

// Execute the script
fetchPermitInfo({
chainId: +chainId as SupportedChainId,
tokenListPath,
rpcUrl,
recheckUnsupported: recheckUnsupported === 'true',
forceRecheck: forceRecheck === 'true',
}).then(() => console.info(`Done 🏁`))
}

fetchPermitInfoByChain()
Loading