@xgamesfun/solana 0.20.1 → 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 (70) hide show
  1. package/README.md +10 -10
  2. package/examples/coin-flip-arena.json +2 -7
  3. package/examples/elements-set.json +2 -9
  4. package/examples/expedition-guild.json +1 -8
  5. package/examples/guild-missions.json +3 -10
  6. package/examples/halving-seasons.json +4 -9
  7. package/examples/hero-trials.json +1 -4
  8. package/examples/merge-2048.json +5 -5
  9. package/examples/paper-hands-farm.json +4 -16
  10. package/examples/partner-vault.json +1 -4
  11. package/examples/stakers-draw.json +1 -8
  12. package/examples/star-fleet.json +1 -8
  13. package/examples/starforce.json +6 -6
  14. package/js/approve/details.mjs +8 -7
  15. package/js/approve/server.mjs +20 -5
  16. package/js/chain/borsh.js +9 -0
  17. package/js/chain/core.js +14 -2
  18. package/js/chain/lookup.js +8 -2
  19. package/js/chain/rpc.js +4 -2
  20. package/js/client/accounts.js +448 -116
  21. package/js/client/grant.js +125 -66
  22. package/js/client/idl/loot.js +1 -1
  23. package/js/client/idl/loot.json +2360 -2218
  24. package/js/client/index.js +1 -0
  25. package/js/client/ix.js +1204 -473
  26. package/js/client/pda.js +20 -16
  27. package/js/client/policy.js +44 -23
  28. package/js/client/random.js +70 -0
  29. package/js/client/sizes.js +255 -12
  30. package/js/economy/check.mjs +455 -210
  31. package/js/economy/cost.mjs +45 -30
  32. package/js/economy/examples.mjs +2 -2
  33. package/js/economy/explain.mjs +24 -20
  34. package/js/economy/guide.mjs +31 -30
  35. package/js/economy/live.mjs +30 -7
  36. package/js/economy/model.mjs +171 -56
  37. package/js/economy/plan.mjs +380 -112
  38. package/js/economy/schema.json +291 -143
  39. package/js/economy/simulate.mjs +154 -87
  40. package/js/mcp/tools.mjs +14 -8
  41. package/js/play/index.js +1121 -375
  42. package/js/play/keys.js +167 -0
  43. package/package.json +1 -1
  44. package/release.json +5 -5
  45. package/skills/xsolana-economy/SKILL.md +15 -11
  46. package/skills/xsolana-economy/references/after-launch.md +37 -27
  47. package/skills/xsolana-economy/references/apps.md +55 -19
  48. package/skills/xsolana-economy/references/sentence-to-spec.md +30 -22
  49. package/skills/xsolana-economy/references/telling-the-person.md +52 -11
  50. package/types/chain/core.d.ts +3 -1
  51. package/types/chain/lookup.d.ts +5 -2
  52. package/types/chain/rpc.d.ts +3 -1
  53. package/types/client/accounts.d.ts +195 -55
  54. package/types/client/grant.d.ts +72 -27
  55. package/types/client/idl/loot.d.ts +590 -559
  56. package/types/client/index.d.ts +1 -0
  57. package/types/client/ix.d.ts +3862 -234
  58. package/types/client/pda.d.ts +19 -15
  59. package/types/client/policy.d.ts +39 -14
  60. package/types/client/random.d.ts +26 -0
  61. package/types/client/sizes.d.ts +93 -5
  62. package/types/economy/check.d.mts +5 -10
  63. package/types/economy/cost.d.mts +2 -1
  64. package/types/economy/live.d.mts +16 -1
  65. package/types/economy/model.d.mts +105 -37
  66. package/types/economy/plan.d.mts +193 -192
  67. package/types/economy/simulate.d.mts +21 -13
  68. package/types/mcp/tools.d.mts +21 -13
  69. package/types/play/index.d.ts +450 -39
  70. package/types/play/keys.d.ts +51 -0
@@ -1,7 +1,12 @@
1
- /** A signer from a Wallet Standard wallet and one of its accounts: the wallet signs, the app sends. */
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
+ */
2
6
  export declare function walletStandardSigner(wallet: any, account: any, chain?: string): {
3
7
  address: any;
4
8
  signTransaction(wire: any): Promise<any>;
9
+ signMessage?: ((message: any) => Promise<any>) | undefined;
5
10
  };
6
11
  /**
7
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,9 +18,18 @@ export declare const units: (amount: any, decimals: any) => bigint;
13
18
  * The player's side of a live economy. `rpc` may be given instead of `rpcUrl` (any object with the client's rpc
14
19
  * methods: accounts, account, latestBlockhash, send, confirm, programAccounts, and call(method, params), the raw JSON
15
20
  * RPC request the devnet check, the slot and the compressed-NFT reads go through). `now` is the clock auctions are read
16
- * by (Unix seconds). Devnet only (`devnetOnly`): mainnet waits for an audit.
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).
17
24
  */
