@xgamesfun/solana 0.24.0 → 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 +94 -51
- package/bin/xsolana.mjs +23 -8
- package/examples/blind-forge.json +2 -4
- package/examples/coin-flip-arena.json +2 -5
- package/examples/duel-arena.json +1 -4
- package/examples/fair-presale.json +1 -3
- package/examples/hero-trials.json +14 -2
- 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/nft-raffle.json +1 -0
- package/examples/pack-league.json +108 -0
- package/examples/partner-vault.json +19 -3
- package/examples/sacrifice-raffle.json +2 -10
- package/examples/shelter-fair.json +1 -0
- package/examples/stakers-draw.json +3 -7
- package/examples/stride-sneakers.json +164 -0
- package/examples/trade-in-shop.json +2 -3
- package/js/approve/details.mjs +117 -48
- 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 +276 -74
- package/js/chain/base58.js +7 -1
- package/js/chain/borsh.js +15 -11
- package/js/chain/bytes.js +11 -8
- package/js/chain/core.js +21 -5
- package/js/chain/curve.js +1 -1
- package/js/chain/lookup.js +118 -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 +40 -14
- 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 +270 -80
- package/js/client/compressed.js +4 -3
- package/js/client/grant.js +165 -40
- package/js/client/idl/loot.js +1 -1
- package/js/client/idl/loot.json +104 -16
- package/js/client/ix.js +2121 -457
- package/js/client/pda.js +20 -18
- package/js/client/policy.js +12 -5
- package/js/client/random.js +1 -1
- package/js/client/sizes.js +220 -65
- package/js/client/traits.js +14 -5
- package/js/connect/connect.mjs +59 -17
- package/js/economy/check.mjs +3873 -690
- package/js/economy/cost.mjs +380 -56
- package/js/economy/examples.mjs +176 -35
- package/js/economy/explain.mjs +461 -110
- package/js/economy/guide.mjs +282 -59
- package/js/economy/legal.mjs +12 -6
- package/js/economy/live.mjs +60 -19
- package/js/economy/model.mjs +320 -97
- package/js/economy/plan.mjs +1022 -203
- package/js/economy/schema.json +127 -369
- package/js/economy/secrets.mjs +17 -7
- package/js/economy/simulate.mjs +771 -178
- 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 +293 -80
- package/js/play/index.js +1960 -461
- package/js/play/keys.js +35 -9
- 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 +30 -16
- package/skills/xsolana-economy/references/after-launch.md +30 -20
- package/skills/xsolana-economy/references/apps.md +47 -36
- package/skills/xsolana-economy/references/sentence-to-spec.md +148 -129
- package/skills/xsolana-economy/references/telling-the-person.md +9 -6
- package/types/chain/core.d.ts +1 -1
- package/types/chain/lookup.d.ts +1 -1
- package/types/client/accounts.d.ts +24 -3
- package/types/client/grant.d.ts +2 -2
- package/types/client/idl/loot.d.ts +22 -0
- package/types/client/ix.d.ts +54 -45
- package/types/client/pda.d.ts +3 -1
- package/types/economy/guide.d.mts +5 -0
- package/types/economy/model.d.mts +48 -3
- package/types/economy/plan.d.mts +44 -2
- package/types/play/index.d.ts +8 -19
- 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/js/client/idl/loot.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"address": "9cwqM1TXytPnFZsLfmUyv2dg4uW6Ch9C6UJVPns7NFQ",
|
|
3
3
|
"metadata": {
|
|
4
4
|
"name": "loot",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.25.0",
|
|
6
6
|
"spec": "0.1.0",
|
|
7
7
|
"description": "Economy for Anything: one program every coin of a project passes through",
|
|
8
8
|
"repository": "https://github.com/gamesfun/loot"
|
|
@@ -10392,10 +10392,23 @@
|
|
|
10392
10392
|
"name": "unclaimed",
|
|
10393
10393
|
"docs": [
|
|
10394
10394
|
"What the winning side put in and has not yet claimed for (in a contest of NFTs, its winners",
|
|
10395
|
-
"whose first claim has not come)
|
|
10395
|
+
"whose first claim has not come)."
|
|
10396
10396
|
],
|
|
10397
10397
|
"type": "u64"
|
|
10398
10398
|
},
|
|
10399
|
+
{
|
|
10400
|
+
"name": "pot_won",
|
|
10401
|
+
"docs": [
|
|
10402
|
+
"Written when a side is named: what the pot holds for the winners once the shares are taken,",
|
|
10403
|
+
"and what arrived in a split prize's vault. Each winning entry takes its part of these, by",
|
|
10404
|
+
"what it put in, whatever reaches the accounts later."
|
|
10405
|
+
],
|
|
10406
|
+
"type": "u64"
|
|
10407
|
+
},
|
|
10408
|
+
{
|
|
10409
|
+
"name": "prize_won",
|
|
10410
|
+
"type": "u64"
|
|
10411
|
+
},
|
|
10399
10412
|
{
|
|
10400
10413
|
"name": "shares",
|
|
10401
10414
|
"docs": [
|
|
@@ -13164,6 +13177,22 @@
|
|
|
13164
13177
|
"The most tickets one wallet holds in a round (`counter.rs`), read at each purchase. 0: no limit."
|
|
13165
13178
|
],
|
|
13166
13179
|
"type": "u32"
|
|
13180
|
+
},
|
|
13181
|
+
{
|
|
13182
|
+
"name": "pots",
|
|
13183
|
+
"docs": [
|
|
13184
|
+
"The pots it has opened, one bit for each `id` (`PaysFrom::Pot`): a close empties every one."
|
|
13185
|
+
],
|
|
13186
|
+
"type": "u16"
|
|
13187
|
+
},
|
|
13188
|
+
{
|
|
13189
|
+
"name": "owing",
|
|
13190
|
+
"docs": [
|
|
13191
|
+
"The last round paid from a pot that may still owe that pot what its places left (`pot_owed`):",
|
|
13192
|
+
"the next ask from a pot (any of them) moves it in first, so a prize never depends on whether",
|
|
13193
|
+
"someone pulled it. The default address: none."
|
|
13194
|
+
],
|
|
13195
|
+
"type": "pubkey"
|
|
13167
13196
|
}
|
|
13168
13197
|
]
|
|
13169
13198
|
}
|
|
@@ -13176,7 +13205,7 @@
|
|
|
13176
13205
|
{
|
|
13177
13206
|
"name": "terms",
|
|
13178
13207
|
"docs": [
|
|
13179
|
-
"Its round's terms;
|
|
13208
|
+
"Its round's terms; its mint kept by every edit."
|
|
13180
13209
|
],
|
|
13181
13210
|
"type": {
|
|
13182
13211
|
"defined": {
|
|
@@ -13349,23 +13378,33 @@
|
|
|
13349
13378
|
{
|
|
13350
13379
|
"name": "price",
|
|
13351
13380
|
"docs": [
|
|
13352
|
-
"The price of one ticket, in
|
|
13381
|
+
"The price of one ticket, in `mint` (or in `ticket_mint`)."
|
|
13353
13382
|
],
|
|
13354
13383
|
"type": "u64"
|
|
13355
13384
|
},
|
|
13356
13385
|
{
|
|
13357
13386
|
"name": "mint",
|
|
13358
13387
|
"docs": [
|
|
13359
|
-
"The mint
|
|
13360
|
-
"pot is open."
|
|
13388
|
+
"The mint ticket money and the places' parts are in, and every pot's. An edit keeps it."
|
|
13361
13389
|
],
|
|
13362
13390
|
"type": "pubkey"
|
|
13363
13391
|
},
|
|
13392
|
+
{
|
|
13393
|
+
"name": "pays_from",
|
|
13394
|
+
"docs": [
|
|
13395
|
+
"Where the places are paid from: this round's own money, or a pot."
|
|
13396
|
+
],
|
|
13397
|
+
"type": {
|
|
13398
|
+
"defined": {
|
|
13399
|
+
"name": "PaysFrom"
|
|
13400
|
+
}
|
|
13401
|
+
}
|
|
13402
|
+
},
|
|
13364
13403
|
{
|
|
13365
13404
|
"name": "shares",
|
|
13366
13405
|
"docs": [
|
|
13367
|
-
"Where ticket money goes before the
|
|
13368
|
-
"
|
|
13406
|
+
"Where ticket money goes before the places (one may be the buyer's choice): what they leave is",
|
|
13407
|
+
"the round's part for its places (`LotteryRound::to_pot`). Empty when tickets are burned."
|
|
13369
13408
|
],
|
|
13370
13409
|
"type": {
|
|
13371
13410
|
"vec": {
|
|
@@ -13378,8 +13417,8 @@
|
|
|
13378
13417
|
{
|
|
13379
13418
|
"name": "places",
|
|
13380
13419
|
"docs": [
|
|
13381
|
-
"What each place wins, first place first, as runs of places alike (`Place::times`): a
|
|
13382
|
-
"the
|
|
13420
|
+
"What each place wins, first place first, as runs of places alike (`Place::times`): a part of",
|
|
13421
|
+
"what the round pays from, a prize, or both. Written empty: one winner who takes all."
|
|
13383
13422
|
],
|
|
13384
13423
|
"type": {
|
|
13385
13424
|
"vec": {
|
|
@@ -13393,7 +13432,7 @@
|
|
|
13393
13432
|
"name": "ticket_mint",
|
|
13394
13433
|
"docs": [
|
|
13395
13434
|
"When set, a ticket costs `price` of this mint and is burned, and no ticket money reaches",
|
|
13396
|
-
"the
|
|
13435
|
+
"the places. The default address means there is none: tickets pay into the pot. It may change",
|
|
13397
13436
|
"between rounds: each round has its own account of it."
|
|
13398
13437
|
],
|
|
13399
13438
|
"type": "pubkey"
|
|
@@ -13424,7 +13463,7 @@
|
|
|
13424
13463
|
"name": "returns",
|
|
13425
13464
|
"docs": [
|
|
13426
13465
|
"No loss: every ticket goes back to its buyer once the round is drawn, and the winners take",
|
|
13427
|
-
"only the pot (what is paid into it: yield, a sponsor). No shares, no ticket mint."
|
|
13466
|
+
"only the pot (what is paid into it: yield, a sponsor). No shares, no ticket mint; paid from a pot."
|
|
13428
13467
|
],
|
|
13429
13468
|
"type": "bool"
|
|
13430
13469
|
},
|
|
@@ -14533,6 +14572,36 @@
|
|
|
14533
14572
|
]
|
|
14534
14573
|
}
|
|
14535
14574
|
},
|
|
14575
|
+
{
|
|
14576
|
+
"name": "PaysFrom",
|
|
14577
|
+
"docs": [
|
|
14578
|
+
"Where a round's places are paid from."
|
|
14579
|
+
],
|
|
14580
|
+
"type": {
|
|
14581
|
+
"kind": "enum",
|
|
14582
|
+
"variants": [
|
|
14583
|
+
{
|
|
14584
|
+
"name": "Round",
|
|
14585
|
+
"fields": [
|
|
14586
|
+
{
|
|
14587
|
+
"name": "rest",
|
|
14588
|
+
"type": {
|
|
14589
|
+
"defined": {
|
|
14590
|
+
"name": "To"
|
|
14591
|
+
}
|
|
14592
|
+
}
|
|
14593
|
+
}
|
|
14594
|
+
]
|
|
14595
|
+
},
|
|
14596
|
+
{
|
|
14597
|
+
"name": "Pot",
|
|
14598
|
+
"fields": [
|
|
14599
|
+
"u8"
|
|
14600
|
+
]
|
|
14601
|
+
}
|
|
14602
|
+
]
|
|
14603
|
+
}
|
|
14604
|
+
},
|
|
14536
14605
|
{
|
|
14537
14606
|
"name": "PerWallet",
|
|
14538
14607
|
"docs": [
|
|
@@ -14568,7 +14637,8 @@
|
|
|
14568
14637
|
{
|
|
14569
14638
|
"name": "Place",
|
|
14570
14639
|
"docs": [
|
|
14571
|
-
"A run of places alike: `times` places, each taking `bps`
|
|
14640
|
+
"A run of places alike: `times` places, each taking `bps` (basis points) of what the round pays",
|
|
14641
|
+
"from (`PaysFrom`: its own money, or a pot with it) and a prize",
|
|
14572
14642
|
"for its winner (`prize.rs`): a raffled NFT, a collectible, tokens, a roll of a box."
|
|
14573
14643
|
],
|
|
14574
14644
|
"type": {
|
|
@@ -16225,11 +16295,13 @@
|
|
|
16225
16295
|
]
|
|
16226
16296
|
},
|
|
16227
16297
|
{
|
|
16228
|
-
"name": "
|
|
16298
|
+
"name": "OneOf",
|
|
16229
16299
|
"fields": [
|
|
16230
16300
|
{
|
|
16231
|
-
"name": "
|
|
16232
|
-
"type":
|
|
16301
|
+
"name": "texts",
|
|
16302
|
+
"type": {
|
|
16303
|
+
"vec": "string"
|
|
16304
|
+
}
|
|
16233
16305
|
}
|
|
16234
16306
|
]
|
|
16235
16307
|
},
|
|
@@ -17011,6 +17083,22 @@
|
|
|
17011
17083
|
"type": "u64",
|
|
17012
17084
|
"value": "10000000"
|
|
17013
17085
|
},
|
|
17086
|
+
{
|
|
17087
|
+
"name": "MAX_ONE_OF",
|
|
17088
|
+
"docs": [
|
|
17089
|
+
"The most texts a rule's `Test::OneOf` matches."
|
|
17090
|
+
],
|
|
17091
|
+
"type": "u32",
|
|
17092
|
+
"value": "16"
|
|
17093
|
+
},
|
|
17094
|
+
{
|
|
17095
|
+
"name": "MAX_POTS",
|
|
17096
|
+
"docs": [
|
|
17097
|
+
"The most pots one lottery keeps (`PaysFrom::Pot`), each at `[\"pot\", lottery, id]`, `id` below this."
|
|
17098
|
+
],
|
|
17099
|
+
"type": "u8",
|
|
17100
|
+
"value": "16"
|
|
17101
|
+
},
|
|
17014
17102
|
{
|
|
17015
17103
|
"name": "MAX_RUN_PLACES",
|
|
17016
17104
|
"type": "u32",
|