//#region src/predict/errors.d.ts /** A caller-supplied argument the SDK rejected before building/sending a tx. */ declare class PredictInputError extends Error { constructor(message: string); } /** A Move `abort` decoded from a simulate/read failure. */ declare class PredictMoveError extends Error { readonly module: string; /** Exact u64 abort code — bigint because clever-error encodings pack data * into the high bits, which Number would silently truncate. */ readonly code: bigint; /** The `E…` constant name: the fullnode's clever-error name when it decodes * one, else the name {@link ABORT_NAMES} gives the module's plain code, or null * when neither knows the abort. */ readonly abortName: string | null; constructor(module: string, code: bigint, abortName: string | null); } interface MoveAbortError { MoveAbort?: { abortCode?: string | number | bigint; location?: { module?: string; }; cleverError?: { constantName?: string; }; }; } /** * Decode a `@mysten/sui` MoveAbort execution error into a {@link PredictMoveError}. * Returns null when `error` carries no MoveAbort (InsufficientGas, a size error, any * non-abort failure), so callers can fall back to a plain Error. * * `abortName` is the chain-decoded clever-error constant when the fullnode surfaces one, and * otherwise the name {@link ABORT_NAMES} gives the module's plain code (Predict's constants are * plain codes, so this is the usual path). It is null when neither knows the abort. * `code` stays a bigint — a clever-error abort code packs the module, line, and * constant index into the high bits of the u64 and would lose precision as a Number. */ declare function decodeMoveAbort(error: MoveAbortError | null | undefined): PredictMoveError | null; /** * Why a queued-order builder refused to add an enqueue. The builder reads the market first and * throws this instead of building a transaction the queue or protocol gates would abort, so a * refused order never fails the rest of a transaction. Each code mirrors one on-chain refusal. The * order's own limits at the current price are checked only on chain (`EOrderFailsLimits`). */ type PredictPreflightCode = /** * Delayed execution isn't live: Predict's version watermark isn't raised * (`ECutoverNotReached`), or Predict doesn't allowlist the order-flow package yet * (`EOrderFlowNotAllowed`). */ 'not-live' /** The market has no `MarketQueue` yet: `queue::create_and_share` hasn't run for it. */ | 'no-queue' /** * A version floor retired code this SDK calls: Predict's watermark is above the Predict * version it was built for (`protocol_config::EPackageVersionDisabled`), or the order desk's * floor is above its order-flow package (`desk::EPackageVersionDisabled`). Update the SDK. */ | 'retired' /** Trading is paused, the protocol is frozen, or minting is paused on this market. */ | 'paused' /** The market's pricing is delayed (`queue_stuck`). Enqueue aborts `EQueueStuck`. */ | 'stuck' /** * The order's Ļ„ would land at or after the market's order cutoff (`EPastCutoff`). A * `read.planMint` or `read.planSell` plan on a market past its expiry throws it too, since the * chain has no live price to quote (`ELivePricingExpired`). */ | 'past-cutoff' /** The market has its maximum unfinished mints or sells (`EQueueFull`). */ | 'queue-full' /** The account has its maximum unfinished orders in this market (`EAccountOrderCap`). */ | 'account-cap' /** * The account balance doesn't cover the order fee (`EFeeNotCovered`). A `read.planMint` plan * also reports it when the balance doesn't cover the plan's `totalDebit`, since its limits assume * the whole budget, or when the owner has no account yet. Prompt a top-up. */ | 'fee' /** A mint's cash need is above the market's spare cash (`EInsufficientMarketCash`). */ | 'market-cash' /** * The escrowed budget, or an exact-amount mint's premium cap, can't buy the minimum premium, * so the order fails its limits. A budget `read.planMint` plan also reports it when what the * budget buys without the fee subsidy, as admission prices it, has a premium below the minimum, * and throws it for a budget below the minimum premium or one no fill clears it with. */ | 'min-premium' /** * The strike's entry probability is outside the market's entry band, so the chain refuses to * quote or admit it (`EOrderFailsLimits`). Pick a strike nearer the money. Only `read.planMint` * reports it, and the probability can still leave the band between plan and placement. */ | 'entry-band' /** * The order's all-in cost without the fee subsidy is above its payout, so admission refuses it * at any slippage (`EOrderFailsLimits`), or for a budget, the fill costs about its payout, where * admission's sizing can't be previewed. Only `read.planMint` reports it, near a certain outcome. */ | 'cost-above-payout' /** A sell is below the policy minimum, or leaves a remainder below it (`EBelowMinSell`). */ | 'below-min-sell' /** The record to sell is missing or not Open (`ERecordNotOpen`). */ | 'record-not-open' /** The record to sell belongs to another account (`ENotRecordOwner`). */ | 'not-record-owner'; /** A queued-order builder's refusal, raised before any transaction is built. */ declare class PredictPreflightError extends Error { readonly code: PredictPreflightCode; constructor(code: PredictPreflightCode, message: string); } /** * Readable text for a decoded Move abort on the Predict paths, or `null` when the abort isn't * one this SDK describes (an unknown name, or an abort `decodeMoveAbort` couldn't name). Callers * fall back to `e.message` on `null`, so new contract errors degrade to the raw abort rather * than to a wrong message. */ declare function describePredictError(e: PredictMoveError): string | null; //#endregion export { MoveAbortError, PredictInputError, PredictMoveError, PredictPreflightCode, PredictPreflightError, decodeMoveAbort, describePredictError }; //# sourceMappingURL=errors.d.mts.map