@xgamesfun/solana 0.0.0-stage → 0.24.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.
Files changed (138) hide show
  1. package/DISCLAIMER.md +41 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +13 -0
  4. package/README.md +172 -2
  5. package/bin/xsolana.mjs +189 -0
  6. package/examples/artwork-auction.json +51 -0
  7. package/examples/blind-forge.json +128 -0
  8. package/examples/coin-flip-arena.json +103 -0
  9. package/examples/duel-arena.json +137 -0
  10. package/examples/elements-set.json +274 -0
  11. package/examples/event-badges.json +67 -0
  12. package/examples/expedition-guild.json +154 -0
  13. package/examples/fair-presale.json +48 -0
  14. package/examples/falling-drop.json +90 -0
  15. package/examples/guild-missions.json +137 -0
  16. package/examples/halving-seasons.json +107 -0
  17. package/examples/hero-trials.json +93 -0
  18. package/examples/ideas.json +789 -0
  19. package/examples/level-ladder.json +65 -0
  20. package/examples/merge-2048.json +128 -0
  21. package/examples/nft-raffle.json +33 -0
  22. package/examples/paper-hands-farm.json +44 -0
  23. package/examples/partner-vault.json +112 -0
  24. package/examples/sacrifice-raffle.json +118 -0
  25. package/examples/scorched-treasury.json +84 -0
  26. package/examples/shelter-fair.json +164 -0
  27. package/examples/spark-pity.json +153 -0
  28. package/examples/stakers-draw.json +118 -0
  29. package/examples/star-fleet.json +150 -0
  30. package/examples/starforce.json +116 -0
  31. package/examples/stud-farm.json +134 -0
  32. package/examples/team-vesting.json +70 -0
  33. package/examples/trade-in-shop.json +168 -0
  34. package/js/approve/details.mjs +263 -0
  35. package/js/approve/ed25519.mjs +36 -0
  36. package/js/approve/live-check.mjs +144 -0
  37. package/js/approve/page.html +86 -0
  38. package/js/approve/page.js +203 -0
  39. package/js/approve/server.mjs +726 -0
  40. package/js/chain/base58.js +73 -0
  41. package/js/chain/borsh.js +270 -0
  42. package/js/chain/bytes.js +141 -0
  43. package/js/chain/core.js +181 -0
  44. package/js/chain/curve.js +52 -0
  45. package/js/chain/lookup.js +279 -0
  46. package/js/chain/mint.js +96 -0
  47. package/js/chain/pda.js +66 -0
  48. package/js/chain/programs.js +102 -0
  49. package/js/chain/rpc.js +219 -0
  50. package/js/chain/sha256.js +68 -0
  51. package/js/chain/token.js +85 -0
  52. package/js/chain/token2022.js +247 -0
  53. package/js/chain/tx.js +224 -0
  54. package/js/client/accounts.js +679 -0
  55. package/js/client/compressed.js +46 -0
  56. package/js/client/grant.js +299 -0
  57. package/js/client/idl/loot.js +2 -0
  58. package/js/client/idl/loot.json +17206 -0
  59. package/js/client/index.js +10 -0
  60. package/js/client/ix.js +2887 -0
  61. package/js/client/pda.js +114 -0
  62. package/js/client/policy.js +69 -0
  63. package/js/client/random.js +70 -0
  64. package/js/client/sizes.js +297 -0
  65. package/js/client/traits.js +44 -0
  66. package/js/connect/connect.mjs +182 -0
  67. package/js/economy/check.mjs +2236 -0
  68. package/js/economy/cost.mjs +185 -0
  69. package/js/economy/examples.mjs +114 -0
  70. package/js/economy/explain.mjs +239 -0
  71. package/js/economy/guide.mjs +232 -0
  72. package/js/economy/legal.mjs +15 -0
  73. package/js/economy/live.mjs +130 -0
  74. package/js/economy/model.mjs +698 -0
  75. package/js/economy/plan.mjs +1155 -0
  76. package/js/economy/schema.json +3071 -0
  77. package/js/economy/secrets.mjs +60 -0
  78. package/js/economy/simulate.mjs +1019 -0
  79. package/js/economy/txsize.mjs +45 -0
  80. package/js/economy/validate.mjs +85 -0
  81. package/js/index.js +10 -0
  82. package/js/mcp/server.mjs +113 -0
  83. package/js/mcp/tools.mjs +485 -0
  84. package/js/play/index.js +2855 -0
  85. package/js/play/keys.js +167 -0
  86. package/js/results/index.js +184 -0
  87. package/js/results/wire.js +90 -0
  88. package/package.json +100 -4
  89. package/release.json +8 -0
  90. package/skills/xsolana-economy/SKILL.md +109 -0
  91. package/skills/xsolana-economy/references/after-launch.md +124 -0
  92. package/skills/xsolana-economy/references/apps.md +193 -0
  93. package/skills/xsolana-economy/references/sentence-to-spec.md +180 -0
  94. package/skills/xsolana-economy/references/telling-the-person.md +134 -0
  95. package/types/chain/base58.d.ts +10 -0
  96. package/types/chain/borsh.d.ts +23 -0
  97. package/types/chain/bytes.d.ts +45 -0
  98. package/types/chain/core.d.ts +52 -0
  99. package/types/chain/curve.d.ts +1 -0
  100. package/types/chain/lookup.d.ts +194 -0
  101. package/types/chain/mint.d.ts +25 -0
  102. package/types/chain/pda.d.ts +25 -0
  103. package/types/chain/programs.d.ts +65 -0
  104. package/types/chain/rpc.d.ts +68 -0
  105. package/types/chain/sha256.d.ts +1 -0
  106. package/types/chain/token.d.ts +141 -0
  107. package/types/chain/token2022.d.ts +53 -0
  108. package/types/chain/tx.d.ts +60 -0
  109. package/types/client/accounts.d.ts +318 -0
  110. package/types/client/compressed.d.ts +29 -0
  111. package/types/client/grant.d.ts +170 -0
  112. package/types/client/idl/loot.d.ts +4498 -0
  113. package/types/client/index.d.ts +9 -0
  114. package/types/client/ix.d.ts +5315 -0
  115. package/types/client/pda.d.ts +95 -0
  116. package/types/client/policy.d.ts +48 -0
  117. package/types/client/random.d.ts +26 -0
  118. package/types/client/sizes.d.ts +101 -0
  119. package/types/client/traits.d.ts +12 -0
  120. package/types/economy/check.d.mts +100 -0
  121. package/types/economy/cost.d.mts +69 -0
  122. package/types/economy/examples.d.mts +27 -0
  123. package/types/economy/explain.d.mts +19 -0
  124. package/types/economy/guide.d.mts +140 -0
  125. package/types/economy/legal.d.mts +12 -0
  126. package/types/economy/live.d.mts +124 -0
  127. package/types/economy/model.d.mts +431 -0
  128. package/types/economy/plan.d.mts +1014 -0
  129. package/types/economy/secrets.d.mts +4 -0
  130. package/types/economy/simulate.d.mts +164 -0
  131. package/types/economy/txsize.d.mts +17 -0
  132. package/types/economy/validate.d.mts +3 -0
  133. package/types/index.d.ts +9 -0
  134. package/types/mcp/tools.d.mts +635 -0
  135. package/types/play/index.d.ts +880 -0
  136. package/types/play/keys.d.ts +51 -0
  137. package/types/results/index.d.ts +155 -0
  138. package/types/results/wire.d.ts +122 -0
