@xgamesfun/solana 0.0.0-stage → 0.24.0

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 (138) hide show
  1. package/DISCLAIMER.md +41 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +13 -0
  4. package/README.md +172 -2
  5. package/bin/xsolana.mjs +189 -0
  6. package/examples/artwork-auction.json +51 -0
  7. package/examples/blind-forge.json +128 -0
  8. package/examples/coin-flip-arena.json +103 -0
  9. package/examples/duel-arena.json +137 -0
  10. package/examples/elements-set.json +274 -0
  11. package/examples/event-badges.json +67 -0
  12. package/examples/expedition-guild.json +154 -0
  13. package/examples/fair-presale.json +48 -0
  14. package/examples/falling-drop.json +90 -0
  15. package/examples/guild-missions.json +137 -0
  16. package/examples/halving-seasons.json +107 -0
  17. package/examples/hero-trials.json +93 -0
  18. package/examples/ideas.json +789 -0
  19. package/examples/level-ladder.json +65 -0
  20. package/examples/merge-2048.json +128 -0
  21. package/examples/nft-raffle.json +33 -0
  22. package/examples/paper-hands-farm.json +44 -0
  23. package/examples/partner-vault.json +112 -0
  24. package/examples/sacrifice-raffle.json +118 -0
  25. package/examples/scorched-treasury.json +84 -0
  26. package/examples/shelter-fair.json +164 -0
  27. package/examples/spark-pity.json +153 -0
  28. package/examples/stakers-draw.json +118 -0
  29. package/examples/star-fleet.json +150 -0
  30. package/examples/starforce.json +116 -0
  31. package/examples/stud-farm.json +134 -0
  32. package/examples/team-vesting.json +70 -0
  33. package/examples/trade-in-shop.json +168 -0
  34. package/js/approve/details.mjs +263 -0
  35. package/js/approve/ed25519.mjs +36 -0
  36. package/js/approve/live-check.mjs +144 -0
  37. package/js/approve/page.html +86 -0
  38. package/js/approve/page.js +203 -0
  39. package/js/approve/server.mjs +726 -0
  40. package/js/chain/base58.js +73 -0
  41. package/js/chain/borsh.js +270 -0
  42. package/js/chain/bytes.js +141 -0
  43. package/js/chain/core.js +181 -0
  44. package/js/chain/curve.js +52 -0
  45. package/js/chain/lookup.js +279 -0
  46. package/js/chain/mint.js +96 -0
  47. package/js/chain/pda.js +66 -0
  48. package/js/chain/programs.js +102 -0
  49. package/js/chain/rpc.js +219 -0
  50. package/js/chain/sha256.js +68 -0
  51. package/js/chain/token.js +85 -0
  52. package/js/chain/token2022.js +247 -0
  53. package/js/chain/tx.js +224 -0
  54. package/js/client/accounts.js +679 -0
  55. package/js/client/compressed.js +46 -0
  56. package/js/client/grant.js +299 -0
  57. package/js/client/idl/loot.js +2 -0
  58. package/js/client/idl/loot.json +17206 -0
  59. package/js/client/index.js +10 -0
  60. package/js/client/ix.js +2887 -0
  61. package/js/client/pda.js +114 -0
  62. package/js/client/policy.js +69 -0
  63. package/js/client/random.js +70 -0
  64. package/js/client/sizes.js +297 -0
  65. package/js/client/traits.js +44 -0
  66. package/js/connect/connect.mjs +182 -0
  67. package/js/economy/check.mjs +2236 -0
  68. package/js/economy/cost.mjs +185 -0
  69. package/js/economy/examples.mjs +114 -0
  70. package/js/economy/explain.mjs +239 -0
  71. package/js/economy/guide.mjs +232 -0
  72. package/js/economy/legal.mjs +15 -0
  73. package/js/economy/live.mjs +130 -0
  74. package/js/economy/model.mjs +698 -0
  75. package/js/economy/plan.mjs +1155 -0
  76. package/js/economy/schema.json +3071 -0
  77. package/js/economy/secrets.mjs +60 -0
  78. package/js/economy/simulate.mjs +1019 -0
  79. package/js/economy/txsize.mjs +45 -0
  80. package/js/economy/validate.mjs +85 -0
  81. package/js/index.js +10 -0
  82. package/js/mcp/server.mjs +113 -0
  83. package/js/mcp/tools.mjs +485 -0
  84. package/js/play/index.js +2855 -0
  85. package/js/play/keys.js +167 -0
  86. package/js/results/index.js +184 -0
  87. package/js/results/wire.js +90 -0
  88. package/package.json +100 -4
  89. package/release.json +8 -0
  90. package/skills/xsolana-economy/SKILL.md +109 -0
  91. package/skills/xsolana-economy/references/after-launch.md +124 -0
  92. package/skills/xsolana-economy/references/apps.md +193 -0
  93. package/skills/xsolana-economy/references/sentence-to-spec.md +180 -0
  94. package/skills/xsolana-economy/references/telling-the-person.md +134 -0
  95. package/types/chain/base58.d.ts +10 -0
  96. package/types/chain/borsh.d.ts +23 -0
  97. package/types/chain/bytes.d.ts +45 -0
  98. package/types/chain/core.d.ts +52 -0
  99. package/types/chain/curve.d.ts +1 -0
  100. package/types/chain/lookup.d.ts +194 -0
  101. package/types/chain/mint.d.ts +25 -0
  102. package/types/chain/pda.d.ts +25 -0
  103. package/types/chain/programs.d.ts +65 -0
  104. package/types/chain/rpc.d.ts +68 -0
  105. package/types/chain/sha256.d.ts +1 -0
  106. package/types/chain/token.d.ts +141 -0
  107. package/types/chain/token2022.d.ts +53 -0
  108. package/types/chain/tx.d.ts +60 -0
  109. package/types/client/accounts.d.ts +318 -0
  110. package/types/client/compressed.d.ts +29 -0
  111. package/types/client/grant.d.ts +170 -0
  112. package/types/client/idl/loot.d.ts +4498 -0
  113. package/types/client/index.d.ts +9 -0
  114. package/types/client/ix.d.ts +5315 -0
  115. package/types/client/pda.d.ts +95 -0
  116. package/types/client/policy.d.ts +48 -0
  117. package/types/client/random.d.ts +26 -0
  118. package/types/client/sizes.d.ts +101 -0
  119. package/types/client/traits.d.ts +12 -0
  120. package/types/economy/check.d.mts +100 -0
  121. package/types/economy/cost.d.mts +69 -0
  122. package/types/economy/examples.d.mts +27 -0
  123. package/types/economy/explain.d.mts +19 -0
  124. package/types/economy/guide.d.mts +140 -0
  125. package/types/economy/legal.d.mts +12 -0
  126. package/types/economy/live.d.mts +124 -0
  127. package/types/economy/model.d.mts +431 -0
  128. package/types/economy/plan.d.mts +1014 -0
  129. package/types/economy/secrets.d.mts +4 -0
  130. package/types/economy/simulate.d.mts +164 -0
  131. package/types/economy/txsize.d.mts +17 -0
  132. package/types/economy/validate.d.mts +3 -0
  133. package/types/index.d.ts +9 -0
  134. package/types/mcp/tools.d.mts +635 -0
  135. package/types/play/index.d.ts +880 -0
  136. package/types/play/keys.d.ts +51 -0
  137. package/types/results/index.d.ts +155 -0
  138. package/types/results/wire.d.ts +122 -0
