@xgamesfun/solana 0.20.1 → 0.25.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 +95 -52
- package/bin/xsolana.mjs +23 -8
- package/examples/blind-forge.json +2 -4
- package/examples/coin-flip-arena.json +4 -12
- package/examples/duel-arena.json +1 -4
- package/examples/elements-set.json +2 -9
- package/examples/expedition-guild.json +1 -8
- package/examples/fair-presale.json +1 -3
- package/examples/guild-missions.json +3 -10
- package/examples/halving-seasons.json +4 -9
- package/examples/hero-trials.json +15 -6
- package/examples/holder-den.json +38 -0
- package/examples/holders-drop.json +105 -0
- package/examples/ideas.json +788 -788
- package/examples/match-predictions.json +24 -0
- package/examples/merge-2048.json +5 -5
- package/examples/nft-raffle.json +1 -0
- package/examples/pack-league.json +108 -0
- package/examples/paper-hands-farm.json +4 -16
- package/examples/partner-vault.json +20 -7
- package/examples/sacrifice-raffle.json +2 -10
- package/examples/shelter-fair.json +1 -0
- package/examples/stakers-draw.json +4 -15
- package/examples/star-fleet.json +1 -8
- package/examples/starforce.json +6 -6
- package/examples/stride-sneakers.json +164 -0
- package/examples/trade-in-shop.json +2 -3
- package/js/approve/details.mjs +122 -52
- package/js/approve/ed25519.mjs +5 -1
- package/js/approve/live-check.mjs +83 -26
- package/js/approve/page.html +217 -78
- package/js/approve/page.js +43 -15
- package/js/approve/server.mjs +290 -73
- package/js/chain/base58.js +7 -1
- package/js/chain/borsh.js +24 -11
- package/js/chain/bytes.js +11 -8
- package/js/chain/core.js +35 -7
- package/js/chain/curve.js +1 -1
- package/js/chain/lookup.js +124 -36
- package/js/chain/mint.js +6 -2
- package/js/chain/pda.js +2 -2
- package/js/chain/programs.js +6 -6
- package/js/chain/rpc.js +44 -16
- package/js/chain/token.js +13 -2
- package/js/chain/token2022.js +55 -16
- package/js/chain/tx.js +32 -22
- package/js/client/accounts.js +653 -131
- package/js/client/compressed.js +4 -3
- package/js/client/grant.js +267 -83
- package/js/client/idl/loot.js +1 -1
- package/js/client/idl/loot.json +2406 -2176
- package/js/client/index.js +1 -0
- package/js/client/ix.js +3059 -664
- package/js/client/pda.js +39 -33
- package/js/client/policy.js +52 -24
- package/js/client/random.js +70 -0
- package/js/client/sizes.js +414 -16
- package/js/client/traits.js +14 -5
- package/js/connect/connect.mjs +59 -17
- package/js/economy/check.mjs +4153 -725
- package/js/economy/cost.mjs +403 -64
- package/js/economy/examples.mjs +176 -35
- package/js/economy/explain.mjs +466 -111
- package/js/economy/guide.mjs +296 -72
- package/js/economy/legal.mjs +12 -6
- package/js/economy/live.mjs +83 -19
- package/js/economy/model.mjs +462 -124
- package/js/economy/plan.mjs +1306 -219
- package/js/economy/schema.json +390 -484
- package/js/economy/secrets.mjs +17 -7
- package/js/economy/simulate.mjs +883 -223
- package/js/economy/txsize.mjs +15 -3
- package/js/economy/validate.mjs +61 -24
- package/js/mcp/server.mjs +42 -14
- package/js/mcp/tools.mjs +307 -88
- package/js/play/index.js +2864 -619
- package/js/play/keys.js +193 -0
- package/js/results/index.js +223 -30
- package/js/results/server.js +230 -0
- package/js/results/wire.js +64 -16
- package/package.json +6 -4
- package/release.json +5 -5
- package/skills/xsolana-economy/SKILL.md +39 -21
- package/skills/xsolana-economy/references/after-launch.md +58 -38
- package/skills/xsolana-economy/references/apps.md +97 -50
- package/skills/xsolana-economy/references/sentence-to-spec.md +148 -121
- package/skills/xsolana-economy/references/telling-the-person.md +61 -17
- package/types/chain/core.d.ts +4 -2
- package/types/chain/lookup.d.ts +5 -2
- package/types/chain/rpc.d.ts +3 -1
- package/types/client/accounts.d.ts +217 -56
- package/types/client/grant.d.ts +72 -27
- package/types/client/idl/loot.d.ts +602 -549
- package/types/client/index.d.ts +1 -0
- package/types/client/ix.d.ts +3884 -247
- package/types/client/pda.d.ts +22 -16
- 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/guide.d.mts +5 -0
- package/types/economy/live.d.mts +16 -1
- package/types/economy/model.d.mts +151 -38
- package/types/economy/plan.d.mts +237 -194
- package/types/economy/simulate.d.mts +21 -13
- package/types/mcp/tools.d.mts +21 -13
- package/types/play/index.d.ts +453 -53
- package/types/play/keys.d.ts +51 -0
- package/types/results/index.d.ts +7 -6
- package/types/results/server.d.ts +126 -0
- package/types/results/wire.d.ts +1 -1
package/types/play/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
/**
|
|
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
|
|
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[];
|
|
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;
|
|
55
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<
|
|
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,
|
|
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,
|
|
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).
|
|
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,
|
|
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):
|
|
286
|
-
* whoever sends it but the network fee.
|
|
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>;
|
|
@@ -320,7 +691,9 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
|
|
|
320
691
|
* nothing but the lottery can take it while a place names it; the winner gets it before any ticket money moves.
|
|
321
692
|
* `price` (whole units of `currency`) a ticket, `drawsAt` (Unix seconds) its one draw, `minSold` the least tickets
|
|
322
693
|
* (fewer: the round is cancelled and refunded), `shares` where the ticket money goes (the seller's own wallet by
|
|
323
|
-
* default: the treasury).
|
|
694
|
+
* default: the treasury). Its one place takes no money, so it keeps no pot: the round pays from its own ticket
|
|
695
|
+
* money, and what the shares leave goes to the treasury too. A seller runs it in a project of their own, whose
|
|
696
|
+
* owner they are.
|
|
324
697
|
*/
|
|
325
698
|
raffle(id: any, nft: any, { price, currency, drawsAt, minSold, perWallet, shares, ...others }?: Readonly<Record<string, any>>): Promise<any>;
|
|
326
699
|
/** 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). */
|
|
@@ -330,7 +703,7 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
|
|
|
330
703
|
/**
|
|
331
704
|
* Claims a grant for the connected wallet: from the approved list (the proof comes from xsolana.json, or is given:
|
|
332
705
|
* `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
|
|
706
|
+
* a server signed ({ publicKey, signature, incarnation, round and amount, or rounds: [{ id, amount }], expires, personHash }). A list in xsolana.json names
|
|
334
707
|
* no round (zeros). `amount` (a voucher's, or `options.amount` for a list's leaf): the tokens this claim gives, in
|
|
335
708
|
* 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
709
|
* 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 +729,110 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
|
|
|
356
729
|
/**
|
|
357
730
|
* What this player can finish now, themselves: a box to settle or refund, a contest entry to claim, a held
|
|
358
731
|
* 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.
|
|
732
|
+
* won, a draw that is due (anyone may reveal it, or ask again when the oracle never answered; it takes 0.0008
|
|
360
733
|
* SOL), and a drawn lottery's unpaid places, which anyone may pay so the next round can open. [{ kind, says, … }];
|
|
361
|
-
*
|
|
734
|
+
* a winner's first claim of a contest of tokens carries `potUnits` and `prizeUnits`, its part as the decision wrote
|
|
735
|
+
* it (base units, as text). Pass one to `claim`.
|
|
362
736
|
*/
|
|
363
737
|
claims(): Promise<({
|
|
364
738
|
key?: undefined;
|
|
739
|
+
tree?: undefined;
|
|
365
740
|
kind: string;
|
|
366
741
|
order: any;
|
|
367
742
|
says: string;
|
|
368
|
-
entry?: undefined;
|
|
369
|
-
id?: undefined;
|
|
370
|
-
side?: undefined;
|
|
371
743
|
hold?: undefined;
|
|
372
|
-
|
|
744
|
+
round?: undefined;
|
|
745
|
+
pulls?: undefined;
|
|
373
746
|
asset?: undefined;
|
|
374
747
|
table?: undefined;
|
|
375
748
|
} | {
|
|
376
749
|
key?: undefined;
|
|
750
|
+
tree?: undefined;
|
|
377
751
|
order?: undefined;
|
|
378
752
|
kind: string;
|
|
379
|
-
entry: any;
|
|
380
753
|
id: any;
|
|
381
754
|
side: any;
|
|
382
755
|
says: string;
|
|
756
|
+
potUnits?: string | undefined;
|
|
757
|
+
prizeUnits?: string | undefined;
|
|
383
758
|
hold?: undefined;
|
|
384
|
-
|
|
759
|
+
round?: undefined;
|
|
760
|
+
pulls?: undefined;
|
|
385
761
|
asset?: undefined;
|
|
386
762
|
table?: undefined;
|
|
387
763
|
} | {
|
|
388
764
|
key?: undefined;
|
|
765
|
+
tree?: undefined;
|
|
389
766
|
order?: undefined;
|
|
390
|
-
entry?: undefined;
|
|
391
|
-
id?: undefined;
|
|
392
|
-
side?: undefined;
|
|
393
767
|
kind: string;
|
|
394
768
|
asset: any;
|
|
395
769
|
hold: any;
|
|
396
770
|
says: string;
|
|
397
|
-
|
|
771
|
+
round?: undefined;
|
|
772
|
+
pulls?: undefined;
|
|
398
773
|
table?: undefined;
|
|
399
774
|
} | {
|
|
775
|
+
key?: undefined;
|
|
776
|
+
order?: undefined;
|
|
777
|
+
hold?: undefined;
|
|
778
|
+
kind: string;
|
|
779
|
+
asset: string;
|
|
780
|
+
tree: string;
|
|
781
|
+
says: string;
|
|
782
|
+
round?: undefined;
|
|
783
|
+
pulls?: undefined;
|
|
784
|
+
table?: undefined;
|
|
785
|
+
} | {
|
|
786
|
+
tree?: undefined;
|
|
400
787
|
order?: undefined;
|
|
401
|
-
entry?: undefined;
|
|
402
|
-
id?: undefined;
|
|
403
|
-
side?: undefined;
|
|
404
788
|
hold?: undefined;
|
|
405
789
|
kind: string;
|
|
406
790
|
key: any;
|
|
407
791
|
says: string;
|
|
408
|
-
|
|
792
|
+
round?: undefined;
|
|
793
|
+
pulls?: undefined;
|
|
409
794
|
asset?: undefined;
|
|
410
795
|
table?: undefined;
|
|
411
796
|
} | {
|
|
797
|
+
tree?: undefined;
|
|
412
798
|
order?: undefined;
|
|
413
|
-
entry?: undefined;
|
|
414
|
-
id?: undefined;
|
|
415
|
-
side?: undefined;
|
|
416
799
|
hold?: undefined;
|
|
417
800
|
kind: string;
|
|
418
801
|
key: any;
|
|
419
|
-
|
|
802
|
+
round: any;
|
|
803
|
+
says: string;
|
|
804
|
+
pulls?: undefined;
|
|
805
|
+
asset?: undefined;
|
|
806
|
+
table?: undefined;
|
|
807
|
+
} | {
|
|
808
|
+
tree?: undefined;
|
|
809
|
+
order?: undefined;
|
|
810
|
+
hold?: undefined;
|
|
811
|
+
kind: string;
|
|
812
|
+
key: any;
|
|
813
|
+
round: any;
|
|
814
|
+
pulls: any;
|
|
420
815
|
says: string;
|
|
421
816
|
asset?: undefined;
|
|
422
817
|
table?: undefined;
|
|
423
818
|
} | {
|
|
424
819
|
key?: undefined;
|
|
820
|
+
tree?: undefined;
|
|
425
821
|
order?: undefined;
|
|
426
|
-
entry?: undefined;
|
|
427
|
-
id?: undefined;
|
|
428
|
-
side?: undefined;
|
|
429
822
|
hold?: undefined;
|
|
430
|
-
|
|
823
|
+
round?: undefined;
|
|
824
|
+
pulls?: undefined;
|
|
431
825
|
kind: string;
|
|
432
826
|
asset: any;
|
|
433
827
|
says: string;
|
|
434
828
|
table?: undefined;
|
|
435
829
|
} | {
|
|
436
830
|
key?: undefined;
|
|
831
|
+
tree?: undefined;
|
|
437
832
|
order?: undefined;
|
|
438
|
-
entry?: undefined;
|
|
439
|
-
id?: undefined;
|
|
440
|
-
side?: undefined;
|
|
441
833
|
hold?: undefined;
|
|
442
|
-
|
|
834
|
+
round?: undefined;
|
|
835
|
+
pulls?: undefined;
|
|
443
836
|
asset?: undefined;
|
|
444
837
|
kind: string;
|
|
445
838
|
table: any;
|
|
@@ -450,7 +843,14 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now }:
|
|
|
450
843
|
* which loser's NFT they take (`{ take: asset }`, the NFT of a losing entry that still holds one; the first found by default):
|
|
451
844
|
* only the winner can, while any are left.
|
|
452
845
|
*/
|
|
453
|
-
claim(c: any, { take, ...others }?: Readonly<Record<string, any>>): Promise<any>;
|
|
846
|
+
claim(c: any, { take, build, ...others }?: Readonly<Record<string, any>>): Promise<any>;
|
|
847
|
+
/**
|
|
848
|
+
* Everything in `list` (by default `claims()`) taken in as few prompts as it can: each step that is one transaction
|
|
849
|
+
* of the wallet's is built first and the lot signed in one prompt when the wallet signs several at once
|
|
850
|
+
* (`wallet.signTransactions`); a lottery's steps depend on each other, so one of each lottery a call. The rest (a roll
|
|
851
|
+
* to settle, a refund, an auction to end…) go one by one after. Returns [{ claim, signature } | { claim, error }].
|
|
852
|
+
*/
|
|
853
|
+
claimAll(list: any): Promise<any[]>;
|
|
454
854
|
/** The player's collectibles of this project: [{ asset, item, itemId, name, uri, attributes, frozen }]. `item` is its key in the spec. */
|
|
455
855
|
collectibles: (owner?: any) => Promise<{
|
|
456
856
|
owner: string;
|