@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.
Files changed (95) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +193 -2
  3. package/REFERENCE.md +338 -0
  4. package/SECURITY.md +25 -0
  5. package/dist/general/providers/index.d.ts +2 -0
  6. package/dist/general/providers/index.js +2 -0
  7. package/dist/general/providers/parchment.d.ts +1 -0
  8. package/dist/general/providers/parchment.js +1 -0
  9. package/dist/general/providers/parchmentSdk.d.ts +23 -0
  10. package/dist/general/providers/parchmentSdk.js +11 -0
  11. package/dist/general/types/configTypes.d.ts +62 -0
  12. package/dist/general/types/configTypes.js +1 -0
  13. package/dist/general/types/index.d.ts +1 -0
  14. package/dist/general/types/index.js +1 -0
  15. package/dist/general/utils/address.d.ts +49 -0
  16. package/dist/general/utils/address.js +110 -0
  17. package/dist/general/utils/caller.d.ts +58 -0
  18. package/dist/general/utils/caller.js +182 -0
  19. package/dist/general/utils/errors.d.ts +16 -0
  20. package/dist/general/utils/errors.js +26 -0
  21. package/dist/general/utils/index.d.ts +4 -0
  22. package/dist/general/utils/index.js +4 -0
  23. package/dist/general/utils/jsBigInt.d.ts +26 -0
  24. package/dist/general/utils/jsBigInt.js +74 -0
  25. package/dist/general/utils/txShape.d.ts +8 -0
  26. package/dist/general/utils/txShape.js +39 -0
  27. package/dist/index.d.ts +4 -0
  28. package/dist/index.js +4 -0
  29. package/dist/packages/index.d.ts +11 -0
  30. package/dist/packages/index.js +5 -0
  31. package/dist/packages/parchment/abortCodes.d.ts +196 -0
  32. package/dist/packages/parchment/abortCodes.js +522 -0
  33. package/dist/packages/parchment/batchClose.d.ts +268 -0
  34. package/dist/packages/parchment/batchClose.js +524 -0
  35. package/dist/packages/parchment/eventGuard.d.ts +106 -0
  36. package/dist/packages/parchment/eventGuard.js +119 -0
  37. package/dist/packages/parchment/gameCounterEvents.d.ts +59 -0
  38. package/dist/packages/parchment/gameCounterEvents.js +56 -0
  39. package/dist/packages/parchment/index.d.ts +52 -0
  40. package/dist/packages/parchment/index.js +30 -0
  41. package/dist/packages/parchment/liquidationCredit.d.ts +28 -0
  42. package/dist/packages/parchment/liquidationCredit.js +25 -0
  43. package/dist/packages/parchment/lockedMintEvents.d.ts +42 -0
  44. package/dist/packages/parchment/lockedMintEvents.js +46 -0
  45. package/dist/packages/parchment/monitoring.d.ts +369 -0
  46. package/dist/packages/parchment/monitoring.js +259 -0
  47. package/dist/packages/parchment/notes.d.ts +6 -0
  48. package/dist/packages/parchment/notes.js +1 -0
  49. package/dist/packages/parchment/onboarding.d.ts +50 -0
  50. package/dist/packages/parchment/onboarding.js +48 -0
  51. package/dist/packages/parchment/orderEffects.d.ts +207 -0
  52. package/dist/packages/parchment/orderEffects.js +268 -0
  53. package/dist/packages/parchment/orderParams.d.ts +72 -0
  54. package/dist/packages/parchment/orderParams.js +71 -0
  55. package/dist/packages/parchment/packageIds.d.ts +53 -0
  56. package/dist/packages/parchment/packageIds.js +149 -0
  57. package/dist/packages/parchment/parchment.d.ts +442 -0
  58. package/dist/packages/parchment/parchment.js +975 -0
  59. package/dist/packages/parchment/parchmentAccount.d.ts +189 -0
  60. package/dist/packages/parchment/parchmentAccount.js +273 -0
  61. package/dist/packages/parchment/parchmentMarket.d.ts +58 -0
  62. package/dist/packages/parchment/parchmentMarket.js +86 -0
  63. package/dist/packages/parchment/parchmentTypes.d.ts +2031 -0
  64. package/dist/packages/parchment/parchmentTypes.js +65 -0
  65. package/dist/packages/parchment/publicInts.d.ts +45 -0
  66. package/dist/packages/parchment/publicInts.js +383 -0
  67. package/dist/packages/parchment/reconcileEvents.d.ts +24 -0
  68. package/dist/packages/parchment/reconcileEvents.js +30 -0
  69. package/dist/packages/parchment/retainedFee.d.ts +43 -0
  70. package/dist/packages/parchment/retainedFee.js +68 -0
  71. package/dist/packages/parchment/sessionClose.d.ts +68 -0
  72. package/dist/packages/parchment/sessionClose.js +50 -0
  73. package/dist/packages/parchment/sessionKey.d.ts +78 -0
  74. package/dist/packages/parchment/sessionKey.js +154 -0
  75. package/dist/packages/parchment/slippage.d.ts +23 -0
  76. package/dist/packages/parchment/slippage.js +27 -0
  77. package/dist/packages/parchment/sponsor.d.ts +39 -0
  78. package/dist/packages/parchment/sponsor.js +48 -0
  79. package/dist/packages/parchment/stakingCalls.d.ts +33 -0
  80. package/dist/packages/parchment/stakingCalls.js +21 -0
  81. package/dist/packages/parchment/stakingEvents.d.ts +53 -0
  82. package/dist/packages/parchment/stakingEvents.js +71 -0
  83. package/dist/packages/parchment/triggerCalls.d.ts +46 -0
  84. package/dist/packages/parchment/triggerCalls.js +36 -0
  85. package/dist/packages/parchment/triggerEvents.d.ts +22 -0
  86. package/dist/packages/parchment/triggerEvents.js +33 -0
  87. package/dist/packages/parchment/triggers.d.ts +113 -0
  88. package/dist/packages/parchment/triggers.js +183 -0
  89. package/dist/packages/parchment/txBodies.d.ts +111 -0
  90. package/dist/packages/parchment/txBodies.js +683 -0
  91. package/dist/packages/parchment/txIntent.d.ts +99 -0
  92. package/dist/packages/parchment/txIntent.js +611 -0
  93. package/dist/types.d.ts +2 -0
  94. package/dist/types.js +1 -0
  95. package/package.json +58 -4
