@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.
- package/README.md +10 -10
- package/examples/coin-flip-arena.json +2 -7
- package/examples/elements-set.json +2 -9
- package/examples/expedition-guild.json +1 -8
- package/examples/guild-missions.json +3 -10
- package/examples/halving-seasons.json +4 -9
- package/examples/hero-trials.json +1 -4
- package/examples/merge-2048.json +5 -5
- package/examples/paper-hands-farm.json +4 -16
- package/examples/partner-vault.json +1 -4
- package/examples/stakers-draw.json +1 -8
- package/examples/star-fleet.json +1 -8
- package/examples/starforce.json +6 -6
- package/js/approve/details.mjs +8 -7
- package/js/approve/server.mjs +20 -5
- package/js/chain/borsh.js +9 -0
- package/js/chain/core.js +14 -2
- package/js/chain/lookup.js +8 -2
- package/js/chain/rpc.js +4 -2
- package/js/client/accounts.js +448 -116
- package/js/client/grant.js +125 -66
- package/js/client/idl/loot.js +1 -1
- package/js/client/idl/loot.json +2360 -2218
- package/js/client/index.js +1 -0
- package/js/client/ix.js +1204 -473
- package/js/client/pda.js +20 -16
- package/js/client/policy.js +44 -23
- package/js/client/random.js +70 -0
- package/js/client/sizes.js +255 -12
- package/js/economy/check.mjs +455 -210
- package/js/economy/cost.mjs +45 -30
- package/js/economy/examples.mjs +2 -2
- package/js/economy/explain.mjs +24 -20
- package/js/economy/guide.mjs +31 -30
- package/js/economy/live.mjs +30 -7
- package/js/economy/model.mjs +171 -56
- package/js/economy/plan.mjs +380 -112
- package/js/economy/schema.json +291 -143
- package/js/economy/simulate.mjs +154 -87
- package/js/mcp/tools.mjs +14 -8
- package/js/play/index.js +1121 -375
- package/js/play/keys.js +167 -0
- package/package.json +1 -1
- package/release.json +5 -5
- package/skills/xsolana-economy/SKILL.md +15 -11
- package/skills/xsolana-economy/references/after-launch.md +37 -27
- package/skills/xsolana-economy/references/apps.md +55 -19
- package/skills/xsolana-economy/references/sentence-to-spec.md +30 -22
- package/skills/xsolana-economy/references/telling-the-person.md +52 -11
- package/types/chain/core.d.ts +3 -1
- package/types/chain/lookup.d.ts +5 -2
- package/types/chain/rpc.d.ts +3 -1
- package/types/client/accounts.d.ts +195 -55
- package/types/client/grant.d.ts +72 -27
- package/types/client/idl/loot.d.ts +590 -559
- package/types/client/index.d.ts +1 -0
- package/types/client/ix.d.ts +3862 -234
- package/types/client/pda.d.ts +19 -15
- package/types/client/policy.d.ts +39 -14
- package/types/client/random.d.ts +26 -0
- package/types/client/sizes.d.ts +93 -5
- package/types/economy/check.d.mts +5 -10
- package/types/economy/cost.d.mts +2 -1
- package/types/economy/live.d.mts +16 -1
- package/types/economy/model.d.mts +105 -37
- package/types/economy/plan.d.mts +193 -192
- package/types/economy/simulate.d.mts +21 -13
- package/types/mcp/tools.d.mts +21 -13
- package/types/play/index.d.ts +450 -39
- package/types/play/keys.d.ts +51 -0
package/types/economy/plan.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Most transactions one wallet approval carries. */
|
|
2
2
|
export declare const PER_APPROVAL = 12;
|
|
3
|
-
export declare function itemArgs(it: any): {
|
|
3
|
+
export declare function itemArgs(it: any, m: any): {
|
|
4
4
|
kind: string;
|
|
5
5
|
rarity: number;
|
|
6
6
|
soulbound: boolean;
|
|
@@ -8,24 +8,33 @@ export declare function itemArgs(it: any): {
|
|
|
8
8
|
name: any;
|
|
9
9
|
uri: any;
|
|
10
10
|
max_supply: any;
|
|
11
|
-
life: {
|
|
12
|
-
ready_after: number;
|
|
13
|
-
lasts: number;
|
|
14
|
-
uses: any;
|
|
15
|
-
cooldown: number;
|
|
16
|
-
} | null;
|
|
17
11
|
active: boolean;
|
|
18
12
|
collection: any;
|
|
13
|
+
traits: any;
|
|
19
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* The bytes of an order of box `b` (`orderBytes`), its spec's names standing in as addresses, with the shares its split
|
|
17
|
+
* stores. `opened`: an open's (`open_box`, `Order::sized`: each draw at its dearest outcome's prizes as they are kept,
|
|
18
|
+
* rows only for the tables its fresh items draw); otherwise a roll made inside another call (a craft, a grant's claim,
|
|
19
|
+
* a mission, a lottery's place, a roll lot: `Order::space_for`, the box's whole table budget a draw).
|
|
20
|
+
*/
|
|
21
|
+
export declare const boxOrderBytes: (b: any, m: any, opens?: number, { opened }?: {
|
|
22
|
+
opened?: boolean | undefined;
|
|
23
|
+
}) => number;
|
|
24
|
+
/** The most bytes of rows one table write carries: what a 1,232-byte transaction leaves after the upsert's accounts,
|
|
25
|
+
* its signature and its own bytes. */
|
|
26
|
+
export declare const TABLE_BATCH_BYTES = 800;
|
|
27
|
+
/** A spec table's rows as the program takes them ({ weight, left, label }), in batches that fit a transaction each. */
|
|
28
|
+
export declare function tableBatches(t: any): never[][];
|
|
20
29
|
/** The program's `Prize` for one part of a box outcome (`model.outcomeParts`). */
|
|
21
|
-
export declare function partPrize(o: any, m: any): {
|
|
30
|
+
export declare function partPrize(o: any, m: any): "Raffled" | {
|
|
22
31
|
Stash: any[];
|
|
23
32
|
} | {
|
|
24
|
-
Item?: undefined;
|
|
25
33
|
Compressed: {
|
|
26
34
|
item: any;
|
|
27
35
|
tree: string;
|
|
28
36
|
};
|
|
37
|
+
Item?: undefined;
|
|
29
38
|
Held?: undefined;
|
|
30
39
|
Nft?: undefined;
|
|
31
40
|
Roll?: undefined;
|
|
@@ -38,15 +47,15 @@ export declare function partPrize(o: any, m: any): {
|
|
|
38
47
|
Roll?: undefined;
|
|
39
48
|
Tokens?: undefined;
|
|
40
49
|
} | {
|
|
41
|
-
Item?: undefined;
|
|
42
50
|
Compressed?: undefined;
|
|
51
|
+
Item?: undefined;
|
|
43
52
|
Held: any[];
|
|
44
53
|
Nft?: undefined;
|
|
45
54
|
Roll?: undefined;
|
|
46
55
|
Tokens?: undefined;
|
|
47
56
|
} | {
|
|
48
|
-
Item?: undefined;
|
|
49
57
|
Compressed?: undefined;
|
|
58
|
+
Item?: undefined;
|
|
50
59
|
Held?: undefined;
|
|
51
60
|
Nft: {
|
|
52
61
|
stash: any;
|
|
@@ -55,34 +64,15 @@ export declare function partPrize(o: any, m: any): {
|
|
|
55
64
|
Roll?: undefined;
|
|
56
65
|
Tokens?: undefined;
|
|
57
66
|
} | {
|
|
58
|
-
Item?: undefined;
|
|
59
67
|
Compressed?: undefined;
|
|
68
|
+
Item?: undefined;
|
|
60
69
|
Held?: undefined;
|
|
61
70
|
Nft?: undefined;
|
|
62
71
|
Roll: any[];
|
|
63
72
|
Tokens?: undefined;
|
|
64
73
|
} | {
|
|
65
|
-
Item?: undefined;
|
|
66
74
|
Compressed?: undefined;
|
|
67
|
-
Held?: undefined;
|
|
68
|
-
Nft?: undefined;
|
|
69
|
-
Roll?: undefined;
|
|
70
|
-
Tokens: {
|
|
71
|
-
from: {
|
|
72
|
-
Pool: any[];
|
|
73
|
-
Mint?: undefined;
|
|
74
|
-
} | {
|
|
75
|
-
Pool?: undefined;
|
|
76
|
-
Mint: string[];
|
|
77
|
-
};
|
|
78
|
-
amount: {
|
|
79
|
-
Bps: number[];
|
|
80
|
-
Fixed?: undefined;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
} | {
|
|
84
75
|
Item?: undefined;
|
|
85
|
-
Compressed?: undefined;
|
|
86
76
|
Held?: undefined;
|
|
87
77
|
Nft?: undefined;
|
|
88
78
|
Roll?: undefined;
|
|
@@ -94,10 +84,7 @@ export declare function partPrize(o: any, m: any): {
|
|
|
94
84
|
Pool?: undefined;
|
|
95
85
|
Mint: string[];
|
|
96
86
|
};
|
|
97
|
-
amount:
|
|
98
|
-
Bps?: undefined;
|
|
99
|
-
Fixed: bigint[];
|
|
100
|
-
};
|
|
87
|
+
amount: bigint;
|
|
101
88
|
};
|
|
102
89
|
};
|
|
103
90
|
export declare function boxArgs(b: any, m: any): {
|
|
@@ -115,8 +102,10 @@ export declare function boxArgs(b: any, m: any): {
|
|
|
115
102
|
shared: boolean;
|
|
116
103
|
} | null;
|
|
117
104
|
stock_odds: boolean;
|
|
105
|
+
when_out: string;
|
|
118
106
|
active: boolean;
|
|
119
107
|
shares: any;
|
|
108
|
+
slots: any;
|
|
120
109
|
entries: any;
|
|
121
110
|
gate: {
|
|
122
111
|
Wallets: any[];
|
|
@@ -148,8 +137,8 @@ export declare function boxArgs(b: any, m: any): {
|
|
|
148
137
|
Item: any[];
|
|
149
138
|
Collection?: undefined;
|
|
150
139
|
} | {
|
|
151
|
-
Item?: undefined;
|
|
152
140
|
Collection: any[];
|
|
141
|
+
Item?: undefined;
|
|
153
142
|
};
|
|
154
143
|
key: any;
|
|
155
144
|
test: any;
|
|
@@ -170,29 +159,29 @@ export declare function boxArgs(b: any, m: any): {
|
|
|
170
159
|
Item: any[];
|
|
171
160
|
Collection?: undefined;
|
|
172
161
|
} | {
|
|
173
|
-
Item?: undefined;
|
|
174
162
|
Collection: any[];
|
|
163
|
+
Item?: undefined;
|
|
175
164
|
};
|
|
176
165
|
key: any;
|
|
177
166
|
test: any;
|
|
178
167
|
} | null;
|
|
179
168
|
fates: any;
|
|
180
169
|
};
|
|
181
|
-
/** Where an outcome sends the NFT a box rolls on: back, burned, given (the treasury's wallet is filled in when the economy goes live), or into a stash. */
|
|
182
|
-
export declare const thenOf: (then: any, m: any) => "
|
|
170
|
+
/** Where an outcome sends the NFT a box rolls on: back (null), burned, given (the treasury's wallet is filled in when the economy goes live), or into a stash. */
|
|
171
|
+
export declare const thenOf: (then: any, m: any) => "Burn" | {
|
|
183
172
|
Give?: undefined;
|
|
184
173
|
Stash: any[];
|
|
185
174
|
} | {
|
|
186
175
|
Stash?: undefined;
|
|
187
176
|
Give: any[];
|
|
188
|
-
};
|
|
177
|
+
} | null;
|
|
189
178
|
export declare function recipeArgs(r: any, m: any): {
|
|
190
179
|
active: boolean;
|
|
191
180
|
inputs: any;
|
|
192
181
|
outputs: any;
|
|
193
|
-
needs: any;
|
|
182
|
+
needs: any[];
|
|
194
183
|
keeps: any;
|
|
195
|
-
raises: any;
|
|
184
|
+
raises: any[];
|
|
196
185
|
window: {
|
|
197
186
|
opens_at: bigint;
|
|
198
187
|
closes_at: bigint;
|
|
@@ -207,12 +196,42 @@ export declare function scheduleArgs(s: any, m: any): {
|
|
|
207
196
|
active: boolean;
|
|
208
197
|
action: {
|
|
209
198
|
from: {
|
|
210
|
-
Pool?: undefined;
|
|
211
199
|
Mint: string[];
|
|
212
200
|
Vest?: undefined;
|
|
201
|
+
Pool?: undefined;
|
|
213
202
|
};
|
|
214
|
-
to: {
|
|
203
|
+
to: string | {
|
|
215
204
|
Pool: any[];
|
|
205
|
+
Account?: undefined;
|
|
206
|
+
Wallet?: undefined;
|
|
207
|
+
Chosen?: undefined;
|
|
208
|
+
Holder?: undefined;
|
|
209
|
+
} | {
|
|
210
|
+
Account: (string | undefined)[];
|
|
211
|
+
Wallet?: undefined;
|
|
212
|
+
Chosen?: undefined;
|
|
213
|
+
Holder?: undefined;
|
|
214
|
+
Pool?: undefined;
|
|
215
|
+
} | {
|
|
216
|
+
Account?: undefined;
|
|
217
|
+
Wallet: (string | undefined)[];
|
|
218
|
+
Chosen?: undefined;
|
|
219
|
+
Holder?: undefined;
|
|
220
|
+
Pool?: undefined;
|
|
221
|
+
} | {
|
|
222
|
+
Account?: undefined;
|
|
223
|
+
Wallet?: undefined;
|
|
224
|
+
Chosen: {
|
|
225
|
+
item: any;
|
|
226
|
+
};
|
|
227
|
+
Holder?: undefined;
|
|
228
|
+
Pool?: undefined;
|
|
229
|
+
} | {
|
|
230
|
+
Account?: undefined;
|
|
231
|
+
Wallet?: undefined;
|
|
232
|
+
Chosen?: undefined;
|
|
233
|
+
Holder: (string | undefined)[];
|
|
234
|
+
Pool?: undefined;
|
|
216
235
|
};
|
|
217
236
|
amount: {
|
|
218
237
|
Fixed: bigint[];
|
|
@@ -220,8 +239,8 @@ export declare function scheduleArgs(s: any, m: any): {
|
|
|
220
239
|
halve_every: any;
|
|
221
240
|
} | {
|
|
222
241
|
from: {
|
|
223
|
-
Pool?: undefined;
|
|
224
242
|
Vest: string[];
|
|
243
|
+
Pool?: undefined;
|
|
225
244
|
Mint?: undefined;
|
|
226
245
|
};
|
|
227
246
|
to: string | {
|
|
@@ -231,38 +250,38 @@ export declare function scheduleArgs(s: any, m: any): {
|
|
|
231
250
|
Chosen?: undefined;
|
|
232
251
|
Holder?: undefined;
|
|
233
252
|
} | {
|
|
234
|
-
Pool?: undefined;
|
|
235
253
|
Account: (string | undefined)[];
|
|
236
254
|
Wallet?: undefined;
|
|
237
255
|
Chosen?: undefined;
|
|
238
256
|
Holder?: undefined;
|
|
239
|
-
} | {
|
|
240
257
|
Pool?: undefined;
|
|
258
|
+
} | {
|
|
241
259
|
Account?: undefined;
|
|
242
260
|
Wallet: (string | undefined)[];
|
|
243
261
|
Chosen?: undefined;
|
|
244
262
|
Holder?: undefined;
|
|
245
|
-
} | {
|
|
246
263
|
Pool?: undefined;
|
|
264
|
+
} | {
|
|
247
265
|
Account?: undefined;
|
|
248
266
|
Wallet?: undefined;
|
|
249
267
|
Chosen: {
|
|
250
268
|
item: any;
|
|
251
269
|
};
|
|
252
270
|
Holder?: undefined;
|
|
253
|
-
} | {
|
|
254
271
|
Pool?: undefined;
|
|
272
|
+
} | {
|
|
255
273
|
Account?: undefined;
|
|
256
274
|
Wallet?: undefined;
|
|
257
275
|
Chosen?: undefined;
|
|
258
276
|
Holder: (string | undefined)[];
|
|
277
|
+
Pool?: undefined;
|
|
259
278
|
};
|
|
260
279
|
amount: {
|
|
261
280
|
Bps: number[];
|
|
262
281
|
Fixed?: undefined;
|
|
263
282
|
} | {
|
|
264
|
-
Fixed: bigint[];
|
|
265
283
|
Bps?: undefined;
|
|
284
|
+
Fixed: bigint[];
|
|
266
285
|
};
|
|
267
286
|
halve_every: any;
|
|
268
287
|
} | {
|
|
@@ -278,38 +297,38 @@ export declare function scheduleArgs(s: any, m: any): {
|
|
|
278
297
|
Chosen?: undefined;
|
|
279
298
|
Holder?: undefined;
|
|
280
299
|
} | {
|
|
281
|
-
Pool?: undefined;
|
|
282
300
|
Account: (string | undefined)[];
|
|
283
301
|
Wallet?: undefined;
|
|
284
302
|
Chosen?: undefined;
|
|
285
303
|
Holder?: undefined;
|
|
286
|
-
} | {
|
|
287
304
|
Pool?: undefined;
|
|
305
|
+
} | {
|
|
288
306
|
Account?: undefined;
|
|
289
307
|
Wallet: (string | undefined)[];
|
|
290
308
|
Chosen?: undefined;
|
|
291
309
|
Holder?: undefined;
|
|
292
|
-
} | {
|
|
293
310
|
Pool?: undefined;
|
|
311
|
+
} | {
|
|
294
312
|
Account?: undefined;
|
|
295
313
|
Wallet?: undefined;
|
|
296
314
|
Chosen: {
|
|
297
315
|
item: any;
|
|
298
316
|
};
|
|
299
317
|
Holder?: undefined;
|
|
300
|
-
} | {
|
|
301
318
|
Pool?: undefined;
|
|
319
|
+
} | {
|
|
302
320
|
Account?: undefined;
|
|
303
321
|
Wallet?: undefined;
|
|
304
322
|
Chosen?: undefined;
|
|
305
323
|
Holder: (string | undefined)[];
|
|
324
|
+
Pool?: undefined;
|
|
306
325
|
};
|
|
307
326
|
amount: {
|
|
308
|
-
Bps: number[];
|
|
309
327
|
Fixed?: undefined;
|
|
328
|
+
Bps: number[];
|
|
310
329
|
} | {
|
|
311
|
-
Fixed: bigint[];
|
|
312
330
|
Bps?: undefined;
|
|
331
|
+
Fixed: bigint[];
|
|
313
332
|
};
|
|
314
333
|
halve_every: any;
|
|
315
334
|
};
|
|
@@ -321,12 +340,12 @@ export declare function scheduleArgs(s: any, m: any): {
|
|
|
321
340
|
* The program's `Prize` for a prize line (`model.prizeLine`): tokens minted or from a pool (a fixed amount, or a share
|
|
322
341
|
* of the pool), an item (a compressed NFT of it into the project's tree, "@tree"), one NFT of a stash, or a roll of a box.
|
|
323
342
|
*/
|
|
324
|
-
export declare function prizeArgs(p: any, m: any): {
|
|
325
|
-
Item?: undefined;
|
|
343
|
+
export declare function prizeArgs(p: any, m: any): "Raffled" | {
|
|
326
344
|
Compressed: {
|
|
327
345
|
item: any;
|
|
328
346
|
tree: string;
|
|
329
347
|
};
|
|
348
|
+
Item?: undefined;
|
|
330
349
|
Held?: undefined;
|
|
331
350
|
Nft?: undefined;
|
|
332
351
|
Roll?: undefined;
|
|
@@ -339,15 +358,15 @@ export declare function prizeArgs(p: any, m: any): {
|
|
|
339
358
|
Roll?: undefined;
|
|
340
359
|
Tokens?: undefined;
|
|
341
360
|
} | {
|
|
342
|
-
Item?: undefined;
|
|
343
361
|
Compressed?: undefined;
|
|
362
|
+
Item?: undefined;
|
|
344
363
|
Held: any[];
|
|
345
364
|
Nft?: undefined;
|
|
346
365
|
Roll?: undefined;
|
|
347
366
|
Tokens?: undefined;
|
|
348
367
|
} | {
|
|
349
|
-
Item?: undefined;
|
|
350
368
|
Compressed?: undefined;
|
|
369
|
+
Item?: undefined;
|
|
351
370
|
Held?: undefined;
|
|
352
371
|
Nft: {
|
|
353
372
|
stash: any;
|
|
@@ -356,34 +375,15 @@ export declare function prizeArgs(p: any, m: any): {
|
|
|
356
375
|
Roll?: undefined;
|
|
357
376
|
Tokens?: undefined;
|
|
358
377
|
} | {
|
|
359
|
-
Item?: undefined;
|
|
360
378
|
Compressed?: undefined;
|
|
379
|
+
Item?: undefined;
|
|
361
380
|
Held?: undefined;
|
|
362
381
|
Nft?: undefined;
|
|
363
382
|
Roll: any[];
|
|
364
383
|
Tokens?: undefined;
|
|
365
384
|
} | {
|
|
366
|
-
Item?: undefined;
|
|
367
385
|
Compressed?: undefined;
|
|
368
|
-
Held?: undefined;
|
|
369
|
-
Nft?: undefined;
|
|
370
|
-
Roll?: undefined;
|
|
371
|
-
Tokens: {
|
|
372
|
-
from: {
|
|
373
|
-
Pool: any[];
|
|
374
|
-
Mint?: undefined;
|
|
375
|
-
} | {
|
|
376
|
-
Pool?: undefined;
|
|
377
|
-
Mint: string[];
|
|
378
|
-
};
|
|
379
|
-
amount: {
|
|
380
|
-
Bps: number[];
|
|
381
|
-
Fixed?: undefined;
|
|
382
|
-
};
|
|
383
|
-
};
|
|
384
|
-
} | {
|
|
385
386
|
Item?: undefined;
|
|
386
|
-
Compressed?: undefined;
|
|
387
387
|
Held?: undefined;
|
|
388
388
|
Nft?: undefined;
|
|
389
389
|
Roll?: undefined;
|
|
@@ -395,10 +395,7 @@ export declare function prizeArgs(p: any, m: any): {
|
|
|
395
395
|
Pool?: undefined;
|
|
396
396
|
Mint: string[];
|
|
397
397
|
};
|
|
398
|
-
amount:
|
|
399
|
-
Bps?: undefined;
|
|
400
|
-
Fixed: bigint[];
|
|
401
|
-
};
|
|
398
|
+
amount: bigint;
|
|
402
399
|
};
|
|
403
400
|
};
|
|
404
401
|
/**
|
|
@@ -412,13 +409,37 @@ export declare const listLeaves: (list: any, t: any) => any;
|
|
|
412
409
|
* `cutPercent` to the treasury) with the rest into the pot. No `every` draws once, at `firstDraw`.
|
|
413
410
|
*/
|
|
414
411
|
export declare function lotteryArgs(l: any, m: any): {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
412
|
+
terms: {
|
|
413
|
+
price: bigint;
|
|
414
|
+
mint: string;
|
|
415
|
+
shares: any;
|
|
416
|
+
places: any;
|
|
417
|
+
ticket_mint: string;
|
|
418
|
+
draws_at: bigint;
|
|
419
|
+
nft_ticket: {
|
|
420
|
+
rule: {
|
|
421
|
+
of: {
|
|
422
|
+
Item: any[];
|
|
423
|
+
Collection?: undefined;
|
|
424
|
+
} | {
|
|
425
|
+
Collection: any[];
|
|
426
|
+
Item?: undefined;
|
|
427
|
+
};
|
|
428
|
+
key: any;
|
|
429
|
+
test: any;
|
|
430
|
+
} | null;
|
|
431
|
+
then: string | {
|
|
432
|
+
Stash: any[];
|
|
433
|
+
Give?: undefined;
|
|
434
|
+
} | {
|
|
435
|
+
Stash?: undefined;
|
|
436
|
+
Give: any[];
|
|
437
|
+
};
|
|
438
|
+
} | null;
|
|
439
|
+
returns: boolean;
|
|
440
|
+
min_sold: bigint;
|
|
441
|
+
};
|
|
420
442
|
every: bigint;
|
|
421
|
-
draws_at: bigint;
|
|
422
443
|
gate: {
|
|
423
444
|
Wallets: any[];
|
|
424
445
|
Staked?: undefined;
|
|
@@ -449,37 +470,41 @@ export declare function lotteryArgs(l: any, m: any): {
|
|
|
449
470
|
Item: any[];
|
|
450
471
|
Collection?: undefined;
|
|
451
472
|
} | {
|
|
452
|
-
Item?: undefined;
|
|
453
473
|
Collection: any[];
|
|
474
|
+
Item?: undefined;
|
|
454
475
|
};
|
|
455
476
|
key: any;
|
|
456
477
|
test: any;
|
|
457
478
|
} | null)[];
|
|
458
479
|
} | null;
|
|
459
480
|
per_wallet: any;
|
|
460
|
-
nft_ticket: {
|
|
461
|
-
rule: {
|
|
462
|
-
of: {
|
|
463
|
-
Item: any[];
|
|
464
|
-
Collection?: undefined;
|
|
465
|
-
} | {
|
|
466
|
-
Item?: undefined;
|
|
467
|
-
Collection: any[];
|
|
468
|
-
};
|
|
469
|
-
key: any;
|
|
470
|
-
test: any;
|
|
471
|
-
} | null;
|
|
472
|
-
then: string | {
|
|
473
|
-
Stash: any[];
|
|
474
|
-
Give?: undefined;
|
|
475
|
-
} | {
|
|
476
|
-
Stash?: undefined;
|
|
477
|
-
Give: any[];
|
|
478
|
-
};
|
|
479
|
-
} | null;
|
|
480
|
-
returns: boolean;
|
|
481
|
-
min_sold: bigint;
|
|
482
481
|
};
|
|
482
|
+
/**
|
|
483
|
+
* A lottery round's header as its first purchase sizes it (`LotteryRound::new`: its `head`), and the token accounts a
|
|
484
|
+
* round may open (`accounts`: the payment mint's, the pot's, one for each run whose prize comes from a pool). The
|
|
485
|
+
* header holds a copy of the terms, a total for each share, two bits a place, a record for each run of tokens and an
|
|
486
|
+
* NFT slot for each place of the lottery's own stash.
|
|
487
|
+
*/
|
|
488
|
+
export declare function roundSize(l: any, m: any): {
|
|
489
|
+
head: number;
|
|
490
|
+
accounts: any;
|
|
491
|
+
};
|
|
492
|
+
/** How many rounds of a lottery are open or still paying out at once, and how many purchases a round takes, as the
|
|
493
|
+
* spec expects them (`expect`): by default two rounds of a lottery that draws again (one selling, one paying out) and
|
|
494
|
+
* one of a lottery that draws once; a round's purchases from the scenario's purchases a day over a round, else 100. */
|
|
495
|
+
export declare function roundsExpected(l: any, m: any): {
|
|
496
|
+
rounds: any;
|
|
497
|
+
entries: any;
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* The SOL, in lamports, a lottery holds for its rounds' rent: the spec's `roundRent` (0 turns it off), or by default
|
|
501
|
+
* what its expected rounds take at once (`roundsExpected`), each its header, its token accounts and its expected
|
|
502
|
+
* entries' bytes (`LotteryRound.lent`: in a round the lottery opened, its spare SOL pays each entry while it covers
|
|
503
|
+
* them, so buyers pay no program rent for a ticket), at devnet's and mainnet's rent, rounded up to 0.001 SOL. Short
|
|
504
|
+
* of it (a busier round, a cluster that charges more), the first buyer fronts the header and later buyers pay their
|
|
505
|
+
* own entries. Each round gives back what it took when it closes; the lottery gives the rest back to the owner when it closes.
|
|
506
|
+
*/
|
|
507
|
+
export declare function roundRentOf(l: any, m: any): bigint;
|
|
483
508
|
/**
|
|
484
509
|
* The args the authority opens a contest with, `at` (Unix seconds) its opening: its sides, when entries close and the
|
|
485
510
|
* result is due, its split, its gate (a list of wallets for a duel), the keys that may decide it, the least pot (an
|
|
@@ -520,8 +545,8 @@ export declare function contestArgs(c: any, m: any, at?: any): {
|
|
|
520
545
|
Item: any[];
|
|
521
546
|
Collection?: undefined;
|
|
522
547
|
} | {
|
|
523
|
-
Item?: undefined;
|
|
524
548
|
Collection: any[];
|
|
549
|
+
Item?: undefined;
|
|
525
550
|
};
|
|
526
551
|
key: any;
|
|
527
552
|
test: any;
|
|
@@ -530,12 +555,12 @@ export declare function contestArgs(c: any, m: any, at?: any): {
|
|
|
530
555
|
deciders: any;
|
|
531
556
|
min_pot: bigint;
|
|
532
557
|
stake: bigint;
|
|
533
|
-
prize: {
|
|
534
|
-
Item?: undefined;
|
|
558
|
+
prize: string | {
|
|
535
559
|
Compressed: {
|
|
536
560
|
item: any;
|
|
537
561
|
tree: string;
|
|
538
562
|
};
|
|
563
|
+
Item?: undefined;
|
|
539
564
|
Held?: undefined;
|
|
540
565
|
Nft?: undefined;
|
|
541
566
|
Roll?: undefined;
|
|
@@ -548,15 +573,15 @@ export declare function contestArgs(c: any, m: any, at?: any): {
|
|
|
548
573
|
Roll?: undefined;
|
|
549
574
|
Tokens?: undefined;
|
|
550
575
|
} | {
|
|
551
|
-
Item?: undefined;
|
|
552
576
|
Compressed?: undefined;
|
|
577
|
+
Item?: undefined;
|
|
553
578
|
Held: any[];
|
|
554
579
|
Nft?: undefined;
|
|
555
580
|
Roll?: undefined;
|
|
556
581
|
Tokens?: undefined;
|
|
557
582
|
} | {
|
|
558
|
-
Item?: undefined;
|
|
559
583
|
Compressed?: undefined;
|
|
584
|
+
Item?: undefined;
|
|
560
585
|
Held?: undefined;
|
|
561
586
|
Nft: {
|
|
562
587
|
stash: any;
|
|
@@ -565,34 +590,15 @@ export declare function contestArgs(c: any, m: any, at?: any): {
|
|
|
565
590
|
Roll?: undefined;
|
|
566
591
|
Tokens?: undefined;
|
|
567
592
|
} | {
|
|
568
|
-
Item?: undefined;
|
|
569
593
|
Compressed?: undefined;
|
|
594
|
+
Item?: undefined;
|
|
570
595
|
Held?: undefined;
|
|
571
596
|
Nft?: undefined;
|
|
572
597
|
Roll: any[];
|
|
573
598
|
Tokens?: undefined;
|
|
574
599
|
} | {
|
|
575
|
-
Item?: undefined;
|
|
576
600
|
Compressed?: undefined;
|
|
577
|
-
Held?: undefined;
|
|
578
|
-
Nft?: undefined;
|
|
579
|
-
Roll?: undefined;
|
|
580
|
-
Tokens: {
|
|
581
|
-
from: {
|
|
582
|
-
Pool: any[];
|
|
583
|
-
Mint?: undefined;
|
|
584
|
-
} | {
|
|
585
|
-
Pool?: undefined;
|
|
586
|
-
Mint: string[];
|
|
587
|
-
};
|
|
588
|
-
amount: {
|
|
589
|
-
Bps: number[];
|
|
590
|
-
Fixed?: undefined;
|
|
591
|
-
};
|
|
592
|
-
};
|
|
593
|
-
} | {
|
|
594
601
|
Item?: undefined;
|
|
595
|
-
Compressed?: undefined;
|
|
596
602
|
Held?: undefined;
|
|
597
603
|
Nft?: undefined;
|
|
598
604
|
Roll?: undefined;
|
|
@@ -604,10 +610,7 @@ export declare function contestArgs(c: any, m: any, at?: any): {
|
|
|
604
610
|
Pool?: undefined;
|
|
605
611
|
Mint: string[];
|
|
606
612
|
};
|
|
607
|
-
amount:
|
|
608
|
-
Bps?: undefined;
|
|
609
|
-
Fixed: bigint[];
|
|
610
|
-
};
|
|
613
|
+
amount: bigint;
|
|
611
614
|
};
|
|
612
615
|
} | null;
|
|
613
616
|
prize_split: boolean;
|
|
@@ -616,16 +619,16 @@ export declare function contestArgs(c: any, m: any, at?: any): {
|
|
|
616
619
|
Item: any[];
|
|
617
620
|
Collection?: undefined;
|
|
618
621
|
} | {
|
|
619
|
-
Item?: undefined;
|
|
620
622
|
Collection: any[];
|
|
623
|
+
Item?: undefined;
|
|
621
624
|
};
|
|
622
625
|
key: any;
|
|
623
626
|
test: any;
|
|
624
627
|
} | null;
|
|
628
|
+
cap: any;
|
|
625
629
|
};
|
|
626
630
|
export declare function farmArgs(f: any, m: any): {
|
|
627
631
|
custody: any;
|
|
628
|
-
rewards_pool: any;
|
|
629
632
|
tiers: any;
|
|
630
633
|
boosts: any;
|
|
631
634
|
max_boost_bps: number;
|
|
@@ -634,8 +637,8 @@ export declare function farmArgs(f: any, m: any): {
|
|
|
634
637
|
Item: any[];
|
|
635
638
|
Collection?: undefined;
|
|
636
639
|
} | {
|
|
637
|
-
Item?: undefined;
|
|
638
640
|
Collection: any[];
|
|
641
|
+
Item?: undefined;
|
|
639
642
|
};
|
|
640
643
|
key: any;
|
|
641
644
|
test: any;
|
|
@@ -643,6 +646,8 @@ export declare function farmArgs(f: any, m: any): {
|
|
|
643
646
|
rate: {
|
|
644
647
|
per_day: bigint;
|
|
645
648
|
mints: boolean;
|
|
649
|
+
shared: boolean;
|
|
650
|
+
halve_every: number;
|
|
646
651
|
} | null;
|
|
647
652
|
growth: {
|
|
648
653
|
key: any;
|
|
@@ -650,6 +655,8 @@ export declare function farmArgs(f: any, m: any): {
|
|
|
650
655
|
level: any;
|
|
651
656
|
steps: any;
|
|
652
657
|
streak: boolean;
|
|
658
|
+
profile: boolean;
|
|
659
|
+
at_least: bigint;
|
|
653
660
|
}[];
|
|
654
661
|
ends_at: bigint;
|
|
655
662
|
lock_key: any;
|
|
@@ -657,18 +664,14 @@ export declare function farmArgs(f: any, m: any): {
|
|
|
657
664
|
exit_to: string | {
|
|
658
665
|
Pool: any[];
|
|
659
666
|
} | null;
|
|
660
|
-
unbond: number;
|
|
661
|
-
toll: {
|
|
662
|
-
bps: number;
|
|
663
|
-
to: string | {
|
|
664
|
-
Pool: any[];
|
|
665
|
-
};
|
|
666
|
-
} | null;
|
|
667
667
|
};
|
|
668
|
-
/** A fee's sink (`Sink`): "burn", or "pool:<key>", one of the project's pools. */
|
|
669
|
-
export declare const sinkOf: (to: any, m: any) => "Burn" | {
|
|
668
|
+
/** A fee's sink (`Sink`): "burn", "rewards" (the farm's own vault), or "pool:<key>", one of the project's pools. */
|
|
669
|
+
export declare const sinkOf: (to: any, m: any) => "Burn" | "Rewards" | {
|
|
670
670
|
Pool: any[];
|
|
671
671
|
};
|
|
672
|
+
/** Whether a spec's farm keeps a record of when its seats stop earning (`loot.farmKeepsEnds`): a tier's term or an upkeep,
|
|
673
|
+
* and it pays something. Each different time waiting costs whoever writes it `loot.END_BYTES` of rent. */
|
|
674
|
+
export declare const farmEnds: (f: any) => any;
|
|
672
675
|
/** An auction's args: its lot, reserve, least raise, times and split. "start" is when it goes live unless it says. */
|
|
673
676
|
export declare function auctionArgs(a: any, m: any): {
|
|
674
677
|
lot: {
|
|
@@ -714,8 +717,8 @@ export declare function auctionArgs(a: any, m: any): {
|
|
|
714
717
|
Item: any[];
|
|
715
718
|
Collection?: undefined;
|
|
716
719
|
} | {
|
|
717
|
-
Item?: undefined;
|
|
718
720
|
Collection: any[];
|
|
721
|
+
Item?: undefined;
|
|
719
722
|
};
|
|
720
723
|
key: any;
|
|
721
724
|
test: any;
|
|
@@ -726,20 +729,20 @@ export declare function auctionArgs(a: any, m: any): {
|
|
|
726
729
|
Item: any[];
|
|
727
730
|
Collection?: undefined;
|
|
728
731
|
} | {
|
|
729
|
-
Item?: undefined;
|
|
730
732
|
Collection: any[];
|
|
733
|
+
Item?: undefined;
|
|
731
734
|
};
|
|
732
735
|
key: any;
|
|
733
736
|
test: any;
|
|
734
737
|
} | null;
|
|
735
738
|
};
|
|
736
739
|
export declare function grantArgs(g: any, m: any): {
|
|
737
|
-
gives: {
|
|
738
|
-
Item?: undefined;
|
|
740
|
+
gives: string | {
|
|
739
741
|
Compressed: {
|
|
740
742
|
item: any;
|
|
741
743
|
tree: string;
|
|
742
744
|
};
|
|
745
|
+
Item?: undefined;
|
|
743
746
|
Held?: undefined;
|
|
744
747
|
Nft?: undefined;
|
|
745
748
|
Roll?: undefined;
|
|
@@ -752,15 +755,15 @@ export declare function grantArgs(g: any, m: any): {
|
|
|
752
755
|
Roll?: undefined;
|
|
753
756
|
Tokens?: undefined;
|
|
754
757
|
} | {
|
|
755
|
-
Item?: undefined;
|
|
756
758
|
Compressed?: undefined;
|
|
759
|
+
Item?: undefined;
|
|
757
760
|
Held: any[];
|
|
758
761
|
Nft?: undefined;
|
|
759
762
|
Roll?: undefined;
|
|
760
763
|
Tokens?: undefined;
|
|
761
764
|
} | {
|
|
762
|
-
Item?: undefined;
|
|
763
765
|
Compressed?: undefined;
|
|
766
|
+
Item?: undefined;
|
|
764
767
|
Held?: undefined;
|
|
765
768
|
Nft: {
|
|
766
769
|
stash: any;
|
|
@@ -769,34 +772,15 @@ export declare function grantArgs(g: any, m: any): {
|
|
|
769
772
|
Roll?: undefined;
|
|
770
773
|
Tokens?: undefined;
|
|
771
774
|
} | {
|
|
772
|
-
Item?: undefined;
|
|
773
775
|
Compressed?: undefined;
|
|
776
|
+
Item?: undefined;
|
|
774
777
|
Held?: undefined;
|
|
775
778
|
Nft?: undefined;
|
|
776
779
|
Roll: any[];
|
|
777
780
|
Tokens?: undefined;
|
|
778
781
|
} | {
|
|
779
|
-
Item?: undefined;
|
|
780
782
|
Compressed?: undefined;
|
|
781
|
-
Held?: undefined;
|
|
782
|
-
Nft?: undefined;
|
|
783
|
-
Roll?: undefined;
|
|
784
|
-
Tokens: {
|
|
785
|
-
from: {
|
|
786
|
-
Pool: any[];
|
|
787
|
-
Mint?: undefined;
|
|
788
|
-
} | {
|
|
789
|
-
Pool?: undefined;
|
|
790
|
-
Mint: string[];
|
|
791
|
-
};
|
|
792
|
-
amount: {
|
|
793
|
-
Bps: number[];
|
|
794
|
-
Fixed?: undefined;
|
|
795
|
-
};
|
|
796
|
-
};
|
|
797
|
-
} | {
|
|
798
783
|
Item?: undefined;
|
|
799
|
-
Compressed?: undefined;
|
|
800
784
|
Held?: undefined;
|
|
801
785
|
Nft?: undefined;
|
|
802
786
|
Roll?: undefined;
|
|
@@ -808,10 +792,7 @@ export declare function grantArgs(g: any, m: any): {
|
|
|
808
792
|
Pool?: undefined;
|
|
809
793
|
Mint: string[];
|
|
810
794
|
};
|
|
811
|
-
amount:
|
|
812
|
-
Bps?: undefined;
|
|
813
|
-
Fixed: bigint[];
|
|
814
|
-
};
|
|
795
|
+
amount: bigint;
|
|
815
796
|
};
|
|
816
797
|
};
|
|
817
798
|
vouchers: any[];
|
|
@@ -826,8 +807,11 @@ export declare function grantArgs(g: any, m: any): {
|
|
|
826
807
|
};
|
|
827
808
|
per_person: any;
|
|
828
809
|
per_key: any;
|
|
829
|
-
|
|
830
|
-
|
|
810
|
+
all: {
|
|
811
|
+
total: any;
|
|
812
|
+
per_window: any;
|
|
813
|
+
window: number;
|
|
814
|
+
};
|
|
831
815
|
window: {
|
|
832
816
|
opens_at: bigint;
|
|
833
817
|
closes_at: bigint;
|
|
@@ -864,20 +848,21 @@ export declare function grantArgs(g: any, m: any): {
|
|
|
864
848
|
Item: any[];
|
|
865
849
|
Collection?: undefined;
|
|
866
850
|
} | {
|
|
867
|
-
Item?: undefined;
|
|
868
851
|
Collection: any[];
|
|
852
|
+
Item?: undefined;
|
|
869
853
|
};
|
|
870
854
|
key: any;
|
|
871
855
|
test: any;
|
|
872
856
|
} | null)[];
|
|
873
857
|
} | null;
|
|
858
|
+
shard_bits: number;
|
|
874
859
|
};
|
|
875
860
|
/**
|
|
876
861
|
* Every step that sets the economy up, in order: the tokens the project mints, the collection, the project, the pools, items, boxes (the shop's too), recipes, schedules, lotteries, grants,
|
|
877
862
|
* farms, auctions, then the seeds and the grants' funds. `only` limits it to these part ids (a change to a live economy).
|
|
878
863
|
*
|
|
879
|
-
* A farm opens before
|
|
880
|
-
* farm credits nothing at once, and releases what lands in its
|
|
864
|
+
* A farm opens before its seed lands in its rewards vault, and anyone may stake in between. That is safe: a sharing
|
|
865
|
+
* farm credits nothing at once, and releases what lands in its vault over its longest lock (a day at least) to the
|
|
881
866
|
* seats there as it is released, its clock stopped while nobody is in. A seed that lands
|
|
882
867
|
* before the first stake or after it is released the same way from that stake on, so seeding first would change nothing.
|
|
883
868
|
*/
|
|
@@ -900,8 +885,9 @@ export declare function setupSteps(economy: any, { now, only, live: given }?: {
|
|
|
900
885
|
treeHolds: any;
|
|
901
886
|
projectNumber: any;
|
|
902
887
|
items: any;
|
|
903
|
-
pools: any
|
|
888
|
+
pools: any;
|
|
904
889
|
stashes: any;
|
|
890
|
+
tables: any;
|
|
905
891
|
boxes: never[];
|
|
906
892
|
payments: any;
|
|
907
893
|
recipes: any;
|
|
@@ -918,11 +904,23 @@ export declare function setupSteps(economy: any, { now, only, live: given }?: {
|
|
|
918
904
|
live: any;
|
|
919
905
|
};
|
|
920
906
|
};
|
|
921
|
-
/**
|
|
922
|
-
|
|
907
|
+
/** The token accounts going live opens (`setupSteps`): [{ who ('the treasury', 'the project' or a wallet), token }], each
|
|
908
|
+
* once, for the coins the economy takes in. */
|
|
909
|
+
export declare function goLiveAccounts(m: any): any[];
|
|
910
|
+
/**
|
|
911
|
+
* The addresses a project's transactions name most, for its standing lookup table: loot's own fixed accounts (the
|
|
912
|
+
* platform, the oracle's), the project and its fee box, its treasury and collections, each coin's mint, its vault and
|
|
913
|
+
* the treasury's account of it, then each pool, item, box and stash. Each a function of the go-live context.
|
|
914
|
+
*/
|
|
915
|
+
export declare function standingAddresses(m: any): any[];
|
|
916
|
+
/** A stash's bytes with `n` NFTs: a table of NFTs (`table.rs`): its 51-byte header, a total for each group of 4,096
|
|
917
|
+
* rows and each block of 64, and 36 bytes an NFT (its weight and its address). */
|
|
918
|
+
export declare const stashBytes: (n: any) => number;
|
|
923
919
|
/** Who puts a spec's auction up, and so is named in its address: the owner for a collectible it holds, the authority for a new unit of an item. */
|
|
924
920
|
export declare const auctionSeller: (a: any, ctx: any) => any;
|
|
925
921
|
export declare const recordBytesOf: (kind: any, body: any) => number;
|
|
922
|
+
/** A farm's bytes as `open_farm` writes it: its args and its numbers. */
|
|
923
|
+
export declare const farmBytes: (f: any, m: any) => number;
|
|
926
924
|
/** Exact initial contest record size for its configured shares, gate, sides and deciders. */
|
|
927
925
|
export declare const contestBytes: (contest: any, m: any) => number;
|
|
928
926
|
/** Stand-in addresses for every name a plan uses, so it can be built and sized without a wallet. */
|
|
@@ -941,6 +939,7 @@ export declare function placeholderContext(m: any, { rent }?: {
|
|
|
941
939
|
'new:tree'?: string | undefined;
|
|
942
940
|
};
|
|
943
941
|
rent: (bytes: any) => bigint;
|
|
942
|
+
slot: bigint;
|
|
944
943
|
};
|
|
945
944
|
/**
|
|
946
945
|
* What of `live` is made. While a setup is landing (`partial`), the project, its collection, its tree and each mint the
|
|
@@ -976,6 +975,7 @@ export declare function pack(steps: any, ctx: any): {
|
|
|
976
975
|
built: any[];
|
|
977
976
|
instructions: any;
|
|
978
977
|
signers: any[];
|
|
978
|
+
alone: boolean;
|
|
979
979
|
}[];
|
|
980
980
|
/**
|
|
981
981
|
* The plan for a spec: refusals, or every step packed into transactions. With `ctx` the transactions carry the
|
|
@@ -1005,6 +1005,7 @@ export declare function plan(economy: any, { now, ctx, only, live }?: {
|
|
|
1005
1005
|
built: any[];
|
|
1006
1006
|
instructions: any;
|
|
1007
1007
|
signers: any[];
|
|
1008
|
+
alone: boolean;
|
|
1008
1009
|
}[];
|
|
1009
1010
|
approvals: number;
|
|
1010
1011
|
freshKeys: any[];
|