@xgamesfun/solana 0.20.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -52
- package/bin/xsolana.mjs +23 -8
- package/examples/blind-forge.json +2 -4
- package/examples/coin-flip-arena.json +4 -12
- package/examples/duel-arena.json +1 -4
- package/examples/elements-set.json +2 -9
- package/examples/expedition-guild.json +1 -8
- package/examples/fair-presale.json +1 -3
- package/examples/guild-missions.json +3 -10
- package/examples/halving-seasons.json +4 -9
- package/examples/hero-trials.json +15 -6
- package/examples/holder-den.json +38 -0
- package/examples/holders-drop.json +105 -0
- package/examples/ideas.json +788 -788
- package/examples/match-predictions.json +24 -0
- package/examples/merge-2048.json +5 -5
- package/examples/nft-raffle.json +1 -0
- package/examples/pack-league.json +108 -0
- package/examples/paper-hands-farm.json +4 -16
- package/examples/partner-vault.json +20 -7
- package/examples/sacrifice-raffle.json +2 -10
- package/examples/shelter-fair.json +1 -0
- package/examples/stakers-draw.json +4 -15
- package/examples/star-fleet.json +1 -8
- package/examples/starforce.json +6 -6
- package/examples/stride-sneakers.json +164 -0
- package/examples/trade-in-shop.json +2 -3
- package/js/approve/details.mjs +122 -52
- package/js/approve/ed25519.mjs +5 -1
- package/js/approve/live-check.mjs +83 -26
- package/js/approve/page.html +217 -78
- package/js/approve/page.js +43 -15
- package/js/approve/server.mjs +290 -73
- package/js/chain/base58.js +7 -1
- package/js/chain/borsh.js +24 -11
- package/js/chain/bytes.js +11 -8
- package/js/chain/core.js +35 -7
- package/js/chain/curve.js +1 -1
- package/js/chain/lookup.js +124 -36
- package/js/chain/mint.js +6 -2
- package/js/chain/pda.js +2 -2
- package/js/chain/programs.js +6 -6
- package/js/chain/rpc.js +44 -16
- package/js/chain/token.js +13 -2
- package/js/chain/token2022.js +55 -16
- package/js/chain/tx.js +32 -22
- package/js/client/accounts.js +653 -131
- package/js/client/compressed.js +4 -3
- package/js/client/grant.js +267 -83
- package/js/client/idl/loot.js +1 -1
- package/js/client/idl/loot.json +2406 -2176
- package/js/client/index.js +1 -0
- package/js/client/ix.js +3059 -664
- package/js/client/pda.js +39 -33
- package/js/client/policy.js +52 -24
- package/js/client/random.js +70 -0
- package/js/client/sizes.js +414 -16
- package/js/client/traits.js +14 -5
- package/js/connect/connect.mjs +59 -17
- package/js/economy/check.mjs +4153 -725
- package/js/economy/cost.mjs +403 -64
- package/js/economy/examples.mjs +176 -35
- package/js/economy/explain.mjs +466 -111
- package/js/economy/guide.mjs +296 -72
- package/js/economy/legal.mjs +12 -6
- package/js/economy/live.mjs +83 -19
- package/js/economy/model.mjs +462 -124
- package/js/economy/plan.mjs +1306 -219
- package/js/economy/schema.json +390 -484
- package/js/economy/secrets.mjs +17 -7
- package/js/economy/simulate.mjs +883 -223
- package/js/economy/txsize.mjs +15 -3
- package/js/economy/validate.mjs +61 -24
- package/js/mcp/server.mjs +42 -14
- package/js/mcp/tools.mjs +307 -88
- package/js/play/index.js +2864 -619
- package/js/play/keys.js +193 -0
- package/js/results/index.js +223 -30
- package/js/results/server.js +230 -0
- package/js/results/wire.js +64 -16
- package/package.json +6 -4
- package/release.json +5 -5
- package/skills/xsolana-economy/SKILL.md +39 -21
- package/skills/xsolana-economy/references/after-launch.md +58 -38
- package/skills/xsolana-economy/references/apps.md +97 -50
- package/skills/xsolana-economy/references/sentence-to-spec.md +148 -121
- package/skills/xsolana-economy/references/telling-the-person.md +61 -17
- package/types/chain/core.d.ts +4 -2
- package/types/chain/lookup.d.ts +5 -2
- package/types/chain/rpc.d.ts +3 -1
- package/types/client/accounts.d.ts +217 -56
- package/types/client/grant.d.ts +72 -27
- package/types/client/idl/loot.d.ts +602 -549
- package/types/client/index.d.ts +1 -0
- package/types/client/ix.d.ts +3884 -247
- package/types/client/pda.d.ts +22 -16
- package/types/client/policy.d.ts +39 -14
- package/types/client/random.d.ts +26 -0
- package/types/client/sizes.d.ts +93 -5
- package/types/economy/check.d.mts +5 -10
- package/types/economy/cost.d.mts +2 -1
- package/types/economy/guide.d.mts +5 -0
- package/types/economy/live.d.mts +16 -1
- package/types/economy/model.d.mts +151 -38
- package/types/economy/plan.d.mts +237 -194
- package/types/economy/simulate.d.mts +21 -13
- package/types/mcp/tools.d.mts +21 -13
- package/types/play/index.d.ts +453 -53
- package/types/play/keys.d.ts +51 -0
- package/types/results/index.d.ts +7 -6
- package/types/results/server.d.ts +126 -0
- package/types/results/wire.d.ts +1 -1
package/types/client/pda.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare const COMPRESSION_PROGRAM = "mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcb
|
|
|
11
11
|
export declare const NOOP_PROGRAM = "mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3";
|
|
12
12
|
/** The PDA of these seeds under the loot program, with its bump. */
|
|
13
13
|
export declare const lootAddress: (seeds: any, program?: string) => any;
|
|
14
|
-
declare const keyReceipt: (grant: any, incarnation: any, voucherKey: any) => any;
|
|
15
14
|
export declare const pda: {
|
|
16
15
|
platform: () => any;
|
|
17
16
|
/** A project: any wallet (its creator) opens as many as it likes, each with a number of its own (`id`, a u64). A
|
|
@@ -24,6 +23,10 @@ export declare const pda: {
|
|
|
24
23
|
box: (project: any, id: any) => any;
|
|
25
24
|
/** NFTs the project holds to give away as prizes: a box entry of a stash gives one of them at random. */
|
|
26
25
|
stash: (project: any, id: any) => any;
|
|
26
|
+
/** A table of weighted rows the project writes and seals (a card among thousands, a trait's values), or commits by a Merkle root. */
|
|
27
|
+
table: (project: any, id: any) => any;
|
|
28
|
+
/** What the project keeps about a wallet (its player's profile: XP, level, rank). */
|
|
29
|
+
profile: (project: any, wallet: any) => any;
|
|
27
30
|
schedule: (project: any, id: any) => any;
|
|
28
31
|
lottery: (project: any, id: any) => any;
|
|
29
32
|
recipe: (project: any, id: any) => any;
|
|
@@ -36,14 +39,16 @@ export declare const pda: {
|
|
|
36
39
|
/** Every collectible the program mints of its own accord (an order's, a prize's, an auction's lot): its address
|
|
37
40
|
* names its item and its serial, minted once at most. */
|
|
38
41
|
itemAsset: (item: any, serial: any) => any;
|
|
39
|
-
/** A contest's pot
|
|
42
|
+
/** A contest's pot: `["pot", contest]`. */
|
|
40
43
|
pot: (record: any) => any;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/** One
|
|
44
|
-
|
|
45
|
-
/** A
|
|
46
|
-
|
|
44
|
+
/** A lottery's pot `id` (below `MAX_POTS`), kept from round to round: `["pot", lottery, id]`. */
|
|
45
|
+
lotteryPot: (lottery: any, id: any) => any;
|
|
46
|
+
/** One round of a lottery: its record, opened by the round's first purchase (`["round", lottery, incarnation, round]`). */
|
|
47
|
+
round: (lottery: any, incarnation: any, round: any) => any;
|
|
48
|
+
/** A lottery round's own token account of `mint`, which the round's record owns. */
|
|
49
|
+
roundTokens: (round: any, mint: any) => any;
|
|
50
|
+
/** A contest's list of entries, one record a player (page 0). */
|
|
51
|
+
entries: (contest: any, incarnation: any, page?: number) => any;
|
|
47
52
|
/** A hold names its NFT and its end (Unix seconds): a release sent late never finds a later hold of the NFT. */
|
|
48
53
|
hold: (asset: any, freeAt: any) => any;
|
|
49
54
|
/** An offer: an id is its maker's own. Its money waits in the project's vault for its mint (`vault`). */
|
|
@@ -58,6 +63,8 @@ export declare const pda: {
|
|
|
58
63
|
listing: (project: any, asset: any) => any;
|
|
59
64
|
staked: (farm: any) => any;
|
|
60
65
|
rewards: (farm: any) => any;
|
|
66
|
+
/** A farm's record of when its seats stop earning, for a farm that keeps one (`Farm.keeps_ends`). */
|
|
67
|
+
ends: (farm: any) => any;
|
|
61
68
|
/** A seat: a player's in a farm of tokens, a collectible's (its asset) in a farm of collectibles. */
|
|
62
69
|
seat: (farm: any, by: any) => any;
|
|
63
70
|
/** What the project writes about an NFT it has no authority over (its Sheet): `nft` is a Core asset, a Token Metadata mint or a compressed NFT's asset id. */
|
|
@@ -70,14 +77,13 @@ export declare const pda: {
|
|
|
70
77
|
treeConfig: (tree: any) => any;
|
|
71
78
|
/** A compressed NFT's asset id: Bubblegum's `["asset", tree, nonce]`, `nonce` the count minted before it. */
|
|
72
79
|
compressedAsset: (tree: any, nonce: any) => any;
|
|
73
|
-
/** A wallet's
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
code: typeof keyReceipt;
|
|
80
|
+
/** A wallet's counts in a project: how many times it bought from each box, crafted each recipe or held tickets in
|
|
81
|
+
* a lottery's round that limits it (`decodeCounts`). */
|
|
82
|
+
counts: (project: any, wallet: any) => any;
|
|
83
|
+
/** Shard `shard` of a grant's limit records: what each wallet, person, badge and voucher key claimed. */
|
|
84
|
+
claims: (grant: any, incarnation: any, shard: any) => any;
|
|
85
|
+
/** Shard `shard` of the rounds a grant paid. */
|
|
86
|
+
rounds: (grant: any, incarnation: any, shard: any) => any;
|
|
81
87
|
/** The program's identity, which signs its requests to the oracle. */
|
|
82
88
|
identity: () => any;
|
|
83
89
|
/** The identity the oracle signs callbacks with: the VRF program's PDA for this program. */
|
package/types/client/policy.d.ts
CHANGED
|
@@ -1,23 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
/** How long the oracle has to answer before a roll or a draw may be asked again, and a pending order refunded (seconds). */
|
|
2
|
+
export declare const STALE_SECONDS: bigint;
|
|
3
|
+
/** How long after a lottery's first ask the next ask cancels its round, and an asked order holding a payment or an NFT
|
|
4
|
+
* may be refunded (seconds). */
|
|
5
|
+
export declare const LOTTERY_TIMEOUT_SECONDS: bigint;
|
|
3
6
|
/**
|
|
4
|
-
* The earliest
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
+
* The earliest an order can be refunded, as `{ slot, at }` (the program wants a later slot than `slot` and a later
|
|
8
|
+
* second than `at`), or null when it never can be as it stands: a failed order from the next slot; a paid order the
|
|
9
|
+
* oracle never answered 10 minutes after it was asked (`STALE_SECONDS`); an asked roll holding a payment or an NFT 7 days
|
|
10
|
+
* after its first ask. A rolled order has an outcome to carry out, and is settled. A waiting roll, or an asked one holding
|
|
11
|
+
* nothing, is asked (again): `rollAskable`.
|
|
7
12
|
*/
|
|
8
|
-
export declare function
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
export declare function orderRefundAt(order: any): {
|
|
14
|
+
slot: bigint;
|
|
15
|
+
at: null;
|
|
16
|
+
} | {
|
|
17
|
+
slot: bigint;
|
|
18
|
+
at: bigint;
|
|
19
|
+
} | {
|
|
20
|
+
slot: null;
|
|
21
|
+
at: bigint;
|
|
22
|
+
} | null;
|
|
23
|
+
/** Whether an order can be refunded at `slot` and `now` (Unix seconds, the chain's clock): `orderRefundAt`. */
|
|
24
|
+
export declare function orderRefundable(order: any, slot: any, now: any): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether its player or the project's keys may ask the oracle for a mission's or a recipe's roll at `slot` and `now`
|
|
27
|
+
* (Unix seconds, the chain's clock): never asked, or never answered within `STALE_SECONDS`. Once asked, a later ask comes
|
|
28
|
+
* in a later slot than the last (`SameSlot`: never the same seed twice), so a roll that found nothing in stock and waits
|
|
29
|
+
* again is asked from the next slot on.
|
|
30
|
+
*/
|
|
31
|
+
export declare const rollAskable: (order: any, slot: any, now: any) => boolean;
|
|
11
32
|
/**
|
|
12
33
|
* Whether a contest is off at `now` (Unix seconds), as the program reads its verdict: called off, its result
|
|
13
34
|
* overdue, or short of its least pot once entries closed. Every entry of one that is off takes its money back.
|
|
14
35
|
*/
|
|
15
36
|
export declare function contestOff(contest: any, now: any): boolean;
|
|
16
|
-
/** Whether a lottery's draw was asked for and the oracle has not answered within
|
|
17
|
-
|
|
37
|
+
/** Whether a lottery round's draw (`round`: its decoded record) was asked for and the oracle has not answered within
|
|
38
|
+
* `STALE_SECONDS` by `now` (Unix seconds, the chain's clock): anyone may ask again. */
|
|
39
|
+
export declare const lotteryDrawStuck: (round: any, now: any) => boolean;
|
|
18
40
|
/**
|
|
19
|
-
* Whether a lottery's draw was asked for and the oracle has not answered within
|
|
20
|
-
* ask (asking again doesn't move it)
|
|
21
|
-
*
|
|
41
|
+
* Whether a lottery round's draw (`round`: its decoded record) was asked for and the oracle has not answered within
|
|
42
|
+
* `LOTTERY_TIMEOUT_SECONDS` of the first ask (asking again doesn't move it) by `now` (Unix seconds, the chain's clock):
|
|
43
|
+
* the next ask of that round (`drawLotteryIx` with its address) cancels it, and every entry is refunded. A round nobody
|
|
44
|
+
* asked to draw is never cancelled.
|
|
22
45
|
*/
|
|
23
|
-
export declare const lotteryCancellable: (
|
|
46
|
+
export declare const lotteryCancellable: (round: any, now: any) => boolean;
|
|
47
|
+
/** A farm seat's `earns_until` when nothing ends its earning (i64::MAX): no tier term and no fuel it reads. */
|
|
48
|
+
export declare const NO_END: bigint;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** What a path's first word names (`random::tag`): an entry of a box, a stash's NFT, a lottery's ticket, a fresh trait. */
|
|
2
|
+
export declare const TAG: Readonly<{
|
|
3
|
+
ENTRY: 1;
|
|
4
|
+
STASH: 2;
|
|
5
|
+
LOTTERY: 3;
|
|
6
|
+
TRAIT: 4;
|
|
7
|
+
}>;
|
|
8
|
+
/** The most words a path holds. */
|
|
9
|
+
export declare const MAX_PATH = 8;
|
|
10
|
+
/** A stream of the oracle's 32-byte `answer` at `path` (whole numbers): seed = sha256("loot-roll-v1" | answer | path as
|
|
11
|
+
* u32 little-endian words); its nth number the first 8 bytes, little-endian, of sha256(seed | n as u64 little-endian). */
|
|
12
|
+
export declare function stream(answer: any, path?: any[]): {
|
|
13
|
+
next(): bigint;
|
|
14
|
+
};
|
|
15
|
+
/** A number from 0 to `n` - 1, every one as likely: a draw past the last whole multiple of `n` is drawn again. null for
|
|
16
|
+
* `n` 0. */
|
|
17
|
+
export declare function uniform(s: any, n: any): number | null;
|
|
18
|
+
/** The row `at` lands on, the weights walked in order. null past the last. */
|
|
19
|
+
export declare function walk(weights: any, at: any): any;
|
|
20
|
+
/** A row by weight (a weight of 0 never drawn); null when none weighs anything, or they sum past 64 bits. */
|
|
21
|
+
export declare function weighted(s: any, weights: any): any;
|
|
22
|
+
/** A number from `min` to `max`, both included, every one as likely (either order). */
|
|
23
|
+
export declare function range(s: any, min: any, max: any): any;
|
|
24
|
+
/** A fresh unit's range trait `t` (its place among the item's traits) as the program draws it at the mint: from the
|
|
25
|
+
* order's `answer`, `at` the unit's place in the order's `won`. */
|
|
26
|
+
export declare const rangeTrait: (answer: any, at: any, t: any, min: any, max: any) => any;
|
package/types/client/sizes.d.ts
CHANGED
|
@@ -2,12 +2,100 @@
|
|
|
2
2
|
export declare function allocationBytes(name: any): any;
|
|
3
3
|
/** The exact bytes of a dynamically allocated account. */
|
|
4
4
|
export declare const accountBytes: (name: any, value: any) => number;
|
|
5
|
+
/** A seat; a loan's hold (with room for its debt); a hold a player asks for, made without one (`Hold::PLAIN`). */
|
|
5
6
|
export declare const ACCOUNT_BYTES: Readonly<{
|
|
6
|
-
|
|
7
|
+
Seat: any;
|
|
8
|
+
Loan: any;
|
|
9
|
+
Hold: number;
|
|
7
10
|
}>;
|
|
8
11
|
/** A project's bytes with `collections` collections, as the program sizes the account. */
|
|
9
12
|
export declare const projectBytes: (collections?: number) => number;
|
|
10
|
-
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
/** The most accounts the oracle's answer to a roll carries (`MAX_CALLBACK_ACCOUNTS`). */
|
|
14
|
+
export declare const MAX_CALLBACK_ACCOUNTS = 21;
|
|
15
|
+
/**
|
|
16
|
+
* The most accounts a roll of `entries` hands the oracle (`catalog::callback_accounts`): the order, the box and the
|
|
17
|
+
* ticket; one for each prize that needs one at the roll (an item, a pool, a stash); and with tokens, the two token
|
|
18
|
+
* programs, the project, and a mint and a vault for each source of tokens.
|
|
19
|
+
*/
|
|
20
|
+
export declare function callbackAccounts(entries: any): number;
|
|
21
|
+
/**
|
|
22
|
+
* How many fresh items' table accounts the oracle's answer to a roll of `entries` can carry (`order::table_budget`):
|
|
23
|
+
* what the box's own accounts leave of `MAX_CALLBACK_ACCOUNTS`. Negative: the box can't be rolled at all.
|
|
24
|
+
*/
|
|
25
|
+
export declare const tableBudget: (entries: any) => number;
|
|
26
|
+
/** The most an order can be (`MAX_ORDER_BYTES`, not in the IDL): a box whose one open's order would be more is refused
|
|
27
|
+
* at its upsert (`BadEntries`). In practice a pack is bounded first by what one oracle answer draws (`drawsFit`). */
|
|
28
|
+
export declare const MAX_ORDER_BYTES = 10240;
|
|
29
|
+
/**
|
|
30
|
+
* The rows of fresh items' tables a draw of each entry writes into its order (`order::rows_of`), walked with the box's
|
|
31
|
+
* table budget as the roll's accounts are (`entryAccounts`: an item whose tables don't fit what is left draws none).
|
|
32
|
+
* `items` maps an item's id to its decoded Item; one left out is taken as not fresh.
|
|
33
|
+
*/
|
|
34
|
+
export declare function entryRows(entries: any, items?: {}): any;
|
|
35
|
+
/**
|
|
36
|
+
* The bytes of an order of `lootBox` with `shares` shares and `opens` opens. With `items` (an item's id to its decoded
|
|
37
|
+
* Item), as `open_box` sizes it (`Order::sized`): each draw at its dearest entry's prizes as the `Won` they become (an
|
|
38
|
+
* item 14 bytes, tokens or an NFT 41, a roll none) and 4 bytes for each table row its fresh items draw now
|
|
39
|
+
* (`entryRows`); its odds and its largest fate. Without `items`, as a roll made inside another call sizes it (a craft,
|
|
40
|
+
* a grant's claim, a mission, a roll lot: `Order::space_for`): the box's whole table budget a draw for a box that
|
|
41
|
+
* gives items. A pack's order grows with its cards.
|
|
42
|
+
*/
|
|
43
|
+
export declare function orderBytes(lootBox: any, shares: number | undefined, opens: number | undefined, items: any): number;
|
|
44
|
+
/**
|
|
45
|
+
* The heap reading a box takes beyond its entries (`order::box_bytes`): its odds, gate, shares, subject, slots and
|
|
46
|
+
* fates, read whole with it, by their bytes and their number. `box`: the box's args, as `upsertBoxIx` takes them.
|
|
47
|
+
*/
|
|
48
|
+
export declare function boxBytes({ odds, gate, shares, subject, slots, fates }: {
|
|
49
|
+
fates?: never[] | undefined;
|
|
50
|
+
gate?: null | undefined;
|
|
51
|
+
odds?: never[] | undefined;
|
|
52
|
+
shares?: never[] | undefined;
|
|
53
|
+
slots?: never[] | undefined;
|
|
54
|
+
subject?: null | undefined;
|
|
55
|
+
}): bigint;
|
|
56
|
+
/**
|
|
57
|
+
* Whether all of `opens` opens of `entries` by `slots` fit one oracle answer (`order::draws_fit`), each draw at the
|
|
58
|
+
* dearest its slot could make, with what is known from the box alone (no table rows, a stash of one group), its `odds`,
|
|
59
|
+
* `shares` and `fates` counted, and `bytes` (`boxBytes`) of heap reading the box takes beyond its entries. `slots` may
|
|
60
|
+
* be a number: that many draws among every entry. The answer's heap counts for a box that rolls, or one sold through
|
|
61
|
+
* the oracle (`oracle`: a box that doesn't roll but one `buy` can't carry, `buyFits`). The program refuses a box whose
|
|
62
|
+
* one open doesn't fit at its upsert, and a purchase that doesn't at `open_box`, where it also reads what the accounts
|
|
63
|
+
* hold (`PackTooLarge`).
|
|
64
|
+
*/
|
|
65
|
+
export declare function drawsFit(entries: any, slots: any, opens?: number, { odds, shares, fates, bytes, oracle }?: {
|
|
66
|
+
bytes?: bigint | undefined;
|
|
67
|
+
fates?: number | undefined;
|
|
68
|
+
odds?: number | undefined;
|
|
69
|
+
oracle?: boolean | undefined;
|
|
70
|
+
shares?: number | undefined;
|
|
71
|
+
}): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Whether one `buy` of a box that doesn't roll (one entry, given `draws` times: its slots' counts) fits one transaction
|
|
74
|
+
* (`catalog::buy_fits`): its accounts, its instructions and its compute, each prize's at the most it takes. A named NFT
|
|
75
|
+
* is given once at most. A box that doesn't fit sells through the oracle (`open_box`), its answer's heap counted
|
|
76
|
+
* (`drawsFit` with `oracle`), and can't give a roll (`PackTooLarge`). `box`: the box's args.
|
|
77
|
+
*/
|
|
78
|
+
export declare function buyFits(box: any, draws?: any): boolean;
|
|
79
|
+
/** The most program rent and fee one order takes from its player, in lamports (0.01 SOL): a client cap (`opensAnOrder`). */
|
|
80
|
+
export declare const ORDER_COST_CAP = 10000000n;
|
|
81
|
+
/**
|
|
82
|
+
* The most opens of `lootBox` a client puts in one order: what one oracle answer draws (`drawsFit`), and what keeps the
|
|
83
|
+
* order's rent and the player's fee within `ORDER_COST_CAP` (`orderBytes` with `items`, so with the box's shares). At
|
|
84
|
+
* least one: a box whose one open is over the cap is still bought one open an order. A purchase of more is several
|
|
85
|
+
* orders, each its own answer.
|
|
86
|
+
*/
|
|
87
|
+
export declare function opensAnOrder(lootBox: any, { shares, items, rentPerByte }?: {
|
|
88
|
+
items?: {} | undefined;
|
|
89
|
+
rentPerByte?: bigint | undefined;
|
|
90
|
+
shares?: any;
|
|
91
|
+
}): number;
|
|
92
|
+
export declare const LIST_HEAD_BYTES = 7;
|
|
93
|
+
/** A limit record (a wallet's count of a box, a recipe or a lottery round; a grant's claim count): key, count, window, in it. */
|
|
94
|
+
export declare const LIMIT_RECORD_BYTES = 28;
|
|
95
|
+
/** A round a grant paid a wallet: its key alone. */
|
|
96
|
+
export declare const ROUND_RECORD_BYTES = 16;
|
|
97
|
+
/** A contest's entry: of tokens, and of NFTs (the NFT, its place on its side, the picks taken). */
|
|
98
|
+
export declare const CONTEST_ENTRY_BYTES: Readonly<{
|
|
99
|
+
tokens: 43;
|
|
100
|
+
nfts: 83;
|
|
101
|
+
}>;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The accounts a route the player pays or asks for (a craft, a buy, a grant's claim) passes after a roll's box and
|
|
3
|
-
* order (`order::askable`, the client's `rollMints`): for each token prize of box `key`, in order, its pool and the
|
|
4
|
-
* pool's mint, or the mint it mints from. Up to 10 distinct accounts a box.
|
|
5
|
-
*/
|
|
6
|
-
export declare function rollMintKeys(key: any, m: any): any;
|
|
7
1
|
/**
|
|
8
2
|
* The transaction a player sends to craft `recipe`, estimated (txsize.mjs): the craft's own accounts, then each
|
|
9
|
-
* line's (craft.rs; a roll's
|
|
3
|
+
* line's (craft.rs; a roll's box and order), a compute limit (a big recipe needs more
|
|
10
4
|
* than the default) and, for each token it gives, the player's token account created if missing.
|
|
11
5
|
*/
|
|
12
6
|
export declare function craftSize(recipe: any, m: any, { detail }?: {
|
|
@@ -77,10 +71,11 @@ export declare function settleSize(b: any, o: any, m: any): {
|
|
|
77
71
|
/**
|
|
78
72
|
* The transaction a player sends to buy box `b` (buy.rs), estimated as `openBoxSize` is: its compute limit and price,
|
|
79
73
|
* the player's token account of the currency created if missing, then `buy`: its own accounts, what the gate takes
|
|
80
|
-
* (a list's proof, or the NFT shown), the accounts its shares name, and each prize's (prize.rs; a roll's
|
|
81
|
-
*
|
|
74
|
+
* (a list's proof, or the NFT shown), the accounts its shares name, and each prize's (prize.rs; a roll's box and
|
|
75
|
+
* order), for each draw of a sale (a fixed amount of tokens once). `count`: the sales in one purchase.
|
|
82
76
|
*/
|
|
83
|
-
export declare function buySize(b: any, m: any, { detail }?: {
|
|
77
|
+
export declare function buySize(b: any, m: any, { detail, count }?: {
|
|
78
|
+
count?: number | undefined;
|
|
84
79
|
detail?: boolean | undefined;
|
|
85
80
|
}): any;
|
|
86
81
|
/** The address a plan stands in for the owner's wallet before one connects (plan.mjs `placeholderContext`). Nobody
|
package/types/economy/cost.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ export declare function setupCost(plan: any, economy: any): {
|
|
|
13
13
|
/**
|
|
14
14
|
* What each action costs whoever signs it while the economy runs: games.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
|
-
* oracle's own
|
|
16
|
+
* oracle's own fee (`oracleSol`, model.mjs ORACLE_FEE).
|
|
17
17
|
*/
|
|
18
18
|
export declare function actionCosts(economy: any, { now }?: Readonly<Record<string, any>>): any[];
|
|
19
19
|
/** Setup and play costs for a spec, or its refusals. */
|
|
@@ -41,6 +41,7 @@ export declare function cost(economy: any, { now, only, live }?: {
|
|
|
41
41
|
built: any[];
|
|
42
42
|
instructions: any;
|
|
43
43
|
signers: any[];
|
|
44
|
+
alone: boolean;
|
|
44
45
|
}[];
|
|
45
46
|
approvals: number;
|
|
46
47
|
freshKeys: any[];
|
|
@@ -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;
|
package/types/economy/live.d.mts
CHANGED
|
@@ -7,13 +7,14 @@ export declare function freshAddresses(names: any, random?: typeof randomBytes):
|
|
|
7
7
|
* The transactions that put `economy` live for `owner`, with `keys` the addresses of the fresh accounts (each signs
|
|
8
8
|
* the transaction that creates it). `live`: what is already live (a change publishes only what differs).
|
|
9
9
|
*/
|
|
10
|
-
export declare function prepare(economy: any, { owner, keys, live, now, rent, only }: {
|
|
10
|
+
export declare function prepare(economy: any, { owner, keys, live, now, rent, only, slot }: {
|
|
11
11
|
keys: any;
|
|
12
12
|
live?: null | undefined;
|
|
13
13
|
now?: number | undefined;
|
|
14
14
|
only?: null | undefined;
|
|
15
15
|
owner: any;
|
|
16
16
|
rent: any;
|
|
17
|
+
slot?: null | undefined;
|
|
17
18
|
}): {
|
|
18
19
|
ok: boolean;
|
|
19
20
|
refusals: any[];
|
|
@@ -33,6 +34,7 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
33
34
|
built: any[];
|
|
34
35
|
instructions: any;
|
|
35
36
|
signers: any[];
|
|
37
|
+
alone: boolean;
|
|
36
38
|
}[];
|
|
37
39
|
approvals: number;
|
|
38
40
|
freshKeys: any[];
|
|
@@ -54,6 +56,7 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
54
56
|
mints: {};
|
|
55
57
|
keys: any;
|
|
56
58
|
rent: any;
|
|
59
|
+
slot: null;
|
|
57
60
|
};
|
|
58
61
|
} | {
|
|
59
62
|
refusals?: undefined;
|
|
@@ -66,6 +69,7 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
66
69
|
built: any[];
|
|
67
70
|
instructions: any;
|
|
68
71
|
signers: any[];
|
|
72
|
+
alone: boolean;
|
|
69
73
|
}[];
|
|
70
74
|
approvals: number;
|
|
71
75
|
freshKeys: any[];
|
|
@@ -79,8 +83,19 @@ export declare function prepare(economy: any, { owner, keys, live, now, rent, on
|
|
|
79
83
|
mints: {};
|
|
80
84
|
keys: any;
|
|
81
85
|
rent: any;
|
|
86
|
+
slot: null;
|
|
82
87
|
};
|
|
83
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* The parts of an economy whose widest transaction passes a legacy transaction, so a player sends it in one approval
|
|
91
|
+
* only with the project's standing lookup table: a box's open or settle and a craft the checker sizes past one
|
|
92
|
+
* (W-TX-V0, W-SETTLE-V0), an auction whose bids are NFTs (each moves with its own accounts), and a farm of another
|
|
93
|
+
* collection's NFTs (a pNFT's stake and exit carry its token record and rule set). [{ where, why }]
|
|
94
|
+
*/
|
|
95
|
+
export declare function wideParts(m: any, warnings?: any[]): {
|
|
96
|
+
where: any;
|
|
97
|
+
why: string;
|
|
98
|
+
}[];
|
|
84
99
|
/**
|
|
85
100
|
* The spec once its setup landed: every part keeps the program number it was given, and `live` names the game, its
|
|
86
101
|
* collection, the treasury, the mints made and the program, with a copy of what is now on chain.
|