/** * @pwngh/economy-lab * * Copyright (c) Preston Neal * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ import type { Ctx, Operation, Outcome } from '../contract.js'; import type { Unit } from '../ports.js'; /** * Cancels an active subscription. A status change only, moving no money (cancel forfeits the rest * of the paid period with no refund), so it posts a placeholder {@link lifecycleMarker}, marks the * record `CANCELED`, and returns `committed`. * * A missing or already-canceled subscription returns a `rejected` `UNKNOWN_SUBSCRIPTION` rather * than throwing. The ownership check runs only after the record is confirmed cancelable, so a * missing or canceled id gets that same answer for every caller and never leaks whether it exists. * * @see {@link https://economy-lab-docs.pages.dev/economy/reference/operations/cancel-subscription/ * Cancel subscription} for the cancel flow and ownership rules. */ export declare function cancelSubscription(operation: Operation, unit: Unit, ctx: Ctx): Promise;