Function useUpdatePlatformFees

  • Beta

    Set the platform fee recipient and basis points

    Parameters

    • contract: RequiredParam<ValidContractInstance>

      an instance of a SmartContract

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

    a mutation object that can be used to update the platform fees settings

    Example

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

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

    return (
    <button
    disabled={isLoading}
    onClick={() => updatePlatformFees({ updatePayload: { fee_recipient: "{{wallet_address}}", platform_fee_basis_points: 5_00 } })}
    >
    Update Platform fees
    </button>
    );
    };

    Twfeature

    PlatformFee

    See

    Documentation

Generated using TypeDoc