@xgamesfun/solana 0.0.0-stage → 0.20.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 +41 -0
- package/LICENSE +202 -0
- package/NOTICE +13 -0
- package/README.md +172 -2
- package/bin/xsolana.mjs +189 -0
- package/examples/artwork-auction.json +51 -0
- package/examples/blind-forge.json +128 -0
- package/examples/coin-flip-arena.json +108 -0
- package/examples/duel-arena.json +137 -0
- package/examples/elements-set.json +281 -0
- package/examples/event-badges.json +67 -0
- package/examples/expedition-guild.json +161 -0
- package/examples/fair-presale.json +48 -0
- package/examples/falling-drop.json +90 -0
- package/examples/guild-missions.json +144 -0
- package/examples/halving-seasons.json +112 -0
- package/examples/hero-trials.json +96 -0
- package/examples/ideas.json +789 -0
- package/examples/level-ladder.json +65 -0
- package/examples/merge-2048.json +128 -0
- package/examples/nft-raffle.json +33 -0
- package/examples/paper-hands-farm.json +56 -0
- package/examples/partner-vault.json +115 -0
- package/examples/sacrifice-raffle.json +118 -0
- package/examples/scorched-treasury.json +84 -0
- package/examples/shelter-fair.json +164 -0
- package/examples/spark-pity.json +153 -0
- package/examples/stakers-draw.json +125 -0
- package/examples/star-fleet.json +157 -0
- package/examples/starforce.json +116 -0
- package/examples/stud-farm.json +134 -0
- package/examples/team-vesting.json +70 -0
- package/examples/trade-in-shop.json +168 -0
- package/js/approve/details.mjs +262 -0
- package/js/approve/ed25519.mjs +36 -0
- package/js/approve/live-check.mjs +144 -0
- package/js/approve/page.html +86 -0
- package/js/approve/page.js +203 -0
- package/js/approve/server.mjs +711 -0
- package/js/chain/base58.js +73 -0
- package/js/chain/borsh.js +261 -0
- package/js/chain/bytes.js +141 -0
- package/js/chain/core.js +169 -0
- package/js/chain/curve.js +52 -0
- package/js/chain/lookup.js +273 -0
- package/js/chain/mint.js +96 -0
- package/js/chain/pda.js +66 -0
- package/js/chain/programs.js +102 -0
- package/js/chain/rpc.js +217 -0
- package/js/chain/sha256.js +68 -0
- package/js/chain/token.js +85 -0
- package/js/chain/token2022.js +247 -0
- package/js/chain/tx.js +224 -0
- package/js/client/accounts.js +347 -0
- package/js/client/compressed.js +46 -0
- package/js/client/grant.js +240 -0
- package/js/client/idl/loot.js +2 -0
- package/js/client/idl/loot.json +17064 -0
- package/js/client/index.js +9 -0
- package/js/client/ix.js +2156 -0
- package/js/client/pda.js +110 -0
- package/js/client/policy.js +48 -0
- package/js/client/sizes.js +54 -0
- package/js/client/traits.js +44 -0
- package/js/connect/connect.mjs +182 -0
- package/js/economy/check.mjs +1991 -0
- package/js/economy/cost.mjs +170 -0
- package/js/economy/examples.mjs +114 -0
- package/js/economy/explain.mjs +235 -0
- package/js/economy/guide.mjs +231 -0
- package/js/economy/legal.mjs +15 -0
- package/js/economy/live.mjs +107 -0
- package/js/economy/model.mjs +583 -0
- package/js/economy/plan.mjs +887 -0
- package/js/economy/schema.json +2923 -0
- package/js/economy/secrets.mjs +60 -0
- package/js/economy/simulate.mjs +952 -0
- package/js/economy/txsize.mjs +45 -0
- package/js/economy/validate.mjs +85 -0
- package/js/index.js +10 -0
- package/js/mcp/server.mjs +113 -0
- package/js/mcp/tools.mjs +479 -0
- package/js/play/index.js +2109 -0
- package/js/results/index.js +184 -0
- package/js/results/wire.js +90 -0
- package/package.json +100 -4
- package/release.json +8 -0
- package/skills/xsolana-economy/SKILL.md +105 -0
- package/skills/xsolana-economy/references/after-launch.md +114 -0
- package/skills/xsolana-economy/references/apps.md +157 -0
- package/skills/xsolana-economy/references/sentence-to-spec.md +172 -0
- package/skills/xsolana-economy/references/telling-the-person.md +93 -0
- package/types/chain/base58.d.ts +10 -0
- package/types/chain/borsh.d.ts +23 -0
- package/types/chain/bytes.d.ts +45 -0
- package/types/chain/core.d.ts +50 -0
- package/types/chain/curve.d.ts +1 -0
- package/types/chain/lookup.d.ts +191 -0
- package/types/chain/mint.d.ts +25 -0
- package/types/chain/pda.d.ts +25 -0
- package/types/chain/programs.d.ts +65 -0
- package/types/chain/rpc.d.ts +66 -0
- package/types/chain/sha256.d.ts +1 -0
- package/types/chain/token.d.ts +141 -0
- package/types/chain/token2022.d.ts +53 -0
- package/types/chain/tx.d.ts +60 -0
- package/types/client/accounts.d.ts +178 -0
- package/types/client/compressed.d.ts +29 -0
- package/types/client/grant.d.ts +125 -0
- package/types/client/idl/loot.d.ts +4467 -0
- package/types/client/index.d.ts +8 -0
- package/types/client/ix.d.ts +1687 -0
- package/types/client/pda.d.ts +91 -0
- package/types/client/policy.d.ts +23 -0
- package/types/client/sizes.d.ts +13 -0
- package/types/client/traits.d.ts +12 -0
- package/types/economy/check.d.mts +105 -0
- package/types/economy/cost.d.mts +68 -0
- package/types/economy/examples.d.mts +27 -0
- package/types/economy/explain.d.mts +19 -0
- package/types/economy/guide.d.mts +140 -0
- package/types/economy/legal.d.mts +12 -0
- package/types/economy/live.d.mts +109 -0
- package/types/economy/model.d.mts +363 -0
- package/types/economy/plan.d.mts +1013 -0
- package/types/economy/secrets.d.mts +4 -0
- package/types/economy/simulate.d.mts +156 -0
- package/types/economy/txsize.d.mts +17 -0
- package/types/economy/validate.d.mts +3 -0
- package/types/index.d.ts +9 -0
- package/types/mcp/tools.d.mts +627 -0
- package/types/play/index.d.ts +469 -0
- package/types/results/index.d.ts +155 -0
- package/types/results/wire.d.ts +122 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { MPL_CORE_PROGRAM } from '../chain/pda.js';
|
|
2
|
+
export declare const LOOT_PROGRAM: string;
|
|
3
|
+
/** MagicBlock's VRF program and its default queue, the only queue the program accepts. */
|
|
4
|
+
export declare const VRF_PROGRAM = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
|
|
5
|
+
export declare const VRF_QUEUE = "Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh";
|
|
6
|
+
export { MPL_CORE_PROGRAM };
|
|
7
|
+
export declare const BPF_LOADER_UPGRADEABLE = "BPFLoaderUpgradeab1e11111111111111111111111";
|
|
8
|
+
/** Compressed NFTs: Bubblegum, and the account compression program and noop of its v2 trees. */
|
|
9
|
+
export declare const BUBBLEGUM_PROGRAM = "BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY";
|
|
10
|
+
export declare const COMPRESSION_PROGRAM = "mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW";
|
|
11
|
+
export declare const NOOP_PROGRAM = "mnoopTCrg4p8ry25e4bcWA9XZjbNjMTfgYVGGEdRsf3";
|
|
12
|
+
/** The PDA of these seeds under the loot program, with its bump. */
|
|
13
|
+
export declare const lootAddress: (seeds: any, program?: string) => any;
|
|
14
|
+
declare const keyReceipt: (grant: any, incarnation: any, voucherKey: any) => any;
|
|
15
|
+
export declare const pda: {
|
|
16
|
+
platform: () => any;
|
|
17
|
+
/** A project: any wallet (its creator) opens as many as it likes, each with a number of its own (`id`, a u64). A
|
|
18
|
+
* new owner keeps the address. */
|
|
19
|
+
project: (creator: any, id?: number) => any;
|
|
20
|
+
/** The project's fee box: where the platform's fees on its transactions wait. */
|
|
21
|
+
fees: (project: any) => any;
|
|
22
|
+
pool: (project: any, index: any) => any;
|
|
23
|
+
item: (project: any, id: any) => any;
|
|
24
|
+
box: (project: any, id: any) => any;
|
|
25
|
+
/** NFTs the project holds to give away as prizes: a box entry of a stash gives one of them at random. */
|
|
26
|
+
stash: (project: any, id: any) => any;
|
|
27
|
+
schedule: (project: any, id: any) => any;
|
|
28
|
+
lottery: (project: any, id: any) => any;
|
|
29
|
+
recipe: (project: any, id: any) => any;
|
|
30
|
+
contest: (project: any, id: any) => any;
|
|
31
|
+
/** An auction: an id is its seller's own. Its bids wait in the project's vault for its mint (`vault`). */
|
|
32
|
+
auction: (project: any, seller: any, id: any) => any;
|
|
33
|
+
farm: (project: any, id: any) => any;
|
|
34
|
+
grant: (project: any, id: any) => any;
|
|
35
|
+
order: (project: any, player: any, nonce: any) => any;
|
|
36
|
+
/** Every collectible the program mints of its own accord (an order's, a prize's, an auction's lot): its address
|
|
37
|
+
* names its item and its serial, minted once at most. */
|
|
38
|
+
itemAsset: (item: any, serial: any) => any;
|
|
39
|
+
/** A contest's pot, or a lottery's: `["pot", contest or lottery]`. */
|
|
40
|
+
pot: (record: any) => any;
|
|
41
|
+
lotteryFunds: (lottery: any) => any;
|
|
42
|
+
lotteryReceipt: (lottery: any, incarnation: any, wallet: any) => any;
|
|
43
|
+
/** One purchase of a lottery's tickets, at a nonce of its buyer's. */
|
|
44
|
+
contribution: (lottery: any, player: any, nonce: any) => any;
|
|
45
|
+
/** A wallet's entry in a contest: one, on one side (another side is `OtherSide`). */
|
|
46
|
+
entry: (contest: any, player: any) => any;
|
|
47
|
+
/** A hold names its NFT and its end (Unix seconds): a release sent late never finds a later hold of the NFT. */
|
|
48
|
+
hold: (asset: any, freeAt: any) => any;
|
|
49
|
+
/** An offer: an id is its maker's own. Its money waits in the project's vault for its mint (`vault`). */
|
|
50
|
+
offer: (project: any, maker: any, id: any) => any;
|
|
51
|
+
/** A lottery's own stash: the NFTs its places promise (`Prize::Held`), which leave only as its prizes. */
|
|
52
|
+
lotteryStash: (lottery: any) => any;
|
|
53
|
+
/** A contest's prize split by stake, set aside when it is decided: `["prize", contest]`. */
|
|
54
|
+
prizeVault: (contest: any) => any;
|
|
55
|
+
/** A sealed schedule's own vault, which only its runs pay out of: `["vest", schedule]`. */
|
|
56
|
+
vest: (schedule: any) => any;
|
|
57
|
+
/** A listing of an NFT for sale or for rent: one per NFT a project holds, so its address names the NFT. */
|
|
58
|
+
listing: (project: any, asset: any) => any;
|
|
59
|
+
staked: (farm: any) => any;
|
|
60
|
+
rewards: (farm: any) => any;
|
|
61
|
+
/** A seat: a player's in a farm of tokens, a collectible's (its asset) in a farm of collectibles. */
|
|
62
|
+
seat: (farm: any, by: any) => any;
|
|
63
|
+
/** 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. */
|
|
64
|
+
sheet: (project: any, nft: any) => any;
|
|
65
|
+
/** A compressed NFT as last proven (`prove_leaf`), read while the leaf is unchanged and its root is still in the tree's change log. */
|
|
66
|
+
leaf: (asset: any) => any;
|
|
67
|
+
/** The root of the traits the project vouches for, under its own `key` (a collection's address, by convention). */
|
|
68
|
+
traits: (project: any, key_: any) => any;
|
|
69
|
+
/** Bubblegum's config of a tree: `[tree]`. */
|
|
70
|
+
treeConfig: (tree: any) => any;
|
|
71
|
+
/** A compressed NFT's asset id: Bubblegum's `["asset", tree, nonce]`, `nonce` the count minted before it. */
|
|
72
|
+
compressedAsset: (tree: any, nonce: any) => any;
|
|
73
|
+
/** A wallet's counter on a box or recipe. Grants and lotteries also name their incarnation. */
|
|
74
|
+
receipt: (record: any, wallet: any) => any;
|
|
75
|
+
grantReceipt: (grant: any, incarnation: any, wallet: any) => any;
|
|
76
|
+
person: (grant: any, incarnation: any, personHash: any) => any;
|
|
77
|
+
/** How many times an NFT shown claimed an open grant its gate asks for one of: an address of its own, never a person's. */
|
|
78
|
+
badge: (grant: any, incarnation: any, nft: any) => any;
|
|
79
|
+
/** A voucher key's counter on a grant (a promo code's). */
|
|
80
|
+
code: typeof keyReceipt;
|
|
81
|
+
/** The program's identity, which signs its requests to the oracle. */
|
|
82
|
+
identity: () => any;
|
|
83
|
+
/** The identity the oracle signs callbacks with: the VRF program's PDA for this program. */
|
|
84
|
+
oracleIdentity: () => any;
|
|
85
|
+
/** The program's ProgramData account (its upgrade authority signs `init_platform`). */
|
|
86
|
+
programData: () => any;
|
|
87
|
+
};
|
|
88
|
+
/** `owner`'s associated token account of `mint` (owner may be a PDA: a project's vault, a pool is not one). */
|
|
89
|
+
export declare const ata: (owner: any, mint: any, tokenProgram?: string) => any;
|
|
90
|
+
/** A project's vault for `mint`: its associated token account, where every open order's payment is held. */
|
|
91
|
+
export declare const vault: (project: any, mint: any, tokenProgram?: string) => any;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const STALE_SLOTS: bigint;
|
|
2
|
+
export declare const LOTTERY_TIMEOUT_SLOTS: bigint;
|
|
3
|
+
/**
|
|
4
|
+
* The earliest slot an order can be refunded in, or null when it never can be: a rolled order has an outcome anyone
|
|
5
|
+
* can carry out, and is settled, never refunded; a roll a mission or a recipe made waits for anyone to ask for it
|
|
6
|
+
* (`Waiting`), and once asked (`Asked`) is asked again if the oracle never answers (`rollAskable`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function orderRefundSlot(order: any): bigint | null;
|
|
9
|
+
/** Whether anyone may ask the oracle for a mission's or a recipe's roll at `slot`: never asked, or never answered. */
|
|
10
|
+
export declare const rollAskable: (order: any, slot: any) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a contest is off at `now` (Unix seconds), as the program reads its verdict: called off, its result
|
|
13
|
+
* overdue, or short of its least pot once entries closed. Every entry of one that is off takes its money back.
|
|
14
|
+
*/
|
|
15
|
+
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 `STALE_SLOTS`: anyone may ask again. */
|
|
17
|
+
export declare const lotteryDrawStuck: (lottery: any, slot: any) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a lottery's draw was asked for and the oracle has not answered within `LOTTERY_TIMEOUT_SLOTS` of the first
|
|
20
|
+
* ask (asking again doesn't move it): anyone may cancel the round and refund it. A round nobody asked to draw is never
|
|
21
|
+
* cancelled.
|
|
22
|
+
*/
|
|
23
|
+
export declare const lotteryCancellable: (lottery: any, slot: any) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** The space reserved by a fixed-size account, including its discriminator. */
|
|
2
|
+
export declare function allocationBytes(name: any): any;
|
|
3
|
+
/** The exact bytes of a dynamically allocated account. */
|
|
4
|
+
export declare const accountBytes: (name: any, value: any) => number;
|
|
5
|
+
export declare const ACCOUNT_BYTES: Readonly<{
|
|
6
|
+
[k: string]: any;
|
|
7
|
+
}>;
|
|
8
|
+
/** A project's bytes with `collections` collections, as the program sizes the account. */
|
|
9
|
+
export declare const projectBytes: (collections?: number) => number;
|
|
10
|
+
export declare const MAX_RECEIPT_ROUNDS: number;
|
|
11
|
+
export declare const RECEIPT_BASE_BYTES = 17;
|
|
12
|
+
export declare const RECEIPT_ROUND_BYTES = 8;
|
|
13
|
+
export declare function receiptBytes(rounds?: number): number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** A leaf: an NFT's address and its traits ([{ key, value }], in order). */
|
|
2
|
+
export declare const traitsLeaf: (nft: any, attributes: any) => Uint8Array<ArrayBuffer>;
|
|
3
|
+
/** Two nodes joined, the smaller first, so a proof needs no left or right. */
|
|
4
|
+
export declare const traitsNode: (a: any, b: any) => Uint8Array<ArrayBuffer>;
|
|
5
|
+
/**
|
|
6
|
+
* The tree of `entries` ([{ nft, attributes }]): { root, proof(nft) → [node, …] bottom up }. A node left without a pair
|
|
7
|
+
* at a level goes up as it is.
|
|
8
|
+
*/
|
|
9
|
+
export declare function traitsTree(entries: any): {
|
|
10
|
+
root: any;
|
|
11
|
+
proof(nft: any): any[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* 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 with its box's prize mints, `rollMintKeys`), a compute limit (a big recipe needs more
|
|
10
|
+
* than the default) and, for each token it gives, the player's token account created if missing.
|
|
11
|
+
*/
|
|
12
|
+
export declare function craftSize(recipe: any, m: any, { detail }?: {
|
|
13
|
+
detail?: boolean | undefined;
|
|
14
|
+
}): any;
|
|
15
|
+
/**
|
|
16
|
+
* The transaction a player sends to open box `b`, estimated (txsize.mjs) as a wallet sends it: its compute limit and
|
|
17
|
+
* price, the player's token account of the box's currency created if missing (and for SOL, the wrap around the
|
|
18
|
+
* purchase), then `open_box` (order.rs): its own accounts (an NFT slot the program leaves empty stands in as the
|
|
19
|
+
* program's address), an account for each outcome that wins something, each prize mint with the game's vault for it,
|
|
20
|
+
* and the NFT the player shows for a gate or odds (at its largest, a Token Metadata one's mint, metadata, token
|
|
21
|
+
* account and Sheet).
|
|
22
|
+
*/
|
|
23
|
+
export declare function openBoxSize(b: any, m: any, { detail }?: {
|
|
24
|
+
detail?: boolean | undefined;
|
|
25
|
+
}): any;
|
|
26
|
+
/** The longest proof a compressed NFT's tree can leave: Bubblegum v2 refuses a smaller canopy. */
|
|
27
|
+
export declare const LONGEST_PROOF = 17;
|
|
28
|
+
/** How many accounts a transaction may lock: so the most a settle can name. */
|
|
29
|
+
export declare const ACCOUNT_LOCKS = 64;
|
|
30
|
+
/** A v0 transaction's lookup table and the lookup-table program: the transaction deactivates the table it loads from. */
|
|
31
|
+
export declare const TABLE_LOCKS = 2;
|
|
32
|
+
/**
|
|
33
|
+
* The accounts a settle of box `b` locks for outcome `o`, counted as the client builds it (`settleIx`, sent by anyone
|
|
34
|
+
* after a Compute Budget instruction, in a v0 transaction with a lookup table, the Sheets of NFTs it doesn't write left
|
|
35
|
+
* out), at its largest: { count, memo, picks, corePicks, payees, compressedSubject }. `memo`: a payee the project
|
|
36
|
+
* didn't pick (a holder's share, a buyer's chosen wallet, a wallet's) can turn on required memos for their own
|
|
37
|
+
* Token-2022 account at any time, and every settle then passes the memo program, one account more.
|
|
38
|
+
* Matches the program's own measurements: a roll on a compressed NFT of a 17-node
|
|
39
|
+
* proof is 41 with nothing won; each prize of tokens in a mint of its own 3, each holder's share 3, a hook asking
|
|
40
|
+
* one account of its own 3, a compressed NFT picked from a stash 22, a Core one of its own collection 2 (Core 1).
|
|
41
|
+
*/
|
|
42
|
+
export declare function settleAccounts(b: any, o: any, m: any, { proof }?: {
|
|
43
|
+
proof?: number | undefined;
|
|
44
|
+
}): {
|
|
45
|
+
count: number;
|
|
46
|
+
keys: string[];
|
|
47
|
+
memo: boolean;
|
|
48
|
+
picks: number;
|
|
49
|
+
corePicks: number;
|
|
50
|
+
payees: number;
|
|
51
|
+
compressedSubject: boolean;
|
|
52
|
+
};
|
|
53
|
+
/** The compute a transaction may have: no settle can take more. */
|
|
54
|
+
export declare const MAX_COMPUTE_UNITS = 1400000;
|
|
55
|
+
/**
|
|
56
|
+
* The compute a settle of box `b`'s outcome `o` takes, estimated at its most from measurements on devnet's
|
|
57
|
+
* features: about 60,000 units for the settle itself, 250,000 for each Token Metadata
|
|
58
|
+
* NFT it moves (a pNFT's, with its rule set), 100,000 for a compressed one (or the NFT it rolls on, of a collection
|
|
59
|
+
* not the game's own), 60,000 for a Core one, 40,000 for each collectible it mints and 20,000 for a roll it makes, and
|
|
60
|
+
* 30,000 for each token payout (a prize, each share of the price, the treasury's), twice that in a coin with a
|
|
61
|
+
* transfer hook. Three pNFTs of stashes, the NFT rolled on and four holders' shares (measured 942,389 to 985,942)
|
|
62
|
+
* come out at about 1,170,000.
|
|
63
|
+
*/
|
|
64
|
+
export declare function settleUnits(b: any, o: any, m: any): number;
|
|
65
|
+
/**
|
|
66
|
+
* The settle of box `b`'s outcome `o` as xsolana's senders build it (js/play, the keeper's sweep: `settleIx` after a
|
|
67
|
+
* compute limit, and a heap frame for three NFT moves or more), estimated (txsize.mjs) at its largest:
|
|
68
|
+
* { legacy: its bytes as a legacy transaction, tableRent: the lamports a lookup table of its accounts holds while it
|
|
69
|
+
* is open, locks: the accounts it locks (`settleAccounts`) }. A settle bigger than a legacy transaction goes as v0,
|
|
70
|
+
* its accounts loaded from a table its sender makes first.
|
|
71
|
+
*/
|
|
72
|
+
export declare function settleSize(b: any, o: any, m: any): {
|
|
73
|
+
legacy: any;
|
|
74
|
+
tableRent: bigint;
|
|
75
|
+
locks: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* The transaction a player sends to buy box `b` (buy.rs), estimated as `openBoxSize` is: its compute limit and price,
|
|
79
|
+
* 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 with its
|
|
81
|
+
* box's prize mints, `rollMintKeys`).
|
|
82
|
+
*/
|
|
83
|
+
export declare function buySize(b: any, m: any, { detail }?: {
|
|
84
|
+
detail?: boolean | undefined;
|
|
85
|
+
}): any;
|
|
86
|
+
/** The address a plan stands in for the owner's wallet before one connects (plan.mjs `placeholderContext`). Nobody
|
|
87
|
+
* holds its key, and the approval page calls it "your wallet" until a wallet connects: no spec may name it. */
|
|
88
|
+
export declare const STAND_IN_OWNER: string;
|
|
89
|
+
/**
|
|
90
|
+
* Checks an economy spec. `now` (Unix seconds) dates "publish".
|
|
91
|
+
* Returns { ok, refusals: [{ code, where, message, fix }], warnings: [{ code, where, message, fix? }] }.
|
|
92
|
+
*/
|
|
93
|
+
export declare function check(economy: any, { network, now }?: {
|
|
94
|
+
network?: string | undefined;
|
|
95
|
+
now?: number | undefined;
|
|
96
|
+
}): {
|
|
97
|
+
ok: boolean;
|
|
98
|
+
refusals: any[];
|
|
99
|
+
warnings: any[];
|
|
100
|
+
};
|
|
101
|
+
/** A one-line summary for each refusal and warning, as a person reads them. */
|
|
102
|
+
export declare function describe({ refusals, warnings }: {
|
|
103
|
+
refusals: any;
|
|
104
|
+
warnings: any;
|
|
105
|
+
}): string;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** Setup cost from a plan (plan.mjs `plan`). */
|
|
2
|
+
export declare function setupCost(plan: any, economy: any): {
|
|
3
|
+
accounts: any;
|
|
4
|
+
rentSol: any;
|
|
5
|
+
programFeesSol: any;
|
|
6
|
+
networkFeesSol: any;
|
|
7
|
+
seeds: {};
|
|
8
|
+
totalSol: any;
|
|
9
|
+
transactions: any;
|
|
10
|
+
approvals: any;
|
|
11
|
+
notes: string[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* What each action costs whoever signs it while the economy runs: games.fun's fee, the network's, and for anything
|
|
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 0.0005 SOL (`oracleSol`, model.mjs ORACLE_FEE).
|
|
17
|
+
*/
|
|
18
|
+
export declare function actionCosts(economy: any, { now }?: Readonly<Record<string, any>>): any[];
|
|
19
|
+
/** Setup and play costs for a spec, or its refusals. */
|
|
20
|
+
/** `only` and `live`: a change to a live economy, priced as only what it publishes (live.mjs `changedParts`). */
|
|
21
|
+
export declare function cost(economy: any, { now, only, live }?: {
|
|
22
|
+
live?: null | undefined;
|
|
23
|
+
now?: number | undefined;
|
|
24
|
+
only?: null | undefined;
|
|
25
|
+
}): {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
refusals: any[];
|
|
28
|
+
warnings: any[];
|
|
29
|
+
steps?: undefined;
|
|
30
|
+
transactions?: undefined;
|
|
31
|
+
approvals?: undefined;
|
|
32
|
+
freshKeys?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
refusals?: undefined;
|
|
35
|
+
ok: boolean;
|
|
36
|
+
warnings: any[];
|
|
37
|
+
steps: any[];
|
|
38
|
+
transactions: {
|
|
39
|
+
signer: string;
|
|
40
|
+
steps: any[];
|
|
41
|
+
built: any[];
|
|
42
|
+
instructions: any;
|
|
43
|
+
signers: any[];
|
|
44
|
+
}[];
|
|
45
|
+
approvals: number;
|
|
46
|
+
freshKeys: any[];
|
|
47
|
+
} | {
|
|
48
|
+
ok: boolean;
|
|
49
|
+
setup: {
|
|
50
|
+
accounts: any;
|
|
51
|
+
rentSol: any;
|
|
52
|
+
programFeesSol: any;
|
|
53
|
+
networkFeesSol: any;
|
|
54
|
+
seeds: {};
|
|
55
|
+
totalSol: any;
|
|
56
|
+
transactions: any;
|
|
57
|
+
approvals: any;
|
|
58
|
+
notes: string[];
|
|
59
|
+
};
|
|
60
|
+
actions: any[];
|
|
61
|
+
fees: {
|
|
62
|
+
playerSol: any;
|
|
63
|
+
projectSol: any;
|
|
64
|
+
oracleSol: any;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/** The cost in plain words. */
|
|
68
|
+
export declare function explainCost(c: any): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Every worked example: { name, spec }. */
|
|
2
|
+
export declare function examples(): any;
|
|
3
|
+
/** One example's whole spec, by name. */
|
|
4
|
+
export declare function example(name: any): any;
|
|
5
|
+
export declare const ideas: () => any;
|
|
6
|
+
/** The parts a spec uses, and features it shows. */
|
|
7
|
+
export declare function partsUsed(spec: any): string[];
|
|
8
|
+
/**
|
|
9
|
+
* What loot can't do exactly that `query` asks for, with the nearest versions: the closest few. `atLeast`: only limits
|
|
10
|
+
* that match at least this well (search passes the best matching capability's score: when a capability matches the
|
|
11
|
+
* words better, its "how" is the answer and a weaker "can't" beside it only misleads; a tie shows both).
|
|
12
|
+
*/
|
|
13
|
+
export declare function limits(query: any, { limit, atLeast }?: {
|
|
14
|
+
atLeast?: number | undefined;
|
|
15
|
+
limit?: number | undefined;
|
|
16
|
+
}): any;
|
|
17
|
+
/** Asks that look impossible but are one field or a short combination, closest to `query`. */
|
|
18
|
+
export declare function hows(query: any, { limit }?: {
|
|
19
|
+
limit?: number | undefined;
|
|
20
|
+
}): any;
|
|
21
|
+
/** The examples, ideas, hows and limits closest to `query`. */
|
|
22
|
+
export declare function search(query: any, { limit, fit }?: Readonly<Record<string, any>>): {
|
|
23
|
+
examples: any;
|
|
24
|
+
ideas: any;
|
|
25
|
+
hows: any;
|
|
26
|
+
limits: any;
|
|
27
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function explainEconomy(economy: any, { now }?: {
|
|
2
|
+
now?: number | undefined;
|
|
3
|
+
}): {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
refusals: any[];
|
|
6
|
+
warnings: any[];
|
|
7
|
+
text: string;
|
|
8
|
+
needsAuthority?: undefined;
|
|
9
|
+
chance?: undefined;
|
|
10
|
+
setupSol?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
refusals?: undefined;
|
|
13
|
+
ok: boolean;
|
|
14
|
+
text: string;
|
|
15
|
+
warnings: any[];
|
|
16
|
+
needsAuthority: boolean;
|
|
17
|
+
chance: boolean;
|
|
18
|
+
setupSol: any;
|
|
19
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/** Each part: what it is for, who acts at play time and its fee, and the nested shapes worth showing. */
|
|
2
|
+
export declare const PARTS: {
|
|
3
|
+
tokens: {
|
|
4
|
+
def: string;
|
|
5
|
+
says: string;
|
|
6
|
+
acts: string;
|
|
7
|
+
};
|
|
8
|
+
currency: {
|
|
9
|
+
says: string;
|
|
10
|
+
};
|
|
11
|
+
collection: {
|
|
12
|
+
def: string;
|
|
13
|
+
says: string;
|
|
14
|
+
};
|
|
15
|
+
items: {
|
|
16
|
+
def: string;
|
|
17
|
+
nested: string[];
|
|
18
|
+
says: string;
|
|
19
|
+
acts: string;
|
|
20
|
+
};
|
|
21
|
+
pools: {
|
|
22
|
+
def: string;
|
|
23
|
+
says: string;
|
|
24
|
+
acts: string;
|
|
25
|
+
};
|
|
26
|
+
stashes: {
|
|
27
|
+
def: string;
|
|
28
|
+
says: string;
|
|
29
|
+
acts: string;
|
|
30
|
+
};
|
|
31
|
+
boxes: {
|
|
32
|
+
def: string;
|
|
33
|
+
nested: string[];
|
|
34
|
+
says: string;
|
|
35
|
+
acts: string;
|
|
36
|
+
};
|
|
37
|
+
payments: {
|
|
38
|
+
def: string;
|
|
39
|
+
nested: string[];
|
|
40
|
+
says: string;
|
|
41
|
+
acts: string;
|
|
42
|
+
};
|
|
43
|
+
recipes: {
|
|
44
|
+
def: string;
|
|
45
|
+
nested: string[];
|
|
46
|
+
says: string;
|
|
47
|
+
acts: string;
|
|
48
|
+
};
|
|
49
|
+
schedules: {
|
|
50
|
+
def: string;
|
|
51
|
+
says: string;
|
|
52
|
+
acts: string;
|
|
53
|
+
};
|
|
54
|
+
lotteries: {
|
|
55
|
+
def: string;
|
|
56
|
+
nested: string[];
|
|
57
|
+
says: string;
|
|
58
|
+
acts: string;
|
|
59
|
+
};
|
|
60
|
+
farms: {
|
|
61
|
+
def: string;
|
|
62
|
+
nested: string[];
|
|
63
|
+
says: string;
|
|
64
|
+
acts: string;
|
|
65
|
+
};
|
|
66
|
+
contests: {
|
|
67
|
+
def: string;
|
|
68
|
+
nested: string[];
|
|
69
|
+
says: string;
|
|
70
|
+
acts: string;
|
|
71
|
+
};
|
|
72
|
+
auctions: {
|
|
73
|
+
def: string;
|
|
74
|
+
nested: string[];
|
|
75
|
+
says: string;
|
|
76
|
+
acts: string;
|
|
77
|
+
};
|
|
78
|
+
holds: {
|
|
79
|
+
def: string;
|
|
80
|
+
says: string;
|
|
81
|
+
acts: string;
|
|
82
|
+
};
|
|
83
|
+
grants: {
|
|
84
|
+
def: string;
|
|
85
|
+
nested: string[];
|
|
86
|
+
says: string;
|
|
87
|
+
acts: string;
|
|
88
|
+
};
|
|
89
|
+
decisions: {
|
|
90
|
+
def: string;
|
|
91
|
+
says: string;
|
|
92
|
+
acts: string;
|
|
93
|
+
};
|
|
94
|
+
keys: {
|
|
95
|
+
says: string;
|
|
96
|
+
};
|
|
97
|
+
scenario: {
|
|
98
|
+
def: string;
|
|
99
|
+
says: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export declare const CONVENTIONS: string[];
|
|
103
|
+
/**
|
|
104
|
+
* What no part of loot does, and the combinations that come closest: { what, words (to match a person's own words),
|
|
105
|
+
* why, nearest: [the version, and what it gives up] }. A limit is never the end of the answer: say what is missing,
|
|
106
|
+
* then offer the nearest versions with their numbers, best first, and build the one the person picks. A feature that
|
|
107
|
+
* ships later moves its entry to HOW.
|
|
108
|
+
*/
|
|
109
|
+
export declare const CANNOT: {
|
|
110
|
+
what: string;
|
|
111
|
+
words: string;
|
|
112
|
+
why: string;
|
|
113
|
+
nearest: string[];
|
|
114
|
+
}[];
|
|
115
|
+
/**
|
|
116
|
+
* Asks that look impossible but are one field or a short combination: { what, words, how }. Shown by xsolana_examples when a
|
|
117
|
+
* person's words match.
|
|
118
|
+
*/
|
|
119
|
+
export declare const HOW: {
|
|
120
|
+
what: string;
|
|
121
|
+
words: string;
|
|
122
|
+
how: string;
|
|
123
|
+
}[];
|
|
124
|
+
/** The parts (one, or all) with their fields from the schema. */
|
|
125
|
+
export declare function catalog(only: any): {
|
|
126
|
+
part: string;
|
|
127
|
+
type: any;
|
|
128
|
+
says: string;
|
|
129
|
+
atPlayTime?: any;
|
|
130
|
+
fields: {
|
|
131
|
+
name: string;
|
|
132
|
+
type: any;
|
|
133
|
+
required?: boolean | undefined;
|
|
134
|
+
default?: any;
|
|
135
|
+
says?: any;
|
|
136
|
+
}[];
|
|
137
|
+
nested?: any;
|
|
138
|
+
}[];
|
|
139
|
+
/** The guide in words: every part (or one, with its nested shapes), the conventions and what loot cannot do. */
|
|
140
|
+
export declare function guideText(only: any): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Each legal flag's sentence, for the person who approves, by the checker's warning code. */
|
|
2
|
+
export declare const LEGAL: Readonly<{
|
|
3
|
+
'W-CHANCE-PRIZE': "Players pay for a chance at money (a box or a lottery that pays a prize, a bet on an outcome). That is gambling in many places: before real money, get a lawyer, and gate it by age and region.";
|
|
4
|
+
'W-CHANCE-ITEMS': "Players pay for random items they can resell (a loot box). Some places treat that as gambling and many require the odds shown: show them on the page, and get a lawyer before real money.";
|
|
5
|
+
'W-AUCTION-SHILL': "Anyone, the seller included, can bid to push an auction’s price up (shill bidding): a reserve is the honest way to set a floor.";
|
|
6
|
+
'W-REVENUE-SHARE': "Stakers are paid from what players spend, which regulators look at when they decide whether a token is a security: before real money, get a lawyer, or pay rewards from emissions instead.";
|
|
7
|
+
}>;
|
|
8
|
+
/** The legal flags a checker verdict raises, each once, in the order the checker raised them: [{ code, says }]. */
|
|
9
|
+
export declare const legalFlags: (verdict: any) => {
|
|
10
|
+
code: any;
|
|
11
|
+
says: any;
|
|
12
|
+
}[];
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { randomBytes } from '../chain/bytes.js';
|
|
2
|
+
/** A key for each fresh account the plan creates. Their secret halves are made by whoever signs (the page). */
|
|
3
|
+
export declare function freshAddresses(names: any, random?: typeof randomBytes): {
|
|
4
|
+
[k: string]: any;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The transactions that put `economy` live for `owner`, with `keys` the addresses of the fresh accounts (each signs
|
|
8
|
+
* the transaction that creates it). `live`: what is already live (a change publishes only what differs).
|
|
9
|
+
*/
|
|
10
|
+
export declare function prepare(economy: any, { owner, keys, live, now, rent, only }: {
|
|
11
|
+
keys: any;
|
|
12
|
+
live?: null | undefined;
|
|
13
|
+
now?: number | undefined;
|
|
14
|
+
only?: null | undefined;
|
|
15
|
+
owner: any;
|
|
16
|
+
rent: any;
|
|
17
|
+
}): {
|
|
18
|
+
ok: boolean;
|
|
19
|
+
refusals: any[];
|
|
20
|
+
warnings: any[];
|
|
21
|
+
steps?: undefined;
|
|
22
|
+
transactions?: undefined;
|
|
23
|
+
approvals?: undefined;
|
|
24
|
+
freshKeys?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
refusals?: undefined;
|
|
27
|
+
ok: boolean;
|
|
28
|
+
warnings: any[];
|
|
29
|
+
steps: any[];
|
|
30
|
+
transactions: {
|
|
31
|
+
signer: string;
|
|
32
|
+
steps: any[];
|
|
33
|
+
built: any[];
|
|
34
|
+
instructions: any;
|
|
35
|
+
signers: any[];
|
|
36
|
+
}[];
|
|
37
|
+
approvals: number;
|
|
38
|
+
freshKeys: any[];
|
|
39
|
+
} | {
|
|
40
|
+
ok: boolean;
|
|
41
|
+
refusals: any[];
|
|
42
|
+
warnings: any[];
|
|
43
|
+
steps?: undefined;
|
|
44
|
+
transactions?: undefined;
|
|
45
|
+
approvals?: undefined;
|
|
46
|
+
freshKeys?: undefined;
|
|
47
|
+
ctx: {
|
|
48
|
+
owner: any;
|
|
49
|
+
authority: any;
|
|
50
|
+
collection: any;
|
|
51
|
+
tree: any;
|
|
52
|
+
project: any;
|
|
53
|
+
treasury: any;
|
|
54
|
+
mints: {};
|
|
55
|
+
keys: any;
|
|
56
|
+
rent: any;
|
|
57
|
+
};
|
|
58
|
+
} | {
|
|
59
|
+
refusals?: undefined;
|
|
60
|
+
ok: boolean;
|
|
61
|
+
warnings: any[];
|
|
62
|
+
steps: any[];
|
|
63
|
+
transactions: {
|
|
64
|
+
signer: string;
|
|
65
|
+
steps: any[];
|
|
66
|
+
built: any[];
|
|
67
|
+
instructions: any;
|
|
68
|
+
signers: any[];
|
|
69
|
+
}[];
|
|
70
|
+
approvals: number;
|
|
71
|
+
freshKeys: any[];
|
|
72
|
+
ctx: {
|
|
73
|
+
owner: any;
|
|
74
|
+
authority: any;
|
|
75
|
+
collection: any;
|
|
76
|
+
tree: any;
|
|
77
|
+
project: any;
|
|
78
|
+
treasury: any;
|
|
79
|
+
mints: {};
|
|
80
|
+
keys: any;
|
|
81
|
+
rent: any;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The spec once its setup landed: every part keeps the program number it was given, and `live` names the game, its
|
|
86
|
+
* collection, the treasury, the mints made and the program, with a copy of what is now on chain.
|
|
87
|
+
*/
|
|
88
|
+
export declare function recordLanded(economy: any, { ctx, signatures, at, now }: {
|
|
89
|
+
at?: string | undefined;
|
|
90
|
+
ctx: any;
|
|
91
|
+
now: any;
|
|
92
|
+
signatures?: never[] | undefined;
|
|
93
|
+
}): any;
|
|
94
|
+
/**
|
|
95
|
+
* What a change to a live economy publishes: the parts that are new or differ from what is on chain (`live.published`),
|
|
96
|
+
* as the part ids setupSteps takes (`only`), and in words what cannot change. `settings`: the project's own settings
|
|
97
|
+
* the spec changes (its authority, treasury, collections), which a publish never writes.
|
|
98
|
+
*/
|
|
99
|
+
export declare function changedParts(economy: any): {
|
|
100
|
+
only: null;
|
|
101
|
+
fixed: never[];
|
|
102
|
+
removed: never[];
|
|
103
|
+
settings: never[];
|
|
104
|
+
} | {
|
|
105
|
+
only: Set<any>;
|
|
106
|
+
fixed: string[];
|
|
107
|
+
removed: string[];
|
|
108
|
+
settings: string[];
|
|
109
|
+
};
|