Function: calculateManualExecProof()
calculateManualExecProof<
V>(messagesInBatch: readonlyCCIPMessage<V>[],lane:Lane<V>,messageId:string,merkleRoot?:string,ctx?:WithLogger):Omit<ExecutionReport,"offchainTokenData"|"message">
Defined in: execution.ts:64
Pure/sync function to calculate/generate OffRamp.executeManually report for messageIds
Type Parameters
| Type Parameter | Default type |
|---|---|
V extends CCIPVersion | CCIPVersion |
Parameters
| Parameter | Type | Description |
|---|---|---|
messagesInBatch | readonly CCIPMessage<V>[] | Array containing all messages in batch, ordered |
lane | Lane<V> | Arguments for leafHasher (lane info) |
messageId | string | Message ID to prove for manual execution |
merkleRoot? | string | Optional merkleRoot of the CommitReport, for validation |
ctx? | WithLogger | Context for logging |
Returns
Omit<ExecutionReport, "offchainTokenData" | "message">
ManualExec report arguments
Throws
CCIPMessageNotInBatchError - When the messageId is not found in the provided batch
Throws
CCIPMerkleRootMismatchError - When calculated merkle root doesn't match the provided one
Remarks
This is a pure/sync function that performs no I/O - all data must be pre-fetched. It builds a merkle tree from the messages, generates a proof for the target messageId, and optionally validates against the provided merkleRoot.
The returned proof can be used with executeReport to manually execute a stuck message.
Example
import { calculateManualExecProof, EVMChain } from '@chainlink/ccip-sdk'
// Fetch the request and all messages in its batch
const request = (await source.getMessagesInTx(txHash))[0]
const commit = await dest.getCommitReport({ commitStore, request })
const messages = await source.getMessagesInBatch(request, commit.report)
// Calculate proof for manual execution
const proof = calculateManualExecProof(
messages,
request.lane,
request.message.messageId,
commit.report.merkleRoot
)
console.log('Merkle root:', proof.merkleRoot)
console.log('Proofs:', proof.proofs)
See
- discoverOffRamp - Find the OffRamp for manual execution
- executeReport - Execute the report on destination chain
- generateUnsignedExecuteReport - Build unsigned execution tx