> ## Documentation Index
> Fetch the complete documentation index at: https://docs.transmissions.wtf/llms.txt
> Use this file to discover all available pages before exploring further.

# sponsorTokenWithETH

> Sponsor a [token intent](./createTokenIntent.mdx) with ETH.

## Usage

<CodeGroup>
  ```typescript app.ts theme={null}
  import { uplinkClient } from './config'

  const signedIntent = { ... }

  const { event } = await uplinkClient.sponsorTokenWithETH({
      channelAddress: '0x123...',
      sponsoredToken: signedIntent,
      to: '0x123...',
      amount: 1n,
      mintReferral: '0x123...',
      data: '0x00..',
  })
  ```

  ```typescript config.ts theme={null}
  import { TransmissionsClient } from '@tx-kit/sdk'
  import { CreatePublicClient, CreateWalletClient } from 'viem'
  import { base } from 'viem/chains'

  const publicClient = createPublicClient({
      chain: base,
      transport: http()
  })

  const walletClient = createWalletClient({
      account, // from local private key or browser wallet
      chain: base,
      transport: http()
  })

  export const { uplinkClient } = new TransmissionsClient({
      publicClient,
      walletClient,
      chain: base
  })
  ```
</CodeGroup>

## Returns

```typescript theme={null}
{ 
  tokenId: bigint, // the token ID of the newly created token
  event: Log 
}
```

## Parameters

### channelAddress

* **type**: `string`

The target channel address

```typescript theme={null}
const { event } = await uplinkClient.sponsorTokenWithETH({
  channelAddress: '0x1234567890123456789012345678901234567890',
  ...
})
```

### to

* **type**: `string`

The recipient of the minted tokens

```typescript theme={null}
const { event } = await uplinkClient.sponsorTokenWithETH({
  to: '0x1234567890123456789012345678901234567890',
  ...
})
```

### tokenId

* **type**: `bigint`

The token ID to mint

```typescript theme={null}
const { event } = await uplinkClient.sponsorTokenWithETH({
  tokenId: 1n,
  ...
})
```

### amount

* **type**: `bigint`

The amount to mint

```typescript theme={null}
const { event } = await uplinkClient.sponsorTokenWithETH({
  amount: 1n,
  ...
})
```

### mintReferral (optional)

* **type**: `string`

The referral address for the mint

```typescript theme={null}
const { event } = await uplinkClient.sponsorTokenWithETH({
  mintReferral: '0x1234567890123456789012345678901234567890',
  ...
})
```

### data (optional)

* **type**: `string`

Additional data for the mint

```typescript theme={null}
const { event } = await uplinkClient.sponsorTokenWithETH
({
  data: '0x00...',
  ...
})
```

### transactionOverrides (optional)

* **type**: `TransactionOverrides`

```typescript theme={null}
type TransactionOverrides = {
  accessList?: AccessList
  gas?: bigint
  maxFeePerGas?: bigint
  maxPriorityFeePerGas?: bigint
  nonce?: number
  value?: bigint
}
```

Overrides for the transaction

```typescript theme={null}
const { event } = await uplinkClient.sponsorTokenWithETH({
    ...
    transactionOverrides: {
        value: parseEther('0.000666')
    }
})
```

## Calldata

generate calldata for the transaction

```typescript theme={null}
const { address, data } = await uplinkClient.calldata.sponsorTokenWithETH({...})
```

### Returns

```typescript theme={null}
{
    address: string, // address of the target contract
    data: string // calldata for the transaction
}
```

## Gas Estimation

Estimate gas for the transaction

```typescript theme={null}
const gas = await uplinkClient.estimateGas.sponsorTokenWithETH({...})
```

### Returns

```typescript theme={null}
bigint // gas estimate in wei
```
