Usage

Returns

{ 
  tokenId: bigint, // the token ID of the newly created token
  event: Log 
}

Parameters

channelAddress

  • type: string

The target channel address

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

to

  • type: string

The recipient of the minted tokens

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

tokenId

  • type: bigint

The token ID to mint

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

amount

  • type: bigint

The amount to mint

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

mintReferral (optional)

  • type: string

The referral address for the mint

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

data (optional)

  • type: string

Additional data for the mint

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

transactionOverrides (optional)

  • type: TransactionOverrides
type TransactionOverrides = {
  accessList?: AccessList
  gas?: bigint
  maxFeePerGas?: bigint
  maxPriorityFeePerGas?: bigint
  nonce?: number
  value?: bigint
}

Overrides for the transaction

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

Calldata

generate calldata for the transaction

const { address, data } = await uplinkClient.calldata.sponsorTokenWithETH({...})

Returns

{
    address: string, // address of the target contract
    data: string // calldata for the transaction
}

Gas Estimation

Estimate gas for the transaction

const gas = await uplinkClient.estimateGas.sponsorTokenWithETH({...})

Returns

bigint // gas estimate in wei