@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
|
@@ -7,7 +7,8 @@ and the spec differ (a limit, an amount, a key not set yet), change one of them
|
|
|
7
7
|
1. **What each play costs and is worth.** Lead with the tools' "in all" number: "A cast costs about 0.0234 SOL in
|
|
8
8
|
all (0.02 SOL, the 0.002 SOL player fee, the oracle and the network, and the Perch's rent when one is caught), and
|
|
9
9
|
gives back 0.01 SOL in prizes on average (50%), plus a Perch 3 casts in 10." For a box of items, the odds; for a
|
|
10
|
-
lottery,
|
|
10
|
+
lottery, where its places are paid from (its pot, which gifts and what earlier rounds left fill, or each round's own
|
|
11
|
+
ticket money, which nothing from outside can change), what that reaches and what each place wins; for a farm, a day of rewards per unit staked and what the
|
|
11
12
|
lock tiers multiply.
|
|
12
13
|
2. **Where the money goes.** "55% of each cast goes into the pond that pays the Golden Carp, 5% into the monthly
|
|
13
14
|
draw's pot, and the other 40% to your treasury."
|
|
@@ -22,13 +23,14 @@ and the spec differ (a limit, an amount, a key not set yet), change one of them
|
|
|
22
23
|
and how often, and what happens if nobody does. If a payout rewards a result the game reports (a clear, a win,
|
|
23
24
|
a score): "Checking that a player really did it is up to you, on your own server: a game runs in the player's
|
|
24
25
|
browser, and the program trusts the authority's signature."
|
|
25
|
-
6. **Flags for the law.** `W-CHANCE-PRIZE`: "Players pay for a chance at money. That is gambling in many places once
|
|
26
|
+
6. **Flags for the law, once.** `W-CHANCE-PRIZE`: "Players pay for a chance at money. That is gambling in many places once
|
|
26
27
|
it is real money; this runs on devnet only." `W-CHANCE-ITEMS`: "Players pay for random items they can resell: some
|
|
27
28
|
places treat that as gambling, and many require the odds to be shown." `W-REVENUE-SHARE`: "Stakers are paid from
|
|
28
|
-
what players spend; regulators look at that when they decide whether a token is a security." Say
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
what players spend; regulators look at that when they decide whether a token is a security." Say each once, the
|
|
30
|
+
first time the checker raises it; then leave them, saying them again only when the person asks or a flag of a new
|
|
31
|
+
kind appears, and keep them out of pages and apps unless asked. The approval page shows them, with the program's
|
|
32
|
+
status (not independently audited, as is, at their own risk, theirs to make legal where they offer it), and keeps
|
|
33
|
+
Approve off until the owner ticks that they read it.
|
|
32
34
|
7. **For an auction**, say how it ends, in their words: "The highest bid when the 48 hours are up wins. Each bid must
|
|
33
35
|
be at least 0.5 SOL and 5% over the last; a bid in the last 10 minutes gives everyone 10 more. Whoever is outbid
|
|
34
36
|
has their SOL back at once, in the same transaction. With no bid, the lot goes back (an item's unit is never
|
|
@@ -38,6 +40,12 @@ and the spec differ (a limit, an amount, a key not set yet), change one of them
|
|
|
38
40
|
For a collectible they already hold: "It stays with the project until someone wins it or the auction ends."
|
|
39
41
|
8. **Anything else the checker warned about**, in a sentence each (a mint that can freeze accounts, a free box bots
|
|
40
42
|
can drain, a grant with no limits or no funds).
|
|
43
|
+
9. **What a cheater gets**, from `xsolana_review`, before the owner approves: for each route paid on a server's
|
|
44
|
+
voucher, which level it uses (the server decides, replays or only bounds the result), what one cheater gets there
|
|
45
|
+
(its ceiling, and what the prize goes on to earn), and what the stronger level would cost to build: "A script that
|
|
46
|
+
waits as long as a player would gets each reward NFT once per wallet, and each then earns tokens every day with no
|
|
47
|
+
end; having the server replay each run would stop forged runs, and needs the game to be deterministic." Then each
|
|
48
|
+
high finding and its fix. The person chooses the trade-off (`trust-and-cheating.md`).
|
|
41
49
|
|
|
42
50
|
## What stays the project's job
|
|
43
51
|
|
|
@@ -78,6 +86,7 @@ money; it holds no files and serves nothing.
|
|
|
78
86
|
`xsolana_check` counts them.
|
|
79
87
|
|
|
80
88
|
Don'ts:
|
|
89
|
+
|
|
81
90
|
- Don't show mints, account addresses, PDAs, lamports or instruction names unless asked.
|
|
82
91
|
- Don't promise returns, profits or "passive income". Say what the program does, with the numbers.
|
|
83
92
|
- Don't hide a gap: if loot can't do what they asked, the first line says so and offers the nearest thing.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Trust and cheating
|
|
2
|
+
|
|
3
|
+
The program enforces its own rules: a cheater can't take more than a route's limits, move a voucher to another
|
|
4
|
+
wallet, harvest someone else's seat or mint into the project's collection. What a cheater can still take is what the
|
|
5
|
+
economy's design and its servers leave open: a result the server never really checked, a person counted as many
|
|
6
|
+
wallets, a reward that keeps earning for good. This page is how to read an economy for that, and how to tell the
|
|
7
|
+
person what they are choosing. `xsolana_review` does the reading for a spec; this page says why.
|
|
8
|
+
|
|
9
|
+
## How far a result can be trusted
|
|
10
|
+
|
|
11
|
+
A result is worth paying only as far as the server that signs the voucher can tell it happened. Strongest first:
|
|
12
|
+
|
|
13
|
+
- **The server decides it.** A turn game played on the server, or a room whose server runs the match: the page sends
|
|
14
|
+
inputs, never results. The result is what the server saw.
|
|
15
|
+
- **The server replays it.** A deterministic game (a fixed time step, seeded randomness): the page sends its inputs,
|
|
16
|
+
and the server runs them again and reads the result itself. Mind CPU limits: replay short runs, or a long one in
|
|
17
|
+
pieces as it is played. Never hand the page the whole run's randomness up front: with the seed and the rules, a
|
|
18
|
+
script searches for the best run offline and sends only that. Reveal randomness as the run goes, or keep the seed on
|
|
19
|
+
the server; one open run per player, and count abandoned runs toward the day's.
|
|
20
|
+
- **The server bounds it.** Any game the browser simulates: the server starts each run (an id and its own clock),
|
|
21
|
+
takes each checkpoint in order, refuses what is faster than the game allows, caps what one player earns a day, and
|
|
22
|
+
can ban. A script that plays at human speed still gets through: this limits what a cheater earns, it does not stop
|
|
23
|
+
one.
|
|
24
|
+
|
|
25
|
+
| Level | What it costs to build | CPU and latency | What a cheater gets | Fits |
|
|
26
|
+
| ------- | ------------------------------------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
27
|
+
| decides | the most: the game's rules run on the server (or in a room that runs the match) | every move waits on the server | what a bot that plays well earns; nothing forged | turn games, card and board games, matches in a room, anything with hidden information |
|
|
28
|
+
| replays | a deterministic game (fixed step, seeded randomness the server keeps) and a replayer | a replay per run, after the fact; short runs or in pieces | what a bot that plays well earns; with the seed up front, the best run found | puzzles, runners, arcade games with short runs |
|
|
29
|
+
| bounds | the least: a run id, the server's clock, checkpoints in order, daily caps, a ban list | almost none | every reward a script claims at human speed, up to the limits | anything the browser simulates; prizes that are cosmetic, small or capped |
|
|
30
|
+
|
|
31
|
+
Even a result the server decided is worth what a good bot can earn. Pay a bounded or replayed result only what you would
|
|
32
|
+
accept losing to a patient script (small amounts, capped a day), and keep entry fees and prize pools for results the
|
|
33
|
+
server decided and for chance (the oracle). Tell players which one your game is.
|
|
34
|
+
|
|
35
|
+
**Say it in the spec.** Every grant paid on vouchers says what its server checks: `"trust": "decides"`, `"replays"` or
|
|
36
|
+
`"bounds"`. It is the spec's own note (it never goes on chain, and changing it publishes nothing), and it must be
|
|
37
|
+
honest: a server that takes the page's word within a pace is `bounds`, whatever else it does. `xsolana_review` reads a
|
|
38
|
+
voucher grant that says nothing as `bounds`, the weakest.
|
|
39
|
+
|
|
40
|
+
## Who gets paid: wallets are not people
|
|
41
|
+
|
|
42
|
+
- **A wallet is free.** Any limit per wallet (`perWallet`, a gate's one claim per collectible shown) limits wallets,
|
|
43
|
+
never a person. What bounds a reward is its totals: `perDay` and `total` are the most it can ever pay, whatever
|
|
44
|
+
happens to a key or how many wallets come.
|
|
45
|
+
- **Count people through vouchers.** `perPerson` counts the person the voucher names (a person hash), which only the
|
|
46
|
+
server chooses: the player can't pick or change it, and an open grant has none. So it is exactly as good as the
|
|
47
|
+
server's choice: a real outside identity (an X account) counts people; a wallet, or a voucher with no person, counts
|
|
48
|
+
nobody. For rewards worth farming, pay only players signed in with X.
|
|
49
|
+
- **Make farming cost something.** Gate on holding a collectible the game sells or a locked stake (`gate`), pay only
|
|
50
|
+
wallets a player proved (`proofRequest` / `verifyProof`), and keep prizes for results small.
|
|
51
|
+
- **Bots play well.** Even a verified result pays a bot what it pays a good player.
|
|
52
|
+
|
|
53
|
+
## What the program guarantees
|
|
54
|
+
|
|
55
|
+
These were attacked on devnet and refused by the program; there is nothing to build for them:
|
|
56
|
+
|
|
57
|
+
- **A voucher is bound to its claim.** It signs the program, the grant, the grant's incarnation, the wallet, the person,
|
|
58
|
+
an expiry and its rounds. It can't be moved to another wallet, or replayed on another grant or a re-made one. A key
|
|
59
|
+
not among the grant's voucher keys is refused, and so is a claim with no voucher on a grant that isn't open.
|
|
60
|
+
- **The winning wallet signs its own claim.** Anyone may pay its fees; nobody claims for it.
|
|
61
|
+
- **A round pays a wallet once** per grant incarnation, whoever signs it again and whenever; `perWallet`,
|
|
62
|
+
`perPerson`, `perKey`, `perDay` and `total` are kept by the program.
|
|
63
|
+
- **A farm's gate can't be forged.** It checks the project's collection and the item number the program writes at mint
|
|
64
|
+
and never lets change: an NFT of another collection, one in no collection, an attribute written by hand, or a mint
|
|
65
|
+
into the project's collection by anyone but the project are refused. Boosts read the staked NFT's own item number.
|
|
66
|
+
- **One seat per NFT, ever.** In escrow, an NFT can't leave before its lock or be staked twice. Watched, an NFT sold
|
|
67
|
+
while staked earns its old staker nothing more, and its new holder takes the seat over. Nobody harvests or unstakes
|
|
68
|
+
someone else's seat.
|
|
69
|
+
- **The project's keys.** A token the project mints has the project as its only minter and no freeze authority. Only
|
|
70
|
+
the authority mints or moves pool funds; only the owner changes mechanics or closes records. Money held for a
|
|
71
|
+
record (a farm's stakes and rewards, a pot, an order, a bid) leaves only by that record's rules.
|
|
72
|
+
- **Chance is the oracle's.** Nobody, the project included, steers a roll or a draw.
|
|
73
|
+
|
|
74
|
+
## What is still yours to get right: the checklist
|
|
75
|
+
|
|
76
|
+
Run `xsolana_review` and go through what it reports; these are the points behind its findings.
|
|
77
|
+
|
|
78
|
+
1. **The signer decides who is paid.** The program checks a voucher's signature, wallet and limits, never what
|
|
79
|
+
happened in the game. Declare `trust` honestly on every voucher grant, and make the server's checks match it.
|
|
80
|
+
2. **Person counting.** `perPerson` holds only when the server names a real person (an X account) in every voucher,
|
|
81
|
+
never a wallet. Without it, each free wallet claims again: set `perDay` and `total` as if every claim were a new
|
|
82
|
+
wallet.
|
|
83
|
+
3. **Sybil wallets.** Open grants (no voucher, code or list) pay any wallet that asks: gate them on something a sybil
|
|
84
|
+
must pay for, keep their prizes small or soulbound, and set `perDay`.
|
|
85
|
+
4. **Voucher key custody.** The key's secret lives only on the server: never in a page, a repository, a spec or a
|
|
86
|
+
chat. Anyone holding it pays anyone, up to the grant's limits, which is why `perDay` and `total` matter. To rotate
|
|
87
|
+
it, put the new public key in the grant's `vouchers` and publish. Use a different key on each cluster: a voucher's
|
|
88
|
+
bytes don't name the cluster.
|
|
89
|
+
5. **Re-made grants pay again.** Closing and making a grant again starts a new incarnation: a new campaign whose
|
|
90
|
+
limits start from zero, and whose list pays every listed round again. Give a re-made grant fresh rounds.
|
|
91
|
+
6. **Emission without an end.** A farm whose rate is minted, with no `runs`, no term on every tier (`earnsFor`), no
|
|
92
|
+
upkeep and no halving, mints for as long as anything is staked. Every way to get what it takes is then worth that
|
|
93
|
+
stream: a cheatable claim of a staked NFT compounds into tokens for good. Give it an end, or pay its rate from its
|
|
94
|
+
vault.
|
|
95
|
+
7. **Prizes worth farming.** A tradeable prize (tokens, an NFT that can be sold, a roll) on a route a script can reach
|
|
96
|
+
is what a cheater farms. Keep such prizes for results the server decides, or small and capped.
|
|
97
|
+
8. **Entry fees and prize pools.** Players' money (a payment, a box's or a lottery's share into a pool) paid out on a
|
|
98
|
+
bounded or replayed result goes to whoever scripts it. Keep those for decided results and chance.
|
|
99
|
+
9. **NFT farm custody.** Escrow moves the NFT to the project while staked; freeze locks it in the wallet; watch leaves
|
|
100
|
+
it free, so it can be sold while staked and its buyer takes the seat. The issuer's own controls still apply to
|
|
101
|
+
NFTs of other collections.
|
|
102
|
+
10. **The gate.** A farm or a route gated on the project's items (`items`, `item_id`, `rarity`) is as strong as the
|
|
103
|
+
ways those items are had. A gate on another collection's attributes trusts whoever can write them.
|
|
104
|
+
11. **The authority and the treasury.** The owner's wallet alone changes every price, rate, grant, limit and voucher
|
|
105
|
+
key; the authority mints, moves pool funds, decides contests and releases holds, with no caps. Keep them in a
|
|
106
|
+
hardware wallet or a multisig; a server that signs gets an authority key of its own, never the owner's.
|
|
107
|
+
12. **The page is untrusted.** A page builds the player's transactions, and a cheater builds their own: the program's
|
|
108
|
+
checks are what count, never the page's. Anything the page decides (a score, a reward amount, who won) is only as
|
|
109
|
+
good as the server that checks it.
|
|
110
|
+
13. **Ordering.** A lottery's tickets are not weighted by time: one buyer can take most of a round right before the
|
|
111
|
+
draw. Anyone, the seller included, can bid an auction up. A box that keeps selling when an outcome runs out
|
|
112
|
+
(`drawLeft`) lets someone watching the stock empty a common outcome to make a rare likelier.
|
|
113
|
+
14. **Contests.** Players' stakes go to the side the authority or a decider key names: keep contests for results the
|
|
114
|
+
server decides, or that anyone can check outside the game.
|
|
115
|
+
|
|
116
|
+
## Telling the person
|
|
117
|
+
|
|
118
|
+
After `xsolana_review`, before the owner approves, say in plain words:
|
|
119
|
+
|
|
120
|
+
- for each signed route, which level its server uses and what a cheater gets ("A script that waits long enough gets
|
|
121
|
+
a Legendary per wallet, up to 100 a day, and each earns 50 tokens a day for good");
|
|
122
|
+
- what the next level would cost to build ("replaying runs needs the game to be deterministic and a server that re-runs
|
|
123
|
+
each run");
|
|
124
|
+
- every high finding, and its fix, or that they accept it.
|
|
125
|
+
|
|
126
|
+
They choose the trade-off, not you.
|
package/types/chain/core.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { MPL_CORE_PROGRAM };
|
|
|
6
6
|
* it also carries Bubblegum's plugin, so compressed NFTs can be minted into it. The collection address signs too (a
|
|
7
7
|
* fresh key).
|
|
8
8
|
*/
|
|
9
|
-
export declare function createCollectionInstruction({ collection, creator, name, uri, royaltyBps, project, compressed }: {
|
|
9
|
+
export declare function createCollectionInstruction({ collection, creator, name, uri, royaltyBps, project, compressed, }: {
|
|
10
10
|
collection: any;
|
|
11
11
|
compressed?: boolean | undefined;
|
|
12
12
|
creator: any;
|
package/types/chain/lookup.d.ts
CHANGED
|
@@ -176,7 +176,7 @@ declare const pause: (ms: any) => Promise<any>;
|
|
|
176
176
|
* plain sentence when it can't be sent. Returns { signature (the last transaction's), table (its address, or null),
|
|
177
177
|
* steps (the signatures of the transactions before it) }.
|
|
178
178
|
*/
|
|
179
|
-
export declare function sendFitting({ rpc, payer, instructions, sign, table, alone, first, standing, sleep }: {
|
|
179
|
+
export declare function sendFitting({ rpc, payer, instructions, sign, table, alone, first, standing, sleep, }: {
|
|
180
180
|
alone?: (() => boolean) | undefined;
|
|
181
181
|
first?: never[] | undefined;
|
|
182
182
|
instructions: any;
|
|
@@ -86,6 +86,17 @@ export declare const ENDED = 2;
|
|
|
86
86
|
/** How many losers' NFTs a winner of a contest of NFTs takes: the share fixed at the decision, one more for an early
|
|
87
87
|
* place on its side. */
|
|
88
88
|
export declare const shareOf: (contest: any, entry: any) => number;
|
|
89
|
+
/**
|
|
90
|
+
* What a winning entry that put in `amount` takes with its first claim of a decided contest of tokens: its part of what
|
|
91
|
+
* the decision wrote (`pot_won`, the pot once the shares were taken; `prize_won`, a split prize's vault), by what it put
|
|
92
|
+
* in against its side's total. The winners claimed before it took `won × claimed ÷ total`, so the parts add up exactly
|
|
93
|
+
* whatever the order: `{ pot, prize }` (the prize part is 0 when the claim forgoes it). Tokens sent to the pot after the
|
|
94
|
+
* decision are nobody's.
|
|
95
|
+
*/
|
|
96
|
+
export declare function contestWinnings(contest: any, amount: any): {
|
|
97
|
+
pot: bigint;
|
|
98
|
+
prize: bigint;
|
|
99
|
+
};
|
|
89
100
|
/** What a count allows `n` more of at `now` under `limit` ({ total, per_window, window }, 0 is no limit; a lottery's
|
|
90
101
|
* window is its round plus one, given as `window`). */
|
|
91
102
|
export declare function countAllows(count: any, limit: any, now: any, n?: number, window?: number): boolean;
|
|
@@ -179,10 +190,20 @@ export declare function decodeTokenMetadata(data: any): {
|
|
|
179
190
|
ruleSet: string | null;
|
|
180
191
|
} | null;
|
|
181
192
|
export declare const OWN_PAID: bigint;
|
|
182
|
-
/** The mint a lottery's tickets are paid in (`terms`: a Lottery's or a round's): its ticket mint, burned, or
|
|
193
|
+
/** The mint a lottery's tickets are paid in (`terms`: a Lottery's or a round's): its ticket mint, burned, or `mint`. */
|
|
183
194
|
export declare const paymentMint: (terms: any) => any;
|
|
184
195
|
/** Whether a lottery's tickets are burned: they are paid in a ticket mint of its own. */
|
|
185
196
|
export declare const ticketsBurn: (terms: any) => boolean;
|
|
197
|
+
/** The most pots one lottery keeps (`MAX_POTS`): a pot's id is below it. */
|
|
198
|
+
export declare const MAX_POTS: number;
|
|
199
|
+
/** The pot a lottery's places are paid from (`terms.pays_from`: `{ Pot: [id] }`), or null when each round pays from its
|
|
200
|
+
* own ticket money (`{ Round: { rest } }`). */
|
|
201
|
+
export declare const potIdOf: (terms: any) => number | null;
|
|
202
|
+
/** Where what a round's places leave goes (`Part::Common` past the shares): its pot, or the `rest` a round paid from
|
|
203
|
+
* its own money names (`lotteryAddress`: the lottery's). */
|
|
204
|
+
export declare const leftoverTo: (lotteryAddress: any, terms: any) => any;
|
|
205
|
+
/** The ids of the pots a lottery opened (`Lottery::pots`, one bit an id), lowest first: a close empties each. */
|
|
206
|
+
export declare const lotteryPots: (lottery: any) => number[];
|
|
186
207
|
/** A share the buyer chooses (a referrer, a collectible's holder): paid out of the price as they buy, from their own account. */
|
|
187
208
|
export declare const chosenAtPurchase: (share: any) => boolean;
|
|
188
209
|
/** The bytes of one entry of a round: buyer, word, what arrived (`fee`: a fee mint, or a chosen share), the NFT ticket. */
|
|
@@ -250,7 +271,7 @@ export declare function partsOwed(r: any, i: any, { places }?: {
|
|
|
250
271
|
})[];
|
|
251
272
|
/**
|
|
252
273
|
* The parts of a round owed in common, of no entry (`{ Common: [i] }`): each share paid in common once drawn (one that
|
|
253
|
-
* burns is burned at the close), then what
|
|
274
|
+
* burns is burned at the close), then what its places leave, owed to its pot or to `rest` (`i` = the shares' count), then after a
|
|
254
275
|
* cancel each pool's token prize back to its pool (past it).
|
|
255
276
|
*/
|
|
256
277
|
export declare function commonOwed(r: any): {
|
|
@@ -260,7 +281,7 @@ export declare function commonOwed(r: any): {
|
|
|
260
281
|
export declare const entryOf: (r: any, ticket: any) => any;
|
|
261
282
|
/** Whether a round is done and owes nothing: the next pull closes it, given its close's accounts. */
|
|
262
283
|
export declare const roundFinished: (r: any) => boolean;
|
|
263
|
-
/** Whether a lottery's place wins something: a
|
|
284
|
+
/** Whether a lottery's place wins something: a part of what the round pays from, a prize, or both. */
|
|
264
285
|
export declare const placeSet: (place: any) => boolean;
|
|
265
286
|
/** The address of a lottery's current round's record (there or not). */
|
|
266
287
|
export declare const roundAddress: (lotteryAddress: any, lottery: any) => any;
|
package/types/client/grant.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const dayOf: (unixSeconds: any) => number;
|
|
|
12
12
|
/** An i64 little-endian (two's complement), as the program reads `expires`. */
|
|
13
13
|
export declare const i64LE: (value: any) => Uint8Array<any>;
|
|
14
14
|
/** A voucher's body, which its key signs the sha256 of (`voucherBytes`). */
|
|
15
|
-
export declare function voucherBody({ program, grant, incarnation, wallet, personHash, expires, rounds, round, amount }: {
|
|
15
|
+
export declare function voucherBody({ program, grant, incarnation, wallet, personHash, expires, rounds, round, amount, }: {
|
|
16
16
|
amount?: bigint | undefined;
|
|
17
17
|
expires: any;
|
|
18
18
|
grant: any;
|
|
@@ -123,7 +123,7 @@ export declare function shardBitsFor(wallets: any, rounds?: number): number;
|
|
|
123
123
|
* order only (`askRollIx` then asks for it, in the same transaction when it fits). Send it with a compute limit of
|
|
124
124
|
* `CLAIM_COMPUTE_UNITS`.
|
|
125
125
|
*/
|
|
126
|
-
export declare function claimGrantIx({ project, id, grant, wallet, signer, count, rounds, round, expires, personHash, amount, proofs, proof, paidRounds, poolMint, item, nft, shown, listProof, programs, voucherKey, nonce, extra }: {
|
|
126
|
+
export declare function claimGrantIx({ project, id, grant, wallet, signer, count, rounds, round, expires, personHash, amount, proofs, proof, paidRounds, poolMint, item, nft, shown, listProof, programs, voucherKey, nonce, extra, }: {
|
|
127
127
|
amount?: bigint | undefined;
|
|
128
128
|
count?: number | undefined;
|
|
129
129
|
expires: any;
|
|
@@ -4460,6 +4460,28 @@ declare const _default: {
|
|
|
4460
4460
|
})[];
|
|
4461
4461
|
variants?: undefined;
|
|
4462
4462
|
};
|
|
4463
|
+
} | {
|
|
4464
|
+
name: string;
|
|
4465
|
+
docs: string[];
|
|
4466
|
+
type: {
|
|
4467
|
+
fields?: undefined;
|
|
4468
|
+
kind: string;
|
|
4469
|
+
variants: ({
|
|
4470
|
+
fields?: undefined;
|
|
4471
|
+
name: string;
|
|
4472
|
+
} | {
|
|
4473
|
+
name: string;
|
|
4474
|
+
fields: string[];
|
|
4475
|
+
} | {
|
|
4476
|
+
name: string;
|
|
4477
|
+
fields: {
|
|
4478
|
+
name: string;
|
|
4479
|
+
type: {
|
|
4480
|
+
vec: string;
|
|
4481
|
+
};
|
|
4482
|
+
}[];
|
|
4483
|
+
})[];
|
|
4484
|
+
};
|
|
4463
4485
|
} | {
|
|
4464
4486
|
name: string;
|
|
4465
4487
|
docs: string[];
|