# DataStreamsLocalSimulatorFork v0.3.1 API Reference
Source: https://docs.chain.link/chainlink-local/api-reference/v0.3.1/data-streams-local-simulator-fork

> For the complete documentation index, see [llms.txt](/llms.txt).

> **NOTE: Integrate Chainlink Local into your project**
>
> ### npm
>
> If you use [NPM](https://www.npmjs.com/), install the [@chainlink/local NPM
> package](https://www.npmjs.com/package/@chainlink/local):
>
> ```shell
> npm install @chainlink/local@0.3.1
> ```
>
> ### yarn
>
> If you use [Yarn](https://yarnpkg.com/), install the [@chainlink/local NPM
> package](https://www.npmjs.com/package/@chainlink/local):
>
> ```shell
> yarn add @chainlink/local@0.3.1
> ```
>
> ### foundry
>
> If you use [Foundry](https://book.getfoundry.sh/):
>
> ```shell
> forge install smartcontractkit/chainlink-local@v0.3.1
> ```
>
> and then set remappings to: `@chainlink/local/=lib/chainlink-local/` in either `remappings.txt` or `foundry.toml` file
>
> ### RemixIDE
>
> Import the `CCIPLocalSimulator` contract from the `@chainlink/local` package:
>
> ```solidity
> import {CCIPLocalSimulator} from "@chainlink/local@0.3.1/src/ccip/CCIPLocalSimulator.sol";
> ```

## DataStreamsLocalSimulatorFork

A contract that simulates Data Streams operations on forked networks in a Foundry test environment.

[`DataStreamsLocalSimulatorFork`](https://github.com/smartcontractkit/chainlink-local/blob/v0.3.1/src/data-streams/DataStreamsLocalSimulatorFork.sol)

> **NOTE**
>
> Works with Foundry only. Use this simulator when your consumer contract needs the real `VerifierProxy` deployed on a
> live network; use [`DataStreamsLocalSimulator`](/chainlink-local/api-reference/v0.3.1/data-streams-local-simulator)
> for local mode.

## Variables

### i\_register

```solidity
Register immutable i_register
```

> **NOTE**
>
> The immutable Register contract instance used to store Data Streams network configuration details.

### LINK\_FAUCET

```solidity
address constant LINK_FAUCET = 0x4281eCF07378Ee595C564a59048801330f3084eE
```

> **NOTE**
>
> The address of the LINK token faucet contract, impersonated by `requestLinkFromFaucet`.

## Functions

### constructor

Initializes the contract.

```solidity
constructor()
```

> **NOTE**
>
> Deploys the Data Streams `Register` with the built-in network details.

### getNetworkDetails

Returns the default values for currently Data Streams supported networks.

```solidity
function getNetworkDetails(uint256 chainId) external view returns (Register.NetworkDetails memory)
```

> **NOTE**
>
> If a network is not present or some of the values have changed, add new network details with `setNetworkDetails`.

#### Parameters

| Parameter | Type      | Description                                                         |
| --------- | --------- | ------------------------------------------------------------------- |
| chainId   | `uint256` | The blockchain network chain ID (e.g., 421614 for Arbitrum Sepolia) |

#### Returns

| Parameter      | Type             | Description                                                      |
| -------------- | ---------------- | ---------------------------------------------------------------- |
| networkDetails | `NetworkDetails` | `verifierProxyAddress` and `linkAddress` for the specified chain |

### setNetworkDetails

Sets the network details for a given chain ID.

```solidity
function setNetworkDetails(uint256 chainId, Register.NetworkDetails memory networkDetails) external
```

#### Parameters

| Parameter      | Type             | Description                                           |
| -------------- | ---------------- | ----------------------------------------------------- |
| chainId        | `uint256`        | The blockchain network chain ID                       |
| networkDetails | `NetworkDetails` | The network details to set for the specified chain ID |

### requestLinkFromFaucet

Requests LINK tokens from the faucet.

```solidity
function requestLinkFromFaucet(address to, uint256 amount) external returns (bool success)
```

> **NOTE**
>
> Impersonates the LINK faucet and transfers LINK (at the address from the current chain's network details) to the
> destination address, on the active fork.

#### Parameters

| Parameter | Type      | Description                            |
| --------- | --------- | -------------------------------------- |
| to        | `address` | The address to receive the LINK tokens |
| amount    | `uint256` | The amount of LINK tokens to transfer  |

#### Returns

| Parameter | Type   | Description                                       |
| --------- | ------ | ------------------------------------------------- |
| success   | `bool` | Returns true if the token transfer was successful |

### requestNativeFromFaucet

Requests native coins from the faucet.

```solidity
function requestNativeFromFaucet(address to, uint256 amount) external
```

> **NOTE**
>
> Deals the amount of native coins to the destination address with `vm.deal`.

#### Parameters

| Parameter | Type      | Description                             |
| --------- | --------- | --------------------------------------- |
| to        | `address` | The address to receive the native coins |
| amount    | `uint256` | The amount of native coins to send      |