Usage

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

const MyComponent = () => {
    const { 
        updateMetadata,
        uri,
        name,
        status, 
        txHash,
        error 
    } = useUpdateMetadata()

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

    return <button onClick={onClick}>Update Metadata</button>
}

Returns

updateChannelMetadata

Function to update channel metadata. See updateChannelMetadata args.

  • type: ({ channelAddress: string; uri: string; name: string; transactionOverrides?: TransactionOverrides; }) => Promise<Log[] | undefined>

status

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

the status of the transaction

uri

  • type: string

the new uri for the channel

name

  • type: string

the new name for the channel

txHash

  • type: string

the transaction hash of the transaction

error

  • type: any

the revert message if the transaction fails