@@ -0,0 +1,4 @@
1
+ /** Whether a string looks like it carries a key, a token or a keyed RPC URL. */
2
+ export declare const secretLike: (value: any) => boolean;
3
+ /** Every place in `value` that looks like a key, a seed phrase or a keypair file. */
4
+ export declare function findSecrets(value: any, path?: string): any;
@@ -0,0 +1,164 @@
1
+ export declare const round: (x: any, digits?: number) => any;
2
+ /** A budget of sales to walk, shared by every salePrices call of one simulation. */
3
+ export declare const walkBudget: () => {
4
+ left: number;
5
+ };
6
+ /**
7
+ * What `perDay` sales a day over `days` pay, one every 1/perDay of a day (the first half a gap in), with the part's
8
+ * rise and fall exactly as the program prices them (state.rs `Fall::sell`): each sale pays the price fallen since the
9
+ * later of the fall's start and the last sale, and the price after it is what was paid plus the rise. A price that stops
10
+ * moving (at its cap, or at its floor with no rise) is counted at that price for every sale after; a rise by a fixed step
11
+ * alone (no percent, no fall) is an arithmetic series, summed at once. Every other sale walked comes out of `budget`
12
+ * (one a simulation, shared by its calls), and the walk throws once it runs out. { count, average, first, last }, in
13
+ * whole units.
14
+ */
15
+ export declare function salePrices(part: any, perDay: any, days: any, fallStartsAfter?: number, budget?: {
16
+ left: number;
17
+ }): {
18
+ count: number;
19
+ average: number;
20
+ first: number | undefined;
21
+ last: number;
22
+ };
23
+ export declare function simulate(economy: any, { now }?: {
24
+ now?: number | undefined;
25
+ }): {
26
+ scenario: {
27
+ days: any;
28
+ perDay: any;
29
+ defaultPerDay: number;
30
+ defaultBidsPerDay: number;
31
+ defaultClaimsPerDay: number;
32
+ };
33
+ boxes: {
34
+ key: any;
35
+ name: any;
36
+ price: number;
37
+ averagePrice?: any;
38
+ token: any;
39
+ opensPerDay: number;
40
+ outcomes: any;
41
+ expectedBack: any;
42
+ returnPercent: any;
43
+ houseEdgePercent: any;
44
+ alsoPays: {};
45
+ unpriced: any[];
46
+ playerFee: number;
47
+ oracleFee: number;
48
+ realCost: {
49
+ price: any;
50
+ token: any;
51
+ atLeast?: boolean | undefined;
52
+ priceBack?: boolean | undefined;
53
+ playerFeeSol: number;
54
+ oracleSol: number;
55
+ networkSol: any;
56
+ rentSol: any;
57
+ rentIs?: string | undefined;
58
+ heldSol?: any;
59
+ heldIs?: string | undefined;
60
+ extrasSol: any;
61
+ totalSol?: any;
62
+ holdSol: any;
63
+ };
64
+ limitedStock?: boolean | undefined;
65
+ whenOut?: string | undefined;
66
+ stock?: {
67
+ whenOut: string;
68
+ stopsSellingInDays: any;
69
+ by: any;
70
+ } | {
71
+ by?: undefined;
72
+ whenOut: string;
73
+ runsOut: {
74
+ inDays: any;
75
+ outcomes: any;
76
+ chancesAfter: any;
77
+ }[];
78
+ stopsSellingInDays?: any;
79
+ } | undefined;
80
+ returnOfRealCostPercent?: any;
81
+ }[];
82
+ items: any;
83
+ payments: any;
84
+ recipes: any;
85
+ schedules: any;
86
+ lotteries: any;
87
+ farms: any;
88
+ grants: any;
89
+ contests: any;
90
+ auctions: any;
91
+ stashes: any;
92
+ pools: {
93
+ key: any;
94
+ pot?: any;
95
+ farm?: any;
96
+ token: any;
97
+ seed: any;
98
+ inPerDay: any;
99
+ outPerDay: any;
100
+ ins: any;
101
+ outs: any[];
102
+ }[];
103
+ perDay: {
104
+ players: {
105
+ pay: {
106
+ [k: string]: any;
107
+ };
108
+ getBack: {
109
+ [k: string]: any;
110
+ };
111
+ playerFeesSol: any;
112
+ oracleFeesSol: any;
113
+ networkFeesSol: any;
114
+ rentSol: any;
115
+ };
116
+ creator: {
117
+ treasury: {
118
+ [k: string]: any;
119
+ };
120
+ projectFeesSol: any;
121
+ oracleFeesSol: any;
122
+ networkFeesSol: any;
123
+ grantRentSol: any;
124
+ };
125
+ oracle: {
126
+ totalSol: any;
127
+ };
128
+ platform: {
129
+ playerFeesSol: any;
130
+ projectFeesSol: any;
131
+ totalSol: any;
132
+ };
133
+ burned: {
134
+ [k: string]: any;
135
+ };
136
+ accounts: {
137
+ [k: string]: any;
138
+ };
139
+ };
140
+ fees: {
141
+ playerSol: number;
142
+ projectSol: number;
143
+ oracleSol: number;
144
+ networkPerSignatureSol: number;
145
+ settleRentUnitSol: number;
146
+ ticketLineRentSol: any;
147
+ collectibleRentSol: number;
148
+ burnRefundSol: number;
149
+ };
150
+ notes: string[];
151
+ };
152
+ /** What the scenario doesn't name and doesn't count at its default, in words: ["grant claims none", "auction bids 10 a day"]. */
153
+ export declare function unnamedExceptions(sim: any): any[];
154
+ /** What the scenario assumes for what it doesn't name, in words: "100 a day (grant claims none, auction bids 10 a day)". */
155
+ export declare function unnamedWords(sim: any): string;
156
+ /** What becomes of a pool (a row of `simulate`'s pools) over the scenario's `days`, in words: "settles at about 40". */
157
+ export declare function poolFate(p: any, days: any): string;
158
+ /**
159
+ * A player's real cost of one action in words: the one number to quote. "about 0.0071 SOL in all (the price, the
160
+ * player fee, …); the wallet needs 0.0151 SOL when it signs, and the rest comes back".
161
+ */
162
+ export declare function inAll(c: any): string;
163
+ /** The simulation in plain words. */
164
+ export declare function explain(sim: any, economy: any): string;
@@ -0,0 +1,17 @@
1
+ export declare const MAX_TRANSACTION_BYTES = 1232;
2
+ export declare const WALLET_ROOM = 64;
3
+ export declare const BUDGET: number;
4
+ export declare const compact: (n: any) => 1 | 2 | 3;
5
+ /**
6
+ * instructions: [{ program: name, accounts: [names], data: bytes }]; signers: [names] (the fee payer first).
7
+ * Returns the estimated wire size in bytes.
8
+ */
9
+ export declare function transactionSize({ instructions, signers }: {
10
+ instructions: any;
11
+ signers: any;
12
+ }): any;
13
+ /** How many accounts the transaction locks: each account once, its programs and signers included. */
14
+ export declare function transactionLocks({ instructions, signers }: {
15
+ instructions: any;
16
+ signers: any;
17
+ }): number;
@@ -0,0 +1,3 @@
1
+ export declare const SCHEMA: any;
2
+ /** Every way `value` breaks `schema`, as { path, message }. An empty list means it is valid. */
3
+ export declare function validate(value: any, schema?: any, root?: any, path?: string): any;
@@ -0,0 +1,9 @@
1
+ export { check, describe } from './economy/check.mjs';
2
+ export { simulate, explain } from './economy/simulate.mjs';
3
+ export { plan, setupSteps, playSteps } from './economy/plan.mjs';
4
+ export { cost, explainCost } from './economy/cost.mjs';
5
+ export { explainEconomy } from './economy/explain.mjs';
6
+ export { model } from './economy/model.mjs';
7
+ export { prepare, recordLanded, changedParts } from './economy/live.mjs';
8
+ export { guideText, catalog, CANNOT } from './economy/guide.mjs';
9
+ export { tools, PROGRAM_INFO, VERSION } from './mcp/tools.mjs';