Usage

"use client";
import { useCreateInfiniteChannel } from "@tx-kit/hooks";

const MyComponent = () => {
    const { 
        createInfiniteChannel,
        channelAddress,
        status, 
        txHash,
        error 
    } = useCreateInfiniteChannel()

    const onClick = () => {
        createInfiniteChannel({ ... })
    }

    return <button onClick={onClick}>Create Channel</button>
}

Returns

createInfiniteChannel

Function to create a new infinite channel. See createInfiniteChannel args.

  • type: ({ uri: string; name: string; defaultAdmin: string; managers: string[]; setupActions: SetupAction[]; transportLayer: InfiniteTransportLayer; transactionOverrides?: TransactionOverrides; }) => Promise<Log[] | undefined>

status

  • type: ContractExecutionStatus
type ContractExecutionStatus =
  | 'pendingApproval'
  | 'txInProgress'
  | 'complete'
  | 'error'

the status of the transaction

channelAddress

  • type: Address

the address of the new channel

txHash

  • type: string

the transaction hash of the transaction

error

  • type: any

the revert message if the transaction fails