# FundingSourceEarn.from

Creates an Earn source for funding, policy rules, or discovery.

The source address identifies a deployed Earn funding source. Caps apply per invocation.

## Imports

:::code-group
```ts [Named]
import { FundingSourceEarn } from 'ox/tempo'
```

```ts [Entrypoint]
import * as FundingSourceEarn from 'ox/tempo/FundingSourceEarn'
```
:::

## Examples

```ts
import { FundingSourceEarn } from 'ox/tempo'

FundingSourceEarn.from({
  maxValueIn: 50_000_000n,
  source: '0x0202020202020202020202020202020202020202',
  vault: '0x0101010101010101010101010101010101010101',
})
```

## Definition

```ts
function from<source>(
  request: from.Parameters<source>,
): {
    data: `0x${string}`;
    target: source;
}
```

**Source:** [src/tempo/FundingSourceEarn.ts](https://github.com/wevm/ox/blob/main/src/tempo/FundingSourceEarn.ts#L36)

## Parameters

### request

* **Type:** `from.Parameters<source>`

#### request.maxAmountIn

* **Type:** `bigint`
* **Optional**

EarnShare input cap in base units. Omission is unlimited; zero permits no input.

#### request.maxValueIn

* **Type:** `bigint`
* **Optional**

Gross underlying-token value cap in base units, before exit fees. Omission is unlimited; zero permits no input.

#### request.source

* **Type:** `source`

Deployed Earn funding source address.

#### request.vault

* **Type:** `abitype_Address`

Earn vault whose shares are redeemed.

## Return Type

`{
    data: `0x${string}`;
    target: source;
}`
