import { AuthApiTransports } from "../../shared/transports.js"; import { PolyesterMutationOptions, PolyesterRequestOptions } from "../../shared/request-options.js"; import { SubaccountResolver } from "../subaccount-resolver.js"; import { AutoWithdrawPreview, AutoWithdrawRule, AutoWithdrawScopedInput, ListAutoWithdrawRunsInput, ListAutoWithdrawRunsResult, SetAutoWithdrawRuleEnabledInput, SetAutoWithdrawRuleInput } from "./auto-withdraw.schemas.js"; //#region src/services/auto-withdraw/auto-withdraw.d.ts /** * Manages the scheduled auto-withdraw rule of the root account or a subaccount: each asset's * balance is paid in kind on an hourly, daily, weekly, biweekly or monthly UTC slot to * destinations on the account's external withdraw whitelist. API keys can read rules and runs; * changing a rule needs a session login with withdraw rights and a fresh single-use step-up * token (`stepUpToken`). A missing step-up throws `StepUpRequiredError` or * `SessionElevationRequiredError`; check `isFreshStepUpRequiredError` before retrying with a new * token. */ declare class AutoWithdrawService { #private; constructor(transports: AuthApiTransports, resolver?: SubaccountResolver); /** Returns the account's latest rule version, or null when the account never had a rule. */ getRule(input?: AutoWithdrawScopedInput, options?: PolyesterRequestOptions): Promise; /** * Creates the account's rule, or replaces its latest version, and returns the new version. * `expectedVersion` is 0 when the account has no rule yet, otherwise its latest version; a * stale version throws `RevisionConflictError`. Requires a fresh `stepUpToken`. */ setRule(input: SetAutoWithdrawRuleInput, options?: PolyesterMutationOptions): Promise; /** * Pauses (`enabled: false`) or resumes (`enabled: true`) the account's rule, keeping its * schedule and destinations, and returns the latest version: a new one, or the current one * unchanged when the rule is already in that state. Each change creates a version, so pass * the latest `version` as `expectedVersion`; a stale one throws `RevisionConflictError`. * Pausing needs no step-up. Resuming needs a fresh `stepUpToken`, checks every destination * again like `setRule`, and clears a pause the rule set itself; a refused destination * leaves the rule paused. */ setRuleEnabled(input: SetAutoWithdrawRuleEnabledInput, options?: PolyesterMutationOptions): Promise; /** * Previews what the account's next run would pay, using the same planning as the run and * the balances, prices and fees now. Readable by API keys with `read-auto-withdraw`. With a * USD minimum, a failed price read throws a retryable error. */ previewRun(input?: AutoWithdrawScopedInput, options?: PolyesterRequestOptions): Promise; /** * Lists the account's runs with their payouts, newest first. Pass the previous * `nextPageToken` as `pageToken` to continue; an empty `nextPageToken` means no more runs. */ listRuns(input?: ListAutoWithdrawRunsInput, options?: PolyesterRequestOptions): Promise; private resolveInput; } //#endregion export { AutoWithdrawService }; //# sourceMappingURL=auto-withdraw.d.ts.map