API Version: v0.2.1 Not using latest version (v0.2.3)

CCIPLocalSimulatorFork v0.2.1 API Reference

CCIPLocalSimulatorFork

CCIPLocalSimulatorFork provides utilities for simulating Cross-Chain Interoperability Protocol (CCIP) operations in a forked environment. It enables testing of cross-chain messaging and token transfers within a Hardhat project.

Types

EVM2EVMMessage

An object representing a cross-chain message with the following structure:

PropertyTypeDescription
sourceChainSelectorbigintThe chain selector of the source chain
senderstringThe address of the message sender
receiverstringThe address of the message receiver
sequenceNumberbigintMessage sequence number
gasLimitbigintGas limit for message execution
strictbooleanWhether strict mode is enabled
noncebigintMessage nonce
feeTokenstringAddress of the token used for fees
feeTokenAmountbigintAmount of fee token
datastringMessage payload data
tokenAmountsArray<{token: string, amount: bigint}>Array of token transfers
sourceTokenDataArray<string>Source token metadata
messageIdstringUnique message identifier

Functions

requestLinkFromTheFaucet

Requests LINK tokens from a faucet contract for testing purposes.

ParameterTypeDescription
linkAddressstringThe address of the LINK contract on the current network
tostringThe address to receive the LINK tokens
amountbigintThe amount of LINK tokens to request

Returns: Promise<string> - The transaction hash of the fund transfer

getEvm2EvmMessage

Parses a transaction receipt to extract CCIP message details from the CCIPSendRequested event.

ParameterTypeDescription
receiptobjectThe transaction receipt from the ccipSend call

Returns: object | null - The parsed EVM2EVMMessage object or null if no valid message is found

routeMessage

Routes a sent message from the source network to the destination network in the forked environment.

ParameterTypeDescription
routerAddressstringAddress of the destination Router contract
evm2EvmMessageobjectThe cross-chain message to be routed

Returns: Promise<void> - Resolves when the message is successfully routed

Get the latest Chainlink content straight to your inbox.