useUpdatePlatformFees

Set the platform fee recipient and basis points

function useUpdatePlatformFees(
  contract: RequiredParam<ValidContractInstance>,
): UseMutationResult<
  Omit<{}, "data">,
  unknown,
  { fee_recipient: string; platform_fee_basis_points: number },
  unknown
>;

Parameters


Returns

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

type ReturnType = UseMutationResult<
  Omit<{}, "data">,
  unknown,
  { fee_recipient: string; platform_fee_basis_points: number },
  unknown
>;

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>
  );
};