Function useUpdateRoyaltySettings

  • Beta

    Set the royalty recipient and fee

    Parameters

    • contract: RequiredParam<ValidContractInstance>

      an instance of a SmartContract

    Returns UseMutationResult<{
        data: (() => Promise<{
            fee_recipient: string;
            seller_fee_basis_points: number;
        }>);
        receipt: providers.TransactionReceipt;
    }, unknown, {
        fee_recipient?: string;
        seller_fee_basis_points?: number;
    }, unknown>

    a mutation object that can be used to update the royalty settings

    Example

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

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

    return (
    <button
    disabled={isLoading}
    onClick={() => updateRoyaltySettings({ updatePayload: { fee_recipient: "{{wallet_address}}", seller_fee_basis_points: 5_00 } })}
    >
    Update Royalty Settings
    </button>
    );
    };

    Twfeature

    Royalty

    See

    Documentation

Generated using TypeDoc