Skip to main content

useWriteContract

Callable

  • useWriteContract<TContract, TFunctionName>(contract: null | Contract | TContract, functionName: TFunctionName, options?: { confirmations?: number; onConfirmation?: any; onError?: any; onResponse?: any }): { error: null | Error; response: undefined | ContractTransaction; mutate: any }

  • Write to a contract


    Type parameters

    Parameters

    • contract: null | Contract | TContract
    • functionName: TFunctionName
    • optionaloptions: { confirmations?: number; onConfirmation?: any; onError?: any; onResponse?: any }

    Returns { error: null | Error; response: undefined | ContractTransaction; mutate: any }

    • error: null | Error
    • response: undefined | ContractTransaction
    • mutate: function
      • mutate(...args: Parameters<ContractFunctions<TContract>[TFunctionName]>): Promise<void>

      • Parameters

        Returns Promise<void>