{"version":3,"file":"errors.mjs","names":[],"sources":["../../src/predict/errors.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n// Typed errors for the Predict SDK.\n//\n// Two failure kinds cross the SDK boundary:\n//   - PredictInputError — a caller gave us something we rejected before touching\n//     the chain (unknown underlying, malformed argument, …).\n//   - PredictMoveError — a Move `abort` surfaced by a read/simulate. Predict's error\n//     constants are plain `u64` codes, not clever errors, so the fullnode can't name\n//     them: `decodeMoveAbort` maps `(module, code)` to the constant name with\n//     ABORT_NAMES below. A clever-error name the fullnode does decode takes precedence.\n\n/** A caller-supplied argument the SDK rejected before building/sending a tx. */\nexport class PredictInputError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = 'PredictInputError';\n\t}\n}\n\n/** A Move `abort` decoded from a simulate/read failure. */\nexport class PredictMoveError extends Error {\n\treadonly module: string;\n\t/** Exact u64 abort code — bigint because clever-error encodings pack data\n\t * into the high bits, which Number would silently truncate. */\n\treadonly code: bigint;\n\t/** The `E…` constant name: the fullnode's clever-error name when it decodes\n\t * one, else the name {@link ABORT_NAMES} gives the module's plain code, or null\n\t * when neither knows the abort. */\n\treadonly abortName: string | null;\n\n\tconstructor(module: string, code: bigint, abortName: string | null) {\n\t\tsuper(\n\t\t\tabortName\n\t\t\t\t? `Move abort in ${module}: ${abortName} (code ${code})`\n\t\t\t\t: `Move abort in ${module}: code ${code}`,\n\t\t);\n\t\tthis.name = 'PredictMoveError';\n\t\tthis.module = module;\n\t\tthis.code = code;\n\t\tthis.abortName = abortName;\n\t}\n}\n\n// The structured MoveAbort execution error surfaced by `@mysten/sui` on a failed\n// simulate/execute. Read structurally rather than via the client's exported\n// `SuiClientTypes.ExecutionError` (`@mysten/sui/client`) so mocked simulate results\n// and future API-shape drift still satisfy it — the same convention reads/inspect.ts\n// uses for its simulate seam. Field provenance:\n//   - `MoveAbort.abortCode`                → u64 abort code as a decimal string.\n//   - `MoveAbort.location.module`          → the aborting module's short name.\n//   - `MoveAbort.cleverError.constantName` → the `E…` error constant, decoded by the\n//     fullnode from the clever-error bits of the abort code and surfaced by the gRPC\n//     (`grpc/core.ts` parseMoveAbort) and GraphQL transports. Only a clever-error abort\n//     carries one, and Predict's plain `u64` constants never do, so ABORT_NAMES names\n//     those.\nexport interface MoveAbortError {\n\tMoveAbort?: {\n\t\tabortCode?: string | number | bigint;\n\t\tlocation?: { module?: string };\n\t\tcleverError?: { constantName?: string };\n\t};\n}\n\n/**\n * The error constants of the Predict modules the SDK's flows abort in, by module, as an array\n * indexed by the plain `u64` abort code (each module numbers its constants from 0 with no gaps).\n * Generated from the Move sources at deepbookv3 29117434 and checked against 43dbc952, the Mainnet\n * Version 5 sources. A published code never changes meaning: new codes only append, so an older\n * package version's codes are a prefix of its module's list. A code a later version drops from its\n * source keeps its name here, because the older versions still abort with it.\n * Keyed by module name only, as the abort location reports it, so a same-named module in an\n * unrelated package would be named from this table too.\n */\nexport const ABORT_NAMES: Readonly<Record<string, readonly string[]>> = Object.freeze({\n\t// Predict (`deepbook_predict`). Append-only since v1, so older package versions use a prefix.\n\texpiry_market: [\n\t\t'EMintPaused',\n\t\t'EMarketNotSettled',\n\t\t'EMintCostAboveMax',\n\t\t'EMintProbabilityAboveMax',\n\t\t'EWrongPricer',\n\t\t'EReferenceTickObservationMissing',\n\t\t'EMintRedeemSameTimestamp',\n\t\t'ERedeemProbabilityBelowMin',\n\t\t'ERedeemProceedsBelowMin',\n\t\t'EMintCostCapRequired',\n\t\t'EMarketNotPendingValuation',\n\t\t'EMintCostAboveMaxPayout',\n\t\t'ENotSettledRedeemKeeper',\n\t\t'EDelayedExecutionRequired',\n\t\t'EOrderFailsLimits',\n\t\t'EInsufficientMarketCash',\n\t\t'EInvalidOrderTiming',\n\t\t'EInvalidOrderTerms',\n\t\t'EWrongMarket',\n\t\t'EWrongStage',\n\t\t'ENotRecordOwner',\n\t\t'EEscrowMismatch',\n\t\t'EWrongPrice',\n\t],\n\tprotocol_config: [\n\t\t'ETradingPaused',\n\t\t'EValuationInProgress',\n\t\t'EValuationNotInProgress',\n\t\t'EPackageVersionDisabled',\n\t\t'EVersionWatermarkNotAdvanced',\n\t\t'EProtocolFrozen',\n\t\t'ESnapshotInProgress',\n\t\t'ETradeWindowClosed',\n\t\t'ESettledRedeemKeeperAlreadyAdded',\n\t\t'ESettledRedeemKeeperNotFound',\n\t\t'EFlushOperatorAlreadyAdded',\n\t\t'EFlushOperatorNotFound',\n\t\t'ENotFlushOperator',\n\t\t'ECutoverNotReached',\n\t\t'EEwmaRetired',\n\t\t'EOrderFlowNotAllowed',\n\t\t// Predict v5: a builder trade before the watermark reaches the builder-fee version.\n\t\t'EBuilderFeeCutoverNotReached',\n\t\t// Predict v5: the settled-redeem keeper setters are retired and always abort with it.\n\t\t'ESettledRedeemRetired',\n\t],\n\t// The bounds Predict's admin setters check, so only an admin transaction aborts here.\n\tconfig_constants: [\n\t\t'EInvalidBaseFee',\n\t\t'EInvalidMinFee',\n\t\t'EInvalidMinEntryProbability',\n\t\t'EInvalidMaxEntryProbability',\n\t\t'EInvalidPythSpotFreshnessMs',\n\t\t'EInvalidBlockScholesPriceFreshnessMs',\n\t\t'EInvalidProtocolReserveProfitShare',\n\t\t'EInvalidBlockScholesSVIFreshnessMs',\n\t\t'EInvalidExpiryFeeWindowMs',\n\t\t'EInvalidExpiryFeeMaxMultiplier',\n\t\t'EInvalidMarketTickSize',\n\t\t'EInvalidEwmaAlpha',\n\t\t'EInvalidEwmaZScoreThreshold',\n\t\t'EInvalidEwmaPenaltyRate',\n\t\t'EInvalidBackingBufferLambda',\n\t\t'EInvalidCadenceWindowSize',\n\t\t'EMarketTickSizeTooLarge',\n\t\t'EInvalidLpRequestLimitFlushAttempts',\n\t\t'EInvalidMaxLpPoolValue',\n\t\t'EInvalidPlpSupplyFeeRate',\n\t\t'EInvalidPlpWithdrawFeeRate',\n\t\t'EInvalidInventoryImpactMaxRate',\n\t\t'EInvalidReferralFeeRate',\n\t\t'EInvalidMaxValuationWindowMs',\n\t\t'EInvalidNoTradeWindowMs',\n\t\t'EInvalidFeeIncentiveSubsidyRate',\n\t\t'EInvalidFeeIncentiveLiveTargetRate',\n\t\t'EInvalidFeeIncentiveLifetimeCapRate',\n\t\t'EInvalidBuilderFeeCap',\n\t\t// Predict v5: `set_template_fee_bands`.\n\t\t'EInvalidFeeBands',\n\t],\n\t// Predict's live pricer, which every quote, plan and enqueue loads.\n\tpricing: [\n\t\t'EZeroForward',\n\t\t'ECannotBeNegative',\n\t\t'ENonPositiveVariance',\n\t\t'EInvalidRange',\n\t\t'EBlockScholesPriceStale',\n\t\t'EBlockScholesInputsInvalid',\n\t\t'EPythSpotInvalid',\n\t\t'EWrongPythFeed',\n\t\t'EWrongBlockScholesValueStore',\n\t\t'ELivePricingExpired',\n\t\t'EBlockScholesSVIStale',\n\t\t'EWrongBlockScholesSVIStore',\n\t\t'EBlockScholesPriceUnavailable',\n\t\t'EBlockScholesSVIUnavailable',\n\t\t'EBlockScholesMinVarianceInvalid',\n\t\t'EOracleWrittenInThisTransaction',\n\t\t'EBlockScholesInputTooWide',\n\t\t'EPythSpotUnavailable',\n\t\t'EPythSpotStale',\n\t\t'EPythForwardRequired',\n\t],\n\t// Admission, positions and the LP pool. `order` and `registry` are left out: DeepBook's core\n\t// package has modules of the same names, which this table would misname.\n\tstrike_exposure: [\n\t\t'EInvalidCloseQuantity',\n\t\t'EInvalidAdmissionTick',\n\t\t'EInvalidReferenceTick',\n\t\t'EReferenceTickAlreadySet',\n\t\t'ETermsExposureMismatch',\n\t\t'EMintQuantityBelowMin',\n\t\t'EInvalidInventoryImpactScale',\n\t],\n\tstrike_exposure_config: [\n\t\t'EEntryProbabilityOutOfBounds',\n\t\t'EInvalidEntryProbabilityBound',\n\t\t'EInvalidFeeProbability',\n\t\t'EPremiumBelowMinimum',\n\t],\n\tstrike_payout_tree: [\n\t\t'EInsufficientPayoutQuantity',\n\t\t'EMaxPayoutTreeNodes',\n\t\t'ENonMonotonePrice',\n\t\t'EStaleValuationSnapshot',\n\t\t'ESnapshotSeqNotIncreasing',\n\t\t'ENodeMissing',\n\t],\n\texpiry_cash: ['EInsufficientCash', 'EInventoryImpactRebateExceedsReserve'],\n\tpredict_account: ['EPositionAlreadyExists', 'EPositionNotFound'],\n\tbuilder_code: ['ENotOwner'],\n\tplp: [\n\t\t'EMissingExpiryValuation',\n\t\t'ENotBootstrapped',\n\t\t'EAlreadyBootstrapped',\n\t\t'EBelowMinBootstrapLiquidity',\n\t\t'EBelowMinFeeIncentiveSponsorship',\n\t\t'EMaxLiveExpiryMarketsExceeded',\n\t\t'EValuationSnapshotNotSealed',\n\t\t'EExpiryPricerAlreadySnapshotted',\n\t\t'EIncompleteValuationSnapshot',\n\t\t'EExpiredMarketNotSettled',\n\t\t'EValuationWindowExpired',\n\t\t'ESnapshotStageOpen',\n\t\t'EBelowMinUsdcContribution',\n\t\t'EContributionExceedsPriceCeiling',\n\t\t'EInsufficientFeeIncentiveReserve',\n\t],\n\tlp_book: [\n\t\t'ERequestNotFound',\n\t\t'EBelowMinSupplyRequest',\n\t\t'EBelowMinWithdrawRequest',\n\t\t'ENotRequestOwner',\n\t],\n\tpool_accounting: [\n\t\t'EUnknownRegisteredExpiry',\n\t\t'ERegisteredExpiryAlreadyExists',\n\t\t'EMaxExpiryFundingExceeded',\n\t\t'ETerminalAccountingStarted',\n\t],\n\t// The order-flow package (`deepbook_predict_orders`).\n\tqueue: [\n\t\t'EWrongDesk',\n\t\t'EWrongMarket',\n\t\t'EQueueStuck',\n\t\t'EQueueFull',\n\t\t'EAccountOrderCap',\n\t\t'EPastCutoff',\n\t\t'EMintCostCapRequired',\n\t\t'EFeeNotCovered',\n\t\t'EBelowMinSell',\n\t\t'ERecordNotOpen',\n\t\t'ENotRecordOwner',\n\t\t'EMarketNotSettled',\n\t\t'EMarketNotExpired',\n\t],\n\tdesk: ['EPackageVersionDisabled', 'EVersionWatermarkNotAdvanced', 'EProtocolFrozen'],\n\torder_queue: ['ERecordNotOpen'],\n\tdelayed_execution_config: [\n\t\t'EInvalidDelayMs',\n\t\t'EInvalidStallTimeoutMs',\n\t\t'EInvalidStuckThresholdMs',\n\t\t'EInvalidGapWaitMs',\n\t\t'EInvalidPythPriceBufferMs',\n\t\t'EInvalidSviMaxAgeMs',\n\t\t'EInvalidMintCapacity',\n\t\t'EInvalidSellCapacity',\n\t\t'EInvalidPerAccountCap',\n\t\t'EInvalidMinSellQuantity',\n\t\t'EInvalidOrderFee',\n\t\t'EInvalidSettleRefundBatch',\n\t\t'EInvalidSettlePayoutBatch',\n\t\t'EUnsupportedPythChannel',\n\t\t'EInvalidTiming',\n\t\t'EInvalidLimits',\n\t],\n\t// The math library (`deepbook_predict_math`).\n\tlazer_price: ['EPropertyNotRequested', 'EGenerationAfterEnvelope', 'EFeedMissing'],\n\t// Sessions (`deepbook_sessions`), which the `/sessions` Predict wrappers abort in.\n\tsessions: [\n\t\t'EInvalidSessionDuration',\n\t\t'ESessionNotAuthorized',\n\t\t'ESessionLimitExceeded',\n\t\t// Session builder approvals (Sessions v4, the Mainnet number).\n\t\t'EBuilderNotApproved',\n\t\t'EBuilderFeeAboveApproved',\n\t\t'EBuilderApprovalsNotEnabled',\n\t],\n\tsession_config: [\n\t\t'EPackageVersionDisabled',\n\t\t'EVersionWatermarkNotAdvanced',\n\t\t// Sessions v4 (the Mainnet number): a session spot order on a pool outside the allowlist.\n\t\t'EPoolNotAllowed',\n\t],\n\t// The shared account (`deepbook_account`).\n\taccount_registry: ['EAppAlreadyAuthorized', 'EAppNotAuthorized', 'EAccountAlreadyExists'],\n});\n\n/** `std::option::EOPTION_NOT_SET`. */\nconst OPTION_NOT_SET = 0x40001n;\n\n/**\n * The constant name of a plain `u64` abort `code` in `module`, from {@link ABORT_NAMES}, or null\n * when the module or the code is unknown.\n */\nexport function abortNameFor(module: string, code: bigint): string | null {\n\t// The order-fee guard (`queueTx.assertOrderFeeAtMost`) aborts in the standard library's\n\t// `option`, whose constant isn't an index.\n\tif (module === 'option' && code === OPTION_NOT_SET) return 'EOPTION_NOT_SET';\n\t// Own keys only: a module named like an `Object.prototype` member is simply unknown.\n\tif (!Object.hasOwn(ABORT_NAMES, module)) return null;\n\tconst names = ABORT_NAMES[module];\n\tif (code < 0n || code >= BigInt(names.length)) return null;\n\treturn names[Number(code)];\n}\n\n/**\n * Decode a `@mysten/sui` MoveAbort execution error into a {@link PredictMoveError}.\n * Returns null when `error` carries no MoveAbort (InsufficientGas, a size error, any\n * non-abort failure), so callers can fall back to a plain Error.\n *\n * `abortName` is the chain-decoded clever-error constant when the fullnode surfaces one, and\n * otherwise the name {@link ABORT_NAMES} gives the module's plain code (Predict's constants are\n * plain codes, so this is the usual path). It is null when neither knows the abort.\n * `code` stays a bigint — a clever-error abort code packs the module, line, and\n * constant index into the high bits of the u64 and would lose precision as a Number.\n */\nexport function decodeMoveAbort(error: MoveAbortError | null | undefined): PredictMoveError | null {\n\tconst abort = error?.MoveAbort;\n\tif (!abort) return null;\n\tconst module = abort.location?.module ?? '';\n\tconst code = abort.abortCode != null ? BigInt(abort.abortCode) : 0n;\n\tconst abortName = abort.cleverError?.constantName ?? abortNameFor(module, code);\n\treturn new PredictMoveError(module, code, abortName);\n}\n\n// === Delayed execution (DBU-885) ===\n\n/**\n * Why a queued-order builder refused to add an enqueue. The builder reads the market first and\n * throws this instead of building a transaction the queue or protocol gates would abort, so a\n * refused order never fails the rest of a transaction. Each code mirrors one on-chain refusal. The\n * order's own limits at the current price are checked only on chain (`EOrderFailsLimits`).\n */\nexport type PredictPreflightCode =\n\t/**\n\t * Delayed execution isn't live: Predict's version watermark isn't raised\n\t * (`ECutoverNotReached`), or Predict doesn't allowlist the order-flow package yet\n\t * (`EOrderFlowNotAllowed`).\n\t */\n\t| 'not-live'\n\t/** The market has no `MarketQueue` yet: `queue::create_and_share` hasn't run for it. */\n\t| 'no-queue'\n\t/**\n\t * A version floor retired code this SDK calls: Predict's watermark is above the Predict\n\t * version it was built for (`protocol_config::EPackageVersionDisabled`), or the order desk's\n\t * floor is above its order-flow package (`desk::EPackageVersionDisabled`). Update the SDK.\n\t */\n\t| 'retired'\n\t/** Trading is paused, the protocol is frozen, or minting is paused on this market. */\n\t| 'paused'\n\t/** The market's pricing is delayed (`queue_stuck`). Enqueue aborts `EQueueStuck`. */\n\t| 'stuck'\n\t/**\n\t * The order's τ would land at or after the market's order cutoff (`EPastCutoff`). A\n\t * `read.planMint` or `read.planSell` plan on a market past its expiry throws it too, since the\n\t * chain has no live price to quote (`ELivePricingExpired`).\n\t */\n\t| 'past-cutoff'\n\t/** The market has its maximum unfinished mints or sells (`EQueueFull`). */\n\t| 'queue-full'\n\t/** The account has its maximum unfinished orders in this market (`EAccountOrderCap`). */\n\t| 'account-cap'\n\t/**\n\t * The account balance doesn't cover the order fee (`EFeeNotCovered`). A `read.planMint` plan\n\t * also reports it when the balance doesn't cover the plan's `totalDebit`, since its limits assume\n\t * the whole budget, or when the owner has no account yet. Prompt a top-up.\n\t */\n\t| 'fee'\n\t/** A mint's cash need is above the market's spare cash (`EInsufficientMarketCash`). */\n\t| 'market-cash'\n\t/**\n\t * The escrowed budget, or an exact-amount mint's premium cap, can't buy the minimum premium,\n\t * so the order fails its limits. A budget `read.planMint` plan also reports it when what the\n\t * budget buys without the fee subsidy, as admission prices it, has a premium below the minimum,\n\t * and throws it for a budget below the minimum premium or one no fill clears it with.\n\t */\n\t| 'min-premium'\n\t/**\n\t * The strike's entry probability is outside the market's entry band, so the chain refuses to\n\t * quote or admit it (`EOrderFailsLimits`). Pick a strike nearer the money. Only `read.planMint`\n\t * reports it, and the probability can still leave the band between plan and placement.\n\t */\n\t| 'entry-band'\n\t/**\n\t * The order's all-in cost without the fee subsidy is above its payout, so admission refuses it\n\t * at any slippage (`EOrderFailsLimits`), or for a budget, the fill costs about its payout, where\n\t * admission's sizing can't be previewed. Only `read.planMint` reports it, near a certain outcome.\n\t */\n\t| 'cost-above-payout'\n\t/** A sell is below the policy minimum, or leaves a remainder below it (`EBelowMinSell`). */\n\t| 'below-min-sell'\n\t/** The record to sell is missing or not Open (`ERecordNotOpen`). */\n\t| 'record-not-open'\n\t/** The record to sell belongs to another account (`ENotRecordOwner`). */\n\t| 'not-record-owner';\n\n/** A queued-order builder's refusal, raised before any transaction is built. */\nexport class PredictPreflightError extends Error {\n\treadonly code: PredictPreflightCode;\n\n\tconstructor(code: PredictPreflightCode, message: string) {\n\t\tsuper(message);\n\t\tthis.name = 'PredictPreflightError';\n\t\tthis.code = code;\n\t}\n}\n\n// Readable text for the aborts a trader, an app or a filler meets on the delayed-execution\n// paths, keyed by `module::EName` as `decodeMoveAbort` names it. The queue's own\n// checks are in the order-flow companion's `queue` and `desk` modules; Predict's admission, fill\n// and quote checks stay in `expiry_market` and `protocol_config`; the Lazer decode is in the math\n// library's `lazer_price`.\nconst PREDICT_ERROR_TEXT: Readonly<Record<string, string>> = Object.freeze({\n\t// Placement (`queue::enqueue_*`).\n\t'queue::EQueueStuck': 'Pricing is delayed for this market. Try again shortly.',\n\t'queue::EQueueFull': \"This market's order queue is full. Try again shortly.\",\n\t'queue::EAccountOrderCap': 'You already have the most waiting orders this market allows.',\n\t'queue::EPastCutoff': 'This market no longer takes orders before its expiry.',\n\t'queue::EFeeNotCovered': \"Your balance doesn't cover the order fee. Top up and retry.\",\n\t'queue::EBelowMinSell': 'The sell is below the minimum size, or leaves a remainder below it.',\n\t'queue::ERecordNotOpen': \"That position isn't open in this market anymore.\",\n\t'queue::ENotRecordOwner': 'That position belongs to another account.',\n\t'queue::EMintCostCapRequired': 'Set a maximum cost for the order.',\n\t'queue::EWrongDesk': 'That order queue belongs to another order desk.',\n\t'queue::EWrongMarket': \"That order queue doesn't belong to this market.\",\n\t'queue::EMarketNotSettled': \"The market hasn't settled yet.\",\n\t'queue::EMarketNotExpired': \"The market hasn't expired yet.\",\n\t'desk::EPackageVersionDisabled':\n\t\t'This order-flow package version is retired. Update to an SDK that calls the current package.',\n\t'desk::EProtocolFrozen': 'The protocol is frozen.',\n\t// The order-fee guard every SDK enqueue starts with. Predict's own `option` unwraps can abort the\n\t// same way, so the text hedges.\n\t'option::EOPTION_NOT_SET':\n\t\t\"This order wasn't placed: most likely the order fee rose after it was built. Build it again.\",\n\t// Predict's admission and quotes.\n\t'expiry_market::EDelayedExecutionRequired':\n\t\t'Immediate trades are retired on this market. Place a queued order instead.',\n\t'expiry_market::EOrderFailsLimits':\n\t\t\"The market can't take this order at the current price: it misses its price limits, its price is outside the market's entry range, or its premium is below the minimum.\",\n\t'expiry_market::EInsufficientMarketCash': \"This market can't take an order this size right now.\",\n\t'expiry_market::EMintCostCapRequired': 'Set a maximum cost for the order.',\n\t'expiry_market::EMintPaused': 'Minting is paused on this market.',\n\t'expiry_market::EInvalidOrderTiming': 'This market no longer takes orders before its expiry.',\n\t'expiry_market::EMarketNotSettled': \"The market hasn't settled yet.\",\n\t'strike_exposure_config::EEntryProbabilityOutOfBounds':\n\t\t\"This strike's price is outside the market's entry range. Pick a strike nearer the money.\",\n\t'strike_exposure_config::EPremiumBelowMinimum':\n\t\t\"The order's premium is below the 1 USDC minimum.\",\n\t'strike_exposure::EMintQuantityBelowMin':\n\t\t'The price moved, so the budget buys fewer contracts than the order asks for.',\n\t'strike_payout_tree::EMaxPayoutTreeNodes':\n\t\t'This market has no room for a new strike right now. Pick a strike that already has positions.',\n\t'expiry_cash::EInsufficientCash': \"This market can't take an order this size right now.\",\n\t// The LP pool.\n\t'lp_book::EBelowMinSupplyRequest': 'The deposit is below the minimum supply request.',\n\t'lp_book::EBelowMinWithdrawRequest': 'The withdrawal is below the minimum withdraw request.',\n\t// Live pricing. The unavailable and stale aborts clear once the oracles write again.\n\t'pricing::EBlockScholesPriceUnavailable':\n\t\t'Pricing is briefly unavailable for this market. Try again in a moment.',\n\t'pricing::EBlockScholesSVIUnavailable':\n\t\t'Pricing is briefly unavailable for this market. Try again in a moment.',\n\t'pricing::EBlockScholesPriceStale': \"This market's price feed is behind. Try again shortly.\",\n\t'pricing::EBlockScholesSVIStale': \"This market's price feed is behind. Try again shortly.\",\n\t'pricing::EPythSpotUnavailable': \"This market's live price is unavailable. Try again shortly.\",\n\t'pricing::EPythSpotStale': \"This market's live price is behind. Try again shortly.\",\n\t'pricing::ELivePricingExpired': 'This market has reached its expiry.',\n\t// Filler (`queue::commit`, decoding the Lazer update).\n\t'lazer_price::EGenerationAfterEnvelope':\n\t\t'The Pyth update was generated after its own timestamp envelope.',\n\t'lazer_price::EFeedMissing': \"The Pyth update doesn't carry this market's feed.\",\n\t'lazer_price::EPropertyNotRequested':\n\t\t\"The Pyth update doesn't carry the price property commit needs.\",\n\t// Sessions and the shared account.\n\t'sessions::ESessionNotAuthorized':\n\t\t\"This session key isn't authorized for the account, or its grant has expired.\",\n\t'sessions::ESessionLimitExceeded':\n\t\t'The account holds the most session keys it can. Revoke expired ones, then grant again.',\n\t'sessions::EInvalidSessionDuration': 'A session must last more than 0 ms and at most 30 days.',\n\t'session_config::EPackageVersionDisabled':\n\t\t'This sessions package version is retired. Update to an SDK that calls the current package.',\n\t'session_config::EPoolNotAllowed':\n\t\t\"Session keys can't place orders on this pool. Cancels and withdrawals still work.\",\n\t'account_registry::EAppNotAuthorized':\n\t\t\"Trading through this app (such as Sessions) isn't enabled for accounts yet.\",\n\t'account_registry::EAccountAlreadyExists': 'This address already has an account.',\n\t// Protocol gates.\n\t'protocol_config::ECutoverNotReached':\n\t\t\"Queued orders aren't live yet: the protocol's version watermark hasn't been raised.\",\n\t'protocol_config::EOrderFlowNotAllowed':\n\t\t\"Queued orders aren't live yet: the protocol hasn't enabled the order-flow package.\",\n\t'protocol_config::EPackageVersionDisabled':\n\t\t'This package version is retired. Update to an SDK that calls the current package.',\n\t'protocol_config::EProtocolFrozen': 'The protocol is frozen.',\n\t'protocol_config::ETradingPaused': 'Trading is paused.',\n\t'protocol_config::ESnapshotInProgress': 'A pool valuation is running. Try again in a moment.',\n});\n\n/**\n * Readable text for a decoded Move abort on the Predict paths, or `null` when the abort isn't\n * one this SDK describes (an unknown name, or an abort `decodeMoveAbort` couldn't name). Callers\n * fall back to `e.message` on `null`, so new contract errors degrade to the raw abort rather\n * than to a wrong message.\n */\nexport function describePredictError(e: PredictMoveError): string | null {\n\tif (!e.abortName) return null;\n\treturn PREDICT_ERROR_TEXT[`${e.module}::${e.abortName}`] ?? null;\n}\n"],"mappings":";;AAaA,IAAa,oBAAb,cAAuC,MAAM;CAC5C,YAAY,SAAiB;AAC5B,QAAM,QAAQ;AACd,OAAK,OAAO;;;;AAKd,IAAa,mBAAb,cAAsC,MAAM;CAU3C,YAAY,QAAgB,MAAc,WAA0B;AACnE,QACC,YACG,iBAAiB,OAAO,IAAI,UAAU,SAAS,KAAK,KACpD,iBAAiB,OAAO,SAAS,OACpC;AACD,OAAK,OAAO;AACZ,OAAK,SAAS;AACd,OAAK,OAAO;AACZ,OAAK,YAAY;;;;;;;;;;;;;AAkCnB,MAAa,cAA2D,OAAO,OAAO;CAErF,eAAe;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,iBAAiB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;CAED,kBAAkB;EACjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;CAED,SAAS;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAGD,iBAAiB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,wBAAwB;EACvB;EACA;EACA;EACA;EACA;CACD,oBAAoB;EACnB;EACA;EACA;EACA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