> For the complete documentation index, see [llms.txt](https://cll-devrel.gitbook.io/chainlink-local-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cll-devrel.gitbook.io/chainlink-local-documentation/api-reference/cciplocalsimulatorfork.js-api.md).

# CCIPLocalSimulatorFork.js API

## **API methods**

* [`requestLinkFromTheFaucet()`](#cciplocalsimulatorfork-.requestlinkfromthefaucet)
* [`getEvm2EvmMessage()`](#cciplocalsimulatorfork-.getevm2evmmessage)
* [`routeMessage()`](#cciplocalsimulatorfork-.routemessage)

## **\[CCIPLocalSimulatorFork].`requestLinkFromTheFaucet()`**

```javascript
async function requestLinkFromTheFaucet(linkAddress: string, to: string, amount: bigint): Promise<string>;
```

Requests LINK tokens from the faucet and returns the transaction hash.

**Parameters:**

* `linkAddress` (string) - The address of the LINK contract on the current network.
* `to` (string) - The address to send LINK to.
* `amount` (bigint) - The amount of LINK to request.

**Return values:**

* `Promise<string>` - Promise resolving to the transaction hash of the fund transfer.

***

## **\[CCIPLocalSimulatorFork].`getEvm2EvmMessage()`**

```solidity
function getEvm2EvmMessage(receipt: TransactionReceipt): 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 Evm2EvmMessage.

**Parameters:**

* `receipt` (TransactionReceipt) - The transaction receipt from the `ccipSend` call.

**Return values:**

* `Evm2EvmMessage | null` - Returns either the sent message or null if provided receipt does not contain `CCIPSendRequested` log. Evm2EvmMessage tuple:
  * `sourceChainSelector` (bigint)
  * `sender` (string)
  * `receiver` (string)
  * `sequenceNumber` (bigint)
  * `gasLimit` (bigint)
  * `strict` (boolean)
  * `nonce` (bigint)
  * `feeToken` (string)
  * `feeTokenAmount` (bigint)
  * `data` (string)
  * `tokenAmounts` (\[])
  * `sourceTokenData` (\[])
  * `messageId` (string)

***

## **\[CCIPLocalSimulatorFork].`routeMessage()`**

```javascript
async function routeMessage(routerAddress: string, evm2EvmMessage: Evm2EvmMessage): Promise<void>;
```

Routes the sent message from the source network (got it from the `getEvm2EvmMessage` function) on the destination (current) network.

**Parameters:**

* `routerAddress` (string) - The address of the destination Router contract (Router on the current network).
* `evm2EvmMessage` (Evm2EvmMessage) - Sent cross-chain message, (got from the `getEvm2EvmMessage` function).

**Return values:**

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