@@ -0,0 +1,124 @@
1
+ import { randomBytes } from '../chain/bytes.js';
2
+ /** A key for each fresh account the plan creates. Their secret halves are made by whoever signs (the page). */
3
+ export declare function freshAddresses(names: any, random?: typeof randomBytes): {
4
+ [k: string]: any;
5
+ };
6
+ /**
7
+ * The transactions that put `economy` live for `owner`, with `keys` the addresses of the fresh accounts (each signs
8
+ * the transaction that creates it). `live`: what is already live (a change publishes only what differs).
9
+ */
10
+ export declare function prepare(economy: any, { owner, keys, live, now, rent, only, slot }: {
11
+ keys: any;
12
+ live?: null | undefined;
13
+ now?: number | undefined;
14
+ only?: null | undefined;
15
+ owner: any;
16
+ rent: any;
17
+ slot?: null | undefined;
18
+ }): {
19
+ ok: boolean;
20
+ refusals: any[];
21
+ warnings: any[];
22
+ steps?: undefined;
23
+ transactions?: undefined;
24
+ approvals?: undefined;
25
+ freshKeys?: undefined;
26
+ } | {
27
+ refusals?: undefined;
28
+ ok: boolean;
29
+ warnings: any[];
30
+ steps: any[];
31
+ transactions: {
32
+ signer: string;
33
+ steps: any[];
34
+ built: any[];
35
+ instructions: any;
36
+ signers: any[];
37
+ alone: boolean;
38
+ }[];
39
+ approvals: number;
40
+ freshKeys: any[];
41
+ } | {
42
+ ok: boolean;
43
+ refusals: any[];
44
+ warnings: any[];
45
+ steps?: undefined;
46
+ transactions?: undefined;
47
+ approvals?: undefined;
48
+ freshKeys?: undefined;
49
+ ctx: {
50
+ owner: any;
51
+ authority: any;
52
+ collection: any;
53
+ tree: any;
54
+ project: any;
55
+ treasury: any;
56
+ mints: {};
57
+ keys: any;
58
+ rent: any;
59
+ slot: null;
60
+ };
61
+ } | {
62
+ refusals?: undefined;
63
+ ok: boolean;
64
+ warnings: any[];
65
+ steps: any[];
66
+ transactions: {
67
+ signer: string;
68
+ steps: any[];
69
+ built: any[];
70
+ instructions: any;
71
+ signers: any[];
72
+ alone: boolean;
73
+ }[];
74
+ approvals: number;
75
+ freshKeys: any[];
76
+ ctx: {
77
+ owner: any;
78
+ authority: any;
79
+ collection: any;
80
+ tree: any;
81
+ project: any;
82
+ treasury: any;
83
+ mints: {};
84
+ keys: any;
85
+ rent: any;
86
+ slot: null;
87
+ };
88
+ };
89
+ /**
90
+ * The parts of an economy whose widest transaction passes a legacy transaction, so a player sends it in one approval
91
+ * only with the project's standing lookup table: a box's open or settle and a craft the checker sizes past one
92
+ * (W-TX-V0, W-SETTLE-V0), an auction whose bids are NFTs (each moves with its own accounts), and a farm of another
93
+ * collection's NFTs (a pNFT's stake and exit carry its token record and rule set). [{ where, why }]
94
+ */
95
+ export declare function wideParts(m: any, warnings?: any[]): {
96
+ where: any;
97
+ why: string;
98
+ }[];
99
+ /**
100
+ * The spec once its setup landed: every part keeps the program number it was given, and `live` names the game, its
101
+ * collection, the treasury, the mints made and the program, with a copy of what is now on chain.
102
+ */
103
+ export declare function recordLanded(economy: any, { ctx, signatures, at, now }: {
104
+ at?: string | undefined;
105
+ ctx: any;
106
+ now: any;
107
+ signatures?: never[] | undefined;
108
+ }): any;
109
+ /**
110
+ * What a change to a live economy publishes: the parts that are new or differ from what is on chain (`live.published`),
111
+ * as the part ids setupSteps takes (`only`), and in words what cannot change. `settings`: the project's own settings
112
+ * the spec changes (its authority, treasury, collections), which a publish never writes.
113
+ */
114
+ export declare function changedParts(economy: any): {
115
+ only: null;
116
+ fixed: never[];
117
+ removed: never[];
118
+ settings: never[];
119
+ } | {
120
+ only: Set<any>;
121
+ fixed: string[];
122
+ removed: string[];
123
+ settings: string[];
124
+ };
@@ -0,0 +1,431 @@
1
+ /** The two flat fees, in lamports, as the platform sets them by default; the program caps each at 0.01 SOL. */
2
+ export declare const FEES: Readonly<{
3
+ player: 2000000n;
4
+ project: 10000n;
5
+ }>;
6
+ /**
7
+ * What MagicBlock's VRF oracle queue (Cuj97ggr…, ephemeral-vrf-sdk 0.17.2 consts.rs DEFAULT_QUEUE) takes for each
8
+ * random number asked of it: VRF_LAMPORTS_COST = 500,000 lamports, 0.0005 SOL (magicblock-labs/ephemeral-vrf,
9
+ * api/src/consts.rs; the high-priority queue's 800,000 is not the one loot uses). Paid by whoever asks: the player
10
+ * on `open_box` (order.rs), whoever sends `draw_lottery` (lottery.rs, its `payer`), the authority on `roll`
11
+ * (roll.rs). Measured on devnet: 500,000 lamports per open.
12
+ */
13
+ export declare const ORACLE_FEE = 800000n;
14
+ /**
15
+ * What js/play's throwaway settle key is funded with, in the purchase's own transaction, for each prize its settle may
16
+ * open or mint (`loot.SETTLE_RENT_UNIT`): whoever settles pays that rent, the order lends nothing. What the settle
17
+ * doesn't spend goes back to the player when the key empties itself, and all of it when the roll fails.
18
+ */
19
+ export declare const SETTLE_RENT_UNIT = 6000000n;
20
+ /** Rent: (bytes + 128) × 5,080 lamports, as `solana rent` reads it on devnet and mainnet-beta. */
21
+ export declare const RENT_PER_BYTE = 5080n;
22
+ export declare const ACCOUNT_OVERHEAD = 128n;
23
+ /**
24
+ * The most rent a byte has cost on any Solana cluster: 3,480 lamports a byte-year for two years, the rate before
25
+ * devnet and mainnet lowered it (a local validator and LiteSVM still charge it). An RPC that asks more is not believed.
26
+ */
27
+ export declare const MOST_RENT_PER_BYTE = 6960n;
28
+ export declare const rent: (bytes: any) => bigint;
29
+ /**
30
+ * A collectible's Core account, paid from the SOL its order holds (or by whoever gives it): its rent (a Core asset of
31
+ * about 190 bytes) plus Metaplex Core's creation fee of 0.0015 SOL, which the account keeps. The full simulation
32
+ * measures 0.00309 to 0.00313 SOL across its fixtures.
33
+ */
34
+ export declare const COLLECTIBLE_RENT = 3100000n;
35
+ /** The network's base fee per signature. Priority fees are extra and up to the wallet. */
36
+ export declare const SIGNATURE_FEE = 5000n;
37
+ export declare const LAMPORTS_PER_SOL = 1000000000n;
38
+ export declare const WSOL = "So11111111111111111111111111111111111111112";
39
+ /** The limits a spec meets: the chain's (the oracle's answer carries 21 accounts; a farm names a tier and a recipe a
40
+ * collectible's place in a byte; Bubblegum keeps a compressed NFT's link in 200 bytes and its name in 32) and the two
41
+ * caps that keep a farm's numbers from overflowing. Since loot 0.22 the program caps no count or size of its own. */
42
+ export declare const LIMITS: Readonly<{
43
+ callbackAccounts: 21;
44
+ tiers: 256;
45
+ collectiblesPerCraft: 255;
46
+ vouchers: 3;
47
+ compressedNameBytes: 32;
48
+ compressedUriBytes: 200;
49
+ maxBoostBps: 1000000;
50
+ maxTierBps: 110000;
51
+ boxEntries: 128;
52
+ boxSlots: 32;
53
+ boxOdds: 32;
54
+ boxFates: 64;
55
+ entryPrizes: 14;
56
+ itemTraits: 64;
57
+ traitKeyBytes: 64;
58
+ recipeLines: 48;
59
+ farmRules: 32;
60
+ growthSteps: 128;
61
+ contestSides: 1024;
62
+ deciders: 32;
63
+ collections: 32;
64
+ lotteryRuns: 64;
65
+ farmEnds: 100000;
66
+ }>;
67
+ /** Attribute names the program writes itself, which a recipe cannot copy and `Set` cannot change (craft.rs, make.rs),
68
+ * and the two a collectible's life keeps (`lifeLines`: its uses and its next use). */
69
+ export declare const RESERVED_ATTRIBUTES: readonly string[];
70
+ export declare const RARITIES: readonly string[];
71
+ /** A refusal raised while reading a value; the checker turns it into a refusal with a code. */
72
+ export declare class SpecError extends Error {
73
+ code: any;
74
+ fix: any;
75
+ constructor(code: any, message: any, fix: any);
76
+ }
77
+ /** A plain decimal string for an amount written as a number or text (no exponent). */
78
+ export declare function decimalText(amount: any): string;
79
+ /** "0.1" of a currency with 9 decimals → 100000000n. Refuses more decimals than the currency has. */
80
+ export declare function toUnits(amount: any, decimals: any): bigint;
81
+ /** 100000000n with 9 decimals → "0.1". */
82
+ export declare function fromUnits(units: any, decimals: any): string;
83
+ /** A count written as an amount (a contest of NFTs counts NFTs): 2 or "2" → 2n. Null when it is not a whole number. */
84
+ export declare function wholeCount(value: any): bigint | null;
85
+ /** 2.5 (percent) → 250 basis points. Null when it is not a whole number of hundredths. */
86
+ export declare function toBps(percent: any): number | null;
87
+ /** "7d" → 604800. A number is seconds already. */
88
+ export declare function toSeconds(duration: any): number;
89
+ /**
90
+ * How long what lands in a farm's rewards vault takes to be released to its seats, in seconds (a farm that shares what
91
+ * lands, `farm.rs` `release_span`): its longest lock tier, and a day at least.
92
+ */
93
+ export declare const releaseSeconds: (f: any) => number;
94
+ /** A farm's release span in words: "a day", "30 days", "36 hours". */
95
+ export declare function releaseWords(f: any): string;
96
+ /**
97
+ * What a run sent late does, in words (schedule.rs `catches_up`): a sealed schedule's fixed amount pays every run due;
98
+ * any other run pays once, for the latest run due, and the runs before it lapse.
99
+ */
100
+ export declare const lateRunWords: (s: any) => "a run missed is missed: one sent late pays once, for the latest run due, and the runs before it lapse" | "a run sent late pays every run due since";
101
+ /**
102
+ * Whether a farm's boost reads a number its own growth writes (`refresh_seat` writes it): each level counts from when it is
103
+ * written, so a page or a keeper should refresh seats.
104
+ */
105
+ export declare const boostReadsGrowth: (f: any) => any;
106
+ /** A box's roll against what is in stock, in words (order.rs): the odds stay as written, whatever is left. */
107
+ export declare const STOCK_WORDS = "The odds stay as written whatever is in stock: a draw that lands on an outcome that can\u2019t be given then (its pool short of the whole amount, its item or stash gone) is not made, no other outcome takes its place, and that draw\u2019s worth of the price goes back at the settle; with no draw made at all, a paid open fails and is refunded, and a free roll goes back to waiting";
108
+ /**
109
+ * What a box that rolls does once an outcome can't be given (`whenOut`, order.rs `WhenOut`), in words. `sold`: it is
110
+ * sold (an open checks the stock); a box only other routes roll (a prize, a mission) never stops a sale.
111
+ */
112
+ export declare function whenOutWords(b: any, { sold }?: {
113
+ sold?: boolean | undefined;
114
+ }): "The odds stay as written whatever is in stock: a draw that lands on an outcome that can’t be given then (its pool short of the whole amount, its item or stash gone) is not made, no other outcome takes its place, and that draw’s worth of the price goes back at the settle; with no draw made at all, a paid open fails and is refunded, and a free roll goes back to waiting" | "When an outcome runs out (an item sold out, a pool short of its prize, a stash empty), a roll draws among the outcomes still there by their written weights, so the others’ chances rise; with nothing left at all, a free roll waits to be asked again and a paid one is refunded" | "When an outcome runs out (an item sold out, a pool short of its prize, a stash empty), the box keeps selling while its first draw has anything left, and a roll draws among the outcomes still there by their written weights: the others’ chances rise as one runs out, so a player can empty a common outcome to make a rare one likelier (a box selling a rare prize should stop selling instead, the default)" | "When an outcome runs out, the box stops selling: it isn’t sold while any outcome couldn’t cover this purchase’s draws and those of purchases still waiting for the oracle (an item’s units left, a pool’s tokens, a stash’s NFTs), so every roll is on the odds as written and nobody can buy their way to a refund on every miss; it sells again once the project restocks or edits the box (an outcome whose odds shrink with stock needs no cover). An outcome emptied another way all the same (another route sharing its pool, item or stash) makes no draw, no other outcome taking its place, and gives back that draw’s worth of the price at the settle; with no draw made at all, the open is refunded";
115
+ /**
116
+ * What the end of a sharing farm that `runs` means, in words, or null (no end, or a fixed rate): its release keeps its
117
+ * pace, so what it has not let go by the end stays in its vault, free for the authority to take back, and so does what
118
+ * a seat forfeits after the end.
119
+ */
120
+ export declare function farmEndWords(f: any): string | null;
121
+ /**
122
+ * The token a farm's rewards are in (`rewards`, a token key): by default its staked token, or for a farm of
123
+ * collectibles the project's currency. One that names a pool (as farms did before they had a vault of their own) is
124
+ * read as that pool's token, and the checker refuses it.
125
+ */
126
+ export declare function farmRewardsToken(f: any, tokens: any, currencyKey: any, poolCurrency?: Map<any, any>): any;
127
+ /** A raise's or a shift's `by`: a number, or for a time a duration, which may be negative ("-1d"). */
128
+ export declare function toBy(by: any): any;
129
+ /** "publish", "publish+7d" or a date → Unix seconds, counted from `now` (Unix seconds) for the first two. */
130
+ export declare function toTime(time: any, now: any): any;
131
+ export declare const rarityNumber: (rarity: any) => number;
132
+ export declare const utf8Bytes: (s: any) => number;
133
+ export declare const isAddress: (s: any) => boolean;
134
+ /** Where an NFT paid goes, in the program's words (`Spend`, `Then`): "burn", "treasury" (its wallet, filled in at go-live), { giveTo }, or { stash }. */
135
+ export declare const spendOf: (then: any, m: any) => "Burn" | {
136
+ Stash: any[];
137
+ Give?: undefined;
138
+ } | {
139
+ Stash?: undefined;
140
+ Give: any[];
141
+ };
142
+ /**
143
+ * The spec with references resolved and ids given. Unknown references stay as they are (the checker reports
144
+ * them); call `check` first when it matters.
145
+ */
146
+ export declare function model(economy: any, { now }?: {
147
+ now?: number | undefined;
148
+ }): {
149
+ now: number;
150
+ name: any;
151
+ authority: any;
152
+ /** The wallet whose account for the currency is the treasury, when it isn't the owner's ("wallet:<address>"). */
153
+ treasuryWallet: any;
154
+ tokens: Map<any, any>;
155
+ currencyKey: any;
156
+ currency: any;
157
+ /** The collection the setup makes (null when the spec says `"collection": false`: a project of tokens only). */
158
+ collection: any;
159
+ /** Core collections the owner already has that the project also takes (its update authority is the owner). */
160
+ collections: any;
161
+ /** How many compressed NFTs the project's tree holds (`compressedTree`), when a prize gives one. */
162
+ treeHolds: any;
163
+ /** The project's number among its owner's: its address is ["project", owner, number]. */
164
+ projectNumber: any;
165
+ items: any;
166
+ pools: any;
167
+ stashes: any;
168
+ tables: any;
169
+ boxes: never[];
170
+ payments: any;
171
+ recipes: any;
172
+ schedules: any;
173
+ lotteries: any;
174
+ farms: any;
175
+ contests: any;
176
+ auctions: any;
177
+ holds: any;
178
+ grants: any;
179
+ traits: any;
180
+ decisions: any;
181
+ scenario: any;
182
+ live: any;
183
+ };
184
+ /**
185
+ * The NFTs a stash lists, each as the program's `piece` takes it: a Core asset (`asset`, its `collection`: its own, the
186
+ * stash's, or the game's when neither says), a Token Metadata NFT (`mint`, `programmable`, `ruleSet`), or a compressed
187
+ * NFT (`compressed`, its asset id).
188
+ */
189
+ export declare function stashNfts(s: any): any;
190
+ /**
191
+ * A prize as the spec writes it (`$defs/prize`), read the one way: a line { gives, … } as a recipe's `out` lines are:
192
+ * "item" (`item`), "tokens" (`amount`, `from` "mint" with `currency`, or "pool:<key>"),
193
+ * "nft" (`nft`, an address the stash `stash` lists) or "roll" (a roll of `box`; in a recipe, on the collectible kept
194
+ * at `on`). A grant's older `gives` ({ item }, { pool, amount }, { roll }) reads as its line. Null for none.
195
+ */
196
+ export declare function prizeLine(p: any): any;
197
+ /** The pool a prize line pays from: tokens' "pool:<key>". */
198
+ export declare const prizePool: (p: any) => any;
199
+ /** The token a prize line pays in: its pool's, or the one it mints. */
200
+ export declare const prizeToken: (p: any, m: any) => any;
201
+ /**
202
+ * Every prize the spec gives (prize.rs): a grant's, a lottery place's, a contest's winners', a mission tier's and a
203
+ * recipe's `out` lines. [{ prize (a line), where, by, route, strict, once }] `strict`: the route refuses a prize it
204
+ * can't give (a grant's claim, a craft); any other goes on without it. `once`: the route gives it once at most (a
205
+ * grant of one claim in all).
206
+ */
207
+ export declare function prizes(m: any): any[];
208
+ /**
209
+ * The project's tree of compressed NFTs (`open_tree`), when a prize gives one (`"compressed": true`), else null: deep
210
+ * enough for `treeHolds` (14 to 20 levels, Bubblegum's sizes for a buffer of 64), its canopy keeping a proof at 10
211
+ * nodes or a few more (at most 8 levels: past that the rent grows faster than the proofs shrink). { depth, buffer,
212
+ * canopy, bytes }
213
+ */
214
+ export declare function compressedTree(m: any): {
215
+ depth: number;
216
+ buffer: number;
217
+ canopy: number;
218
+ bytes: number;
219
+ } | null;
220
+ /**
221
+ * Every route that gives a roll of a box, with the box it names: a prize's roll (`prizes`), an auction's lot, a
222
+ * mission's roll on the NFT leaving it and a recipe's roll on a collectible it keeps. [{ box, by, route }]
223
+ */
224
+ export declare function prizeRolls(m: any): {
225
+ box: any;
226
+ by: any;
227
+ route: any;
228
+ }[];
229
+ /**
230
+ * Every roll of a box any route makes, for the checks keyed on "a box something rolls": `prizeRolls`, every box
231
+ * outcome's (or bundle part's) roll of another box (route "box", made at its settle), and, followed through chains,
232
+ * each route that rolls a box whose outcome rolls another (a grant's roll of “mid”, whose outcome rolls “inner”, is a
233
+ * roll of “inner” by the grant, `through` ["mid"]). [{ box, by, route, through? }]
234
+ */
235
+ export declare function rollsOf(m: any): {
236
+ box: any;
237
+ by: any;
238
+ route: any;
239
+ }[];
240
+ /** A prize line in words: "one Badge", "100 GOLD from “rewards”", "100 GOLD, minted", "the NFT ab12…cd34 of “vault”", "a roll of “Chest”". */
241
+ export declare function prizeWords(p: any, m: any): string;
242
+ /**
243
+ * What one box outcome gives (catalog.rs), each in the box's own words: "item", "pay" (a fixed amount from a pool),
244
+ * "stash" (an NFT of a stash at random), "mint"
245
+ * (tokens minted), "nft" (one NFT a stash lists) or "roll" (a roll of another box). A bundle gives its `prizes`; "burn"
246
+ * and "nothing" give none.
247
+ */
248
+ export declare function outcomeParts(o: any): any;
249
+ /** Whether a box leaves its outcome to the oracle (catalog.rs `rolls`): more than one outcome, or an NFT at random. */
250
+ /** How many draws one open of a box makes: its slots' counts, or one. */
251
+ export declare const drawsOf: (b: any) => any;
252
+ /** Whether a box's prize costs its settle a collectible's rent: an item minted as a Core NFT, or a fresh compressed one
253
+ * (its traits' Sheet). A plain compressed NFT costs no rent. */
254
+ export declare const holdsRent: (p: any, m: any) => boolean;
255
+ /**
256
+ * The units of `SETTLE_RENT_UNIT` a settle of box `b`'s order may spend (`loot.settleRent`), which js/play funds its
257
+ * throwaway settle key with and gets back unspent: for each draw, each part of the richest outcome that opens an
258
+ * account (a collectible, a fresh compressed NFT's Sheet, a stash's NFT); once an order, each source of tokens it may
259
+ * pay, and the fate of the NFT it rolls on.
260
+ */
261
+ export declare function settleUnits(b: any, m: any): number;
262
+ export declare const boxRolls: (b: any, m: any) => any;
263
+ /** Whether a box sells with `buy`, in one transaction (buy.rs): it doesn't roll and rolls on no NFT, any number of draws
264
+ * a sale (a fixed pack: its prizes given once for each draw). */
265
+ export declare const boxBuys: (b: any, m: any) => boolean;
266
+ /**
267
+ * What a recipe's lines owe the life of each collectible they take (an item's `life`), as the program's needs and
268
+ * raises (craft.rs `Need`, `Raise`), at each collectible's place in the recipe (each burned unit, then each kept one, in
269
+ * line order; a pay line takes none): ready after `readyAfter` (`made` older than it), for `lasts` (`made` within it),
270
+ * on every line that takes it; `uses` times (`used` raised by 1 up to it) and a `cooldown` (`next_use` passed, then
271
+ * raised to that far from now) on a line that uses it or takes it staked; a renew line counts its uses from 0 again.
272
+ * { needs, raises }, in the program's shapes.
273
+ */
274
+ export declare function lifeLines(r: any, m: any): {
275
+ needs: any[];
276
+ raises: any[];
277
+ };
278
+ /** A lottery's place as { percent, prize }: a number is a share of the pot and no prize. */
279
+ export declare const placeOf: (p: any) => {
280
+ percent: any;
281
+ prize: any;
282
+ times: any;
283
+ };
284
+ /** "pool:house" → { kind: 'pool', key: 'house' }; "burn" → { kind: 'burn' }. */
285
+ export declare function destination(to: any): {
286
+ kind: string;
287
+ key?: undefined;
288
+ } | {
289
+ kind: string;
290
+ key: string;
291
+ };
292
+ /** The share with its basis points, or null bps when the percent is not whole hundredths. */
293
+ export declare const sharesOf: (split: any) => any;
294
+ /**
295
+ * The program's `To` for a destination, with pool indexes resolved (the IDL's own shape). A wallet ("wallet:<address>")
296
+ * is paid at its own token account of the part's currency (the program opens it when it is not there); "treasury" is the game's treasury wallet's; "chosen"
297
+ * (or "chosen:<item>") is the one the buyer names when they buy; "lottery:<key>" is that lottery's pot
298
+ * ("@pot:<id>") and "farm:<key>" that farm's rewards vault ("@rewards:<id>"), which the plan resolves once the game is
299
+ * known.
300
+ */
301
+ export declare function toEnum(to: any, m: any): "Burn" | "Treasury" | {
302
+ Pool: any[];
303
+ Account?: undefined;
304
+ Wallet?: undefined;
305
+ Chosen?: undefined;
306
+ Holder?: undefined;
307
+ } | {
308
+ Pool?: undefined;
309
+ Account: (string | undefined)[];
310
+ Wallet?: undefined;
311
+ Chosen?: undefined;
312
+ Holder?: undefined;
313
+ } | {
314
+ Pool?: undefined;
315
+ Account?: undefined;
316
+ Wallet: (string | undefined)[];
317
+ Chosen?: undefined;
318
+ Holder?: undefined;
319
+ } | {
320
+ Pool?: undefined;
321
+ Account?: undefined;
322
+ Wallet?: undefined;
323
+ Chosen: {
324
+ item: any;
325
+ };
326
+ Holder?: undefined;
327
+ } | {
328
+ Pool?: undefined;
329
+ Account?: undefined;
330
+ Wallet?: undefined;
331
+ Chosen?: undefined;
332
+ Holder: (string | undefined)[];
333
+ };
334
+ /**
335
+ * The program's `Rule` for a spec rule: which NFTs (a collection's, or an item's the game mints), an attribute and its
336
+ * test. With neither, the collection the game has authority over: `@collection`, filled in when the economy goes live.
337
+ */
338
+ export declare function ruleOf(rule: any, m: any): {
339
+ of: {
340
+ Item: any[];
341
+ Collection?: undefined;
342
+ } | {
343
+ Item?: undefined;
344
+ Collection: any[];
345
+ };
346
+ key: any;
347
+ test: any;
348
+ } | null;
349
+ /** One thing or a list of them, as a list: a farm's `gate` and `growth` take either. */
350
+ export declare const listOf: (x: any) => any[];
351
+ /**
352
+ * The program's `Gate` for a spec gate: a few wallets (`wallets`), a list of any size (`list`: an allowlist, its root and
353
+ * depth: the client's `gateList`), a stake (`staked`: at least `atLeast` of a farm's token in the wallet's seat; the farm's address
354
+ * is "@farm:<id>", filled in when the project is known), or a rule a collectible the player shows must pass.
355
+ */
356
+ export declare const gateOf: (gate: any, m: any) => {
357
+ Wallets: any[];
358
+ Staked?: undefined;
359
+ List?: undefined;
360
+ Holds?: undefined;
361
+ } | {
362
+ Wallets?: undefined;
363
+ Staked: {
364
+ farm: string;
365
+ at_least: bigint;
366
+ };
367
+ List?: undefined;
368
+ Holds?: undefined;
369
+ } | {
370
+ Wallets?: undefined;
371
+ Staked?: undefined;
372
+ List: {
373
+ root: any;
374
+ depth: number;
375
+ };
376
+ Holds?: undefined;
377
+ } | {
378
+ Wallets?: undefined;
379
+ Staked?: undefined;
380
+ List?: undefined;
381
+ Holds: ({
382
+ of: {
383
+ Item: any[];
384
+ Collection?: undefined;
385
+ } | {
386
+ Item?: undefined;
387
+ Collection: any[];
388
+ };
389
+ key: any;
390
+ test: any;
391
+ } | null)[];
392
+ } | null;
393
+ /** The program's `PerWallet` for a part's "perWallet" (in all) and "perWalletEach" ({ count, every }). */
394
+ export declare const perWalletOf: (part: any) => {
395
+ total: any;
396
+ per_window: any;
397
+ window: number;
398
+ };
399
+ /** The program's `Window` for a part's "opens" and "closes" (times; 0 leaves a side open). */
400
+ export declare const windowOf: (part: any, now: any) => {
401
+ opens_at: bigint;
402
+ closes_at: bigint;
403
+ };
404
+ /** A lottery's split of ticket money: its own, and "cutPercent" as a share to the treasury. */
405
+ export declare const lotterySplit: (l: any) => any[];
406
+ /** The program's `Effect` for a spec effect: a flat share, or a share per point of the attribute. */
407
+ export declare function effectOf(effect: any): {
408
+ PerPoint: {
409
+ bps: number;
410
+ most: any;
411
+ };
412
+ Flat?: undefined;
413
+ } | {
414
+ PerPoint?: undefined;
415
+ Flat: number[];
416
+ };
417
+ /** A box's outcomes with their program weights: chances become whole weights (hundredths of a basis point). */
418
+ export declare function weights(box: any): any;
419
+ /** Every place the spec names a pool as somewhere money leaves from, with what takes it. */
420
+ export declare function poolTakers(m: any): any[];
421
+ /** Every place the spec sends money into a pool. */
422
+ export declare function poolFillers(m: any): any[];
423
+ /**
424
+ * Every place the spec sends money into a farm's rewards vault ("farm:<key>"): a split's share, a schedule that pays it,
425
+ * a craft that pays it, the owner's seed, an early exit's fee into its own vault. [{ farm, by, how }]
426
+ */
427
+ export declare function farmFillers(m: any): {
428
+ farm: any;
429
+ by: string;
430
+ how: string;
431
+ }[];