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

> 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.0
> ```
>
> ### 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.0
> ```
>
> ### foundry
>
> If you use [Foundry](https://book.getfoundry.sh/):
>
> ```shell
> forge install smartcontractkit/chainlink-local@v0.3.0
> ```
>
> 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.0/src/ccip/CCIPLocalSimulator.sol";
> ```

## DataStreamsLocalSimulator

Local Data Streams simulator (no-fork mode).

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

## Variables

### feeManagerEnabled

Whether fee manager is enabled (can be toggled after deployment)

```solidity
bool public feeManagerEnabled
```

### i\_linkToken

The LINK token instance

```solidity
LinkToken internal immutable i_linkToken
```

### i\_wrappedNative

The wrapped native token instance

```solidity
WETH9 internal immutable i_wrappedNative
```

### s\_mockFeeManager

```solidity
MockFeeManager internal s_mockFeeManager
```

### s\_mockRewardManager

```solidity
MockRewardManager internal s_mockRewardManager
```

### s\_mockVerifier

```solidity
MockVerifier internal s_mockVerifier
```

### s\_mockVerifierProxy

```solidity
MockVerifierProxy internal s_mockVerifierProxy
```

## Functions

### \_deployFeeManager

Internal function to deploy fee manager and reward manager

```solidity
function _deployFeeManager() private;
```

### configuration

Returns configuration details for pre-deployed contracts and services needed for
local Data Streams simulations.

```solidity
function configuration()
    public
    view
    returns (
        WETH9 wrappedNative_,
        LinkToken linkToken_,
        MockVerifier mockVerifier_,
        MockVerifierProxy mockVerifierProxy_,
        MockFeeManager mockFeeManager_,
        MockRewardManager mockRewardManager_
    );
```

**Returns**

| Name                 | Type                | Description                                                                       |
| -------------------- | ------------------- | --------------------------------------------------------------------------------- |
| `wrappedNative_`     | `WETH9`             | - The wrapped native token.                                                       |
| `linkToken_`         | `LinkToken`         | - The LINK token.                                                                 |
| `mockVerifier_`      | `MockVerifier`      | - The mock verifier contract.                                                     |
| `mockVerifierProxy_` | `MockVerifierProxy` | - The mock verifier proxy contract.                                               |
| `mockFeeManager_`    | `MockFeeManager`    | - The mock fee manager contract (returns what's currently set on verifier proxy). |
| `mockRewardManager_` | `MockRewardManager` | - The mock reward manager contract (address(0) if fee manager is disabled).       |

### constructor

```solidity
constructor() ;
```

### enableOffChainBilling

Enables off-chain billing mechanism by removing fee manager

This simulates chains that don't have FeeManager contracts deployed

```solidity
function enableOffChainBilling() external;
```

### enableOnChainBilling

Enables on-chain billing mechanism by deploying/setting fee manager

This simulates chains that have FeeManager contracts deployed

```solidity
function enableOnChainBilling() external;
```

### getBillingMechanism

Returns the current billing mechanism type

```solidity
function getBillingMechanism() external view returns (string memory billingType);
```

**Returns**

| Name          | Type     | Description                                                   |
| ------------- | -------- | ------------------------------------------------------------- |
| `billingType` | `string` | "on-chain" if fee manager is enabled, "off-chain" if disabled |

### requestLinkFromFaucet

Requests LINK tokens from the faucet. The provided amount of tokens are
transferred to provided destination address.

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

**Parameters**

| Name     | Type      | Description                                        |
| -------- | --------- | -------------------------------------------------- |
| `to`     | `address` | - The address to which LINK tokens are to be sent. |
| `amount` | `uint256` | - The amount of LINK tokens to send.               |

**Returns**

| Name      | Type   | Description                                                                   |
| --------- | ------ | ----------------------------------------------------------------------------- |
| `success` | `bool` | - Returns `true` if the transfer of tokens was successful, otherwise `false`. |