18
- export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }: {
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;
19
33
  now?: (() => number) | undefined;
20
34
  programs?: {} | undefined;
21
35
  rpc?: null | undefined;
@@ -27,7 +41,8 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
27
41
  readonly address: any;
28
42
  /** The shop: every item with a price (or free), its price now and what is left. */
29
43
  shop(): Promise<any>;
30
- /** The boxes: price now and each outcome's chance. */
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). */
31
46
  boxes(): Promise<any>;
32
47
  /**
33
48
  * Buys a shop item, in one transaction (`buy`: the price split and the item given at once). A listing that rolls
@@ -48,15 +63,128 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
48
63
  won: any;
49
64
  assets: any;
50
65
  settled: any;
66
+ parts?: any[] | undefined;
51
67
  asset?: any;
52
68
  } | {
53
69
  signature: any;
54
- assets: any;
70
+ assets: any[];
55
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[];
56
183
  }>;
57
184
  /**
58
185
  * Opens a box (shows a collectible for its gate or odds when given): a box that needs no roll is bought at once
59
- * (`buy`); one that rolls waits for the roll and collects it.
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).
60
188
  */
61
189
  openBox(boxKey: any, options?: {}): Promise<{
62
190
  order: any;
@@ -72,11 +200,123 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
72
200
  won: any;
73
201
  assets: any;
74
202
  settled: any;
203
+ parts?: any[] | undefined;
75
204
  asset?: any;
76
205
  } | {
77
206
  signature: any;
78
- assets: any;
207
+ assets: any[];
79
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[];
80
320
  }>;
81
321
  /** Collects an order opened earlier (its roll arrived after the app stopped waiting). */
82
322
  collect: (orderAddress: any, options?: {}) => Promise<{
@@ -93,11 +333,45 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
93
333
  won: any;
94
334
  assets: any;
95
335
  settled: any;
336
+ parts?: any[] | undefined;
96
337
  asset?: any;
97
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
+ })[]>;
98
370
  /** Gives an order's payment back once its time has come (a roll that failed or never came). */
99
371
  refund(orderAddress: any): Promise<any>;
100
- /** Asks the oracle for a roll a mission, a recipe or a prize made (anyone may; the asker pays the oracle). */
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). */
101
375
  askRoll: (orderAddress: any) => Promise<any>;
102
376
  /**
103
377
  * Pays a payment of the economy (an entry, an attempt, a tip). `amount`: what the player chose, in whole units, for
@@ -117,7 +391,20 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
117
391
  * which `buyTickets` takes as the terms the player was shown. A lottery not written yet (a raffle still to open)
118
392
  * has a null price.
119
393
  */
120
- lotteries(): Promise<any>;
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
+ }[]>;
121
408
  /**
122
409
  * Buys `count` tickets of a lottery, on the terms the player was shown: `listing`, the lottery as `lotteries()`
123
410
  * showed it (a lottery changed since, its price or anything else, is refused rather than paid), or `maxPrice`, the
@@ -142,8 +429,7 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
142
429
  stake(farmKey: any, amount: any, tier?: number, { shown, extra, transfers, ...others }?: Readonly<Record<string, any>>): Promise<any>;
143
430
  /**
144
431
  * Takes `amount` out once its lock has run (0: only rewards); `forfeit` gives up rewards that cannot move. Before the
145
- * lock, a tier with an early exit lets it leave for its fee, and gives up what the seat is owed; in a farm that
146
- * unbonds, what is taken out waits first (`withdraw` takes it out once free).
432
+ * lock, a tier with an early exit lets it leave for its fee, keeping what the seat was credited.
147
433
  */
148
434
  unstake(farmKey: any, amount?: number, { forfeit, extra, transfers, ...others }?: Readonly<Record<string, any>>): Promise<any>;
149
435
  /**
@@ -159,12 +445,28 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
159
445
  * which `collect` then finishes.
160
446
  */
161
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[]>;
162
464
  /**
163
465
  * Writes what a staked collectible has grown (a farm with `growth`: its points and level, on it or in its Sheet)
164
466
  * and reads its boosts again. Anyone may send it; the player pays for what the write adds. `by`: the collectible,
165
467
  * or the player for their token seat's booster.
166
468
  */
