@xgamesfun/solana 0.24.0 → 0.25.1
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/DISCLAIMER.md +1 -1
- package/NOTICE +4 -4
- package/README.md +100 -52
- package/bin/xsolana.mjs +32 -11
- 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/ideas.json +788 -788
- package/examples/nft-raffle.json +1 -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 +4 -7
- 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 +2 -2
- 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 +3884 -690
- package/js/economy/cost.mjs +381 -57
- package/js/economy/examples.mjs +176 -35
- package/js/economy/explain.mjs +468 -110
- package/js/economy/guide.mjs +282 -59
- package/js/economy/legal.mjs +12 -6
- package/js/economy/live.mjs +62 -20
- package/js/economy/model.mjs +320 -97
- package/js/economy/plan.mjs +1022 -203
- package/js/economy/review.mjs +760 -0
- package/js/economy/schema.json +134 -372
- package/js/economy/secrets.mjs +17 -7
- package/js/economy/simulate.mjs +771 -178
- package/js/economy/trust.mjs +15 -0
- package/js/economy/txsize.mjs +15 -3
- package/js/economy/validate.mjs +61 -24
- package/js/index.js +1 -0
- package/js/mcp/server.mjs +43 -15
- package/js/mcp/tools.mjs +318 -80
- package/js/play/index.js +1960 -461
- package/js/play/keys.js +35 -9
- package/js/results/index.js +225 -32
- 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 +52 -22
- package/skills/xsolana-economy/references/after-launch.md +32 -21
- package/skills/xsolana-economy/references/apps.md +47 -36
- package/skills/xsolana-economy/references/sentence-to-spec.md +149 -129
- package/skills/xsolana-economy/references/telling-the-person.md +15 -6
- package/skills/xsolana-economy/references/trust-and-cheating.md +126 -0
- 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/cost.d.mts +1 -1
- package/types/economy/explain.d.mts +3 -0
- 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/economy/review.d.mts +45 -0
- package/types/economy/trust.d.mts +8 -0
- package/types/index.d.ts +1 -0
- package/types/mcp/tools.d.mts +62 -0
- package/types/play/index.d.ts +14 -25
- package/types/results/index.d.ts +8 -7
- package/types/results/server.d.ts +126 -0
- package/types/results/wire.d.ts +1 -1
package/types/client/ix.d.ts
CHANGED
|
@@ -3452,7 +3452,7 @@ export declare const prizeRollNonce: (n: any) => bigint;
|
|
|
3452
3452
|
* collectibles of the same item already made earlier in the instruction); `nft` the NFT's kind, as `piece` takes it
|
|
3453
3453
|
* ({ collection, tokenMetadata, compressed }).
|
|
3454
3454
|
*/
|
|
3455
|
-
export declare function prizeMetas({ project, collection, prize, winner, nonce, poolMints, items, nft, made, projectMint, programs, lottery }: {
|
|
3455
|
+
export declare function prizeMetas({ project, collection, prize, winner, nonce, poolMints, items, nft, made, projectMint, programs, lottery, }: {
|
|
3456
3456
|
collection: any;
|
|
3457
3457
|
items?: {} | undefined;
|
|
3458
3458
|
lottery: any;
|
|
@@ -3574,7 +3574,7 @@ export declare const createProjectIx: ({ owner, id, authority, treasury, collect
|
|
|
3574
3574
|
* authority or treasury comes with the account at its key (`new_authority`, `new_treasury`), which the program checks
|
|
3575
3575
|
* as `createProjectIx`'s.
|
|
3576
3576
|
*/
|
|
3577
|
-
export declare const updateProjectIx: ({ owner, project, authority, paused, treasury, collections, newOwner }: {
|
|
3577
|
+
export declare const updateProjectIx: ({ owner, project, authority, paused, treasury, collections, newOwner, }: {
|
|
3578
3578
|
authority?: null | undefined;
|
|
3579
3579
|
collections?: null | undefined;
|
|
3580
3580
|
newOwner?: null | undefined;
|
|
@@ -3610,7 +3610,8 @@ export declare function withDefaults(def: any): {
|
|
|
3610
3610
|
};
|
|
3611
3611
|
/**
|
|
3612
3612
|
* The owner writes one record (`def`: { Item: { id, args } }, { Box: … }, …), at its own address. A lottery names
|
|
3613
|
-
* its
|
|
3613
|
+
* its mint, the pot its terms pay from (which a write opens when it isn't open; pot 0's address for a lottery whose
|
|
3614
|
+
* rounds pay from their own money, where any account will do), its ticket mint, both token programs and the round it waits on
|
|
3614
3615
|
* (`lotteryState`: the lottery as it is, null for a new one; `idleRound`: its current round's record, or round 0's once
|
|
3615
3616
|
* it drew once and ended: a lottery made again, edited once ended or made to repeat waits while that round runs or
|
|
3616
3617
|
* still owes NFTs of its own stash), then its own stash when a place holds or draws an NFT of it. A box, a recipe, a grant or a lottery that
|
|
@@ -3629,9 +3630,10 @@ export declare function upsertIx({ owner, project, def: given, lotteryState }: {
|
|
|
3629
3630
|
};
|
|
3630
3631
|
/**
|
|
3631
3632
|
* The owner closes the record at `target`, and its rent comes back: a grant's with the funds it held. A lottery
|
|
3632
|
-
* (`lottery`: its decoded record) sends what
|
|
3633
|
-
* by default), and closes
|
|
3634
|
-
* gave out every NFT of its own stash, `idleRound`)
|
|
3633
|
+
* (`lottery`: its decoded record) sends what every pot it opened holds (`Lottery::pots`) to `to`, a token account of its
|
|
3634
|
+
* mint (the owner's own by default), and closes each, once its current round has no record (one that drew once and
|
|
3635
|
+
* ended: once its round 0 gave out every NFT of its own stash, `idleRound`), and once the round its `owing` names has
|
|
3636
|
+
* moved in what it owes its pot (pull it first, `Part::Common`). One that never opened a pot names only those rounds.
|
|
3635
3637
|
*/
|
|
3636
3638
|
export declare function closeRecordIx({ owner, project, target, lottery, schedule, programs, to, extra }: {
|
|
3637
3639
|
extra?: never[] | undefined;
|
|
@@ -3651,7 +3653,7 @@ export declare function closeRecordIx({ owner, project, target, lottery, schedul
|
|
|
3651
3653
|
* `player` (or a sponsor, or the project's own keys funding a pool) pays `amount` of `mint`, split at once by `shares`.
|
|
3652
3654
|
* The rest goes to the project's `treasury` wallet. The player opens any account this pays into that is not there.
|
|
3653
3655
|
*/
|
|
3654
|
-
export declare function payIx({ player, project, mint, treasury, amount, shares, reference: ref, playerToken, holders, programs, extra }: {
|
|
3656
|
+
export declare function payIx({ player, project, mint, treasury, amount, shares, reference: ref, playerToken, holders, programs, extra, }: {
|
|
3655
3657
|
amount: any;
|
|
3656
3658
|
extra?: never[] | undefined;
|
|
3657
3659
|
holders: any;
|
|
@@ -3679,7 +3681,7 @@ export declare function payIx({ player, project, mint, treasury, amount, shares,
|
|
|
3679
3681
|
* The player opens the project's vault for the price's mint, and for each prize's, when it is not there. A box that
|
|
3680
3682
|
* limits each wallet counts the purchase in the player's counts (`pda.counts`, its rent theirs).
|
|
3681
3683
|
*/
|
|
3682
|
-
export declare function openBoxIx({ player, project, box, boxAddress, nonce, maxPrice, count, items, shown, listProof, subject, chosenRecipient, chosen, settler, poolMints, playerToken, programs, extra }: {
|
|
3684
|
+
export declare function openBoxIx({ player, project, box, boxAddress, nonce, maxPrice, count, items, shown, listProof, subject, chosenRecipient, chosen, settler, poolMints, playerToken, programs, extra, }: {
|
|
3683
3685
|
box: any;
|
|
3684
3686
|
boxAddress: any;
|
|
3685
3687
|
chosen?: null | undefined;
|
|
@@ -3714,7 +3716,7 @@ export declare function openBoxIx({ player, project, box, boxAddress, nonce, max
|
|
|
3714
3716
|
* treasury wallet; `holders` maps a collectible a share pays to its holder; each roll the entry gives is made at the
|
|
3715
3717
|
* next nonce from `nonce` (`buyRolls`). `shown`/`listProof` pass the box's gate.
|
|
3716
3718
|
*/
|
|
3717
|
-
export declare function buyIx({ player, project, box, boxAddress, maxPrice, count, treasury, chosenRecipient, chosen, nonce, shown, listProof, items, poolMints, nfts, holders, playerToken, programs, extra }: {
|
|
3719
|
+
export declare function buyIx({ player, project, box, boxAddress, maxPrice, count, treasury, chosenRecipient, chosen, nonce, shown, listProof, items, poolMints, nfts, holders, playerToken, programs, extra, }: {
|
|
3718
3720
|
box: any;
|
|
3719
3721
|
boxAddress: any;
|
|
3720
3722
|
chosen?: null | undefined;
|
|
@@ -3757,7 +3759,7 @@ export declare function buyGives(box: any, count?: number): {
|
|
|
3757
3759
|
* for a prize in a mint with a transfer hook, the hook's accounts (`extra`). The buyer's odds boosts were fixed at
|
|
3758
3760
|
* purchase.
|
|
3759
3761
|
*/
|
|
3760
|
-
export declare function callbackRollIx({ order, orderState, box, boxAddress, randomness, project, poolMints, items, programs, extra }: {
|
|
3762
|
+
export declare function callbackRollIx({ order, orderState, box, boxAddress, randomness, project, poolMints, items, programs, extra, }: {
|
|
3761
3763
|
box: any;
|
|
3762
3764
|
boxAddress: any;
|
|
3763
3765
|
extra?: never[] | undefined;
|
|
@@ -3782,7 +3784,7 @@ export declare function callbackRollIx({ order, orderState, box, boxAddress, ran
|
|
|
3782
3784
|
* Compressed the item, the tree's config, the tree, the collection, Bubblegum's programs; for a fresh one, then its
|
|
3783
3785
|
* tables and the Sheet of the NFT it mints
|
|
3784
3786
|
*/
|
|
3785
|
-
export declare function wonAccounts({ order, items, nfts, prizeTo, putBack, programs, from, upto, tree, treeMinted, unminted }: {
|
|
3787
|
+
export declare function wonAccounts({ order, items, nfts, prizeTo, putBack, programs, from, upto, tree, treeMinted, unminted, }: {
|
|
3786
3788
|
from?: number | undefined;
|
|
3787
3789
|
items?: {} | undefined;
|
|
3788
3790
|
nfts?: {} | undefined;
|
|
@@ -3851,7 +3853,7 @@ export declare const SETTLE_LAST = 4294967295;
|
|
|
3851
3853
|
* (`settled`) up to it, and nothing more. The first call, whichever it is, splits the payment (its shares' accounts
|
|
3852
3854
|
* ride on it).
|
|
3853
3855
|
*/
|
|
3854
|
-
export declare function settleIx({ signer, orderAddress, order, projectState, items, nfts, prizeTo, putBack, subject, handBack, holders, programs, upto, tree, treeMinted, unminted, extra }: {
|
|
3856
|
+
export declare function settleIx({ signer, orderAddress, order, projectState, items, nfts, prizeTo, putBack, subject, handBack, holders, programs, upto, tree, treeMinted, unminted, extra, }: {
|
|
3855
3857
|
extra?: never[] | undefined;
|
|
3856
3858
|
handBack?: boolean | undefined;
|
|
3857
3859
|
holders: any;
|
|
@@ -3941,7 +3943,7 @@ export declare function askRollIx({ payer, orderAddress, order, box, settler, po
|
|
|
3941
3943
|
* wallet), a collectible's holder or 'Burn', `amount` { Fixed: [n] } or { Bps: [bps] } of a pool. The authority opens the
|
|
3942
3944
|
* account it pays into when it is not there; a collectible nobody holds gets nothing.
|
|
3943
3945
|
*/
|
|
3944
|
-
export declare function moveTokensIx({ authority, project, mint, from, to, amount, reference: ref, holders, programs, treasury, farm, extra }: {
|
|
3946
|
+
export declare function moveTokensIx({ authority, project, mint, from, to, amount, reference: ref, holders, programs, treasury, farm, extra, }: {
|
|
3945
3947
|
amount: any;
|
|
3946
3948
|
authority: any;
|
|
3947
3949
|
extra?: never[] | undefined;
|
|
@@ -4014,7 +4016,7 @@ export declare const madeAssets: (project: any, item: any, itemState: any, count
|
|
|
4014
4016
|
* (`piece`): `asset` and `collection` for a Core asset, with `tokenMetadata` for a Token Metadata NFT, or `compressed`
|
|
4015
4017
|
* (after a `proveLeafIx`).
|
|
4016
4018
|
*/
|
|
4017
|
-
export declare function releaseIx({ signer, project, collection, asset, tokenMetadata: tm, compressed, hold, address, to, treasury, reference: ref, more }: {
|
|
4019
|
+
export declare function releaseIx({ signer, project, collection, asset, tokenMetadata: tm, compressed, hold, address, to, treasury, reference: ref, more, }: {
|
|
4018
4020
|
address?: null | undefined;
|
|
4019
4021
|
asset: any;
|
|
4020
4022
|
collection: any;
|
|
@@ -4083,7 +4085,7 @@ export declare function verdictBytes({ program, contest, incarnation, side, expi
|
|
|
4083
4085
|
* contest with a chosen share is decided naming its `recipient`, a wallet (a bounty's worker); a decider's verdict
|
|
4084
4086
|
* signs it too (`verdictBytes`).
|
|
4085
4087
|
*/
|
|
4086
|
-
export declare function decideIx({ signer, project, projectState, contestAddress, contest, side, recipient, verdict, reference: ref, holders, prizeMint, programs, extra }: {
|
|
4088
|
+
export declare function decideIx({ signer, project, projectState, contestAddress, contest, side, recipient, verdict, reference: ref, holders, prizeMint, programs, extra, }: {
|
|
4087
4089
|
contest: any;
|
|
4088
4090
|
contestAddress: any;
|
|
4089
4091
|
extra?: never[] | undefined;
|
|
@@ -4132,7 +4134,7 @@ export declare const callbackRandomIx: ({ project, reference: ref, randomness }:
|
|
|
4132
4134
|
* lapse; only a sealed schedule's fixed amount pays every run due, up to `upto` runs made (`scheduleCatchesUp`).
|
|
4133
4135
|
* `poolMint`: the mint of the pool it moves from (when it moves from one). `extra`: a hook's or a memo's accounts.
|
|
4134
4136
|
*/
|
|
4135
|
-
export declare function runScheduleIx({ payer, project, id, schedule, poolMint, holders, programs, treasury, upto, extra }: {
|
|
4137
|
+
export declare function runScheduleIx({ payer, project, id, schedule, poolMint, holders, programs, treasury, upto, extra, }: {
|
|
4136
4138
|
extra?: never[] | undefined;
|
|
4137
4139
|
holders: any;
|
|
4138
4140
|
id: any;
|
|
@@ -4160,7 +4162,7 @@ export declare const currentRound: (lotteryAddress: any, lottery: any) => any;
|
|
|
4160
4162
|
* `treasury` wallet. A lottery whose ticket costs an NFT sells one at a time, for `nft` ({ asset, collection,
|
|
4161
4163
|
* tokenMetadata, compressed }, as `piece` takes it).
|
|
4162
4164
|
*/
|
|
4163
|
-
export declare function buyTicketsIx({ player, project, id, lottery, round, mint, count, shown, listProof, chosenRecipient, chosen, nft, holders, treasury, playerToken, programs, extra }: {
|
|
4165
|
+
export declare function buyTicketsIx({ player, project, id, lottery, round, mint, count, shown, listProof, chosenRecipient, chosen, nft, holders, treasury, playerToken, programs, extra, }: {
|
|
4164
4166
|
chosen?: null | undefined;
|
|
4165
4167
|
chosenRecipient?: null | undefined;
|
|
4166
4168
|
count: any;
|
|
@@ -4188,15 +4190,19 @@ export declare function buyTicketsIx({ player, project, id, lottery, round, mint
|
|
|
4188
4190
|
* round asked for (null when nobody bought into the current one: it moves on, or a lottery that draws once ends, with
|
|
4189
4191
|
* no ask), and `roundAddress` its address when it is not the current round's (an older round still waiting for its
|
|
4190
4192
|
* answer: asked again after `STALE_SECONDS`, or after the timeout cancelled, with no lottery account, so `lottery` may be
|
|
4191
|
-
* null then; without `round`, the current round's, with the lottery's terms). A round's first ask fixes its money
|
|
4192
|
-
*
|
|
4193
|
-
*
|
|
4194
|
-
*
|
|
4193
|
+
* null then; without `round`, the current round's, with the lottery's terms). A round's first ask fixes its money. Paid
|
|
4194
|
+
* from a pot, it takes the pot, its mint and the round's account of it, then, when the lottery names a round that may
|
|
4195
|
+
* still owe a pot (`lottery.owing`), that round, its account of the mint and its pot (`owing`: that round's decoded
|
|
4196
|
+
* record, whose terms name its pot; without it, or when the record is gone, the pot this round pays from). A round paid
|
|
4197
|
+
* from its own money takes none of these. Then each run of token prizes in place order, its mint and for a pool, the
|
|
4198
|
+
* pool and the round's account of the mint (`poolMints`: a pool's index to its mint). With `skipHooked` (the project's
|
|
4199
|
+
* authority only) a hooked pool or pot gives the round nothing. `extra`: hook accounts.
|
|
4195
4200
|
*/
|
|
4196
|
-
export declare function drawLotteryIx({ payer, project, id, lottery, round, roundAddress, skipHooked, poolMints, extra }: {
|
|
4201
|
+
export declare function drawLotteryIx({ payer, project, id, lottery, round, roundAddress, owing, skipHooked, poolMints, extra, }: {
|
|
4197
4202
|
extra?: never[] | undefined;
|
|
4198
4203
|
id: any;
|
|
4199
4204
|
lottery: any;
|
|
4205
|
+
owing?: null | undefined;
|
|
4200
4206
|
payer: any;
|
|
4201
4207
|
poolMints?: {} | undefined;
|
|
4202
4208
|
project: any;
|
|
@@ -4239,13 +4245,14 @@ export declare function stashNfts(r: any, stash: any): any;
|
|
|
4239
4245
|
* 'Own' entry `entry`'s own part: a refund, a no-loss ticket's price, or its NFT ticket back or where its
|
|
4240
4246
|
* price sends it (`ticket` its kind as `piece` takes it; `handBack` when the wallet its price gives
|
|
4241
4247
|
* it to is an account of the loot program; `hold`: made a hold for whoever it is owed to instead);
|
|
4242
|
-
* { Pot: [run] } the entry's places in the run, their part of the
|
|
4248
|
+
* { Pot: [run] } the entry's places in the run, their part of what the round pays from, paid into the buyer's account;
|
|
4243
4249
|
* { Prize: [run] } their prize: tokens into the buyer's account, or each place's prize (`prize`: { stash, the lottery's
|
|
4244
4250
|
* own stash decoded, for NFTs not taken out yet (`stashNfts`); stashes, a project stash's id to its
|
|
4245
4251
|
* decoded stash; nfts, an NFT's kind by its asset; hold, NFTs made holds; most, the most places a
|
|
4246
4252
|
* pull carries; and what `prizeMetas` takes: collection, poolMints, items, projectMint }), a roll's
|
|
4247
4253
|
* order at `prizeRollNonce(nonce + place)` (ask it in the same transaction: `pullRolls`);
|
|
4248
|
-
* { Common: [i] } a part owed in common: share `i`, the
|
|
4254
|
+
* { Common: [i] } a part owed in common: share `i`, what the places leave (`i` = the shares' count: to the pot, or
|
|
4255
|
+
* to `rest` for a round paid from its own money; never owed when that burns), a pool's prize back after a
|
|
4249
4256
|
* cancel (past it), paid where it goes (`holders`, `programs`); `toTreasury` when that can't take it
|
|
4250
4257
|
* (a pool never opened, the pot closed since or made again in another mint, an account gone: a
|
|
4251
4258
|
* holder nobody is is found here).
|
|
@@ -4253,7 +4260,7 @@ export declare function stashNfts(r: any, stash: any): any;
|
|
|
4253
4260
|
* lottery is gone, so rent it lent goes to the owner). A round that owes nothing and waits only for its close is closed
|
|
4254
4261
|
* by any pull.
|
|
4255
4262
|
*/
|
|
4256
|
-
export declare function pullIx({ payer, project, roundAddress: key, round: r, entry, part, projectState, ticket, handBack, hold, nonce, prize, holders, toTreasury, lotteryClosed, programs, extra }: {
|
|
4263
|
+
export declare function pullIx({ payer, project, roundAddress: key, round: r, entry, part, projectState, ticket, handBack, hold, nonce, prize, holders, toTreasury, lotteryClosed, programs, extra, }: {
|
|
4257
4264
|
entry?: number | undefined;
|
|
4258
4265
|
extra?: never[] | undefined;
|
|
4259
4266
|
handBack?: boolean | undefined;
|
|
@@ -4462,7 +4469,7 @@ export declare const AUTH_RULES_PROGRAM = "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3r
|
|
|
4462
4469
|
* `burns`: burns a Core asset (false when left out); `reads`: reads its Sheet; `held`: reads it in the project's token
|
|
4463
4470
|
* account (an escrow farm).
|
|
4464
4471
|
*/
|
|
4465
|
-
export declare function piece({ project, asset, wallet, collection, hasAuthority, tokenMetadata: tm, compressed: c, moves, locks, writes, burns, reads, held }: {
|
|
4472
|
+
export declare function piece({ project, asset, wallet, collection, hasAuthority, tokenMetadata: tm, compressed: c, moves, locks, writes, burns, reads, held, }: {
|
|
4466
4473
|
asset: any;
|
|
4467
4474
|
burns?: boolean | undefined;
|
|
4468
4475
|
collection: any;
|
|
@@ -4614,7 +4621,7 @@ export declare function nftPaid({ project, owner, then, asset, collection, hasAu
|
|
|
4614
4621
|
* place), or given to the wallet `to` (the treasury, a partner). The receipt (`PaidNft`) is the record: an app admits the player when the NFT, where it went (`to`: a payment to the player's own wallet pays nothing) and the reference
|
|
4615
4622
|
* are the ones it asked for. `extra`: Core's transfer adapters.
|
|
4616
4623
|
*/
|
|
4617
|
-
export declare function payNftIx({ player, project, asset, to, collection, hasAuthority, tokenMetadata: tm, compressed, reference: ref, extra }: {
|
|
4624
|
+
export declare function payNftIx({ player, project, asset, to, collection, hasAuthority, tokenMetadata: tm, compressed, reference: ref, extra, }: {
|
|
4618
4625
|
asset: any;
|
|
4619
4626
|
collection: any;
|
|
4620
4627
|
compressed: any;
|
|
@@ -4702,7 +4709,7 @@ export declare function withLeafCloses(instructions: any): any;
|
|
|
4702
4709
|
* (`pda.leaf`). A Token Metadata NFT's (`tokenMetadata`: true, or its kind) names its edition, which must be closed
|
|
4703
4710
|
* too: its mint holds none, with no mint authority but its edition (`NotBurned` otherwise).
|
|
4704
4711
|
*/
|
|
4705
|
-
export declare const closeSheetIx: ({ project, nft, tree, burned, treasury, tokenMetadata: tm }: {
|
|
4712
|
+
export declare const closeSheetIx: ({ project, nft, tree, burned, treasury, tokenMetadata: tm, }: {
|
|
4706
4713
|
burned?: any;
|
|
4707
4714
|
nft: any;
|
|
4708
4715
|
project: any;
|
|
@@ -4760,7 +4767,7 @@ export declare const proveTraitsIx: ({ signer, project, key, nft, attributes, pr
|
|
|
4760
4767
|
* collection, hasAuthority, tokenMetadata, compressed }) go in the same call at the same tier, one fee, by their seats'
|
|
4761
4768
|
* addresses. `extra` carries reward token hooks/memos and Core transfer adapter accounts.
|
|
4762
4769
|
*/
|
|
4763
|
-
export declare const stakeNftIx: ({ player, project, id, farm, asset, collection, hasAuthority, tokenMetadata: tm, compressed, previous, tier, programs, more, extra }: {
|
|
4770
|
+
export declare const stakeNftIx: ({ player, project, id, farm, asset, collection, hasAuthority, tokenMetadata: tm, compressed, previous, tier, programs, more, extra, }: {
|
|
4764
4771
|
asset: any;
|
|
4765
4772
|
collection: any;
|
|
4766
4773
|
compressed: any;
|
|
@@ -4790,7 +4797,7 @@ export declare const stakeNftIx: ({ player, project, id, farm, asset, collection
|
|
|
4790
4797
|
* in the same call, one fee, one transfer of rewards: by their seats' addresses, the `i`th's roll at `nonce + 2i` and its
|
|
4791
4798
|
* prize's at `nonce + 2i + 1` (`seatNonces` says which NFT has which). One still locked refuses the whole call.
|
|
4792
4799
|
*/
|
|
4793
|
-
export declare const unstakeNftIx: ({ player, project, id, farm, asset, collection, hasAuthority, tokenMetadata: tm, compressed, forfeit, roll, nonce, tier, projectCollection, poolMints, items, nft, boxes, programs, more, extra }: {
|
|
4800
|
+
export declare const unstakeNftIx: ({ player, project, id, farm, asset, collection, hasAuthority, tokenMetadata: tm, compressed, forfeit, roll, nonce, tier, projectCollection, poolMints, items, nft, boxes, programs, more, extra, }: {
|
|
4794
4801
|
asset: any;
|
|
4795
4802
|
boxes?: {} | undefined;
|
|
4796
4803
|
collection: any;
|
|
@@ -4829,7 +4836,7 @@ export declare const seatNonces: (project: any, id: any, farm: any, player: any,
|
|
|
4829
4836
|
* (`NotProven`). `more` seats of the player's in the farm (each { by, held, tree }) collect in the same call, one fee,
|
|
4830
4837
|
* one transfer.
|
|
4831
4838
|
*/
|
|
4832
|
-
export declare const harvestIx: ({ player, project, id, farm, by, held, tree, compound, programs, more, extra }: {
|
|
4839
|
+
export declare const harvestIx: ({ player, project, id, farm, by, held, tree, compound, programs, more, extra, }: {
|
|
4833
4840
|
by?: any;
|
|
4834
4841
|
compound?: boolean | undefined;
|
|
4835
4842
|
extra?: never[] | undefined;
|
|
@@ -4854,7 +4861,7 @@ export declare const harvestIx: ({ player, project, id, farm, by, held, tree, co
|
|
|
4854
4861
|
* NFT's token account that holds it, `holder`'s (its staker's, or a watched NFT's buyer's). `signer` pays for what the
|
|
4855
4862
|
* write adds. `extra`: the reward mint's hook accounts.
|
|
4856
4863
|
*/
|
|
4857
|
-
export declare const refreshSeatIx: ({ signer, project, id, farm, by, seat, collection, hasAuthority, tokenMetadata: tm, compressed, holder, extra }: {
|
|
4864
|
+
export declare const refreshSeatIx: ({ signer, project, id, farm, by, seat, collection, hasAuthority, tokenMetadata: tm, compressed, holder, extra, }: {
|
|
4858
4865
|
by: any;
|
|
4859
4866
|
collection: any;
|
|
4860
4867
|
compressed: any;
|
|
@@ -4881,7 +4888,9 @@ export declare const refreshSeatIx: ({ signer, project, id, farm, by, seat, coll
|
|
|
4881
4888
|
* it lowers a number: its seat and farm follow it, and the raise may not lower a number that farm reads; for a `Trade` line the NFT traded in, as `piece` takes it: `{ asset, collection, tokenMetadata,
|
|
4882
4889
|
* compressed }`). A collectible used that is staked in a farm holding it for the player (escrow) or locking it in their
|
|
4883
4890
|
* wallet (freeze) is `{ asset, farm }`, `farm` that farm's id: its seat and farm follow it (a raise on it may not lower a
|
|
4884
|
-
* number its farm reads: `BadRecipe`).
|
|
4891
|
+
* number its farm reads: `BadRecipe`). One that boosts the player's token seat in a farm of tokens is
|
|
4892
|
+
* `{ asset, farm, booster: true }`: the player's token seat (`["seat", farm, player]`) and that farm follow it, on a kept
|
|
4893
|
+
* `Use` line or a `Show` line alike. A `Staked` line names the farm its collectible
|
|
4885
4894
|
* is staked in (`Input::Staked { item, farm }`, escrowed or frozen there): its address, or `{ asset, farm }` with that
|
|
4886
4895
|
* farm, and its seat and that farm follow it. Each item line passes its item's collection
|
|
4887
4896
|
* (`items[id].collection`, the decoded Items; `collection` when not given), written for a burn: Core writes it as it
|
|
@@ -4892,7 +4901,7 @@ export declare const refreshSeatIx: ({ signer, project, id, farm, by, seat, coll
|
|
|
4892
4901
|
* (`askRollIx`, in the same transaction when it fits).
|
|
4893
4902
|
* A craft makes several Core calls: raise the compute limit. `extra`: a token's hook accounts.
|
|
4894
4903
|
*/
|
|
4895
|
-
export declare function craftIx({ player, project, collection, id, recipe, assets, times, nonce, holders, programs, treasury, poolMints, items, nfts, boxes, extra }: {
|
|
4904
|
+
export declare function craftIx({ player, project, collection, id, recipe, assets, times, nonce, holders, programs, treasury, poolMints, items, nfts, boxes, extra, }: {
|
|
4896
4905
|
assets?: never[] | undefined;
|
|
4897
4906
|
boxes?: {} | undefined;
|
|
4898
4907
|
collection: any;
|
|
@@ -4921,7 +4930,7 @@ export declare const craftNewAssets: (recipe: any) => any;
|
|
|
4921
4930
|
* asset (`collection` its own, Core's address for none), a Token Metadata NFT (`tokenMetadata`), or `compressed` (after
|
|
4922
4931
|
* a `proveLeafIx`).
|
|
4923
4932
|
*/
|
|
4924
|
-
export declare function holdIx({ player, project, collection, asset, tokenMetadata: tm, compressed, freeAt, reference: ref, more }: {
|
|
4933
|
+
export declare function holdIx({ player, project, collection, asset, tokenMetadata: tm, compressed, freeAt, reference: ref, more, }: {
|
|
4925
4934
|
asset: any;
|
|
4926
4935
|
collection: any;
|
|
4927
4936
|
compressed: any;
|
|
@@ -4944,7 +4953,7 @@ export declare function holdIx({ player, project, collection, asset, tokenMetada
|
|
|
4944
4953
|
* treasury in its hold (`["hold", nft, 0]`, the signer paying its rent until anyone `release`s it to the treasury, one
|
|
4945
4954
|
* NFT a call). `out` is never the project's own address nor another account of the program (`ToTheProject`).
|
|
4946
4955
|
*/
|
|
4947
|
-
export declare function stashIx({ signer, project, id, lottery, lotteryState, asset, out, drop, weight, collection, tokenMetadata: tm, compressed, more }: {
|
|
4956
|
+
export declare function stashIx({ signer, project, id, lottery, lotteryState, asset, out, drop, weight, collection, tokenMetadata: tm, compressed, more, }: {
|
|
4948
4957
|
asset: any;
|
|
4949
4958
|
collection: any;
|
|
4950
4959
|
compressed: any;
|
|
@@ -4969,7 +4978,7 @@ export declare function stashIx({ signer, project, id, lottery, lotteryState, as
|
|
|
4969
4978
|
* compressed }, as `piece` takes it), which the contest holds until it is claimed. `shown`/`listProof` pass its gate.
|
|
4970
4979
|
* A new entry's record is the player's to pay (not refunded). `extra`: a hook's accounts.
|
|
4971
4980
|
*/
|
|
4972
|
-
export declare function enterIx({ player, project, id, contest, side, amount, shown, listProof, nft, playerToken, programs, extra }: {
|
|
4981
|
+
export declare function enterIx({ player, project, id, contest, side, amount, shown, listProof, nft, playerToken, programs, extra, }: {
|
|
4973
4982
|
amount: any;
|
|
4974
4983
|
contest: any;
|
|
4975
4984
|
extra?: never[] | undefined;
|
|
@@ -5000,7 +5009,7 @@ export declare function enterIx({ player, project, id, contest, side, amount, sh
|
|
|
5000
5009
|
* closes the contest (`projectState`: its treasury); a contest that owes nothing (nobody entered, every part claimed,
|
|
5001
5010
|
* off by itself with none in) is closed by any claim, the `payer`'s. `extra`: a hook's accounts.
|
|
5002
5011
|
*/
|
|
5003
|
-
export declare function claimIx({ payer, project, projectState, id, contest, entries, player, nfts, kinds, nonce, collection, poolMints, items, nft, prizeMint, forgo, end, hold, programs, extra }: {
|
|
5012
|
+
export declare function claimIx({ payer, project, projectState, id, contest, entries, player, nfts, kinds, nonce, collection, poolMints, items, nft, prizeMint, forgo, end, hold, programs, extra, }: {
|
|
5004
5013
|
collection: any;
|
|
5005
5014
|
contest: any;
|
|
5006
5015
|
end?: boolean | undefined;
|
|
@@ -5069,7 +5078,7 @@ export declare const MAX_BID_NFTS = 3;
|
|
|
5069
5078
|
* (`held`, the kinds of `auction.held`, in order) back to its bidder; one that can't move now (`hold`: true for all, or a
|
|
5070
5079
|
* list of assets) becomes a hold for them instead, `bidder` paying its rent until its release. `extra`: a hook's accounts.
|
|
5071
5080
|
*/
|
|
5072
|
-
export declare function bidIx({ bidder, project, id, auction, amount, shown, listProof, nfts, held, hold, bidderToken, programs, extra }: {
|
|
5081
|
+
export declare function bidIx({ bidder, project, id, auction, amount, shown, listProof, nfts, held, hold, bidderToken, programs, extra, }: {
|
|
5073
5082
|
amount: any;
|
|
5074
5083
|
auction: any;
|
|
5075
5084
|
bidder: any;
|
|
@@ -5101,7 +5110,7 @@ export declare function bidIx({ bidder, project, id, auction, amount, shown, lis
|
|
|
5101
5110
|
* piece nor proof), and a winning NFT of a bid a hold for `proceeds` (its hold's address in its piece's place); anyone
|
|
5102
5111
|
* then delivers each with `releaseIx`, and the end's sender gets the rent back then.
|
|
5103
5112
|
*/
|
|
5104
|
-
export declare function endAuctionIx({ signer, project, projectState, id, auction, item, collection, tokenMetadata: tm, compressed, held, hold, reference: ref, nonce, holders, programs, extra }: {
|
|
5113
|
+
export declare function endAuctionIx({ signer, project, projectState, id, auction, item, collection, tokenMetadata: tm, compressed, held, hold, reference: ref, nonce, holders, programs, extra, }: {
|
|
5105
5114
|
auction: any;
|
|
5106
5115
|
collection: any;
|
|
5107
5116
|
compressed: any;
|
|
@@ -5166,7 +5175,7 @@ export declare function closeOfferIx({ maker, project, id, offer, programs, extr
|
|
|
5166
5175
|
* any kind, as `piece` takes it (`collection`, `hasAuthority` false for a Core asset of another collection,
|
|
5167
5176
|
* `tokenMetadata`, or `compressed` after a `proveLeafIx`).
|
|
5168
5177
|
*/
|
|
5169
|
-
export declare function sellToOfferIx({ seller, project, projectState, id, offer, asset, collection, hasAuthority, tokenMetadata: tm, compressed, holders, programs, extra }: {
|
|
5178
|
+
export declare function sellToOfferIx({ seller, project, projectState, id, offer, asset, collection, hasAuthority, tokenMetadata: tm, compressed, holders, programs, extra, }: {
|
|
5170
5179
|
asset: any;
|
|
5171
5180
|
collection: any;
|
|
5172
5181
|
compressed: any;
|
|
@@ -5191,7 +5200,7 @@ export declare function sellToOfferIx({ seller, project, projectState, id, offer
|
|
|
5191
5200
|
* `pda.hold(asset, due)` until it is repaid (`repayIx`, then `releaseIx` sends it home) or, once due, sent to the
|
|
5192
5201
|
* lender (`releaseIx` with `to` the lender); the loan goes to the borrower. The NFT is any kind, as `sellToOfferIx` takes it.
|
|
5193
5202
|
*/
|
|
5194
|
-
export declare function borrowIx({ borrower, project, id, offer, due, asset, collection, hasAuthority, tokenMetadata: tm, compressed, programs, extra }: {
|
|
5203
|
+
export declare function borrowIx({ borrower, project, id, offer, due, asset, collection, hasAuthority, tokenMetadata: tm, compressed, programs, extra, }: {
|
|
5195
5204
|
asset: any;
|
|
5196
5205
|
borrower: any;
|
|
5197
5206
|
collection: any;
|
|
@@ -5239,7 +5248,7 @@ export declare const listingTerms: (listing: any) => Uint8Array<ArrayBuffer>;
|
|
|
5239
5248
|
* goes to the project until it is sold or the listing is closed. The listing's address names the NFT
|
|
5240
5249
|
* (`pda.listing(project, asset)`), so a game finds it, and its renter, with one account read.
|
|
5241
5250
|
*/
|
|
5242
|
-
export declare function openListingIx({ maker, project, asset, mint, deal, shares, collection, hasAuthority, tokenMetadata: tm, compressed, extra }: {
|
|
5251
|
+
export declare function openListingIx({ maker, project, asset, mint, deal, shares, collection, hasAuthority, tokenMetadata: tm, compressed, extra, }: {
|
|
5243
5252
|
asset: any;
|
|
5244
5253
|
collection: any;
|
|
5245
5254
|
compressed: any;
|
|
@@ -5264,7 +5273,7 @@ export declare function openListingIx({ maker, project, asset, mint, deal, share
|
|
|
5264
5273
|
* take's own accounts come a sale's compressed NFT's proof, then the shares' accounts, then (in `extra`) Core's
|
|
5265
5274
|
* transfer adapters and any transfer hook's accounts, which the program finds by address after the shares'.
|
|
5266
5275
|
*/
|
|
5267
|
-
export declare function takeListingIx({ taker, project, projectState, listing, periods, collection, hasAuthority, tokenMetadata: tm, compressed, holders, programs, takerToken, extra }: {
|
|
5276
|
+
export declare function takeListingIx({ taker, project, projectState, listing, periods, collection, hasAuthority, tokenMetadata: tm, compressed, holders, programs, takerToken, extra, }: {
|
|
5268
5277
|
collection: any;
|
|
5269
5278
|
compressed: any;
|
|
5270
5279
|
extra?: never[] | undefined;
|
|
@@ -5287,7 +5296,7 @@ export declare function takeListingIx({ taker, project, projectState, listing, p
|
|
|
5287
5296
|
* Its maker closes a listing (`listing` the decoded Listing): the NFT goes home. While a rental runs it only stops (no
|
|
5288
5297
|
* renter takes it again), and the same call once the rental is over takes it home. Free.
|
|
5289
5298
|
*/
|
|
5290
|
-
export declare function closeListingIx({ maker, project, listing, collection, hasAuthority, tokenMetadata: tm, compressed, extra }: {
|
|
5299
|
+
export declare function closeListingIx({ maker, project, listing, collection, hasAuthority, tokenMetadata: tm, compressed, extra, }: {
|
|
5291
5300
|
collection: any;
|
|
5292
5301
|
compressed: any;
|
|
5293
5302
|
extra?: never[] | undefined;
|
package/types/client/pda.d.ts
CHANGED
|
@@ -39,8 +39,10 @@ export declare const pda: {
|
|
|
39
39
|
/** Every collectible the program mints of its own accord (an order's, a prize's, an auction's lot): its address
|
|
40
40
|
* names its item and its serial, minted once at most. */
|
|
41
41
|
itemAsset: (item: any, serial: any) => any;
|
|
42
|
-
/** A contest's pot
|
|
42
|
+
/** A contest's pot: `["pot", contest]`. */
|
|
43
43
|
pot: (record: any) => any;
|
|
44
|
+
/** A lottery's pot `id` (below `MAX_POTS`), kept from round to round: `["pot", lottery, id]`. */
|
|
45
|
+
lotteryPot: (lottery: any, id: any) => any;
|
|
44
46
|
/** One round of a lottery: its record, opened by the round's first purchase (`["round", lottery, incarnation, round]`). */
|
|
45
47
|
round: (lottery: any, incarnation: any, round: any) => any;
|
|
46
48
|
/** A lottery round's own token account of `mint`, which the round's record owns. */
|
package/types/economy/cost.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function setupCost(plan: any, economy: any): {
|
|
|
11
11
|
notes: string[];
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* What each action costs whoever signs it while the economy runs:
|
|
14
|
+
* What each action costs whoever signs it while the economy runs: xgames.fun's fee, the network's, and for anything
|
|
15
15
|
* that asks MagicBlock's oracle for a random number (a box's open, a lottery's draw, the authority's `roll`) the
|
|
16
16
|
* oracle's own fee (`oracleSol`, model.mjs ORACLE_FEE).
|
|
17
17
|
*/
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare const ruleWords: (r: any) => string;
|
|
2
|
+
/** A gate in a sentence: "Only players who show …", "Only the wallets it names …", "Only wallets with … staked …". */
|
|
3
|
+
export declare const gateWords: (gate: any, verb: any, m: any) => string;
|
|
1
4
|
export declare function explainEconomy(economy: any, { now }?: {
|
|
2
5
|
now?: number | undefined;
|
|
3
6
|
}): {
|
|
@@ -106,6 +106,11 @@ export declare const CONVENTIONS: string[];
|
|
|
106
106
|
* then offer the nearest versions with their numbers, best first, and build the one the person picks. A feature that
|
|
107
107
|
* ships later moves its entry to HOW.
|
|
108
108
|
*/
|
|
109
|
+
/**
|
|
110
|
+
* What no code removes, only makes smaller: a wallet is not a person, the page can't be trusted, and bots play well.
|
|
111
|
+
* Said once in the guide, so every design starts from it.
|
|
112
|
+
*/
|
|
113
|
+
export declare const SAFETY: string[];
|
|
109
114
|
export declare const CANNOT: {
|
|
110
115
|
what: string;
|
|
111
116
|
words: string;
|
|
@@ -111,7 +111,7 @@ export declare const STOCK_WORDS = "The odds stay as written whatever is in stoc
|
|
|
111
111
|
*/
|
|
112
112
|
export declare function whenOutWords(b: any, { sold }?: {
|
|
113
113
|
sold?: boolean | undefined;
|
|
114
|
-
}): "The odds stay as written whatever is in stock: a draw that lands on an outcome that can’t be given then (its pool short of the whole amount, its item or stash gone) is not made, no other outcome takes its place, and that draw’s worth of the price goes back at the settle; with no draw made at all, a paid open fails and is refunded, and a free roll goes back to waiting" | "When an outcome runs out (an item sold out, a pool short of its prize, a stash empty), a roll draws among the outcomes still there by their written weights, so the others’ chances rise; with nothing left at all, a free roll waits to be asked again and a paid one is refunded" | "When an outcome runs out (an item sold out, a pool short of its prize, a stash empty), the box keeps selling while its first draw has anything left, and a roll draws among the outcomes still there by their written weights: the others’ chances rise as one runs out, so a player can empty a common outcome to make a rare one likelier (a box selling a rare prize should stop selling instead, the default)" | "When an outcome runs out, the box stops selling: it isn’t sold while
|
|
114
|
+
}): "The odds stay as written whatever is in stock: a draw that lands on an outcome that can’t be given then (its pool short of the whole amount, its item or stash gone) is not made, no other outcome takes its place, and that draw’s worth of the price goes back at the settle; with no draw made at all, a paid open fails and is refunded, and a free roll goes back to waiting. A free roll (a prize, a recipe’s, a mission’s chest) is on the odds as written too: a draw on an outcome that is out misses and gives nothing back (a pack keeps what its other draws won; a roll that drew nothing waits to be asked again), so emptying a shared source before asking steers nothing. A pack that should draw among what is left needs \"whenOut\": \"drawLeft\"" | "When an outcome runs out (an item sold out, a pool short of its prize, a stash empty), a roll draws among the outcomes still there by their written weights, so the others’ chances rise; with nothing left at all, a free roll waits to be asked again and a paid one is refunded" | "When an outcome runs out (an item sold out, a pool short of its prize, a stash empty), the box keeps selling while its first draw has anything left, and a roll draws among the outcomes still there by their written weights: the others’ chances rise as one runs out, so a player can empty a common outcome to make a rare one likelier (a box selling a rare prize should stop selling instead, the default)" | "When an outcome runs out, the box stops selling: it isn’t sold while anything an outcome takes (an item’s units left, a pool’s tokens, a stash’s NFTs) couldn’t cover, at the most any outcome sharing it takes in one draw, this purchase’s draws and those of purchases still waiting for the oracle, so every roll is on the odds as written and nobody can buy their way to a refund on every miss; it sells again once the project restocks or edits the box (an outcome whose odds shrink with stock needs no cover). An outcome emptied another way all the same (another route sharing its pool, item or stash) makes no draw, no other outcome taking its place, and gives back that draw’s worth of the price at the settle; with no draw made at all, the open is refunded";
|
|
115
115
|
/**
|
|
116
116
|
* What the end of a sharing farm that `runs` means, in words, or null (no end, or a fixed rate): its release keeps its
|
|
117
117
|
* pace, so what it has not let go by the end stays in its vault, free for the authority to take back, and so does what
|
|
@@ -275,7 +275,7 @@ export declare function lifeLines(r: any, m: any): {
|
|
|
275
275
|
needs: any[];
|
|
276
276
|
raises: any[];
|
|
277
277
|
};
|
|
278
|
-
/** A lottery's place as { percent, prize }: a number is a
|
|
278
|
+
/** A lottery's place as { percent, prize }: a number is a percent of what the round pays from, and no prize. */
|
|
279
279
|
export declare const placeOf: (p: any) => {
|
|
280
280
|
percent: any;
|
|
281
281
|
prize: any;
|
|
@@ -295,7 +295,7 @@ export declare const sharesOf: (split: any) => any;
|
|
|
295
295
|
* The program's `To` for a destination, with pool indexes resolved (the IDL's own shape). A wallet ("wallet:<address>")
|
|
296
296
|
* is paid at its own token account of the part's currency (the program opens it when it is not there); "treasury" is the game's treasury wallet's; "chosen"
|
|
297
297
|
* (or "chosen:<item>") is the one the buyer names when they buy; "lottery:<key>" is that lottery's pot
|
|
298
|
-
* ("@pot:<id>") and "farm:<key>" that farm's rewards vault ("@rewards:<id>"), which the plan resolves once the game is
|
|
298
|
+
* ("@pot:<lottery id>:<pot id>") and "farm:<key>" that farm's rewards vault ("@rewards:<id>"), which the plan resolves once the game is
|
|
299
299
|
* known.
|
|
300
300
|
*/
|
|
301
301
|
export declare function toEnum(to: any, m: any): "Burn" | "Treasury" | {
|
|
@@ -401,6 +401,51 @@ export declare const windowOf: (part: any, now: any) => {
|
|
|
401
401
|
opens_at: bigint;
|
|
402
402
|
closes_at: bigint;
|
|
403
403
|
};
|
|
404
|
+
/** Whether lottery `l` pays its places from a pot it keeps (`"pot"`, `PaysFrom::Pot`); false when each round pays from
|
|
405
|
+
* its own ticket money and sends what its places leave to `"rest"` (`PaysFrom::Round`). */
|
|
406
|
+
export declare const keepsPot: (l: any) => boolean;
|
|
407
|
+
/** The program's `PaysFrom` for a lottery: `{ Pot: [id] }` or `{ Round: { rest } }` (its `rest` as `toEnum` gives it). */
|
|
408
|
+
export declare const paysFromOf: (l: any, m: any) => {
|
|
409
|
+
Pot: any[];
|
|
410
|
+
Round?: undefined;
|
|
411
|
+
} | {
|
|
412
|
+
Pot?: undefined;
|
|
413
|
+
Round: {
|
|
414
|
+
rest: string | {
|
|
415
|
+
Pool: any[];
|
|
416
|
+
Account?: undefined;
|
|
417
|
+
Wallet?: undefined;
|
|
418
|
+
Chosen?: undefined;
|
|
419
|
+
Holder?: undefined;
|
|
420
|
+
} | {
|
|
421
|
+
Pool?: undefined;
|
|
422
|
+
Account: (string | undefined)[];
|
|
423
|
+
Wallet?: undefined;
|
|
424
|
+
Chosen?: undefined;
|
|
425
|
+
Holder?: undefined;
|
|
426
|
+
} | {
|
|
427
|
+
Pool?: undefined;
|
|
428
|
+
Account?: undefined;
|
|
429
|
+
Wallet: (string | undefined)[];
|
|
430
|
+
Chosen?: undefined;
|
|
431
|
+
Holder?: undefined;
|
|
432
|
+
} | {
|
|
433
|
+
Pool?: undefined;
|
|
434
|
+
Account?: undefined;
|
|
435
|
+
Wallet?: undefined;
|
|
436
|
+
Chosen: {
|
|
437
|
+
item: any;
|
|
438
|
+
};
|
|
439
|
+
Holder?: undefined;
|
|
440
|
+
} | {
|
|
441
|
+
Pool?: undefined;
|
|
442
|
+
Account?: undefined;
|
|
443
|
+
Wallet?: undefined;
|
|
444
|
+
Chosen?: undefined;
|
|
445
|
+
Holder: (string | undefined)[];
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
};
|
|
404
449
|
/** A lottery's split of ticket money: its own, and "cutPercent" as a share to the treasury. */
|
|
405
450
|
export declare const lotterySplit: (l: any) => any[];
|
|
406
451
|
/** The program's `Effect` for a spec effect: a flat share, or a share per point of the attribute. */
|
package/types/economy/plan.d.mts
CHANGED
|
@@ -405,13 +405,55 @@ export declare function prizeArgs(p: any, m: any): "Raffled" | {
|
|
|
405
405
|
*/
|
|
406
406
|
export declare const listLeaves: (list: any, t: any) => any;
|
|
407
407
|
/**
|
|
408
|
-
* A lottery's args: its
|
|
409
|
-
* `cutPercent` to the treasury) with the rest
|
|
408
|
+
* A lottery's args: its money in `currency` (the project's by default), ticket money split by `split` (and
|
|
409
|
+
* `cutPercent` to the treasury) with the rest for the places, which are paid from its pot (`pot`) or from each round's
|
|
410
|
+
* own money, what they leave going to `rest` (`paysFromOf`). No `every` draws once, at `firstDraw`.
|
|
410
411
|
*/
|
|
411
412
|
export declare function lotteryArgs(l: any, m: any): {
|
|
412
413
|
terms: {
|
|
413
414
|
price: bigint;
|
|
414
415
|
mint: string;
|
|
416
|
+
pays_from: {
|
|
417
|
+
Pot: any[];
|
|
418
|
+
Round?: undefined;
|
|
419
|
+
} | {
|
|
420
|
+
Pot?: undefined;
|
|
421
|
+
Round: {
|
|
422
|
+
rest: string | {
|
|
423
|
+
Pool: any[];
|
|
424
|
+
Account?: undefined;
|
|
425
|
+
Wallet?: undefined;
|
|
426
|
+
Chosen?: undefined;
|
|
427
|
+
Holder?: undefined;
|
|
428
|
+
} | {
|
|
429
|
+
Account: (string | undefined)[];
|
|
430
|
+
Wallet?: undefined;
|
|
431
|
+
Chosen?: undefined;
|
|
432
|
+
Holder?: undefined;
|
|
433
|
+
Pool?: undefined;
|
|
434
|
+
} | {
|
|
435
|
+
Account?: undefined;
|
|
436
|
+
Wallet: (string | undefined)[];
|
|
437
|
+
Chosen?: undefined;
|
|
438
|
+
Holder?: undefined;
|
|
439
|
+
Pool?: undefined;
|
|
440
|
+
} | {
|
|
441
|
+
Account?: undefined;
|
|
442
|
+
Wallet?: undefined;
|
|
443
|
+
Chosen: {
|
|
444
|
+
item: any;
|
|
445
|
+
};
|
|
446
|
+
Holder?: undefined;
|
|
447
|
+
Pool?: undefined;
|
|
448
|
+
} | {
|
|
449
|
+
Account?: undefined;
|
|
450
|
+
Wallet?: undefined;
|
|
451
|
+
Chosen?: undefined;
|
|
452
|
+
Holder: (string | undefined)[];
|
|
453
|
+
Pool?: undefined;
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
};
|
|
415
457
|
shares: any;
|
|
416
458
|
places: any;
|
|
417
459
|
ticket_mint: string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TRUST_LEVELS, TRUST_WORDS } from './trust.mjs';
|
|
2
|
+
/** Severities, most serious first. */
|
|
3
|
+
export declare const SEVERITIES: readonly string[];
|
|
4
|
+
export { TRUST_LEVELS, TRUST_WORDS };
|
|
5
|
+
/**
|
|
6
|
+
* The review of an economy: { ok, routes, findings, tradeoffs }. `ok` is false when there is a high finding, or when
|
|
7
|
+
* the spec does not check (then `refusals` says why, and the rest is empty).
|
|
8
|
+
*/
|
|
9
|
+
export declare function review(economy: any, { now }?: {
|
|
10
|
+
now?: number | undefined;
|
|
11
|
+
}): {
|
|
12
|
+
ok: boolean;
|
|
13
|
+
refusals: any[];
|
|
14
|
+
routes: never[];
|
|
15
|
+
findings: never[];
|
|
16
|
+
tradeoffs: string;
|
|
17
|
+
} | {
|
|
18
|
+
refusals?: undefined;
|
|
19
|
+
ok: boolean;
|
|
20
|
+
routes: ({
|
|
21
|
+
kind: string;
|
|
22
|
+
key: any;
|
|
23
|
+
name: any;
|
|
24
|
+
trigger: string;
|
|
25
|
+
enforced: any[];
|
|
26
|
+
trusts: any[];
|
|
27
|
+
trust: any;
|
|
28
|
+
ceiling: string;
|
|
29
|
+
feeds: any[];
|
|
30
|
+
} | {
|
|
31
|
+
kind: string;
|
|
32
|
+
key: any;
|
|
33
|
+
name: any;
|
|
34
|
+
trigger: string;
|
|
35
|
+
enforced: any[];
|
|
36
|
+
trusts: any;
|
|
37
|
+
trust: null;
|
|
38
|
+
ceiling: string;
|
|
39
|
+
feeds: any[];
|
|
40
|
+
})[];
|
|
41
|
+
findings: any[];
|
|
42
|
+
tradeoffs: string;
|
|
43
|
+
};
|
|
44
|
+
/** A review in words, for the terminal and the tool's text. */
|
|
45
|
+
export declare function describeReview(r: any, name?: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The trust levels a voucher grant declares, strongest first. */
|
|
2
|
+
export declare const TRUST_LEVELS: readonly string[];
|
|
3
|
+
/** Each trust level in words: what the server does, and what a cheater still gets. */
|
|
4
|
+
export declare const TRUST_WORDS: Readonly<{
|
|
5
|
+
decides: "the server decides the result itself (it runs the game or the match; the page sends only inputs): nothing the page says can forge one, though a bot that plays well still earns what a good player does";
|
|
6
|
+
replays: "the server runs the page’s inputs again and reads the result itself: a forged result fails, though a bot that plays well still earns, and one that knows the run’s randomness up front can search for the best run offline";
|
|
7
|
+
bounds: "the page runs the game and reports the result, and the server checks only its pace, order and daily caps: a script that waits as long as a person would gets every reward, up to the limits";
|
|
8
|
+
}>;
|
package/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { simulate, explain } from './economy/simulate.mjs';
|
|
|
3
3
|
export { plan, setupSteps, playSteps } from './economy/plan.mjs';
|
|
4
4
|
export { cost, explainCost } from './economy/cost.mjs';
|
|
5
5
|
export { explainEconomy } from './economy/explain.mjs';
|
|
6
|
+
export { review, describeReview, SEVERITIES, TRUST_LEVELS, TRUST_WORDS } from './economy/review.mjs';
|
|
6
7
|
export { model } from './economy/model.mjs';
|
|
7
8
|
export { prepare, recordLanded, changedParts } from './economy/live.mjs';
|
|
8
9
|
export { guideText, catalog, CANNOT } from './economy/guide.mjs';
|