I am trying to fetch CCIP message transfer status using ccip-js,
I load CCIP messageIds from a CSV, then call:
await ccipClient.getTransferStatus({
messageId,
client: publicClient,
destinationRouterAddress: "0x881e3A65B4d4a04dD529061dd0071cf975F58bCD",
sourceChainSelector: "5009297550715157269",
});
However, every call fails with an internal RPC error.
Here is the log:
Error fetching status for 0xcc7a5ee8495593e53ab4197b2d030da801607a8a116ae02c68a13d168f67f208: An internal error was received.
URL: https://cloudflare-eth.com
Request body: {"method":"eth_call","params":[{"data":"0xa40e69c7","to":"0x881e3A65B4d4a04dD529061dd0071cf975F58bCD"},"latest"]}
Raw Call Arguments:
to: 0x881e3A65B4d4a04dD529061dd0071cf975F58bCD
data: 0xa40e69c7
Contract Call:
address: 0x881e3A65B4d4a04dD529061dd0071cf975F58bCD
function: getOffRamps()
Details: Internal error
Version: [email protected]
messageId being called in 0xcc7a5ee8495593e53ab4197b2d030da801607a8a116ae02c68a13d168f67f208
I event tried with viem v2. But downgraded to viem v1 due to error.
Full script:
import * as CCIP from '@chainlink/ccip-js'
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
import { ethers } from 'ethers'
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
import pLimit from 'p-limit'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const CSV_PATH = path.join(__dirname, 'messageIds.csv')
const publicClient = createPublicClient({
chain: mainnet,
transport: http(),
})
const ccipClient = CCIP.createClient()
function loadFromCsv(filepath: string): string[] {
if (!fs.existsSync(filepath)) return []
const fileContent = fs.readFileSync(filepath, 'utf-8')
return fileContent.split('\n').filter(l => l && l !== 'messageId')
}
async function checkStatusSequential(messageIds: string[]) {
for (const id of messageIds) {
try {
const status = await ccipClient.getTransferStatus({
messageId: id as `0x${string}`,
client: publicClient,
destinationRouterAddress: "0x881e3A65B4d4a04dD529061dd0071cf975F58bCD",
sourceChainSelector: "5009297550715157269",
})
console.log(`Message ID: ${id} -> Status: ${status}`)
} catch (err: any) {
console.error(`Error fetching status for ${id}:`, err.message)
}
}
}
async function main() {
const loadedIds = loadFromCsv(CSV_PATH)
await checkStatusSequential(loadedIds)
}
main().catch(console.error)
These are my dependencies:
"devDependencies": {
"@chainlink/ccip-js": "^0.2.6",
"@types/node": "^20.19.25",
"dotenv": "^16.6.1",
"ethers": "^6.15.0",
"p-limit": "^5.0.0",
"tsx": "^4.20.6",
"typescript": "^5.9.3",
"viem": "^1.21.0"
}