> ## 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.

# updateChannelFees

> Update the minting fees and protocol reward splits for a deployed channel

<Tip>
  Check out the [sdk quickstart guide](/sdk/quickstart) for help setting up your client.
</Tip>

## Usage

<CodeGroup>
  ```typescript app.js theme={null}
  import { uplinkClient } from './config'
  import { CUSTOM_FEES } from '@tx-kit/sdk/constants'

  const channelAddress = '0x1234567890123456789012345678901234567890'
  const feeContract = CUSTOM_FEES
  const feeArgs = {
      channelTreasury: '0x1234567890123456789012345678901234567890',
      uplinkPercentage: 10,
      channelPercentage: 15,
      creatorPercentage: 60,
      mintReferralPercentage: 5,
      sponsorPercentage: 10,
      ethMintPrice: parseEther('0.000666'),
      erc20MintPrice: parseEther('0.000666'),
      erc20Contract: baseSepoliaWETH
  }

  const { event } = await uplinkClient.updateChannelFees({
      channelAddress,
      { feeContract, feeArgs }
  })
  ```

  ```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}
{ 
  event: Log 
}
```

## Parameters

### channelAddress

* **type**: `string`

The target channel address

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

### feeContract

* **type**: `string`

The address of the fee contract to use. Use `CUSTOM_FEES` for the default fee contract, or address zero to disable fees.

```typescript theme={null}
const { event } = await uplinkClient.updateChannelFees({
  { feeContract: CUSTOM_FEES, ... },
  ...
})
```

### feeArgs

* **type**: `CustomFeeInputs | null`

The fee configuration to apply. If `feeContract` is set to address zero, this parameter is ignored.

```typescript theme={null}
const { event } = await uplinkClient.updateChannelFees({
  { 
    feeContract: CUSTOM_FEES,
    feeArgs: {
        channelTreasury: '0x123...' // channel treasury address
        uplinkPercentage: 10 // protocol reward split percentage
        channelPercentage: 10 // channel reward split percentage
        creatorPercentage: 60 // creator reward split percentage
        mintReferralPercentage: 10 // mint referral reward split percentage
        sponsorPercentage: 10 // sponsor reward split percentage
        ethMintPrice: parseEther('0.000666') // ETH mint price
        erc20MintPrice: BigInt(0) // ERC20 mint price
        erc20Contract: zeroAddress // ERC20 contract address
    },
   },
  ...
})
```

### 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 { contractAddress } = await uplinkClient.updateChannelFees({
    ...
    transactionOverrides: {
        gas: 1000000n
    }
})
```

## Calldata

generate calldata for the transaction

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

### 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.updateChannelFees({...})
```

### Returns

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