Function useCreateAccount

  • Beta

    Create a account

    Parameters

    • contract: RequiredParam<SmartContract<BaseContract>>

      an instance of a account factory contract

    Returns UseMutationResult

    a mutation object that can be used to create a account

    Example

    const Component = () => {
    const { contract } = useContract("{{contract_address}}");
    const {
    mutate: createAccount,
    isLoading,
    error,
    } = useCreateAccount(contract);

    if (error) {
    console.error("failed to create account", error);
    }

    return (
    <button
    disabled={isLoading}
    onClick={() => createAccount("0x...")}
    >
    Create Account
    </button>
    );
    };

    Twfeature

    AccountFactory

    See

    Documentation

Generated using TypeDoc