@@ -0,0 +1,53 @@
1
+ import type { ApiParchmentConfigResponse } from "./parchmentTypes.js";
2
+ /**
3
+ * Modules whose published call targets live in `parchment_trade`. `game_events` is not one of
4
+ * them: its emitters are `public(package)` in `parchment_game`.
5
+ */
6
+ export declare const PARCHMENT_TRADE_MODULES: readonly ["trade", "order", "oracle", "game", "game_book", "referral", "builder", "fees", "fee_mint", "launch", "keeper", "auth", "locked_mint", "mint_cap", "harvest", "account_transfer", "event_guard"];
7
+ /**
8
+ * Modules that moved from core `parchment` into `parchment_base`. Call targets use
9
+ * `basePackageId`. A missing id is null; the core package is not a fallback.
10
+ */
11
+ export declare const PARCHMENT_BASE_MODULES: readonly ["builder_book", "holder_book", "liq_book", "lp", "position", "safety", "constants"];
12
+ export type ParchmentTradeModule = (typeof PARCHMENT_TRADE_MODULES)[number];
13
+ /**
14
+ * Published call targets that stayed in core `parchment`. `extended_field` and `init` are not
15
+ * call targets. `game_events` is not in this list: its emitters are `public(package)`.
16
+ */
17
+ export declare const PARCHMENT_CORE_MODULES: readonly ["access", "account", "authority", "config", "events", "exchange", "market", "referral_book", "timelock"];
18
+ type PackageIds = Pick<ApiParchmentConfigResponse, "packageId" | "tradePackageId" | "tradePackageIds" | "basePackageId">;
19
+ /** Whether `module` lives in `parchment_trade`. */
20
+ export declare function isParchmentTradeModule(module: string): module is ParchmentTradeModule;
21
+ /**
22
+ * Package id for a Move call target `${id}::${module}::${fn}`: the latest `parchment_trade` for
23
+ * moved modules, `basePackageId` for `parchment_base`, the core package for modules that stayed
24
+ * there. Null when that package is not configured. A module with no published call target
25
+ * (`game_events`, or any other name) throws. `parchment_oracle::adapter` and `parchment_token`
26
+ * modules are not covered.
27
+ */
28
+ export declare function parchmentCallPackageId(config: PackageIds, module: string): string | null;
29
+ type OriginalPackageIds = Pick<ApiParchmentConfigResponse, "packageId" | "packageIds" | "tradePackageId" | "tradePackageIds" | "basePackageId" | "basePackageIds" | "gamePackageId" | "gamePackageIds" | "mintPackageId" | "mintPackageIds">;
30
+ /**
31
+ * Defining (original) `parchment_trade` id for type strings that still live there, such as
32
+ * `${id}::oracle::PriceReceipt` and `${id}::fees::StakingSink`.
33
+ * `game_book` and `game_events` types use {@link parchmentGameTypePackageId}. `locked_mint` and
34
+ * `mint_cap` types use {@link parchmentMintTypePackageId}. This function returns only the trade type id.
35
+ */
36
+ export declare function parchmentTradeTypePackageId(config: PackageIds): string | null;
37
+ /** Defining (original) core `parchment` id. Move calls use `packageId` (the latest). */
38
+ export declare function parchmentCoreTypePackageId(config: Pick<OriginalPackageIds, "packageId" | "packageIds">): string | null;
39
+ /** Defining (original) `parchment_base` id. */
40
+ export declare function parchmentBaseTypePackageId(config: Pick<OriginalPackageIds, "basePackageId" | "basePackageIds">): string | null;
41
+ /** Defining (original) `parchment_game` id (`game_book`, `game_events`). */
42
+ export declare function parchmentGameTypePackageId(config: Pick<OriginalPackageIds, "gamePackageId" | "gamePackageIds">): string | null;
43
+ /** Defining (original) `parchment_mint` id (`MintCapKey`, `locked_mint`, `mint_cap`). */
44
+ export declare function parchmentMintTypePackageId(config: Pick<OriginalPackageIds, "mintPackageId" | "mintPackageIds">): string | null;
45
+ /**
46
+ * A configured `/config` (a core or trade package id) must name the split packages. An
47
+ * unconfigured response, with both ids empty, still loads. There is no fallback to the trade
48
+ * package id. A mint id that is a trade package id is rejected: that address derives the wrong
49
+ * `MintCapKey` field. Any other shared id among core, trade, base, game and mint is rejected too.
50
+ * The same id twice in one list is rejected. A singular id that repeats the list's only entry is not.
51
+ */
52
+ export declare function requireSplitPackageIds<T extends OriginalPackageIds>(config: T): T;
53
+ export {};
@@ -0,0 +1,149 @@
1
+ import { normalizeSuiAddress } from "@mysten/sui/utils";
2
+ import { ParchmentApiError } from "../../general/utils/errors.js";
3
+ export const PARCHMENT_TRADE_MODULES = [
4
+ "trade",
5
+ "order",
6
+ "oracle",
7
+ "game",
8
+ "game_book",
9
+ "referral",
10
+ "builder",
11
+ "fees",
12
+ "fee_mint",
13
+ "launch",
14
+ "keeper",
15
+ "auth",
16
+ "locked_mint",
17
+ "mint_cap",
18
+ "harvest",
19
+ "account_transfer",
20
+ "event_guard",
21
+ ];
22
+ export const PARCHMENT_BASE_MODULES = [
23
+ "builder_book",
24
+ "holder_book",
25
+ "liq_book",
26
+ "lp",
27
+ "position",
28
+ "safety",
29
+ "constants",
30
+ ];
31
+ export const PARCHMENT_CORE_MODULES = [
32
+ "access",
33
+ "account",
34
+ "authority",
35
+ "config",
36
+ "events",
37
+ "exchange",
38
+ "market",
39
+ "referral_book",
40
+ "timelock",
41
+ ];
42
+ export function isParchmentTradeModule(module) {
43
+ return PARCHMENT_TRADE_MODULES.includes(module);
44
+ }
45
+ export function parchmentCallPackageId(config, module) {
46
+ if (isParchmentTradeModule(module))
47
+ return config.tradePackageId;
48
+ if (PARCHMENT_BASE_MODULES.includes(module)) {
49
+ return config.basePackageId ?? null;
50
+ }
51
+ if (PARCHMENT_CORE_MODULES.includes(module))
52
+ return config.packageId;
53
+ const message = module === "game_events"
54
+ ? "game_events is not a published call target; its emitters are public(package) in parchment_game"
55
+ : `${module} is not a published call target`;
56
+ throw new ParchmentApiError(0, "unpublished_module", message);
57
+ }
58
+ function originalPackageId(list, single) {
59
+ const listed = list?.find(nonempty);
60
+ if (listed)
61
+ return listed;
62
+ return nonempty(single) ? single : null;
63
+ }
64
+ export function parchmentTradeTypePackageId(config) {
65
+ return originalPackageId(config.tradePackageIds, config.tradePackageId);
66
+ }
67
+ export function parchmentCoreTypePackageId(config) {
68
+ return originalPackageId(config.packageIds, config.packageId);
69
+ }
70
+ export function parchmentBaseTypePackageId(config) {
71
+ return originalPackageId(config.basePackageIds, config.basePackageId);
72
+ }
73
+ export function parchmentGameTypePackageId(config) {
74
+ return originalPackageId(config.gamePackageIds, config.gamePackageId);
75
+ }
76
+ export function parchmentMintTypePackageId(config) {
77
+ return originalPackageId(config.mintPackageIds, config.mintPackageId);
78
+ }
79
+ function nonempty(id) {
80
+ return typeof id === "string" && id.length > 0;
81
+ }
82
+ function canonPackageId(id) {
83
+ try {
84
+ return normalizeSuiAddress(id);
85
+ }
86
+ catch {
87
+ return id;
88
+ }
89
+ }
90
+ function packageIdList(single, list) {
91
+ const ids = [...(list ?? [])];
92
+ if (nonempty(single))
93
+ ids.push(single);
94
+ return ids.filter(nonempty).map(canonPackageId);
95
+ }
96
+ function duplicatePackageId(list) {
97
+ const seen = new Set();
98
+ for (const id of list ?? []) {
99
+ if (!nonempty(id))
100
+ continue;
101
+ const canon = canonPackageId(id);
102
+ if (seen.has(canon))
103
+ return true;
104
+ seen.add(canon);
105
+ }
106
+ return false;
107
+ }
108
+ export function requireSplitPackageIds(config) {
109
+ if (!nonempty(config.packageId) && !nonempty(config.tradePackageId))
110
+ return config;
111
+ const missing = ["basePackageId", "gamePackageId", "mintPackageId"].filter((name) => !nonempty(config[name]));
112
+ if (missing.length > 0) {
113
+ throw new ParchmentApiError(0, "split_packages_unset", `config is missing ${missing.join(", ")}; it does not fall back to the trade package`);
114
+ }
115
+ const lists = [
116
+ ["packageIds", config.packageIds],
117
+ ["tradePackageIds", config.tradePackageIds],
118
+ ["basePackageIds", config.basePackageIds],
119
+ ["gamePackageIds", config.gamePackageIds],
120
+ ["mintPackageIds", config.mintPackageIds],
121
+ ];
122
+ for (const [name, list] of lists) {
123
+ if (duplicatePackageId(list)) {
124
+ throw new ParchmentApiError(0, "package_ids_duplicate", `${name} lists an id more than once; ids in one package list must be unique`);
125
+ }
126
+ }
127
+ const groups = [
128
+ ["packageId", packageIdList(config.packageId, config.packageIds)],
129
+ ["tradePackageId", packageIdList(config.tradePackageId, config.tradePackageIds)],
130
+ ["basePackageId", packageIdList(config.basePackageId, config.basePackageIds)],
131
+ ["gamePackageId", packageIdList(config.gamePackageId, config.gamePackageIds)],
132
+ ["mintPackageId", packageIdList(config.mintPackageId, config.mintPackageIds)],
133
+ ];
134
+ const trade = new Set(groups[1][1]);
135
+ if (groups[4][1].some((id) => trade.has(id))) {
136
+ throw new ParchmentApiError(0, "mint_package_is_trade", "mintPackageId is a trade package id; MintCapKey is defined in parchment_mint, not parchment_trade");
137
+ }
138
+ for (let i = 0; i < groups.length; i++) {
139
+ for (let j = i + 1; j < groups.length; j++) {
140
+ if (groups[i][0] === "tradePackageId" && groups[j][0] === "mintPackageId")
141
+ continue;
142
+ const left = new Set(groups[i][1]);
143
+ if (groups[j][1].some((id) => left.has(id))) {
144
+ throw new ParchmentApiError(0, "package_ids_overlap", `${groups[i][0]} and ${groups[j][0]} share an id; package lists must be disjoint`);
145
+ }
146
+ }
147
+ }
148
+ return config;
149
+ }
@@ -0,0 +1,442 @@
1
+ import { type ParchmentMonitoring, type ParchmentStakingHistory, type ParchmentStakingHistoryDays, type ParchmentStatsActivity } from "./monitoring.js";
2
+ import { Caller } from "../../general/utils/caller.js";
3
+ import type { ParchmentOptions, RequestOptionsUpdate } from "../../general/types/configTypes.js";
4
+ import { ParchmentAccount } from "./parchmentAccount.js";
5
+ import { ParchmentMarket } from "./parchmentMarket.js";
6
+ import type { ParchmentLivePrice, ParchmentTrade, ApiParchmentSponsorBody, ParchmentSponsoredTx, ApiParchmentBindReferrerTxBody, ApiParchmentBindTradingReferrerTxBody, ApiParchmentTransferAccountTxBody, ApiParchmentClaimQuestTxBody, ApiParchmentClaimTxBody, ApiParchmentExitEarlyBoundedTxBody, ApiParchmentExitEarlyTxBody, ApiParchmentReleaseUnlockedTxBody, ApiParchmentClosePreviewBody, ApiParchmentClosePreviewResponse, ApiParchmentCancelOrderAsDelegateTxBody, ApiParchmentCancelOrderTxBody, ApiParchmentConfigResponse, ApiParchmentEmergencyCloseAsDelegateTxBody, ApiParchmentEmergencyCloseTxBody, ApiParchmentCloseRetiredAsDelegateTxBody, ApiParchmentCloseRetiredTxBody, ApiParchmentExpireOrderTxBody, ApiParchmentOrdersQuery, ApiParchmentOrdersResponse, ApiParchmentRequestCloseAsDelegateTxBody, ApiParchmentRequestCloseTxBody, ApiParchmentRequestOpenAsDelegateTxBody, ApiParchmentRequestOpenTxBody, Order, ApiParchmentDepositTxBody, ApiParchmentGameTxBody, ApiParchmentOpenCratesTxBody, ApiParchmentGrantDelegateTxBody, ApiParchmentGrantCloseDelegateTxBody, ApiParchmentGrantSessionAndTriggerTxBody, ApiParchmentRevokeSessionAndTriggerTxBody, ParchmentTrigger, ParchmentTriggers, ApiParchmentInstallTreasuryTxBody, ApiParchmentAuthRegisterTxBody, ApiParchmentLiquidateTxBody, ApiParchmentHistoryBody, ApiParchmentHistoryResponse, ApiParchmentEquityHistoryBody, ApiParchmentEquityHistoryResponse, ApiParchmentLimitsResponse, ApiParchmentLpHarvestTxBody, ApiParchmentSweepTxBody, ApiParchmentSweepSurplusTxBody, ApiParchmentClaimPendingMintTxBody, ApiParchmentLpResponse, ParchmentStaker, ParchmentStakingPool, ApiParchmentOpenAccountTxBody, ApiParchmentOpenPreviewBody, ApiParchmentOpenPreviewResponse, ApiParchmentPositionsResponse, ParchmentPageQuery, ApiParchmentPriceHistoryBody, ApiParchmentPriceHistoryResponse, ApiParchmentCandlesBatchBody, ApiParchmentCandlesBatchResponse, ApiParchmentCandlesBody, ApiParchmentCandlesResponse, ApiParchmentPricesResponse, ApiParchmentProtocolResponse, ApiParchmentReferralsResponse, ApiParchmentRegisterBuilderTxBody, ApiParchmentCreateBuilderTxBody, ApiParchmentSetBuilderCreateFeeTxBody, ApiParchmentSetBuilderFeeTxBody, ApiParchmentBuilderOwnerTxBody, ApiParchmentTransferBuilderTxBody, ApiParchmentApproveBuilderTxBody, ApiParchmentRevokeBuilderApprovalTxBody, ApiParchmentRevokeDelegateTxBody, ApiParchmentSetBuilderPayoutTxBody, ApiParchmentStakeTxBody, ApiParchmentUnstakeTxBody, ApiParchmentWithdrawTxBody, ParchmentAccountQueue, ParchmentBuiltTx, ParchmentBuilder, ParchmentBuilderAllowance, ParchmentBuilderApproval, ParchmentFeed, ParchmentGame, ParchmentLeaderboard, ParchmentLeaderboardQuery, ParchmentGameDefinitions, ParchmentRecentPosition, ParchmentMarketStatsResponse, ParchmentLpQueue, ParchmentPnlCard, ParchmentQueue, ParchmentTradingReferral } from "./parchmentTypes.js";
7
+ import { type TriggerProofInput, type TriggerSigner } from "./triggers.js";
8
+ /**
9
+ * Parchment API client.
10
+ *
11
+ * Construct it with {@link Parchment.create}. The caller prefix is `"parchment"`,
12
+ * so requests resolve under `{baseUrl}/api/parchment/...`.
13
+ *
14
+ * Reads use {@link Caller.fetchApi}. Transaction builders use
15
+ * {@link Caller.fetchApiTxObject} and return an unsigned `Transaction`.
16
+ */
17
+ export declare class Parchment extends Caller {
18
+ /**
19
+ * Creates a client. This does not contact the network.
20
+ *
21
+ * @param options - API origin. `baseUrl` is the origin only.
22
+ */
23
+ static create(options: ParchmentOptions): Promise<Parchment>;
24
+ constructor(options: ParchmentOptions);
25
+ /**
26
+ * Returns a client for the same API whose requests use these opt-in limits (see
27
+ * {@link RequestOptions}). A field left out (or `undefined`) keeps this client's value; an explicit
28
+ * `null` clears it, e.g. `{ signal: null }` drops an inherited signal. This client is unchanged.
29
+ *
30
+ * @example
31
+ * const order = await parchment.withRequestOptions({ timeoutMs: 5_000 }).getOrder(orderId);
32
+ */
33
+ withRequestOptions(options: RequestOptionsUpdate): Parchment;
34
+ getConfig(): Promise<ApiParchmentConfigResponse>;
35
+ getLimits(): Promise<ApiParchmentLimitsResponse>;
36
+ getMarkets(): Promise<{
37
+ markets: ParchmentMarket[];
38
+ }>;
39
+ getMarket(input: {
40
+ marketId: string;
41
+ }): Promise<ParchmentMarket>;
42
+ getPriceHistory(input: ApiParchmentPriceHistoryBody): Promise<ApiParchmentPriceHistoryResponse>;
43
+ /** OHLC candles of one market: the newest `limit` intervals of `[fromMs, toMs]` (at most 500), oldest first. */
44
+ getCandles(input: ApiParchmentCandlesBody): Promise<ApiParchmentCandlesResponse>;
45
+ /**
46
+ * {@link getCandles} for up to 12 markets in one request (`GET /markets/candles`), one window for all: a
47
+ * multi-chart layout's load and poll. `series` has one entry per market, in `marketIds` order (repeats
48
+ * dropped); a market that fails carries its own `error` (`code`, `message`) instead of `candles`, and the
49
+ * others are still served. No market, a malformed id (`bad_request`) or more than 12 (`too_many_markets`)
50
+ * throws without a request.
51
+ */
52
+ getCandlesBatch(input: ApiParchmentCandlesBatchBody): Promise<ApiParchmentCandlesBatchResponse>;
53
+ getPrices(): Promise<ApiParchmentPricesResponse>;
54
+ /**
55
+ * URL of the display-only live price stream for an `EventSource`: `GET prices/stream`, Server-Sent
56
+ * Events `price` (decode with {@link parseLivePrice}) and `heartbeat` (every 15 s). `marketIds`
57
+ * narrows it (at most 64). A 503 (`stream_unavailable` on a service without live prices, or
58
+ * `overloaded`) means: keep polling {@link getPrices}.
59
+ */
60
+ pricesStreamUrl(input?: {
61
+ marketIds?: readonly string[];
62
+ }): string;
63
+ /**
64
+ * URL of the live trade stream for an `EventSource`: `GET trades/stream`, Server-Sent Events
65
+ * `trade` (every trader's opens, closes and liquidations; decode with {@link parseTrade}; the
66
+ * event's SSE id is the trade id) and `heartbeat` (every 15 s). With `after` (the last trade id
67
+ * received), every later trade comes, however far back, oldest first, so a new `EventSource`
68
+ * neither misses nor repeats any; `EventSource`'s own reconnects resume from `Last-Event-ID`.
69
+ * Without it a client first gets the last 30, oldest first. `reset` (data `{}`): `after` is past
70
+ * the newest trade (another deployment); drop the trades held and the cursor, close that
71
+ * `EventSource` and open a new one on a URL without `after` (its own reconnects would send the
72
+ * stale `after` again and reset again); the new one starts with the last 30. 503 `overloaded`:
73
+ * retry later.
74
+ */
75
+ tradesStreamUrl(input?: {
76
+ after?: bigint;
77
+ }): string;
78
+ /**
79
+ * Accounts, positions and queue claims are each paged (service default 50, `limit` applies to every
80
+ * list). Follow `accountsNextCursor` / `positionsNextCursor` / `queue.claimsNextCursor` with the
81
+ * matching cursor; a non-null next cursor means the list is incomplete.
82
+ */
83
+ getAccount(input: {
84
+ walletAddress: string;
85
+ limit?: number | bigint;
86
+ accountsCursor?: string | null;
87
+ positionsCursor?: string | number | bigint | null;
88
+ claimsCursor?: string | number | bigint | null;
89
+ }): Promise<ParchmentAccount>;
90
+ /** One page of open positions (service default 50). Follow `nextCursor` until it is null. */
91
+ getPositions(input: {
92
+ walletAddress: string;
93
+ } & ParchmentPageQuery): Promise<ApiParchmentPositionsResponse>;
94
+ /** The owner's account equity over time (hourly snapshots); `range` is `24h`, `7d`, `30d` or `all`. */
95
+ getEquityHistory(input: ApiParchmentEquityHistoryBody): Promise<ApiParchmentEquityHistoryResponse>;
96
+ getHistory(input: ApiParchmentHistoryBody): Promise<ApiParchmentHistoryResponse>;
97
+ getLp(): Promise<ApiParchmentLpResponse>;
98
+ /** Staking pool stream and lock parameters. `null` until the pool is indexed. */
99
+ getStakingPool(): Promise<ParchmentStakingPool | null>;
100
+ /**
101
+ * One staker's position. `pendingReward` replays `staking::pending_now` (stream vesting
102
+ * included); `unlockAtMs` is when `unstake` stops aborting `EStakeLocked`.
103
+ */
104
+ getStaker(input: {
105
+ walletAddress: string;
106
+ }): Promise<ParchmentStaker>;
107
+ /** Protocol FIFO queue. `lpCash` and `instantlyPayable` are null until known. */
108
+ getQueue(): Promise<ParchmentQueue>;
109
+ /** This wallet's place in the FIFO queue. `rank` is null when there is no claim. */
110
+ getAccountQueue(input: {
111
+ walletAddress: string;
112
+ }): Promise<ParchmentAccountQueue>;
113
+ /**
114
+ * Direct and second-level binds. `estimatedDirectBonus` and `estimatedSecondBonus`
115
+ * are estimates, not settled amounts.
116
+ */
117
+ getReferrals(input: {
118
+ walletAddress: string;
119
+ limit?: number | bigint;
120
+ /** `asReferrer.directNextCursor` from the previous page. */
121
+ directCursor?: string | null;
122
+ /** `asReferrer.secondLevelNextCursor` from the previous page. */
123
+ secondLevelCursor?: string | null;
124
+ }): Promise<ApiParchmentReferralsResponse>;
125
+ /**
126
+ * Trading referral for this wallet. Amounts are base units.
127
+ * `referrer` is null when the wallet is unbound.
128
+ */
129
+ getTradingReferral(input: {
130
+ walletAddress: string;
131
+ }): Promise<ParchmentTradingReferral>;
132
+ /** One builder code. Amounts are base units. */
133
+ getBuilder(input: {
134
+ code: string;
135
+ }): Promise<ParchmentBuilder>;
136
+ /** Every code this wallet owns, lowest id first. */
137
+ getOwnedBuilders(input: {
138
+ walletAddress: string;
139
+ }): Promise<ParchmentBuilder[]>;
140
+ /** This wallet's self-serve allowance: live codes it created (not codes it owns), limit 3. */
141
+ getBuilderAllowance(input: {
142
+ walletAddress: string;
143
+ }): Promise<ParchmentBuilderAllowance>;
144
+ /** The builders this trading account approved, each with its fee ceiling. */
145
+ getBuilderApprovals(input: {
146
+ accountId: string;
147
+ }): Promise<ParchmentBuilderApproval[]>;
148
+ /** This wallet's builder, or null when it has none. */
149
+ getAccountBuilder(input: {
150
+ walletAddress: string;
151
+ }): Promise<ParchmentBuilder | null>;
152
+ /**
153
+ * Quest, achievement and cosmetic definitions plus the fee-backed achievement mint fraction.
154
+ * Quests, daily claims and crates grant XP/cosmetics only; FEES_PAID achievements are the
155
+ * only game path that mints PARCHMENT.
156
+ */
157
+ getGameDefinitions(): Promise<ParchmentGameDefinitions>;
158
+ /** Game state for one wallet. XP is notional. Amounts are base units. */
159
+ getGame(input: {
160
+ walletAddress: string;
161
+ }): Promise<ParchmentGame>;
162
+ /**
163
+ * Ranked rows. `period` is daily, weekly, all, or season.
164
+ * `by` is pnl, pnlPct, volume, winStreak, or xp.
165
+ */
166
+ getLeaderboard(input: ParchmentLeaderboardQuery): Promise<ParchmentLeaderboard>;
167
+ /** Whale opens/closes, newest first. `limit` as the service's `?limit` (default 50, max-page-limit cap). */
168
+ getWhaleFeed(input?: {
169
+ limit?: number | bigint;
170
+ }): Promise<ParchmentFeed>;
171
+ /** Liquidations, newest first. `limit` as the service's `?limit` (default 50, max-page-limit cap). */
172
+ getRektFeed(input?: {
173
+ limit?: number | bigint;
174
+ }): Promise<ParchmentFeed>;
175
+ getPnlCard(input: {
176
+ positionId: string | bigint;
177
+ }): Promise<ParchmentPnlCard>;
178
+ getProtocol(): Promise<ApiParchmentProtocolResponse>;
179
+ /** Ticker: recent opens (entryWad), closes and liquidations (exitWad), newest first. */
180
+ getRecentPositions(input?: {
181
+ limit?: number | bigint;
182
+ }): Promise<ParchmentRecentPosition[]>;
183
+ /** Per-market 24h volume, opens/closes and open interest. */
184
+ getMarketStats(): Promise<ParchmentMarketStatsResponse>;
185
+ /**
186
+ * Protocol monitoring (`GET stats/monitoring`): the daily mint cap, the payout queue, side
187
+ * exposure against the caps, the fee split, two-step fill timing and short-hold PnL, now and per
188
+ * UTC day over the last `days` (the service defaults to 90 and serves at most 366).
189
+ */
190
+ getMonitoring(input?: {
191
+ days?: number | bigint;
192
+ }): Promise<ParchmentMonitoring>;
193
+ /**
194
+ * Daily trading activity (`GET stats/activity`): per-market volume, liquidations and fills and
195
+ * collateral deposits vs withdrawals, one row per UTC day with since-launch totals.
196
+ */
197
+ getStatsActivity(input?: {
198
+ days?: number | bigint;
199
+ }): Promise<ParchmentStatsActivity>;
200
+ /**
201
+ * Staking APR / APY history (`GET stats/staking-history?days=7|30|90|all`): the pool's realized
202
+ * rate over the window and its 15-minute snapshots (at most 500, oldest first).
203
+ */
204
+ getStakingHistory(input: {
205
+ days: ParchmentStakingHistoryDays;
206
+ }): Promise<ParchmentStakingHistory>;
207
+ /** LP vault payout queue. */
208
+ getLpQueue(): Promise<ParchmentLpQueue>;
209
+ /** Two-step orders for an owner wallet. `status` defaults to the service default. */
210
+ getOrders(owner: string, input?: ApiParchmentOrdersQuery): Promise<ApiParchmentOrdersResponse>;
211
+ /**
212
+ * One order. A body without the requested `orderId`, an `accountId` / `owner` / `marketId`, a
213
+ * known `kind` or a known `status` is `bad_body` (so {@link waitForOrder} retries it instead of
214
+ * treating it as final).
215
+ */
216
+ getOrder(orderId: string, signal?: AbortSignal): Promise<Order>;
217
+ /**
218
+ * Poll {@link getOrder} until the order has a known final status. Rejects with an Error after
219
+ * `timeoutMs`. Read errors (for example 404 before the indexer catches up) are retried.
220
+ * Each read is aborted at the deadline, so a hung request cannot run past `timeoutMs`.
221
+ * Pass `signal` to stop waiting early; the promise then rejects with the signal's reason.
222
+ */
223
+ waitForOrder(orderId: string, { timeoutMs, pollMs, signal: callerSignal }?: {
224
+ timeoutMs?: number;
225
+ pollMs?: number;
226
+ signal?: AbortSignal;
227
+ }): Promise<Order>;
228
+ getPreviewOpen(input: ApiParchmentOpenPreviewBody): Promise<ApiParchmentOpenPreviewResponse>;
229
+ getPreviewClose(input: ApiParchmentClosePreviewBody): Promise<ApiParchmentClosePreviewResponse>;
230
+ getOpenAccountTx(input: ApiParchmentOpenAccountTxBody): Promise<ParchmentBuiltTx>;
231
+ getDepositTx(input: ApiParchmentDepositTxBody): Promise<ParchmentBuiltTx>;
232
+ /** Withdraw. Requires `accountCapId`, the owned AccountCap. */
233
+ getWithdrawTx(input: ApiParchmentWithdrawTxBody): Promise<ParchmentBuiltTx>;
234
+ /**
235
+ * Request a keeper-filled open (`request-open`). The keeper fills at the plain oracle mid inside
236
+ * the fill window, or the order is refunded/expired. No oracle update is needed. Escrows margin +
237
+ * the exec fee from free balance (optional wallet `topUp`). The exec fee is kept on a fill, cancel,
238
+ * expiry and most refunds, and returned with the escrow on pause / kill-switch refunds (outcomes 5,
239
+ * 6), session refunds (13) and liquidation-pause refunds (14).
240
+ */
241
+ getRequestOpenTx(input: ApiParchmentRequestOpenTxBody): Promise<ParchmentBuiltTx>;
242
+ /** Delegate open request. No AccountCap. */
243
+ getRequestOpenAsDelegateTx(input: ApiParchmentRequestOpenAsDelegateTxBody): Promise<ParchmentBuiltTx>;
244
+ /** Request a keeper-filled close (`request-close`). Optional wallet `topUp` covers the exec fee. */
245
+ getRequestCloseTx(input: ApiParchmentRequestCloseTxBody): Promise<ParchmentBuiltTx>;
246
+ /** Delegate close request. No AccountCap. */
247
+ getRequestCloseAsDelegateTx(input: ApiParchmentRequestCloseAsDelegateTxBody): Promise<ParchmentBuiltTx>;
248
+ /**
249
+ * Cancel a pending order at or after `effectiveCancelAfterMs(order)`, i.e.
250
+ * `max(cancelAfterMs, requestedMs + 5 s)`; earlier aborts. Runs under every pause. Escrow is
251
+ * refunded; the exec fee is kept.
252
+ */
253
+ getCancelOrderTx(input: ApiParchmentCancelOrderTxBody): Promise<ParchmentBuiltTx>;
254
+ /** Delegate cancel. No AccountCap. */
255
+ getCancelOrderAsDelegateTx(input: ApiParchmentCancelOrderAsDelegateTxBody): Promise<ParchmentBuiltTx>;
256
+ /**
257
+ * Permissionless expiry, allowed strictly after `orderExpiresAfterMs(order)` (the fill deadline
258
+ * for opens; for closes, `emergencyAfterMs` plus the fill-deadline span
259
+ * `fillDeadlineMs - requestedMs`). Earlier gives `ENotExpired`.
260
+ */
261
+ getExpireOrderTx(input: ApiParchmentExpireOrderTxBody): Promise<ParchmentBuiltTx>;
262
+ /**
263
+ * Emergency close of a pending close order after `emergencyAfterMs`. `update` is the signed
264
+ * Lazer update the caller already has. There is no exit bound to pass, and the request's stored
265
+ * `acceptablePriceWad` is not checked: `order::emergency_close` passes `trade::no_price_bound()`,
266
+ * so the close fills at the one-step price whatever it is.
267
+ */
268
+ getEmergencyCloseTx(input: ApiParchmentEmergencyCloseTxBody): Promise<ParchmentBuiltTx>;
269
+ /** Delegate emergency close. No AccountCap. */
270
+ getEmergencyCloseAsDelegateTx(input: ApiParchmentEmergencyCloseAsDelegateTxBody): Promise<ParchmentBuiltTx>;
271
+ /**
272
+ * One-step close on a retired market (no orders there, no price bound). Runs under every pause;
273
+ * aborts `trade::EOracleKilled` (20) only under the market's oracle kill switch.
274
+ */
275
+ getCloseRetiredTx(input: ApiParchmentCloseRetiredTxBody): Promise<ParchmentBuiltTx>;
276
+ /** Delegate close on a retired market. No AccountCap. */
277
+ getCloseRetiredAsDelegateTx(input: ApiParchmentCloseRetiredAsDelegateTxBody): Promise<ParchmentBuiltTx>;
278
+ /**
279
+ * Liquidate. A stale `update` aborts `oracle::EPriceStale` (oracle 1) in `oracle::begin_price`; a
280
+ * storage mid that has not crossed bust aborts `trade::ENotLiquidatable` (15). `update` is caller-supplied. Account-free: no
281
+ * AccountCap and no accountId. Order keepers only: any other sender aborts `trade::EKeeperOnlyLiquidation` (36). The
282
+ * bounty coin goes to `walletAddress`.
283
+ */
284
+ getLiquidateTx(input: ApiParchmentLiquidateTxBody): Promise<ParchmentBuiltTx>;
285
+ /**
286
+ * Keeper crank over one market's liquidation book. Order keepers only: any other sender aborts
287
+ * `trade::EKeeperOnlyLiquidation` (36). Bounties go to `walletAddress`.
288
+ */
289
+ getSweepTx(input: ApiParchmentSweepTxBody): Promise<ParchmentBuiltTx>;
290
+ /** Permissionless hourly sweep: 1% of the cash above max(150% of R, $250k), at most 1% of R (launch defaults, admin-tunable). */
291
+ getSweepSurplusTx(input: ApiParchmentSweepSurplusTxBody): Promise<ParchmentBuiltTx>;
292
+ /** Mint PARCHMENT against fee-mint basis parked when the account was liquidated without it. */
293
+ getClaimPendingMintTx(input: ApiParchmentClaimPendingMintTxBody): Promise<ParchmentBuiltTx>;
294
+ /**
295
+ * User-triggered FIFO crank. Credits the exchange-side free balance and does
296
+ * not transfer a coin to the wallet. `maxEntries` defaults to 32 and must be
297
+ * from 1 to 128. This call takes no account objects.
298
+ */
299
+ getHarvestTx(input: ApiParchmentLpHarvestTxBody): Promise<ParchmentBuiltTx>;
300
+ /** Bind a staking referrer. A zero `referrer` (`0x0`) is a local `zero_referrer` (chain `staking::EZeroReferrer`, 13). */
301
+ getBindReferrerTx(input: ApiParchmentBindReferrerTxBody): Promise<ParchmentBuiltTx>;
302
+ /**
303
+ * Bind a trading referrer. Requires `accountCapId` and `referrer`. The referrer cannot be the zero
304
+ * address: `0x0` is a local `zero_referrer` (chain `referral::EZeroReferrer`, 5).
305
+ * Version and digest are sent only when the caller provides them.
306
+ * Accrued credits stay in free balance and are withdrawn with `getWithdrawTx`.
307
+ */
308
+ getBindTradingReferrerTx(input: ApiParchmentBindTradingReferrerTxBody): Promise<ParchmentBuiltTx>;
309
+ /**
310
+ * Transfer the whole account to `recipient` in one step (no accept). See `ApiParchmentTransferAccountTxBody`.
311
+ * After it lands the caller no longer owns an account and may open a new one.
312
+ */
313
+ getTransferAccountTx(input: ApiParchmentTransferAccountTxBody): Promise<ParchmentBuiltTx>;
314
+ getStakeTx(input: ApiParchmentStakeTxBody): Promise<ParchmentBuiltTx>;
315
+ getUnstakeTx(input: ApiParchmentUnstakeTxBody): Promise<ParchmentBuiltTx>;
316
+ /** Staking reward claim. The staker keeps 100%; a referred claim records the referrers' bonus as owed, paid from the treasury share. */
317
+ getClaimTx(input: ApiParchmentClaimTxBody): Promise<ParchmentBuiltTx>;
318
+ /**
319
+ * `release-unlocked`: pays the vested part of `who`'s locked PARCHMENT (default the sender) to
320
+ * that owner, never the caller. Permissionless; pays 0 when nothing has vested.
321
+ */
322
+ getReleaseUnlockedTx(input: ApiParchmentReleaseUnlockedTxBody): Promise<ParchmentBuiltTx>;
323
+ /**
324
+ * Vest `exit-early`: the sender takes everything past the lock now, less `earlyExitPenaltyNow`.
325
+ * Unbounded: `locked_mint::exit_early` exits every bucket eligible when the transaction
326
+ * executes, with no bound on the buckets or the penalty, so a prompt left open across another
327
+ * bucket's unlock exits (and penalizes) that bucket too. Re-read the preview right before signing.
328
+ */
329
+ getExitEarlyTx(input: ApiParchmentExitEarlyTxBody): Promise<ParchmentBuiltTx>;
330
+ /**
331
+ * Vest `exit-early-bounded`: `locked_mint::exit_early_bounded` exits only `unlocks` and
332
+ * aborts (`locked_mint` 5, `EPenaltyAboveMax`) above `maxPenalty`. Pass the game profile's
333
+ * `earlyExitUnlocks` and `earlyExitPenaltyNow` the owner confirmed.
334
+ */
335
+ getExitEarlyBoundedTx(input: ApiParchmentExitEarlyBoundedTxBody): Promise<ParchmentBuiltTx>;
336
+ /** Delegate expiry uses the shared on-chain Clock (0x6); legacy `nowMs` is ignored. */
337
+ getGrantDelegateTx(input: ApiParchmentGrantDelegateTxBody): Promise<ParchmentBuiltTx>;
338
+ getRevokeDelegateTx(input: ApiParchmentRevokeDelegateTxBody): Promise<ParchmentBuiltTx>;
339
+ /**
340
+ * One programmable transaction that grants the browser session key and the service's close-only
341
+ * trigger delegate. The wallet signs it once. The session key expires; the close-only delegate does not.
342
+ */
343
+ getGrantSessionAndTriggerTx(input: ApiParchmentGrantSessionAndTriggerTxBody): Promise<ParchmentBuiltTx>;
344
+ /** Revoke the browser session key and the close-only trigger delegate in one transaction. */
345
+ getRevokeSessionAndTriggerTx(input: ApiParchmentRevokeSessionAndTriggerTxBody): Promise<ParchmentBuiltTx>;
346
+ /**
347
+ * Grant the service's configured close-only take-profit and stop-loss delegate (`config.triggerDelegate`) alone
348
+ * (no expiry; `getRevokeDelegateTx` removes it).
349
+ */
350
+ getGrantCloseDelegateTx(input: ApiParchmentGrantCloseDelegateTxBody): Promise<ParchmentBuiltTx>;
351
+ /**
352
+ * One page (service default 50) of the live take-profit and stop-loss rows for `walletAddress` (pending,
353
+ * armed, firing, submitted, and idle with `stopLossDropped`). Follow `nextCursor` until it is null.
354
+ */
355
+ getTriggers(input: {
356
+ walletAddress: string;
357
+ cursor?: string | null;
358
+ limit?: number | bigint;
359
+ }): Promise<ParchmentTriggers>;
360
+ /**
361
+ * Set both legs of one position, or of the position the open request in a signed, not yet sent
362
+ * transaction creates (`{ openTxDigest, marketId, isLong, openTxBytesBase64 }`; send the open only after this
363
+ * resolves): `signer` is the owner, who signs one proof; null clears a leg. Each leg closes the
364
+ * whole position. 503 `price_unavailable`: the service has no current price for the market yet;
365
+ * retry in a moment.
366
+ */
367
+ setTriggers(input: Omit<TriggerProofInput, "expiresAtMs">, signer: TriggerSigner, nowMs?: number): Promise<ParchmentTrigger>;
368
+ /**
369
+ * Register a builder code (admin). Requires the authority cap id, code, payout, owner, and feeBps.
370
+ * Version and digest are sent only when the caller provides them.
371
+ */
372
+ getRegisterBuilderTx(input: ApiParchmentRegisterBuilderTxBody): Promise<ParchmentBuiltTx>;
373
+ /** Point a builder's payout at a new address. Rewards already in free balance stay there. */
374
+ getSetBuilderPayoutTx(input: ApiParchmentSetBuilderPayoutTxBody): Promise<ParchmentBuiltTx>;
375
+ /** Create a code the sender owns. The service splits exactly `getConfig().builders.createFee` from `coin`. */
376
+ getCreateBuilderTx(input: ApiParchmentCreateBuilderTxBody): Promise<ParchmentBuiltTx>;
377
+ /**
378
+ * Set the self-serve creation price (admin, `config::set_builder_create_fee`): USDC base units,
379
+ * 0 to 100 USDC. Read the live price from `getConfig().builders.createFee`.
380
+ */
381
+ getSetBuilderCreateFeeTx(input: ApiParchmentSetBuilderCreateFeeTxBody): Promise<ParchmentBuiltTx>;
382
+ /** Set the owner's code fee in bps of profit, up to the owner limit. */
383
+ getSetBuilderFeeTx(input: ApiParchmentSetBuilderFeeTxBody): Promise<ParchmentBuiltTx>;
384
+ /** Pause the owner's code: new opens stop naming it. */
385
+ getPauseBuilderTx(input: ApiParchmentBuilderOwnerTxBody): Promise<ParchmentBuiltTx>;
386
+ /** Resume an owner-paused code. An admin suspend stays. */
387
+ getResumeBuilderTx(input: ApiParchmentBuilderOwnerTxBody): Promise<ParchmentBuiltTx>;
388
+ /** Hand the code to a new owner in one transaction. The payout is unchanged. */
389
+ getTransferBuilderTx(input: ApiParchmentTransferBuilderTxBody): Promise<ParchmentBuiltTx>;
390
+ /** Approve a builder's fee on this account's profit, up to `maxFeeBps` (account owner only). */
391
+ getApproveBuilderTx(input: ApiParchmentApproveBuilderTxBody): Promise<ParchmentBuiltTx>;
392
+ /** Stop paying a builder on later opens. Works under every pause. */
393
+ getRevokeBuilderApprovalTx(input: ApiParchmentRevokeBuilderApprovalTxBody): Promise<ParchmentBuiltTx>;
394
+ /**
395
+ * Install the single PARCHMENT treasury cap once.
396
+ * Version and digest are sent only when the caller provides them.
397
+ */
398
+ getInstallTreasuryTx(input: ApiParchmentInstallTreasuryTxBody): Promise<ParchmentBuiltTx>;
399
+ /**
400
+ * Admin package-split setup: `parchment_trade::auth::register<C>(config, exchange, admin_cap)`
401
+ * registers the trade package on Config and Exchange. Run once per exchange after publishing
402
+ * `parchment_trade`; trading, game, fee mint and staking sinks abort until it has run.
403
+ * Version and digest are sent only when the caller provides them.
404
+ */
405
+ getAuthRegisterTx(input: ApiParchmentAuthRegisterTxBody): Promise<ParchmentBuiltTx>;
406
+ /**
407
+ * Admin package-split setup, once per exchange after `getAuthRegisterTx`:
408
+ * `parchment_trade::game_book::attach<C>(config, exchange, admin_cap)` attaches the GameBook
409
+ * (and the GameConfig on first use). A repeat aborts `game_book::EAlreadyAttached` (0).
410
+ * Same body as `getAuthRegisterTx`.
411
+ */
412
+ getGameAttachTx(input: ApiParchmentAuthRegisterTxBody): Promise<ParchmentBuiltTx>;
413
+ /**
414
+ * Asks the gas sponsor to pay for a session key's trade: a `*-as-delegate` kind (see {@link PARCHMENT_SPONSORED_ACTIONS};
415
+ * a Close All batch of up to 16 closes is one kind) whose sender, `walletAddress`, is a live delegate of the account
416
+ * the kind trades on. Pass the kind a builder returned (`built.txBytesBase64`) and the session key's proof for it
417
+ * (`signSponsorProof`: `senderSignature`, `expiresAtMs`). The session key signs the returned
418
+ * `txBytesBase64` unchanged (`signSessionSponsoredTx`); execute it with `[sessionSignature, sponsorSignature]` within
419
+ * `validEpoch`. On a rejection, {@link shouldPayOwnGas} says whether to use the wallet path instead and
420
+ * {@link isSessionKeyRevoked} whether to forget the session key (403 `not_delegate`).
421
+ * A bad sender, proof or kind is `bad_request` / `bad_tx_kind` before any request.
422
+ */
423
+ sponsorTransaction(input: ApiParchmentSponsorBody, signal?: AbortSignal): Promise<ParchmentSponsoredTx>;
424
+ /** Daily streak XP only; no coin result. Omits `questId`. Version and digest are sent only when provided. */
425
+ getClaimDailyTx(input: ApiParchmentGameTxBody): Promise<ParchmentBuiltTx>;
426
+ /** XP/cosmetic crate via a private entry MoveCall using on-chain randomness; no result. Omits `questId`. */
427
+ getOpenCrateTx(input: ApiParchmentGameTxBody): Promise<ParchmentBuiltTx>;
428
+ /**
429
+ * Open `count` crates (at least 1, no app-level cap) in one private entry MoveCall using on-chain randomness; no
430
+ * result, one `CrateOpened` event per crate. `count` is checked locally (`count_required` / `bad_count`).
431
+ * The batch's tier-ups and XP crate grants are deferred to the player's next open or XP grant.
432
+ */
433
+ getOpenCratesTx(input: ApiParchmentOpenCratesTxBody): Promise<ParchmentBuiltTx>;
434
+ /** Claim one quest for XP/cosmetics; no coin result. Version and digest are sent only when provided. */
435
+ getClaimQuestTx(input: ApiParchmentClaimQuestTxBody): Promise<ParchmentBuiltTx>;
436
+ /** Issue pending fee-backed achievement PARCHMENT using Clock and daily caps; returns a coin to transfer. */
437
+ getCollectMintTx(input: ApiParchmentGameTxBody): Promise<ParchmentBuiltTx>;
438
+ }
439
+ /** A `prices/stream` `price` event's data as a {@link ParchmentLivePrice}; anything else is `bad_body`. */
440
+ export declare function parseLivePrice(data: string): ParchmentLivePrice;
441
+ /** A `trades/stream` `trade` event's data as a {@link ParchmentTrade}; anything else is `bad_body`. */
442
+ export declare function parseTrade(data: string): ParchmentTrade;