API Version: v0.2.9 Not using latest version (v0.3.1)

CCIPLocalSimulatorFork JS v0.2.9 API Reference

CCIPLocalSimulatorFork JS

Hardhat 2 JavaScript helpers for fork routing.

CCIPLocalSimulatorFork JS

Types

Evm2EvmMessage : Object

Properties

NameType
sourceChainSelectorbigint
senderstring
receiverstring
sequenceNumberbigint
gasLimitbigint
strictboolean
noncebigint
feeTokenstring
feeTokenAmountbigint
datastring
tokenAmountsArray.<\{token: string, amount: bigint}>
sourceTokenDataArray.<string>
messageIdstring

Functions

requestLinkFromTheFaucet(linkAddress, to, amount) ⇒ Promise.<string>

Requests LINK tokens from the faucet and returns the transaction hash

Returns: Promise.<string> - Promise resolving to the transaction hash of the fund transfer

ParamTypeDescription
linkAddressstringThe address of the LINK contract on the current network
tostringThe address to send LINK to
amountbigintThe amount of LINK to request

getEvm2EvmMessage(receipt) ⇒ Evm2EvmMessage | null

Parses a transaction receipt to extract the sent message Scans through transaction logs to find a CCIPSendRequested event and then decodes it to an object

Returns: Evm2EvmMessage | null - Returns either the sent message or null if provided receipt does not contain CCIPSendRequested log

ParamTypeDescription
receiptobjectThe transaction receipt from the ccipSend call

getEvm2AnyRampMessage(receipt) ⇒ object | null

Parses a transaction receipt to extract the sent message from CCIPMessageSent

Returns: object | null - Returns { destChainSelector, sequenceNumber, EVM2AnyRampMessage message } or null

ParamTypeDescription
receiptobject– The tx receipt from the on-ramp contract

routeMessage(routerAddress, evm2EvmMessage) ⇒ Promise.<void>

Routes the sent message from the source network on the destination (current) network

Returns: Promise.<void> - Either resolves with no value if the message is successfully routed, or reverts
Throws:

  • Error Fails if no off-ramp matches the message's source chain selector or if calling router.getOffRamps()
ParamTypeDescription
routerAddressstringAddress of the destination Router
evm2EvmMessageEvm2EvmMessageSent cross-chain message

Get the latest Chainlink content straight to your inbox.