@xgamesfun/solana 0.26.3 → 0.27.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 +9 -9
- package/js/approve/live-check.mjs +106 -1
- package/js/approve/page.html +1 -1
- package/js/approve/page.js +19 -5
- package/js/approve/server.mjs +192 -33
- package/js/chain/metadata.js +92 -0
- package/js/client/compressed.js +12 -5
- package/js/client/idl/loot.js +1 -1
- package/js/client/idl/loot.json +53 -7
- package/js/client/ix.js +44 -9
- package/js/economy/check.mjs +12 -4
- package/js/economy/cost.mjs +6 -5
- package/js/economy/explain.mjs +3 -2
- package/js/economy/guide.mjs +2 -2
- package/js/economy/live.mjs +27 -7
- package/js/economy/model.mjs +13 -2
- package/js/economy/plan.mjs +84 -27
- package/js/economy/schema.json +7 -1
- package/js/mcp/tools.mjs +31 -11
- package/js/play/index.js +519 -193
- package/package.json +1 -1
- package/release.json +5 -5
- package/skills/xsolana-economy/SKILL.md +4 -4
- package/skills/xsolana-economy/references/apps.md +6 -0
- package/skills/xsolana-economy/references/telling-the-person.md +4 -2
- package/skills/xsolana-economy/references/trust-and-cheating.md +4 -3
- package/types/chain/metadata.d.ts +45 -0
- package/types/client/compressed.d.ts +5 -2
- package/types/client/ix.d.ts +38 -7
- package/types/economy/cost.d.mts +11 -3
- package/types/economy/live.d.mts +29 -5
- package/types/economy/model.d.mts +6 -0
- package/types/economy/plan.d.mts +22 -5
- package/types/play/index.d.ts +214 -129
package/types/play/index.d.ts
CHANGED
|
@@ -60,13 +60,14 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
60
60
|
settled: null;
|
|
61
61
|
says: string;
|
|
62
62
|
} | {
|
|
63
|
-
says?: undefined;
|
|
64
63
|
order: any;
|
|
65
64
|
won: any;
|
|
66
65
|
assets: any;
|
|
67
66
|
settled: any;
|
|
68
67
|
parts?: any[] | undefined;
|
|
69
68
|
asset?: any;
|
|
69
|
+
gone?: any[] | undefined;
|
|
70
|
+
says?: string | undefined;
|
|
70
71
|
} | {
|
|
71
72
|
signature: any;
|
|
72
73
|
assets: any[];
|
|
@@ -80,13 +81,14 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
80
81
|
settled: null;
|
|
81
82
|
says: string;
|
|
82
83
|
} | {
|
|
83
|
-
says?: undefined;
|
|
84
84
|
order: any;
|
|
85
85
|
won: any;
|
|
86
86
|
assets: any;
|
|
87
87
|
settled: any;
|
|
88
88
|
parts?: any[] | undefined;
|
|
89
89
|
asset?: any;
|
|
90
|
+
gone?: any[] | undefined;
|
|
91
|
+
says?: string | undefined;
|
|
90
92
|
})[] | undefined;
|
|
91
93
|
} | {
|
|
92
94
|
orders: ({
|
|
@@ -98,70 +100,24 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
98
100
|
settled: null;
|
|
99
101
|
says: string;
|
|
100
102
|
} | {
|
|
101
|
-
says?: undefined;
|
|
102
|
-
order: any;
|
|
103
|
-
won: any;
|
|
104
|
-
assets: any;
|
|
105
|
-
settled: any;
|
|
106
|
-
parts?: any[] | undefined;
|
|
107
|
-
asset?: any;
|
|
108
|
-
})[];
|
|
109
|
-
won: any[];
|
|
110
|
-
assets: any[];
|
|
111
|
-
parts: any[];
|
|
112
|
-
} | {
|
|
113
|
-
order: any;
|
|
114
|
-
settled: string;
|
|
115
|
-
says: string;
|
|
116
|
-
orders: ({
|
|
117
|
-
order: any;
|
|
118
|
-
settled: string;
|
|
119
|
-
says: string;
|
|
120
|
-
} | {
|
|
121
|
-
order: any;
|
|
122
|
-
settled: null;
|
|
123
|
-
says: string;
|
|
124
|
-
} | {
|
|
125
|
-
says?: undefined;
|
|
126
|
-
order: any;
|
|
127
|
-
won: any;
|
|
128
|
-
assets: any;
|
|
129
|
-
settled: any;
|
|
130
|
-
parts?: any[] | undefined;
|
|
131
|
-
asset?: any;
|
|
132
|
-
})[];
|
|
133
|
-
won: any[];
|
|
134
|
-
assets: any[];
|
|
135
|
-
parts: any[];
|
|
136
|
-
} | {
|
|
137
|
-
order: any;
|
|
138
|
-
settled: null;
|
|
139
|
-
says: string;
|
|
140
|
-
orders: ({
|
|
141
|
-
order: any;
|
|
142
|
-
settled: string;
|
|
143
|
-
says: string;
|
|
144
|
-
} | {
|
|
145
|
-
order: any;
|
|
146
|
-
settled: null;
|
|
147
|
-
says: string;
|
|
148
|
-
} | {
|
|
149
|
-
says?: undefined;
|
|
150
103
|
order: any;
|
|
151
104
|
won: any;
|
|
152
105
|
assets: any;
|
|
153
106
|
settled: any;
|
|
154
107
|
parts?: any[] | undefined;
|
|
155
108
|
asset?: any;
|
|
109
|
+
gone?: any[] | undefined;
|
|
110
|
+
says?: string | undefined;
|
|
156
111
|
})[];
|
|
157
112
|
won: any[];
|
|
158
113
|
assets: any[];
|
|
159
114
|
parts: any[];
|
|
160
115
|
} | {
|
|
161
|
-
says?: undefined;
|
|
162
116
|
order: any;
|
|
163
117
|
settled: any;
|
|
164
118
|
asset?: any;
|
|
119
|
+
gone?: any[] | undefined;
|
|
120
|
+
says?: string | undefined;
|
|
165
121
|
orders: ({
|
|
166
122
|
order: any;
|
|
167
123
|
settled: string;
|
|
@@ -171,13 +127,14 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
171
127
|
settled: null;
|
|
172
128
|
says: string;
|
|
173
129
|
} | {
|
|
174
|
-
says?: undefined;
|
|
175
130
|
order: any;
|
|
176
131
|
won: any;
|
|
177
132
|
assets: any;
|
|
178
133
|
settled: any;
|
|
179
134
|
parts?: any[] | undefined;
|
|
180
135
|
asset?: any;
|
|
136
|
+
gone?: any[] | undefined;
|
|
137
|
+
says?: string | undefined;
|
|
181
138
|
})[];
|
|
182
139
|
won: any[];
|
|
183
140
|
assets: any[];
|
|
@@ -197,13 +154,14 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
197
154
|
settled: null;
|
|
198
155
|
says: string;
|
|
199
156
|
} | {
|
|
200
|
-
says?: undefined;
|
|
201
157
|
order: any;
|
|
202
158
|
won: any;
|
|
203
159
|
assets: any;
|
|
204
160
|
settled: any;
|
|
205
161
|
parts?: any[] | undefined;
|
|
206
162
|
asset?: any;
|
|
163
|
+
gone?: any[] | undefined;
|
|
164
|
+
says?: string | undefined;
|
|
207
165
|
} | {
|
|
208
166
|
signature: any;
|
|
209
167
|
assets: any[];
|
|
@@ -217,13 +175,14 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
217
175
|
settled: null;
|
|
218
176
|
says: string;
|
|
219
177
|
} | {
|
|
220
|
-
says?: undefined;
|
|
221
178
|
order: any;
|
|
222
179
|
won: any;
|
|
223
180
|
assets: any;
|
|
224
181
|
settled: any;
|
|
225
182
|
parts?: any[] | undefined;
|
|
226
183
|
asset?: any;
|
|
184
|
+
gone?: any[] | undefined;
|
|
185
|
+
says?: string | undefined;
|
|
227
186
|
})[] | undefined;
|
|
228
187
|
} | {
|
|
229
188
|
orders: ({
|
|
@@ -235,70 +194,24 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
235
194
|
settled: null;
|
|
236
195
|
says: string;
|
|
237
196
|
} | {
|
|
238
|
-
says?: undefined;
|
|
239
|
-
order: any;
|
|
240
|
-
won: any;
|
|
241
|
-
assets: any;
|
|
242
|
-
settled: any;
|
|
243
|
-
parts?: any[] | undefined;
|
|
244
|
-
asset?: any;
|
|
245
|
-
})[];
|
|
246
|
-
won: any[];
|
|
247
|
-
assets: any[];
|
|
248
|
-
parts: any[];
|
|
249
|
-
} | {
|
|
250
|
-
order: any;
|
|
251
|
-
settled: string;
|
|
252
|
-
says: string;
|
|
253
|
-
orders: ({
|
|
254
|
-
order: any;
|
|
255
|
-
settled: string;
|
|
256
|
-
says: string;
|
|
257
|
-
} | {
|
|
258
|
-
order: any;
|
|
259
|
-
settled: null;
|
|
260
|
-
says: string;
|
|
261
|
-
} | {
|
|
262
|
-
says?: undefined;
|
|
263
197
|
order: any;
|
|
264
198
|
won: any;
|
|
265
199
|
assets: any;
|
|
266
200
|
settled: any;
|
|
267
201
|
parts?: any[] | undefined;
|
|
268
202
|
asset?: any;
|
|
203
|
+
gone?: any[] | undefined;
|
|
204
|
+
says?: string | undefined;
|
|
269
205
|
})[];
|
|
270
206
|
won: any[];
|
|
271
207
|
assets: any[];
|
|
272
208
|
parts: any[];
|
|
273
209
|
} | {
|
|
274
|
-
order: any;
|
|
275
|
-
settled: null;
|
|
276
|
-
says: string;
|
|
277
|
-
orders: ({
|
|
278
|
-
order: any;
|
|
279
|
-
settled: string;
|
|
280
|
-
says: string;
|
|
281
|
-
} | {
|
|
282
|
-
order: any;
|
|
283
|
-
settled: null;
|
|
284
|
-
says: string;
|
|
285
|
-
} | {
|
|
286
|
-
says?: undefined;
|
|
287
|
-
order: any;
|
|
288
|
-
won: any;
|
|
289
|
-
assets: any;
|
|
290
|
-
settled: any;
|
|
291
|
-
parts?: any[] | undefined;
|
|
292
|
-
asset?: any;
|
|
293
|
-
})[];
|
|
294
|
-
won: any[];
|
|
295
|
-
assets: any[];
|
|
296
|
-
parts: any[];
|
|
297
|
-
} | {
|
|
298
|
-
says?: undefined;
|
|
299
210
|
order: any;
|
|
300
211
|
settled: any;
|
|
301
212
|
asset?: any;
|
|
213
|
+
gone?: any[] | undefined;
|
|
214
|
+
says?: string | undefined;
|
|
302
215
|
orders: ({
|
|
303
216
|
order: any;
|
|
304
217
|
settled: string;
|
|
@@ -308,13 +221,14 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
308
221
|
settled: null;
|
|
309
222
|
says: string;
|
|
310
223
|
} | {
|
|
311
|
-
says?: undefined;
|
|
312
224
|
order: any;
|
|
313
225
|
won: any;
|
|
314
226
|
assets: any;
|
|
315
227
|
settled: any;
|
|
316
228
|
parts?: any[] | undefined;
|
|
317
229
|
asset?: any;
|
|
230
|
+
gone?: any[] | undefined;
|
|
231
|
+
says?: string | undefined;
|
|
318
232
|
})[];
|
|
319
233
|
won: any[];
|
|
320
234
|
assets: any[];
|
|
@@ -330,13 +244,14 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
330
244
|
settled: null;
|
|
331
245
|
says: string;
|
|
332
246
|
} | {
|
|
333
|
-
says?: undefined;
|
|
334
247
|
order: any;
|
|
335
248
|
won: any;
|
|
336
249
|
assets: any;
|
|
337
250
|
settled: any;
|
|
338
251
|
parts?: any[] | undefined;
|
|
339
252
|
asset?: any;
|
|
253
|
+
gone?: any[] | undefined;
|
|
254
|
+
says?: string | undefined;
|
|
340
255
|
}>;
|
|
341
256
|
/**
|
|
342
257
|
* Finds the settle keys a page that closed left holding the player's SOL, and finishes their jobs: a key whose order
|
|
@@ -369,7 +284,9 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
369
284
|
key: string;
|
|
370
285
|
swept: bigint;
|
|
371
286
|
})[]>;
|
|
372
|
-
/** Gives an order's payment back once its time has come (a roll that failed or never came).
|
|
287
|
+
/** Gives an order's payment back once its time has come (a roll that failed or never came). An NFT the project
|
|
288
|
+
* held for the roll goes back with it; one it no longer holds (its collection took it back or burned it) is not
|
|
289
|
+
* looked for, and the whole payment goes back all the same. */
|
|
373
290
|
refund(orderAddress: any): Promise<any>;
|
|
374
291
|
/** Asks the oracle for a roll a mission, a recipe or a prize made (its player or the project's keys may; the asker
|
|
375
292
|
* pays the oracle). Its first ask fixes its odds: the player's profile, and an NFT they show (`shown`; by default
|
|
@@ -550,18 +467,31 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
550
467
|
settled: null;
|
|
551
468
|
says: string;
|
|
552
469
|
} | {
|
|
553
|
-
says?: undefined;
|
|
554
470
|
order: any;
|
|
555
471
|
won: any;
|
|
556
472
|
assets: any;
|
|
557
473
|
settled: any;
|
|
558
474
|
parts?: any[] | undefined;
|
|
559
475
|
asset?: any;
|
|
476
|
+
gone?: any[] | undefined;
|
|
477
|
+
says?: string | undefined;
|
|
560
478
|
} | undefined;
|
|
561
479
|
}>;
|
|
562
480
|
/**
|
|
563
481
|
* Hands an NFT of any kind to the project until a time (a hold): `seconds` from now, or `{ until }` (Unix seconds).
|
|
564
482
|
* The hold's address names its end. Returns { signature, freeAt }.
|
|
483
|
+
*
|
|
484
|
+
* Like every route that hands an NFT in (`stakeNft` in escrow, `borrow`, `enter`, `bid`, `listForSale`,
|
|
485
|
+
* `listForRent`, a ticket paid with an NFT, a box that rolls on one), it first clears what an earlier owner of the
|
|
486
|
+
* NFT left in this project: a hold or a listing that stayed open when whoever controls the NFT's collection took it
|
|
487
|
+
* out of the project's hands. Left open, such a record could take the NFT once the project holds it again. The
|
|
488
|
+
* player holds the NFT now, so the program closes each on that proof (a hold by `release`, a listing by
|
|
489
|
+
* `take_listing`, nothing sent or paid), in front of the deposit in the same transaction, or in a transaction of
|
|
490
|
+
* their own before it when the two do not fit one. The closes cost the player their transaction fee only: each
|
|
491
|
+
* record's rent goes to whoever that record names (a hold's payer, a listing's maker), never to the player. Only
|
|
492
|
+
* what can't be closed still refuses the deposit, in words (a listing whose rental still runs: the program keeps
|
|
493
|
+
* it until the rental has run); `acceptLeftover: true` goes ahead all the same. NFTs of the project's own
|
|
494
|
+
* collections are not read.
|
|
565
495
|
*/
|
|
566
496
|
hold(asset: any, seconds: any, { acceptLeftover, ...others }?: Readonly<Record<string, any>>): Promise<{
|
|
567
497
|
signature: any;
|
|
@@ -613,7 +543,9 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
613
543
|
* borrower in the same instruction: one prompt. `repay`: the debt the payer was shown (`loan()`'s, in base units);
|
|
614
544
|
* the program refuses any other (`TermsChanged`). An NFT its collection took back or burned while the project held
|
|
615
545
|
* it is refused here, before anything is signed: the program takes no repayment for it, and the borrower keeps what
|
|
616
|
-
* they borrowed.
|
|
546
|
+
* they borrowed. Such a loan is closed for nothing instead: `claims()` lists it for its borrower and its lender, and
|
|
547
|
+
* `claim` of it closes the hold (nothing is repaid, and the hold's rent goes back to whoever paid it). When the NFT
|
|
548
|
+
* can't move now (frozen for now, or its collection refuses the move), or `home` is
|
|
617
549
|
* false, the money goes alone, so the loan does not fall due: the hold is then over, and anyone sends the NFT home
|
|
618
550
|
* once it can move (`claims()` lists it). A compressed NFT is proven in the same transaction; the money alone for one
|
|
619
551
|
* whose proof keeps going out of date goes without it. Returns { signature, home }, and `says` when the NFT waits.
|
|
@@ -661,10 +593,10 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
661
593
|
* be a hold one, and sends each on with a release after it (`releases`).
|
|
662
594
|
*/
|
|
663
595
|
endAuction(auctionKey: any, { holders, ...others }?: Readonly<Record<string, any>>): Promise<{
|
|
664
|
-
says?: undefined;
|
|
665
596
|
owedPaid: any;
|
|
666
597
|
waiting?: undefined;
|
|
667
598
|
paid: any;
|
|
599
|
+
says?: undefined;
|
|
668
600
|
releases?: undefined;
|
|
669
601
|
} | {
|
|
670
602
|
owedPaid: any;
|
|
@@ -673,9 +605,9 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
673
605
|
says: string;
|
|
674
606
|
releases?: undefined;
|
|
675
607
|
} | {
|
|
676
|
-
says?: undefined;
|
|
677
608
|
owedPaid: any;
|
|
678
609
|
waiting?: undefined;
|
|
610
|
+
says?: undefined;
|
|
679
611
|
paid: any;
|
|
680
612
|
releases: any[];
|
|
681
613
|
} | {
|
|
@@ -687,7 +619,6 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
687
619
|
waiting: boolean;
|
|
688
620
|
says: string;
|
|
689
621
|
} | {
|
|
690
|
-
says?: undefined;
|
|
691
622
|
winner?: any;
|
|
692
623
|
asset?: any;
|
|
693
624
|
waiting?: undefined;
|
|
@@ -702,22 +633,24 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
702
633
|
settled: null;
|
|
703
634
|
says: string;
|
|
704
635
|
} | {
|
|
705
|
-
says?: undefined;
|
|
706
636
|
order: any;
|
|
707
637
|
won: any;
|
|
708
638
|
assets: any;
|
|
709
639
|
settled: any;
|
|
710
640
|
parts?: any[] | undefined;
|
|
711
641
|
asset?: any;
|
|
642
|
+
gone?: any[] | undefined;
|
|
643
|
+
says?: string | undefined;
|
|
712
644
|
} | undefined;
|
|
713
|
-
} | {
|
|
714
645
|
says?: undefined;
|
|
646
|
+
} | {
|
|
715
647
|
winner?: any;
|
|
716
648
|
asset?: any;
|
|
717
649
|
waiting?: undefined;
|
|
718
650
|
signature: any;
|
|
719
651
|
lotFirst: boolean;
|
|
720
652
|
paid: any;
|
|
653
|
+
says?: undefined;
|
|
721
654
|
releases?: undefined;
|
|
722
655
|
} | {
|
|
723
656
|
winner?: any;
|
|
@@ -729,12 +662,12 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
729
662
|
says: string;
|
|
730
663
|
releases?: undefined;
|
|
731
664
|
} | {
|
|
732
|
-
says?: undefined;
|
|
733
665
|
winner?: any;
|
|
734
666
|
asset?: any;
|
|
735
667
|
waiting?: undefined;
|
|
736
668
|
signature: any;
|
|
737
669
|
lotFirst: boolean;
|
|
670
|
+
says?: undefined;
|
|
738
671
|
paid: any;
|
|
739
672
|
releases: any[];
|
|
740
673
|
}>;
|
|
@@ -745,10 +678,10 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
745
678
|
* an NFT of the winning bid is gone (`endAuction` does it then). Refused once the lot went to its winner (`CantCallOff`).
|
|
746
679
|
*/
|
|
747
680
|
callOffSale(auctionKey: any, { ...others }?: Readonly<Record<string, any>>): Promise<{
|
|
748
|
-
says?: undefined;
|
|
749
681
|
owedPaid: any;
|
|
750
682
|
waiting?: undefined;
|
|
751
683
|
paid: any;
|
|
684
|
+
says?: undefined;
|
|
752
685
|
releases?: undefined;
|
|
753
686
|
} | {
|
|
754
687
|
owedPaid: any;
|
|
@@ -757,9 +690,9 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
757
690
|
says: string;
|
|
758
691
|
releases?: undefined;
|
|
759
692
|
} | {
|
|
760
|
-
says?: undefined;
|
|
761
693
|
owedPaid: any;
|
|
762
694
|
waiting?: undefined;
|
|
695
|
+
says?: undefined;
|
|
763
696
|
paid: any;
|
|
764
697
|
releases: any[];
|
|
765
698
|
} | {
|
|
@@ -771,7 +704,6 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
771
704
|
waiting: boolean;
|
|
772
705
|
says: string;
|
|
773
706
|
} | {
|
|
774
|
-
says?: undefined;
|
|
775
707
|
winner?: any;
|
|
776
708
|
asset?: any;
|
|
777
709
|
waiting?: undefined;
|
|
@@ -786,22 +718,24 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
786
718
|
settled: null;
|
|
787
719
|
says: string;
|
|
788
720
|
} | {
|
|
789
|
-
says?: undefined;
|
|
790
721
|
order: any;
|
|
791
722
|
won: any;
|
|
792
723
|
assets: any;
|
|
793
724
|
settled: any;
|
|
794
725
|
parts?: any[] | undefined;
|
|
795
726
|
asset?: any;
|
|
727
|
+
gone?: any[] | undefined;
|
|
728
|
+
says?: string | undefined;
|
|
796
729
|
} | undefined;
|
|
797
|
-
} | {
|
|
798
730
|
says?: undefined;
|
|
731
|
+
} | {
|
|
799
732
|
winner?: any;
|
|
800
733
|
asset?: any;
|
|
801
734
|
waiting?: undefined;
|
|
802
735
|
signature: any;
|
|
803
736
|
lotFirst: boolean;
|
|
804
737
|
paid: any;
|
|
738
|
+
says?: undefined;
|
|
805
739
|
releases?: undefined;
|
|
806
740
|
} | {
|
|
807
741
|
winner?: any;
|
|
@@ -813,12 +747,12 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
813
747
|
says: string;
|
|
814
748
|
releases?: undefined;
|
|
815
749
|
} | {
|
|
816
|
-
says?: undefined;
|
|
817
750
|
winner?: any;
|
|
818
751
|
asset?: any;
|
|
819
752
|
waiting?: undefined;
|
|
820
753
|
signature: any;
|
|
821
754
|
lotFirst: boolean;
|
|
755
|
+
says?: undefined;
|
|
822
756
|
paid: any;
|
|
823
757
|
releases: any[];
|
|
824
758
|
}>;
|
|
@@ -839,24 +773,64 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
839
773
|
* `maxPeriods` at once. Nobody can end a rental early; the next renter takes it once one is over, until it is unlisted.
|
|
840
774
|
*/
|
|
841
775
|
listForRent(asset: any, { price, lasts, maxPeriods, currency, shares, acceptLeftover, ...others }?: Readonly<Record<string, any>>): Promise<any>;
|
|
842
|
-
/**
|
|
776
|
+
/**
|
|
777
|
+
* The listing of `asset` (one account read), or null: { listing, asset, maker, mint, deal, renter, until }. One more
|
|
778
|
+
* read says whether the project still holds the NFT: when whoever controls its collection took it back or burned
|
|
779
|
+
* it, the listing is flagged `gone` with `says`, what that means in words. There is then nothing to buy or rent,
|
|
780
|
+
* and the listing can be closed for nothing (`unlist` by its maker, `closeGone` by anyone).
|
|
781
|
+
*/
|
|
843
782
|
listing(asset: any): Promise<any>;
|
|
844
783
|
/** Who rents `asset` now (one account read, then a check that the project still holds it), or null. */
|
|
845
784
|
rentedTo(asset: any): Promise<any>;
|
|
846
|
-
/**
|
|
785
|
+
/**
|
|
786
|
+
* The project's listings, a maker's (`maker`) or all: one search of the program's accounts, then one read of the
|
|
787
|
+
* listed NFTs together, which flags a listing `gone` (with `says`) when the project no longer holds its NFT: a
|
|
788
|
+
* Core asset held by another or burned, a Token Metadata NFT whose token left the project's account. A compressed
|
|
789
|
+
* NFT is not read here (an indexer's answer for each): `listing(asset)` says it for one.
|
|
790
|
+
*/
|
|
847
791
|
listings({ maker, ...others }?: Readonly<Record<string, any>>): Promise<any>;
|
|
848
792
|
/**
|
|
849
793
|
* Buys a listed NFT at the terms the player saw: `listing`, as `listing()` or `listings()` showed it. It is
|
|
850
794
|
* required: the terms signed are those, never the listing read now, so a price or a share changed since is refused.
|
|
795
|
+
* A listing whose NFT the project no longer holds (its collection took it back or burned it) is refused in words
|
|
796
|
+
* before anything is signed: nothing is there to buy, and anyone can close that listing for nothing (`closeGone`).
|
|
851
797
|
*/
|
|
852
798
|
buyListing(asset: any, { listing, ...others }?: Readonly<Record<string, any>>): Promise<any>;
|
|
853
799
|
/**
|
|
854
800
|
* Rents a listed NFT for `periods` periods, at the terms the player saw: `listing`, as `listing()` or `listings()`
|
|
855
|
-
* showed it (required, as for `buyListing`).
|
|
801
|
+
* showed it (required, as for `buyListing`). One whose NFT the project no longer holds is refused in words, as
|
|
802
|
+
* `buyListing` refuses it.
|
|
856
803
|
*/
|
|
857
804
|
rentListing(asset: any, { periods, listing, ...others }?: Readonly<Record<string, any>>): Promise<any>;
|
|
858
|
-
/**
|
|
805
|
+
/**
|
|
806
|
+
* Takes a listed NFT home (its maker). While a rental runs it only stops the listing; call again once it is over.
|
|
807
|
+
* A listing whose NFT the project no longer holds (its collection took it back or burned it) closes without it, on
|
|
808
|
+
* that proof: nothing is sent, and the listing's rent comes back to its maker. While a rental of it still runs,
|
|
809
|
+
* that close too only stops the listing, and closes it once the rental has run.
|
|
810
|
+
*/
|
|
859
811
|
unlist(asset: any): Promise<any>;
|
|
812
|
+
/**
|
|
813
|
+
* Closes what this project still records of an NFT it no longer holds (`asset`: whoever controls its collection
|
|
814
|
+
* took it out of the project's hands or burned it): each hold of it (`release`) and its listing (`take_listing`),
|
|
815
|
+
* on the proof that it is gone. Anyone may, at any time, also while a hold runs and for a loan before it is due:
|
|
816
|
+
* nothing is sent or paid, and a loan's debt ends unpaid. The sender pays the transaction's fee only; each
|
|
817
|
+
* record's rent goes to whoever that record names (a hold's payer, a listing's maker), never to the sender. A
|
|
818
|
+
* listing whose rental still runs is left (`waits`): the program keeps a running rental, and the listing closes
|
|
819
|
+
* once it has run. Refused in words, with nothing sent, when the project still holds the NFT or nothing shows it
|
|
820
|
+
* gone. Returns { signature, closed: [{ kind, address }], waits: [{ kind, address }] }; `signature` is null when
|
|
821
|
+
* there was nothing to close.
|
|
822
|
+
*/
|
|
823
|
+
closeGone(asset: any): Promise<{
|
|
824
|
+
signature: any;
|
|
825
|
+
closed: {
|
|
826
|
+
kind: any;
|
|
827
|
+
address: any;
|
|
828
|
+
}[];
|
|
829
|
+
waits: {
|
|
830
|
+
kind: any;
|
|
831
|
+
address: any;
|
|
832
|
+
}[];
|
|
833
|
+
}>;
|
|
860
834
|
/**
|
|
861
835
|
* The project's owner raffles an NFT they hold, as lottery `id`: the NFT goes into the lottery's own stash, where
|
|
862
836
|
* nothing but the lottery can take it while a place names it; the winner gets it before any ticket money moves.
|
|
@@ -899,15 +873,126 @@ export declare function solanaApp({ spec, rpcUrl, rpc, wallet, programs, now, ke
|
|
|
899
873
|
}[]>;
|
|
900
874
|
/**
|
|
901
875
|
* What this player can finish now, themselves: a box to settle or refund, a contest entry to claim, a held
|
|
902
|
-
* collectible to take home,
|
|
876
|
+
* collectible to take home, a hold of theirs or a loan they made or took whose NFT the project no longer holds (its
|
|
877
|
+
* collection took it back or burned it: listed at any time, also while the hold runs, as a `release` flagged
|
|
878
|
+
* `gone`, whose claim closes the hold and sends nothing), an auction they won (or one off by the clock: their bid back), a lottery place they
|
|
903
879
|
* won, a draw that is due (anyone may reveal it, or ask again when the oracle never answered; it takes 0.0008
|
|
904
880
|
* SOL), and a drawn lottery's unpaid places, which anyone may pay so the next round can open. [{ kind, says, … }];
|
|
905
881
|
* a winner's first claim of a contest of tokens carries `potUnits` and `prizeUnits`, its part as the decision wrote
|
|
906
882
|
* it (base units, as text). Pass one to `claim`.
|
|
907
883
|
*/
|
|
908
|
-
claims(): Promise<
|
|
884
|
+
claims(): Promise<({
|
|
885
|
+
key?: undefined;
|
|
886
|
+
tree?: undefined;
|
|
887
|
+
kind: string;
|
|
888
|
+
order: any;
|
|
889
|
+
says: string;
|
|
890
|
+
round?: undefined;
|
|
891
|
+
pulls?: undefined;
|
|
892
|
+
asset?: undefined;
|
|
893
|
+
table?: undefined;
|
|
894
|
+
} | {
|
|
895
|
+
key?: undefined;
|
|
896
|
+
tree?: undefined;
|
|
897
|
+
order?: undefined;
|
|
898
|
+
kind: string;
|
|
899
|
+
id: any;
|
|
900
|
+
side: any;
|
|
901
|
+
says: string;
|
|
902
|
+
potUnits?: string | undefined;
|
|
903
|
+
prizeUnits?: string | undefined;
|
|
904
|
+
round?: undefined;
|
|
905
|
+
pulls?: undefined;
|
|
906
|
+
asset?: undefined;
|
|
907
|
+
table?: undefined;
|
|
908
|
+
} | {
|
|
909
|
+
key?: undefined;
|
|
910
|
+
tree?: undefined;
|
|
911
|
+
order?: undefined;
|
|
912
|
+
kind: string;
|
|
913
|
+
asset: any;
|
|
914
|
+
hold: any;
|
|
915
|
+
gone: boolean;
|
|
916
|
+
says: string;
|
|
917
|
+
round?: undefined;
|
|
918
|
+
pulls?: undefined;
|
|
919
|
+
table?: undefined;
|
|
920
|
+
} | {
|
|
921
|
+
key?: undefined;
|
|
922
|
+
tree?: undefined;
|
|
923
|
+
order?: undefined;
|
|
924
|
+
kind: string;
|
|
925
|
+
asset: any;
|
|
926
|
+
hold: any;
|
|
927
|
+
says: string;
|
|
928
|
+
round?: undefined;
|
|
929
|
+
pulls?: undefined;
|
|
930
|
+
table?: undefined;
|
|
931
|
+
} | {
|
|
932
|
+
key?: undefined;
|
|
933
|
+
order?: undefined;
|
|
934
|
+
kind: string;
|
|
935
|
+
asset: string;
|
|
936
|
+
tree: string;
|
|
937
|
+
says: string;
|
|
938
|
+
round?: undefined;
|
|
939
|
+
pulls?: undefined;
|
|
940
|
+
table?: undefined;
|
|
941
|
+
} | {
|
|
942
|
+
tree?: undefined;
|
|
943
|
+
order?: undefined;
|
|
944
|
+
kind: string;
|
|
945
|
+
key: any;
|
|
946
|
+
says: string;
|
|
947
|
+
round?: undefined;
|
|
948
|
+
pulls?: undefined;
|
|
949
|
+
asset?: undefined;
|
|
950
|
+
table?: undefined;
|
|
951
|
+
} | {
|
|
952
|
+
tree?: undefined;
|
|
953
|
+
order?: undefined;
|
|
954
|
+
kind: string;
|
|
955
|
+
key: any;
|
|
956
|
+
round: any;
|
|
957
|
+
says: string;
|
|
958
|
+
pulls?: undefined;
|
|
959
|
+
asset?: undefined;
|
|
960
|
+
table?: undefined;
|
|
961
|
+
} | {
|
|
962
|
+
tree?: undefined;
|
|
963
|
+
order?: undefined;
|
|
964
|
+
kind: string;
|
|
965
|
+
key: any;
|
|
966
|
+
round: any;
|
|
967
|
+
pulls: any;
|
|
968
|
+
says: string;
|
|
969
|
+
asset?: undefined;
|
|
970
|
+
table?: undefined;
|
|
971
|
+
} | {
|
|
972
|
+
key?: undefined;
|
|
973
|
+
tree?: undefined;
|
|
974
|
+
order?: undefined;
|
|
975
|
+
round?: undefined;
|
|
976
|
+
pulls?: undefined;
|
|
977
|
+
kind: string;
|
|
978
|
+
asset: any;
|
|
979
|
+
says: string;
|
|
980
|
+
table?: undefined;
|
|
981
|
+
} | {
|
|
982
|
+
key?: undefined;
|
|
983
|
+
tree?: undefined;
|
|
984
|
+
order?: undefined;
|
|
985
|
+
round?: undefined;
|
|
986
|
+
pulls?: undefined;
|
|
987
|
+
asset?: undefined;
|
|
988
|
+
kind: string;
|
|
989
|
+
table: any;
|
|
990
|
+
says: string;
|
|
991
|
+
})[]>;
|
|
909
992
|
/**
|
|
910
|
-
* Finishes one of `claims()`, signed by this player. Returns the signature. A
|
|
993
|
+
* Finishes one of `claims()`, signed by this player. Returns the signature. A `release` flagged `gone` closes its
|
|
994
|
+
* hold on the proof that the project no longer holds the NFT: nothing is sent, the hold's rent goes back to whoever
|
|
995
|
+
* paid it, and a loan's debt ends unpaid. A winner of a contest of NFTs picks
|
|
911
996
|
* which loser's NFT they take (`{ take: asset }`, the NFT of a losing entry that still holds one; the first found by default):
|
|
912
997
|
* only the winner can, while any are left.
|
|
913
998
|
*/
|