Function useUpdatePrimarySaleRecipient

  • Beta

    Set the primary sale recipient

    Parameters

    • contract: RequiredParam<ValidContractInstance>

      an instance of a SmartContract

    Returns UseMutationResult<{
        receipt: providers.TransactionReceipt;
    }, unknown, string, unknown>

    a mutation object that can be used to update the primary sales recipient

    Example

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

    if (error) {
    console.error("failed to update recipient", error);
    }

    return (
    <button
    disabled={isLoading}
    onClick={() => updatePrimarySalesRecipient({ newRecipient: "{{wallet_address}}" })}
    >
    Update Recipient
    </button>
    );
    };

    Twfeature

    PrimarySale

    See

    Documentation

Generated using TypeDoc