@parchment-trade/sdk 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +193 -2
- package/REFERENCE.md +338 -0
- package/SECURITY.md +25 -0
- package/dist/general/providers/index.d.ts +2 -0
- package/dist/general/providers/index.js +2 -0
- package/dist/general/providers/parchment.d.ts +1 -0
- package/dist/general/providers/parchment.js +1 -0
- package/dist/general/providers/parchmentSdk.d.ts +23 -0
- package/dist/general/providers/parchmentSdk.js +11 -0
- package/dist/general/types/configTypes.d.ts +62 -0
- package/dist/general/types/configTypes.js +1 -0
- package/dist/general/types/index.d.ts +1 -0
- package/dist/general/types/index.js +1 -0
- package/dist/general/utils/address.d.ts +49 -0
- package/dist/general/utils/address.js +110 -0
- package/dist/general/utils/caller.d.ts +58 -0
- package/dist/general/utils/caller.js +182 -0
- package/dist/general/utils/errors.d.ts +16 -0
- package/dist/general/utils/errors.js +26 -0
- package/dist/general/utils/index.d.ts +4 -0
- package/dist/general/utils/index.js +4 -0
- package/dist/general/utils/jsBigInt.d.ts +26 -0
- package/dist/general/utils/jsBigInt.js +74 -0
- package/dist/general/utils/txShape.d.ts +8 -0
- package/dist/general/utils/txShape.js +39 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/packages/index.d.ts +11 -0
- package/dist/packages/index.js +5 -0
- package/dist/packages/parchment/abortCodes.d.ts +196 -0
- package/dist/packages/parchment/abortCodes.js +522 -0
- package/dist/packages/parchment/batchClose.d.ts +268 -0
- package/dist/packages/parchment/batchClose.js +524 -0
- package/dist/packages/parchment/eventGuard.d.ts +106 -0
- package/dist/packages/parchment/eventGuard.js +119 -0
- package/dist/packages/parchment/gameCounterEvents.d.ts +59 -0
- package/dist/packages/parchment/gameCounterEvents.js +56 -0
- package/dist/packages/parchment/index.d.ts +52 -0
- package/dist/packages/parchment/index.js +30 -0
- package/dist/packages/parchment/liquidationCredit.d.ts +28 -0
- package/dist/packages/parchment/liquidationCredit.js +25 -0
- package/dist/packages/parchment/lockedMintEvents.d.ts +42 -0
- package/dist/packages/parchment/lockedMintEvents.js +46 -0
- package/dist/packages/parchment/monitoring.d.ts +369 -0
- package/dist/packages/parchment/monitoring.js +259 -0
- package/dist/packages/parchment/notes.d.ts +6 -0
- package/dist/packages/parchment/notes.js +1 -0
- package/dist/packages/parchment/onboarding.d.ts +50 -0
- package/dist/packages/parchment/onboarding.js +48 -0
- package/dist/packages/parchment/orderEffects.d.ts +207 -0
- package/dist/packages/parchment/orderEffects.js +268 -0
- package/dist/packages/parchment/orderParams.d.ts +72 -0
- package/dist/packages/parchment/orderParams.js +71 -0
- package/dist/packages/parchment/packageIds.d.ts +53 -0
- package/dist/packages/parchment/packageIds.js +149 -0
- package/dist/packages/parchment/parchment.d.ts +442 -0
- package/dist/packages/parchment/parchment.js +975 -0
- package/dist/packages/parchment/parchmentAccount.d.ts +189 -0
- package/dist/packages/parchment/parchmentAccount.js +273 -0
- package/dist/packages/parchment/parchmentMarket.d.ts +58 -0
- package/dist/packages/parchment/parchmentMarket.js +86 -0
- package/dist/packages/parchment/parchmentTypes.d.ts +2031 -0
- package/dist/packages/parchment/parchmentTypes.js +65 -0
- package/dist/packages/parchment/publicInts.d.ts +45 -0
- package/dist/packages/parchment/publicInts.js +383 -0
- package/dist/packages/parchment/reconcileEvents.d.ts +24 -0
- package/dist/packages/parchment/reconcileEvents.js +30 -0
- package/dist/packages/parchment/retainedFee.d.ts +43 -0
- package/dist/packages/parchment/retainedFee.js +68 -0
- package/dist/packages/parchment/sessionClose.d.ts +68 -0
- package/dist/packages/parchment/sessionClose.js +50 -0
- package/dist/packages/parchment/sessionKey.d.ts +78 -0
- package/dist/packages/parchment/sessionKey.js +154 -0
- package/dist/packages/parchment/slippage.d.ts +23 -0
- package/dist/packages/parchment/slippage.js +27 -0
- package/dist/packages/parchment/sponsor.d.ts +39 -0
- package/dist/packages/parchment/sponsor.js +48 -0
- package/dist/packages/parchment/stakingCalls.d.ts +33 -0
- package/dist/packages/parchment/stakingCalls.js +21 -0
- package/dist/packages/parchment/stakingEvents.d.ts +53 -0
- package/dist/packages/parchment/stakingEvents.js +71 -0
- package/dist/packages/parchment/triggerCalls.d.ts +46 -0
- package/dist/packages/parchment/triggerCalls.js +36 -0
- package/dist/packages/parchment/triggerEvents.d.ts +22 -0
- package/dist/packages/parchment/triggerEvents.js +33 -0
- package/dist/packages/parchment/triggers.d.ts +113 -0
- package/dist/packages/parchment/triggers.js +183 -0
- package/dist/packages/parchment/txBodies.d.ts +111 -0
- package/dist/packages/parchment/txBodies.js +683 -0
- package/dist/packages/parchment/txIntent.d.ts +99 -0
- package/dist/packages/parchment/txIntent.js +611 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +1 -0
- package/package.json +58 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EMERGENCY_CLOSE_DISABLED_MS, MARKET_STATUS_ACTIVE, MARKET_STATUS_REDUCE_ONLY, MARKET_STATUS_RETIRED, ORDER_PARAMS_V1_BCS, ORDER_TX_NOTE, PUBLIC_INTS, bindTradingReferrerTxBody, transferAccountTxBody, cancelOrderTxBody, claimPendingMintTxBody, claimQuestTxBody, claimTxBody, exitEarlyBoundedTxBody, exitEarlyTxBody, releaseUnlockedTxBody, closePreviewBody, closeRetiredTxBody, depositTxBody, gameTxBody, openCratesTxBody, installTreasuryTxBody, lpHarvestTxBody, openAccountTxBody, registerBuilderTxBody, setBuilderPayoutTxBody, createBuilderTxBody, setBuilderFeeTxBody, builderOwnerTxBody, transferBuilderTxBody, approveBuilderTxBody, revokeBuilderApprovalTxBody, BUILDER_FEE_HARD_BPS, MAX_BUILDER_CREATE_FEE, setBuilderCreateFeeTxBody, stakeTxBody, sweepSurplusTxBody, unstakeTxBody, withdrawTxBody, decodeOrderParams, closeRetiredAsDelegateTxBody, emergencyCloseAsDelegateTxBody, grantDelegateTxBody, grantCloseDelegateTxBody, grantSessionAndTriggerTxBody, revokeSessionAndTriggerTxBody, revokeDelegateTxBody, NEAR_LIQ_DISTANCE_FRACTION, TRIGGER_PROOF_TTL_MS, TRIGGER_PROOF_VERSION, newTriggerIntentId, signTriggerProof, stopAgainstLiquidation, triggerBindBody, triggerPrepareBody, triggerProofMessage, triggerRequestBody, emergencyCloseDisabled, emergencyCloseTxBody, expireOrderTxBody, hasPendingOrderSlot, isEmergencyAfterDisabled, openPreviewBody, orderParamsFromJson, orderRefTxBody, requestCloseAsDelegateTxBody, requestCloseTxBody, requestOpenAsDelegateTxBody, requestOpenTxBody, assertDelegateLiveThroughFill, DELEGATE_FILL_MARGIN_MS, ORDER_ABORT_MESSAGES, ORDER_ABORT_NAMES, ORACLE_RESERVED_ABORT_CODES, ORDER_RESERVED_ABORT_CODES, TRADE_RESERVED_ABORT_CODES, MIN_CANCEL_DELAY_MS, ORDER_FINALIZED_EVENT_BCS, ORDER_OUTCOMES, ORDER_REFUND_SESSION_MESSAGE, ORDER_REQUESTED_EVENT_BCS, PARCHMENT_CANDLES_BATCH_MAX_MARKETS, PARCHMENT_SPONSORED_ACTIONS, PARCHMENT_TRADE_MODULES, ParchmentAccount, ParchmentMarket, TX_ACTIONS, TRADE_ABORT_MESSAGES, TRADE_ABORT_NAMES, FEE_MINT_ABORT_MESSAGES, FEE_MINT_ABORT_NAMES, MARKET_ABORT_MESSAGES, MARKET_ABORT_NAMES, ACCESS_ABORT_NAMES, ACCOUNT_ABORT_NAMES, CONFIG_ABORT_NAMES, BUILDER_ABORT_NAMES, REFERRAL_ABORT_NAMES, STAKING_ABORT_NAMES, DECLARED_NOT_RAISED_ABORT_CODES, EXCHANGE_ABORT_NAMES, HOLDER_BOOK_ABORT_NAMES, ACCOUNT_TRANSFER_ABORT_NAMES, ABORT_MODULE_PATHS, ABORT_NAME_MAPS, AUTHORITY_ABORT_NAMES, FEES_ABORT_NAMES, GAME_ABORT_MESSAGES, GAME_ABORT_NAMES, KEEPER_ABORT_NAMES, EVENT_GUARD_ABORT_NAMES, LIQ_BOOK_ABORT_NAMES, LP_ABORT_NAMES, ORACLE_ABORT_NAMES, ORACLE_ADAPTER_ABORT_NAMES, POSITION_ABORT_NAMES, TIMELOCK_ABORT_NAMES, LOCKED_MINT_ABORT_NAMES, MINT_CAP_ABORT_NAMES, UNCOVERED_MODULES, LOCKED_LEDGER_STATUSES, RETAINED_FEE_CURVE_DEFAULTS, RETAINED_FEE_CURVE_MAX_COV_BPS, addSetRetainedFeeCurveCall, lpRetainedFeeCurve, retainedFeeCurve, retainedStakerShareBps, abortMessage, abortName, boundFromSlippage, decodeAbortCode, decodeOrderFinalizedEvent, finalizedOrdersFromTx, orderOutcome, decodeOrderRequestedEvent, isParchmentTradeModule, marketIsActive, marketIsDelisted, marketIsRetired, marketMinHoldMs, marketNextSessionOpenMs, marketSessionEndsAtMs, liquidationPaused, requestsPausedMessage, orderAbortMessage, orderAbortName, effectiveCancelAfterMs, orderExpiresAfterMs, parchmentBaseTypePackageId, parchmentCallPackageId, parchmentCoreTypePackageId, parchmentGameTypePackageId, parchmentMintTypePackageId, parchmentTradeTypePackageId, requireSplitPackageIds, requestedOrderIdFromTx, requestedOrdersFromTx, SPONSOR_IN_FLIGHT_LIMIT, SPONSOR_NOT_DELEGATE, isSessionKeyRevoked, shouldPayOwnGas, sponsorBody, SESSION_KEY_EXPIRY_MARGIN_MS, SESSION_KEY_TTL_MS, MAX_SPONSOR_PROOF_LIFETIME_MS, SPONSOR_PROOF_LIFETIME_MS, assertSessionTradeKind, createSessionKey, isSponsoredCopyOf, liveSessionDelegate, sessionKeyExpiryMs, sessionKeyFromSecret, sessionKeySecret, signSessionSponsoredTx, signSponsorProof, sponsorProofMessage, tradeAbortMessage, FORCE_CLOSE_SESSION_MAX_IDS, BatchCloseError, CLOSE_BATCH_BUDGET, SPONSOR_BATCH_BUDGET, SUI_TX_LIMITS, batchCloseTx, closeBatchTopUps, closeBatchUsage, fitCloseBatch, legIsRequest, planCloseBatches, splitCloseBatches, txIntentViolation, untrustedConfigPackages, UNCHECKED_TX, GAME_REGISTRY_MAXIMA, gameEventLimitsFromDefinitions, playerProgressionEvents, addArmSessionCloseAdminCall, addArmSessionCloseCall, addSessionRefundCall, addForceCloseSessionCall, addMintPendingForCalls, buildMintPendingForTx, addOneSignatureOnboardingCalls, deriveAccountId, MONITORING_MAX_DAYS, monitoringPath, monitoringView, statsActivityPath, statsActivityView, STAKING_HISTORY_WINDOWS, stakingHistoryPath, stakingHistoryView, parseLivePrice, parseTrade, } from "./parchment/index.js";
|
|
2
|
+
export { EVENT_CLOSE_ARMED_EVENT_BCS, EVENT_GUARD_MAX_WINDOW_MS, EVENT_LEVERAGE_CAP_UPDATED_EVENT_BCS, EVENT_PAUSE_UPDATED_EVENT_BCS, EVENT_REASON, addArmEventCloseCall, addClearEventLeverageCapCall, addClearEventPauseCall, addEventGuardAdminClearCall, addSetEventLeverageCapCall, addSetEventPauseCall, decodeEventCloseArmedEvent, decodeEventLeverageCapUpdatedEvent, decodeEventPauseUpdatedEvent, eventGuardEventType, } from "./parchment/index.js";
|
|
3
|
+
export { TRIGGER_LEVELS_COMMITTED_BCS, TRIGGER_LEVELS_SET_EVENT_BCS, decodeTriggerLevelsCommitted, decodeTriggerLevelsSetEvent } from "./parchment/index.js";
|
|
4
|
+
export { addRequestOpenWithTriggersCall, addRequestOpenWithTriggersAsDelegateCall, addSetTriggerLevelsCall, addSetTriggerLevelsAsDelegateCall } from "./parchment/index.js";
|
|
5
|
+
export { LOCKED_WEIGHT_SYNCED_EVENT_BCS, LOCKED_YIELD_CLAIMED_EVENT_BCS, LOCKED_YIELD_FORFEITED_EVENT_BCS, LOCKED_WEIGHT_BPS_UPDATED_EVENT_BCS, decodeLockedWeightSyncedEvent, decodeLockedYieldClaimedEvent, decodeLockedYieldForfeitedEvent, decodeLockedWeightBpsUpdatedEvent, addSyncLockedCall, addSyncLockedCalls, addForfeitLockedYieldCall, } from "./parchment/index.js";
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abort codes left reserved by removed guards: the TWAP price guard (oracle 3,
|
|
3
|
+
* order 18, trade 30) and the signed bid/ask band (trade 26
|
|
4
|
+
* `EPriceOutsideSignedBand`, oracle 18 `EBadSignedRange`), and order 23 `ENeedsStoragePrice` (retired:
|
|
5
|
+
* every `order::expire` takes an expiry price now). Never raised; each number stays taken so
|
|
6
|
+
* no other code shifts. They have no name or copy here, so they fall through to the caller's generic
|
|
7
|
+
* unknown-abort message.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TRADE_RESERVED_ABORT_CODES: readonly number[];
|
|
10
|
+
export declare const ORDER_RESERVED_ABORT_CODES: readonly number[];
|
|
11
|
+
export declare const ORACLE_RESERVED_ABORT_CODES: readonly number[];
|
|
12
|
+
/**
|
|
13
|
+
* Declared, not raised (lead 6:08 AM): constants A keeps in the Move source with their numbers reserved,
|
|
14
|
+
* but no code path aborts with them today: `trade` 0 `EBadVersion`, 10 `ELpInsolvent`, 16 `ENotAuthorized`,
|
|
15
|
+
* `order` 1 `ENotAuthorized` and `oracle` 0 `EBadVersion`. Their names stay in `TRADE_ABORT_NAMES`,
|
|
16
|
+
* `ORDER_ABORT_NAMES` and `ORACLE_ABORT_NAMES` (same as the service's `abort_name` for trade/order). Doc only.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DECLARED_NOT_RAISED_ABORT_CODES: Readonly<Record<string, readonly number[]>>;
|
|
19
|
+
/**
|
|
20
|
+
* Friendly messages for Move abort codes the SDK documents.
|
|
21
|
+
* Keys are on-chain abort codes within the named module.
|
|
22
|
+
*/
|
|
23
|
+
export declare const TRADE_ABORT_MESSAGES: Readonly<Record<number, string>>;
|
|
24
|
+
/**
|
|
25
|
+
* `trade` module abort code -> Move constant name, from the `#[error(code = N)]` declarations in
|
|
26
|
+
* `parchment_trade::trade` (`trade.move`); 30 is reserved and unnamed. Same module/code pairs as the
|
|
27
|
+
* service's `abort_name`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const TRADE_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
30
|
+
/**
|
|
31
|
+
* Look up a friendly trade abort message, or undefined when unknown. Accepts a raw clever-error
|
|
32
|
+
* abort code (every `trade` abort on chain is one) or the decoded N.
|
|
33
|
+
*/
|
|
34
|
+
export declare function tradeAbortMessage(code: number | bigint | string): string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* `order` module abort code -> Move constant name, from the `#[error(code = N)]` declarations in
|
|
37
|
+
* `parchment_trade::order` (`order.move`). On chain the abort code is a clever-error bitset;
|
|
38
|
+
* `decodeAbortCode` extracts N from it.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ORDER_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
41
|
+
/**
|
|
42
|
+
* Friendly messages for `order` module aborts, keyed by constant name. On chain, `order.move`
|
|
43
|
+
* aborts carry numeric `#[error(code = N)]` codes 0-12, 14-17, 19-22 and 24-31 (not names; 13 is unused, 18 and 23 are reserved); `ORDER_ABORT_NAMES` maps
|
|
44
|
+
* them to these keys. The service's `abort_name` is already a name. `orderAbortMessage`
|
|
45
|
+
* accepts either form.
|
|
46
|
+
*/
|
|
47
|
+
export declare const ORDER_ABORT_MESSAGES: Readonly<Record<string, string>>;
|
|
48
|
+
/**
|
|
49
|
+
* The `#[error(code = N)]` value of a Move abort code. A clever-error bitset (top nibble
|
|
50
|
+
* `0b1100`) carries N in bits 48..55; a plain abort code is returned unchanged. Returns
|
|
51
|
+
* undefined for a bitset without an error code, or input that is not a non-negative u64.
|
|
52
|
+
*/
|
|
53
|
+
export declare function decodeAbortCode(raw: number | bigint | string): number | undefined;
|
|
54
|
+
/** The `order` constant name for a raw or decoded abort code, or undefined when unknown. */
|
|
55
|
+
export declare function orderAbortName(code: number | bigint | string): string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Look up a friendly order abort message, or undefined when unknown. Accepts the constant name
|
|
58
|
+
* (`"ECancelTooEarly"`, as in the service's `abort_name`) or the on-chain abort code: a number,
|
|
59
|
+
* bigint or decimal string, either plain (`8`) or the raw clever-error u64.
|
|
60
|
+
*/
|
|
61
|
+
export declare function orderAbortMessage(nameOrCode: string | number | bigint): string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* `market` and `fee_mint` abort code -> Move constant name, from the `#[error(code = N)]`
|
|
64
|
+
* declarations in `parchment::market` (0-10) and `parchment_trade::fee_mint` (0-2). Every declared code
|
|
65
|
+
* (the drift test checks them against the contract source); message copy only for 8 / 2.
|
|
66
|
+
*/
|
|
67
|
+
export declare const MARKET_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
68
|
+
export declare const FEE_MINT_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
69
|
+
/**
|
|
70
|
+
* `parchment::exchange` and `parchment::access` abort code -> Move constant name, from their explicit
|
|
71
|
+
* `#[error(code = N)]` declarations (exchange 0-9, 11-16 (14 is `EHarvestAuth`); access 0, the extension timelock 1-4, then 5-9).
|
|
72
|
+
* Admin/keeper-side, so names only (no message copy). Same module/code pairs as the service's `abort_name`.
|
|
73
|
+
*/
|
|
74
|
+
export declare const EXCHANGE_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
75
|
+
export declare const ACCESS_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
76
|
+
/**
|
|
77
|
+
* `parchment::builder_book` / `parchment::referral_book` abort code -> Move constant name (writer-level
|
|
78
|
+
* ceilings, behind the `builder` / `referral` checks, so normal flows raise those codes instead). Names only.
|
|
79
|
+
*/
|
|
80
|
+
export declare const BUILDER_BOOK_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
81
|
+
export declare const REFERRAL_BOOK_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
82
|
+
/**
|
|
83
|
+
* `parchment::account` abort code -> Move constant name (`account.move` 0-7). Cap/delegate mismatches
|
|
84
|
+
* raise 2 / 6. Names only, no message copy, like the service's `abort_name` (which only logs them).
|
|
85
|
+
*/
|
|
86
|
+
export declare const ACCOUNT_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
87
|
+
/**
|
|
88
|
+
* `parchment_base::holder_book` abort code -> Move constant name. One account per wallet: the
|
|
89
|
+
* `account_transfer::transfer_account` recipient (or the sender itself) already holds an account.
|
|
90
|
+
*/
|
|
91
|
+
export declare const HOLDER_BOOK_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
92
|
+
/** `parchment_trade::account_transfer` abort code -> Move constant name. */
|
|
93
|
+
export declare const ACCOUNT_TRANSFER_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
94
|
+
/**
|
|
95
|
+
* `parchment_trade::game_book` abort code -> Move constant name. 0: admin `game_book::attach` on an
|
|
96
|
+
* Exchange that already has the game book (once per Exchange; the split moved game_book out of `parchment`).
|
|
97
|
+
* 1-3: writer-level ceilings behind the `game` checks (normal flows raise `game` codes instead).
|
|
98
|
+
*/
|
|
99
|
+
export declare const GAME_BOOK_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
100
|
+
/**
|
|
101
|
+
* `parchment::config` abort code -> Move constant name (`config.move` 0-28, 100 and 101). Names only,
|
|
102
|
+
* no message copy. 7 (the builder share ceiling) is unassigned: builder codes no longer take a share.
|
|
103
|
+
* 9 (`EBadExecFeeRecipient`) is `set_exec_fee_recipient(@0x0)`. 10-26 are the
|
|
104
|
+
* selective-pause categories raised by `assert_unpaused` (24 was `EOrderCancelsPaused`; that category
|
|
105
|
+
* was removed, cancel/expire are never paused, so 24 is unassigned). 27 (`EBadBuilderFee`): a builder
|
|
106
|
+
* fee limit or max above 100 bps. 28 (`EBadBuilderCreateFee`): a creation price above $100. 101 (`EGuardianCannotUnpause`): only the admin can unpause.
|
|
107
|
+
*/
|
|
108
|
+
export declare const CONFIG_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
109
|
+
/**
|
|
110
|
+
* `parchment_trade::referral`, `parchment_trade::builder` and `parchment_token::staking` abort code ->
|
|
111
|
+
* Move constant name, from their `#[error(code = N)]` declarations (referral 0-5, builder 0, 2, 4-6,
|
|
112
|
+
* 8-14, staking 0-13). Names only, no message copy. The `@0x0` rejections: referral 5
|
|
113
|
+
* and staking 13 (`bind_referrer(.., @0x0)`), builder 5 (payout `@0x0`) and 6 (owner `@0x0`). Builder
|
|
114
|
+
* codes are on-top only, so the share, payout-uniqueness and enable-gate codes (1, 3, 7) are gone.
|
|
115
|
+
*/
|
|
116
|
+
export declare const REFERRAL_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
117
|
+
export declare const BUILDER_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
118
|
+
export declare const STAKING_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
119
|
+
/**
|
|
120
|
+
* `parchment_trade::oracle` abort code -> Move constant name (`oracle.move` 0-2, 4-6, 8-17, 19-20). 3 and 18 are
|
|
121
|
+
* reserved (removed TWAP guard and signed range check, see `ORACLE_RESERVED_ABORT_CODES`) and 7 was never
|
|
122
|
+
* declared: all stay unnamed. 19 `ETimestampWindow` rejects a regular-session window quote on a one-step path.
|
|
123
|
+
* 0 is declared, not raised. 13 `EGapTooShort` / 14 `ESessionArmed` / 16 `ENotKeeper` gate the keeper
|
|
124
|
+
* `arm_session_close` (which arms from a signed-closed Lazer session even while storage is fresh); 15 (`EOracleKilled`) is the kill switch and 17 (`EMarketClosesPaused`) the per-market
|
|
125
|
+
* close pause, both raised by the fullpause oracle guards. Names only, no message copy.
|
|
126
|
+
*/
|
|
127
|
+
export declare const ORACLE_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
128
|
+
/**
|
|
129
|
+
* `parchment_game::game` and the `parchment_trade::game` facade share these codes (`game.move`).
|
|
130
|
+
* The short key `game` is the impl. `abortName("parchment_trade::game", n)` uses `game_facade`.
|
|
131
|
+
* 13 (`EBadBatch`) is an `open_crates` count of 0. 6 (`ECooldown`) is retired (no crate cooldown) and
|
|
132
|
+
* kept for completeness. Names only except
|
|
133
|
+
* `GAME_ABORT_MESSAGES`.
|
|
134
|
+
*/
|
|
135
|
+
export declare const GAME_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
136
|
+
/**
|
|
137
|
+
* Smaller modules, names only (no message copy), from their `#[error(code = N)]` declarations:
|
|
138
|
+
* `parchment_trade::keeper` (0), `parchment_trade::fees` (0-1), `parchment::timelock` (0, 2, 4-7; 1, 3 and 8 removed),
|
|
139
|
+
* `parchment::position` (0-4), `parchment::liq_book` (0-1), `parchment::lp` (0), `parchment::authority` (0)
|
|
140
|
+
* and `parchment_oracle::adapter` (1-10; code 0 is retired, not used).
|
|
141
|
+
*/
|
|
142
|
+
export declare const KEEPER_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
143
|
+
/** `parchment_trade::event_guard` (0-9): keeper event pause, event leverage cap and event close. */
|
|
144
|
+
export declare const EVENT_GUARD_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
145
|
+
export declare const FEES_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
146
|
+
export declare const TIMELOCK_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
147
|
+
export declare const POSITION_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
148
|
+
export declare const LIQ_BOOK_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
149
|
+
export declare const LP_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
150
|
+
/** `parchment::authority` only; the vendored `oracle_aggregator::authority` is in `UNCOVERED_MODULES`. */
|
|
151
|
+
export declare const AUTHORITY_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
152
|
+
export declare const ORACLE_ADAPTER_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
153
|
+
/**
|
|
154
|
+
* `parchment_mint::locked_mint` and `parchment_mint::mint_cap` abort code -> Move constant name. These
|
|
155
|
+
* modules abort with plain `const EName: u64 = N` codes (no `#[error]`). The trade facades delegate
|
|
156
|
+
* and do not raise them. locked_mint 3 (was `EBadTarget`, from the removed `admin_redirect`) has
|
|
157
|
+
* no constant; 4 (`ETooManyBuckets`) is reserved, no longer raised. Names only, no message copy.
|
|
158
|
+
*/
|
|
159
|
+
export declare const LOCKED_MINT_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
160
|
+
export declare const MINT_CAP_ABORT_NAMES: Readonly<Record<number, string>>;
|
|
161
|
+
/** Friendly messages for `market` aborts, keyed by constant name. */
|
|
162
|
+
export declare const MARKET_ABORT_MESSAGES: Readonly<Record<string, string>>;
|
|
163
|
+
/** Friendly messages for `game` aborts a player can hit with a bad input, keyed by constant name. */
|
|
164
|
+
export declare const GAME_ABORT_MESSAGES: Readonly<Record<string, string>>;
|
|
165
|
+
/** Friendly messages for `fee_mint` aborts, keyed by constant name. */
|
|
166
|
+
export declare const FEE_MINT_ABORT_MESSAGES: Readonly<Record<string, string>>;
|
|
167
|
+
/**
|
|
168
|
+
* Every `abortName` module key -> its code -> constant name map. Keys are Move module names; each one
|
|
169
|
+
* means exactly the module in `ABORT_MODULE_PATHS` (e.g. `config` is `parchment::config`, not the vendored
|
|
170
|
+
* `oracle_aggregator::config`).
|
|
171
|
+
*/
|
|
172
|
+
export declare const ABORT_NAME_MAPS: Readonly<Record<string, Readonly<Record<number, string>>>>;
|
|
173
|
+
/**
|
|
174
|
+
* `ABORT_NAME_MAPS` key -> the full Move module path it covers. `abortName` also accepts these paths,
|
|
175
|
+
* which is how a short-name collision (`config`, `authority`) is told apart.
|
|
176
|
+
*/
|
|
177
|
+
export declare const ABORT_MODULE_PATHS: Readonly<Record<string, string>>;
|
|
178
|
+
/**
|
|
179
|
+
* Contract modules with `#[error(code = N)]` that `abortName` deliberately does not name (full path ->
|
|
180
|
+
* reason). The vendored `pyth_lazer` modules use code-less `#[error]` constants and are not listed.
|
|
181
|
+
*/
|
|
182
|
+
export declare const UNCOVERED_MODULES: Readonly<Record<string, string>>;
|
|
183
|
+
/**
|
|
184
|
+
* The Move constant name for an abort in `module`, from a raw clever-error code or the decoded N.
|
|
185
|
+
* `module` is an `ABORT_NAME_MAPS` key (`trade`, `order`, `oracle`, `game`, `game_book`, `keeper`, `event_guard`, `fees`, `market`,
|
|
186
|
+
* `fee_mint`, `exchange`, `access`, `account`, `config`, `timelock`, `position`, `liq_book`, `lp`,
|
|
187
|
+
* `authority`, `adapter`, `referral`, `builder`, `builder_book`, `referral_book`, `staking`, `locked_mint`, `mint_cap`, `game_facade`) or its full path from `ABORT_MODULE_PATHS`
|
|
188
|
+
* (`parchment::config`); undefined for other modules (see `UNCOVERED_MODULES`), reserved and unknown codes.
|
|
189
|
+
*/
|
|
190
|
+
export declare function abortName(module: string, code: number | bigint | string): string | undefined;
|
|
191
|
+
/**
|
|
192
|
+
* A friendly message for an abort in `module` (`trade`, `order`, `market`, `fee_mint` or `game`), from the
|
|
193
|
+
* constant name (the service's `abort_name`) or the raw/decoded code; undefined when unknown and for
|
|
194
|
+
* every other (names-only) `ABORT_NAME_MAPS` module and for codes in `market` / `fee_mint` / `game` without copy.
|
|
195
|
+
*/
|
|
196
|
+
export declare function abortMessage(module: string, nameOrCode: string | number | bigint): string | undefined;
|