@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,880 @@
1
+ /**
2
+ * A signer from a Wallet Standard wallet and one of its accounts: the wallet signs, the app sends. With the wallet's
3
+ * `solana:signMessage`, also `signMessage(bytes)`: the app's settle keys are made from one signature of it a session,
4
+ * so a page that closes can make them again (`recover`).
5
+ */
6
+ export declare function walletStandardSigner(wallet: any, account: any, chain?: string): {
7
+ address: any;
8
+ signTransaction(wire: any): Promise<any>;
9
+ signMessage?: ((message: any) => Promise<any>) | undefined;
10
+ };
11
+ /**
12
+ * An amount in whole units of a token ("12", "0.5", or a number) in its base units. Only a plain decimal is taken, with
13
+ * at most the token's decimals: "0x10", "1.2.3", "", "1e3", "-1" and an extra decimal place are refused, never read as
14
+ * some other amount.
15
+ */
16
+ export declare const units: (amount: any, decimals: any) => bigint;
17
+ /**
18
+ * The player's side of a live economy. `rpc` may be given instead of `rpcUrl` (any object with the client's rpc
19
+ * methods: accounts, account, latestBlockhash, send, confirm, programAccounts, and call(method, params), the raw JSON
20
+ * RPC request the devnet check, the slot and the compressed-NFT reads go through). `now` is the clock auctions are read
21
+ * by (Unix seconds). Devnet only (`devnetOnly`): mainnet waits for an audit. `keyStore`: where a settle key that can't
22
+ * be made again from the wallet's signature is kept, encrypted (`browserStore()` in a browser; null keeps keys in memory
23
+ * only).
24
+ */
25
+ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, keyStore }: {
26
+ keyStore?: {
27
+ get: (k: any) => string | null;
28
+ set: (k: any, v: any) => void;
29
+ remove: (k: any) => void;
30
+ keys: () => (string | null)[];
31
+ cryptoKey: () => any;
32
+ } | null | undefined;
33
+ now?: (() => number) | undefined;
34
+ programs?: {} | undefined;
35
+ rpc?: null | undefined;
36
+ rpcUrl?: string | undefined;
37
+ spec: any;
38
+ wallet: any;
39
+ }): {
40
+ project: any;
41
+ readonly address: any;
42
+ /** The shop: every item with a price (or free), its price now and what is left. */
43
+ shop(): Promise<any>;
44
+ /** The boxes: price now, each outcome's chance as written, and what the box does once an outcome runs out
45
+ * (`whenOut`: 'stopSales', it isn't sold until restocked; 'drawLeft', it draws among what is left). */
46
+ boxes(): Promise<any>;
47
+ /**
48
+ * Buys a shop item, in one transaction (`buy`: the price split and the item given at once). A listing that rolls
49
+ * (an NFT at random, or one it rolls on) is opened and settled instead. Returns { signature, assets, asset } for a
50
+ * purchase, or what `collect` returns for an open.
51
+ */
52
+ buy(itemKey: any, options?: {}): Promise<{
53
+ order: any;
54
+ settled: string;
55
+ says: string;
56
+ } | {
57
+ order: any;
58
+ settled: null;
59
+ says: string;
60
+ } | {
61
+ says?: undefined;
62
+ order: any;
63
+ won: any;
64
+ assets: any;
65
+ settled: any;
66
+ parts?: any[] | undefined;
67
+ asset?: any;
68
+ } | {
69
+ signature: any;
70
+ assets: any[];
71
+ asset?: any;
72
+ rolls?: ({
73
+ order: any;
74
+ settled: string;
75
+ says: string;
76
+ } | {
77
+ order: any;
78
+ settled: null;
79
+ says: string;
80
+ } | {
81
+ says?: undefined;
82
+ order: any;
83
+ won: any;
84
+ assets: any;
85
+ settled: any;
86
+ parts?: any[] | undefined;
87
+ asset?: any;
88
+ })[] | undefined;
89
+ } | {
90
+ orders: ({
91
+ order: any;
92
+ settled: string;
93
+ says: string;
94
+ } | {
95
+ order: any;
96
+ settled: null;
97
+ says: string;
98
+ } | {
99
+ says?: undefined;
100
+ order: any;
101
+ won: any;
102
+ assets: any;
103
+ settled: any;
104
+ parts?: any[] | undefined;
105
+ asset?: any;
106
+ })[];
107
+ won: any[];
108
+ assets: any[];
109
+ parts: any[];
110
+ } | {
111
+ order: any;
112
+ settled: string;
113
+ says: string;
114
+ orders: ({
115
+ order: any;
116
+ settled: string;
117
+ says: string;
118
+ } | {
119
+ order: any;
120
+ settled: null;
121
+ says: string;
122
+ } | {
123
+ says?: undefined;
124
+ order: any;
125
+ won: any;
126
+ assets: any;
127
+ settled: any;
128
+ parts?: any[] | undefined;
129
+ asset?: any;
130
+ })[];
131
+ won: any[];
132
+ assets: any[];
133
+ parts: any[];
134
+ } | {
135
+ order: any;
136
+ settled: null;
137
+ says: string;
138
+ orders: ({
139
+ order: any;
140
+ settled: string;
141
+ says: string;
142
+ } | {
143
+ order: any;
144
+ settled: null;
145
+ says: string;
146
+ } | {
147
+ says?: undefined;
148
+ order: any;
149
+ won: any;
150
+ assets: any;
151
+ settled: any;
152
+ parts?: any[] | undefined;
153
+ asset?: any;
154
+ })[];
155
+ won: any[];
156
+ assets: any[];
157
+ parts: any[];
158
+ } | {
159
+ says?: undefined;
160
+ order: any;
161
+ settled: any;
162
+ asset?: any;
163
+ orders: ({
164
+ order: any;
165
+ settled: string;
166
+ says: string;
167
+ } | {
168
+ order: any;
169
+ settled: null;
170
+ says: string;
171
+ } | {
172
+ says?: undefined;
173
+ order: any;
174
+ won: any;
175
+ assets: any;
176
+ settled: any;
177
+ parts?: any[] | undefined;
178
+ asset?: any;
179
+ })[];
180
+ won: any[];
181
+ assets: any[];
182
+ parts: any[];
183
+ }>;
184
+ /**
185
+ * Opens a box (shows a collectible for its gate or odds when given): a box that needs no roll is bought at once
186
+ * (`buy`); one that rolls waits for the roll and collects it, settling a pack in as many parts as it needs. `count`
187
+ * opens several packs in one purchase: one wallet prompt and one oracle answer (`maxPrice` is a pack's).
188
+ */
189
+ openBox(boxKey: any, options?: {}): Promise<{
190
+ order: any;
191
+ settled: string;
192
+ says: string;
193
+ } | {
194
+ order: any;
195
+ settled: null;
196
+ says: string;
197
+ } | {
198
+ says?: undefined;
199
+ order: any;
200
+ won: any;
201
+ assets: any;
202
+ settled: any;
203
+ parts?: any[] | undefined;
204
+ asset?: any;
205
+ } | {
206
+ signature: any;
207
+ assets: any[];
208
+ asset?: any;
209
+ rolls?: ({
210
+ order: any;
211
+ settled: string;
212
+ says: string;
213
+ } | {
214
+ order: any;
215
+ settled: null;
216
+ says: string;
217
+ } | {
218
+ says?: undefined;
219
+ order: any;
220
+ won: any;
221
+ assets: any;
222
+ settled: any;
223
+ parts?: any[] | undefined;
224
+ asset?: any;
225
+ })[] | undefined;
226
+ } | {
227
+ orders: ({
228
+ order: any;
229
+ settled: string;
230
+ says: string;
231
+ } | {
232
+ order: any;
233
+ settled: null;
234
+ says: string;
235
+ } | {
236
+ says?: undefined;
237
+ order: any;
238
+ won: any;
239
+ assets: any;
240
+ settled: any;
241
+ parts?: any[] | undefined;
242
+ asset?: any;
243
+ })[];
244
+ won: any[];
245
+ assets: any[];
246
+ parts: any[];
247
+ } | {
248
+ order: any;
249
+ settled: string;
250
+ says: string;
251
+ orders: ({
252
+ order: any;
253
+ settled: string;
254
+ says: string;
255
+ } | {
256
+ order: any;
257
+ settled: null;
258
+ says: string;
259
+ } | {
260
+ says?: undefined;
261
+ order: any;
262
+ won: any;
263
+ assets: any;
264
+ settled: any;
265
+ parts?: any[] | undefined;
266
+ asset?: any;
267
+ })[];
268
+ won: any[];
269
+ assets: any[];
270
+ parts: any[];
271
+ } | {
272
+ order: any;
273
+ settled: null;
274
+ says: string;
275
+ orders: ({
276
+ order: any;
277
+ settled: string;
278
+ says: string;
279
+ } | {
280
+ order: any;
281
+ settled: null;
282
+ says: string;
283
+ } | {
284
+ says?: undefined;
285
+ order: any;
286
+ won: any;
287
+ assets: any;
288
+ settled: any;
289
+ parts?: any[] | undefined;
290
+ asset?: any;
291
+ })[];
292
+ won: any[];
293
+ assets: any[];
294
+ parts: any[];
295
+ } | {
296
+ says?: undefined;
297
+ order: any;
298
+ settled: any;
299
+ asset?: any;
300
+ orders: ({
301
+ order: any;
302
+ settled: string;
303
+ says: string;
304
+ } | {
305
+ order: any;
306
+ settled: null;
307
+ says: string;
308
+ } | {
309
+ says?: undefined;
310
+ order: any;
311
+ won: any;
312
+ assets: any;
313
+ settled: any;
314
+ parts?: any[] | undefined;
315
+ asset?: any;
316
+ })[];
317
+ won: any[];
318
+ assets: any[];
319
+ parts: any[];
320
+ }>;
321
+ /** Collects an order opened earlier (its roll arrived after the app stopped waiting). */
322
+ collect: (orderAddress: any, options?: {}) => Promise<{
323
+ order: any;
324
+ settled: string;
325
+ says: string;
326
+ } | {
327
+ order: any;
328
+ settled: null;
329
+ says: string;
330
+ } | {
331
+ says?: undefined;
332
+ order: any;
333
+ won: any;
334
+ assets: any;
335
+ settled: any;
336
+ parts?: any[] | undefined;
337
+ asset?: any;
338
+ }>;
339
+ /**
340
+ * Finds the settle keys a page that closed left holding the player's SOL, and finishes their jobs: a key whose order
341
+ * has rolled settles it (no prompt); one whose order is gone, failed or due its refund sends its SOL back; one whose
342
+ * order still waits for its roll keeps it for later. Each key is made again from the wallet's signature (asked once
343
+ * a session, `walletStandardSigner`'s `signMessage`), or read from the page's storage (`keyStore`) when the wallet
344
+ * signs no messages. Returns [{ name, key, settled } | { name, key, swept } | { name, key, waiting }].
345
+ */
346
+ recover(): Promise<({
347
+ name: null;
348
+ key: string;
349
+ error: any;
350
+ waiting?: undefined;
351
+ swept?: undefined;
352
+ } | {
353
+ name: null;
354
+ key: string;
355
+ settled: any;
356
+ won: any;
357
+ waiting?: undefined;
358
+ swept?: undefined;
359
+ } | {
360
+ name: null;
361
+ key: string;
362
+ waiting: any;
363
+ swept?: undefined;
364
+ } | {
365
+ waiting?: undefined;
366
+ name: null;
367
+ key: string;
368
+ swept: bigint;
369
+ })[]>;
370
+ /** Gives an order's payment back once its time has come (a roll that failed or never came). */
371
+ refund(orderAddress: any): Promise<any>;
372
+ /** Asks the oracle for a roll a mission, a recipe or a prize made (anyone may; the asker pays the oracle). On a box
373
+ * with nothing in stock only the order's player may ask, a slot after it was made or last asked, and that ends the
374
+ * roll there with nothing, no oracle (a lot its winner paid for fails, for its refund). */
375
+ askRoll: (orderAddress: any) => Promise<any>;
376
+ /**
377
+ * Pays a payment of the economy (an entry, an attempt, a tip). `amount`: what the player chose, in whole units, for
378
+ * a payment with `any` (at least its `amount`). `chosenRecipient`: the wallet the player names for a share the
379
+ * payment lets them choose (a referrer), never their own. `holders`: asset → holder, for a holder's share (read
380
+ * now when not given).
381
+ */
382
+ pay(paymentKey: any, { amount: chosen, holders, chosenRecipient, ...others }?: Readonly<Record<string, any>>): Promise<any>;
383
+ /**
384
+ * Pays with one of the player's NFTs, any kind (`pay_nft`): burned (`to` null), or given to the wallet `to` (the
385
+ * treasury, a partner), straight from the player. The receipt (`PaidNft`) is the record an app admits the player
386
+ * by, with `reference` (32 bytes, or text the client hashes). Returns the signature.
387
+ */
388
+ payNft(asset: any, { to, reference, ...others }?: Readonly<Record<string, any>>): Promise<any>;
389
+ /**
390
+ * The lotteries: each one's ticket price now, its round and status, and its terms (`incarnation`, `revision`),
391
+ * which `buyTickets` takes as the terms the player was shown. A lottery not written yet (a raffle still to open)
392
+ * has a null price.
393
+ */
394
+ lotteries(): Promise<{
395
+ key: any;
396
+ name: any;
397
+ price: string | null;
398
+ priceUnits: any;
399
+ currency: any;
400
+ status: any;
401
+ round: any;
402
+ sold: any;
403
+ drawsAt: number | null;
404
+ nftTicket: boolean;
405
+ incarnation: any;
406
+ revision: any;
407
+ }[]>;
408
+ /**
409
+ * Buys `count` tickets of a lottery, on the terms the player was shown: `listing`, the lottery as `lotteries()`
410
+ * showed it (a lottery changed since, its price or anything else, is refused rather than paid), or `maxPrice`, the
411
+ * most a ticket may cost, in base units. One of them is required: the price read now is never the bound.
412
+ * `chosenRecipient`: the wallet (or collectible) the player names for a share the lottery lets them choose (a
413
+ * referrer). A lottery whose ticket costs an NFT (`nft_ticket`) sells one ticket for one of the player's NFTs that
414
+ * passes its rule: `nft`, its address (held by the project until the draw, then burned, given on or stashed; back to
415
+ * the player if the round is cancelled). `listProof`: for a list gate.
416
+ */
417
+ buyTickets(lotteryKey: any, count?: number, { shown, chosenRecipient, listProof, nft: paidWith, listing, maxPrice, ...others }?: Readonly<Record<string, any>>): Promise<any>;
418
+ /**
419
+ * Writes an NFT's traits from the project's traits tree (`traits` in the spec) into its Sheet, where rules read them:
420
+ * anyone may, paying the Sheet's rent. `attributes` ([{ key, value }]) and `proof` come from the project's tree
421
+ * (`loot.traitsTree`); `key` names the tree (a collection's address), the spec's first when left out. Traits the
422
+ * Sheet already has are left as they are.
423
+ */
424
+ proveTraits(nft: any, attributes: any, proof: any, key?: any): Promise<any>;
425
+ /**
426
+ * Stakes `amount` (whole units) of a farm's token at lock tier `tier`. A farm with an end takes no stake at its end
427
+ * or after it, nor one whose lock would run past it: refused here, before the wallet signs.
428
+ */
429
+ stake(farmKey: any, amount: any, tier?: number, { shown, extra, transfers, ...others }?: Readonly<Record<string, any>>): Promise<any>;
430
+ /**
431
+ * Takes `amount` out once its lock has run (0: only rewards); `forfeit` gives up rewards that cannot move. Before the
432
+ * lock, a tier with an early exit lets it leave for its fee, keeping what the seat was credited.
433
+ */
434
+ unstake(farmKey: any, amount?: number, { forfeit, extra, transfers, ...others }?: Readonly<Record<string, any>>): Promise<any>;
435
+ /**
436
+ * Stakes one of the player's NFTs in a farm (its own seat, or as the booster of their token seat), of any kind: a
437
+ * Core asset, a Token Metadata NFT's mint (legacy or pNFT), or a compressed NFT's asset id. In a farm that watches,
438
+ * an NFT whose last staker sold it takes their seat over. A farm with an end takes none at its end or after it.
439
+ */
440
+ stakeNft(farmKey: any, asset: any, tier?: number, { extra, transfers, ...others }?: Readonly<Record<string, any>>): Promise<any>;
441
+ /**
442
+ * Releases the collectible after its lock: it grows on its way out (a farm with `growth`), and from its own seat
443
+ * takes its tier's prize (a mission: `prize.rs`). `forfeit` gives up rewards, and the prize, that cannot move.
444
+ * Returns the signature, or { signature, roll } when it makes a roll (a mission's result on the NFT, or a chest),
445
+ * which `collect` then finishes.
446
+ */
447
+ unstakeNft(farmKey: any, asset: any, { forfeit, extra, transfers, ...others }?: Readonly<Record<string, any>>): Promise<any>;
448
+ /**
449
+ * What farm `farmKey` has to walk: `{ ends, needsWalk, parts }`, the times its seats stop earning it has passed and not
450
+ * yet credited up to, whether a move can no longer do them in its own transaction, and how many transactions
451
+ * `walkFarm` would take. Every move walks them first; nothing is lost however long they wait.
452
+ */
453
+ farmWalk(farmKey: any): Promise<{
454
+ ends: any;
455
+ needsWalk: boolean;
456
+ parts: number;
457
+ }>;
458
+ /**
459
+ * Walks a farm up to now in parts (`walk_farm`), for one that has passed more ends than a move can walk: one transaction
460
+ * for every `loot.WALK_PER_TX` ends, oldest first. Anyone may send it, and it costs only the network fee. Returns their
461
+ * signatures, none when there is nothing to walk.
462
+ */
463
+ walkFarm(farmKey: any, { perTx, ...others }?: Readonly<Record<string, any>>): Promise<any[]>;
464
+ /**
465
+ * Writes what a staked collectible has grown (a farm with `growth`: its points and level, on it or in its Sheet)
466
+ * and reads its boosts again. Anyone may send it; the player pays for what the write adds. `by`: the collectible,
467
+ * or the player for their token seat's booster.
468
+ */
469
+ refresh(farmKey: any, by: any, { extra, ...others }?: Readonly<Record<string, any>>): Promise<any>;
470
+ /**
471
+ * Collects what a seat owes (the player's own, or one of their collectibles' seats). In a farm that watches, it
472
+ * shows the seat's NFT is still theirs: the Core asset, or their token account of a Token Metadata NFT.
473
+ */
474
+ harvest(farmKey: any, by?: any, { compound, extra, transfers, ...others }?: Readonly<Record<string, any>>): Promise<any>;
475
+ /**
476
+ * Adds what a token seat is owed to its stake, without restarting its lock (a farm of tokens whose rewards are the
477
+ * staked token).
478
+ */
479
+ compound(farmKey: any, opts?: {}): Promise<any>;
480
+ /**
481
+ * The player's seats in a farm (the wallet's, or `player`'s): each one's NFT (`asset`, null for a token seat with
482
+ * no booster), what it holds staked (`amount`, in whole units of the staked token, a number for display that can
483
+ * round past 2^53 base units; `amountUnits`, in base units exactly, a bigint; 1 for an NFT), its tier, when it
484
+ * came in (`since`) and when its lock is over (`freeAt`, unix seconds; null when the NFT says it, `lockKey`), its
485
+ * boost in percent, until when it earns (`earnsUntil`, unix seconds, null for no end: a tier's term, an upkeep), and
486
+ * what it is owed now: `waiting` (whole units of the rewards, `rewards` their token) and `owedUnits` (base units). What it is owed is the program's own sum, from a refresh of the seat dry-run on the
487
+ * network (nothing is signed or sent): what the farm released or its rate paid since its last move is in it, by the
488
+ * farm's rounding. When the dry run fails, it is what the seat was last credited, and `counted` is false.
489
+ * One search of the chain, and one dry run per seat: read it when the page opens and after a stake or a harvest.
490
+ */
491
+ staked(farmKey: any, player?: any): Promise<{
492
+ asset: any;
493
+ amount: number;
494
+ amountUnits: bigint;
495
+ tier: any;
496
+ since: number;
497
+ freeAt: number | null;
498
+ lockKey?: any;
499
+ boostPercent: number;
500
+ rewards: any;
501
+ waiting: string;
502
+ owedUnits: bigint;
503
+ earnsUntil: number | null;
504
+ counted: boolean;
505
+ }[]>;
506
+ /** The recipes: whether each is on, and its version now (what `craft` takes as the terms the player was shown). */
507
+ recipes(): Promise<any>;
508
+ /**
509
+ * Crafts a recipe, handing in `assets` (the collectibles it burns or uses, in the recipe's order). `version`: the
510
+ * recipe's version the page showed the player (`recipes()`, or the listing itself as `listing`), so a recipe the
511
+ * owner changed since is refused rather than crafted on terms the player never saw. It is required: the version
512
+ * read now is never signed in its place. `extra`: the tail a Core collection's plugins need when the craft moves or
513
+ * rolls on a Core NFT (sent after the Memo program's account, as on every other Core move).
514
+ */
515
+ craft(recipeKey: any, assets?: any[], times?: number, { version, listing, extra, ...others }?: Readonly<Record<string, any>>): Promise<{
516
+ signature: any;
517
+ made: any;
518
+ roll?: any;
519
+ rolled?: {
520
+ order: any;
521
+ settled: string;
522
+ says: string;
523
+ } | {
524
+ order: any;
525
+ settled: null;
526
+ says: string;
527
+ } | {
528
+ says?: undefined;
529
+ order: any;
530
+ won: any;
531
+ assets: any;
532
+ settled: any;
533
+ parts?: any[] | undefined;
534
+ asset?: any;
535
+ } | undefined;
536
+ }>;
537
+ /**
538
+ * Hands an NFT of any kind to the project until a time (a hold): `seconds` from now, or `{ until }` (Unix seconds).
539
+ * The hold's address names its end. Returns { signature, freeAt }.
540
+ */
541
+ hold(asset: any, seconds: any): Promise<{
542
+ signature: any;
543
+ freeAt: bigint;
544
+ }>;
545
+ /**
546
+ * A lender's offer to borrow against: `maker`'s offer number `id` in this project. Returns { address, offer, mint,
547
+ * amount, repay, lasts, risks }: `risks`, in words, each power over the loan's token that could make repaying fail
548
+ * (its freeze authority, a Token-2022 pause, a transfer hook, a permanent delegate) and who holds it. The program
549
+ * takes such tokens, and a lender who holds one can stop every repayment and take the NFT once it is due: show the
550
+ * risks before the player borrows.
551
+ */
552
+ loanOffer(maker: any, id: any): Promise<{
553
+ address: any;
554
+ offer: any;
555
+ mint: any;
556
+ program: any;
557
+ amount: any;
558
+ repay: any;
559
+ lasts: any;
560
+ risks: any[];
561
+ }>;
562
+ /**
563
+ * Borrows against the player's NFT `asset` from `maker`'s offer `id`: the NFT is held until the loan is repaid, or
564
+ * goes to the lender once it is due (`due`, Unix seconds; by default the longest the offer allows, less a minute).
565
+ * A loan whose token someone could freeze, pause, hook or move (`loanOffer`'s `risks`) is refused unless
566
+ * `acceptRisks` is true: the page shows the player who holds that power first. `extra`: a transfer hook's accounts.
567
+ */
568
+ borrow(maker: any, id: any, asset: any, { due, acceptRisks, extra, ...others }?: Readonly<Record<string, any>>): Promise<{
569
+ signature: any;
570
+ due: any;
571
+ hold: any;
572
+ }>;
573
+ /**
574
+ * The loan on `asset` (held until `due`), as a page shows it before anyone repays: { lender, mint, repay (base units),
575
+ * due, paid }. `repay` is what `repay` then takes as the amount shown. Null when it holds no loan.
576
+ */
577
+ loan(asset: any, due: any): Promise<{
578
+ lender: any;
579
+ mint: any;
580
+ repay: bigint;
581
+ due: number;
582
+ borrower: any;
583
+ } | null>;
584
+ /**
585
+ * Repays the loan on `asset` (held until `due`), the player's own or a friend's, then sends the NFT home to its
586
+ * borrower. `repay`: the debt the payer was shown (`loan()`'s, in base units); the program refuses any other
587
+ * (`TermsChanged`). The repay goes in the wallet's transaction alone, with what it opens (the borrower's Token
588
+ * Metadata account), so a release that fails never undoes a repay that must land before the loan is due; the same
589
+ * transaction funds a throwaway key that sends the release (anyone may), a pNFT's or a compressed NFT's too: the key
590
+ * is funded for what that release opens (a pNFT's token account and record, a compressed NFT's proof record, which
591
+ * comes back in the same transaction). Returns { signature, released }.
592
+ */
593
+ repay(asset: any, due: any, { repay, extra, ...others }?: Readonly<Record<string, any>>): Promise<{
594
+ signature: any;
595
+ released: any;
596
+ }>;
597
+ /**
598
+ * Backs `side` of contest number `id` (the authority opens contests while the project runs) with `amount`; a contest
599
+ * of NFTs takes one of the player's NFTs that passes its rule instead (`nft`, its address), held until it is
600
+ * claimed. `listProof`: for a list gate.
601
+ */
602
+ enter(id: any, side: any, amount: any, { shown, listProof, nft: staked, ...others }?: Readonly<Record<string, any>>): Promise<any>;
603
+ /**
604
+ * The auctions: each one's lot, high bid, the least the next bid must be, when it ends and how long is left, and
605
+ * whether the player leads. One no longer on chain has ended. `waiting`: SOL that came back to the player's
606
+ * wrapped-SOL account from a bid that was topped (`unwrap` turns it into plain SOL).
607
+ */
608
+ auctions(): Promise<any>;
609
+ /**
610
+ * Bids `amount` (whole units) on an auction. The bid it tops goes back to its bidder in the same transaction
611
+ * (the program opens their account again if they closed it, paid by this bidder). In SOL, only what the player's
612
+ * wrapped-SOL account does not hold already is wrapped, and the account stays open: if this bid is topped, it comes
613
+ * back there.
614
+ */
615
+ bid(auctionKey: any, amount: any, { shown, listProof, nfts, ...others }?: Readonly<Record<string, any>>): Promise<any>;
616
+ /**
617
+ * Ends an auction that is over (anyone can; the winner usually does): the lot to the highest bidder, a new
618
+ * collectible minted for them at the address its item and serial name, however long after the end it is sent. A
619
+ * roll lot makes the winner's roll of its box (`order`), which `collect` asks for and settles. An end too big for one
620
+ * transaction makes each NFT a hold and sends each home with a release after it (`releases`).
621
+ */
622
+ endAuction(auctionKey: any, { holders, ...others }?: Readonly<Record<string, any>>): Promise<{
623
+ signature: any;
624
+ owedPaid: any;
625
+ } | {
626
+ owedPaid?: undefined;
627
+ signature: any;
628
+ releases: any[];
629
+ winner?: any;
630
+ } | {
631
+ owedPaid?: undefined;
632
+ signature: any;
633
+ winner?: any;
634
+ asset?: any;
635
+ order?: any;
636
+ rolled?: {
637
+ order: any;
638
+ settled: string;
639
+ says: string;
640
+ } | {
641
+ order: any;
642
+ settled: null;
643
+ says: string;
644
+ } | {
645
+ says?: undefined;
646
+ order: any;
647
+ won: any;
648
+ assets: any;
649
+ settled: any;
650
+ parts?: any[] | undefined;
651
+ asset?: any;
652
+ } | undefined;
653
+ }>;
654
+ /**
655
+ * Runs a schedule that is due (an emission into a pool, a rent or a drip): the project's owner or authority, or who it
656
+ * pays, may (a sealed burn: anyone), and nothing is paid to whoever sends it but the network fee. A run missed is missed:
657
+ * this pays once, for the latest run due, and the runs before it lapse; only a sealed fixed amount pays every run due. `holders`: asset → holder, for a schedule that pays a collectible's holder.
658
+ * Returns null when it isn't due yet.
659
+ */
660
+ runSchedule(scheduleKey: any, { holders, most, ...others }?: Readonly<Record<string, any>>): Promise<any>;
661
+ /**
662
+ * Lists one of the player's NFTs (any kind) for sale at `price` (whole units of `currency`, the economy's by
663
+ * default), `shares` taken first (a royalty, a platform's cut). The project holds it until it sells or is unlisted.
664
+ */
665
+ listForSale(asset: any, { price, currency, shares, ...others }?: Readonly<Record<string, any>>): Promise<any>;
666
+ /**
667
+ * Lists one of the player's NFTs for rent: `price` (whole units) a period of `lasts` seconds, a renter taking 1 to
668
+ * `maxPeriods` at once. Nobody can end a rental early; the next renter takes it once one is over, until it is unlisted.
669
+ */
670
+ listForRent(asset: any, { price, lasts, maxPeriods, currency, shares, ...others }?: Readonly<Record<string, any>>): Promise<any>;
671
+ /** The listing of `asset` (one account read), or null: { listing, asset, maker, mint, deal, renter, until }. */
672
+ listing(asset: any): Promise<any>;
673
+ /** Who rents `asset` now (one account read, then a check that the project still holds it), or null. */
674
+ rentedTo(asset: any): Promise<any>;
675
+ /** The project's listings, a maker's (`maker`) or all: one search of the program's accounts. */
676
+ listings({ maker, ...others }?: Readonly<Record<string, any>>): Promise<any>;
677
+ /**
678
+ * Buys a listed NFT at the terms the player saw: `listing`, as `listing()` or `listings()` showed it. It is
679
+ * required: the terms signed are those, never the listing read now, so a price or a share changed since is refused.
680
+ */
681
+ buyListing(asset: any, { listing, ...others }?: Readonly<Record<string, any>>): Promise<any>;
682
+ /**
683
+ * Rents a listed NFT for `periods` periods, at the terms the player saw: `listing`, as `listing()` or `listings()`
684
+ * showed it (required, as for `buyListing`).
685
+ */
686
+ rentListing(asset: any, { periods, listing, ...others }?: Readonly<Record<string, any>>): Promise<any>;
687
+ /** Takes a listed NFT home (its maker). While a rental runs it only stops the listing; call again once it is over. */
688
+ unlist(asset: any): Promise<any>;
689
+ /**
690
+ * The project's owner raffles an NFT they hold, as lottery `id`: the NFT goes into the lottery's own stash, where
691
+ * nothing but the lottery can take it while a place names it; the winner gets it before any ticket money moves.
692
+ * `price` (whole units of `currency`) a ticket, `drawsAt` (Unix seconds) its one draw, `minSold` the least tickets
693
+ * (fewer: the round is cancelled and refunded), `shares` where the ticket money goes (the seller's own wallet by
694
+ * default: the treasury). A seller runs it in a project of their own, whose owner they are.
695
+ */
696
+ raffle(id: any, nft: any, { price, currency, drawsAt, minSold, perWallet, shares, ...others }?: Readonly<Record<string, any>>): Promise<any>;
697
+ /** The raffle's owner takes the NFT back out of lottery `id`'s own stash once nothing promises it (the lottery ended, or no place names it). */
698
+ unraffle(id: any, nft: any): Promise<any>;
699
+ /** Turns what waits in the player's wrapped-SOL account (a bid that was topped) into plain SOL. */
700
+ unwrap(): Promise<any>;
701
+ /**
702
+ * Claims a grant for the connected wallet: from the approved list (the proof comes from xsolana.json, or is given:
703
+ * `proof`, `personHash` and the `round` the list pays, as a results server's list answers them), or with a voucher
704
+ * a server signed ({ publicKey, signature, incarnation, round and amount, or rounds: [{ id, amount }], expires, personHash }). A list in xsolana.json names
705
+ * no round (zeros). `amount` (a voucher's, or `options.amount` for a list's leaf): the tokens this claim gives, in
706
+ * base units, up to the grant's own, for a grant of a fixed amount of tokens (a reward by rank); absent or 0 gives
707
+ * the grant's prize as it is. A grant that gives a roll of a box makes the wallet's roll, which `claims()` then
708
+ * lists and `collect` asks for and settles.
709
+ */
710
+ claimGrant(grantKey: any, options?: {}): Promise<any>;
711
+ /**
712
+ * Takes every prize a results server vouched for this wallet's wins, or put on a list (`server`: its URL;
713
+ * a results server), page by page. Each pays only this wallet, within the grant's limits. Returns [{ round, grant,
714
+ * signature }] for each claim made, and [{ round, grant, error }] for one that failed, without stopping the rest;
715
+ * wins already claimed are skipped (the program pays a wallet each round once per grant incarnation).
716
+ *
717
+ * `token`: the player's play-host sign-in for this game. A drop that gives NFTs from a stash gives one only at a
718
+ * signed-in claim, first come first served (the server answers `R-SIGN-IN` to a voucher request with no sign-in, so
719
+ * a stranger can't hand them out): with the token such a win is claimed through `POST /v1/claims`; without it, it is
720
+ * [{ round, grant, error }].
721
+ */
722
+ claimWins({ server, token, fetchImpl, ...others }?: Readonly<Record<string, any>>): Promise<{
723
+ round: any;
724
+ grant: any;
725
+ error: any;
726
+ }[]>;
727
+ /**
728
+ * What this player can finish now, themselves: a box to settle or refund, a contest entry to claim, a held
729
+ * collectible to take home, an auction they won (or one off by the clock: their bid back), a lottery place they
730
+ * won, a draw that is due (anyone may reveal it, or ask again when the oracle never answered; it takes 0.0008
731
+ * SOL), and a drawn lottery's unpaid places, which anyone may pay so the next round can open. [{ kind, says, … }];
732
+ * pass one to `claim`.
733
+ */
734
+ claims(): Promise<({
735
+ key?: undefined;
736
+ tree?: undefined;
737
+ kind: string;
738
+ order: any;
739
+ says: string;
740
+ id?: undefined;
741
+ side?: undefined;
742
+ hold?: undefined;
743
+ round?: undefined;
744
+ pulls?: undefined;
745
+ asset?: undefined;
746
+ table?: undefined;
747
+ } | {
748
+ key?: undefined;
749
+ tree?: undefined;
750
+ order?: undefined;
751
+ kind: string;
752
+ id: any;
753
+ side: any;
754
+ says: string;
755
+ hold?: undefined;
756
+ round?: undefined;
757
+ pulls?: undefined;
758
+ asset?: undefined;
759
+ table?: undefined;
760
+ } | {
761
+ key?: undefined;
762
+ tree?: undefined;
763
+ order?: undefined;
764
+ id?: undefined;
765
+ side?: undefined;
766
+ kind: string;
767
+ asset: any;
768
+ hold: any;
769
+ says: string;
770
+ round?: undefined;
771
+ pulls?: undefined;
772
+ table?: undefined;
773
+ } | {
774
+ key?: undefined;
775
+ order?: undefined;
776
+ id?: undefined;
777
+ side?: undefined;
778
+ hold?: undefined;
779
+ kind: string;
780
+ asset: string;
781
+ tree: string;
782
+ says: string;
783
+ round?: undefined;
784
+ pulls?: undefined;
785
+ table?: undefined;
786
+ } | {
787
+ tree?: undefined;
788
+ order?: undefined;
789
+ id?: undefined;
790
+ side?: undefined;
791
+ hold?: undefined;
792
+ kind: string;
793
+ key: any;
794
+ says: string;
795
+ round?: undefined;
796
+ pulls?: undefined;
797
+ asset?: undefined;
798
+ table?: undefined;
799
+ } | {
800
+ tree?: undefined;
801
+ order?: undefined;
802
+ id?: undefined;
803
+ side?: undefined;
804
+ hold?: undefined;
805
+ kind: string;
806
+ key: any;
807
+ round: any;
808
+ says: string;
809
+ pulls?: undefined;
810
+ asset?: undefined;
811
+ table?: undefined;
812
+ } | {
813
+ tree?: undefined;
814
+ order?: undefined;
815
+ id?: undefined;
816
+ side?: undefined;
817
+ hold?: undefined;
818
+ kind: string;
819
+ key: any;
820
+ round: any;
821
+ pulls: any;
822
+ says: string;
823
+ asset?: undefined;
824
+ table?: undefined;
825
+ } | {
826
+ key?: undefined;
827
+ tree?: undefined;
828
+ order?: undefined;
829
+ id?: undefined;
830
+ side?: undefined;
831
+ hold?: undefined;
832
+ round?: undefined;
833
+ pulls?: undefined;
834
+ kind: string;
835
+ asset: any;
836
+ says: string;
837
+ table?: undefined;
838
+ } | {
839
+ key?: undefined;
840
+ tree?: undefined;
841
+ order?: undefined;
842
+ id?: undefined;
843
+ side?: undefined;
844
+ hold?: undefined;
845
+ round?: undefined;
846
+ pulls?: undefined;
847
+ asset?: undefined;
848
+ kind: string;
849
+ table: any;
850
+ says: string;
851
+ })[]>;
852
+ /**
853
+ * Finishes one of `claims()`, signed by this player. Returns the signature. A winner of a contest of NFTs picks
854
+ * which loser's NFT they take (`{ take: asset }`, the NFT of a losing entry that still holds one; the first found by default):
855
+ * only the winner can, while any are left.
856
+ */
857
+ claim(c: any, { take, build, ...others }?: Readonly<Record<string, any>>): Promise<any>;
858
+ /**
859
+ * Everything in `list` (by default `claims()`) taken in as few prompts as it can: each step that is one transaction
860
+ * of the wallet's is built first and the lot signed in one prompt when the wallet signs several at once
861
+ * (`wallet.signTransactions`); a lottery's steps depend on each other, so one of each lottery a call. The rest (a roll
862
+ * to settle, a refund, an auction to end…) go one by one after. Returns [{ claim, signature } | { claim, error }].
863
+ */
864
+ claimAll(list: any): Promise<any[]>;
865
+ /** The player's collectibles of this project: [{ asset, item, itemId, name, uri, attributes, frozen }]. `item` is its key in the spec. */
866
+ collectibles: (owner?: any) => Promise<{
867
+ owner: string;
868
+ collection: string | null;
869
+ name: string;
870
+ uri: string;
871
+ attributes: {};
872
+ frozen: boolean;
873
+ soulbound: boolean;
874
+ asset: any;
875
+ itemId: number | null;
876
+ item: any;
877
+ }[]>;
878
+ /** What the player holds of each of the economy's tokens, in whole units. */
879
+ balances(owner?: any): Promise<{}>;
880
+ };