167
- refresh(farmKey: any, by: any, { extra, transfers, ...others }?: Readonly<Record<string, any>>): Promise<any>;
469
+ refresh(farmKey: any, by: any, { extra, ...others }?: Readonly<Record<string, any>>): Promise<any>;
168
470
  /**
169
471
  * Collects what a seat owes (the player's own, or one of their collectibles' seats). In a farm that watches, it
170
472
  * shows the seat's NFT is still theirs: the Core asset, or their token account of a Token Metadata NFT.
@@ -172,18 +474,16 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
172
474
  harvest(farmKey: any, by?: any, { compound, extra, transfers, ...others }?: Readonly<Record<string, any>>): Promise<any>;
173
475
  /**
174
476
  * Adds what a token seat is owed to its stake, without restarting its lock (a farm of tokens whose rewards are the
175
- * staked token). The farm's toll, if any, is taken first.
477
+ * staked token).
176
478
  */
177
479
  compound(farmKey: any, opts?: {}): Promise<any>;
178
- /** Takes out the tokens whose unbonding wait is over (a farm with `unbond`), and what the seat is owed. */
179
- withdraw(farmKey: any, opts?: {}): Promise<any>;
180
480
  /**
181
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
182
482
  * no booster), what it holds staked (`amount`, in whole units of the staked token, a number for display that can
183
483
  * round past 2^53 base units; `amountUnits`, in base units exactly, a bigint; 1 for an NFT), its tier, when it
184
484
  * came in (`since`) and when its lock is over (`freeAt`, unix seconds; null when the NFT says it, `lockKey`), its
185
- * boost in percent, and what it is owed now: `waiting` (whole units of the rewards, `rewards` their token) and
186
- * `owedUnits` (base units). What it is owed is the program's own sum, from a refresh of the seat dry-run on the
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
187
487
  * network (nothing is signed or sent): what the farm released or its rate paid since its last move is in it, by the
188
488
  * farm's rounding. When the dry run fails, it is what the seat was last credited, and `counted` is false.
189
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.
@@ -200,6 +500,7 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
200
500
  rewards: any;
201
501
  waiting: string;
202
502
  owedUnits: bigint;
503
+ earnsUntil: number | null;
203
504
  counted: boolean;
204
505
  }[]>;
205
506
  /** The recipes: whether each is on, and its version now (what `craft` takes as the terms the player was shown). */
@@ -208,12 +509,30 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
208
509
  * Crafts a recipe, handing in `assets` (the collectibles it burns or uses, in the recipe's order). `version`: the
209
510
  * recipe's version the page showed the player (`recipes()`, or the listing itself as `listing`), so a recipe the
210
511
  * owner changed since is refused rather than crafted on terms the player never saw. It is required: the version
211
- * read now is never signed in its place.
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).
212
514
  */
213
- craft(recipeKey: any, assets?: any[], times?: number, { version, listing, ...others }?: Readonly<Record<string, any>>): Promise<{
515
+ craft(recipeKey: any, assets?: any[], times?: number, { version, listing, extra, ...others }?: Readonly<Record<string, any>>): Promise<{
214
516
  signature: any;
215
517
  made: any;
216
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;
217
536
  }>;
218
537
  /**
219
538
  * Hands an NFT of any kind to the project until a time (a hold): `seconds` from now, or `{ until }` (Unix seconds).
@@ -251,6 +570,30 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
251
570
  due: any;
252
571
  hold: any;
253
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
+ }>;
254
597
  /**
255
598
  * Backs `side` of contest number `id` (the authority opens contests while the project runs) with `amount`; a contest
256
599
  * of NFTs takes one of the player's NFTs that passes its rule instead (`nft`, its address), held until it is
@@ -273,17 +616,45 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
273
616
  /**
274
617
  * Ends an auction that is over (anyone can; the winner usually does): the lot to the highest bidder, a new
275
618
  * collectible minted for them at the address its item and serial name, however long after the end it is sent. A
276
- * roll lot makes the winner's roll of its box (`order`), which `collect` asks for and settles.
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`).
277
621
  */
278
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;
279
632
  signature: any;
280
633
  winner?: any;
281
634
  asset?: any;
282
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;
283
653
  }>;
284
654
  /**
285
- * Runs a schedule that is due (an emission into a pool, a rent or a drip): anyone may, and nothing is paid to
286
- * whoever sends it but the network fee. `holders`: asset → holder, for a schedule that pays a collectible's holder.
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.
287
658
  * Returns null when it isn't due yet.
288
659
  */
289
660
  runSchedule(scheduleKey: any, { holders, most, ...others }?: Readonly<Record<string, any>>): Promise<any>;
