useValidateAddDevice

Description

This hook uses the validateAddDevice method from the smart account client to add a new signer to the user's account, either synchronously or asynchronously.

It's typically used in the process of adding a new device or recovery method to a user's account.

Returns

  • data (Hash | undefined): The hash of the transaction if it was successfully sent, otherwise undefined.

  • error (Error | null): An error object if the transaction failed, otherwise null.

  • isPending (boolean): A boolean indicating whether the transaction is currently pending.

  • isSuccess (boolean): A boolean indicating whether the transaction was successfully sent.

  • isError (boolean): A boolean indicating whether an error occurred during the transaction process.

  • validateAddDevice (ValidateAddDeviceMutate): A function to trigger the validation process without waiting for the result.

  • validateAddDeviceAsync (ValidateAddDeviceMutateAsync): A function to trigger the validation process and wait for the result. This returns a promise that resolves to the transaction hash.

Last updated