@@ -330,7 +701,7 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
330
701
  /**
331
702
  * Claims a grant for the connected wallet: from the approved list (the proof comes from xsolana.json, or is given:
332
703
  * `proof`, `personHash` and the `round` the list pays, as a results server's list answers them), or with a voucher
333
- * a server signed ({ publicKey, signature, incarnation, round, expires, personHash, amount }). A list in xsolana.json names
704
+ * a server signed ({ publicKey, signature, incarnation, round and amount, or rounds: [{ id, amount }], expires, personHash }). A list in xsolana.json names
334
705
  * no round (zeros). `amount` (a voucher's, or `options.amount` for a list's leaf): the tokens this claim gives, in
335
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
336
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
@@ -356,90 +727,123 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
356
727
  /**
357
728
  * What this player can finish now, themselves: a box to settle or refund, a contest entry to claim, a held
358
729
  * collectible to take home, an auction they won (or one off by the clock: their bid back), a lottery place they
359
- * won, a draw that is due (anyone may reveal it, or ask again when the oracle never answered; it takes 0.0005
730
+ * won, a draw that is due (anyone may reveal it, or ask again when the oracle never answered; it takes 0.0008
360
731
  * SOL), and a drawn lottery's unpaid places, which anyone may pay so the next round can open. [{ kind, says, … }];
361
732
  * pass one to `claim`.
362
733
  */
363
734
  claims(): Promise<({
364
735
  key?: undefined;
736
+ tree?: undefined;
365
737
  kind: string;
366
738
  order: any;
367
739
  says: string;
368
- entry?: undefined;
369
740
  id?: undefined;
370
741
  side?: undefined;
371
742
  hold?: undefined;
372
- contribution?: undefined;
743
+ round?: undefined;
744
+ pulls?: undefined;
373
745
  asset?: undefined;
374
746
  table?: undefined;
375
747
  } | {
376
748
  key?: undefined;
749
+ tree?: undefined;
377
750
  order?: undefined;
378
751
  kind: string;
379
- entry: any;
380
752
  id: any;
381
753
  side: any;
382
754
  says: string;
383
755
  hold?: undefined;
384
- contribution?: undefined;
756
+ round?: undefined;
757
+ pulls?: undefined;
385
758
  asset?: undefined;
386
759
  table?: undefined;
387
760
  } | {
388
761
  key?: undefined;
762
+ tree?: undefined;
389
763
  order?: undefined;
390
- entry?: undefined;
391
764
  id?: undefined;
392
765
  side?: undefined;
393
766
  kind: string;
394
767
  asset: any;
395
768
  hold: any;
396
769
  says: string;
397
- contribution?: undefined;
770
+ round?: undefined;
771
+ pulls?: undefined;
398
772
  table?: undefined;
399
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;
400
801
  order?: undefined;
401
- entry?: undefined;
402
802
  id?: undefined;
403
803
  side?: undefined;
404
804
  hold?: undefined;
405
805
  kind: string;
406
806
  key: any;
807
+ round: any;
407
808
  says: string;
408
- contribution?: undefined;
809
+ pulls?: undefined;
409
810
  asset?: undefined;
410
811
  table?: undefined;
411
812
  } | {
813
+ tree?: undefined;
412
814
  order?: undefined;
413
- entry?: undefined;
414
815
  id?: undefined;
415
816
  side?: undefined;
416
817
  hold?: undefined;
417
818
  kind: string;
418
819
  key: any;
419
- contribution: any;
820
+ round: any;
821
+ pulls: any;
420
822
  says: string;
421
823
  asset?: undefined;
422
824
  table?: undefined;
423
825
  } | {
424
826
  key?: undefined;
827
+ tree?: undefined;
425
828
  order?: undefined;
426
- entry?: undefined;
427
829
  id?: undefined;
428
830
  side?: undefined;
429
831
  hold?: undefined;
430
- contribution?: undefined;
832
+ round?: undefined;
833
+ pulls?: undefined;
431
834
  kind: string;
432
835
  asset: any;
433
836
  says: string;
434
837
  table?: undefined;
435
838
  } | {
436
839
  key?: undefined;
840
+ tree?: undefined;
437
841
  order?: undefined;
438
- entry?: undefined;
439
842
  id?: undefined;
440
843
  side?: undefined;
441
844
  hold?: undefined;
442
- contribution?: undefined;
845
+ round?: undefined;
846
+ pulls?: undefined;
443
847
  asset?: undefined;
444
848
  kind: string;
445
849
  table: any;
@@ -450,7 +854,14 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
450
854
  * which loser's NFT they take (`{ take: asset }`, the NFT of a losing entry that still holds one; the first found by default):
451
855
  * only the winner can, while any are left.
452
856
  */
453
- claim(c: any, { take, ...others }?: Readonly<Record<string, any>>): Promise<any>;
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[]>;
454
865
  /** The player's collectibles of this project: [{ asset, item, itemId, name, uri, attributes, frozen }]. `item` is its key in the spec. */
455
866
  collectibles: (owner?: any) => Promise<{
456
867
  owner: string;